diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-05 21:43:37 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-12-05 21:43:37 +0000 |
commit | aea385e615a7442f8d78d6297ccd8bd20d5f6237 (patch) | |
tree | dedea2603262e5f4749527c1a005ce628e0b3b59 | |
parent | added import of private and/or public from older gpg4usb to wizard (diff) | |
download | gpg4usb-aea385e615a7442f8d78d6297ccd8bd20d5f6237.tar.gz gpg4usb-aea385e615a7442f8d78d6297ccd8bd20d5f6237.zip |
remove everything system tray related from trunk
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@655 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | mainwindow.cpp | 53 | ||||
-rw-r--r-- | mainwindow.h | 9 |
2 files changed, 0 insertions, 62 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp index 2a0fba4..75879f8 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -54,7 +54,6 @@ MainWindow::MainWindow() createToolBars(); createStatusBar(); createDockWindows(); - createTrayIcon(); mKeyList->addMenuAction(appendSelectedKeysAct); mKeyList->addMenuAction(copyMailAddressToClipboardAct); @@ -73,7 +72,6 @@ MainWindow::MainWindow() edit->curTextPage()->setFocus(); this->setWindowTitle(qApp->applicationName()); this->show(); - trayIcon->show(); // Show wizard, if the don't show wizard message box wasn't checked // and keylist doesn't contain a private key @@ -478,45 +476,6 @@ void MainWindow::createDockWindows() } } -void MainWindow::createTrayIcon() { - - QAction* minimizeAction = new QAction(tr("Mi&nimize"), this); - connect(minimizeAction, SIGNAL(triggered()), this, SLOT(hide())); - - QAction* maximizeAction = new QAction(tr("Ma&ximize"), this); - connect(maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized())); - - QAction* restoreAction = new QAction(tr("&Restore"), this); - connect(restoreAction, SIGNAL(triggered()), this, SLOT(showNormal())); - - QAction* quitAction = new QAction(tr("&Quit"), this); - connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); - - trayIconMenu = new QMenu(this); - trayIconMenu->addAction(minimizeAction); - //trayIconMenu->addAction(maximizeAction); - trayIconMenu->addAction(restoreAction); - trayIconMenu->addSeparator(); - trayIconMenu->addAction(quitAction); - - - trayIcon = new QSystemTrayIcon(this); - - QIcon icon(":/tray.png"); - trayIcon->setIcon(icon); - /*QByteArray category = qgetenv("SNI_CATEGORY"); - if (!category.isEmpty()) { - trayIcon->setProperty("_qt_sni_category", QString::fromLocal8Bit(category)); - }*/ - trayIcon->setProperty("_qt_sni_category", qApp->applicationDirPath() + "/tmp"); - trayIcon->setContextMenu(trayIconMenu); -} - -void MainWindow::showTrayMessage(QString title, QString body) { - QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::MessageIcon(QSystemTrayIcon::Information); - trayIcon->showMessage(title, body, icon, 15000); -} - void MainWindow::createAttachmentDock() { if (attachmentDockCreated) { return; @@ -545,18 +504,6 @@ void MainWindow::closeAttachmentDock() { void MainWindow::closeEvent(QCloseEvent *event) { - // TODO: if close via tray, check for unsaved documents - if (trayIcon->isVisible()) { - - showTrayMessage(tr("GPG4USB still alive"), tr("gpg4usb will keep running in the " - "system tray. To terminate the program, " - "choose <b>Quit</b> in the context menu " - "of the system tray entry.")); - - hide(); - event->ignore(); - return; - } /* * ask to save changes, if there are * modified documents in any tab diff --git a/mainwindow.h b/mainwindow.h index 2dbd48c..89e2046 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -190,12 +190,6 @@ private: void createDockWindows(); /** - * @details Create icon for system tray - */ - void createTrayIcon(); - void showTrayMessage(QString title, QString body); - - /** * @details Create attachment-dockwindow. */ void createAttachmentDock(); @@ -239,9 +233,6 @@ private: QDockWidget *attachmentDock; /** Attachment Dock */ QDialog *genkeyDialog; /** Dialog for key generation */ - QSystemTrayIcon *trayIcon; - QMenu *trayIconMenu; - QAction *newTabAct; /** Action to create new tab */ QAction *switchTabUpAct; /** Action to switch tab up*/ QAction *switchTabDownAct; /** Action to switch tab down */ |