Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 389 → Rev 390

/branches/BR-0.4/basico/core/mod_win.py
14,6 → 14,7
import platform
 
import gi
gi.require_version('Gdk', '3.0')
gi.require_version('Gtk', '3.0')
 
from gi.repository import GLib
77,20 → 78,23
# From docs: Don’t use this function. It sets the X xlib.Window
# System “class” and “name” hints for a window.
# But I have to do it or it doesn't shows the right title. ???
self.set_wmclass (APP['name'], APP['name'])
self.set_role(APP['name'])
# ~ self.set_wmclass (APP['name'], APP['name'])
# ~ self.set_role(APP['name'])
 
"""
Change Gtk+ Style
"""
screen = Gdk.Screen.get_default()
css_provider = Gtk.CssProvider()
css_provider.load_from_path(FILE['CSS'])
context = Gtk.StyleContext()
context.add_provider_for_screen(screen, css_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER)
 
self.set_default_size(1024, 728)
self.set_position(Gtk.WindowPosition.CENTER_ALWAYS)
self.setup_headerbar()
#FIX: hack to avoid white background in widgets within a notebook tab
#FIXME: it should be managed by settings
# ~ screen = Gdk.Screen.get_default()
# ~ css_provider = Gtk.CssProvider()
# ~ css_provider.load_from_path(FILE['CSS'])
# ~ context = Gtk.StyleContext()
# ~ context.add_provider_for_screen(screen, css_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER)
 
# ~ self.maximize ()
self.maximize ()
self.show_all()
 
 
109,23 → 113,7
 
 
def setup_headerbar_left(self, hb):
# ~ '''Left headerbar side not used by now'''
lhbox = self.srvgui.add_widget('gtk_hbox_hb_left', Gtk.HBox())
 
### Dashboard / Visor
# ~ hbox = Gtk.HBox()
# ~ icon = self.srvicm.get_pixbuf_icon('basico-dashboard', 24, 24)
# ~ image = Gtk.Image()
# ~ image.set_from_pixbuf(icon)
# ~ label = Gtk.Label()
# ~ hbox.pack_start(image, False, False, 3)
# ~ hbox.pack_start(label, False, False, 3)
# ~ button = self.srvgui.add_widget('gtk_button_dashboard', Gtk.Button())
# ~ button.add(hbox)
# ~ button.set_relief(Gtk.ReliefStyle.NONE)
 
# ~ button.connect('clicked', self.srvclb.gui_show_dashboard)
 
return lhbox
 
 
284,7 → 272,7
stack_main = self.srvgui.add_widget('gtk_stack_main', Gtk.Stack())
stack_switcher.set_stack(stack_main)
stack_switcher.set_property('icon-size', 3)
stack_main.connect('notify::visible-child', self.stack_changed)
# ~ stack_main.connect('notify::visible-child', self.stack_changed)
stack_main.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT)
stack_main.set_transition_duration(250)
box.pack_start(stack_main, True, True, 0)
344,7 → 332,6
self.srvgui.swap_widget(boxtoolbar, visortoolbar)
 
### Stack for visors
 
stack_switcher = self.srvgui.add_widget('gtk_stack_switcher_visors', Gtk.StackSwitcher())
rhbox = self.srvgui.get_widget('gtk_hbox_toolbar_stack_switcher')
rhbox.pack_start(stack_switcher, False, False, 0)
352,7 → 339,7
stack_visors = self.srvgui.add_widget('gtk_stack_visors', Gtk.Stack())
stack_switcher.set_stack(stack_visors)
stack_switcher.set_property('icon-size', 3)
stack_visors.connect('notify::visible-child', self.stack_changed)
stack_visors.connect('notify::visible-child', self.srvclb.stack_visor_changed)
stack_visors.set_transition_type(Gtk.StackTransitionType.SLIDE_LEFT_RIGHT)
stack_visors.set_transition_duration(250)
box.pack_start(stack_visors, True, True, 0)
359,7 → 346,7
 
#### Stack for Visor SAP Notes
stack_child = self.setup_tab_sapnote_visor()
stack_visors.add_titled(stack_child, "visor-sapnote", "SAP Notes")
stack_visors.add_titled(stack_child, "visor-sapnotes", "SAP Notes")
stack_visors.child_set_property (stack_child, "icon-name", "basico-sapnote")
 
