Subversion Repositories basico

Rev

Rev 243 | Rev 251 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 243 Rev 246
Line 26... Line 26...
26
        self.setup()
26
        self.setup()
27
27
28
    def get_services(self):
28
    def get_services(self):
29
        """Load services to be used in this class
29
        """Load services to be used in this class
30
        """
30
        """
31
        self.gui = self.app.get_service("GUI")
-
 
32
        self.cb = self.app.get_service('Callbacks')
-
 
33
        self.im = self.app.get_service('IM')
-
 
-
 
31
        self.srvgui = self.app.get_service("GUI")
-
 
32
        self.srvclb = self.app.get_service('Callbacks')
-
 
33
        self.srvicm = self.app.get_service('IM')
34
34
35
    def setup(self):
35
    def setup(self):
36
        # Import Header
36
        # Import Header
37
        header = Gtk.VBox()
37
        header = Gtk.VBox()
38
        hbox = Gtk.HBox()
38
        hbox = Gtk.HBox()
39
        icon = self.im.get_new_image_icon('basico-add')
-
 
-
 
39
        icon = self.srvicm.get_new_image_icon('basico-add')
40
        title = Gtk.Label()
40
        title = Gtk.Label()
41
        title.set_markup('<big><b>Import SAP Notes from Launchpad</b></big>')
41
        title.set_markup('<big><b>Import SAP Notes from Launchpad</b></big>')
42
        title.set_xalign(0.0)
42
        title.set_xalign(0.0)
43
        hbox.pack_start(icon, False, False, 6)
43
        hbox.pack_start(icon, False, False, 6)
44
        hbox.pack_start(title, True, True, 0)
44
        hbox.pack_start(title, True, True, 0)
Line 60... Line 60...
60
        vbox.pack_start(label, False, True, 0)
60
        vbox.pack_start(label, False, True, 0)
61
        custom_scroller = Gtk.ScrolledWindow()
61
        custom_scroller = Gtk.ScrolledWindow()
62
        custom_scroller.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
62
        custom_scroller.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
63
        custom_scroller.set_shadow_type(Gtk.ShadowType.IN)
63
        custom_scroller.set_shadow_type(Gtk.ShadowType.IN)
64
        custom_scroller.set_vexpand(True)
64
        custom_scroller.set_vexpand(True)
65
        custom_text_view = self.gui.add_widget('gtk_textview_download_launchpad', Gtk.TextView())
-
 
-
 
65
        custom_text_view = self.srvgui.add_widget('gtk_textview_download_launchpad', Gtk.TextView())
66
        custom_text_view.set_vexpand(True)
66
        custom_text_view.set_vexpand(True)
67
        custom_text_buffer = Gtk.TextBuffer()
67
        custom_text_buffer = Gtk.TextBuffer()
68
        custom_text_buffer.set_text('')
68
        custom_text_buffer.set_text('')
69
        custom_text_view.set_buffer(custom_text_buffer)
69
        custom_text_view.set_buffer(custom_text_buffer)
70
        custom_scroller.add(custom_text_view)
70
        custom_scroller.add(custom_text_view)
Line 73... Line 73...
73
        message = "<small>Please, be patient:  Firefox will be launched headless so you won't see any window.</small>"
73
        message = "<small>Please, be patient:  Firefox will be launched headless so you won't see any window.</small>"
74
        label.set_markup('%s' % message)
74
        label.set_markup('%s' % message)
75
        label.set_justify(Gtk.Justification.LEFT)
75
        label.set_justify(Gtk.Justification.LEFT)
76
        vbox.pack_end(label, False, False, 0)
76
        vbox.pack_end(label, False, False, 0)
77
        custom_button = Gtk.Button("Download")
77
        custom_button = Gtk.Button("Download")
78
        custom_button.connect('clicked', self.cb.sapnote_import_from_launchpad)
-
 
-
 
78
        custom_button.connect('clicked', self.srvclb.sapnote_import_from_launchpad)
79
        vbox.pack_end(custom_button, False, False, 3)
79
        vbox.pack_end(custom_button, False, False, 3)
80
        self.pack_start(vbox, True, True, 0)
80
        self.pack_start(vbox, True, True, 0)
81
        self.show_all()
81
        self.show_all()