Integrate Adblock preferences with extension list
This commit is contained in:
parent
4d7424adc4
commit
15a06bbfe1
1 changed files with 4 additions and 23 deletions
|
@ -199,10 +199,6 @@ adblock_reload_rules (MidoriExtension* extension,
|
||||||
katze_assign (blockscript, adblock_build_js (blockcss->str, blockcssprivate->str));
|
katze_assign (blockscript, adblock_build_js (blockcss->str, blockcssprivate->str));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
adblock_browser_populate_tool_menu_cb (MidoriBrowser* browser,
|
|
||||||
GtkWidget* menu,
|
|
||||||
MidoriExtension* extension);
|
|
||||||
static void
|
static void
|
||||||
adblock_preferences_render_tick_cb (GtkTreeViewColumn* column,
|
adblock_preferences_render_tick_cb (GtkTreeViewColumn* column,
|
||||||
GtkCellRenderer* renderer,
|
GtkCellRenderer* renderer,
|
||||||
|
@ -568,8 +564,7 @@ adblock_get_preferences_dialog (MidoriExtension* extension)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
adblock_menu_configure_filters_activate_cb (GtkWidget* menuitem,
|
adblock_open_preferences_cb (MidoriExtension* extension)
|
||||||
MidoriExtension* extension)
|
|
||||||
{
|
{
|
||||||
static GtkWidget* dialog = NULL;
|
static GtkWidget* dialog = NULL;
|
||||||
|
|
||||||
|
@ -584,20 +579,6 @@ adblock_menu_configure_filters_activate_cb (GtkWidget* menuitem,
|
||||||
gtk_window_present (GTK_WINDOW (dialog));
|
gtk_window_present (GTK_WINDOW (dialog));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
adblock_browser_populate_tool_menu_cb (MidoriBrowser* browser,
|
|
||||||
GtkWidget* menu,
|
|
||||||
MidoriExtension* extension)
|
|
||||||
{
|
|
||||||
GtkWidget* menuitem;
|
|
||||||
|
|
||||||
menuitem = gtk_menu_item_new_with_mnemonic (_("Configure _Advertisement filters..."));
|
|
||||||
g_signal_connect (menuitem, "activate",
|
|
||||||
G_CALLBACK (adblock_menu_configure_filters_activate_cb), extension);
|
|
||||||
gtk_widget_show (menuitem);
|
|
||||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
adblock_check_filter_options (GRegex* regex,
|
adblock_check_filter_options (GRegex* regex,
|
||||||
const gchar* opts,
|
const gchar* opts,
|
||||||
|
@ -989,8 +970,8 @@ adblock_app_add_browser_cb (MidoriApp* app,
|
||||||
(GtkCallback)adblock_add_tab_foreach_cb, extension);
|
(GtkCallback)adblock_add_tab_foreach_cb, extension);
|
||||||
g_signal_connect (browser, "add-tab",
|
g_signal_connect (browser, "add-tab",
|
||||||
G_CALLBACK (adblock_add_tab_cb), extension);
|
G_CALLBACK (adblock_add_tab_cb), extension);
|
||||||
g_signal_connect (browser, "populate-tool-menu",
|
g_signal_connect (extension, "open-preferences",
|
||||||
G_CALLBACK (adblock_browser_populate_tool_menu_cb), extension);
|
G_CALLBACK (adblock_open_preferences_cb), extension);
|
||||||
g_signal_connect (extension, "deactivate",
|
g_signal_connect (extension, "deactivate",
|
||||||
G_CALLBACK (adblock_deactivate_cb), browser);
|
G_CALLBACK (adblock_deactivate_cb), browser);
|
||||||
g_object_unref (statusbar);
|
g_object_unref (statusbar);
|
||||||
|
@ -1318,7 +1299,7 @@ adblock_deactivate_cb (MidoriExtension* extension,
|
||||||
MidoriApp* app = midori_extension_get_app (extension);
|
MidoriApp* app = midori_extension_get_app (extension);
|
||||||
|
|
||||||
g_signal_handlers_disconnect_by_func (
|
g_signal_handlers_disconnect_by_func (
|
||||||
browser, adblock_browser_populate_tool_menu_cb, extension);
|
browser, adblock_open_preferences_cb, extension);
|
||||||
g_signal_handlers_disconnect_by_func (
|
g_signal_handlers_disconnect_by_func (
|
||||||
extension, adblock_deactivate_cb, browser);
|
extension, adblock_deactivate_cb, browser);
|
||||||
g_signal_handlers_disconnect_by_func (
|
g_signal_handlers_disconnect_by_func (
|
||||||
|
|
Loading…
Reference in a new issue