From 91bce0e1757b1d0a416b1621741d9db0cc5e4387 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 5 May 2013 08:54:54 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/actions/choose_library.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/actions/choose_library.py b/src/calibre/gui2/actions/choose_library.py index d38c16ddf3..0d096d66bd 100644 --- a/src/calibre/gui2/actions/choose_library.py +++ b/src/calibre/gui2/actions/choose_library.py @@ -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())