Small UI fixes. Compatibility with Qt version < 4.7.
- error callback for loadHistory, to make the reload button enabled again after an error - remove descriptionEdit's placeholder (for compatibilty with earlier versions of Qt) - add placeholder text to descriptionEdit if supported by the user's version of Qt - set contentEdit read-only while loading a new page - saveButton was still showing "Saving" after saving had failed
This commit is contained in:
parent
07c7b7b1be
commit
5daf71effe
2 changed files with 19 additions and 4 deletions
|
|
@ -62,6 +62,9 @@ class MainWindow(QtMainWindow):
|
||||||
SIGNAL("clicked()"),
|
SIGNAL("clicked()"),
|
||||||
self.loadHistory)
|
self.loadHistory)
|
||||||
|
|
||||||
|
if hasattr(self.ui.descriptionEdit, "setPlaceholderText"):
|
||||||
|
self.ui.descriptionEdit.setPlaceholderText("Edit summary")
|
||||||
|
|
||||||
if self.weboob.count_backends() == 0:
|
if self.weboob.count_backends() == 0:
|
||||||
self.backendsConfig()
|
self.backendsConfig()
|
||||||
else:
|
else:
|
||||||
|
|
@ -102,6 +105,7 @@ class MainWindow(QtMainWindow):
|
||||||
|
|
||||||
self.ui.loadButton.setEnabled(False)
|
self.ui.loadButton.setEnabled(False)
|
||||||
self.ui.loadButton.setText('Loading...')
|
self.ui.loadButton.setText('Loading...')
|
||||||
|
self.ui.contentEdit.setReadOnly(True)
|
||||||
|
|
||||||
backend = str(self.ui.backendBox.currentText())
|
backend = str(self.ui.backendBox.currentText())
|
||||||
self.process = QtDo(self.weboob,
|
self.process = QtDo(self.weboob,
|
||||||
|
|
@ -184,6 +188,7 @@ class MainWindow(QtMainWindow):
|
||||||
QMessageBox.critical(self, self.tr('Error while saving page'),
|
QMessageBox.critical(self, self.tr('Error while saving page'),
|
||||||
content, QMessageBox.Ok)
|
content, QMessageBox.Ok)
|
||||||
self.ui.saveButton.setEnabled(True)
|
self.ui.saveButton.setEnabled(True)
|
||||||
|
self.ui.saveButton.setText("Save")
|
||||||
|
|
||||||
def loadPreview(self):
|
def loadPreview(self):
|
||||||
""" Loads the current page's preview into the preview QTextEdit """
|
""" Loads the current page's preview into the preview QTextEdit """
|
||||||
|
|
@ -208,7 +213,9 @@ class MainWindow(QtMainWindow):
|
||||||
"Summary"])
|
"Summary"])
|
||||||
self.ui.historyTable.setColumnWidth(3, 1000)
|
self.ui.historyTable.setColumnWidth(3, 1000)
|
||||||
|
|
||||||
self.process = QtDo(self.weboob, self._gotRevision)
|
self.process = QtDo(self.weboob,
|
||||||
|
self._gotRevision,
|
||||||
|
self._errorHistory)
|
||||||
self.process.do('iter_revisions',
|
self.process.do('iter_revisions',
|
||||||
self.content.id,
|
self.content.id,
|
||||||
max_results=self.ui.nbRevBox.value(),
|
max_results=self.ui.nbRevBox.value(),
|
||||||
|
|
@ -245,3 +252,14 @@ class MainWindow(QtMainWindow):
|
||||||
self.ui.historyTable.setItem(row, 3, item_summary)
|
self.ui.historyTable.setItem(row, 3, item_summary)
|
||||||
|
|
||||||
self.ui.historyTable.setCurrentCell(row, 0)
|
self.ui.historyTable.setCurrentCell(row, 0)
|
||||||
|
|
||||||
|
def _errorHistory(self, backend, error, backtrace):
|
||||||
|
""" Loading the history has failed """
|
||||||
|
content = unicode(self.tr('Unable to load history:\n%s\n')) % to_unicode(error)
|
||||||
|
if logging.root.level == logging.DEBUG:
|
||||||
|
content += '\n%s\n' % to_unicode(backtrace)
|
||||||
|
QMessageBox.critical(self, self.tr('Error while loading history'),
|
||||||
|
content, QMessageBox.Ok)
|
||||||
|
|
||||||
|
self.ui.loadHistoryButton.setEnabled(True)
|
||||||
|
self.ui.loadHistoryButton.setText("Reload")
|
||||||
|
|
|
||||||
|
|
@ -147,9 +147,6 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="placeholderText">
|
|
||||||
<string>Edit summary</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue