This commit is contained in:
Kovid Goyal 2012-06-05 10:52:44 +05:30
parent 61a3c2aae4
commit 08dada2281
2 changed files with 6 additions and 2 deletions

View File

@ -42,7 +42,7 @@ class ProceedQuestion(QDialog):
ic.setMaximumHeight(100)
ic.setScaledContents(True)
ic.setStyleSheet('QLabel { margin-right: 10px }')
self.bb = QDialogButtonBox(QDialogButtonBox.Yes|QDialogButtonBox.No)
self.bb = QDialogButtonBox()
self.bb.accepted.connect(self.accept)
self.bb.rejected.connect(self.reject)
self.log_button = self.bb.addButton(_('View log'), self.bb.ActionRole)
@ -59,6 +59,7 @@ class ProceedQuestion(QDialog):
_('Show detailed information about this error'))
self.det_msg = QPlainTextEdit(self)
self.det_msg.setReadOnly(True)
self.bb.setStandardButtons(self.bb.Yes|self.bb.No)
self.bb.button(self.bb.Yes).setDefault(True)
l.addWidget(ic, 0, 0, 1, 1)

View File

@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
from calibre.gui2 import Application
from PyQt4.Qt import (QDialog, QGridLayout, QListWidget, QDialogButtonBox,
QPushButton, QTimer)
QPushButton, QTimer, QIcon)
app = Application([], force_calibre_style=True)
@ -23,7 +23,10 @@ bb = QDialogButtonBox()
bb.setStandardButtons(bb.Close)
bb.accepted.connect(d.accept)
bb.rejected.connect(d.reject)
b = bb.addButton('Action', bb.ActionRole)
b.setIcon(QIcon(I('wizard.png')))
l.addWidget(bb, 2, 0, 1, 2)
bb.button(bb.Close).setDefault(True)
b = QPushButton('Normal')
l.addWidget(b, 0, 1, 1, 1)