Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 129 → Rev 130

/branches/BR-0.3/basico/callbacks.py
506,9 → 506,10
def import_notes_from_file(self):
db = self.get_service('DB')
notebook = self.gui.get_widget('notebook')
rootwin = self.gui.get_widget('mainbox')
#~ rootwin = self.gui.get_widget('mainbox')
#~ self.log.debug (type(rootwin))
 
dialog = Gtk.FileChooserDialog("Select Basico JSON file", rootwin,
dialog = Gtk.FileChooserDialog("Select Basico JSON file", None,
Gtk.FileChooserAction.OPEN,
(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_SAVE, Gtk.ResponseType.OK))
530,9 → 531,9
db.save_notes()
self.refresh_view()
switch = self.gui.get_widget('schSelectNotesAllNone')
sapnoteview.select_all_none(switch, True)
sapnoteview.select_all_none(switch, False)
sapnoteview.expand_all()
#~ sapnoteview.select_all_none(switch, True)
#~ sapnoteview.select_all_none(switch, False)
#~ sapnoteview.expand_all()
else:
self.alert.show('Import', 'Nothing imported', 'error')
self.log.debug("Nothing imported")
567,7 → 568,7
dlbag = {}
 
# FIXME: max_workers = 1 = Threads disabled
with Executor(max_workers=2) as exe:
with Executor(max_workers=1) as exe:
jobs = []
for sapnote in bag:
job = exe.submit(self.sap.fetch, sapnote)
/branches/BR-0.3/basico/data/ui/basico.ui
1,5 → 1,5
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3
<!-- Generated with glade 3.20.0
 
Copyright (C) 2016-2017
 
22,7 → 22,7
 
-->
<interface domain="basico">
<requires lib="gtk+" version="3.18"/>
<requires lib="gtk+" version="3.10"/>
<!-- interface-license-type gplv3 -->
<!-- interface-name Basico -->
<!-- interface-description Basico UI XML file -->
40,7 → 40,7
<child>
<object class="GtkNotebook" id="mainbox">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_focus">False</property>
<property name="show_tabs">False</property>
<property name="show_border">False</property>
<child>
145,273 → 145,92
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="boxMenu">
<property name="visible">True</property>
<object class="GtkBox" id="boxSearch">
<property name="can_focus">False</property>
<property name="vexpand">False</property>
<property name="spacing">3</property>
<property name="no_show_all">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkMenuButton" id="mnuBtnViews">
<property name="width_request">250</property>
<property name="visible">True</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="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="visible">True</property>
<property name="can_focus">False</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>
</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>
<object class="GtkBox" id="boxMenu">
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="no_show_all">True</property>
<property name="vexpand">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkComboBox" id="cmbSearchInfo">
<object class="GtkToggleButton" id="tgbShowMenuView">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">False</property>
<property name="can_focus">True</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>
</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="GtkBox" id="box31">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="mnuBtnImport">
<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="use_popover">False</property>
<property name="always_show_image">True</property>
<property name="active">True</property>
<child>
<object class="GtkBox" id="box35">
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkImage" id="imgWPImport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</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>
<property name="stock">gtk-select-color</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="mnuBtnAddNote">
<object class="GtkBox" id="box30">
<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="use_popover">False</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box36">
<object class="GtkComboBox" id="cmbSearchInfo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkImage" id="imgWPAddNote">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</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>
<property name="focus_on_click">False</property>
<property name="vexpand">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>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="mnuBtnActions">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="relief">none</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 class="GtkCheckButton" id="chkWPFilterCurView">
<property name="label" translatable="yes">Current view</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="no_show_all">True</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>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btnWPUnfullscreen">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="relief">none</property>
<property name="focus_on_click">False</property>
<child>
<object class="GtkImage" id="imgWPUnfullscreen">
<object class="GtkSearchEntry" id="stySearchInfo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
<property name="icon_size">1</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>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">7</property>
<property name="position">2</property>
</packing>
</child>
</object>
418,7 → 237,7
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">0</property>
</packing>
</child>
</object>
443,21 → 262,6
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box32">
<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">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
<property name="can_focus">True</property>
484,7 → 288,7
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
</object>
505,9 → 309,6
<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>
519,7 → 320,6
<object class="GtkScrolledWindow" id="scrolledwindow4">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<property name="min_content_width">200</property>
<child>
<object class="GtkViewport" id="viewport3">
911,9 → 711,9
<child>
<object class="GtkButton" id="btnPrefsSAPReset">
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="focus_on_click">False</property>
<child>
<object class="GtkBox" id="box23">
<property name="visible">True</property>
956,9 → 756,9
<child>
<object class="GtkButton" id="btnPrefsSAPCancel">
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="focus_on_click">False</property>
<child>
<object class="GtkBox" id="box44">
<property name="visible">True</property>
1000,9 → 800,9
<child>
<object class="GtkButton" id="btnPrefsSAPApply">
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
<property name="focus_on_click">False</property>
<child>
<object class="GtkBox" id="box24">
<property name="visible">True</property>
1046,9 → 846,9
<property name="label">gtk-go-back</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="focus_on_click">False</property>
<property name="always_show_image">True</property>
</object>
<packing>
1099,187 → 899,65
</packing>
</child>
<child>
<object class="GtkBox" id="box7">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Help</property>
</object>
<packing>
<property name="position">5</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box34">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="label11">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">About</property>
</object>
<packing>
<property name="position">6</property>
<property name="tab_fill">False</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="boxWinMenu">
<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">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<child>
<object class="GtkBox" id="box17">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="box19">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box13">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<property name="margin_left">3</property>
<property name="margin_right">3</property>
<property name="margin_top">3</property>
<property name="margin_bottom">3</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">
<object class="GtkRadioButton" id="rbtImpLaunchpad">
<property name="label" translatable="yes">Import from Launchpad</property>
<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>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</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="GtkRadioButton" id="rbtImpBasico">
<property name="label" translatable="yes">Import a Basico package</property>
<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>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">rbtImpLaunchpad</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="schSelectNotesAllNone">
<object class="GtkRadioButton" id="rbtImpJSON">
<property name="label" translatable="yes">Import JSON</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">rbtImpLaunchpad</property>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
</object>
1286,53 → 964,37
<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>
<object class="GtkNotebook" id="ntbImport">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_left">3</property>
<property name="margin_right">3</property>
<child>
<object class="GtkLabel" id="label13">
<object class="GtkBox">
<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>
<property name="orientation">vertical</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="GtkSwitch" id="schExpandCollapse">
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Launchpad</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="tab_fill">False</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">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
1341,234 → 1003,215
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Basico</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box21">
<object class="GtkBox">
<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="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">JSON</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">4</property>
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox" id="box22">
<property name="width_request">100</property>
<object class="GtkButtonBox" id="btnImpGroup">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="margin_left">3</property>
<property name="margin_right">3</property>
<property name="margin_top">3</property>
<property name="margin_bottom">3</property>
<property name="spacing">6</property>
<property name="layout_style">start</property>
<child>
<placeholder/>
<object class="GtkButton" id="btnImpHelp">
<property name="label">gtk-help</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="use_stock">True</property>
<property name="always_show_image">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btnImpCancel">
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="use_stock">True</property>
<property name="always_show_image">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btnImpApply">
<property name="label">gtk-apply</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
<property name="receives_default">True</property>
<property name="relief">none</property>
<property name="use_stock">True</property>
<property name="always_show_image">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
</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">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">5</property>
</packing>
</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="box48">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<property name="homogeneous">True</property>
<child>
<placeholder/>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Import</property>
</object>
<packing>
<property name="position">5</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">out</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="box53">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<property name="homogeneous">True</property>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="label_item">
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame3">
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">out</property>
<child>
<object class="GtkBox" id="box8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">3</property>
<property name="homogeneous">True</property>
<child>
<placeholder/>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;small&gt; Selected SAP Notes &lt;/small&gt;</property>
<property name="use_markup">True</property>
</object>
</child>
<property name="label" translatable="yes">Export</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">6</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box45">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkBox" id="box3">
<object class="GtkBox" id="box7">
<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">0</property>
<property name="position">7</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="togglebutton1">
<child type="tab">
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_markup" translatable="yes">&lt;b&gt;Select SAP Notes&lt;/b&gt;
 
If toggled, it selects all
if not, set the selection to none</property>
<property name="relief">none</property>
<property name="focus_on_click">False</property>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Help</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">7</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="mnuBtnImport2">
<object class="GtkBox" id="box34">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="lblSAPNoteViewCount">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;span size="30000"&gt;&lt;/span&gt;</property>
<property name="use_markup">True</property>
</object>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">8</property>
</packing>
</child>
<child>
<object class="GtkMenuButton" id="mnbWorkplace">
<child type="tab">
<object class="GtkLabel" id="label11">
<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>
<child>
<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>
<property name="can_focus">False</property>
<property name="label" translatable="yes">About</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">8</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
/branches/BR-0.3/basico/sap.py
20,6 → 20,7
LOGIN_PAGE_URL = "https://accounts.sap.com"
LOGOUT_PAGE_URL = "https://accounts.sap.com/ui/logout"
ODATA_NOTE_URL = "https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')" #$expand=LongText" #?$expand=LongText,RefTo,RefBy"
ODATA_NOTE_URL_LONGTEXT = "view-source:https://launchpad.support.sap.com/services/odata/svt/snogwscorr/TrunkSet(SapNotesNumber='%s',Version='0',Language='E')/LongText"
SAP_NOTE_URL = "https://launchpad.support.sap.com/#/notes/%s"
SAP_NOTE_URL_PDF = "https://launchpad.support.sap.com/services/pdf/notes/%s/E"
TIMEOUT = 5
186,6 → 187,11
browser = driver.load(ODATA_NOTE_URL % sapnote)
time.sleep(10)
content = browser.page_source
#~ browser = driver.load(ODATA_NOTE_URL_LONGTEXT % sapnote)
#~ time.sleep(10)
#~ longtext = browser.page_source
#~ self.log.debug(longtext)
 
#~ self.log.debug("\t%3d - SAP Note %s downloaded" % (sapnote, driver.)
#~ else:
#~ content = ''
/branches/BR-0.3/basico/sapnoteviewmenu.py
135,10 → 135,12
def set_view(self, view):
# FIXME: Get last view visited from config
# Change icon
if view is None:
view ='chronologic'
self.log.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)
 
