Subversion Repositories basico

Rev

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

Rev 254 Rev 255
Line 49... Line 49...
49
        self.srvgui = self.controller.get_service("GUI")
49
        self.srvgui = self.controller.get_service("GUI")
50
        self.srvdtb = self.controller.get_service("DB")
50
        self.srvdtb = self.controller.get_service("DB")
51
        self.srvuif = self.controller.get_service("UIF")
51
        self.srvuif = self.controller.get_service("UIF")
52
        self.srvicm = self.controller.get_service('IM')
52
        self.srvicm = self.controller.get_service('IM')
53
        self.srvclb = self.controller.get_service('Callbacks')
53
        self.srvclb = self.controller.get_service('Callbacks')
-
 
54
        self.srvant = self.controller.get_service('Annotation')
54
55
55
56
56
    def setup_controller(self, uiapp):
57
    def setup_controller(self, uiapp):
57
        self.controller = uiapp.get_controller()
58
        self.controller = uiapp.get_controller()
58
59
Line 384... Line 385...
384
        visortoolbar = self.srvgui.add_widget('visortoolbar', VisorToolbar(self.controller))
385
        visortoolbar = self.srvgui.add_widget('visortoolbar', VisorToolbar(self.controller))
385
        self.srvgui.swap_widget(boxtoolbar, visortoolbar)
386
        self.srvgui.swap_widget(boxtoolbar, visortoolbar)
386
387
387
        ### Visor
388
        ### Visor
388
        notebook = self.srvgui.add_widget('gtk_notebook_visor', Gtk.Notebook())
389
        notebook = self.srvgui.add_widget('gtk_notebook_visor', Gtk.Notebook())
-
 
390
        notebook.connect('switch-page', self.srvclb.gui_visor_switch_page)
-
 
391
        notebook.set_show_border(False)
-
 
392
        notebook.set_hexpand(True)
389
393
390
        visor_sapnotes = self.setup_tab_sapnote_visor()
-
 
391
        notebook.append_page(visor_sapnotes, Gtk.Label('SAP Notes'))
-
 
-
 
394
-
 
395
        visor_sapnotes_page = self.setup_tab_sapnote_visor()
-
 
396
        visor_sapnotes_page.set_hexpand(True)
-
 
397
        tab_widget = self.srvuif.create_notebook_tab_label('basico-sapnote', '<b>SAP Notes</b>')
-
 
398
        notebook.append_page(visor_sapnotes_page, tab_widget)
392
399
393
        visor_annotations_page = self.setup_tab_annotations_visor()
400
        visor_annotations_page = self.setup_tab_annotations_visor()
394
        notebook.append_page(
-
 
395
            visor_annotations_page,
-
 
396
            Gtk.Image.new_from_icon_name(
-
 
397
                "help-about",
-
 
398
                Gtk.IconSize.MENU
-
 
399
            )
-
 
400
        )
-
 
401
        self.controller.debug(visor_sapnotes == visor_annotations_page)
-
 
-
 
401
        tab_widget = self.srvuif.create_notebook_tab_label('basico-annotation', '<b>Annotations</b>')
-
 
402
        notebook.append_page(visor_annotations_page, tab_widget)
-
 
403
-
 
404
        notebook.child_set_property(visor_sapnotes_page, "tab-expand", True)
-
 
405
        notebook.child_set_property(visor_sapnotes_page, "tab-fill", False)
-
 
406
        notebook.child_set_property(visor_annotations_page, "tab-expand", True)
-
 
407
        notebook.child_set_property(visor_annotations_page, "tab-fill", False)
-
 
408
402
        box.pack_start(notebook, True, True, 0)
409
        box.pack_start(notebook, True, True, 0)
403
410
404
        return box
411
        return box
405
412
406
    def setup_tab_sapnote_visor(self):
413
    def setup_tab_sapnote_visor(self):
Line 415... Line 422...
415
422
416
        ### Visor
423
        ### Visor
417
        scr = Gtk.ScrolledWindow()
424
        scr = Gtk.ScrolledWindow()
418
        scr.set_hexpand(True)
425
        scr.set_hexpand(True)
419
        scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
426
        scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
-
 
427
        scr.set_shadow_type(Gtk.ShadowType.NONE)
420
        vwp = Gtk.Viewport()
428
        vwp = Gtk.Viewport()
421
        vwp.set_hexpand(True)
429
        vwp.set_hexpand(True)
422
        visor = self.srvgui.add_widget('visor_sapnotes', SAPNotesVisor(self.controller))
430
        visor = self.srvgui.add_widget('visor_sapnotes', SAPNotesVisor(self.controller))
423
        visor.set_hexpand(True)
431
        visor.set_hexpand(True)
424
        visor.set_vexpand(True)
432
        visor.set_vexpand(True)
Line 442... Line 450...
442
450
443
        ### Visor
451
        ### Visor
444
        scr = Gtk.ScrolledWindow()
452
        scr = Gtk.ScrolledWindow()
445
        scr.set_hexpand(True)
453
        scr.set_hexpand(True)
446
        scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
454
        scr.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
-
 
455
        scr.set_shadow_type(Gtk.ShadowType.NONE)
447
        vwp = Gtk.Viewport()
456
        vwp = Gtk.Viewport()
448
        vwp.set_hexpand(True)
457
        vwp.set_hexpand(True)
449
        visor = self.srvgui.add_widget('visor_annotations', AnnotationsVisor(self.controller))
458
        visor = self.srvgui.add_widget('visor_annotations', AnnotationsVisor(self.controller))
450
        visor.set_hexpand(True)
459
        visor.set_hexpand(True)
451
        visor.set_vexpand(True)
460
        visor.set_vexpand(True)
Line 485... Line 494...
485
    def setup_stack_annotation(self):
494
    def setup_stack_annotation(self):
486
        return self.srvgui.add_widget('widget_annotation', AnnotationWidget(self.controller))
495
        return self.srvgui.add_widget('widget_annotation', AnnotationWidget(self.controller))
487
496
488
497
489
    def run(self):
498
    def run(self):
-
 
499
        visor_annotations = self.srvgui.get_widget('visor_annotations')
490
        viewmenu = self.srvgui.get_widget('viewmenu')
500
        viewmenu = self.srvgui.get_widget('viewmenu')
491
        viewmenu.set_view('annotation')
-
 
-
 
501
        viewmenu.set_view('collection')
492
        self.srvclb.gui_show_dashboard()
502
        self.srvclb.gui_show_dashboard()
493
        # ~ self.srvclb.gui_show_about()
-
 
-
 
503
        annotations = self.srvant.search_term('')
-
 
504
        visor_annotations.populate_annotations(annotations)