[Pkg-owncloud-commits] [owncloud-client] 330/498: IgnoreListEditor: handle the ignore hidden files checkbox.

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:03 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit cfe5150037d4a895213aa67934d2e8c71a70292b
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Jul 15 14:50:41 2015 +0200

    IgnoreListEditor: handle the ignore hidden files checkbox.
    
    Write the setting of the checkbox to all folder definitions.
---
 src/gui/ignorelisteditor.cpp |  23 ++++++
 src/gui/ignorelisteditor.h   |   2 +
 src/gui/ignorelisteditor.ui  | 177 ++++++++++++++++++++++++-------------------
 3 files changed, 126 insertions(+), 76 deletions(-)

diff --git a/src/gui/ignorelisteditor.cpp b/src/gui/ignorelisteditor.cpp
index 23f96b1..77a3bcb 100644
--- a/src/gui/ignorelisteditor.cpp
+++ b/src/gui/ignorelisteditor.cpp
@@ -57,6 +57,13 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) :
 
     ui->tableWidget->horizontalHeader()->setResizeMode(patternCol, QHeaderView::Stretch);
     ui->tableWidget->verticalHeader()->setVisible(false);
+
+    /* value for syncing hidden files */
+    bool ignoreHidden = true;
+    if( FolderMan::instance()->map().count() > 0 ) {
+        ignoreHidden = FolderMan::instance()->map().first()->ignoreHiddenFiles();
+    }
+    ui->ignoreHiddenFilesCheckBox->setChecked( !ignoreHidden );
 }
 
 IgnoreListEditor::~IgnoreListEditor()
@@ -64,6 +71,11 @@ IgnoreListEditor::~IgnoreListEditor()
     delete ui;
 }
 
+bool IgnoreListEditor::ignoreHiddenFiles()
+{
+    return ! ui->ignoreHiddenFilesCheckBox->isChecked();
+}
+
 void IgnoreListEditor::slotItemSelectionChanged()
 {
     QTableWidgetItem *item = ui->tableWidget->currentItem();
@@ -110,6 +122,17 @@ void IgnoreListEditor::slotUpdateLocalIgnoreList()
         QMessageBox::warning(this, tr("Could not open file"),
                              tr("Cannot write changes to '%1'.").arg(ignoreFile));
     }
+
+    /* handle the hidden file checkbox */
+    bool ignoreHiddenFiles = ! ui->ignoreHiddenFilesCheckBox->isChecked();
+
+    /* the ignoreHiddenFiles flag is a folder specific setting, but for now, it is
+     * handled globally. Save it to every folder that is defined.
+     */
+    foreach (Folder* folder, FolderMan::instance()->map()) {
+        folder->setIgnoreHiddenFiles(ignoreHiddenFiles);
+        folder->saveToSettings();
+    }
 }
 
 void IgnoreListEditor::slotAddPattern()
diff --git a/src/gui/ignorelisteditor.h b/src/gui/ignorelisteditor.h
index 57bb04a..bd64d8a 100644
--- a/src/gui/ignorelisteditor.h
+++ b/src/gui/ignorelisteditor.h
@@ -36,6 +36,8 @@ public:
     explicit IgnoreListEditor(QWidget *parent = 0);
     ~IgnoreListEditor();
 
+    bool ignoreHiddenFiles();
+
 private slots:
     void slotItemSelectionChanged();
     void slotRemoveCurrentItem();
diff --git a/src/gui/ignorelisteditor.ui b/src/gui/ignorelisteditor.ui
index e6b7c11..b6d33c7 100644
--- a/src/gui/ignorelisteditor.ui
+++ b/src/gui/ignorelisteditor.ui
@@ -6,94 +6,119 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>471</width>
-    <height>359</height>
+    <width>438</width>
+    <height>463</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Ignored Files Editor</string>
   </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="5" column="0" colspan="2">
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="1">
-    <spacer name="verticalSpacer">
-     <property name="enabled">
-      <bool>true</bool>
-     </property>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>213</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="1">
-    <widget class="QPushButton" name="addPushButton">
-     <property name="enabled">
-      <bool>true</bool>
-     </property>
-     <property name="text">
-      <string>Add</string>
+  <layout class="QGridLayout" name="gridLayout_3">
+   <item row="0" column="0">
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Global Ignore Settings</string>
      </property>
+     <layout class="QGridLayout" name="gridLayout_2">
+      <item row="0" column="0">
+       <widget class="QCheckBox" name="ignoreHiddenFilesCheckBox">
+        <property name="text">
+         <string>Sync hidden files</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
-   <item row="2" column="1">
-    <widget class="QPushButton" name="removePushButton">
-     <property name="enabled">
-      <bool>true</bool>
-     </property>
-     <property name="text">
-      <string>Remove</string>
+   <item row="1" column="0">
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Files Ingored by Patterns</string>
      </property>
+     <layout class="QGridLayout" name="gridLayout">
+      <item row="1" column="1">
+       <widget class="QPushButton" name="removePushButton">
+        <property name="enabled">
+         <bool>true</bool>
+        </property>
+        <property name="text">
+         <string>Remove</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="1">
+       <widget class="QPushButton" name="addPushButton">
+        <property name="enabled">
+         <bool>true</bool>
+        </property>
+        <property name="text">
+         <string>Add</string>
+        </property>
+       </widget>
+      </item>
+      <item row="0" column="0" rowspan="3">
+       <widget class="QTableWidget" name="tableWidget">
+        <property name="enabled">
+         <bool>true</bool>
+        </property>
+        <property name="selectionMode">
+         <enum>QAbstractItemView::SingleSelection</enum>
+        </property>
+        <property name="selectionBehavior">
+         <enum>QAbstractItemView::SelectRows</enum>
+        </property>
+        <property name="columnCount">
+         <number>2</number>
+        </property>
+        <column>
+         <property name="text">
+          <string>Pattern</string>
+         </property>
+        </column>
+        <column>
+         <property name="text">
+          <string>Allow Deletion</string>
+         </property>
+        </column>
+       </widget>
+      </item>
+      <item row="2" column="1">
+       <spacer name="verticalSpacer">
+        <property name="enabled">
+         <bool>true</bool>
+        </property>
+        <property name="orientation">
+         <enum>Qt::Vertical</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>213</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item row="3" column="0" colspan="2">
+       <widget class="QLabel" name="descriptionLabel">
+        <property name="enabled">
+         <bool>true</bool>
+        </property>
+        <property name="text">
+         <string/>
+        </property>
+        <property name="wordWrap">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
-   <item row="4" column="0" colspan="2">
-    <widget class="QLabel" name="descriptionLabel">
-     <property name="enabled">
-      <bool>true</bool>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="0" rowspan="3">
-    <widget class="QTableWidget" name="tableWidget">
-     <property name="enabled">
-      <bool>true</bool>
-     </property>
-     <property name="selectionMode">
-      <enum>QAbstractItemView::SingleSelection</enum>
-     </property>
-     <property name="selectionBehavior">
-      <enum>QAbstractItemView::SelectRows</enum>
-     </property>
-     <property name="columnCount">
-      <number>2</number>
+   <item row="4" column="0">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
      </property>
-     <column>
-      <property name="text">
-       <string>Pattern</string>
-      </property>
-     </column>
-     <column>
-      <property name="text">
-       <string>Allow Deletion</string>
-      </property>
-     </column>
     </widget>
    </item>
   </layout>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list