/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2002-2009 Hiroyuki Yamamoto & the Claws Mail team
+ * Copyright (C) 2002-2012 Hiroyuki Yamamoto & the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifdef HAVE_CONFIG_H
# include "config.h"
+#include "claws-features.h"
#endif
#include "defs.h"
#include "mainwindow.h"
#include "alertpanel.h"
#include "prefs_common.h"
+#include "prefs_actions.h"
#include "utils.h"
#include "prefswindow.h"
#include "prefs_gtk.h"
#include "plugin.h"
+#include "messageview.h"
enum
{
static void prefs_toolbar_create_widget(PrefsPage *_page, GtkWindow *window, gpointer data)
{
ToolbarPage *prefs_toolbar = (ToolbarPage *) _page;
- gchar *win_titles[3];
- win_titles[TOOLBAR_MAIN] = _("Main toolbar configuration");
- win_titles[TOOLBAR_COMPOSE] = _("Compose toolbar configuration");
- win_titles[TOOLBAR_MSGVIEW] = _("Message view toolbar configuration");
prefs_toolbar->window = GTK_WIDGET(window);
item->index = toolbar_ret_val_from_descr(event);
g_free(event);
- /* TODO: save A_CLAWS_ACTIONS only if they are still active */
toolbar_set_list_item(item, prefs_toolbar->source);
g_free(item->file);
g_free(prefs_toolbar_messageview);
}
+void prefs_toolbar_update_action_btns(void)
+{
+ if (toolbar_check_action_btns(TOOLBAR_MAIN)) {
+ toolbar_save_config_file(TOOLBAR_MAIN);
+ toolbar_update(TOOLBAR_MAIN, mainwindow_get_mainwindow());
+ }
+
+ if (toolbar_check_action_btns(TOOLBAR_COMPOSE)) {
+ toolbar_save_config_file(TOOLBAR_COMPOSE);
+ compose_reflect_prefs_pixmap_theme();
+ }
+
+ if (toolbar_check_action_btns(TOOLBAR_MSGVIEW)) {
+ toolbar_save_config_file(TOOLBAR_MSGVIEW);
+ messageview_reflect_prefs_pixmap_theme();
+ }
+}
+
static void set_visible_if_not_text(GtkTreeViewColumn *col,
GtkCellRenderer *renderer,
GtkTreeModel *model,
static gboolean icon_chooser_key_pressed(GtkWidget *widget, GdkEventKey *event,
ToolbarPage *prefs_toolbar)
{
- if (event && event->keyval == GDK_Escape) {
+ if (event && event->keyval == GDK_KEY_Escape) {
icon_chooser_cancel_clicked(NULL, prefs_toolbar);
return TRUE;
}
ToolbarPage *prefs_toolbar)
{
if (event) {
- if (event->keyval == GDK_KP_Enter ||
- event->keyval == GDK_Return ||
- event->keyval == GDK_space) {
+ if (event->keyval == GDK_KEY_KP_Enter ||
+ event->keyval == GDK_KEY_Return ||
+ event->keyval == GDK_KEY_space) {
icon_chooser_ok_clicked(NULL, prefs_toolbar);
return TRUE;
}
GdkEventButton *event,
ToolbarPage *prefs_toolbar )
{
- GtkWidget *event_widget, *button;
+ GtkWidget *event_widget;
gboolean restore = TRUE;
- button = prefs_toolbar->icon_button;
-
/* Test where mouse was clicked */
event_widget = gtk_get_event_widget((GdkEvent *)event);
if (event_widget != widget) {
restore = FALSE;
break;
}
- event_widget = event_widget->parent;
+ event_widget = gtk_widget_get_parent(event_widget);
}
}
static void icon_chooser_create(GtkButton *button, ToolbarPage *prefs_toolbar)
{
+ GtkAllocation allocation;
GtkWidget *icon_chooser_win;
GtkWidget *scrollwin;
GtkWidget *icon_view;
#ifndef MAEMO
gtk_window_set_decorated(GTK_WINDOW(icon_chooser_win), FALSE);
#endif
- gdk_window_get_origin(GTK_WIDGET(prefs_toolbar->icon_button)->window,
+ gdk_window_get_origin(gtk_widget_get_window(
+ GTK_WIDGET(prefs_toolbar->icon_button)),
&x, &y);
- x += GTK_WIDGET(prefs_toolbar->icon_button)->allocation.x;
- y += GTK_WIDGET(prefs_toolbar->icon_button)->allocation.y;
+ gtk_widget_get_allocation(GTK_WIDGET(prefs_toolbar->icon_button), &allocation);
+ x += allocation.x;
+ y += allocation.y;
y += 50;
x -= 300-50;
gtk_window_move(GTK_WINDOW(icon_chooser_win), x, y);