~albx79/+junk/myunity-clearer-labels

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
' Gambas module file
'******************************************************************************
' This file is part of MyUnity
'
' Copyright © 2011-2012 Fabio Colinelli
' Copyright © 2011-2012 Davide Pedrelli
' Authors: Fabio "Pixel" Colinelli <pixel.ubuntu@gmail.com>
'          Davide "Pedro" Pedrelli <pobox.davide@gmail.com>
'          Sergio "Giowile" Gridelli <sergio.gridelli@gmail.com>
'          Andrea "warp10" Colangelo <warp10@ubuntu.com>
'
' 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; version 3 OF the License.
'  
' 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., 51 Franklin St, Fifth Floor, Boston, MA 02110 - 1301, USA.
'
'******************************************************************************

PUBLIC SUB start()
  DisableControls()
  Combo_insert()
  readSettings()
  SetLabel()
  SetPictureBox()
END


PUBLIC SUB DisableControls()
  
  SELECT CASE Main.Uversion
    CASE "11.04"
      
    CASE "11.10"
      
    CASE "12.04"
      
  END SELECT 
  
END


PUBLIC SUB Combo_insert()
  'Font hinting
  FMain.ComboBox2.Add("none")
  FMain.ComboBox2.Add("slight")
  FMain.ComboBox2.Add("medium")
  FMain.ComboBox2.Add("full")
  
  'Font antialiasing
  FMain.ComboBox1.Add("none")
  FMain.ComboBox1.Add("grayscale")
  FMain.ComboBox1.Add("rgba")
END 


PUBLIC SUB readSettings()
  DIM tmpValue AS Variant
  DIM tmpShell AS String

      tmpValue = Main.GconfGet("/apps/metacity/general/", "titlebar_font") ' Window title
      tmpValue = Replace(tmpValue, "'", "")
      FMain.ButtonFtitle.Text = tmpValue
      
      tmpValue = Main.GsettingsGet("org.gnome.desktop.interface", "document-font-name") ' Document
      tmpValue = Replace(tmpValue, "'", "")
      FMain.ButtonFdocument.Text = tmpValue
      
      tmpValue = Main.GsettingsGet("org.gnome.nautilus.desktop", "font") ' Desktop
      tmpValue = Replace(tmpValue, "'", "")
      FMain.ButtonFdesktop.Text = tmpValue
      
      tmpValue = Main.GsettingsGet("org.gnome.desktop.interface", "font-name") ' System
      tmpValue = Replace(tmpValue, "'", "")
      FMain.ButtonFsystem.Text = tmpValue
      
      tmpValue = Main.GsettingsGet("org.gnome.desktop.interface", "monospace-font-name") ' Monospace
      tmpValue = Replace(tmpValue, "'", "")
      FMain.ButtonFmono.Text = tmpValue

      tmpValue = Main.GsettingsGet("org.gnome.settings-daemon.plugins.xsettings", "hinting") ' Hinting
      tmpValue = Right$(Left$(tmpValue, Len(tmpValue) - 2), -1)
      IF tmpValue = "none" THEN FMain.ComboBox2.Index = 0
      IF tmpValue = "slight" THEN FMain.ComboBox2.Index = 1
      IF tmpValue = "medium" THEN FMain.ComboBox2.Index = 2
      IF tmpValue = "full" THEN FMain.ComboBox2.Index = 3
      
      tmpValue = Main.GsettingsGet("org.gnome.settings-daemon.plugins.xsettings", "antialiasing") ' Antialiasing
      tmpValue = Right$(Left$(tmpValue, Len(tmpValue) - 2), -1)
      IF tmpValue = "none" THEN FMain.ComboBox1.Index = 0
      IF tmpValue = "grayscale" THEN FMain.ComboBox1.Index = 1
      IF tmpValue = "rgba" THEN FMain.ComboBox1.Index = 2
      
END


PUBLIC SUB SetLabel()  ' setup label
  
END


PUBLIC SUB SetPictureBox()
  
END


PUBLIC SUB defaultSettings()

      SHELL "gconftool --unset /apps/metacity/general/titlebar_font" WAIT  ' Window title
      SHELL "gsettings reset org.gnome.desktop.interface document-font-name" WAIT  ' Document
      SHELL "gsettings set org.gnome.nautilus.desktop font 'Ubuntu 11'" WAIT ' Desktop
      SHELL "gsettings reset org.gnome.desktop.interface font-name" ' System
      SHELL "gsettings reset org.gnome.desktop.interface monospace-font-name" WAIT  ' Monospace
      
      SHELL "gsettings reset org.gnome.settings-daemon.plugins.xsettings hinting" WAIT  ' Hinting
      SHELL "gsettings reset org.gnome.settings-daemon.plugins.xsettings antialiasing" WAIT  ' Antialiasing
  
readSettings()
END