Quellcode durchsuchen

- added a new icon to display the waiting-to-be-synced state
- fixed the status display if the status dialog opens

Klaas Freitag vor 14 Jahren
Ursprung
Commit
cd817940ae

+ 1 - 0
mirall.qrc

@@ -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


+ 2 - 2
src/mirall/application.cpp

@@ -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();
   }
 }
 

+ 12 - 5
src/mirall/folder.cpp

@@ -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)

+ 2 - 0
src/mirall/owncloudfolder.cpp

@@ -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;

+ 1 - 1
src/mirall/theme.cpp

@@ -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 ) {