Merge lp:~muktupavels/compiz/prepare-for-pygobject into lp:compiz/0.9.13
- prepare-for-pygobject
- Merge into 0.9.13
Proposed by
Alberts Muktupāvels
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | 4156 |
Merged at revision: | 4155 |
Proposed branch: | lp:~muktupavels/compiz/prepare-for-pygobject |
Merge into: | lp:compiz/0.9.13 |
Diff against target: |
1733 lines (+274/-261) 5 files modified
compizconfig/ccsm/ccm/Pages.py (+89/-86) compizconfig/ccsm/ccm/Settings.py (+54/-52) compizconfig/ccsm/ccm/Utils.py (+25/-22) compizconfig/ccsm/ccm/Widgets.py (+98/-95) compizconfig/ccsm/ccm/Window.py (+8/-6) |
To merge this branch: | bzr merge lp:~muktupavels/compiz/prepare-for-pygobject |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Dmitry Shachnev | Approve | ||
Compiz Maintainers | Pending | ||
Review via email:
|
Commit message
ccsm: prepare for PyGObject
Description of the change
Rename few gtk.* to Gtk.* to reduce diff when porting to python 3, pygobject and gtk+ 3. Do same also with gobject.*...
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Dmitry Shachnev (mitya57) : | # |
review:
Approve
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Marco Trevisan (Treviño) (3v1n0) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'compizconfig/ccsm/ccm/Pages.py' |
2 | --- compizconfig/ccsm/ccm/Pages.py 2018-06-27 09:51:35 +0000 |
3 | +++ compizconfig/ccsm/ccm/Pages.py 2018-07-08 20:42:11 +0000 |
4 | @@ -34,6 +34,9 @@ |
5 | from ccm.Utils import * |
6 | from ccm.Widgets import * |
7 | |
8 | +Gtk = gtk |
9 | +GObject = gobject |
10 | + |
11 | import locale |
12 | import gettext |
13 | locale.setlocale(locale.LC_ALL, "") |
14 | @@ -45,16 +48,16 @@ |
15 | |
16 | # Generic Page |
17 | # |
18 | -class GenericPage(gobject.GObject): |
19 | - __gsignals__ = {"go-back" : (gobject.SIGNAL_RUN_FIRST, |
20 | - gobject.TYPE_NONE, |
21 | +class GenericPage(GObject.GObject): |
22 | + __gsignals__ = {"go-back" : (GObject.SIGNAL_RUN_FIRST, |
23 | + GObject.TYPE_NONE, |
24 | [])} |
25 | |
26 | LeftWidget = None |
27 | RightWidget = None |
28 | |
29 | def __init__(self): |
30 | - gobject.GObject.__init__(self) |
31 | + GObject.GObject.__init__(self) |
32 | |
33 | def GoBack(self, widget): |
34 | self.emit('go-back') |
35 | @@ -66,7 +69,7 @@ |
36 | def __init__(self, plugin): |
37 | GenericPage.__init__(self) |
38 | self.Plugin = plugin |
39 | - self.LeftWidget = gtk.VBox(False, 10) |
40 | + self.LeftWidget = Gtk.VBox(False, 10) |
41 | self.LeftWidget.set_border_width(10) |
42 | |
43 | pluginLabel = Label() |
44 | @@ -83,7 +86,7 @@ |
45 | self.LeftWidget.pack_start(filterLabel, False, False, 0) |
46 | self.LeftWidget.pack_start(self.FilterEntry, False, False, 0) |
47 | self.LeftWidget.pack_start(pluginLabel, False, False, 0) |
48 | - infoLabelCont = gtk.HBox() |
49 | + infoLabelCont = Gtk.HBox() |
50 | infoLabelCont.set_border_width(10) |
51 | self.LeftWidget.pack_start(infoLabelCont, False, False, 0) |
52 | infoLabel = Label(plugin.LongDesc, 180) |
53 | @@ -97,10 +100,10 @@ |
54 | enableLabel.set_markup(HeaderMarkup % (_("Use This Plugin"))) |
55 | enableLabel.connect("style-set", self.HeaderStyleSet) |
56 | self.LeftWidget.pack_start(enableLabel, False, False, 0) |
57 | - enableCheckCont = gtk.HBox() |
58 | + enableCheckCont = Gtk.HBox() |
59 | enableCheckCont.set_border_width(10) |
60 | self.LeftWidget.pack_start(enableCheckCont, False, False, 0) |
61 | - enableCheck = gtk.CheckButton() |
62 | + enableCheck = Gtk.CheckButton() |
63 | enableCheck.add(Label(_("Enable %s") % plugin.ShortDesc, 120)) |
64 | enableCheck.set_tooltip_text(plugin.LongDesc) |
65 | enableCheck.set_active(plugin.Enabled) |
66 | @@ -110,11 +113,11 @@ |
67 | else: |
68 | self.FilterEntry.set_tooltip_text(_("Search Compiz Core Options")) |
69 | |
70 | - backButton = gtk.Button(gtk.STOCK_GO_BACK) |
71 | + backButton = Gtk.Button(Gtk.STOCK_GO_BACK) |
72 | backButton.set_use_stock(True) |
73 | self.LeftWidget.pack_end(backButton, False, False, 0) |
74 | backButton.connect('clicked', self.GoBack) |
75 | - self.RightWidget = gtk.Notebook() |
76 | + self.RightWidget = Gtk.Notebook() |
77 | self.RightWidget.set_scrollable(True) |
78 | self.Pages = [] |
79 | |
80 | @@ -124,7 +127,7 @@ |
81 | groupPage = GroupPage(name, group) |
82 | groupPage.Wrap() |
83 | if not groupPage.Empty: |
84 | - self.RightWidget.append_page(groupPage.Scroll, gtk.Label(name)) |
85 | + self.RightWidget.append_page(groupPage.Scroll, Gtk.Label(name)) |
86 | self.Pages.append(groupPage) |
87 | |
88 | self.RightWidget.connect('size-allocate', self.ResetFocus) |
89 | @@ -159,7 +162,7 @@ |
90 | |
91 | if self.NotFoundBox is None: |
92 | self.NotFoundBox = NotFoundBox(text) |
93 | - self.RightWidget.append_page(self.NotFoundBox, gtk.Label(_("Error"))) |
94 | + self.RightWidget.append_page(self.NotFoundBox, Gtk.Label(_("Error"))) |
95 | else: |
96 | self.NotFoundBox.update(text) |
97 | |
98 | @@ -185,7 +188,7 @@ |
99 | if page.Filter(text): |
100 | empty = False |
101 | if num < 0: |
102 | - self.RightWidget.insert_page(page.Scroll, gtk.Label(page.Name), self.GetPageSpot(page)) |
103 | + self.RightWidget.insert_page(page.Scroll, Gtk.Label(page.Name), self.GetPageSpot(page)) |
104 | else: |
105 | if num >= 0: |
106 | self.RightWidget.remove_page(num) |
107 | @@ -242,10 +245,10 @@ |
108 | def __init__(self, context): |
109 | GenericPage.__init__(self) |
110 | self.Context = context |
111 | - self.LeftWidget = gtk.VBox(False, 10) |
112 | + self.LeftWidget = Gtk.VBox(False, 10) |
113 | self.LeftWidget.set_border_width(10) |
114 | - self.RightWidget = gtk.Notebook() |
115 | - self.RightChild = gtk.VBox() |
116 | + self.RightWidget = Gtk.Notebook() |
117 | + self.RightChild = Gtk.VBox() |
118 | |
119 | # Image + Label |
120 | filterLabel = Label() |
121 | @@ -272,23 +275,23 @@ |
122 | self.LeftWidget.pack_start(filterSearchLabel, False, False, 0) |
123 | |
124 | # Options |
125 | - self.FilterNameCheck = check = gtk.CheckButton(_("Short description and name")) |
126 | + self.FilterNameCheck = check = Gtk.CheckButton(_("Short description and name")) |
127 | check.set_active(True) |
128 | check.connect("toggled", self.LevelChanged, FilterName) |
129 | self.LeftWidget.pack_start(check, False, False, 0) |
130 | |
131 | - self.FilterLongDescCheck = check = gtk.CheckButton(_("Long description")) |
132 | + self.FilterLongDescCheck = check = Gtk.CheckButton(_("Long description")) |
133 | check.set_active(True) |
134 | check.connect("toggled", self.LevelChanged, FilterLongDesc) |
135 | self.LeftWidget.pack_start(check, False, False, 0) |
136 | |
137 | - self.FilterValueCheck = check = gtk.CheckButton(_("Settings value")) |
138 | + self.FilterValueCheck = check = Gtk.CheckButton(_("Settings value")) |
139 | check.set_active(False) |
140 | check.connect("toggled", self.LevelChanged, FilterValue) |
141 | self.LeftWidget.pack_start(check, False, False, 0) |
142 | |
143 | # Back Button |
144 | - self.BackButton = gtk.Button(gtk.STOCK_GO_BACK) |
145 | + self.BackButton = Gtk.Button(Gtk.STOCK_GO_BACK) |
146 | self.BackButton.set_use_stock(True) |
147 | self.BackButton.connect('clicked', self.GoBack) |
148 | self.LeftWidget.pack_end(self.BackButton, False, False, 0) |
149 | @@ -318,30 +321,30 @@ |
150 | |
151 | self.SelectorButtons.set_size_request(-1, 50) |
152 | |
153 | - self.SelectorBoxes = gtk.HBox() |
154 | + self.SelectorBoxes = Gtk.HBox() |
155 | self.SelectorBoxes.set_border_width(5) |
156 | self.SelectorBoxes.set_spacing(5) |
157 | |
158 | - scroll = gtk.ScrolledWindow() |
159 | + scroll = Gtk.ScrolledWindow() |
160 | scroll.props.hscrollbar_policy = gtk.POLICY_AUTOMATIC |
161 | scroll.props.vscrollbar_policy = gtk.POLICY_AUTOMATIC |
162 | scroll.add(self.PluginBox) |
163 | self.SelectorBoxes.pack_start(scroll, False, False, 0) |
164 | - scroll = gtk.ScrolledWindow() |
165 | + scroll = Gtk.ScrolledWindow() |
166 | scroll.props.hscrollbar_policy = gtk.POLICY_AUTOMATIC |
167 | scroll.props.vscrollbar_policy = gtk.POLICY_AUTOMATIC |
168 | scroll.add(self.GroupBox) |
169 | self.SelectorBoxes.pack_start(scroll, False, False, 0) |
170 | - scroll = gtk.ScrolledWindow() |
171 | + scroll = Gtk.ScrolledWindow() |
172 | scroll.add(self.SubGroupBox) |
173 | scroll.props.hscrollbar_policy = gtk.POLICY_AUTOMATIC |
174 | scroll.props.vscrollbar_policy = gtk.POLICY_AUTOMATIC |
175 | self.SelectorBoxes.pack_start(scroll, False, False, 0) |
176 | self.RightChild.pack_start(self.SelectorButtons, False, False, 0) |
177 | self.RightChild.pack_start(self.SelectorBoxes, False, False, 0) |
178 | - self.SettingsArea = gtk.ScrolledWindow() |
179 | - ebox = gtk.EventBox() |
180 | - self.SettingsBox = gtk.VBox() |
181 | + self.SettingsArea = Gtk.ScrolledWindow() |
182 | + ebox = Gtk.EventBox() |
183 | + self.SettingsBox = Gtk.VBox() |
184 | ebox.add(self.SettingsBox) |
185 | self.SettingsBox.set_border_width(5) |
186 | self.SettingsArea.props.hscrollbar_policy = gtk.POLICY_AUTOMATIC |
187 | @@ -353,20 +356,20 @@ |
188 | GlobalUpdater.Block += 1 |
189 | |
190 | # Notebook |
191 | - self.NotebookLabel = gtk.Label(_("Settings")) |
192 | - self.NotebookChild = gtk.EventBox() |
193 | + self.NotebookLabel = Gtk.Label(_("Settings")) |
194 | + self.NotebookChild = Gtk.EventBox() |
195 | self.NotebookChild.add(self.RightChild) |
196 | self.RightWidget.append_page(self.NotebookChild, self.NotebookLabel) |
197 | |
198 | - box = gtk.VBox() |
199 | + box = Gtk.VBox() |
200 | box.set_border_width(5) |
201 | progress = Popup(child=box) |
202 | progress.connect("delete-event", lambda *a: True) |
203 | progress.set_title(_("Loading Advanced Search")) |
204 | - bar = gtk.ProgressBar() |
205 | + bar = Gtk.ProgressBar() |
206 | box.pack_start(bar, False, False, 0) |
207 | |
208 | - label = gtk.Label() |
209 | + label = Gtk.Label() |
210 | box.pack_start(label, False, False, 0) |
211 | |
212 | progress.set_size_request(300, -1) |
213 | @@ -593,7 +596,7 @@ |
214 | self.PackedPlugins = [] |
215 | self.PackedGroups = [] |
216 | for plugin in plugins: |
217 | - box = gtk.VBox() |
218 | + box = Gtk.VBox() |
219 | for (pageName, page) in self.GroupPages[plugin.Name]: |
220 | box.pack_start(page.Label, False, False, 0) |
221 | box.pack_start(page.Widget, False, False, 0) |
222 | @@ -652,16 +655,16 @@ |
223 | class ProfileBackendPage(object): |
224 | def __init__(self, context): |
225 | self.Context = context |
226 | - rightChild = gtk.VBox() |
227 | + rightChild = Gtk.VBox() |
228 | rightChild.set_border_width(10) |
229 | |
230 | # Profiles |
231 | - profileBox = gtk.HBox() |
232 | + profileBox = Gtk.HBox() |
233 | profileBox.set_spacing(5) |
234 | - profileAdd = gtk.Button() |
235 | + profileAdd = Gtk.Button() |
236 | profileAdd.set_tooltip_text(_("Add a New Profile")) |
237 | profileAdd.set_image(gtk.image_new_from_stock(gtk.STOCK_ADD, gtk.ICON_SIZE_BUTTON)) |
238 | - self.ProfileRemoveButton = profileRemove = gtk.Button() |
239 | + self.ProfileRemoveButton = profileRemove = Gtk.Button() |
240 | profileRemove.set_tooltip_text(_("Remove This Profile")) |
241 | profileRemove.set_image(gtk.image_new_from_stock(gtk.STOCK_REMOVE, gtk.ICON_SIZE_BUTTON)) |
242 | self.ProfileComboBox = gtk.combo_box_new_text() |
243 | @@ -684,15 +687,15 @@ |
244 | profileLabel = Label() |
245 | profileLabel.set_markup(HeaderMarkup % (_("Profile"))) |
246 | profileLabel.connect("style-set", self.HeaderStyleSet) |
247 | - self.ProfileImportExportBox = gtk.HBox() |
248 | + self.ProfileImportExportBox = Gtk.HBox() |
249 | self.ProfileImportExportBox.set_spacing(5) |
250 | - profileImportButton = gtk.Button(_("Import")) |
251 | + profileImportButton = Gtk.Button(_("Import")) |
252 | profileImportButton.set_tooltip_text(_("Import a CompizConfig Profile")) |
253 | - profileImportAsButton = gtk.Button(_("Import as...")) |
254 | + profileImportAsButton = Gtk.Button(_("Import as...")) |
255 | profileImportAsButton.set_tooltip_text(_("Import a CompizConfig Profile as a new profile")) |
256 | - profileExportButton = gtk.Button(_("Export")) |
257 | + profileExportButton = Gtk.Button(_("Export")) |
258 | profileExportButton.set_tooltip_text(_("Export your CompizConfig Profile")) |
259 | - profileResetButton = gtk.Button(_("Reset to defaults")) |
260 | + profileResetButton = Gtk.Button(_("Reset to defaults")) |
261 | profileResetButton.set_tooltip_text(_("Reset your CompizConfig Profile to the global defaults")) |
262 | profileResetButton.set_image(gtk.image_new_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_BUTTON)) |
263 | profileImportButton.set_image(gtk.image_new_from_stock(gtk.STOCK_OPEN, gtk.ICON_SIZE_BUTTON)) |
264 | @@ -730,7 +733,7 @@ |
265 | integrationLabel = Label() |
266 | integrationLabel.set_markup(HeaderMarkup % (_("Integration"))) |
267 | integrationLabel.connect("style-set", self.HeaderStyleSet) |
268 | - self.IntegrationButton = gtk.CheckButton(_("Enable integration into the desktop environment")) |
269 | + self.IntegrationButton = Gtk.CheckButton(_("Enable integration into the desktop environment")) |
270 | self.IntegrationButton.set_active(self.Context.Integration) |
271 | self.IntegrationButton.set_sensitive(self.Context.CurrentBackend.IntegrationSupport) |
272 | self.IntegrationButton.connect("toggled", self.IntegrationChanged) |
273 | @@ -791,10 +794,10 @@ |
274 | return False |
275 | |
276 | def ProfileChangedAddTimeout(self, widget): |
277 | - gobject.timeout_add (500, self.ProfileChanged, widget) |
278 | + Gobject.timeout_add (500, self.ProfileChanged, widget) |
279 | |
280 | def CreateFilter(self, chooser): |
281 | - filter = gtk.FileFilter() |
282 | + filter = Gtk.FileFilter() |
283 | filter.add_pattern("*.profile") |
284 | filter.set_name(_("Profiles (*.profile)")) |
285 | chooser.add_filter(filter) |
286 | @@ -838,7 +841,7 @@ |
287 | def ImportProfileDialog (self, main): |
288 | b = (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, |
289 | gtk.STOCK_OPEN, gtk.RESPONSE_OK) |
290 | - chooser = gtk.FileChooserDialog (title = _("Open file.."), |
291 | + chooser = Gtk.FileChooserDialog (title = _("Open file.."), |
292 | parent = main, buttons = b) |
293 | chooser.set_current_folder (os.environ.get ("HOME")) |
294 | self.CreateFilter (chooser) |
295 | @@ -856,8 +859,8 @@ |
296 | dlg.add_button (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) |
297 | dlg.add_button (gtk.STOCK_ADD, gtk.RESPONSE_OK) |
298 | |
299 | - entry = gtk.Entry () |
300 | - label = gtk.Label (_("Please enter a name for the new profile:")) |
301 | + entry = Gtk.Entry () |
302 | + label = Gtk.Label (_("Please enter a name for the new profile:")) |
303 | dlg.vbox.pack_start (label, False, False, 5) |
304 | dlg.vbox.pack_start (entry, False, False, 5) |
305 | |
306 | @@ -924,7 +927,7 @@ |
307 | return False |
308 | |
309 | def BackendChangedAddTimeout(self, widget): |
310 | - gobject.timeout_add (500, self.BackendChanged, widget) |
311 | + Gobject.timeout_add (500, self.BackendChanged, widget) |
312 | |
313 | # Plugin List Page |
314 | # |
315 | @@ -932,32 +935,32 @@ |
316 | def __init__(self, context): |
317 | self.Context = context |
318 | self.Block = 0 |
319 | - rightChild = gtk.VBox() |
320 | + rightChild = Gtk.VBox() |
321 | rightChild.set_border_width(10) |
322 | |
323 | # Auto sort |
324 | - autoSort = gtk.CheckButton(_("Automatic plugin sorting")) |
325 | + autoSort = Gtk.CheckButton(_("Automatic plugin sorting")) |
326 | rightChild.pack_start(autoSort, False, False, 10) |
327 | |
328 | # Lists |
329 | - listBox = gtk.HBox() |
330 | + listBox = Gtk.HBox() |
331 | listBox.set_spacing(5) |
332 | |
333 | self.DisabledPluginsList = ScrolledList(_("Disabled Plugins")) |
334 | self.EnabledPluginsList = ScrolledList(_("Enabled Plugins")) |
335 | |
336 | # Left/Right buttons |
337 | - self.MiddleButtonBox = buttonBox = gtk.VBox() |
338 | + self.MiddleButtonBox = buttonBox = Gtk.VBox() |
339 | buttonBox.set_spacing(5) |
340 | boxAlignment = gtk.Alignment(0.0, 0.5, 0.0, 0.0) |
341 | boxAlignment.add(buttonBox) |
342 | |
343 | - rightButton = gtk.Button() |
344 | + rightButton = Gtk.Button() |
345 | rightImage = Image(gtk.STOCK_GO_FORWARD, ImageStock, gtk.ICON_SIZE_BUTTON) |
346 | rightButton.set_image(rightImage) |
347 | rightButton.connect("clicked", self.EnablePlugins) |
348 | |
349 | - leftButton = gtk.Button() |
350 | + leftButton = Gtk.Button() |
351 | leftImage = Image(gtk.STOCK_GO_BACK, ImageStock, gtk.ICON_SIZE_BUTTON) |
352 | leftButton.set_image(leftImage) |
353 | leftButton.connect("clicked", self.EnabledPluginsList.delete) |
354 | @@ -966,23 +969,23 @@ |
355 | buttonBox.pack_start(leftButton, False, False, 0) |
356 | |
357 | # Up/Down buttons |
358 | - enabledBox = gtk.VBox() |
359 | + enabledBox = Gtk.VBox() |
360 | enabledBox.set_spacing(10) |
361 | |
362 | enabledAlignment = gtk.Alignment(0.5, 0.0, 0.0, 0.0) |
363 | - self.EnabledButtonBox = enabledButtonBox = gtk.HBox() |
364 | + self.EnabledButtonBox = enabledButtonBox = Gtk.HBox() |
365 | enabledButtonBox.set_spacing(5) |
366 | enabledAlignment.add(enabledButtonBox) |
367 | |
368 | - upButton = gtk.Button(gtk.STOCK_GO_UP) |
369 | - downButton = gtk.Button(gtk.STOCK_GO_DOWN) |
370 | + upButton = Gtk.Button(Gtk.STOCK_GO_UP) |
371 | + downButton = Gtk.Button(Gtk.STOCK_GO_DOWN) |
372 | upButton.set_use_stock(True) |
373 | downButton.set_use_stock(True) |
374 | upButton.connect('clicked', self.EnabledPluginsList.move_up) |
375 | downButton.connect('clicked', self.EnabledPluginsList.move_down) |
376 | |
377 | # Add buttons |
378 | - addButton = gtk.Button(gtk.STOCK_ADD) |
379 | + addButton = Gtk.Button(Gtk.STOCK_ADD) |
380 | addButton.set_use_stock(True) |
381 | addButton.connect('clicked', self.AddPlugin) |
382 | |
383 | @@ -1055,16 +1058,16 @@ |
384 | self.DisabledPluginsList.append(plugin.Name) |
385 | |
386 | def AddPlugin(self, widget): |
387 | - dlg = gtk.Dialog(_("Add plugin")) |
388 | + dlg = Gtk.Dialog(_("Add plugin")) |
389 | dlg.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) |
390 | dlg.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK).grab_default() |
391 | dlg.set_default_response(gtk.RESPONSE_OK) |
392 | |
393 | - label = gtk.Label(_("Plugin name:")) |
394 | + label = Gtk.Label(_("Plugin name:")) |
395 | label.set_tooltip_text(_("Insert plugin name")) |
396 | dlg.vbox.pack_start(label, True, True, 0) |
397 | |
398 | - entry = gtk.Entry() |
399 | + entry = Gtk.Entry() |
400 | entry.props.activates_default = True |
401 | dlg.vbox.pack_start(entry, True, True, 0) |
402 | |
403 | @@ -1102,9 +1105,9 @@ |
404 | def __init__(self, context): |
405 | GenericPage.__init__(self) |
406 | self.Context = context |
407 | - self.LeftWidget = gtk.VBox(False, 10) |
408 | + self.LeftWidget = Gtk.VBox(False, 10) |
409 | self.LeftWidget.set_border_width(10) |
410 | - self.RightWidget = gtk.Notebook() |
411 | + self.RightWidget = Gtk.Notebook() |
412 | |
413 | # Left Pane |
414 | self.DescLabel = Label() |
415 | @@ -1113,7 +1116,7 @@ |
416 | self.DescImg = Image("profiles",ImageCategory, 64) |
417 | self.LeftWidget.pack_start(self.DescImg, False, False, 0) |
418 | self.LeftWidget.pack_start(self.DescLabel, False, False, 0) |
419 | - self.InfoLabelCont = gtk.HBox() |
420 | + self.InfoLabelCont = Gtk.HBox() |
421 | self.InfoLabelCont.set_border_width(10) |
422 | self.LeftWidget.pack_start(self.InfoLabelCont, False, False, 0) |
423 | self.InfoLabel = Label(_("Configure the backend, profile and other internal settings used by the Compiz Configuration System."), 180) |
424 | @@ -1123,35 +1126,35 @@ |
425 | aboutLabel = Label() |
426 | aboutLabel.set_markup(HeaderMarkup % (_("About"))) |
427 | aboutLabel.connect("style-set", self.HeaderStyleSet) |
428 | - aboutButton = gtk.Button() |
429 | + aboutButton = Gtk.Button() |
430 | aboutButton.set_relief(gtk.RELIEF_NONE) |
431 | aboutImage = Image(gtk.STOCK_ABOUT, ImageStock, gtk.ICON_SIZE_BUTTON) |
432 | - aboutFrame = gtk.HBox() |
433 | + aboutFrame = Gtk.HBox() |
434 | aboutFrame.set_spacing(5) |
435 | aboutFrame.pack_start(aboutImage, False, False, 0) |
436 | aboutFrame.pack_start(Label(_("About CCSM...")), False, False, 0) |
437 | aboutButton.add(aboutFrame) |
438 | aboutButton.set_tooltip_text(_("About")) |
439 | aboutButton.connect('clicked', self.ShowAboutDialog) |
440 | - aboutBin = gtk.HBox() |
441 | + aboutBin = Gtk.HBox() |
442 | aboutBin.set_border_width(10) |
443 | aboutBin.pack_start(aboutButton, False, False, 0) |
444 | self.LeftWidget.pack_start(aboutLabel, False, False, 0) |
445 | self.LeftWidget.pack_start(aboutBin, False, False, 0) |
446 | |
447 | # Back Button |
448 | - backButton = gtk.Button(gtk.STOCK_GO_BACK) |
449 | + backButton = Gtk.Button(Gtk.STOCK_GO_BACK) |
450 | backButton.set_use_stock(True) |
451 | backButton.connect('clicked', self.GoBack) |
452 | self.LeftWidget.pack_end(backButton, False, False, 0) |
453 | |
454 | # Profile & Backend Page |
455 | self.ProfileBackendPage = ProfileBackendPage(context) |
456 | - self.RightWidget.append_page(self.ProfileBackendPage.Widget, gtk.Label(_("Profile & Backend"))) |
457 | + self.RightWidget.append_page(self.ProfileBackendPage.Widget, Gtk.Label(_("Profile & Backend"))) |
458 | |
459 | # Plugin List |
460 | self.PluginListPage = PluginListPage(context) |
461 | - self.RightWidget.append_page(self.PluginListPage.Widget, gtk.Label(_("Plugin List"))) |
462 | + self.RightWidget.append_page(self.PluginListPage.Widget, Gtk.Label(_("Plugin List"))) |
463 | |
464 | StyleBlock = 0 |
465 | |
466 | @@ -1175,7 +1178,7 @@ |
467 | def __init__(self, main, context): |
468 | self.Context = context |
469 | self.Main = main |
470 | - sidebar = gtk.VBox(False, 10) |
471 | + sidebar = Gtk.VBox(False, 10) |
472 | sidebar.set_border_width(10) |
473 | pluginWindow = PluginWindow(self.Context) |
474 | pluginWindow.connect('show-plugin', self.ShowPlugin) |
475 | @@ -1206,7 +1209,7 @@ |
476 | sidebar.pack_start(screenBox, False, False, 0) |
477 | |
478 | # Categories |
479 | - categoryBox = gtk.VBox() |
480 | + categoryBox = Gtk.VBox() |
481 | categoryBox.set_border_width(5) |
482 | categories = ['All'] + sorted(pluginWindow.get_categories(), key=CategoryKeyFunc) |
483 | for category in categories: |
484 | @@ -1221,7 +1224,7 @@ |
485 | align = gtk.Alignment (0, 0.5, 1, 1) |
486 | align.set_padding (0, 0, 0, 10) |
487 | align.add (categoryToggleIcon) |
488 | - categoryToggleBox = gtk.HBox () |
489 | + categoryToggleBox = Gtk.HBox () |
490 | categoryToggleBox.pack_start (align, False, False, 0) |
491 | categoryToggleBox.pack_start (categoryToggleLabel, True, True, 0) |
492 | categoryToggle = PrettyButton () |
493 | @@ -1234,7 +1237,7 @@ |
494 | categoryLabel.connect("style-set", self.HeaderStyleSet) |
495 | |
496 | # Exit Button |
497 | - exitButton = gtk.Button(gtk.STOCK_CLOSE) |
498 | + exitButton = Gtk.Button(Gtk.STOCK_CLOSE) |
499 | exitButton.set_use_stock(True) |
500 | exitButton.connect('clicked', self.Main.Quit) |
501 | |
502 | @@ -1242,12 +1245,12 @@ |
503 | searchLabel = Label() |
504 | searchLabel.set_markup(HeaderMarkup % (_("Advanced Search"))) |
505 | searchLabel.connect("style-set", self.HeaderStyleSet) |
506 | - searchImage = gtk.Image() |
507 | + searchImage = Gtk.Image() |
508 | searchImage.set_from_stock(gtk.STOCK_GO_FORWARD, gtk.ICON_SIZE_BUTTON) |
509 | searchButton = PrettyButton() |
510 | searchButton.connect("clicked", self.ShowAdvancedFilter) |
511 | searchButton.set_relief(gtk.RELIEF_NONE) |
512 | - searchFrame = gtk.HBox() |
513 | + searchFrame = Gtk.HBox() |
514 | searchFrame.pack_start(searchLabel, False, False, 0) |
515 | searchFrame.pack_end(searchImage, False, False, 0) |
516 | searchButton.add(searchFrame) |
517 | @@ -1256,12 +1259,12 @@ |
518 | prefLabel = Label() |
519 | prefLabel.set_markup(HeaderMarkup % (_("Preferences"))) |
520 | prefLabel.connect("style-set", self.HeaderStyleSet) |
521 | - prefImage = gtk.Image() |
522 | + prefImage = Gtk.Image() |
523 | prefImage.set_from_stock(gtk.STOCK_GO_FORWARD, gtk.ICON_SIZE_BUTTON) |
524 | prefButton = PrettyButton() |
525 | prefButton.connect("clicked", self.ShowPreferences) |
526 | prefButton.set_relief(gtk.RELIEF_NONE) |
527 | - prefFrame = gtk.HBox() |
528 | + prefFrame = Gtk.HBox() |
529 | prefFrame.pack_start(prefLabel, False, False, 0) |
530 | prefFrame.pack_end(prefImage, False, False, 0) |
531 | prefButton.add(prefFrame) |
532 | @@ -1320,19 +1323,19 @@ |
533 | # |
534 | class Page(object): |
535 | def __init__(self): |
536 | - self.SetContainer = gtk.VBox() |
537 | + self.SetContainer = Gtk.VBox() |
538 | |
539 | - self.Widget = gtk.EventBox() |
540 | + self.Widget = Gtk.EventBox() |
541 | self.Widget.add(self.SetContainer) |
542 | |
543 | self.Empty = True |
544 | |
545 | def Wrap(self): |
546 | - scroll = gtk.ScrolledWindow() |
547 | + scroll = Gtk.ScrolledWindow() |
548 | scroll.props.hscrollbar_policy = gtk.POLICY_NEVER |
549 | scroll.props.vscrollbar_policy = gtk.POLICY_AUTOMATIC |
550 | |
551 | - view = gtk.Viewport() |
552 | + view = Gtk.Viewport() |
553 | view.set_border_width(5) |
554 | view.set_shadow_type(gtk.SHADOW_NONE) |
555 | |
556 | @@ -1350,9 +1353,9 @@ |
557 | |
558 | self.Name = name |
559 | self.VisibleAreas = self.subGroupAreas = [] |
560 | - self.Label = gtk.Alignment(xalign=0.0, yalign=0.5) |
561 | + self.Label = Gtk.Alignment(xalign=0.0, yalign=0.5) |
562 | self.Label.set_padding(4, 4, 4, 4) |
563 | - label = gtk.Label("<b>%s</b>" %(protect_pango_markup(name or _('General')))) |
564 | + label = Gtk.Label("<b>%s</b>" %(protect_pango_markup(name or _('General')))) |
565 | label.set_use_markup(True) |
566 | self.Label.add(label) |
567 | if '' in group: |
568 | |
569 | === modified file 'compizconfig/ccsm/ccm/Settings.py' |
570 | --- compizconfig/ccsm/ccm/Settings.py 2018-06-27 09:51:35 +0000 |
571 | +++ compizconfig/ccsm/ccm/Settings.py 2018-07-08 20:42:11 +0000 |
572 | @@ -31,6 +31,8 @@ |
573 | from ccm.Utils import * |
574 | from ccm.Pages import * |
575 | |
576 | +Gtk = gtk |
577 | + |
578 | import locale |
579 | import gettext |
580 | locale.setlocale(locale.LC_ALL, "") |
581 | @@ -52,14 +54,14 @@ |
582 | self.CurrentRow = None |
583 | |
584 | self.Blocked = 0 |
585 | - self.EBox = gtk.EventBox() |
586 | - self.Box = gtk.HBox() |
587 | + self.EBox = Gtk.EventBox() |
588 | + self.Box = Gtk.HBox() |
589 | self.EBox.set_visible_window(False) |
590 | if Setting: |
591 | self.EBox.set_sensitive(not Setting.ReadOnly) |
592 | self.Box.set_spacing(5) |
593 | self.EBox.add(self.Box) |
594 | - self.Reset = gtk.Button() |
595 | + self.Reset = Gtk.Button() |
596 | if not Settings: |
597 | self.MakeLabel() |
598 | markup = "%s\n<small><i>%s</i></small>" % (self.Setting.LongDesc, self.Setting.Name) |
599 | @@ -84,7 +86,7 @@ |
600 | self.RemoveUpdater() |
601 | |
602 | def GetColumn(self, num): |
603 | - return (str, gtk.TreeViewColumn(self.Setting.ShortDesc, gtk.CellRendererText(), text=num)) |
604 | + return (str, Gtk.TreeViewColumn(self.Setting.ShortDesc, Gtk.CellRendererText(), text=num)) |
605 | |
606 | def PureVirtual (self, func): |
607 | message = "Missing %(function)s function for %(name)s setting (%(class)s)" |
608 | @@ -109,7 +111,7 @@ |
609 | if not self.Setting: |
610 | return |
611 | |
612 | - label = gtk.Label() |
613 | + label = Gtk.Label() |
614 | desc = protect_pango_markup (self.Setting.ShortDesc) |
615 | style = "%s" |
616 | if self.Setting.Integrated: |
617 | @@ -212,7 +214,7 @@ |
618 | class StringSetting(StockSetting): |
619 | def _Init(self): |
620 | StockSetting._Init(self) |
621 | - self.Entry = gtk.Entry() |
622 | + self.Entry = Gtk.Entry() |
623 | self.Entry.connect('activate', self.Changed) |
624 | self.Entry.connect('focus-out-event', self.Changed) |
625 | self.Widget = self.Entry |
626 | @@ -271,9 +273,9 @@ |
627 | |
628 | def GetColumn(self, num): |
629 | self.Num = num |
630 | - cell = gtk.CellRendererCombo() |
631 | - column = gtk.TreeViewColumn(self.Setting.ShortDesc, cell, text=num) |
632 | - model = gtk.ListStore(str) |
633 | + cell = Gtk.CellRendererCombo() |
634 | + column = Gtk.TreeViewColumn(self.Setting.ShortDesc, cell, text=num) |
635 | + model = Gtk.ListStore(str) |
636 | for property, value in [("model", model), ("text_column", 0), |
637 | ("editable", False), ("has_entry", False)]: |
638 | cell.set_property (property, value) |
639 | @@ -338,9 +340,9 @@ |
640 | |
641 | def GetColumn(self, num): |
642 | self.Num = num |
643 | - cell = gtk.CellRendererCombo() |
644 | - column = gtk.TreeViewColumn(self.Setting.ShortDesc, cell, text=num) |
645 | - model = gtk.ListStore(str) |
646 | + cell = Gtk.CellRendererCombo() |
647 | + column = Gtk.TreeViewColumn(self.Setting.ShortDesc, cell, text=num) |
648 | + model = Gtk.ListStore(str) |
649 | for property, value in [("model", model), ("text_column", 0), |
650 | ("editable", False), ("has_entry", False)]: |
651 | cell.set_property (property, value) |
652 | @@ -399,8 +401,8 @@ |
653 | def _Init (self): |
654 | StockSetting._Init(self) |
655 | self.Label.set_size_request(-1, -1) |
656 | - self.CheckButton = gtk.CheckButton () |
657 | - align = gtk.Alignment(yalign=0.5) |
658 | + self.CheckButton = Gtk.CheckButton () |
659 | + align = Gtk.Alignment(yalign=0.5) |
660 | align.add(self.CheckButton) |
661 | self.Box.pack_end(align, False, False, 0) |
662 | self.CheckButton.connect ('toggled', self.Changed) |
663 | @@ -419,10 +421,10 @@ |
664 | |
665 | def GetColumn (self, num): |
666 | self.Num = num |
667 | - cell = gtk.CellRendererToggle() |
668 | + cell = Gtk.CellRendererToggle() |
669 | cell.set_property("activatable", True) |
670 | cell.connect('toggled', self.CellToggled) |
671 | - return (bool, gtk.TreeViewColumn(self.Setting.ShortDesc, cell, active=num)) |
672 | + return (bool, Gtk.TreeViewColumn(self.Setting.ShortDesc, cell, active=num)) |
673 | |
674 | class NumberSetting(StockSetting): |
675 | |
676 | @@ -476,7 +478,7 @@ |
677 | |
678 | def _Init(self): |
679 | StockSetting._Init(self) |
680 | - self.Button = gtk.ColorButton() |
681 | + self.Button = Gtk.ColorButton() |
682 | self.Button.set_size_request (100, -1) |
683 | self.Button.set_use_alpha(True) |
684 | self.Button.connect('color-set', self.Changed) |
685 | @@ -489,7 +491,7 @@ |
686 | return ["#%.4x%.4x%.4x%.4x" %tuple(seq) for seq in self.Setting.Value] |
687 | |
688 | def GetColumn(self, num): |
689 | - return (str, gtk.TreeViewColumn(self.Setting.ShortDesc, CellRendererColor(), text=num)) |
690 | + return (str, Gtk.TreeViewColumn(self.Setting.ShortDesc, CellRendererColor(), text=num)) |
691 | |
692 | def _Read(self): |
693 | col = gtk.gdk.Color() |
694 | @@ -505,7 +507,7 @@ |
695 | |
696 | class BaseListSetting(Setting): |
697 | def _Init(self): |
698 | - self.Widget = gtk.VBox() |
699 | + self.Widget = Gtk.VBox() |
700 | self.EditDialog = None |
701 | self.EditDialogOpen = False |
702 | self.PageToBeRefreshed = None |
703 | @@ -516,8 +518,8 @@ |
704 | |
705 | types, cols = self.ListInfo() |
706 | self.Types = types |
707 | - self.Store = gtk.ListStore(*types) |
708 | - self.View = gtk.TreeView(self.Store) |
709 | + self.Store = Gtk.ListStore(*types) |
710 | + self.View = Gtk.TreeView(self.Store) |
711 | self.View.set_headers_visible(True) |
712 | |
713 | for widget in self.Widgets: |
714 | @@ -534,13 +536,13 @@ |
715 | self.Select.set_mode(gtk.SELECTION_SINGLE) |
716 | self.Select.connect('changed', self.SelectionChanged) |
717 | self.Widget.set_spacing(5) |
718 | - self.Scroll = gtk.ScrolledWindow() |
719 | + self.Scroll = Gtk.ScrolledWindow() |
720 | self.Scroll.props.hscrollbar_policy = gtk.POLICY_AUTOMATIC |
721 | self.Scroll.props.vscrollbar_policy = gtk.POLICY_NEVER |
722 | self.Scroll.add(self.View) |
723 | self.Widget.pack_start(self.Scroll, True, True, 0) |
724 | self.Widget.set_child_packing(self.Scroll, True, True, 0, gtk.PACK_START) |
725 | - buttonBox = gtk.HBox(False) |
726 | + buttonBox = Gtk.HBox(False) |
727 | buttonBox.set_spacing(5) |
728 | buttonBox.set_border_width(5) |
729 | self.Widget.pack_start(buttonBox, False, False, 0) |
730 | @@ -551,7 +553,7 @@ |
731 | (gtk.STOCK_GO_DOWN, self.Move, 'down', False),) |
732 | self.Buttons = {} |
733 | for stock, callback, data, sensitive in buttonTypes: |
734 | - b = gtk.Button(stock) |
735 | + b = Gtk.Button(stock) |
736 | b.set_use_stock(True) |
737 | buttonBox.pack_start(b, False, False, 0) |
738 | if data is not None: |
739 | @@ -627,8 +629,8 @@ |
740 | self._Delete(row) |
741 | |
742 | def _MakeEditDialog(self): |
743 | - dlg = gtk.Dialog(_("Edit")) |
744 | - vbox = gtk.VBox(spacing=TableX) |
745 | + dlg = Gtk.Dialog(_("Edit")) |
746 | + vbox = Gtk.VBox(spacing=TableX) |
747 | vbox.props.border_width = 6 |
748 | dlg.vbox.pack_start(vbox, True, True, 0) |
749 | dlg.set_default_size(500, -1) |
750 | @@ -784,14 +786,14 @@ |
751 | |
752 | def _Init(self): |
753 | frame = gtk.Frame(self.Setting.ShortDesc) |
754 | - table = gtk.Table() |
755 | + table = Gtk.Table() |
756 | |
757 | row = col = 0 |
758 | self.Checks = [] |
759 | sortedItems = sorted(self.Setting.Info[1][2].items(), key=EnumSettingKeyFunc) |
760 | self.minVal = sortedItems[0][1] |
761 | for key, value in sortedItems: |
762 | - box = gtk.CheckButton(key) |
763 | + box = Gtk.CheckButton(key) |
764 | self.Checks.append((key, box)) |
765 | table.attach(box, col, col+1, row, row+1, TableDef, TableDef, TableX, TableX) |
766 | box.connect('toggled', self.Changed) |
767 | @@ -800,10 +802,10 @@ |
768 | col = 0 |
769 | row += 1 |
770 | |
771 | - vbox = gtk.VBox() |
772 | + vbox = Gtk.VBox() |
773 | vbox.pack_start(self.Reset, False, False, 0) |
774 | |
775 | - hbox = gtk.HBox() |
776 | + hbox = Gtk.HBox() |
777 | hbox.pack_start(table, True, True, 0) |
778 | hbox.pack_start(vbox, False, False, 0) |
779 | |
780 | @@ -833,7 +835,7 @@ |
781 | |
782 | def _Init(self): |
783 | frame = gtk.Frame(self.Setting.ShortDesc) |
784 | - table = gtk.Table() |
785 | + table = Gtk.Table() |
786 | |
787 | row = col = 0 |
788 | self.Checks = [] |
789 | @@ -842,7 +844,7 @@ |
790 | self.ItemsByValue = info[1] |
791 | sortedItems = info[2] |
792 | for key, value in sortedItems: |
793 | - box = gtk.CheckButton(key) |
794 | + box = Gtk.CheckButton(key) |
795 | self.Checks.append((key, box)) |
796 | table.attach(box, col, col+1, row, row+1, TableDef, TableDef, TableX, TableX) |
797 | box.connect('toggled', self.Changed) |
798 | @@ -851,10 +853,10 @@ |
799 | col = 0 |
800 | row += 1 |
801 | |
802 | - vbox = gtk.VBox() |
803 | + vbox = Gtk.VBox() |
804 | vbox.pack_start(self.Reset, False, False, 0) |
805 | |
806 | - hbox = gtk.HBox() |
807 | + hbox = Gtk.HBox() |
808 | hbox.pack_start(table, True, True, 0) |
809 | hbox.pack_start(vbox, False, False, 0) |
810 | |
811 | @@ -890,7 +892,7 @@ |
812 | |
813 | self.Label.set_size_request(-1, -1) |
814 | |
815 | - editButton = gtk.Button () |
816 | + editButton = Gtk.Button () |
817 | editButton.add (Image (name = gtk.STOCK_EDIT, type = ImageStock, |
818 | size = gtk.ICON_SIZE_BUTTON)) |
819 | editButton.set_tooltip_text(_("Edit %s" % self.Setting.ShortDesc)) |
820 | @@ -905,7 +907,7 @@ |
821 | |
822 | |
823 | def RunEditDialog (self, widget): |
824 | - dlg = gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
825 | + dlg = Gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
826 | dlg.set_position (gtk.WIN_POS_CENTER_ON_PARENT) |
827 | dlg.set_transient_for (self.Widget.get_toplevel ()) |
828 | dlg.add_button (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) |
829 | @@ -1021,7 +1023,7 @@ |
830 | new = current.replace ("%s_R" % modifier, "") |
831 | label.set_text (self.GetLabelText (new)) |
832 | |
833 | - dlg = gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
834 | + dlg = Gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
835 | dlg.set_position (gtk.WIN_POS_CENTER_ALWAYS) |
836 | dlg.set_transient_for (self.Widget.get_toplevel ()) |
837 | dlg.set_icon (self.Widget.get_toplevel ().get_icon ()) |
838 | @@ -1030,20 +1032,20 @@ |
839 | dlg.add_button (gtk.STOCK_OK, gtk.RESPONSE_OK).grab_default () |
840 | dlg.set_default_response (gtk.RESPONSE_OK) |
841 | |
842 | - mainBox = gtk.VBox () |
843 | - alignment = gtk.Alignment () |
844 | + mainBox = Gtk.VBox () |
845 | + alignment = Gtk.Alignment () |
846 | alignment.set_padding (10, 10, 10, 10) |
847 | alignment.add (mainBox) |
848 | dlg.vbox.pack_start (alignment, True, True, 0) |
849 | |
850 | - checkButton = gtk.CheckButton (_("Enabled")) |
851 | + checkButton = Gtk.CheckButton (_("Enabled")) |
852 | active = len (self.current) \ |
853 | and self.current.lower () not in ("disabled", "none") |
854 | checkButton.set_active (active) |
855 | checkButton.set_tooltip_text(self.Setting.LongDesc) |
856 | mainBox.pack_start (checkButton, True, True, 0) |
857 | |
858 | - box = gtk.VBox () |
859 | + box = Gtk.VBox () |
860 | checkButton.connect ("toggled", ShowHideBox, box, dlg) |
861 | mainBox.pack_start (box, True, True, 0) |
862 | |
863 | @@ -1064,7 +1066,7 @@ |
864 | grabber.set_tooltip_text (self.Setting.LongDesc) |
865 | box.pack_start (grabber, True, True, 0) |
866 | |
867 | - label = gtk.Label (self.current) |
868 | + label = Gtk.Label (self.current) |
869 | label.set_tooltip_text (self.Setting.LongDesc) |
870 | alignment = gtk.Alignment (0.5, 0.5) |
871 | alignment.set_padding (15, 0, 0, 0) |
872 | @@ -1174,7 +1176,7 @@ |
873 | else: |
874 | box.hide () |
875 | dialog.resize (1, 1) |
876 | - dlg = gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
877 | + dlg = Gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
878 | dlg.set_position (gtk.WIN_POS_CENTER_ALWAYS) |
879 | dlg.set_transient_for (self.Widget.get_toplevel ()) |
880 | dlg.set_modal (True) |
881 | @@ -1182,20 +1184,20 @@ |
882 | dlg.add_button (gtk.STOCK_OK, gtk.RESPONSE_OK).grab_default () |
883 | dlg.set_default_response (gtk.RESPONSE_OK) |
884 | |
885 | - mainBox = gtk.VBox () |
886 | - alignment = gtk.Alignment () |
887 | + mainBox = Gtk.VBox () |
888 | + alignment = Gtk.Alignment () |
889 | alignment.set_padding (10, 10, 10, 10) |
890 | alignment.add (mainBox) |
891 | dlg.vbox.pack_start (alignment, True, True, 0) |
892 | |
893 | - checkButton = gtk.CheckButton (_("Enabled")) |
894 | + checkButton = Gtk.CheckButton (_("Enabled")) |
895 | active = len (self.current) \ |
896 | and self.current.lower () not in ("disabled", "none") |
897 | checkButton.set_active (active) |
898 | checkButton.set_tooltip_text (self.Setting.LongDesc) |
899 | mainBox.pack_start (checkButton, True, True, 0) |
900 | |
901 | - box = gtk.VBox () |
902 | + box = Gtk.VBox () |
903 | checkButton.connect ("toggled", ShowHideBox, box, dlg) |
904 | mainBox.pack_start (box, True, True, 0) |
905 | |
906 | @@ -1337,7 +1339,7 @@ |
907 | self.Button.set_label (label) |
908 | |
909 | def RunEdgeSelector (self, widget): |
910 | - dlg = gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
911 | + dlg = Gtk.Dialog (_("Edit %s") % self.Setting.ShortDesc) |
912 | dlg.set_position (gtk.WIN_POS_CENTER_ON_PARENT) |
913 | dlg.set_transient_for (self.Widget.get_toplevel ()) |
914 | dlg.set_modal (True) |
915 | @@ -1346,7 +1348,7 @@ |
916 | dlg.set_default_response (gtk.RESPONSE_OK) |
917 | |
918 | selector = SingleEdgeSelector (self.current) |
919 | - alignment = gtk.Alignment () |
920 | + alignment = Gtk.Alignment () |
921 | alignment.set_padding (10, 10, 10, 10) |
922 | alignment.add (selector) |
923 | |
924 | @@ -1463,13 +1465,13 @@ |
925 | self.Name = name |
926 | settings = sorted(GetSettings(subGroup), key=SettingKeyFunc) |
927 | if not name: |
928 | - self.Child = self.Widget = gtk.VBox() |
929 | + self.Child = self.Widget = Gtk.VBox() |
930 | else: |
931 | - self.Widget = gtk.Frame() |
932 | + self.Widget = Gtk.Frame() |
933 | self.Expander = gtk.Expander(name) |
934 | self.Widget.add(self.Expander) |
935 | self.Expander.set_expanded(False) |
936 | - self.Child = gtk.VBox() |
937 | + self.Child = Gtk.VBox() |
938 | self.Expander.add(self.Child) |
939 | |
940 | self.Child.set_spacing(TableX) |
941 | |
942 | === modified file 'compizconfig/ccsm/ccm/Utils.py' |
943 | --- compizconfig/ccsm/ccm/Utils.py 2018-06-27 17:23:29 +0000 |
944 | +++ compizconfig/ccsm/ccm/Utils.py 2018-07-08 20:42:11 +0000 |
945 | @@ -34,6 +34,9 @@ |
946 | import operator |
947 | import itertools |
948 | |
949 | +Gtk = gtk |
950 | +GObject = gobject |
951 | + |
952 | import locale |
953 | import gettext |
954 | locale.setlocale(locale.LC_ALL, "") |
955 | @@ -46,8 +49,8 @@ |
956 | IconTheme.prepend_search_path(IconDir) |
957 | |
958 | def gtk_process_events (): |
959 | - while gtk.events_pending (): |
960 | - gtk.main_iteration () |
961 | + while Gtk.events_pending (): |
962 | + Gtk.main_iteration () |
963 | |
964 | def getScreens(): |
965 | screens = [] |
966 | @@ -64,11 +67,11 @@ |
967 | def protect_markup_dict (dict_): |
968 | return dict((k, protect_pango_markup (v)) for (k, v) in dict_.items()) |
969 | |
970 | -class Image (gtk.Image): |
971 | +class Image (Gtk.Image): |
972 | |
973 | def __init__ (self, name = None, type = ImageNone, size = 32, |
974 | useMissingImage = False): |
975 | - gtk.Image.__init__ (self) |
976 | + Gtk.Image.__init__ (self) |
977 | |
978 | if not name: |
979 | return |
980 | @@ -86,14 +89,14 @@ |
981 | name = "plugin-" + name |
982 | try: |
983 | pixbuf = IconTheme.load_icon (name, size, 0) |
984 | - except gobject.GError: |
985 | + except GObject.GError: |
986 | pixbuf = IconTheme.load_icon ("plugin-unknown", size, 0) |
987 | |
988 | elif type == ImageCategory: |
989 | name = "plugins-" + name |
990 | try: |
991 | pixbuf = IconTheme.load_icon (name, size, 0) |
992 | - except gobject.GError: |
993 | + except GObject.GError: |
994 | pixbuf = IconTheme.load_icon ("plugins-unknown", size, 0) |
995 | |
996 | else: |
997 | @@ -103,10 +106,10 @@ |
998 | |
999 | elif type == ImageStock: |
1000 | self.set_from_stock (name, size) |
1001 | - except gobject.GError as e: |
1002 | + except GObject.GError as e: |
1003 | self.set_from_stock (gtk.STOCK_MISSING_IMAGE, gtk.ICON_SIZE_BUTTON) |
1004 | |
1005 | -class ActionImage (gtk.Alignment): |
1006 | +class ActionImage (Gtk.Alignment): |
1007 | |
1008 | map = { |
1009 | "keyboard" : "input-keyboard", |
1010 | @@ -121,7 +124,7 @@ |
1011 | if action in self.map: action = self.map[action] |
1012 | self.add (Image (name = action, type = ImageThemed, size = 22)) |
1013 | |
1014 | -class SizedButton (gtk.Button): |
1015 | +class SizedButton (Gtk.Button): |
1016 | |
1017 | minWidth = -1 |
1018 | minHeight = -1 |
1019 | @@ -138,7 +141,7 @@ |
1020 | newHeight = max (height, self.minHeight) |
1021 | self.set_size_request (newWidth, newHeight) |
1022 | |
1023 | -class PrettyButton (gtk.Button): |
1024 | +class PrettyButton (Gtk.Button): |
1025 | |
1026 | __gsignals__ = { |
1027 | 'expose-event' : 'override', |
1028 | @@ -194,20 +197,20 @@ |
1029 | |
1030 | return ret |
1031 | |
1032 | -class Label(gtk.Label): |
1033 | +class Label(Gtk.Label): |
1034 | def __init__(self, value = "", wrap = 160): |
1035 | - gtk.Label.__init__(self, value) |
1036 | + Gtk.Label.__init__(self, value) |
1037 | self.props.xalign = 0 |
1038 | self.props.wrap_mode = pango.WRAP_WORD |
1039 | self.set_line_wrap(True) |
1040 | self.set_size_request(wrap, -1) |
1041 | |
1042 | -class NotFoundBox(gtk.Alignment): |
1043 | +class NotFoundBox(Gtk.Alignment): |
1044 | def __init__(self, value=""): |
1045 | gtk.Alignment.__init__(self, 0.5, 0.5, 0.0, 0.0) |
1046 | |
1047 | - box = gtk.HBox() |
1048 | - self.Warning = gtk.Label() |
1049 | + box = Gtk.HBox() |
1050 | + self.Warning = Gtk.Label() |
1051 | self.Markup = _("<span size=\"large\"><b>No matches found.</b> </span><span>\n\n Your filter \"<b>%s</b>\" does not match any items.</span>") |
1052 | value = protect_pango_markup(value) |
1053 | self.Warning.set_markup(self.Markup % value) |
1054 | @@ -232,16 +235,16 @@ |
1055 | nCategories = len (main.MainPage.RightWidget._boxes) |
1056 | self.CategoryLoadIconsList = list(range(3, nCategories)) # Skip the first 3 |
1057 | |
1058 | - gobject.timeout_add (150, self.Wait) |
1059 | + GObject.timeout_add (150, self.Wait) |
1060 | |
1061 | def Wait(self): |
1062 | if not self.PluginList: |
1063 | return False |
1064 | |
1065 | if len (self.CategoryLoadIconsList) == 0: # If we're done loading icons |
1066 | - gobject.idle_add (self.ParseSettings) |
1067 | + GObject.idle_add (self.ParseSettings) |
1068 | else: |
1069 | - gobject.idle_add (self.LoadCategoryIcons) |
1070 | + GObject.idle_add (self.LoadCategoryIcons) |
1071 | |
1072 | return False |
1073 | |
1074 | @@ -254,7 +257,7 @@ |
1075 | |
1076 | self.PluginList.remove (self.PluginList[0]) |
1077 | |
1078 | - gobject.timeout_add (200, self.Wait) |
1079 | + GObject.timeout_add (200, self.Wait) |
1080 | |
1081 | return False |
1082 | |
1083 | @@ -272,7 +275,7 @@ |
1084 | |
1085 | self.CategoryLoadIconsList.remove (self.CategoryLoadIconsList[0]) |
1086 | |
1087 | - gobject.timeout_add (150, self.Wait) |
1088 | + GObject.timeout_add (150, self.Wait) |
1089 | |
1090 | return False |
1091 | |
1092 | @@ -287,7 +290,7 @@ |
1093 | def SetContext (self, context): |
1094 | self.Context = context |
1095 | |
1096 | - gobject.timeout_add (2000, self.Update) |
1097 | + GObject.timeout_add (2000, self.Update) |
1098 | |
1099 | def Append (self, widget): |
1100 | reference = weakref.ref(widget) |
1101 | @@ -401,7 +404,7 @@ |
1102 | |
1103 | def GetAcceleratorName(key, mods): |
1104 | # <Primary> is <Control> everywhere except for Mac OS |
1105 | - return gtk.accelerator_name(key, mods).replace('<Primary>', '<Control>') |
1106 | + return Gtk.accelerator_name(key, mods).replace('<Primary>', '<Control>') |
1107 | |
1108 | # Support python 2.4 |
1109 | try: |
1110 | |
1111 | === modified file 'compizconfig/ccsm/ccm/Widgets.py' |
1112 | --- compizconfig/ccsm/ccm/Widgets.py 2018-06-27 09:51:35 +0000 |
1113 | +++ compizconfig/ccsm/ccm/Widgets.py 2018-07-08 20:42:11 +0000 |
1114 | @@ -35,6 +35,9 @@ |
1115 | from ccm.Constants import * |
1116 | from ccm.Conflicts import * |
1117 | |
1118 | +Gtk = gtk |
1119 | +GObject = gobject |
1120 | + |
1121 | import locale |
1122 | import gettext |
1123 | locale.setlocale(locale.LC_ALL, "") |
1124 | @@ -46,9 +49,9 @@ |
1125 | # Try to use gtk like coding style for consistency |
1126 | # |
1127 | |
1128 | -class ClearEntry(gtk.Entry): |
1129 | +class ClearEntry(Gtk.Entry): |
1130 | def __init__(self): |
1131 | - gtk.Entry.__init__(self) |
1132 | + Gtk.Entry.__init__(self) |
1133 | self.set_icon_from_stock(gtk.ENTRY_ICON_SECONDARY, gtk.STOCK_CLEAR) |
1134 | self.set_icon_tooltip_text(gtk.ENTRY_ICON_SECONDARY, _("Clear")) |
1135 | self.connect('icon-press', self._clear_pressed) |
1136 | @@ -61,11 +64,11 @@ |
1137 | |
1138 | class CellRendererColor(gtk.GenericCellRenderer): |
1139 | __gproperties__ = { |
1140 | - 'text': (gobject.TYPE_STRING, |
1141 | + 'text': (GObject.TYPE_STRING, |
1142 | 'color markup text', |
1143 | 'The color as markup like this: #rrrrggggbbbbaaaa', |
1144 | '#0000000000000000', |
1145 | - gobject.PARAM_READWRITE) |
1146 | + GObject.PARAM_READWRITE) |
1147 | } |
1148 | |
1149 | _text = '#0000000000000000' |
1150 | @@ -141,11 +144,11 @@ |
1151 | cr.set_source_rgba(r, g, b, a) |
1152 | cr.paint() |
1153 | |
1154 | -class PluginView(gtk.TreeView): |
1155 | +class PluginView(Gtk.TreeView): |
1156 | def __init__(self, plugins): |
1157 | liststore = gtk.ListStore(str, gtk.gdk.Pixbuf, bool, object) |
1158 | self.model = liststore.filter_new() |
1159 | - gtk.TreeView.__init__(self, self.model) |
1160 | + Gtk.TreeView.__init__(self, self.model) |
1161 | |
1162 | self.SelectionHandler = None |
1163 | |
1164 | @@ -155,8 +158,8 @@ |
1165 | liststore.append([plugin.ShortDesc, Image(plugin.Name, type=ImagePlugin).props.pixbuf, |
1166 | plugin.Enabled, plugin]) |
1167 | |
1168 | - column = self.insert_column_with_attributes(0, _('Plugin'), gtk.CellRendererPixbuf(), pixbuf=1, sensitive=2) |
1169 | - cell = gtk.CellRendererText() |
1170 | + column = self.insert_column_with_attributes(0, _('Plugin'), Gtk.CellRendererPixbuf(), pixbuf=1, sensitive=2) |
1171 | + cell = Gtk.CellRendererText() |
1172 | cell.props.wrap_width = 200 |
1173 | column.pack_start(cell, True, True, 0) |
1174 | column.set_attributes(cell, text=0) |
1175 | @@ -177,19 +180,19 @@ |
1176 | |
1177 | return self.SelectionHandler(model[iter][3]) |
1178 | |
1179 | -class GroupView(gtk.TreeView): |
1180 | +class GroupView(Gtk.TreeView): |
1181 | def __init__(self, name): |
1182 | - self.model = gtk.ListStore(str, str) |
1183 | - gtk.TreeView.__init__(self, self.model) |
1184 | + self.model = Gtk.ListStore(str, str) |
1185 | + Gtk.TreeView.__init__(self, self.model) |
1186 | |
1187 | self.SelectionHandler = None |
1188 | |
1189 | self.Visible = set() |
1190 | |
1191 | - cell = gtk.CellRendererText() |
1192 | + cell = Gtk.CellRendererText() |
1193 | cell.props.ypad = 5 |
1194 | cell.props.wrap_width = 200 |
1195 | - column = gtk.TreeViewColumn(name, cell, text=0) |
1196 | + column = Gtk.TreeViewColumn(name, cell, text=0) |
1197 | self.append_column(column) |
1198 | |
1199 | self.get_selection().connect('changed', self.SelectionChanged) |
1200 | @@ -223,9 +226,9 @@ |
1201 | |
1202 | # Selector Buttons |
1203 | # |
1204 | -class SelectorButtons(gtk.HBox): |
1205 | +class SelectorButtons(Gtk.HBox): |
1206 | def __init__(self): |
1207 | - gtk.HBox.__init__(self) |
1208 | + Gtk.HBox.__init__(self) |
1209 | self.set_border_width(10) |
1210 | self.set_spacing(5) |
1211 | self.buttons = [] |
1212 | @@ -240,7 +243,7 @@ |
1213 | |
1214 | def add_button(self, label, callback): |
1215 | arrow = gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_NONE) |
1216 | - button = gtk.Button(label) |
1217 | + button = Gtk.Button(label) |
1218 | button.set_relief(gtk.RELIEF_NONE) |
1219 | button.connect('clicked', self.on_button_clicked, callback) |
1220 | if self.get_children(): |
1221 | @@ -264,14 +267,14 @@ |
1222 | |
1223 | # Selector Box |
1224 | # |
1225 | -class SelectorBox(gtk.ScrolledWindow): |
1226 | +class SelectorBox(Gtk.ScrolledWindow): |
1227 | def __init__(self, backgroundColor): |
1228 | - gtk.ScrolledWindow.__init__(self) |
1229 | - self.viewport = gtk.Viewport() |
1230 | + Gtk.ScrolledWindow.__init__(self) |
1231 | + self.viewport = Gtk.Viewport() |
1232 | self.viewport.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse(backgroundColor)) |
1233 | self.props.hscrollbar_policy = gtk.POLICY_NEVER |
1234 | self.props.vscrollbar_policy = gtk.POLICY_AUTOMATIC |
1235 | - self.box = gtk.VBox() |
1236 | + self.box = Gtk.VBox() |
1237 | self.box.set_spacing(5) |
1238 | self.viewport.add(self.box) |
1239 | self.add(self.viewport) |
1240 | @@ -284,18 +287,18 @@ |
1241 | self.box.destroy() |
1242 | |
1243 | def add_item(self, item, callback, markup="%s", image=None, info=None): |
1244 | - button = gtk.Button() |
1245 | + button = Gtk.Button() |
1246 | label = Label(wrap=170) |
1247 | text = protect_pango_markup(item) |
1248 | label.set_markup(markup % text or _("General")) |
1249 | - labelBox = gtk.VBox() |
1250 | + labelBox = Gtk.VBox() |
1251 | labelBox.set_spacing(5) |
1252 | labelBox.pack_start(label, True, True, 0) |
1253 | if info: |
1254 | infoLabel = Label() |
1255 | infoLabel.set_markup("<span size='small'>%s</span>" % info) |
1256 | labelBox.pack_start(infoLabel, True, True, 0) |
1257 | - box = gtk.HBox() |
1258 | + box = Gtk.HBox() |
1259 | box.set_spacing(5) |
1260 | if image: |
1261 | box.pack_start(image, False, False, 0) |
1262 | @@ -318,18 +321,18 @@ |
1263 | |
1264 | # Scrolled List |
1265 | # |
1266 | -class ScrolledList(gtk.ScrolledWindow): |
1267 | +class ScrolledList(Gtk.ScrolledWindow): |
1268 | def __init__(self, name): |
1269 | - gtk.ScrolledWindow.__init__(self) |
1270 | + Gtk.ScrolledWindow.__init__(self) |
1271 | |
1272 | self.props.hscrollbar_policy = gtk.POLICY_NEVER |
1273 | self.props.vscrollbar_policy = gtk.POLICY_AUTOMATIC |
1274 | |
1275 | - self.store = gtk.ListStore(gobject.TYPE_STRING) |
1276 | + self.store = Gtk.ListStore(GObject.TYPE_STRING) |
1277 | |
1278 | - self.view = gtk.TreeView(self.store) |
1279 | + self.view = Gtk.TreeView(self.store) |
1280 | self.view.set_headers_visible(True) |
1281 | - self.view.insert_column_with_attributes(-1, name, gtk.CellRendererText(), text=0) |
1282 | + self.view.insert_column_with_attributes(-1, name, Gtk.CellRendererText(), text=0) |
1283 | |
1284 | self.set_size_request(300, 300) |
1285 | |
1286 | @@ -385,12 +388,12 @@ |
1287 | |
1288 | # Button modifier selection widget |
1289 | # |
1290 | -class ModifierSelector (gtk.DrawingArea): |
1291 | +class ModifierSelector (Gtk.DrawingArea): |
1292 | |
1293 | - __gsignals__ = {"added" : (gobject.SIGNAL_RUN_FIRST, |
1294 | - gobject.TYPE_NONE, [gobject.TYPE_STRING]), |
1295 | - "removed" : (gobject.SIGNAL_RUN_FIRST, |
1296 | - gobject.TYPE_NONE, [gobject.TYPE_STRING])} |
1297 | + __gsignals__ = {"added" : (GObject.SIGNAL_RUN_FIRST, |
1298 | + GObject.TYPE_NONE, [GObject.TYPE_STRING]), |
1299 | + "removed" : (GObject.SIGNAL_RUN_FIRST, |
1300 | + GObject.TYPE_NONE, [GObject.TYPE_STRING])} |
1301 | |
1302 | _current = [] |
1303 | |
1304 | @@ -515,10 +518,10 @@ |
1305 | |
1306 | # Edge selection widget |
1307 | # |
1308 | -class EdgeSelector (gtk.DrawingArea): |
1309 | +class EdgeSelector (Gtk.DrawingArea): |
1310 | |
1311 | - __gsignals__ = {"clicked" : (gobject.SIGNAL_RUN_FIRST, |
1312 | - gobject.TYPE_NONE, (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT,))} |
1313 | + __gsignals__ = {"clicked" : (GObject.SIGNAL_RUN_FIRST, |
1314 | + GObject.TYPE_NONE, (GObject.TYPE_STRING, GObject.TYPE_PYOBJECT,))} |
1315 | |
1316 | _base_surface = None |
1317 | _surface = None |
1318 | @@ -923,7 +926,7 @@ |
1319 | |
1320 | # Popup |
1321 | # |
1322 | -class Popup (gtk.Window): |
1323 | +class Popup (Gtk.Window): |
1324 | |
1325 | def __init__ (self, parent=None, text=None, child=None, decorated=True, mouse=False, modal=True): |
1326 | gtk.Window.__init__ (self, gtk.WINDOW_TOPLEVEL) |
1327 | @@ -935,8 +938,8 @@ |
1328 | self.set_decorated (decorated) |
1329 | self.set_property("skip-taskbar-hint", True) |
1330 | if text: |
1331 | - label = gtk.Label (text) |
1332 | - align = gtk.Alignment () |
1333 | + label = Gtk.Label (text) |
1334 | + align = Gtk.Alignment () |
1335 | align.set_padding (20, 20, 20, 20) |
1336 | align.add (label) |
1337 | self.add (align) |
1338 | @@ -945,19 +948,19 @@ |
1339 | gtk_process_events () |
1340 | |
1341 | def destroy (self): |
1342 | - gtk.Window.destroy (self) |
1343 | + Gtk.Window.destroy (self) |
1344 | gtk_process_events () |
1345 | |
1346 | # Key Grabber |
1347 | # |
1348 | -class KeyGrabber (gtk.Button): |
1349 | +class KeyGrabber (Gtk.Button): |
1350 | |
1351 | - __gsignals__ = {"changed" : (gobject.SIGNAL_RUN_FIRST, |
1352 | - gobject.TYPE_NONE, |
1353 | - [gobject.TYPE_INT, gobject.TYPE_INT]), |
1354 | - "current-changed" : (gobject.SIGNAL_RUN_FIRST, |
1355 | - gobject.TYPE_NONE, |
1356 | - [gobject.TYPE_INT, gobject.TYPE_INT])} |
1357 | + __gsignals__ = {"changed" : (GObject.SIGNAL_RUN_FIRST, |
1358 | + GObject.TYPE_NONE, |
1359 | + [GObject.TYPE_INT, GObject.TYPE_INT]), |
1360 | + "current-changed" : (GObject.SIGNAL_RUN_FIRST, |
1361 | + GObject.TYPE_NONE, |
1362 | + [GObject.TYPE_INT, GObject.TYPE_INT])} |
1363 | |
1364 | key = 0 |
1365 | mods = 0 |
1366 | @@ -993,7 +996,7 @@ |
1367 | self.popup.destroy () |
1368 | |
1369 | def on_key_press_event (self, widget, event): |
1370 | - mods = event.state & gtk.accelerator_get_default_mod_mask () |
1371 | + mods = event.state & Gtk.accelerator_get_default_mod_mask () |
1372 | |
1373 | if event.keyval in (gtk.keysyms.Escape, gtk.keysyms.Return) \ |
1374 | and not mods: |
1375 | @@ -1007,7 +1010,7 @@ |
1376 | if (key == gtk.keysyms.ISO_Left_Tab): |
1377 | key = gtk.keysyms.Tab |
1378 | |
1379 | - if gtk.accelerator_valid (key, mods) \ |
1380 | + if Gtk.accelerator_valid (key, mods) \ |
1381 | or (key == gtk.keysyms.Tab and mods): |
1382 | self.set_label (key, mods) |
1383 | self.end_key_grab () |
1384 | @@ -1022,7 +1025,7 @@ |
1385 | if self.label: |
1386 | if key != None and mods != None: |
1387 | self.emit ("current-changed", key, mods) |
1388 | - gtk.Button.set_label (self, self.label) |
1389 | + Gtk.Button.set_label (self, self.label) |
1390 | return |
1391 | if key == None and mods == None: |
1392 | key = self.key |
1393 | @@ -1030,15 +1033,15 @@ |
1394 | label = GetAcceleratorName (key, mods) |
1395 | if not len (label): |
1396 | label = _("Disabled") |
1397 | - gtk.Button.set_label (self, label) |
1398 | + Gtk.Button.set_label (self, label) |
1399 | |
1400 | # Match Button |
1401 | # |
1402 | -class MatchButton(gtk.Button): |
1403 | +class MatchButton(Gtk.Button): |
1404 | |
1405 | - __gsignals__ = {"changed" : (gobject.SIGNAL_RUN_FIRST, |
1406 | - gobject.TYPE_NONE, |
1407 | - [gobject.TYPE_STRING])} |
1408 | + __gsignals__ = {"changed" : (GObject.SIGNAL_RUN_FIRST, |
1409 | + GObject.TYPE_NONE, |
1410 | + [GObject.TYPE_STRING])} |
1411 | |
1412 | prefix = {\ |
1413 | _("Window Title"): 'title', |
1414 | @@ -1147,7 +1150,7 @@ |
1415 | |
1416 | self.match = self.entry.get_text () |
1417 | |
1418 | - dlg = gtk.Dialog (_("Edit match")) |
1419 | + dlg = Gtk.Dialog (_("Edit match")) |
1420 | dlg.set_position (gtk.WIN_POS_CENTER_ON_PARENT) |
1421 | dlg.set_transient_for (self.get_parent ().get_toplevel ()) |
1422 | dlg.add_button (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) |
1423 | @@ -1155,7 +1158,7 @@ |
1424 | dlg.set_response_sensitive(gtk.RESPONSE_OK, False) |
1425 | dlg.set_default_response (gtk.RESPONSE_OK) |
1426 | |
1427 | - table = gtk.Table () |
1428 | + table = Gtk.Table () |
1429 | |
1430 | rows = [] |
1431 | |
1432 | @@ -1169,11 +1172,11 @@ |
1433 | |
1434 | # Value |
1435 | label = Label (_("Value")) |
1436 | - box = gtk.HBox () |
1437 | + box = Gtk.HBox () |
1438 | box.set_spacing (5) |
1439 | - entry = gtk.Entry () |
1440 | + entry = Gtk.Entry () |
1441 | entry.connect ('changed', self._check_entry_value, dlg) |
1442 | - button = gtk.Button (_("Grab")) |
1443 | + button = Gtk.Button (_("Grab")) |
1444 | button.connect ('clicked', self.grab_value, entry, type_chooser) |
1445 | box.pack_start (entry, True, True, 0) |
1446 | box.pack_start (button, False, False, 0) |
1447 | @@ -1189,7 +1192,7 @@ |
1448 | |
1449 | # Invert |
1450 | label = Label (_("Invert")) |
1451 | - check = gtk.CheckButton () |
1452 | + check = Gtk.CheckButton () |
1453 | rows.append ((label, check)) |
1454 | |
1455 | row = 0 |
1456 | @@ -1213,17 +1216,17 @@ |
1457 | |
1458 | dlg.destroy () |
1459 | |
1460 | -class FileButton (gtk.Button): |
1461 | - __gsignals__ = {"changed" : (gobject.SIGNAL_RUN_FIRST, |
1462 | - gobject.TYPE_NONE, |
1463 | - [gobject.TYPE_STRING])} |
1464 | +class FileButton (Gtk.Button): |
1465 | + __gsignals__ = {"changed" : (GObject.SIGNAL_RUN_FIRST, |
1466 | + GObject.TYPE_NONE, |
1467 | + [GObject.TYPE_STRING])} |
1468 | _directory = False |
1469 | _context = None |
1470 | _image = False |
1471 | _path = "" |
1472 | |
1473 | def __init__ (self, context, entry, directory=False, image=False, path=""): |
1474 | - gtk.Button.__init__ (self) |
1475 | + Gtk.Button.__init__ (self) |
1476 | |
1477 | self._entry = entry |
1478 | self._directory = directory |
1479 | @@ -1242,7 +1245,7 @@ |
1480 | self._entry.activate () |
1481 | |
1482 | def create_filter(self): |
1483 | - filter = gtk.FileFilter () |
1484 | + filter = Gtk.FileFilter () |
1485 | if self._image: |
1486 | filter.set_name (_("Images")) |
1487 | filter.add_pattern ("*.png") |
1488 | @@ -1289,7 +1292,7 @@ |
1489 | else: |
1490 | title = _("Open file...") |
1491 | |
1492 | - chooser = gtk.FileChooserDialog (title = title, buttons = b) |
1493 | + chooser = Gtk.FileChooserDialog (title = title, buttons = b) |
1494 | if self._directory: |
1495 | chooser.set_action (gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) |
1496 | else: |
1497 | @@ -1302,7 +1305,7 @@ |
1498 | |
1499 | if self._image: |
1500 | chooser.set_use_preview_label (False) |
1501 | - chooser.set_preview_widget (gtk.Image ()) |
1502 | + chooser.set_preview_widget (Gtk.Image ()) |
1503 | chooser.connect ("selection-changed", self.update_preview) |
1504 | |
1505 | ret = chooser.run () |
1506 | @@ -1315,9 +1318,9 @@ |
1507 | |
1508 | # About Dialog |
1509 | # |
1510 | -class AboutDialog (gtk.AboutDialog): |
1511 | +class AboutDialog (Gtk.AboutDialog): |
1512 | def __init__ (self, parent): |
1513 | - gtk.AboutDialog.__init__ (self) |
1514 | + Gtk.AboutDialog.__init__ (self) |
1515 | self.set_transient_for (parent) |
1516 | |
1517 | self.set_name (_("CompizConfig Settings Manager")) |
1518 | @@ -1339,7 +1342,7 @@ |
1519 | |
1520 | # Error dialog |
1521 | # |
1522 | -class ErrorDialog (gtk.MessageDialog): |
1523 | +class ErrorDialog (Gtk.MessageDialog): |
1524 | '''Display an error dialog''' |
1525 | |
1526 | def __init__ (self, parent, message): |
1527 | @@ -1357,7 +1360,7 @@ |
1528 | |
1529 | # Warning dialog |
1530 | # |
1531 | -class WarningDialog (gtk.MessageDialog): |
1532 | +class WarningDialog (Gtk.MessageDialog): |
1533 | '''Display a warning dialog''' |
1534 | |
1535 | def __init__ (self, parent, message): |
1536 | @@ -1373,7 +1376,7 @@ |
1537 | |
1538 | # First run dialog providing a user warning. |
1539 | # |
1540 | -class FirstRun (gtk.MessageDialog): |
1541 | +class FirstRun (Gtk.MessageDialog): |
1542 | '''First run dialog providing a user warning.''' |
1543 | |
1544 | def __init__(self, parent): |
1545 | @@ -1386,7 +1389,7 @@ |
1546 | self.set_markup("<b>%s</b>" % title) |
1547 | message = _("This tool allows you to deeply configure Compiz's settings. Some options may be incompatible with each other. Unless used with care, it is possible to be left with an unusable desktop.") |
1548 | self.format_secondary_markup(message) |
1549 | - check_button = gtk.CheckButton(label=_("Show this warning next time?")) |
1550 | + check_button = Gtk.CheckButton(label=_("Show this warning next time?")) |
1551 | check_button.set_active(True) |
1552 | self.vbox.pack_start(check_button, True, True, 2) |
1553 | check_button.show() |
1554 | @@ -1409,25 +1412,25 @@ |
1555 | |
1556 | # Plugin Button |
1557 | # |
1558 | -class PluginButton (gtk.HBox): |
1559 | +class PluginButton (Gtk.HBox): |
1560 | |
1561 | - __gsignals__ = {"clicked" : (gobject.SIGNAL_RUN_FIRST, |
1562 | - gobject.TYPE_NONE, |
1563 | + __gsignals__ = {"clicked" : (GObject.SIGNAL_RUN_FIRST, |
1564 | + GObject.TYPE_NONE, |
1565 | []), |
1566 | - "activated" : (gobject.SIGNAL_RUN_FIRST, |
1567 | - gobject.TYPE_NONE, |
1568 | + "activated" : (GObject.SIGNAL_RUN_FIRST, |
1569 | + GObject.TYPE_NONE, |
1570 | [])} |
1571 | |
1572 | _plugin = None |
1573 | |
1574 | def __init__ (self, plugin, useMissingImage = False): |
1575 | - gtk.HBox.__init__(self) |
1576 | + Gtk.HBox.__init__(self) |
1577 | self._plugin = plugin |
1578 | |
1579 | image = Image (plugin.Name, ImagePlugin, 32, useMissingImage) |
1580 | label = Label (plugin.ShortDesc, 120) |
1581 | label.connect ('style-set', self.style_set) |
1582 | - box = gtk.HBox () |
1583 | + box = Gtk.HBox () |
1584 | box.set_spacing (5) |
1585 | box.pack_start (image, False, False, 0) |
1586 | box.pack_start (label, True, True, 0) |
1587 | @@ -1442,7 +1445,7 @@ |
1588 | blacklist_plugins.append('unityshell') |
1589 | |
1590 | if plugin.Name not in blacklist_plugins: |
1591 | - enable = gtk.CheckButton () |
1592 | + enable = Gtk.CheckButton () |
1593 | enable.set_tooltip_text(_("Enable %s") % plugin.ShortDesc) |
1594 | enable.set_active (plugin.Enabled) |
1595 | enable.set_sensitive (plugin.Context.AutoSort) |
1596 | @@ -1506,7 +1509,7 @@ |
1597 | |
1598 | # Category Box |
1599 | # |
1600 | -class CategoryBox(gtk.VBox): |
1601 | +class CategoryBox(Gtk.VBox): |
1602 | |
1603 | _plugins = None |
1604 | _unfiltered_plugins = None |
1605 | @@ -1519,7 +1522,7 @@ |
1606 | _current_plugins = 0 |
1607 | |
1608 | def __init__ (self, context, name, plugins=None, categoryIndex=0): |
1609 | - gtk.VBox.__init__ (self) |
1610 | + Gtk.VBox.__init__ (self) |
1611 | |
1612 | self.set_spacing (5) |
1613 | |
1614 | @@ -1541,7 +1544,7 @@ |
1615 | # Keep unfiltered list of plugins for correct background icon loading |
1616 | self._unfiltered_plugins = self._plugins |
1617 | |
1618 | - header = gtk.HBox () |
1619 | + header = Gtk.HBox () |
1620 | header.set_border_width (5) |
1621 | header.set_spacing (10) |
1622 | label = Label ('', -1) |
1623 | @@ -1552,7 +1555,7 @@ |
1624 | header.pack_start (image, False, False, 0) |
1625 | header.pack_start (label, False, False, 0) |
1626 | |
1627 | - self._table = gtk.Table () |
1628 | + self._table = Gtk.Table () |
1629 | self._table.set_border_width (10) |
1630 | |
1631 | # load icons now only for the first 3 categories |
1632 | @@ -1565,7 +1568,7 @@ |
1633 | |
1634 | self._alignment = gtk.Alignment (0, 0, 1, 1) |
1635 | self._alignment.set_padding (0, 20, 0, 0) |
1636 | - self._alignment.add (gtk.HSeparator ()) |
1637 | + self._alignment.add (Gtk.HSeparator ()) |
1638 | |
1639 | self.pack_start (header, False, False, 0) |
1640 | self.pack_start (self._table, False, False, 0) |
1641 | @@ -1622,10 +1625,10 @@ |
1642 | |
1643 | # Plugin Window |
1644 | # |
1645 | -class PluginWindow(gtk.ScrolledWindow): |
1646 | - __gsignals__ = {"show-plugin" : (gobject.SIGNAL_RUN_FIRST, |
1647 | - gobject.TYPE_NONE, |
1648 | - [gobject.TYPE_PYOBJECT])} |
1649 | +class PluginWindow(Gtk.ScrolledWindow): |
1650 | + __gsignals__ = {"show-plugin" : (GObject.SIGNAL_RUN_FIRST, |
1651 | + GObject.TYPE_NONE, |
1652 | + [GObject.TYPE_PYOBJECT])} |
1653 | |
1654 | _not_found_box = None |
1655 | _style_block = 0 |
1656 | @@ -1636,7 +1639,7 @@ |
1657 | _box = None |
1658 | |
1659 | def __init__ (self, context, categories=[], plugins=[]): |
1660 | - gtk.ScrolledWindow.__init__ (self) |
1661 | + Gtk.ScrolledWindow.__init__ (self) |
1662 | |
1663 | self._categories = {} |
1664 | self._boxes = [] |
1665 | @@ -1660,7 +1663,7 @@ |
1666 | self.props.vscrollbar_policy = gtk.POLICY_AUTOMATIC |
1667 | self.connect ('size-allocate', self.rebuild_boxes) |
1668 | |
1669 | - self._box = gtk.VBox () |
1670 | + self._box = Gtk.VBox () |
1671 | self._box.set_spacing (5) |
1672 | |
1673 | self._not_found_box = NotFoundBox () |
1674 | @@ -1673,7 +1676,7 @@ |
1675 | self._boxes.append (category_box) |
1676 | self._box.pack_start (category_box, False, False, 0) |
1677 | |
1678 | - viewport = gtk.Viewport () |
1679 | + viewport = Gtk.Viewport () |
1680 | viewport.connect("style-set", self.set_viewport_style) |
1681 | viewport.set_focus_vadjustment (self.get_vadjustment ()) |
1682 | viewport.add (self._box) |
1683 | |
1684 | === modified file 'compizconfig/ccsm/ccm/Window.py' |
1685 | --- compizconfig/ccsm/ccm/Window.py 2018-06-27 09:51:35 +0000 |
1686 | +++ compizconfig/ccsm/ccm/Window.py 2018-07-08 20:42:11 +0000 |
1687 | @@ -29,6 +29,8 @@ |
1688 | from ccm.Constants import * |
1689 | from ccm.Conflicts import * |
1690 | |
1691 | +Gtk = gtk |
1692 | + |
1693 | import locale |
1694 | import gettext |
1695 | locale.setlocale(locale.LC_ALL, "") |
1696 | @@ -36,12 +38,12 @@ |
1697 | gettext.textdomain("ccsm") |
1698 | _ = gettext.gettext |
1699 | |
1700 | -class MainWin(gtk.Window): |
1701 | +class MainWin(Gtk.Window): |
1702 | |
1703 | currentCategory = None |
1704 | |
1705 | def __init__(self, Context, pluginPage=None, categoryName=None): |
1706 | - gtk.Window.__init__(self) |
1707 | + Gtk.Window.__init__(self) |
1708 | self.ShowingPlugin = None |
1709 | self.Context = Context |
1710 | self.connect("destroy", self.Quit) |
1711 | @@ -49,10 +51,10 @@ |
1712 | self.set_title(_("CompizConfig Settings Manager")) |
1713 | |
1714 | # Build the panes |
1715 | - self.MainBox = gtk.HBox() |
1716 | + self.MainBox = Gtk.HBox() |
1717 | self.add(self.MainBox) |
1718 | - self.LeftPane = gtk.VBox() |
1719 | - self.RightPane = gtk.VBox() |
1720 | + self.LeftPane = Gtk.VBox() |
1721 | + self.RightPane = Gtk.VBox() |
1722 | self.RightPane.set_border_width(5) |
1723 | self.MainBox.pack_start(self.LeftPane, False, False, 0) |
1724 | self.MainBox.pack_start(self.RightPane, True, True, 0) |
1725 | @@ -69,7 +71,7 @@ |
1726 | self.MainPage.ToggleCategory(None, categoryName) |
1727 | |
1728 | def Quit(self, *args): |
1729 | - gtk.main_quit() |
1730 | + Gtk.main_quit() |
1731 | |
1732 | def SetPage(self, page): |
1733 | if page == self.CurrentPage: |