- Added an open status entry into the tray menu

- fixed some menu glitches on the mac os platform.
This commit is contained in:
Klaas Freitag 2012-04-30 16:38:00 +02:00
parent c2f0459a36
commit f8efb1fc99
3 changed files with 16 additions and 3 deletions

View file

@ -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.

View file

@ -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

View file

@ -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