#### Stack for Visor Annotations
372,56 → 359,6
stack_visors.add_titled(stack_child, "visor-attachments", "Attachments")
stack_visors.child_set_property (stack_child, "icon-name", "basico-attachment")
 
# ~ notebook = self.srvgui.add_widget('gtk_notebook_visor', Gtk.Notebook())
# ~ signal = notebook.connect('switch-page', self.srvclb.gui_visor_switch_page)
# ~ self.srvgui.add_signal('gtk_notebook_visor', 'switch-page', signal)
# ~ notebook.set_show_border(False)
# ~ notebook.set_hexpand(True)
# ~ notebook.set_show_tabs(False)
 
# Notebook tab for SAP Notes Visor
# ~ visor_sapnotes_page = self.setup_tab_sapnote_visor()
# ~ visor_sapnotes_page.set_hexpand(True)
# ~ tab_widget = self.srvuif.create_notebook_tab_label('basico-sapnote', '<b>SAP Notes</b>')
# ~ notebook.append_page(visor_sapnotes_page, tab_widget)
 
# Notebook tab for SAP Notes Visor
# ~ visor_annotations_page = self.setup_tab_annotations_visor()
# ~ visor_annotations_page.set_hexpand(True)
# ~ tab_widget = self.srvuif.create_notebook_tab_label('basico-annotation', '<b>Annotations</b>')
# ~ notebook.append_page(visor_annotations_page, tab_widget)
 
# Notebook tab for Attachments Visor
# ~ visor_attachments_page = self.setup_tab_attachments_visor()
# ~ visor_attachments_page.set_hexpand(True)
# ~ tab_widget = self.srvuif.create_notebook_tab_label('basico-attachment', '<b>Attachments</b>')
# ~ notebook.append_page(visor_attachments_page, tab_widget)
 
# ~ # Notebook tab for Webbookmarks Visor
# ~ visor_annotations_page = self.setup_tab_annotations_visor()
# ~ visor_annotations_page.set_hexpand(True)
# ~ tab_widget = self.srvuif.create_notebook_tab_label('basico-annotation', '<b>Annotations</b>')
# ~ notebook.append_page(visor_annotations_page, tab_widget)
 
# ~ if self.srvuif.webkit_support():
# ~ visor_help_page = self.srvgui.add_widget('gtk_notebook_help_page', self.setup_tab_help_visor())
# ~ visor_help_page.set_hexpand(True)
# ~ tab_widget = self.srvuif.create_notebook_tab_label('basico-help', '<b>Help</b>')
# ~ notebook.append_page(visor_help_page, tab_widget)
# ~ self.srvuif.set_widget_visibility('gtk_notebook_help_page', False)
# ~ notebook.child_set_property(visor_help_page, "tab-expand", True)
# ~ notebook.child_set_property(visor_help_page, "tab-fill", False)
 
 
# ~ notebook.child_set_property(visor_sapnotes_page, "tab-expand", True)
# ~ notebook.child_set_property(visor_sapnotes_page, "tab-fill", False)
# ~ notebook.child_set_property(visor_annotations_page, "tab-expand", True)
# ~ notebook.child_set_property(visor_annotations_page, "tab-fill", False)
# ~ notebook.child_set_property(visor_attachments_page, "tab-expand", True)
# ~ notebook.child_set_property(visor_attachments_page, "tab-fill", False)
 
# ~ box.pack_start(notebook, True, True, 0)
 
return box
 
# ~ def setup_tab_help_visor(self):
467,8 → 404,6
### Visor
 
notebook = self.srvgui.add_widget('gtk_notebook_annotations_visor', Gtk.Notebook())
# ~ signal = notebook.connect('switch-page', self.srvclb.gui_visor_annotations_switch_page)
# ~ self.srvgui.add_signal('gtk_notebook_visor', 'switch-page', signal)
notebook.set_show_border(False)
notebook.set_hexpand(True)
notebook.set_show_tabs(False)
495,9 → 430,6
notebook.append_page(annotation_widget, tab_widget)
 
box.pack_start(notebook, True, True, 0)
 
# Annotation Widget tab
 
