if ((img = midori_view_get_snapshot (MIDORI_VIEW (view), 240, 160)))
{
- gint i;
GKeyFile* key_file;
gchar* dial_id = g_strdup_printf ("Dial %s", slot_id + 1);
- gchar* config_file = g_build_filename (sokoke_set_config_dir (NULL),
- "speeddial", NULL);
gchar* file_path = sokoke_build_thumbnail_path (uri);
gchar* thumb_dir = g_build_path (G_DIR_SEPARATOR_S, g_get_user_cache_dir (),
PACKAGE_NAME, "thumbnails", NULL);
katze_mkdir_with_parents (thumb_dir, 0700);
gdk_pixbuf_save (img, file_path, "png", NULL, "compression", "7", NULL);
- sokoke_key_file_save_to_file (key_file, config_file, NULL);
-
- i = 0;
- while ((view = gtk_notebook_get_nth_page (GTK_NOTEBOOK (
- browser->notebook), i++)))
- if (midori_view_is_blank (MIDORI_VIEW (view)))
- midori_view_reload (MIDORI_VIEW (view), FALSE);
+ midori_view_save_speed_dial_config (MIDORI_VIEW (view), key_file);
g_object_unref (img);
g_free (file_path);
g_free (thumb_dir);
- g_free (config_file);
g_free (dial_id);
}
g_free (uri);
gchar* thumb_dir;
gchar* thumb_uri;
MidoriBrowser* browser;
- gint i;
- GtkWidget* tab;
+ GKeyFile* key_file;
if (midori_view_get_load_status (thumb_view) != MIDORI_LOAD_FINISHED)
return;
#endif
browser = midori_browser_get_for_widget (GTK_WIDGET (view));
- i = 0;
- while ((tab = midori_browser_get_nth_tab (browser, i++)))
- if (midori_view_is_blank (MIDORI_VIEW (tab)))
- midori_view_reload (MIDORI_VIEW (tab), FALSE);
+ g_object_get (browser, "speed-dial", &key_file, NULL);
+ midori_view_save_speed_dial_config (view, key_file);
}
/**
const gchar* message)
{
gchar* action;
- gchar* config_file;
GKeyFile* key_file;
MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view));
gchar* msg = g_strdup (message + 16);
gchar** parts = g_strsplit (msg, " ", 4);
- gint i;
- GtkWidget* tab;
g_object_get (browser, "speed-dial", &key_file, NULL);
action = parts[0];
g_free (dial_id);
}
+ midori_view_save_speed_dial_config (view, key_file);
+
+ g_free (msg);
+ g_free (action);
+}
+
+void
+midori_view_save_speed_dial_config (MidoriView* view,
+ GKeyFile* key_file)
+{
+ gchar* config_file;
+ guint i = 0;
+ MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view));
+ GtkWidget* tab;
+
config_file = g_build_filename (sokoke_set_config_dir (NULL), "speeddial", NULL);
sokoke_key_file_save_to_file (key_file, config_file, NULL);
+ g_free (config_file);
+
katze_assign (speeddial_markup, prepare_speed_dial_html (view));
- i = 0;
while ((tab = midori_browser_get_nth_tab (browser, i++)))
if (midori_view_is_blank (MIDORI_VIEW (tab)))
midori_view_reload (MIDORI_VIEW (tab), FALSE);
- g_free (msg);
- g_free (action);
- g_free (config_file);
}