[gnome-disk-utility] Clean up options offered in fstab dialog, in particular negate 'noauto'
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility] Clean up options offered in fstab dialog, in particular negate 'noauto'
- Date: Tue, 21 Feb 2012 18:19:18 +0000 (UTC)
commit 86e49471c7b1a2f7ab49d88f5561079d8e40b0d1
Author: David Zeuthen <davidz redhat com>
Date: Tue Feb 21 13:14:08 2012 -0500
Clean up options offered in fstab dialog, in particular negate 'noauto'
Also suggested by Jon McCann, thanks.
Signed-off-by: David Zeuthen <davidz redhat com>
data/ui/edit-fstab-dialog.ui | 38 +++++++----------------------------
src/palimpsest/gducrypttabdialog.c | 6 ++--
src/palimpsest/gdufstabdialog.c | 19 ++++++-----------
src/palimpsest/gduutils.c | 3 ++
src/palimpsest/gduutils.h | 1 +
5 files changed, 22 insertions(+), 45 deletions(-)
---
diff --git a/data/ui/edit-fstab-dialog.ui b/data/ui/edit-fstab-dialog.ui
index 3b1f7df..1ba1f7c 100644
--- a/data/ui/edit-fstab-dialog.ui
+++ b/data/ui/edit-fstab-dialog.ui
@@ -181,7 +181,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -198,7 +198,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -217,7 +217,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -234,7 +234,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
@@ -255,7 +255,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">3</property>
+ <property name="top_attach">1</property>
<property name="width">2</property>
<property name="height">1</property>
</packing>
@@ -282,36 +282,14 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="fstab-nofail-checkbutton">
- <property name="label" translatable="yes">Don't wait for device at startup</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_markup" translatable="yes">If checked, the system won&apos;t wait for the device at startup [nofail]</property>
- <property name="tooltip_text" translatable="yes">If checked, the system won't wait for the device at startup [nofail]</property>
- <property name="use_action_appearance">False</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">2</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="fstab-noauto-checkbutton">
- <property name="label" translatable="yes">Don't mount at startup</property>
+ <object class="GtkCheckButton" id="fstab-neg-noauto-checkbutton">
+ <property name="label" translatable="yes">Mount at startup</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="has_tooltip">True</property>
- <property name="tooltip_markup" translatable="yes">If checked, the device will not be mounted at startup [noauto]</property>
- <property name="tooltip_text" translatable="yes">If checked, the device will not be mounted at startup [noauto]</property>
+ <property name="tooltip_markup" translatable="yes">If checked, the device will be mounted at startup [!noauto]</property>
<property name="use_action_appearance">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
diff --git a/src/palimpsest/gducrypttabdialog.c b/src/palimpsest/gducrypttabdialog.c
index f5e8596..ea612b3 100644
--- a/src/palimpsest/gducrypttabdialog.c
+++ b/src/palimpsest/gducrypttabdialog.c
@@ -156,9 +156,9 @@ update (CrypttabDialogData *data,
g_free (s);
g_object_freeze_notify (G_OBJECT (data->options_entry));
- gdu_options_update_check_option (data->options_entry, "noauto", widget, data->noauto_checkbutton, FALSE);
- gdu_options_update_check_option (data->options_entry, "nofail", widget, data->nofail_checkbutton, FALSE);
- gdu_options_update_check_option (data->options_entry, "x-udisks-auth", widget, data->auth_checkbutton, FALSE);
+ gdu_options_update_check_option (data->options_entry, "noauto", widget, data->noauto_checkbutton, FALSE, FALSE);
+ gdu_options_update_check_option (data->options_entry, "nofail", widget, data->nofail_checkbutton, FALSE, FALSE);
+ gdu_options_update_check_option (data->options_entry, "x-udisks-auth", widget, data->auth_checkbutton, FALSE, FALSE);
g_object_thaw_notify (G_OBJECT (data->options_entry));
can_apply = FALSE;
diff --git a/src/palimpsest/gdufstabdialog.c b/src/palimpsest/gdufstabdialog.c
index 775d979..96618b3 100644
--- a/src/palimpsest/gdufstabdialog.c
+++ b/src/palimpsest/gdufstabdialog.c
@@ -45,8 +45,7 @@ typedef struct
GtkWidget *type_entry;
GtkWidget *options_entry;
- GtkWidget *noauto_checkbutton;
- GtkWidget *nofail_checkbutton;
+ GtkWidget *neg_noauto_checkbutton;
GtkWidget *auth_checkbutton;
GtkWidget *show_checkbutton;
GtkWidget *name_entry;
@@ -90,10 +89,9 @@ update (FstabDialogData *data,
ui_opts = gtk_entry_get_text (GTK_ENTRY (data->options_entry));
g_object_freeze_notify (G_OBJECT (data->options_entry));
- gdu_options_update_check_option (data->options_entry, "noauto", widget, data->noauto_checkbutton, FALSE);
- gdu_options_update_check_option (data->options_entry, "nofail", widget, data->nofail_checkbutton, TRUE);
- gdu_options_update_check_option (data->options_entry, "x-udisks-auth", widget, data->auth_checkbutton, FALSE);
- gdu_options_update_check_option (data->options_entry, "x-gvfs-show", widget, data->show_checkbutton, FALSE);
+ gdu_options_update_check_option (data->options_entry, "noauto", widget, data->neg_noauto_checkbutton, TRUE, FALSE);
+ gdu_options_update_check_option (data->options_entry, "x-udisks-auth", widget, data->auth_checkbutton, FALSE, FALSE);
+ gdu_options_update_check_option (data->options_entry, "x-gvfs-show", widget, data->show_checkbutton, FALSE, FALSE);
gdu_options_update_entry_option (data->options_entry, "x-gvfs-name=", widget, data->name_entry);
gdu_options_update_entry_option (data->options_entry, "x-gvfs-icon=", widget, data->icon_entry);
g_object_thaw_notify (G_OBJECT (data->options_entry));
@@ -398,8 +396,7 @@ gdu_fstab_dialog_show (GduWindow *window,
data.directory_entry = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-directory-entry"));
data.type_entry = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-type-entry"));
data.options_entry = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-options-entry"));
- data.noauto_checkbutton = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-noauto-checkbutton"));
- data.nofail_checkbutton = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-nofail-checkbutton"));
+ data.neg_noauto_checkbutton = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-neg-noauto-checkbutton"));
data.auth_checkbutton = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-auth-checkbutton"));
data.show_checkbutton = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-show-checkbutton"));
data.name_entry = GTK_WIDGET (gtk_builder_get_object (builder, "fstab-name-entry"));
@@ -438,7 +435,7 @@ gdu_fstab_dialog_show (GduWindow *window,
opts = "nosuid,nodev,nofail,x-gvfs-show";
/* propose noauto if the media is removable - otherwise e.g. systemd will time out at boot */
if (drive != NULL && udisks_drive_get_removable (drive))
- opts = "nosuid,nodev,noauto,x-gvfs-show";
+ opts = "nosuid,nodev,nofail,noauto,x-gvfs-show";
freq = 0;
passno = 0;
}
@@ -483,9 +480,7 @@ gdu_fstab_dialog_show (GduWindow *window,
"notify::text", G_CALLBACK (on_property_changed), &data);
g_signal_connect (data.device_combobox,
"changed", G_CALLBACK (fstab_on_device_combobox_changed), &data);
- g_signal_connect (data.noauto_checkbutton,
- "notify::active", G_CALLBACK (on_property_changed), &data);
- g_signal_connect (data.nofail_checkbutton,
+ g_signal_connect (data.neg_noauto_checkbutton,
"notify::active", G_CALLBACK (on_property_changed), &data);
g_signal_connect (data.auth_checkbutton,
"notify::active", G_CALLBACK (on_property_changed), &data);
diff --git a/src/palimpsest/gduutils.c b/src/palimpsest/gduutils.c
index 2d69e86..3166032 100644
--- a/src/palimpsest/gduutils.c
+++ b/src/palimpsest/gduutils.c
@@ -310,11 +310,14 @@ gdu_options_update_check_option (GtkWidget *options_entry,
const gchar *option,
GtkWidget *widget,
GtkWidget *check_button,
+ gboolean negate,
gboolean add_to_front)
{
gboolean opts, ui;
opts = !! has_option (options_entry, option, FALSE, NULL);
ui = !! gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_button));
+ if (negate)
+ ui = !ui;
if (opts != ui)
{
if (widget == check_button)
diff --git a/src/palimpsest/gduutils.h b/src/palimpsest/gduutils.h
index fc66b75..659a82e 100644
--- a/src/palimpsest/gduutils.h
+++ b/src/palimpsest/gduutils.h
@@ -47,6 +47,7 @@ void gdu_options_update_check_option (GtkWidget *options_entry,
const gchar *option,
GtkWidget *widget,
GtkWidget *check_button,
+ gboolean negate,
gboolean add_to_front);
void gdu_options_update_entry_option (GtkWidget *options_entry,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]