Fix #1814 (Update choose_library.ui)

This commit is contained in:
Kovid Goyal 2023-01-08 10:32:43 +05:30
parent 7a829f484a
commit 8114376b2f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 91 additions and 81 deletions

View File

@ -5,17 +5,17 @@ __license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, errno
from threading import Thread, Event
from qt.core import QDialog, QTimer, Qt, pyqtSignal
import errno
import os
from qt.core import QDialog, Qt, QTimer, pyqtSignal
from threading import Event, Thread
from calibre import force_unicode, isbytestring, patheq
from calibre.constants import filesystem_encoding, get_portable_base, iswindows
from calibre.gui2 import choose_dir, error_dialog
from calibre.gui2.dialogs.choose_library_ui import Ui_Dialog
from calibre.gui2.dialogs.progress import ProgressDialog as PD
from calibre.gui2 import error_dialog, choose_dir
from calibre.constants import (filesystem_encoding, iswindows,
get_portable_base)
from calibre import isbytestring, patheq, force_unicode
from calibre.utils.localization import localize_user_manual_link
class ProgressDialog(PD):
@ -43,8 +43,11 @@ class ProgressDialog(PD):
class ChooseLibrary(QDialog, Ui_Dialog):
def __init__(self, db, callback, parent):
QDialog.__init__(self, parent)
super().__init__(parent)
self.setupUi(self)
self.nas_warning.setText(self.nas_warning.text().format(localize_user_manual_link(
'https://manual.calibre-ebook.com/faq.html#i-am-getting-errors-with-my-calibre-library-on-a-networked-drive-nas')))
self.nas_warning.setOpenExternalLinks(True)
self.db = db
self.new_db = None
self.callback = callback

View File

@ -28,66 +28,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>New &amp;location:</string>
</property>
<property name="buddy">
<cstring>location</cstring>
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<widget class="QRadioButton" name="existing_library">
<property name="text">
<string>Use the previously &amp;existing library at the new location</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" colspan="3">
<layout class="QHBoxLayout" name="hbox1">
<item>
<widget class="QRadioButton" name="empty_library">
<property name="text">
<string>&amp;Create an empty library at the new location</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="copy_structure">
<property name="toolTip">
<string>Copy the custom columns, saved searches, column widths, plugboards,
user categories, and other information from the old to the new library</string>
</property>
<property name="text">
<string>&amp;Copy structure from the current library</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="0" colspan="3">
<widget class="QRadioButton" name="move_library">
<property name="text">
<string>&amp;Move the current library to new location</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="7" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -100,19 +41,6 @@ user categories, and other information from the old to the new library</string>
</property>
</spacer>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
@ -137,6 +65,55 @@ user categories, and other information from the old to the new library</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="5" column="0" colspan="4">
<widget class="QRadioButton" name="existing_library">
<property name="text">
<string>Use the previously &amp;existing library at the new location</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<layout class="QHBoxLayout" name="hbox1">
<item>
<widget class="QRadioButton" name="empty_library">
<property name="text">
<string>&amp;Create an empty library at the new location</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="copy_structure">
<property name="toolTip">
<string>Copy the custom columns, saved searches, column widths, plugboards,
user categories, and other information from the old to the new library</string>
</property>
<property name="text">
<string>&amp;Copy structure from the current library</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="0" colspan="3">
<widget class="QRadioButton" name="move_library">
<property name="text">
<string>&amp;Move the current library to new location</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="HistoryLineEdit" name="location">
<property name="sizeAdjustPolicy">
@ -147,6 +124,36 @@ user categories, and other information from the old to the new library</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>New &amp;location:</string>
</property>
<property name="buddy">
<cstring>location</cstring>
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<widget class="QLabel" name="nas_warning">
<property name="text">
<string>Note that putting the calibre library on a Networked drive &lt;a href=&quot;{}&quot;&gt;is not safe&lt;/a&gt;.</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>