Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=54db28f2176e0ee247c43bf746d2c143468cdad2
commit 54db28f2176e0ee247c43bf746d2c143468cdad2 Author: bouleetbil <[email protected]> Date: Mon Jan 2 10:01:13 2012 +0100 pyfpm *checkbox checked if package is installed diff --git a/py-pacman/pyfpm/.anjuta/session/anjuta.session b/py-pacman/pyfpm/.anjuta/session/anjuta.session index 70dcbc0..fc42e9c 100644 --- a/py-pacman/pyfpm/.anjuta/session/anjuta.session +++ b/py-pacman/pyfpm/.anjuta/session/anjuta.session @@ -1,19 +1,15 @@ [Anjuta] Maximized=1 -Geometry=1024x544+0+27 - -[Project Manager] -Expand=pyfpm%%%pyfpm//pyfpm%%%pyfpm//pyfpm//src +Geometry=1024x553+0+0 [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 +Files=file:///home/gaetan/tmpgit/frugal-tweak/py-pacman/pyfpm/src/pyfpm.py#112%%%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 diff --git a/py-pacman/pyfpm/.anjuta/session/dock-layout.xml b/py-pacman/pyfpm/.anjuta/session/dock-layout.xml index e3fa46b..1e531bb 100644 --- a/py-pacman/pyfpm/.anjuta/session/dock-layout.xml +++ b/py-pacman/pyfpm/.anjuta/session/dock-layout.xml @@ -1,4 +1,2 @@ <?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> +<dock-layout><layout name="__default__"><dock name="__dock_1" floating="no" width="-1" height="-1" floatx="0" floaty="0"><paned orientation="horizontal" locked="no" position="307"><item name="AnjutaProjectManager" orientation="vertical" locked="no"/><paned orientation="vertical" locked="no" position="332"><item name="AnjutaDocumentManager" orientation="vertical" locked="no"/><item name="AnjutaTerminal" orientation="vertical" locked="no"/></paned></paned></dock></layout></dock-layout> diff --git a/py-pacman/pyfpm/.anjuta_sym_db.db b/py-pacman/pyfpm/.anjuta_sym_db.db index 352a4b9..7ab5cf6 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 7331233..034fca2 100755 --- a/py-pacman/pyfpm/src/pyfpm.py +++ b/py-pacman/pyfpm/src/pyfpm.py @@ -45,27 +45,28 @@ class GUI: self.window.connect("destroy",Gtk.main_quit) self.treepkg = self.builder.get_object("treepkg") - self.liststorePkg = Gtk.ListStore(str,str,str) + self.liststorePkg = Gtk.ListStore(int,str,str) self.treepkg.set_model(self.liststorePkg) + self.columnPkginstall = Gtk.TreeViewColumn(' ') self.columnPkgname = Gtk.TreeViewColumn('Name') - self.columnLver = Gtk.TreeViewColumn('Install Version') self.columnVers = Gtk.TreeViewColumn('Version') + self.treepkg.append_column(self.columnPkginstall) self.treepkg.append_column(self.columnPkgname) - self.treepkg.append_column(self.columnLver) self.treepkg.append_column(self.columnVers) - + + self.cellInst = Gtk.CellRendererToggle() + self.cellInst.set_property('active', 0) + self.cellInst.connect('toggled', self.toggled, self.treepkg) self.cellName = Gtk.CellRendererText() - self.cellLver = Gtk.CellRendererText() self.cellVers = Gtk.CellRendererText() + self.columnPkginstall.pack_start(self.cellInst, True) self.columnPkgname.pack_start(self.cellName, True) - self.columnLver.pack_start(self.cellLver, True) self.columnVers.pack_start(self.cellVers, True) - - self.columnPkgname.add_attribute(self.cellName, 'text', 0) - self.columnLver.add_attribute(self.cellLver, 'text', 1) + self.columnPkginstall.add_attribute(self.cellInst, 'active', 0) + self.columnPkgname.add_attribute(self.cellName, 'text', 1) self.columnVers.add_attribute(self.cellVers, 'text', 2) # on autorise la recherche @@ -96,6 +97,9 @@ class GUI: self.window.show_all() + def toggled(self, cell_renderer, col, treeview): + print "passe" + def destroy(window, self): pacman_finally() Gtk.main_quit() @@ -107,9 +111,10 @@ class GUI: pkgs =[] pkgs = pacman_search_pkg(search) pacman_trans_release() + bo_inst=0 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)]) + bo_inst=pacman_package_is_installed(pacman_pkg_get_info(pkg,PM_PKG_NAME)) + self.liststorePkg.append([bo_inst,pacman_pkg_get_info(pkg,PM_PKG_NAME),pacman_pkg_get_info(pkg,PM_PKG_VERSION)]) class pypacmang2: def listFindElement(self,array,element): @@ -133,6 +138,7 @@ class pypacmang2: 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 cdde775..050025d 100644 --- a/py-pacman/pyfpm/src/pyfpm.ui +++ b/py-pacman/pyfpm/src/pyfpm.ui @@ -32,6 +32,7 @@ <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="label" translatable="yes">File</property> <child type="submenu"> <object class="GtkMenu" id="menu1"> <property name="visible">True</property> @@ -56,6 +57,7 @@ <property name="use_action_appearance">False</property> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="label" translatable="yes">Help</property> <child type="submenu"> <object class="GtkMenu" id="menu3"> <property name="visible">True</property> _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