self.view = view
self.log.debug("Set current view to: %s" % view)
 
/branches/BR-0.3/basico/sapnoteviewvisor.py
28,9 → 28,9
class SAPNoteViewVisor(Gtk.Box):
def __init__(self, app):
self.app = app
#~ LOG_FILE = self.app.get_file('LOG')
#~ LOG_NAME = self.__class__.__name__
#~ self.log = get_logger(LOG_NAME, LOG_FILE)
LOG_FILE = self.app.get_file('LOG')
LOG_NAME = self.__class__.__name__
self.log = get_logger(LOG_NAME, LOG_FILE)
self.get_services()
self.toggled = 0
self.selected = set()
171,6 → 171,7
 
def get_toggled(self):
flowbox = self.gui.get_widget('flowbox')
mnubtnactions = self.gui.get_widget('mnuBtnActions')
 
toggled = set()
def foreach_row(item):
182,8 → 183,15
#~ self.log.debug("%s -> %s" % (row, active))
 
flowbox.foreach(foreach_row)
 
lsid = list(toggled)
lsid.sort()
if len(lsid) > 0:
lsid.sort()
mnubtnactions.set_no_show_all(False)
mnubtnactions.show_all()
else:
mnubtnactions.set_no_show_all(True)
mnubtnactions.hide()
 
