Subversion Repositories basico

Rev

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

Rev 254 Rev 255
Line 41... Line 41...
41
        self.srvsap = self.app.get_service('SAP')
41
        self.srvsap = self.app.get_service('SAP')
42
        self.srvicm = self.app.get_service('IM')
42
        self.srvicm = self.app.get_service('IM')
43
        self.srvutl = self.app.get_service('Utils')
43
        self.srvutl = self.app.get_service('Utils')
44
        self.srvant = self.app.get_service('Annotation')
44
        self.srvant = self.app.get_service('Annotation')
45
        self.srvbnr = self.get_service('BNR')
45
        self.srvbnr = self.get_service('BNR')
-
 
46
-
 
47
-
 
48
    def gui_visor_switch_page(self, notebook, page, page_num):
-
 
49
        # 0|1 -> SAP Notes Visor | Annotations Visor
-
 
50
        self.srvgui.set_key_value('current_visor_tab', page_num)
-
 
51
46
52
47
53
48
    def action_search(self, entry):
54
    def action_search(self, entry):
49
        visor = self.srvgui.get_widget('visor_sapnotes')
-
 
50
        viewmenu = self.srvgui.get_widget('viewmenu')
-
 
51
        view = viewmenu.get_view()
-
 
-
 
55
        visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
-
 
56
        visor_annotations = self.srvgui.get_widget('visor_annotations')
52
        term = entry.get_text()
57
        term = entry.get_text()
-
 
58
        page = self.srvgui.get_key_value('current_visor_tab')
53
59
54
        if view != 'annotation':
-
 
-
 
60
        if page == 0:
55
            bag = self.srvdtb.search(term)
61
            bag = self.srvdtb.search(term)
56
            visor.populate_sapnotes(bag)
-
 
57
        else:
-
 
-
 
62
            visor_sapnotes.populate_sapnotes(bag)
-
 
63
        elif page == 1:
58
            annotations = self.srvant.search_term(term)
64
            annotations = self.srvant.search_term(term)
59
            visor.populate_annotations(annotations)
-
 
-
 
65
            visor_annotations.populate_annotations(annotations)
60
66
61
        ebuffer = entry.get_buffer()
67
        ebuffer = entry.get_buffer()
62
        ebuffer.delete_text(0, -1)
68
        ebuffer.delete_text(0, -1)
63
69
64
70
Line 344... Line 350...
344
        model = viewmenu.get_model()
350
        model = viewmenu.get_model()
345
        model.foreach(gui_iterate_over_data)
351
        model.foreach(gui_iterate_over_data)
346
352
347
353
348
    def gui_filter_visor(self, entry):
354
    def gui_filter_visor(self, entry):
349
        visor = self.srvgui.get_widget('visor_sapnotes')
-
 
-
 
355
        page = self.srvgui.get_key_value('current_visor_tab')
-
 
356
        if page == 0:
-
 
357
            visor = self.srvgui.get_widget('visor_sapnotes')
-
 
358
            visible_filter = visor.get_visible_filter()
-
 
359
            visible_filter.refilter()
-
 
360
            visor.update_total_sapnotes_count(len(visible_filter))
-
 
361
        elif page == 1:
-
 
362
            visor = self.srvgui.get_widget('visor_annotations')
-
 
363
            visible_filter = visor.get_visible_filter()
-
 
364
            visible_filter.refilter()
-
 
365
            # ~ visor.update_total_sapnotes_count(len(visible_filter))
-
 
366
-
 
367
-
 
368
    def gui_filter_visor_annotations(self, entry):
-
 
369
        visor = self.srvgui.get_widget('visor_annotations')
350
        self.debug(visor)
370
        self.debug(visor)
351
        visible_filter = visor.get_visible_filter()
371
        visible_filter = visor.get_visible_filter()
352
        visible_filter.refilter()
372
        visible_filter.refilter()
353
        visor.update_total_sapnotes_count(len(visible_filter))
373
        visor.update_total_sapnotes_count(len(visible_filter))
354
374
Line 437... Line 457...
437
            self.srvant.create(annotation)
457
            self.srvant.create(annotation)
438
            # ~ self.info('New annotation created (%s) and linked to SAP Note %010d' % (aid, int(sid)))
458
            # ~ self.info('New annotation created (%s) and linked to SAP Note %010d' % (aid, int(sid)))
439
459
440
        self.gui_annotation_widget_clear()
460
        self.gui_annotation_widget_clear()
441
        # ~ visor.populate_annotations()
461
        # ~ visor.populate_annotations()
442
        viewmenu.set_view('annotation')
-
 
443
        viewmenu.populate()
-
 
-
 
462
        # ~ viewmenu.set_view('annotation')
-
 
463
        # ~ viewmenu.populate()
444
464
445
465
446
    def action_annotation_cancel(self, *args):
466
    def action_annotation_cancel(self, *args):
447
        statusbar = self.srvgui.get_widget('widget_statusbar')
467
        statusbar = self.srvgui.get_widget('widget_statusbar')
448
        self.gui_annotation_widget_clear()
468
        self.gui_annotation_widget_clear()