Просмотр исходного кода

Polished the ui, stop syncing during user actions.

Klaas Freitag 14 лет назад
Родитель
Сommit
869152424c

+ 17 - 0
src/mirall/application.cpp

@@ -122,6 +122,7 @@ void Application::setupSystemTray()
 void Application::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
 {
   if( reason == QSystemTrayIcon::Trigger ) {
+    setAllFolderSyncEnabled( false );
     // check if there is a mirall.cfg already.
     if( _owncloudSetup->wizard()->isVisible() ) {
       _owncloudSetup->wizard()->show();
@@ -136,6 +137,7 @@ void Application::slotTrayClicked( QSystemTrayIcon::ActivationReason reason )
 
       _statusDialog->show();
     }
+    setAllFolderSyncEnabled( true );
   }
 }
 
@@ -167,6 +169,8 @@ void Application::slotReparseConfiguration()
 
 void Application::slotAddFolder()
 {
+  setAllFolderSyncEnabled( false );
+
   _folderWizard->setFolderMap( &_folderMap );
 
   _folderWizard->restart();
@@ -216,6 +220,7 @@ void Application::slotAddFolder()
   }
   else
     qDebug() << "* Folder wizard cancelled";
+  setAllFolderSyncEnabled( true );
 }
 
 void Application::slotRemoveFolder( const QString& alias )
@@ -278,7 +283,9 @@ void Application::slotFetchFolder( const QString& alias )
 
 void Application::slotConfigure()
 {
+  setAllFolderSyncEnabled( false );
   _owncloudSetup->startWizard();
+  setAllFolderSyncEnabled( true );
 }
 
 void Application::setupKnownFolders()
@@ -394,6 +401,16 @@ void Application::slotFolderSyncFinished(const SyncResult &result)
     }
 }
 
+void Application::setAllFolderSyncEnabled( bool stat )
+{
+  if( stat )
+    qDebug() << " ** Enabling folder sync!";
+  else
+    qDebug() << " ** Disabling folder sync!";
+  foreach( Folder *f, _folderMap ) {
+    f->setSyncEnabled( stat );
+  }
+}
 
 } // namespace Mirall
 

+ 1 - 0
src/mirall/application.h

@@ -51,6 +51,7 @@ protected slots:
 
     void slotFolderSyncStarted();
     void slotFolderSyncFinished(const SyncResult &);
+    void setAllFolderSyncEnabled( bool );
 
 protected:
 

+ 32 - 11
src/mirall/createanowncloudpage.ui

@@ -16,6 +16,16 @@
   <layout class="QGridLayout" name="gridLayout_2">
    <item row="0" column="0">
     <layout class="QHBoxLayout" name="horizontalLayout_12">
+     <item>
+      <widget class="QLabel" name="label_5">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="pixmap">
+        <pixmap resource="../../mirall.qrc">:/new/mirall/resources/ownCloud-32.png</pixmap>
+       </property>
+      </widget>
+     </item>
      <item>
       <widget class="QLabel" name="label_3">
        <property name="font">
@@ -26,7 +36,7 @@
         </font>
        </property>
        <property name="text">
-        <string>Create a new Owncloud:</string>
+        <string>Create a new ownCloud</string>
        </property>
       </widget>
      </item>
@@ -48,13 +58,19 @@
    <item row="1" column="0">
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
-      <string>Where do you want to create your Owncloud?</string>
+      <string>Where do you want to create your ownCloud?</string>
      </property>
      <layout class="QGridLayout" name="gridLayout">
       <item row="0" column="0" colspan="3">
        <widget class="QRadioButton" name="createLocalRadioBtn">
+        <property name="font">
+         <font>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
         <property name="text">
-         <string>create Owncloud on this computer</string>
+         <string>create ownCloud on this computer</string>
         </property>
         <property name="checked">
          <bool>true</bool>
@@ -90,7 +106,7 @@
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;This option installs the Owncloud on this computer. Other people will not be able to access your data.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;installs the ownCloud on this computer. Other people will not be able to access your data by default.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
         </property>
         <property name="textFormat">
          <enum>Qt::AutoText</enum>
