mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
be03fdbb5c
commit
312e1951dc
@ -202,9 +202,6 @@ def question_dialog(parent, title, msg, det_msg='', show_copy_button=False,
|
|||||||
from calibre.gui2.dialogs.message_box import MessageBox
|
from calibre.gui2.dialogs.message_box import MessageBox
|
||||||
d = MessageBox(MessageBox.QUESTION, title, msg, det_msg, parent=parent,
|
d = MessageBox(MessageBox.QUESTION, title, msg, det_msg, parent=parent,
|
||||||
show_copy_button=show_copy_button)
|
show_copy_button=show_copy_button)
|
||||||
if buttons is not None:
|
|
||||||
d.bb.setStandardButtons(buttons)
|
|
||||||
|
|
||||||
return d.exec_() == d.Accepted
|
return d.exec_() == d.Accepted
|
||||||
|
|
||||||
def info_dialog(parent, title, msg, det_msg='', show=False,
|
def info_dialog(parent, title, msg, det_msg='', show=False,
|
||||||
|
@ -92,7 +92,10 @@ class MessageBox(QDialog, Ui_Dialog):
|
|||||||
def showEvent(self, ev):
|
def showEvent(self, ev):
|
||||||
ret = QDialog.showEvent(self, ev)
|
ret = QDialog.showEvent(self, ev)
|
||||||
if self.is_question:
|
if self.is_question:
|
||||||
self.bb.button(self.bb.Yes).setFocus(Qt.OtherFocusReason)
|
try:
|
||||||
|
self.bb.button(self.bb.Yes).setFocus(Qt.OtherFocusReason)
|
||||||
|
except:
|
||||||
|
pass# Buttons were changed
|
||||||
else:
|
else:
|
||||||
self.bb.button(self.bb.Ok).setFocus(Qt.OtherFocusReason)
|
self.bb.button(self.bb.Ok).setFocus(Qt.OtherFocusReason)
|
||||||
return ret
|
return ret
|
||||||
|
@ -11,7 +11,7 @@ from functools import partial
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
from PyQt4.Qt import SIGNAL, QObject, Qt, QTimer, QDate, \
|
from PyQt4.Qt import SIGNAL, QObject, Qt, QTimer, QDate, \
|
||||||
QPixmap, QListWidgetItem, QDialog, pyqtSignal, QMessageBox, QIcon, \
|
QPixmap, QListWidgetItem, QDialog, pyqtSignal, QIcon, \
|
||||||
QPushButton
|
QPushButton
|
||||||
|
|
||||||
from calibre.gui2 import error_dialog, file_icon_provider, dynamic, \
|
from calibre.gui2 import error_dialog, file_icon_provider, dynamic, \
|
||||||
@ -770,9 +770,7 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
|
|||||||
if question_dialog(self, _('Tags changed'),
|
if question_dialog(self, _('Tags changed'),
|
||||||
_('You have changed the tags. In order to use the tags'
|
_('You have changed the tags. In order to use the tags'
|
||||||
' editor, you must either discard or apply these '
|
' editor, you must either discard or apply these '
|
||||||
'changes'), show_copy_button=False,
|
'changes. Apply changes?'), show_copy_button=False):
|
||||||
buttons=QMessageBox.Apply|QMessageBox.Discard,
|
|
||||||
yes_button=QMessageBox.Apply):
|
|
||||||
self.apply_tags(commit=True, notify=True)
|
self.apply_tags(commit=True, notify=True)
|
||||||
self.original_tags = unicode(self.tags.text())
|
self.original_tags = unicode(self.tags.text())
|
||||||
else:
|
else:
|
||||||
|
@ -10,7 +10,7 @@ import textwrap, re, os
|
|||||||
from PyQt4.Qt import Qt, QDateEdit, QDate, \
|
from PyQt4.Qt import Qt, QDateEdit, QDate, \
|
||||||
QIcon, QToolButton, QWidget, QLabel, QGridLayout, \
|
QIcon, QToolButton, QWidget, QLabel, QGridLayout, \
|
||||||
QDoubleSpinBox, QListWidgetItem, QSize, QPixmap, \
|
QDoubleSpinBox, QListWidgetItem, QSize, QPixmap, \
|
||||||
QPushButton, QSpinBox, QMessageBox, QLineEdit
|
QPushButton, QSpinBox, QLineEdit
|
||||||
|
|
||||||
from calibre.gui2.widgets import EnLineEdit, CompleteComboBox, \
|
from calibre.gui2.widgets import EnLineEdit, CompleteComboBox, \
|
||||||
EnComboBox, FormatList, ImageView, CompleteLineEdit
|
EnComboBox, FormatList, ImageView, CompleteLineEdit
|
||||||
@ -848,9 +848,7 @@ class TagsEdit(CompleteLineEdit): # {{{
|
|||||||
if question_dialog(self, _('Tags changed'),
|
if question_dialog(self, _('Tags changed'),
|
||||||
_('You have changed the tags. In order to use the tags'
|
_('You have changed the tags. In order to use the tags'
|
||||||
' editor, you must either discard or apply these '
|
' editor, you must either discard or apply these '
|
||||||
'changes'), show_copy_button=False,
|
'changes. Apply changes?'), show_copy_button=False):
|
||||||
buttons=QMessageBox.Apply|QMessageBox.Discard,
|
|
||||||
yes_button=QMessageBox.Apply):
|
|
||||||
self.commit(db, id_)
|
self.commit(db, id_)
|
||||||
db.commit()
|
db.commit()
|
||||||
self.original_val = self.current_val
|
self.original_val = self.current_val
|
||||||
|
Loading…
x
Reference in New Issue
Block a user