GdkEventKey *event,
gpointer data);
+static gint foldersel_clist_compare (GtkCList *clist,
+ gconstpointer ptr1,
+ gconstpointer ptr2);
+
FolderItem *foldersel_folder_sel(Folder *cur_folder,
FolderSelectionType type,
const gchar *default_folder)
gtk_ctree_set_expander_style(GTK_CTREE(ctree),
GTK_CTREE_EXPANDER_SQUARE);
gtk_ctree_set_indent(GTK_CTREE(ctree), CTREE_INDENT);
+ gtk_clist_set_compare_func(GTK_CLIST(ctree), foldersel_clist_compare);
GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(ctree)->column[0].button,
GTK_CAN_FOCUS);
/* gtk_signal_connect(GTK_OBJECT(ctree), "tree_select_row",
if (event && event->keyval == GDK_Escape)
foldersel_cancel(NULL, NULL);
}
+
+static gint foldersel_clist_compare(GtkCList *clist,
+ gconstpointer ptr1, gconstpointer ptr2)
+{
+ FolderItem *item1 = ((GtkCListRow *)ptr1)->data;
+ FolderItem *item2 = ((GtkCListRow *)ptr2)->data;
+
+ if (!item1->name)
+ return (item2->name != NULL);
+ if (!item2->name)
+ return -1;
+
+ return g_strcasecmp(item1->name, item2->name);
+}
static void toolbar_account_cb (GtkWidget *widget,
gpointer data);
+#if 0
static void toolbar_account_button_pressed (GtkWidget *widget,
GdkEventButton *event,
gpointer data);
+#endif
static void ac_label_button_pressed (GtkWidget *widget,
GdkEventButton *event,
gpointer data);
{
SensitiveCond state;
gboolean sensitive;
- gint i;
+ gint i = 0;
struct {
GtkWidget *widget;
SensitiveCond cond;
} entry[11];
- entry[0].widget = mainwin->get_btn;
- entry[0].cond = M_HAVE_ACCOUNT|M_UNLOCKED;
- entry[1].widget = mainwin->getall_btn;
- entry[1].cond = M_HAVE_ACCOUNT|M_UNLOCKED;
- entry[2].widget = mainwin->compose_news_btn;
- entry[2].cond = M_HAVE_NEWS_ACCOUNT;
- entry[3].widget = mainwin->reply_btn;
- entry[3].cond = M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST;
- entry[4].widget = mainwin->replyall_btn;
- entry[4].cond = M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST;
- entry[5].widget = mainwin->replysender_btn;
- entry[5].cond = M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST;
- entry[6].widget = mainwin->fwd_btn;
- entry[6].cond = M_HAVE_ACCOUNT|M_TARGET_EXIST;
-/* entry[6].widget = mainwin->prefs_btn;
- entry[6].cond = M_UNLOCKED;
- entry[7].widget = mainwin->account_btn;
- entry[7].cond = M_UNLOCKED; */
- entry[7].widget = mainwin->next_btn;
- entry[7].cond = M_MSG_EXIST;
- entry[8].widget = mainwin->delete_btn;
- entry[8].cond = M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED;
- entry[9].widget = mainwin->exec_btn;
- entry[9].cond = M_MSG_EXIST|M_EXEC|M_UNLOCKED;
- entry[10].widget = NULL;
- entry[10].cond = 0;
+#define SET_WIDGET_COND(w, c) \
+{ \
+ entry[i].widget = w; \
+ entry[i].cond = c; \
+ i++; \
+}
+
+ SET_WIDGET_COND(mainwin->get_btn, M_HAVE_ACCOUNT|M_UNLOCKED);
+ SET_WIDGET_COND(mainwin->getall_btn, M_HAVE_ACCOUNT|M_UNLOCKED);
+ SET_WIDGET_COND(mainwin->compose_news_btn, M_HAVE_ACCOUNT);
+ SET_WIDGET_COND(mainwin->reply_btn,
+ M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+ SET_WIDGET_COND(mainwin->replyall_btn,
+ M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+ SET_WIDGET_COND(mainwin->replysender_btn,
+ M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
+ SET_WIDGET_COND(mainwin->fwd_btn, M_HAVE_ACCOUNT|M_TARGET_EXIST);
+#if 0
+ SET_WIDGET_COND(mainwin->prefs_btn, M_UNLOCKED);
+ SET_WIDGET_COND(mainwin->account_btn, M_UNLOCKED);
+#endif
+ SET_WIDGET_COND(mainwin->next_btn, M_MSG_EXIST);
+ SET_WIDGET_COND(mainwin->delete_btn,
+ M_TARGET_EXIST|M_ALLOW_DELETE|M_UNLOCKED);
+ SET_WIDGET_COND(mainwin->exec_btn, M_MSG_EXIST|M_EXEC|M_UNLOCKED);
+ SET_WIDGET_COND(NULL, 0);
+
+#undef SET_WIDGET_COND
state = main_window_get_current_state(mainwin);
GtkWidget *replysender_btn;
GtkWidget *fwd_btn;
GtkWidget *send_btn;
- /*
+#if 0
GtkWidget *prefs_btn;
GtkWidget *account_btn;
- */
+#endif
GtkWidget *next_btn;
GtkWidget *delete_btn;
GtkWidget *exec_btn;
toolbar_next_unread_cb,
mainwin);
- /*
+#if 0
gtk_toolbar_append_space(GTK_TOOLBAR(toolbar));
icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_PREFERENCES);
prefs_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
_("Prefs"),
- _("Common preference"),
+ _("Common preferences"),
"Prefs",
icon_wid,
toolbar_prefs_cb,
gtk_signal_connect(GTK_OBJECT(account_btn), "button_press_event",
GTK_SIGNAL_FUNC(toolbar_account_button_pressed),
mainwin);
- */
+#endif
gtk_signal_connect(GTK_OBJECT(reply_btn), "button_press_event",
GTK_SIGNAL_FUNC(toolbar_reply_popup_cb),
mainwin);
- mainwin->toolbar = toolbar;
- mainwin->get_btn = get_btn;
- mainwin->getall_btn = getall_btn;
- mainwin->compose_mail_btn = compose_mail_btn;
- mainwin->compose_news_btn = compose_news_btn;
- mainwin->reply_btn = reply_btn;
- mainwin->replyall_btn = replyall_btn;
- mainwin->replysender_btn = replysender_btn;
- mainwin->fwd_btn = fwd_btn;
- mainwin->send_btn = send_btn;
- /*
- mainwin->prefs_btn = prefs_btn;
- mainwin->account_btn = account_btn;
- */
- mainwin->next_btn = next_btn;
- mainwin->delete_btn = delete_btn;
- mainwin->exec_btn = exec_btn;
+ mainwin->toolbar = toolbar;
+ mainwin->get_btn = get_btn;
+ mainwin->getall_btn = getall_btn;
+ mainwin->compose_mail_btn = compose_mail_btn;
+ mainwin->compose_news_btn = compose_news_btn;
+ mainwin->reply_btn = reply_btn;
+ mainwin->replyall_btn = replyall_btn;
+ mainwin->replysender_btn = replysender_btn;
+ mainwin->fwd_btn = fwd_btn;
+ mainwin->send_btn = send_btn;
+ #if 0
+ mainwin->prefs_btn = prefs_btn;
+ mainwin->account_btn = account_btn;
+ #endif
+ mainwin->next_btn = next_btn;
+ mainwin->delete_btn = delete_btn;
+ mainwin->exec_btn = exec_btn;
gtk_widget_show_all(toolbar);
}
prefs_account_open_cb(mainwin, 0, NULL);
}
+#if 0
static void toolbar_account_button_pressed(GtkWidget *widget,
GdkEventButton *event,
gpointer data)
menu_button_position, widget,
event->button, event->time);
}
+#endif
static void ac_label_button_pressed(GtkWidget *widget, GdkEventButton *event,
gpointer data)
void messageview_select_all(MessageView *messageview)
{
- gint displaytype = /* force MVIEV_TEXT on first page */
- ((messageview->type == MVIEW_MIME)
- && (gtk_notebook_get_current_page(GTK_NOTEBOOK(
- messageview->mimeview->notebook)) > 0))
- ? MVIEW_MIME
- : MVIEW_TEXT;
-
- switch (displaytype) {
- case MVIEW_TEXT:
- gtk_editable_select_region(GTK_EDITABLE(messageview->textview->text), 0, -1);
- break;
- case MVIEW_MIME:
- if (messageview->mimeview->type == MIMEVIEW_TEXT)
- gtk_editable_select_region(GTK_EDITABLE(messageview->mimeview->textview->text), 0, -1);
- default:
- break;
+ GtkWidget *text = NULL;
+
+ if (messageview->type == MVIEW_TEXT)
+ text = messageview->textview->text;
+ else if (messageview->type == MVIEW_MIME) {
+ if (gtk_notebook_get_current_page
+ (GTK_NOTEBOOK(messageview->mimeview->notebook)) == 0)
+ text = messageview->textview->text;
+ else if (messageview->mimeview->type == MIMEVIEW_TEXT)
+ text = messageview->mimeview->textview->text;
}
+
+ if (text)
+ gtk_editable_select_region(GTK_EDITABLE(text), 0, -1);
}
void messageview_set_position(MessageView *messageview, gint pos)