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

commit 11cb775985e65df0c5e939a0169351a4ffd9470c
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Sun Sep 12 02:04:30 2010 +0200

*refresh package installed after install/uninstall

diff --git a/frugal-mono-tools/MainWindow.cs b/frugal-mono-tools/MainWindow.cs
index 92fb233..744286f 100644
--- a/frugal-mono-tools/MainWindow.cs
+++ b/frugal-mono-tools/MainWindow.cs
@@ -183,62 +183,7 @@ public partial class MainWindow : Gtk.Window
this.vbox5.Add (this.scroll);
this.scroll.ShowAll();

-               //HW
-               if(!MainClass.pacmanG2.IsInstalled("system-config-printer"))
-               {
-                       BTN_Printer.Visible=false;
-                       LAB_Printer.Visible=true;
-               }
-               else
-               {
-                       BTN_Printer.Visible=true;
-                       LAB_Printer.Visible=false;
-               }
-               if(!MainClass.pacmanG2.IsInstalled("frugalwareutils"))
-               {
-                       BTN_Setup.Visible=false;
-                       LIB_Setup.Visible=true;
-               }
-               else
-               {
-                       BTN_Setup.Visible=true;
-                       LIB_Setup.Visible=false;
-               }
-
-               string dmesgOutput=Outils.ReadFile( 
"/var/log/syslog");//Outils.getoutput("/bin/dmesg");
-               if(dmesgOutput.IndexOf("lirc")>0)
-               {
-                       if (!MainClass.pacmanG2.IsInstalled("lirc"))
-                       {
-                               LIB_Lirc.Visible=true;
-                       }
-                       else
-                       {
-                               LIB_Lirc.Visible=false;
-                       }
-               }
-               else
-               {
-                       LIB_Lirc.Visible=false;
-               }
-
-
-               if(dmesgOutput.IndexOf("Bluetooth")>0)
-               {
-                       if (!MainClass.pacmanG2.IsInstalled("bluez"))
-                       {
-                               LIB_Bluez.Visible=true;
-                       }
-                       else
-                       {
-                               LIB_Bluez.Visible=false;
-                       }
-               }
-               else
-               {
-                       LIB_Bluez.Visible=false;
-               }
-
+               _initHardware();

BTN_Uninstall.Visible=false;
BTN_Install.Visible=false;
@@ -290,13 +235,139 @@ public partial class MainWindow : Gtk.Window
CBO_GraphicalDevice.SetActiveIter(iter);
}

-
INT_Numlock.Active=IsNumlockOnStartX();
+               string dmesgOutput=Outils.ReadFile( 
"/var/log/syslog");//Outils.getoutput("/bin/dmesg");
if ((dmesgOutput.IndexOf("TouchPad")>0) && 
(!MainClass.pacmanG2.IsInstalled("xf86-input-synaptics")))
BTN_Synaptics.Visible=true;
else
BTN_Synaptics.Visible=false;

