Merge lp:~ballogy/gloobus-preview/pygobject3-port into lp:gloobus-preview

Proposed by Balló György
Status: Merged
Merged at revision: 293
Proposed branch: lp:~ballogy/gloobus-preview/pygobject3-port
Merge into: lp:gloobus-preview
Diff against target: 123 lines (+21/-22)
1 file modified
src/gloobus-preview-configuration (+21/-22)
To merge this branch: bzr merge lp:~ballogy/gloobus-preview/pygobject3-port
Reviewer Review Type Date Requested Status
Gloobus Developers Pending
Review via email: mp+245281@code.launchpad.net

Description of the change

Port gloobus-preview-configuration to pygobject3

This makes gloobus-preview-configuration to use GTK+ 3.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gloobus-preview-configuration'
2--- src/gloobus-preview-configuration 2010-05-20 13:04:40 +0000
3+++ src/gloobus-preview-configuration 2014-12-20 21:21:10 +0000
4@@ -6,10 +6,9 @@
5 import os
6 import sys
7 import glob
8-import gtk
9+from gi.repository import Gtk, GConf
10 import signal
11 import gettext
12-import gconf
13 #import config
14
15 #=========================== CLASS COLORS =======================================================#
16@@ -69,54 +68,54 @@
17 def __init__(self):
18 self.config = config_load()
19
20- self.client = gconf.client_get_default()
21+ self.client = GConf.Client.get_default()
22 self.gconf_win_layout = self.client.get_string('/apps/metacity/general/button_layout')
23
24 #================= Show In Taskbar ================= #
25- self.entry1 = gtk.CheckButton(label=_("Show in TaskBar"), use_underline=False)
26+ self.entry1 = Gtk.CheckButton(label=_("Show in TaskBar"), use_underline=False)
27 self.entry1.set_tooltip_markup(_("When enabled gloobus-preview will be\nshown in the <b>taskbar</b>"))
28 self.entry1.set_active(self.config.getboolean("Main","taskbar"))
29
30 #================= Allways on top ================= #
31- self.entry2 = gtk.CheckButton(label=_("Always on top"), use_underline=False)
32+ self.entry2 = Gtk.CheckButton(label=_("Always on top"), use_underline=False)
33 self.entry2.set_tooltip_markup(_("When enabled gloobus-preview will be\n<b>always on top</b> of the other windows"))
34 self.entry2.set_active(self.config.getboolean("Main","ontop"))
35 win.set_keep_above(self.config.getboolean("Main","ontop"))
36
37
38 #================= Quit on lose focus ================= #
39- self.entry3 = gtk.CheckButton(label=_("Quit on lose focus"), use_underline=False)
40+ self.entry3 = Gtk.CheckButton(label=_("Quit on lose focus"), use_underline=False)
41 self.entry3.set_tooltip_markup(_("When enabled, gloobus-preview will <b>exit</b>\nwhen it loses focus"))
42 self.entry3.set_active(self.config.getboolean("Main","focus"))
43
44 #================= Win bar layout ================= #
45- self.entry4 = gtk.CheckButton(label=_("Window Bar Layout inverted"), use_underline=False)
46+ self.entry4 = Gtk.CheckButton(label=_("Window Bar Layout inverted"), use_underline=False)
47 self.entry4.set_tooltip_markup(_("Layout of the buttons\nclose button on the right/left?"))
48 self.entry4.set_active(self.config.getboolean("Main","winbar_layout"))
49
50 #================= Use gtk theme ================= #
51- self.theme_gtk_entry = gtk.CheckButton(label=_("Use gtk theme"), use_underline=False)
52+ self.theme_gtk_entry = Gtk.CheckButton(label=_("Use gtk theme"), use_underline=False)
53 self.theme_gtk_entry.set_tooltip_markup(_("When enabled, gloobus-preview will use system GTK theme"))
54 self.theme_gtk_entry.set_active(self.config.getboolean("Theme","gtk"))
55
56 #=================== BUTTONS ===================== #
57- container0 = gtk.HBox(True,1) #Save and close buttons
58+ container0 = Gtk.HBox(True,1) #Save and close buttons
59
60- ok_button = gtk.Button(_("Save"))
61- cancel_button = gtk.Button(_("Cancel"))
62+ ok_button = Gtk.Button(_("Save"))
63+ cancel_button = Gtk.Button(_("Cancel"))
64
65 container0.add(cancel_button)
66 container0.add(ok_button)
67- cancel_button.connect('clicked', gtk.main_quit)
68+ cancel_button.connect('clicked', Gtk.main_quit)
69 ok_button.connect('clicked', self.save_conf)
70
71 #============ GENERAL CONTAINER ================== #
72
73- general_container = gtk.VBox(False,1)
74+ general_container = Gtk.VBox(False,1)
75
76- title = gtk.Label()
77+ title = Gtk.Label()
78 title.set_markup(_("<b>Main settings</b>"))
79- align2 = gtk.Alignment(0,0,0,0)
80+ align2 = Gtk.Alignment.new(0,0,0,0)
81 align2.set_padding(0,5,0,0)
82 align2.add(title)
83
84@@ -128,11 +127,11 @@
85 if self.gconf_win_layout == None:
86 general_container.add(self.entry4) #Always on top
87
88- general_container.add(gtk.HSeparator())
89- general_container.add(gtk.Label()) #White Space
90+ general_container.add(Gtk.HSeparator())
91+ general_container.add(Gtk.Label()) #White Space
92 general_container.add(container0) #Close & save buttons
93
94- align = gtk.Alignment(0,0,0,0);
95+ align = Gtk.Alignment.new(0,0,0,0);
96 align.set_padding(10,5,10,10)
97
98 align.add(general_container)
99@@ -155,7 +154,7 @@
100
101 config_save(self.config)
102
103- gtk.main_quit()
104+ Gtk.main_quit()
105
106
107 #==================================== GLOBAL FUNCTIONS ===============================================#
108@@ -232,13 +231,13 @@
109 g.debug("Path: " + abspath)
110 g.debug("Config File: " + CONFIG_PATH)
111
112-win = gtk.Window()
113+win = Gtk.Window()
114 win.set_title(_("Gloobus-Preview Configuration"))
115 #win.set_default_size(400,150)
116-win.connect('delete-event', gtk.main_quit)
117+win.connect('delete-event', Gtk.main_quit)
118
119
120 gui = GUI()
121
122-gtk.main()
123+Gtk.main()
124

Subscribers

People subscribed via source and target branches