summaryrefslogtreecommitdiffstats
path: root/kioslave/media/propsdlgplugin/propertiespage.cpp
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2012-05-08 16:56:25 -0500
committerDarrell Anderson <humanreadable@yahoo.com>2012-05-08 16:56:25 -0500
commitc4050cef6c09c1aaf37aec25784f6120ab5f4470 (patch)
tree475cc9034d9fe73a807f0a35255364e662a62f49 /kioslave/media/propsdlgplugin/propertiespage.cpp
parent8ecd10805a655acc958f241942b00826f71454cc (diff)
downloadtdebase-c4050cef6c09c1aaf37aec25784f6120ab5f4470.tar.gz
tdebase-c4050cef6c09c1aaf37aec25784f6120ab5f4470.zip
Add KControl (Peripherals/Storage Media/Advanced) controls to set
default mount options. Thanks to Francois Andriot. This partially resolves bug report 986.
Diffstat (limited to 'kioslave/media/propsdlgplugin/propertiespage.cpp')
-rw-r--r--kioslave/media/propsdlgplugin/propertiespage.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/kioslave/media/propsdlgplugin/propertiespage.cpp b/kioslave/media/propsdlgplugin/propertiespage.cpp
index 14ac2b33f..33d481ef5 100644
--- a/kioslave/media/propsdlgplugin/propertiespage.cpp
+++ b/kioslave/media/propsdlgplugin/propertiespage.cpp
@@ -140,12 +140,23 @@ PropertiesPage::PropertiesPage(TQWidget* parent, const TQString &_id)
option_automount->setChecked(options["automount"] == "true");
connect( option_automount, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );
+ bool has_groupbox_specific = true;
if (!options.contains("journaling") &&
!options.contains("shortname") &&
!options.contains("uid") &&
!options.contains("utf8") &&
- !options.contains("flush"))
+ !options.contains("flush")) {
groupbox_specific->hide();
+ has_groupbox_specific = false;
+ }
+
+ // The order is important - we want groupboxes to hide automatically depending on use_defaults
+ // but don't want to emit changed() until user actually changes something.
+ connect( option_defaults, TQT_SIGNAL( toggled(bool) ), groupbox_generic, SLOT( setHidden(bool) ) );
+ if (has_groupbox_specific)
+ connect( option_defaults, TQT_SIGNAL( toggled(bool) ), groupbox_specific, SLOT( setHidden(bool) ) );
+ option_defaults->setChecked(options["use_defaults"] == "true");
+ connect( option_defaults, TQT_SIGNAL( stateChanged(int) ), TQT_SIGNAL( changed() ) );
} else {
@@ -198,6 +209,7 @@ bool PropertiesPage::save()
}
result << TQString("mountpoint=%1").arg(mp);
result << TQString("automount=%1").arg(option_automount->isChecked() ? "true" : "false");
+ result << TQString("use_defaults=%1").arg(option_defaults->isChecked() ? "true" : "false");
kdDebug() << result << endl;