return lsid
 
226,11 → 234,12
flowbox.add(row)
 
lblcount = self.gui.get_widget("lblSAPNoteViewCount")
lblcount.set_markup("<span size=\"30000\">%d</span>" % len(bag))
self.log.debug("lblcount: %s (%s)"% (str(lblcount), str(type(lblcount))))
#~ lblcount.set_markup("<span size=\"30000\">%d</span>" % len(bag))
self.gui.swap_widget(self, flowbox)
 
toggled = self.get_toggled()
lblSelectedNotes.set_markup('<b><small>%d</small>/%d of <big>%d</big></b>' % (len(toggled), len(bag), self.db.get_total()))
#~ toggled = self.get_toggled()
#~ lblSelectedNotes.set_markup('<b><small>%d</small>/%d of <big>%d</big></b>' % (len(toggled), len(bag), self.db.get_total()))
 
self.show_all()
 
/branches/BR-0.3/basico/uifuncs.py
104,17 → 104,17
dialog.destroy()
 
 
def fullscreen(self, switch, active):
window = self.gui.get_widget('mainwindow')
btnwpunfull = self.gui.get_widget('btnWPUnfullscreen')
if active:
window.fullscreen()
btnwpunfull.set_no_show_all(False)
btnwpunfull.show_all()
else:
window.unfullscreen()
btnwpunfull.set_no_show_all(True)
btnwpunfull.hide()
#~ def fullscreen(self, switch, active):
#~ window = self.gui.get_widget('mainwindow')
#~ btnwpunfull = self.gui.get_widget('btnWPUnfullscreen')
#~ if active:
#~ window.fullscreen()
#~ btnwpunfull.set_no_show_all(False)
#~ btnwpunfull.show_all()
#~ else:
#~ window.unfullscreen()
#~ btnwpunfull.set_no_show_all(True)
#~ btnwpunfull.hide()
 
 
def do_unfullscreen(self, *args):
/branches/BR-0.3/basico/window.py
107,11 → 107,22
rhbox = Gtk.HBox() # Right side of title bar
 