visor_annotations.show_all()
box.show_all()
return box
569,17 → 501,11
return box
 
 
def stack_changed(self, stack, gparam):
try:
pos = self.srvgui.get_key_value('current_paned_position')
paned = self.srvgui.get_widget('gtk_hpaned')
paned.set_position(pos)
except KeyError:
pass
# ~ visible_stack_name = stack.get_visible_child_name()
# ~ self.set_visible_stack(visible_stack_name)
 
def run(self):
viewmenu = self.srvgui.get_widget('viewmenu')
stack_visors = self.srvgui.get_widget('gtk_stack_visors')
 
stack_visors.set_visible_child_name('visor-sapnotes')
viewmenu.set_view('collection')
self.srvclb.gui_viewmenu_select_first_entry()
 
/branches/BR-0.4/basico/data/res/css/basico.css
1,0 → 0,0
progress, trough { min-height: 20px; }
 
toolbar {
border-bottom: 3px transparent;
margin-bottom: 3px;
}
 
stack {
border: 0px transparent;
}
 
paned {
border: 0px transparent;
}
 
/*
treeview {
border: 0px transparent;
}
 
viewport {
border: 1px solid transparent;
}
 
scrolledwindow {
border: 1px solid silver;
}
*/
/*
textview {
border: 1px solid black;
}
*/
 
/*
box * {
font: 20px Sans;
}
*/
/branches/BR-0.4/basico/services/srv_callbacks.py
43,14 → 43,14
self.srvatc = self.get_service('Attachment')
 
 
def gui_visor_switch_page(self, notebook, page, page_num):
# 0|1|(2) -> SAP Notes Visor | Annotations Visor | (Help)
self.srvgui.set_key_value('current_visor_tab', page_num)
# ~ notebook_viewmenu = self.srvgui.get_widget('gtk_notebook_menuview')
# ~ paned = self.srvgui.get_widget('gtk_hpaned')
self.log.debug("Visor page switched to: %d", page_num)
def stack_visor_changed(self, stack, gparam):
visible_stack_name = stack.get_visible_child_name()
self.log.debug("Visor switched to: %s", visible_stack_name)
 
if page_num == 0:
if visible_stack_name is None:
return
 
if visible_stack_name == 'visor-sapnotes':
# ~ self.srvuif.set_widget_visibility('gtk_button_menu_views', True)
self.srvuif.set_widget_visibility('gtk_label_total_notes', True)
visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
58,7 → 58,7
visor_sapnotes.update_total_sapnotes_count()
# ~ paned.set_position(400)
# ~ notebook_viewmenu.set_current_page(0)
elif page_num == 1:
elif visible_stack_name == 'visor-annotations':
# ~ self.srvuif.set_widget_visibility('gtk_button_menu_views', False)
self.srvuif.set_widget_visibility('gtk_label_total_notes', True)
visor_annotations = self.srvgui.get_widget('visor_annotations')
84,15 → 84,17
 
 
def action_search(self, entry):
stack_visors = self.srvgui.get_widget('gtk_stack_visors')
visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
visor_annotations = self.srvgui.get_widget('visor_annotations')
term = entry.get_text()
page = self.srvgui.get_key_value('current_visor_tab')
 
stack_visor = stack_visors.get_visible_child_name()
completion = self.srvgui.get_widget('gtk_entrycompletion_visor')
completion_model = completion.get_model()
completion_model.clear()
 
if page == 0:
if stack_visor == 'visor-sapnotes':
bag = self.srvdtb.search(term)
visor_sapnotes.populate(bag)
ebuffer = entry.get_buffer()
100,7 → 102,7
msg = "Found %d SAP Notes for term '%s'" % (len(bag), term)
self.log.info(msg)
self.srvuif.statusbar_msg(msg)
elif page == 1:
elif stack_visor == 'visor-annotations':
annotations = self.srvant.search_term(term)
visor_annotations.populate(annotations)
msg = "Found %d annotations for term '%s'" % (len(annotations), term)
542,13 → 544,15
 
 
def gui_filter_visor(self, entry):
page = self.srvgui.get_key_value('current_visor_tab')
if page == 0:
stack_visors = self.srvgui.get_widget('gtk_stack_visors')
visible_stack_name = stack_visors.get_visible_child_name()
 
