Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 108 → Rev 109

/branches/BR-0.3/basico/sapnoteview.py
11,6 → 11,7
 
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Gio
from gi.repository.GdkPixbuf import Pixbuf
from gi.repository import Pango
from datetime import datetime
1759,6 → 1760,7
self.set_enable_search(True)
self.set_hover_selection(False)
self.set_grid_lines(Gtk.TreeViewGridLines.NONE)
self.set_level_indentation(0)
#~ self.set_search_entry(self.gui.get_widget('stySearchInfo'))
#~ self.set_search_column(3)
 
2056,6 → 2058,7
self.settings = self.app.get_service('Settings')
self.plugins = self.app.get_service('Plugins')
self.db = self.app.get_service('DB')
self.uif = self.app.get_service("UIF")
 
 
 
2109,6 → 2112,7
label.set_markup('<big>❤</big>')
bookmark = Gtk.ToggleButton()
bookmark.set_relief(Gtk.ReliefStyle.NONE)
bookmark.get_style_context().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION)
bookmark.add(label)
row.pack_start(bookmark, False, False, 6)
 
2127,6 → 2131,7
button.set_relief(Gtk.ReliefStyle.NONE)
button.set_alignment (0.0, 0.0)
button.set_hexpand(False)
button.get_style_context().add_class(Gtk.STYLE_CLASS_SUGGESTED_ACTION)
label = Gtk.Label()
label.set_markup('<big>❓</big>')
button.add(label)
2137,6 → 2142,7
button.set_relief(Gtk.ReliefStyle.NONE)
button.set_alignment (0.0, 0.0)
button.set_hexpand(False)
button.get_style_context().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION)
label = Gtk.Label()
label.set_markup('<big>🔗</big>')
button.add(label)
2152,6 → 2158,21
button.add(label)
button.connect('clicked', self.show_infobox, infobox)
row.pack_start(button, False, False, 6)
 
app = self.gui.get_app()
actions_menu = Gio.Menu()
actions_menu.append_item(self.uif.create_item('Import Basico Package', 'app.actions-import-basico', 'document-open'))
app.add_action(self.uif.create_action("actions-import-basico"))
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"))
actions_menu.append_item(self.uif.create_item('Import SAP Notes from SAP Launchpad', 'app.actions-import-launchpad', 'download'))
app.add_action(self.uif.create_action("actions-import-launchpad"))
btnactions = Gtk.MenuButton()
btnactions.set_always_show_image(True)
btnactions.set_property("use-popover", True)
btnactions.set_menu_model(actions_menu)
row.pack_start(btnactions, False, False, 6)
 
container.pack_start(row, False, False, 0)
container.pack_start(infobox, False, False, 0)
container.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse("White"))
/branches/BR-0.3/basico/window.py
549,7 → 549,6
self.log.debug("Pane position: %s" % position)
 
 
 
def __completion_func(self, completion, key, iter):
model = completion.get_model()
text = model.get_value(iter, 0)
/branches/BR-0.3/basico/data/ui/basico.ui
1,5 → 1,5
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0
<!-- Generated with glade 3.18.3
 
Copyright (C) 2016-2017
 
