Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=a117cbb258b68efdf14ddf2aa05c7360c3c385be
commit a117cbb258b68efdf14ddf2aa05c7360c3c385be Author: bouleetbil <[email protected]> Date: Sun Jan 1 18:25:52 2012 +0100 pyfpm *treeview group find all groups diff --git a/py-pacman/pyfpm/.anjuta/session/anjuta.session b/py-pacman/pyfpm/.anjuta/session/anjuta.session new file mode 100644 index 0000000..70dcbc0 --- /dev/null +++ b/py-pacman/pyfpm/.anjuta/session/anjuta.session @@ -0,0 +1,27 @@ + +[Anjuta] +Maximized=1 +Geometry=1024x544+0+27 + +[Project Manager] +Expand=pyfpm%%%pyfpm//pyfpm%%%pyfpm//pyfpm//src + +[File Loader] +Files=file:///home/gaetan/tmpgit/frugal-tweak/py-pacman/pyfpm/src/pyfpm.py#99%%%file:///home/gaetan/tmpgit/frugal-tweak/py-pacman/pyfpm/src/pyfpm.ui + +[Document Manager] +bookmarks=<?xml version="1.0" encoding="UTF-8"?>\n<bookmarks/>\n + +[Execution] +Program arguments= +Program uri=file:///home/gaetan/tmpgit/frugal-tweak/py-pacman/pyfpm/src/pyfpm.py +Run in terminal=2 +Working directories=file:///home/gaetan/tmpgit/frugal-tweak/py-pacman/pyfpm + +[Build] +Configuration list=1:Default:%%%1:Debug:Debug%%%1:Profiling:Profiling%%%1:Optimized:Optimized +Selected Configuration=Default +BuildArgs/Default=--enable-maintainer-mode +BuildArgs/Debug=--enable-maintainer-mode 'CFLAGS=-g -O0' 'CXXFLAGS=-g -O0' 'JFLAGS=-g -O0' 'FFLAGS=-g -O0' +BuildArgs/Profiling=--enable-maintainer-mode 'CFLAGS=-g -pg' 'CXXFLAGS=-g -pg' 'JFLAGS=-g -pg' 'FFLAGS=-g -pg' +BuildArgs/Optimized=--enable-maintainer-mode 'CFLAGS=-O2' 'CXXFLAGS=-O2' 'JFLAGS=-O2' 'FFLAGS=-O2' diff --git a/py-pacman/pyfpm/.anjuta/session/dock-layout.xml b/py-pacman/pyfpm/.anjuta/session/dock-layout.xml new file mode 100644 index 0000000..e3fa46b --- /dev/null +++ b/py-pacman/pyfpm/.anjuta/session/dock-layout.xml @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<dock-layout> + +<layout name="__default__"><dock name="__dock_1" floating="no" width="-1" height="-1" floatx="0" floaty="0"><paned orientation="vertical" locked="no" position="329"><paned orientation="horizontal" locked="no" position="247"><notebook orientation="vertical" locked="no" page="0"><item name="AnjutaFileManager" orientation="vertical" locked="no"/><item name="AnjutaProjectManager" orientation="vertical" locked="no"/><item name="AnjutaSymbolDB" orientation="vertical" locked="no"/><item name="AnjutaGladePalette" orientation="vertical" locked="no"/></notebook><paned orientation="horizontal" locked="no" position="597"><item name="AnjutaDocumentManager" orientation="vertical" locked="no"/><item name="AnjutaGladeTree" orientation="vertical" locked="no"/></paned></paned><item name="AnjutaTerminal" orientation="vertical" locked="no"/></paned></dock></layout></dock-layout> diff --git a/py-pacman/pyfpm/.anjuta_sym_db.db b/py-pacman/pyfpm/.anjuta_sym_db.db index 91262c0..352a4b9 100644 Binary files a/py-pacman/pyfpm/.anjuta_sym_db.db and b/py-pacman/pyfpm/.anjuta_sym_db.db differ diff --git a/py-pacman/pyfpm/src/pyfpm.py b/py-pacman/pyfpm/src/pyfpm.py index 0700a49..7331233 100755 --- a/py-pacman/pyfpm/src/pyfpm.py +++ b/py-pacman/pyfpm/src/pyfpm.py @@ -35,7 +35,8 @@ class GUI: pacman_init() pacman_init_database() pacman_register_all_database() - + self.pypacman = pypacmang2() + self.builder = Gtk.Builder() self.builder.add_from_file(UI_FILE) self.builder.connect_signals(self) @@ -58,7 +59,6 @@ class GUI: self.cellLver = Gtk.CellRendererText() self.cellVers = Gtk.CellRendererText() - self.columnPkgname.pack_start(self.cellName, True) self.columnLver.pack_start(self.cellLver, True) self.columnVers.pack_start(self.cellVers, True) @@ -76,8 +76,23 @@ class GUI: self.SAI_search=self.builder.get_object("SAI_search") #find pacman-g2 group - #draft - self.PacmanGetGrp() + self.treegrp = self.builder.get_object("treegrp") + tab_grp=self.pypacman.PacmanGetGrp() + self.liststoreGrp = Gtk.ListStore(str) + self.treegrp.set_model(self.liststoreGrp) + self.columnGrpname = Gtk.TreeViewColumn('Name') + self.treegrp.append_column(self.columnGrpname) + self.cellGrpName = Gtk.CellRendererText() + self.columnGrpname.pack_start(self.cellGrpName, True) + + self.columnGrpname.add_attribute(self.cellGrpName, 'text', 0) + # on autorise la recherche + self.treegrp.set_search_column(0) + # on autorise la classement de la colonne + self.columnGrpname.set_sort_column_id(0) + + for grp in tab_grp : + self.liststoreGrp.append([grp]) self.window.show_all() @@ -95,18 +110,29 @@ class GUI: for pkg in pkgs: #TODO find local version self.liststorePkg.append([pacman_pkg_get_info(pkg,PM_PKG_NAME),"",pacman_pkg_get_info(pkg,PM_PKG_VERSION)]) - - def PacmanGetGrp(db): + +class pypacmang2: + def listFindElement(self,array,element): + bo_find=0 + for el in array : + if element==el : + bo_find=1 + break + return bo_find + + def PacmanGetGrp(self): db=db_list[0] tab_GRP=[] - i=pacman_db_getgrpcache(db) - while i != 0: - grp = pacman_list_getdata(i) - print pointer_to_string(grp) - tab_GRP.append(grp) - i=pacman_list_next(i) + for db in db_list : + i=pacman_db_getgrpcache(db) + while i != 0: + grp = pacman_list_getdata(i) + if self.listFindElement(tab_GRP,pointer_to_string(grp))==0: + tab_GRP.append(pointer_to_string(grp)) + i=pacman_list_next(i) + tab_GRP.sort(); return tab_GRP - + def main(): app = GUI() Gtk.main() diff --git a/py-pacman/pyfpm/src/pyfpm.ui b/py-pacman/pyfpm/src/pyfpm.ui index f1c036b..cdde775 100644 --- a/py-pacman/pyfpm/src/pyfpm.ui +++ b/py-pacman/pyfpm/src/pyfpm.ui @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <requires lib="gtk+" version="2.24"/> - <!-- interface-naming-policy project-wide --> <object class="GtkWindow" id="window"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -28,23 +27,21 @@ <object class="GtkMenuBar" id="menubar1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="ubuntu_local">True</property> <child> <object class="GtkMenuItem" id="menuitem1"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> <child type="submenu"> <object class="GtkMenu" id="menu1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="ubuntu_local">True</property> <child> <object class="GtkImageMenuItem" id="imagemenuitem5"> <property name="label">gtk-quit</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> <signal name="activate" handler="destroy" swapped="no"/> @@ -56,20 +53,19 @@ </child> <child> <object class="GtkMenuItem" id="menuitem4"> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> <child type="submenu"> <object class="GtkMenu" id="menu3"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="ubuntu_local">True</property> <child> <object class="GtkImageMenuItem" id="imagemenuitem10"> <property name="label">gtk-about</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> </object> @@ -89,12 +85,13 @@ <object class="GtkScrolledWindow" id="scrolledwindow2"> <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="treeGroup"> + <object class="GtkTreeView" id="treegrp"> <property name="visible">True</property> <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"/> + </child> </object> </child> </object> @@ -116,8 +113,6 @@ <property name="invisible_char_set">True</property> <property name="primary_icon_activatable">False</property> <property name="secondary_icon_activatable">False</property> - <property name="primary_icon_sensitive">True</property> - <property name="secondary_icon_sensitive">True</property> </object> <packing> <property name="expand">True</property> @@ -128,6 +123,7 @@ <child> <object class="GtkButton" id="BTN_search"> <property name="label" translatable="yes">Search</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -163,12 +159,13 @@ <object class="GtkScrolledWindow" id="scrolledwindow1"> <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="treepkg"> <property name="visible">True</property> <property name="can_focus">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection2"/> + </child> </object> </child> </object> @@ -256,6 +253,7 @@ <child> <object class="GtkButton" id="button2"> <property name="label" translatable="yes">Remove</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -271,6 +269,7 @@ <child> <object class="GtkButton" id="button1"> <property name="label" translatable="yes">Install</property> + <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