if visible_stack_name == 'visor-sapnotes':
visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
visible_filter = visor_sapnotes.get_visible_filter()
visible_filter.refilter()
visor_sapnotes.update_total_sapnotes_count()
elif page == 1:
elif visible_stack_name == 'visor-annotations':
visor_annotations = self.srvgui.get_widget('visor_annotations')
visor_annotations.populate()
visible_filter = visor_annotations.get_visible_filter()
/branches/BR-0.4/basico/services/srv_gui.py
16,6 → 16,7
from basico.core.mod_srv import Service
from basico.core.mod_win import GtkAppWindow
from basico.core.mod_log import get_logger
from basico.core.mod_env import FILE
# ~ from basico.widgets.wdg_splash import Splash
 
 
/branches/BR-0.4/basico/widgets/wdg_annot.py
34,10 → 34,10
 
def setup(self):
# Toolbar
self.tool_bar = Gtk.Toolbar()
self.pack_start(self.tool_bar, False, True, 0)
self.tool_bar.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
self.tool_bar.set_property('margin-bottom', 0)
self.toolbar = Gtk.Toolbar()
self.pack_start(self.toolbar, False, True, 0)
self.toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
self.toolbar.set_property('margin-bottom', 0)
 
# Task Category button
tool = Gtk.ToolItem()
66,11 → 66,11
hbox = Gtk.HBox()
hbox.pack_start(a_category, False, False, 0)
tool.add(hbox)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Separator
tool = self.srvuif.get_toolbar_separator(False, False)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Annotation Type button
tool = Gtk.ToolItem()
91,11 → 91,11
hbox = Gtk.HBox()
hbox.pack_start(a_type, False, False, 0)
tool.add(hbox)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Separator
tool = self.srvuif.get_toolbar_separator(False, False)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Task Priority button
tool = Gtk.ToolItem()
125,11 → 125,11
hbox = Gtk.HBox()
hbox.pack_start(a_priority, False, False, 0)
tool.add(hbox)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Separator
tool = self.srvuif.get_toolbar_separator(False, False)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Scope combobox entry
tool = Gtk.ToolItem()
157,7 → 157,7
 
vbox.pack_start(scope, True, True, 0)
tool.add(vbox)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
 
# Tags entry
168,11 → 168,11
tool.set_icon_name('basico-attachment')
# ~ popover = self.srvgui.add_widget('gtk_button_annotation_toolbar_attachment', Gtk.Popover.new(tool))
tool.connect('clicked', self.srvclb.gui_attachment_add_to_annotation)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Separator
tool = self.srvuif.get_toolbar_separator(False, True)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Title
tool = Gtk.ToolItem()
195,7 → 195,7
tool.add(a_wdg_timestamp_created)
tool.set_no_show_all(True)
tool.hide()
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Timestamp updated
tool = Gtk.ToolItem()
206,7 → 206,7
tool.add(a_wdg_human_timestamp)
tool.set_no_show_all(True)
tool.hide()
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Annotation Stack Switcher
tool = Gtk.ToolItem()
215,11 → 215,11
stack = self.srvgui.add_widget('stack_annotation', Gtk.Stack())
stack_switcher.set_stack(stack)
tool.add(stack_switcher)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Separator
tool = self.srvuif.get_toolbar_separator(False, False)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Arrow UP
tool = self.srvgui.add_widget('gtk_button_annotation_toolbar_previous_item', Gtk.ToolButton())
226,7 → 226,7
tool.set_tooltip_markup('<b>Previous annotation</b>')
tool.set_icon_name('basico-arrow-up')
tool.connect('clicked', self.srvclb.gui_annotation_previous_row)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Arrow DOWN
tool = self.srvgui.add_widget('gtk_button_annotation_toolbar_next_item', Gtk.ToolButton())
233,16 → 233,16
tool.set_tooltip_markup('<b>Next annotation</b>')
tool.set_icon_name('basico-arrow-down')
tool.connect('clicked', self.srvclb.gui_annotation_next_row)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Separator
tool = self.srvuif.get_toolbar_separator(False, False)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Toolbar initial settings
self.set_visible(True)
self.set_no_show_all(False)
self.tool_bar.set_hexpand(True)
self.toolbar.set_hexpand(True)
 
 
def completion_match_func(self, completion, key, iter):
365,11 → 365,10
stack_annotation.child_set_property (editor, "icon-name", "basico-drafts")
 
