Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 407 → Rev 406

/branches/BR-0.4/basico/widgets/wdg_visor_sapnotes.py
9,7 → 9,7
 
import os
from os.path import sep as SEP
from html import escape
from cgi import escape
import glob
import json
from enum import IntEnum
781,8 → 781,7
 
def get_selected_sapnotes(model, path, itr):
sid = model.get(itr, COLUMN.SID)[0]
self.log.debug(sid)
if len(escape(sid)) > 0:
if len(aid) == 0:
selected.append(str(sid))
 
sorted_model.foreach(get_selected_sapnotes)
/branches/BR-0.4/basico/widgets/wdg_annot.py
15,7 → 15,6
gi.require_version('Pango', '1.0')
gi.require_version('GdkPixbuf', '2.0')
gi.require_version('GtkSource', '3.0')
from gi.repository import Gdk
from gi.repository import Gtk
from gi.repository import Pango
from gi.repository.GdkPixbuf import Pixbuf
228,12 → 227,10
 
# Arrow UP
tool = self.srvgui.add_widget('gtk_button_annotation_toolbar_previous_item', Gtk.ToolButton())
# ~ icon = self.srvicm.get_new_image_icon('basico-arrow-up')
# ~ tool.add(icon)
# ~ tool.set_expand(False)
# ~ tool.set_visible_horizontal(True)
# ~ tool.set_visible_vertical(True)
# ~ tool.set_is_important(True)
tool.set_expand(False)
tool.set_visible_horizontal(True)
tool.set_visible_vertical(True)
tool.set_is_important(True)
tool.set_tooltip_markup('<b>Previous annotation</b>')
tool.set_icon_name('basico-arrow-up')
tool.connect('clicked', self.srvclb.gui_annotation_previous_row)
241,20 → 238,18
 
# Arrow DOWN
tool = self.srvgui.add_widget('gtk_button_annotation_toolbar_next_item', Gtk.ToolButton())
# ~ icon = self.srvicm.get_new_image_icon('basico-arrow-down')
# ~ tool.add(icon)
# ~ tool.set_visible_vertical(True)
# ~ tool.set_visible_horizontal(True)
# ~ tool.set_is_important(True)
# ~ tool.set_expand(False)
tool.set_visible_vertical(True)
tool.set_visible_horizontal(True)
tool.set_is_important(True)
tool.set_expand(False)
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.toolbar.insert(tool, -1)
 
# ~ # Separator
# ~ tool = self.srvuif.get_toolbar_separator(False, False)
# ~ self.toolbar.insert(tool, -1)
# Separator
tool = self.srvuif.get_toolbar_separator(False, False)
self.toolbar.insert(tool, -1)
 
# Toolbar initial settings
self.set_visible(True)
315,15 → 310,8
self.__setup_header()
self.__setup_body()
self.__setup_footer()
self.connect("key-press-event",self.on_key_press_event)
 
 
def on_key_press_event(self, widget, event):
if Gdk.keyval_name(event.keyval) == 'Escape':
self.srvclb.action_annotation_cancel()
self.log.debug(" Key val, name: %s - %s", event.keyval, Gdk.keyval_name(event.keyval))
 
 
def __setup_header(self):
# Annotation Header
container = self.srvgui.get_widget('gtk_vbox_annotation_container')
388,7 → 376,6
self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', False)
self.srvuif.set_widget_visibility('gtk_entry_annotation_scope', False)
self.srvuif.set_widget_visibility('gtk_switch_annotation_template', False)
self.srvuif.set_widget_visibility('annotation_footer_buttons', False)
self.srvuif.set_widget_visibility('gtk_label_annotation_sid', True)
elif stack_name == 'properties':
self.srvuif.set_widget_visibility('gtk_combobox_annotation_category', False)
397,7 → 384,6
self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', False)
self.srvuif.set_widget_visibility('gtk_entry_annotation_scope', False)
self.srvuif.set_widget_visibility('gtk_switch_annotation_template', False)
self.srvuif.set_widget_visibility('annotation_footer_buttons', False)
self.srvuif.set_widget_visibility('gtk_label_annotation_sid', False)
elif stack_name == 'editor':
self.srvuif.set_widget_visibility('gtk_combobox_annotation_category', True)
406,7 → 392,6
self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', True)
self.srvuif.set_widget_visibility('gtk_entry_annotation_scope', True)
self.srvuif.set_widget_visibility('gtk_switch_annotation_template', True)
self.srvuif.set_widget_visibility('annotation_footer_buttons', True)
self.srvuif.set_widget_visibility('gtk_label_annotation_sid', False)
 
 
581,7 → 566,6
def __setup_footer(self):
# Buttons Accept/Cancel
hbox = Gtk.HBox()
self.srvgui.add_widget('annotation_footer_buttons', hbox)
accept = self.srvgui.add_widget('gtk_button_accept_annotation', Gtk.Button('Accept'))
accept.connect('clicked', self.srvclb.action_annotation_accept, self.sid)
accept.set_property('always-show-image', True)
/branches/BR-0.4/basico/services/srv_callbacks.py
44,6 → 44,8
 
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 visible_stack_name is None:
return
 
50,6 → 52,7
if visible_stack_name == 'visor-sapnotes':
self.srvuif.set_widget_visibility('gtk_label_total_notes', True)
visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
visible_filter = visor_sapnotes.get_visible_filter()
visor_sapnotes.update_total_sapnotes_count()
elif visible_stack_name == 'visor-annotations':
self.srvuif.set_widget_visibility('gtk_label_total_notes', True)
489,7 → 492,7
time.sleep(0.2)
 
dlbuffer.set_text('')
# ~ popover = self.srvgui.get_widget('gtk_popover_toolbutton_import')
popover = self.srvgui.get_widget('gtk_popover_toolbutton_import')
# ~ self.gui_hide_popover(popover)
if len(bag) > 0:
webdriver.close(driver)
/branches/BR-0.4/basico/services/srv_gui.py
8,9 → 8,7
"""
 
import gi
gi.require_version('Gdk', '3.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Gdk
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import GObject
49,7 → 47,6
self.my_app_settings = "Primary application instance."
self.window = self.srvgui.add_widget('gtk_app_window_main', GtkAppWindow(self))
self.window.connect("delete-event", self.srvgui.quit)
self.window.connect("key-press-event",self.on_key_press_event)
self.log.debug("New Basico instance created")
self.srvuif.statusbar_msg("Welcome to Basico", True)
else:
58,12 → 55,6
splash.hide()
 
 
def on_key_press_event(self, widget, event):
if Gdk.keyval_name(event.keyval) == 'Escape':
self.srvclb.action_annotation_cancel()
self.log.debug(" Key val, name: %s - %s", event.keyval, Gdk.keyval_name(event.keyval))
 
 
def get_services(self):
"""
Missing method docstring (missing-docstring)
112,6 → 103,7
GObject.threads_init()
self.uiapp = UIApp(self.app)
self.log.debug("Setting up GUI")
# ~ window = self.get_window()
# ~ splash = self.app.get_splash()
# ~ splash.show()
self.uiapp.run()