Subversion Repositories basico

Compare Revisions

Ignore whitespace Rev 376 → Rev 377

/branches/BR-0.4/basico/services/srv_callbacks.py
189,7 → 189,7
dialog.set_default_size(800, 400)
res_bck_file = dialog.run()
self.log.debug("Backup file: %s", dialog.get_filename())
 
if res_bck_file == Gtk.ResponseType.OK:
backup_filename = dialog.get_filename()
if res_bck_annot == Gtk.ResponseType.YES:
202,7 → 202,7
self.log.info(msg)
self.srvuif.statusbar_msg(msg, True)
self.srvuif.copy_text_to_clipboard(bckname)
 
else:
self.srvuif.statusbar_msg("Backup aborted by user", True)
self.log.info("Backup aborted")
359,7 → 359,7
 
def gui_annotation_widget_show(self, widget, sid='0000000000', action='create'):
widget_annotation = self.srvgui.get_widget('widget_annotation')
widget = self.srvgui.get_widget('gtk_label_timestamp_created')
widget = self.srvgui.get_widget('gtk_label_timestamp_created')
vpaned = self.srvgui.get_widget('gtk_vpaned_visor')
vpaned.set_position(0)
if action == 'create':
554,7 → 554,7
elif page == 1:
visor_annotations = self.srvgui.get_widget('visor_annotations')
visor_annotations.populate()
visible_filter = visor.get_visible_filter()
visible_filter = visor_annotations.get_visible_filter()
visible_filter.refilter()
visor_annotations.update_total_annotations_count()
 
614,18 → 614,15
 
def action_annotation_delete(self, *args):
visor_annotations = self.srvgui.get_widget('visor_annotations')
widget_annotation = self.srvgui.get_widget('widget_annotation')
aid = widget_annotation.get_aid_from_widget()
title = self.srvant.get_title(aid)
answer = self.srvuif.warning_message_delete_annotations(None, 'Deleting annotations', 'Are you sure?', [aid])
aids = visor_annotations.rows_toggled()
answer = self.srvuif.warning_message_delete_annotations(None, 'Deleting annotations', 'Are you sure?', aids)
if answer is True:
self.srvant.delete(aid)
self.gui_annotation_widget_clear()
self.srvuif.set_widget_visibility('gtk_vbox_container_annotations', False)
for aid in aids:
self.srvant.delete(aid)
visor_annotations.populate()
self.srvuif.statusbar_msg("Annotation <i>'%s'</i> deleted" % title, True)
self.srvuif.statusbar_msg("Annotations deleted", True)
else:
self.log.info("Annotation %s hasn't been deleted" % title)
self.log.info("Annotations hasn't been deleted")
self.srvuif.statusbar_msg("Action canceled. Nothing deleted.", True)
 
self.srvuif.grab_focus()
638,7 → 635,7
viewmenu = self.srvgui.get_widget('viewmenu')
 
aid = widget_annotation.get_aid_from_widget()
annotation = widget_annotation.get_metadata_from_widget()
annotation = widget_annotation.get_metadata_from_widget()
 
if self.srvant.is_valid(aid):
self.srvant.update(annotation)
815,7 → 812,7
visor_annotations = self.srvgui.get_widget('visor_annotations')
visor_annotations.row_previous()
 
 
def gui_annotation_next_row(self, *args):
visor_annotations = self.srvgui.get_widget('visor_annotations')
visor_annotations.row_next()
859,8 → 856,8
self.srvuif.statusbar_msg(msg)
GObject.signal_handler_unblock(notebook, signal)
paned.set_position(400)
 
 
def gui_link_to_sapnote(self, *args):
pass
 
908,7 → 905,7
visor_attachemnts = self.srvgui.get_widget('visor_attachments')
visor_annotations = self.srvgui.get_widget('visor_annotations')
visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
 
# Create annotation
aid = self.srvant.gen_aid(sid)
annotation = {}
916,15 → 913,15
annotation["Title"] = "Attachments added for SAP Note %s" % str(int(sid))
annotation["Component"] = "Annotation"
annotation["Type"] = "Note"
annotation["Category"] = "Inbox"
annotation["Category"] = "Inbox"
annotation["Priority"] = "Low"
annotation["Link"] = ""
annotation["Link"] = ""
annotation["LinkType"] = "Website"
annotation["Origin"] = "Service-Attachment"
 
# Get attachments from filechooser dialog
attachments = self.gui_attachment_show_filechooser()
 
# Add them to Basico database
if attachments is not None:
content = '== Attachments\n\n'
949,7 → 946,7
visor_attachemnts = self.srvgui.get_widget('visor_attachments')
visor_annotations = self.srvgui.get_widget('visor_annotations')
aid = widget_annotation.get_aid_from_widget()
 
# Create annotation
sid = self.srvant.get_sid(aid)
new_aid = self.srvant.gen_aid(sid)
958,12 → 955,12
annotation["Title"] = "Attachments added for annotation: %s" % self.srvant.get_title(aid)
annotation["Component"] = "Annotation"
annotation["Type"] = "Note"
annotation["Category"] = "Inbox"
annotation["Category"] = "Inbox"
annotation["Priority"] = "Low"
annotation["Link"] = ""
annotation["Link"] = ""
annotation["LinkType"] = "Website"
annotation["Origin"] = "Service-Attachment"
 
# Get attachments from filechooser dialog
attachments = self.gui_attachment_show_filechooser()
 
984,13 → 981,13
visor_annotations.populate()
else:
self.log.warning("No files selected to attach")
 
 
def gui_attachment_add(self, button):
visor_attachemnts = self.srvgui.get_widget('visor_attachments')
visor_annotations = self.srvgui.get_widget('visor_annotations')
visor_sapnotes = self.srvgui.get_widget('visor_sapnotes')
 
# Create annotation
aid = self.srvant.gen_aid('0000000000')
annotation = {}
998,15 → 995,15
annotation["Title"] = "Attachments added"
annotation["Component"] = "Annotation"
annotation["Type"] = "Note"
annotation["Category"] = "Inbox"
annotation["Category"] = "Inbox"
annotation["Priority"] = "Low"
annotation["Link"] = ""
annotation["Link"] = ""
annotation["LinkType"] = "Website"
annotation["Origin"] = "Service-Attachment"
 
# Get attachments from filechooser dialog
attachments = self.gui_attachment_show_filechooser()
 
# Add them to Basico database
if attachments is not None:
content = '== Attachments\n\n'
1030,7 → 1027,7
dialog = Gtk.FileChooserDialog(title="Open file(s) ...",
parent=parentwin,
action=Gtk.FileChooserAction.OPEN,
buttons=("_Cancel",
buttons=("_Cancel",
Gtk.ResponseType.CANCEL,
"_Open", Gtk.ResponseType.ACCEPT))
dialog.set_select_multiple(True)
1044,6 → 1041,6
i += 1
dialog.destroy()
return filenames
 
def copy_text_to_clipboard(self, widget, text):
self.srvuif.copy_text_to_clipboard(text)