- statusBar()->showMessage(tr("Not connected to core."));
- systray = new QSystemTrayIcon(this);
- systray->setIcon(QIcon(":/icons/quassel-icon.png"));
-
- QString toolTip("left click to minimize the quassel client to tray");
- systray->setToolTip(toolTip);
-
- QMenu *systrayMenu = new QMenu();
- systrayMenu->addAction(ui.actionAboutQuassel);
- systrayMenu->addSeparator();
- systrayMenu->addAction(ui.actionConnectCore);
- systrayMenu->addAction(ui.actionDisconnectCore);
- systrayMenu->addSeparator();
- systrayMenu->addAction(ui.actionQuit);
-
- systray->setContextMenu(systrayMenu);
-
- systray->show();
- connect(systray, SIGNAL(activated( QSystemTrayIcon::ActivationReason )),
- this, SLOT(systrayActivated( QSystemTrayIcon::ActivationReason )));
+void MainWin::updateIcon() {
+ QPixmap icon;
+ if(Client::isConnected())
+ icon = DesktopIcon("quassel", IconLoader::SizeEnormous);
+ else
+ icon = DesktopIcon("quassel_disconnected", IconLoader::SizeEnormous);
+ setWindowIcon(icon);
+ qApp->setWindowIcon(icon);
+ systemTrayIcon()->setIcon(icon);
+}
+
+void MainWin::setupActions() {
+ ActionCollection *coll = QtUi::actionCollection("General");
+ // File
+ coll->addAction("ConnectCore", new Action(SmallIcon("network-connect"), tr("&Connect to Core..."), coll,
+ this, SLOT(showCoreConnectionDlg())));
+ coll->addAction("DisconnectCore", new Action(SmallIcon("network-disconnect"), tr("&Disconnect from Core"), coll,
+ Client::instance(), SLOT(disconnectFromCore())));
+ coll->addAction("CoreInfo", new Action(SmallIcon("help-about"), tr("Core &Info..."), coll,
+ this, SLOT(showCoreInfoDlg())));
+ coll->addAction("EditNetworks", new Action(SmallIcon("configure"), tr("Edit &Networks..."), coll,
+ this, SLOT(on_actionEditNetworks_triggered())));
+ coll->addAction("Quit", new Action(SmallIcon("application-exit"), tr("&Quit"), coll,
+ qApp, SLOT(quit()), tr("Ctrl+Q")));
+
+ // View
+ coll->addAction("ManageBufferViews", new Action(SmallIcon("view-tree"), tr("&Manage Buffer Views..."), coll,
+ this, SLOT(on_actionManageViews_triggered())));
+ Action *lockAct = coll->addAction("LockDockPositions", new Action(tr("&Lock Dock Positions"), coll));
+ lockAct->setCheckable(true);
+ connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockDockPositions_toggled(bool)));
+
+ coll->addAction("ToggleSearchBar", new Action(SmallIcon("edit-find"), tr("Show &Search Bar"), coll,
+ 0, 0, tr("Ctrl+F")))->setCheckable(true);
+ coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
+ 0, 0))->setCheckable(true);
+
+ // Settings
+ coll->addAction("ConfigureQuassel", new Action(SmallIcon("configure"), tr("&Configure Quassel..."), coll,
+ this, SLOT(showSettingsDlg()), tr("F7")));
+
+ // Help
+ coll->addAction("AboutQuassel", new Action(SmallIcon("quassel"), tr("&About Quassel..."), coll,
+ this, SLOT(showAboutDlg())));
+ coll->addAction("AboutQt", new Action(QIcon(":/pics/qt-logo.png"), tr("About &Qt..."), coll,
+ qApp, SLOT(aboutQt())));
+ coll->addAction("DebugNetworkModel", new Action(SmallIcon("tools-report-bug"), tr("Debug &NetworkModel"), coll,
+ this, SLOT(on_actionDebugNetworkModel_triggered())));
+ coll->addAction("DebugMessageModel", new Action(SmallIcon("tools-report-bug"), tr("Debug &MessageModel"), coll,
+ this, SLOT(on_actionDebugMessageModel_triggered())));
+ coll->addAction("DebugLog", new Action(SmallIcon("tools-report-bug"), tr("Debug &Log"), coll,
+ this, SLOT(on_actionDebugLog_triggered())));
+}