From 7483a4389fbe9f485cab845179586a9d0a5becf6 Mon Sep 17 00:00:00 2001
From: Charles Haley <>
Date: Tue, 4 May 2010 16:29:01 +0100
Subject: [PATCH 1/3] Play with main UI layout -- move restriction box
---
src/calibre/gui2/main.ui | 122 ++++++++++++++++++---------------------
1 file changed, 56 insertions(+), 66 deletions(-)
diff --git a/src/calibre/gui2/main.ui b/src/calibre/gui2/main.ui
index 8dcb0e6d75..c076bf6b03 100644
--- a/src/calibre/gui2/main.ui
+++ b/src/calibre/gui2/main.ui
@@ -157,6 +157,30 @@
0
+ -
+
+
+ &Restrict to:
+
+
+ search_restriction
+
+
+
+ -
+
+
+ Books display will be restricted to those matching the selected saved search
+
+
+
+ -
+
+
+ set in ui.py
+
+
+
-
@@ -206,13 +230,6 @@
- -
-
-
- set in ui.py
-
-
-
-
@@ -336,69 +353,42 @@
-
-
-
- Sort by &popularity
+
-
+
+
+ Sort by &popularity
+
+
+
+
+ -
+
+
+ 0
+
-
+
+ Match any
+
+
+ -
+
+ Match all
+
+
-
-
-
-
-
-
- 0
-
-
-
-
- Match any
-
-
- -
-
- Match all
-
-
-
-
- -
-
-
- Create, edit, and delete user categories
-
-
- Manage &user categories
-
-
-
-
-
- -
-
-
-
-
-
- &Restrict to:
-
-
- search_restriction
-
-
-
- -
-
-
-
- 50
- 0
-
-
-
- Books display will be restricted to those matching the selected saved search
-
-
-
-
+ -
+
+
+ Create, edit, and delete user categories
+
+
+ Manage &user categories
+
+
+
From 22e104d9b2a12b7c0a0270ac76f1cb2817d93883 Mon Sep 17 00:00:00 2001
From: Charles Haley <>
Date: Tue, 4 May 2010 16:36:30 +0100
Subject: [PATCH 2/3] Change restriction explanation label
---
src/calibre/gui2/main.ui | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/calibre/gui2/main.ui b/src/calibre/gui2/main.ui
index c076bf6b03..48396861b3 100644
--- a/src/calibre/gui2/main.ui
+++ b/src/calibre/gui2/main.ui
@@ -160,7 +160,7 @@
-
- &Restrict to:
+ &Restrict display to:
search_restriction
From 873481851dce529c0add189cf3ffc9bb273fad51 Mon Sep 17 00:00:00 2001
From: Charles Haley <>
Date: Tue, 4 May 2010 17:24:40 +0100
Subject: [PATCH 3/3] Fix problem with adding multiple columns: should not
delete from item being interated on
---
src/calibre/gui2/library.py | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/calibre/gui2/library.py b/src/calibre/gui2/library.py
index c1a8057844..cd8a078001 100644
--- a/src/calibre/gui2/library.py
+++ b/src/calibre/gui2/library.py
@@ -283,16 +283,17 @@ class BooksModel(QAbstractTableModel):
def read_config(self):
self.use_roman_numbers = config['use_roman_numerals_for_series_number']
- self.column_map = config['column_map'][:] # force a copy
+ cmap = config['column_map'][:] # force a copy
self.headers = {}
- for i in self.column_map: # take out any columns no longer in the db
- if not i in self.orig_headers and not i in self.custom_columns:
- self.column_map.remove(i)
- for i in self.column_map:
- if i in self.orig_headers:
- self.headers[i] = self.orig_headers[i]
- elif i in self.custom_columns:
- self.headers[i] = self.custom_columns[i]['name']
+ self.column_map = []
+ for col in cmap: # take out any columns no longer in the db
+ if col in self.orig_headers or col in self.custom_columns:
+ self.column_map.append(col)
+ for col in self.column_map:
+ if col in self.orig_headers:
+ self.headers[col] = self.orig_headers[col]
+ elif col in self.custom_columns:
+ self.headers[col] = self.custom_columns[col]['name']
self.build_data_convertors()
self.reset()
self.emit(SIGNAL('columns_sorted()'))