Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=48dc4cac5ad70507f747dd43fe45878fe677fb5a
commit 48dc4cac5ad70507f747dd43fe45878fe677fb5a Author: bouleetbil <bouleet...@frogdev.info> Date: Mon Jan 10 21:57:04 2011 +0100 *can install package (will see for use a gui and not a terminal) diff --git a/frugal-tweak-vala/UI/MainUI.ui b/frugal-tweak-vala/UI/MainUI.ui index 5b50e6b..3595a18 100644 --- a/frugal-tweak-vala/UI/MainUI.ui +++ b/frugal-tweak-vala/UI/MainUI.ui @@ -495,62 +495,105 @@ <property name="visible">True</property> <property name="orientation">vertical</property> <child> - <object class="GtkHBox" id="hbox8"> + <object class="GtkVBox" id="vbox6"> <property name="visible">True</property> + <property name="orientation">vertical</property> <child> - <object class="GtkComboBox" id="combobox_repo"> + <object class="GtkHBox" id="hbox8"> <property name="visible">True</property> + <child> + <object class="GtkComboBox" id="combobox_repo"> + <property name="visible">True</property> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="entry_search_pkg"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">•</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="button2"> + <property name="label" translatable="yes">Search</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <signal name="clicked" handler="EventGtk_On_PacmanG2Search"/> + </object> + <packing> + <property name="position">2</property> + </packing> + </child> </object> <packing> <property name="position">0</property> </packing> </child> <child> - <object class="GtkEntry" id="entry_search_pkg"> + <object class="GtkScrolledWindow" id="scrolledwindow6"> + <property name="width_request">400</property> + <property name="height_request">300</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="invisible_char">•</property> + <property name="hscrollbar_policy">automatic</property> + <property name="vscrollbar_policy">automatic</property> + <child> + <object class="GtkTreeView" id="tree_package"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </object> + </child> </object> <packing> <property name="position">1</property> </packing> </child> + </object> + <packing> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox9"> + <property name="visible">True</property> <child> - <object class="GtkButton" id="button2"> - <property name="label" translatable="yes">Search</property> + <object class="GtkButton" id="button_uninstall"> + <property name="label" translatable="yes">Uninstall</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> - <signal name="clicked" handler="EventGtk_On_PacmanG2Search"/> </object> <packing> - <property name="position">2</property> + <property name="position">0</property> </packing> </child> - </object> - <packing> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkScrolledWindow" id="scrolledwindow6"> - <property name="width_request">400</property> - <property name="height_request">300</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</property> <child> - <object class="GtkTreeView" id="tree_package"> + <object class="GtkButton" id="button_install"> + <property name="label" translatable="yes">Install</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="receives_default">True</property> + <signal name="clicked" handler="EventGtk_on_button_install_clicked"/> </object> + <packing> + <property name="position">1</property> + </packing> </child> </object> <packing> <property name="position">1</property> </packing> </child> + <child> + <placeholder/> + </child> </object> </child> </object> diff --git a/frugal-tweak-vala/src/EventGtk.vala b/frugal-tweak-vala/src/EventGtk.vala index f7f0285..f80638e 100644 --- a/frugal-tweak-vala/src/EventGtk.vala +++ b/frugal-tweak-vala/src/EventGtk.vala @@ -91,4 +91,19 @@ public class EventGtk{ } } + [CCode (cname = "G_MODULE_EXPORT EventGtk_on_button_install_clicked",instance_pos = -1)] + public void on_BTN_install_clicked (Button source) { + TreeIter iter; + TreeModel model; + string str = ""; + + TreeSelection sel = GtkObj.tree_pkg.get_selection(); + if (sel.count_selected_rows() == 1) { + sel.get_selected( out model, out iter); + GtkObj.listmodel_pkg.get(iter, 0, out str); + } + if(str=="") return; + Tools.run_command("fwroot" ,"frugalware-tweak-terminal -e pacman-g2 -S "+str,false); + } + } diff --git a/frugal-tweak-vala/src/GtkObj.vala b/frugal-tweak-vala/src/GtkObj.vala index 40aae8b..88ce2b0 100644 --- a/frugal-tweak-vala/src/GtkObj.vala +++ b/frugal-tweak-vala/src/GtkObj.vala @@ -33,5 +33,7 @@ public static class GtkObj { public static Gtk.ListStore listmodel_repo; public static Gtk.TreeView tree_pkg; public static Gtk.ListStore listmodel_pkg; + public static Gtk.Button uninstall_pkg; + public static Gtk.Button install_pkg; } _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git