diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2014-10-26 16:07:44 +0000 |
|---|---|---|
| committer | Anton <anton@picapica> | 2014-10-26 20:12:10 +0400 |
| commit | c1bea284db936776189f5e9d8f030b6e5ef98ebf (patch) | |
| tree | b5a8c96164129ba79a262721a4de6a22002b2953 | |
| parent | ddb55736240c67ddc28ee7becb78c8a77f54a6d1 (diff) | |
| download | pica-pica-c1bea284db936776189f5e9d8f030b6e5ef98ebf.tar.gz pica-pica-c1bea284db936776189f5e9d8f030b6e5ef98ebf.zip | |
Added item "Activate" in systray menu for Unity
git-svn-id: svn://localhost/project_picapica/trunk@334 fb96df88-216d-11de-830c-f3023f12d8ac
| -rw-r--r-- | pica-client/globals.h | 1 | ||||
| -rw-r--r-- | pica-client/main.cpp | 2 | ||||
| -rw-r--r-- | pica-client/msguirouter.cpp | 10 | ||||
| -rw-r--r-- | pica-client/picasystray.cpp | 8 |
4 files changed, 20 insertions, 1 deletions
diff --git a/pica-client/globals.h b/pica-client/globals.h index 660e764..875bd83 100644 --- a/pica-client/globals.h +++ b/pica-client/globals.h @@ -29,4 +29,5 @@ extern class PicaActionCenter *action_center; extern class PicaSysTray *systray; extern class FileTransferController *ftctrl; extern class QString snd_newmessage; +extern class AccountsWindow *accwindow; #endif // GLOBALS_H diff --git a/pica-client/main.cpp b/pica-client/main.cpp index 5b15667..7df81ce 100644 --- a/pica-client/main.cpp +++ b/pica-client/main.cpp @@ -29,6 +29,7 @@ QIcon picapica_ico_fly; class PicaActionCenter *action_center; class PicaSysTray *systray; class FileTransferController *ftctrl; +class AccountsWindow *accwindow; // /usr/share/pica-client/pica-pica_CA.pem //QString config_defaultCA("/home/root_jr/files/projects/picapica_wc/localhost/project_picapica/trunk/tests/trusted_CA.pem"); @@ -468,6 +469,7 @@ int main(int argc, char *argv[]) action_center = ∾ AccountsWindow aw; + accwindow = &aw; SkyNet s; skynet=&s; diff --git a/pica-client/msguirouter.cpp b/pica-client/msguirouter.cpp index 4cb7771..3264490 100644 --- a/pica-client/msguirouter.cpp +++ b/pica-client/msguirouter.cpp @@ -2,6 +2,7 @@ #include "dialogs/forgedcertdialog.h" #include "history.h" #include "mainwindow.h" +#include "accountswindow.h" #include "picasystray.h" #include "globals.h" #include "sound.h" @@ -29,6 +30,15 @@ MsgUIRouter::MsgUIRouter(QObject *parent) : void MsgUIRouter::trayicon_dclick() { + if (mainwindow == NULL) + { + accwindow->showNormal(); + accwindow->activateWindow(); + accwindow->raise(); + return; + } + + if (blinkqueue.isEmpty()) { mainwindow->showNormal(); diff --git a/pica-client/picasystray.cpp b/pica-client/picasystray.cpp index 1f9d1da..8bc1e10 100644 --- a/pica-client/picasystray.cpp +++ b/pica-client/picasystray.cpp @@ -14,8 +14,14 @@ PicaSysTray::PicaSysTray(QObject *parent) : { systrayMenu_ = new QMenu(); + //Unity cannot into doubleclick on tray icon... :( + QAction *activate = new QAction(tr("&Activate"), this); + connect(activate, SIGNAL(triggered()), this, SIGNAL(doubleclicked())); + + systrayMenu_->addAction(action_center->AboutAct()); systrayMenu_->addAction(action_center->MuteSoundsAct()); + systrayMenu_->addAction(activate); systrayMenu_->addSeparator(); systrayMenu_->addAction(action_center->ExitAct()); @@ -34,7 +40,7 @@ PicaSysTray::PicaSysTray(QObject *parent) : void PicaSysTray::systray_activated(QSystemTrayIcon::ActivationReason r) { - if (r == QSystemTrayIcon::DoubleClick && mainwindow!=NULL) + if (r == QSystemTrayIcon::DoubleClick) { emit doubleclicked(); } |