@@ -107,13 +123,13 @@ p, li { white-space: pre-wrap; }
        <widget class="QRadioButton" name="createPerFTPRadioBtn">
         <property name="font">
          <font>
-          <weight>50</weight>
-          <bold>false</bold>
+          <weight>75</weight>
+          <bold>true</bold>
           <underline>false</underline>
          </font>
         </property>
         <property name="text">
-         <string>create Owncloud on my domain</string>
+         <string>create ownCloud on my internet domain</string>
         </property>
        </widget>
       </item>
@@ -140,9 +156,9 @@ p, li { white-space: pre-wrap; }
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;This option installs Owncloud on a domain you control. You need the FTP credentials for installations.&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;installs ownCloud on a domain you control. You need the FTP credentials for the installation.&lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#585858;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;This Owncloud will be visible in the internet.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;This ownCloud will be accessible from the internet.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
         </property>
         <property name="textFormat">
          <enum>Qt::AutoText</enum>
@@ -158,7 +174,10 @@ p, li { white-space: pre-wrap; }
       <item row="4" column="1">
        <widget class="QLabel" name="label">
         <property name="text">
-         <string>Domain:</string>
+         <string>&amp;Domain:</string>
+        </property>
+        <property name="buddy">
+         <cstring>myDomainEdit</cstring>
         </property>
        </widget>
       </item>
@@ -190,6 +209,8 @@ p, li { white-space: pre-wrap; }
    </item>
   </layout>
  </widget>
- <resources/>
+ <resources>
+  <include location="../../mirall.qrc"/>
+ </resources>
  <connections/>
 </ui>

+ 2 - 2
src/mirall/folderwizardowncloudpage.ui

@@ -17,7 +17,7 @@
    <item row="2" column="0">
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
-      <string>Owncloud Settings</string>
+      <string>ownCloud Settings</string>
      </property>
      <layout class="QGridLayout" name="gridLayout">
       <item row="1" column="1">
@@ -90,7 +90,7 @@
       </font>
      </property>
      <property name="text">
-      <string>Owncloud</string>
+      <string>ownCloud</string>
      </property>
     </widget>
    </item>

+ 4 - 1
src/mirall/folderwizardsourcepage.ui

@@ -55,7 +55,10 @@
         <item>
          <widget class="QLabel" name="label_2">
           <property name="text">
-           <string>Directory alias name:</string>
+           <string>&amp;Directory alias name:</string>
+          </property>
+          <property name="buddy">
+           <cstring>aliasLineEdit</cstring>
           </property>
          </widget>
         </item>

+ 48 - 46
src/mirall/owncloudcredentialspage.ui

@@ -26,7 +26,7 @@
         </font>
        </property>
        <property name="text">
-        <string>Owncloud Credentials:</string>
+        <string>ownCloud Credentials</string>
        </property>
       </widget>
      </item>
@@ -48,7 +48,7 @@
    <item row="1" column="0">
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
-      <string>Provide Owncloud Credentials</string>
+      <string>Provide ownCloud Credentials</string>
      </property>
      <layout class="QGridLayout" name="gridLayout_2">
       <item row="0" column="0">
@@ -58,7 +58,9 @@
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;Provide the credentials to your ownCloud Instance. If you do not have credentials yet, quickly open the ownCloud link and finish the setup.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;Provide the credentials to your ownCloud Instance. &lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#585858;&quot;&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;If the ownCloud is created this is the admin account of your ownCloud. If you want to connect to an existing ownCloud, provide your account data.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
         </property>
         <property name="textFormat">
          <enum>Qt::AutoText</enum>
@@ -71,59 +73,59 @@ p, li { white-space: pre-wrap; }
         </property>
        </widget>
       </item>
-      <item row="1" column="0">
-       <layout class="QGridLayout" name="gridLayout">
-        <item row="0" column="0">
-         <widget class="QLabel" name="label_2">
-          <property name="text">
-           <string>Owncloud-User:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="0" column="1">
-         <widget class="QLineEdit" name="OCUserEdit">
-          <property name="text">
-           <string/>
-          </property>
-          <property name="placeholderText">
-           <string>john</string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="0">
-         <widget class="QLabel" name="label_5">
-          <property name="text">
-           <string>Password:</string>
-          </property>
-         </widget>
-        </item>
-        <item row="1" column="1">
-         <widget class="QLineEdit" name="OCPasswdEdit">
-          <property name="text">
-           <string/>
-          </property>
-          <property name="echoMode">
-           <enum>QLineEdit::Password</enum>
-          </property>
-          <property name="placeholderText">
-           <string>secret</string>
-          </property>
-         </widget>
-        </item>
-       </layout>
-      </item>
      </layout>
     </widget>
    </item>
    <item row="2" column="0">
