Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 99 → Rev 100

/branches/BR-0.3/basico/data/ui/basico.ui
187,7 → 187,7
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
202,145 → 202,137
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator6">
<object class="GtkBox" id="box48">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</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="relief">none</property>
<property name="focus_on_click">False</property>
<property name="use_popover">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkBox" id="box28">
<object class="GtkBox" id="box52">
<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>
<object class="GtkLabel" id="lblSelectedNotes">
<object class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;big&gt;0 SAP Notes selected&lt;/big&gt;</property>
<property name="label" translatable="yes">&lt;small&gt;Select All / None&lt;/small&gt;</property>
<property name="use_markup">True</property>
<property name="justify">center</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>
<child>
<object class="GtkSwitch" id="schSelectNotesAllNone">
<property name="visible">True</property>
<property name="can_focus">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">0</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="GtkSeparator" id="separator8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</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>
<child>
<object class="GtkImage" id="imgMnuBtnImport">
<object class="GtkBox" id="box53">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
<property name="orientation">vertical</property>
<property name="spacing">3</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">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">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkBox" id="box3">
<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">6</property>
</packing>
</child>
<child>
<object class="GtkSeparator" id="separator9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">7</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box48">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkBox" id="box52">
<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>
<object class="GtkLabel" id="label12">
<object class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;small&gt;Selection&lt;/small&gt;</property>
<property name="label" translatable="yes">&lt;small&gt;Selected SAP Notes&lt;/small&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="schSelectNotesAllNone">
<object class="GtkMenuButton" id="mnuBtnActions">
<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>
<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">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
349,36 → 341,68
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">2</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="box12">
<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>
<object class="GtkBox" id="box53">
<object class="GtkBox" id="box10">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkLabel" id="label13">
<object class="GtkComboBox" id="cmbSearchInfo">
<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="vexpand">False</property>
<property name="focus_on_click">False</property>
<property name="popup_fixed_width">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">False</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">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkSwitch" id="schExpandCollapse">
<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>
<property name="primary_icon_name">edit-find-symbolic</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
</object>
390,17 → 414,57
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkSeparator" id="separator1">
<property name="visible">True</property>
<property name="can_focus">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">8</property>
<property name="padding">3</property>
<property name="position">3</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkMenuButton" id="mnuBtnImport">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</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>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
417,31 → 481,10
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
<object class="GtkComboBox" id="cmbSearchInfo">
<property name="visible">True</property>
<property name="can_focus">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="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>
<property name="primary_icon_name">edit-find-symbolic</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
<placeholder/>
</child>
</object>
</child>
/branches/BR-0.3/basico/basico.py
36,10 → 36,10
from .plugins import Plugins
from .callbacks import Callback
from .notify import Notification
from .dashboard import Dashboard
#~ from .dashboard import Dashboard
from .stats import Stats
from .database import Database
from .webserver import WebServer
#~ from .webserver import WebServer
from .driver import SeleniumDriver
from .env import ROOT, APP, LPATH, GPATH, FILE
 
74,10 → 74,10
'Plugins' : Plugins(),
'Callbacks' : Callback(),
'Stats' : Stats(),
'Dashboard' : Dashboard(),
#~ 'Dashboard' : Dashboard(),
'DB' : Database(),
'Driver' : SeleniumDriver(),
'WebServer' : WebServer()
#~ 'WebServer' : WebServer()
}
self.register_services(services)
except Exception as error:
/branches/BR-0.3/basico/webserver.py
41,10 → 41,14
 
 
def halt(self):
self.webserver.shutdown()
self.thread.join()
try:
self.webserver.shutdown()
self.thread.join()
except:
pass
 
 
 
def finalize(self):
self.halt()
 
/branches/BR-0.3/basico/sapnoteview.py
1628,7 → 1628,7
 
model = self.get_model()
model.foreach(traverse_treeview)
lblSelectedNotes.set_markup('<small>%d of %d\nSAP Notes selected</small>' % (len(self.selected), self.db.get_total()))
lblSelectedNotes.set_markup('<small><b>%d of %d</b></small>' % (len(self.selected), self.db.get_total()))
actions = self.gui.get_widget('mnuBtnActions')
if (len(self.selected)) > 0:
actions.set_sensitive(True)
1709,6 → 1709,12
self.expand_all()
else:
self.collapse_all()
#~ def expand_collapse(self, checkbutton):
#~ active = checkbutton.get_active()
#~ if active:
#~ self.expand_all()
#~ else:
#~ self.collapse_all()
 
 
def select_all_none(self, switch, active):
1724,8 → 1730,25
 
model.foreach(traverse_treeview, active)
self.check_states()
#~ def select_all_none(self, checkbutton):
#~ active = checkbutton.get_active()
#~ self.log.debug(args)
 
#~ model = self.get_model()
 