# Add Annotation properties stack
properties = self.annotation_properties()
stack_annotation.add_titled(properties, "properties", "Edit properties")
stack_annotation.child_set_property (properties, "icon-name", "basico-tags")
# ~ properties = self.annotation_properties()
# ~ stack_annotation.add_titled(properties, "properties", "Edit properties")
# ~ stack_annotation.child_set_property (properties, "icon-name", "basico-tags")
 
# ~ self.set_visible_stack('editor')
 
 
def set_visible_stack(self, stack_name='preview'):
382,17 → 381,19
self.srvuif.set_widget_visibility('gtk_combobox_annotation_type', False)
self.srvuif.set_widget_visibility('gtk_combobox_annotation_priority', False)
self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', False)
self.srvuif.set_widget_visibility('gtk_entry_annotation_scope', False)
elif stack_name == 'properties':
self.srvuif.set_widget_visibility('gtk_combobox_annotation_category', False)
self.srvuif.set_widget_visibility('gtk_combobox_annotation_type', False)
self.srvuif.set_widget_visibility('gtk_combobox_annotation_priority', False)
self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', False)
self.srvuif.set_widget_visibility('gtk_entry_annotation_scope', False)
elif stack_name == 'editor':
self.srvuif.set_widget_visibility('gtk_combobox_annotation_category', True)
self.srvuif.set_widget_visibility('gtk_combobox_annotation_type', True)
self.srvuif.set_widget_visibility('gtk_combobox_annotation_priority', True)
self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', True)
self.log.debug("Set visible stack: %s", stack_name)
self.srvuif.set_widget_visibility('gtk_entry_annotation_scope', True)
 
 
def annotation_preview(self):
/branches/BR-0.4/basico/widgets/wdg_visor_annotations.py
84,8 → 84,8
def setup_panel(self):
vbox_main = Gtk.VBox()
self.pack_start(vbox_main, False, False, 3)
separator = Gtk.Separator(orientation = Gtk.Orientation.VERTICAL)
self.pack_start(separator, False, False, 3)
# ~ separator = Gtk.Separator(orientation = Gtk.Orientation.VERTICAL)
# ~ self.pack_start(separator, False, False, 3)
vbox_main.set_hexpand(False)
vbox_main.set_property('margin-top', 6)
vbox_main.set_property('margin-left', 6)
402,7 → 402,7
self.renderer_updated = Gtk.CellRendererText()
self.renderer_updated.set_property('background', '#FFE6D1')
self.column_updated = Gtk.TreeViewColumn('Updated', self.renderer_updated, markup=9)
widget = get_column_header_widget('Update on', 'basico-chronologic')
widget = get_column_header_widget('Updated', 'basico-chronologic')
self.column_updated.set_widget(widget)
self.column_updated.set_visible(True)
self.column_updated.set_expand(False)
438,7 → 438,7
self.renderer_created = Gtk.CellRendererText()
self.renderer_created.set_property('background', '#FFE6D1')
self.column_created = Gtk.TreeViewColumn('Created', self.renderer_created, markup=12)
widget = get_column_header_widget('Created on', 'basico-chronologic')
widget = get_column_header_widget('Created', 'basico-chronologic')
self.column_created.set_widget(widget)
self.column_created.set_visible(True)
self.column_created.set_expand(False)
/branches/BR-0.4/basico/widgets/wdg_visor_sapnotes.py
344,8 → 344,8
# SAP Note UpdatedOn
self.renderer_updated = Gtk.CellRendererText()
self.renderer_updated.set_property('background', '#FFE6D1')
self.column_updated = Gtk.TreeViewColumn('Updated On', self.renderer_updated, markup=9)
widget = get_column_header_widget('Update on', 'basico-chronologic')
self.column_updated = Gtk.TreeViewColumn('Updated', self.renderer_updated, markup=9)
widget = get_column_header_widget('Updated', 'basico-chronologic')
self.column_updated.set_widget(widget)
self.column_updated.set_visible(True)
self.column_updated.set_expand(False)
/branches/BR-0.4/basico/widgets/wdg_visor_toolbar.py
16,24 → 16,26
from basico.core.mod_wdg import BasicoWidget
 
 
class VisorToolbar(BasicoWidget, Gtk.HBox):
class VisorToolbar(BasicoWidget, Gtk.VBox):
def __init__(self, app):
super().__init__(app, __class__.__name__)
Gtk.Box.__init__(self)
self.get_services()
self.set_homogeneous(False)
self.tool_bar = Gtk.Toolbar()
self.pack_start(self.tool_bar, False, True, 0)
self.tool_bar.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
self.tool_bar.set_property('margin-bottom', 0)
 
