Subversion Repositories basico

Rev

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

Rev 9 Rev 74
Line 19... Line 19...
19
from gi.repository import Gio
19
from gi.repository import Gio
20
20
21
from .service import Service
21
from .service import Service
22
from .window import GtkAppWindow
22
from .window import GtkAppWindow
23
from .log import get_logger
23
from .log import get_logger
24
from .env import FILE
-
 
-
 
24
from .env import FILE, APP
25
25
26
class UIApp(Gtk.Application):
26
class UIApp(Gtk.Application):
27
    """
27
    """
28
    """
28
    """
29
    def __init__(self, controller):
29
    def __init__(self, controller):
Line 32... Line 32...
32
                                 flags=Gio.ApplicationFlags.FLAGS_NONE)
32
                                 flags=Gio.ApplicationFlags.FLAGS_NONE)
33
        GLib.set_application_name("Basico")
33
        GLib.set_application_name("Basico")
34
        GLib.set_prgname('basico')
34
        GLib.set_prgname('basico')
35
        self.log = get_logger(self.__class__.__name__, FILE['LOG'])
35
        self.log = get_logger(self.__class__.__name__, FILE['LOG'])
36
        self.controller = controller
36
        self.controller = controller
37
        #~ print (controller.list_services())
-
 
38
        #~ print (dir(controller))
-
 
39
        self.get_services()
37
        self.get_services()
40
38
41
39
42
    def get_services(self):
40
    def get_services(self):
43
        self.gui = self.controller.get_service('GUI')
41
        self.gui = self.controller.get_service('GUI')
Line 84... Line 82...
84
82
85
    def cb_show_about(self, *args):
83
    def cb_show_about(self, *args):
86
        DIR_ICONS = self.controller.get_var("ICONS")
84
        DIR_ICONS = self.controller.get_var("ICONS")
87
        CREDITS = self.controller.get_file("CREDITS")
85
        CREDITS = self.controller.get_file("CREDITS")
88
        rootwin = self.gui.get_widget('mainwindow')
86
        rootwin = self.gui.get_widget('mainwindow')
-
 
87
        version = APP['version']
89
88
90
        aboutdialog = Gtk.AboutDialog()
89
        aboutdialog = Gtk.AboutDialog()
91
        aboutdialog.set_hide_titlebar_when_maximized(True)
90
        aboutdialog.set_hide_titlebar_when_maximized(True)
92
        icon_dlg = self.im.get_icon('basico', 96, 96)
91
        icon_dlg = self.im.get_icon('basico', 96, 96)
93
        applicense = Gtk.License(Gtk.License.GPL_3_0)
92
        applicense = Gtk.License(Gtk.License.GPL_3_0)
94
        shortname = self.controller.get_app_info('short')
93
        shortname = self.controller.get_app_info('short')
95
        longname = self.controller.get_app_info('desc')
94
        longname = self.controller.get_app_info('desc')
96
        authors = self.controller.get_app_info('authors')
95
        authors = self.controller.get_app_info('authors')
97
        #~ documenters = self.controller.get_app_info('documenters')
-
 
98
        #~ aboutdialog.set_title("About %s" % longname)
-
 
99
        aboutdialog.set_logo(icon_dlg)
96
        aboutdialog.set_logo(icon_dlg)
100
        aboutdialog.set_icon(icon_dlg)
97
        aboutdialog.set_icon(icon_dlg)
101
        #~ aboutdialog.add_credit_section("Icon 🙇", ["Single Unicode character (U+1F64x).\nSee Emoticons section from Unicode Standard version 6.0"])
-
 
102
-
 
103
        #~ for line in open(CREDITS, 'r').readlines():
-
 
104
            #~ data = line.split(';')
-
 
105
            #~ aboutdialog.add_credit_section(data[0], [data[1]])
-
 
106
        aboutdialog.set_comments(longname)
98
        aboutdialog.set_comments(longname)
107
        #~ aboutdialog.set_comments(longname)
-
 
108
        #~ aboutdialog.set_program_name("%s\n(%s)" % (shortname, longname))
-
 
109
        aboutdialog.set_version("0.1")
-
 
-
 
99
        aboutdialog.set_version(version)
110
        aboutdialog.set_copyright("Copyright \xa9 2016 Tomás VĂ­rseda GarcĂ­a")
100
        aboutdialog.set_copyright("Copyright \xa9 2016 Tomás VĂ­rseda GarcĂ­a")
111
        aboutdialog.set_license_type(applicense)
101
        aboutdialog.set_license_type(applicense)
112
        aboutdialog.set_authors(authors)
102
        aboutdialog.set_authors(authors)
113
        #~ aboutdialog.set_documenters(documenters)
-
 
114
        aboutdialog.set_website("http://t00mlabs.net")
103
        aboutdialog.set_website("http://t00mlabs.net")
115
        aboutdialog.set_website_label("t00mlabs Website")
104
        aboutdialog.set_website_label("t00mlabs Website")
116
        aboutdialog.set_title("")
105
        aboutdialog.set_title("")
117
        aboutdialog.connect("response", self.cb_hide_about)
106
        aboutdialog.connect("response", self.cb_hide_about)
118
        aboutdialog.set_transient_for(rootwin)
107
        aboutdialog.set_transient_for(rootwin)
119
        aboutdialog.set_modal(True)
108
        aboutdialog.set_modal(True)
120
        #~ icon_app = Pixbuf.new_from_file_at_scale(DIR_ICONS + 'basico.png', 64, 64, True)
-
 
121
        #~ aboutdialog.set_logo(icon_app)
-
 
122
        aboutdialog.show()
109
        aboutdialog.show()