[anjuta/gsettings-migration] build-basic-autotools: Use combo for root installation



commit 4b9fa42a6f0c4f7e63fa0e897bb299f455e6a160
Author: Johannes Schmid <jhs gnome org>
Date:   Tue Oct 19 15:47:01 2010 +0200

    build-basic-autotools: Use combo for root installation

 .../anjuta-build-basic-autotools-plugin.ui         |   34 +++++++++++++++----
 plugins/build-basic-autotools/plugin.c             |    9 ++---
 2 files changed, 30 insertions(+), 13 deletions(-)
---
diff --git a/plugins/build-basic-autotools/anjuta-build-basic-autotools-plugin.ui b/plugins/build-basic-autotools/anjuta-build-basic-autotools-plugin.ui
index 767a221..52b32c1 100644
--- a/plugins/build-basic-autotools/anjuta-build-basic-autotools-plugin.ui
+++ b/plugins/build-basic-autotools/anjuta-build-basic-autotools-plugin.ui
@@ -1,11 +1,11 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="2.16"/>
   <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkAdjustment" id="adjustment1">
-    <property name="value">4</property>
     <property name="lower">1</property>
     <property name="upper">30</property>
+    <property name="value">4</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
@@ -326,13 +326,20 @@
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkEntry" id="preferences_entry:text:sudo:0:build-install-root-command">
+                          <object class="GtkComboBox" id="preferences_combo:text:sudo, su -c:0:build-install-root-command">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
+                            <property name="model">install_list</property>
+                            <property name="row_span_column">0</property>
+                            <property name="column_span_column">0</property>
+                            <property name="active">0</property>
+                            <child>
+                              <object class="GtkCellRendererText" id="renderer2"/>
+                              <attributes>
+                                <attribute name="text">0</attribute>
+                              </attributes>
+                            </child>
                           </object>
                           <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
                             <property name="position">1</property>
                           </packing>
                         </child>
@@ -375,7 +382,6 @@
     <property name="window_position">center-on-parent</property>
     <property name="default_width">450</property>
     <property name="type_hint">dialog</property>
-    <property name="has_separator">False</property>
     <child internal-child="vbox">
       <object class="GtkVBox" id="dialog-vbox2">
         <property name="visible">True</property>
@@ -582,4 +588,18 @@
       <action-widget response="-5">ok_button</action-widget>
     </action-widgets>
   </object>
+  <object class="GtkListStore" id="install_list">
+    <columns>
+      <!-- column-name gchararray1 -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">sudo</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">su -c</col>
+      </row>
+    </data>
+  </object>
 </interface>
diff --git a/plugins/build-basic-autotools/plugin.c b/plugins/build-basic-autotools/plugin.c
index 13843c8..c76ce11 100644
--- a/plugins/build-basic-autotools/plugin.c
+++ b/plugins/build-basic-autotools/plugin.c
@@ -71,7 +71,7 @@
 #define BUILD_PREFS_DIALOG "preferences-dialog-build"
 #define BUILD_PREFS_ROOT "preferences-build-container"
 #define INSTALL_ROOT_CHECK "preferences_toggle:bool:0:0:build-install-root"
-#define INSTALL_ROOT_ENTRY "preferences_entry:text:sudo:0:build-install-root-command"
+#define INSTALL_ROOT_ENTRY "preferences_combo:text:sudo, su -c:0:build-install-root-command"
 #define PARALLEL_MAKE_CHECK "preferences_toggle:bool:0:0:build-parallel-make"
 #define PARALLEL_MAKE_SPIN "preferences_spin:int:1:0:build-parallel-make-job"
 
@@ -1646,10 +1646,7 @@ get_root_install_command(BasicAutotoolsPlugin *bplugin)
 	if (g_settings_get_boolean (settings, PREF_INSTALL_ROOT))
 	{
 		gchar* command = g_settings_get_string (settings, PREF_INSTALL_ROOT_COMMAND);
-		if (command != NULL)
-			return command;
-		else
-			return g_strdup("");
+		return command;
 	}
 	else
 		return g_strdup("");
@@ -1668,7 +1665,7 @@ build_install_dir (BasicAutotoolsPlugin *plugin, const gchar *dirname,
 	prog = build_program_new_with_command (build_dir,
 	                                       "%s %s",
 	                                       root,
-	                                       CHOOSE_COMMAND (plugin, INSTALL)),
+	                                       CHOOSE_COMMAND (plugin, INSTALL));
 	build_program_set_callback (prog, callback, user_data);	
 	
 	context = build_save_and_execute_command (plugin, prog, TRUE, err);



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