mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Avoid quick flickering up of the ok-icon for the sync prepare state.
For the SyncPrepare phase now the icon that was displayed before is kept. If the folder was disabled before, the sync icon is displayed.
This commit is contained in:
parent
89cfa387cd
commit
a3927c5c2c
2 changed files with 21 additions and 5 deletions
|
@ -34,6 +34,8 @@
|
|||
#include <QMessageBox>
|
||||
#include <QAction>
|
||||
#include <QKeySequence>
|
||||
#include <QIcon>
|
||||
#include <QVariant>
|
||||
|
||||
namespace Mirall {
|
||||
|
||||
|
@ -49,7 +51,8 @@ static const char progressBarStyleC[] =
|
|||
|
||||
AccountSettings::AccountSettings(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::AccountSettings)
|
||||
ui(new Ui::AccountSettings),
|
||||
_wasDisabledBefore(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
|
@ -225,9 +228,18 @@ void AccountSettings::folderToModelItem( QStandardItem *item, Folder *f )
|
|||
Theme *theme = Theme::instance();
|
||||
item->setData( theme->statusHeaderText( status ), Qt::ToolTipRole );
|
||||
if( f->syncEnabled() ) {
|
||||
if( status == SyncResult::SyncPrepare ) {
|
||||
if( _wasDisabledBefore ) {
|
||||
// if the folder was disabled before, set the sync icon
|
||||
item->setData( theme->syncStateIcon( SyncResult::SyncRunning), FolderStatusDelegate::FolderStatusIconRole );
|
||||
} // we keep the previous icon for the SyncPrepare state.
|
||||
} else {
|
||||
// kepp the previous icon for the prepare phase.
|
||||
item->setData( theme->syncStateIcon( status ), FolderStatusDelegate::FolderStatusIconRole );
|
||||
}
|
||||
} else {
|
||||
item->setData( theme->folderDisabledIcon( ), FolderStatusDelegate::FolderStatusIconRole ); // size 48 before
|
||||
_wasDisabledBefore = false;
|
||||
}
|
||||
item->setData( theme->statusHeaderText( status ), FolderStatusDelegate::FolderStatus );
|
||||
|
||||
|
@ -435,6 +447,10 @@ void AccountSettings::slotEnableCurrentFolder()
|
|||
}
|
||||
|
||||
folderMan->slotEnableFolder( alias, !folderEnabled );
|
||||
|
||||
// keep state for the icon setting.
|
||||
if( !folderEnabled ) _wasDisabledBefore = true;
|
||||
|
||||
slotUpdateFolderState (f);
|
||||
// set the button text accordingly.
|
||||
slotFolderActivated( selected );
|
||||
|
|
|
@ -98,7 +98,7 @@ private:
|
|||
QHash<QStandardItem*, QTimer*> _hideProgressTimers;
|
||||
QString _kindContext;
|
||||
QStringList _generalErrors;
|
||||
|
||||
bool _wasDisabledBefore;
|
||||
};
|
||||
|
||||
} // namespace Mirall
|
||||
|
|
Loading…
Reference in a new issue