Subversion Repositories basico

Rev

Rev 4 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 74
Line 13... Line 13...
13
13
14
from .service import Service
14
from .service import Service
15
15
16
class UIFuncs(Service):
16
class UIFuncs(Service):
17
    def initialize(self):
17
    def initialize(self):
18
        self.log.debug("Loading common UI Funcs service")
-
 
19
        self.gui = self.app.get_service('GUI')
18
        self.gui = self.app.get_service('GUI')
20
        self.cb = self.app.get_service('Callbacks')
19
        self.cb = self.app.get_service('Callbacks')
21
        self.im = self.app.get_service('IM')
20
        self.im = self.app.get_service('IM')
-
 
21
-
 
22
-
 
23
    def get_gtk_version(self):
-
 
24
        return Gtk.get_major_version(), Gtk.get_minor_version(), Gtk.get_micro_version()
-
 
25
-
 
26
-
 
27
    def check_gtk_version(self):
-
 
28
        vmajor, vminor, vmicro =  self.get_gtk_version()
-
 
29
        self.log.debug("GTK+ Version: %d.%d.%d" % (vmajor, vminor, vmicro))
-
 
30
-
 
31
        if vmajor == 3 and vminor >= 18:
-
 
32
            self.log.debug("GTK+ version supported")
-
 
33
            return True
-
 
34
        else:
-
 
35
            self.log.error("Please, install a modern version of GTK+ (>= 3.18)")
-
 
36
            return False
22
37
23
38
24
    def get_label(self, text, xalign=0.5, yalign=0.5):
39
    def get_label(self, text, xalign=0.5, yalign=0.5):
25
        label = Gtk.Label()
40
        label = Gtk.Label()
26
        label.set_selectable(False)
41
        label.set_selectable(False)