Esempio n. 1
0
 def toDiaryDict(self):
     text, formats = self.textEditor.getRichText()
     tags = self.tagEditor.text()
     if self.tagModified:  # remove duplicate tags
         tags = ' '.join(set(tags.split()))
     return dict(id=self.id, datetime=self.datetime or currentDatetime(),
                 text=text, formats=formats, title=self.titleEditor.text(),
                 tags=tags)
Esempio n. 2
0
 def toNikkiDict(self):
     text, formats = self.textEditor.getRichText()
     return dict(id=self.id,
                 datetime=self.datetime or currentDatetime(),
                 text=text,
                 formats=formats,
                 title=self.titleEditor.text(),
                 tags=self.tagEditor.text())
Esempio n. 3
0
 def toDiaryDict(self):
     text, formats = self.textEditor.getRichText()
     tags = self.tagEditor.text()
     if self.tagModified:  # remove duplicate tags
         tags = ' '.join(set(tags.split()))
     return dict(id=self.id, datetime=self.datetime or currentDatetime(),
                 text=text, formats=formats, title=self.titleEditor.text(),
                 tags=tags)
Esempio n. 4
0
 def on_dtBtn_clicked(self):
     """Show datetime edit dialog"""
     if self.readOnly: return
     dtStr = currentDatetime() if self.datetime is None else self.datetime
     newDt = DateTimeDialog.getDateTime(datetimeToQt(dtStr), fullDatetimeFmt, self)
     if newDt is not None:
         newDtStr = newDt.toString(DB_DATETIME_FMT_QT)
         if newDtStr != self.datetime:
             self.datetime = newDtStr
             self.dtBtn.setText(datetimeTrans(newDtStr))
             self.timeModified = True
Esempio n. 5
0
 def on_dtBtn_clicked(self):
     """Show datetime edit dialog"""
     if self.readOnly: return
     dtStr = currentDatetime() if self.datetime is None else self.datetime
     newDt = DateTimeDialog.getDateTime(datetimeToQt(dtStr), fullDatetimeFmt, self)
     if newDt is not None:
         newDtStr = newDt.toString(DB_DATETIME_FMT_QT)
         if newDtStr != self.datetime:
             self.datetime = newDtStr
             self.dtBtn.setText(datetimeTrans(newDtStr))
             self.timeModified = True