+2001-09-12
+
+ * src/utils.c: get_quote_level(): some optimization and bugfixes.
+ * src/codeconv.[ch]: conv_get_current_locale(): new.
+ * src/editaddress.c: edit_person_page_basic(): reverse the order
+ of first and last name on some locales.
+
+2001-09-11
+
+ * src/compose.c: applied the patch from Yasumatsu that reformats
+ the current paragraph (thanks!). Modified so that it doesn't
+ reformat quoted paragraphs.
+ compose_create(): don't fill the entry automatically on reedit
+ mode.
+ * src/mainwindow.c
+ src/summaryview.[ch]: added the "Mark all read" option.
+ summary_mark_all_read(): new.
+
+2001-09-10
+
+ * src/vcard.c
+ src/mgutils.c
+ src/syldap.c
+ src/editldap.c
+ src/editldap_basedn.c
+ src/jpilot.c
+ src/editjpilot.c: removed all warnings.
+ * configure.in
+ src/jpilot.[ch]: fixed the problem that failed to detect JPilot
+ header files on the Debian system.
+ * src/mainwindow.c
+ src/summaryview.[ch]: enabled sorting by mark, unread, attachment,
+ and color label. Enabled moving to next/prev flagged messages.
+
+2001-09-09
+
+ * src/pixmaps/dir-close.xpm
+ src/pixmaps/dir-open.xpm
+ src/pixmaps/new.xpm
+ src/pixmaps/unread.xpm: modified the color balance.
+ * src/utils.[ch]: execute_sync(): new.
+ execute_command_line(): added the arg for async mode.
+ * src/inc.c: inc_mail(): use execute_command_line().
+
2001-09-08
* src/prefs.[ch]
- src/prefs_common.c
- src/prefs_account.c: modified the layout.
+ src/prefs_common.[ch]
+ src/prefs_account.c: modified the layout. Added the option to
+ launch the external editor automatically.
+ * src/compose.c: launch the external editor automatically if the
+ option is set.
2001-09-06
+2001-09-13 [paul]
+
+ * configure.in
+ change to version 0.6.1claws3
+
+ * sync with sylpheed 0.6.1cvs6
+
2001-09-13 [darko]
* src/folderview.c
+2001-09-12
+
+ * src/utils.c: get_quote_level(): ºÇŬ²½¤È¥Ð¥°½¤Àµ¡£
+ * src/codeconv.[ch]: conv_get_current_locale(): ¿·µ¬¡£
+ * src/editaddress.c: edit_person_page_basic(): ÆÃÄê¤Î¥í¥«¡¼¥ë¤Ç
+ À«¡¦Ì¾¤Î½ç½ø¤ò¸ò´¹¡£
+
+2001-09-11
+
+ * src/compose.c: ¸½ºß¤ÎÃÊÍî¤òÀ°·Á¤¹¤ë¤è¤¦¤Ë¤¹¤ë°Â¾¾¤µ¤ó¤Î¥Ñ¥Ã¥Á¤ò
+ ŬÍÑ(thanks!)¡£°úÍѤµ¤ì¤¿ÃÊÍî¤òÀ°·Á¤·¤Ê¤¤¤è¤¦¤Ë½¤Àµ¡£
+ compose_create(): ºÆÊÔ½¸¥â¡¼¥É¤Ç¥¨¥ó¥È¥ê¤ò¼«Æ°Åª¤ËËä¤á¤Ê¤¤¤è¤¦¤Ë
+ ¤·¤¿¡£
+ * src/mainwindow.c
+ src/summaryview.[ch]: ¡ÖÁ´¤ÆÆÉ¤ó¤À¤³¤È¤Ë¤¹¤ë¡×¥ª¥×¥·¥ç¥ó¤òÄɲá£
+ summary_mark_all_read(): ¿·µ¬¡£
+
+2001-09-10
+
+ * src/vcard.c
+ src/mgutils.c
+ src/syldap.c
+ src/editldap.c
+ src/editldap_basedn.c
+ src/jpilot.c
+ src/editjpilot.c: Á´¤Æ¤Î·Ù¹ð¤ò½üµî¡£
+ * configure.in
+ src/jpilot.[ch]: Debian ¥·¥¹¥Æ¥à¤Ç JPilot ¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤ò
+ ¸¡½Ð¤Ç¤¤Ê¤¤ÌäÂê¤ò½¤Àµ¡£
+ * src/mainwindow.c
+ src/summaryview.[ch]: ¥Þ¡¼¥¯¡¢Ì¤ÆÉ¡¢ÅºÉÕ¡¢¤½¤·¤Æ¥«¥é¡¼¥é¥Ù¥ë
+ ¤Ë¤è¤ë¥½¡¼¥È¤¬¤Ç¤¤ë¤è¤¦¤Ë¤·¤¿¡£Á°/¼¡¤Î¥Õ¥é¥°ÉÕ¤¥á¥Ã¥»¡¼¥¸
+ ¤Ø¤Î°Üư¤¬¤Ç¤¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+2001-09-09
+
+ * src/pixmaps/dir-close.xpm
+ src/pixmaps/dir-open.xpm
+ src/pixmaps/new.xpm
+ src/pixmaps/unread.xpm: ¿§¤Î¥Ð¥é¥ó¥¹¤ò½¤Àµ¡£
+ * src/utils.[ch]: execute_sync(): ¿·µ¬¡£
+ execute_command_line(): È󯱴ü¥â¡¼¥ÉÍѤΰú¿ô¤òÄɲá£
+ * src/inc.c: inc_mail(): execute_command_line() ¤ò»ÈÍÑ¡£
+
2001-09-08
* src/prefs.[ch]
- src/prefs_common.c
- src/prefs_account.c: ¥ì¥¤¥¢¥¦¥È¤ò½¤Àµ¡£
+ src/prefs_common.[ch]
+ src/prefs_account.c: ¥ì¥¤¥¢¥¦¥È¤ò½¤Àµ¡£³°Éô¥¨¥Ç¥£¥¿¤ò¼«Æ°Åª¤Ë
+ µ¯Æ°¤¹¤ë¥ª¥×¥·¥ç¥ó¤òÄɲá£
+ * src/compose.c: ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤¿¤é³°Éô¥¨¥Ç¥£¥¿¤ò¼«Æ°Åª
+ ¤Ëµ¯Æ°¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
2001-09-06
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws2
+EXTRA_VERSION=claws3
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl
[ LIBS="$LIBS -lpisock"
AC_DEFINE(USE_JPILOT) ],
[ ac_cv_enable_jpilot=no ])
+ if test "$ac_cv_enable_jpilot" = no; then
+ AC_CHECK_HEADERS(libpisock/pi-args.h libpisock/pi-appinfo.h libpisock/pi-address.h,
+ [ LIBS="$LIBS -lpisock"
+ ac_cv_enable_jpilot=yes
+ AC_DEFINE(USE_JPILOT) ])
+ fi
AC_MSG_CHECKING([whether jpilot is available])
AC_MSG_RESULT($ac_cv_enable_jpilot)
else
src/account.c
src/addrbook.c
src/addrcache.c
-src/address.c
src/addressadd.c
src/addressbook.c
src/addrindex.c
gtk_widget_show_all( window );
PIXMAP_CREATE( window, bookXpm, bookXpmMask, book_xpm );
- PIXMAP_CREATE( window, folderXpm, folderXpmMask, DIRECTORY_OPEN_XPM );
+ PIXMAP_CREATE( window, folderXpm, folderXpmMask, dir_open_xpm );
}
static void addressadd_load_folder( GtkCTreeNode *parentNode, ItemFolder *parentFolder,
static GdkPixmap *ldapxpm;
static GdkBitmap *ldapxpmmask;
-/* Message buffer */
+/* Message buffer */
static gchar addressbook_msgbuf[ ADDRESSBOOK_MSGBUF_SIZE ];
-/* Address list selection */
+/* Address list selection */
static GList *_addressListSelection_ = NULL;
/* Address index file and interfaces */
static GHashTable *_addressBookTypeHash_ = NULL;
static GList *_addressBookTypeList_ = NULL;
-static void addressbook_create ( void );
+static void addressbook_create (void);
static gint addressbook_close (void);
static void addressbook_button_set_sensitive (void);
guint action,
GtkWidget *widget);
-/* Data source edit stuff */
-static void addressbook_new_book_cb ( gpointer data,
- guint action,
- GtkWidget *widget );
-static void addressbook_new_vcard_cb ( gpointer data,
- guint action,
- GtkWidget *widget );
+/* Data source edit stuff */
+static void addressbook_new_book_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
+static void addressbook_new_vcard_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
#ifdef USE_JPILOT
-static void addressbook_new_jpilot_cb ( gpointer data,
- guint action,
- GtkWidget *widget );
+static void addressbook_new_jpilot_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
#endif
#ifdef USE_LDAP
-static void addressbook_new_ldap_cb ( gpointer data,
- guint action,
- GtkWidget *widget );
+static void addressbook_new_ldap_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
#endif
static void addressbook_set_clist (AddressObject *obj);
(GtkCTreeNode *node,
AddressDataSource *ds,
ItemFolder *itemFolder,
- AddressObjectType otype );
+ AddressObjectType otype);
static GtkCTreeNode *addressbook_node_add_group (GtkCTreeNode *node,
AddressDataSource *ds,
- ItemGroup *itemGroup );
+ ItemGroup *itemGroup);
/* static GtkCTreeNode *addressbook_node_add_category
(GtkCTreeNode *node,
AddressDataSource *ds,
ItemFolder *itemFolder ); */
static void addressbook_tree_remove_children (GtkCTree *ctree,
- GtkCTreeNode *parent );
+ GtkCTreeNode *parent);
static void addressbook_move_nodes_up (GtkCTree *ctree,
- GtkCTreeNode *node );
+ GtkCTreeNode *node);
static GtkCTreeNode *addressbook_find_group_node (GtkCTreeNode *parent,
- ItemGroup *group );
+ ItemGroup *group);
static void addressbook_delete_object (AddressObject *obj);
/* static gint addressbook_obj_name_compare (gconstpointer a,
gconstpointer b); */
-static void addressbook_book_show_message ( AddressBookFile *book );
-static void addressbook_vcard_show_message ( VCardFile *vcf );
+static void addressbook_book_show_message (AddressBookFile *book);
+static void addressbook_vcard_show_message (VCardFile *vcf);
#ifdef USE_JPILOT
-static void addressbook_jpilot_show_message ( JPilotFile *jpf );
+static void addressbook_jpilot_show_message (JPilotFile *jpf);
#endif
#ifdef USE_LDAP
-static void addressbook_ldap_show_message ( SyldapServer *server );
+static void addressbook_ldap_show_message (SyldapServer *server);
#endif
-/* LUT's and IF stuff */
-static void addressbook_free_adapter ( GtkCTreeNode *node );
-static void addressbook_free_child_adapters ( GtkCTreeNode *node );
-AddressTypeControlItem *addrbookctl_lookup ( gint ot );
-AddressTypeControlItem *addrbookctl_lookup_iface( AddressIfType ifType );
+/* LUT's and IF stuff */
+static void addressbook_free_adapter (GtkCTreeNode *node);
+static void addressbook_free_child_adapters (GtkCTreeNode *node);
+AddressTypeControlItem *addrbookctl_lookup (gint ot);
+AddressTypeControlItem *addrbookctl_lookup_iface(AddressIfType ifType);
-void addrbookctl_build_map ( GtkWidget *window );
-void addrbookctl_build_iflist ( void );
-AdapterInterface *addrbookctl_find_interface ( AddressIfType ifType );
-void addrbookctl_build_ifselect();
+void addrbookctl_build_map (GtkWidget *window);
+void addrbookctl_build_iflist (void);
+AdapterInterface *addrbookctl_find_interface (AddressIfType ifType);
+void addrbookctl_build_ifselect (void);
-static void addrbookctl_free_interface ( AdapterInterface *adapter );
-static void addrbookctl_free_datasource ( AdapterDSource *adapter );
-static void addrbookctl_free_folder ( AdapterFolder *adapter );
-static void addrbookctl_free_group ( AdapterGroup *adapter );
+static void addrbookctl_free_interface (AdapterInterface *adapter);
+static void addrbookctl_free_datasource (AdapterDSource *adapter);
+static void addrbookctl_free_folder (AdapterFolder *adapter);
+static void addrbookctl_free_group (AdapterGroup *adapter);
-static void addressbook_list_select_clear ( void );
-static void addressbook_list_select_add ( AddressObject *obj );
-static void addressbook_list_select_remove ( AddressObject *obj );
+static void addressbook_list_select_clear (void);
+static void addressbook_list_select_add (AddressObject *obj);
+static void addressbook_list_select_remove (AddressObject *obj);
static GtkItemFactoryEntry addressbook_entries[] =
{
return addrbook.target_compose;
}
-void addressbook_refresh( void ) {
- if( addrbook.window ) {
- if( addrbook.treeSelected ) {
- gtk_ctree_select( GTK_CTREE(addrbook.ctree), addrbook.treeSelected );
+void addressbook_refresh(void)
+{
+ if (addrbook.window) {
+ if (addrbook.treeSelected) {
+ gtk_ctree_select(GTK_CTREE(addrbook.ctree),
+ addrbook.treeSelected);
}
}
addressbook_export_to_file();
* In the tradition of MVC architecture, the data stores have been separated from the
* GUI components. The addrindex.c file provides the interface to all data stores.
*/
-static void addressbook_create( void ) {
+static void addressbook_create(void)
+{
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *menubar;
GtkWidget *label;
GtkWidget *entry;
GtkWidget *statusbar;
- /* GtkWidget *hmbox; */
GtkWidget *hbbox;
GtkWidget *hsbox;
GtkWidget *del_btn;
GtkItemFactory *menu_factory;
gint n_entries;
GList *nodeIf;
- AdapterInterface *adapter;
- AddressTypeControlItem *atci;
- AddressInterface *iface;
gchar *titles[N_COLS] = {_("Name"), _("E-Mail address"), _("Remarks")};
gchar *text;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), _("Address book"));
gtk_widget_set_usize(window, ADDRESSBOOK_WIDTH, ADDRESSBOOK_HEIGHT);
- gtk_container_set_border_width(GTK_CONTAINER(window), BORDER_WIDTH);
gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, TRUE);
gtk_widget_realize(window);
GTK_POLICY_ALWAYS);
gtk_widget_set_usize(ctree_swin, COL_FOLDER_WIDTH + 40, -1);
- /* Address index */
+ /* Address index */
ctree = gtk_ctree_new(1, 0);
gtk_container_add(GTK_CONTAINER(ctree_swin), ctree);
gtk_clist_set_selection_mode(GTK_CLIST(ctree), GTK_SELECTION_BROWSE);
GTK_POLICY_ALWAYS);
gtk_box_pack_start(GTK_BOX(clist_vbox), clist_swin, TRUE, TRUE, 0);
- /* Address list */
+ /* Address list */
clist = gtk_ctree_new_with_titles(N_COLS, 0, titles);
gtk_container_add(GTK_CONTAINER(clist_swin), clist);
gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_EXTENDED);
GTK_SIGNAL_FUNC(addressbook_to_clicked),
GINT_TO_POINTER(COMPOSE_BCC));
- /* Build icons for interface */
+ /* Build icons for interface */
PIXMAP_CREATE( window, interfacexpm, interfacexpmmask, interface_xpm );
/* Build control tables */
- addrbookctl_build_map( window );
+ addrbookctl_build_map(window);
addrbookctl_build_iflist();
addrbookctl_build_ifselect();
- /* Add each interface into the tree as a root level folder */
+ /* Add each interface into the tree as a root level folder */
nodeIf = _addressInterfaceList_;
while( nodeIf ) {
- adapter = nodeIf->data;
- nodeIf = g_list_next( nodeIf );
- iface = adapter->interface;
- if( iface->useInterface ) {
- atci = adapter->atci;
+ AdapterInterface *adapter = nodeIf->data;
+ AddressInterface *iface = adapter->interface;
+ nodeIf = g_list_next(nodeIf);
+
+ if(iface->useInterface) {
+ AddressTypeControlItem *atci = adapter->atci;
text = atci->displayName;
adapter->treeNode =
gtk_ctree_insert_node( GTK_CTREE(ctree),
ads = ADAPTER_DSOURCE(obj);
if( ads == NULL ) return;
ds = ads->dataSource;
- if( ds == NULL ) return;
+ if( ds == NULL ) return;
if( addrindex_ds_get_modify_flag( ds ) ) {
addrindex_ds_read_data( ds );
void addrbookctl_build_map( GtkWidget *window ) {
AddressTypeControlItem *atci;
- /* Build icons */
- PIXMAP_CREATE(window, folderxpm, folderxpmmask, DIRECTORY_CLOSE_XPM);
- PIXMAP_CREATE(window, folderopenxpm, folderopenxpmmask, DIRECTORY_OPEN_XPM);
+ // Build icons
+ PIXMAP_CREATE(window, folderxpm, folderxpmmask, dir_close_xpm);
+ PIXMAP_CREATE(window, folderopenxpm, folderopenxpmmask, dir_open_xpm);
PIXMAP_CREATE(window, groupxpm, groupxpmmask, group_xpm);
PIXMAP_CREATE(window, vcardxpm, vcardxpmmask, vcard_xpm);
PIXMAP_CREATE(window, bookxpm, bookxpmmask, book_xpm);
void addritem_person_set_last_name ( ItemPerson *person, const gchar *value );
void addritem_person_set_nick_name ( ItemPerson *person, const gchar *value );
void addritem_person_set_common_name ( ItemPerson *person, const gchar *value );
+void addritem_person_set_external_id ( ItemPerson *person, const gchar *value );
void addritem_person_set_opened ( ItemPerson *person, const gboolean value );
void addritem_free_item_person ( ItemPerson *person );
void addritem_free_list_email ( GList *list );
ItemEMail *addritem_move_email_after ( ItemPerson *person, ItemEMail *itemMove, ItemEMail *itemTarget );
#endif /* __ADDRITEM_H__ */
-
-
return str ? str : "US-ASCII";
}
+const gchar *conv_get_current_locale(void)
+{
+ gchar *cur_locale;
+
+ cur_locale = g_getenv("LC_ALL");
+ if (!cur_locale) cur_locale = g_getenv("LANG");
+ if (!cur_locale) cur_locale = setlocale(LC_CTYPE, NULL);
+
+ debug_print("current locale: %s\n",
+ cur_locale ? cur_locale : "(none)");
+
+ return cur_locale;
+}
+
void conv_unmime_header_overwrite(gchar *str)
{
gchar *buf;
CharSet conv_get_outgoing_charset (void);
const gchar *conv_get_outgoing_charset_str (void);
+const gchar *conv_get_current_locale (void);
+
void conv_unmime_header_overwrite (gchar *str);
void conv_unmime_header (gchar *outbuf,
gint outlen,
static GList *compose_list = NULL;
-static Compose *compose_create (PrefsAccount *account);
+static Compose *compose_create (PrefsAccount *account,
+ ComposeMode mode);
static void compose_toolbar_create (Compose *compose,
GtkWidget *container);
static GtkWidget *compose_account_option_menu_create
const gchar *type,
ContentType cnttype);
static void compose_wrap_line (Compose *compose);
+static void compose_wrap_line_all (Compose *compose);
static void compose_set_title (Compose *compose);
static PrefsAccount *compose_current_mail_account(void);
static GtkItemFactoryEntry compose_entries[] =
{
{N_("/_File"), NULL, NULL, 0, "<Branch>"},
- {N_("/_File/_Attach file"), "<control>M", compose_attach_cb, 0, NULL},
+ {N_("/_File/_Attach file"), "<control>M", compose_attach_cb, 0, NULL},
{N_("/_File/_Insert file"), "<control>I", compose_insert_file_cb, 0, NULL},
- {N_("/_File/Insert si_gnature"), "<control>G", compose_insert_sig, 0, NULL},
+ {N_("/_File/Insert si_gnature"), "<control>G", compose_insert_sig, 0, NULL},
{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", NULL, 0, NULL},
- {N_("/_Edit/_Redo"), "<control>Y", NULL, 0, NULL},
- {N_("/_Edit/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Edit"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_Edit/_Undo"), "<control>Z", NULL, 0, NULL},
+ {N_("/_Edit/_Redo"), "<control>Y", NULL, 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 long _lines"), "<alt>L", compose_wrap_line, 0, NULL},
- {N_("/_Edit/Edit with e_xternal editor"), "<alt>X",
- compose_ext_editor_cb, 0, NULL},
-
- {N_("/_Message"), NULL, NULL, 0, "<Branch>"},
+ {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},
+ {N_("/_Edit/Edit with e_xternal editor"),
+ "<alt>X", compose_ext_editor_cb, 0, NULL},
+
+ {N_("/_Message"), NULL, NULL, 0, "<Branch>"},
{N_("/_Message/_Send"), "<shift><control>S",
compose_send_cb, 0, NULL},
{N_("/_Message/Send _later"), "<shift><alt>S",
compose_send_later_cb, 0, NULL},
{N_("/_Message/Save to _draft folder"),
- "<alt>D", compose_draft_cb, 0, NULL},
- {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Message/_To"), NULL, compose_toggle_to_cb, 0, "<ToggleItem>"},
- {N_("/_Message/_Cc"), NULL, compose_toggle_cc_cb, 0, "<ToggleItem>"},
- {N_("/_Message/_Bcc"), NULL, compose_toggle_bcc_cb, 0, "<ToggleItem>"},
+ "<alt>D", compose_draft_cb, 0, NULL},
+ {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Message/_To"), NULL, compose_toggle_to_cb , 0, "<ToggleItem>"},
+ {N_("/_Message/_Cc"), NULL, compose_toggle_cc_cb , 0, "<ToggleItem>"},
+ {N_("/_Message/_Bcc"), NULL, compose_toggle_bcc_cb , 0, "<ToggleItem>"},
{N_("/_Message/_Reply to"), NULL, compose_toggle_replyto_cb, 0, "<ToggleItem>"},
- {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_Followup to"), NULL, compose_toggle_followupto_cb, 0, "<ToggleItem>"},
- {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_Attach"), NULL, compose_toggle_attach_cb, 0, "<ToggleItem>"},
#if USE_GPGME
- {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Message/Si_gn"), NULL, compose_toggle_sign_cb, 0, "<ToggleItem>"},
+ {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Message/Si_gn"), NULL, compose_toggle_sign_cb , 0, "<ToggleItem>"},
{N_("/_Message/_Encrypt"), NULL, compose_toggle_encrypt_cb, 0, "<ToggleItem>"},
#endif /* USE_GPGME */
{N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_Request Return Receipt"), NULL, compose_toggle_return_receipt_cb, 0, "<ToggleItem>"},
- {N_("/_Tool"), NULL, NULL, 0, "<Branch>"},
- {N_("/_Tool/Show _ruler"), NULL, compose_toggle_ruler_cb, 0, "<ToggleItem>"},
- {N_("/_Tool/_Address book"), "<alt>A", compose_address_cb, 0, NULL},
+ {N_("/_Tool"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_Tool/Show _ruler"), NULL, compose_toggle_ruler_cb, 0, "<ToggleItem>"},
+ {N_("/_Tool/_Address book"), "<alt>A", compose_address_cb , 0, NULL},
{N_("/_Tool/_Templates ..."), NULL, template_select_cb, 0, NULL},
- {N_("/_Help"), NULL, NULL, 0, "<LastBranch>"},
- {N_("/_Help/_About"), NULL, about_show, 0, NULL}
+ {N_("/_Help"), NULL, NULL, 0, "<LastBranch>"},
+ {N_("/_Help/_About"), NULL, about_show, 0, NULL}
};
static GtkTargetEntry compose_mime_types[] =
if (!account) account = cur_account;
g_return_val_if_fail(account != NULL, NULL);
- compose = compose_create(account);
- compose->mode = COMPOSE_NEW;
+ compose = compose_create(account, COMPOSE_NEW);
compose->replyinfo = NULL;
if (prefs_common.auto_sig)
gtk_widget_grab_focus(compose->newsgroups_entry);
}
- return compose;
+ if (prefs_common.auto_exteditor)
+ compose_exec_ext_editor(compose);
+
+ return compose;
}
#define CHANGE_FLAGS(msginfo) \
g_return_val_if_fail(account != NULL, NULL);
g_return_val_if_fail(account->protocol != A_NNTP, NULL);
- compose = compose_create(account);
- compose->mode = COMPOSE_NEW;
+ compose = compose_create(account, COMPOSE_NEW);
if (prefs_common.auto_sig)
compose_insert_sig(compose);
CHANGE_FLAGS(msginfo);
- compose = compose_create(reply_account);
- compose->mode = COMPOSE_REPLY;
+ compose = compose_create(account, COMPOSE_REPLY);
compose->replyinfo = msginfo;
gtk_stext_thaw(text);
gtk_widget_grab_focus(compose->text);
+
+ if (prefs_common.auto_exteditor)
+ compose_exec_ext_editor(compose);
}
MSG_SET_PERM_FLAGS(msginfo->flags, MSG_FORWARDED);
CHANGE_FLAGS(msginfo);
- compose = compose_create(account);
- compose->mode = COMPOSE_FORWARD;
+ compose = compose_create(account, COMPOSE_FORWARD);
if (msginfo->subject && *msginfo->subject) {
gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), "Fw: ");
else
gtk_widget_grab_focus(compose->newsgroups_entry);
- return compose;
+ if (prefs_common.auto_exteditor)
+ compose_exec_ext_editor(compose);
+
+ return compose;
}
#undef INSERT_FW_HEADER
}
g_return_val_if_fail(account != NULL, NULL);
- compose = compose_create(account);
- compose->mode = COMPOSE_FORWARD;
+ compose = compose_create(account, COMPOSE_FORWARD);
text = GTK_STEXT(compose->text);
gtk_stext_freeze(text);
if (!account) account = cur_account;
g_return_if_fail(account != NULL);
- compose = compose_create(account);
- compose->mode = COMPOSE_REEDIT;
-
+ compose = compose_create(account, COMPOSE_REEDIT);
compose->targetinfo = procmsg_msginfo_copy(msginfo);
if (compose_parse_header(compose, msginfo) < 0) return;
gtk_stext_thaw(text);
gtk_widget_grab_focus(compose->text);
+
+ if (prefs_common.auto_exteditor)
+ compose_exec_ext_editor(compose);
}
GList *compose_get_compose_list(void)
}
static void compose_wrap_line(Compose *compose)
+{
+ GtkSText *text = GTK_STEXT(compose->text);
+ gint ch_len, last_ch_len;
+ gchar cbuf[MB_CUR_MAX], last_ch;
+ guint text_len;
+ guint line_end;
+ guint quoted;
+ gint p_start, p_end;
+ gint line_pos, cur_pos;
+ gint line_len, cur_len;
+
+#define GET_STEXT(pos) \
+ if (text->use_wchar) \
+ ch_len = wctomb(cbuf, (wchar_t)GTK_STEXT_INDEX(text, (pos))); \
+ else { \
+ cbuf[0] = GTK_STEXT_INDEX(text, (pos)); \
+ ch_len = 1; \
+ }
+
+ gtk_stext_freeze(text);
+
+ text_len = gtk_stext_get_length(text);
+
+ /* check to see if the point is on the paragraph mark (empty line). */
+ cur_pos = gtk_stext_get_point(text);
+ GET_STEXT(cur_pos);
+ if ((ch_len == 1 && *cbuf == '\n') || cur_pos == text_len) {
+ if (cur_pos == 0)
+ goto compose_end; /* on the paragraph mark */
+ GET_STEXT(cur_pos - 1);
+ if (ch_len == 1 && *cbuf == '\n')
+ goto compose_end; /* on the paragraph mark */
+ }
+
+ /* find paragraph start. */
+ line_end = quoted = 0;
+ for (p_start = cur_pos; p_start >= 0; --p_start) {
+ GET_STEXT(p_start);
+ if (ch_len == 1 && *cbuf == '\n') {
+ if (quoted)
+ goto compose_end; /* quoted part */
+ if (line_end) {
+ p_start += 2;
+ break;
+ }
+ line_end = 1;
+ } else {
+ if (ch_len == 1 && strchr(">:#", *cbuf))
+ quoted = 1;
+ else if (ch_len != 1 || !isspace(*cbuf))
+ quoted = 0;
+
+ line_end = 0;
+ }
+ }
+ if (p_start < 0)
+ p_start = 0;
+
+ /* find paragraph end. */
+ line_end = 0;
+ for (p_end = cur_pos; p_end < text_len; p_end++) {
+ GET_STEXT(p_end);
+ if (ch_len == 1 && *cbuf == '\n') {
+ if (line_end) {
+ p_end -= 1;
+ break;
+ }
+ line_end = 1;
+ } else {
+ if (line_end && ch_len == 1 && strchr(">:#", *cbuf))
+ goto compose_end; /* quoted part */
+
+ line_end = 0;
+ }
+ }
+ if (p_end >= text_len)
+ p_end = text_len;
+
+ if (p_start >= p_end)
+ goto compose_end;
+
+ line_len = cur_len = 0;
+ last_ch_len = 0;
+ last_ch = '\0';
+ line_pos = p_start;
+ for (cur_pos = p_start; cur_pos < p_end; cur_pos++) {
+ guint space = 0;
+
+ GET_STEXT(cur_pos);
+
+ if (ch_len < 0) {
+ cbuf[0] = '\0';
+ ch_len = 1;
+ }
+
+ if (ch_len == 1 && isspace(*cbuf))
+ space = 1;
+
+ if (ch_len == 1 && *cbuf == '\n') {
+ guint replace = 0;
+ if (last_ch_len == 1 && !isspace(last_ch)) {
+ if (cur_pos + 1 < p_end) {
+ GET_STEXT(cur_pos + 1);
+ if (ch_len == 1 && !isspace(*cbuf))
+ replace = 1;
+ }
+ }
+ gtk_stext_set_point(text, cur_pos + 1);
+ gtk_stext_backward_delete(text, 1);
+ if (replace) {
+ gtk_stext_set_point(text, cur_pos);
+ gtk_stext_insert(text, NULL, NULL, NULL, " ", 1);
+ space = 1;
+ }
+ else {
+ p_end--;
+ cur_pos--;
+ continue;
+ }
+ }
+
+ last_ch_len = ch_len;
+ last_ch = *cbuf;
+
+ if (space) {
+ line_pos = cur_pos + 1;
+ line_len = cur_len + ch_len;
+ }
+
+ if (cur_len + ch_len > prefs_common.linewrap_len &&
+ line_len > 0) {
+ gint tlen = ch_len;
+
+ GET_STEXT(line_pos - 1);
+ if (ch_len == 1 && isspace(*cbuf)) {
+ gtk_stext_set_point(text, line_pos);
+ gtk_stext_backward_delete(text, 1);
+ p_end--;
+ cur_pos--;
+ line_pos--;
+ cur_len--;
+ line_len--;
+ }
+ ch_len = tlen;
+
+ gtk_stext_set_point(text, line_pos);
+ gtk_stext_insert(text, NULL, NULL, NULL, "\n", 1);
+ p_end++;
+ cur_pos++;
+ line_pos++;
+ cur_len = cur_len - line_len + ch_len;
+ line_len = 0;
+ continue;
+ }
+
+ if (ch_len > 1) {
+ line_pos = cur_pos + 1;
+ line_len = cur_len + ch_len;
+ }
+ cur_len += ch_len;
+ }
+
+compose_end:
+ gtk_stext_thaw(text);
+
+#undef GET_STEXT
+}
+
+static void compose_wrap_line_all(Compose *compose)
{
GtkSText *text = GTK_STEXT(compose->text);
guint text_len;
get_rc_dir(), G_DIR_SEPARATOR, (gint)compose);
if (prefs_common.linewrap_at_send)
- compose_wrap_line(compose);
+ compose_wrap_line_all(compose);
if (compose_write_to_file(compose, tmp, FALSE) < 0) {
lock = FALSE;
(*count)++;
}
-static Compose *compose_create(PrefsAccount *account)
+static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
{
Compose *compose;
GtkWidget *window;
compose->popupmenu = popupmenu;
compose->popupfactory = popupfactory;
- compose->mode = COMPOSE_NEW;
+ compose->mode = mode;
compose->replyto = NULL;
compose->cc = NULL;
gtk_widget_set_sensitive(menuitem, FALSE);
}
*/
- if (account->set_autocc && account->auto_cc) {
+ if (account->set_autocc && account->auto_cc && mode != COMPOSE_REEDIT) {
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, "/Message/Bcc");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
- if (account->auto_bcc)
+ if (account->auto_bcc && mode != COMPOSE_REEDIT)
gtk_entry_set_text(GTK_ENTRY(bcc_entry),
account->auto_bcc);
}
"/Message/Reply to");
gtk_check_menu_item_set_active
(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
- if (account->auto_replyto)
+ if (account->auto_replyto && mode != COMPOSE_REEDIT)
gtk_entry_set_text(GTK_ENTRY(reply_entry),
account->auto_replyto);
}
CREATE_TOOLBAR_ICON(linewrap_xpm);
linewrap_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
_("Linewrap"),
- _("Wrap long lines"),
+ _("Wrap current paragraph"),
"Linewrap",
icon_wid,
toolbar_linewrap_cb,
g_get_tmp_dir(), G_DIR_SEPARATOR, (gint)compose);
if (prefs_common.linewrap_at_send)
- compose_wrap_line(compose);
+ compose_wrap_line_all(compose);
if (compose_write_to_file(compose, tmp, FALSE) < 0 ||
compose_queue(compose, tmp) < 0) {
#include "addressbook.h"
#include "prefs_account.h"
-typedef enum
-{
- COMPOSE_MAIL,
- COMPOSE_NEWS
-} ComposeMode;
-
typedef enum
{
COMPOSE_TO,
COMPOSE_FORWARD_AS_ATTACH,
COMPOSE_NEW,
COMPOSE_REEDIT
-} ComposeReplyMode;
+} ComposeMode;
struct _Compose
{
GtkItemFactory *popupfactory;
- ComposeReplyMode mode;
+ ComposeMode mode;
MsgInfo *targetinfo;
MsgInfo *replyinfo;
#include "addrbook.h"
#include "manage_window.h"
#include "gtkutils.h"
+#include "codeconv.h"
#include "prefs_common.h"
window = gtk_window_new(GTK_WINDOW_DIALOG);
gtk_widget_set_usize(window, 400, -1);
- gtk_container_set_border_width(GTK_CONTAINER(window), 8);
+ //gtk_container_set_border_width(GTK_CONTAINER(window), 8);
gtk_window_set_title(GTK_WINDOW(window), _("Edit address"));
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
static void addressbook_edit_person_dialog_create( gboolean *cancelled ) {
GtkWidget *window;
GtkWidget *vbox;
+ GtkWidget *vnbox;
GtkWidget *notebook;
GtkWidget *hbbox;
GtkWidget *ok_btn;
window = gtk_window_new(GTK_WINDOW_DIALOG);
gtk_widget_set_usize(window, EDITPERSON_WIDTH, EDITPERSON_HEIGHT );
- gtk_container_set_border_width(GTK_CONTAINER(window), 0);
+ //gtk_container_set_border_width(GTK_CONTAINER(window), 0);
gtk_window_set_title(GTK_WINDOW(window), _("Edit Person Data"));
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
GTK_SIGNAL_FUNC(edit_person_key_pressed),
cancelled);
- vbox = gtk_vbox_new( FALSE, 6 );
- gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER_WIDTH);
- gtk_widget_show( vbox );
- gtk_container_add( GTK_CONTAINER( window ), vbox );
+ vbox = gtk_vbox_new(FALSE, 4);
+ //gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER_WIDTH);
+ gtk_widget_show(vbox);
+ gtk_container_add(GTK_CONTAINER(window), vbox);
+
+ vnbox = gtk_vbox_new(FALSE, 4);
+ gtk_container_set_border_width(GTK_CONTAINER(vnbox), 4);
+ gtk_widget_show(vnbox);
+ gtk_box_pack_start(GTK_BOX(vbox), vnbox, TRUE, TRUE, 0);
// Notebook
notebook = gtk_notebook_new();
- gtk_widget_show( notebook );
- gtk_box_pack_start( GTK_BOX( vbox ), notebook, TRUE, TRUE, 0 );
- gtk_container_set_border_width( GTK_CONTAINER( notebook ), 6 );
+ gtk_widget_show(notebook);
+ gtk_box_pack_start(GTK_BOX(vnbox), notebook, TRUE, TRUE, 0);
+ gtk_container_set_border_width(GTK_CONTAINER(notebook), 6);
// Status line
hsbox = gtk_hbox_new(FALSE, 0);
// Button panel
gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
&cancel_btn, _("Cancel"), NULL, NULL);
- gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
+ gtk_box_pack_end(GTK_BOX(vnbox), hbbox, FALSE, FALSE, 0);
gtk_widget_grab_default(ok_btn);
gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
GtkWidget *entry_fn;
GtkWidget *entry_ln;
GtkWidget *entry_nn;
- gint top;
+ const gchar *locale;
+ gint top = 0;
vbox = gtk_vbox_new( FALSE, 8 );
gtk_widget_show( vbox );
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
- // First row
- top = 0;
- label = gtk_label_new(_("Display Name"));
- gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
- entry_name = gtk_entry_new();
- gtk_table_attach(GTK_TABLE(table), entry_name, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
-
- // Next row
- ++top;
- label = gtk_label_new(_("First Name"));
- gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
- entry_fn = gtk_entry_new();
- gtk_table_attach(GTK_TABLE(table), entry_fn, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
-
- // Next row
- ++top;
- label = gtk_label_new(_("Last Name"));
- gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-
- entry_ln = gtk_entry_new();
- gtk_table_attach(GTK_TABLE(table), entry_ln, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+#define ATTACH_ROW(text, entry) \
+{ \
+ label = gtk_label_new(text); \
+ gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), \
+ GTK_FILL, 0, 0, 0); \
+ gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); \
+ \
+ entry = gtk_entry_new(); \
+ gtk_table_attach(GTK_TABLE(table), entry, 1, 2, top, (top + 1), \
+ GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0); \
+ top++; \
+}
- // Next row
- ++top;
- label = gtk_label_new(_("Nick Name"));
- gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ ATTACH_ROW(_("Display Name"), entry_name);
+ locale = conv_get_current_locale();
+ if (locale &&
+ (!g_strncasecmp(locale, "ja", 2) ||
+ !g_strncasecmp(locale, "ko", 2) ||
+ !g_strncasecmp(locale, "zh", 2))) {
+ ATTACH_ROW(_("Last Name"), entry_ln);
+ ATTACH_ROW(_("First Name"), entry_fn);
+ } else {
+ ATTACH_ROW(_("First Name"), entry_fn);
+ ATTACH_ROW(_("Last Name"), entry_ln);
+ }
+ ATTACH_ROW(_("Nick Name"), entry_nn);
- entry_nn = gtk_entry_new();
- gtk_table_attach(GTK_TABLE(table), entry_nn, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+#undef ATTACH_ROW
gtk_widget_show_all(vbox);
#include "addressitem.h"
#include "jpilot.h"
#include "mgutils.h"
+#include "gtkutils.h"
+#include "manage_window.h"
#define ADDRESSBOOK_GUESS_JPILOT "MyJPilot"
#define JPILOT_NUM_CUSTOM_LABEL 4
}
static void edit_jpilot_file_check( void ) {
- gint t;
+ gint t = -1;
gchar *sFile;
gchar *sMsg;
gboolean flg;
#include "addressbook.h"
#include "prefs_common.h"
#include "addressitem.h"
+#include "mgutils.h"
#include "syldap.h"
#include "editldap_basedn.h"
+#include "manage_window.h"
+#include "gtkutils.h"
#define ADDRESSBOOK_GUESS_LDAP_NAME "MyServer"
#define ADDRESSBOOK_GUESS_LDAP_SERVER "localhost"
cancelled);
vbox = gtk_vbox_new( FALSE, 6 );
- gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER_WIDTH);
+ //gtk_container_set_border_width(GTK_CONTAINER(vbox), BORDER_WIDTH);
gtk_widget_show( vbox );
gtk_container_add( GTK_CONTAINER( window ), vbox );
vbox = gtk_vbox_new( FALSE, 8 );
gtk_widget_show( vbox );
gtk_container_add( GTK_CONTAINER( ldapedit.notebook ), vbox );
- gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );
+ //gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );
label = gtk_label_new( pageLbl );
gtk_widget_show( label );
vbox = gtk_vbox_new( FALSE, 8 );
gtk_widget_show( vbox );
gtk_container_add( GTK_CONTAINER( ldapedit.notebook ), vbox );
- gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );
+ //gtk_container_set_border_width( GTK_CONTAINER (vbox), BORDER_WIDTH );
label = gtk_label_new( pageLbl );
gtk_widget_show( label );
gint menuVal;
gint n = 0;
- g_return_if_fail(menu != NULL);
+ g_return_if_fail(optmenu != NULL);
menu = gtk_option_menu_get_menu(optmenu);
for( cur = GTK_MENU_SHELL(menu)->children; cur != NULL; cur = cur->next ) {
gint edit_ldap_get_optmenu( GtkOptionMenu *optmenu ) {
GtkWidget *menu;
GtkWidget *menuitem;
- g_return_if_fail(menu != NULL);
+
+ g_return_val_if_fail(optmenu != NULL, -1);
+
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(optmenu));
menuitem = gtk_menu_get_active(GTK_MENU(menu));
return GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(menuitem)));
AdapterDSource *addressbook_edit_ldap( AddressIndex *addrIndex, AdapterDSource *ads ) {
static gboolean cancelled;
gchar *sName, *sHost, *sBase, *sBind, *sPass, *sCrit;
- gint iPort, iMaxE, iTime, iMail, iName;
+ gint iPort, iMaxE, iTime;
AddressDataSource *ds = NULL;
SyldapServer *server = NULL;
gboolean fin;
/*
* End of Source.
*/
-
#include "intl.h"
#include "prefs_common.h"
#include "syldap.h"
+#include "mgutils.h"
+#include "gtkutils.h"
+#include "manage_window.h"
static struct _LDAPEdit_basedn {
GtkWidget *window;
}
static void edit_ldap_bdn_list_select( GtkCList *clist, gint row, gint column, GdkEvent *event, gpointer data ) {
- gchar **text;
+ gchar **text = NULL;
if( gtk_clist_get_text( clist, row, 0, text ) ) {
if( *text ) {
gtk_entry_set_text(GTK_ENTRY(ldapedit_basedn.basedn_entry), *text );
}
}
-static void edit_ldap_bdn_create() {
+static void edit_ldap_bdn_create(void) {
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
GtkWidget *host_label;
GtkWidget *port_label;
- GtkWidget *basedn_label;
+ //GtkWidget *basedn_label;
GtkWidget *basedn_list;
GtkWidget *vlbox;
GtkWidget *lwindow;
GtkWidget *basedn_entry;
- GtkWidget *hlbox;
+ //GtkWidget *hlbox;
GtkWidget *hbbox;
GtkWidget *hsep;
GtkWidget *ok_btn;
GtkWidget *cancel_btn;
- GtkWidget *check_btn;
- GtkWidget *file_btn;
+ //GtkWidget *check_btn;
+ //GtkWidget *file_btn;
GtkWidget *hsbox;
GtkWidget *statusbar;
gint top;
static void foldersel_init(void)
{
- PIXMAP_CREATE(ctree, folderxpm, folderxpmmask, DIRECTORY_CLOSE_XPM);
- PIXMAP_CREATE(ctree, folderopenxpm, folderopenxpmmask,
- DIRECTORY_OPEN_XPM);
+ PIXMAP_CREATE(ctree, folderxpm, folderxpmmask, dir_close_xpm);
+ PIXMAP_CREATE(ctree, folderopenxpm, folderopenxpmmask, dir_open_xpm);
}
static gboolean foldersel_gnode_func(GtkCTree *ctree, guint depth,
PIXMAP_CREATE(ctree, inboxxpm, inboxxpmmask, inbox_xpm);
PIXMAP_CREATE(ctree, outboxxpm, outboxxpmmask, outbox_xpm);
- PIXMAP_CREATE(ctree, folderxpm, folderxpmmask, DIRECTORY_CLOSE_XPM);
- PIXMAP_CREATE(ctree, folderopenxpm, folderopenxpmmask,
- DIRECTORY_OPEN_XPM);
+ PIXMAP_CREATE(ctree, folderxpm, folderxpmmask, dir_close_xpm);
+ PIXMAP_CREATE(ctree, folderopenxpm, folderopenxpmmask, dir_open_xpm);
PIXMAP_CREATE(ctree, trashxpm, trashxpmmask, trash_xpm);
if (!normalfont)
summary_write_cache(mainwin->summaryview);
main_window_lock(mainwin);
- if (prefs_common.use_extinc && prefs_common.extinc_path) {
- gint pid;
-
+ if (prefs_common.use_extinc && prefs_common.extinc_cmd) {
/* external incorporating program */
- if ((pid = fork()) < 0) {
- perror("fork");
+ if (execute_command_line(prefs_common.extinc_cmd, FALSE) < 0) {
main_window_unlock(mainwin);
inc_autocheck_timer_set();
return;
}
- if (pid == 0) {
- execlp(prefs_common.extinc_path,
- g_basename(prefs_common.extinc_path),
- NULL);
-
- /* this will be called when failed */
- perror("exec");
- _exit(1);
- }
-
- /* wait until child process is terminated */
- waitpid(pid, NULL, 0);
-
if (prefs_common.inc_local)
new_msgs = inc_spool();
} else {
GTK_SIGNAL_FUNC(inc_cancel), dialog);
gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
GTK_SIGNAL_FUNC(gtk_true), NULL);
+ /* manage_window_set_transient(GTK_WINDOW(progress->window)); */
progress_dialog_set_value(progress, 0.0);
#ifdef USE_JPILOT
+#include <glib.h>
#include <time.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
#include <dlfcn.h>
-#include <pi-args.h>
-#include <pi-appinfo.h>
-#include <pi-address.h>
+#ifdef HAVE_LIBPISOCK_PI_ARGS_H
+# include <libpisock/pi-args.h>
+# include <libpisock/pi-appinfo.h>
+# include <libpisock/pi-address.h>
+#else
+# include <pi-args.h>
+# include <pi-appinfo.h>
+# include <pi-address.h>
+#endif
#include "mgutils.h"
#include "addritem.h"
}
gint jpilot_get_status( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, -1 );
return pilotFile->retVal;
}
ItemFolder *jpilot_get_root_folder( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, NULL );
return addrcache_get_root_folder( pilotFile->addressCache );
}
gchar *jpilot_get_name( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, NULL );
return pilotFile->name;
}
* Return: TRUE if file was modified.
*/
gboolean jpilot_get_modified( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, FALSE );
return addrcache_check_file( pilotFile->addressCache, pilotFile->path );
}
gboolean jpilot_get_accessed( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, FALSE );
return pilotFile->accessFlag;
}
* Return: TRUE if file was read.
*/
gboolean jpilot_get_read_flag( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, FALSE );
return pilotFile->addressCache->dataRead;
}
*/
void jpilot_clear_custom_labels( JPilotFile *pilotFile ) {
GList *node;
+
g_return_if_fail( pilotFile != NULL );
// Release custom labels
GList *jpilot_get_custom_labels( JPilotFile *pilotFile ) {
GList *retVal = NULL;
GList *node;
- g_return_if_fail( pilotFile != NULL );
+
+ g_return_val_if_fail( pilotFile != NULL, NULL );
+
node = pilotFile->customLabels;
while( node ) {
retVal = g_list_append( retVal, g_strdup( node->data ) );
*/
void jpilot_print_file( JPilotFile *pilotFile, FILE *stream ) {
GList *node;
+
g_return_if_fail( pilotFile != NULL );
+
fprintf( stream, "JPilotFile:\n" );
fprintf( stream, "file spec: '%s'\n", pilotFile->path );
fprintf( stream, " metadata: %s\n", pilotFile->readMetadata ? "yes" : "no" );
node = pilotFile->customLabels;
while( node ) {
- fprintf( stream, " c label: %s\n", node->data );
+ fprintf( stream, " c label: %s\n", (gchar *)node->data );
node = g_list_next( node );
}
node = pilotFile->customLabels;
while( node ) {
- fprintf( stream, " c label: %s\n", node->data );
+ fprintf( stream, " c label: %s\n", (gchar *)node->data );
node = g_list_next( node );
}
// Shamelessly copied from JPilot (libplugin.c)
static int raw_header_to_header(RawDBHeader *rdbh, DBHeader *dbh) {
unsigned long temp;
+
strncpy(dbh->db_name, rdbh->db_name, 31);
dbh->db_name[31] = '\0';
dbh->flags = bytes_to_bin(rdbh->flags, 2);
// jp_read_DB_files (from libplugin.c)
static gint jpilot_read_file( JPilotFile *pilotFile ) {
FILE *in;
- char *buf;
- int num_records, recs_returned, i, num, r;
- unsigned int offset, prev_offset, next_offset, rec_size;
- int out_of_order;
- long fpos; /*file position indicator */
- unsigned char attrib;
- unsigned int unique_id;
- gint cat_id;
+ gchar *buf;
+ gint num_records, recs_returned, i, num;
+ guint offset, prev_offset, next_offset, rec_size;
+ gint out_of_order;
+ glong fpos; /*file position indicator */
+ guchar attrib;
+ guint unique_id;
+ gint cat_id = 0;
mem_rec_header *mem_rh, *temp_mem_rh, *last_mem_rh;
record_header rh;
RawDBHeader rdbh;
gint retVal;
struct Address addr;
struct AddressAppInfo *ai;
- char **addrEnt;
- int inum, k;
+ gchar **addrEnt;
+ gint inum, k;
gchar fullName[ FULLNAME_BUFSIZE ];
gchar bufEMail[ EMAIL_BUFSIZE ];
gchar* extID;
ItemPerson *person;
ItemEMail *email;
- int *indPhoneLbl;
- char *labelEntry;
+ gint *indPhoneLbl;
+ gchar *labelEntry;
GList *node;
ItemFolder *folderInd[ JPILOT_NUM_CATEG ];
// Now go load all records
while(!feof(in)) {
- struct CategoryAppInfo *cat = & ai->category;
+ //struct CategoryAppInfo *cat = &ai->category;
+
fpos = ftell(in);
if (out_of_order) {
find_next_offset(mem_rh, fpos, &next_offset, &attrib, &unique_id);
// Add entry for each email address listed under phone labels.
indPhoneLbl = addr.phoneLabel;
for( k = 0; k < JPILOT_NUM_ADDR_PHONE; k++ ) {
- int ind;
+ gint ind;
ind = indPhoneLbl[k];
/*
fprintf( stdout, "%d : %d : %20s : %s\n", k, ind,
unsigned char *buf;
int num;
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, -1 );
pilotFile->readMetadata = FALSE;
addrcache_clear( pilotFile->addressCache );
struct AddressAppInfo *ai;
GList *node;
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, -1 );
// Release indexes
node = pilotFile->labelInd;
*/
GList *jpilot_load_label( JPilotFile *pilotFile, GList *labelList ) {
int i;
- g_return_if_fail( pilotFile != NULL );
+
+ g_return_val_if_fail( pilotFile != NULL, NULL );
+
if( pilotFile->readMetadata ) {
struct AddressAppInfo *ai = & pilotFile->addrInfo;
for( i = 0; i < JPILOT_NUM_LABELS; i++ ) {
*/
gchar *jpilot_get_category_name( JPilotFile *pilotFile, gint catID ) {
gchar *catName = NULL;
- g_return_if_fail( pilotFile != NULL );
+
+ g_return_val_if_fail( pilotFile != NULL, NULL );
+
if( pilotFile->readMetadata ) {
struct AddressAppInfo *ai = & pilotFile->addrInfo;
struct CategoryAppInfo *cat = & ai->category;
* Load list with character strings of phone label names.
*/
GList *jpilot_load_phone_label( JPilotFile *pilotFile, GList *labelList ) {
- int i;
- g_return_if_fail( pilotFile != NULL );
+ gint i;
+
+ g_return_val_if_fail( pilotFile != NULL, NULL );
+
if( pilotFile->readMetadata ) {
struct AddressAppInfo *ai = & pilotFile->addrInfo;
for( i = 0; i < JPILOT_NUM_PHONELABELS; i++ ) {
* are loaded.
*/
GList *jpilot_load_custom_label( JPilotFile *pilotFile, GList *labelList ) {
- int i;
- g_return_if_fail( pilotFile != NULL );
+ gint i;
+
+ g_return_val_if_fail( pilotFile != NULL, NULL );
if( pilotFile->readMetadata ) {
struct AddressAppInfo *ai = & pilotFile->addrInfo;
*/
GList *jpilot_get_category_list( JPilotFile *pilotFile ) {
GList *catList = NULL;
- int i;
- g_return_if_fail( pilotFile != NULL );
+ gint i;
+
+ g_return_val_if_fail( pilotFile != NULL, NULL );
+
if( pilotFile->readMetadata ) {
struct AddressAppInfo *ai = & pilotFile->addrInfo;
struct CategoryAppInfo *cat = & ai->category;
struct AddressAppInfo *ai = & pilotFile->addrInfo;
struct CategoryAppInfo *cat = & ai->category;
gint i;
+
for( i = 0; i < JPILOT_NUM_CATEG; i++ ) {
ItemFolder *folder = addritem_create_item_folder();
addritem_folder_set_name( folder, cat->name[i] );
*/
// ============================================================================================
gint jpilot_read_data( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, -1 );
+
pilotFile->retVal = MGU_SUCCESS;
pilotFile->accessFlag = FALSE;
if( addrcache_check_file( pilotFile->addressCache, pilotFile->path ) ) {
* Return link list of persons.
*/
GList *jpilot_get_list_person( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, NULL );
return addrcache_get_list_person( pilotFile->addressCache );
}
* Return: NULL.
*/
GList *jpilot_get_list_folder( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, NULL );
return addrcache_get_list_folder( pilotFile->addressCache );
}
* Return: List of items, or NULL if none.
*/
GList *jpilot_get_all_persons( JPilotFile *pilotFile ) {
- g_return_if_fail( pilotFile != NULL );
+ g_return_val_if_fail( pilotFile != NULL, NULL );
return addrcache_get_all_persons( pilotFile->addressCache );
}
* Check label list for specified label.
*/
gint jpilot_check_label( struct AddressAppInfo *ai, gchar *lblCheck ) {
- int i;
- gchar *lblName;
+ gint i;
+ gchar *lblName;
+
if( lblCheck == NULL ) return -1;
if( strlen( lblCheck ) < 1 ) return -1;
for( i = 0; i < JPILOT_NUM_LABELS; i++ ) {
*/
gboolean jpilot_validate( const JPilotFile *pilotFile ) {
gboolean retVal;
- g_return_if_fail( pilotFile != NULL );
+
+ g_return_val_if_fail( pilotFile != NULL, FALSE );
retVal = TRUE;
if( pilotFile->path ) {
gint jpilot_test_read_file( const gchar *fileSpec ) {
JPilotFile *pilotFile;
gint retVal;
+
if( fileSpec ) {
pilotFile = jpilot_create_path( fileSpec );
retVal = jpilot_read_metadata( pilotFile );
gboolean jpilot_test_custom_label( JPilotFile *pilotFile, const gchar *labelName ) {
gboolean retVal;
GList *node;
- g_return_if_fail( pilotFile != NULL );
+
+ g_return_val_if_fail( pilotFile != NULL, FALSE );
retVal = FALSE;
if( labelName ) {
* Test whether pilot link library installed.
* Return: TRUE if library available.
*/
-gboolean jpilot_test_pilot_lib() {
+gboolean jpilot_test_pilot_lib( void ) {
void *handle, *fun;
handle = dlopen( PILOT_LINK_LIB_NAME, RTLD_LAZY );
/*
* End of Source.
*/
-
-
#ifndef __JPILOT_H__
#define __JPILOT_H__
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#ifdef USE_JPILOT
-#include <stdio.h>
#include <glib.h>
-#include <pi-address.h>
+#include <stdio.h>
+
+#ifdef HAVE_LIBPISOCK_PI_ADDRESS_H
+# include <libpisock/pi-address.h>
+#else
+# include <pi-address.h>
+#endif
#include "addritem.h"
#include "addrcache.h"
static void mark_as_read_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
+static void mark_all_read_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
+static void add_address_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
static void set_charset_cb (MainWindow *mainwin,
guint action,
guint action,
GtkWidget *widget);
-static void next_unread_cb (MainWindow *mainwin,
+static void prev_unread_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-
-static void next_marked_cb (MainWindow *mainwin,
+static void next_unread_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-
static void prev_marked_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-
-static void next_labeled_cb (MainWindow *mainwin,
+static void next_marked_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-
-
static void prev_labeled_cb (MainWindow *mainwin,
guint action,
GtkWidget *widget);
-
+static void next_labeled_cb (MainWindow *mainwin,
+ guint action,
+ GtkWidget *widget);
static void goto_folder_cb (MainWindow *mainwin,
guint action,
{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/_Prev message"), NULL, prev_cb, 0, NULL},
- {N_("/_Summary/_Next message"), NULL, next_cb, 0, NULL},
- {N_("/_Summary/N_ext unread message"), NULL, next_unread_cb, 0, NULL},
- {N_("/_Summary/Prev marked message"), NULL, prev_marked_cb, 0, NULL},
- {N_("/_Summary/Next marked message"), NULL, next_marked_cb, 0, NULL},
- {N_("/_Summary/Prev labeled message"), NULL, prev_labeled_cb, 0, NULL},
- {N_("/_Summary/Next labeled message"), NULL, next_labeled_cb, 0, NULL},
- {N_("/_Summary/---"), NULL, NULL, 0, "<Separator>"},
- {N_("/_Summary/_Go to other folder"), "<alt>G", goto_folder_cb, 0, NULL},
+ {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 _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 sco_re"), NULL, sort_summary_cb, SORT_BY_SCORE, NULL},
- {N_("/_Summary/_Sort/Sort by _label"), NULL, sort_summary_cb, SORT_BY_LABEL, 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},
{"/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/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},
- {"/Message/Reply to all" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
- {"/Message/Forward" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
- {"/Message/Forward as attachment" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
- {"/Message/Open in new window" , 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/Reply" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+ {"/Message/Reply to sender" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+ {"/Message/Reply to all" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+ {"/Message/Forward" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
+ {"/Message/Forward as attachment", 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/Re-edit", M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
+ {"/Message/Add sender to address book", M_SINGLE_TARGET_EXIST},
{"/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/Prev message" , M_MSG_EXIST},
- {"/Summary/Next message" , M_MSG_EXIST},
- {"/Summary/Next unread message", M_MSG_EXIST},
- {"/Summary/Sort" , M_MSG_EXIST},
+ {"/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},
{"/Configuration", M_UNLOCKED},
summary_mark_as_read(mainwin->summaryview);
}
+static void mark_all_read_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_mark_all_read(mainwin->summaryview);
+}
+
+static void add_address_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_add_address(mainwin->summaryview);
+}
+
static void set_charset_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
summary_step(mainwin->summaryview, GTK_SCROLL_STEP_FORWARD);
}
-static void next_unread_cb(MainWindow *mainwin, guint action,
+static void prev_unread_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
- summary_select_next_unread(mainwin->summaryview);
+ summary_select_prev_unread(mainwin->summaryview);
}
-static void next_marked_cb(MainWindow *mainwin, guint action,
+static void next_unread_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
- summary_select_next_marked(mainwin->summaryview);
+ summary_select_next_unread(mainwin->summaryview);
}
static void prev_marked_cb(MainWindow *mainwin, guint action,
summary_select_prev_marked(mainwin->summaryview);
}
-static void next_labeled_cb(MainWindow *mainwin, guint action,
+static void next_marked_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
- summary_select_next_labeled(mainwin->summaryview);
+ summary_select_next_marked(mainwin->summaryview);
}
static void prev_labeled_cb(MainWindow *mainwin, guint action,
- GtkWidget *widget)
+ GtkWidget *widget)
{
summary_select_prev_labeled(mainwin->summaryview);
}
+static void next_labeled_cb(MainWindow *mainwin, guint action,
+ GtkWidget *widget)
+{
+ summary_select_next_labeled(mainwin->summaryview);
+}
+
static void goto_folder_cb(MainWindow *mainwin, guint action,
GtkWidget *widget)
{
void mgu_print_list( GSList *list, FILE *stream ) {
GSList *node = list;
while( node ) {
- fprintf( stream, "\t- >%s<\n", node->data );
+ fprintf( stream, "\t- >%s<\n", (gchar *)node->data );
node = g_slist_next( node );
}
}
void mgu_print_dlist( GList *list, FILE *stream ) {
GList *node = list;
while( node ) {
- fprintf( stream, "\t- >%s<\n", node->data );
+ fprintf( stream, "\t- >%s<\n", (gchar *)node->data );
node = g_list_next( node );
}
}
return;
}
- execute_command_line(buf);
+ execute_command_line(buf, TRUE);
}
#if USE_GPGME
/* XPM */
-static char * DIRECTORY_CLOSE_XPM[] = {
+static char * dir_close_xpm[] = {
"16 16 28 1",
" c None",
". c #000000",
-"+ c #8F98C4",
-"@ c #7277AB",
-"# c #757EB0",
-"$ c #606497",
-"% c #D1D5F6",
-"& c #BDC1E8",
-"* c #D6D8F7",
-"= c #9CA1DB",
-"- c #AFB2EC",
-"; c #B4BCE3",
-"> c #989FD1",
-", c #AAB2D3",
-"' c #9197C6",
-") c #8A92C3",
-"! c #7A7FB7",
-"~ c #606499",
-"{ c #C7CCF0",
-"] c #595A88",
-"^ c #52537B",
-"/ c #7E87B9",
-"( c #6C72A9",
-"_ c #898FC0",
-": c #6B6EA6",
-"< c #4B4D6E",
-"[ c #AFB8DC",
-"} c #3D3F60",
+"+ c #A1ACDA",
+"@ c #7C83C1",
+"# c #808CC7",
+"$ c #656AAB",
+"% c #E5E9FD",
+"& c #D4D7F6",
+"* c #E9EBFD",
+"= c #B1B6ED",
+"- c #C6C9F8",
+"; c #CBD3F3",
+"> c #ACB4E5",
+", c #C0C9E7",
+"' c #A4ABDC",
+") c #9BA5D9",
+"! c #878DCE",
+"~ c #656AAD",
+"{ c #DDE1FA",
+"] c #5C5D99",
+"^ c #545588",
+"/ c #8C97D0",
+"( c #747CBF",
+"_ c #9AA1D7",
+": c #7377BC",
+"< c #4C4E77",
+"[ c #C6CFEE",
+"} c #3C3E65",
" ",
" ",
" .... ",
/* XPM */
-static char * DIRECTORY_OPEN_XPM[] = {
-"16 16 34 1",
+static char * dir_open_xpm[] = {
+"16 16 33 1",
" c None",
". c #000000",
-"+ c #8F98C4",
-"@ c #7277AB",
-"# c #757EB0",
-"$ c #606497",
-"% c #7F83C2",
-"& c #686CA3",
-"* c #797FB2",
-"= c #666BA1",
-"- c #5D6194",
-"; c #505173",
-"> c #434562",
-", c #232436",
-"' c #606499",
-") c #BAC0E7",
-"! c #C1C7EC",
-"~ c #ABB3D8",
-"{ c #3B3C58",
-"] c #484969",
-"^ c #C7CCF0",
-"/ c #A2ACCD",
-"( c #7F87AE",
-"_ c #9FA9C6",
-": c #3F4160",
-"< c #B3B7EC",
-"[ c #5B6080",
-"} c #252544",
-"| c #787FB1",
-"1 c #393A58",
-"2 c #B5BDE4",
-"3 c #50526D",
-"4 c #8E94CD",
-"5 c #666D97",
+"+ c #A7B2DF",
+"@ c #7F86C7",
+"# c #8390CD",
+"$ c #666BB1",
+"% c #9297DE",
+"& c #7177BF",
+"* c #8992CF",
+"= c #6E75BC",
+"- c #6267AD",
+"; c #515381",
+"> c #424469",
+", c #222334",
+"' c #666BB3",
+") c #D6DCF8",
+"! c #DDE2FA",
+"~ c #C7D0EF",
+"{ c #393A5B",
+"] c #484972",
+"^ c #E2E6FC",
+"/ c #BEC8E7",
+"( c #929CCB",
+"_ c #BAC5E1",
+": c #3E4066",
+"< c #D0D4FA",
+"[ c #5F6693",
+"} c #8892CE",
+"| c #37385B",
+"1 c #D2D9F6",
+"2 c #515478",
+"3 c #A5ADE7",
+"4 c #6E78B1",
" ",
" ",
" .... ",
".)!~!~!~!~!~.{].",
".^/(_(_(_(_(.{:.",
" .<_(_(_(_(_[.:.",
-" }!|_(_(_(_(_.1.",
-" }2(_(_(_(_(3..",
-" .4(5(5(5(5(5..",
+" .!}_(_(_(_(_.|.",
+" .1(_(_(_(_(2..",
+" .3(4(4(4(4(4..",
" ............ ",
" ",
" "};
/* XPM */
static char * new_xpm[] = {
-"13 10 63 1",
+"13 10 49 1",
" c None",
-". c #360000",
-"+ c #430000",
-"@ c #370000",
-"# c #FF0000",
-"$ c #FFC7C4",
-"% c #FFC7C5",
-"& c #FFC7C3",
-"* c #FFC6C1",
-"= c #FFC6C2",
-"- c #FFC6C3",
-"; c #FFC5C1",
-"> c #BA0000",
-", c #FFC6C0",
-"' c #FFC1B7",
-") c #FFC2BA",
-"! c #FFC4BE",
-"~ c #FF7163",
-"{ c #FFAC9F",
-"] c #FFC7C0",
-"^ c #FFC5BB",
-"/ c #FFC4B7",
-"( c #FFC5BC",
-"_ c #FFC4BA",
-": c #FFADA2",
-"< c #FF5846",
-"[ c #FFC7C6",
-"} c #FFC6BF",
-"| c #FFC7C2",
-"1 c #FFC6BB",
-"2 c #FFB7A9",
-"3 c #FFAEA1",
-"4 c #3B0000",
-"5 c #FFC0B8",
-"6 c #FFB8A7",
-"7 c #FFC6B9",
-"8 c #FFC3B7",
-"9 c #FFBFB4",
-"0 c #FF6A56",
-"a c #FFC6BE",
-"b c #FFC5B7",
-"c c #FFC4B5",
-"d c #FFBFAD",
-"e c #FF8973",
-"f c #FF4C36",
-"g c #FFC2B9",
-"h c #FFC5BA",
-"i c #FFBCAA",
-"j c #FFC2B4",
-"k c #FFC0B3",
-"l c #FF684E",
-"m c #C70000",
-"n c #FFAA9E",
-"o c #FF503D",
-"p c #FF4F39",
-"q c #FF3B21",
-"r c #FF6E54",
-"s c #FF684B",
-"t c #FF9078",
-"u c #FF7E66",
-"v c #FF543B",
-"w c #FF8675",
-"x c #8E0000",
-" .+...@..... ",
-".#$%&*=$$-;>.",
-".-#*,%'*)!#~.",
-"@={#]^/(_#:<.",
-".[=}#|1]#23:.",
-"45&6##7##890.",
-".$'#ab#cd#ef@",
-".-#g^hijklmn.",
-".#opqrstuvwx.",
-" ...@......@ "};
+". c #000000",
+"+ c #D52828",
+"@ c #F5CECD",
+"# c #F5CFCE",
+"$ c #F4CECB",
+"% c #F4CDCB",
+"& c #9C1D1D",
+"* c #F4CDC9",
+"= c #F3C8C2",
+"- c #F3C8C4",
+"; c #F4CAC7",
+"> c #E5837C",
+", c #EFB6AE",
+"' c #F3CCC6",
+") c #F3CAC2",
+"! c #F3CBC6",
+"~ c #F3CBC4",
+"{ c #EFB7B0",
+"] c #E06F63",
+"^ c #F5CECE",
+"/ c #F0BFB7",
+"( c #F3C7C2",
+"_ c #F0C0B5",
+": c #F3CCC4",
+"< c #F2C6BF",
+"[ c #E37E70",
+"} c #F4CDC7",
+"| c #F3CBC2",
+"1 c #F2CAC1",
+"2 c #F1C6BA",
+"3 c #E89789",
+"4 c #DE6255",
+"5 c #F3CAC4",
+"6 c #F0C3B7",
+"7 c #F2C7BF",
+"8 c #E27A69",
+"9 c #A61F1F",
+"0 c #EEB4AD",
+"a c #DF685C",
+"b c #DE6559",
+"c c #DA5345",
+"d c #E37F6E",
+"e c #E17968",
+"f c #E89C8D",
+"g c #E58C7E",
+"h c #DF6A5A",
+"i c #E8968B",
+"j c #771616",
+" ........... ",
+".+@#@$%@@@%&.",
+".@+$*#=$-;+>.",
+".%,+*')!~+{].",
+".^%*+$'*+/{{.",
+".(@_++:++)<[.",
+".@=+}|+12+34.",
+".@+5'~677890.",
+".+abcdefghij.",
+" ........... "};
/* XPM */
-static char *trash_xpm[] = {
+static char * trash_xpm[] = {
"16 16 10 1",
" c None",
". c #000000",
-"+ c #191B2E",
-"@ c #93A6D8",
-"# c #7386BC",
-"$ c #3B4762",
-"% c #272A42",
-"& c #5A679D",
-"* c #C1CDF4",
-"= c #515E74",
+"+ c #A1B7E7",
+"@ c #7B92CE",
+"# c #3B4766",
+"$ c #272A42",
+"% c #1B1C2E",
+"& c #5D6CAD",
+"* c #D2DEFB",
+"= c #52617C",
" ",
" ...... ",
-" +.@@#$##.. ",
-".#@@@%+###&. ",
-".&@**####&=. ",
-".=&##&&==$$. ",
-" .+&==$$%+. ",
-" .=++++++=. ",
-" .=@$#$&$=.... ",
-" .=@$#$&$=..... ",
-" .=@$#$&$=..... ",
-" .&@$#$&$=.... ",
+" ..++@#@@.. ",
+".@+++$%@@@&. ",
+".&+**@@@@&=. ",
+".=&@@&&==##. ",
+" .%&==##$%. ",
+" .=%%%%%%=. ",
+" .=+#@#&#=.... ",
+" .=+#@#&#=..... ",
+" .=+#@#&#=..... ",
+" .&+#@#&#=.... ",
" .&&&=&=... ",
" ....... ",
" ",
/* XPM */
static char * unread_xpm[] = {
-"13 10 46 1",
+"13 10 38 1",
" c None",
-". c #000036",
-"+ c #000040",
-"@ c #0000FF",
-"# c #C6C7FF",
-"$ c #C7C7FF",
-"% c #C6C6FF",
-"& c #C7C6FF",
-"* c #C6C5FF",
-"= c #0000AF",
-"- c #C3C1FF",
-"; c #C3C2FF",
-"> c #C6C4FF",
-", c #7371FF",
-"' c #AEACFF",
-") c #C7C5FF",
-"! c #B1ADFF",
-"~ c #5E58FF",
-"{ c #0000DA",
-"] c #BBB7FF",
-"^ c #B2AEFF",
-"/ c #000038",
-"( c #C3C0FF",
-"_ c #BBB8FF",
-": c #0000E3",
-"< c #0000F9",
-"[ c #C6C3FF",
-"} c #C3BFFF",
-"| c #766AFF",
-"1 c #C7C4FF",
-"2 c #9289FF",
-"3 c #5A4CFF",
-"4 c #C0BCFF",
-"5 c #C6C2FF",
-"6 c #7368FF",
-"7 c #0000AD",
-"8 c #AEAAFF",
-"9 c #5250FF",
-"0 c #524FFF",
-"a c #413BFF",
-"b c #766EFF",
-"c c #9890FF",
-"d c #857EFF",
-"e c #5D54FF",
-"f c #8C86FF",
-"g c #00007E",
-" .+......... ",
-".@#$$%&$$%*=.",
-".%@&&$-&;>@,.",
-".%'@$*>)>@!~.",
-".$&&@$&${]^!.",
-"/($_@:&<@[}|.",
-".$-@&)@1}@23.",
-".&@;*)45(678.",
-".@90ab6cdefg.",
+". c #000000",
+"+ c #2828D5",
+"@ c #CECFF5",
+"# c #D0D0F5",
+"$ c #CECEF5",
+"% c #1B1B92",
+"& c #CCCBF4",
+"* c #CBCBF4",
+"= c #CDCDF5",
+"- c #8888E7",
+"; c #BAB8F1",
+"> c #CFCEF5",
+", c #BDBAF1",
+"' c #7572E3",
+") c #2222B7",
+"! c #C5C2F3",
+"~ c #CBC9F4",
+"{ c #C3C2F3",
+"] c #2323BE",
+"^ c #2727D0",
+"/ c #CECDF5",
+"( c #8881E6",
+"_ c #A29CEB",
+": c #7068E1",
+"< c #C8C6F3",
+"[ c #CDCBF4",
+"} c #867FE6",
+"| c #1B1B90",
+"1 c #B9B7F0",
+"2 c #6B6BE2",
+"3 c #5E5ADF",
+"4 c #8984E7",
+"5 c #A6A1EC",
+"6 c #9692E9",
+"7 c #746EE3",
+"8 c #9C99EA",
+"9 c #141469",
+" ........... ",
+".+@##$$##$$%.",
+".$+$$#&$*=+-.",
+".$;+#$=>=+,'.",
+".#$$+#$#)!,,.",
+".~#{+]$^+/~(.",
+".#&+$>+/~+_:.",
+".$+*$><[~}|1.",
+".+2234}56789.",
" ........... "};
#include "account.h"
-#define VSPACING 12
+#define VSPACING 10
#define VSPACING_NARROW 4
#define VSPACING_NARROW_2 2
#define VBOX_BORDER 16
GtkWidget *entry_fw_quotemark;
GtkWidget *text_fw_quotefmt;
+ GtkWidget *checkbtn_autoextedit;
GtkWidget *checkbtn_reply_account_autosel;
GtkWidget *checkbtn_forward_account_autosel;
GtkWidget *checkbtn_reedit_account_autosel;
{"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
&receive.checkbtn_incext,
prefs_set_data_from_toggle, prefs_set_toggle},
- {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_path, P_STRING,
+ {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING,
&receive.entry_incext,
prefs_set_data_from_entry, prefs_set_entry},
{"signature_separator", "-- ", &prefs_common.sig_sep, P_STRING,
&compose.entry_sigsep, prefs_set_data_from_entry, prefs_set_entry},
+ {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
+ &compose.checkbtn_autoextedit,
+ prefs_set_data_from_toggle, prefs_set_toggle},
{"reply_account_autoselect", "TRUE",
&prefs_common.reply_account_autosel, P_BOOL,
&compose.checkbtn_reply_account_autosel,
static void prefs_compose_create(void)
{
GtkWidget *vbox1;
+ GtkWidget *vbox2;
+ GtkWidget *vbox3;
/*
GtkWidget *frame_quote;
GtkWidget *checkbtn_forward_account_autosel;
GtkWidget *checkbtn_reedit_account_autosel;
+ GtkWidget *checkbtn_autoextedit;
+
GtkWidget *vbox_linewrap;
GtkWidget *hbox3;
gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
- PACK_CHECK_BUTTON (vbox_quote, checkbtn_quote,
- _("Quote message when replying"));
-
- hbox1 = gtk_hbox_new (FALSE, 8);
+ hbox1 = gtk_hbox_new (FALSE, 32);
gtk_widget_show (hbox1);
- gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
+
+ hbox2 = gtk_hbox_new (FALSE, 8);
+ gtk_widget_show (hbox2);
+ gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
label_quotemark = gtk_label_new (_("Quotation mark"));
gtk_widget_show (label_quotemark);
- gtk_box_pack_start (GTK_BOX (hbox1), label_quotemark, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
entry_quotemark = gtk_entry_new ();
gtk_widget_show (entry_quotemark);
- gtk_box_pack_start (GTK_BOX (hbox1), entry_quotemark, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox2), entry_quotemark, FALSE, FALSE, 0);
gtk_widget_set_usize (entry_quotemark, 64, -1);
+ PACK_CHECK_BUTTON (hbox1, checkbtn_quote,
+ _("Quote message when replying"));
+
hbox2 = gtk_hbox_new (FALSE, 0);
gtk_widget_show (hbox2);
gtk_box_pack_start (GTK_BOX (vbox_quote), hbox2, TRUE, TRUE, 0);
PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
_("when re-editing"));
- /* line-wrapping */
+ vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox2);
+ gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
+
+ PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
+ _("Automatically launch the external editor"));
+
+ PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
+
+ /* line-wrapping */
vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
gtk_widget_show (vbox_linewrap);
gtk_box_pack_start (GTK_BOX (vbox1), vbox_linewrap, FALSE, FALSE, 0);
gtk_widget_show (label_linewrap);
gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
+ PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
+
hbox4 = gtk_hbox_new (FALSE, 32);
gtk_widget_show (hbox4);
gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
compose.checkbtn_autosig = checkbtn_autosig;
compose.entry_sigsep = entry_sigsep;
+ compose.checkbtn_autoextedit = checkbtn_autoextedit;
compose.checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
compose.checkbtn_reedit_account_autosel = checkbtn_reedit_account_autosel;
gtk_box_pack_start (GTK_BOX (hbox1), exteditor_combo, TRUE, TRUE, 0);
gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
"gedit %s",
+ "kedit %s",
"mgedit --no-fork %s",
"emacs %s",
"xemacs %s",
{
/* Receive */
gboolean use_extinc;
- gchar *extinc_path;
+ gchar *extinc_cmd;
gboolean inc_local;
gboolean filter_on_inc;
gchar *spool_path;
gint linewrap_len;
gboolean linewrap_quote;
gboolean linewrap_at_send;
+ gboolean auto_exteditor;
gboolean reply_account_autosel;
gboolean forward_account_autosel;
gboolean reedit_account_autosel;
GtkWidget *customhdr_clist;
} customhdr;
-#define VSPACING 12
-#define VSPACING_NARROW 4
-#define DEFAULT_ENTRY_WIDTH 80
-#define PREFSBUFSIZE 1024
-
/* widget creating functions */
static void prefs_custom_header_create (void);
GtkWidget *other_headers;
} dispheader;
-/*
- parameter name, default value, pointer to the prefs variable, data type,
- pointer to the widget pointer,
- pointer to the function for data setting,
- pointer to the function for widget setting
- */
-
-#define VSPACING 12
-#define VSPACING_NARROW 4
-#define DEFAULT_ENTRY_WIDTH 80
-#define PREFSBUFSIZE 1024
-
/* widget creating functions */
static void prefs_display_header_create (void);
pointer to the function for widget setting
*/
-#define VSPACING 12
-#define VSPACING_NARROW 4
-#define DEFAULT_ENTRY_WIDTH 80
-#define PREFSBUFSIZE 1024
-
/* widget creating functions */
static void prefs_filter_create (void);
gint current_action;
} filtering;
-#define VSPACING 12
-#define VSPACING_NARROW 4
-#define DEFAULT_ENTRY_WIDTH 80
-#define PREFSBUFSIZE 1024
-
/* widget creating functions */
static void prefs_filtering_create (void);
static guint summary_get_msgnum (SummaryView *summaryview,
GtkCTreeNode *node);
-static GtkCTreeNode *summary_find_next_unread_msg
+static GtkCTreeNode *summary_find_prev_unread_msg
(SummaryView *summaryview,
GtkCTreeNode *current_node);
-static GtkCTreeNode *summary_find_next_marked_msg
+static GtkCTreeNode *summary_find_next_unread_msg
(SummaryView *summaryview,
GtkCTreeNode *current_node);
static GtkCTreeNode *summary_find_prev_marked_msg
(SummaryView *summaryview,
GtkCTreeNode *current_node);
-static GtkCTreeNode *summary_find_next_labeled_msg
+static GtkCTreeNode *summary_find_next_marked_msg
(SummaryView *summaryview,
GtkCTreeNode *current_node);
static GtkCTreeNode *summary_find_prev_labeled_msg
(SummaryView *summaryview,
GtkCTreeNode *current_node);
+static GtkCTreeNode *summary_find_next_labeled_msg
+ (SummaryView *summaryview,
+ GtkCTreeNode *current_node);
static GtkCTreeNode *summary_find_msg_by_msgnum
(SummaryView *summaryview,
guint msgnum);
-#if 0
-static GtkCTreeNode *summary_find_prev_unread_msg
- (SummaryView *summaryview,
- GtkCTreeNode *current_node);
-#endif
static void summary_update_status (SummaryView *summaryview);
guint action,
GtkWidget *widget);
+static void summary_add_address_cb (SummaryView *summaryview,
+ guint action,
+ GtkWidget *widget);
+
+static void summary_mark_clicked (GtkWidget *button,
+ SummaryView *summaryview);
+static void summary_unread_clicked (GtkWidget *button,
+ SummaryView *summaryview);
+static void summary_mime_clicked (GtkWidget *button,
+ SummaryView *summaryview);
static void summary_num_clicked (GtkWidget *button,
SummaryView *summaryview);
static void summary_score_clicked (GtkWidget *button,
SummaryView *summaryview);
static void summary_subject_clicked (GtkWidget *button,
SummaryView *summaryview);
-static void summary_mark_clicked (GtkWidget *button,
- SummaryView *summaryview);
static void summary_start_drag (GtkWidget *widget,
int button,
guint time,
SummaryView *summaryview);
-static void summary_add_address_cb (SummaryView *summaryview,
- guint action,
- GtkWidget *widget);
-
/* custom compare functions for sorting */
+static gint summary_cmp_by_mark (GtkCList *clist,
+ gconstpointer ptr1,
+ gconstpointer ptr2);
+static gint summary_cmp_by_unread (GtkCList *clist,
+ gconstpointer ptr1,
+ gconstpointer ptr2);
+static gint summary_cmp_by_mime (GtkCList *clist,
+ gconstpointer ptr1,
+ gconstpointer ptr2);
static gint summary_cmp_by_num (GtkCList *clist,
gconstpointer ptr1,
gconstpointer ptr2);
{N_("/_Mark/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Mark/Mark as unr_ead"), NULL, summary_mark_as_unread, 0, NULL},
{N_("/_Mark/Mark as rea_d"), NULL, summary_mark_as_read, 0, NULL},
-#if MARK_ALL_READ
{N_("/_Mark/Mark all read"), NULL, summary_mark_all_read, 0, NULL},
-#endif
{N_("/_Mark/Ignore thread"), NULL, summary_ignore_thread, 0, NULL},
{N_("/_Mark/Unignore thread"), NULL, summary_unignore_thread, 0, NULL},
{N_("/Color la_bel"), NULL, NULL, 0, NULL},
GTK_CAN_FOCUS);
/* connect signal to the buttons for sorting */
- gtk_signal_connect
- (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_NUMBER].button),
- "clicked",
- GTK_SIGNAL_FUNC(summary_num_clicked),
- summaryview);
- gtk_signal_connect
- (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_SCORE].button),
- "clicked",
- GTK_SIGNAL_FUNC(summary_score_clicked),
- summaryview);
- gtk_signal_connect
- (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_SIZE].button),
- "clicked",
- GTK_SIGNAL_FUNC(summary_size_clicked),
- summaryview);
- gtk_signal_connect
- (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_DATE].button),
- "clicked",
- GTK_SIGNAL_FUNC(summary_date_clicked),
- summaryview);
- gtk_signal_connect
- (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_FROM].button),
- "clicked",
- GTK_SIGNAL_FUNC(summary_from_clicked),
- summaryview);
- gtk_signal_connect
- (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_SUBJECT].button),
- "clicked",
- GTK_SIGNAL_FUNC(summary_subject_clicked),
- summaryview);
- gtk_signal_connect
- (GTK_OBJECT(GTK_CLIST(ctree)->column[S_COL_MARK].button),
- "clicked",
- GTK_SIGNAL_FUNC(summary_mark_clicked),
- summaryview);
+#define CLIST_BUTTON_SIGNAL_CONNECT(col, func) \
+ gtk_signal_connect \
+ (GTK_OBJECT(GTK_CLIST(ctree)->column[col].button), \
+ "clicked", \
+ GTK_SIGNAL_FUNC(func), \
+ summaryview)
+
+ CLIST_BUTTON_SIGNAL_CONNECT(S_COL_MARK , summary_mark_clicked);
+ CLIST_BUTTON_SIGNAL_CONNECT(S_COL_UNREAD , summary_unread_clicked);
+ CLIST_BUTTON_SIGNAL_CONNECT(S_COL_MIME , summary_mime_clicked);
+ CLIST_BUTTON_SIGNAL_CONNECT(S_COL_NUMBER , summary_num_clicked);
+ CLIST_BUTTON_SIGNAL_CONNECT(S_COL_SCORE , summary_score_clicked);
+ CLIST_BUTTON_SIGNAL_CONNECT(S_COL_SIZE , summary_size_clicked);
+ CLIST_BUTTON_SIGNAL_CONNECT(S_COL_DATE , summary_date_clicked);
+ CLIST_BUTTON_SIGNAL_CONNECT(S_COL_FROM , summary_from_clicked);
+ CLIST_BUTTON_SIGNAL_CONNECT(S_COL_SUBJECT, summary_subject_clicked);
+
+#undef CLIST_BUTTON_SIGNAL_CONNECT
/* create status label */
hbox = gtk_hbox_new(FALSE, 0);
ignorethread_xpm);
PIXMAP_CREATE(summaryview->ctree, clipxpm, clipxpmmask, clip_xpm);
PIXMAP_CREATE(summaryview->hbox, folderxpm, folderxpmmask,
- DIRECTORY_OPEN_XPM);
+ dir_open_xpm);
pixmap = gtk_pixmap_new(clipxpm, clipxpmmask);
gtk_clist_set_column_widget(GTK_CLIST(summaryview->ctree),
menu_set_sensitive(ifactory, "/Mark/Mark as unread", TRUE);
menu_set_sensitive(ifactory, "/Mark/Mark as read", TRUE);
-#if MARK_ALL_READ
menu_set_sensitive(ifactory, "/Mark/Mark all read", TRUE);
-#endif
menu_set_sensitive(ifactory, "/Mark/Ignore thread", TRUE);
menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);
menu_set_sensitive(ifactory, "/Forward as attachment", TRUE);
menu_set_sensitive(ifactory, "/Add sender to address book", sens);
-
+
menu_set_sensitive(ifactory, "/Open in new window", sens);
menu_set_sensitive(ifactory, "/View source", sens);
menu_set_sensitive(ifactory, "/Show all header", sens);
menu_set_sensitive(ifactory, "/Follow-up and reply to", sens);
}
-#if 0
-static void summary_set_add_sender_menu(SummaryView *summaryview)
+void summary_select_prev_unread(SummaryView *summaryview)
{
- GtkWidget *menu;
- GtkWidget *submenu;
- MsgInfo *msginfo;
- gchar *from;
+ GtkCTreeNode *node;
+ GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
- menu = gtk_item_factory_get_item(summaryview->popupfactory,
- "/Add sender to address book");
- msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
- summaryview->selected);
- if (!msginfo || !msginfo->from) {
- gtk_widget_set_sensitive(menu, FALSE);
- submenu = gtk_menu_new();
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu), submenu);
- return;
+ node = summary_find_prev_unread_msg(summaryview, summaryview->selected);
+
+ if (!node) {
+ AlertValue val;
+
+ val = alertpanel(_("No more unread messages"),
+ _("No unread message found. "
+ "Search from the end?"),
+ _("Yes"), _("No"), NULL);
+ if (val != G_ALERTDEFAULT) return;
+ node = summary_find_prev_unread_msg(summaryview, NULL);
}
- gtk_widget_set_sensitive(menu, TRUE);
- Xstrdup_a(from, msginfo->from, return);
- eliminate_address_comment(from);
- extract_address(from);
- addressbook_add_submenu(menu, msginfo->fromname, from, NULL);
+ if (!node) {
+ alertpanel_notice(_("No unread messages."));
+ } else {
+ gtkut_ctree_expand_parent_all(ctree, node);
+ gtk_sctree_unselect_all(GTK_SCTREE(ctree));
+ gtk_sctree_select(GTK_SCTREE(ctree), node);
+ if (summaryview->displayed == node)
+ summaryview->displayed = NULL;
+ summary_display_msg(summaryview, node, FALSE);
+ }
}
-#endif
void summary_select_next_unread(SummaryView *summaryview)
{
GtkCTreeNode *node;
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
- node = summary_find_next_unread_msg(summaryview,
- summaryview->selected);
+ node = summary_find_next_unread_msg(summaryview, summaryview->selected);
if (node) {
gtkut_ctree_expand_parent_all(ctree, node);
gtk_sctree_unselect_all(GTK_SCTREE(ctree));
gtk_sctree_select(GTK_SCTREE(ctree), node);
-
- /* BUGFIX: select next unread message
- * REVERT: causes incorrect folder stats
- * gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0.0);
- */
-
if (summaryview->displayed == node)
summaryview->displayed = NULL;
summary_display_msg(summaryview, node, FALSE);
} else {
AlertValue val;
- val = alertpanel(_("No unread message"),
- _("No unread message found. Go to next folder?"),
+ val = alertpanel(_("No more unread messages"),
+ _("No unread message found. "
+ "Go to next folder?"),
_("Yes"), _("No"), NULL);
if (val == G_ALERTDEFAULT) {
if (gtk_signal_n_emissions_by_name
}
}
-void summary_select_next_marked(SummaryView *summaryview)
+void summary_select_prev_marked(SummaryView *summaryview)
{
GtkCTreeNode *node;
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
- node = summary_find_next_marked_msg(summaryview,
- summaryview->selected);
+ node = summary_find_prev_marked_msg(summaryview, summaryview->selected);
if (!node) {
AlertValue val;
val = alertpanel(_("No more marked messages"),
_("No marked message found. "
- "Search from the beginning?"),
+ "Search from the end?"),
_("Yes"), _("No"), NULL);
if (val != G_ALERTDEFAULT) return;
- node = summary_find_next_marked_msg(summaryview,
- NULL);
+ node = summary_find_prev_marked_msg(summaryview, NULL);
}
+
if (!node) {
alertpanel_notice(_("No marked messages."));
} else {
+ gtkut_ctree_expand_parent_all(ctree, node);
gtk_sctree_unselect_all(GTK_SCTREE(ctree));
gtk_sctree_select(GTK_SCTREE(ctree), node);
if (summaryview->displayed == node)
}
}
-void summary_select_prev_marked(SummaryView *summaryview)
+void summary_select_next_marked(SummaryView *summaryview)
{
GtkCTreeNode *node;
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
- node = summary_find_prev_marked_msg(summaryview,
- summaryview->selected);
+ node = summary_find_next_marked_msg(summaryview, summaryview->selected);
if (!node) {
AlertValue val;
val = alertpanel(_("No more marked messages"),
_("No marked message found. "
- "Search from the end?"),
+ "Search from the beginning?"),
_("Yes"), _("No"), NULL);
if (val != G_ALERTDEFAULT) return;
- node = summary_find_prev_marked_msg(summaryview,
- NULL);
+ node = summary_find_next_marked_msg(summaryview, NULL);
}
+
if (!node) {
alertpanel_notice(_("No marked messages."));
} else {
+ gtkut_ctree_expand_parent_all(ctree, node);
gtk_sctree_unselect_all(GTK_SCTREE(ctree));
gtk_sctree_select(GTK_SCTREE(ctree), node);
if (summaryview->displayed == node)
}
}
-void summary_select_next_labeled(SummaryView *summaryview)
+void summary_select_prev_labeled(SummaryView *summaryview)
{
GtkCTreeNode *node;
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
- node = summary_find_next_labeled_msg(summaryview,
- summaryview->selected);
+ node = summary_find_prev_labeled_msg(summaryview, summaryview->selected);
if (!node) {
AlertValue val;
val = alertpanel(_("No more labeled messages"),
_("No labeled message found. "
- "Search from the beginning?"),
+ "Search from the end?"),
_("Yes"), _("No"), NULL);
if (val != G_ALERTDEFAULT) return;
- node = summary_find_next_labeled_msg(summaryview,
- NULL);
+ node = summary_find_prev_labeled_msg(summaryview, NULL);
}
+
if (!node) {
alertpanel_notice(_("No labeled messages."));
} else {
+ gtkut_ctree_expand_parent_all(ctree, node);
gtk_sctree_unselect_all(GTK_SCTREE(ctree));
gtk_sctree_select(GTK_SCTREE(ctree), node);
if (summaryview->displayed == node)
}
}
-void summary_select_prev_labeled(SummaryView *summaryview)
+void summary_select_next_labeled(SummaryView *summaryview)
{
GtkCTreeNode *node;
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
- node = summary_find_prev_labeled_msg(summaryview,
- summaryview->selected);
+ node = summary_find_next_labeled_msg(summaryview, summaryview->selected);
if (!node) {
AlertValue val;
val = alertpanel(_("No more labeled messages"),
_("No labeled message found. "
- "Search from the end?"),
+ "Search from the beginning?"),
_("Yes"), _("No"), NULL);
if (val != G_ALERTDEFAULT) return;
- node = summary_find_prev_labeled_msg(summaryview,
- NULL);
+ node = summary_find_next_labeled_msg(summaryview, NULL);
}
+
if (!node) {
alertpanel_notice(_("No labeled messages."));
} else {
+ gtkut_ctree_expand_parent_all(ctree, node);
gtk_sctree_unselect_all(GTK_SCTREE(ctree));
gtk_sctree_select(GTK_SCTREE(ctree), node);
if (summaryview->displayed == node)
return msginfo->msgnum;
}
-static GtkCTreeNode *summary_find_next_unread_msg(SummaryView *summaryview,
+static GtkCTreeNode *summary_find_prev_unread_msg(SummaryView *summaryview,
GtkCTreeNode *current_node)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
if (current_node)
node = current_node;
else
- node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
+ node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list_end);
- for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
+ for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) break;
+ if (MSG_IS_UNREAD(msginfo->flags)) break;
}
return node;
}
-static GtkCTreeNode *summary_find_next_marked_msg(SummaryView *summaryview,
+static GtkCTreeNode *summary_find_next_unread_msg(SummaryView *summaryview,
GtkCTreeNode *current_node)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
MsgInfo *msginfo;
if (current_node)
- node = GTK_CTREE_NODE_NEXT(current_node);
+ node = current_node;
else
node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
- for (; node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+ for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (MSG_IS_MARKED(msginfo->flags)) break;
+ if (MSG_IS_UNREAD(msginfo->flags)) break;
}
return node;
return node;
}
-static GtkCTreeNode *summary_find_next_labeled_msg(SummaryView *summaryview,
+static GtkCTreeNode *summary_find_next_marked_msg(SummaryView *summaryview,
GtkCTreeNode *current_node)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
MsgInfo *msginfo;
if (current_node)
- node = GTK_CTREE_NODE_NEXT(current_node);
+ node = gtkut_ctree_node_next(ctree, current_node);
else
node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
- for (; node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+ for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (MSG_GET_COLORLABEL_VALUE(msginfo->flags) > 0) break;
+ if (MSG_IS_MARKED(msginfo->flags)) break;
}
return node;
}
static GtkCTreeNode *summary_find_prev_labeled_msg(SummaryView *summaryview,
- GtkCTreeNode *current_node)
+ GtkCTreeNode *current_node)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
GtkCTreeNode *node;
for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (MSG_GET_COLORLABEL_VALUE(msginfo->flags) > 0) break;
+ if (MSG_GET_COLORLABEL_VALUE(msginfo->flags) > 0) break;
}
return node;
}
-static GtkCTreeNode *summary_find_msg_by_msgnum(SummaryView *summaryview,
- guint msgnum)
+static GtkCTreeNode *summary_find_next_labeled_msg(SummaryView *summaryview,
+ GtkCTreeNode *current_node)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
GtkCTreeNode *node;
MsgInfo *msginfo;
- node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
+ if (current_node)
+ node = gtkut_ctree_node_next(ctree, current_node);
+ else
+ node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (msginfo->msgnum == msgnum) break;
+ if (MSG_GET_COLORLABEL_VALUE(msginfo->flags) > 0) break;
}
return node;
}
-#if 0
-static GtkCTreeNode *summary_find_prev_unread_msg(SummaryView *summaryview,
- GtkCTreeNode *current_node)
+static GtkCTreeNode *summary_find_msg_by_msgnum(SummaryView *summaryview,
+ guint msgnum)
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
GtkCTreeNode *node;
MsgInfo *msginfo;
- if (current_node)
- node = current_node;
- /*node = GTK_CTREE_NODE_PREV(current_node);*/
- else
- node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list_end);
+ node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
- for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) {
+ for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
- if (MSG_IS_UNREAD(msginfo->flags)) break;
+ if (msginfo->msgnum == msgnum) break;
}
return node;
}
-#endif
static guint attract_hash_func(gconstpointer key)
{
return;
switch (type) {
+ case SORT_BY_MARK:
+ cmp_func = (GtkCListCompareFunc)summary_cmp_by_mark;
+ break;
+ case SORT_BY_UNREAD:
+ cmp_func = (GtkCListCompareFunc)summary_cmp_by_unread;
+ break;
+ case SORT_BY_MIME:
+ cmp_func = (GtkCListCompareFunc)summary_cmp_by_mime;
+ break;
case SORT_BY_NUMBER:
cmp_func = (GtkCListCompareFunc)summary_cmp_by_num;
break;
summary_status_show(summaryview);
}
-#if MARK_ALL_READ
-static void summary_mark_all_read(SummaryView *summaryview)
+void summary_mark_all_read(SummaryView *summaryview)
{
- summary_select_all(summaryview);
- summary_mark_as_read(summaryview);
- summary_unselect_all(summaryview);
+ GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
+ GtkCList *clist = GTK_CLIST(summaryview->ctree);
+ GtkCTreeNode *node;
+
+ gtk_clist_freeze(clist);
+ for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list); node != NULL;
+ node = gtkut_ctree_node_next(ctree, node))
+ summary_mark_row_as_read(summaryview, node);
+ for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list); node != NULL;
+ node = gtkut_ctree_node_next(ctree, node)) {
+ if (!GTK_CTREE_ROW(node)->expanded)
+ summary_set_row_marks(summaryview, node);
+ }
+ gtk_clist_thaw(clist);
+
+ summary_status_show(summaryview);
}
-#endif
static void summary_mark_row_as_unread(SummaryView *summaryview,
GtkCTreeNode *row)
MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_REPLIED | MSG_FORWARDED);
if (!MSG_IS_UNREAD(msginfo->flags)) {
MSG_SET_PERM_FLAGS(msginfo->flags, MSG_UNREAD);
- gtk_ctree_node_set_pixmap(ctree, row, S_COL_UNREAD,
- unreadxpm, unreadxpmmask);
summaryview->unread++;
debug_print(_("Message %d is marked as unread\n"),
msginfo->msgnum);
summary_copy_selected_to(summaryview, to_folder);
}
+void summary_add_address(SummaryView *summaryview)
+{
+ MsgInfo *msginfo;
+ gchar *from;
+
+ msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
+ summaryview->selected);
+ if (!msginfo) return;
+
+ Xstrdup_a(from, msginfo->from, return);
+ eliminate_address_comment(from);
+ extract_address(from);
+ addressbook_add_contact(msginfo->fromname, from, NULL);
+}
+
void summary_select_all(SummaryView *summaryview)
{
if (summaryview->messages >= 500) {
summaryview->selected);
if (!msginfo) return;
- switch ((ComposeReplyMode)action) {
+ switch ((ComposeMode)action) {
case COMPOSE_REPLY:
compose_reply(msginfo, prefs_common.reply_with_quote,
FALSE, FALSE);
static void summary_add_address_cb(SummaryView *summaryview,
guint action, GtkWidget *widget)
{
- MsgInfo *msginfo;
- gchar *from;
+ summary_add_address(summaryview);
+}
- msginfo = gtk_ctree_node_get_row_data(GTK_CTREE(summaryview->ctree),
- summaryview->selected);
- if (!msginfo) return;
+static void summary_mark_clicked(GtkWidget *button, SummaryView *summaryview)
+{
+ summary_sort(summaryview, SORT_BY_MARK);
+}
- Xstrdup_a(from, msginfo->from, return);
- eliminate_address_comment(from);
- extract_address(from);
- addressbook_add_contact(msginfo->fromname, from, NULL);
+static void summary_unread_clicked(GtkWidget *button, SummaryView *summaryview)
+{
+ summary_sort(summaryview, SORT_BY_UNREAD);
+}
+
+static void summary_mime_clicked(GtkWidget *button, SummaryView *summaryview)
+{
+ summary_sort(summaryview, SORT_BY_MIME);
}
static void summary_num_clicked(GtkWidget *button, SummaryView *summaryview)
summary_sort(summaryview, SORT_BY_SUBJECT);
}
-static void summary_mark_clicked(GtkWidget *button,
- SummaryView *summaryview)
-{
- summary_sort(summaryview, SORT_BY_LABEL);
-}
-
void summary_change_display_item(SummaryView *summaryview)
{
GtkCList *clist = GTK_CLIST(summaryview->ctree);
/* custom compare functions for sorting */
+static gint summary_cmp_by_mark(GtkCList *clist,
+ gconstpointer ptr1, gconstpointer ptr2)
+{
+ MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
+ MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
+
+ return MSG_IS_MARKED(msginfo1->flags) - MSG_IS_MARKED(msginfo2->flags);
+}
+
+static gint summary_cmp_by_unread(GtkCList *clist,
+ gconstpointer ptr1, gconstpointer ptr2)
+{
+ MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
+ MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
+
+ return MSG_IS_UNREAD(msginfo1->flags) - MSG_IS_UNREAD(msginfo2->flags);
+}
+
+static gint summary_cmp_by_mime(GtkCList *clist,
+ gconstpointer ptr1, gconstpointer ptr2)
+{
+ MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
+ MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
+
+ return MSG_IS_MIME(msginfo1->flags) - MSG_IS_MIME(msginfo2->flags);
+}
+
static gint summary_cmp_by_num(GtkCList *clist,
gconstpointer ptr1, gconstpointer ptr2)
{
MsgInfo *msginfo1 = ((GtkCListRow *)ptr1)->data;
MsgInfo *msginfo2 = ((GtkCListRow *)ptr2)->data;
- return MSG_GET_COLORLABEL(msginfo1->flags) - MSG_GET_COLORLABEL(msginfo2->flags);
+ return MSG_GET_COLORLABEL(msginfo1->flags) -
+ MSG_GET_COLORLABEL(msginfo2->flags);
}
-
static gint summary_cmp_by_score(GtkCList *clist,
gconstpointer ptr1, gconstpointer ptr2)
{
SORT_BY_FROM,
SORT_BY_SUBJECT,
SORT_BY_SCORE,
- SORT_BY_LABEL
+ SORT_BY_LABEL,
+ SORT_BY_MARK,
+ SORT_BY_UNREAD,
+ SORT_BY_MIME
} SummarySortType;
typedef enum
SummarySelection summary_get_selection_type (SummaryView *summaryview);
+void summary_select_prev_unread (SummaryView *summaryview);
void summary_select_next_unread (SummaryView *summaryview);
-void summary_select_next_marked (SummaryView *summaryview);
-void summary_select_prev_marked (SummaryView *summaryview);
+void summary_select_prev_marked (SummaryView *summaryview);
+void summary_select_next_marked (SummaryView *summaryview);
+void summary_select_prev_labeled (SummaryView *summaryview);
+void summary_select_next_labeled (SummaryView *summaryview);
void summary_select_by_msgnum (SummaryView *summaryview,
guint msgnum);
guint summary_get_current_msgnum (SummaryView *summaryview);
void summary_unmark (SummaryView *summaryview);
void summary_mark_as_unread (SummaryView *summaryview);
void summary_mark_as_read (SummaryView *summaryview);
+void summary_mark_all_read (SummaryView *summaryview);
+void summary_add_address (SummaryView *summaryview);
void summary_select_all (SummaryView *summaryview);
void summary_unselect_all (SummaryView *summaryview);
#ifdef USE_LDAP
-#include <sys/time.h>
#include <glib.h>
+#include <sys/time.h>
+#include <string.h>
#include <ldap.h>
#include <lber.h>
#include <pthread.h>
}
gint syldap_get_status( SyldapServer *ldapServer ) {
- g_return_if_fail( ldapServer != NULL );
+ g_return_val_if_fail( ldapServer != NULL, -1 );
return ldapServer->retVal;
}
+
ItemFolder *syldap_get_root_folder( SyldapServer *ldapServer ) {
- g_return_if_fail( ldapServer != NULL );
+ g_return_val_if_fail( ldapServer != NULL, NULL );
return addrcache_get_root_folder( ldapServer->addressCache );
}
+
gchar *syldap_get_name( SyldapServer *ldapServer ) {
- g_return_if_fail( ldapServer != NULL );
+ g_return_val_if_fail( ldapServer != NULL, NULL );
return ldapServer->name;
}
+
gboolean syldap_get_accessed( SyldapServer *ldapServer ) {
- g_return_if_fail( ldapServer != NULL );
+ g_return_val_if_fail( ldapServer != NULL, FALSE );
return ldapServer->accessFlag;
}
* Display object to specified stream.
*/
void syldap_print_data( SyldapServer *ldapServer, FILE *stream ) {
- GSList *node;
g_return_if_fail( ldapServer != NULL );
+
fprintf( stream, "SyldapServer:\n" );
fprintf( stream, " name: '%s'\n", ldapServer->name );
fprintf( stream, "host name: '%s'\n", ldapServer->hostName );
* Display object to specified stream.
*/
void syldap_print_short( SyldapServer *ldapServer, FILE *stream ) {
- GSList *node;
g_return_if_fail( ldapServer != NULL );
+
fprintf( stream, "SyldapServer:\n" );
fprintf( stream, " name: '%s'\n", ldapServer->name );
fprintf( stream, "host name: '%s'\n", ldapServer->hostName );
ItemPerson *person;
ItemEMail *email;
GSList *nodeName = listName;
+
while( nodeName ) {
GSList *nodeAddress = listAddr;
person = addritem_create_item_person();
static GSList *syldap_add_list_values( LDAP *ld, LDAPMessage *entry, char *attr ) {
GSList *list = NULL;
gint i;
- char **vals;
+ gchar **vals;
+
if( ( vals = ldap_get_values( ld, entry, attr ) ) != NULL ) {
for( i = 0; vals[i] != NULL; i++ ) {
// printf( "lv\t%s: %s\n", attr, vals[i] );
*/
static GSList *syldap_add_single_value( LDAP *ld, LDAPMessage *entry, char *attr ) {
GSList *list = NULL;
- char **vals;
+ gchar **vals;
+
if( ( vals = ldap_get_values( ld, entry, attr ) ) != NULL ) {
if( vals[0] != NULL ) {
// printf( "sv\t%s: %s\n", attr, vals[0] );
* Return: TRUE if search criteria appear OK.
*/
gboolean syldap_check_search( SyldapServer *ldapServer ) {
- g_return_if_fail( ldapServer != NULL );
+ g_return_val_if_fail( ldapServer != NULL, FALSE );
+
ldapServer->retVal = MGU_LDAP_CRITERIA;
// Test search criteria
char *attribute;
gchar *criteria;
BerElement *ber;
- int rc, cnt;
+ gint rc;
GSList *listName = NULL, *listAddress = NULL, *listID = NULL;
GSList *listFirst = NULL, *listLast = NULL, *listDN = NULL;
struct timeval timeout;
gboolean entriesFound = FALSE;
- g_return_if_fail( ldapServer != NULL );
+ g_return_val_if_fail( ldapServer != NULL, -1 );
ldapServer->retVal = MGU_SUCCESS;
if( ! syldap_check_search( ldapServer ) ) {
*/
// ============================================================================================
gint syldap_read_data( SyldapServer *ldapServer ) {
- g_return_if_fail( ldapServer != NULL );
+ g_return_val_if_fail( ldapServer != NULL, -1 );
ldapServer->accessFlag = FALSE;
pthread_detach( pthread_self() );
// ============================================================================================
void syldap_cancel_read( SyldapServer *ldapServer ) {
g_return_if_fail( ldapServer != NULL );
+
if( ldapServer->thread ) {
// printf( "thread cancelled\n" );
pthread_cancel( *ldapServer->thread );
// ============================================================================================
gint syldap_read_data_th( SyldapServer *ldapServer ) {
pthread_t thread;
- g_return_if_fail( ldapServer != NULL );
+
+ g_return_val_if_fail( ldapServer != NULL, -1 );
ldapServer->busyFlag = FALSE;
syldap_check_search( ldapServer );
* Return link list of persons.
*/
GList *syldap_get_list_person( SyldapServer *ldapServer ) {
- g_return_if_fail( ldapServer != NULL );
+ g_return_val_if_fail( ldapServer != NULL, NULL );
return addrcache_get_list_person( ldapServer->addressCache );
}
* Return: NULL.
*/
GList *syldap_get_list_folder( SyldapServer *ldapServer ) {
- g_return_if_fail( ldapServer != NULL );
+ g_return_val_if_fail( ldapServer != NULL, NULL );
return NULL;
}
GList *syldap_read_basedn_s( const gchar *host, const gint port, const gchar *bindDN, const gchar *bindPW, const gint tov ) {
GList *baseDN = NULL;
LDAP *ld;
- int rc, i;
+ gint rc, i;
LDAPMessage *result, *e;
- char *attribs[10];
+ gchar *attribs[10];
BerElement *ber;
- char *attribute;
- char **vals;
+ gchar *attribute;
+ gchar **vals;
struct timeval timeout;
if( host == NULL ) return baseDN;
GList *syldap_read_basedn( SyldapServer *ldapServer ) {
GList *baseDN = NULL;
LDAP *ld;
- int rc, i;
+ gint rc, i;
LDAPMessage *result, *e;
- char *attribs[10];
+ gchar *attribs[10];
BerElement *ber;
- char *attribute;
- char **vals;
+ gchar *attribute;
+ gchar **vals;
struct timeval timeout;
ldapServer->retVal = MGU_BAD_ARGS;
gboolean syldap_test_connect_s( const gchar *host, const gint port ) {
gboolean retVal = FALSE;
LDAP *ld;
+
if( host == NULL ) return retVal;
if( port < 1 ) return retVal;
if( ( ld = ldap_open( host, port ) ) != NULL ) {
gboolean syldap_test_connect( SyldapServer *ldapServer ) {
gboolean retVal = FALSE;
LDAP *ld;
+
ldapServer->retVal = MGU_BAD_ARGS;
if( ldapServer == NULL ) return retVal;
if( ldapServer->hostName == NULL ) return retVal;
gint get_quote_level(const gchar *str)
{
- size_t firstquotepos;
- size_t lastquotepos = -1;
+ const gchar *first_pos;
+ const gchar *last_pos;
const gchar *p = str;
- const gchar *pos;
- gint quotelevel = -1;
- gint i = 0;
+ gint quote_level = -1;
/* speed up line processing by only searching to the last '>' */
- if ((pos = strchr(str, '>')) != NULL) {
- firstquotepos = pos - str;
- lastquotepos = strrchr(str, '>') - str + 1;
-
+ if ((first_pos = strchr(str, '>')) != NULL) {
/* skip a line if it contains a '<' before the initial '>' */
- if (memchr(str, '<', pos - str) != NULL)
+ if (memchr(str, '<', first_pos - str) != NULL)
return -1;
+ last_pos = strrchr(first_pos, '>');
} else
return -1;
- while (i < lastquotepos) {
- while (i < lastquotepos) {
- if (isspace(*p) || (*p == '\t')) {
+ while (p <= last_pos) {
+ while (p < last_pos) {
+ if (isspace(*p))
p++;
- i++;
- } else
+ else
break;
}
- if (i >= lastquotepos)
- break;
if (*p == '>')
- quotelevel++;
- else if ((*p != '-') && !isspace(*p) && (i < lastquotepos)) {
+ quote_level++;
+ else if (*p != '-' && !isspace(*p) && p <= last_pos) {
/* any characters are allowed except '-' and space */
- while ((*p != '-') && (*p != '>') && !isspace(*p) &&
- (i < lastquotepos)) {
+ while (*p != '-' && *p != '>' && !isspace(*p) &&
+ p < last_pos)
p++;
- i++;
- }
if (*p == '>')
- quotelevel++;
- else if ((i >= lastquotepos) || isspace(*p))
+ quote_level++;
+ else
break;
}
p++;
- i++;
}
- return quotelevel;
+ return quote_level;
}
GList *uri_list_extract_filenames(const gchar *uri_list)
return 0;
}
-gint execute_command_line(const gchar *cmdline)
+gint execute_sync(gchar *const argv[])
+{
+ pid_t pid;
+
+ if ((pid = fork()) < 0) {
+ perror("fork");
+ return -1;
+ }
+
+ if (pid == 0) { /* child process */
+ execvp(argv[0], argv);
+
+ perror("execvp");
+ _exit(1);
+ }
+
+ waitpid(pid, NULL, 0);
+
+ return 0;
+}
+
+gint execute_command_line(const gchar *cmdline, gboolean async)
{
gchar **argv;
gint i;
}
}
- ret = execute_async(argv);
+ if (async)
+ ret = execute_async(argv);
+ else
+ ret = execute_sync(argv);
g_strfreev(argv);
return ret;
g_snprintf(buf, sizeof(buf), default_cmdline, uri);
}
- execute_command_line(buf);
+ execute_command_line(buf, TRUE);
return 0;
}
/* process execution */
gint execute_async (gchar *const argv[]);
-gint execute_command_line (const gchar *cmdline);
+gint execute_sync (gchar *const argv[]);
+gint execute_command_line (const gchar *cmdline,
+ gboolean async);
/* open URI with external browser */
gint open_uri(const gchar *uri, const gchar *cmdline);
* card information. Refer to RFC2426 for more information.
*/
-#include <sys/stat.h>
#include <glib.h>
+#include <sys/stat.h>
+#include <string.h>
#include "mgutils.h"
#include "vcard.h"
* Return: TRUE if file was modified.
*/
gboolean vcard_get_modified( VCardFile *vcardFile ) {
- g_return_if_fail( vcardFile != NULL );
+ g_return_val_if_fail( vcardFile != NULL, FALSE );
return addrcache_check_file( vcardFile->addressCache, vcardFile->path );
}
gboolean vcard_get_accessed( VCardFile *vcardFile ) {
- g_return_if_fail( vcardFile != NULL );
+ g_return_val_if_fail( vcardFile != NULL, FALSE );
return addrcache_check_file( vcardFile->addressCache, vcardFile->path );
}
* Return: TRUE if file was read.
*/
gboolean vcard_get_read_flag( VCardFile *vcardFile ) {
- g_return_if_fail( vcardFile != NULL );
+ g_return_val_if_fail( vcardFile != NULL, FALSE );
return vcardFile->addressCache->dataRead;
}
* Return: Status code.
*/
gint vcard_get_status( VCardFile *cardFile ) {
- g_return_if_fail( cardFile != NULL );
+ g_return_val_if_fail( cardFile != NULL, -1 );
return cardFile->retVal;
}
ItemFolder *vcard_get_root_folder( VCardFile *cardFile ) {
- g_return_if_fail( cardFile != NULL );
+ g_return_val_if_fail( cardFile != NULL, NULL );
return addrcache_get_root_folder( cardFile->addressCache );
}
gchar *vcard_get_name( VCardFile *cardFile ) {
- g_return_if_fail( cardFile != NULL );
+ g_return_val_if_fail( cardFile != NULL, NULL );
return cardFile->name;
}
VCardFile *vcard_create_path( const gchar *path ) {
VCardFile *cardFile;
cardFile = vcard_create();
- vcard_set_file(cardFile, path );
+ vcard_set_file(cardFile, path);
return cardFile;
}
* Display object to specified stream.
*/
void vcard_print_file( VCardFile *cardFile, FILE *stream ) {
- GSList *node;
g_return_if_fail( cardFile != NULL );
+
fprintf( stream, "VCardFile:\n" );
fprintf( stream, " name: '%s'\n", cardFile->name );
fprintf( stream, "file spec: '%s'\n", cardFile->path );
* return: TRUE if file opened successfully.
*/
static gint vcard_open_file( VCardFile* cardFile ) {
- g_return_if_fail( cardFile != NULL );
+ g_return_val_if_fail( cardFile != NULL, -1 );
// fprintf( stdout, "Opening file\n" );
cardFile->addressCache->dataRead = FALSE;
if (vcard_read_line( cardFile ) == NULL ) {
buf[0] = '\0';
- return;
+ return NULL;
}
/* Copy into private buffer */
// Unescape characters in quoted-printable string.
static void vcard_unescape_qp( gchar *value ) {
gchar *ptr, *src, *dest;
- int d, v;
- char ch;
+ gint d, v = 0;
+ gchar ch;
gboolean gotch;
ptr = value;
while( *ptr ) {
* it will generate duplicate address entries for each person listed.
*/
static void vcard_read_file( VCardFile *cardFile ) {
- gchar *tagtemp = NULL, *tagname = NULL, *tagvalue = NULL, *tagtype = NULL, *tagrest = NULL;
+ gchar *tagtemp = NULL, *tagname = NULL, *tagvalue = NULL, *tagtype = NULL;
GSList *listName = NULL, *listAddress = NULL, *listRemarks = NULL, *listID = NULL;
- GSList *listQP = NULL;
+ //GSList *listQP = NULL;
for( ;; ) {
gchar *line = vcard_get_line( cardFile );
*/
// ============================================================================================
gint vcard_read_data( VCardFile *cardFile ) {
- g_return_if_fail( cardFile != NULL );
+ g_return_val_if_fail( cardFile != NULL, -1 );
+
cardFile->retVal = MGU_SUCCESS;
cardFile->accessFlag = FALSE;
if( addrcache_check_file( cardFile->addressCache, cardFile->path ) ) {
* Return link list of persons.
*/
GList *vcard_get_list_person( VCardFile *cardFile ) {
- g_return_if_fail( cardFile != NULL );
+ g_return_val_if_fail( cardFile != NULL, NULL );
return addrcache_get_list_person( cardFile->addressCache );
}
* Return: NULL.
*/
GList *vcard_get_list_folder( VCardFile *cardFile ) {
- g_return_if_fail( cardFile != NULL );
+ g_return_val_if_fail( cardFile != NULL, NULL );
return NULL;
}
* Return: List of items, or NULL if none.
*/
GList *vcard_get_all_persons( VCardFile *cardFile ) {
- g_return_if_fail( cardFile != NULL );
+ g_return_val_if_fail( cardFile != NULL, NULL );
return addrcache_get_all_persons( cardFile->addressCache );
}
*/
gboolean vcard_validate( const VCardFile *cardFile ) {
gboolean retVal;
- g_return_if_fail( cardFile != NULL );
+
+ g_return_val_if_fail( cardFile != NULL, FALSE );
retVal = TRUE;
if( cardFile->path ) {
*/
gint vcard_test_read_file( const gchar *fileSpec ) {
gboolean haveStart;
- gchar *tagtemp = NULL, *tagname = NULL, *tagvalue = NULL, *tagtype = NULL, *tagrest = NULL, *line;
+ gchar *tagtemp = NULL, *tagname = NULL, *tagvalue = NULL, *tagtype = NULL, *line;
VCardFile *cardFile;
gint retVal, lines;