Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 140 → Rev 141

/branches/BR-0.3/basico/data/ui/basico.ui
File deleted
/branches/BR-0.3/basico/about.py
34,15 → 34,13
# Set logo
label = Gtk.Label()
label.set_markup("🙇")
label.modify_font(Pango.FontDescription('Arial 92'))
label.set_selectable(True)
label.modify_font(Pango.FontDescription('Monospace 92'))
widget.pack_start(label, False, False, 6)
 
# Set App name
label = Gtk.Label()
label.set_markup("<b>%s %s</b>" % (APP['short'].capitalize(), APP['version']))
label.modify_font(Pango.FontDescription('Arial 48'))
label.set_selectable(True)
label.modify_font(Pango.FontDescription('Monospace 48'))
widget.pack_start(label, False, False, 6)
 
# Set App desc
49,7 → 47,6
label = Gtk.Label()
label.set_markup("%s" % APP['name'])
label.modify_font(Pango.FontDescription('Arial 24'))
label.set_selectable(True)
widget.pack_start(label, False, False, 6)
 
# Set App license
58,7 → 55,6
label.modify_font(Pango.FontDescription('Monospace 10'))
label.set_justify(Gtk.Justification.CENTER)
label.set_line_wrap(True)
label.set_selectable(True)
widget.pack_start(label, False, False, 6)
 
# Set Link button
71,10 → 67,9
label.modify_font(Pango.FontDescription('Monospace 10'))
label.set_justify(Gtk.Justification.CENTER)
label.set_line_wrap(True)
label.set_selectable(True)
widget.pack_start(label, False, False, 6)
 
# Set Copyright holders
# Authors
label = Gtk.Label()
label.set_markup("\n%s" % escape(APP['authors'][0]))
label.modify_font(Pango.FontDescription('Monospace 10'))
/branches/BR-0.3/basico/basico.py
83,7 → 83,7
raise
 
def debug(self, message):
self.log.debug("%15s | %s" % (self.__class__.__name__, message))
self.log.debug("%18s | %s" % (self.__class__.__name__, message))
 
