Added open ownCloud action to tray menu

This commit is contained in:
Klaas Freitag 2012-05-15 18:29:12 +02:00
parent 8510d1fc32
commit f9b060fe82
2 changed files with 14 additions and 2 deletions

View File

@ -250,6 +250,8 @@ void Application::slotAuthCheck( const QString& ,QNetworkReply *reply )
void Application::setupActions()
{
_actionOpenoC = new QAction(tr("Open ownCloud..."), this);
QObject::connect(_actionOpenoC, SIGNAL(triggered(bool)), SLOT(slotOpenOwnCloud()));
_actionOpenStatus = new QAction(tr("Open status..."), this);
QObject::connect(_actionOpenStatus, SIGNAL(triggered(bool)), SLOT(slotOpenStatus()));
_actionAddFolder = new QAction(tr("Add folder..."), this);
@ -284,13 +286,14 @@ void Application::setupContextMenu()
}
_contextMenu->setTitle(_theme->appName() );
_contextMenu->addAction(_actionOpenStatus);
_contextMenu->addAction(_actionOpenoC);
_contextMenu->addAction(_actionConfigure);
_contextMenu->addAction(_actionAddFolder);
_contextMenu->addSeparator();
// here all folders should be added
foreach (Folder *folder, _folderMan->map() ) {
QAction *action = new QAction( tr("open %1").arg( folder->alias()), this );
QAction *action = new QAction( tr("open folder %1").arg( folder->alias()), this );
action->setIcon( _theme->trayFolderIcon( folder->backend()) );
connect( action, SIGNAL(triggered()),_folderOpenActionMapper,SLOT(map()));
@ -319,6 +322,14 @@ void Application::slotFolderOpenAction( const QString& alias )
}
}
void Application::slotOpenOwnCloud()
{
MirallConfigFile cfgFile;
QString url = cfgFile.ownCloudUrl();
QDesktopServices::openUrl( url );
}
void Application::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
{
// A click on the tray icon should only open the status window on Win and

View File

@ -73,7 +73,7 @@ protected:
protected slots:
void slotTrayClicked( QSystemTrayIcon::ActivationReason );
void slotFolderOpenAction(const QString & );
void slotOpenOwnCloud();
void slotStartFolderSetup();
void slotOwnCloudFound( const QString&, const QString&, const QString&, const QString& );
void slotNoOwnCloudFound( QNetworkReply* );
@ -89,6 +89,7 @@ private:
QAction *_actionAddFolder;
QAction *_actionOpenStatus;
QAction *_actionConfigure;
QAction *_actionOpenoC;
#if QT_VERSION >= 0x040700
QNetworkConfigurationManager *_networkMgr;