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

commit 35d9a3ed1a3590c26e276c38cd4c7ee35b8601e2
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Sat Sep 18 13:00:40 2010 +0200

delete useless ndesk import
not a good idea to start a new instance reverse it
Some clean up
Some fix for redraw window when window is hiden
fixes update detection before string 3.6.8 is > to 3.6.10

diff --git a/frugal-mono-tools/DbusObject.cs b/frugal-mono-tools/DbusObject.cs
deleted file mode 100644
index 5bd7ad9..0000000
--- a/frugal-mono-tools/DbusObject.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// /*
-//  *  Copyright (C) 2010 by Gaetan Gourdin <bouleet...@frogdev.info>
-//  *
-//  *  This program is free software; you can redistribute it and/or modify
-//  *  it under the terms of the GNU General Public License as published by
-//  *  the Free Software Foundation; either version 2 of the License, or
-//  *  (at your option) any later version.
-//  *
-//  *  This program is distributed in the hope that it will be useful,
-//  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  *  GNU General Public License for more details.
-//  *
-//  *  You should have received a copy of the GNU General Public License
-//  *  along with this program; if not, write to the Free Software
-//  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 
USA.
-//  */
-using System;
-using NDesk.DBus;
-using org.freedesktop.DBus;
-
-namespace frugalmonotools
-{
-       [Interface ("com.frugalware.tweak")]
-       public class DbusObject : MarshalByRefObject
-       {
-               public void Hello (string arg0)
-               {
-                       Console.WriteLine ("Got a Hello " + arg0);
-               }
-
-               public void GiveNoReply ()
-               {
-                       Console.WriteLine ("Asked to give no reply");
-               }
-       }
-
-}
-
diff --git a/frugal-mono-tools/Fen_Menu.cs b/frugal-mono-tools/Fen_Menu.cs
index a76f0e8..73ed31e 100644
--- a/frugal-mono-tools/Fen_Menu.cs
+++ b/frugal-mono-tools/Fen_Menu.cs
@@ -110,9 +110,6 @@ namespace frugalmonotools
Pixbuf icoabout = global::Gdk.Pixbuf.LoadFromResource 
("frugalmonotools.Pictures.icons.about.png");
ListMenu.AppendValues(icoabout.ScaleSimple(20,20, 
Gdk.InterpType.Nearest),cch_about);

-                       //see module system
-                       SelectModule(cch_system);
-
//timer news
System.Timers.Timer aTimer = new System.Timers.Timer();
aTimer.Elapsed+=new ElapsedEventHandler(checkRSS);
@@ -234,11 +231,14 @@ namespace frugalmonotools
}
protected virtual void OnDeleteEvent (object o, Gtk.DeleteEventArgs args)
{
-                               if(MainClass.StartedAutomatic)
-                                       this.Hide();
-                               else
-                                       Application.Quit ();
-
+                       if(MainClass.StartedAutomatic)
+                       {
+                               this.Hide();
+                       }
+                       else
+                       {
+                               Application.Quit ();
+                       }
args.RetVal = true;
}
private void checkRSS(object source, ElapsedEventArgs e)
diff --git a/frugal-mono-tools/Main.cs b/frugal-mono-tools/Main.cs
index 0b0669c..abae5bf 100644
--- a/frugal-mono-tools/Main.cs
+++ b/frugal-mono-tools/Main.cs
@@ -25,9 +25,6 @@ using Gdk;
using Gtk;
using Rss;

-using NDesk.DBus;
-using org.freedesktop.DBus;
-

namespace frugalmonotools
{
@@ -133,7 +130,12 @@ namespace frugalmonotools
WebkitBrowser browser = new WebkitBrowser("http://wiki.frugalware.org";);
browser.Show();
};
-                               menuItemcc.Activated += delegate { 
Outils.Excecute("frugalware-tweak","",false); };
+                               menuItemcc.Activated += delegate {
+                                                               Fen.Visible = 
!Fen.Visible;
+                                                               if (Fen.Visible)
+                                                                       
Fen.Show();
+                                                               };
+
menuItemccRoot.Activated += delegate { 
Outils.Excecute("sucontrolcenter","",false); };

// Quit the application when quit has been clicked.
@@ -145,39 +147,15 @@ namespace frugalmonotools
public static Fen_Menu Fen ;
public static bool StartedAutomatic=false;
public static Xorg xorg = new Xorg();
-               public static Bus bus;
-               public static string DbusName="com.frugalware.tweak";
-               public static ObjectPath DbusPath = new ObjectPath 
("com/frugalware/tweak");
-               public static DbusObject DbusCom;
+

