mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get Books: IMprove search for e-knigi and Chitanka
This commit is contained in:
commit
2222918260
@ -252,7 +252,7 @@ class SearchDialog(QDialog, Ui_Dialog):
|
|||||||
# Milliseconds
|
# Milliseconds
|
||||||
self.hang_time = self.config.get('hang_time', 75) * 1000
|
self.hang_time = self.config.get('hang_time', 75) * 1000
|
||||||
|
|
||||||
self.max_results = self.config.get('max_results', 10)
|
self.max_results = self.config.get('max_results', 15)
|
||||||
self.should_open_external = self.config.get('open_external', True)
|
self.should_open_external = self.config.get('open_external', True)
|
||||||
|
|
||||||
# Number of threads to run for each type of operation
|
# Number of threads to run for each type of operation
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<string>Get Books</string>
|
<string>Get Books</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset resource="../../../../../resources/images.qrc">
|
<iconset>
|
||||||
<normaloff>:/images/store.png</normaloff>:/images/store.png</iconset>
|
<normaloff>:/images/store.png</normaloff>:/images/store.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeGripEnabled">
|
<property name="sizeGripEnabled">
|
||||||
@ -82,8 +82,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>173</width>
|
<width>193</width>
|
||||||
<height>106</height>
|
<height>127</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@ -254,6 +254,19 @@
|
|||||||
<header>widgets.h</header>
|
<header>widgets.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>search_edit</tabstop>
|
||||||
|
<tabstop>search</tabstop>
|
||||||
|
<tabstop>results_view</tabstop>
|
||||||
|
<tabstop>store_list</tabstop>
|
||||||
|
<tabstop>select_all_stores</tabstop>
|
||||||
|
<tabstop>select_invert_stores</tabstop>
|
||||||
|
<tabstop>select_none_stores</tabstop>
|
||||||
|
<tabstop>configure</tabstop>
|
||||||
|
<tabstop>open_external</tabstop>
|
||||||
|
<tabstop>close</tabstop>
|
||||||
|
<tabstop>adv_search_button</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../../../resources/images.qrc"/>
|
<include location="../../../../../resources/images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -40,9 +40,9 @@ class ChitankaStore(BasicStoreConfig, StorePlugin):
|
|||||||
d.exec_()
|
d.exec_()
|
||||||
|
|
||||||
def search(self, query, max_results=10, timeout=60):
|
def search(self, query, max_results=10, timeout=60):
|
||||||
# check for cyrilic symbols before performing search
|
# check for cyrillic symbols before performing search
|
||||||
uquery = unicode(query.strip(), 'utf-8')
|
uquery = unicode(query.strip(), 'utf-8')
|
||||||
reObj = re.search(u'^[а-яА-Я\\d]{4,}[а-яА-Я\\d\\s]*$', uquery)
|
reObj = re.search(u'^[а-яА-Я\\d\\s]{3,}$', uquery)
|
||||||
if not reObj:
|
if not reObj:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -46,9 +46,9 @@ class eKnigiStore(BasicStoreConfig, StorePlugin):
|
|||||||
d.exec_()
|
d.exec_()
|
||||||
|
|
||||||
def search(self, query, max_results=10, timeout=60):
|
def search(self, query, max_results=10, timeout=60):
|
||||||
# check for cyrilic symbols before performing search
|
# check for cyrillic symbols before performing search
|
||||||
uquery = unicode(query.strip(), 'utf-8')
|
uquery = unicode(query.strip(), 'utf-8')
|
||||||
reObj = re.search(u'^[а-яА-Я\\d]{2,}[а-яА-Я\\d\\s]*$', uquery)
|
reObj = re.search(u'^[а-яА-Я\\d\\s]{2,}$', uquery)
|
||||||
if not reObj:
|
if not reObj:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user