Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-mono-tools.git;a=commitdiff;h=bdf01a29b595d99a0924b9fdf6ffd697571d2967

commit bdf01a29b595d99a0924b9fdf6ffd697571d2967
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Thu Aug 26 12:42:38 2010 +0000

*can wait the end of proccess

diff --git a/frugal-mono-tools/MainWindow.cs b/frugal-mono-tools/MainWindow.cs
index 8c12a3e..5eac911 100644
--- a/frugal-mono-tools/MainWindow.cs
+++ b/frugal-mono-tools/MainWindow.cs
@@ -222,12 +222,12 @@ public partial class MainWindow : Gtk.Window
protected virtual void OpenLink (object sender, System.EventArgs e)
{
//by default use firefox
-               if (!Outils.Excecute("firefox",BTN_Link.Label))
+               if (!Outils.Excecute("firefox",BTN_Link.Label,false))
{
-                       if (!Outils.Excecute("midori",BTN_Link.Label))
+                       if (!Outils.Excecute("midori",BTN_Link.Label,false))
{
//last chance :p
-                               Outils.Excecute("konqueror",BTN_Link.Label);
+                               
Outils.Excecute("konqueror",BTN_Link.Label,false);
}
}
}
diff --git a/frugal-mono-tools/OUTILS/Outils.cs 
b/frugal-mono-tools/OUTILS/Outils.cs
index 92001b1..d4133bd 100644
--- a/frugal-mono-tools/OUTILS/Outils.cs
+++ b/frugal-mono-tools/OUTILS/Outils.cs
@@ -20,15 +20,15 @@ namespace frugalmonotools
{
public static class Outils
{
-               public static Boolean Excecute(String Commande,string Arguments)
+               public static Boolean Excecute(String Commande,string 
Arguments,bool wait)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName = Commande;
proc.StartInfo.Arguments = Arguments;
-                       if (proc.Start())return true;
-
-                       return false;
+                       if (!proc.Start()) return false;
+                       if (wait) proc.WaitForExit();
+                       return true;
}
/// <summary>
///enable disable service,enable = false disable and stop this service
@@ -43,13 +43,13 @@ namespace frugalmonotools
{
if (enable)
{
-                               Outils.Excecute("service "+servicename+" 
add","");
-                               Outils.Excecute("service "+servicename+" 
start","");
+                               Outils.Excecute("service "+servicename+" 
add","",true);
+                               Outils.Excecute("service "+servicename+" 
start","",true);
}
else
{
-                               Outils.Excecute("service "+servicename+" 
del","");
-                               Outils.Excecute("service "+servicename+" 
stop","");
+                               Outils.Excecute("service "+servicename+" 
del","",true);
+                               Outils.Excecute("service "+servicename+" 
stop","",true);
}
}
/// <summary>
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to