~ubuntu-branches/ubuntu/jaunty/psi/jaunty

« back to all changes in this revision

Viewing changes to src/psiactionlist.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
#include "psiactionlist.h"
 
22
#include "iconset.h"
22
23
 
23
24
#include <qobject.h>
24
25
 
82
83
 
83
84
        QString aName;
84
85
        for ( int i = 0; !(aName = QString(actionlist[i].name)).isEmpty(); i++ ) {
85
 
                actions->addAction( aName, actionlist[i].action );
 
86
                IconAction *action = actionlist[i].action;
 
87
                if (action)
 
88
                        actions->addAction( aName, action );
86
89
        }
87
90
 
88
91
        list->addList( actions );
114
117
                IconAction *showOffline = new IconAction (tr("Show Offline Contacts"), "psi/show_offline", tr("Show Offline Contacts"), 0, viewGroups, 0, true);
115
118
                showOffline->setWhatsThis (tr("Toggles visibility of offline contacts in roster"));
116
119
 
117
 
                IconAction *showAway = new IconAction (tr("Show Away/XA/DnD"), "psi/show_away", tr("Show Away/XA/DnD"), 0, viewGroups, 0, true);
 
120
                IconAction *showAway = new IconAction (tr("Show Away/XA/DnD Contacts"), "psi/show_away", tr("Show Away/XA/DnD Contacts"), 0, viewGroups, 0, true);
118
121
                showAway->setWhatsThis (tr("Toggles visibility of away/xa/dnd contacts in roster"));
119
122
 
120
 
                IconAction *showHidden = new IconAction (tr("Show Hidden"), "psi/show_hidden", tr("Show Hidden"), 0, viewGroups, 0, true);
 
123
                IconAction *showHidden = new IconAction (tr("Show Hidden Contacts"), "psi/show_hidden", tr("Show Hidden Contacts"), 0, viewGroups, 0, true);
121
124
                showHidden->setWhatsThis (tr("Toggles visibility of hidden contacts in roster"));
122
125
 
123
126
                IconAction *showAgents = new IconAction (tr("Show Agents/Transports"), "psi/disco", tr("Show Agents/Transports"), 0, viewGroups, 0, true);
126
129
                IconAction *showSelf = new IconAction (tr("Show Self Contact"), "psi/show_self", tr("Show Self Contact"), 0, viewGroups, 0, true);
127
130
                showSelf->setWhatsThis (tr("Toggles visibility of self contact in roster"));
128
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"));
 
134
 
129
135
                ActionNames actions[] = {
130
136
                        { "view_groups",  viewGroups  },
131
137
                        { "show_offline", showOffline },
133
139
                        { "show_hidden",  showHidden  },
134
140
                        { "show_agents",  showAgents  },
135
141
                        { "show_self",    showSelf    },
 
142
                        { "show_statusmsg", showStatusMsg },
136
143
                        { "", 0 }
137
144
                };
138
145
 
142
149
        {
143
150
                PopupAction *optionsButton = new PopupAction (tr("&Psi"), 0, this, "optionsButton");
144
151
                optionsButton->setWhatsThis (tr("The main Psi button, that provides access to many actions"));
145
 
                optionsButton->setSizePolicy ( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
146
 
                optionsButton->setIcon ( IconsetFactory::iconPtr("psi/psiMain"), false );
 
152
                optionsButton->setSizePolicy ( QSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred ) );
 
153
                optionsButton->setIcon ( IconsetFactory::iconPtr("psi/main"), false );
147
154
 
148
155
                PopupAction *statusButton = new PopupAction (tr("&Status"), 0, this, "statusButton");
149
156
                statusButton->setWhatsThis (tr("Provides a convenient way to change and to get information about current status"));
164
171
 
165
172
 
166
173
        {
167
 
                IconAction *add_act = new MAction(IconsetFactory::icon("psi/addContact"), tr("&Add a contact"), 0, psi, this);
 
174
                IconAction *add_act = 0;
 
175
                if (!option.lockdown.roster)
 
176
                        add_act = new MAction(IconsetFactory::icon("psi/addContact"), tr("&Add a contact"), 0, psi, this);
168
177
 
169
178
                IconAction *lw_act = new MAction(IconsetFactory::icon("psi/xml"), tr("&XML Console"), 2, psi, this);
170
179
 
171
 
                IconAction *actDisco = new MAction(IconsetFactory::icon("psi/disco"), tr("Service &Discovery"), 3, psi, this);
 
180
                IconAction *actDisco = 0;
 
181
                if(!option.lockdown.services)
 
182
                        actDisco = new MAction(IconsetFactory::icon("psi/disco"), tr("Service &Discovery"), 3, psi, this);
172
183
 
173
184
//              IconAction *actReadme = new IconAction (tr("ReadMe"), tr("&ReadMe"), 0, this);
174
185
//              actReadme->setWhatsThis (tr("Show Read Me file"));
187
198
 
188
199
                IconAction *actNewMessage = new IconAction (tr("New blank message"), "psi/sendMessage", tr("New &blank message"), 0, this);
189
200
                IconAction *actJoinGroupchat = new IconAction (tr("Join Groupchat"), "psi/groupChat", tr("Join &Groupchat"), 0, this);
190
 
                IconAction *actAccountSetup = new IconAction (tr("Account Setup"), "psi/account", tr("Acc&ount Setup"), 0, this);
191
 
                IconAction *actOptions = new IconAction (tr("Options"), "psi/options", tr("&Options"), 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);
192
205
                IconAction *actToolbars = new IconAction(tr("Configure Toolbars"), "psi/toolbars", tr("Configure Tool&bars"), 0, this);
193
 
                IconAction *actChangeProfile = new IconAction (tr("Change Profile"), "psi/profile", tr("&Change profile"), 0, this);
 
206
                IconAction *actChangeProfile = 0;
 
207
                actChangeProfile = new IconAction (tr("Change Profile"), "psi/profile", tr("&Change profile"), 0, this);
194
208
 
195
209
                IconAction *actPlaySounds = new IconAction (tr("Play sounds"), "psi/playSounds", tr("Play &sounds"), 0, this, 0, true);
196
210
                actPlaySounds->setWhatsThis (tr("Toggles whether sound should be played or not"));
197
 
 
 
211
                
198
212
                IconAction *actQuit = new IconAction (tr("Quit"), "psi/quit", tr("&Quit"), 0, this);
199
213
                actQuit->setWhatsThis (tr("Quits Psi"));
200
214
 
201
215
                IconAction *actTip = new IconAction (tr("Tip of the Day"), "psi/tip", tr("&Tip of the Day"), 0, this);
202
216
                actTip->setWhatsThis (tr("See many useful tips"));
203
217
 
 
218
                // TODO: probably we want to lock down filetransfer, right?
204
219
                IconAction *actFileTrans = new IconAction (tr("Transfer Manager"), "psi/filemanager", tr("Trans&fer Manager"), 0, this);
205
220
                actFileTrans->setWhatsThis (tr("Opens the Transfer Manager dialog"));
206
221
 
223
238
                createActionList( tr( "Menu Items" ), Actions_MainWin, actions );
224
239
        }
225
240
 
 
241
#ifdef USE_PEP
 
242
        {
 
243
                IconAction *actPublishTune = new IconAction (tr("Publish tune"), "psi/publishTune", tr("Publish &tune"), 0, this, 0, true);
 
244
                actPublishTune->setWhatsThis (tr("Toggles whether the currently playing tune should be published or not."));
 
245
 
 
246
                ActionNames actions[] = {
 
247
                        { "publish_tune", actPublishTune },
 
248
                        { "", 0 }
 
249
                };
 
250
 
 
251
                createActionList( tr( "Publish" ), Actions_MainWin, actions );
 
252
        }
 
253
#endif
 
254
 
226
255
        {
227
256
                // status actions
228
257
                IconActionGroup *statusGroup = new IconActionGroup ( this );
292
321
                IconAction *actOnlineHome = new IconAction (tr("Home Page (Online)"), tr("&Home Page (Online)"), 0, this);
293
322
                actOnlineHome->setWhatsThis (tr("Home Page (Online)"));
294
323
 
 
324
                IconAction *actPsiMUC = new IconAction (tr("Join Psi Discussion Room (Online)"), tr("&Join Psi Discussion Room (Online)"), 0, this);
 
325
                actOnlineHome->setWhatsThis (tr("Join Psi Discussion Room (Online)"));
 
326
 
295
327
                IconAction *actBugReport = new IconAction (tr("Report a Bug (Online)"), tr("Report a &Bug (Online)"), 0, this);
296
328
                actBugReport->setWhatsThis (tr("Report a Bug (Online)"));
297
329
 
298
 
                IconAction *actAbout = new IconAction (tr("About"), "psi/psi16", tr("&About"), 0, this);
 
330
                IconAction *actAbout = new IconAction (tr("About"), "psi/logo_16", tr("&About"), 0, this);
299
331
 
300
332
                IconAction *actAboutQt = new IconAction (tr("About Qt"), tr("About &Qt"), 0, this);
301
333
 
305
337
                        { "help_online_help", actOnlineHelp },
306
338
                        { "help_online_wiki", actOnlineWiki },
307
339
                        { "help_online_home", actOnlineHome },
 
340
                        { "help_psi_muc",     actPsiMUC     },
308
341
                        { "help_report_bug",  actBugReport  },
309
342
                        { "help_about",       actAbout      },
310
343
                        { "help_about_qt",    actAboutQt    },