+    <layout class="QGridLayout" name="gridLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="label_2">
+       <property name="text">
+        <string>ownCloud-User:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QLineEdit" name="OCUserEdit">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="placeholderText">
+        <string>john</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0">
+      <widget class="QLabel" name="label_5">
+       <property name="text">
+        <string>Password:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="1">
+      <widget class="QLineEdit" name="OCPasswdEdit">
+       <property name="text">
+        <string/>
+       </property>
+       <property name="echoMode">
+        <enum>QLineEdit::Password</enum>
+       </property>
+       <property name="placeholderText">
+        <string>secret</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="3" column="0">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
      <property name="sizeHint" stdset="0">
       <size>
-       <width>530</width>
-       <height>194</height>
+       <width>568</width>
+       <height>158</height>
       </size>
      </property>
     </spacer>

+ 1 - 0
src/mirall/owncloudsetup.cpp

@@ -134,6 +134,7 @@ void OwncloudSetup::slotInstallOCServer()
   }
   args << "--admin-user" << adminUser;
   args << "--admin-password" << adminPwd;
+  args << "--skip-download";
 
   runOwncloudAdmin( args );
   _ocWizard->setField( "OCUrl", QString( "%1/owncloud/").arg(_ocWizard->field("myOCDomain").toString() ));

+ 20 - 8
src/mirall/owncloudwizardselecttypepage.ui

@@ -26,7 +26,7 @@
         </font>
        </property>
        <property name="text">
-        <string>Create an Owncloud Connection:</string>
+        <string>Create an ownCloud Connection</string>
        </property>
       </widget>
      </item>
@@ -48,13 +48,19 @@
    <item row="1" column="0">
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
-      <string>Select the Owncloud you want to connect to:</string>
+      <string>Select the ownCloud you want to connect to</string>
      </property>
      <layout class="QGridLayout" name="gridLayout">
       <item row="0" column="0" colspan="3">
        <widget class="QRadioButton" name="connectMyOCRadioBtn">
+        <property name="font">
+         <font>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
         <property name="text">
-         <string>connect my Owncloud</string>
+         <string>connect my ownCloud</string>
         </property>
         <property name="checked">
          <bool>true</bool>
@@ -84,9 +90,9 @@
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;Select this option if you already have an Owncloud instance running on a server to which you have access.&lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;Select this option if you have an ownCloud instance running on a server.&lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#585858;&quot;&gt;&lt;/p&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;Enter the web address of your Owncloud below.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;Enter the web address of your ownCloud below.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
         </property>
         <property name="textFormat">
          <enum>Qt::AutoText</enum>
@@ -102,7 +108,7 @@ p, li { white-space: pre-wrap; }
       <item row="2" column="1">
        <widget class="QLabel" name="label">
         <property name="text">
-         <string>URL:</string>
+         <string>ownCloud-URL:</string>
         </property>
        </widget>
       </item>
@@ -115,8 +121,14 @@ p, li { white-space: pre-wrap; }
       </item>
       <item row="3" column="0" colspan="3">
        <widget class="QRadioButton" name="createNewOCRadioBtn">
+        <property name="font">
+         <font>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
         <property name="text">
-         <string>create a new Owncloud</string>
+         <string>create a new ownCloud</string>
         </property>
        </widget>
       </item>
@@ -143,7 +155,7 @@ p, li { white-space: pre-wrap; }
 &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
 &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;Select this option if you want to create a new Owncloud either on the local machine or on your server. &lt;/span&gt;&lt;/p&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;Select if you want to create a new ownCloud either on the local machine or on your server. &lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#585858;&quot;&gt;&lt;/p&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#585858;&quot;&gt;This wizard will guide you through all neccessary steps.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
         </property>