From b9228e64ff1b0311fb22dc217225bbd397b98435 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Thu, 15 Aug 2013 17:00:01 +0200 Subject: [PATCH] Make Folder Reset an expert option (F5) This feature should not be required, but might be helpful in the debugging process. --- src/mirall/accountsettings.cpp | 18 +++++++++++------- src/mirall/accountsettings.ui | 22 +--------------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/src/mirall/accountsettings.cpp b/src/mirall/accountsettings.cpp index 795e6b1a2..f18ded8d3 100644 --- a/src/mirall/accountsettings.cpp +++ b/src/mirall/accountsettings.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include namespace Mirall { @@ -53,13 +55,16 @@ AccountSettings::AccountSettings(QWidget *parent) : ui->_folderList->setEditTriggers( QAbstractItemView::NoEditTriggers ); ui->_ButtonRemove->setEnabled(false); - ui->_ButtonReset->setEnabled(false); ui->_ButtonEnable->setEnabled(false); ui->_ButtonInfo->setEnabled(false); ui->_ButtonAdd->setEnabled(true); + QAction *resetFolderAction = new QAction(this); + resetFolderAction->setShortcut(QKeySequence(Qt::Key_F5)); + connect(resetFolderAction, SIGNAL(triggered()), SLOT(slotResetCurrentFolder())); + addAction(resetFolderAction); + connect(ui->_ButtonRemove, SIGNAL(clicked()), this, SLOT(slotRemoveCurrentFolder())); - connect(ui->_ButtonReset, SIGNAL(clicked()), this, SLOT(slotResetCurrentFolder())); connect(ui->_ButtonEnable, SIGNAL(clicked()), this, SLOT(slotEnableCurrentFolder())); connect(ui->_ButtonInfo, SIGNAL(clicked()), this, SLOT(slotInfoAboutCurrentFolder())); connect(ui->_ButtonAdd, SIGNAL(clicked()), this, SLOT(slotAddFolder())); @@ -85,8 +90,6 @@ void AccountSettings::slotFolderActivated( const QModelIndex& indx ) bool state = indx.isValid(); ui->_ButtonRemove->setEnabled( state ); - ui->_ButtonReset->setEnabled( state ); - ui->_ButtonReset->setEnabled( state ); ui->_ButtonEnable->setEnabled( state ); ui->_ButtonInfo->setEnabled( state ); @@ -185,7 +188,6 @@ void AccountSettings::buttonsSetEnabled() bool isSelected = selected.isValid(); ui->_ButtonEnable->setEnabled(isSelected); - ui->_ButtonReset->setEnabled(isSelected); ui->_ButtonRemove->setEnabled(isSelected); ui->_ButtonInfo->setEnabled(isSelected); } @@ -260,8 +262,10 @@ void AccountSettings::slotResetCurrentFolder() QString alias = _model->data( selected, FolderStatusDelegate::FolderAliasRole ).toString(); int ret = QMessageBox::question( 0, tr("Confirm Folder Reset"), tr("

Do you really want to reset folder %1 and rebuild your client database?

" - "

Note: While no files will be removed, this can cause significant data " - "traffic and take several minutes to hours, depending on the size of the folder.

").arg(alias), + "

Note: This function is designed for maintenance purposes only. " + "No files will be removed, but this can cause significant data traffic and " + "take several minutes or hours to complete, depending on the size of the folder. " + "Only use this option if advised by your administrator.

").arg(alias), QMessageBox::Yes|QMessageBox::No ); if( ret == QMessageBox::Yes ) { FolderMan *folderMan = FolderMan::instance(); diff --git a/src/mirall/accountsettings.ui b/src/mirall/accountsettings.ui index b3aa33726..f701fd102 100644 --- a/src/mirall/accountsettings.ui +++ b/src/mirall/accountsettings.ui @@ -7,7 +7,7 @@ 0 0 607 - 385 + 382 @@ -85,19 +85,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -105,13 +92,6 @@ - - - - Reset - - -