diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2020-08-19 14:09:07 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2020-08-19 15:16:53 +0300 |
commit | a36b9ed378afea9483309a31005712e0997cb361 (patch) | |
tree | 52029fba2510f9fe3abcb765828570242ff88ad6 /src | |
parent | d7ce72a31f002f9cb47fce2c6cb1e9a0267e0ad7 (diff) |
Move sync hidden files to advanced settings
Fixes: #8020
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/generalsettings.cpp | 11 | ||||
-rw-r--r-- | src/gui/generalsettings.ui | 105 | ||||
-rw-r--r-- | src/gui/ignorelisteditor.cpp | 14 | ||||
-rw-r--r-- | src/gui/ignorelisteditor.h | 2 | ||||
-rw-r--r-- | src/gui/ignorelisteditor.ui | 16 |
5 files changed, 62 insertions, 86 deletions
diff --git a/src/gui/generalsettings.cpp b/src/gui/generalsettings.cpp index 5f82afbbc..4d121ab2c 100644 --- a/src/gui/generalsettings.cpp +++ b/src/gui/generalsettings.cpp @@ -56,6 +56,8 @@ GeneralSettings::GeneralSettings(QWidget *parent) loadMiscSettings(); slotUpdateInfo(); + _ui->syncHiddenFilesCheckBox->setChecked(!FolderMan::instance()->ignoreHiddenFiles()); + // misc connect(_ui->monoIconsCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings); connect(_ui->crashreporterCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings); @@ -63,6 +65,15 @@ GeneralSettings::GeneralSettings(QWidget *parent) connect(_ui->newFolderLimitSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &GeneralSettings::saveMiscSettings); connect(_ui->newExternalStorage, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings); + /* handle the hidden file checkbox */ + + /* the ignoreHiddenFiles flag is a folder specific setting, but for now, it is + * handled globally. Save it to every folder that is defined. + */ + connect(_ui->syncHiddenFilesCheckBox, &QCheckBox::toggled, this,[](bool checked){ + FolderMan::instance()->setIgnoreHiddenFiles(!checked); + }); + #ifndef WITH_CRASHREPORTER _ui->crashreporterCheckBox->setVisible(false); #endif diff --git a/src/gui/generalsettings.ui b/src/gui/generalsettings.ui index 3751debcf..dd6e00bf5 100644 --- a/src/gui/generalsettings.ui +++ b/src/gui/generalsettings.ui @@ -69,30 +69,6 @@ </property> <layout class="QVBoxLayout" name="verticalLayout"> <item> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QPushButton" name="ignoredFilesButton"> - <property name="text"> - <string>Edit &Ignored Files</string> - </property> - </widget> - </item> - <item> - <spacer name="spacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>555</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> <widget class="QCheckBox" name="newFolderLimitCheckBox"> @@ -137,41 +113,60 @@ </layout> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <item> - <widget class="QCheckBox" name="newExternalStorage"> - <property name="text"> - <string>Ask for confirmation before synchronizing external storages</string> - </property> - </widget> - </item> - </layout> + <widget class="QCheckBox" name="newExternalStorage"> + <property name="text"> + <string>Ask for confirmation before synchronizing external storages</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="showInExplorerNavigationPaneCheckBox"> + <property name="text"> + <string>Show sync folders in &Explorer's Navigation Pane</string> + </property> + </widget> </item> <item> - <layout class="QHBoxLayout" name="horizontalLayout_10"> + <widget class="QCheckBox" name="crashreporterCheckBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>S&how crash reporter</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="syncHiddenFilesCheckBox"> + <property name="text"> + <string>Sync hidden files</string> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> - <widget class="QCheckBox" name="showInExplorerNavigationPaneCheckBox"> + <widget class="QPushButton" name="ignoredFilesButton"> <property name="text"> - <string>Show sync folders in &Explorer's Navigation Pane</string> + <string>Edit &Ignored Files</string> </property> </widget> </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_9"> <item> - <widget class="QCheckBox" name="crashreporterCheckBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <spacer name="spacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <property name="text"> - <string>S&how crash reporter</string> + <property name="sizeHint" stdset="0"> + <size> + <width>555</width> + <height>20</height> + </size> </property> - </widget> + </spacer> </item> </layout> </item> @@ -396,14 +391,16 @@ <tabstop>autostartCheckBox</tabstop> <tabstop>desktopNotificationsCheckBox</tabstop> <tabstop>monoIconsCheckBox</tabstop> - <tabstop>ignoredFilesButton</tabstop> <tabstop>newFolderLimitCheckBox</tabstop> <tabstop>newFolderLimitSpinBox</tabstop> <tabstop>newExternalStorage</tabstop> <tabstop>showInExplorerNavigationPaneCheckBox</tabstop> <tabstop>crashreporterCheckBox</tabstop> + <tabstop>syncHiddenFilesCheckBox</tabstop> + <tabstop>ignoredFilesButton</tabstop> <tabstop>updateChannel</tabstop> <tabstop>restartButton</tabstop> + <tabstop>scrollArea</tabstop> </tabstops> <resources/> <connections> @@ -414,12 +411,12 @@ <slot>setEnabled(bool)</slot> <hints> <hint type="sourcelabel"> - <x>225</x> - <y>231</y> + <x>245</x> + <y>139</y> </hint> <hint type="destinationlabel"> - <x>587</x> - <y>230</y> + <x>412</x> + <y>141</y> </hint> </hints> </connection> diff --git a/src/gui/ignorelisteditor.cpp b/src/gui/ignorelisteditor.cpp index 6526f45e0..0e1eee22c 100644 --- a/src/gui/ignorelisteditor.cpp +++ b/src/gui/ignorelisteditor.cpp @@ -59,8 +59,6 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) ui->tableWidget->resizeColumnsToContents(); ui->tableWidget->horizontalHeader()->setSectionResizeMode(patternCol, QHeaderView::Stretch); ui->tableWidget->verticalHeader()->setVisible(false); - - ui->syncHiddenFilesCheckBox->setChecked(!FolderMan::instance()->ignoreHiddenFiles()); } IgnoreListEditor::~IgnoreListEditor() @@ -68,11 +66,6 @@ IgnoreListEditor::~IgnoreListEditor() delete ui; } -bool IgnoreListEditor::ignoreHiddenFiles() -{ - return !ui->syncHiddenFilesCheckBox->isChecked(); -} - void IgnoreListEditor::slotItemSelectionChanged() { QTableWidgetItem *item = ui->tableWidget->currentItem(); @@ -123,13 +116,6 @@ void IgnoreListEditor::slotUpdateLocalIgnoreList() FolderMan *folderMan = FolderMan::instance(); - /* handle the hidden file checkbox */ - - /* the ignoreHiddenFiles flag is a folder specific setting, but for now, it is - * handled globally. Save it to every folder that is defined. - */ - folderMan->setIgnoreHiddenFiles(ignoreHiddenFiles()); - // We need to force a remote discovery after a change of the ignore list. // Otherwise we would not download the files/directories that are no longer // ignored (because the remote etag did not change) (issue #3172) diff --git a/src/gui/ignorelisteditor.h b/src/gui/ignorelisteditor.h index 9ef0b8056..b8ef563ba 100644 --- a/src/gui/ignorelisteditor.h +++ b/src/gui/ignorelisteditor.h @@ -37,8 +37,6 @@ public: explicit IgnoreListEditor(QWidget *parent = nullptr); ~IgnoreListEditor() override; - bool ignoreHiddenFiles(); - private slots: void slotItemSelectionChanged(); void slotRemoveCurrentItem(); diff --git a/src/gui/ignorelisteditor.ui b/src/gui/ignorelisteditor.ui index 89a6eb0ec..dd897abe3 100644 --- a/src/gui/ignorelisteditor.ui +++ b/src/gui/ignorelisteditor.ui @@ -15,22 +15,6 @@ </property> <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Global Ignore Settings</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QCheckBox" name="syncHiddenFilesCheckBox"> - <property name="text"> - <string>Sync hidden files</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> <widget class="QGroupBox" name="groupBox_2"> <property name="title"> <string>Files Ignored by Patterns</string> |