-
Notifications
You must be signed in to change notification settings - Fork 1
/
AppRun
executable file
·85 lines (60 loc) · 2.25 KB
/
AppRun
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
#!/usr/bin/env python
import findrox; findrox.version(1, 9, 13)
import sys, os
import rox
from rox.settings import Settings, Setting, BoolSetting, get_gconf
from rox import OptionsBox, g
import colourscheme
try:
import gconf
except:
pass
import theme
__builtins__._ = rox.i18n.translation(os.path.join(rox.app_dir, 'Messages'))
settings = Settings()
def build_toolbar_style_menu(box, node, label, option):
client = get_gconf()
hbox = g.HBox(False, 4)
hbox.pack_start(g.Label(_(label)), False, True, 0)
button = g.combo_box_new_text()
hbox.pack_start(button, True, True, 0)
#button.set_size_request(150, -1)
values = [ 'both', 'both-horiz', 'icons', 'text' ]
labels = [_('Text below icons'), _('Text beside icons'),
_('Icons only'), _('Text only') ]
for label in labels:
button.append_text(label)
def get():
toolbar_style = values[button.get_active()]
if client:
client.set_string ("/desktop/gnome/interface/toolbar_style",
toolbar_style)
return toolbar_style
def set():
toolbar_style=option.value
if client:
client.set_string ("/desktop/gnome/interface/toolbar_style",
toolbar_style)
return button.set_active(values.index(toolbar_style))
box.handlers[option] = (get, set)
button.connect('changed', lambda w: box.check_widget(option))
return [hbox]
OptionsBox.widget_registry['dirmenu'] = build_toolbar_style_menu
OptionsBox.widget_registry['button'] = colourscheme.build_parent_button
settings = Settings()
class ThemeSetting(BoolSetting):
def __init__(self, name, default, gconf_key = None):
BoolSetting.__init__(self, name, default, settings, False, gconf_key)
ThemeSetting('menus_have_icons', 1, 'menus_have_icons')
#ThemeSetting('menubar_detachable', 0)
#ThemeSetting('menus_have_tearoff', 0)
ThemeSetting('toolbar_detachable', 0, 'toolbar_detachable')
#ThemeSetting('Gtk/ToolbarIconSize', 32)
Setting('Gtk/ToolbarStyle', 'icons', settings, True)
Setting('Net/ThemeName', "Default", settings, True, 'gtk_theme')
Setting('Net/IconThemeName', "hicolor", settings, True, 'icon_theme')
colourscheme.init(Setting('Gtk/ColorScheme', '', settings, True,
'gtk_color_scheme'))
box = OptionsBox.OptionsBox(settings, os.path.join(rox.app_dir, 'Options.xml'))
box.open()
rox.mainloop()