Summary Files Commits Branches @commit @diff @stats
path: root / badwolf.c
diff options
context:
space:
mode:
Commitd57b655fecccbdee1f745e74a4578c14aeef5bcb (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2020-08-26 15:10:51 +0200
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2020-08-26 15:10:51 +0200
Files08d8b1fc1b3c3cbd1a2bba80d09c64a1c8370090 /badwolf.c
goodwolf-d57b655fecccbdee1f745e74a4578c14aeef5bcb.tar
goodwolf-d57b655fecccbdee1f745e74a4578c14aeef5bcb.tar.gz
goodwolf-d57b655fecccbdee1f745e74a4578c14aeef5bcb.zip
Parentb6e995810f9cba4dac83d57643a5f9698699cbad (diff)
Parent5af5a723bfa9a3da2df754e63a3833445ecdb49b (diff)
Merge branch 'features/suggestions' into develop
1 files changed, 17 insertions, 0 deletions
-rw-r--r--badwolf.c17
diff --git a/badwolf.c b/badwolf.c
index d0b337a..ca1f5d7 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -6,6 +6,8 @@
#include "config.h"
#include "downloads.h"
+#include "bookmarks.h"
+#include "config.h"
#include "keybindings.h"
#include "uri.h"
@@ -21,6 +23,7 @@ const gchar *version = VERSION;
static gchar *web_extensions_directory;
static int context_id_counter = 0;
+GtkTreeModel *bookmarks_completion_model;
static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data);
static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView,
@@ -736,6 +739,15 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b
gtk_label_set_single_line_mode(GTK_LABEL(browser->statuslabel), TRUE);
gtk_label_set_ellipsize(GTK_LABEL(browser->statuslabel), BADWOLF_STATUSLABEL_ELLIPSIZE);
+ if(bookmarks_completion_model != NULL)
+ {
+ GtkEntryCompletion *location_completion = gtk_entry_completion_new();
+ GtkTreeModel *location_completion_model = bookmarks_completion_model;
+
+ bookmarks_completion_setup(location_completion, location_completion_model);
+ gtk_entry_set_completion(GTK_ENTRY(browser->location), location_completion);
+ }
+
gtk_entry_set_text(GTK_ENTRY(browser->location), target_url);
gtk_entry_set_input_purpose(GTK_ENTRY(browser->location), GTK_INPUT_PURPOSE_URL);
@@ -930,6 +942,9 @@ main(int argc, char *argv[])
g_build_filename(g_get_user_data_dir(), "badwolf", "webkit-web-extension", NULL);
fprintf(stderr, _("webkit-web-extension directory set to: %s\n"), web_extensions_directory);
+ bookmarks_completion_model = bookmarks_completion_init();
+ g_object_ref(bookmarks_completion_model);
+
window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
window->notebook = gtk_notebook_new();
window->new_tab = gtk_button_new_from_icon_name("tab-new-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
@@ -997,6 +1012,8 @@ main(int argc, char *argv[])
gtk_main();
+ g_object_unref(bookmarks_completion_model);
+
#if 0
/* TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. */
_("ΓΈ");