WIP - ini edit, error check and syntax highlighting.

This commit is contained in:
Jim Miller 2014-12-30 13:18:23 -06:00
parent bb098c1865
commit 55acb0c87c
2 changed files with 28 additions and 15 deletions

View file

@ -597,10 +597,14 @@ class PersonalIniTab(QWidget):
label = QLabel(_('These settings provide more detailed control over what metadata will be displayed inside the ebook as well as let you set %(isa)s and %(u)s/%(p)s for different sites.')%no_trans)
label.setWordWrap(True)
self.l.addWidget(label)
self.l.addSpacing(5)
# self.l.addSpacing(5)
label = QLabel(_("<b>New:</b> This experimental version includes find, color coding, and error checking. Red generally indicates errors. Not all errors can be found."))
label.setWordWrap(True)
self.l.addWidget(label)
self.label = QLabel('personal.ini:')
self.l.addWidget(self.label)
# self.label = QLabel('personal.ini:')
# self.l.addWidget(self.label)
# self.ini = QTextEdit(self)
# try:
@ -619,14 +623,16 @@ class PersonalIniTab(QWidget):
self.ini_button.clicked.connect(self.add_ini_button)
self.l.addWidget(self.ini_button)
self.defaults = QPushButton(_('View Defaults')+' (plugin-defaults.ini)', self)
self.defaults.setToolTip(_("View all of the plugin's configurable settings\nand their default settings."))
self.defaults.clicked.connect(self.show_defaults)
self.l.addWidget(self.defaults)
label = QLabel(_("Changes will only be saved if you click 'OK' to leave Customize FFDL."))
label.setWordWrap(True)
self.l.addWidget(label)
# self.l.insertStretch(-1)
self.l.insertStretch(-1)
# let edit box fill the space.
def show_defaults(self):
@ -659,7 +665,7 @@ class PersonalIniTab(QWidget):
if errors:
retry = errors_dialog(self.plugin_action.gui,
_('Go back to fix errors?'),
'<p>'+'</p><p>'.join([ '%s %s'%e for e in errors ])+'</p>')
'<p>'+'</p><p>'.join([ '(lineno: %s) %s'%e for e in errors ])+'</p>')
else:
retry = False

View file

@ -1344,20 +1344,27 @@ class ViewLog(SizePersistedDialog):
self.l = l = QVBoxLayout()
self.setLayout(l)
label = QLabel(_('Eventually I intend for errors to be clickable and take you to the error in the file. For now, use copy and Find.'))
label.setWordWrap(True)
self.l.addWidget(label)
self.tb = QTextBrowser(self)
self.tb.setFont(QFont("Courier",
parent.font().pointSize()+1))
self.tb.setHtml(html)
l.addWidget(self.tb)
self.bb = QDialogButtonBox(QDialogButtonBox.Yes | QDialogButtonBox.No)
self.bb.accepted.connect(self.accept)
self.bb.rejected.connect(self.reject)
# self.copy_button = self.bb.addButton(_('Copy to clipboard'),
# self.bb.ActionRole)
# self.copy_button.setIcon(QIcon(I('edit-copy.png')))
# self.copy_button.clicked.connect(self.copy_to_clipboard)
l.addWidget(self.bb)
horz = QHBoxLayout()
editagain = QPushButton(_('Edit Ini Again'), self)
editagain.clicked.connect(self.accept)
horz.addWidget(editagain)
saveanyway = QPushButton(_('Save Ini Anyway'), self)
saveanyway.clicked.connect(self.reject)
horz.addWidget(saveanyway)
l.addLayout(horz)
self.setModal(False)
self.setWindowTitle(title)
self.setWindowIcon(QIcon(I('debug.png')))