144
154
void KBBMainWindow::initActions()
146
156
// Prepare and create XML GUI
147
fileQuit = KStdAction::quit( this,
157
fileQuit = KStandardAction::quit( this,
148
158
SLOT( close() ), actionCollection() );
149
159
fileQuit->setToolTip( i18n( "Quit KBugBuster" ) );
151
new KAction( i18n("See &Pending Changes"), "contents", 0, this, SLOT( slotListChanges() ),
152
actionCollection(), "file_seechanges" );
153
new KAction( i18n("&Submit Changes"), "mail_send", 0, this, SLOT( slotSubmit() ),
154
actionCollection(), "file_submit" );
156
reloadpacklist = new KAction( i18n("Reload &Product List"), "reload", CTRL+Qt::Key_F5, m_mainWidget, SLOT( slotReloadPackageList() ),
157
actionCollection(), "reload_packagelist" );
158
reloadpack= new KAction( i18n("Reload Bug &List (for current product)"), "reload", Qt::Key_F5, m_mainWidget, SLOT( slotReloadPackage() ),
159
actionCollection(), "reload_package" );
160
reloadbug = new KAction( i18n("Reload Bug &Details (for current bug)"), "reload", SHIFT+Qt::Key_F5, m_mainWidget, SLOT( slotReloadBug() ),
161
actionCollection(), "reload_bug" );
162
loadMyBugs = new KAction( i18n( "Load &My Bugs List" ), 0, m_mainWidget, SLOT( slotLoadMyBugs() ),
163
actionCollection(), "load_my_bugs" );
164
reloadall = new KAction( i18n("Load All Bug Details (for current product)"), Qt::Key_F6, m_mainWidget, SLOT( slotRetrieveAllBugDetails() ), actionCollection(), "load_allbugs" );
165
new KAction( i18n("Extract &Attachments"), "filesave", Qt::Key_F4, m_mainWidget, SLOT( slotExtractAttachments() ),
166
actionCollection(), "extract_attachments" );
168
new KAction( i18n("Clear Cache"), 0, this, SLOT( clearCache() ),
169
actionCollection(), "clear_cache" );
171
new KAction( i18n("&Search by Product..."), "goto", CTRL+Qt::Key_P, this,
172
SLOT( searchPackage() ), actionCollection(), "search_package" );
173
new KAction( i18n("Search by Bug &Number..."), "filefind", CTRL+Qt::Key_N, this,
174
SLOT( searchBugNumber() ), actionCollection(), "search_bugnumber" );
161
QAction *action = actionCollection()->addAction( "file_seechanges" );
162
action->setIcon( KIcon("document-preview") );
163
action->setText( i18n("See &Pending Changes") );
164
connect(action, SIGNAL(triggered(bool)), SLOT( slotListChanges() ));
165
action = actionCollection()->addAction( "file_submit" );
166
action->setIcon( KIcon("mail-send") );
167
action->setText( i18n("&Submit Changes") );
168
connect(action, SIGNAL(triggered(bool)), SLOT( slotSubmit() ));
170
reloadpacklist = actionCollection()->addAction( "reload_packagelist" );
171
reloadpacklist->setIcon( KIcon("view-refresh") );
172
reloadpacklist->setText( i18n("Reload &Product List") );
173
connect(reloadpacklist, SIGNAL(triggered(bool)), m_mainWidget, SLOT( slotReloadPackageList() ));
174
reloadpacklist->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_F5));
175
reloadpack = actionCollection()->addAction( "reload_package" );
176
reloadpack->setIcon( KIcon("view-refresh") );
177
reloadpack->setText( i18n("Reload Bug &List (for current product)") );
178
connect(reloadpack, SIGNAL(triggered(bool)), m_mainWidget, SLOT( slotReloadPackage() ));
179
reloadpack->setShortcut(QKeySequence(Qt::Key_F5));
180
reloadbug = actionCollection()->addAction( "reload_bug" );
181
reloadbug->setIcon( KIcon("view-refresh") );
182
reloadbug->setText( i18n("Reload Bug &Details (for current bug)") );
183
connect(reloadbug, SIGNAL(triggered(bool)), m_mainWidget, SLOT( slotReloadBug() ));
184
reloadbug->setShortcut(QKeySequence(Qt::SHIFT+Qt::Key_F5));
185
loadMyBugs = actionCollection()->addAction( "load_my_bugs" );
186
loadMyBugs->setText( i18n( "Load &My Bugs List" ) );
187
connect(loadMyBugs, SIGNAL(triggered(bool) ), m_mainWidget, SLOT( slotLoadMyBugs() ));
188
reloadall = actionCollection()->addAction( "load_allbugs" );
189
reloadall->setText( i18n("Load All Bug Details (for current product)") );
190
connect(reloadall, SIGNAL(triggered(bool) ), m_mainWidget, SLOT( slotRetrieveAllBugDetails() ));
191
reloadall->setShortcut(QKeySequence(Qt::Key_F6));
192
action = actionCollection()->addAction( "extract_attachments" );
193
action->setIcon( KIcon("document-save") );
194
action->setText( i18n("Extract &Attachments") );
195
connect(action, SIGNAL(triggered(bool)), m_mainWidget, SLOT( slotExtractAttachments() ));
196
action->setShortcut(QKeySequence(Qt::Key_F4));
198
action = actionCollection()->addAction( "clear_cache" );
199
action->setText( i18n("Clear Cache") );
200
connect(action, SIGNAL(triggered(bool) ), SLOT( clearCache() ));
202
action = actionCollection()->addAction( "search_package" );
203
action->setIcon( KIcon("go-jump") );
204
action->setText( i18n("&Search by Product...") );
205
connect(action, SIGNAL(triggered(bool)), SLOT( searchPackage() ));
206
action->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_P));
207
action = actionCollection()->addAction( "search_bugnumber" );
208
action->setIcon( KIcon("edit-find") );
209
action->setText( i18n("Search by Bug &Number...") );
210
connect(action, SIGNAL(triggered(bool)), SLOT( searchBugNumber() ));
211
action->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_N));
175
212
// For now "Description" searches by title. Maybe later we can have a
176
213
// full-text search interfacing bugs.kde.org and rename the current one to "By Title".
177
new KAction( i18n("Search by &Description...") ,"find", CTRL+Qt::Key_D, this,
178
SLOT( searchDescription() ), actionCollection(), "search_description" );
214
action = actionCollection()->addAction( "search_description" );
215
action->setIcon( KIcon("edit-find") );
216
action->setText( i18n("Search by &Description...") );
217
connect(action, SIGNAL(triggered(bool)), SLOT( searchDescription() ));
218
action->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_D));
180
// new KAction( i18n("&Merge"), "view_remove", CTRL+Qt::Key_M, m_mainWidget,
220
// new KAction( i18n("&Merge"), "view-close", CTRL+Qt::Key_M, m_mainWidget,
181
221
// SLOT( mergeBugs() ), actionCollection(), "cmd_merge" );
182
// new KAction( i18n("&Unmerge"), "view_top_bottom", CTRL+SHIFT+Qt::Key_M, m_mainWidget,
222
// new KAction( i18n("&Unmerge"), "view-split-top-bottom", CTRL+SHIFT+Qt::Key_M, m_mainWidget,
183
223
// SLOT( unmergeBugs() ), actionCollection(), "cmd_unmerge" );
184
new KAction( i18n("C&lose..."), "edittrash", CTRL+Qt::Key_L, m_mainWidget,
185
SLOT( closeBug() ), actionCollection(), "cmd_close" );
186
// new KAction( i18n("Clos&e Silently"), "edittrash", CTRL+Qt::Key_E, m_mainWidget,
224
action = actionCollection()->addAction( "cmd_close" );
225
action->setIcon( KIcon("user-trash") );
226
action->setText( i18n("C&lose...") );
227
connect(action, SIGNAL(triggered(bool)), m_mainWidget, SLOT( closeBug() ));
228
action->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_L));
229
// new KAction( i18n("Clos&e Silently"), "user-trash", CTRL+Qt::Key_E, m_mainWidget,
187
230
// SLOT( closeBugSilently() ), actionCollection(), "cmd_close_silently" );
188
new KAction( i18n("Re&open"), "idea", CTRL+Qt::Key_O, m_mainWidget,
189
SLOT( reopenBug() ), actionCollection(), "cmd_reopen" );
190
// new KAction( i18n("Re&assign..."), "folder_new", CTRL+Qt::Key_A, m_mainWidget,
231
action = actionCollection()->addAction( "cmd_reopen" );
232
action->setIcon( KIcon("edit-redo") );
233
action->setText( i18n("Re&open") );
234
connect(action, SIGNAL(triggered(bool)), m_mainWidget, SLOT( reopenBug() ));
235
action->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_O));
236
// new KAction( i18n("Re&assign..."), "folder-new", CTRL+Qt::Key_A, m_mainWidget,
191
237
// SLOT( reassignBug() ), actionCollection(), "cmd_reassign" );
192
// new KAction( i18n("Change &Title..."), "text_under", CTRL+Qt::Key_T, m_mainWidget,
238
// new KAction( i18n("Change &Title..."), "edit-rename", CTRL+Qt::Key_T, m_mainWidget,
193
239
// SLOT( titleBug() ), actionCollection(), "cmd_title" );
194
// new KAction( i18n("Change &Severity..."), "edit", CTRL+Qt::Key_S, m_mainWidget,
240
// new KAction( i18n("Change &Severity..."), "document-properties", CTRL+Qt::Key_S, m_mainWidget,
195
241
// SLOT( severityBug() ), actionCollection(), "cmd_severity" );
196
new KAction( i18n("&Reply..."), "mail_replyall",CTRL+Qt::Key_R , m_mainWidget,
197
SLOT( replyBug() ), actionCollection(), "cmd_reply" );
198
new KAction( i18n("Reply &Privately..."), "mail_reply", CTRL+Qt::Key_I, m_mainWidget,
199
SLOT( replyPrivateBug() ), actionCollection(), "cmd_replyprivate" );
242
action = actionCollection()->addAction( "cmd_reply" );
243
action->setIcon( KIcon("mail-reply-all") );
244
action->setText( i18n("&Reply...") );
245
connect(action, SIGNAL(triggered(bool)), m_mainWidget, SLOT( replyBug() ));
246
action->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_R));
247
action = actionCollection()->addAction( "cmd_replyprivate" );
248
action->setIcon( KIcon("mail-reply-sender") );
249
action->setText( i18n("Reply &Privately...") );
250
connect(action, SIGNAL(triggered(bool)), m_mainWidget, SLOT( replyPrivateBug() ));
251
action->setShortcut(QKeySequence(Qt::CTRL+Qt::Key_I));
201
KStdAction::showMenubar(this, SLOT( slotToggleMenubar() ), actionCollection() );
202
#if KDE_IS_VERSION( 3, 1, 90 )
253
KStandardAction::showMenubar(this, SLOT( slotToggleMenubar() ), actionCollection() );
203
254
createStandardStatusBarAction();
204
255
setStandardToolBarMenuEnabled(true);
207
m_disconnectedAction = new KToggleAction( i18n("&Disconnected Mode"), 0,
209
SLOT( slotDisconnectedAction() ),
211
"settings_disconnected" );
257
m_disconnectedAction = actionCollection()->add<KToggleAction>( "settings_disconnected" );
258
m_disconnectedAction->setText( i18n("&Disconnected Mode") );
259
connect(m_disconnectedAction, SIGNAL(triggered(bool)), SLOT( slotDisconnectedAction() ));
212
260
m_disconnectedAction->setChecked( BugSystem::self()->disconnected() );
214
262
// Bookmarks menu
215
m_pamBookmarks = new KActionMenu( i18n( "&Bookmarks" ), "bookmark", actionCollection(), "bookmarks" );
216
m_pBookmarkMenu = new KBookmarkMenu( KBBBookmarkManager::self(), this, m_pamBookmarks->popupMenu(), actionCollection(), true );
218
KStdAction::preferences( this, SLOT(preferences()), actionCollection() );
220
KToggleAction *toggleTmp = new KToggleAction( i18n("Show Closed Bugs"), "recycled", 0, this, SLOT( slotToggleDone() ),
221
actionCollection(), "cmd_toggle_done" );
222
#if KDE_IS_VERSION( 3, 2, 90 )
223
toggleTmp->setCheckedState(i18n("Hide Closed Bugs"));
263
m_pamBookmarks = actionCollection()->add<KActionMenu>( "bookmarks" );
264
m_pamBookmarks->setText( i18n( "&Bookmarks" ) );
265
m_pBookmarkMenu = new KBookmarkMenu( KBBBookmarkManager::self(), this, m_pamBookmarks->menu(), actionCollection() );
267
KStandardAction::preferences( this, SLOT(preferences()), actionCollection() );
269
KToggleAction *toggleTmp = actionCollection()->add<KToggleAction>( "cmd_toggle_done" );
270
toggleTmp->setIcon( KIcon("view-filter") );
271
toggleTmp->setText( i18n("Show Closed Bugs") );
272
connect(toggleTmp, SIGNAL(triggered(bool) ), SLOT( slotToggleDone() ));
273
toggleTmp->setCheckedState(KGuiItem(i18n("Hide Closed Bugs")));
225
274
toggleTmp->setChecked( KBBPrefs::instance()->mShowClosedBugs );
227
toggleTmp =new KToggleAction( i18n("Show Wishes"), "bookmark", 0, this, SLOT( slotToggleWishes() ),
228
actionCollection(), "cmd_toggle_wishes" );
229
#if KDE_IS_VERSION( 3, 2, 90 )
230
toggleTmp->setCheckedState(i18n("Hide Wishes"));
276
toggleTmp = actionCollection()->add<KToggleAction>( "cmd_toggle_wishes" );
277
toggleTmp->setIcon( KIcon("view-history") );
278
toggleTmp->setText( i18n("Show Wishes") );
279
connect(toggleTmp, SIGNAL(triggered(bool) ), SLOT( slotToggleWishes() ));
280
toggleTmp->setCheckedState(KGuiItem(i18n("Hide Wishes")));
232
281
toggleTmp->setChecked(KBBPrefs::instance()->mShowWishes);
234
mSelectServerAction = new KSelectAction( i18n( "Select Server" ), 0, 0,
236
SLOT( slotSelectServer() ),
283
mSelectServerAction = actionCollection()->add<KSelectAction>( "select_server", this, SLOT( slotSelectServer() ) );
284
mSelectServerAction->setText( i18n( "Select Server" ) );
240
285
setupSelectServerAction();
242
287
if ( KBBPrefs::instance()->mDebugMode ) {
243
new KAction( i18n("Show Last Server Response..."), 0 , this,
244
SLOT( showLastResponse() ), actionCollection(),
245
"debug_lastresponse" );
246
new KAction( i18n("Show Bug HTML Source..."), 0 , this,
247
SLOT( showBugSource() ), actionCollection(),
248
"debug_showbugsource" );
288
action = actionCollection()->addAction( "debug_lastresponse" );
289
action->setText( i18n("Show Last Server Response...") );
290
connect(action, SIGNAL(triggered(bool) ), SLOT( showLastResponse() ));
291
action = actionCollection()->addAction( "debug_showbugsource" );
292
action->setText( i18n("Show Bug HTML Source...") );
293
connect(action, SIGNAL(triggered(bool) ), SLOT( showBugSource() ));
251
#if KDE_IS_VERSION( 3, 2, 90 )
252
296
setupGUI( (ToolBar | Keys | StatusBar | Save | Create ), "kbugbusterui.rc" );
258
299
void KBBMainWindow::slotToggleMenubar()