public static void Main (string[] args)
{
//root options
-               if (Mono.Unix.Native.Syscall.getuid()!=0)
-                       boRoot=false;
-               else
-                       boRoot=true;
-                       try{
-                                       bus = Bus.Session;
-                                       if (bus.RequestName (DbusName) == 
RequestNameReply.PrimaryOwner)
-                                       {
-                                               //create a new instance of the 
object to be exported
-                                               DbusCom = new DbusObject ();
-                                               bus.Register (DbusPath, 
DbusCom);
-                                               //EXEMPLE : 
MainClass.DbusCom.Hello("test");
-                                       }
-                                       else
-                                       {
-                                               //import a remote to a local 
proxy
-                                               DbusCom = 
bus.GetObject<DbusObject> (DbusName, DbusPath);
-                                       }
-
-                       }
-                       catch(Exception exe)
-                       {
-                               Console.WriteLine("Can't register :"+DbusName);
-                               Console.WriteLine(exe.Message);
-                       }
+                       if (Mono.Unix.Native.Syscall.getuid()!=0)
+                               boRoot=false;
+                       else
+                               boRoot=true;

System.Timers.Timer aTimer;
if(args.Length==0)
@@ -216,6 +194,7 @@ namespace frugalmonotools
// Creation of the Icon
Pixbuf ico = global::Gdk.Pixbuf.LoadFromResource 
("frugalmonotools.Pictures.systray.png");

+                                                       Fen = new Fen_Menu();
trayIcon = new StatusIcon(ico);
trayIcon.Visible = true;
check();
@@ -227,7 +206,11 @@ namespace frugalmonotools
aTimer.Enabled=true;


-                                                       trayIcon.Activate += 
delegate { Outils.Excecute("frugalware-tweak","",false); };
+                                                       trayIcon.Activate += 
delegate {
+                                                               Fen.Visible = 
!Fen.Visible;
+                                                               if (Fen.Visible)
+                                                                       
Fen.Show();
+                                                               };

// Show a pop up menu when the icon has been right clicked.
trayIcon.PopupMenu += OnTrayIconPopup;
diff --git a/frugal-mono-tools/Update.cs b/frugal-mono-tools/Update.cs
index 554d76b..a5b2afd 100644
--- a/frugal-mono-tools/Update.cs
+++ b/frugal-mono-tools/Update.cs
@@ -48,8 +48,28 @@ namespace frugalmonotools
bool AddIt = false;
if(string.Compare(pkginstall.packageversion,pkg.packageversion)<0)
AddIt =true;
-                                               //check force read info only 
here for startup more quickly

+                                               //pff
+                                               //3.6.8 is > to 3.6.10 but that 
can be some string
+                                               //so compare string
+                                               try
+                                               {
+                                                       //parse numeric
+                                                       string []tmpinst = 
pkginstall.packageversion.Split('-');
+                                                       string []tmpupdate = 
pkg.packageversion.Split('-');
+                                                       string [] 
versionInstalled= tmpinst[0].Split('.');
+                                                       string []updateVersion= 
tmpupdate[0].Split('.');
+                                                       int i =0;
+                                                       foreach(string ver in 
updateVersion)
+                                                       {
+                                                               
if(string.Compare(versionInstalled[i],ver)<0)
+                                                                       
AddIt=true;
+                                                               if 
(int.Parse(versionInstalled[i])<int.Parse(ver))
+                                                                       
AddIt=true;
+                                                               i++;
+                                                       }
+                                               }
+                                               catch{}
if 
((PacmanG2.ShouldPackageForce(pkg.packagename+"-"+pkg.packageversion,pkg.repo)) 
&&
(pkginstall.packageversion!=pkg.packageversion))
AddIt=true;
diff --git a/frugal-mono-tools/WID_System.cs b/frugal-mono-tools/WID_System.cs
index f6b55ba..3278ea9 100644
--- a/frugal-mono-tools/WID_System.cs
+++ b/frugal-mono-tools/WID_System.cs
@@ -35,9 +35,10 @@ namespace frugalmonotools
}
public void InitSystem()
{
-                       if(!MainClass.boRoot)
+                       BTN_System.Visible=false;
+                       if(MainClass.boRoot)
{
-                               BTN_System.Visible=false;
+                               BTN_System.Visible=true;
}
//system configuration
SAI_Host.Text=confSystem.GetHostname();
diff --git a/frugal-mono-tools/frugal-mono-tools.csproj 
b/frugal-mono-tools/frugal-mono-tools.csproj
index 576285e..44889ea 100644
--- a/frugal-mono-tools/frugal-mono-tools.csproj
+++ b/frugal-mono-tools/frugal-mono-tools.csproj
@@ -50,7 +50,6 @@
<Reference Include="webkit-sharp, Version=1.1.15.0, Culture=neutral, 
PublicKeyToken=eaa1d335d2e19745" />
<Reference Include="notify-sharp, Version=0.4.0.0, Culture=neutral, 
PublicKeyToken=2df29c54e245917a" />
<Reference Include="System.ServiceProcess" />
-    <Reference Include="NDesk.DBus, Version=1.0.0.0, Culture=neutral, 
PublicKeyToken=f6716e4f9b2ed099" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
@@ -100,7 +99,6 @@
<Compile Include="Services.cs" />
<Compile Include="WebkitBrowser.cs" />
<Compile Include="ConfSystem.cs" />
-    <Compile Include="DbusObject.cs" />
<Compile Include="Xorg.cs" />
<Compile Include="Fen_Menu.cs" />
<Compile Include="gtk-gui\frugalmonotools.Fen_Menu.cs" />
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to