mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When switching to a library that does not exist, allow the user to abort the switch without forgetting the library. Fixes #1176364 ([Enhancement] Off-line Library)
This commit is contained in:
parent
e7268bc39f
commit
91bce0e175
@ -116,11 +116,12 @@ class MovedDialog(QDialog): # {{{
|
||||
self.cd.setIcon(QIcon(I('document_open.png')))
|
||||
self.cd.clicked.connect(self.choose_dir)
|
||||
l.addWidget(self.cd, 2, 1, 1, 1)
|
||||
self.bb = QDialogButtonBox(self)
|
||||
self.bb = QDialogButtonBox(QDialogButtonBox.Abort)
|
||||
b = self.bb.addButton(_('Library moved'), self.bb.AcceptRole)
|
||||
b.setIcon(QIcon(I('ok.png')))
|
||||
b = self.bb.addButton(_('Forget library'), self.bb.RejectRole)
|
||||
b.setIcon(QIcon(I('edit-clear.png')))
|
||||
b.clicked.connect(self.forget_library)
|
||||
self.bb.accepted.connect(self.accept)
|
||||
self.bb.rejected.connect(self.reject)
|
||||
l.addWidget(self.bb, 3, 0, 1, ncols)
|
||||
@ -132,9 +133,8 @@ class MovedDialog(QDialog): # {{{
|
||||
if d is not None:
|
||||
self.loc.setText(d)
|
||||
|
||||
def reject(self):
|
||||
def forget_library(self):
|
||||
self.stats.remove(self.location)
|
||||
QDialog.reject(self)
|
||||
|
||||
def accept(self):
|
||||
newloc = unicode(self.loc.text())
|
||||
|
Loading…
x
Reference in New Issue
Block a user