From c4050cef6c09c1aaf37aec25784f6120ab5f4470 Mon Sep 17 00:00:00 2001 From: Darrell Anderson Date: Tue, 8 May 2012 16:56:25 -0500 Subject: Add KControl (Peripherals/Storage Media/Advanced) controls to set default mount options. Thanks to Francois Andriot. This partially resolves bug report 986. --- kioslave/media/propsdlgplugin/propertiespage.cpp | 14 +- kioslave/media/propsdlgplugin/propertiespagegui.ui | 490 ++++++++++----------- 2 files changed, 257 insertions(+), 247 deletions(-) (limited to 'kioslave/media/propsdlgplugin') 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; diff --git a/kioslave/media/propsdlgplugin/propertiespagegui.ui b/kioslave/media/propsdlgplugin/propertiespagegui.ui index 51ead3a25..2a6ff899e 100644 --- a/kioslave/media/propsdlgplugin/propertiespagegui.ui +++ b/kioslave/media/propsdlgplugin/propertiespagegui.ui @@ -8,207 +8,207 @@ 0 0 - 527 - 476 + 219 + 446 - + + PropertiesPageGUI + + unnamed - - 0 - - + + + option_defaults + + + Use default mount options + + + - layout17 + groupbox_generic + + + Generic Mount Options unnamed - + - groupbox_generic - - - Generic Mount Options + layout15 unnamed + + + option_ro + + + Read only + + + Mount the file system read-only. + + + + + option_quiet + + + Quiet + + + Attempts to chown or chmod files do not return errors, although they fail. Use with caution! + + + + + option_sync + + + Synchronous + + + All I/O to the file system should be done synchronously. + + + + + option_atime + + + Access time updates + + + Update inode access time for each access. + + - layout15 + layout14 - + unnamed - - - option_ro - - - Read only - - - Mount the file system read-only. - - - - - option_quiet - - - Quiet - - - Attempts to chown or chmod files do not return errors, although they fail. Use with caution! - - - + - option_sync + textLabel3 - Synchronous - - - All I/O to the file system should be done synchronously. + Mountpoint: - - - - option_atime - - - Access time updates + + option_mountpoint - Update inode access time for each access. + Under what directory this file system shall be mounted. Please note that there is no guarantee that the system will respect your wish. For one the directory has to be below /media - and it does not yet have to exist. - + - layout14 - - - - unnamed - - - - textLabel3 - - - Mountpoint: - - - option_mountpoint - - - Under what directory this file system shall be mounted. Please note that there is no guarantee that the system will respect your wish. For one the directory has to be below /media - and it does not yet have to exist. - - - - - option_mountpoint - - - - - - - - - - option_automount + option_mountpoint - Mount automatically - - - Mount this file system automatically. + - + + + + + option_automount + + + Mount automatically + + + Mount this file system automatically. + - + + + + + groupbox_specific + + + Filesystem Specific Mount Options + + + + unnamed + + - groupbox_specific - - - Filesystem Specific Mount Options + layout11 unnamed + + + option_flush + + + Flushed IO + + + Always flush all data to the hot plug devices immediately and don't cache it. + + + + + option_utf8 + + + UTF-8 charset + + + UTF8 is the filesystem safe 8-bit encoding of Unicode that is used by the console. It can be be enabled for the filesystem with this option. + + + + + option_uid + + + Mount as user + + + Mount this file system as user. + + - layout11 + layout7 - + unnamed - + - option_flush + text_journaling - Flushed IO - - - Always flush all data to the hot plug devices immediately and don't cache it. - - - - - option_utf8 - - - UTF-8 charset - - - UTF8 is the filesystem safe 8-bit encoding of Unicode that is used by the console. It can be be enabled for the filesystem with this option. - - - - - option_uid + Journaling: - - Mount as user + + option_journaling - Mount this file system as user. - - - - - layout7 - - - - unnamed - - - - text_journaling - - - Journaling: - - - option_journaling - - - <h2>Specifies the journalling mode for file data. Metadata is always journaled. </h2> + <h2>Specifies the journalling mode for file data. Metadata is always journaled. </h2> <h3><b>All Data</b></h3> All data is committed into the journal prior to being written into the main file system. This is the slowest variant with the highest data security. @@ -218,29 +218,29 @@ <h3><b>Write Back</b></h3> Data ordering is not preserved - data may be written into the main file system after its metadata has been committed to the journal. This is rumoured to be the highest-throughput option. It guarantees internal file system integrity, however it can allow old data to appear in files after a crash and journal recovery. - - - - - - All Data - - - - - Ordered - - - - - Write Back - - - - option_journaling - - - <h2>Specifies the journalling mode for file data. Metadata is always journaled. </h2> + + + + + + All Data + + + + + Ordered + + + + + Write Back + + + + option_journaling + + + <h2>Specifies the journalling mode for file data. Metadata is always journaled. </h2> <h3><b>All Data</b></h3> All data is committed into the journal prior to being written into the main file system. This is the slowest variant with the highest data security. @@ -250,30 +250,30 @@ <h3><b>Write Back</b></h3> Data ordering is not preserved - data may be written into the main file system after its metadata has been committed to the journal. This is rumoured to be the highest-throughput option. It guarantees internal file system integrity, however it can allow old data to appear in files after a crash and journal recovery. - - - + - + + + + + layout14 + + + + unnamed + + - layout14 + text_shortname - - - unnamed - - - - text_shortname - - - Short names: - - - option_shortname - - - <h2>Defines the behaviour for creation and display of filenames which fit into 8.3 characters. If a long name for a file exists, it will always be preferred display.</h2> + + Short names: + + + option_shortname + + + <h2>Defines the behaviour for creation and display of filenames which fit into 8.3 characters. If a long name for a file exists, it will always be preferred display.</h2> <h3><b>Lower</b></h3> Force the short name to lower case upon display; store a long name when the short name is not all upper case. @@ -286,34 +286,34 @@ Display the shortname as is; store a long name when the short name is not all lo <h3><b>Mixed</b></h3> Display the short name as is; store a long name when the short name is not all upper case. - - - - - - Lower - - - - - Windows 95 - - - - - Windows NT - - - - - Mixed - - - - option_shortname - - - <h2>Defines the behaviour for creation and display of filenames which fit into 8.3 characters. If a long name for a file exists, it will always be preferred display.</h2> + + + + + + Lower + + + + + Windows 95 + + + + + Windows NT + + + + + Mixed + + + + option_shortname + + + <h2>Defines the behaviour for creation and display of filenames which fit into 8.3 characters. If a long name for a file exists, it will always be preferred display.</h2> <h3><b>Lower</b></h3> Force the short name to lower case upon display; store a long name when the short name is not all upper case. @@ -326,42 +326,40 @@ Display the shortname as is; store a long name when the short name is not all lo <h3><b>Mixed</b></h3> Display the short name as is; store a long name when the short name is not all upper case. - - - + - + - - - label_filesystem - - - Filesystem: iso9660 - - - - - spacer1 - - - Vertical - - - Expanding - - - - 20 - 20 - - - - + + + label_filesystem + + + Filesystem: iso9660 + + + + + spacer1 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + -- cgit v1.2.1