Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=86f9a5e8e4cb395c90efc5d896111d48f1895599

commit 86f9a5e8e4cb395c90efc5d896111d48f1895599
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Sun Sep 5 00:16:48 2010 +0200

*added group package

diff --git a/frugal-mono-tools/MainWindow.cs b/frugal-mono-tools/MainWindow.cs
index 4167b52..684d5c2 100644
--- a/frugal-mono-tools/MainWindow.cs
+++ b/frugal-mono-tools/MainWindow.cs
@@ -33,7 +33,7 @@ public partial class MainWindow : Gtk.Window
private bool boRoot = false;
//pacman-g2
// Create a model for treeview pkg
-       ListStore pkgListStore = new Gtk.ListStore (typeof (string));
+       ListStore pkgListStore = new Gtk.ListStore (typeof (string),typeof 
(string));
ListStore UpdateListStore = new Gtk.ListStore (typeof (string));
ListStore modelRepoList = new ListStore (typeof (string),typeof (int));
ListStore serviceListStore = new Gtk.ListStore (typeof (string),typeof 
(string),typeof (string));
@@ -41,20 +41,16 @@ public partial class MainWindow : Gtk.Window
private WebKit.WebView webview=null;
Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow();

-
-
const string cch_FileLoginManager=@"/etc/sysconfig/desktop";
const string cch_FileLayoutXorg=@"/etc/X11/xorg.conf.d/10-evdev.conf";
//http://www.go-mono.com/docs/index.aspx?link=T:Gtk.HTML
//HTML htl;

-
//RSS
const string UrlPlanet="http://planet.frugalware.org/feed.php?type=rss";;
ListStore modelFlux = new ListStore (typeof (string),typeof (int));
RSS FluxRss;
-
-
+
public MainWindow () : base(Gtk.WindowType.Toplevel)
{
this.SetDefaultSize (700, 500);
@@ -124,6 +120,16 @@ public partial class MainWindow : Gtk.Window
pkgColumn.PackStart (pkgNameCell, true);
treeviewpkg.AppendColumn (pkgColumn);
pkgColumn.AddAttribute (pkgNameCell, "text", 0);
+
+               // Create a column for the package group
+               Gtk.TreeViewColumn pkgGroupColumn = new Gtk.TreeViewColumn ();
+               pkgGroupColumn.Title = "Group";
+               Gtk.CellRendererText pkgGroupCell = new Gtk.CellRendererText ();
+               // Add the cell to the column
+               pkgGroupColumn.PackStart (pkgGroupCell, true);
+               treeviewpkg.AppendColumn (pkgGroupColumn);
+               pkgGroupColumn.AddAttribute (pkgGroupCell, "text", 1);
+

int i = 0 ;
foreach (string repo in  MainClass.pacmanG2.fwRepo)
@@ -670,7 +676,7 @@ public partial class MainWindow : Gtk.Window
foreach (Package package in packages)
{
// Add some data to the store
-                               pkgListStore.AppendValues 
(package.pkgname+"-"+package.pkgversion);
+                               pkgListStore.AppendValues 
(package.pkgname+"-"+package.pkgversion,package.pkggroup);
}
}
catch{}
diff --git a/frugal-mono-tools/PacmanG2.cs b/frugal-mono-tools/PacmanG2.cs
index a7599a0..5b675b5 100644
--- a/frugal-mono-tools/PacmanG2.cs
+++ b/frugal-mono-tools/PacmanG2.cs
@@ -130,9 +130,8 @@ namespace frugalmonotools
package.pkgname=extractNamePackage(tmpname);
package.pkgversion=extractVersionPackage(tmpname);
package.pkgdescription=_getDescription(package.pkgname+"-"+package.pkgversion,repo);
-                               package.pkggroup="";
+                               
package.pkggroup=_getGroup(package.pkgname+"-"+package.pkgversion,repo);
package.force=ShouldPackageForce(package.pkgname+"-"+package.pkgversion,repo);
-                //TODO extract group from file desc and extract version from 
name
packages.Add(package);
}
return packages;
@@ -186,7 +185,26 @@ namespace frugalmonotools
return content;

}
-
+               private static string _getGroup(string Package,string repo)
+               {
+                       string filedesc = 
ROOT_PATH+PACMANG2_BDD+"/"+repo+"/"+Package+"/desc";
+                       string content = Outils.ReadFile(filedesc);
+                       string[] lines = content.Split('\n');
+                       bool FindDescr = false;
+            foreach (string line in lines)
+            {
+                               if(FindDescr)
+                               {
+                                       content=line;
+                                       break;
+                               }
+                               if (line=="%GROUPS%")
+                                       FindDescr=true;
+
+                       }
+                       return content;
+
+               }
public string extractNamePackage(string file)
{
string[] words = file.Split('-');
diff --git a/frugal-mono-tools/gtk-gui/MainWindow.cs 
b/frugal-mono-tools/gtk-gui/MainWindow.cs
index ec3dddd..449dc67 100644
--- a/frugal-mono-tools/gtk-gui/MainWindow.cs
+++ b/frugal-mono-tools/gtk-gui/MainWindow.cs
@@ -261,7 +261,7 @@ public partial class MainWindow
this.ONG_principal = new global::Gtk.Notebook ();
this.ONG_principal.CanFocus = true;
this.ONG_principal.Name = "ONG_principal";
-               this.ONG_principal.CurrentPage = 1;
+               this.ONG_principal.CurrentPage = 0;
// Container child ONG_principal.Gtk.Notebook+NotebookChild
this.vbox4 = new global::Gtk.VBox ();
this.vbox4.Name = "vbox4";
@@ -1402,7 +1402,7 @@ public partial class MainWindow
this.Child.ShowAll ();
}
this.DefaultWidth = 735;
-               this.DefaultHeight = 403;
+               this.DefaultHeight = 414;
this.BTN_Hide.Hide ();
this.BTN_Setup.Hide ();
this.BTN_ServiceStart.Hide ();
diff --git a/frugal-mono-tools/gtk-gui/gui.stetic 
b/frugal-mono-tools/gtk-gui/gui.stetic
index 90c700f..425641a 100644
--- a/frugal-mono-tools/gtk-gui/gui.stetic
+++ b/frugal-mono-tools/gtk-gui/gui.stetic
@@ -17,7 +17,7 @@
</source>
</icon-set>
</icon-factory>
-  <widget class="Gtk.Window" id="MainWindow" design-size="735 403">
+  <widget class="Gtk.Window" id="MainWindow" design-size="735 414">
<property name="MemberName" />
<property name="Title" translatable="yes">Frugalware-tools</property>
<property name="Icon">resource:frugalmonotools.header.svg</property>
@@ -27,7 +27,7 @@
<widget class="Gtk.Notebook" id="ONG_principal">
<property name="MemberName" />
<property name="CanFocus">True</property>
-        <property name="CurrentPage">1</property>
+        <property name="CurrentPage">0</property>
<child>
<widget class="Gtk.VBox" id="vbox4">
<property name="MemberName" />
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to