~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
' 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 msg AS Boolean = FALSE

PUBLIC SUB DefaultSettings(special AS String)
  FMessage.loadMSG(special)
END

PUBLIC SUB LoadDefaultSettings(special AS String)
DIM tmpText AS String

IF msg = TRUE THEN 
      SELECT CASE FMain.tab
        CASE "launcher"
            MLauncher.defaultSettings()
          
        CASE "dash"
            MDash.defaultSettings()
          
        CASE "panel"
            MPanel.defaultSettings()
          
        CASE "desktop"
            MDesktop.defaultSettings()
           
        CASE "font"
            MFont.defaultSettings()
          
        CASE "launcherQl"
            SELECT CASE Main.Uversion
              CASE "11.04"
              CASE "11.10"
              CASE "12.04"
                TRY KILL User.Home & "/.local/share/applications/" & "*.desktop"
                Main.OriginalTiles = Chr$(34) & Main.OriginalTiles & Chr$(34)
                SHELL "gsettings set com.canonical.Unity.Launcher favorites " & Main.OriginalTiles WAIT 
                WAIT 3
                SHELL "gsettings set com.canonical.Unity.Launcher favorites " & Main.OriginalTiles WAIT   
                MQuicklist.ReadSetting()
           END SELECT 
           
        CASE "themes"
            SELECT CASE Main.Uversion
              CASE "11.10"
                IF special = "" THEN 
                  SHELL "gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'" WAIT 
                  SHELL "gconftool-2 --set --type string /apps/metacity/general/theme 'Ambiance'" WAIT 
                  SHELL "gsettings reset org.gnome.desktop.interface icon-theme" WAIT 
                  
                ELSE IF special = "theme" THEN 
                  tmpText = Replace$(FMain.LabelTheme.Text, " ", Chr(92) & " ")
                  SHELL "rm -R ~/.themes/" & tmpText WAIT 
                  tmpText = Replace$(FMain.nameDirTheme.Text, " ", Chr(92) & " ")
                  SHELL "rm -R ~/.themes/" & tmpText WAIT 
                  SHELL "gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'" WAIT 
                  SHELL "gconftool-2 --set --type string /apps/metacity/general/theme 'Ambiance'" WAIT 
                  
                ELSE IF special = "icons" THEN 
                  tmpText = Replace$(FMain.LabelIcon.Text, " ", Chr(92) & " ")
                  SHELL "rm -R ~/.icons/" & tmpText WAIT 
                  tmpText = Replace$(FMain.nameDirIcons.Text, " ", Chr(92) & " ")
                  SHELL "rm -R ~/.icons/" & tmpText WAIT 
                  SHELL "gsettings reset org.gnome.desktop.interface icon-theme" WAIT 
                  
                ENDIF 
              CASE "12.04"
                IF special = "" THEN 
                  SHELL "gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'" WAIT 
                  SHELL "gconftool-2 --set --type string /apps/metacity/general/theme 'Ambiance'" WAIT 
                  SHELL "gsettings reset org.gnome.desktop.interface icon-theme" WAIT 
                  
                ELSE IF special = "theme" THEN 
                  tmpText = Replace$(FMain.LabelTheme.Text, " ", Chr(92) & " ")
                  SHELL "rm -R ~/.themes/" & tmpText WAIT 
                  tmpText = Replace$(FMain.nameDirTheme.Text, " ", Chr(92) & " ")
                  SHELL "rm -R ~/.themes/" & tmpText WAIT 
                  SHELL "gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'" WAIT 
                  SHELL "gconftool-2 --set --type string /apps/metacity/general/theme 'Ambiance'" WAIT 
                  
                ELSE IF special = "icons" THEN 
                  tmpText = Replace$(FMain.LabelIcon.Text, " ", Chr(92) & " ")
                  SHELL "rm -R ~/.icons/" & tmpText WAIT 
                  tmpText = Replace$(FMain.nameDirIcons.Text, " ", Chr(92) & " ")
                  SHELL "rm -R ~/.icons/" & tmpText WAIT 
                  SHELL "gsettings reset org.gnome.desktop.interface icon-theme" WAIT 
                  
                ENDIF 
           END SELECT 
           
      END SELECT 

  MThemes.start()
  FMain.Prepare_setting()
  msg = FALSE
ENDIF 
END