Merge lp:~midori/midori/clippyEditor into lp:midori

Proposed by Christian Dywan on 2017-11-27
Status: Needs review
Proposed branch: lp:~midori/midori/clippyEditor
Merge into: lp:midori
Prerequisite: lp:~midori/midori/clippyBookmarks
Diff against target: 1021 lines (+408/-453)
7 files modified
extensions/clippy.vala (+160/-1)
midori/midori-bookmarks-db.c (+215/-0)
midori/midori-bookmarks-db.h (+4/-0)
midori/midori-browser.c (+21/-450)
midori/midori.vapi (+6/-0)
panels/midori-bookmarks.c (+1/-1)
panels/midori-history.c (+1/-1)
To merge this branch: bzr merge lp:~midori/midori/clippyEditor
Reviewer Review Type Date Requested Status
Midori Devs 2017-11-27 Pending
Review via email: mp+334320@code.launchpad.net

Commit message

Move bookmark editor into clippy

Description of the change

This branch moves the bookmark editor into Clippy (and always uses a popover in all cases, no dialog, for consistency). The combo box created from the bookmarks database moves out of Browser into to BookmarksDb, which is where it should've been in the first place.

To post a comment you must log in.

Unmerged revisions

7175. By Christian Dywan on 2017-11-27

Move bookmark editor into clippy

7174. By Christian Dywan on 2017-11-26

Move bookmarkbar into clippy extension

7173. By Christian Dywan on 2017-11-26

Drop pass-through-console flag

7172. By Christian Dywan on 2017-11-25

Unconditionally include WebKit2 headers

7171. By Christian Dywan on 2017-11-07

Drop non-WebKit2 website saving code path

7170. By Christian Dywan on 2017-11-06

Non-conditional skipping of non-WebKit2 extensions

7169. By Christian Dywan on 2017-11-06

Drop non-WebKit2/ non-libnotify code paths

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'extensions/clippy.vala'
--- extensions/clippy.vala 2017-11-27 17:24:49 +0000
+++ extensions/clippy.vala 2017-11-27 17:24:49 +0000
@@ -10,6 +10,129 @@
10*/10*/
1111
12namespace Bookmarks {12namespace Bookmarks {
13 private class Editor : Gtk.Popover {
14 Midori.Browser browser;
15 bool new_bookmark;
16 bool is_folder;
17 Katze.Item bookmark;
18 Gtk.Button accept;
19 Gtk.Entry entry_title;
20 Gtk.Entry entry_uri;
21 Gtk.ComboBox combo_folder;
22 Gtk.CheckButton check_toolbar;
23
24 public Editor (Midori.Browser browser, bool new_bookmark, bool is_folder, Katze.Item? bookmark_or_parent, Gtk.Widget? relative_to) {
25 this.browser = browser;
26 this.new_bookmark = new_bookmark;
27 this.is_folder = is_folder;
28
29 this.relative_to = relative_to ?? browser.get_titlebar ();
30 set_border_width (12);
31 var content_area = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
32 add (content_area);
33 var actions = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
34 content_area.pack_end (actions, true, true, 0);
35 accept = new Gtk.Button.from_stock (new_bookmark ? Gtk.Stock.ADD : Gtk.Stock.SAVE);
36 actions.pack_end (accept, false, false, 0);
37 accept.clicked.connect (accepted);
38 accept.set_can_default (true);
39 set_default_widget (accept);
40
41 var description = new Gtk.Label (is_folder ?
42 _("Type a name for this folder, and choose where to keep it.") :
43 _("Type a name for this bookmark, and choose where to keep it."));
44 var vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 6);
45 vbox.pack_start (description, false, false, 6);
46 content_area.pack_start (vbox, false, false, 0);
47
48 if (new_bookmark) {
49 var view = browser.tab as Midori.View;
50 if (is_folder) {
51 bookmark = new Katze.Array (typeof (Katze.Item));
52 } else {
53 bookmark = new Katze.Item ();
54 bookmark.uri = view.get_display_uri ();
55 }
56 bookmark.name = view.get_display_title ();
57 bookmark.set_meta_integer ("parentid", bookmark_or_parent != null
58 ? bookmark_or_parent.get_meta_integer ("id") : 0);
59 } else {
60 bookmark = bookmark_or_parent;
61 }
62
63 entry_title = new Gtk.Entry ();
64 entry_title.activates_default = true;
65 entry_title.text = bookmark.name != null ? bookmark.name : "";
66 entry_title.changed.connect (title_changed);
67 title_changed ();
68 vbox.pack_start (entry_title, false, false, 0);
69
70 if (!is_folder) {
71 entry_uri = new Gtk.Entry ();
72 entry_uri.activates_default = true;
73 entry_uri.text = bookmark.uri;
74 vbox.pack_start (entry_uri, false, false, 0);
75 }
76
77 var bookmarks = browser.bookmarks as Midori.BookmarksDb;
78 combo_folder = bookmarks.folder_button_new (bookmark.get_meta_integer ("parentid"));
79 vbox.pack_start (combo_folder, false, false, 0);
80
81 var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
82 vbox.pack_start (hbox, false, false, 0);
83 check_toolbar = new Gtk.CheckButton.with_mnemonic (_("Show in Bookmarks _Bar"));
84 check_toolbar.active = bookmark.get_meta_boolean ("toolbar");
85 hbox.pack_start (check_toolbar, false, false, 0);
86
87 if (new_bookmark && !is_folder) {
88 var label = new Gtk.Button.with_mnemonic (_("Add to _Speed Dial"));
89 label.clicked.connect (() => {
90 var view = browser.tab as Midori.View;
91 browser.speed_dial.add (view.get_display_uri (), view.get_display_title (), null);
92 destroy ();
93 });
94 actions.pack_start (label, false, false, 0);
95
96 /* FIXME: There's no API for extending the bookmark dialog */
97 var action_group = browser.get_action_group ();
98 var action = action_group.get_action ("CreateLauncher");
99 if (action != null) {
100 label = new Gtk.Button.with_mnemonic (action.label);
101 label.clicked.connect (() => {
102 action.activate ();
103 destroy ();
104 });
105 actions.pack_start (label, false, false, 0);
106 }
107 }
108
109 content_area.show_all ();
110 show ();
111 }
112
113 void title_changed () {
114 accept.sensitive = entry_title.text != null && entry_title.text != "";
115 }
116
117 void accepted () {
118 bookmark.name = entry_title.text;
119 bookmark.set_meta_integer ("toolbar", check_toolbar.active ? 1 : 0);
120 if (!(bookmark is Katze.Array))
121 bookmark.uri = entry_uri.text;
122 Gtk.TreeIter iter;
123 int64 parent_id = -1;
124 if (combo_folder.get_active_iter (out iter))
125 combo_folder.model.get (iter, 1, out parent_id);
126 bookmark.set_meta_integer ("parentid", parent_id);
127 var bookmarks = browser.bookmarks as Midori.BookmarksDb;
128 if (new_bookmark)
129 bookmarks.add_item (bookmark);
130 else
131 bookmarks.update_item (bookmark);
132 destroy ();
133 }
134 }
135
13 private class Toolbar : Gtk.Toolbar {136 private class Toolbar : Gtk.Toolbar {
14 Midori.Browser browser;137 Midori.Browser browser;
15 bool populating;138 bool populating;
@@ -120,15 +243,51 @@
120 void browser_added (Midori.Browser browser) {243 void browser_added (Midori.Browser browser) {
121 browser.notify["bookmarks"].connect (bookmarks_changed);244 browser.notify["bookmarks"].connect (bookmarks_changed);
122 browser.notify_property ("bookmarks");245 browser.notify_property ("bookmarks");
246
247 var action_group = browser.get_action_group ();
248 action_group.get_action ("BookmarkAdd").activate.connect ((action) => {
249 new Editor (browser, true, false, null,
250 action.get_data<Gtk.Widget?> ("proxy") ?? get_proxy (action));
251 });
252 action_group.get_action ("BookmarkFolderAdd").activate.connect ((action) => {
253 new Editor (browser, true, true, null,
254 action.get_data<Gtk.Widget?> ("proxy") ?? get_proxy (action));
255 });
256 action_group.get_action ("BookmarkEdit").activate.connect ((action) => {
257 new Editor (browser, false, false,
258 action.get_data<Katze.Item> ("bookmark"),
259 action.get_data<Gtk.Widget?> ("proxy"));
260 });
261 action_group.get_action ("BookmarkFolderEdit").activate.connect ((action) => {
262 new Editor (browser, false, true,
263 action.get_data<Katze.Item> ("bookmark"),
264 action.get_data<Gtk.Widget?> ("proxy"));
265 });
266 }
267
268 Gtk.Widget? get_proxy (Gtk.Action action) {
269 foreach (var proxy in action.get_proxies ()) {
270 if (proxy is Gtk.ToolItem)
271 return proxy;
272 }
273 return null;
123 }274 }
124275
125 void bookmarks_changed (GLib.Object object, GLib.ParamSpec pspec) {276 void bookmarks_changed (GLib.Object object, GLib.ParamSpec pspec) {
126 var browser = object as Midori.Browser;277 var browser = object as Midori.Browser;
127 var action_group = browser.get_action_group ();278 var action_group = browser.get_action_group ();
128 var action = action_group.get_action ("Bookmarkbar") as Gtk.ToggleAction;279 var action = action_group.get_action ("Bookmarkbar");
129 action.visible = browser.parent == null && browser.bookmarks != null;280 action.visible = browser.parent == null && browser.bookmarks != null;
130 if (action.visible)281 if (action.visible)
131 browser.add_toolbar (new Toolbar (browser));282 browser.add_toolbar (new Toolbar (browser));
283 action = action_group.get_action ("BookmarkAdd");
284 action.visible = browser.bookmarks != null;
285 action = action_group.get_action ("BookmarkFolderAdd");
286 action.visible = browser.bookmarks != null;
287 action = action_group.get_action ("BookmarkEdit");
288 action.visible = browser.bookmarks != null;
289 action = action_group.get_action ("BookmarkFolderEdit");
290 action.visible = browser.bookmarks != null;
132 }291 }
133292
134 void activated (Midori.App app) {293 void activated (Midori.App app) {
135294
=== modified file 'midori/midori-bookmarks-db.c'
--- midori/midori-bookmarks-db.c 2015-07-06 21:26:46 +0000
+++ midori/midori-bookmarks-db.c 2017-11-27 17:24:49 +0000
@@ -16,6 +16,7 @@
16#include "midori-array.h"16#include "midori-array.h"
17#include "sokoke.h"17#include "sokoke.h"
18#include "midori-core.h"18#include "midori-core.h"
19#include "katze-cellrenderercomboboxtext.h"
1920
20#include <glib/gstdio.h>21#include <glib/gstdio.h>
21#include <glib/gi18n.h>22#include <glib/gi18n.h>
@@ -1149,3 +1150,217 @@
11491150
1150 g_object_unref (array);1151 g_object_unref (array);
1151}1152}
1153
1154typedef struct _FolderEntry
1155{
1156 const gchar *title;
1157 gint64 id;
1158 gint64 parentid;
1159} FolderEntry;
1160
1161static void
1162midori_bookmark_folder_free_folder_entry (FolderEntry* folder)
1163{
1164 g_free ((gpointer)folder->title);
1165}
1166
1167static gboolean
1168midori_bookmark_folder_button_reach_parent (GtkTreeModel* model, GtkTreeIter *iter, gint64 parentid)
1169{
1170 do
1171 {
1172 gint64 id;
1173
1174 gtk_tree_model_get (model, iter, 1, &id, -1);
1175
1176 if (parentid == id)
1177 return TRUE;
1178
1179 if (gtk_tree_model_iter_has_child (model, iter))
1180 {
1181 GtkTreeIter child;
1182 gtk_tree_model_iter_children (model, &child, iter);
1183 if (midori_bookmark_folder_button_reach_parent (model, &child, parentid))
1184 {
1185 *iter = child;
1186 return TRUE;
1187 }
1188 }
1189 }
1190 while (gtk_tree_model_iter_next (model, iter));
1191
1192 return FALSE;
1193}
1194
1195GtkWidget*
1196midori_bookmarks_db_folder_button_new (MidoriBookmarksDb* array,
1197 gint64 selected_parentid)
1198{
1199 GtkTreeStore* model;
1200 GtkWidget* combo;
1201 GtkCellRenderer* renderer;
1202 guint n;
1203 sqlite3* db;
1204 sqlite3_stmt* statement;
1205 gint result;
1206 const gchar* sqlcmd = "SELECT title, id, parentid FROM bookmarks WHERE uri='' ORDER BY parentid, title ASC";
1207 gint64 current_parentid;
1208 GtkTreeIter tree_iter;
1209 GtkTreeIter stock_parent_iter;
1210 GtkTreeIter* parent_iter;
1211 GList *folders = NULL;
1212
1213 db = g_object_get_data (G_OBJECT (array), "db");
1214 g_return_val_if_fail (db != NULL, NULL);
1215
1216 /* folder combo box model content:
1217 ** 0: title
1218 ** 1: id
1219 */
1220 model = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_INT64);
1221 combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (model));
1222
1223 /* setup combo layout
1224 ** 0: a folder icon
1225 ** 1: the folder name
1226 */
1227
1228 gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo));
1229
1230 renderer = gtk_cell_renderer_pixbuf_new ();
1231 g_object_set (G_OBJECT (renderer),
1232 "stock-id", GTK_STOCK_DIRECTORY,
1233 "stock-size", GTK_ICON_SIZE_MENU,
1234 NULL);
1235 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE);
1236
1237 renderer = katze_cell_renderer_combobox_text_new ();
1238 g_object_set (G_OBJECT (renderer),
1239 "width-chars", 40, /* FIXME: figure out a way to define an acceptable string length */
1240 "ellipsize", PANGO_ELLIPSIZE_END,
1241 "unfolded-text", _("Select [text]"),
1242 NULL);
1243 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
1244 gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), renderer, "text", 0);
1245
1246 /* read the folders list from the database */
1247 /* FIXME: this should be a service of midori/midori-bookmarks-db */
1248
1249 if ((result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL)) == SQLITE_OK)
1250 {
1251 while ((result = sqlite3_step (statement)) == SQLITE_ROW)
1252 {
1253 FolderEntry* folder = g_new (FolderEntry, 1);
1254
1255 folder->title = g_strdup ((const gchar*)sqlite3_column_text (statement, 0));
1256 folder->id = sqlite3_column_int64 (statement, 1);
1257 folder->parentid = sqlite3_column_int64 (statement, 2);
1258
1259 folders = g_list_append (folders, folder);
1260 }
1261
1262 sqlite3_clear_bindings (statement);
1263 sqlite3_reset (statement);
1264 }
1265
1266 /* populate the combo box */
1267 /* FIXME: here we should have the root bookmark array's name and id, not hard encoded values */
1268
1269 gtk_tree_store_insert_with_values (model, &tree_iter, NULL, G_MAXINT,
1270 0, _("Bookmarks"), 1, (gint64)-1, -1);
1271 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &tree_iter);
1272
1273 current_parentid = -1;
1274 parent_iter = NULL;
1275 n = 1;
1276 while (g_list_first (folders))
1277 {
1278 gboolean something_done = FALSE;
1279 GList* list_iter = g_list_first (folders);
1280
1281 do
1282 {
1283 FolderEntry* folder = list_iter->data;
1284 const gchar* title = folder->title;
1285 gint64 id = folder->id;
1286 gint64 parentid = folder->parentid;
1287
1288 if (parentid != current_parentid) /* optimize case of sub-folders of the same parent */
1289 {
1290 if (!parentid)
1291 {
1292 /* folder's parent is the stree store root */
1293
1294 current_parentid = -1;
1295 parent_iter = NULL;
1296 }
1297 else if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &tree_iter))
1298 {
1299 if (midori_bookmark_folder_button_reach_parent (
1300 GTK_TREE_MODEL (model), &tree_iter, parentid))
1301 {
1302 /* folder's parent found in the tree store */
1303
1304 current_parentid = parentid;
1305 stock_parent_iter = tree_iter;
1306 parent_iter = &stock_parent_iter;
1307 }
1308 else
1309 {
1310 /* folder's parent not found, skip it */
1311
1312 list_iter = g_list_next (list_iter);
1313 continue;
1314 }
1315 }
1316 else
1317 g_assert_not_reached ();
1318 }
1319
1320 /* insert folder in the tree store and remove it from the folders list */
1321
1322 gtk_tree_store_insert_with_values (model, &tree_iter, parent_iter, G_MAXINT,
1323 0, title, 1, id, -1);
1324
1325 if (id == selected_parentid)
1326 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &tree_iter);
1327
1328 n++;
1329
1330 something_done = TRUE;
1331
1332 g_free ((gpointer)title);
1333 folders = g_list_delete_link (folders, list_iter);
1334
1335 list_iter = g_list_first (folders);
1336 }
1337 while (list_iter);
1338
1339 if (!something_done) /* avoid infinite loop in case of orphan folders */
1340 break;
1341 }
1342
1343 if (g_list_first (folders))
1344 {
1345 GList* iter;
1346 g_printerr ("midori_bookmark_folder_button_new: orphan folder(s) detected in bookmarks db\n");
1347
1348 for (iter = g_list_first (folders) ; iter ; iter = g_list_next (iter))
1349 {
1350 FolderEntry* folder = iter->data;
1351 const gchar* title = folder->title;
1352 gint64 id = folder->id;
1353 gint64 parentid = folder->parentid;
1354
1355 g_printerr (" id=%" G_GINT64_FORMAT ", parentid=%" G_GINT64_FORMAT ", title=%s\n",
1356 id, parentid, title);
1357 }
1358
1359 g_list_free_full (folders, (GDestroyNotify)midori_bookmark_folder_free_folder_entry);
1360 }
1361
1362 if (n < 2)
1363 gtk_widget_set_sensitive (combo, FALSE);
1364
1365 return combo;
1366}
11521367
=== modified file 'midori/midori-bookmarks-db.h'
--- midori/midori-bookmarks-db.h 2015-07-06 21:26:46 +0000
+++ midori/midori-bookmarks-db.h 2017-11-27 17:24:49 +0000
@@ -75,5 +75,9 @@
75midori_bookmarks_db_populate_folder (MidoriBookmarksDb* bookmarks,75midori_bookmarks_db_populate_folder (MidoriBookmarksDb* bookmarks,
76 KatzeArray *folder);76 KatzeArray *folder);
7777
78GtkWidget*
79midori_bookmarks_db_folder_button_new (MidoriBookmarksDb* bookmarks,
80 gint64 selected_parentid);
81
78#endif /* !__MIDORI_BOOKMARKS_DB_H__ */82#endif /* !__MIDORI_BOOKMARKS_DB_H__ */
7983
8084
=== modified file 'midori/midori-browser.c'
--- midori/midori-browser.c 2017-11-27 17:24:49 +0000
+++ midori/midori-browser.c 2017-11-27 17:24:49 +0000
@@ -289,8 +289,6 @@
289 midori_view_get_next_page (view) != NULL);289 midori_view_get_next_page (view) != NULL);
290290
291 _action_set_sensitive (browser, "AddSpeedDial", !midori_view_is_blank (view));291 _action_set_sensitive (browser, "AddSpeedDial", !midori_view_is_blank (view));
292 _action_set_sensitive (browser, "BookmarkAdd", !midori_view_is_blank (view));
293 _action_set_sensitive (browser, "BookmarkFolderAdd", !midori_view_is_blank (view));
294 _action_set_sensitive (browser, "MailTo", !midori_view_is_blank (view));292 _action_set_sensitive (browser, "MailTo", !midori_view_is_blank (view));
295 _action_set_sensitive (browser, "SaveAs", midori_tab_can_save (MIDORI_TAB (view)));293 _action_set_sensitive (browser, "SaveAs", midori_tab_can_save (MIDORI_TAB (view)));
296 _action_set_sensitive (browser, "ZoomIn", midori_view_can_zoom_in (view));294 _action_set_sensitive (browser, "ZoomIn", midori_view_can_zoom_in (view));
@@ -818,220 +816,6 @@
818 }816 }
819}817}
820818
821static gboolean
822midori_bookmark_folder_button_reach_parent (GtkTreeModel* model, GtkTreeIter *iter, gint64 parentid)
823{
824 do
825 {
826 gint64 id;
827
828 gtk_tree_model_get (model, iter, 1, &id, -1);
829
830 if (parentid == id)
831 return TRUE;
832
833 if (gtk_tree_model_iter_has_child (model, iter))
834 {
835 GtkTreeIter child;
836 gtk_tree_model_iter_children (model, &child, iter);
837 if (midori_bookmark_folder_button_reach_parent (model, &child, parentid))
838 {
839 *iter = child;
840 return TRUE;
841 }
842 }
843 }
844 while (gtk_tree_model_iter_next (model, iter));
845
846 return FALSE;
847}
848
849typedef struct _FolderEntry
850{
851 const gchar *title;
852 gint64 id;
853 gint64 parentid;
854} FolderEntry;
855
856static void
857midori_bookmark_folder_free_folder_entry (FolderEntry* folder)
858{
859 g_free ((gpointer)folder->title);
860}
861
862static GtkWidget*
863midori_bookmark_folder_button_new (MidoriBookmarksDb* array,
864 gint64 selected_parentid)
865{
866 GtkTreeStore* model;
867 GtkWidget* combo;
868 GtkCellRenderer* renderer;
869 guint n;
870 sqlite3* db;
871 sqlite3_stmt* statement;
872 gint result;
873 const gchar* sqlcmd = "SELECT title, id, parentid FROM bookmarks WHERE uri='' ORDER BY parentid, title ASC";
874 gint64 current_parentid;
875 GtkTreeIter tree_iter;
876 GtkTreeIter stock_parent_iter;
877 GtkTreeIter* parent_iter;
878 GList *folders = NULL;
879
880 db = g_object_get_data (G_OBJECT (array), "db");
881 g_return_val_if_fail (db != NULL, NULL);
882
883 /* folder combo box model content:
884 ** 0: title
885 ** 1: id
886 */
887 model = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_INT64);
888 combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (model));
889
890 /* setup combo layout
891 ** 0: a folder icon
892 ** 1: the folder name
893 */
894
895 gtk_cell_layout_clear (GTK_CELL_LAYOUT (combo));
896
897 renderer = gtk_cell_renderer_pixbuf_new ();
898 g_object_set (G_OBJECT (renderer),
899 "stock-id", GTK_STOCK_DIRECTORY,
900 "stock-size", GTK_ICON_SIZE_MENU,
901 NULL);
902 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE);
903
904 renderer = katze_cell_renderer_combobox_text_new ();
905 g_object_set (G_OBJECT (renderer),
906 "width-chars", 40, /* FIXME: figure out a way to define an acceptable string length */
907 "ellipsize", PANGO_ELLIPSIZE_END,
908 "unfolded-text", _("Select [text]"),
909 NULL);
910 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
911 gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), renderer, "text", 0);
912
913 /* read the folders list from the database */
914 /* FIXME: this should be a service of midori/midori-bookmarks-db */
915
916 if ((result = sqlite3_prepare_v2 (db, sqlcmd, -1, &statement, NULL)) == SQLITE_OK)
917 {
918 while ((result = sqlite3_step (statement)) == SQLITE_ROW)
919 {
920 FolderEntry* folder = g_new (FolderEntry, 1);
921
922 folder->title = g_strdup ((const gchar*)sqlite3_column_text (statement, 0));
923 folder->id = sqlite3_column_int64 (statement, 1);
924 folder->parentid = sqlite3_column_int64 (statement, 2);
925
926 folders = g_list_append (folders, folder);
927 }
928
929 sqlite3_clear_bindings (statement);
930 sqlite3_reset (statement);
931 }
932
933 /* populate the combo box */
934 /* FIXME: here we should have the root bookmark array's name and id, not hard encoded values */
935
936 gtk_tree_store_insert_with_values (model, &tree_iter, NULL, G_MAXINT,
937 0, _("Bookmarks"), 1, (gint64)-1, -1);
938 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &tree_iter);
939
940 current_parentid = -1;
941 parent_iter = NULL;
942 n = 1;
943 while (g_list_first (folders))
944 {
945 gboolean something_done = FALSE;
946 GList* list_iter = g_list_first (folders);
947
948 do
949 {
950 FolderEntry* folder = list_iter->data;
951 const gchar* title = folder->title;
952 gint64 id = folder->id;
953 gint64 parentid = folder->parentid;
954
955 if (parentid != current_parentid) /* optimize case of sub-folders of the same parent */
956 {
957 if (!parentid)
958 {
959 /* folder's parent is the stree store root */
960
961 current_parentid = -1;
962 parent_iter = NULL;
963 }
964 else if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &tree_iter))
965 {
966 if (midori_bookmark_folder_button_reach_parent (
967 GTK_TREE_MODEL (model), &tree_iter, parentid))
968 {
969 /* folder's parent found in the tree store */
970
971 current_parentid = parentid;
972 stock_parent_iter = tree_iter;
973 parent_iter = &stock_parent_iter;
974 }
975 else
976 {
977 /* folder's parent not found, skip it */
978
979 list_iter = g_list_next (list_iter);
980 continue;
981 }
982 }
983 else
984 g_assert_not_reached ();
985 }
986
987 /* insert folder in the tree store and remove it from the folders list */
988
989 gtk_tree_store_insert_with_values (model, &tree_iter, parent_iter, G_MAXINT,
990 0, title, 1, id, -1);
991
992 if (id == selected_parentid)
993 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &tree_iter);
994
995 n++;
996
997 something_done = TRUE;
998
999 g_free ((gpointer)title);
1000 folders = g_list_delete_link (folders, list_iter);
1001
1002 list_iter = g_list_first (folders);
1003 }
1004 while (list_iter);
1005
1006 if (!something_done) /* avoid infinite loop in case of orphan folders */
1007 break;
1008 }
1009
1010 if (g_list_first (folders))
1011 {
1012 GList* iter;
1013 g_printerr ("midori_bookmark_folder_button_new: orphan folder(s) detected in bookmarks db\n");
1014
1015 for (iter = g_list_first (folders) ; iter ; iter = g_list_next (iter))
1016 {
1017 FolderEntry* folder = iter->data;
1018 const gchar* title = folder->title;
1019 gint64 id = folder->id;
1020 gint64 parentid = folder->parentid;
1021
1022 g_printerr (" id=%" G_GINT64_FORMAT ", parentid=%" G_GINT64_FORMAT ", title=%s\n",
1023 id, parentid, title);
1024 }
1025
1026 g_list_free_full (folders, (GDestroyNotify)midori_bookmark_folder_free_folder_entry);
1027 }
1028
1029 if (n < 2)
1030 gtk_widget_set_sensitive (combo, FALSE);
1031
1032 return combo;
1033}
1034
1035static gint64819static gint64
1036midori_bookmark_folder_button_get_active (GtkWidget* combo)820midori_bookmark_folder_button_get_active (GtkWidget* combo)
1037{821{
@@ -1049,76 +833,6 @@
1049 return id;833 return id;
1050}834}
1051835
1052static void
1053midori_browser_edit_bookmark_title_changed_cb (GtkEntry* entry,
1054 GtkWidget* button)
1055{
1056 const gchar* title = gtk_entry_get_text (entry);
1057 gtk_widget_set_sensitive (button,
1058 title != NULL && title[0] != '\0');
1059}
1060
1061static void
1062midori_browser_edit_bookmark_response_cb (GtkWidget* dialog,
1063 gint response,
1064 MidoriBrowser* browser)
1065{
1066 if (response == GTK_RESPONSE_ACCEPT)
1067 {
1068 KatzeItem* bookmark = g_object_get_data (G_OBJECT (dialog), "bookmark");
1069 GtkWidget* entry_title = g_object_get_data (G_OBJECT (dialog), "entry-title");
1070 katze_item_set_name (bookmark,
1071 gtk_entry_get_text (GTK_ENTRY (entry_title)));
1072 GtkWidget* check_toolbar = g_object_get_data (G_OBJECT (dialog), "check-toolbar");
1073 katze_item_set_meta_integer (bookmark, "toolbar",
1074 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check_toolbar)));
1075 GtkWidget* entry_uri = g_object_get_data (G_OBJECT (dialog), "entry-uri");
1076 if (!KATZE_IS_ARRAY (bookmark))
1077 katze_item_set_uri (bookmark,
1078 gtk_entry_get_text (GTK_ENTRY (entry_uri)));
1079
1080 GtkWidget* combo_folder = g_object_get_data (G_OBJECT (dialog), "combo-folder");
1081 gint64 selected = midori_bookmark_folder_button_get_active (combo_folder);
1082 katze_item_set_meta_integer (bookmark, "parentid", selected);
1083
1084 gboolean new_bookmark = g_object_get_data (G_OBJECT (dialog), "new-bookmark") != NULL;
1085 if (new_bookmark)
1086 midori_bookmarks_db_add_item (browser->bookmarks, bookmark);
1087 else
1088 midori_bookmarks_db_update_item (browser->bookmarks, bookmark);
1089 }
1090 gtk_widget_destroy (dialog);
1091}
1092
1093static void
1094midori_browser_edit_bookmark_add_speed_dial_cb (GtkWidget* button,
1095 KatzeItem* bookmark)
1096{
1097 MidoriBrowser* browser = midori_browser_get_for_widget (button);
1098 midori_browser_add_speed_dial (browser);
1099 GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER);
1100 midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_DELETE_EVENT, browser);
1101}
1102
1103static void
1104midori_browser_edit_bookmark_create_launcher_cb (GtkWidget* button,
1105 KatzeItem* bookmark)
1106{
1107 MidoriBrowser* browser = midori_browser_get_for_widget (button);
1108 GtkAction* action = g_object_get_data (G_OBJECT (button), "midori-action");
1109 gtk_action_activate (action);
1110 GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER);
1111 midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_DELETE_EVENT, browser);
1112}
1113
1114static void
1115midori_browser_edit_bookmark_button_cb (GtkWidget* button,
1116 MidoriBrowser* browser)
1117{
1118 GtkWidget* dialog = gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER);
1119 midori_browser_edit_bookmark_response_cb (dialog, GTK_RESPONSE_ACCEPT, browser);
1120}
1121
1122/* Private function, used by MidoriBookmarks and MidoriHistory */836/* Private function, used by MidoriBookmarks and MidoriHistory */
1123/* static */ gboolean837/* static */ gboolean
1124midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser,838midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser,
@@ -1127,144 +841,14 @@
1127 gboolean is_folder,841 gboolean is_folder,
1128 GtkWidget* proxy)842 GtkWidget* proxy)
1129{843{
1130 KatzeItem* bookmark = bookmark_or_parent;844 GtkAction* action = _action_by_name (browser,
1131 const gchar* title;845 new_bookmark ?
1132 GtkWidget* dialog;846 (is_folder ? "BookmarkFolderAdd" : "BookmarkAdd") :
1133 GtkWidget* accept;847 (is_folder ? "BookmarkFolderEdit" : "BookmarkEdit"));
1134 GtkWidget* content_area;848 g_object_set_data_full (G_OBJECT (action), "bookmark", bookmark_or_parent, (GDestroyNotify)g_object_unref);
1135 GtkWidget* actions;849 g_object_set_data (G_OBJECT (action), "proxy", proxy);
1136 GtkWidget* view;850 gtk_action_activate (action);
1137 GtkWidget* vbox;851 return FALSE;
1138 GtkWidget* hbox;
1139 GtkWidget* label;
1140 const gchar* value;
1141 GtkWidget* entry_title;
1142 GtkWidget* entry_uri;
1143 GtkWidget* combo_folder;
1144 GtkWidget* check_toolbar;
1145 gboolean return_status = FALSE;
1146
1147 if (is_folder)
1148 title = new_bookmark ? _("New Folder") : _("Edit Folder");
1149 else
1150 title = new_bookmark ? _("New Bookmark") : _("Edit Bookmark");
1151 if (proxy != NULL)
1152 {
1153 dialog = gtk_popover_new (proxy);
1154 content_area = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
1155 gtk_container_add (GTK_CONTAINER (dialog), content_area);
1156 actions = gtk_hbox_new (FALSE, 6);
1157 gtk_box_pack_end (GTK_BOX (content_area), actions, TRUE, TRUE, 0);
1158 accept = gtk_button_new_from_stock (new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_SAVE);
1159 gtk_box_pack_end (GTK_BOX (actions), accept, FALSE, FALSE, 0);
1160 g_signal_connect (accept, "clicked", G_CALLBACK (midori_browser_edit_bookmark_button_cb), browser);
1161 }
1162 else
1163 {
1164 dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (browser),
1165 GTK_DIALOG_DESTROY_WITH_PARENT, NULL, NULL);
1166 content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
1167 actions = gtk_hbox_new (FALSE, 0);
1168 gtk_box_pack_end (GTK_BOX (content_area), actions, TRUE, TRUE, 0);
1169 gtk_dialog_add_buttons (GTK_DIALOG (dialog),
1170 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
1171 new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
1172 gtk_window_set_icon_name (GTK_WINDOW (dialog),
1173 new_bookmark ? GTK_STOCK_ADD : GTK_STOCK_REMOVE);
1174 gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
1175 g_signal_connect (dialog, "response", G_CALLBACK (midori_browser_edit_bookmark_response_cb), browser);
1176 accept = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
1177 }
1178 gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
1179
1180 if (!is_folder)
1181 label = gtk_label_new (_("Type a name for this bookmark, and choose where to keep it."));
1182 else
1183 label = gtk_label_new (_("Type a name for this folder, and choose where to keep it."));
1184
1185 vbox = gtk_vbox_new (FALSE, 6);
1186 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 6);
1187 gtk_box_pack_start (GTK_BOX (content_area), vbox, FALSE, FALSE, 0);
1188
1189 if (new_bookmark)
1190 {
1191 view = midori_browser_get_current_tab (browser);
1192 if (is_folder)
1193 {
1194 bookmark = (KatzeItem*)katze_array_new (KATZE_TYPE_ARRAY);
1195 katze_item_set_name (bookmark,
1196 midori_view_get_display_title (MIDORI_VIEW (view)));
1197 }
1198 else
1199 bookmark = g_object_new (KATZE_TYPE_ITEM,
1200 "uri", midori_view_get_display_uri (MIDORI_VIEW (view)),
1201 "name", midori_view_get_display_title (MIDORI_VIEW (view)), NULL);
1202 katze_item_set_meta_integer (
1203 bookmark, "parentid",
1204 (!bookmark_or_parent
1205 ? 0
1206 : katze_item_get_meta_integer (bookmark_or_parent, "id")));
1207 g_object_set_data (G_OBJECT (dialog), "new-bookmark", bookmark);
1208 }
1209 g_object_set_data_full (G_OBJECT (dialog), "bookmark", bookmark, (GDestroyNotify)g_object_unref);
1210
1211 entry_title = gtk_entry_new ();
1212 gtk_entry_set_activates_default (GTK_ENTRY (entry_title), TRUE);
1213 value = katze_item_get_name (bookmark);
1214 gtk_entry_set_text (GTK_ENTRY (entry_title), katze_str_non_null (value));
1215 midori_browser_edit_bookmark_title_changed_cb (GTK_ENTRY (entry_title),
1216 accept);
1217 g_signal_connect (entry_title, "changed",
1218 G_CALLBACK (midori_browser_edit_bookmark_title_changed_cb), accept);
1219 gtk_box_pack_start (GTK_BOX (vbox), entry_title, FALSE, FALSE, 0);
1220 g_object_set_data (G_OBJECT (dialog), "entry-title", entry_title);
1221
1222 entry_uri = NULL;
1223 if (!is_folder)
1224 {
1225 entry_uri = katze_uri_entry_new (accept);
1226 gtk_entry_set_activates_default (GTK_ENTRY (entry_uri), TRUE);
1227 gtk_entry_set_text (GTK_ENTRY (entry_uri), katze_item_get_uri (bookmark));
1228 gtk_box_pack_start (GTK_BOX (vbox), entry_uri, FALSE, FALSE, 0);
1229 g_object_set_data (G_OBJECT (dialog), "entry-uri", entry_uri);
1230 }
1231
1232 combo_folder = midori_bookmark_folder_button_new (browser->bookmarks,
1233 katze_item_get_meta_integer (bookmark, "parentid"));
1234 gtk_box_pack_start (GTK_BOX (vbox), combo_folder, FALSE, FALSE, 0);
1235 g_object_set_data (G_OBJECT (dialog), "combo-folder", combo_folder);
1236
1237 hbox = gtk_hbox_new (FALSE, 6);
1238 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
1239 check_toolbar = gtk_check_button_new_with_mnemonic (_("Show in Bookmarks _Bar"));
1240 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_toolbar),
1241 katze_item_get_meta_boolean (bookmark, "toolbar"));
1242 gtk_box_pack_start (GTK_BOX (hbox), check_toolbar, FALSE, FALSE, 0);
1243 g_object_set_data (G_OBJECT (dialog), "check-toolbar", check_toolbar);
1244
1245 if (new_bookmark && !is_folder)
1246 {
1247 label = gtk_button_new_with_mnemonic (_("Add to _Speed Dial"));
1248 g_signal_connect (label, "clicked",
1249 G_CALLBACK (midori_browser_edit_bookmark_add_speed_dial_cb), bookmark);
1250 gtk_box_pack_start (GTK_BOX (actions), label, FALSE, FALSE, 0);
1251
1252 /* FIXME: There's no API for extending the bookmark dialog */
1253 GtkAction* action = _action_by_name (browser, "CreateLauncher");
1254 if (action != NULL)
1255 {
1256 label = gtk_button_new_with_mnemonic (gtk_action_get_label (action));
1257 g_object_set_data (G_OBJECT (label), "midori-action", action);
1258 g_signal_connect (label, "clicked",
1259 G_CALLBACK (midori_browser_edit_bookmark_create_launcher_cb), bookmark);
1260 gtk_box_pack_start (GTK_BOX (actions), label, FALSE, FALSE, 0);
1261 }
1262 }
1263
1264 gtk_widget_show_all (content_area);
1265 gtk_widget_show (dialog);
1266
1267 return return_status;
1268}852}
1269853
1270static gboolean854static gboolean
@@ -4276,25 +3860,6 @@
4276}3860}
42773861
4278static void3862static void
4279_action_bookmark_add_activate (GtkAction* action,
4280 MidoriBrowser* browser)
4281{
4282 GtkWidget* proxy = NULL;
4283 GSList* proxies = gtk_action_get_proxies (action);
4284 for (; proxies != NULL; proxies = g_slist_next (proxies))
4285 if (GTK_IS_TOOL_ITEM (proxies->data))
4286 {
4287 proxy = proxies->data;
4288 break;
4289 }
4290
4291 if (g_str_equal (gtk_action_get_name (action), "BookmarkFolderAdd"))
4292 midori_browser_edit_bookmark_dialog_new (browser, NULL, TRUE, TRUE, proxy);
4293 else
4294 midori_browser_edit_bookmark_dialog_new (browser, NULL, TRUE, FALSE, proxy);
4295}
4296
4297static void
4298_action_bookmarks_import_activate (GtkAction* action,3863_action_bookmarks_import_activate (GtkAction* action,
4299 MidoriBrowser* browser)3864 MidoriBrowser* browser)
4300{3865{
@@ -4423,7 +3988,7 @@
4423 gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);3988 gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
4424 gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, TRUE, 0);3989 gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, TRUE, 0);
44253990
4426 combobox_folder = midori_bookmark_folder_button_new (browser->bookmarks, 0);3991 combobox_folder = midori_bookmarks_db_folder_button_new (browser->bookmarks, 0);
4427 gtk_box_pack_start (GTK_BOX (content_area), combobox_folder, FALSE, TRUE, 0);3992 gtk_box_pack_start (GTK_BOX (content_area), combobox_folder, FALSE, TRUE, 0);
4428 gtk_widget_show_all (content_area);3993 gtk_widget_show_all (content_area);
44293994
@@ -5198,10 +4763,16 @@
51984763
5199 { "BookmarkAdd", STOCK_BOOKMARK_ADD,4764 { "BookmarkAdd", STOCK_BOOKMARK_ADD,
5200 NULL, "<Ctrl>d",4765 NULL, "<Ctrl>d",
5201 N_("Add a new bookmark"), G_CALLBACK (_action_bookmark_add_activate) },4766 N_("Add a new bookmark"), NULL },
5202 { "BookmarkFolderAdd", NULL,4767 { "BookmarkFolderAdd", NULL,
5203 N_("Add a new _folder"), "",4768 N_("Add a new _folder"), "",
5204 NULL, G_CALLBACK (_action_bookmark_add_activate) },4769 NULL, NULL },
4770 { "BookmarkEdit", NULL,
4771 "Edit an existing bookmark", "",
4772 NULL, NULL },
4773 { "BookmarkFolderEdit", NULL,
4774 "Edit an existing folder", "",
4775 NULL, NULL },
5205 { "BookmarksImport", NULL,4776 { "BookmarksImport", NULL,
5206 N_("_Import bookmarks…"), "",4777 N_("_Import bookmarks…"), "",
5207 NULL, G_CALLBACK (_action_bookmarks_import_activate) },4778 NULL, G_CALLBACK (_action_bookmarks_import_activate) },
@@ -5984,8 +5555,10 @@
5984 _action_set_visible (browser, "LastSession", FALSE);5555 _action_set_visible (browser, "LastSession", FALSE);
59855556
5986 _action_set_visible (browser, "Bookmarks", browser->bookmarks != NULL);5557 _action_set_visible (browser, "Bookmarks", browser->bookmarks != NULL);
5987 _action_set_visible (browser, "BookmarkAdd", browser->bookmarks != NULL);5558 _action_set_visible (browser, "BookmarkAdd", FALSE);
5988 _action_set_visible (browser, "BookmarkFolderAdd", browser->bookmarks != NULL);5559 _action_set_visible (browser, "BookmarkFolderAdd", FALSE);
5560 _action_set_visible (browser, "BookmarkEdit", FALSE);
5561 _action_set_visible (browser, "BookmarkFolderEdit", FALSE);
5989 _action_set_visible (browser, "BookmarksImport", browser->bookmarks != NULL);5562 _action_set_visible (browser, "BookmarksImport", browser->bookmarks != NULL);
5990 _action_set_visible (browser, "BookmarksExport", browser->bookmarks != NULL);5563 _action_set_visible (browser, "BookmarksExport", browser->bookmarks != NULL);
5991 _action_set_visible (browser, "Bookmarkbar", FALSE);5564 _action_set_visible (browser, "Bookmarkbar", FALSE);
@@ -6427,8 +6000,6 @@
6427 for (; proxies; proxies = g_slist_next (proxies))6000 for (; proxies; proxies = g_slist_next (proxies))
6428 gtk_widget_show (proxies->data);6001 gtk_widget_show (proxies->data);
6429 }6002 }
6430 _action_set_visible (browser, "BookmarkAdd", bookmarks != NULL);
6431 _action_set_visible (browser, "BookmarkFolderAdd", bookmarks != NULL);
6432 _action_set_visible (browser, "BookmarksImport", bookmarks != NULL);6003 _action_set_visible (browser, "BookmarksImport", bookmarks != NULL);
6433 _action_set_visible (browser, "BookmarksExport", bookmarks != NULL);6004 _action_set_visible (browser, "BookmarksExport", bookmarks != NULL);
64346005
64356006
=== modified file 'midori/midori.vapi'
--- midori/midori.vapi 2017-11-27 17:24:49 +0000
+++ midori/midori.vapi 2017-11-27 17:24:49 +0000
@@ -24,7 +24,11 @@
2424
25 [CCode (type_id = "TYPE_MIDORI_BOOKMARKS_DB", cheader_filename = "midori/midori-bookmarks-db.h")]25 [CCode (type_id = "TYPE_MIDORI_BOOKMARKS_DB", cheader_filename = "midori/midori-bookmarks-db.h")]
26 public class BookmarksDb : Katze.Array {26 public class BookmarksDb : Katze.Array {
27 public void add_item (Katze.Item item);
28 public void update_item (Katze.Item item);
29 public void remove_item (Katze.Item item);
27 public Katze.Array? query_recursive (string fields, string condition, string? value, bool recursive);30 public Katze.Array? query_recursive (string fields, string condition, string? value, bool recursive);
31 public unowned Gtk.ComboBox folder_button_new (int64 parent_id);
28 }32 }
2933
30 [CCode (cheader_filename = "midori/midori-array.h")]34 [CCode (cheader_filename = "midori/midori-array.h")]
@@ -109,6 +113,8 @@
109 public Katze.Array? history { owned get; set; }113 public Katze.Array? history { owned get; set; }
110 [NoAccessorMethod]114 [NoAccessorMethod]
111 public bool show_tabs { get; set; }115 public bool show_tabs { get; set; }
116 [NoAccessorMethod]
117 public Midori.SpeedDial? speed_dial { owned get; set; }
112118
113 public signal Browser new_window (Browser? browser);119 public signal Browser new_window (Browser? browser);
114 [HasEmitter]120 [HasEmitter]
115121
=== modified file 'panels/midori-bookmarks.c'
--- panels/midori-bookmarks.c 2015-08-10 00:31:37 +0000
+++ panels/midori-bookmarks.c 2017-11-27 17:24:49 +0000
@@ -605,7 +605,7 @@
605605
606 browser = midori_browser_get_for_widget (bookmarks->treeview);606 browser = midori_browser_get_for_widget (bookmarks->treeview);
607 midori_browser_edit_bookmark_dialog_new (607 midori_browser_edit_bookmark_dialog_new (
608 browser, item, FALSE, KATZE_ITEM_IS_FOLDER (item), NULL);608 browser, item, FALSE, KATZE_ITEM_IS_FOLDER (item), bookmarks->treeview);
609609
610 g_object_unref (item);610 g_object_unref (item);
611 }611 }
612612
=== modified file 'panels/midori-history.c'
--- panels/midori-history.c 2015-08-10 00:11:32 +0000
+++ panels/midori-history.c 2017-11-27 17:24:49 +0000
@@ -326,7 +326,7 @@
326 GtkTreeIter iter;326 GtkTreeIter iter;
327 KatzeItem* item = NULL;327 KatzeItem* item = NULL;
328328
329 GtkWidget* proxy = GTK_IS_TOOL_ITEM (menuitem) ? menuitem : NULL;329 GtkWidget* proxy = GTK_IS_TOOL_ITEM (menuitem) ? menuitem : history->treeview;
330 MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (history));330 MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (history));
331 if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (history->treeview),331 if (katze_tree_view_get_selected_iter (GTK_TREE_VIEW (history->treeview),
332 &model, &iter))332 &model, &iter))

Subscribers

People subscribed via source and target branches

to all changes: