From 1e2167d9314ed7aad791752832d3f614f099df1b Mon Sep 17 00:00:00 2001 From: Charlie Reinl Date: Wed, 21 Sep 2016 10:05:42 +0000 Subject: [PATCH] [GB.DESKTOP] * BUG: Desktop.RunAsRoot() should work correctly on SuSE now. It uses 'kdsu' if 'kdsudo' is not found. * NEW: Desktop.RunAsRoot() It uses 'gksu' if 'gksudo' is not found. git-svn-id: svn://localhost/gambas/trunk@7917 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.desktop/.settings | 6 +++--- comp/src/gb.desktop/.src/Desktop.class | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/comp/src/gb.desktop/.settings b/comp/src/gb.desktop/.settings index eb6e6446a..164667968 100644 --- a/comp/src/gb.desktop/.settings +++ b/comp/src/gb.desktop/.settings @@ -26,7 +26,7 @@ Geometry=[848,380,224,280] Path="gb.desktop.gambas" [FCommit] -LastCommit="[GB.DESKTOP]\n* BUG: Change the Mime loading code so it not fail on the first readed glob2 file\n and read all the available files.\n---- Cette ligne et les suivantes seront ignorées ----\n\nM .project\nM .settings\nM .src/DesktopMime.class\nM .src/Tests/Form11.form\nA .src/Tests/Module1.module\nM .startup" +LastCommit="[GB.DESKTOP]\n* BUG: Desktop.RunAsRoot() should work correctly on SuSE now. It uses 'kdsu' if 'kdsudo' is not found.\n* NEW: Desktop.RunAsRoot() It uses 'gksu' if 'gksudo' is not found.\n\n---- Diese Zeile und alles Folgende wird ignoriert. ----" [OpenFile] File[1]=".src/DesktopMime.class:22.357" @@ -35,7 +35,7 @@ File[2]=".src/Tests/Form11.form" Count=15 File[3]=".src/Main.module:22.161" File[4]=".src/DesktopFile.class:0.347" -File[5]=".src/Desktop.class:2.189" +File[5]=".src/Desktop.class:2.454" File[6]=".src/DesktopWatcher.class:2.33" File[7]="xdg-utils/xdg-open:17.383" File[8]=".src/_Desktop_Passwords.class:15.79" @@ -48,7 +48,7 @@ File[14]=".src/_DesktopVirtual.class:0.0" File[15]=".src/DesktopWindow.class:0.0" [VersionControl] -User="gambix" +User="dashboard68" RememberPassword=1 [Watches] diff --git a/comp/src/gb.desktop/.src/Desktop.class b/comp/src/gb.desktop/.src/Desktop.class index 63714b027..0c721123c 100644 --- a/comp/src/gb.desktop/.src/Desktop.class +++ b/comp/src/gb.desktop/.src/Desktop.class @@ -442,13 +442,17 @@ Static Public Sub RunAsRoot(Command As String) Case "KDE", "KDE4", "KDE5" sExec = "kdesudo" + ' newer SuSE have no kdesudo, but a kdesu + If Not System.Exist(sExec) Then sExec = "kdesu" Case "LXDE" sExec = "lxde-sudo" Case Else sExec = "gksudo" + ' gksu with an argument raise a gksudo + If Not System.Exist(sExec) Then sExec = "gksu" End Select - + If Not System.Exist(sExec) Then Error.Raise("No graphical sudo program found") Exec [sExec, Command]