+2001-05-26 [alfons]
+
+ Minor GUI fixes adding horizontal scrollbars to Hoa's matcher dialogs,
+ and fixing the persistence troubles when using separate windows.
+
+ * src/mainwindow.c:
+
+ Added #define SEPARATE_ACTION used in the gtk item factory for
+ the SEPARATE_FOLDER and SEPARATE_MESSAGE items, so we can
+ use gtk_item_factory_get_widget_by_action() to get the items.
+
+ Removed separate_widget_cb from the gtk item factory data
+
+ (mainwindow_create): connect separate_widget_cb() to check
+ menu item "toggled" signal. also passing a MainWindow pointer
+ as object data for both check menu items.
+
+ (separate_widget_cb): definition of separate_widget_cb() to match
+ GtkCheckMenuItem's "toggled" signal. Now get the pointer to the main
+ window using gtk_object_get_data(). The type of window separation
+ (SEPARATE_MESSAGE or SEPARATE_FOLDER) is passed as the signal's data
+
+ * src/prefs_filtering.c,
+ src/prefs_matcher.c: added horizontal scrollbars
+
2001-05-25 [darko]
* src/headerview.c
static void toggle_statusbar_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-static void separate_widget_cb (MainWindow *mainwin,
- guint action,
- GtkWidget *widget);
+
+static void separate_widget_cb(GtkCheckMenuItem *checkitem, guint action);
static void addressbook_open_cb (MainWindow *mainwin,
guint action,
FolderItem *item,
gpointer data);
+#define SEPARATE_ACTION 667
+
static GtkItemFactoryEntry mainwin_entries[] =
{
{N_("/_File"), NULL, NULL, 0, "<Branch>"},
{N_("/_View/_Toolbar/_Non-display"), NULL, toggle_toolbar_cb, TOOLBAR_NONE, "/View/Toolbar/Icon and text"},
{N_("/_View/_Status bar"), NULL, toggle_statusbar_cb, 0, "<ToggleItem>"},
{N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_View/Separate f_older tree"), NULL, separate_widget_cb, SEPARATE_FOLDER, "<ToggleItem>"},
- {N_("/_View/Separate m_essage view"), NULL, separate_widget_cb, SEPARATE_MESSAGE, "<ToggleItem>"},
+ {N_("/_View/Separate f_older tree"), NULL, NULL, SEPARATE_ACTION + SEPARATE_FOLDER, "<ToggleItem>"},
+ {N_("/_View/Separate m_essage view"), NULL, NULL, SEPARATE_ACTION + SEPARATE_MESSAGE, "<ToggleItem>"},
{N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_View/_Code set"), NULL, NULL, 0, "<Branch>"},
{N_("/_View/_Code set/_Auto detect"),
n_menu_entries = sizeof(mainwin_entries) / sizeof(mainwin_entries[0]);
menubar = menubar_create(window, mainwin_entries,
n_menu_entries, "<Main>", mainwin);
+
gtk_widget_show(menubar);
gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, TRUE, 0);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
prefs_common.show_statusbar);
+ /* set the check of the SEPARATE_xxx menu items. we also need the main window
+ * as a property and pass the action type to the callback */
+ menuitem = gtk_item_factory_get_widget_by_action(ifactory, SEPARATE_ACTION + SEPARATE_FOLDER);
+ g_assert(menuitem);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), type & SEPARATE_FOLDER);
+ gtk_object_set_data(GTK_OBJECT(menuitem), "mainwindow", mainwin);
+ gtk_signal_connect(GTK_OBJECT(menuitem), "toggled", GTK_SIGNAL_FUNC(separate_widget_cb),
+ GUINT_TO_POINTER(SEPARATE_FOLDER));
+
+ menuitem = gtk_item_factory_get_widget_by_action(ifactory, SEPARATE_ACTION + SEPARATE_MESSAGE);
+ g_assert(menuitem);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), type & SEPARATE_MESSAGE);
+ gtk_object_set_data(GTK_OBJECT(menuitem), "mainwindow", mainwin);
+ gtk_signal_connect(GTK_OBJECT(menuitem), "toggled", GTK_SIGNAL_FUNC(separate_widget_cb),
+ GUINT_TO_POINTER(SEPARATE_MESSAGE));
+
menu_set_sensitive(ifactory, "/Summary/Thread view",
prefs_common.enable_thread ? FALSE : TRUE);
menu_set_sensitive(ifactory, "/Summary/Unthread view",
}
}
-static void separate_widget_cb(MainWindow *mainwin, guint action,
- GtkWidget *widget)
+static void separate_widget_cb(GtkCheckMenuItem *checkitem, guint action)
{
+ MainWindow *mainwin;
SeparateType type;
+ mainwin = (MainWindow *) gtk_object_get_data(GTK_OBJECT(checkitem), "mainwindow");
+ g_return_if_fail(mainwin != NULL);
+
type = mainwin->type ^ action;
main_window_separation_change(mainwin, type);
filtering.cond_clist = cond_clist;
}
+static void prefs_filtering_update_hscrollbar(void)
+{
+ gint optwidth = gtk_clist_optimal_column_width(GTK_CLIST(filtering.cond_clist), 0);
+ gtk_clist_set_column_width(GTK_CLIST(filtering.cond_clist), 0, optwidth);
+}
+
static void prefs_filtering_set_dialog(void)
{
GtkCList *clist = GTK_CLIST(filtering.cond_clist);
GSList *cur;
-
+
gtk_clist_freeze(clist);
gtk_clist_clear(clist);
prefs_filtering_clist_set_row(-1, prop);
}
+ prefs_filtering_update_hscrollbar();
gtk_clist_thaw(clist);
prefs_filtering_reset_dialog();
prefs_filtering_clist_set_row(-1, prop);
filteringprop_free(prop);
+
+ prefs_filtering_update_hscrollbar();
}
static void prefs_filtering_substitute_cb(void)
prefs_filtering_clist_set_row(row, prop);
filteringprop_free(prop);
+
+ prefs_filtering_update_hscrollbar();
}
static void prefs_filtering_delete_cb(void)
return;
gtk_clist_remove(clist, row);
+
+ prefs_filtering_update_hscrollbar();
}
static void prefs_filtering_up(void)
gtk_entry_set_text(GTK_ENTRY(matcher.value_entry), "");
}
+static void prefs_matcher_update_hscrollbar(void)
+{
+ gint optwidth = gtk_clist_optimal_column_width(GTK_CLIST(matcher.cond_clist), 0);
+ gtk_clist_set_column_width(GTK_CLIST(matcher.cond_clist), 0, optwidth);
+}
+
static void prefs_matcher_set_dialog(MatcherList * matchers)
{
GtkCList *clist = GTK_CLIST(matcher.cond_clist);
bool_op = matchers->bool_and;
}
+
+ prefs_matcher_update_hscrollbar();
gtk_clist_thaw(clist);
matcherprop_free(matcherprop);
prefs_matcher_reset_condition();
+ prefs_matcher_update_hscrollbar();
}
static void prefs_matcher_substitute_cb(void)
matcherprop_free(matcherprop);
prefs_matcher_reset_condition();
+
+ prefs_matcher_update_hscrollbar();
}
static void prefs_matcher_delete_cb(void)
return;
gtk_clist_remove(clist, row);
+
+ prefs_matcher_update_hscrollbar();
}
static void prefs_matcher_up(void)