Make clickable link and HTML formatting in About box.

This commit is contained in:
Jim Miller 2011-12-25 17:36:36 -06:00
parent 74ac6fb348
commit e3ceeb937f
2 changed files with 34 additions and 9 deletions

View file

@ -1,11 +1,11 @@
FanFictionDownLoader Plugin
===========================
<p>FanFictionDownLoader Plugin</p>
<hr />
http://code.google.com/p/fanficdownloader/
<p><a href="http://code.google.com/p/fanficdownloader/">http://code.google.com/p/fanficdownloader/</a></p>
Created by Jim Miller, borrowing heavily from
<p>Created by Jim Miller, borrowing heavily from
Kovid Goyal's 'The InterfacePlugin Demo' and
Grant Drake's 'Count Pages' plugins.
Grant Drake's 'Count Pages' plugins.</p>
Requires calibre >= 0.7.53
<p>Requires calibre >= 0.7.53</p>

View file

@ -12,7 +12,7 @@ import traceback
from PyQt4.Qt import (QDialog, QMessageBox, QVBoxLayout, QHBoxLayout, QGridLayout,
QPushButton, QProgressDialog, QString, QLabel, QCheckBox,
QTextEdit, QLineEdit, QInputDialog, QComboBox, QClipboard,
QProgressDialog, QTimer )
QProgressDialog, QTimer, QDialogButtonBox, QPixmap, Qt )
from calibre.gui2 import error_dialog, warning_dialog, question_dialog, info_dialog
@ -123,8 +123,9 @@ class DownloadDialog(QDialog):
# get_resources will return a dictionary mapping names to bytes. Names that
# are not found in the zip file will not be in the returned dictionary.
text = get_resources('about.txt')
QMessageBox.about(self, 'About the FanFictionDownLoader Plugin',
text.decode('utf-8'))
# QMessageBox.about(self, 'About the FanFictionDownLoader Plugin',
# text.decode('utf-8'))
AboutDialog(self.windowIcon(),text,self).exec_()
def ffdl(self):
self.start_downloads(unicode(self.url.toPlainText()),
@ -253,6 +254,30 @@ class MetadataProgressDialog(QProgressDialog):
# show_copy_button=False).exec_()
self.gui = None
class AboutDialog(QDialog):
def __init__(self, icon, text, parent=None):
QDialog.__init__(self, parent)
self.resize(400, 250)
self.l = QGridLayout()
self.setLayout(self.l)
self.logo = QLabel()
self.logo.setMaximumWidth(110)
self.logo.setPixmap(QPixmap(icon.pixmap(100,100)))
self.label = QLabel(text)
self.label.setOpenExternalLinks(True)
self.label.setWordWrap(True)
self.setWindowTitle(_('Update available!'))
self.setWindowIcon(icon)
self.l.addWidget(self.logo, 0, 0)
self.l.addWidget(self.label, 0, 1)
self.bb = QDialogButtonBox(self)
b = self.bb.addButton(_('OK'), self.bb.AcceptRole)
b.setDefault(True)
self.l.addWidget(self.bb, 2, 0, 1, -1)
self.bb.accepted.connect(self.accept)
class NotGoingToDownload(Exception):
def __init__(self,error):
self.error=error