mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Fix #1857923 [[Enhancement] Remeber last paths in automatic adding](https://bugs.launchpad.net/calibre/+bug/1857923)
This commit is contained in:
parent
f24fbd5312
commit
bf83df219c
@ -63,9 +63,6 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLineEdit" name="opt_debug_pipeline">
|
<widget class="QLineEdit" name="opt_debug_pipeline">
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="clearButtonEnabled">
|
<property name="clearButtonEnabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
@ -15,6 +15,7 @@ from PyQt5.Qt import (QWidget, pyqtSignal, QCheckBox, QAbstractSpinBox, QApplica
|
|||||||
from calibre.customize.ui import preferences_plugins
|
from calibre.customize.ui import preferences_plugins
|
||||||
from calibre.utils.config import ConfigProxy
|
from calibre.utils.config import ConfigProxy
|
||||||
from calibre.gui2.complete2 import EditWithComplete
|
from calibre.gui2.complete2 import EditWithComplete
|
||||||
|
from calibre.gui2.widgets import HistoryLineEdit
|
||||||
from polyglot.builtins import unicode_type, string_or_bytes
|
from polyglot.builtins import unicode_type, string_or_bytes
|
||||||
|
|
||||||
|
|
||||||
@ -109,9 +110,11 @@ class Setting(object):
|
|||||||
elif isinstance(self.gui_obj, QAbstractSpinBox):
|
elif isinstance(self.gui_obj, QAbstractSpinBox):
|
||||||
self.datatype = 'number'
|
self.datatype = 'number'
|
||||||
self.gui_obj.valueChanged.connect(self.changed)
|
self.gui_obj.valueChanged.connect(self.changed)
|
||||||
elif isinstance(self.gui_obj, QLineEdit):
|
elif isinstance(self.gui_obj, (QLineEdit, HistoryLineEdit)):
|
||||||
self.datatype = 'string'
|
self.datatype = 'string'
|
||||||
self.gui_obj.textChanged.connect(self.changed)
|
self.gui_obj.textChanged.connect(self.changed)
|
||||||
|
if isinstance(self.gui_obj, HistoryLineEdit):
|
||||||
|
self.gui_obj.initialize('preferences_setting_' + self.name)
|
||||||
elif isinstance(self.gui_obj, QComboBox):
|
elif isinstance(self.gui_obj, QComboBox):
|
||||||
self.datatype = 'choice'
|
self.datatype = 'choice'
|
||||||
self.gui_obj.editTextChanged.connect(self.changed)
|
self.gui_obj.editTextChanged.connect(self.changed)
|
||||||
|
@ -93,6 +93,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
|||||||
_('Choose a folder'))
|
_('Choose a folder'))
|
||||||
if path:
|
if path:
|
||||||
self.opt_auto_add_path.setText(path)
|
self.opt_auto_add_path.setText(path)
|
||||||
|
self.opt_auto_add_path.save_history()
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
ConfigWidgetBase.initialize(self)
|
ConfigWidgetBase.initialize(self)
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -313,10 +313,13 @@ that have been explicitly ignored below.</string>
|
|||||||
<item row="1" column="0" colspan="2">
|
<item row="1" column="0" colspan="2">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="opt_auto_add_path">
|
<widget class="HistoryLineEdit" name="opt_auto_add_path">
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>Folder to automatically add files from</string>
|
<string>Folder to automatically add files from</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="clearButtonEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -436,6 +439,13 @@ that have been explicitly ignored below.</string>
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>HistoryLineEdit</class>
|
||||||
|
<extends>QLineEdit</extends>
|
||||||
|
<header>calibre/gui2/widgets.h</header>
|
||||||
|
</customwidget>
|
||||||
|
</customwidgets>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../../resources/images.qrc"/>
|
<include location="../../../../resources/images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -669,6 +669,7 @@ class HistoryLineEdit(QComboBox): # {{{
|
|||||||
self.setInsertPolicy(self.NoInsert)
|
self.setInsertPolicy(self.NoInsert)
|
||||||
self.setMaxCount(10)
|
self.setMaxCount(10)
|
||||||
self.setClearButtonEnabled = self.lineEdit().setClearButtonEnabled
|
self.setClearButtonEnabled = self.lineEdit().setClearButtonEnabled
|
||||||
|
self.textChanged = self.editTextChanged
|
||||||
|
|
||||||
def setPlaceholderText(self, txt):
|
def setPlaceholderText(self, txt):
|
||||||
return self.lineEdit().setPlaceholderText(txt)
|
return self.lineEdit().setPlaceholderText(txt)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user