#include "mainwindow.h"
#include "alertpanel.h"
#include "prefs_common.h"
+#include "prefs_actions.h"
#include "utils.h"
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);
static void add_item_to_plugin_combo(gpointer key, gpointer data, gpointer combo_box)
{
- gtk_combo_box_text_append_text(
- GTK_COMBO_BOX_TEXT(combo_box),
- (const gchar*)key);
+ gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), (const gchar*)key);
}
static void prefs_toolbar_populate(ToolbarPage *prefs_toolbar)
act = (gchar *)cur->data;
get_action_name(act, &act_name);
- gtk_combo_box_text_append_text(
- GTK_COMBO_BOX_TEXT(prefs_toolbar->item_action_combo),
+ gtk_combo_box_append_text(
+ GTK_COMBO_BOX(prefs_toolbar->item_action_combo),
act_name);
g_free(act_name);
}
if (item_type == ITEM_FUNCTION) {
- event = gtk_combo_box_text_get_active_text(
- GTK_COMBO_BOX_TEXT(prefs_toolbar->item_func_combo));
+ event = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
+ prefs_toolbar->item_func_combo));
if (is_duplicate(prefs_toolbar, event)) {
alertpanel_error(ERROR_MSG);
-1);
if (item_type == ITEM_FUNCTION) {
- icon_event = gtk_combo_box_text_get_active_text(
- GTK_COMBO_BOX_TEXT(prefs_toolbar->item_func_combo));
+ icon_event = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
+ prefs_toolbar->item_func_combo));
if (is_duplicate(prefs_toolbar, icon_event)
&& g_utf8_collate(icon_event, set_event) != 0){
static void action_selection_changed(GtkComboBox *action_combo,
ToolbarPage *prefs_toolbar)
{
- gchar *text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
+ gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
prefs_toolbar->item_action_combo));
if(text != NULL) { /* action */
static void plugin_selection_changed(GtkComboBox *action_combo,
ToolbarPage *prefs_toolbar)
{
- gchar *text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(prefs_toolbar->item_plugin_combo));
+ gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(prefs_toolbar->item_plugin_combo));
if (text != NULL) { /* action */
gtk_entry_set_text(GTK_ENTRY(prefs_toolbar->item_text_entry), text);
static void func_selection_changed(GtkComboBox *action_combo,
ToolbarPage *prefs_toolbar)
{
- gchar *text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(
+ gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
prefs_toolbar->item_func_combo));
if(text != NULL) { /* action */
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- item_action_combo = gtk_combo_box_text_new();
+ item_action_combo = gtk_combo_box_new_text();
gtk_widget_set_size_request(item_action_combo, 200, -1);
gtk_table_attach (GTK_TABLE (table), item_action_combo, 1, 3, 1, 2,
(GtkAttachOptions) (GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
/* available internal functions */
- item_func_combo = gtk_combo_box_text_new();
+ item_func_combo = gtk_combo_box_new_text();
gtk_widget_set_size_request(item_func_combo, 200, -1);
gtk_table_attach (GTK_TABLE (table), item_func_combo, 1, 3, 1, 2,
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
/* plugin-registered items */
- item_plugin_combo = gtk_combo_box_text_new();
+ item_plugin_combo = gtk_combo_box_new_text();
gtk_widget_set_size_request(item_plugin_combo, 200, -1);
gtk_table_attach(GTK_TABLE(table), item_plugin_combo, 1, 3, 1, 2,
(GtkAttachOptions) (GTK_FILL),
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;
}
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);