Subversion Repositories basico

Rev

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

Rev 285 Rev 287
Line 22... Line 22...
22
from gi.repository import GObject
22
from gi.repository import GObject
23
from gi.repository.GdkPixbuf import Pixbuf
23
from gi.repository.GdkPixbuf import Pixbuf
24
from gi.repository import Pango
24
from gi.repository import Pango
25
25
26
from basico.core.mod_srv import Service
26
from basico.core.mod_srv import Service
27
from basico.core.mod_env import LPATH
-
 
-
 
27
from basico.core.mod_env import LPATH, ATYPES
28
from basico.widgets.wdg_cols import CollectionsMgtView
28
from basico.widgets.wdg_cols import CollectionsMgtView
29
from basico.widgets.wdg_import import ImportWidget
29
from basico.widgets.wdg_import import ImportWidget
30
from basico.core.mod_log import get_logger
30
from basico.core.mod_log import get_logger
31
31
32
32
Line 37... Line 37...
37
        self.app = app
37
        self.app = app
38
        self.get_services()
38
        self.get_services()
39
        self.bag = []
39
        self.bag = []
40
        self.icons = {}
40
        self.icons = {}
41
        self.icons['type'] = {}
41
        self.icons['type'] = {}
42
        for atype in ['Email', 'FIXME', 'Meeting', 'Note', 'Procedure', 'Snippet', 'Template', 'TODO']:
-
 
43
            self.icons['type'][atype.lower()] = self.srvicm.get_pixbuf_icon('basico-annotation-type-%s' % atype.lower())
-
 
44
        self.setup()
42
        self.setup()
45
43
46
44
47
    def get_services(self):
45
    def get_services(self):
48
        self.srvgui = self.app.get_service("GUI")
46
        self.srvgui = self.app.get_service("GUI")
Line 393... Line 391...
393
        self.populate_sapnotes(self.bag)
391
        self.populate_sapnotes(self.bag)
394
392
395
393
396
    def populate_sapnotes(self, bag=None, cid=None):
394
    def populate_sapnotes(self, bag=None, cid=None):
397
        icon_annotation = self.srvicm.get_pixbuf_icon('basico-annotation', 32, 32)
395
        icon_annotation = self.srvicm.get_pixbuf_icon('basico-annotation', 32, 32)
398
        icon_content = self.srvicm.get_pixbuf_icon('basico-logviewer', 32, 32)
-
 
399
        icon_link = self.srvicm.get_pixbuf_icon('basico-browser', 32, 32)
-
 
-
 
396
        # ~ icon_content = self.srvicm.get_pixbuf_icon('basico-logviewer', 32, 32)
-
 
397
        # ~ icon_link = self.srvicm.get_pixbuf_icon('basico-browser', 32, 32)
400
        icon_empty = self.srvicm.get_pixbuf_icon('basico-empty', 32, 32)
398
        icon_empty = self.srvicm.get_pixbuf_icon('basico-empty', 32, 32)
401
        icon_sapnote = self.srvicm.get_pixbuf_icon('basico-sapnote', 32, 32)
399
        icon_sapnote = self.srvicm.get_pixbuf_icon('basico-sapnote', 32, 32)
402
        icon_bookmark = self.srvicm.get_pixbuf_icon('basico-bookmarks', 32, 32)
400
        icon_bookmark = self.srvicm.get_pixbuf_icon('basico-bookmarks', 32, 32)
-
 
401
        for atype in ATYPES:
-
 
402
            self.icons['type'][atype.lower()] = self.srvicm.get_pixbuf_icon('basico-annotation-type-%s' % atype.lower())
403
        self.column_sid.set_visible(True)
403
        self.column_sid.set_visible(True)
404
        self.column_checkbox.set_visible(True)
404
        self.column_checkbox.set_visible(True)
405
        self.column_category.set_visible(False)
405
        self.column_category.set_visible(False)
406
        self.column_component.set_visible(True)
406
        self.column_component.set_visible(True)
407
        completion = self.srvgui.get_widget('gtk_entrycompletion_visor')
407
        completion = self.srvgui.get_widget('gtk_entrycompletion_visor')
408
        completion_model = completion.get_model()
408
        completion_model = completion.get_model()
409
        completion_model.clear()
409
        completion_model.clear()
410
-
 
411
        # ~ model = self.treeview.get_model()
-
 
412
        # ~ self.treeview.set_model(None)
-
 
413
        self.model.clear()
410
        self.model.clear()
414
411
415
        if bag is None:
412
        if bag is None:
416
            bag = self.bag
413
            bag = self.bag
417
        else:
414
        else:
Line 474... Line 471...
474
                                                annotation['aid'],
471
                                                annotation['aid'],
475
                                                annotation['timestamp']
472
                                                annotation['timestamp']
476
                                            )
473
                                            )
477
                        self.model.append(pid, node)
474
                        self.model.append(pid, node)
478
        self.treeview.set_model(self.sorted_model)
475
        self.treeview.set_model(self.sorted_model)
479
        # ~ self.treeview.set_model(self.sorted_model)
-
 
480
        self.update_total_sapnotes_count(len(self.model))
476
        self.update_total_sapnotes_count(len(self.model))
481
        self.show_widgets()
477
        self.show_widgets()
482
        stack = self.srvgui.get_widget('gtk_stack_main')
478
        stack = self.srvgui.get_widget('gtk_stack_main')
483
        stack.set_visible_child_name('visor')
479
        stack.set_visible_child_name('visor')
484
480