~ubuntu-branches/ubuntu/lucid/ktorrent/lucid

« back to all changes in this revision

Viewing changes to plugins/infowidget/webseedstab.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-12-08 19:17:41 UTC
  • mfrom: (1.2.1 upstream) (0.7.12 sid)
  • Revision ID: james.westby@ubuntu.com-20091208191741-lqlq0xvnlv8ki19u
Tags: 3.3.1+dfsg.1-1ubuntu1
* Merge with Debian Testing remaining changes:
  - Build-depend directly on libboost-serialization1.40-dev since
    libboost-serialization-dev from boost-defaults is not in Main
  - Add in rules: include /usr/lib/kubuntu-desktop-i18n/debhelper/kubuntu.mk
  - Don't use dpkg-source 3.0 format
  - Add quilt to build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                setupUi(this);
37
37
                connect(m_add,SIGNAL(clicked()),this,SLOT(addWebSeed()));
38
38
                connect(m_remove,SIGNAL(clicked()),this,SLOT(removeWebSeed()));
 
39
                connect(m_disable_all,SIGNAL(clicked()),this,SLOT(disableAll()));
 
40
                connect(m_enable_all,SIGNAL(clicked()),this,SLOT(enableAll()));
39
41
                m_add->setIcon(KIcon("list-add"));
40
42
                m_remove->setIcon(KIcon("list-remove"));
41
43
                m_add->setEnabled(false);
67
69
                m_remove->setEnabled(curr_tc != 0);
68
70
                m_webseed_list->setEnabled(curr_tc != 0);
69
71
                m_webseed->setEnabled(curr_tc != 0);
 
72
                m_enable_all->setEnabled(curr_tc != 0);
 
73
                m_disable_all->setEnabled(curr_tc != 0);
70
74
                onWebSeedTextChanged(m_webseed->text());
71
75
                
72
76
                // see if we need to enable or disable the remove button
115
119
        
116
120
        void WebSeedsTab::selectionChanged(const QModelIndexList & indexes)
117
121
        {
118
 
                foreach (const QModelIndex &idx, indexes)
 
122
                foreach (const QModelIndex & idx, indexes)
119
123
                {
120
124
                        const WebSeedInterface* ws = curr_tc->getWebSeed(proxy_model->mapToSource(idx).row());
121
125
                        if (ws && ws->isUserCreated())
163
167
                if (!s.isNull())
164
168
                        m_webseed_list->header()->restoreState(s);
165
169
        }
 
170
        
 
171
        void WebSeedsTab::disableAll() 
 
172
        {
 
173
                for (int i = 0;i < model->rowCount();i++)
 
174
                {
 
175
                        model->setData(model->index(i,0),Qt::Unchecked,Qt::CheckStateRole);
 
176
                }
 
177
        }
 
178
        
 
179
        void WebSeedsTab::enableAll() 
 
180
        {
 
181
                for (int i = 0;i < model->rowCount();i++)
 
182
                {
 
183
                        model->setData(model->index(i,0),Qt::Checked,Qt::CheckStateRole);
 
184
                }
 
185
        }
 
186
 
166
187
}