Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 124 → Rev 125

/branches/BR-0.3/basico/workplace.py
35,8 → 35,8
scrolledwindow.set_vexpand(True)
 
textview = Gtk.TextView()
textbuffer = textview.get_buffer()
textbuffer.set_text("This is some text inside of a 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.")
scrolledwindow.add(textview)
45,7 → 45,12
box.add(scrolledwindow)
self.show_all()
 
def get_buffer(self):
istart, iend = self.textbuffer.get_bounds()
return self.textbuffer.get_text(istart, iend, False)
 
 
 
class Workplace(Service):
def initialize(self):
'''
64,6 → 69,8
 
if response == Gtk.ResponseType.OK:
self.log.debug("The OK button was clicked")
lines = dialog.get_buffer()
self.cb.import_notes_from_sapnet(lines)
elif response == Gtk.ResponseType.CANCEL:
self.log.debug("The Cancel button was clicked")
 
/branches/BR-0.3/basico/database.py
214,9 → 214,12
bag.add(sapnote)
elif key == 'task':
if len(value) == 0:
tasks = sapnotes[sapnote]['tasks']
if len(tasks) > 0:
bag.add(sapnote)
try:
tasks = sapnotes[sapnote]['tasks']
if len(tasks) > 0:
bag.add(sapnote)
except:
pass
else:
if value in sapnotes[sapnote]['tasks']:
bag.add(sapnote)
/branches/BR-0.3/basico/callbacks.py
526,7 → 526,7
self.log.debug("Nothing imported")
dialog.destroy()
 
def import_notes_from_sapnet(self):
def import_notes_from_sapnet(self, lines):
db = self.get_service('DB')
driver = self.get_service('Driver')
 
534,10 → 534,10
winroot = self.gui.get_widget('mainwinow')
sapnotes = []
bag = set()
txtnotes = self.gui.get_widget('txtSAPNotes')
textbuffer = txtnotes.get_buffer()
istart, iend = textbuffer.get_bounds()
lines = textbuffer.get_text(istart, iend, False)
#~ txtnotes = self.gui.get_widget('txtSAPNotes')
#~ textbuffer = txtnotes.get_buffer()
#~ istart, iend = textbuffer.get_bounds()
#~ lines = textbuffer.get_text(istart, iend, False)
 
lines = lines.replace(' ', ',')
lines = lines.replace('\n', ',')
572,7 → 572,7
db.save_notes()
db.build_stats()
 
textbuffer.set_text("")
#~ textbuffer.set_text("")
self.log.info("Task completed.")
notebook.set_current_page(0)
dialog = Gtk.MessageDialog(winroot, 0, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, "Task completed")
659,8 → 659,8
self.set_search_term('')
self.search_notes()
#~ self.refresh_view()
sapnoteview.select_all_none(switch, False)
sapnoteview.collapse()
#~ sapnoteview.select_all_none(switch, False)
#~ sapnoteview.collapse()
 
 
def refresh_view(self, action=None, callback=None, view=None):