# Left side titlebar
menuviews = self.gui.add_widget('mnuBtnViews', Gtk.MenuButton())
hbox = Gtk.HBox()
label = self.gui.add_widget('lblViewCurrent', Gtk.Label())
image = self.gui.add_widget('imgViewCurrent', Gtk.Image())
hbox.pack_start(image, False, False, 3)
hbox.pack_start(label, False, False, 3)
menuviews.add(hbox)
lhbox.pack_start(menuviews, False, False, 3)
 
imgtitlebar = self.gui.add_widget('imgtitlebar', Gtk.Image())
imgtitlebar.set_visible(False)
imgtitlebar.set_no_show_all(True)
lbltitlebar = self.gui.add_widget("lbltitlebar", Gtk.Label())
self.cb.update_titlebar_title("Dashboard", "dashboard")
lbltitlebar.set_visible(False)
lbltitlebar.set_no_show_all(True)
#~ self.cb.update_titlebar_title("Dashboard", "dashboard")
#~ lbltitlebar.set_markup("<big><b>Dashboard</b></big>")
lhbox.pack_start(imgtitlebar, False, False, 3)
lhbox.pack_start(lbltitlebar, False, False, 3)
119,6 → 130,39
hb.pack_start(lhbox)
 
# Middle side titlebar
# Menu Actions
#~ def estoy_toggled(btnactions):
#~ total = self.db.get_total()
#~ self.log.debug("TOTAL: %d" % total)
#~ if total > 0:
#~ actions_menu = self.gui.get_widget('actions_menu')
#~ btnactions.set_menu_model(actions_menu)
#~ else:
#~ btnactions.set_menu_model(None)
 
#~ return True
 
label = self.gui.add_widget('lblSelectedNotes', Gtk.Label())
#~ label.set_markup('<b><small>0</small>/0 of <big>%d</big></b>' % self.db.get_total())
button = self.gui.add_widget('mnuBtnActions', Gtk.MenuButton())
#~ button.connect('toggled', estoy_toggled)
button.set_relief(Gtk.ReliefStyle.NONE)
button.set_no_show_all(False)
button.set_visible(False)
button.add(label)
mhbox.pack_start(button, False, False, 0)
 
# Quick SAP Note Entry
#~ label = Gtk.Label()
#~ label.set_markup("<b>Quick SAP Note </b>")
#~ mhbox.pack_start(label, False, False, 0)
#~ entry = Gtk.Entry()
#~ entry.set_max_length(10)
#~ entry.set_max_width_chars(5)
#~ entry.set_width_chars(10)
#~ entry.set_alignment(xalign=1)
#~ mhbox.pack_start(entry, False, False, 0)
 
# Dashboard button
#~ button = self.gui.add_widget('btnDashboard', Gtk.Button())
#~ button.set_tooltip_markup('<big><b>Dashboard</b></big>')
131,41 → 175,45
#~ mhbox.pack_start(button, False, False, 0)
 