+
+
+               _initNetworkManager();
+               _initLoginManager();
+
+               //RSS
+               try{
+                       CBO_TitleNews.Model=modelFlux;
+                       rssFeed =RssFeed.Read(UrlPlanet);
+                       RssChannel rssChannel = (RssChannel)rssFeed.Channels[0];
+
+                       i = 0;
+                       string latest="";
+                       foreach (RssItem item in rssChannel.Items)
+                       {
+                               string titre=item.Title;
+                               modelFlux.AppendValues(titre,i);
+                               if(latest 
=="")latest=item.Link.AbsoluteUri.ToString();
+                               i++;
+                       }
+                       InformNewFlux(latest);
+               }
+               catch{}
+
+               //system configuration
+               SAI_Host.Text=confSystem.GetHostname();
+               SAI_Distribution.Text=confSystem.GetDistribution();
+               SAI_Kernel.Text=confSystem.GetKernel();
+               SAI_Shell.Text=confSystem.GetUserShell();
+               CBO_Locale.Model=modelLocale;
+               foreach (string locale in  confSystem.LocaleSystem)
+               {
+                       iter=modelLocale.AppendValues(locale);
+                       if(confSystem.GetLocale()==locale)
+                               CBO_Locale.SetActiveIter(iter);
+               }
+
+               //configuration
+               
INT_CheckStartup.Active=MainClass.configuration.Get_CheckUpdate();
+               
INT_StartWithXSession.Active=MainClass.configuration.Get_StartWithX();
+               INT_ShowNotif.Active=MainClass.configuration.Get_ShowNotif();
+               INT_ShowSplash.Active=MainClass.configuration.Get_ShowSplash();
+
+               //update
+               UpdateToTreeview();
+               IgnorepkgToSAI();
+       }
+       private void InformNewFlux(string latest)
+       {
+                       if (MainClass.cache.GetLatest()!=latest)
+                       {
+                               Outils.Inform("Frugalware","News are 
available.");
+                               //write cache
+                               MainClass.cache.SetLatest(latest);
+                               MainClass.cache.CacheSave();
+               }
+       }
+       private void IgnorepkgToSAI()
+       {
+               SAI_ignorePkg.Text="";
+               foreach(string ignore in MainClass.pacmanG2.ignorePkg)
+               {
+                       SAI_ignorePkg.Text+=" "+ignore;
+               }
+       }
+       private  void _initHardware()
+       {
+                       //HW
+               if(!MainClass.pacmanG2.IsInstalled("system-config-printer"))
+               {
+                       BTN_Printer.Visible=false;
+                       LAB_Printer.Visible=true;
+               }
+               else
+               {
+                       BTN_Printer.Visible=true;
+                       LAB_Printer.Visible=false;
+               }
+               if(!MainClass.pacmanG2.IsInstalled("frugalwareutils"))
+               {
+                       BTN_Setup.Visible=false;
+                       LIB_Setup.Visible=true;
+               }
+               else
+               {
+                       BTN_Setup.Visible=true;
+                       LIB_Setup.Visible=false;
+               }
+
+               string dmesgOutput=Outils.ReadFile( 
"/var/log/syslog");//Outils.getoutput("/bin/dmesg");
+               if(dmesgOutput.IndexOf("lirc")>0)
+               {
+                       if (!MainClass.pacmanG2.IsInstalled("lirc"))
+                       {
+                               LIB_Lirc.Visible=true;
+                       }
+                       else
+                       {
+                               LIB_Lirc.Visible=false;
+                       }
+               }
+               else
+               {
+                       LIB_Lirc.Visible=false;
+               }
+
+
+               if(dmesgOutput.IndexOf("Bluetooth")>0)
+               {
+                       if (!MainClass.pacmanG2.IsInstalled("bluez"))
+                       {
+                               LIB_Bluez.Visible=true;
+                       }
+                       else
+                       {
+                               LIB_Bluez.Visible=false;
+                       }
+               }
+               else
+               {
+                       LIB_Bluez.Visible=false;
+               }
+
+       }
+       private void _initNetworkManager()
+       {
//network init
INT_NM.Active=Outils.ServiceOnStartUp("S99rc.networkmanager");
EnableDisable(INT_NM,"networkmanager",LIB_NMNotInstalled);
@@ -310,6 +381,9 @@ public partial class MainWindow : Gtk.Window
{
INT_FW.Active=false;
}
+       }
+       private void _initLoginManager()
+       {
//Login Manager init
EnableDisable(INT_XDM,"xdm",LIB_XDM);
EnableDisable(INT_LXDM,"lxdm",LIB_LXDM);
@@ -358,66 +432,6 @@ public partial class MainWindow : Gtk.Window
}
}
catch { }
-
-               //RSS
-               try{
-                       CBO_TitleNews.Model=modelFlux;
-                       rssFeed =RssFeed.Read(UrlPlanet);
-                       RssChannel rssChannel = (RssChannel)rssFeed.Channels[0];
-
-                       i = 0;
-                       string latest="";
-                       foreach (RssItem item in rssChannel.Items)
-                       {
-                               string titre=item.Title;
-                               modelFlux.AppendValues(titre,i);
-                               if(latest 
=="")latest=item.Link.AbsoluteUri.ToString();
-                               i++;
-                       }
-                       InformNewFlux(latest);
-               }
-               catch{}
-
-               //system configuration
-               SAI_Host.Text=confSystem.GetHostname();
-               SAI_Distribution.Text=confSystem.GetDistribution();
-               SAI_Kernel.Text=confSystem.GetKernel();
-               SAI_Shell.Text=confSystem.GetUserShell();
-               CBO_Locale.Model=modelLocale;
-               foreach (string locale in  confSystem.LocaleSystem)
-               {
-                       iter=modelLocale.AppendValues(locale);
-                       if(confSystem.GetLocale()==locale)
-                               CBO_Locale.SetActiveIter(iter);
-               }
-
-               //configuration
-               
INT_CheckStartup.Active=MainClass.configuration.Get_CheckUpdate();
-               
INT_StartWithXSession.Active=MainClass.configuration.Get_StartWithX();
-               INT_ShowNotif.Active=MainClass.configuration.Get_ShowNotif();
-               INT_ShowSplash.Active=MainClass.configuration.Get_ShowSplash();
-
-               //update
-               UpdateToTreeview();
-               IgnorepkgToSAI();
-       }
-       private void InformNewFlux(string latest)
-       {
-                       if (MainClass.cache.GetLatest()!=latest)
-                       {
-                               Outils.Inform("Frugalware","News are 
available.");
-                               //write cache
-                               MainClass.cache.SetLatest(latest);
-                               MainClass.cache.CacheSave();
-               }
-       }
-       private void IgnorepkgToSAI()
-       {
-               SAI_ignorePkg.Text="";
-               foreach(string ignore in MainClass.pacmanG2.ignorePkg)
-               {
-                       SAI_ignorePkg.Text+=" "+ignore;
-               }
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
@@ -915,6 +929,10 @@ public partial class MainWindow : Gtk.Window
else
Outils.ExcecuteAsRoot("python /usr/bin/PyFrugalVTE pacman-g2 -Rc 
"+packageSelected,true);
_searchPackage();
+
+               _initHardware();
+               _initLoginManager();
+               _initNetworkManager();
}

protected virtual void OnBTNInstallClicked (object sender, System.EventArgs e)
@@ -925,6 +943,10 @@ public partial class MainWindow : Gtk.Window
else
Outils.ExcecuteAsRoot("python /usr/bin/PyFrugalVTE pacman-g2 -Sy 
"+packageSelected,true);
_searchPackage();
+
+               _initHardware();
+               _initLoginManager();
+               _initNetworkManager();
}

protected virtual void OnBTNUpdateClicked (object sender, System.EventArgs e)
diff --git a/frugal-mono-tools/gtk-gui/MainWindow.cs 
b/frugal-mono-tools/gtk-gui/MainWindow.cs
index 128447d..a075eef 100644
--- a/frugal-mono-tools/gtk-gui/MainWindow.cs
+++ b/frugal-mono-tools/gtk-gui/MainWindow.cs
@@ -317,7 +317,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 = 6;
+               this.ONG_principal.CurrentPage = 0;
// Container child ONG_principal.Gtk.Notebook+NotebookChild
this.vbox4 = new global::Gtk.VBox ();
this.vbox4.Name = "vbox4";
diff --git a/frugal-mono-tools/gtk-gui/gui.stetic 
b/frugal-mono-tools/gtk-gui/gui.stetic
index af66744..0dfbd70 100644
--- a/frugal-mono-tools/gtk-gui/gui.stetic
+++ b/frugal-mono-tools/gtk-gui/gui.stetic
@@ -27,7 +27,7 @@
<widget class="Gtk.Notebook" id="ONG_principal">
<property name="MemberName" />
<property name="CanFocus">True</property>
-        <property name="CurrentPage">6</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