~ubuntu-branches/debian/stretch/psi-plus/stretch

« back to all changes in this revision

Viewing changes to src/options/opt_plugins.cpp

  • Committer: Package Import Robot
  • Author(s): Boris Pek
  • Date: 2013-10-23 02:42:20 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20131023024220-bk2hyoenqkwfhpgw
Tags: 0.16.242-1
* New upstream release:
  fixed the problem of initialization of private conversation when both
  sides use libotr 4.0.x. (Closes: #724880)
* Update debian/watch: sources were moved.
* Delete psi-plus-content-downloader package and update all related files.
  This plugin is in psi-plus-plugins package now.
* Update debian/control:
  - remove all currently unneeded Replaces and Breaks fields
  - add build dependency on libidn11-dev
* Update debian/rules: simplify get-orig-source section.
* Update debian/copyright:
  - update Source field due to changes in sources location
  - remove copyright holders whose code was deleted from source tree
    (bundled libidn library was removed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        OptPluginsUI *d = (OptPluginsUI *)w;
45
45
 
46
46
        d->pb_info->setIcon(QIcon(IconsetFactory::iconPixmap("psi/info")));
 
47
        d->cb_plugins->setMaxVisibleItems(50);
47
48
        d->cb_loadPlugin->setProperty("isOption", false);
48
49
 
49
50
        listPlugins();
51
52
        connect(d->cb_plugins,SIGNAL(currentIndexChanged(int)),SLOT(pluginSelected(int)));
52
53
        connect(d->cb_loadPlugin,SIGNAL(clicked(bool)),SLOT(loadToggled(bool)));
53
54
        connect(d->pb_info, SIGNAL(clicked()), SLOT(showPluginInfo()));
54
 
        
 
55
 
55
56
        return w;
56
57
}
57
58
 
93
94
        OptPluginsUI *d = (OptPluginsUI *)w;
94
95
 
95
96
        d->cb_plugins->clear();
96
 
        
 
97
 
97
98
        PluginManager *pm=PluginManager::instance();
98
 
        
 
99
 
99
100
        QStringList plugins = pm->availablePlugins();
100
101
        plugins.sort();
101
102
        foreach (const QString& plugin, plugins){
102
 
                d->cb_plugins->addItem(plugin);
 
103
                QIcon icon = pm->icon(plugin);
 
104
 
 
105
                if (!pm->isEnabled(plugin)) {
 
106
                        icon = QIcon(icon.pixmap(icon.availableSizes().at(0), QIcon::Disabled));
 
107
                }
 
108
                d->cb_plugins->addItem(icon, plugin);
103
109
        }
104
110
        pluginSelected(0);
105
111
}
108
114
{
109
115
        if ( !w )
110
116
                return;
111
 
        
 
117
 
112
118
        OptPluginsUI *d = (OptPluginsUI *)w;
113
 
        
 
119
 
 
120
        PluginManager *pm = PluginManager::instance();
 
121
        QString name = d->cb_plugins->currentText();
 
122
 
114
123
        QString option=QString("%1.%2")
115
124
                .arg(PluginManager::loadOptionPrefix)
116
 
                .arg(PluginManager::instance()->shortName(d->cb_plugins->currentText())); 
 
125
                .arg(pm->shortName(name));
117
126
        PsiOptions::instance()->setOption(option, state);
118
127
 
119
128
        pluginSelected(0);
 
129
 
 
130
        QIcon icon = pm->icon(name);
 
131
        if (!pm->isEnabled(name)) {
 
132
                icon = QIcon(icon.pixmap(icon.availableSizes().at(0), QIcon::Disabled));
 
133
        }
 
134
 
 
135
        d->cb_plugins->setItemIcon(d->cb_plugins->currentIndex(), icon);
 
136
 
120
137
}
121
138
 
122
139
void OptionsTabPlugins::pluginSelected(int index)
124
141
        Q_UNUSED(index);
125
142
        if ( !w )
126
143
                return;
127
 
        
 
144
 
128
145
        OptPluginsUI *d = (OptPluginsUI *)w;
129
146
        d->le_location->setText(tr("No plugin selected."));
130
147
        d->cb_loadPlugin->setEnabled(false);