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

« back to all changes in this revision

Viewing changes to src/plugins/generic/extendedoptionsplugin/extendedoptionsplugin.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:
18
18
 *
19
19
 */
20
20
 
21
 
#include <QtGui>
 
21
#include <QSpinBox>
 
22
#include <QCheckBox>
 
23
#include <QLineEdit>
 
24
#include <QComboBox>
 
25
#include <QTextList>
 
26
#include <QToolButton>
 
27
#include <QScrollArea>
 
28
#include <QVBoxLayout>
 
29
#include <QTextEdit>
 
30
#include <QGroupBox>
 
31
#include <QLabel>
 
32
#include <QButtonGroup>
 
33
#include <QColorDialog>
22
34
 
23
35
#include "psiplugin.h"
24
36
#include "optionaccessor.h"
28
40
#include "plugininfoprovider.h"
29
41
 
30
42
 
31
 
#define constVersion "0.3.7"
 
43
#define constVersion "0.3.9"
32
44
 
33
45
class ExtToolButton : public QToolButton
34
46
{
43
55
 
44
56
class ExtendedOptions : public QObject, public PsiPlugin, public OptionAccessor, public ApplicationInfoAccessor, public PluginInfoProvider
45
57
{
46
 
        Q_OBJECT
 
58
        Q_OBJECT
 
59
#ifdef HAVE_QT5
 
60
        Q_PLUGIN_METADATA(IID "com.psi-plus.ExtendedOptions")
 
61
#endif
47
62
        Q_INTERFACES(PsiPlugin OptionAccessor ApplicationInfoAccessor PluginInfoProvider)
 
63
 
48
64
public:
49
 
                        ExtendedOptions();
50
 
        virtual QString name() const;
51
 
        virtual QString shortName() const;
52
 
        virtual QString version() const;
53
 
        virtual QWidget* options();
54
 
        virtual bool enable();
55
 
        virtual bool disable();
56
 
        virtual void optionChanged(const QString& option);
57
 
        virtual void applyOptions();
58
 
        virtual void restoreOptions();
59
 
        virtual void setOptionAccessingHost(OptionAccessingHost* host);
60
 
        virtual void setApplicationInfoAccessingHost(ApplicationInfoAccessingHost* host);
 
65
        ExtendedOptions();
 
66
        virtual QString name() const;
 
67
        virtual QString shortName() const;
 
68
        virtual QString version() const;
 
69
        virtual QWidget* options();
 
70
        virtual bool enable();
 
71
        virtual bool disable();
 
72
        virtual void optionChanged(const QString& option);
 
73
        virtual void applyOptions();
 
74
        virtual void restoreOptions();
 
75
        virtual void setOptionAccessingHost(OptionAccessingHost* host);
 
76
        virtual void setApplicationInfoAccessingHost(ApplicationInfoAccessingHost* host);
61
77
        virtual QString pluginInfo();
 
78
        virtual QPixmap icon() const;
62
79
 
63
80
private slots:
64
 
        void chooseColor(QAbstractButton*);
 
81
        void chooseColor(QAbstractButton*);
65
82
        void hack();
66
83
 
67
84
private:
68
 
        OptionAccessingHost *psiOptions;
69
 
        ApplicationInfoAccessingHost* appInfo;
 
85
        OptionAccessingHost *psiOptions;
 
86
        ApplicationInfoAccessingHost* appInfo;
70
87
        bool enabled;
71
 
        QString readFile();
 
88
        QString readFile();
72
89
        void saveFile(const QString& text);
73
 
        QString profileDir();
 
90
        QString profileDir();
74
91
        QPointer<QWidget> options_;
75
92
 
76
 
        //Chats-----
77
 
       // QCheckBox *htmlRender;
78
 
        QCheckBox *centralToolbar;
79
 
        QCheckBox *confirmClearing;
80
 
        QCheckBox *messageIcons;
81
 
        //QCheckBox *altnSwitch;        
82
 
        QCheckBox *showAvatar;
83
 
        QSpinBox *avatarSize;
84
 
        QCheckBox *disablePastSend;
85
 
        QCheckBox *sayMode;
 
93
        //Chats-----
 
94
        // QCheckBox *htmlRender;
 
95
        QCheckBox *confirmClearing;
 
96
        QCheckBox *messageIcons;
 
97
        //QCheckBox *altnSwitch;
 
98
        QCheckBox *showAvatar;
 
99
        QSpinBox *avatarSize;
 
100
        QCheckBox *sayMode;
86
101
        QCheckBox *disableSend;
87
102
        QCheckBox *auto_capitalize;
88
103
        QCheckBox *auto_scroll_to_bottom;
94
109
        QCheckBox *scaledIcons;
95
110
 
96
111
 
97
 
        //MUC-----
98
 
        QCheckBox *showJoins;
99
 
        QCheckBox *showRole;
100
 
        QCheckBox *showStatus;
101
 
        QCheckBox *leftMucRoster;
102
 
        QCheckBox *showGroups;
103
 
        QCheckBox *showAffIcons;
104
 
        QCheckBox *skipAutojoin;
105
 
        QTextEdit *bookmarksListSkip;
106
 
        QCheckBox *mucClientIcons;
 
112
        //MUC-----
 
113
        QCheckBox *showJoins;
 
114
        QCheckBox *showRole;
 
115
        QCheckBox *showStatus;
 
116
        QCheckBox *leftMucRoster;
 
117
        QCheckBox *showGroups;
 
118
        QCheckBox *showAffIcons;
 
119
        QCheckBox *skipAutojoin;
 
120
        QTextEdit *bookmarksListSkip;
 
121
        QCheckBox *mucClientIcons;
107
122
        //QCheckBox *rosterNickColors;
108
123
        QCheckBox *mucHtml;
109
124
        QCheckBox *hideAutoJoin;
120
135
        QCheckBox *accept_defaults;
121
136
        QCheckBox *auto_configure;
122
137
 
123
 
        //Roster
124
 
        QCheckBox *resolveNicks;
125
 
        QCheckBox *lockRoster;
126
 
        QCheckBox *leftRoster;
127
 
        QCheckBox *singleLineStatus;
128
 
        QCheckBox *avatarTip;
129
 
        QCheckBox *statusTip;
130
 
        QCheckBox *geoTip;
131
 
        QCheckBox *pgpTip;
132
 
        QCheckBox *clientTip;
133
 
        QComboBox *sortContacts;
 
138
        //Roster
 
139
        QCheckBox *resolveNicks;
 
140
        QCheckBox *lockRoster;
 
141
        QCheckBox *leftRoster;
 
142
        QCheckBox *singleLineStatus;
 
143
        QCheckBox *avatarTip;
 
144
        QCheckBox *statusTip;
 
145
        QCheckBox *geoTip;
 
146
        QCheckBox *pgpTip;
 
147
        QCheckBox *clientTip;
 
148
        QComboBox *sortContacts;
134
149
        // QComboBox *sortGroups;
135
150
        // QComboBox *sortAccs;
136
 
        QCheckBox *leftAvatars;
137
 
        QCheckBox *defaultAvatar;
138
 
        QCheckBox *showStatusIcons;
139
 
        QCheckBox *statusIconsOverAvatars;
 
151
        QCheckBox *leftAvatars;
 
152
        QCheckBox *defaultAvatar;
 
153
        QCheckBox *showStatusIcons;
 
154
        QCheckBox *statusIconsOverAvatars;
140
155
        QCheckBox *auto_delete_unlisted;
141
156
 
142
 
        //Menu------
143
 
        QCheckBox *admin;
144
 
        QCheckBox *activeChats;
145
 
        QCheckBox *pgpKey;
146
 
        QCheckBox *picture;
147
 
        QCheckBox *changeProfile;
148
 
        QCheckBox *chat;
149
 
        QCheckBox *invis;
150
 
        QCheckBox *xa;
 
157
        //Menu------
 
158
        QCheckBox *admin;
 
159
        QCheckBox *activeChats;
 
160
        QCheckBox *pgpKey;
 
161
        QCheckBox *picture;
 
162
        QCheckBox *changeProfile;
 
163
        QCheckBox *chat;
 
164
        QCheckBox *invis;
 
165
        QCheckBox *xa;
151
166
        QCheckBox *enableMessages;
152
167
 
153
168
 
154
 
        //Look-----
155
 
        QToolButton *popupBorder;
156
 
        QToolButton *linkColor;
157
 
        QToolButton *mailtoColor;
158
 
        QToolButton *moderColor;
159
 
        QToolButton *visitorColor;
160
 
        QToolButton *parcColor;
161
 
        QToolButton *noroleColor;
162
 
        QToolButton *tipText;
163
 
        QToolButton *tipBase;
 
169
        //Look-----
 
170
        QToolButton *popupBorder;
 
171
        QToolButton *linkColor;
 
172
        QToolButton *mailtoColor;
 
173
        QToolButton *moderColor;
 
174
        QToolButton *visitorColor;
 
175
        QToolButton *parcColor;
 
176
        QToolButton *noroleColor;
 
177
        QToolButton *tipText;
 
178
        QToolButton *tipBase;
164
179
        QToolButton *composingBut;
165
180
        QToolButton *unreadBut;
166
181
        QGroupBox *groupTip;
167
182
        QGroupBox *groupMucRoster;
168
183
 
169
 
        //CSS----------------
170
 
        QTextEdit *chatCss;
171
 
        QTextEdit *rosterCss;
172
 
        QTextEdit *popupCss;
173
 
        QTextEdit *tooltipCss;
 
184
        //CSS----------------
 
185
        QTextEdit *chatCss;
 
186
        QTextEdit *rosterCss;
 
187
        QTextEdit *popupCss;
 
188
        QTextEdit *tooltipCss;
174
189
 
175
190
        //Tabs----------------
176
191
        QCheckBox *disableScroll;
192
207
        QCheckBox *popupsSuppressAway;
193
208
};
194
209
 
 
210
#ifndef HAVE_QT5
195
211
Q_EXPORT_PLUGIN(ExtendedOptions)
 
212
#endif
196
213
 
197
214
ExtendedOptions::ExtendedOptions()
198
215
        : psiOptions(0)
203
220
 
204
221
QString ExtendedOptions::name() const
205
222
{
206
 
        return "Extended Options Plugin";
 
223
        return "Extended Options Plugin";
207
224
}
208
225
 
209
226
QString ExtendedOptions::shortName() const
210
227
{
211
 
        return "extopt";
 
228
        return "extopt";
212
229
}
213
230
 
214
231
QString ExtendedOptions::version() const
215
232
{
216
 
        return constVersion;
 
233
        return constVersion;
217
234
}
218
235
 
219
236
bool ExtendedOptions::enable()
227
244
bool ExtendedOptions::disable()
228
245
{
229
246
        enabled = false;
230
 
        return true;
 
247
        return true;
231
248
}
232
249
 
233
250
QWidget* ExtendedOptions::options()
234
251
{
235
 
        if (!enabled) {
 
252
        if (!enabled) {
236
253
                return 0;
237
254
        }
238
255
 
239
256
        options_ = new QWidget;
240
257
        QVBoxLayout *mainLayout = new QVBoxLayout(options_);
241
258
        QScrollArea* area = new QScrollArea;
242
 
        QTabWidget *tabs = new QTabWidget;
 
259
        QTabWidget *tabs = new QTabWidget;
243
260
        QWidget *tab1 = new QWidget;
244
 
        QWidget *tab2 = new QWidget;
245
 
        QWidget *tab3 = new QWidget;
246
 
        QWidget *tab4 = new QWidget;
 
261
        QWidget *tab2 = new QWidget;
 
262
        QWidget *tab3 = new QWidget;
 
263
        QWidget *tab4 = new QWidget;
247
264
        QWidget *tab5 = new QWidget;
248
 
        QWidget *tab6 = new QWidget;
249
 
        QWidget *tab7 = new QWidget;
 
265
        QWidget *tab6 = new QWidget;
 
266
        QWidget *tab7 = new QWidget;
250
267
        QWidget *tab8 = new QWidget;
251
 
        QVBoxLayout *tab1Layout = new QVBoxLayout(tab1);
252
 
        QVBoxLayout *tab2Layout = new QVBoxLayout(tab2);
253
 
        QVBoxLayout *tab3Layout = new QVBoxLayout(tab3);
254
 
        QVBoxLayout *tab4Layout = new QVBoxLayout(tab4);
 
268
        QVBoxLayout *tab1Layout = new QVBoxLayout(tab1);
 
269
        QVBoxLayout *tab2Layout = new QVBoxLayout(tab2);
 
270
        QVBoxLayout *tab3Layout = new QVBoxLayout(tab3);
 
271
        QVBoxLayout *tab4Layout = new QVBoxLayout(tab4);
255
272
        QVBoxLayout *tab5Layout = new QVBoxLayout(tab5);
256
 
        QVBoxLayout *tab6Layout = new QVBoxLayout(tab6);
257
 
        QVBoxLayout *tab7Layout = new QVBoxLayout(tab7);
 
273
        QVBoxLayout *tab6Layout = new QVBoxLayout(tab6);
 
274
        QVBoxLayout *tab7Layout = new QVBoxLayout(tab7);
258
275
        QVBoxLayout *tab8Layout = new QVBoxLayout(tab8);
259
 
        tabs->addTab(tab1, tr("Chat"));
260
 
        tabs->addTab(tab2, tr("Conference"));
 
276
        tabs->addTab(tab1, tr("Chat"));
 
277
        tabs->addTab(tab2, tr("Groupchat"));
261
278
        tabs->addTab(tab5, tr("Tabs"));
262
 
        tabs->addTab(tab3, tr("Roster"));
263
 
        tabs->addTab(tab4, tr("Menu"));
264
 
        tabs->addTab(tab6, tr("Look"));
265
 
        tabs->addTab(tab7, tr("CSS"));
 
279
        tabs->addTab(tab3, tr("Roster"));
 
280
        tabs->addTab(tab4, tr("Menu"));
 
281
        tabs->addTab(tab6, tr("Look"));
 
282
        tabs->addTab(tab7, tr("CSS"));
266
283
        tabs->addTab(tab8, tr("Misc"));
267
284
 
268
285
        area->setWidget(tabs);
269
286
        area->setWidgetResizable(true);
270
287
 
271
 
        //Chats-----
272
 
      //  htmlRender = new QCheckBox(tr("Enable HTML rendering in chat window"));
273
 
        centralToolbar = new QCheckBox(tr("Enable central toolbar"));
274
 
        confirmClearing = new QCheckBox(tr("Ask for confirmation before clearing chat window"));
275
 
        messageIcons = new QCheckBox(tr("Enable icons in chat"));
 
288
        //Chats-----
 
289
        //      htmlRender = new QCheckBox(tr("Enable HTML rendering in chat window"));
 
290
        confirmClearing = new QCheckBox(tr("Ask for confirmation before clearing chat window"));
 
291
        messageIcons = new QCheckBox(tr("Enable icons in chat"));
276
292
        scaledIcons = new QCheckBox(tr("Scaled message icons"));
277
293
 
278
294
        /* altnSwitch = new QCheckBox(tr("Switch tabs with \"ALT+(1-9)\""));
279
 
        altnSwitch->setChecked(psiOptions->getGlobalOption("options.ui.tabs.alt-n-switch").toBool());*/
280
 
        showAvatar = new QCheckBox(tr("Show Avatar"));
281
 
        disablePastSend = new QCheckBox(tr("Disable \"Paste and Send\" button"));
282
 
        sayMode = new QCheckBox(tr("Enable \"Says style\""));
283
 
        disableSend = new QCheckBox(tr("Hide \"Send\" button"));        
 
295
           altnSwitch->setChecked(psiOptions->getGlobalOption("options.ui.tabs.alt-n-switch").toBool());*/
 
296
        showAvatar = new QCheckBox(tr("Show Avatar"));
 
297
        sayMode = new QCheckBox(tr("Enable \"Says style\""));
 
298
        disableSend = new QCheckBox(tr("Hide \"Send\" button"));
284
299
 
285
300
        avatarSize = new QSpinBox;
286
301
        QGridLayout *chatGridLayout = new QGridLayout;
305
320
 
306
321
        tab1Layout->addWidget(new QLabel(tr("Chat window caption:")));
307
322
        tab1Layout->addWidget(chat_caption);
308
 
       // tab1Layout->addWidget(htmlRender);
309
 
        tab1Layout->addWidget(centralToolbar);
310
 
        tab1Layout->addWidget(confirmClearing);
311
 
        tab1Layout->addWidget(messageIcons);
 
323
        // tab1Layout->addWidget(htmlRender);
 
324
        tab1Layout->addWidget(confirmClearing);
 
325
        tab1Layout->addWidget(messageIcons);
312
326
        tab1Layout->addWidget(scaledIcons);
313
 
        //tab1Layout->addWidget(altnSwitch);
314
 
        tab1Layout->addWidget(disablePastSend);
 
327
        //tab1Layout->addWidget(altnSwitch);
315
328
        tab1Layout->addWidget(disableSend);
316
 
        tab1Layout->addWidget(sayMode);
 
329
        tab1Layout->addWidget(sayMode);
317
330
        tab1Layout->addWidget(showAvatar);
318
331
        tab1Layout->addLayout(chatGridLayout);
319
332
        tab1Layout->addWidget(new QLabel(tr("Default JID mode ignore list:")));
322
335
        tab1Layout->addWidget(auto_scroll_to_bottom);
323
336
        tab1Layout->addWidget(show_status_changes);
324
337
        tab1Layout->addWidget(chat_status_with_priority);
325
 
        tab1Layout->addStretch();
326
 
 
327
 
 
328
 
 
329
 
 
330
 
        //MUC-----
 
338
        tab1Layout->addStretch();
 
339
 
 
340
 
 
341
 
 
342
 
 
343
        //MUC-----
331
344
        QTabWidget *mucTabWidget = new QTabWidget;
332
345
        QWidget *mucGeneralWidget = new QWidget;
333
346
        QWidget *mucRosterWidget = new QWidget;
337
350
        mucTabWidget->addTab(mucRosterWidget, tr("Roster"));
338
351
 
339
352
 
340
 
        showJoins = new QCheckBox(tr("Show joins"));
 
353
        showJoins = new QCheckBox(tr("Show joins"));
341
354
        show_initial_joins = new QCheckBox(tr("Show initial joins"));
342
355
        status_with_priority = new QCheckBox(tr("Show status with priority"));
343
356
        showRole = new QCheckBox(tr("Show roles and affiliations changes"));
344
 
        showStatus = new QCheckBox(tr("Show status changes"));
345
 
        skipAutojoin = new QCheckBox(tr("Enable autojoin for bookmarked conferences"));
346
 
        hideAutoJoin = new QCheckBox(tr("Hide conference on auto-join"));
347
 
        mucHtml = new QCheckBox(tr("Enable HTML rendering in MUC chat window"));
 
357
        showStatus = new QCheckBox(tr("Show status changes"));
 
358
        skipAutojoin = new QCheckBox(tr("Enable autojoin for bookmarked groupchats"));
 
359
        hideAutoJoin = new QCheckBox(tr("Hide groupchat on auto-join"));
 
360
        mucHtml = new QCheckBox(tr("Enable HTML rendering in groupchat chat window"));
348
361
 
349
362
        muc_leave_status_message = new QLineEdit;
350
363
        accept_defaults = new QCheckBox(tr("Automatically accept the default room configuration"));
351
364
        accept_defaults->setToolTip(tr("Automatically accept the default room configuration when a new room is created"));
352
365
        auto_configure = new QCheckBox(tr("Automatically open the configuration dialog when a new room is created"));
353
366
        auto_configure->setToolTip(tr("Automatically open the configuration dialog when a new room is created.\n"
354
 
                                   "This option only has effect if accept-defaults is false."));
 
367
                                                                  "This option only has effect if accept-defaults is false."));
355
368
 
356
 
        bookmarksListSkip = new QTextEdit();
357
 
        bookmarksListSkip->setMaximumWidth(300);
358
 
        bookmarksListSkip->setPlainText(readFile());
 
369
        bookmarksListSkip = new QTextEdit();
 
370
        bookmarksListSkip->setMaximumWidth(300);
 
371
        bookmarksListSkip->setPlainText(readFile());
359
372
 
360
373
        mucGeneralLayout->addWidget(accept_defaults);
361
374
        mucGeneralLayout->addWidget(auto_configure);
367
380
        mucGeneralLayout->addWidget(status_with_priority);
368
381
        mucGeneralLayout->addWidget(skipAutojoin);
369
382
        mucGeneralLayout->addWidget(hideAutoJoin);
370
 
        mucGeneralLayout->addWidget(new QLabel(tr("Disable autojoin to folowing conferences:\n(specify JIDs)")));
 
383
        mucGeneralLayout->addWidget(new QLabel(tr("Disable autojoin to folowing groupchats:\n(specify JIDs)")));
371
384
        mucGeneralLayout->addWidget(bookmarksListSkip);
372
 
        mucGeneralLayout->addWidget(new QLabel(tr("MUC leave status message:")));
 
385
        mucGeneralLayout->addWidget(new QLabel(tr("Groupchat leave status message:")));
373
386
        mucGeneralLayout->addWidget(muc_leave_status_message);
374
387
        mucGeneralLayout->addStretch();
375
388
 
376
389
 
377
 
        leftMucRoster = new QCheckBox(tr("Place MUC roster at left"));
 
390
        leftMucRoster = new QCheckBox(tr("Place groupchat roster at left"));
378
391
        showGroups = new QCheckBox(tr("Show groups"));
379
392
        use_slim_group_headings = new QCheckBox(tr("Use slim group heading"));
380
393
        show_status_icons = new QCheckBox(tr("Show status icons"));
381
394
        showAffIcons = new QCheckBox(tr("Show affiliation icons"));
382
395
        mucClientIcons = new QCheckBox(tr("Show client icons"));
383
 
//      rosterNickColors = new QCheckBox(tr("Enable nick coloring"));
 
396
        //      rosterNickColors = new QCheckBox(tr("Enable nick coloring"));
384
397
        avatars_show = new QCheckBox(tr("Show avatars"));
385
398
        avatars_at_left = new QCheckBox(tr("Place avatars at left"));
386
399
 
406
419
        mucRosterLayout->addWidget(show_status_icons);
407
420
        mucRosterLayout->addWidget(showAffIcons);
408
421
        mucRosterLayout->addWidget(mucClientIcons);
409
 
//      mucRosterLayout->addWidget(rosterNickColors);
 
422
        //      mucRosterLayout->addWidget(rosterNickColors);
410
423
        mucRosterLayout->addWidget(avatars_show);
411
424
        mucRosterLayout->addWidget(avatars_at_left);
412
425
        mucRosterLayout->addLayout(mucRosterGrid);
417
430
 
418
431
 
419
432
 
420
 
        //Roster
421
 
        resolveNicks = new QCheckBox(tr("Resolve nicks on contact add"));
422
 
        lockRoster = new QCheckBox(tr("Lockdown roster"));
423
 
        leftRoster = new QCheckBox(tr("Place roster at left in \"all-in-one-window\" mode"));
424
 
        singleLineStatus = new QCheckBox(tr("Contact name and status message in a row"));
425
 
        leftAvatars = new QCheckBox(tr("Place avatars at left"));
426
 
        defaultAvatar = new QCheckBox(tr("If contact does not have avatar, use default avatar"));
427
 
        showStatusIcons = new QCheckBox(tr("Show status icons"));
428
 
        statusIconsOverAvatars = new QCheckBox(tr("Place status icon over avatar"));
 
433
        //Roster
 
434
        resolveNicks = new QCheckBox(tr("Resolve nicks on contact add"));
 
435
        lockRoster = new QCheckBox(tr("Lockdown roster"));
 
436
        leftRoster = new QCheckBox(tr("Place roster at left in \"all-in-one-window\" mode"));
 
437
        singleLineStatus = new QCheckBox(tr("Contact name and status message in a row"));
 
438
        leftAvatars = new QCheckBox(tr("Place avatars at left"));
 
439
        defaultAvatar = new QCheckBox(tr("If contact does not have avatar, use default avatar"));
 
440
        showStatusIcons = new QCheckBox(tr("Show status icons"));
 
441
        statusIconsOverAvatars = new QCheckBox(tr("Place status icon over avatar"));
429
442
 
430
443
        auto_delete_unlisted = new QCheckBox(tr("Automatically remove temporary contacts"));
431
444
        auto_delete_unlisted->hide(); //FIXME!!!! Remove this when the option will be fixed
432
445
 
433
 
        QGroupBox *groupBox = new QGroupBox(tr("Tooltips:"));
434
 
        QVBoxLayout *boxLayout = new QVBoxLayout(groupBox);
435
 
 
436
 
        avatarTip = new QCheckBox(tr("Show avatar"));
437
 
        statusTip = new QCheckBox(tr("Show last status"));
438
 
        pgpTip = new QCheckBox(tr("Show PGP"));
439
 
        clientTip = new QCheckBox(tr("Show client version"));
440
 
        geoTip = new QCheckBox(tr("Show geolocation"));
441
 
 
442
 
        boxLayout->addWidget(avatarTip);
443
 
        boxLayout->addWidget(statusTip);
444
 
        boxLayout->addWidget(pgpTip);
445
 
        boxLayout->addWidget(clientTip);
446
 
        boxLayout->addWidget(geoTip);
447
 
 
448
 
        sortContacts = new QComboBox;
449
 
        sortContacts->addItem("alpha");
450
 
        sortContacts->addItem("status");
 
446
        QGroupBox *groupBox = new QGroupBox(tr("Tooltips:"));
 
447
        QVBoxLayout *boxLayout = new QVBoxLayout(groupBox);
 
448
 
 
449
        avatarTip = new QCheckBox(tr("Show avatar"));
 
450
        statusTip = new QCheckBox(tr("Show last status"));
 
451
        pgpTip = new QCheckBox(tr("Show PGP"));
 
452
        clientTip = new QCheckBox(tr("Show client version"));
 
453
        geoTip = new QCheckBox(tr("Show geolocation"));
 
454
 
 
455
        boxLayout->addWidget(avatarTip);
 
456
        boxLayout->addWidget(statusTip);
 
457
        boxLayout->addWidget(pgpTip);
 
458
        boxLayout->addWidget(clientTip);
 
459
        boxLayout->addWidget(geoTip);
 
460
 
 
461
        sortContacts = new QComboBox;
 
462
        sortContacts->addItem("alpha");
 
463
        sortContacts->addItem("status");
451
464
 
452
465
        QHBoxLayout *sortLayout = new QHBoxLayout();
453
466
        sortLayout->addWidget(new QLabel(tr("Sort style for contacts:")));
454
467
        sortLayout->addWidget(sortContacts);
455
468
        sortLayout->addStretch();
456
469
 
457
 
        tab3Layout->addWidget(resolveNicks);
 
470
        tab3Layout->addWidget(resolveNicks);
458
471
        tab3Layout->addWidget(lockRoster);
459
472
        tab3Layout->addWidget(auto_delete_unlisted);
460
 
        tab3Layout->addWidget(leftRoster);
461
 
        tab3Layout->addWidget(singleLineStatus);
462
 
        tab3Layout->addWidget(showStatusIcons);
463
 
        tab3Layout->addWidget(statusIconsOverAvatars);
464
 
        tab3Layout->addWidget(leftAvatars);
465
 
        tab3Layout->addWidget(defaultAvatar);
 
473
        tab3Layout->addWidget(leftRoster);
 
474
        tab3Layout->addWidget(singleLineStatus);
 
475
        tab3Layout->addWidget(showStatusIcons);
 
476
        tab3Layout->addWidget(statusIconsOverAvatars);
 
477
        tab3Layout->addWidget(leftAvatars);
 
478
        tab3Layout->addWidget(defaultAvatar);
466
479
        tab3Layout->addLayout(sortLayout);
467
480
        tab3Layout->addWidget(groupBox);
468
481
        tab3Layout->addStretch();
469
482
 
470
483
 
471
 
        //Menu------
472
 
        admin = new QCheckBox(tr("Show \"Admin\" option in account menu"));
473
 
        activeChats = new QCheckBox(tr("Show \"Active Chats\" option in contact menu"));
474
 
        pgpKey = new QCheckBox(tr("Show \"Assign OpenPGP Key\" option in contact menu"));
475
 
        picture = new QCheckBox(tr("Show \"Picture\" option in contact menu"));
476
 
        changeProfile = new QCheckBox(tr("Show \"Change Profile\" option in main menu"));
477
 
        chat = new QCheckBox(tr("Show \"Chat\" option in status menu"));
478
 
        invis = new QCheckBox(tr("Show \"Invisible\" option in status menu"));
479
 
        xa = new QCheckBox(tr("Show \"XA\" option in status menu"));
 
484
        //Menu------
 
485
        admin = new QCheckBox(tr("Show \"Admin\" option in account menu"));
 
486
        activeChats = new QCheckBox(tr("Show \"Active Chats\" option in contact menu"));
 
487
        pgpKey = new QCheckBox(tr("Show \"Assign OpenPGP Key\" option in contact menu"));
 
488
        picture = new QCheckBox(tr("Show \"Picture\" option in contact menu"));
 
489
        changeProfile = new QCheckBox(tr("Show \"Change Profile\" option in main menu"));
 
490
        chat = new QCheckBox(tr("Show \"Chat\" option in status menu"));
 
491
        invis = new QCheckBox(tr("Show \"Invisible\" option in status menu"));
 
492
        xa = new QCheckBox(tr("Show \"XA\" option in status menu"));
480
493
        enableMessages = new QCheckBox(tr("Enable single messages"));
481
494
 
482
495
        tab4Layout->addWidget(enableMessages);
483
 
        tab4Layout->addWidget(admin);
484
 
        tab4Layout->addWidget(activeChats);
485
 
        tab4Layout->addWidget(pgpKey);
486
 
        tab4Layout->addWidget(picture);
487
 
        tab4Layout->addWidget(changeProfile);
488
 
        tab4Layout->addWidget(chat);
489
 
        tab4Layout->addWidget(invis);
490
 
        tab4Layout->addWidget(xa);
491
 
        tab4Layout->addStretch();
492
 
 
493
 
 
494
 
        //Look----
 
496
        tab4Layout->addWidget(admin);
 
497
        tab4Layout->addWidget(activeChats);
 
498
        tab4Layout->addWidget(pgpKey);
 
499
        tab4Layout->addWidget(picture);
 
500
        tab4Layout->addWidget(changeProfile);
 
501
        tab4Layout->addWidget(chat);
 
502
        tab4Layout->addWidget(invis);
 
503
        tab4Layout->addWidget(xa);
 
504
        tab4Layout->addStretch();
 
505
 
 
506
 
 
507
        //Look----
495
508
        popupBorder = new ExtToolButton;
496
 
        QHBoxLayout *pbLayout = new QHBoxLayout;
497
 
        pbLayout->addWidget(new QLabel(tr("Popup border color:")));
498
 
        pbLayout->addStretch();
499
 
        pbLayout->addWidget(popupBorder);
 
509
        QHBoxLayout *pbLayout = new QHBoxLayout;
 
510
        pbLayout->addWidget(new QLabel(tr("Popup border color:")));
 
511
        pbLayout->addStretch();
 
512
        pbLayout->addWidget(popupBorder);
500
513
 
501
514
        linkColor = new ExtToolButton;
502
 
        QHBoxLayout *lcLayout = new QHBoxLayout;
503
 
        lcLayout->addWidget(new QLabel(tr("Link color:")));
504
 
        lcLayout->addStretch();
505
 
        lcLayout->addWidget(linkColor);
 
515
        QHBoxLayout *lcLayout = new QHBoxLayout;
 
516
        lcLayout->addWidget(new QLabel(tr("Link color:")));
 
517
        lcLayout->addStretch();
 
518
        lcLayout->addWidget(linkColor);
506
519
 
507
520
        mailtoColor = new ExtToolButton;
508
 
        QHBoxLayout *mcLayout = new QHBoxLayout;
509
 
        mcLayout->addWidget(new QLabel(tr("Mailto color:")));
510
 
        mcLayout->addStretch();
511
 
        mcLayout->addWidget(mailtoColor);
 
521
        QHBoxLayout *mcLayout = new QHBoxLayout;
 
522
        mcLayout->addWidget(new QLabel(tr("Mailto color:")));
 
523
        mcLayout->addStretch();
 
524
        mcLayout->addWidget(mailtoColor);
512
525
 
513
526
        moderColor = new ExtToolButton;
514
 
        QHBoxLayout *modcLayout = new QHBoxLayout;
515
 
        modcLayout->addWidget(new QLabel(tr("Moderators color:")));
516
 
        modcLayout->addStretch();
517
 
        modcLayout->addWidget(moderColor);
 
527
        QHBoxLayout *modcLayout = new QHBoxLayout;
 
528
        modcLayout->addWidget(new QLabel(tr("Moderators color:")));
 
529
        modcLayout->addStretch();
 
530
        modcLayout->addWidget(moderColor);
518
531
 
519
532
        parcColor = new ExtToolButton;
520
 
        QHBoxLayout *parcLayout = new QHBoxLayout;
521
 
        parcLayout->addWidget(new QLabel(tr("Participants color:")));
522
 
        parcLayout->addStretch();
523
 
        parcLayout->addWidget(parcColor);
 
533
        QHBoxLayout *parcLayout = new QHBoxLayout;
 
534
        parcLayout->addWidget(new QLabel(tr("Participants color:")));
 
535
        parcLayout->addStretch();
 
536
        parcLayout->addWidget(parcColor);
524
537
 
525
538
        visitorColor  = new ExtToolButton;
526
 
        QHBoxLayout *vscLayout = new QHBoxLayout;
527
 
        vscLayout->addWidget(new QLabel(tr("Visitors color:")));
528
 
        vscLayout->addStretch();
529
 
        vscLayout->addWidget(visitorColor);
530
 
 
531
 
        noroleColor  = new ExtToolButton;
532
 
        QHBoxLayout *nrcLayout = new QHBoxLayout;
533
 
        nrcLayout->addWidget(new QLabel(tr("No Role color:")));
534
 
        nrcLayout->addStretch();
535
 
        nrcLayout->addWidget(noroleColor);
536
 
 
537
 
        groupMucRoster = new QGroupBox(tr("MUC roster coloring:"));
 
539
        QHBoxLayout *vscLayout = new QHBoxLayout;
 
540
        vscLayout->addWidget(new QLabel(tr("Visitors color:")));
 
541
        vscLayout->addStretch();
 
542
        vscLayout->addWidget(visitorColor);
 
543
 
 
544
        noroleColor      = new ExtToolButton;
 
545
        QHBoxLayout *nrcLayout = new QHBoxLayout;
 
546
        nrcLayout->addWidget(new QLabel(tr("No Role color:")));
 
547
        nrcLayout->addStretch();
 
548
        nrcLayout->addWidget(noroleColor);
 
549
 
 
550
        groupMucRoster = new QGroupBox(tr("Groupchat roster coloring:"));
538
551
        groupMucRoster->setCheckable(true);
539
552
        QVBoxLayout *mucRosterLay = new QVBoxLayout(groupMucRoster);
540
553
        mucRosterLay->addLayout(modcLayout);
544
557
        connect(groupMucRoster, SIGNAL(toggled(bool)), SLOT(hack()));
545
558
 
546
559
        tipText = new ExtToolButton;
547
 
        QHBoxLayout *ttLayout = new QHBoxLayout;
548
 
        ttLayout->addWidget(new QLabel(tr("ToolTip text color:")));
549
 
        ttLayout->addStretch();
550
 
        ttLayout->addWidget(tipText);
 
560
        QHBoxLayout *ttLayout = new QHBoxLayout;
 
561
        ttLayout->addWidget(new QLabel(tr("ToolTip text color:")));
 
562
        ttLayout->addStretch();
 
563
        ttLayout->addWidget(tipText);
551
564
 
552
565
        tipBase = new ExtToolButton;
553
 
        QHBoxLayout *tbLayout = new QHBoxLayout;
554
 
        tbLayout->addWidget(new QLabel(tr("ToolTip background color:")));
555
 
        tbLayout->addStretch();
556
 
        tbLayout->addWidget(tipBase);
 
566
        QHBoxLayout *tbLayout = new QHBoxLayout;
 
567
        tbLayout->addWidget(new QLabel(tr("ToolTip background color:")));
 
568
        tbLayout->addStretch();
 
569
        tbLayout->addWidget(tipBase);
557
570
 
558
571
        groupTip = new QGroupBox(tr("ToolTip coloring:"));
559
572
        groupTip->setCheckable(true);
574
587
        unreadLayout->addStretch();
575
588
        unreadLayout->addWidget(unreadBut);
576
589
 
577
 
        QButtonGroup *b_color = new QButtonGroup;
578
 
        b_color->addButton(popupBorder);
579
 
        b_color->addButton(linkColor);
580
 
        b_color->addButton(mailtoColor);
581
 
        b_color->addButton(moderColor);
582
 
        b_color->addButton(parcColor);
583
 
        b_color->addButton(visitorColor);
584
 
        b_color->addButton(noroleColor);
585
 
        b_color->addButton(tipText);
586
 
        b_color->addButton(tipBase);
 
590
        QButtonGroup *b_color = new QButtonGroup;
 
591
        b_color->addButton(popupBorder);
 
592
        b_color->addButton(linkColor);
 
593
        b_color->addButton(mailtoColor);
 
594
        b_color->addButton(moderColor);
 
595
        b_color->addButton(parcColor);
 
596
        b_color->addButton(visitorColor);
 
597
        b_color->addButton(noroleColor);
 
598
        b_color->addButton(tipText);
 
599
        b_color->addButton(tipBase);
587
600
        b_color->addButton(composingBut);
588
601
        b_color->addButton(unreadBut);
589
 
        connect(b_color, SIGNAL(buttonClicked(QAbstractButton*)), SLOT(chooseColor(QAbstractButton*)));
 
602
        connect(b_color, SIGNAL(buttonClicked(QAbstractButton*)), SLOT(chooseColor(QAbstractButton*)));
590
603
 
591
 
        QGroupBox *group3Box = new QGroupBox(tr("Colors:"));
 
604
        QGroupBox *group3Box = new QGroupBox(tr("Colors:"));
592
605
        QVBoxLayout *box3Layout = new QVBoxLayout(group3Box);
593
606
        box3Layout->addWidget(groupMucRoster);
594
607
        box3Layout->addWidget(groupTip);
595
608
        box3Layout->addLayout(pbLayout);
596
 
        box3Layout->addLayout(lcLayout);
597
 
        box3Layout->addLayout(mcLayout);        
 
609
        box3Layout->addLayout(lcLayout);
 
610
        box3Layout->addLayout(mcLayout);
598
611
        box3Layout->addLayout(composingLayout);
599
612
        box3Layout->addLayout(unreadLayout);
600
 
        box3Layout->addStretch();
601
 
 
602
 
        tab6Layout->addWidget(group3Box);
603
 
 
604
 
        //CSS----------------
605
 
        QTabWidget *cssTab = new QTabWidget;
606
 
 
607
 
        chatCss = new QTextEdit;
608
 
        chatCss->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
609
 
 
610
 
        rosterCss = new QTextEdit;
611
 
        rosterCss->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
612
 
 
613
 
        popupCss = new QTextEdit;
614
 
        popupCss->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
615
 
 
616
 
        tooltipCss = new QTextEdit;
617
 
        tooltipCss->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
618
 
 
619
 
        cssTab->addTab(chatCss, tr("Chat"));
620
 
        cssTab->addTab(rosterCss, tr("Roster"));
621
 
        cssTab->addTab(popupCss, tr("Popup"));
622
 
        cssTab->addTab(tooltipCss, tr("Tooltip"));
 
613
        box3Layout->addStretch();
 
614
 
 
615
        tab6Layout->addWidget(group3Box);
 
616
 
 
617
        //CSS----------------
 
618
        QTabWidget *cssTab = new QTabWidget;
 
619
 
 
620
        chatCss = new QTextEdit;
 
621
        chatCss->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
 
622
 
 
623
        rosterCss = new QTextEdit;
 
624
        rosterCss->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
 
625
 
 
626
        popupCss = new QTextEdit;
 
627
        popupCss->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
 
628
 
 
629
        tooltipCss = new QTextEdit;
 
630
        tooltipCss->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
 
631
 
 
632
        cssTab->addTab(chatCss, tr("Chat"));
 
633
        cssTab->addTab(rosterCss, tr("Roster"));
 
634
        cssTab->addTab(popupCss, tr("Popup"));
 
635
        cssTab->addTab(tooltipCss, tr("Tooltip"));
623
636
 
624
637
        QLabel *cssLabel = new QLabel(tr("<a href=\"http://psi-plus.com/wiki/skins_css\">CSS for Psi+</a>"));
625
638
        cssLabel->setOpenExternalLinks(true);
626
639
 
627
 
        tab7Layout->addWidget(cssTab);
 
640
        tab7Layout->addWidget(cssTab);
628
641
        tab7Layout->addWidget(cssLabel);
629
642
 
630
643
 
670
683
        account_single = new QCheckBox(tr("Enable \"Single Account\" mode"));
671
684
        xml_console_enable_at_login = new QCheckBox(tr("Enable XML-console on login"));
672
685
        lastActivity = new QCheckBox(tr("Enable last activity server"));
673
 
        sndMucNotify = new QCheckBox(tr("Enable sound notifications for every MUC message"));
 
686
        sndMucNotify = new QCheckBox(tr("Enable sound notifications for every groupchat message"));
674
687
        popupsSuppressDnd = new QCheckBox(tr("Disable popup notifications if status is DND"));
675
688
        popupsSuppressAway = new QCheckBox(tr("Disable popup notifications if status is Away"));
676
689
 
688
701
        tab8Layout->addStretch();
689
702
 
690
703
 
691
 
        QLabel *wikiLink = new QLabel(tr("<a href=\"http://psi-plus.com/wiki/plugins#extended_options_plugin\">Wiki (Online)</a>"));
 
704
        QLabel *wikiLink = new QLabel(tr("<a href=\"http://psi-plus.com/wiki/plugins#extended_options_plugin\">Wiki (Online)</a>"));
692
705
        wikiLink->setOpenExternalLinks(true);
693
706
 
694
707
        mainLayout->addWidget(area);
695
 
        mainLayout->addWidget(wikiLink);
 
708
        mainLayout->addWidget(wikiLink);
696
709
 
697
710
        restoreOptions();
698
711
 
706
719
 
707
720
        //Chats-----
708
721
        //psiOptions->setGlobalOption("options.html.chat.render",QVariant(htmlRender->isChecked()));
709
 
        psiOptions->setGlobalOption("options.ui.chat.central-toolbar",QVariant(centralToolbar->isChecked()));
710
722
        psiOptions->setGlobalOption("options.ui.chat.warn-before-clear",QVariant(confirmClearing->isChecked()));
711
723
        psiOptions->setGlobalOption("options.ui.chat.use-message-icons",QVariant(messageIcons->isChecked()));
712
724
        psiOptions->setGlobalOption("options.ui.chat.scaled-message-icons",QVariant(scaledIcons->isChecked()));
713
725
        //psiOptions->setGlobalOption("options.ui.tabs.alt-n-switch",QVariant(altnSwitch->isChecked()));
714
726
        psiOptions->setGlobalOption("options.ui.chat.avatars.show",QVariant(showAvatar->isChecked()));
715
 
        psiOptions->setGlobalOption("options.ui.chat.disable-paste-send",QVariant(disablePastSend->isChecked()));
716
727
        psiOptions->setGlobalOption("options.ui.chat.use-chat-says-style",QVariant(sayMode->isChecked()));
717
728
        psiOptions->setGlobalOption("options.ui.chat.avatars.size", QVariant(avatarSize->value()));
718
729
        psiOptions->setGlobalOption("options.ui.disable-send-button",QVariant(disableSend->isChecked()));
721
732
        psiOptions->setGlobalOption("options.ui.chat.auto-scroll-to-bottom",QVariant(auto_scroll_to_bottom->isChecked()));
722
733
        psiOptions->setGlobalOption("options.ui.chat.caption",QVariant(chat_caption->text()));
723
734
        psiOptions->setGlobalOption("options.ui.chat.default-jid-mode",QVariant(default_jid_mode->currentText()));
724
 
        psiOptions->setGlobalOption("options.ui.chat.default-jid-mode-ignorelist",QVariant(default_jid_mode_ignorelist->toPlainText()
725
 
                                                                        .split(QRegExp("\\s+"), QString::SkipEmptyParts)
726
 
                                                                        .join(",")));
 
735
        psiOptions->setGlobalOption("options.ui.chat.default-jid-mode-ignorelist",
 
736
                                                                QVariant(default_jid_mode_ignorelist->toPlainText()
 
737
                                                                                 .split(QRegExp("\\s+"), QString::SkipEmptyParts)
 
738
                                                                                 .join(",")));
727
739
        psiOptions->setGlobalOption("options.ui.chat.show-status-changes",QVariant(show_status_changes->isChecked()));
728
740
        psiOptions->setGlobalOption("options.ui.chat.status-with-priority",QVariant(chat_status_with_priority->isChecked()));
729
741
 
737
749
        psiOptions->setGlobalOption("options.ui.muc.userlist.show-affiliation-icons",QVariant(showAffIcons->isChecked()));
738
750
        psiOptions->setGlobalOption("options.ui.muc.userlist.show-client-icons",QVariant(mucClientIcons->isChecked()));
739
751
        psiOptions->setGlobalOption("options.muc.bookmarks.auto-join",QVariant(skipAutojoin->isChecked()));
740
 
//      psiOptions->setGlobalOption("options.ui.muc.userlist.nick-coloring",QVariant(rosterNickColors->isChecked()));
 
752
        //      psiOptions->setGlobalOption("options.ui.muc.userlist.nick-coloring",QVariant(rosterNickColors->isChecked()));
741
753
        psiOptions->setGlobalOption("options.html.muc.render",QVariant(mucHtml->isChecked()));
742
754
        psiOptions->setGlobalOption("options.ui.muc.hide-on-autojoin",QVariant(hideAutoJoin->isChecked()));
743
755
        saveFile(bookmarksListSkip->toPlainText());
834
846
                return;
835
847
 
836
848
        //Chats-----
837
 
       // htmlRender->setChecked(psiOptions->getGlobalOption("options.html.chat.render").toBool());
838
 
        centralToolbar->setChecked(psiOptions->getGlobalOption("options.ui.chat.central-toolbar").toBool());
839
 
        confirmClearing->setChecked(psiOptions->getGlobalOption("options.ui.chat.warn-before-clear").toBool());
840
 
        messageIcons->setChecked(psiOptions->getGlobalOption("options.ui.chat.use-message-icons").toBool());
 
849
        // htmlRender->setChecked(psiOptions->getGlobalOption("options.html.chat.render").toBool());
 
850
        confirmClearing->setChecked(psiOptions->getGlobalOption("options.ui.chat.warn-before-clear").toBool());
 
851
        messageIcons->setChecked(psiOptions->getGlobalOption("options.ui.chat.use-message-icons").toBool());
841
852
        scaledIcons->setChecked(psiOptions->getGlobalOption("options.ui.chat.scaled-message-icons").toBool());
842
853
        // altnSwitch->setChecked(psiOptions->getGlobalOption("options.ui.tabs.alt-n-switch").toBool());
843
 
        showAvatar->setChecked(psiOptions->getGlobalOption("options.ui.chat.avatars.show").toBool());
844
 
        avatarSize->setValue(psiOptions->getGlobalOption("options.ui.chat.avatars.size").toInt());
845
 
        disablePastSend->setChecked(psiOptions->getGlobalOption("options.ui.chat.disable-paste-send").toBool());
 
854
        showAvatar->setChecked(psiOptions->getGlobalOption("options.ui.chat.avatars.show").toBool());
 
855
        avatarSize->setValue(psiOptions->getGlobalOption("options.ui.chat.avatars.size").toInt());
846
856
        sayMode->setChecked(psiOptions->getGlobalOption("options.ui.chat.use-chat-says-style").toBool());
847
857
        disableSend->setChecked(psiOptions->getGlobalOption("options.ui.disable-send-button").toBool());
848
858
 
854
864
        show_status_changes->setChecked(psiOptions->getGlobalOption("options.ui.chat.show-status-changes").toBool());
855
865
        chat_status_with_priority->setChecked(psiOptions->getGlobalOption("options.ui.chat.status-with-priority").toBool());
856
866
 
857
 
        //MUC-----
858
 
        showJoins->setChecked(psiOptions->getGlobalOption("options.muc.show-joins").toBool());
859
 
        showRole->setChecked(psiOptions->getGlobalOption("options.muc.show-role-affiliation").toBool());
860
 
        showStatus->setChecked(psiOptions->getGlobalOption("options.muc.show-status-changes").toBool());
861
 
        leftMucRoster->setChecked(psiOptions->getGlobalOption("options.ui.muc.roster-at-left").toBool());
 
867
        //MUC-----
 
868
        showJoins->setChecked(psiOptions->getGlobalOption("options.muc.show-joins").toBool());
 
869
        showRole->setChecked(psiOptions->getGlobalOption("options.muc.show-role-affiliation").toBool());
 
870
        showStatus->setChecked(psiOptions->getGlobalOption("options.muc.show-status-changes").toBool());
 
871
        leftMucRoster->setChecked(psiOptions->getGlobalOption("options.ui.muc.roster-at-left").toBool());
862
872
        showGroups->setChecked(psiOptions->getGlobalOption("options.ui.muc.userlist.show-groups").toBool());
863
873
        showAffIcons->setChecked(psiOptions->getGlobalOption("options.ui.muc.userlist.show-affiliation-icons").toBool());
864
 
        skipAutojoin->setChecked(psiOptions->getGlobalOption("options.muc.bookmarks.auto-join").toBool());
865
 
        bookmarksListSkip->setPlainText(readFile());
 
874
        skipAutojoin->setChecked(psiOptions->getGlobalOption("options.muc.bookmarks.auto-join").toBool());
 
875
        bookmarksListSkip->setPlainText(readFile());
866
876
        mucClientIcons->setChecked(psiOptions->getGlobalOption("options.ui.muc.userlist.show-client-icons").toBool());
867
 
//      rosterNickColors->setChecked(psiOptions->getGlobalOption("options.ui.muc.userlist.nick-coloring").toBool());
 
877
        //      rosterNickColors->setChecked(psiOptions->getGlobalOption("options.ui.muc.userlist.nick-coloring").toBool());
868
878
        mucHtml->setChecked(psiOptions->getGlobalOption("options.html.muc.render").toBool());
869
879
        hideAutoJoin->setChecked(psiOptions->getGlobalOption("options.ui.muc.hide-on-autojoin").toBool());
870
880
 
894
904
        hideWhenClose->setChecked(psiOptions->getGlobalOption("options.ui.chat.hide-when-closing").toBool());
895
905
        canCloseTab->setChecked(psiOptions->getGlobalOption("options.ui.tabs.can-close-inactive-tab").toBool());
896
906
 
897
 
        //Roster
898
 
        resolveNicks->setChecked(psiOptions->getGlobalOption("options.contactlist.resolve-nicks-on-contact-add").toBool());
899
 
        lockRoster->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.lockdown-roster").toBool());
900
 
        leftRoster->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.roster-at-left-when-all-in-one-window").toBool());
901
 
        singleLineStatus->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.status-messages.single-line").toBool());
902
 
        avatarTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.avatar").toBool());
903
 
        statusTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.last-status").toBool());
904
 
        geoTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.geolocation").toBool());
905
 
        pgpTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.pgp").toBool());
906
 
        clientTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.client-version").toBool());
907
 
        sortContacts->setCurrentIndex(sortContacts->findText(psiOptions->getGlobalOption("options.ui.contactlist.contact-sort-style").toString()));
908
 
        leftAvatars->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.avatars.avatars-at-left").toBool());
909
 
        defaultAvatar->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.avatars.use-default-avatar").toBool());
910
 
        showStatusIcons->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.show-status-icons").toBool());
911
 
        statusIconsOverAvatars->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.status-icon-over-avatar").toBool());
 
907
        //Roster
 
908
        resolveNicks->setChecked(psiOptions->getGlobalOption("options.contactlist.resolve-nicks-on-contact-add").toBool());
 
909
        lockRoster->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.lockdown-roster").toBool());
 
910
        leftRoster->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.roster-at-left-when-all-in-one-window").toBool());
 
911
        singleLineStatus->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.status-messages.single-line").toBool());
 
912
        avatarTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.avatar").toBool());
 
913
        statusTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.last-status").toBool());
 
914
        geoTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.geolocation").toBool());
 
915
        pgpTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.pgp").toBool());
 
916
        clientTip->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.client-version").toBool());
 
917
        sortContacts->setCurrentIndex(sortContacts->findText(psiOptions->getGlobalOption("options.ui.contactlist.contact-sort-style").toString()));
 
918
        leftAvatars->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.avatars.avatars-at-left").toBool());
 
919
        defaultAvatar->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.avatars.use-default-avatar").toBool());
 
920
        showStatusIcons->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.show-status-icons").toBool());
 
921
        statusIconsOverAvatars->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.status-icon-over-avatar").toBool());
912
922
        auto_delete_unlisted->setChecked(psiOptions->getGlobalOption("options.ui.contactlist.auto-delete-unlisted").toBool());
913
923
 
914
 
        //Menu------
915
 
        admin->setChecked(psiOptions->getGlobalOption("options.ui.menu.account.admin").toBool());
916
 
        activeChats->setChecked(psiOptions->getGlobalOption("options.ui.menu.contact.active-chats").toBool());
917
 
        pgpKey->setChecked(psiOptions->getGlobalOption("options.ui.menu.contact.custom-pgp-key").toBool());
918
 
        picture->setChecked(psiOptions->getGlobalOption("options.ui.menu.contact.custom-picture").toBool());
919
 
        changeProfile->setChecked(psiOptions->getGlobalOption("options.ui.menu.main.change-profile").toBool());
920
 
        chat->setChecked(psiOptions->getGlobalOption("options.ui.menu.status.chat").toBool());
921
 
        invis->setChecked(psiOptions->getGlobalOption("options.ui.menu.status.invisible").toBool());
922
 
        xa->setChecked(psiOptions->getGlobalOption("options.ui.menu.status.xa").toBool());
 
924
        //Menu------
 
925
        admin->setChecked(psiOptions->getGlobalOption("options.ui.menu.account.admin").toBool());
 
926
        activeChats->setChecked(psiOptions->getGlobalOption("options.ui.menu.contact.active-chats").toBool());
 
927
        pgpKey->setChecked(psiOptions->getGlobalOption("options.ui.menu.contact.custom-pgp-key").toBool());
 
928
        picture->setChecked(psiOptions->getGlobalOption("options.ui.menu.contact.custom-picture").toBool());
 
929
        changeProfile->setChecked(psiOptions->getGlobalOption("options.ui.menu.main.change-profile").toBool());
 
930
        chat->setChecked(psiOptions->getGlobalOption("options.ui.menu.status.chat").toBool());
 
931
        invis->setChecked(psiOptions->getGlobalOption("options.ui.menu.status.invisible").toBool());
 
932
        xa->setChecked(psiOptions->getGlobalOption("options.ui.menu.status.xa").toBool());
923
933
        enableMessages->setChecked(psiOptions->getGlobalOption("options.ui.message.enabled").toBool());
924
934
 
925
 
        //Look----
926
 
        QColor color;
927
 
        color = psiOptions->getGlobalOption("options.ui.look.colors.passive-popup.border").toString();
928
 
        popupBorder->setStyleSheet(QString("background-color: %1;").arg(color.name()));
929
 
        popupBorder->setProperty("psi_color", color);
930
 
        color = psiOptions->getGlobalOption("options.ui.look.colors.chat.link-color").toString();
931
 
        linkColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
932
 
        linkColor->setProperty("psi_color", color);
933
 
        color = psiOptions->getGlobalOption("options.ui.look.colors.chat.mailto-color").toString();
934
 
        mailtoColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
935
 
        mailtoColor->setProperty("psi_color", color);
936
 
        color = psiOptions->getGlobalOption("options.ui.look.colors.muc.role-moderator").toString();
937
 
        moderColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
938
 
        moderColor->setProperty("psi_color", color);
939
 
        color = psiOptions->getGlobalOption("options.ui.look.colors.muc.role-participant").toString();
940
 
        parcColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
941
 
        parcColor->setProperty("psi_color", color);
942
 
        color = psiOptions->getGlobalOption("options.ui.look.colors.muc.role-visitor").toString();
943
 
        visitorColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
944
 
        visitorColor->setProperty("psi_color", color);
945
 
        color = psiOptions->getGlobalOption("options.ui.look.colors.muc.role-norole").toString();
946
 
        noroleColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
947
 
        noroleColor->setProperty("psi_color", color);
948
 
        color = psiOptions->getGlobalOption("options.ui.look.colors.tooltip.text").toString();
949
 
        tipText->setStyleSheet(QString("background-color: %1;").arg(color.name()));
950
 
        tipText->setProperty("psi_color", color);
951
 
        color = psiOptions->getGlobalOption("options.ui.look.colors.tooltip.background").toString();
952
 
        tipBase->setStyleSheet(QString("background-color: %1;").arg(color.name()));
 
935
        //Look----
 
936
        QColor color;
 
937
        color = psiOptions->getGlobalOption("options.ui.look.colors.passive-popup.border").toString();
 
938
        popupBorder->setStyleSheet(QString("background-color: %1;").arg(color.name()));
 
939
        popupBorder->setProperty("psi_color", color);
 
940
        color = psiOptions->getGlobalOption("options.ui.look.colors.chat.link-color").toString();
 
941
        linkColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
 
942
        linkColor->setProperty("psi_color", color);
 
943
        color = psiOptions->getGlobalOption("options.ui.look.colors.chat.mailto-color").toString();
 
944
        mailtoColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
 
945
        mailtoColor->setProperty("psi_color", color);
 
946
        color = psiOptions->getGlobalOption("options.ui.look.colors.muc.role-moderator").toString();
 
947
        moderColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
 
948
        moderColor->setProperty("psi_color", color);
 
949
        color = psiOptions->getGlobalOption("options.ui.look.colors.muc.role-participant").toString();
 
950
        parcColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
 
951
        parcColor->setProperty("psi_color", color);
 
952
        color = psiOptions->getGlobalOption("options.ui.look.colors.muc.role-visitor").toString();
 
953
        visitorColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
 
954
        visitorColor->setProperty("psi_color", color);
 
955
        color = psiOptions->getGlobalOption("options.ui.look.colors.muc.role-norole").toString();
 
956
        noroleColor->setStyleSheet(QString("background-color: %1;").arg(color.name()));
 
957
        noroleColor->setProperty("psi_color", color);
 
958
        color = psiOptions->getGlobalOption("options.ui.look.colors.tooltip.text").toString();
 
959
        tipText->setStyleSheet(QString("background-color: %1;").arg(color.name()));
 
960
        tipText->setProperty("psi_color", color);
 
961
        color = psiOptions->getGlobalOption("options.ui.look.colors.tooltip.background").toString();
 
962
        tipBase->setStyleSheet(QString("background-color: %1;").arg(color.name()));
953
963
        tipBase->setProperty("psi_color", color);
954
964
        color = psiOptions->getGlobalOption("options.ui.look.colors.chat.unread-message-color").toString();
955
965
        unreadBut->setStyleSheet(QString("background-color: %1;").arg(color.name()));
960
970
        groupTip->setChecked(psiOptions->getGlobalOption("options.ui.look.colors.tooltip.enable").toBool());
961
971
        groupMucRoster->setChecked(psiOptions->getGlobalOption("options.ui.muc.userlist.nick-coloring").toBool());
962
972
 
963
 
        //CSS----------------
964
 
        chatCss->setText(psiOptions->getGlobalOption("options.ui.chat.css").toString());
965
 
        rosterCss->setText(psiOptions->getGlobalOption("options.ui.contactlist.css").toString());
966
 
        popupCss->setText(psiOptions->getGlobalOption("options.ui.notifications.passive-popups.css").toString());
967
 
        tooltipCss->setText(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.css").toString());
 
973
        //CSS----------------
 
974
        chatCss->setText(psiOptions->getGlobalOption("options.ui.chat.css").toString());
 
975
        rosterCss->setText(psiOptions->getGlobalOption("options.ui.contactlist.css").toString());
 
976
        popupCss->setText(psiOptions->getGlobalOption("options.ui.notifications.passive-popups.css").toString());
 
977
        tooltipCss->setText(psiOptions->getGlobalOption("options.ui.contactlist.tooltip.css").toString());
968
978
 
969
979
        //Misc--------------------
970
980
        flash_windows->setChecked(psiOptions->getGlobalOption("options.ui.flash-windows").toBool());
989
999
 
990
1000
void ExtendedOptions::chooseColor(QAbstractButton* button)
991
1001
{
992
 
        QColor c;
993
 
        c = button->property("psi_color").value<QColor>();
994
 
        c = QColorDialog::getColor(c, new QWidget());
995
 
        if(c.isValid()) {
996
 
                button->setProperty("psi_color", c);
997
 
                button->setStyleSheet(QString("background-color: %1").arg(c.name()));
998
 
        }
 
1002
        QColor c;
 
1003
        c = button->property("psi_color").value<QColor>();
 
1004
        c = QColorDialog::getColor(c, new QWidget());
 
1005
        if(c.isValid()) {
 
1006
                button->setProperty("psi_color", c);
 
1007
                button->setStyleSheet(QString("background-color: %1").arg(c.name()));
 
1008
        }
999
1009
 
1000
 
       hack();
 
1010
        hack();
1001
1011
}
1002
1012
 
1003
1013
void ExtendedOptions::setApplicationInfoAccessingHost(ApplicationInfoAccessingHost* host)
1033
1043
void ExtendedOptions::hack()
1034
1044
{
1035
1045
        //Enable "Apply" button
1036
 
        centralToolbar->toggle();
1037
 
        centralToolbar->toggle();
 
1046
        confirmClearing->toggle();
 
1047
        confirmClearing->toggle();
1038
1048
}
1039
1049
 
1040
1050
QString ExtendedOptions::profileDir()
1047
1057
 
1048
1058
QString ExtendedOptions::pluginInfo()
1049
1059
{
1050
 
        return tr("Author: ") +  "Dealer_WeARE\n"
1051
 
                        + tr("Email: ") + "wadealer@gmail.com\n\n"
1052
 
                        + trUtf8("This plugin is designed to allow easy configuration of some advanced options in Psi+.\n"
1053
 
                                 "This plugin gives you access to advanced application options, which do not have a graphical user interface.\n\n"
1054
 
                                 "Importantly: a large part of the options are important system settings. These require extra attention and proper"
1055
 
                                 "understanding of the results when changing the option.");
 
1060
        return tr("Author: ") +  "Dealer_WeARE\n"
 
1061
                 + tr("Email: ") + "wadealer@gmail.com\n\n"
 
1062
                 + trUtf8("This plugin is designed to allow easy configuration of some advanced options in Psi+.\n"
 
1063
                                  "This plugin gives you access to advanced application options, which do not have a graphical user interface.\n\n"
 
1064
                                  "Importantly: a large part of the options are important system settings. These require extra attention and proper"
 
1065
                                  "understanding of the results when changing the option.");
 
1066
}
 
1067
 
 
1068
QPixmap ExtendedOptions::icon() const
 
1069
{
 
1070
        return QPixmap(":/icons/extendedoptions.png");
1056
1071
}
1057
1072
 
1058
1073
#include "extendedoptionsplugin.moc"
1059