# Import button
# Toolbar
self.toolbar = Gtk.Toolbar()
self.pack_start(self.toolbar, False, True, 0)
self.toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
self.toolbar.set_property('margin-bottom', 0)
 
## Import button
tool = Gtk.ToolButton()
tool.set_icon_name('basico-add')
tool.set_tooltip_markup('<b>Download or find SAP Notes (if they were already downloaded)</b>')
popover = self.srvgui.add_widget('gtk_popover_toolbutton_import', Gtk.Popover.new(tool))
tool.connect('clicked', self.srvclb.gui_show_popover, popover)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
## Popover body
box = Gtk.VBox(spacing = 0, orientation="vertical")
48,19 → 50,19
tool.set_tooltip_markup('<b>Create a new annotation (not linked to any SAP Note)</b>')
popover = self.srvgui.add_widget('gtk_popover_annotation', Gtk.Popover.new(tool))
tool.connect('clicked', self.clb_create_annotation)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Attachment button
## Attachment button
tool = Gtk.ToolButton()
tool.set_icon_name('basico-attachment')
tool.set_tooltip_markup('<b>Attach any document to this annotation</b>')
popover = self.srvgui.add_widget('gtk_button_main_toolbar_attachment', Gtk.Popover.new(tool))
tool.connect('clicked', self.srvclb.gui_attachment_add)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Filter entry
## Filter entry
 
## Completion
### Completion
self.completion = self.srvgui.add_widget('gtk_entrycompletion_visor', Gtk.EntryCompletion())
self.completion.set_match_func(self.completion_match_func)
self.completion_model = Gtk.ListStore(str)
98,15 → 100,15
tool.add(hbox)
tool.set_tooltip_markup('<b>Click left icon to search in all the annotations or just type to filter the current view</b>')
tool.set_expand(True)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Separator
## Separator
tool = Gtk.SeparatorToolItem.new()
tool.set_draw(False)
tool.set_expand(True)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Button Total SAP Notes
## Button Total SAP Notes
tool = Gtk.ToolItem()
tool.set_expand(False)
label = self.srvgui.add_widget('gtk_label_total_notes', Gtk.Label())
113,15 → 115,25
hbox = Gtk.HBox()
hbox.pack_start(label, False, False, 0)
tool.add(hbox)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Visor Stack Switcher
## Separator
tool = Gtk.SeparatorToolItem.new()
tool.set_draw(False)
tool.set_expand(False)
self.toolbar.insert(tool, -1)
 
## Visor Stack Switcher
tool = Gtk.ToolItem()
tool.set_expand(False)
hbox = self.srvgui.add_widget('gtk_hbox_toolbar_stack_switcher', Gtk.HBox())
tool.add(hbox)
self.tool_bar.insert(tool, -1)
self.toolbar.insert(tool, -1)
 
# Separator
# ~ separator = Gtk.Separator(orientation = Gtk.Orientation.HORIZONTAL)
# ~ self.pack_start(separator, False, False, 3)
 
# Fullscreen toggle button
# ~ tool = Gtk.ToolItem()
# ~ tool.set_expand(False)
134,12 → 146,12
# ~ button.add(box)
# ~ tool.add(button)
# ~ tool.set_tooltip_markup('<b>Fullscreen/Window mode</b>')
# ~ self.tool_bar.insert(tool, -1)
# ~ self.toolbar.insert(tool, -1)
 
# Toolbar initial settings
self.set_visible(True)
self.set_no_show_all(False)
self.tool_bar.set_hexpand(True)
self.toolbar.set_hexpand(True)
 
 
def get_services(self):