358
359
ActionCollection *coll = QtUi::actionCollection("General", tr("General"));
360
coll->addAction("ConnectCore", new Action(SmallIcon("network-connect"), tr("&Connect to Core..."), coll,
361
coll->addAction("ConnectCore", new Action(QIcon::fromTheme("network-connect"), tr("&Connect to Core..."), coll,
361
362
this, SLOT(showCoreConnectionDlg())));
362
coll->addAction("DisconnectCore", new Action(SmallIcon("network-disconnect"), tr("&Disconnect from Core"), coll,
363
coll->addAction("DisconnectCore", new Action(QIcon::fromTheme("network-disconnect"), tr("&Disconnect from Core"), coll,
363
364
Client::instance(), SLOT(disconnectFromCore())));
364
coll->addAction("CoreInfo", new Action(SmallIcon("help-about"), tr("Core &Info..."), coll,
365
coll->addAction("ChangePassword", new Action(QIcon::fromTheme("dialog-password"), tr("Change &Password..."), coll,
366
this, SLOT(showChangePasswordDialog())));
367
coll->addAction("CoreInfo", new Action(QIcon::fromTheme("help-about"), tr("Core &Info..."), coll,
365
368
this, SLOT(showCoreInfoDlg())));
366
coll->addAction("ConfigureNetworks", new Action(SmallIcon("configure"), tr("Configure &Networks..."), coll,
369
coll->addAction("ConfigureNetworks", new Action(QIcon::fromTheme("configure"), tr("Configure &Networks..."), coll,
367
370
this, SLOT(on_actionConfigureNetworks_triggered())));
368
371
// FIXME: use QKeySequence::Quit once we depend on Qt 4.6
369
coll->addAction("Quit", new Action(SmallIcon("application-exit"), tr("&Quit"), coll,
372
coll->addAction("Quit", new Action(QIcon::fromTheme("application-exit"), tr("&Quit"), coll,
370
373
this, SLOT(quit()), Qt::CTRL + Qt::Key_Q));
377
380
lockAct->setCheckable(true);
378
381
connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool)));
380
coll->addAction("ToggleSearchBar", new Action(SmallIcon("edit-find"), tr("Show &Search Bar"), coll,
383
coll->addAction("ToggleSearchBar", new Action(QIcon::fromTheme("edit-find"), tr("Show &Search Bar"), coll,
381
384
0, 0, QKeySequence::Find))->setCheckable(true);
382
385
coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll,
383
386
this, SLOT(showAwayLog())));
384
coll->addAction("ToggleMenuBar", new Action(SmallIcon("show-menu"), tr("Show &Menubar"), coll,
387
coll->addAction("ToggleMenuBar", new Action(QIcon::fromTheme("show-menu"), tr("Show &Menubar"), coll,
385
388
0, 0, QKeySequence(Qt::CTRL + Qt::Key_M)))->setCheckable(true);
387
390
coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
388
391
0, 0))->setCheckable(true);
391
QAction *fullScreenAct = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll);
394
_fullScreenAction = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll);
393
QAction *fullScreenAct = new Action(SmallIcon("view-fullscreen"), tr("&Full Screen Mode"), coll,
396
_fullScreenAction = new Action(QIcon::fromTheme("view-fullscreen"), tr("&Full Screen Mode"), coll,
394
397
this, SLOT(onFullScreenToggled()), QKeySequence(Qt::Key_F11));
395
fullScreenAct->setCheckable(true);
398
_fullScreenAction->setCheckable(true);
399
coll->addAction("ToggleFullScreen", _fullScreenAction);
397
coll->addAction("ToggleFullScreen", fullScreenAct);
400
QAction *configureShortcutsAct = new Action(SmallIcon("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
403
QAction *configureShortcutsAct = new Action(QIcon::fromTheme("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
401
404
this, SLOT(showShortcutsDlg()));
402
405
configureShortcutsAct->setMenuRole(QAction::NoRole);
403
406
coll->addAction("ConfigureShortcuts", configureShortcutsAct);
406
QAction *configureQuasselAct = new Action(SmallIcon("configure"), tr("&Configure Quassel..."), coll,
409
QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
407
410
this, SLOT(showSettingsDlg()));
408
411
configureQuasselAct->setMenuRole(QAction::PreferencesRole);
410
QAction *configureQuasselAct = new Action(SmallIcon("configure"), tr("&Configure Quassel..."), coll,
413
QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
411
414
this, SLOT(showSettingsDlg()), QKeySequence(Qt::Key_F7));
413
416
coll->addAction("ConfigureQuassel", configureQuasselAct);
416
QAction *aboutQuasselAct = new Action(SmallIcon("quassel"), tr("&About Quassel"), coll,
419
QAction *aboutQuasselAct = new Action(QIcon(":/icons/quassel.png"), tr("&About Quassel"), coll,
417
420
this, SLOT(showAboutDlg()));
418
421
aboutQuasselAct->setMenuRole(QAction::AboutRole);
419
422
coll->addAction("AboutQuassel", aboutQuasselAct);
422
425
qApp, SLOT(aboutQt()));
423
426
aboutQtAct->setMenuRole(QAction::AboutQtRole);
424
427
coll->addAction("AboutQt", aboutQtAct);
425
coll->addAction("DebugNetworkModel", new Action(SmallIcon("tools-report-bug"), tr("Debug &NetworkModel"), coll,
428
coll->addAction("DebugNetworkModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &NetworkModel"), coll,
426
429
this, SLOT(on_actionDebugNetworkModel_triggered())));
427
coll->addAction("DebugBufferViewOverlay", new Action(SmallIcon("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll,
430
coll->addAction("DebugBufferViewOverlay", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll,
428
431
this, SLOT(on_actionDebugBufferViewOverlay_triggered())));
429
coll->addAction("DebugMessageModel", new Action(SmallIcon("tools-report-bug"), tr("Debug &MessageModel"), coll,
432
coll->addAction("DebugMessageModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &MessageModel"), coll,
430
433
this, SLOT(on_actionDebugMessageModel_triggered())));
431
coll->addAction("DebugHotList", new Action(SmallIcon("tools-report-bug"), tr("Debug &HotList"), coll,
434
coll->addAction("DebugHotList", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &HotList"), coll,
432
435
this, SLOT(on_actionDebugHotList_triggered())));
433
coll->addAction("DebugLog", new Action(SmallIcon("tools-report-bug"), tr("Debug &Log"), coll,
436
coll->addAction("DebugLog", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &Log"), coll,
434
437
this, SLOT(on_actionDebugLog_triggered())));
435
coll->addAction("ReloadStyle", new Action(SmallIcon("view-refresh"), tr("Reload Stylesheet"), coll,
438
coll->addAction("ReloadStyle", new Action(QIcon::fromTheme("view-refresh"), tr("Reload Stylesheet"), coll,
436
439
QtUi::style(), SLOT(reload()), QKeySequence::Refresh));
438
441
coll->addAction("HideCurrentBuffer", new Action(tr("Hide Current Buffer"), coll,
496
499
QKeySequence(jumpModifier + Qt::Key_9)))->setProperty("Index", 9);
498
501
// Buffer navigation
499
coll->addAction("NextBufferView", new Action(SmallIcon("go-next-view"), tr("Activate Next Chat List"), coll,
502
coll->addAction("NextBufferView", new Action(QIcon::fromTheme("go-next-view"), tr("Activate Next Chat List"), coll,
500
503
this, SLOT(nextBufferView()), QKeySequence(QKeySequence::Forward)));
501
coll->addAction("PreviousBufferView", new Action(SmallIcon("go-previous-view"), tr("Activate Previous Chat List"), coll,
504
coll->addAction("PreviousBufferView", new Action(QIcon::fromTheme("go-previous-view"), tr("Activate Previous Chat List"), coll,
502
505
this, SLOT(previousBufferView()), QKeySequence::Back));
503
coll->addAction("NextBuffer", new Action(SmallIcon("go-down"), tr("Go to Next Chat"), coll,
506
coll->addAction("NextBuffer", new Action(QIcon::fromTheme("go-down"), tr("Go to Next Chat"), coll,
504
507
this, SLOT(nextBuffer()), QKeySequence(Qt::ALT + Qt::Key_Down)));
505
coll->addAction("PreviousBuffer", new Action(SmallIcon("go-up"), tr("Go to Previous Chat"), coll,
508
coll->addAction("PreviousBuffer", new Action(QIcon::fromTheme("go-up"), tr("Go to Previous Chat"), coll,
506
509
this, SLOT(previousBuffer()), QKeySequence(Qt::ALT + Qt::Key_Up)));
741
void MainWin::showChangePasswordDialog()
743
if((Client::coreFeatures() & Quassel::PasswordChange)) {
745
QString newPassword = QInputDialog::getText(this, tr("Set Core Password"), tr("New password for your Quassel Core:"), QLineEdit::Password, QString(), &ok);
746
if (ok && !newPassword.isEmpty()) {
747
emit changePassword(newPassword);
751
QMessageBox box(QMessageBox::Warning, tr("Feature Not Supported"),
752
tr("<b>Your Quassel Core does not support this feature</b>"),
753
QMessageBox::Ok, this);
754
box.setInformativeText(tr("You need a Quassel Core v0.12.0 or newer in order to be able to remotely change your password."));
736
760
void MainWin::changeActiveBufferView(bool backwards)
738
762
BufferView *current = activeBufferView();
1393
1419
// Relying on QWidget::isFullScreen is discouraged, see the KToggleFullScreenAction docs
1394
1420
// Also, one should not use showFullScreen() or showNormal(), as those reset all other window flags
1396
QAction *action = QtUi::actionCollection("General")->action("ToggleFullScreen");
1400
1422
#ifdef HAVE_KDE
1401
KToggleFullScreenAction *kAct = static_cast<KToggleFullScreenAction *>(action);
1402
kAct->setFullScreen(this, kAct->isChecked());
1423
static_cast<KToggleFullScreenAction*>(_fullScreenAction)->setFullScreen(this, _fullScreenAction->isChecked());
1404
if (action->isChecked())
1425
if (_fullScreenAction->isChecked())
1405
1426
setWindowState(windowState() | Qt::WindowFullScreen);
1407
1428
setWindowState(windowState() & ~Qt::WindowFullScreen);