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

commit 259b5394a7379b8425d8bcfda3ca26f014bbc7c5
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Fri Sep 3 23:54:59 2010 +0200

*can hide some update

diff --git a/frugal-mono-tools/MainWindow.cs b/frugal-mono-tools/MainWindow.cs
index 0a7035f..4167b52 100644
--- a/frugal-mono-tools/MainWindow.cs
+++ b/frugal-mono-tools/MainWindow.cs
@@ -214,7 +214,6 @@ public partial class MainWindow : Gtk.Window
BTN_Xorg.Visible=false;
BTN_Update.Visible=false;
BTN_Setup.Visible = false;
-                       BTN_Hide.Visible = false;
BTN_UpdateDatabase.Visible = false;
}
else
@@ -688,7 +687,7 @@ public partial class MainWindow : Gtk.Window
}


-       protected void OnSelectionEntryPkg(object o, EventArgs args)
+       protected void OnSelectionEntryUpdate(object o, EventArgs args)
{
try
{
@@ -697,6 +696,7 @@ public partial class MainWindow : Gtk.Window
{
string T =(string)model.GetValue (iter, 0);
UpdateSelected=T;
+                                       
UpdateSelected=MainClass.pacmanG2.extractNamePackage(UpdateSelected);
if(boRoot)
{
BTN_Hide.Visible=true;
@@ -705,7 +705,7 @@ public partial class MainWindow : Gtk.Window
}
catch{}
}
-       protected void OnSelectionEntryUpdate(object o, EventArgs args)
+       protected void OnSelectionEntryPkg (object o, EventArgs args)
{
try
{
@@ -897,19 +897,43 @@ public partial class MainWindow : Gtk.Window
Outils.Excecute("python","/usr/bin/PyFrugalVTE pacman-g2 -Sy 
"+packageSelected,false);
}

-
-
-
-
-
-
-
-
-
-
-
-
-
+       protected virtual void OnBTNHideClicked (object sender, 
System.EventArgs e)
+       {
+               try
+               {
+                       if(UpdateSelected=="") return;
+                       string pacmanConf = @"/etc/pacman-g2.conf";
+                       string strPacmanConf =Outils.ReadFile(pacmanConf);
+                       string[] lines = strPacmanConf.Split('\n');
+                       string[] result= new string[lines.Length];
+                       string lineResult;
+                       int i = 0;
+                               foreach (string line in lines)
+                   {
+                                       lineResult=line;
+                                       if 
(System.Text.RegularExpressions.Regex.Matches(line, "IgnorePkg").Count>0)
+                                       {
+                                               //find it :p
+                                               
lineResult=lineResult.Replace("=","= "+UpdateSelected+" ");
+                                               
lineResult=lineResult.Replace("#","");
+                                               
MainClass.pacmanG2.ignorePkg.Add(UpdateSelected);
+                                       }
+                                       result[i]=lineResult;
+                                       i++;
+                               }
+                       StreamWriter File = new StreamWriter(pacmanConf);
+                       foreach (string line in result)
+               {
+                               File.WriteLine(line);
+                       }
+                       File.Close();
+               }
+               catch(Exception exe)
+               {
+                       Console.WriteLine("Can't update pacman-g2.conf");
+                       Console.WriteLine(exe.Message);
+               }
+       }

}

diff --git a/frugal-mono-tools/gtk-gui/MainWindow.cs 
b/frugal-mono-tools/gtk-gui/MainWindow.cs
index 7cc0421..ec3dddd 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 = 0;
+               this.ONG_principal.CurrentPage = 1;
// Container child ONG_principal.Gtk.Notebook+NotebookChild
this.vbox4 = new global::Gtk.VBox ();
this.vbox4.Name = "vbox4";
@@ -1403,6 +1403,7 @@ public partial class MainWindow
}
this.DefaultWidth = 735;
this.DefaultHeight = 403;
+               this.BTN_Hide.Hide ();
this.BTN_Setup.Hide ();
this.BTN_ServiceStart.Hide ();
this.BTN_ServiceStop.Hide ();
@@ -1414,6 +1415,8 @@ public partial class MainWindow
this.BTN_Search.Clicked += new global::System.EventHandler 
(this.OnBTNSearchClicked);
this.BTN_Uninstall.Clicked += new global::System.EventHandler 
(this.OnBTNUninstallClicked);
this.BTN_Install.Clicked += new global::System.EventHandler 
(this.OnBTNInstallClicked);
+               this.BTN_Hide.Clicked += new global::System.EventHandler 
(this.OnBTNHideClicked);
+               this.BTN_UpdateDatabase.Clicked += new 
global::System.EventHandler (this.OnBTNUpdateDatabaseClicked);
this.BTN_Refresh.Clicked += new global::System.EventHandler 
(this.OnBTNRefreshClicked);
this.BTN_Update.Clicked += new global::System.EventHandler 
(this.OnBTNUpdateClicked);
this.BTN_Synaptics.Clicked += new global::System.EventHandler 
(this.OnBTNSynapticsClicked);
diff --git a/frugal-mono-tools/gtk-gui/gui.stetic 
b/frugal-mono-tools/gtk-gui/gui.stetic
index 409f363..90c700f 100644
--- a/frugal-mono-tools/gtk-gui/gui.stetic
+++ b/frugal-mono-tools/gtk-gui/gui.stetic
@@ -205,10 +205,12 @@
<child>
<widget class="Gtk.Button" id="BTN_Hide">
<property name="MemberName" />
+                    <property name="Visible">False</property>
<property name="CanFocus">True</property>
<property name="Type">TextOnly</property>
<property name="Label" translatable="yes">Hide this update package</property>
<property name="UseUnderline">True</property>
+                    <signal name="Clicked" handler="OnBTNHideClicked" />
</widget>
<packing>
<property name="Position">0</property>
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to