From f8efb1fc990d3d4983abffb80f750853f3d3e271 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Mon, 30 Apr 2012 16:38:00 +0200 Subject: [PATCH] - Added an open status entry into the tray menu - fixed some menu glitches on the mac os platform. --- src/mirall/application.cpp | 13 ++++++++++++- src/mirall/application.h | 2 ++ src/mirall/statusdialog.cpp | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp index 1eb8340cd..4960f98cc 100644 --- a/src/mirall/application.cpp +++ b/src/mirall/application.cpp @@ -257,6 +257,8 @@ void Application::slotHideSplash() void Application::setupActions() { + _actionOpenStatus = new QAction(tr("Open status..."), this); + QObject::connect(_actionOpenStatus, SIGNAL(triggered(bool)), SLOT(slotOpenStatus())); _actionAddFolder = new QAction(tr("Add folder..."), this); QObject::connect(_actionAddFolder, SIGNAL(triggered(bool)), SLOT(slotAddFolder())); _actionConfigure = new QAction(tr("Configure..."), this); @@ -288,6 +290,7 @@ void Application::setupContextMenu() _contextMenu = new QMenu(); } _contextMenu->setTitle(_theme->appName() ); + _contextMenu->addAction(_actionOpenStatus); _contextMenu->addAction(_actionConfigure); _contextMenu->addAction(_actionAddFolder); _contextMenu->addSeparator(); @@ -339,9 +342,10 @@ void Application::slotTrayClicked( QSystemTrayIcon::ActivationReason reason ) _owncloudSetupWizard->startWizard(); } else { qDebug() << "#============# Status dialog starting #=============#"; - +#if defined Q_WS_WIN || defined Q_WS_X11 _statusDialog->setFolderList( _folderMan->map() ); _statusDialog->show(); +#endif } } } @@ -400,6 +404,13 @@ void Application::slotAddFolder() _folderMan->restoreEnabledFolders(); } +void Application::slotOpenStatus() +{ + if( ! _statusDialog ) return; + _statusDialog->setFolderList( _folderMan->map() ); + _statusDialog->show(); +} + /* * the folder is to be removed. The slot is called from a signal emitted by * the status dialog, which removes the folder from its list by itself. diff --git a/src/mirall/application.h b/src/mirall/application.h index d4506c86e..c4ac4048c 100644 --- a/src/mirall/application.h +++ b/src/mirall/application.h @@ -51,6 +51,7 @@ signals: protected slots: void slotAddFolder(); + void slotOpenStatus(); void slotRemoveFolder( const QString& ); #ifdef HAVE_FETCH_AND_PUSH void slotFetchFolder( const QString& ); @@ -88,6 +89,7 @@ private: QSystemTrayIcon *_tray; QAction *_actionQuit; QAction *_actionAddFolder; + QAction *_actionOpenStatus; QAction *_actionConfigure; #if QT_VERSION >= 0x040700 diff --git a/src/mirall/statusdialog.cpp b/src/mirall/statusdialog.cpp index 9c6d52917..643675f67 100644 --- a/src/mirall/statusdialog.cpp +++ b/src/mirall/statusdialog.cpp @@ -206,11 +206,11 @@ StatusDialog::StatusDialog( Theme *theme, QWidget *parent) : connect(_ownCloudInfo, SIGNAL(noOwncloudFound(QNetworkReply*)), this, SLOT(slotOCInfoFail(QNetworkReply*))); -#if defined Q_WS_X11 || defined Q_WS_MAC +#if defined Q_WS_X11 connect(_folderList, SIGNAL(activated(QModelIndex)), SLOT(slotFolderActivated(QModelIndex))); connect( _folderList,SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex))); #endif -#ifdef Q_WS_WIN +#if defined Q_WS_WIN || defined Q_WS_MAC connect(_folderList, SIGNAL(clicked(QModelIndex)), SLOT(slotFolderActivated(QModelIndex))); connect( _folderList,SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex))); #endif