# Workplace button
button = Gtk.Button()
button.set_tooltip_markup('<big><b>Workplace</b></big>')
icon = self.im.get_pixbuf_icon('workplace', 24, 24)
image = Gtk.Image()
image.set_from_pixbuf(icon)
button.set_image(image)
button.set_relief(Gtk.ReliefStyle.NONE)
button.connect('clicked', self.cb.show_workplace)
mhbox.pack_start(button, False, False, 0)
#~ button = Gtk.Button()
#~ button.set_tooltip_markup('<big><b>Workplace</b></big>')
#~ icon = self.im.get_pixbuf_icon('workplace', 24, 24)
#~ image = Gtk.Image()
#~ image.set_from_pixbuf(icon)
#~ button.set_image(image)
#~ button.set_relief(Gtk.ReliefStyle.NONE)
#~ button.connect('clicked', self.cb.show_workplace)
#~ mhbox.pack_start(button, False, False, 0)
 
 
# Workbook button
button = Gtk.Button()
button.set_tooltip_markup('<big><b>Workbook</b></big>')
icon = self.im.get_pixbuf_icon('comments', 24, 24)
image = Gtk.Image()
image.set_from_pixbuf(icon)
button.set_image(image)
button.set_relief(Gtk.ReliefStyle.NONE)
button.connect('clicked', self.cb.show_workbook)
mhbox.pack_start(button, False, False, 0)
#~ button = Gtk.Button()
#~ button.set_tooltip_markup('<big><b>Workbook</b></big>')
#~ icon = self.im.get_pixbuf_icon('comments', 24, 24)
#~ image = Gtk.Image()
#~ image.set_from_pixbuf(icon)
#~ button.set_image(image)
#~ button.set_relief(Gtk.ReliefStyle.NONE)
#~ button.connect('clicked', self.cb.show_workbook)
#~ mhbox.pack_start(button, False, False, 0)
 
 
# School button
button = Gtk.Button()
button.set_tooltip_markup('<big><b>My SAP School</b></big>')
icon = self.im.get_pixbuf_icon('school', 24, 24)
image = Gtk.Image()
image.set_from_pixbuf(icon)
button.set_image(image)
button.set_relief(Gtk.ReliefStyle.NONE)
button.connect('clicked', self.cb.show_school)
mhbox.pack_start(button, False, False, 0)
#~ button = Gtk.Button()
#~ button.set_tooltip_markup('<big><b>My SAP School</b></big>')
#~ icon = self.im.get_pixbuf_icon('school', 24, 24)
#~ image = Gtk.Image()
#~ image.set_from_pixbuf(icon)
#~ button.set_image(image)
#~ button.set_relief(Gtk.ReliefStyle.NONE)
#~ button.connect('clicked', self.cb.show_school)
#~ mhbox.pack_start(button, False, False, 0)
 
#~ label = Gtk.Label()
#~ label.set_markup("<b> SAP Note </b>")
#~ mhbox.pack_start(label, False, False, 0)
 
 
# Search entry
#~ button = Gtk.Button()
#~ button.set_tooltip_markup('<big><b>Search</b></big>')
179,6 → 227,19
 
 
# Right side titlebar
# MnuButton valid with any modern version of Gtk (?> 3.10)
btnactions = self.gui.add_widget('mnuBtnImport', Gtk.MenuButton())
btnactions.set_always_show_image(True)
btnactions.set_property("use-popover", True)
btnactions.set_relief(Gtk.ReliefStyle.NONE)
imgwpimport = Gtk.Image()
icon = self.im.get_pixbuf_icon('download', 22, 22)
imgwpimport.set_from_pixbuf(icon)
btnactions.add(imgwpimport)
#~ actions_menu = self.gui.get_widget('actions_menu')
#~ btnactions.set_menu_model(actions_menu)
rhbox.pack_start(btnactions, False, False, 0)
 
# Menu
button = Gtk.Button()
#~ button.set_tooltip_markup('<big><b>About</b></big>')
235,7 → 296,7
button.add(hbox)
button.set_relief(Gtk.ReliefStyle.NONE)
button.connect('clicked', self.cb.show_settings)
box.pack_end(button, False, False, 0)
box.pack_start(button, False, False, 0)
 
popover.add(box)
 
254,6 → 315,7
#~ button.show_all()
#~ self.cb.update_titlebar_title("Settings", "settings")
#~ rhbox.pack_end(button, False, False, 0)
 
hb.pack_end(rhbox)
 
hb.set_custom_title(mhbox)
485,9 → 547,9
#~ revsearch.set_no_show_all(True)
 
# button import
image = self.gui.get_widget('imgMnuBtnImport')
icon = self.im.get_pixbuf_icon('import', 24, 24)
image.set_from_pixbuf(icon)
#~ image = self.gui.get_widget('imgMnuBtnImport')
#~ icon = self.im.get_pixbuf_icon('import', 24, 24)
#~ image.set_from_pixbuf(icon)
 
#~ # button refresh
#~ image = self.gui.get_widget('imgBtnRefresh')
505,10 → 567,10
#~ btnStopDlNotes = self.gui.get_widget('btnStopDlNotes')
#~ btnStopDlNotes.connect('clicked', self.cb.stop_dl_notes)
 
switch = self.gui.get_widget('schExpandCollapse')
#~ switch = self.gui.get_widget('schExpandCollapse')
#~ switch.connect('state-set', viewmenu.expand_collapse)
#~ switch.connect('toggled', sapnoteview.expand_collapse)
switch = self.gui.get_widget('schSelectNotesAllNone')
#~ switch = self.gui.get_widget('schSelectNotesAllNone')
#~ switch.connect('state-set', viewmenu.select_all_none)
#~ switch.connect('toggled', viewmenu.select_all_none)
 
