mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Added open ownCloud action to tray menu
This commit is contained in:
parent
8510d1fc32
commit
f9b060fe82
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user