Fix #1949448 [Opinion/enhancement request: Move 'welcome wizard' button to opposite side of preferences](https://bugs.launchpad.net/calibre/+bug/1949448)

This commit is contained in:
Kovid Goyal 2021-11-02 15:54:15 +05:30
parent 4b97f07532
commit ba89a2b970
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -12,9 +12,9 @@ from collections import OrderedDict
from functools import partial from functools import partial
from qt.core import ( from qt.core import (
QApplication, QDialog, QDialogButtonBox, QFont, QFrame, QHBoxLayout, QIcon, QApplication, QDialog, QDialogButtonBox, QFont, QFrame, QHBoxLayout, QIcon,
QLabel, QPainter, QPointF, QScrollArea, QSize, QSizePolicy, QStackedWidget, QLabel, QPainter, QPointF, QPushButton, QScrollArea, QSize, QSizePolicy,
QStatusTipEvent, Qt, QTabWidget, QTextLayout, QToolBar, QVBoxLayout, QWidget, QStackedWidget, QStatusTipEvent, Qt, QTabWidget, QTextLayout, QToolBar,
pyqtSignal QVBoxLayout, QWidget, pyqtSignal
) )
from calibre.constants import __appname__, __version__, islinux from calibre.constants import __appname__, __version__, islinux
@ -246,8 +246,7 @@ class Preferences(QDialog):
self.bb.button(QDialogButtonBox.StandardButton.Apply).clicked.connect(self.accept) self.bb.button(QDialogButtonBox.StandardButton.Apply).clicked.connect(self.accept)
self.bb.button(QDialogButtonBox.StandardButton.RestoreDefaults).setIcon(QIcon(I('clear_left.png'))) self.bb.button(QDialogButtonBox.StandardButton.RestoreDefaults).setIcon(QIcon(I('clear_left.png')))
self.bb.button(QDialogButtonBox.StandardButton.RestoreDefaults).clicked.connect(self.restore_defaults) self.bb.button(QDialogButtonBox.StandardButton.RestoreDefaults).clicked.connect(self.restore_defaults)
self.wizard_button = self.bb.addButton(_('Run Welcome &wizard'), QDialogButtonBox.ButtonRole.ActionRole) self.wizard_button = QPushButton(QIcon(I('wizard.png')), _('Run Welcome &wizard'))
self.wizard_button.setIcon(QIcon(I('wizard.png')))
self.wizard_button.clicked.connect(self.run_wizard, type=Qt.ConnectionType.QueuedConnection) self.wizard_button.clicked.connect(self.run_wizard, type=Qt.ConnectionType.QueuedConnection)
self.wizard_button.setAutoDefault(False) self.wizard_button.setAutoDefault(False)
self.bb.rejected.connect(self.reject) self.bb.rejected.connect(self.reject)
@ -264,7 +263,10 @@ class Preferences(QDialog):
(QDialogButtonBox.StandardButton.Cancel, _('Cancel and return to overview'))]: (QDialogButtonBox.StandardButton.Cancel, _('Cancel and return to overview'))]:
self.bb.button(ac).setToolTip(tt) self.bb.button(ac).setToolTip(tt)
l.addWidget(self.title_bar), l.addWidget(self.stack), l.addWidget(self.bb) l.addWidget(self.title_bar), l.addWidget(self.stack)
h = QHBoxLayout()
l.addLayout(h)
h.addWidget(self.wizard_button), h.addStretch(10), h.addWidget(self.bb)
if initial_plugin is not None: if initial_plugin is not None:
category, name = initial_plugin[:2] category, name = initial_plugin[:2]