Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 81 → Rev 82

/branches/BR-0.3/basico/window.py
348,14 → 348,30
self.mainbox = self.gui.get_widget('mainbox')
self.mainbox.reparent(self)
 
# HEADERBAR WIDGETS
self.setup_headerbar()
 
# STATUSBAR WIDGETS
statusbar = self.gui.get_widget('pgbMain')
statusbar.set_text("")
statusbar.set_show_text(True)
statusbar.set_fraction(0.0)
self.setup_menus()
#~ self.tasks.setup_widgets()
 
# SETTINGS PAGE WIDGETS
button = self.gui.get_widget('btnPrefsBack')
button.connect('clicked', self.cb.show_workplace)
 
button = self.gui.add_widget('btnPrefsSAPApply')
button.connect('clicked', self.cb.apply_preferences)
 
button = self.gui.add_widget('btnPrefsSAPCancel')
button.connect('clicked', self.cb.refresh_view)
 
button = self.gui.add_widget('btnPrefsSAPReset')
button.connect('clicked', self.cb.default_preferences)
 
# SAPNOTEVIEW WIDGETS
notesbox = self.gui.get_widget('notesbox')
sapnoteview = SAPNoteView(self.controller)
self.gui.add_widget('sapnoteview', sapnoteview)
468,16 → 484,6
# Actions button
button = self.gui.get_widget('mnuBtnActions')
 
# Prefs for SAP module
button = self.gui.add_widget('btnPrefsSAPApply')
button.connect('clicked', self.cb.apply_preferences)
 
button = self.gui.add_widget('btnPrefsSAPCancel')
button.connect('clicked', self.cb.refresh_view)
 
button = self.gui.add_widget('btnPrefsSAPReset')
button.connect('clicked', self.cb.default_preferences)
 
# Notebook Import Widget
#~ ntbimport = self.gui.add_widget('ntbAddSAPNotes')
 
/branches/BR-0.3/basico/data/ui/basico.ui
2342,6 → 2342,8
<object class="GtkBox" id="box18">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
2592,7 → 2594,19
</packing>
</child>
<child>
<placeholder/>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">&lt;big&gt;READ ONLY SETTINGS&lt;/big&gt;
(Work In Progress)</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">1</property>
</packing>
</child>
</object>
<packing>
2609,10 → 2623,10
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="btnPrefsSAPReset">
<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="no_show_all">True</property>
<child>
<object class="GtkBox" id="box23">
<property name="visible">True</property>
2654,10 → 2668,10
</child>
<child>
<object class="GtkButton" id="btnPrefsSAPCancel">
<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="no_show_all">True</property>
<child>
<object class="GtkBox" id="box44">
<property name="visible">True</property>
2698,10 → 2712,10
</child>
<child>
<object class="GtkButton" id="btnPrefsSAPApply">
<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="no_show_all">True</property>
<child>
<object class="GtkBox" id="box24">
<property name="visible">True</property>
2740,6 → 2754,22
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="btnPrefsBack">
<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="always_show_image">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
/branches/BR-0.3/basico/sap.py
121,6 → 121,21
return valid, sid
 
 
 
def apply_preferences(self, *args):
self.gui = self.app.get_service('GUI')
settings = self.get_default_settings()
new_settings = {}
for key in settings:
widget = self.gui.get_widget(key)
value = widget.get_text()
new_settings[key] = value
#~ self.log.debug(new_settings)
self.config[self.section] = new_settings
self.save_config()
self.log.debug("Settings saved")
 
 
def start_fetching(self, total):
self.notes_fetched = 0
self.notes_total = total
/branches/BR-0.3/basico/settings.py
23,6 → 23,9
 
 
class Settings(Service):
######
# FIXME: right now, settings are hardcoded
######
def initialize(self):
view = self.get_config_value('View')
self.log.debug("View: %s" % view)
29,9 → 32,6
 
def get_default_settings(self):
settings = {}
# Deprecated as Basico uses now login with SAP Passport
#~ settings['CNF_SAP_SUser'] = 'SXXXXXXXXXX'
#~ settings['CNF_SAP_SPass'] = 'MyP455w0rD'
utils = self.get_service('Utils')
settings['CNF_SAP_LOGIN'] = LOGIN_PAGE_URL
settings['CNF_SAP_LOGOUT'] = LOGOUT_PAGE_URL
56,3 → 56,16
settings['CNF_FF_PROFILE_DIR'] = sap.get_config_value('CNF_FF_PROFILE_DIR')
 
return settings
 
 
#~ def get_value(self, key):
#~ settings = self.get_custom_settings()
 
#~ try:
#~ return settings[key]
#~ except:
#~ return None
 
 
#~ def set_value(self, key, value):
#~ pass
/branches/BR-0.3/basico/sapnoteview.py
941,10 → 941,11
#~ comptxt = escape(sapnote['componenttxt'])
icon = self.im.get_icon('component', 32, 32)
node = []
count = len(self.db.get_notes_by_node("componentkey", compkey))
if len(comptxt) > 0:
component = "<big><b>%s</b></big> (<i>%s</i>)" % (compkey, comptxt) # component
else:
component = "<big><b>%s</b></big>" % compkey
component = "<big><b>%s</b></big>" % (compkey)
 
#~ component = "<big><b>%s</b></big>" % (compkey)
#~ component = "<span size='18000'><b>%s</b></span> <span size='12000'>(<i>%s</i>)</span>" % (compkey, comptxt)
954,7 → 955,7
node.append(component) # Component
node.append("") # Category
node.append("") # Type
node.append("") # Id
node.append("%d SAP Notes" % count) # Id
node.append("") # Title
node.append("") # Priority
node.append("") # Lang