/branches/BR-0.3/basico/workplace.py
36,9 → 36,7
 
textview = Gtk.TextView()
self.textbuffer = textview.get_buffer()
self.textbuffer.set_text("This is some text inside of a Gtk.TextView. "
+ "Select text and click one of the buttons 'bold', 'italic', "
+ "or 'underline' to modify the text accordingly.")
self.textbuffer.set_text("")
scrolledwindow.add(textview)
 
box = self.get_content_area()
61,7 → 59,7
self.setup_menus()
 
 
def hello(self, *args):
def show_import_dialog_launchpad(self, *args):
self.log.debug("Import from Launchpad")
parent_window = self.gui.get_widget('mainwindow')
dialog = DlgImportFromLaunchpad(parent_window)
79,15 → 77,15
 
def setup_widgets(self):
# Toolbar
btnwpunfull = self.gui.get_widget('btnWPUnfullscreen')
btnwpunfull.connect('clicked', self.uif.do_unfullscreen)
imgwpunfull = self.gui.get_widget('imgWPUnfullscreen')
icon = self.im.get_pixbuf_icon('unfullscreen', 24, 24)
imgwpunfull.set_from_pixbuf(icon)
#~ btnwpunfull = self.gui.get_widget('btnWPUnfullscreen')
#~ btnwpunfull.connect('clicked', self.uif.do_unfullscreen)
#~ imgwpunfull = self.gui.get_widget('imgWPUnfullscreen')
#~ icon = self.im.get_pixbuf_icon('unfullscreen', 24, 24)
#~ imgwpunfull.set_from_pixbuf(icon)
 
icon = self.im.get_pixbuf_icon('addnote', 24, 24)
imgwpaddnote = self.gui.get_widget('imgWPAddNote')
imgwpaddnote.set_from_pixbuf(icon)
#~ icon = self.im.get_pixbuf_icon('addnote', 24, 24)
#~ imgwpaddnote = self.gui.get_widget('imgWPAddNote')
#~ imgwpaddnote.set_from_pixbuf(icon)
 
 
tgbshowmenu = self.gui.get_widget('tgbShowMenuView')
105,6 → 103,10
visor = self.gui.add_widget('visor', SAPNoteViewVisor(self.app))
self.gui.swap_widget(visorbox, visor)
 
#~ toggled = visor.get_toggled()
#~ bag = visor.get_bag()
#~ label = self.gui.get_widget('lblSelectedNotes')
#~ label.set_markup('<b><small>%d</small>/%d of <big>%d</big></b>' % (len(toggled), len(bag), self.db.get_total()))
 
def get_services(self):
self.gui = self.app.get_service("GUI")
125,7 → 127,7
app = self.gui.get_app()
 
# View label
self.gui.add_widget('lblViewCurrent')
#~ self.gui.add_widget('lblViewCurrent')
 
## Views Menu
views_menu = self.gui.add_widget('mnuviews', Gio.Menu())
200,7 → 202,7
app = self.gui.get_app()
 
## Action Menu
actions_menu = Gio.Menu()
actions_menu = self.gui.add_widget('actions_menu', Gio.Menu())
 
#~ # Browse SAP Notes
actions_menu.append_item(self.uif.create_item('Browse SAP Note(s)', 'app.actions-browse', 'browse'))
258,9 → 260,9
 
 
def setup_menu_import(self):
imgwpimport = self.gui.get_widget('imgWPImport')
icon = self.im.get_pixbuf_icon('download', 24, 24)
imgwpimport.set_from_pixbuf(icon)
#~ imgwpimport = self.gui.get_widget('imgWPImport')
#~ icon = self.im.get_pixbuf_icon('download', 24, 24)
#~ imgwpimport.set_from_pixbuf(icon)
viewmenu = self.gui.get_widget('viewmenu')
view = viewmenu.get_view()
 
284,7 → 286,7
actions_menu.append_item(self.uif.create_item('Import SAP Notes from SAP Launchpad', 'app.actions-import-launchpad', 'download'))
#~ action = Gio.SimpleAction.new('app.actions-import-launchpad', None)
#~ action.connect('activate', self.hello, 'download')
app.add_action(self.uif.create_action("actions-import-launchpad", self.hello))
app.add_action(self.uif.create_action("actions-import-launchpad", self.show_import_dialog_launchpad))
#~ action) #
 
#~ actions_menu.append_submenu('Import', actions_import_submenu)