Skip to content
Snippets Groups Projects
Commit 8ab973d4 authored by gambas's avatar gambas
Browse files

Stock: Merge the detection of 'gnome', 'mate' and 'cinnamon' desktops.

[GB.FORM]
* NEW: Stock: Merge the detection of 'gnome', 'mate' and 'cinnamon' desktops.
parent c8a569eb
No related branches found
Tags 0.7.3
No related merge requests found
Pipeline #236638588 passed
......@@ -27,7 +27,7 @@
msgid ""
msgstr ""
"Project-Id-Version: gb.form 3.15.90\n"
"POT-Creation-Date: 2020-12-19 01:25 UTC\n"
"POT-Creation-Date: 2020-12-19 13:00 UTC\n"
"PO-Revision-Date: 2020-12-19 01:25 UTC\n"
"Last-Translator: Benoît Minisini <g4mba5@gmail.com>\n"
"Language: fr\n"
......@@ -438,7 +438,7 @@ msgstr "Aperçu"
msgid "Errors"
msgstr "Erreurs"
#: FFontChooser.class:334
#: FFontChooser.class:338
msgid "How quickly daft jumping zebras vex"
msgstr "Portez ce vieux whisky au juge blond qui fume"
......
......@@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: gb.form 3.15.90\n"
"POT-Creation-Date: 2020-12-19 01:25 UTC\n"
"POT-Creation-Date: 2020-12-19 13:00 UTC\n"
"PO-Revision-Date: 2020-11-18 18:23 UTC\n"
"Last-Translator: Benoît Minisini <g4mba5@gmail.com>\n"
"Language: zh\n"
......@@ -418,7 +418,7 @@ msgstr "预览"
msgid "Errors"
msgstr "错误"
#: FFontChooser.class:334
#: FFontChooser.class:338
msgid "How quickly daft jumping zebras vex"
msgstr "One CHINA, One family. 一个中国,一个家。"
......
# Gambas Project File 3.0
Title=More controls for graphical components
Startup=FTestFontChooser
Startup=FMain
Version=3.15.90
VersionFile=1
Component=gb.image
......@@ -9,7 +9,7 @@ Component=gb.form
Component=gb.settings
Component=gb.form.stock
Authors="Benoît Minisini"
Environment="GB_GUI=gb.qt5\n GB_STOCK_DEBUG=1\n LANG=zh_CN.UTF-8\n LC_ALL=zh_CN.UTF-8\n GTK_DEBUG=interactive\n LC_ALL=en_US.UTF-8"
Environment="GB_GUI=gb.gtk3\n GB_STOCK_DEBUG=1\n LANG=zh_CN.UTF-8\n LC_ALL=zh_CN.UTF-8\n GTK_DEBUG=interactive\n LC_ALL=en_US.UTF-8"
TabSize=2
Translate=1
Language=en
......
......@@ -175,6 +175,27 @@ Static Private Sub FindInConfigFile(aPath As String[], sPattern As String, Optio
End
Static Private Sub GetThemeWithDConf(sDesktop As String) As String
Dim sTheme As String
Try Exec ["dconf", "read", "/org/" & sDesktop & "/desktop/interface/icon-theme"] To sTheme
sTheme = Trim(sTheme)
If Not sTheme Then
Try Exec ["dconf", "read", "/org/" & sDesktop & "/theme/name"] To sTheme
sTheme = Trim(sTheme)
Endif
If sTheme Then
If sTheme Begins "'" Then sTheme = Chr$(34) & Mid$(sTheme, 2, -1) & Chr$(34)
sTheme = UnQuote(sTheme)
Endif
Return sTheme
End
' TODO: Vérifier les thèmes
' FIXME: Mettre à jour
......@@ -193,47 +214,21 @@ Static Private Sub SearchTheme(sDesktop As String)
Select sDesktop
Case "gnome", "cinnamon"
'If Not sTheme Then Try Exec ["gconftool-2", "-g", "/desktop/gnome/interface/icon_theme"] To sTheme
If sDesktop = "cinnamon" Then
Try Exec ["dconf", "read", "/org/cinnamon/theme/name"] To sTheme
Endif
If Not sTheme Then Try Exec ["dconf", "read", "/org/gnome/desktop/interface/icon-theme"] To sTheme
If sTheme Then
sTheme = Trim(sTheme)
If sTheme Begins "'" Then sTheme = Chr$(34) & Mid$(sTheme, 2, -1) & Chr$(34)
sTheme = UnQuote(sTheme)
sTheme = Trim(sTheme)
Endif
GetAllThemePath("gnome", $aRoots, sTheme)
AddPath("gnome", "/usr/share/icons/gnome")
AddPath("gnome", "/usr/share/icons/hicolor")
'AddPath("gnome", "/usr/X11R6/share/icons/hicolor")
Case "mate"
Case "gnome", "cinnamon", "mate"
sTheme = GetThemeWithDConf(sDesktop)
If Not sTheme And If sDesktop <> "gnome" Then sTheme = GetThemeWithDConf("gnome")
If Not sTheme Then
Try Exec ["dconf", "read", "/org/mate/desktop/interface/icon-theme"] To sTheme
If sTheme Then
sTheme = Trim(sTheme)
If sTheme Begins "'" Then sTheme = Chr$(34) & Mid$(sTheme, 2, -1) & Chr$(34)
sTheme = UnQuote(sTheme)
Else
If sDesktop = "mate" Then
Try Exec ["mateconftool-2", "-g", "/desktop/mate/interface/icon_theme"] To sTheme
sTheme = Trim(sTheme)
Else
Try Exec ["gconftool-2", "-g", "/desktop/gnome/interface/icon_theme"] To sTheme
Endif
sTheme = Trim(sTheme)
Endif
If sTheme Then GetAllThemePath("gnome", $aRoots, sTheme)
If sTheme Then
GetAllThemePath("gnome", $aRoots, sTheme)
Endif
AddPath("gnome", "/usr/share/icons/mate")
AddPath("gnome", "/usr/share/icons/gnome")
AddPath("gnome", "/usr/share/icons/hicolor")
'AddPath("gnome", "/usr/X11R6/share/icons/hicolor")
......
......@@ -9,6 +9,7 @@ End
Public Sub Form_Open()
Component.Load("gb.form.dialog")
Debug Style.Name
End
......@@ -18,3 +19,12 @@ Public Sub Button1_Click()
Print DateBox1.Text;; DateBox1.Value
End
Public Sub ButtonBox1_Click()
Dialog.Path = ButtonBox1.Text
Dialog.Filter = ["*.pdf", ("PDF files"), "*.ps", ("Postscript files")]
If Dialog.SaveFile() Then Return
End
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment