[gnome-settings-daemon/automounter] automount: define an enum for combobox positions



commit 1c076938e4720637af70032dedf3d7e31098d083
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Wed Nov 24 15:12:01 2010 +0100

    automount: define an enum for combobox positions

 plugins/automount/nautilus-autorun.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/plugins/automount/nautilus-autorun.c b/plugins/automount/nautilus-autorun.c
index e302999..b0bbb4a 100644
--- a/plugins/automount/nautilus-autorun.c
+++ b/plugins/automount/nautilus-autorun.c
@@ -43,6 +43,7 @@ enum
 	AUTORUN_SEP,
 	AUTORUN_OTHER_APP,
 };
+
 enum
 {
 	COLUMN_AUTORUN_GICON,
@@ -52,6 +53,12 @@ enum
 	COLUMN_AUTORUN_ITEM_TYPE,
 };
 
+enum {
+        COMBO_ITEM_ASK_OR_LABEL = 0,
+        COMBO_ITEM_DO_NOTHING,
+        COMBO_ITEM_OPEN_FOLDER
+};
+
 static gboolean should_autorun_mount (GMount *mount);
 
 static void nautilus_autorun_rebuild_combo_box (GtkWidget *combo_box);
@@ -718,20 +725,20 @@ nautilus_autorun_prepare_combo_box (GtkWidget *combo_box,
 	gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo_box), combo_box_separator_func, NULL, NULL);
 
 	if (num_apps == 0) {
-		gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
+		gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), COMBO_ITEM_ASK_OR_LABEL);
 		gtk_widget_set_sensitive (combo_box, FALSE);
 	} else {
 		gtk_widget_set_sensitive (combo_box, TRUE);
 		if (pref_ask && include_ask) {
-			gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
+			gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), COMBO_ITEM_ASK_OR_LABEL);
 		} else if (pref_ignore) {
-			gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), include_ask ? 1 : 0);
+			gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), include_ask ? COMBO_ITEM_DO_NOTHING : COMBO_ITEM_ASK_OR_LABEL);
 		} else if (pref_open_folder) {
-			gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), include_ask ? 2 : 1);
+			gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), include_ask ? COMBO_ITEM_OPEN_FOLDER : COMBO_ITEM_DO_NOTHING);
 		} else if (set_active != -1) {
 			gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), set_active);
 		} else {
-			gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), include_ask ? 1 : 0);
+			gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), include_ask ? COMBO_ITEM_DO_NOTHING : COMBO_ITEM_ASK_OR_LABEL);
 		}
 
 		/* See if we have an old data around */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]