#~ def traverse_treeview(model, path, iter, user_data=None):
#~ row = model.get_value(iter, 0)
#~ row_type, sid = row.split('@')
#~ if row_type == 'sapnote':
#~ model.set_value(iter, 1, active)
 
#~ return False
 
#~ model.foreach(traverse_treeview, active)
#~ self.check_states()
 
 
 
def select_by_component(self, component_target, active):
model = self.get_model()
#~ self.log.debug("Component target: %s" % component_target)
/branches/BR-0.3/basico/window.py
45,8 → 45,8
self.setup_app()
 
# Then run webserver
self.webserver = self.controller.get_service('WebServer')
self.webserver.run()
#~ self.webserver = self.controller.get_service('WebServer')
#~ self.webserver.run()
 
 
def setup_controller(self, uiapp):
116,15 → 116,15
 
# Middle side titlebar
# Dashboard button
button = self.gui.add_widget('btnDashboard', Gtk.Button())
button.set_tooltip_markup('<big><b>Dashboard</b></big>')
icon = self.im.get_pixbuf_icon('dashboard', 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_dashboard)
mhbox.pack_start(button, False, False, 0)
#~ button = self.gui.add_widget('btnDashboard', Gtk.Button())
#~ button.set_tooltip_markup('<big><b>Dashboard</b></big>')
#~ icon = self.im.get_pixbuf_icon('dashboard', 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_dashboard)
#~ mhbox.pack_start(button, False, False, 0)
 
# Workplace button
button = Gtk.Button()
247,7 → 247,7
self.app.add_action(self.uif.create_action("view-components", self.cb.refresh_view, 'components'))
 
# Component descriptions view
views_menu.append_item(self.uif.create_item('View by component description', 'app.view-component-descriptions', ''))
views_menu.append_item(self.uif.create_item('View by description', 'app.view-component-descriptions', ''))
self.app.add_action(self.uif.create_action("view-component-descriptions", self.cb.refresh_view, 'description'))
 
# Bookmarks view
259,7 → 259,7
self.app.add_action(self.uif.create_action("view-categories", self.cb.refresh_view, 'category'))
 
# Chronologic order view
views_menu.append_item(self.uif.create_item('View in chronologic order', 'app.chronologic-order', ''))
views_menu.append_item(self.uif.create_item('View chronologically', 'app.chronologic-order', ''))
self.app.add_action(self.uif.create_action("chronologic-order", self.cb.refresh_view, 'chronologic'))
 
# Priority view
510,8 → 510,10
 
switch = self.gui.get_widget('schExpandCollapse')
switch.connect('state-set', sapnoteview.expand_collapse)
#~ switch.connect('toggled', sapnoteview.expand_collapse)
switch = self.gui.get_widget('schSelectNotesAllNone')
switch.connect('state-set', sapnoteview.select_all_none)
#~ switch.connect('toggled', sapnoteview.select_all_none)
 
 
#~ # Actions button
545,7 → 547,7
self.show_all()
self.log.debug("GUI loaded")
 
self.cb.show_dashboard()
self.cb.show_workplace()
 
 
def setup_props_window(self):
660,16 → 662,16
combobox.add_attribute(cell, 'markup', 1)
combobox.connect('changed', self.cb_combobox_changed)
 
model.append(None, ['search', 'Search in all database'])
model.append(None, ['project', 'Filter by project name'])
model.append(None, ['task', 'Filter by task name'])
model.append(None, ['component', 'Filter by component'])
model.append(None, ['category', 'Filter by category'])
model.append(None, ['type', 'Filter by type'])
model.append(None, ['id', 'Filter by Id'])
model.append(None, ['title', 'Filter by title'])
model.append(None, ['priority', 'Filter by priority'])
model.append(None, ['version', 'Filter by version'])
model.append(None, ['search', '<small>Search in all database</small>'])
model.append(None, ['project', '<small>Filter by project name</small>'])
model.append(None, ['task', '<small>Filter by task name</small>'])
model.append(None, ['component', '<small>Filter by component</small>'])
model.append(None, ['category', '<small>Filter by category</small>'])
model.append(None, ['type', '<small>Filter by type</small>'])
model.append(None, ['id', '<small>Filter by Id</small>'])
model.append(None, ['title', '<small>Filter by title</small>'])
model.append(None, ['priority', '<small>Filter by priority</small>'])
model.append(None, ['version', '<small>Filter by version</small>'])
#~ model.append(None, ['released', 'Filter by release date'])
 
combobox.set_active(0)
688,7 → 690,7
self.im = self.controller.get_service('IM')
self.cb = self.controller.get_service('Callbacks')
self.tasks = self.controller.get_service('Tasks')
self.dashboard = self.controller.get_service('Dashboard')
#~ self.dashboard = self.controller.get_service('Dashboard')
 
 
def swap_widget(self, container, combobox):