~ubuntu-branches/ubuntu/karmic/psi/karmic

« back to all changes in this revision

Viewing changes to src/psiactionlist.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "psiactionlist.h"
22
22
#include "iconset.h"
 
23
#include "psioptions.h"
23
24
 
24
25
#include <qobject.h>
25
26
 
55
56
        };
56
57
 
57
58
        void createActionList( QString name, int id, ActionNames * );
 
59
 
 
60
private slots:
 
61
        void optionsChanged();
 
62
 
58
63
};
59
64
 
60
65
PsiActionList::Private::Private(PsiActionList *_list, PsiCon *_psi)
70
75
        createMessage();
71
76
        createChat();
72
77
        createGroupchat();
 
78
 
 
79
        connect(PsiOptions::instance(), SIGNAL(optionChanged(const QString&)), SLOT(optionsChanged()));
 
80
        optionsChanged();
73
81
}
74
82
 
75
83
PsiActionList::Private::~Private()
108
116
void PsiActionList::Private::createMainWin()
109
117
{
110
118
        {
111
 
                IconActionGroup *viewGroups = new IconActionGroup ( this );
112
 
                viewGroups->setMenuText (tr("View Groups"));
113
 
                viewGroups->setWhatsThis (tr("Toggle visibility of special roster groups"));
114
 
                viewGroups->setUsesDropDown (true);
115
 
                viewGroups->setExclusive (false);
116
 
 
117
 
                IconAction *showOffline = new IconAction (tr("Show Offline Contacts"), "psi/show_offline", tr("Show Offline Contacts"), 0, viewGroups, 0, true);
118
 
                showOffline->setWhatsThis (tr("Toggles visibility of offline contacts in roster"));
119
 
 
120
 
                IconAction *showAway = new IconAction (tr("Show Away/XA/DnD Contacts"), "psi/show_away", tr("Show Away/XA/DnD Contacts"), 0, viewGroups, 0, true);
121
 
                showAway->setWhatsThis (tr("Toggles visibility of away/xa/dnd contacts in roster"));
122
 
 
123
 
                IconAction *showHidden = new IconAction (tr("Show Hidden Contacts"), "psi/show_hidden", tr("Show Hidden Contacts"), 0, viewGroups, 0, true);
124
 
                showHidden->setWhatsThis (tr("Toggles visibility of hidden contacts in roster"));
125
 
 
126
 
                IconAction *showAgents = new IconAction (tr("Show Agents/Transports"), "psi/disco", tr("Show Agents/Transports"), 0, viewGroups, 0, true);
127
 
                showAgents->setWhatsThis (tr("Toggles visibility of agents/transports in roster"));
128
 
 
129
 
                IconAction *showSelf = new IconAction (tr("Show Self Contact"), "psi/show_self", tr("Show Self Contact"), 0, viewGroups, 0, true);
130
 
                showSelf->setWhatsThis (tr("Toggles visibility of self contact in roster"));
131
 
 
132
 
                IconAction *showStatusMsg = new IconAction (tr("Show Status Messages"), "psi/statusmsg", tr("Show Status Messages"), 0, viewGroups, 0, true);
133
 
                showSelf->setWhatsThis (tr("Toggles visibility of status messages of contacts"));
 
119
                IconActionGroup *viewGroups = new IconActionGroup(this);
 
120
                viewGroups->setMenuText(tr("View Groups"));
 
121
                viewGroups->setWhatsThis(tr("Toggle visibility of special roster groups"));
 
122
                viewGroups->setUsesDropDown(true);
 
123
                viewGroups->setExclusive(false);
 
124
 
 
125
                IconAction *showOffline = new IconAction(tr("Show Offline Contacts"), "psi/show_offline", tr("Show Offline Contacts"), 0, viewGroups, 0, true);
 
126
                showOffline->setWhatsThis(tr("Toggles visibility of offline contacts in roster"));
 
127
 
 
128
                IconAction *showAway = new IconAction(tr("Show Away/XA/DnD Contacts"), "psi/show_away", tr("Show Away/XA/DnD Contacts"), 0,
 
129
                                                      PsiOptions::instance()->getOption("options.ui.menu.view.show-away").toBool() ? (QObject*)viewGroups : (QObject*)this, 0, true);
 
130
                showAway->setWhatsThis(tr("Toggles visibility of away/xa/dnd contacts in roster"));
 
131
 
 
132
                IconAction *showHidden = new IconAction(tr("Show Hidden Contacts"), "psi/show_hidden", tr("Show Hidden Contacts"), 0, viewGroups, 0, true);
 
133
                showHidden->setWhatsThis(tr("Toggles visibility of hidden contacts in roster"));
 
134
 
 
135
                IconAction *showAgents = new IconAction(tr("Show Agents/Transports"), "psi/disco", tr("Show Agents/Transports"), 0, viewGroups, 0, true);
 
136
                showAgents->setWhatsThis(tr("Toggles visibility of agents/transports in roster"));
 
137
 
 
138
                IconAction *showSelf = new IconAction(tr("Show Self Contact"), "psi/show_self", tr("Show Self Contact"), 0, viewGroups, 0, true);
 
139
                showSelf->setWhatsThis(tr("Toggles visibility of self contact in roster"));
 
140
 
 
141
                IconAction *showStatusMsg = new IconAction(tr("Show Status Messages"), "psi/statusmsg", tr("Show Status Messages"), 0, viewGroups, 0, true);
 
142
                showSelf->setWhatsThis(tr("Toggles visibility of status messages of contacts"));
134
143
 
135
144
                ActionNames actions[] = {
136
145
                        { "view_groups",  viewGroups  },
143
152
                        { "", 0 }
144
153
                };
145
154
 
146
 
                createActionList( tr( "Show Contacts" ), Actions_MainWin, actions );
 
155
                createActionList(tr("Show Contacts"), Actions_MainWin, actions);
147
156
        }
148
157
 
149
158
        {
172
181
 
173
182
        {
174
183
                IconAction *add_act = 0;
175
 
                if (!option.lockdown.roster)
 
184
                if (!PsiOptions::instance()->getOption("options.ui.contactlist.lockdown-roster").toBool())
176
185
                        add_act = new MAction(IconsetFactory::icon("psi/addContact"), tr("&Add a contact"), 0, psi, this);
177
186
 
178
187
                IconAction *lw_act = new MAction(IconsetFactory::icon("psi/xml"), tr("&XML Console"), 2, psi, this);
179
188
 
180
189
                IconAction *actDisco = 0;
181
 
                if(!option.lockdown.services)
 
190
                if(!PsiOptions::instance()->getOption("options.ui.contactlist.disable-service-discovery").toBool())
182
191
                        actDisco = new MAction(IconsetFactory::icon("psi/disco"), tr("Service &Discovery"), 3, psi, this);
183
192
 
184
193
//              IconAction *actReadme = new IconAction (tr("ReadMe"), tr("&ReadMe"), 0, this);
198
207
 
199
208
                IconAction *actNewMessage = new IconAction (tr("New blank message"), "psi/sendMessage", tr("New &blank message"), 0, this);
200
209
                IconAction *actJoinGroupchat = new IconAction (tr("Join Groupchat"), "psi/groupChat", tr("Join &Groupchat"), 0, this);
201
 
                IconAction *actAccountSetup = 0;
202
 
                actAccountSetup = new IconAction (tr("Account Setup"), "psi/account", tr("Acc&ount Setup"), 0, this);
203
 
                IconAction *actOptions = 0;
204
 
                actOptions = new IconAction (tr("Options"), "psi/options", tr("&Options"), 0, this);
 
210
                IconAction *actAccountSetup = new IconAction (tr("Account Setup"), "psi/account", tr("Acc&ount Setup"), 0, this);
 
211
 
 
212
                IconAction *actOptions = new IconAction (tr("Options"), "psi/options", tr("&Options"), 0, this);
 
213
                actOptions->setMenuRole(QAction::PreferencesRole);
 
214
 
205
215
                IconAction *actToolbars = new IconAction(tr("Configure Toolbars"), "psi/toolbars", tr("Configure Tool&bars"), 0, this);
206
 
                IconAction *actChangeProfile = 0;
207
 
                actChangeProfile = new IconAction (tr("Change Profile"), "psi/profile", tr("&Change profile"), 0, this);
 
216
                IconAction *actChangeProfile = new IconAction (tr("Change Profile"), "psi/profile", tr("&Change profile"), 0, this);
208
217
 
209
218
                IconAction *actPlaySounds = new IconAction (tr("Play sounds"), "psi/playSounds", tr("Play &sounds"), 0, this, 0, true);
210
219
                actPlaySounds->setWhatsThis (tr("Toggles whether sound should be played or not"));
211
220
                
212
221
                IconAction *actQuit = new IconAction (tr("Quit"), "psi/quit", tr("&Quit"), 0, this);
 
222
                actQuit->setMenuRole(QAction::QuitRole);
213
223
                actQuit->setWhatsThis (tr("Quits Psi"));
214
224
 
215
225
                IconAction *actTip = new IconAction (tr("Tip of the Day"), "psi/tip", tr("&Tip of the Day"), 0, this);
328
338
                actBugReport->setWhatsThis (tr("Report a Bug (Online)"));
329
339
 
330
340
                IconAction *actAbout = new IconAction (tr("About"), "psi/logo_16", tr("&About"), 0, this);
 
341
                actAbout->setMenuRole(QAction::AboutRole);
331
342
 
332
343
                IconAction *actAboutQt = new IconAction (tr("About Qt"), tr("About &Qt"), 0, this);
 
344
                actAboutQt->setMenuRole(QAction::AboutQtRole);
 
345
 
 
346
                IconAction *actDiagQCAPlugin = new IconAction (tr("Security Plugins"), tr("Security &Plugins"), 0, this);
 
347
 
 
348
                IconAction *actDiagQCAKeyStore = new IconAction (tr("Key Storage"), tr("&Key Storage"), 0, this);
333
349
 
334
350
                ActionNames actions[] = {
335
 
                        { "help_readme",      actReadme     },
336
 
                        { "help_tip",         actTip        },
337
 
                        { "help_online_help", actOnlineHelp },
338
 
                        { "help_online_wiki", actOnlineWiki },
339
 
                        { "help_online_home", actOnlineHome },
340
 
                        { "help_psi_muc",     actPsiMUC     },
341
 
                        { "help_report_bug",  actBugReport  },
342
 
                        { "help_about",       actAbout      },
343
 
                        { "help_about_qt",    actAboutQt    },
 
351
                        { "help_readme",           actReadme          },
 
352
                        { "help_tip",              actTip             },
 
353
                        { "help_online_help",      actOnlineHelp      },
 
354
                        { "help_online_wiki",      actOnlineWiki      },
 
355
                        { "help_online_home",      actOnlineHome      },
 
356
                        { "help_psi_muc",          actPsiMUC          },
 
357
                        { "help_report_bug",       actBugReport       },
 
358
                        { "help_about",            actAbout           },
 
359
                        { "help_about_qt",         actAboutQt         },
 
360
                        { "help_diag_qcaplugin",   actDiagQCAPlugin  },
 
361
                        { "help_diag_qcakeystore", actDiagQCAKeyStore },
344
362
                        { "", 0 }
345
363
                };
346
364
 
372
390
{
373
391
}
374
392
 
 
393
void PsiActionList::Private::optionsChanged()
 
394
{
 
395
        ActionList *statusList = list->actionList(tr("Status"));
 
396
        statusList->action("status_chat")->setVisible(PsiOptions::instance()->getOption("options.ui.menu.status.chat").toBool());
 
397
        statusList->action("status_xa")->setVisible(PsiOptions::instance()->getOption("options.ui.menu.status.xa").toBool());
 
398
        statusList->action("status_invisible")->setVisible(PsiOptions::instance()->getOption("options.ui.menu.status.invisible").toBool());
 
399
}
 
400
 
375
401
//----------------------------------------------------------------------------
376
402
// PsiActionList
377
403
//----------------------------------------------------------------------------