void Stick20ResponseTask::ShowIconMessage (const QString msg) { QString title = QString ("Nitrokey App"); int timeout = 3000; #ifdef HAVE_LIBAPPINDICATOR if (isUnity ()) { if (!notify_init ("example")) return; NotifyNotification* notf; notf = notify_notification_new (title.toUtf8 ().data (), msg.toUtf8 ().data (), NULL); notify_notification_show (notf, NULL); notify_uninit (); } else #endif // HAVE_LIBAPPINDICATOR { if (TRUE == trayIcon->supportsMessages ()) { trayIcon->showMessage (title, msg, QSystemTrayIcon::Information, timeout); } else csApplet->messageBox (msg); } }
void SystemTrayMenu::updateMainMenu() { this->clear(); this->addAction(QIcon::fromTheme("help-contents"), gettext("Online &Help!")); this->addSeparator(); QString currentIM = this->doUpdateIMListMenu(mIMList); this->addSeparator(); if (currentIM=="fcitx-kbd") { this->doUpdateVKListMenu(mVKList); this->addSeparator(); } if (currentIM =="/Fcitx/im/mozc") { this->doUpdateMozcHiraganaListMenu(mMozcHiraganaList); this->doUpdateMozcToolListMenu(mMozcToolList); this->addSeparator(); } else { foreach(const KimpanelProperty &prop, this->mStatusMenuList) { MyAction *menu=NULL; if(prop.icon.contains(PREFIX "/share/fcitx")) menu = new MyAction(QIcon(prop.icon), prop.label, this); else menu = new MyAction(QIcon::fromTheme(prop.icon), prop.label, this); menu->setMyActionType(StatusAction); menu->setProp(prop); this->addAction(menu); } this->addSeparator(); } this->addAction(QIcon::fromTheme("preferences-desktop"), gettext("ConfigureFcitx")); this->addAction(QIcon::fromTheme("preferences-desktop"), gettext("ConfigureIMPanel")); this->addSeparator(); if (isUnity()) { this->addAction(gettext("Character Map")); this->addAction(gettext("Keyboard Layout Chart")); this->addAction(gettext("Text Entry Settings...")); this->addSeparator(); } doUpdateSkinListMenu(); }