def saveAllData(self): f = KFileDialog.getSaveFileName() try: writeArrayToDatafile(self.rawDataBackupCopy, f) self.ui.statusbar.message("Successfully saved %s values to %s." % (str(len(self.data)), f)) except Exception as e: self.ui.statusbar.message("Failed to save data to %s: %s" % (f, str(e)))
def save_file(self): """ Save the current document. """ tabwidget = self.window.tabWidget document = tabwidget.currentWidget() if(document is not None): filename = KFileDialog.getSaveFileName(KUrl(), "*.xoj | *.xoj - Xournal File") xournal = Xournal() xournal.save(filename, document)
def saveSession(self): filename = str( KFileDialog.getSaveFileName(KUrl("pisi-archive"), "*.offline", self, i18n("Save offline session")) ) if filename: self.emit(SIGNAL("saveSession(str)"), filename) self.switchSession(SessionManager.NORMAL)
def export_to_file(self): filename = KFileDialog.getSaveFileName(KUrl("~"), "Text (*.txt)", self, "Select file to save launcher data") fh = open(filename, 'w') for rownum in range(self.tableWidget.rowCount()): icon = self.tableWidget.cellWidget(rownum, 0) and unicode(self.tableWidget.cellWidget(rownum, 0).icon()) or "" button_text = self.tableWidget.item(rownum, 1) and unicode(self.tableWidget.item(rownum, 1).text()) media_url = self.tableWidget.item(rownum, 2) and unicode(self.tableWidget.item(rownum, 2).text()) tooltip_text = (self.tableWidget.item(rownum, 3) and unicode(self.tableWidget.item(rownum, 3).text())) or "" if button_text and media_url: fh.write("\t".join([icon, button_text, media_url, tooltip_text]) + "\n") fh.close()
def saveSession(self): filename = str(KFileDialog.getSaveFileName(KUrl("pisi-archive"), "*.offline", self, i18n("Save offline session"))) if filename: self.emit(SIGNAL("saveSession(str)"), filename) self.switchSession(SessionManager.NORMAL)
def exportIndex(self): filename = str(KFileDialog.getSaveFileName(KUrl("pisi-installed"), "*.xml", self, i18n("Export index file"))) if filename: self.emit(SIGNAL("exportIndex(str)"), filename)