From 3f70b8e27721ad0d10553c19a11b0a2483bcc949 Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Thu, 4 May 2006 10:37:20 +0000 Subject: [PATCH] Bug 171135. Give user the option to launch YAST when micasad is not running. --- c_gui/CasaMain.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/c_gui/CasaMain.cs b/c_gui/CasaMain.cs index 2db31176..2b8e87a1 100644 --- a/c_gui/CasaMain.cs +++ b/c_gui/CasaMain.cs @@ -179,9 +179,7 @@ namespace Novell.CASA.GUI } else { - // NOTE: Until we can figure out how to run YAST as root from here. - //if (Common.IS_LINUX) - if (false) + if (Common.IS_LINUX) { message = "CASA services are not available.\r\n\r\nConfigure CASA using YAST?"; buttonType = Gtk.ButtonsType.YesNo; @@ -331,7 +329,7 @@ namespace Novell.CASA.GUI UnlockGUI(); - Gdk.Color color = new Gdk.Color(90, 77, 189); + Gdk.Color color = new Gdk.Color(90, 77, 189); drawingarea1.ModifyBg(Gtk.StateType.Normal, color); windowMain.Show(); @@ -1666,7 +1664,15 @@ namespace Novell.CASA.GUI if (args.Args[0].Equals(Gtk.ResponseType.Yes)) { // launch yast to configure CASA - Common.StartProcess("/sbin/yast2", "CASA"); + String sCurrentDesktop = Environment.GetEnvironmentVariable("WINDOWMANAGER"); + if (sCurrentDesktop != null && (sCurrentDesktop.IndexOf("kde") > 0)) + { + Common.StartProcess("kdesu", "/sbin/yast2 CASA"); + } + else + { + Common.StartProcess("gnomesu", "/sbin/yast2 CASA"); + } } if (md != null)