+2001-01-05 [alfons] 0.6.6claws38
+
+ * sync with sylpheed 0.6.6cvs10-17
+ (last stuff marked as LAST_STABLE)
+
2002-01-04 [melvin] 0.6.6claws37
* src/account.c
MICRO_VERSION=6
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws37
+EXTRA_VERSION=claws38
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl
gint column,
GdkEvent *event,
gpointer data);
+static void account_row_moved (GtkCList *clist,
+ gint source_row,
+ gint dest_row);
static void account_key_pressed (GtkWidget *widget,
GdkEventKey *event,
gpointer data);
gtk_signal_connect (GTK_OBJECT (clist), "select_row",
GTK_SIGNAL_FUNC (account_selected), NULL);
+ gtk_signal_connect (GTK_OBJECT (clist), "row_move",
+ GTK_SIGNAL_FUNC (account_row_moved), NULL);
vbox2 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox2);
if (!clist->selection) return;
row = GPOINTER_TO_INT(clist->selection->data);
- if (row > 0) {
+ if (row > 0)
gtk_clist_row_move(clist, row, row - 1);
- account_list_set();
- }
}
static void account_down(void)
if (!clist->selection) return;
row = GPOINTER_TO_INT(clist->selection->data);
- if (row < clist->rows - 1) {
+ if (row < clist->rows - 1)
gtk_clist_row_move(clist, row, row + 1);
- account_list_set();
- }
}
static void account_set_default(void)
}
}
+static void account_row_moved(GtkCList *clist, gint source_row, gint dest_row)
+{
+ account_list_set();
+ if (gtk_clist_row_is_visible(clist, dest_row) != GTK_VISIBILITY_FULL) {
+ gtk_clist_moveto(clist, dest_row, -1,
+ source_row < dest_row ? 1.0 : 0.0, 0.0);
+ }
+}
+
static void account_key_pressed(GtkWidget *widget, GdkEventKey *event,
gpointer data)
{
{
GtkCList *clist = GTK_CLIST(edit_account.clist);
GList *cur;
- gint prev_row;
+ gint row = -1, prev_row = -1;
if (clist->selection)
prev_row = GPOINTER_TO_INT(clist->selection->data);
- else
- prev_row = -1;
gtk_clist_freeze(clist);
gtk_clist_clear(clist);
for (cur = account_list; cur != NULL; cur = cur->next) {
- gint row;
-
row = account_clist_set_row((PrefsAccount *)cur->data, -1);
if ((PrefsAccount *)cur->data == cur_account) {
gtk_clist_select_row(clist, row, -1);
}
if (prev_row >= 0) {
- gtk_clist_select_row(clist, prev_row, -1);
- gtkut_clist_set_focus_row(clist, prev_row);
- gtk_clist_moveto(clist, prev_row, 0, 0.5, 0);
+ row = prev_row;
+ gtk_clist_select_row(clist, row, -1);
+ gtkut_clist_set_focus_row(clist, row);
}
+ if (row >= 0 &&
+ gtk_clist_row_is_visible(clist, row) != GTK_VISIBILITY_FULL)
+ gtk_clist_moveto(clist, row, -1, 0.5, 0);
+
gtk_clist_thaw(clist);
}
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
/* #include <sys/utsname.h> */
# include <wctype.h>
#endif
-
-#include "gtkstext.h"
-
#include "intl.h"
#include "main.h"
#include "mainwindow.h"
#include "compose.h"
+#include "gtkstext.h"
#include "addressbook.h"
#include "folderview.h"
#include "procmsg.h"
{N_("/_File/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_File/_Close"), "<alt>W", compose_close_cb, 0, NULL},
- {N_("/_Edit"), NULL, NULL, 0, "<Branch>"},
- {N_("/_Edit/_Undo"), "<control>Z", compose_undo_cb, 0, NULL},
- {N_("/_Edit/_Redo"), "<control>Y", compose_redo_cb, 0, NULL},
- {N_("/_Edit/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Edit/Cu_t"), "<control>X", compose_cut_cb, 0, NULL},
- {N_("/_Edit/_Copy"), "<control>C", compose_copy_cb, 0, NULL},
- {N_("/_Edit/_Paste"), "<control>V", compose_paste_cb, 0, NULL},
- {N_("/_Edit/Select _all"), "<control>A", compose_allsel_cb, 0, NULL},
- {N_("/_Edit/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Edit/_Wrap current paragraph"), "<alt>L", compose_wrap_line, 0, NULL},
+ {N_("/_Edit"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_Edit/_Undo"), "<control>Z", compose_undo_cb, 0, NULL},
+ {N_("/_Edit/_Redo"), "<control>Y", compose_redo_cb, 0, NULL},
+ {N_("/_Edit/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Edit/Cu_t"), "<control>X", compose_cut_cb, 0, NULL},
+ {N_("/_Edit/_Copy"), "<control>C", compose_copy_cb, 0, NULL},
+ {N_("/_Edit/_Paste"), "<control>V", compose_paste_cb, 0, NULL},
+ {N_("/_Edit/Select _all"), "<control>A", compose_allsel_cb, 0, NULL},
+ {N_("/_Edit/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Edit/_Wrap current paragraph"),
+ "<alt>L", compose_wrap_line, 0, NULL},
{N_("/_Edit/Wrap all long _lines"),
- "<shift><alt>L", compose_wrap_line_all, 0, NULL},
+ "<shift><alt>L", compose_wrap_line_all, 0, NULL},
{N_("/_Edit/Edit with e_xternal editor"),
- "<alt>X", compose_ext_editor_cb, 0, NULL},
-
+ "<alt>X", compose_ext_editor_cb, 0, NULL},
+#if 0 /* NEW COMPOSE GUI */
+ {N_("/_View"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_View/_To"), NULL, compose_toggle_to_cb , 0, "<ToggleItem>"},
+ {N_("/_View/_Cc"), NULL, compose_toggle_cc_cb , 0, "<ToggleItem>"},
+ {N_("/_View/_Bcc"), NULL, compose_toggle_bcc_cb , 0, "<ToggleItem>"},
+ {N_("/_View/_Reply to"), NULL, compose_toggle_replyto_cb, 0, "<ToggleItem>"},
+ {N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Followup to"), NULL, compose_toggle_followupto_cb, 0, "<ToggleItem>"},
+ {N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/R_uler"), NULL, compose_toggle_ruler_cb, 0, "<ToggleItem>"},
+ {N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Attachment"), NULL, compose_toggle_attach_cb, 0, "<ToggleItem>"},
+#endif
{N_("/_Message"), NULL, NULL, 0, "<Branch>"},
{N_("/_Message/_Send"), "<control>Return",
compose_send_cb, 0, NULL},
compose_send_later_cb, 0, NULL},
{N_("/_Message/Save to _draft folder"),
"<alt>D", compose_draft_cb, 0, NULL},
+ {N_("/_Message/Save and _keep editing"),
+ "<control>S", compose_draft_cb, 1, NULL},
#if 0 /* NEW COMPOSE GUI */
{N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_To"), NULL, compose_toggle_to_cb , 0, "<ToggleItem>"},
{N_("/_Tool/Show _ruler"), NULL, compose_toggle_ruler_cb, 0, "<ToggleItem>"},
{N_("/_Tool/_Address book"), "<alt>A", compose_address_cb , 0, NULL},
{N_("/_Tool/_Template"), NULL, NULL, 0, "<Branch>"},
- {N_("/_Help"), NULL, NULL, 0, "<LastBranch>"},
+ {N_("/_Help"), NULL, NULL, 0, "<Branch>"},
{N_("/_Help/_About"), NULL, about_show, 0, NULL}
};
GtkWidget *menuitem;
ifactory = gtk_item_factory_from_widget(compose->menubar);
- menuitem = gtk_item_factory_get_item(ifactory, "/Message/Bcc");
+ menuitem = gtk_item_factory_get_item(ifactory, "/View/Bcc");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
}
ifactory = gtk_item_factory_from_widget(compose->menubar);
menuitem = gtk_item_factory_get_item
- (ifactory, "/Message/Reply to");
+ (ifactory, "/View/Reply to");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
}
while (--len >= 0)
if (buf[len] == '\r') buf[len] = '\n';
}
-
- gtk_stext_insert(text, NULL, NULL, NULL, buf, -1);
+ gtk_stext_insert(text, NULL, NULL, NULL, buf, -1);
}
gtk_stext_thaw(text);
ifactory = gtk_item_factory_from_widget(compose->menubar);
menuitem = gtk_item_factory_get_item(ifactory,
- "/Message/Attach");
+ "/View/Attachment");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
TRUE);
}
#define GET_CHAR(pos, buf, len) \
{ \
if (text->use_wchar) \
- len = wctomb(buf, (wchar_t)GTK_STEXT_INDEX(text, (pos))); \
+ len = wctomb(buf, (wchar_t)GTK_STEXT_INDEX(text, (pos))); \
else { \
buf[0] = GTK_STEXT_INDEX(text, (pos)); \
len = 1; \
gint line_pos, cur_pos;
gint line_len, cur_len;
-
gtk_stext_freeze(text);
text_len = gtk_stext_get_length(text);
/* mark position of new line - needed for quotation wrap */
if (is_new_line) {
if (linewrap_quote) {
- qlen = gtkut_text_str_compare
+ qlen = gtkut_stext_str_compare
(text, cur_pos, tlen, qfmt);
if (qlen)
i_len = get_indent_length
/* if it's just quotation + newline skip it */
if (i_len && (cur_pos + 1 < tlen)) {
/* check if text at new line matches indent */
- ilen = gtkut_text_str_compare_n
+ ilen = gtkut_stext_str_compare_n
(text, cur_pos + 1, p_pos, i_len, tlen);
if (cur_pos + ilen < tlen) {
GET_CHAR(cur_pos + ilen + 1, cb, clen);
/* if text starts with quote fmt or with
indent string, delete them */
if (i_len) {
- ilen = gtkut_text_str_compare_n
+ ilen = gtkut_stext_str_compare_n
(text, cur_pos, p_pos, i_len,
tlen);
if (ilen) {
- gtk_stext_forward_delete(text,
- ilen);
+ gtk_stext_forward_delete
+ (text, ilen);
tlen -= ilen;
}
} else if (qlen) {
- if (gtkut_text_str_compare
+ if (gtkut_stext_str_compare
(text, cur_pos, tlen, qfmt)) {
gtk_stext_forward_delete
(text, qlen);
((clen > 1) || isalnum(cb[0]))) {
gtk_stext_insert(text, NULL, NULL,
NULL, " ", 1);
- /* gtk_text_compact_buffer(text); */
+ /* gtk_stext_compact_buffer(text); */
tlen++;
}
dump_text(text, line_pos, tlen, 1);
#endif
/* force wrapping if it is one long word but not URL */
- if (p_pos + i_len == line_pos)
- if (!gtkut_text_is_uri_string
+ if (line_pos - p_pos <= i_len)
+ if (!gtkut_stext_is_uri_string
(text, line_pos, tlen))
line_pos = cur_pos - 1;
#ifdef WRAP_DEBUG
/* if next character is space delete it */
if (clen == 1 && isspace(*cbuf)) {
if (p_pos + i_len != line_pos ||
- !gtkut_text_is_uri_string
+ !gtkut_stext_is_uri_string
(text, line_pos, tlen)) {
gtk_stext_set_point(text, line_pos);
gtk_stext_backward_delete(text, 1);
/* if it is URL at beginning of line don't wrap */
if (p_pos + i_len == line_pos &&
- gtkut_text_is_uri_string(text, line_pos, tlen)) {
+ gtkut_stext_is_uri_string(text, line_pos, tlen)) {
#ifdef WRAP_DEBUG
printf("found URL at ");
dump_text(text, line_pos, tlen, 1);
/* should we insert quotation ? */
if (linewrap_quote && qlen) {
/* only if line is not already quoted */
- if (!gtkut_text_str_compare
+ if (!gtkut_stext_str_compare
(text, line_pos, tlen, qfmt)) {
guint ins_len;
gtk_stext_thaw(text);
}
+
#undef GET_CHAR
static void compose_set_title(Compose *compose)
g_free(addr);
}
-
static void compose_add_entry_field(GtkWidget *table, GtkWidget **hbox,
GtkWidget **entry, gint *count,
const gchar *label_str,
gtk_stext_set_editable(GTK_STEXT(text), TRUE);
if (prefs_common.block_cursor) {
- GTK_STEXT(text)->cursor_type = STEXT_CURSOR_BLOCK;
+ GTK_STEXT(text)->cursor_type = GTK_STEXT_CURSOR_BLOCK;
}
if (prefs_common.smart_wrapping) {
style = gtk_widget_get_style(text);
- /* workaround for the slow down of GtkText when using Pixmap theme */
+ /* workaround for the slow down of GtkSText when using Pixmap theme */
if (style->engine) {
GtkThemeEngine *engine;
tmpl_menu = gtk_item_factory_get_item(ifactory, "/Tool/Template");
#if 0 /* NEW COMPOSE GUI */
+ gtk_widget_hide(bcc_hbox);
+ gtk_widget_hide(bcc_entry);
+ gtk_widget_hide(reply_hbox);
+ gtk_widget_hide(reply_entry);
+ gtk_widget_hide(followup_hbox);
+ gtk_widget_hide(followup_entry);
+ gtk_widget_hide(ruler_hbox);
+ gtk_table_set_row_spacing(GTK_TABLE(table), 4, 0);
+ gtk_table_set_row_spacing(GTK_TABLE(table), 5, 0);
+ gtk_table_set_row_spacing(GTK_TABLE(table), 6, 0);
+
if (account->protocol == A_NNTP) {
gtk_widget_hide(to_hbox);
gtk_widget_hide(to_entry);
gtk_widget_hide(newsgroups_hbox);
gtk_widget_hide(newsgroups_entry);
gtk_table_set_row_spacing(GTK_TABLE(table), 2, 0);
-
- menu_set_sensitive(ifactory, "/Message/Followup to", FALSE);
+ menu_set_sensitive(ifactory, "/View/Followup to", FALSE);
}
#endif
#if 0 /* NEW COMPOSE GUI */
if (account->protocol != A_NNTP) {
- menuitem = gtk_item_factory_get_item(ifactory, "/Message/To");
+ menuitem = gtk_item_factory_get_item(ifactory, "/View/To");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
gtk_widget_set_sensitive(menuitem, FALSE);
- menuitem = gtk_item_factory_get_item(ifactory, "/Message/Cc");
+ menuitem = gtk_item_factory_get_item(ifactory, "/View/Cc");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
gtk_widget_set_sensitive(menuitem, FALSE);
#if 0 /* NEW COMPOSE GUI */
compose->use_cc = TRUE;
gtk_entry_set_text(GTK_ENTRY(cc_entry), account->auto_cc);
- menuitem = gtk_item_factory_get_item(ifactory, "/Message/Cc");
+ menuitem = gtk_item_factory_get_item(ifactory, "/View/Cc");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
#endif
if (account->set_autobcc) {
compose_entry_append(compose, account->auto_bcc, COMPOSE_BCC);
#if 0 /* NEW COMPOSE GUI */
- compose->use_bcc = TRUE;
- menuitem = gtk_item_factory_get_item(ifactory, "/Message/Bcc");
+ menuitem = gtk_item_factory_get_item(ifactory, "/View/Bcc");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
if (account->auto_bcc && mode != COMPOSE_REEDIT)
#if 0 /* NEW COMPOSE GUI */
compose->use_replyto = TRUE;
menuitem = gtk_item_factory_get_item(ifactory,
- "/Message/Reply to");
+ "/View/Reply to");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
gtk_entry_set_text(GTK_ENTRY(reply_entry),
gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(compose->header_last->combo)->entry), prefs_common.trans_hdr ? _("Newsgroups:") : "Newsgroups:");
}
- menuitem = gtk_item_factory_get_item(ifactory, "/Tool/Show ruler");
+#if 0 /* NEW COMPOSE GUI */
+ menuitem = gtk_item_factory_get_item(ifactory, "/View/Ruler");
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
prefs_common.show_ruler);
+#endif
#if USE_GPGME
menuitem = gtk_item_factory_get_item(ifactory, "/Message/Sign");
return compose;
}
-#include "pixmaps/stock_mail_send.xpm"
-#include "pixmaps/stock_mail_send_queue.xpm"
-#include "pixmaps/stock_mail.xpm"
-#include "pixmaps/stock_paste.xpm"
-#include "pixmaps/stock_mail_attach.xpm"
-#include "pixmaps/stock_mail_compose.xpm"
-#include "pixmaps/linewrap.xpm"
-#include "pixmaps/tb_address_book.xpm"
-
-#define CREATE_TOOLBAR_ICON(xpm_d) \
-{ \
- icon = gdk_pixmap_create_from_xpm_d(container->window, &mask, \
- &container->style->white, \
- xpm_d); \
- icon_wid = gtk_pixmap_new(icon, mask); \
-}
-
static void compose_toolbar_create(Compose *compose, GtkWidget *container)
{
GtkWidget *toolbar;
if (!tmpl || !tmpl->value) return;
gtk_stext_freeze(GTK_STEXT(compose->text));
-
+
if (tmpl->subject && *tmpl->subject != '\0')
gtk_entry_set_text(GTK_ENTRY(compose->subject_entry),
tmpl->subject);
GtkWidget *menuitem;
cancelled = FALSE;
- gtk_main();
+ gtk_main();
if (cancelled == TRUE) {
gtk_widget_hide(attach_prop.window);
gint val;
val = compose_send(compose);
+
if (val == 0) gtk_widget_destroy(compose->window);
}
Compose *compose = (Compose *)data;
FolderItem *draft;
gchar *tmp;
+ gint msgnum;
+ static gboolean lock = FALSE;
+
+ if (lock) return;
draft = folder_get_default_draft();
+ g_return_if_fail(draft != NULL);
+
+ lock = TRUE;
- tmp = g_strdup_printf("%s%cdraft.%d", g_get_tmp_dir(),
+ tmp = g_strdup_printf("%s%cdraft.%d", g_get_tmp_dir(),
G_DIR_SEPARATOR, (gint)compose);
if (compose_write_to_file(compose, tmp, TRUE) < 0) {
g_free(tmp);
+ lock = FALSE;
return;
}
folder_item_scan(draft);
- if (folder_item_add_msg(draft, tmp, TRUE) < 0) {
+ if ((msgnum = folder_item_add_msg(draft, tmp, TRUE)) <= 0) {
unlink(tmp);
g_free(tmp);
+ lock = FALSE;
return;
}
g_free(tmp);
+ draft->mtime = 0; /* force updating */
if (compose->mode == COMPOSE_REEDIT) {
compose_remove_reedit_target(compose);
folder_item_scan(draft);
folderview_update_item(draft, TRUE);
- gtk_widget_destroy(compose->window);
+ lock = FALSE;
+
+ /* 0: quit editing 1: keep editing */
+ if (action == 0)
+ gtk_widget_destroy(compose->window);
+ else {
+ struct stat s;
+ gchar *path;
+
+ path = folder_item_fetch_msg(draft, msgnum);
+ g_return_if_fail(path != NULL);
+ if (stat(path, &s) < 0) {
+ FILE_OP_ERROR(path, "stat");
+ g_free(path);
+ lock = FALSE;
+ return;
+ }
+ g_free(path);
+
+ procmsg_msginfo_free(compose->targetinfo);
+ compose->targetinfo = g_new0(MsgInfo, 1);
+ compose->targetinfo->msgnum = msgnum;
+ compose->targetinfo->size = s.st_size;
+ compose->targetinfo->mtime = s.st_mtime;
+ compose->targetinfo->folder = draft;
+ compose->mode = COMPOSE_REEDIT;
+ }
}
static void compose_attach_cb(gpointer data, guint action, GtkWidget *widget)
{N_("/_Rename folder..."), NULL, folderview_rename_folder_cb, 0, NULL},
{N_("/_Delete folder"), NULL, folderview_delete_folder_cb, 0, NULL},
{N_("/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Update folder tree"), NULL, folderview_update_tree_cb, 0, NULL},
+ {N_("/_Check for new messages"),
+ NULL, folderview_update_tree_cb, 0, NULL},
{N_("/R_escan folder tree"), NULL, folderview_update_tree_cb, 1, NULL},
{N_("/---"), NULL, NULL, 0, "<Separator>"},
{N_("/Remove _mailbox"), NULL, folderview_remove_mailbox_cb, 0, NULL},
{N_("/_Rename folder..."), NULL, NULL, 0, NULL},
{N_("/_Delete folder"), NULL, folderview_rm_imap_folder_cb, 0, NULL},
{N_("/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Update folder tree"), NULL, folderview_update_tree_cb, 0, NULL},
+ {N_("/_Check for new messages"),
+ NULL, folderview_update_tree_cb, 0, NULL},
{N_("/R_escan folder tree"), NULL, folderview_update_tree_cb, 1, NULL},
{N_("/---"), NULL, NULL, 0, "<Separator>"},
{N_("/Remove _IMAP4 account"), NULL, folderview_rm_imap_server_cb, 0, NULL},
SET_SENS(mail_factory, "/Create new folder...", new_folder);
SET_SENS(mail_factory, "/Rename folder...", rename_folder);
SET_SENS(mail_factory, "/Delete folder", delete_folder);
- SET_SENS(mail_factory, "/Update folder tree", update_tree);
+ SET_SENS(mail_factory, "/Check for new messages", update_tree);
SET_SENS(mail_factory, "/Rescan folder tree", rescan_tree);
SET_SENS(mail_factory, "/Remove mailbox", remove_tree);
SET_SENS(mail_factory, "/Property...", folder_property);
SET_SENS(imap_factory, "/Create new folder...", new_folder);
SET_SENS(imap_factory, "/Rename folder...", rename_folder);
SET_SENS(imap_factory, "/Delete folder", delete_folder);
- SET_SENS(imap_factory, "/Update folder tree", update_tree);
+ SET_SENS(imap_factory, "/Check for new messages", update_tree);
SET_SENS(imap_factory, "/Rescan folder tree", rescan_tree);
SET_SENS(imap_factory, "/Remove IMAP4 account", remove_tree);
SET_SENS(imap_factory, "/Processing...", folder_processing);
menu_set_insensitive_all(GTK_MENU_SHELL(popup));
SET_SENS(news_factory, "/Subscribe to newsgroup...", new_folder);
SET_SENS(news_factory, "/Remove newsgroup", delete_folder);
+#if 0
+ SET_SENS(news_factory, "/Check for new messages", update_tree);
+#endif
SET_SENS(news_factory, "/Remove news account", remove_tree);
SET_SENS(news_factory, "/Search folder...", search_folder);
SET_SENS(news_factory, "/Processing...", folder_processing);
/* SYLPHEED:
* cursor timer
*/
-static void gtk_stext_enable_blink (GtkSText *text);
+static void gtk_stext_enable_blink (GtkSText *text);
static void gtk_stext_disable_blink (GtkSText *text);
/* #define DEBUG_GTK_STEXT */
/* SYLPHEED:
* timer for blinking cursor
*/
- text->cursor_visible = FALSE; /* don't know whether gtktext stores this somewhere */
- text->cursor_timer_on = TRUE;
- text->cursor_off_ms = 500;
- text->cursor_on_ms = 500;
- text->cursor_timer_id = 0;
+ text->cursor_visible = FALSE; /* don't know whether gtktext stores this somewhere */
+ text->cursor_timer_on = TRUE;
+ text->cursor_off_ms = 500;
+ text->cursor_on_ms = 500;
+ text->cursor_timer_id = 0;
text->cursor_idle_time_timer_id = 0;
- text->wrap_rmargin = 0;
- text->cursor_type = STEXT_CURSOR_LINE;
- text->persist_column = 0;
+ text->wrap_rmargin = 0;
+ text->cursor_type = GTK_STEXT_CURSOR_LINE;
+ text->persist_column = 0;
init_properties (text);
}
/* SYLPHEED:
- * cursor timer
+ * cursor timer
*/
- gtk_stext_disable_blink(text);
-
+ gtk_stext_disable_blink (text);
+
GTK_OBJECT_CLASS(parent_class)->destroy (object);
}
break;
case GDK_Page_Up: scroll_int (text, -text->vadj->page_increment); break;
case GDK_Page_Down: scroll_int (text, +text->vadj->page_increment); break;
- case GDK_Up:
- scroll_int (text, -KEY_SCROLL_PIXELS);
- break;
+ case GDK_Up: scroll_int (text, -KEY_SCROLL_PIXELS); break;
case GDK_Down: scroll_int (text, +KEY_SCROLL_PIXELS); break;
case GDK_Return:
if (event->state & GDK_CONTROL_MASK)
}
extend_start = (text->point.index == editable->selection_start_pos);
- gtk_stext_disable_blink(text);
+ /* SYLPHEED: cursor */
+ gtk_stext_disable_blink (text);
+ }
+ else
+ {
+ gtk_stext_enable_blink (text);
}
/* SYLPHEED:
* cursor
*/
- if (!extend_selection)
- gtk_stext_enable_blink(text);
-
if (event->keyval != GDK_Up && event->keyval != GDK_Down) {
reset_persist_col_pos(text);
}
}
break;
case GDK_Delete:
- {
- if (event->state & GDK_CONTROL_MASK) {
- gtk_stext_delete_forward_word (text);
- }
- else if (event->state & GDK_SHIFT_MASK)
- {
- extend_selection = FALSE;
- gtk_editable_cut_clipboard (editable);
- }
- else {
- gtk_stext_delete_forward_character (text);
- }
- }
+ if (event->state & GDK_CONTROL_MASK)
+ gtk_stext_delete_forward_word (text);
+ else if (event->state & GDK_SHIFT_MASK)
+ {
+ extend_selection = FALSE;
+ gtk_editable_cut_clipboard (editable);
+ }
+ else
+ gtk_stext_delete_forward_character (text);
break;
case GDK_Tab:
position = text->point.index;
#endif
draw_cursor (GTK_STEXT(widget), TRUE);
+ /* SYLPHEED: cursor */
GTK_STEXT(widget)->cursor_visible = TRUE;
- gtk_stext_enable_blink(GTK_STEXT(widget));
+ gtk_stext_enable_blink (GTK_STEXT(widget));
return FALSE;
}
gtk_stext_kill_word (GtkEditable *editable,
gint direction)
{
- if (editable->selection_start_pos != editable->selection_end_pos) {
+ if (editable->selection_start_pos != editable->selection_end_pos)
gtk_editable_delete_selection (editable);
- }
else
{
gint old_pos = editable->current_pos;
if (lp.end.index == lp.start.index)
{
/* SYLPHEED: don't wrap URLs */
- if (gtkut_text_is_uri_string(text, lp.end.index,
+ if (gtkut_stext_is_uri_string(text, lp.end.index,
gtk_stext_get_length(text)))
{
lp.end = saved_mark;
pixel_width = gdk_text_width_wc (gc_values.font,
buffer.wc, len);
else
- pixel_width = gdk_text_width (gc_values.font,
+ pixel_width = gdk_text_width (gc_values.font,
buffer.ch, len);
}
else
GTK_WIDGET_DRAWABLE (text) && text->line_start_cache)
{
GdkFont* font;
- gint pixel_width, pixel_height;
- GdkGC *gc;
+ gint pixel_width;
+ gint pixel_height;
g_assert(text->cursor_mark.property);
- gc = gdk_gc_new(text->text_area);
- g_assert(gc);
- gdk_gc_copy(gc, text->gc);
-
font = MARK_CURRENT_FONT(text, &text->cursor_mark);
- /* SYLPHEED:
- * changed the cursor to a real block (TM)
- */
- if (text->cursor_type == STEXT_CURSOR_BLOCK) {
- if (text->use_wchar)
- pixel_width = gdk_char_width_wc(font, text->cursor_char);
- else
- pixel_width = gdk_char_width(font, text->cursor_char);
- pixel_width -= 1;
- pixel_height = LINE_HEIGHT(CACHE_DATA(text->current_line));
-
- draw_bg_rect (text, &text->cursor_mark,
- text->cursor_pos_x,
- text->cursor_pos_y - (pixel_height + 1),
- pixel_width + 1,
- pixel_height + 1,
- FALSE);
- }
- else {
- draw_bg_rect (text, &text->cursor_mark,
- text->cursor_pos_x - 1,
- text->cursor_pos_y - text->cursor_char_offset - font->ascent,
- 2, font->descent + font->ascent + 1, FALSE);
-
- }
-
+ /* SYLPHEED:
+ * changed the cursor to a real block (TM)
+ */
+ if (text->cursor_type == GTK_STEXT_CURSOR_BLOCK)
+ {
+ if (text->cursor_char)
+ {
+ if (text->use_wchar)
+ pixel_width = gdk_char_width_wc (font, text->cursor_char);
+ else
+ pixel_width = gdk_char_width (font, (guchar)text->cursor_char);
+ }
+ else
+ {
+ pixel_width = gdk_char_width (font, 'W');
+ }
+
+ pixel_height = LINE_HEIGHT(CACHE_DATA(text->current_line));
+
+ draw_bg_rect (text, &text->cursor_mark,
+ text->cursor_pos_x,
+ text->cursor_pos_y - (pixel_height + 1),
+ pixel_width,
+ pixel_height + 1,
+ FALSE);
+ }
+ else
+ {
+ draw_bg_rect (text, &text->cursor_mark,
+ text->cursor_pos_x,
+ text->cursor_pos_y - text->cursor_char_offset - font->ascent,
+ 2, font->descent + font->ascent + 1, FALSE);
+ }
+
if (text->cursor_char)
{
if (font->type == GDK_FONT_FONT)
gdk_gc_set_font (text->gc, font);
-
+
gdk_gc_set_foreground (text->gc, MARK_CURRENT_FORE (text, &text->cursor_mark));
-
+
if (text->use_wchar)
gdk_draw_text_wc (text->text_area, font,
text->gc,
1);
}
}
-
- gdk_gc_copy(text->gc, gc);
- gdk_gc_unref(gc);
}
}
draw_cursor (GtkSText* text, gint absolute)
{
GtkEditable *editable = (GtkEditable *)text;
- gint pixel_width, pixel_height;
TDEBUG (("in draw_cursor\n"));
GTK_WIDGET_DRAWABLE (text) && text->line_start_cache)
{
GdkFont* font;
- GdkGC* gc;
+ gint pixel_width;
+ gint pixel_height;
g_assert (text->cursor_mark.property);
- gc = gdk_gc_new(text->text_area);
- g_assert (gc);
- gdk_gc_copy(gc, text->gc);
- font = MARK_CURRENT_FONT (text, &text->cursor_mark);
- if (text->cursor_type == STEXT_CURSOR_BLOCK) {
- /* SYLPHEED:
- * changed the cursor to a real block (TM)
- */
- if (text->use_wchar) {
- pixel_width = gdk_char_width_wc(font, text->cursor_char);
- }
- else {
- pixel_width = gdk_char_width(font, text->cursor_char);
- }
- pixel_width -= 1;
-
- pixel_height = LINE_HEIGHT(CACHE_DATA(text->current_line));
- gdk_gc_set_foreground (text->gc, >K_WIDGET (text)->style->text[GTK_STATE_NORMAL]);
- gdk_gc_set_function(text->gc, GDK_INVERT);
- gdk_draw_rectangle(text->text_area, text->gc, TRUE,
- text->cursor_pos_x,
- text->cursor_pos_y - pixel_height,
- pixel_width,
- pixel_height);
- }
- else {
- gdk_gc_set_line_attributes(text->gc, 2, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_MITER);
- gdk_gc_set_foreground(text->gc, >K_WIDGET (text)->style->text[GTK_STATE_NORMAL]);
- gdk_draw_line(text->text_area, text->gc, text->cursor_pos_x,
- text->cursor_pos_y + font->descent - text->cursor_char_offset,
- text->cursor_pos_x,
- text->cursor_pos_y - text->cursor_char_offset - font->ascent );
-
- }
- gdk_gc_copy(text->gc, gc);
- gdk_gc_unref(gc);
+ font = MARK_CURRENT_FONT (text, &text->cursor_mark);
+
+ /* SYLPHEED:
+ * change the cursor to a real block (TM)
+ */
+ if (text->cursor_type == GTK_STEXT_CURSOR_BLOCK)
+ {
+ if (text->cursor_char)
+ {
+ if (text->use_wchar)
+ pixel_width = gdk_char_width_wc (font, text->cursor_char);
+ else
+ pixel_width = gdk_char_width (font, (guchar)text->cursor_char);
+ }
+ else
+ {
+ pixel_width = gdk_char_width (font, 'W');
+ }
+
+ pixel_height = LINE_HEIGHT(CACHE_DATA(text->current_line));
+
+ gdk_gc_set_foreground (text->gc, >K_WIDGET (text)->style->text[GTK_STATE_NORMAL]);
+ gdk_gc_set_function (text->gc, GDK_INVERT);
+ gdk_draw_rectangle (text->text_area, text->gc, TRUE,
+ text->cursor_pos_x,
+ text->cursor_pos_y - pixel_height,
+ pixel_width,
+ pixel_height);
+ gdk_gc_set_function (text->gc, GDK_COPY);
+ }
+ else
+ {
+ gdk_gc_set_line_attributes(text->gc, 2, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_MITER);
+ gdk_gc_set_foreground (text->gc, >K_WIDGET (text)->style->text[GTK_STATE_NORMAL]);
+
+ gdk_draw_line (text->text_area, text->gc, text->cursor_pos_x + 1,
+ text->cursor_pos_y + font->descent - text->cursor_char_offset,
+ text->cursor_pos_x + 1,
+ text->cursor_pos_y - text->cursor_char_offset - font->ascent);
+ }
}
}
* cursor timer
*/
-static gint stext_blink_timer_proc(GtkSText *text)
+static gint
+stext_blink_timer_proc (GtkSText *text)
{
- if (text->cursor_state_on) {
- text->cursor_state_on = FALSE;
- undraw_cursor(text, TRUE);
- /* kill this timer... */
- gtk_timeout_remove(text->cursor_timer_id);
- text->cursor_timer_id = gtk_timeout_add(text->cursor_off_ms, (GtkFunction) stext_blink_timer_proc, (gpointer) text);
- }
- else {
- text->cursor_state_on = TRUE;
- draw_cursor(text, TRUE);
- /* kill this timer... */
- gtk_timeout_remove(text->cursor_timer_id);
- text->cursor_timer_id = gtk_timeout_add(text->cursor_on_ms, (GtkFunction) stext_blink_timer_proc, (gpointer) text);
- }
- return TRUE;
+ if (text->cursor_state_on)
+ {
+ text->cursor_state_on = FALSE;
+ undraw_cursor (text, TRUE);
+ /* kill this timer... */
+ gtk_timeout_remove (text->cursor_timer_id);
+ text->cursor_timer_id = gtk_timeout_add (text->cursor_off_ms,
+ (GtkFunction) stext_blink_timer_proc,
+ (gpointer) text);
+ }
+ else
+ {
+ text->cursor_state_on = TRUE;
+ draw_cursor (text, TRUE);
+ /* kill this timer... */
+ gtk_timeout_remove (text->cursor_timer_id);
+ text->cursor_timer_id = gtk_timeout_add (text->cursor_on_ms,
+ (GtkFunction) stext_blink_timer_proc,
+ (gpointer) text);
+ }
+
+ return TRUE;
}
-static gint stext_idle_timer_proc(GtkSText *text)
+static gint
+stext_idle_timer_proc (GtkSText *text)
{
- /* make sure the cursor timer is off */
- if (text->cursor_timer_id) {
- gtk_timeout_remove(text->cursor_timer_id);
- text->cursor_timer_id = 0;
- }
- /* assuming it's always on when calling this function ... */
- text->cursor_state_on = TRUE;
- text->cursor_timer_id = gtk_timeout_add(text->cursor_on_ms, (GtkFunction) stext_blink_timer_proc, (gpointer) text);
- /* make sure we kill the timer (could perhaps make this function return FALSE (not documented in
- * the current docs). should check the source. */
- gtk_idle_remove( text->cursor_idle_time_timer_id );
- text->cursor_idle_time_timer_id = 0;
- return TRUE;
+ /* make sure the cursor timer is off */
+ if (text->cursor_timer_id)
+ {
+ gtk_timeout_remove (text->cursor_timer_id);
+ text->cursor_timer_id = 0;
+ }
+
+ /* assuming it's always on when calling this function ... */
+ text->cursor_state_on = TRUE;
+ text->cursor_timer_id = gtk_timeout_add (text->cursor_on_ms,
+ (GtkFunction) stext_blink_timer_proc,
+ (gpointer) text);
+ /* make sure we kill the timer (could perhaps make this function return
+ FALSE (not documented in the current docs). should check the source. */
+ gtk_idle_remove (text->cursor_idle_time_timer_id);
+ text->cursor_idle_time_timer_id = 0;
+
+ return TRUE;
}
-static void gtk_stext_enable_blink (GtkSText *text)
+static void
+gtk_stext_enable_blink (GtkSText *text)
{
- if (text->cursor_timer_on) {
- gtk_stext_disable_blink(text);
- text->cursor_idle_time_timer_id = gtk_idle_add((GtkFunction) stext_idle_timer_proc, (gpointer) text);
- }
+ if (text->cursor_timer_on)
+ {
+ gtk_stext_disable_blink (text);
+ text->cursor_idle_time_timer_id = gtk_idle_add ((GtkFunction) stext_idle_timer_proc,
+ (gpointer) text);
+ }
}
-static void gtk_stext_disable_blink (GtkSText *text)
+static void
+gtk_stext_disable_blink (GtkSText *text)
{
- if (text->cursor_timer_on) {
- if (text->cursor_idle_time_timer_id) {
- gtk_idle_remove( text->cursor_idle_time_timer_id );
- text->cursor_idle_time_timer_id = 0;
- }
- if (text->cursor_timer_id) {
- gtk_timeout_remove( text->cursor_timer_id );
- text->cursor_timer_id = 0;
- }
- draw_cursor(text, TRUE);
- }
+ if (text->cursor_timer_on)
+ {
+ if (text->cursor_idle_time_timer_id)
+ {
+ gtk_idle_remove (text->cursor_idle_time_timer_id);
+ text->cursor_idle_time_timer_id = 0;
+ }
+ if (text->cursor_timer_id)
+ {
+ gtk_timeout_remove (text->cursor_timer_id);
+ text->cursor_timer_id = 0;
+ }
+ draw_cursor(text, TRUE);
+ }
}
-void gtk_stext_set_blink(GtkSText *text, gboolean blinkin_on)
+void
+gtk_stext_set_blink (GtkSText *text, gboolean blinking_on)
{
- if (text->cursor_timer_on != blinkin_on) {
- if (text->cursor_timer_on) {
- /* text widget already created? */
- if (text->cursor_visible) {
- gtk_stext_disable_blink(text);
- }
- text->cursor_timer_on = FALSE;
- }
- else {
- if (text->cursor_visible) {
- gtk_stext_enable_blink(text);
- }
- text->cursor_timer_on = TRUE;
- }
+ if (text->cursor_timer_on != blinking_on)
+ {
+ if (text->cursor_timer_on)
+ {
+ /* text widget already created? */
+ if (text->cursor_visible)
+ {
+ gtk_stext_disable_blink (text);
+ }
+ text->cursor_timer_on = FALSE;
}
+ else
+ {
+ if (text->cursor_visible)
+ {
+ gtk_stext_enable_blink (text);
+ }
+ text->cursor_timer_on = TRUE;
+ }
+ }
}
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-/*
- * Modified by the Sylpheed Team and others 2001.
- */
-
#ifndef __GTK_STEXT_H__
#define __GTK_STEXT_H__
typedef struct _GtkSText GtkSText;
typedef struct _GtkSTextClass GtkSTextClass;
-typedef enum _GtkSTextCursorType GtkSTextCursorType;
-
-enum _GtkSTextCursorType
+typedef enum
{
- STEXT_CURSOR_LINE,
- STEXT_CURSOR_BLOCK
-};
+ GTK_STEXT_CURSOR_LINE,
+ GTK_STEXT_CURSOR_BLOCK
+} GtkSTextCursorType;
struct _GtkSPropertyMark
{
/* CURSOR */
- gint cursor_pos_x; /* Position of cursor. */
- gint cursor_pos_y; /* Baseline of line cursor is drawn on. */
+ gint cursor_pos_x; /* Position of cursor. */
+ gint cursor_pos_y; /* Baseline of line cursor is drawn on. */
GtkSPropertyMark cursor_mark; /* Where it is in the buffer. */
- GdkWChar cursor_char; /* Character to redraw. */
- gchar cursor_char_offset; /* Distance from baseline of the font. */
- gint cursor_virtual_x; /* Where it would be if it could be. */
- gint cursor_drawn_level; /* How many people have undrawn. */
+ GdkWChar cursor_char; /* Character to redraw. */
+ gchar cursor_char_offset; /* Distance from baseline of the font. */
+ gint cursor_virtual_x; /* Where it would be if it could be. */
+ gint cursor_drawn_level; /* How many people have undrawn. */
/* Current Line */
GdkGC *bg_gc; /* gc for drawing background pixmap */
/* SYLPHEED:
- * properties added for different cursor
+ * properties added for different cursor
*/
- gboolean cursor_visible; /* whether cursor is visible */
- gboolean cursor_timer_on; /* blinking enabled */
- guint cursor_off_ms, cursor_on_ms; /* cursor off / on time */
- gboolean cursor_state_on; /* state */
- guint32 cursor_timer_id; /* blinking timer */
- guint32 cursor_idle_time_timer_id; /* timer id */
+ gboolean cursor_visible; /* whether cursor is visible */
+ gboolean cursor_timer_on; /* blinking enabled */
+ guint cursor_off_ms; /* cursor off time */
+ guint cursor_on_ms; /* cursor on time */
+ gboolean cursor_state_on; /* state */
+ guint32 cursor_timer_id; /* blinking timer */
+ guint32 cursor_idle_time_timer_id; /* timer id */
GtkSTextCursorType cursor_type;
GtkType gtk_stext_get_type (void);
GtkWidget* gtk_stext_new (GtkAdjustment *hadj,
- GtkAdjustment *vadj);
-void gtk_stext_set_editable (GtkSText *text,
- gboolean editable);
-void gtk_stext_set_word_wrap (GtkSText *text,
- gint word_wrap);
-void gtk_stext_set_line_wrap (GtkSText *text,
- gint line_wrap);
-void gtk_stext_set_adjustments (GtkSText *text,
- GtkAdjustment *hadj,
- GtkAdjustment *vadj);
-void gtk_stext_set_point (GtkSText *text,
- guint index);
-guint gtk_stext_get_point (GtkSText *text);
-guint gtk_stext_get_length (GtkSText *text);
-void gtk_stext_freeze (GtkSText *text);
-void gtk_stext_thaw (GtkSText *text);
-void gtk_stext_insert (GtkSText *text,
- GdkFont *font,
- GdkColor *fore,
- GdkColor *back,
- const char *chars,
- gint length);
-gint gtk_stext_backward_delete (GtkSText *text,
- guint nchars);
-gint gtk_stext_forward_delete (GtkSText *text,
- guint nchars);
+ GtkAdjustment *vadj);
+void gtk_stext_set_editable (GtkSText *text,
+ gboolean editable);
+void gtk_stext_set_word_wrap (GtkSText *text,
+ gint word_wrap);
+void gtk_stext_set_line_wrap (GtkSText *text,
+ gint line_wrap);
+void gtk_stext_set_adjustments (GtkSText *text,
+ GtkAdjustment *hadj,
+ GtkAdjustment *vadj);
+void gtk_stext_set_point (GtkSText *text,
+ guint index);
+guint gtk_stext_get_point (GtkSText *text);
+guint gtk_stext_get_length (GtkSText *text);
+void gtk_stext_freeze (GtkSText *text);
+void gtk_stext_thaw (GtkSText *text);
+void gtk_stext_insert (GtkSText *text,
+ GdkFont *font,
+ GdkColor *fore,
+ GdkColor *back,
+ const char *chars,
+ gint length);
+gint gtk_stext_backward_delete (GtkSText *text,
+ guint nchars);
+gint gtk_stext_forward_delete (GtkSText *text,
+ guint nchars);
/* SYLPHEED
*/
-void gtk_stext_set_blink (GtkSText *text, gboolean blinking_on);
+void gtk_stext_set_blink (GtkSText *text,
+ gboolean blinking_on);
+void gtk_stext_set_cursor_type (GtkSText *text,
+ GtkSTextCursorType cursor_type);
void gtk_stext_compact_buffer (GtkSText *text);
/* Set the rmargin for the stext. if rmargin is 0, then reset to old
* behaviour */
void gtk_stext_set_wrap_rmargin (GtkSText *text, gint rmargin);
-void gtk_stext_set_cursor_type (GtkSText *text, GtkSTextCursorType cursor_type);
#define GTK_STEXT_INDEX(t, index) (((t)->use_wchar) \
? ((index) < (t)->gap_position ? (t)->text.wc[index] : \
gtk_container_remove(container, widget);
}
-gboolean gtkut_text_match_string(GtkSText *text, gint pos, wchar_t *wcs,
- gint len, gboolean case_sens)
+gboolean gtkut_stext_match_string(GtkSText *text, gint pos, wchar_t *wcs,
+ gint len, gboolean case_sens)
{
gint match_count = 0;
return FALSE;
}
-guint gtkut_text_str_compare_n(GtkSText *text, guint pos1, guint pos2,
- guint len, guint text_len)
+guint gtkut_stext_str_compare_n(GtkSText *text, guint pos1, guint pos2,
+ guint len, guint text_len)
{
guint i;
GdkWChar ch1, ch2;
return i;
}
-guint gtkut_text_str_compare(GtkSText *text, guint start_pos, guint text_len,
- const gchar *str)
+guint gtkut_stext_str_compare(GtkSText *text, guint start_pos, guint text_len,
+ const gchar *str)
{
wchar_t *wcs;
guint len;
if (len > text_len - start_pos)
result = FALSE;
else
- result = gtkut_text_match_string(text, start_pos, wcs, len,
- TRUE);
+ result = gtkut_stext_match_string(text, start_pos, wcs, len,
+ TRUE);
g_free(wcs);
return result ? len : 0;
}
-gboolean gtkut_text_is_uri_string(GtkSText *text,
- guint start_pos, guint text_len)
+gboolean gtkut_stext_is_uri_string(GtkSText *text,
+ guint start_pos, guint text_len)
{
- if (gtkut_text_str_compare(text, start_pos, text_len, "http://") ||
- gtkut_text_str_compare(text, start_pos, text_len, "ftp://") ||
- gtkut_text_str_compare(text, start_pos, text_len, "https://"))
+ if (gtkut_stext_str_compare(text, start_pos, text_len, "http://") ||
+ gtkut_stext_str_compare(text, start_pos, text_len, "ftp://") ||
+ gtkut_stext_str_compare(text, start_pos, text_len, "https://"))
return TRUE;
return FALSE;
void gtkut_container_remove (GtkContainer *container,
GtkWidget *widget);
-gboolean gtkut_text_match_string (GtkSText *text,
+gboolean gtkut_stext_match_string (GtkSText *text,
gint pos,
wchar_t *wcs,
gint len,
gboolean case_sens);
-guint gtkut_text_str_compare_n (GtkSText *text,
+guint gtkut_stext_str_compare_n (GtkSText *text,
guint pos1,
guint pos2,
guint len,
guint text_len);
-guint gtkut_text_str_compare (GtkSText *text,
+guint gtkut_stext_str_compare (GtkSText *text,
guint start_pos,
guint text_len,
const gchar *str);
-gboolean gtkut_text_is_uri_string (GtkSText *text,
+gboolean gtkut_stext_is_uri_string (GtkSText *text,
guint start_pos,
guint text_len);
cur_pos = imap_parse_address(sock, cur_pos + 1,
&tmp_from, &tmp_fromname,
line_str);
+ g_return_val_if_fail(cur_pos != NULL, NULL);
Xstrdup_a(from, tmp_from,
{g_free(tmp_from); g_free(tmp_fromname);
return NULL;});
g_return_val_if_fail(*cur_pos == ' ', NULL); \
cur_pos = imap_parse_address(sock, cur_pos + 1, NULL, NULL, \
line_str); \
+ g_return_val_if_fail(cur_pos != NULL, NULL); \
}
/* skip sender and reply-to */
g_return_val_if_fail(*cur_pos == ' ', NULL);
cur_pos = imap_parse_address(sock, cur_pos + 1,
&tmp_to, NULL, line_str);
+ g_return_val_if_fail(cur_pos != NULL, NULL);
Xstrdup_a(to, tmp_to, {g_free(tmp_to); return NULL;});
g_free(tmp_to);
g_return_val_if_fail(*cur_pos == ' ', NULL);
cur_pos = imap_parse_atom
(sock, cur_pos, buf, sizeof(buf), line_str);
+ g_return_val_if_fail(cur_pos != NULL, NULL);
if (buf[0] != '\0') {
eliminate_parenthesis(buf, '(', ')');
extract_parenthesis(buf, '<', '>');
g_return_val_if_fail(*cur_pos == ' ', NULL);
cur_pos = imap_parse_atom
(sock, cur_pos, buf, sizeof(buf), line_str);
+ g_return_val_if_fail(cur_pos != NULL, NULL);
if (buf[0] != '\0') {
extract_parenthesis(buf, '<', '>');
remove_space(buf);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
- labelBook = gtk_label_new(_(""));
+ labelBook = gtk_label_new("");
gtk_table_attach(GTK_TABLE(table), labelBook, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(labelBook), 0, 0.5);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
- labelFile = gtk_label_new(_(""));
+ labelFile = gtk_label_new("");
gtk_table_attach(GTK_TABLE(table), labelFile, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(labelFile), 0, 0.5);
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
- labelRecs = gtk_label_new(_(""));
+ labelRecs = gtk_label_new("");
gtk_table_attach(GTK_TABLE(table), labelRecs, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(labelRecs), 0, 0.5);
*/
static gchar *ldif_get_line( LdifFile *ldifFile ) {
gchar buf[ LDIFBUFSIZE ];
- int ch;
+ gint ch;
gchar *ptr;
if( feof( ldifFile->file ) ) return NULL;
{N_("/_File/_Save as..."), NULL, save_as_cb, 0, NULL},
{N_("/_File/_Print..."), "<alt>P", print_cb, 0, NULL},
{N_("/_File/---"), NULL, NULL, 0, "<Separator>"},
-/* {N_("/_File/_Close"), "<alt>W", app_exit_cb, 0, NULL},*/
+ /* {N_("/_File/_Close"), "<alt>W", app_exit_cb, 0, NULL}, */
{N_("/_File/E_xit"), "<alt>Q", app_exit_cb, 0, NULL},
{N_("/_Edit"), NULL, NULL, 0, "<Branch>"},
{N_("/_Edit/_Copy"), "<control>C", copy_cb, 0, NULL},
{N_("/_Edit/Select _all"), "<control>A", allsel_cb, 0, NULL},
{N_("/_Edit/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Edit/_Find in current message"), "<control>F", search_cb, 0, NULL},
+ {N_("/_Edit/_Find in current message..."),
+ "<control>F", search_cb, 0, NULL},
{N_("/_Edit/_Search folder..."), "<control>S", search_cb, 1, NULL},
{N_("/_View"), NULL, NULL, 0, "<Branch>"},
{N_("/_View/_Toolbar/Icon _and text"), NULL, toggle_toolbar_cb, TOOLBAR_BOTH, "<RadioItem>"},
{N_("/_View/_Toolbar/_Icon"), NULL, toggle_toolbar_cb, TOOLBAR_ICON, "/View/Toolbar/Icon and text"},
{N_("/_View/_Toolbar/_Text"), NULL, toggle_toolbar_cb, TOOLBAR_TEXT, "/View/Toolbar/Icon and text"},
- {N_("/_View/_Toolbar/_None"), NULL, toggle_toolbar_cb, TOOLBAR_NONE, "/View/Toolbar/Icon and text"},
- {N_("/_View/_Status bar"), NULL, toggle_statusbar_cb, 0, "<ToggleItem>"},
+ {N_("/_View/_Toolbar/_None"), 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, 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/View _source"), "<control>U", view_source_cb, 0, NULL},
- {N_("/_View/Show all _header"), "<control>H", header_window_show_cb, 0, NULL},
+ {N_("/_View/_Sort"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_View/_Sort/Sort by _number"), NULL, sort_summary_cb, SORT_BY_NUMBER, NULL},
+ {N_("/_View/_Sort/Sort by s_ize"), NULL, sort_summary_cb, SORT_BY_SIZE, NULL},
+ {N_("/_View/_Sort/Sort by _date"), NULL, sort_summary_cb, SORT_BY_DATE, NULL},
+ {N_("/_View/_Sort/Sort by _from"), NULL, sort_summary_cb, SORT_BY_FROM, NULL},
+ {N_("/_View/_Sort/Sort by _subject"),NULL, sort_summary_cb, SORT_BY_SUBJECT, NULL},
+ {N_("/_View/_Sort/Sort by _color label"),
+ NULL, sort_summary_cb, SORT_BY_LABEL, NULL},
+ {N_("/_View/_Sort/Sort by _mark"), NULL, sort_summary_cb, SORT_BY_MARK, NULL},
+ {N_("/_View/_Sort/Sort by _unread"), NULL, sort_summary_cb, SORT_BY_UNREAD, NULL},
+ {N_("/_View/_Sort/Sort by a_ttachment"),
+ NULL, sort_summary_cb, SORT_BY_MIME, NULL},
+ {N_("/_View/_Sort/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Sort/_Attract by subject"),
+ NULL, attract_by_subject_cb, 0, NULL},
+ {N_("/_View/Th_read view"), "<control>T", thread_cb, 0, NULL},
+ {N_("/_View/U_nthread view"), "<shift><control>T", thread_cb, 1, NULL},
+ {N_("/_View/Set display _item..."), NULL, set_display_item_cb, 0, NULL},
{N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_View/_Code set"), NULL, NULL, 0, "<Branch>"},
{N_("/_View/_Code set/_Auto detect"),
NULL, set_charset_cb, C_AUTO, "<RadioItem>"},
+ {N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Go to"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_View/_Go to/_Prev message"), NULL, prev_cb, 0, NULL},
+ {N_("/_View/_Go to/_Next message"), NULL, next_cb, 0, NULL},
+ {N_("/_View/_Go to/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Go to/P_rev unread message"),
+ NULL, prev_unread_cb, 0, NULL},
+ {N_("/_View/_Go to/N_ext unread message"),
+ NULL, next_unread_cb, 0, NULL},
+ {N_("/_View/_Go to/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Go to/Prev _marked message"),
+ NULL, prev_marked_cb, 0, NULL},
+ {N_("/_View/_Go to/Next m_arked message"),
+ NULL, next_marked_cb, 0, NULL},
+ {N_("/_View/_Go to/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Go to/Prev _labeled message"),
+ NULL, prev_labeled_cb, 0, NULL},
+ {N_("/_View/_Go to/Next la_beled message"),
+ NULL, next_labeled_cb, 0, NULL},
+ {N_("/_View/_Go to/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Go to/Other _folder..."), "<alt>G", goto_folder_cb, 0, NULL},
+ {N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/Open in new _window"), "<shift><control>N", open_msg_cb, 0, NULL},
+ {N_("/_View/_View source"), "<control>U", view_source_cb, 0, NULL},
+ {N_("/_View/Show all _header"), "<control>H", header_window_show_cb, 0, NULL},
+ {N_("/_View/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_View/_Update"), "<alt>U", update_summary_cb, 0, NULL},
#define CODESET_SEPARATOR \
{N_("/_View/_Code set/---"), NULL, NULL, 0, "<Separator>"}
#undef CODESET_ACTION
{N_("/_Message"), NULL, NULL, 0, "<Branch>"},
- {N_("/_Message/Get new ma_il"), "<alt>I", inc_mail_cb, 0, NULL},
+ {N_("/_Message/Get new ma_il"), "<alt>I", inc_mail_cb, 0, NULL},
{N_("/_Message/Get from _all accounts"),
"<shift><alt>I", inc_all_account_mail_cb, 0, NULL},
{N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_Copy..."), NULL, copy_to_cb, 0, NULL},
{N_("/_Message/_Delete"), "<alt>D", delete_cb, 0, NULL},
{N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Message/Delete du_plicated messages"),
+ NULL, delete_duplicated_cb, 0, NULL},
+ {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_Mark"), NULL, NULL, 0, "<Branch>"},
{N_("/_Message/_Mark/_Mark"), NULL, mark_cb, 0, NULL},
{N_("/_Message/_Mark/_Unmark"), NULL, unmark_cb, 0, NULL},
{N_("/_Message/_Mark/Mark as unr_ead"), NULL, mark_as_unread_cb, 0, NULL},
{N_("/_Message/_Mark/Mark as rea_d"),
NULL, mark_as_read_cb, 0, NULL},
- {N_("/_Message/_Mark/Mark all read"), NULL, mark_all_read_cb, 0, NULL},
- {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Message/Open in new _window"), "<shift><control>N", open_msg_cb, 0, NULL},
-
- {N_("/_Summary"), NULL, NULL, 0, "<Branch>"},
- {N_("/_Summary/_Hide read messages"), NULL, hide_read_messages, 0, "<ToggleItem>"},
- {N_("/_Summary/_Delete duplicated messages"),
- NULL, delete_duplicated_cb, 0, NULL},
- {N_("/_Summary/_Filter messages"), NULL, filter_cb, 0, NULL},
- {N_("/_Summary/E_xecute"), "<alt>X", execute_summary_cb, 0, NULL},
- {N_("/_Summary/_Update"), "<alt>U", update_summary_cb, 0, NULL},
- {N_("/_Summary/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Summary/Go _to"), NULL, NULL, 0, "<Branch>"},
- {N_("/_Summary/Go _to/_Prev message"), NULL, prev_cb, 0, NULL},
- {N_("/_Summary/Go _to/_Next message"), NULL, next_cb, 0, NULL},
- {N_("/_Summary/Go _to/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Summary/Go _to/P_rev unread message"),
- NULL, prev_unread_cb, 0, NULL},
- {N_("/_Summary/Go _to/N_ext unread message"),
- NULL, next_unread_cb, 0, NULL},
- {N_("/_Summary/Go _to/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Summary/Go _to/Prev _marked message"),
- NULL, prev_marked_cb, 0, NULL},
- {N_("/_Summary/Go _to/Next m_arked message"),
- NULL, next_marked_cb, 0, NULL},
- {N_("/_Summary/Go _to/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Summary/Go _to/Prev _labeled message"),
- NULL, prev_labeled_cb, 0, NULL},
- {N_("/_Summary/Go _to/Next la_beled message"),
- NULL, next_labeled_cb, 0, NULL},
- {N_("/_Summary/_Go to other folder..."),"<alt>G", goto_folder_cb, 0, NULL},
- {N_("/_Summary/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Summary/_Sort"), NULL, NULL, 0, "<Branch>"},
- {N_("/_Summary/_Sort/Sort by _number"), NULL, sort_summary_cb, SORT_BY_NUMBER, NULL},
- {N_("/_Summary/_Sort/Sort by s_ize"), NULL, sort_summary_cb, SORT_BY_SIZE, NULL},
- {N_("/_Summary/_Sort/Sort by _date"), NULL, sort_summary_cb, SORT_BY_DATE, NULL},
- {N_("/_Summary/_Sort/Sort by _from"), NULL, sort_summary_cb, SORT_BY_FROM, NULL},
- {N_("/_Summary/_Sort/Sort by _subject"),NULL, sort_summary_cb, SORT_BY_SUBJECT, NULL},
- {N_("/_Summary/_Sort/Sort by _color label"),
- NULL, sort_summary_cb, SORT_BY_LABEL, NULL},
- {N_("/_Summary/_Sort/Sort by _mark"), NULL, sort_summary_cb, SORT_BY_MARK, NULL},
- {N_("/_Summary/_Sort/Sort by _unread"), NULL, sort_summary_cb, SORT_BY_UNREAD, NULL},
- {N_("/_Summary/_Sort/Sort by a_ttachment"),
- NULL, sort_summary_cb, SORT_BY_MIME, NULL},
- {N_("/_Summary/_Sort/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Summary/_Sort/_Attract by subject"),
- NULL, attract_by_subject_cb, 0, NULL},
- {N_("/_Summary/_Thread view"), "<control>T", thread_cb, 0, NULL},
- {N_("/_Summary/Unt_hread view"), "<shift><control>T", thread_cb, 1, NULL},
- {N_("/_Summary/Set display _item..."), NULL, set_display_item_cb, 0, NULL},
+ {N_("/_Message/_Mark/Mark all _read"), NULL, mark_all_read_cb, 0, NULL},
{N_("/_Tool"), NULL, NULL, 0, "<Branch>"},
{N_("/_Tool/_Address book"), "<alt>A", addressbook_open_cb, 0, NULL},
+ {N_("/_Tool/Add sender to address boo_k"),
+ NULL, add_address_cb, 0, NULL},
+ {N_("/_Tool/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Tool/_Filter messages"), NULL, filter_cb, 0, NULL},
+ {N_("/_Tool/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Tool/E_xecute"), "<alt>X", execute_summary_cb, 0, NULL},
+ {N_("/_Tool/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Tool/_Log window"), "<alt>L", log_window_show_cb, 0, NULL},
{N_("/_Configuration"), NULL, NULL, 0, "<Branch>"},
{N_("/_Configuration/C_hange current account"),
NULL, NULL, 0, "<Branch>"},
- {N_("/_Help"), NULL, NULL, 0, "<LastBranch>"},
+ {N_("/_Help"), NULL, NULL, 0, "<Branch>"},
{N_("/_Help/_Manual"), NULL, NULL, 0, "<Branch>"},
{N_("/_Help/_Manual/_English"), NULL, manual_open_cb, MANUAL_LANG_EN, NULL},
{N_("/_Help/_Manual/_Japanese"), NULL, manual_open_cb, MANUAL_LANG_JA, NULL},
GUINT_TO_POINTER(SEPARATE_MESSAGE));
- menu_set_sensitive(ifactory, "/Summary/Thread view",
+ menu_set_sensitive(ifactory, "/View/Thread view",
prefs_common.enable_thread ? FALSE : TRUE);
- menu_set_sensitive(ifactory, "/Summary/Unthread view",
+ menu_set_sensitive(ifactory, "/View/Unthread view",
prefs_common.enable_thread ? TRUE : FALSE);
-
- /*main_window_set_thread_option(mainwin);*/
-
/* set account selection menu */
ac_menu = gtk_item_factory_get_widget
prefs_common.mainwin_y);
gtk_widget_set_usize(window, prefs_common.mainwin_width,
prefs_common.mainwin_height);
-
gtk_widget_show(mainwin->window);
/* initialize views */
header_window_init(mainwin->headerwin);
log_window_init(mainwin->logwin);
-
mainwin->lock_count = 0;
mainwin->cursor_count = 0;
{"/File/Empty trash" , M_UNLOCKED},
{"/File/Save as...", M_SINGLE_TARGET_EXIST|M_UNLOCKED},
{"/File/Print..." , M_TARGET_EXIST|M_UNLOCKED},
-/* {"/File/Close", M_UNLOCKED},*/
+ /* {"/File/Close", M_UNLOCKED}, */
{"/File/Exit" , M_UNLOCKED},
- {"/View/Show all header" , M_SINGLE_TARGET_EXIST},
- {"/View/View source" , M_SINGLE_TARGET_EXIST},
+ {"/View/Sort" , M_MSG_EXIST},
+ {"/View/Thread view" , M_UNTHREADED},
+ {"/View/Unthread view" , M_THREADED},
+ {"/View/Go to" , M_MSG_EXIST},
+ {"/View/Go to/Prev message" , M_MSG_EXIST},
+ {"/View/Go to/Next message" , M_MSG_EXIST},
+ {"/View/Go to/Next unread message" , M_MSG_EXIST},
+ {"/View/Go to/Prev marked message" , M_MSG_EXIST},
+ {"/View/Go to/Next marked message" , M_MSG_EXIST},
+ {"/View/Go to/Prev labeled message", M_MSG_EXIST},
+ {"/View/Go to/Next labeled message", M_MSG_EXIST},
+ {"/View/Open in new window" , M_SINGLE_TARGET_EXIST},
+ {"/View/Show all header" , M_SINGLE_TARGET_EXIST},
+ {"/View/View source" , M_SINGLE_TARGET_EXIST},
{"/Message/Get new mail" , M_HAVE_ACCOUNT|M_UNLOCKED},
{"/Message/Get from all accounts" , M_HAVE_ACCOUNT|M_UNLOCKED},
-/* {"/Message/Compose new message" , M_HAVE_ACCOUNT}, */
{"/Message/Compose a news message", M_HAVE_NEWS_ACCOUNT},
{"/Message/Reply" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
{"/Message/Reply to sender" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
{"/Message/Follow-up and reply to", M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST|M_NEWS},
{"/Message/Forward" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
{"/Message/Bounce" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
- {"/Message/Open in new window" , M_SINGLE_TARGET_EXIST},
{"/Message/Re-edit", M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
{"/Message/Move...", M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
{"/Message/Copy...", M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
{"/Message/Delete" , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
{"/Message/Mark" , M_TARGET_EXIST},
+ {"/Message/Delete duplicated messages", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
- {"/Summary/Delete duplicated messages", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
- {"/Summary/Filter messages" , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
- {"/Summary/Execute" , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
- {"/Summary/Go to" , M_MSG_EXIST},
- {"/Summary/Go to/Prev message" , M_MSG_EXIST},
- {"/Summary/Go to/Next message" , M_MSG_EXIST},
- {"/Summary/Go to/Next unread message" , M_MSG_EXIST},
- {"/Summary/Go to/Prev marked message" , M_MSG_EXIST},
- {"/Summary/Go to/Next marked message" , M_MSG_EXIST},
- {"/Summary/Go to/Prev labeled message", M_MSG_EXIST},
- {"/Summary/Go to/Next labeled message", M_MSG_EXIST},
- {"/Summary/Sort" , M_MSG_EXIST},
- {"/Summary/Thread view" , M_UNTHREADED},
- {"/Summary/Unthread view" , M_THREADED},
+ {"/Tool/Add sender to address book", M_SINGLE_TARGET_EXIST},
+ {"/Tool/Filter messages" , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+ {"/Tool/Execute" , M_MSG_EXIST|M_EXEC|M_UNLOCKED},
{"/Configuration", M_UNLOCKED},
{NULL, 0}
};
-
+
ifactory = gtk_item_factory_from_widget(mainwin->menubar);
state = main_window_get_current_state(mainwin);
/* create separated window(s) if needed */
if (type & SEPARATE_FOLDER) {
folderwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(folderwin), _("Sylpheed - folder view"));
- gtk_window_set_wmclass(GTK_WINDOW(folderwin), "separate folderview", "Sylpheed");
+ gtk_window_set_title(GTK_WINDOW(folderwin),
+ _("Sylpheed - Folder View"));
+ gtk_window_set_wmclass(GTK_WINDOW(folderwin),
+ "folder_view", "Sylpheed");
gtk_window_set_policy(GTK_WINDOW(folderwin),
TRUE, TRUE, FALSE);
gtk_widget_set_usize(folderwin, -1,
}
if (type & SEPARATE_MESSAGE) {
messagewin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(messagewin), _("Sylpheed - message view"));
- gtk_window_set_wmclass(GTK_WINDOW(messagewin), "separate messageview", "Sylpheed");
+ gtk_window_set_title(GTK_WINDOW(messagewin),
+ _("Sylpheed - Message View"));
+ gtk_window_set_wmclass(GTK_WINDOW(messagewin),
+ "message_view", "Sylpheed");
gtk_window_set_policy(GTK_WINDOW(messagewin),
TRUE, TRUE, FALSE);
gtk_widget_set_usize
if (0 == action) {
summary_thread_build(mainwin->summaryview);
mainwin->summaryview->folder_item->threaded = TRUE;
- menu_set_sensitive(ifactory, "/Summary/Thread view", FALSE);
- menu_set_sensitive(ifactory, "/Summary/Unthread view", TRUE);
+ menu_set_sensitive(ifactory, "/View/Thread view", FALSE);
+ menu_set_sensitive(ifactory, "/View/Unthread view", TRUE);
} else {
summary_unthread(mainwin->summaryview);
mainwin->summaryview->folder_item->threaded = FALSE;
- menu_set_sensitive(ifactory, "/Summary/Thread view", TRUE);
- menu_set_sensitive(ifactory, "/Summary/Unthread view", FALSE);
+ menu_set_sensitive(ifactory, "/View/Thread view", TRUE);
+ menu_set_sensitive(ifactory, "/View/Unthread view", FALSE);
}
}
#include <glib.h>
#include <gtk/gtkwidget.h>
#include <gtk/gtkitemfactory.h>
+#include <gtk/gtkmenu.h>
#include <gtk/gtkmenushell.h>
#define MENUITEM_ADD(menu, menuitem, label, data) \
GtkWidget *confirm_area;
window = gtk_window_new (GTK_WINDOW_DIALOG);
- gtk_window_set_title (GTK_WINDOW (window), _("Search folder"));
+ gtk_window_set_title (GTK_WINDOW (window), _("Search messages"));
gtk_widget_set_usize (window, 450, -1);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, TRUE);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkscrolledwindow.h>
-#include <gtk/gtktext.h>
#include <gtk/gtksignal.h>
#include <stdio.h>
#include <ctype.h>
#include "procheader.h"
#include "prefs_common.h"
#include "codeconv.h"
+#include "gtkstext.h"
#include "utils.h"
#include "gtkutils.h"
#include "procmime.h"
gtk_widget_set_usize(scrolledwin_sb, prefs_common.mainview_width, -1);
gtk_widget_set_usize(scrolledwin_mb, prefs_common.mainview_width, -1);
- /* create GtkText widgets for single-byte and multi-byte character */
- text_sb = gtk_text_new(NULL, NULL);
- text_mb = gtk_text_new(NULL, NULL);
- GTK_TEXT(text_sb)->default_tab_width = 8;
- GTK_TEXT(text_mb)->default_tab_width = 8;
+ /* create GtkSText widgets for single-byte and multi-byte character */
+ text_sb = gtk_stext_new(NULL, NULL);
+ text_mb = gtk_stext_new(NULL, NULL);
+ GTK_STEXT(text_sb)->default_tab_width = 8;
+ GTK_STEXT(text_mb)->default_tab_width = 8;
gtk_widget_show(text_sb);
gtk_widget_show(text_mb);
- gtk_text_set_word_wrap(GTK_TEXT(text_sb), TRUE);
- gtk_text_set_word_wrap(GTK_TEXT(text_mb), TRUE);
+ gtk_stext_set_word_wrap(GTK_STEXT(text_sb), TRUE);
+ gtk_stext_set_word_wrap(GTK_STEXT(text_mb), TRUE);
gtk_widget_ensure_style(text_sb);
gtk_widget_ensure_style(text_mb);
if (text_sb->style && text_sb->style->font->type == GDK_FONT_FONTSET) {
void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
{
- GtkText *text;
+ GtkSText *text;
gchar buf[BUFFSIZE];
const gchar *boundary = NULL;
gint boundary_len = 0;
conv = conv_code_converter_new(charset);
textview_clear(textview);
- text = GTK_TEXT(textview->text);
- gtk_text_freeze(text);
+ text = GTK_STEXT(textview->text);
+ gtk_stext_freeze(text);
textview->body_pos = 0;
textview->cur_pos = 0;
conv_code_converter_destroy(conv);
- gtk_text_thaw(text);
+ gtk_stext_thaw(text);
}
#define TEXT_INSERT(str) \
- gtk_text_insert(text, textview->msgfont, NULL, NULL, str, -1)
+ gtk_stext_insert(text, textview->msgfont, NULL, NULL, str, -1)
void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
{
- GtkText *text;
+ GtkSText *text;
if (!partinfo) return;
textview_set_font(textview, NULL);
- text = GTK_TEXT(textview->text);
+ text = GTK_STEXT(textview->text);
textview_clear(textview);
- gtk_text_freeze(text);
+ gtk_stext_freeze(text);
TEXT_INSERT(_("To save this part, pop up the context menu with "));
TEXT_INSERT(_("right click and select `Save as...', "));
TEXT_INSERT(_("or double-click, or click the center button, "));
TEXT_INSERT(_("or press `l' key."));
- gtk_text_thaw(text);
+ gtk_stext_thaw(text);
}
#if USE_GPGME
void textview_show_signature_part(TextView *textview, MimeInfo *partinfo)
{
- GtkText *text;
+ GtkSText *text;
if (!partinfo) return;
textview_set_font(textview, NULL);
- text = GTK_TEXT(textview->text);
+ text = GTK_STEXT(textview->text);
textview_clear(textview);
- gtk_text_freeze(text);
+ gtk_stext_freeze(text);
if (partinfo->sigstatus_full == NULL) {
TEXT_INSERT(_("This signature has not been checked yet.\n"));
TEXT_INSERT(partinfo->sigstatus_full);
}
- gtk_text_thaw(text);
+ gtk_stext_thaw(text);
}
#endif /* USE_GPGME */
last->next = NULL; \
} else { \
g_warning("alloc error scanning URIs\n"); \
- gtk_text_insert(text, textview->msgfont, fg_color, NULL, \
+ gtk_stext_insert(text, textview->msgfont, fg_color, NULL, \
linebuf, -1); \
return; \
}
struct txtpos *next; /* next */
} head = {NULL, NULL, 0, NULL}, *last = &head;
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
/* parse for clickable parts, and build a list of begin and end positions */
for (walk = linebuf, n = 0;;) {
uri = g_new(RemoteURI, 1);
if (last->bp - normal_text > 0)
- gtk_text_insert(text, font,
+ gtk_stext_insert(text, font,
fg_color, NULL,
normal_text,
last->bp - normal_text);
- uri->uri = parser[last->pti].build_uri(last->bp,
+ uri->uri = parser[last->pti].build_uri(last->bp,
last->ep);
- uri->start = gtk_text_get_point(text);
- gtk_text_insert(text, font, uri_color,
+ uri->start = gtk_stext_get_point(text);
+ gtk_stext_insert(text, font, uri_color,
NULL, last->bp, last->ep - last->bp);
- uri->end = gtk_text_get_point(text);
+ uri->end = gtk_stext_get_point(text);
textview->uri_list =
g_slist_append(textview->uri_list, uri);
}
if (*normal_text)
- gtk_text_insert(text, font, fg_color,
+ gtk_stext_insert(text, font, fg_color,
NULL, normal_text, -1);
} else
- gtk_text_insert(text, font, fg_color, NULL, linebuf, -1);
+ gtk_stext_insert(text, font, fg_color, NULL, linebuf, -1);
}
#undef ADD_TXT_POS
{
GdkColor *link_color = NULL;
RemoteURI* uri;
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
gchar buf[BUFFSIZE];
/* this part is taken from textview_write_line. Right now the only place
if (!conv)
strncpy2(buf, str, sizeof(buf));
else if (conv_convert(conv, buf, sizeof(buf), str) < 0) {
- gtk_text_insert(text, textview->msgfont,
+ gtk_stext_insert(text, textview->msgfont,
prefs_common.enable_color
? &error_color : NULL, NULL,
"*** Warning: code conversion failed ***\n",
}
uri = g_new(RemoteURI, 1);
uri->uri = g_strdup(url);
- uri->start = gtk_text_get_point(text);
- gtk_text_insert(text, textview->msgfont, link_color, NULL, buf,
+ uri->start = gtk_stext_get_point(text);
+ gtk_stext_insert(text, textview->msgfont, link_color, NULL, buf,
strlen(buf));
- uri->end = gtk_text_get_point(text);
+ uri->end = gtk_stext_get_point(text);
textview->uri_list = g_slist_append(textview->uri_list, uri);
}
static void textview_write_line(TextView *textview, const gchar *str,
CodeConverter *conv)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
gchar buf[BUFFSIZE];
GdkColor *fg_color;
gint quotelevel = -1;
if (!conv)
strncpy2(buf, str, sizeof(buf));
else if (conv_convert(conv, buf, sizeof(buf), str) < 0) {
- gtk_text_insert(text, textview->msgfont,
+ gtk_stext_insert(text, textview->msgfont,
prefs_common.enable_color
? &error_color : NULL, NULL,
"*** Warning: code conversion failed ***\n",
fg_color = "e_colors[quotelevel];
if (prefs_common.head_space && spacingfont && buf[0] != '\n')
- gtk_text_insert(text, spacingfont, NULL, NULL, " ", 1);
+ gtk_stext_insert(text, spacingfont, NULL, NULL, " ", 1);
if (prefs_common.enable_color)
textview_make_clickable_parts(textview, textview->msgfont,
void textview_clear(TextView *textview)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
- gtk_text_freeze(text);
- gtk_text_set_point(text, 0);
- gtk_text_forward_delete(text, gtk_text_get_length(text));
- gtk_text_thaw(text);
+ gtk_stext_freeze(text);
+ gtk_stext_set_point(text, 0);
+ gtk_stext_forward_delete(text, gtk_stext_get_length(text));
+ gtk_stext_thaw(text);
textview_uri_list_remove_all(textview->uri_list);
textview->uri_list = NULL;
{
gboolean use_fontset = TRUE;
- /* In multi-byte mode, GtkText can't display 8bit characters
+ /* In multi-byte mode, GtkSText can't display 8bit characters
correctly, so it must be single-byte mode. */
if (MB_CUR_MAX > 1) {
if (codeset) {
{
if (pos < 0) {
textview->cur_pos =
- gtk_text_get_length(GTK_TEXT(textview->text));
+ gtk_stext_get_length(GTK_STEXT(textview->text));
} else {
textview->cur_pos = pos;
}
static void textview_show_header(TextView *textview, GPtrArray *headers)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
Header *header;
gint i;
g_return_if_fail(headers != NULL);
- gtk_text_freeze(text);
+ gtk_stext_freeze(text);
for (i = 0; i < headers->len; i++) {
header = g_ptr_array_index(headers, i);
g_return_if_fail(header->name != NULL);
- gtk_text_insert(text, textview->boldfont, NULL, NULL,
+ gtk_stext_insert(text, textview->boldfont, NULL, NULL,
header->name, -1);
if (header->name[strlen(header->name) - 1] != ' ')
- gtk_text_insert(text, textview->boldfont,
+ gtk_stext_insert(text, textview->boldfont,
NULL, NULL, " ", 1);
if (procheader_headername_equal(header->name, "Subject") ||
procheader_headername_equal(header->name,
"X-Newsreader")) &&
strstr(header->body, "Sylpheed") != NULL)
- gtk_text_insert(text, NULL, &emphasis_color, NULL,
+ gtk_stext_insert(text, NULL, &emphasis_color, NULL,
header->body, -1);
else if (prefs_common.enable_color) {
textview_make_clickable_parts(textview,
NULL, NULL, NULL,
header->body);
}
- gtk_text_insert(text, textview->msgfont, NULL, NULL, "\n", 1);
+ gtk_stext_insert(text, textview->msgfont, NULL, NULL, "\n", 1);
}
- gtk_text_insert(text, textview->msgfont, NULL, NULL, "\n", 1);
- gtk_text_thaw(text);
- textview->body_pos = gtk_text_get_length(text);
+ gtk_stext_insert(text, textview->msgfont, NULL, NULL, "\n", 1);
+ gtk_stext_thaw(text);
+ textview->body_pos = gtk_stext_get_length(text);
}
gboolean textview_search_string(TextView *textview, const gchar *str,
gboolean case_sens)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
gint pos;
wchar_t *wcs;
gint len;
pos = textview->cur_pos;
if (pos < textview->body_pos)
pos = textview->body_pos;
- text_len = gtk_text_get_length(text);
+ text_len = gtk_stext_get_length(text);
if (text_len - pos < len) {
g_free(wcs);
return FALSE;
for (; pos < text_len; pos++) {
if (text_len - pos < len) break;
- if (gtkut_text_match_string(GTK_TEXT(text), pos, wcs, len, case_sens)
+ if (gtkut_stext_match_string(text, pos, wcs, len, case_sens)
== TRUE) {
gtk_editable_set_position(GTK_EDITABLE(text),
pos + len);
gboolean textview_search_string_backward(TextView *textview, const gchar *str,
gboolean case_sens)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
gint pos;
wchar_t *wcs;
gint len;
g_return_val_if_fail(wcs != NULL, FALSE);
len = wcslen(wcs);
pos = textview->cur_pos;
- text_len = gtk_text_get_length(text);
+ text_len = gtk_stext_get_length(text);
if (text_len - textview->body_pos < len) {
g_free(wcs);
return FALSE;
pos = text_len - len;
for (; pos >= textview->body_pos; pos--) {
- if (gtkut_text_match_string(GTK_TEXT(text), pos, wcs, len, case_sens)
+ if (gtkut_stext_match_string(text, pos, wcs, len, case_sens)
== TRUE) {
gtk_editable_set_position(GTK_EDITABLE(text), pos);
gtk_editable_select_region(GTK_EDITABLE(text),
void textview_scroll_one_line(TextView *textview, gboolean up)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
gfloat upper;
if (prefs_common.enable_smooth_scroll) {
gboolean textview_scroll_page(TextView *textview, gboolean up)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
gfloat upper;
gfloat page_incr;
gfloat old_value, gfloat last_value,
gint step)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
gint change_value;
gboolean up;
gint i;
static void textview_smooth_scroll_one_line(TextView *textview, gboolean up)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
gfloat upper;
gfloat old_value;
gfloat last_value;
static gboolean textview_smooth_scroll_page(TextView *textview, gboolean up)
{
- GtkText *text = GTK_TEXT(textview->text);
+ GtkSText *text = GTK_STEXT(textview->text);
gfloat upper;
gfloat page_incr;
gfloat old_value;
GtkWidget *text_sb;
GtkWidget *text_mb;
+ GtkWidget *popup_menu;
+ GtkItemFactory *popup_factory;
+
gboolean text_is_mb;
GSList *uri_list;
#endif
#include <glib.h>
-#include "gtkstext.h"
#include <string.h> /* for strlen */
#include <stdlib.h> /* for mbstowcs */
#include "undo.h"
+#include "gtkstext.h"
#include "utils.h"
#include "prefs_common.h"
void undo_redo (UndoMain *undostruct);
-UndoMain *undo_init (GtkWidget *text)
+UndoMain *undo_init(GtkWidget *text)
{
UndoMain *undostruct;