1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2025-05-12 14:34:12 +02:00

- added a new icon to display the waiting-to-be-synced state

- fixed the status display if the status dialog opens
This commit is contained in:
Klaas Freitag 2012-03-31 12:44:22 +02:00
parent c196f77732
commit cd817940ae
6 changed files with 18 additions and 8 deletions

View File

@ -20,5 +20,6 @@
<file>resources/folder-important.png</file>
<file>resources/folder-grey.png</file>
<file>resources/owncloud_splash.png</file>
<file>resources/task-ongoing.png</file>
</qresource>
</RCC>

BIN
resources/task-ongoing.png Normal file

Binary file not shown.

After

(image error) Size: 3.3 KiB

View File

@ -268,7 +268,6 @@ void Application::slotFolderOpenAction( const QString& alias )
void Application::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
{
if( reason == QSystemTrayIcon::Trigger ) {
_folderMan->disableFoldersWithRestore();
// check if there is a mirall.cfg already.
if( _owncloudSetupWizard->wizard()->isVisible() ) {
_owncloudSetupWizard->wizard()->show();
@ -281,10 +280,11 @@ void Application::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
qDebug() << "No configured folders yet, start the Owncloud integration dialog.";
_owncloudSetupWizard->startWizard();
} else {
qDebug() << "#============# Status dialog starting #=============#";
_statusDialog->setFolderList( _folderMan->map() );
_statusDialog->show();
}
_folderMan->restoreEnabledFolders();
}
}

View File

@ -19,6 +19,7 @@
#include "mirall/folder.h"
#include "mirall/folderwatcher.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/syncresult.h"
#define DEFAULT_POLL_INTERVAL_SEC 15000
@ -101,9 +102,10 @@ void Folder::setSyncEnabled( bool doit )
_pollTimer->start();
}
qDebug() << "setSyncEnabled - ############################ " << doit;
if( doit ) {
// undefined until next sync
_syncResult.setStatus( SyncResult::Undefined );
_syncResult.setStatus( SyncResult::NotYetStarted);
evaluateSync( QStringList() );
} else {
// disabled.
@ -187,8 +189,16 @@ void Folder::evaluateSync(const QStringList &pathList)
// sync finished.
qDebug() << "* " << alias() << "Poll timer disabled";
_pollTimer->stop();
_syncResult.setStatus( SyncResult::NotYetStarted );
emit scheduleToSync( alias() );
// startSync( pathList );
}
void Folder::startSync( const QStringList &pathList )
{
_syncResult = SyncResult( SyncResult::SyncRunning );
emit syncStateChange();
}
void Folder::slotPollTimerTimeout()
@ -218,9 +228,6 @@ void Folder::slotSyncStarted()
#ifdef USE_WATCHER
_watcher->setEventsEnabled(false);
#endif
_syncResult = SyncResult( SyncResult::SyncRunning );
emit syncStateChange();
}
void Folder::slotSyncFinished(const SyncResult &result)

View File

@ -99,6 +99,8 @@ void ownCloudFolder::startSync()
void ownCloudFolder::startSync(const QStringList &pathList)
{
Folder::startSync( pathList );
if (_csync && _csync->isRunning()) {
qCritical() << "* ERROR csync is still running and new sync requested.";
return;

View File

@ -50,7 +50,7 @@ QIcon Theme::syncStateIcon( SyncResult::Status status, int ) const
qDebug() << "Status: " << status;
if( status == SyncResult::NotYetStarted ) {
statusIcon = "dialog-close";
statusIcon = "task-ongoing";
} else if( status == SyncResult::SyncRunning ) {
statusIcon = "view-refresh";
} else if( status == SyncResult::Success ) {