mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge from trunk
This commit is contained in:
commit
308e6af73f
@ -4,7 +4,7 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
|||||||
'''Dialog to edit metadata in bulk'''
|
'''Dialog to edit metadata in bulk'''
|
||||||
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
import os, re, shutil
|
import re
|
||||||
|
|
||||||
from PyQt4.Qt import QDialog, QGridLayout
|
from PyQt4.Qt import QDialog, QGridLayout
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
@ -104,9 +104,9 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
|||||||
|
|
||||||
s_r_functions = {
|
s_r_functions = {
|
||||||
'' : lambda x: x,
|
'' : lambda x: x,
|
||||||
'lower' : lambda x: x.lower(),
|
_('Lower Case') : lambda x: x.lower(),
|
||||||
'upper' : lambda x: x.upper(),
|
_('Upper Case') : lambda x: x.upper(),
|
||||||
'title' : lambda x: x.title(),
|
_('Title Case') : lambda x: x.title(),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, window, rows, db):
|
def __init__(self, window, rows, db):
|
||||||
@ -203,10 +203,11 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
|
|||||||
self.search_for.editTextChanged[str].connect(self.s_r_paint_results)
|
self.search_for.editTextChanged[str].connect(self.s_r_paint_results)
|
||||||
self.replace_with.editTextChanged[str].connect(self.s_r_paint_results)
|
self.replace_with.editTextChanged[str].connect(self.s_r_paint_results)
|
||||||
self.test_text.editTextChanged[str].connect(self.s_r_paint_results)
|
self.test_text.editTextChanged[str].connect(self.s_r_paint_results)
|
||||||
|
self.central_widget.setCurrentIndex(0)
|
||||||
|
|
||||||
def s_r_field_changed(self, txt):
|
def s_r_field_changed(self, txt):
|
||||||
txt = unicode(txt)
|
txt = unicode(txt)
|
||||||
for i in range(0,self.s_r_number_of_books):
|
for i in range(0, self.s_r_number_of_books):
|
||||||
if txt:
|
if txt:
|
||||||
fm = self.db.field_metadata[txt]
|
fm = self.db.field_metadata[txt]
|
||||||
id = self.ids[i]
|
id = self.ids[i]
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="central_widget">
|
<widget class="QTabWidget" name="central_widget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabWidgetPage1">
|
<widget class="QWidget" name="tabWidgetPage1">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -47,7 +47,7 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_20">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Author(s): </string>
|
<string>&Author(s): </string>
|
||||||
</property>
|
</property>
|
||||||
@ -128,7 +128,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_30">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Publisher: </string>
|
<string>&Publisher: </string>
|
||||||
</property>
|
</property>
|
||||||
@ -148,7 +148,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="label_41">
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Add ta&gs: </string>
|
<string>Add ta&gs: </string>
|
||||||
</property>
|
</property>
|
||||||
@ -244,7 +244,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="label_51">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Remove &format:</string>
|
<string>Remove &format:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -329,16 +329,16 @@ Future conversion of these books will use the default settings.</string>
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="filler">
|
<widget class="QLabel" name="filler">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string> </string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_21">
|
<widget class="QLabel" name="xlabel_21">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Search &field:</string>
|
<string>Search &field:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -348,7 +348,7 @@ Future conversion of these books will use the default settings.</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QLabel" name="label_22">
|
<widget class="QLabel" name="xlabel_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Search for:</string>
|
<string>&Search for:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -358,7 +358,7 @@ Future conversion of these books will use the default settings.</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="3" column="2">
|
||||||
<widget class="QLabel" name="label_42">
|
<widget class="QLabel" name="xlabel_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Replace with:</string>
|
<string>&Replace with:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -377,7 +377,7 @@ Future conversion of these books will use the default settings.</string>
|
|||||||
<widget class="HistoryLineEdit" name="replace_with"/>
|
<widget class="HistoryLineEdit" name="replace_with"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QLabel" name="label_43">
|
<widget class="QLabel" name="label_41">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Apply function &after replace:</string>
|
<string>Apply function &after replace:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -390,7 +390,7 @@ Future conversion of these books will use the default settings.</string>
|
|||||||
<widget class="QComboBox" name="replace_func"/>
|
<widget class="QComboBox" name="replace_func"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QLabel" name="label_31">
|
<widget class="QLabel" name="xlabel_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Test &text</string>
|
<string>Test &text</string>
|
||||||
</property>
|
</property>
|
||||||
@ -400,7 +400,7 @@ Future conversion of these books will use the default settings.</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="2">
|
<item row="6" column="2">
|
||||||
<widget class="QLabel" name="label_52">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Test re&sult</string>
|
<string>Test re&sult</string>
|
||||||
</property>
|
</property>
|
||||||
@ -410,7 +410,7 @@ Future conversion of these books will use the default settings.</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QLabel" name="label_32">
|
<widget class="QLabel" name="label_31">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Your test:</string>
|
<string>Your test:</string>
|
||||||
</property>
|
</property>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user