def setup(self):
"""
/branches/BR-0.3/basico/callbacks.py
121,7 → 121,8
titlebar = self.gui.get_widget("lbltitlebar")
if capitalize:
title = title.capitalize()
titlebar.set_markup("<big><b>%s</b></big>" % title)
titlebar.set_markup("<big><b>%15s</b></big>" % title)
titlebar.set_hexpand(True)
 
 
#~ def show_dashboard(self, *args):
346,8 → 347,12
 
 
def set_search_term(self, term):
searchentry = self.gui.get_widget("stySearchInfo")
searchentry.set_text(term)
self.debug("Search term: %s" % term)
try:
searchentry = self.gui.get_widget("stySearchInfo")
searchentry.set_text(term)
except:
pass
 
 
def search_notes(self, *args):
473,7 → 478,7
db = self.get_service('DB')
driver = self.get_service('Driver')
 
notebook = self.gui.get_widget('notebook')
#~ notebook = self.gui.get_widget('notebook')
winroot = self.gui.get_widget('mainwindow')
sapnotes = []
bag = set()
511,7 → 516,7
db.build_stats()
 
self.debug("Task completed.")
notebook.set_current_page(0)
#~ notebook.set_current_page(0)
dialog = Gtk.MessageDialog(winroot, 0, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, "Task completed")
msgrc = ""
ko = 0
540,8 → 545,6
self.refresh_and_clear_view()
sapnoteview.populate(dlbag)
sapnoteview.expand_all()
boxMenu = self.gui.get_widget('boxMenu')
boxMenu.show_all()
 
 
def stop_dl_notes(self, *args):
/branches/BR-0.3/basico/gui.py
81,6 → 81,7
parent.add(widget)
except Exception as error:
self.print_traceback()
raise
 
widget.show_all()
 
/branches/BR-0.3/basico/iconmanager.py
64,6 → 64,14
return icon
 
 
def get_new_image_icon(self, name, width=36, height=36):
pixbuf = self.get_pixbuf_icon(name, width, height)
icon = Gtk.Image()
icon.set_from_pixbuf(pixbuf)
 
return icon
 
 
def get_image_icon(self, name, width=36, height=36):
key = "%s-%d-%d" % (name, width, height)
try:
/branches/BR-0.3/basico/importdlg.py
0,0 → 1,197
#!/usr/bin/python
# -*- coding: utf-8 -*-
# File: sapnoteview.py
# Author: Tomás Vírseda
# License: GPL v3
# Description: Workplace service
 
import json
 
import gi
gi.require_version('Gdk', '3.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Pango
 
from .service import Service
 
 
class LaunchpadDialog(Gtk.VBox, Service):
def __init__(self, app):
Gtk.VBox.__init__(self, app)
self.app = app
 
self.get_services()
self.setup()
 
 
def setup(self):
menuview = self.gui.get_widget('tgbShowMenuView')
menuview.set_active(False)
self.set_property('margin', 6)
self.set_spacing(6)
 
box = Gtk.VBox()
box.set_vexpand(True)
self.pack_end(box, True, True, 0)
 
# Label
title = Gtk.Label()
title.set_markup('<big><b>Import from Launchpad</b></big>')
title.modify_font(Pango.FontDescription('Arial 24'))
box.pack_start(title, False, True, 6)
 
# Instructions
label = Gtk.Label()
message = "Write down the list of SAP Notes that you want to download\nThey can be separated by newline or by commas"
label.set_markup('<big>%s</big>' % message)
label.set_justify(Gtk.Justification.CENTER)
label.modify_font(Pango.FontDescription('Arial 12'))
box.pack_start(label, False, True, 6)
 
scrolledwindow = Gtk.ScrolledWindow()
scrolledwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
scrolledwindow.set_shadow_type(Gtk.ShadowType.IN)
scrolledwindow.set_hexpand(True)
scrolledwindow.set_vexpand(True)
textview = Gtk.TextView()
self.textbuffer = textview.get_buffer()
self.textbuffer.set_text("")
scrolledwindow.add(textview)
box.pack_start(scrolledwindow, True, True, 0)
 
 
buttonbox = Gtk.ButtonBox() #.new(Gtk.Orientation.HORIZONTAL)
buttonbox.set_hexpand(False)
buttonbox.set_vexpand(False)
buttonbox.set_layout(Gtk.ButtonBoxStyle.EDGE )
 
button = Gtk.Button('Cancel')
button.set_can_focus(False)
icon = self.im.get_new_image_icon('gtk-cancel', 24, 24)
button.set_image(icon)
button.set_always_show_image(True)
button.set_relief(Gtk.ReliefStyle.NONE)
button.connect("clicked", self.cancel)
buttonbox.pack_start(button, False, False, 0)
 
button = Gtk.Button('Accept')
button.set_can_focus(False)
icon = self.im.get_new_image_icon('gtk-apply', 24, 24)
button.set_image(icon)
button.set_always_show_image(True)
button.set_relief(Gtk.ReliefStyle.NONE)
button.connect("clicked", self.accept)
buttonbox.pack_start(button, True, True, 0)
box.pack_start(buttonbox, False, True, 6)
 
self.show_all()
 
 
def get_services(self):
self.im = self.app.get_service('IM')
self.gui = self.app.get_service('GUI')
self.cb = self.app.get_service('Callbacks')
 
 
def accept(self, *args):
lines = self.get_buffer()
self.cb.import_notes_from_sapnet(lines)
 
 
def cancel(self, *args):
self.cb.show_about()
 
 
def get_buffer(self):
istart, iend = self.textbuffer.get_bounds()
return self.textbuffer.get_text(istart, iend, False)
 
 
 
class FileChooserDialog(Gtk.VBox, Service):
def __init__(self, app):
Gtk.VBox.__init__(self, app)
self.app = app
self.log = self.app.log
self.get_services()
self.setup()
 
 
def get_services(self):
self.im = self.app.get_service('IM')
self.gui = self.app.get_service('GUI')
self.db = self.app.get_service('DB')
 
 
def setup(self):
self.set_property('margin', 6)
self.set_spacing(6)
 
box = Gtk.VBox()
self.fcw = Gtk.FileChooserWidget()
 
# Add filters
#~ filter_any = Gtk.FileFilter()
#~ filter_any.set_name("Any file")
#~ filter_any.add_pattern("*")
#~ fcw.add_filter(filter_any)
filter_json = Gtk.FileFilter()
filter_json.set_name("JSON files")
filter_json.add_mime_type("application/xml")
filter_json.add_mime_type("application/json")
filter_json.add_mime_type("text/json")
filter_json.add_mime_type("application/x-javascript")
filter_json.add_mime_type("text/x-javascript")
filter_json.add_mime_type("application/x-json")
filter_json.add_mime_type("text/x-json")
self.fcw.add_filter(filter_json)
#~ self.debug(dir(fcw))
box.pack_start(self.fcw, True, True, 0)
 
buttonbox = Gtk.ButtonBox() #.new(Gtk.Orientation.HORIZONTAL)
buttonbox.set_hexpand(False)
buttonbox.set_vexpand(False)
buttonbox.set_layout(Gtk.ButtonBoxStyle.EDGE )
 
button = Gtk.Button('Cancel')
button.set_can_focus(False)
icon = self.im.get_new_image_icon('gtk-cancel', 24, 24)
button.set_image(icon)
button.set_always_show_image(True)
button.set_relief(Gtk.ReliefStyle.NONE)
button.connect("clicked", self.cancel)
buttonbox.pack_start(button, False, False, 0)
 
button = Gtk.Button('Accept')
button.set_can_focus(False)
icon = self.im.get_new_image_icon('gtk-apply', 24, 24)
button.set_image(icon)
button.set_always_show_image(True)
button.set_relief(Gtk.ReliefStyle.NONE)
button.connect("clicked", self.accept)
buttonbox.pack_start(button, True, True, 0)
box.pack_start(buttonbox, False, True, 6)
 
self.add(box)
 
 
def accept(self, *args):
filename = self.fcw.get_filename()
self.debug(filename)
 
with open(filename, 'r') as fp:
try:
bag = json.load(fp)
self.db.import_sapnotes(bag)
self.debug ("Imported %d notes from %s" % (len(bag), filename))
visor = self.gui.get_widget('visor')
visor.populate(bag)
self.db.save_notes()
except:
self.debug("Error importing JSON contents")
 
 
def cancel(self, *args):
self.cb.show_about()
/branches/BR-0.3/basico/log.py
18,7 → 18,7
 
## Redirect log to stdout
#~ formatter = logging.Formatter("%(levelname)7s | %(asctime)s | %(message)s")
formatter = logging.Formatter("%(levelname)7s | %(lineno)3d | %(asctime)s | %(message)s")
formatter = logging.Formatter("%(levelname)7s | %(asctime)s | %(message)s")
ch = logging.StreamHandler() # Create console handler and set level to debug
ch.setLevel(logging.DEBUG) # Set logging devel
ch.setFormatter(formatter) # add formatter to console handler
/branches/BR-0.3/basico/sap.py
163,6 → 163,7
try:
driver = self.get_service('Driver')
ODATA_NOTE_URL = self.settings.get('SAP', 'ODATA_NOTE_URL')
self.log.debug("Downloading: %s" % ODATA_NOTE_URL % sapnote)
browser = driver.load(ODATA_NOTE_URL % sapnote)
time.sleep(10)
content = browser.page_source
/branches/BR-0.3/basico/sapnoteview.py
21,6 → 21,7
from datetime import datetime
from dateutil import parser as dateparser
 
from .service import Service
 
class Column(IntEnum):
rowtype = 0
36,9 → 37,10
released = 10
 
 
class SAPNoteView(Gtk.TreeView):
class SAPNoteView(Gtk.TreeView, Service):
numOfInstances = 0
def __init__(self, app):
Gtk.TreeView.__init__(self)
SAPNoteView.numOfInstances += 1
self.app = app
self.log = self.app.log
228,8 → 230,8
self.prepare()
self.show_all()
 
def debug(self, message):
self.log.debug("%15s | %s" % (self.__class__.__name__, message))
#~ def debug(self, message):
#~ self.log.debug("%15s | %s" % (self.__class__.__name__, message))
 
 
def getNumInstances(self):
/branches/BR-0.3/basico/sapnoteviewmenu.py
61,7 → 61,7
try:
row = model[treeiters][0]
row_type, cid = row.split('@')
self.app.debug("%s (%s)" % (row_type, cid))
#~ self.app.debug("%s (%s)" % (row_type, cid))
matches = self.db.get_notes_by_node(row_type, cid)
visor.populate(matches, cid)
except:
119,7 → 119,7
# Change icon
if view is None:
view ='chronologic'
self.debug ("View: %s - Type (%s)" % (view, type(view)))
#~ self.debug ("View: %s - Type (%s)" % (view, type(view)))
iconview = self.gui.get_widget('imgViewCurrent')
icon = self.im.get_pixbuf_icon(view, 16, 16)
iconview.set_from_pixbuf(icon)
128,8 → 128,10
 
# Change label
viewlabel = self.gui.get_widget('lblViewCurrent')
name = "<b>%-s</b>" % view.capitalize()
name = "<b>%s</b>" % view.capitalize()
viewlabel.set_markup(name)
viewlabel.set_xalign(0.0)
viewlabel.set_justify(Gtk.Justification.LEFT)
self.populate([])
 
 
/branches/BR-0.3/basico/sapnoteviewrow.py
21,11 → 21,14
from datetime import datetime
from dateutil import parser as dateparser
 
from .service import Service
 
class SAPNoteViewRow(Gtk.HBox):
 
class SAPNoteViewRow(Gtk.HBox, Service):
def __init__(self, app, sid):
Gtk.HBox.__init__(self)
self.app = app
self.log = self.app.log
self.get_services()
self.setup_row(sid)
 
62,12 → 65,13
 
 
def bookmark_switch(self, *args):
label = self.bookmark.get_children()[0]
if self.bookmark.get_active():
self.bookmark.set_label('🖤️')
self.cb.bookmark([self.sid])
label.set_markup('<span color="black">✔</span>️')
else:
self.bookmark.set_label('♡')
self.cb.unbookmark([self.sid])
label.set_markup('<span color="lightgray">✔</span>️')
 
 
def dummy(self, *args):
81,7 → 85,7
hboxup = Gtk.HBox()
hboxdown = Gtk.HBox()
 
#~ self.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("White"))
self.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("White Smoke"))
self.set_hexpand(True)
hboxup.set_hexpand(True)
hboxdown.set_hexpand(True)
96,19 → 100,16
# BOOKMARK BUTTON
self.bookmark = Gtk.ToggleButton()
self.bookmark.set_hexpand(False)
self.bookmark.set_mode(False)
self.bookmark.set_relief(Gtk.ReliefStyle.NONE)
self.bookmark.set_active(sapnote['bookmark'])
label = Gtk.Label()
label.modify_font(Pango.FontDescription('Monospace 14'))
self.bookmark.add(label)
if self.bookmark.get_active():
label = Gtk.Label()
label.set_markup('<b>🖤</b>')
label.modify_font(Pango.FontDescription('Monospace 14'))
self.bookmark.add(label)
#~ self.bookmark.set_label('🖤')
label.set_markup('<span color="black">✔</span>️')
else:
label = Gtk.Label()
label.set_markup('<b>♡</b>')
label.modify_font(Pango.FontDescription('Monospace 14'))
self.bookmark.add(label)
label.set_markup('<span color="lightgray">✔</span>️')
self.bookmark.connect('toggled', self.bookmark_switch)
hboxup.pack_start(self.bookmark, False, False, 6)
 
159,7 → 160,7
model = Gtk.ListStore(str, str, str)
#~ ## key
renderer = Gtk.CellRendererText()
renderer.set_property('background', 'Lemon Chiffon')
#~ renderer.set_property('background', 'Lemon Chiffon')
column = Gtk.TreeViewColumn('Id', renderer, text=0)
column.set_visible(False)
column.set_clickable(False)
168,18 → 169,18
 
# Property
renderer = Gtk.CellRendererText()
renderer.set_property('background', 'Light Steel Blue')
#~ renderer.set_property('background', 'Light Steel Blue')
renderer.set_alignment(1.0, 0.5)
column = Gtk.TreeViewColumn('Property', renderer, markup=1)
column.set_visible(True)
column.set_expand(False)
column.set_clickable(False)
column.set_clickable(True)
#~ column.set_sort_indicator(True)
propview.append_column(column)
 
# Value
renderer = Gtk.CellRendererText()
renderer.set_property('background', 'White Smoke')
#~ renderer.set_property('background', 'White Smoke')
renderer.set_alignment(0.0, 0.5)
column = Gtk.TreeViewColumn('Value', renderer, markup=2)
column.set_visible(True)
190,9 → 191,9
propview.show_all()
 
propview.set_headers_visible(True)
propview.set_enable_search(False)
propview.set_grid_lines(Gtk.TreeViewGridLines.HORIZONTAL)
#~ propview.set_search_column(2)
propview.set_enable_search(True)
propview.set_grid_lines(Gtk.TreeViewGridLines.BOTH)
propview.set_search_column(2)
#~ trvprops.connect('row-activated', self.double_click)
selection = propview.get_selection()
selection.set_mode(Gtk.SelectionMode.SINGLE)
/branches/BR-0.3/basico/sapnoteviewvisor.py
20,13 → 20,16
from dateutil import parser as dateparser
 
from .about import About
from .service import Service
from .sapnoteviewrow import SAPNoteViewRow
 
 
class SAPNoteViewVisor(Gtk.Box):
class SAPNoteViewVisor(Gtk.Box, Service):
def __init__(self, app):
Gtk.Box.__init__(self)
Gtk.Box.__init__(self, app)
self.app = app
self.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("White Smoke"))
self.modify_fg(Gtk.StateType.NORMAL, Gdk.color_parse("Brown"))
self.log = self.app.log
self.get_services()
self.toggled = 0
48,19 → 51,6
self.uif = self.app.get_service("UIF")
 
 
def get_welcome_widget(self):
widget = Gtk.VBox()
widget.set_hexpand(True)
label = Gtk.Label()
label.set_markup("<span size='60000'><b>Welcome to Basico</b></span>")
widget.pack_start(label, True, True, 6)
label = Gtk.Label()
label.set_markup("<span size='100000'>🙇</span>")
widget.pack_start(label, True, True, 6)
 
return widget
 
 
def get_toggled(self):
flowbox = self.gui.get_widget('flowbox')
mnubtnactions = self.gui.get_widget('mnuBtnActions')
113,17 → 103,19
t1 = datetime.now()
 
for sid in lbag:
row = SAPNoteViewRow(self.app, sid)
flowbox.add(row)
try:
row = SAPNoteViewRow(self.app, sid)
flowbox.add(row)
except:
raise
t2 = datetime.now()
self.log.debug("cid: %s, td: %s" % (cid, str(t2 - t1)))
#~ raise
self.debug("%s rows loaded in %s" % (cid, str(t2 - t1)))
else:
try:
t1 = datetime.now()
flowbox = self.fbcache[cid]
t2 = datetime.now()
self.log.debug("cid: %s, td: %s" % (cid, str(t2 - t1)))
self.debug("%s rows loaded in %s" % (cid, str(t2 - t1)))
except:
flowbox = Gtk.FlowBox()
lbag = []
136,7 → 128,7
row = SAPNoteViewRow(self.app, sid)
flowbox.add(row)
t2 = datetime.now()
self.log.debug("cid: %s, td: %s" % (cid, str(t2 - t1)))
self.debug("%s rows loaded in %s" % (cid, str(t2 - t1)))
self.fbcache[cid] = flowbox
 
flowbox.set_valign(Gtk.Align.START)
145,9 → 137,3
self.gui.add_widget('flowbox', flowbox)
self.gui.swap_widget(self, flowbox)
self.show_all()
 
#~ With freeze
#~ DEBUG | 86 | 2018-03-25 00:56:03,257 | Basico | componentkey (BC)
#~ DEBUG | 124 | 2018-03-25 00:56:03,661 | td: 0:00:00.400956
 
 
/branches/BR-0.3/basico/service.py
108,7 → 108,7
self.debug("Section '%s' initialized in config file" % section)
 
def debug(self, message):
self.log.debug("%15s | %s" % (self.__class__.__name__, message))
self.log.debug("%18s | %s" % (self.__class__.__name__, message))
 
def get_traceback(self):
return self.app.get_traceback()
/branches/BR-0.3/basico/window.py
40,12 → 40,14
self.current_notes = {}
 
self.setup_window()
self.controller.debug("Window setup correctly")
self.setup_widgets()
self.controller.debug("Widgets setup correctly")
#~ self.setup_app()
 
self.gui.get_service('Workplace')
 
 
 
def setup_controller(self, uiapp):
self.uiapp = uiapp
self.controller = uiapp.get_controller()
84,6 → 86,8
 
# Left side titlebar
button = self.gui.add_widget('tgbShowMenuView', Gtk.ToggleButton())
#~ button.connect('toggled', self.workplace.show_menu_view)
button.set_active(False)
icon = self.im.get_image_icon('gtk-select-color')
button.add(icon)
lhbox.pack_start(button, False, False, 3)
91,6 → 95,7
menuviews = self.gui.add_widget('mnuBtnViews', Gtk.MenuButton())
hbox = Gtk.HBox()
label = self.gui.add_widget('lblViewCurrent', Gtk.Label())
label.set_xalign(0.0)
image = self.gui.add_widget('imgViewCurrent', Gtk.Image())
hbox.pack_start(image, False, False, 3)
hbox.pack_start(label, False, False, 3)
101,6 → 106,8
imgtitlebar.set_visible(False)
imgtitlebar.set_no_show_all(True)
lbltitlebar = self.gui.add_widget("lbltitlebar", Gtk.Label())
lbltitlebar.set_xalign(0.0)
lbltitlebar.set_justify(Gtk.Justification.LEFT)
lbltitlebar.set_visible(False)
lbltitlebar.set_no_show_all(True)
lhbox.pack_start(imgtitlebar, False, False, 3)
322,6 → 329,8
self.add(mainbox)
self.show_all()
 
# Finally, activate Workplace
self.controller.get_service('Workplace')
# SETUP MENUS
#~ self.setup_menus()
 
464,6 → 473,7
self.im = self.controller.get_service('IM')
self.cb = self.controller.get_service('Callbacks')
self.tasks = self.controller.get_service('Tasks')
#~ self.workplace = self.controller.get_service('Workplace')
 
 
def swap_widget(self, container, combobox):
/branches/BR-0.3/basico/workplace.py
21,33 → 21,6
from .service import Service
 
 
class DlgImportFromLaunchpad(Gtk.Dialog):
def __init__(self, parent):
Gtk.Dialog.__init__(self, "Import SAP Notes from Launchpad", parent, 0,
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OK, Gtk.ResponseType.OK))
 
self.set_default_size(600, 480)
 
scrolledwindow = Gtk.ScrolledWindow()
scrolledwindow.set_hexpand(True)
scrolledwindow.set_vexpand(True)
 
textview = Gtk.TextView()
self.textbuffer = textview.get_buffer()
self.textbuffer.set_text("")
scrolledwindow.add(textview)
 
box = self.get_content_area()
box.add(scrolledwindow)
self.show_all()
 
def get_buffer(self):
istart, iend = self.textbuffer.get_bounds()
return self.textbuffer.get_text(istart, iend, False)
 
 
 
class Workplace(Service):
def initialize(self):
'''
57,28 → 30,23
self.setup_widgets()
self.setup_menus()
 
def show_import_dialog_json(self, *args):
from .importdlg import FileChooserDialog
visor = self.gui.get_widget('visor')
self.gui.swap_widget(visor, FileChooserDialog(self.app))
 
def show_import_dialog_launchpad(self, *args):
self.debug("Import from Launchpad")
parent_window = self.gui.get_widget('mainwindow')
dialog = DlgImportFromLaunchpad(parent_window)
response = dialog.run()
from .importdlg import LaunchpadDialog
visor = self.gui.get_widget('visor')
self.gui.swap_widget(visor, LaunchpadDialog(self.app))
 
if response == Gtk.ResponseType.OK:
self.debug("The OK button was clicked")
lines = dialog.get_buffer()
self.cb.import_notes_from_sapnet(lines)
elif response == Gtk.ResponseType.CANCEL:
self.debug("The Cancel button was clicked")
 
dialog.destroy()
 
 
def setup_widgets(self):
# Toolbar
 
tgbshowmenu = self.gui.get_widget('tgbShowMenuView')
tgbshowmenu.connect('toggled', self.show_menu_view)
tgbshowmenu.set_active(False)
self.lblSelectedNotes = self.gui.get_widget('lblSelectedNotes')
 
# Views
112,9 → 80,6
def setup_menu_views(self):
app = self.gui.get_app()
 
# View label
#~ self.gui.add_widget('lblViewCurrent')
 
## Views Menu
views_menu = self.gui.add_widget('mnuviews', Gio.Menu())
 
263,7 → 228,7
 
# Import from JSON file
actions_menu.append_item(self.uif.create_item('Import JSON file', 'app.actions-import-json', 'document-open'))
app.add_action(self.uif.create_action("actions-import-json"))
app.add_action(self.uif.create_action("actions-import-json", self.show_import_dialog_json))
 
#~ Import from SAP Launchpad
actions_menu.append_item(self.uif.create_item('Import SAP Notes from SAP Launchpad', 'app.actions-import-launchpad', 'download'))