Account settings: Double click no longer open in the file browser #3585

Add a separate option in the context menu for it
This commit is contained in:
Olivier Goffart 2015-08-13 11:53:00 +02:00
parent 5685aa7ff0
commit 6fcb48a0c7
2 changed files with 9 additions and 7 deletions

View file

@ -102,7 +102,6 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent) :
addAction(syncNowAction);
connect(ui->_folderList, SIGNAL(clicked(QModelIndex)), SLOT(slotFolderActivated(QModelIndex)));
connect(ui->_folderList, SIGNAL(doubleClicked(QModelIndex)),SLOT(slotDoubleClicked(QModelIndex)));
connect(ui->selectiveSyncApply, SIGNAL(clicked()), _model, SLOT(slotApplySelectiveSync()));
connect(ui->selectiveSyncCancel, SIGNAL(clicked()), _model, SLOT(resetFolders()));
@ -161,6 +160,8 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
this, SLOT(slotRemoveCurrentFolder()));
connect(menu->addAction(folderPaused ? tr("Resume") : tr("Pause")), SIGNAL(triggered(bool)),
this, SLOT(slotEnableCurrentFolder()));
connect(menu->addAction(tr("Open folder in file browser")), SIGNAL(triggered(bool)),
this, SLOT(slotOpenCurrentFolder()));
menu->exec(tv->mapToGlobal(pos));
}
@ -296,14 +297,15 @@ void AccountSettings::slotResetCurrentFolder()
}
}
void AccountSettings::slotDoubleClicked( const QModelIndex& indx )
void AccountSettings::slotOpenCurrentFolder()
{
if( ! indx.isValid() ) return;
QString alias = _model->data( indx, FolderStatusDelegate::FolderAliasRole ).toString();
if (alias.isEmpty()) return;
QModelIndex selected = ui->_folderList->selectionModel()->currentIndex();
if( selected.isValid() ) {
QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString();
emit openFolderAlias(alias);
}
}
void AccountSettings::showConnectionLabel( const QString& message, QStringList errors )
{

View file

@ -65,7 +65,6 @@ signals:
public slots:
void slotFolderActivated( const QModelIndex& );
void slotOpenOC();
void slotDoubleClicked( const QModelIndex& );
void slotUpdateQuota( qint64,qint64 );
void slotAccountStateChanged(int state);
@ -77,6 +76,7 @@ protected slots:
void slotSyncCurrentFolderNow();
void slotRemoveCurrentFolder();
void slotResetCurrentFolder();
void slotOpenCurrentFolder();
void slotFolderWizardAccepted();
void slotFolderWizardRejected();
void slotDeleteAccount();