Skip to content

Commit

Permalink
Move sync hidden files to advanced settings
Browse files Browse the repository at this point in the history
Fixes: #8020
  • Loading branch information
TheOneRing committed Aug 19, 2020
1 parent d7ce72a commit a36b9ed
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 86 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/8020
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change: Move sync hidden files to advanced settings

We moved the option to sync hidden files from the "Edit ignored Files" dialog
into the advanced settings.

https://github.com/owncloud/client/issues/8020
11 changes: 11 additions & 0 deletions src/gui/generalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,24 @@ 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);
connect(_ui->newFolderLimitCheckBox, &QAbstractButton::toggled, this, &GeneralSettings::saveMiscSettings);
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
Expand Down
105 changes: 51 additions & 54 deletions src/gui/generalsettings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,6 @@
<string>Advanced</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="ignoredFilesButton">
<property name="text">
<string>Edit &amp;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>
Expand Down Expand Up @@ -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 &amp;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&amp;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 &amp;Explorer's Navigation Pane</string>
<string>Edit &amp;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&amp;how crash reporter</string>
<property name="sizeHint" stdset="0">
<size>
<width>555</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</item>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down
14 changes: 0 additions & 14 deletions src/gui/ignorelisteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,13 @@ 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()
{
delete ui;
}

bool IgnoreListEditor::ignoreHiddenFiles()
{
return !ui->syncHiddenFilesCheckBox->isChecked();
}

void IgnoreListEditor::slotItemSelectionChanged()
{
QTableWidgetItem *item = ui->tableWidget->currentItem();
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/gui/ignorelisteditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class IgnoreListEditor : public QDialog
explicit IgnoreListEditor(QWidget *parent = nullptr);
~IgnoreListEditor() override;

bool ignoreHiddenFiles();

private slots:
void slotItemSelectionChanged();
void slotRemoveCurrentItem();
Expand Down
16 changes: 0 additions & 16 deletions src/gui/ignorelisteditor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,6 @@
<string>Ignored Files Editor</string>
</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">
Expand Down

0 comments on commit a36b9ed

Please sign in to comment.