37,6 → 37,7
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">False</property>
<property name="show_border">False</property>
<child>
<object class="GtkBox" id="DashboardViewer3">
<property name="visible">True</property>
142,212 → 143,173
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="boxMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="vexpand">False</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<object class="GtkBox" id="box10">
<object class="GtkMenuButton" id="mnuBtnViews">
<property name="width_request">250</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="focus_on_click">False</property>
<child>
<object class="GtkBox" id="box13">
<object class="GtkBox" id="box29">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<property name="spacing">6</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box26">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkMenuButton" id="mnuBtnWorkPlaceUtils">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="focus_on_click">False</property>
<property name="use_popover">False</property>
<child>
<object class="GtkBox" id="box27">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkLabel" id="lblSelectedNotes1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<object class="GtkImage" id="imgViewCurrent">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="stock">gtk-select-color</property>
<property name="icon_size">1</property>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box15">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label23">
<object class="GtkLabel" id="lblViewCurrent">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;small&gt; Select All / None &lt;/small&gt;</property>
<property name="label" translatable="yes">&lt;b&gt;View&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="schSelectNotesAllNone">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="tgbShowMenuView">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="focus_on_click">False</property>
<property name="always_show_image">True</property>
<property name="active">True</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-select-color</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box30">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkComboBox" id="cmbSearchInfo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">False</property>
<property name="focus_on_click">False</property>
<property name="popup_fixed_width">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box12">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;small&gt; Expand / Collapse &lt;/small&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="schExpandCollapse">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<object class="GtkCheckButton" id="chkWPFilterCurView">
<property name="label" translatable="yes">Current view</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box9">
<object class="GtkSearchEntry" id="stySearchInfo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="truncate_multiline">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="mnuBtnActions">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="focus_on_click">False</property>
<property name="use_popover">False</property>
<child>
<object class="GtkBox" id="box20">
<object class="GtkBox" id="box28">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<child>
<placeholder/>
<object class="GtkLabel" id="lblSelectedNotes">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box21">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
<property name="position">3</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox" id="box22">
<property name="width_request">100</property>
<object class="GtkLabel" id="lblWPStats">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
<property name="label" translatable="yes">Stats</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">6</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
354,7 → 316,7
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">2</property>
</packing>
</child>
</object>
365,7 → 327,7
</packing>
</child>
<child>
<object class="GtkPaned" id="paned1">
<object class="GtkPaned" id="panWorkplace">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="position">250</property>
372,7 → 334,7
<property name="position_set">True</property>
<property name="wide_handle">True</property>
<child>
<object class="GtkBox" id="box31">
<object class="GtkBox" id="boxMenuView">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_right">6</property>
379,45 → 341,12
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkMenuButton" id="mnuBtnViews">
<property name="width_request">250</property>
<object class="GtkBox" id="box32">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="focus_on_click">False</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="box29">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage" id="imgViewCurrent">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="stock">gtk-select-color</property>
<property name="icon_size">1</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lblViewCurrent">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;View&lt;/b&gt;</property>
<property name="use_markup">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<placeholder/>
</child>
</object>
<packing>
470,99 → 399,13
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box30">
<object class="GtkBox" id="box33">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBox" id="cmbSearchInfo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">False</property>
<property name="focus_on_click">False</property>
<property name="popup_fixed_width">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
<placeholder/>
</child>
<child>
<object class="GtkCheckButton" id="chkWPFilterCurView">
<property name="label" translatable="yes">Current view</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSearchEntry" id="stySearchInfo">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="activates_default">True</property>
<property name="truncate_multiline">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="mnuBtnActions">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="focus_on_click">False</property>
<property name="use_popover">False</property>
<child>
<object class="GtkBox" id="box28">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkLabel" id="lblSelectedNotes">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="lblWPStats">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Stats</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
1207,23 → 1050,215
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkImage" id="imgMnuBtnImport">
<object class="GtkBox" id="box10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box26">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkMenuButton" id="mnuBtnWorkPlaceUtils">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="focus_on_click">False</property>
<property name="use_popover">False</property>
<child>
<object class="GtkBox" id="box27">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkLabel" id="lblSelectedNotes1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_markup">True</property>
<property name="justify">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box15">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label23">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;small&gt; Select All / None &lt;/small&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="schSelectNotesAllNone">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box12">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;small&gt; Expand / Collapse &lt;/small&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="schExpandCollapse">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkBox" id="box20">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box21">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox" id="box22">
<property name="width_request">100</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">6</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
1382,7 → 1417,11
<property name="relief">none</property>
<property name="focus_on_click">False</property>
<child>
<placeholder/>
<object class="GtkImage" id="imgMnuBtnImport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
</object>
</child>
</object>
<packing>
/branches/BR-0.3/basico/workplace.py
25,6 → 25,9
 
 
def setup_widgets(self):
# Toolbar
tgbshowmenu = self.gui.get_widget('tgbShowMenuView')
tgbshowmenu.connect('toggled', self.show_menu_view)
# Menu Views
self.setup_menu_views()
 
46,6 → 49,14
self.cb = self.app.get_service('Callbacks')
 
 
def show_menu_view(self, *args):
paned = self.gui.get_widget('boxMenuView')
button = self.gui.get_widget('tgbShowMenuView')
if button.get_active():
paned.show_all()
else:
paned.hide()
 
def setup_menu_views(self):
app = self.gui.get_app()