Commit 4b9fa42a authored by Johannes Schmid's avatar Johannes Schmid

build-basic-autotools: Use combo for root installation

parent f5421f95
<?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>
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment