+2001-09-30
+
+ * src/textview.[ch]: added textview_set_position().
+ * src/messageview.[ch]: added messageview_set_position().
+ * src/addrbook.c
+ src/addrcache.c
+ src/addressadd.c
+ src/addressbook.c
+ src/addrindex.c
+ src/addritem.c
+ src/editaddress.c
+ src/editbook.c
+ src/editgroup.c
+ src/editjpilot.c
+ src/editldap.c
+ src/editldap_basedn.c
+ src/editvcard.c
+ src/jpilot.c
+ src/mgutils.c
+ src/syldap.c
+ src/vcard.c: converted C++-style comments into C-style one.
+ * src/imap.c: QUOTE_IF_REQUIRED(): new macro. Copy string into
+ new buffer and quote with double quotes if required.
+ imap_status(), imap_cmd_login(), imap_cmd_list(),
+ imap_cmd_do_select(), imap_cmd_create(), imap_cmd_delete(),
+ imap_cmd_copy(): use QUOTE_IF_REQUIRED().
+
+2001-09-30
+
+ * src/textview.[ch]: textview_search_string_backward(): new.
+ Add the new member cur_pos to TextView.
+ Connect button_press_event with gtk_signal_connect_after() to
+ obtain the correct editable position.
+
2001-09-27
* src/folder.c: folder_write_list_recursive(): preserve unthreaded
+2001-09-30 [paul] 0.6.2claws12
+
+ * po/de.po, po/es.po, po/fr.po, po/nl.po, po/pt_BR.po
+ updated translations
+
+ * po/POTFILES.in
+ add 'src/importldif.c'
+
+ * AUTHORS, tools/README, tools/eud2gc.py, tools/Makefile.am
+ added eudora-to-vCard conversion tool
+ submitted by Jeroen Versteeg <j.m.versteeg@student.utwente.nl>
+
+ * sync with sylpheed 0.6.2cvs8
+
+2001-09-30 [paul]
+
+ * sylpheed-0.6.2claws released
+
2001-09-27 [melvin] 0.6.2claws11
* src/gtkspell.c
+2001-09-30
+
+ * src/textview.[ch]: textview_set_position() ¤òÄɲá£
+ * src/messageview.[ch]: messageview_set_position() ¤òÄɲá£
+ * src/addrbook.c
+ src/addrcache.c
+ src/addressadd.c
+ src/addressbook.c
+ src/addrindex.c
+ src/addritem.c
+ src/editaddress.c
+ src/editbook.c
+ src/editgroup.c
+ src/editjpilot.c
+ src/editldap.c
+ src/editldap_basedn.c
+ src/editvcard.c
+ src/jpilot.c
+ src/mgutils.c
+ src/syldap.c
+ src/vcard.c: C++ ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¤ò C ¥¹¥¿¥¤¥ë¤ËÊÑ´¹¡£
+ * src/imap.c: QUOTE_IF_REQUIRED(): ¿·µ¬¥Þ¥¯¥í¡£Ê¸»úÎó¤ò¿·µ¬
+ ¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤·¡¢É¬Íפʤé¥À¥Ö¥ë¥¯¥©¡¼¥È¤Ç³ç¤ë¡£
+ imap_status(), imap_cmd_login(), imap_cmd_list(),
+ imap_cmd_do_select(), imap_cmd_create(), imap_cmd_delete(),
+ imap_cmd_copy(): QUOTE_IF_REQUIRED() ¤ò»ÈÍÑ¡£
+
+2001-09-30
+
+ * src/textview.[ch]: textview_search_string_backward(): ¿·µ¬¡£
+ ¿·µ¬¥á¥ó¥Ð cur_pos ¤ò TextView ¤ËÄɲá£
+ Àµ¤·¤¤ editable ¤Î°ÌÃÖ¤òÆÀ¤ë¤¿¤á¤Ë button_press_event ¤ò
+ gtk_signal_connect_after() ¤ÇÀܳ¡£
+
2001-09-27
* src/folder.c: folder_write_list_recursive(): ¥¹¥ì¥Ã¥É²ò½ü¤Î¾õÂÖ
* 0.6.2
* The new addressbook has been implemented (Match Grun).
- * LDAP, VCard, and JPilot have been supported.
+ * LDAP, vCard, and JPilot have been supported.
* The option to launch the external editor automatically has been added.
* Sorting by mark, unread, attachment, and color label has been enabled.
* Moving to the next or previous flagged messages has been enabled.
The appearance and interface are similar to some popular e-mail clients for
Windows, such as Outlook Express, Becky!, and Datula. The interface is also
designed to emulate the mailers on Emacsen, and almost all commands are
-accessible with the keyboard.
+accessible with the keyboard. You'll figure out the usage if you have ever
+used some e-mail clients for Windows, or Mew or Wanderlust.
The messages are managed by MH format, and you'll be able to use it together
with another mailer based on MH format (like Mew). You can also utilize
Currently implemented features are:
- o user-friendly and intuitive interface
- o 3-paned view like many Windoze-based mail client
- o ability of keyboard-only operation
- o Mew/Wanderlust-like key bind (most of normally used keys have been
- implemented)
+ o POP3 support
o IMAP4rev1 support
- o multipart MIME
+ o integrated NetNews client
+ o unlimited multiple account handling
+ o thread display
+ o filtering
+ o MIME (attachments)
o built-in image view
o X-Face support
+ o multiple MH folder support
+ o mbox importing / exporting
o external editor support
- o unlimited multiple account handling
o message queueing
- o filtering
+ o automatic mail checking
o draft message function
o line-wrapping
+ o clickable URI
o XML-based address book
- o APOP support
- o unread message management
- o multiple MH folder support
- o integrated NetNews client
+ o LDAP, vCard, and JPilot support
+ o newly arrived and unread message management
+ o Mew/Wanderlust-like key bind
+ o printing
+ o APOP authentication support
+ o SMTP AUTH support
+ o SSL support (POP3, SMTP, IMAP4rev1)
o IPv6 support
- o GnuPG support (currently implementing)
- o multithread support (experimental)
- o mbox importing / exporting
o drag & drop (partially implemented)
- o fast thread display
- o high-speed message processing
- o lightweight resource usage
- o easily customizable configuration
- o supports automake + autoconf, and internationalization of message
- by gettext
-
-You'll figure out the usage if you have used a mailer on Windows, or
-Mew or Wanderlust.
+ o GnuPG support (currently implementing)
+ o automake + autoconf support
+ o internationalization of messages by gettext
+ o support of many code sets, including UTF-8 (Unicode) (when using
+ libjconv)
+
+and more.
Installation
============
What's Sylpheed
===============
-Sylpheed¤ÏGTK+¤ò»ÈÍѤ·¤¿¡¢X Window System¾å¤ÇÆ°ºî¤¹¤ë
+Sylpheed ¤Ï GTK+ ¤ò»ÈÍѤ·¤¿¡¢ X Window System ¾å¤ÇÆ°ºî¤¹¤ë
* ·Ú²÷¤ÊÆ°ºî
* Èþ¤·¤¯¡¢ÀöÎý¤µ¤ì¤¿¥¤¥ó¥¿¥Õ¥§¡¼¥¹
¤òÌܻؤ·¤¿ÅŻҥ᡼¥ë¥¯¥é¥¤¥¢¥ó¥È(& ¥Ë¥å¡¼¥¹¥ê¡¼¥À¡¼)¤Ç¤¹¡£
-³°´Ñ¤ä¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏOutlook Express¡¢Becky!¡¢Datula¤È¤¤¤Ã¤¿¡¢ Windows¤Ç
-¤ÏÄêÈ֤Υ᡼¥é¤ò»²¹Í¤Ë¤·¤Æ¤¤¤Þ¤¹¡£¤Þ¤¿¡¢Áàºî·Ï¤ÏMew¤äWanderlustÅù¤Î Emacs
-·Ï¥á¡¼¥é¤ò»²¹Í¤Ë¤·¤Æ¤¤¤Æ¡¢¥¡¼¥Ü¡¼¥É¤Î¤ß¤Ë¤è¤ëÁàºî¤¬²Äǽ¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
+³°´Ñ¤ä¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ï Outlook Express ¡¢ Becky! ¡¢ Datula ¤È¤¤¤Ã¤¿¡¢
+Windows ¤Ç¤ÏÄêÈ֤Υ᡼¥é¤ò»²¹Í¤Ë¤·¤Æ¤¤¤Þ¤¹¡£¤Þ¤¿¡¢Áàºî·Ï¤Ï Mew ¤ä
+Wanderlust Åù¤Î Emacs ·Ï¥á¡¼¥é¤ò»²¹Í¤Ë¤·¤Æ¤ª¤ê¡¢¥¡¼¥Ü¡¼¥É¤Î¤ß¤Ë¤è¤ëÁàºî
+¤¬²Äǽ¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ Windows ¾å¤Î¥á¡¼¥é¡¢¤¢¤ë¤¤¤Ï Mew ¤ä Wanderlust Åù
+¤Î»ÈÍѷи³¤¬¤¢¤ì¤Ð¤¹¤°¤Ë»È¤¤Êý¤Ïʬ¤«¤ë¤È»×¤¤¤Þ¤¹¡£
-¥á¥Ã¥»¡¼¥¸¤ÏMH·Á¼°¤Ç´ÉÍý¤·¤Æ¤ª¤ê¡¢Â¾¤ÎMH·Á¼°¤ò»ÈÍѤ·¤¿¥á¡¼¥é(MewÅù)¤ÈÊ»ÍÑ
-¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£¤Þ¤¿¡¢fetchmail¤äprocmail¤òÍøÍѤ·¤¿¤ê¡¢¼õ¿®¤Ë³°Éô
-¥×¥í¥°¥é¥à(inc, imgetÅù)¤ò»ÈÍѤ¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£
+¥á¥Ã¥»¡¼¥¸¤Ï MH ·Á¼°¤Ç´ÉÍý¤·¤Æ¤ª¤ê¡¢Â¾¤Î MH ·Á¼°¤ò»ÈÍѤ·¤¿¥á¡¼¥é(Mew Åù)
+¤ÈÊ»ÍѤ¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£¤Þ¤¿¡¢ fetchmail ¤ä procmail ¤òÍøÍѤ·¤¿¤ê¡¢¼õ¿®
+¤Ë³°Éô¥×¥í¥°¥é¥à(inc, imget Åù)¤ò»ÈÍѤ¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£
¸½ºß¼ÂÁõ¤µ¤ì¤Æ¤¤¤ëµ¡Ç½¤Ï
- o ¥æ¡¼¥¶¥Õ¥ì¥ó¥É¥ê¤Çľ´ÑŪ¤Ê¥¤¥ó¥¿¥Õ¥§¡¼¥¹
- o Windoze ¾å¤Î¥á¡¼¥ë¥¯¥é¥¤¥¢¥ó¥È¤Ë¤è¤¯¤¢¤ë3¤Ú¥¤¥óɽ¼¨
- o ¥¡¼¥Ü¡¼¥É¤Î¤ß¤Ë¤è¤ëÁàºî¤¬²Äǽ
- o Mew/Wanderlust ¥é¥¤¥¯¤Ê¥¡¼¥Ð¥¤¥ó¥É (Ä̾ï»È¤ï¤ì¤ë¥¡¼¤ÎÂçÉôʬ¤Ï
- ¼ÂÁõºÑ)
+ o POP3 Âбþ
o IMAP4rev1 Âбþ
- o ¥Þ¥ë¥Á¥Ñ¡¼¥È MIME
+ o Åý¹ç NetNews ¥¯¥é¥¤¥¢¥ó¥È
+ o ̵À©¸Â¤ÎÊ£¿ô¥¢¥«¥¦¥ó¥È´ÉÍý
+ o ¥¹¥ì¥Ã¥Éɽ¼¨
+ o ¿¶¤êʬ¤±µ¡Ç½
+ o MIME (źÉÕ)
o ²èÁüɽ¼¨µ¡Ç½¤òÆâ¢
o X-Face Âбþ
+ o Ê£¿ô¤Î MH ¥Õ¥©¥ë¥À¤ËÂбþ
+ o mbox ¥Õ¥¡¥¤¥ë¤Î¥¤¥ó¥Ý¡¼¥È / ¥¨¥¯¥¹¥Ý¡¼¥È
o ³°Éô¥¨¥Ç¥£¥¿Âбþ
- o ̵À©¸Â¤ÎÊ£¿ô¥¢¥«¥¦¥ó¥È´ÉÍý
- o ¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®ÂÔµ¡µ¡Ç½
- o ¿¶¤êʬ¤±µ¡Ç½
+ o Á÷¿®ÂÔµ¡µ¡Ç½
+ o ¼«Æ°¥á¡¼¥ë¥Á¥§¥Ã¥¯µ¡Ç½
o Áð¹Æµ¡Ç½
o ¼«Æ°²þ¹Ôµ¡Ç½
+ o ¥¯¥ê¥Ã¥«¥Ö¥ë URI
o XML ¥Ù¡¼¥¹¤Î¥¢¥É¥ì¥¹Ä¢
- o APOP Âбþ
- o ̤ÆÉ¥á¥Ã¥»¡¼¥¸´ÉÍý
- o Ê£¿ô¤Î MH ¥Õ¥©¥ë¥À¤ËÂбþ
- o Åý¹ç NetNews ¥¯¥é¥¤¥¢¥ó¥È
+ o LDAP, vCard, JPilot Âбþ
+ o ¿·Ã塦̤ÆÉ´ÉÍý
+ o Mew/Wanderlust ¥é¥¤¥¯¤Ê¥¡¼¥Ð¥¤¥ó¥É
+ o °õºþµ¡Ç½
+ o APOP ǧ¾ÚÂбþ
+ o SMTP AUTH Âбþ
+ o SSL Âбþ (POP3, SMTP, IMAP4rev1)
o IPv6 Âбþ
- o GnuPG Âбþ (¸½ºß¼ÂÁõÃæ)
- o ¥Þ¥ë¥Á¥¹¥ì¥Ã¥ÉÂбþ (¼Â¸³Åª)
- o mbox ¥Õ¥¡¥¤¥ë¤Î¥¤¥ó¥Ý¡¼¥È / ¥¨¥¯¥¹¥Ý¡¼¥È
o ¥É¥é¥Ã¥° & ¥É¥í¥Ã¥× (°ìÉô¼ÂÁõ)
- o ¹â®¤Ê¥¹¥ì¥Ã¥Éɽ¼¨
- o ¹â®¤Ê¥á¥Ã¥»¡¼¥¸½èÍý
- o Äã¾ÃÈñ¥ê¥½¡¼¥¹
- o Íưפ˥«¥¹¥¿¥Þ¥¤¥º¤Ç¤¤ëÀßÄê
- o automake + autoconf ¤È gettext ¤Ë¤è¤ë¥á¥Ã¥»¡¼¥¸¤Î¹ñºÝ²½¤ËÂбþ
-
-Windows ¾å¤Î¥á¡¼¥é¡¢¤¢¤ë¤¤¤Ï Mew ¤ä Wanderlust ¤ò»ÈÍѤ·¤¿¤³¤È¤Î¤¢¤ë¿Í¤Ê¤é
-¤¹¤°¤Ë»È¤¤Êý¤Ïʬ¤«¤ë¤È»×¤¤¤Þ¤¹¡£
+ o GnuPG Âбþ (¸½ºß¼ÂÁõÃæ)
+ o automake + autoconf Âбþ
+ o gettext ¤Ë¤è¤ë¥á¥Ã¥»¡¼¥¸¤Î¹ñºÝ²½Âбþ
+ o UTF-8 (Unicode) ¤ò´Þ¤à¿¿ô¤Î¥³¡¼¥É¥»¥Ã¥È¤ËÂбþ(libjconv »ÈÍÑ»þ)
+
+Åù¤Ç¤¹¡£
¥¤¥ó¥¹¥È¡¼¥ëÊýË¡
================
MICRO_VERSION=2
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws11
+EXTRA_VERSION=claws12
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl
#define AB_ELTAG_GROUP "group"
#define AB_ELTAG_FOLDER "folder"
-// Attribute tag names
+/* Attribute tag names */
#define AB_ATTAG_TYPE "type"
#define AB_ATTAG_UID "uid"
#define AB_ATTAG_NAME "name"
longjmp( book->jumper, 1 );
}
/* Get next tag (person, group or folder) */
+ if( xml_parse_next_tag( file ) ) {
+ longjmp( book->jumper, 1 );
+ }
if( xml_compare_tag( file, AB_ELTAG_PERSON ) ) {
addrbook_chkparse_person( book, file );
}
else if( xml_compare_tag( file, AB_ELTAG_FOLDER ) ) {
addrbook_chkparse_folder( book, file );
}
+ else {
+ /* Item not recognized */
+ retVal = FALSE;
+ }
}
return retVal;
}
#include "addritem.h"
#include "addrcache.h"
-// Address book file.
+/* Address book file */
typedef struct _AddressBookFile AddressBookFile;
+
struct _AddressBookFile {
gchar *name;
gchar *path;
jmp_buf jumper;
};
-// Function prototypes
+/* Function prototypes */
AddressBookFile *addrbook_create_book ( void );
void addrbook_empty_book ( AddressBookFile *book );
const gchar *remarks );
#endif /* __ADDRBOOK_H__ */
-
-/*
-* End of Source.
-*/
-
-
obj = ( AddrItemObject * ) g_hash_table_lookup( cache->itemHash, uid );
if( obj ) {
if( ADDRITEM_TYPE(obj) == ITEMTYPE_PERSON ) {
- /* Remove person's email addresses from all groups where
- referenced and from hash table. */
+ /* Remove person's email addresses from all groups where */
+ /* referenced and from hash table. */
ItemPerson *person = ( ItemPerson * ) obj;
ItemFolder *parent = ( ItemFolder * ) ADDRITEM_PARENT(person);
if( ! parent ) parent = cache->rootFolder;
- /* Remove emails from groups, remove from parent's list
- and hash table */
+ /* Remove emails from groups, remove from parent's list */
+ /* and hash table */
addrcache_foldergrp_rem_person( parent, person );
parent->listPerson = g_list_remove( parent->listPerson, person );
g_hash_table_remove( cache->itemHash, uid );
obj = ( AddrItemObject * ) g_hash_table_lookup( cache->itemHash, uid );
if( obj ) {
if( ADDRITEM_TYPE(obj) == ITEMTYPE_PERSON ) {
- /* Remove person's email addresses from all groups where
- referenced and from hash table. */
+ /* Remove person's email addresses from all groups where */
+ /* referenced and from hash table. */
ItemFolder *parent = ( ItemFolder * ) ADDRITEM_PARENT(person);
if( ! parent ) parent = cache->rootFolder;
addrcache_foldergrp_rem_person( parent, person );
}
/*
-* Get all persons visitor function.
+* Get all person visitor function.
*/
static void addrcache_get_all_persons_vis( gpointer key, gpointer value, gpointer data ) {
AddrItemObject *obj = ( AddrItemObject * ) value;
#include <glib.h>
#include "addritem.h"
-/* Address book file. */
+/* Address cache */
typedef struct _AddressCache AddressCache;
+
struct _AddressCache {
gint nextID;
gboolean dataRead;
const gchar *remarks );
#endif /* __ADDRCACHE_H__ */
-
-/*
-* End of Source.
-*/
-
static void addressadd_tree_button( GtkCTree *ctree, GdkEventButton *event, gpointer data ) {
if( ! event ) return;
if( event->button == 1 ) {
- // Handle double click
+ /* Handle double click */
if( event->type == GDK_2BUTTON_PRESS ) {
addressadd_cancelled = FALSE;
gtk_main_quit();
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Name"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_table_attach(GTK_TABLE(table), label_name, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(label_name), 0, 0.5);
- // Second row
+ /* Second row */
top = 1;
label = gtk_label_new(_("Address"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_table_attach(GTK_TABLE(table), label_addr, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(label_addr), 0, 0.5);
- // Third row
+ /* Third row */
top = 2;
label = gtk_label_new(_("Remarks"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_table_attach(GTK_TABLE(table), label_rems, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(label_rems), 0, 0.5);
- // Address book/folder tree
+ /* Address book/folder tree */
vlbox = gtk_vbox_new(FALSE, 8);
gtk_box_pack_start(GTK_BOX(vbox), vlbox, TRUE, TRUE, 0);
gtk_container_set_border_width( GTK_CONTAINER(vlbox), 8 );
gtk_ctree_set_indent( GTK_CTREE(tree_folder), CTREE_INDENT );
gtk_clist_set_auto_sort( GTK_CLIST(tree_folder), TRUE );
- // Status line
+ /* Status line */
hsbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
- // Button panel
+ /* 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);
ds = nodeDS->data;
dsName = g_strdup( addrindex_ds_get_name( ds ) );
- // Read address book
+ /* Read address book */
if( ! addrindex_ds_get_read_flag( ds ) ) {
addrindex_ds_read_data( ds );
}
- // Add node for address book
+ /* Add node for address book */
abf = ds->rawDataSource;
name = &dsName;
node = gtk_ctree_insert_node( tree, NULL, NULL,
#include "addrindex.h"
-// Function prototypes
gboolean addressadd_selection( AddressIndex *addrIndex, const gchar *name, const gchar *address, const gchar *remarks );
#endif /* __ADDRESS_ADD_H__ */
-
-/*
-* End of Source.
-*/
-
static GtkCTreeNode *addressbook_node_add_group (GtkCTreeNode *node,
AddressDataSource *ds,
ItemGroup *itemGroup);
-/* static GtkCTreeNode *addressbook_node_add_category
- (GtkCTreeNode *node,
- AddressDataSource *ds,
- ItemFolder *itemFolder ); */
+/* static GtkCTreeNode *addressbook_node_add_category */
+/* (GtkCTreeNode *node, */
+/* AddressDataSource *ds, */
+/* ItemFolder *itemFolder); */
static void addressbook_tree_remove_children (GtkCTree *ctree,
GtkCTreeNode *parent);
static void addressbook_move_nodes_up (GtkCTree *ctree,
static gint addressbook_list_compare_func (GtkCList *clist,
gconstpointer ptr1,
gconstpointer ptr2);
-/* static gint addressbook_obj_name_compare (gconstpointer a,
- gconstpointer b); */
+/* 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);
{N_("/_Edit/C_ut"), "<ctl>X", NULL, 0, NULL},
{N_("/_Edit/_Copy"), "<ctl>C", NULL, 0, NULL},
{N_("/_Edit/_Paste"), "<ctl>V", NULL, 0, NULL},
+ {N_("/_Tools"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_Tools/Import _Mozilla"), NULL, NULL, 0, NULL},
+ {N_("/_Tools/Import _V-Card"), NULL, NULL, 0, NULL},
+ {N_("/_Tools/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Tools/Export _LDIF"), NULL, NULL, 0, NULL},
+ {N_("/_Tools/Export V-_Card"), NULL, NULL, 0, NULL},
*/
static GtkItemFactoryEntry addressbook_tree_popup_entries[] =
addritem_free_item_group( item );
item = NULL;
}
- /* Remove group from parent node */
+ /* Remove group from parent node */
gtk_ctree_remove_node( ctree, nd );
}
else if( aio->type == ADDR_ITEM_PERSON ) {
if( addrbook.listSelected == NULL ) canEdit = FALSE;
- /* Enable add */
+ /* Enable add */
menu_set_sensitive( addrbook.menu_factory, "/Address/New Address", editAddress );
menu_set_sensitive( addrbook.menu_factory, "/Address/New Group", canAdd );
menu_set_sensitive( addrbook.menu_factory, "/Address/New Folder", canAdd );
addrbook.opened = node;
if( obj->type == ADDR_DATASOURCE ) {
- /* Read from file */
+ /* Read from file */
static gboolean tVal = TRUE;
ads = ADAPTER_DSOURCE(obj);
}
}
- /* Update address list */
+ /* Update address list */
addressbook_set_clist( obj );
/* Setup main menu selections */
if( ds == NULL ) return;
}
else {
- /* Must be folder or something else */
+ /* Must be folder or something else */
ds = addressbook_find_datasource( node );
if( ds == NULL ) return;
/* Proceed with deletion */
if( obj->type == ADDR_DATASOURCE ) {
- /* Remove data source */
+ /* Remove data source. */
if( addrindex_index_remove_datasource( _addressIndex_, ds ) ) {
addressbook_free_child_adapters( node );
remFlag = TRUE;
}
}
else if( pobj->type == ADDR_ITEM_FOLDER ) {
- /* New address */
+ /* New address */
ItemFolder *folder = ADAPTER_FOLDER(pobj)->itemFolder;
ItemPerson *person = addressbook_edit_person( abf, folder, NULL, FALSE );
if( person ) {
ItemPerson *person;
if( email == NULL ) return;
if( pobj && pobj->type == ADDR_ITEM_GROUP ) {
- /* Edit parent group */
+ /* Edit parent group */
AdapterGroup *adapter = ADAPTER_GROUP(pobj);
ItemGroup *itemGrp = adapter->itemGroup;
if( addressbook_edit_group( abf, NULL, itemGrp ) == NULL ) return;
if( atci == NULL ) return;
if( atciMail == NULL ) return;
- /* Load email addresses */
+ /* Load email addresses */
items = addritem_folder_get_person_list( itemFolder );
for( ; items != NULL; items = g_list_next( items ) ) {
GtkCTreeNode *nodePerson = NULL;
eMailAddr = ADDRITEM_NAME(email);
if( *eMailAddr == '\0' ) eMailAddr = NULL;
if( flgFirst ) {
- /* First email belongs with person */
+ /* First email belongs with person */
gchar *str = addressbook_format_item_clist( person, email );
if( str ) {
text[COL_NAME] = str;
atci = adapter->atci;
if( atci == NULL ) return;
- /* Create nodes in list copying values for data sources in tree */
+ /* Create nodes in list copying values for data sources in tree */
row = GTK_CTREE_ROW( adapter->treeNode );
if( row ) {
node = row->children;
if( GTK_CTREE_ROW(node)->level < 2 ) return NULL;
ao = gtk_ctree_node_get_row_data( GTK_CTREE(addrbook.ctree), node );
if( ao ) {
-/* printf( "ao->type = %d\n", ao->type ); */
+/* printf( "ao->type = %d\n", ao->type ); */
if( ao->type == ADDR_DATASOURCE ) {
AdapterDSource *ads = ADAPTER_DSOURCE(ao);
-/* printf( "found it\n" ); */
+/* printf( "found it\n" ); */
ds = ads->dataSource;
break;
}
}
if( obj->type == ADDR_INTERFACE ) {
- /* printf( "set_clist: loading datasource...\n" );
- addressbook_node_load_datasource( clist, obj ); */
+ /* printf( "set_clist: loading datasource...\n" ); */
+ /* addressbook_node_load_datasource( clist, obj ); */
return;
}
addressbook_load_group( ctreelist, itemGroup );
}
else if( obj->type == ADDR_ITEM_FOLDER ) {
- /* Load folders */
+ /* Load folders */
ItemFolder *itemFolder = ADAPTER_FOLDER(obj)->itemFolder;
addressbook_folder_load_person( ctreelist, itemFolder );
addressbook_folder_load_group( ctreelist, itemFolder );
atci = adapter->atci;
if( iface ) {
if( iface->useInterface ) {
- /* Load data sources below interface node */
+ /* Load data sources below interface node */
nodeDS = iface->listSource;
while( nodeDS ) {
ds = nodeDS->data;
else {
/* We have an old file */
if( addrIndex->wasConverted ) {
- /* Converted successfully - save address index */
+ /* Converted successfully - save address index */
addrindex_set_file_name( addrIndex, ADDRESSBOOK_INDEX_FILE );
addrindex_save_data( addrIndex );
if( addrIndex->retVal == MGU_SUCCESS ) {
addrIndex = addrindex_create_index();
/* Use use new address book. */
- /* addrindex_set_file_path( addrIndex, "/home/match/tmp/empty-dir" ); */
+ /* addrindex_set_file_path( addrIndex, "/home/match/tmp/empty-dir" ); */
addrindex_set_file_path( addrIndex, get_rc_dir() );
addrindex_set_file_name( addrIndex, ADDRESSBOOK_INDEX_FILE );
else {
/* We have an old file */
if( addrIndex->wasConverted ) {
- /* Converted successfully - save address index */
+ /* Converted successfully - save address index */
addrindex_set_file_name( addrIndex, ADDRESSBOOK_INDEX_FILE );
addrindex_save_data( addrIndex );
if( addrIndex->retVal == MGU_SUCCESS ) {
if( errFlag ) {
debug_print( "Error\n%s\n", msg );
- alertpanel( _( "Sylpheed Addressbook Conversion Error" ), msg, _( "Close" ), NULL, NULL );
+ alertpanel( _( "Addressbook Conversion Error" ), msg,
+ _( "Close" ), NULL, NULL );
}
else {
if( msg ) {
debug_print( "Warning\n%s\n", msg );
- alertpanel( _( "Sylpheed Addressbook Conversion" ), msg, _( "Close" ), NULL, NULL );
+ alertpanel( _( "Addressbook Conversion" ), msg,
+ _( "Close" ), NULL, NULL );
}
}
if( msg ) g_free( msg );
pobj = gtk_ctree_node_get_row_data(ctree, node);
g_return_val_if_fail(pobj != NULL, NULL);
- /* Determine object type to be displayed */
+ /* Determine object type to be displayed */
if( obj->type == ADDR_DATASOURCE ) {
otype = ADAPTER_DSOURCE(obj)->subType;
}
addrindex_print_index( _addressIndex_, stdout );
}
- /* Notify address completion of new data */
+ /* Notify address completion of new data */
invalidate_address_completion();
}
}
void addrbookctl_build_map( GtkWidget *window ) {
AddressTypeControlItem *atci;
- // Build icons
+ /* 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);
g_hash_table_insert( _addressBookTypeHash_, &atci->objectType, atci );
_addressBookTypeList_ = g_list_append( _addressBookTypeList_, atci );
- /* Address book */
+ /* Address book */
atci = g_new0( AddressTypeControlItem, 1 );
atci->objectType = ADDR_BOOK;
atci->interfaceType = ADDR_IF_BOOK;
void addressbook_export_to_file (void);
gint addressbook_obj_name_compare (gconstpointer a,
gconstpointer b);
-// static gint addressbook_obj_name_compare(gconstpointer a,
-// gconstpointer b);
+/* static gint addressbook_obj_name_compare(gconstpointer a,
+ gconstpointer b); */
/* provisional API for accessing the address book */
ADDR_ITEM_GROUP,
ADDR_INTERFACE,
ADDR_DATASOURCE,
- ADDR_BOOK, // Sub-type
- ADDR_VCARD, // Sub-type
- ADDR_JPILOT, // Sub-type
- ADDR_CATEGORY, // Sub-type
- ADDR_LDAP // Sub-type
+ ADDR_BOOK, /* Sub-type */
+ ADDR_VCARD, /* Sub-type */
+ ADDR_JPILOT, /* Sub-type */
+ ADDR_CATEGORY, /* Sub-type */
+ ADDR_LDAP /* Sub-type */
} AddressObjectType;
typedef struct _AddressBook_win AddressBook_win;
#define TAG_DS_JPILOT "jpilot"
#define TAG_DS_LDAP "server"
-// XML Attribute names
+/* XML Attribute names */
#define ATTAG_BOOK_NAME "name"
#define ATTAG_BOOK_FILE "file"
#define ATTAG_LDAP_MAX_ENTRY "max-entry"
#define ATTAG_LDAP_TIMEOUT "timeout"
-#define DISP_NEW_COMMON "Common Address"
-#define DISP_NEW_PERSONAL "Personal Address"
+#if 0
+N_("Common address")
+N_("Personal address")
+#endif
+
+#define DISP_NEW_COMMON _("Common address")
+#define DISP_NEW_PERSONAL _("Personal address")
-// Old address book
+/* Old address book */
#define TAG_IF_OLD_COMMON "common_address"
#define TAG_IF_OLD_PERSONAL "personal_address"
-#define DISP_OLD_COMMON "Common Address"
-#define DISP_OLD_PERSONAL "Personal Address"
+#define DISP_OLD_COMMON _("Common address")
+#define DISP_OLD_PERSONAL _("Personal address")
typedef struct _AddressIfAttr AddressIfAttrib;
struct _AddressIfAttr {
iface->haveLibrary = syldap_test_ldap_lib();
iface->useInterface = iface->haveLibrary;
iface->getAccessFlag = ( void * ) syldap_get_accessed;
- // iface->getModifyFlag = ( void * ) syldap_get_modified;
- // iface->getReadFlag = ( void * ) syldap_get_read_flag;
+ /* iface->getModifyFlag = ( void * ) syldap_get_modified; */
+ /* iface->getReadFlag = ( void * ) syldap_get_read_flag; */
iface->getStatusCode = ( void * ) syldap_get_status;
iface->getReadData = ( void * ) syldap_read_data;
iface->getRootFolder = ( void * ) syldap_get_root_folder;
addrIndex->interfaceList = g_list_append( addrIndex->interfaceList, iface );
ADDRITEM_PARENT(iface) = ADDRITEM_OBJECT(addrIndex);
- // Two old legacy data sources
+ /* Two old legacy data sources */
iface = addrindex_create_interface( ADDR_IF_COMMON, "Old Address - common", TAG_IF_OLD_COMMON, NULL );
iface->legacyFlag = TRUE;
addrIndex->interfaceList = g_list_append( addrIndex->interfaceList, iface );
}
}
#else
-// Just read/write name-value pairs
+/* Just read/write name-value pairs */
static AddressDataSource *addrindex_parse_jpilot( XMLFile *file ) {
AddressDataSource *ds = g_new0( AddressDataSource, 1 );
GList *list = addrindex_read_attributes( file );
}
}
#else
-// Just read/write name-value pairs
+/* Just read/write name-value pairs */
static AddressDataSource *addrindex_parse_ldap( XMLFile *file ) {
AddressDataSource *ds = g_new0( AddressDataSource, 1 );
GList *list = addrindex_read_attributes( file );
*/
static void addrindex_read_index( AddressIndex *addrIndex, XMLFile *file ) {
guint prev_level;
- //gchar *element;
- //GList *attr;
+ /* gchar *element; */
+ /* GList *attr; */
XMLTag *xtag;
AddressInterface *iface = NULL, *dsIFace = NULL;
AddressDataSource *ds;
if( file->level < prev_level ) return;
xtag = xml_get_current_tag( file );
- // printf( "tag : %s\n", xtag->tag );
+ /* printf( "tag : %s\n", xtag->tag ); */
iface = addrindex_tag_get_interface( addrIndex, xtag->tag, ADDR_IF_NONE );
if( iface ) {
addrIndex->lastType = iface->type;
if( iface->legacyFlag ) addrIndex->needsConversion = TRUE;
- // printf( "found : %s\n", iface->name );
+ /* printf( "found : %s\n", iface->name ); */
}
else {
dsIFace = addrindex_tag_get_datasource( addrIndex, addrIndex->lastType, xtag->tag );
if( dsIFace ) {
- // Add data source to list
- // printf( "\tdata source: %s\n", dsIFace->name );
+ /* Add data source to list */
+ /* printf( "\tdata source: %s\n", dsIFace->name ); */
ds = NULL;
if( addrIndex->lastType == ADDR_IF_BOOK ) {
ds = addrindex_parse_book( file );
if( ds->rawDataSource ) {
addrbook_set_path( ds->rawDataSource, addrIndex->filePath );
- // addrbook_print_book( ds->rawDataSource, stdout );
+ /* addrbook_print_book( ds->rawDataSource, stdout ); */
}
}
else if( addrIndex->lastType == ADDR_IF_VCARD ) {
ds = addrindex_parse_vcard( file );
- // if( ds->rawDataSource ) {
- // vcard_print_file( ds->rawDataSource, stdout );
- // }
+ /* if( ds->rawDataSource ) { */
+ /* vcard_print_file( ds->rawDataSource, stdout ); */
+ /* } */
}
else if( addrIndex->lastType == ADDR_IF_JPILOT ) {
ds = addrindex_parse_jpilot( file );
ds->interface = dsIFace;
dsIFace->listSource = g_list_append( dsIFace->listSource, ds );
}
- // printf( "=============================\n\n" );
+ /* printf( "=============================\n\n" ); */
}
}
/*
g_free( fileSpec );
if( file == NULL ) {
- // fprintf( stdout, " file '%s' does not exist.\n", addrIndex->fileName );
+ /* fprintf( stdout, " file '%s' does not exist.\n", addrIndex->fileName ); */
return addrIndex->retVal;
}
node->list = g_list_append( node->list, newNode );
}
else {
- // printf( "invalid: !!! \n" );
+ /* printf( "invalid: !!! \n" ); */
attr = xml_get_current_tag_attr( file );
}
}
if (file->level < prev_level) return;
xtag = xml_get_current_tag( file );
- // printf( "tag : %s\n", xtag->tag );
+ /* printf( "tag : %s\n", xtag->tag ); */
element = xml_get_element( file );
attr = xml_get_current_tag_attr( file );
- // show_attribs( attr );
- // printf( "\ttag value : %s :\n", element );
+ /* show_attribs( attr ); */
+ /* printf( "\ttag value : %s :\n", element ); */
addrindex_consume_tree( file );
}
}
ItemGroup *itemGroup;
gchar *fName;
- // Create a folder for group
+ /* Create a folder for group */
fName = g_strdup_printf( "Cvt - %s", node->name );
itemGFolder = addritem_create_item_folder();
addritem_folder_set_name( itemGFolder, fName );
addrcache_folder_add_folder( cache, parent, itemGFolder );
g_free( fName );
- // Add group into folder
+ /* Add group into folder */
itemGroup = addritem_create_item_group();
addritem_group_set_name( itemGroup, node->name );
addrcache_id_group( cache, itemGroup );
ItemPerson *itemPerson;
ItemEMail *itemEMail;
- // Create person and email objects
+ /* Create person and email objects */
itemPerson = addritem_create_item_person();
addritem_person_set_common_name( itemPerson, node->name );
addrcache_id_person( cache, itemPerson );
addrcache_id_email( cache, itemEMail );
addrcache_person_add_email( cache, itemPerson, itemEMail );
- // Add person into appropriate folder
+ /* Add person into appropriate folder */
if( itemGFolder ) {
addrcache_folder_add_person( cache, itemGFolder, itemPerson );
}
addrcache_folder_add_person( cache, parent, itemPerson );
}
- // Add email address only into group
+ /* Add email address only into group */
if( parentGrp ) {
addrcache_group_add_email( cache, parentGrp, itemEMail );
}
GList *fileList = NULL;
gint fileNum = 0;
- // Setup root node
+ /* Setup root node */
rootNode = g_new0( AddressCvtNode, 1 );
rootNode->type = TEMPNODE_ROOT;
rootNode->name = g_strdup( "root" );
rootNode->list = NULL;
addrindex_add_obj( file, rootNode );
- // addrindex_print_node( rootNode, stdout );
+ /* addrindex_print_node( rootNode, stdout ); */
- // Create new address book
+ /* Create new address book */
abf = addrbook_create_book();
addrbook_set_name( abf, displayName );
addrbook_set_path( abf, addrIndex->filePath );
- // Determine next available file number
+ /* Determine next available file number */
fileList = addrbook_get_bookfile_list( abf );
if( fileList ) {
fileNum = 1 + abf->maxValue;
addrindex_process_node( abf, rootNode, abf->addressCache->rootFolder, NULL, NULL );
- // addrbook_dump_book( abf, stdout );
+ /* addrbook_dump_book( abf, stdout ); */
addrbook_save_data( abf );
addrIndex->retVal = abf->retVal;
if( abf->retVal == MGU_SUCCESS ) retVal = TRUE;
addrindex_free_node( rootNode );
rootNode = NULL;
- // Create entries in address index
+ /* Create entries in address index */
if( retVal ) {
abf = addrbook_create_book();
addrbook_set_name( abf, displayName );
GList *attr;
XMLTag *xtag;
- // Process file
+ /* Process file */
for (;;) {
prev_level = file->level;
xml_parse_next_tag( file );
if (file->level < prev_level) return;
xtag = xml_get_current_tag( file );
- // printf( "tag : %d : %s\n", prev_level, xtag->tag );
+ /* printf( "tag : %d : %s\n", prev_level, xtag->tag ); */
if( strcmp( xtag->tag, TAG_IF_OLD_COMMON ) == 0 ) {
if( addrindex_process_book( addrIndex, file, DISP_OLD_COMMON ) ) {
addrIndex->needsConversion = FALSE;
}
element = xml_get_element( file );
attr = xml_get_current_tag_attr( file );
- // show_attribs( attr );
- // printf( "\ttag value : %s :\n", element );
+ /* show_attribs( attr ); */
+ /* printf( "\ttag value : %s :\n", element ); */
addrindex_consume_tree( file );
}
}
g_free( fileSpec );
if( file == NULL ) {
- // fprintf( stdout, " file '%s' does not exist.\n", addrIndex->fileName );
+ /* fprintf( stdout, " file '%s' does not exist.\n", addrIndex->fileName ); */
return addrIndex->retVal;
}
GList *fileList = NULL;
gint fileNum = 0;
- // Create new address book
+ /* Create new address book */
abf = addrbook_create_book();
addrbook_set_name( abf, displayName );
addrbook_set_path( abf, addrIndex->filePath );
- // Determine next available file number
+ /* Determine next available file number */
fileList = addrbook_get_bookfile_list( abf );
if( fileList ) {
fileNum = 1 + abf->maxValue;
addrbook_free_book( abf );
abf = NULL;
- // Create entries in address index
+ /* Create entries in address index */
if( retVal ) {
abf = addrbook_create_book();
addrbook_set_name( abf, displayName );
GtkWidget *statusbar;
gint status_cid;
- // Basic data tab
+ /* Basic data tab */
GtkWidget *entry_name;
GtkWidget *entry_first;
GtkWidget *entry_last;
GtkWidget *entry_nick;
- // EMail data tab
+ /* EMail data tab */
GtkWidget *entry_email;
GtkWidget *entry_alias;
GtkWidget *entry_remarks;
GtkWidget *clist_email;
- // Attribute data tab
+ /* Attribute data tab */
GtkWidget *entry_atname;
GtkWidget *entry_atvalue;
GtkWidget *clist_attrib;
#define PAGE_EMAIL 1
#define PAGE_ATTRIBUTES 2
-/*
+#if 0
#define SET_LABEL_AND_ENTRY(str, entry, top) \
{ \
label = gtk_label_new(str); \
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);
return item;
}
-*/
+#endif /* 0 */
static void edit_person_status_show( gchar *msg ) {
if( personeditdlg.statusbar != NULL ) {
ItemEMail *email = gtk_clist_get_row_data( clist, row );
edit_person_email_clear( NULL );
if( email ) {
- // Remove list entry
+ /* Remove list entry */
gtk_clist_remove( clist, row );
addritem_free_item_email( email );
email = NULL;
}
- // Position hilite bar
+ /* Position hilite bar */
email = gtk_clist_get_row_data( clist, row );
if( ! email ) {
personeditdlg.rowIndEMail = -1 + row;
UserAttribute *attrib = gtk_clist_get_row_data( clist, row );
edit_person_attrib_clear( NULL );
if( attrib ) {
- // Remove list entry
+ /* Remove list entry */
gtk_clist_remove( clist, row );
addritem_free_attribute( attrib );
attrib = NULL;
}
- // Position hilite bar
+ /* Position hilite bar */
attrib = gtk_clist_get_row_data( clist, row );
if( ! attrib ) {
personeditdlg.rowIndAttrib = -1 + row;
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);
cancelled);
vbox = gtk_vbox_new(FALSE, 4);
- //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);
gtk_widget_show(vnbox);
gtk_box_pack_start(GTK_BOX(vbox), vnbox, TRUE, TRUE, 0);
- // Notebook
+ /* Notebook */
notebook = gtk_notebook_new();
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
+ /* Status line */
hsbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
- // Button panel
+ /* Button panel */
gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
&cancel_btn, _("Cancel"), NULL, NULL);
gtk_box_pack_end(GTK_BOX(vnbox), hbbox, FALSE, FALSE, 0);
GTK_NOTEBOOK( personeditdlg.notebook ),
gtk_notebook_get_nth_page( GTK_NOTEBOOK( personeditdlg.notebook ), pageNum ), label );
- // Split into two areas
+ /* Split into two areas */
hbox = gtk_hbox_new( FALSE, 0 );
gtk_container_add( GTK_CONTAINER( vbox ), hbox );
- // EMail list
+ /* EMail list */
vboxl = gtk_vbox_new( FALSE, 4 );
gtk_container_add( GTK_CONTAINER( hbox ), vboxl );
gtk_container_set_border_width( GTK_CONTAINER(vboxl), 4 );
- // Address list
+ /* Address list */
clist_swin = gtk_scrolled_window_new( NULL, NULL );
gtk_container_add( GTK_CONTAINER(vboxl), clist_swin );
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(clist_swin),
for( i = 0; i < EMAIL_N_COLS; i++ )
GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(clist)->column[i].button, GTK_CAN_FOCUS);
- // Data entry area
+ /* Data entry area */
table = gtk_table_new( 4, 2, FALSE);
gtk_box_pack_start(GTK_BOX(vboxl), table, FALSE, FALSE, 0);
gtk_container_set_border_width( GTK_CONTAINER(table), 4 );
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
gtk_table_set_col_spacings(GTK_TABLE(table), 4);
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("E-Mail Address"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
entry_email = gtk_entry_new();
gtk_table_attach(GTK_TABLE(table), entry_email, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Next row
+ /* Next row */
++top;
label = gtk_label_new(_("Alias"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
entry_alias = gtk_entry_new();
gtk_table_attach(GTK_TABLE(table), entry_alias, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Next row
+ /* Next row */
++top;
label = gtk_label_new(_("Remarks"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
entry_remarks = gtk_entry_new();
gtk_table_attach(GTK_TABLE(table), entry_remarks, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Button box
+ /* Button box */
vboxb = gtk_vbox_new( FALSE, 4 );
gtk_box_pack_start(GTK_BOX(hbox), vboxb, FALSE, FALSE, 2);
gtk_container_set_border_width( GTK_CONTAINER(vbuttonbox), 4 );
gtk_container_add( GTK_CONTAINER(vboxb), vbuttonbox );
- // Buttons
+ /* Buttons */
buttonUp = gtk_button_new_with_label( _( "Move Up" ) );
gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonUp );
gtk_widget_show_all(vbox);
- // Event handlers
+ /* Event handlers */
gtk_signal_connect( GTK_OBJECT(clist), "select_row",
GTK_SIGNAL_FUNC( edit_person_email_list_selected), NULL );
gtk_signal_connect( GTK_OBJECT(buttonUp), "clicked",
GTK_NOTEBOOK( personeditdlg.notebook ),
gtk_notebook_get_nth_page( GTK_NOTEBOOK( personeditdlg.notebook ), pageNum ), label );
- // Split into two areas
+ /* Split into two areas */
hbox = gtk_hbox_new( FALSE, 0 );
gtk_container_add( GTK_CONTAINER( vbox ), hbox );
- // Attribute list
+ /* Attribute list */
vboxl = gtk_vbox_new( FALSE, 4 );
gtk_container_add( GTK_CONTAINER( hbox ), vboxl );
gtk_container_set_border_width( GTK_CONTAINER(vboxl), 4 );
- // Address list
+ /* Address list */
clist_swin = gtk_scrolled_window_new( NULL, NULL );
gtk_container_add( GTK_CONTAINER(vboxl), clist_swin );
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(clist_swin),
for( i = 0; i < ATTRIB_N_COLS; i++ )
GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(clist)->column[i].button, GTK_CAN_FOCUS);
- // Data entry area
+ /* Data entry area */
table = gtk_table_new( 4, 2, FALSE);
gtk_box_pack_start(GTK_BOX(vboxl), table, FALSE, FALSE, 0);
gtk_container_set_border_width( GTK_CONTAINER(table), 4 );
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
gtk_table_set_col_spacings(GTK_TABLE(table), 4);
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Name"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
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
+ /* Next row */
++top;
label = gtk_label_new(_("Value"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
entry_value = gtk_entry_new();
gtk_table_attach(GTK_TABLE(table), entry_value, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Button box
+ /* Button box */
vboxb = gtk_vbox_new( FALSE, 4 );
gtk_box_pack_start(GTK_BOX(hbox), vboxb, FALSE, FALSE, 2);
gtk_container_set_border_width( GTK_CONTAINER(vbuttonbox), 4 );
gtk_container_add( GTK_CONTAINER(vboxb), vbuttonbox );
- // Buttons
+ /* Buttons */
buttonDel = gtk_button_new_with_label( _( "Delete" ) );
gtk_container_add( GTK_CONTAINER(vbuttonbox), buttonDel );
gtk_widget_show_all(vbox);
- // Event handlers
+ /* Event handlers */
gtk_signal_connect( GTK_OBJECT(clist), "select_row",
GTK_SIGNAL_FUNC( edit_person_attrib_list_selected), NULL );
gtk_signal_connect( GTK_OBJECT(buttonDel), "clicked",
gtk_widget_show(personeditdlg.window);
manage_window_set_transient(GTK_WINDOW(personeditdlg.window));
- // Clear all fields
+ /* Clear all fields */
personeditdlg.rowIndEMail = -1;
personeditdlg.rowIndAttrib = -1;
edit_person_status_show( "" );
personeditdlg.editNew = TRUE;
}
- // Select appropriate start page
+ /* Select appropriate start page */
if( pgMail ) {
gtk_notebook_set_page( GTK_NOTEBOOK(personeditdlg.notebook), PAGE_EMAIL );
}
cn = g_strdup( gtk_editable_get_chars( GTK_EDITABLE(personeditdlg.entry_name), 0, -1 ) );
if( person ) {
- // Update email/attribute list
+ /* Update email/attribute list */
addrbook_update_address_list( abf, person, listEMail );
addrbook_update_attrib_list( abf, person, listAttrib );
}
else {
- // Create new person and email/attribute list
+ /* Create new person and email/attribute list */
if( cn == NULL || *cn == '\0' ) {
- // Wasting our time
+ /* Wasting our time */
if( listEMail == NULL && listAttrib == NULL ) cancelled = TRUE;
}
if( ! cancelled ) {
}
if( ! cancelled ) {
- // Set person stuff
+ /* Set person stuff */
addritem_person_set_common_name( person, cn );
addritem_person_set_first_name( person,
gtk_editable_get_chars( GTK_EDITABLE(personeditdlg.entry_first), 0, -1 ) );
#ifndef __EDITADDRESS_H__
#define __EDITADDRESS_H__
-// Function prototypes
ItemPerson *addressbook_edit_person( AddressBookFile *abf, ItemFolder *parent, ItemPerson *person, gboolean pgMail );
#endif /* __EDITADDRESS_H__ */
-
-/*
-* End of Source.
-*/
AddressBookFile *bookFile;
} addrbookedit_dlg;
-/* static struct _AddressFileSelection vcard_file_selector; */
+/* static struct _AddressFileSelection vcard_file_selector; */
/*
* Edit functions.
static void edit_book_enable_buttons( gboolean enable ) {
gtk_widget_set_sensitive( addrbookedit_dlg.check_btn, enable );
- // gtk_widget_set_sensitive( addrbookedit_dlg.file_btn, enable );
+ /* gtk_widget_set_sensitive( addrbookedit_dlg.file_btn, enable ); */
}
static void edit_book_name_focus( GtkWidget *widget, GdkEventFocus *event, gpointer data) {
GtkWidget *ok_btn;
GtkWidget *cancel_btn;
GtkWidget *check_btn;
- // GtkWidget *file_btn;
+ /* GtkWidget *file_btn; */
GtkWidget *statusbar;
GtkWidget *hsbox;
gint top;
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings(GTK_TABLE(table), 8 );
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Name"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
check_btn = gtk_button_new_with_label( _(" Check File "));
gtk_table_attach(GTK_TABLE(table), check_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
- // Second row
+ /* Second row */
top = 1;
label = gtk_label_new(_("File"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(file_label), 0, 0.5);
gtk_table_attach(GTK_TABLE(table), file_label, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // file_btn = gtk_button_new_with_label( _(" ... "));
- // gtk_table_attach(GTK_TABLE(table), file_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
+ /* file_btn = gtk_button_new_with_label( _(" ... ")); */
+ /* gtk_table_attach(GTK_TABLE(table), file_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0); */
- // Status line
+ /* Status line */
hsbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
- // Button panel
+ /* 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_SIGNAL_FUNC(edit_book_ok), cancelled);
gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
GTK_SIGNAL_FUNC(edit_book_cancel), cancelled);
-// gtk_signal_connect(GTK_OBJECT(file_btn), "clicked",
-// GTK_SIGNAL_FUNC(edit_book_file_select), NULL);
+/* gtk_signal_connect(GTK_OBJECT(file_btn), "clicked", */
+/* GTK_SIGNAL_FUNC(edit_book_file_select), NULL); */
gtk_signal_connect(GTK_OBJECT(check_btn), "clicked",
GTK_SIGNAL_FUNC(edit_book_file_check), NULL);
addrbookedit_dlg.ok_btn = ok_btn;
addrbookedit_dlg.cancel_btn = cancel_btn;
addrbookedit_dlg.check_btn = check_btn;
- // addrbookedit_dlg.file_btn = file_btn;
+ /* addrbookedit_dlg.file_btn = file_btn; */
addrbookedit_dlg.statusbar = statusbar;
addrbookedit_dlg.status_cid = gtk_statusbar_get_context_id( GTK_STATUSBAR(statusbar), "Edit Addressbook Dialog" );
}
abf = addrbook_create_book();
addrbook_set_path( abf, addrIndex->filePath );
- // Take initial guess at file name
+ /* Take initial guess at file name */
newFile = edit_book_guess_file( abf );
if( newFile ) {
tmp = g_strdup_printf( "<%s>", newFile );
}
else {
if( newBook ) {
- // Get final file name in case it changed
+ /* Get final file name in case it changed */
newFile = edit_book_guess_file( abf );
addrbook_set_file( abf, newFile );
g_free( newFile );
}
g_free( sName );
- // Save data
+ /* Save data */
if( abf ) addrbook_save_data( abf );
return ads;
#ifndef __EDITBOOK_H__
#define __EDITBOOK_H__
-// Function prototypes
AdapterDSource *addressbook_edit_book( AddressIndex *addrIndex, AdapterDSource *ads );
#endif /* __EDITBOOK_H__ */
-
-/*
-* End of Source.
-*/
-
GtkWidget *statusbar;
gint status_cid;
- // Basic data tab
+ /* Basic data tab */
GtkWidget *entry_name;
GtkCList *clist_group;
GtkCList *clist_avail;
gtk_widget_show( vbox );
gtk_container_add( GTK_CONTAINER( window ), vbox );
- // Group area
+ /* Group area */
hboxg = gtk_hbox_new( FALSE, 0 );
gtk_box_pack_start(GTK_BOX(vbox), hboxg, FALSE, FALSE, 0);
- // Data entry area
+ /* Data entry area */
table = gtk_table_new( 1, 3, FALSE);
gtk_box_pack_start(GTK_BOX(hboxg), table, TRUE, TRUE, 0);
gtk_container_set_border_width( GTK_CONTAINER(table), 4 );
gtk_table_set_row_spacings(GTK_TABLE(table), 0);
gtk_table_set_col_spacings(GTK_TABLE(table), 4);
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Group Name"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
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);
- // List area
+ /* List area */
hboxl = gtk_hbox_new( FALSE, 6 );
gtk_container_set_border_width( GTK_CONTAINER(hboxl), 8 );
gtk_box_pack_start(GTK_BOX(vbox), hboxl, TRUE, TRUE, 0);
- // Group list
+ /* Group list */
vboxl = gtk_vbox_new( FALSE, 0 );
gtk_box_pack_start(GTK_BOX(hboxl), vboxl, TRUE, TRUE, 0);
for( i = 0; i < GROUP_N_COLS; i++ )
GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(clist_group)->column[i].button, GTK_CAN_FOCUS);
- // Available list
+ /* Available list */
vboxl = gtk_vbox_new( FALSE, 0 );
gtk_box_pack_start(GTK_BOX(hboxl), vboxl, TRUE, TRUE, 0);
for( i = 0; i < GROUP_N_COLS; i++ )
GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(clist_avail)->column[i].button, GTK_CAN_FOCUS);
- // Status line
+ /* Status line */
hsbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
- // Button panel
+ /* 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_widget_show_all(vbox);
- // Event handlers
+ /* Event handlers */
gtk_signal_connect( GTK_OBJECT(clist_group), "select_row",
GTK_SIGNAL_FUNC( edit_group_group_selected), NULL );
gtk_signal_connect( GTK_OBJECT(clist_avail), "select_row",
gtk_widget_show(groupeditdlg.window);
manage_window_set_transient(GTK_WINDOW(groupeditdlg.window));
- // Clear all fields
+ /* Clear all fields */
groupeditdlg.rowIndGroup = -1;
groupeditdlg.rowIndAvail = -1;
edit_group_status_show( "" );
listEMail = edit_group_build_email_list();
if( group ) {
- // Update email list
+ /* Update email list */
addrbook_update_group_list( abf, group, listEMail );
}
else {
- // Create new person and email list
+ /* Create new person and email list */
group = addrbook_add_group_list( abf, parent, listEMail );
}
addritem_group_set_name( group, gtk_editable_get_chars( GTK_EDITABLE(groupeditdlg.entry_name), 0, -1 ) );
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/*
- * Edit VCard address book data.
- */
-
#ifndef __EDITGROUP_H__
#define __EDITGROUP_H__
-// Function prototypes
ItemGroup *addressbook_edit_group( AddressBookFile *abf, ItemFolder *folder, ItemGroup *group );
ItemFolder *addressbook_edit_folder( AddressBookFile *abf, ItemFolder *parent, ItemFolder *folder );
#endif /* __EDITGROUP_H__ */
-
-/*
-* End of Source.
-*/
-
if( sFile ) {
g_strchomp( sFile ); g_strchug( sFile );
if( *sFile != '\0' ) {
- // Attempt to read file
+ /* Attempt to read file */
JPilotFile *jpf = jpilot_create_path( sFile );
t = jpilot_read_data( jpf );
if( t == MGU_SUCCESS ) {
- // Set check boxes
+ /* Set check boxes */
edit_jpilot_fill_check_box( jpf );
flg = TRUE;
}
}
}
if( ! flg ) {
- // Clear all check boxes
+ /* Clear all check boxes */
edit_jpilot_fill_check_box_new();
}
g_free( sFile );
- // Display appropriate message
+ /* Display appropriate message */
if( t == MGU_SUCCESS ) {
sMsg = "";
}
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Name"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
check_btn = gtk_button_new_with_label( _(" Check File "));
gtk_table_attach(GTK_TABLE(table), check_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
- // Second row
+ /* Second row */
top = 1;
label = gtk_label_new(_("File"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
file_btn = gtk_button_new_with_label( _(" ... "));
gtk_table_attach(GTK_TABLE(table), file_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
- // Third row
+ /* Third row */
top = 2;
frame_custom = gtk_frame_new(_("Additional e-Mail address item(s)"));
gtk_table_attach(GTK_TABLE(table), frame_custom, 1, 2, top, (top + JPILOT_NUM_CUSTOM_LABEL), GTK_FILL, 0, 0, 0);
- // Now do custom labels.
+ /* Now do custom labels. */
vbox_custom = gtk_vbox_new (FALSE, 8);
for( i = 0; i < JPILOT_NUM_CUSTOM_LABEL; i++ ) {
hlbox = gtk_hbox_new( FALSE, 0 );
gtk_container_add (GTK_CONTAINER (frame_custom), vbox_custom);
gtk_container_set_border_width( GTK_CONTAINER(vbox_custom), 8 );
- // Status line
+ /* Status line */
hsbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
- // Button panel
+ /* 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);
#ifdef USE_JPILOT
-// Function prototypes
AdapterDSource *addressbook_edit_jpilot( AddressIndex *addrIndex, AdapterDSource *ads );
#endif /* USE_JPILOT */
#endif /* __EDITJPILOT_H__ */
-
-/*
-* End of Source.
-*/
-
*/
/*
- * Edit VCard address book data.
+ * Edit LDAP address book data.
*/
#ifdef HAVE_CONFIG_H
g_strchomp( sBind ); g_strchug( sBind );
g_strchomp( sPass ); g_strchug( sPass );
if( *sHost != '\0' ) {
- // Test connection to server
+ /* Test connection to server */
if( syldap_test_connect_s( sHost, iPort ) ) {
- // Attempt to read base DN
+ /* Attempt to read base DN */
GList *baseDN = syldap_read_basedn_s( sHost, iPort, sBind, sPass, iTime );
if( baseDN ) {
GList *node = baseDN;
g_free( sPass );
if( sBaseDN ) {
- // Load search DN
+ /* Load search DN */
gtk_entry_set_text(GTK_ENTRY(ldapedit.entry_baseDN), sBaseDN);
g_free( sBaseDN );
}
- // Display appropriate message
+ /* Display appropriate message */
if( flg ) {
sMsg = _( "Connected successfully to server" );
}
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 );
- // Notebook
+ /* 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 );
- // Status line
+ /* Status line */
hsbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
- // Button panel
+ /* 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);
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 );
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Name"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
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
+ /* Next row */
++top;
label = gtk_label_new(_("Hostname"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
entry_server = gtk_entry_new();
gtk_table_attach(GTK_TABLE(table), entry_server, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Next row
+ /* Next row */
++top;
label = gtk_label_new(_("Port"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
check_btn = gtk_button_new_with_label( _(" Check Server "));
gtk_table_attach(GTK_TABLE(table), check_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
- // Next row
+ /* Next row */
++top;
label = gtk_label_new(_("Search Base"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
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 );
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Search Criteria"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
reset_btn = gtk_button_new_with_label( _(" Reset "));
gtk_table_attach(GTK_TABLE(table), reset_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
- // Next row
+ /* Next row */
++top;
label = gtk_label_new(_("Bind DN"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
entry_bindDN = gtk_entry_new();
gtk_table_attach(GTK_TABLE(table), entry_bindDN, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Next row
+ /* Next row */
++top;
label = gtk_label_new(_("Bind Password"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
entry_bindPW = gtk_entry_new();
gtk_table_attach(GTK_TABLE(table), entry_bindPW, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Next row
+ /* Next row */
++top;
label = gtk_label_new(_("Timeout (secs)"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_timeout), TRUE);
gtk_table_attach(GTK_TABLE(table), hbox_spin, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Next row
+ /* Next row */
++top;
label = gtk_label_new(_("Maximum Entries"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/*
- * Edit VCard address book data.
- */
-
#ifndef __EDITLDAP_H__
#define __EDITLDAP_H__
#ifdef USE_LDAP
-// Function prototypes
AdapterDSource *addressbook_edit_ldap( AddressIndex *addrIndex, AdapterDSource *ads );
#endif /* USE_LDAP */
#endif /* __EDITLDAP_H__ */
-
-/*
-* End of Source.
-*/
-
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;
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings(GTK_TABLE(table), 8);
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Hostname"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_table_attach(GTK_TABLE(table), host_label, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(host_label), 0, 0.5);
- // Second row
+ /* Second row */
top = 1;
label = gtk_label_new(_("Port"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_table_attach(GTK_TABLE(table), port_label, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
gtk_misc_set_alignment(GTK_MISC(port_label), 0, 0.5);
- // Third row
+ /* Third row */
top = 2;
label = gtk_label_new(_("Search Base"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
basedn_entry = gtk_entry_new();
gtk_table_attach(GTK_TABLE(table), basedn_entry, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Basedn list
+ /* Basedn list */
vlbox = gtk_vbox_new(FALSE, 8);
gtk_box_pack_start(GTK_BOX(vbox), vlbox, TRUE, TRUE, 0);
gtk_container_set_border_width( GTK_CONTAINER(vlbox), 8 );
gtk_clist_set_column_title( GTK_CLIST(basedn_list), 0, _( "Available Search Base(s)" ) );
gtk_clist_set_selection_mode(GTK_CLIST(basedn_list), GTK_SELECTION_BROWSE);
- // Status line
+ /* Status line */
hsbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
- // Button panel
+ /* 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_label_set_text(GTK_LABEL(ldapedit_basedn.host_label), hostName);
gtk_label_set_text(GTK_LABEL(ldapedit_basedn.port_label), sPort);
if( *sHost != '\0' ) {
- // Test connection to server
+ /* Test connection to server */
if( syldap_test_connect_s( sHost, iPort ) ) {
- // Attempt to read base DN
+ /* Attempt to read base DN */
GList *baseDN = syldap_read_basedn_s( sHost, iPort, bindDN, bindPW, tov );
if( baseDN ) {
GList *node = baseDN;
}
g_free( sHost );
- // Display appropriate message
+ /* Display appropriate message */
if( flgConn ) {
if( ! flgDN ) {
sMsg = _( "Could not read Search Base(s) from server - please set manually" );
edit_ldap_bdn_load_data( hostName, port, tov, bindDN, bindPW );
gtk_widget_show(ldapedit_basedn.window);
-// sprintf( sPort, "%d", port );
-// gtk_label_set_text(GTK_LABEL(ldapedit_basedn.host_label), hostName);
-// gtk_label_set_text(GTK_LABEL(ldapedit_basedn.port_label), sPort);
+/* sprintf( sPort, "%d", port ); */
+/* gtk_label_set_text(GTK_LABEL(ldapedit_basedn.host_label), hostName); */
+/* gtk_label_set_text(GTK_LABEL(ldapedit_basedn.port_label), sPort); */
gtk_entry_set_text(GTK_ENTRY(ldapedit_basedn.basedn_entry), baseDN);
gtk_main();
gtk_widget_hide(ldapedit_basedn.window);
if( ldapedit_basedn_cancelled ) return NULL;
-// if( cancelled == TRUE ) return NULL;
+/* if( cancelled == TRUE ) return NULL; */
if( ldapedit_basedn_bad_server ) return NULL;
retVal = g_strdup( gtk_editable_get_chars( GTK_EDITABLE(ldapedit_basedn.basedn_entry), 0, -1 ) );
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/*
- * Edit VCard address book data.
- */
-
#ifndef __EDITLDAP_BASEDN_H__
#define __EDITLDAP_BASEDN_H__
#ifdef USE_LDAP
-// Function prototypes
gchar *edit_ldap_basedn_selection( const gchar *hostName, const gint port, gchar *baseDN, const gint tov,
const gchar* bindDN, const gchar *bindPW );
#endif /* USE_LDAP */
#endif /* __EDITLDAP_BASEDN_H__ */
-
-/*
-* End of Source.
-*/
-
*/
/*
- * Edit VCard address book data.
+ * Edit vCard address book data.
*/
#ifdef HAVE_CONFIG_H
sMsg = "";
}
else if( t == MGU_BAD_FORMAT ) {
- sMsg = _("File does not appear to be VCard format.");
+ sMsg = _("File does not appear to be vCard format.");
}
else {
sMsg = _("Could not read file.");
static void edit_vcard_file_select_create( AddressFileSelection *afs ) {
GtkWidget *fileSelector;
- fileSelector = gtk_file_selection_new( _("Select VCard File") );
+ fileSelector = gtk_file_selection_new( _("Select vCard File") );
gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION(fileSelector) );
gtk_signal_connect( GTK_OBJECT (GTK_FILE_SELECTION(fileSelector)->ok_button),
"clicked", GTK_SIGNAL_FUNC (edit_vcard_file_ok), ( gpointer ) afs );
window = gtk_window_new(GTK_WINDOW_DIALOG);
gtk_widget_set_usize(window, 450, -1);
gtk_container_set_border_width( GTK_CONTAINER(window), 0 );
- gtk_window_set_title(GTK_WINDOW(window), _("Edit VCard Entry"));
+ gtk_window_set_title(GTK_WINDOW(window), _("Edit vCard Entry"));
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(window), TRUE);
gtk_signal_connect(GTK_OBJECT(window), "delete_event",
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings(GTK_TABLE(table), 8 );
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Name"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
check_btn = gtk_button_new_with_label( _(" Check File "));
gtk_table_attach(GTK_TABLE(table), check_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
- // Second row
+ /* Second row */
top = 1;
label = gtk_label_new(_("File"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
file_btn = gtk_button_new_with_label( _(" ... "));
gtk_table_attach(GTK_TABLE(table), file_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
- // Status line
+ /* Status line */
hsbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
- // Button panel
+ /* 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);
vcardedit.ok_btn = ok_btn;
vcardedit.cancel_btn = cancel_btn;
vcardedit.statusbar = statusbar;
- vcardedit.status_cid = gtk_statusbar_get_context_id( GTK_STATUSBAR(statusbar), "Edit VCard Dialog" );
+ vcardedit.status_cid = gtk_statusbar_get_context_id( GTK_STATUSBAR(statusbar), "Edit vCard Dialog" );
}
AdapterDSource *addressbook_edit_vcard( AddressIndex *addrIndex, AdapterDSource *ads ) {
gtk_entry_set_text(GTK_ENTRY(vcardedit.name_entry), vcf->name);
if (vcf->path)
gtk_entry_set_text(GTK_ENTRY(vcardedit.file_entry), vcf->path);
- gtk_window_set_title( GTK_WINDOW(vcardedit.window), _("Edit VCard Entry"));
+ gtk_window_set_title( GTK_WINDOW(vcardedit.window), _("Edit vCard Entry"));
}
else {
gtk_entry_set_text(GTK_ENTRY(vcardedit.name_entry), ADDRESSBOOK_GUESS_VCARD );
gtk_entry_set_text(GTK_ENTRY(vcardedit.file_entry), vcard_find_gnomecard() );
- gtk_window_set_title( GTK_WINDOW(vcardedit.window), _("Add New VCard Entry"));
+ gtk_window_set_title( GTK_WINDOW(vcardedit.window), _("Add New vCard Entry"));
}
gtk_main();
*/
/*
- * Edit VCard address book data.
+ * Edit vCard address book data.
*/
#ifndef __EDITVCARD_H__
#define __EDITVCARD_H__
-// Function prototypes
AdapterDSource *addressbook_edit_vcard( AddressIndex *addrIndex, AdapterDSource *ads );
#endif /* __EDITVCARD_H__ */
-
-/*
-* End of Source.
-*/
-
return ok;
}
+#define QUOTE_IF_REQUIRED(out, str) \
+{ \
+ if (*str != '"' && strchr(str, ' ')) { \
+ gint len; \
+ len = strlen(str) + 3; \
+ Xalloca(out, len, return IMAP_ERROR); \
+ g_snprintf(out, len, "\"%s\"", str); \
+ } else { \
+ Xstrdup_a(out, str, return IMAP_ERROR); \
+ } \
+}
+
static gint imap_status(IMAPSession *session, IMAPFolder *folder,
const gchar *path,
gint *messages, gint *recent, gint *unseen,
guint32 *uid_validity)
{
gchar *real_path;
+ gchar *real_path_;
gint ok;
GPtrArray *argbuf;
gchar *str;
argbuf = g_ptr_array_new();
real_path = imap_get_real_path(folder, path);
- if (strchr(real_path, ' ') != NULL)
- imap_cmd_gen_send(SESSION(session)->sock, "STATUS \"%s\" "
- "(MESSAGES RECENT UNSEEN UIDVALIDITY)",
- real_path);
- else
- imap_cmd_gen_send(SESSION(session)->sock, "STATUS %s "
- "(MESSAGES RECENT UNSEEN UIDVALIDITY)",
- real_path);
+ QUOTE_IF_REQUIRED(real_path_, real_path);
+ imap_cmd_gen_send(SESSION(session)->sock, "STATUS %s "
+ "(MESSAGES RECENT UNSEEN UIDVALIDITY)", real_path_);
ok = imap_cmd_ok(SESSION(session)->sock, argbuf);
if (ok != IMAP_SUCCESS) THROW(ok);
static gint imap_cmd_login(SockInfo *sock,
const gchar *user, const gchar *pass)
{
+ gchar *user_, *pass_;
gint ok;
- if (strchr(user, ' ') != NULL)
- imap_cmd_gen_send(sock, "LOGIN \"%s\" %s", user, pass);
- else
- imap_cmd_gen_send(sock, "LOGIN %s %s", user, pass);
+ QUOTE_IF_REQUIRED(user_, user);
+ QUOTE_IF_REQUIRED(pass_, pass);
+ imap_cmd_gen_send(sock, "LOGIN %s %s", user_, pass_);
ok = imap_cmd_ok(sock, NULL);
if (ok != IMAP_SUCCESS)
static gint imap_cmd_list(SockInfo *sock, const gchar *ref,
const gchar *mailbox, GPtrArray *argbuf)
{
- gchar *new_ref;
- gchar *new_mailbox;
+ gchar *ref_, *mailbox_;
if (!ref) ref = "\"\"";
if (!mailbox) mailbox = "\"\"";
- if (*ref != '"' && strchr(ref, ' ') != NULL)
- new_ref = g_strdup_printf("\"%s\"", ref);
- else
- new_ref = g_strdup(ref);
- if (*mailbox != '"' && strchr(mailbox, ' ') != NULL)
- new_mailbox = g_strdup_printf("\"%s\"", mailbox);
- else
- new_mailbox = g_strdup(mailbox);
-
- imap_cmd_gen_send(sock, "LIST %s %s", new_ref, new_mailbox);
-
- g_free(new_ref);
- g_free(new_mailbox);
+ QUOTE_IF_REQUIRED(ref_, ref);
+ QUOTE_IF_REQUIRED(mailbox_, mailbox);
+ imap_cmd_gen_send(sock, "LIST %s %s", ref_, mailbox_);
return imap_cmd_ok(sock, argbuf);
}
gchar *resp_str;
GPtrArray *argbuf;
gchar *select_cmd;
+ gchar *folder_;
*exists = *recent = *unseen = *uid_validity = 0;
argbuf = g_ptr_array_new();
else
select_cmd = "SELECT";
- if (strchr(folder, ' ') != NULL)
- imap_cmd_gen_send(sock, "%s \"%s\"", select_cmd, folder);
- else
- imap_cmd_gen_send(sock, "%s %s", select_cmd, folder);
+ QUOTE_IF_REQUIRED(folder_, folder);
+ imap_cmd_gen_send(sock, "%s %s", select_cmd, folder_);
if ((ok = imap_cmd_ok(sock, argbuf)) != IMAP_SUCCESS) THROW;
static gint imap_cmd_create(SockInfo *sock, const gchar *folder)
{
- if (strchr(folder, ' ') != NULL)
- imap_cmd_gen_send(sock, "CREATE \"%s\"", folder);
- else
- imap_cmd_gen_send(sock, "CREATE %s", folder);
+ gchar *folder_;
+
+ QUOTE_IF_REQUIRED(folder_, folder);
+ imap_cmd_gen_send(sock, "CREATE %s", folder_);
return imap_cmd_ok(sock, NULL);
}
static gint imap_cmd_delete(SockInfo *sock, const gchar *folder)
{
- if (strchr(folder, ' ') != NULL)
- imap_cmd_gen_send(sock, "DELETE \"%s\"", folder);
- else
- imap_cmd_gen_send(sock, "DELETE %s", folder);
+ gchar *folder_;
+
+ QUOTE_IF_REQUIRED(folder_, folder);
+ imap_cmd_gen_send(sock, "DELETE %s", folder_);
return imap_cmd_ok(sock, NULL);
}
static gint imap_cmd_copy(SockInfo *sock, guint32 uid, const gchar *destfolder)
{
gint ok;
+ gchar *destfolder_;
g_return_val_if_fail(destfolder != NULL, IMAP_ERROR);
- if (strchr(destfolder, ' ') != NULL)
- imap_cmd_gen_send(sock, "UID COPY %d \"%s\"", uid, destfolder);
- else
- imap_cmd_gen_send(sock, "UID COPY %d %s", uid, destfolder);
+ QUOTE_IF_REQUIRED(destfolder_, destfolder);
+ imap_cmd_gen_send(sock, "UID COPY %d %s", uid, destfolder_);
ok = imap_cmd_ok(sock, NULL);
if (ok != IMAP_SUCCESS) {
- log_warning(_("can't copy %d to %s\n"), uid, destfolder);
+ log_warning(_("can't copy %d to %s\n"), uid, destfolder_);
return -1;
}
return n;
}
-/* Shamelessly copied from JPilot (utils.c)
- These next 2 functions were copied from pi-file.c in the pilot-link app
- Exact value of "Jan 1, 1970 0:00:00 GMT" - "Jan 1, 1904 0:00:00 GMT" */
+/* Shamelessly copied from JPilot (utils.c) */
+/*These next 2 functions were copied from pi-file.c in the pilot-link app */
+/* Exact value of "Jan 1, 1970 0:00:00 GMT" - "Jan 1, 1904 0:00:00 GMT" */
#define PILOT_TIME_DELTA (unsigned)(2082844800)
time_t pilot_time_to_unix_time ( unsigned long raw_time ) {
return 0;
}
-/* Shamelessly copied from JPilot (libplugin.c)
- Read file size. */
+/* Shamelessly copied from JPilot (libplugin.c) */
+/* Read file size. */
static int jpilot_get_info_size( FILE *in, int *size ) {
RawDBHeader rdbh;
DBHeader dbh;
return MGU_SUCCESS;
}
-/* Read address file into address list. Based on JPilot's
- libplugin.c (jp_get_app_info) */
+/* Read address file into address list. Based on JPilot's */
+/* libplugin.c (jp_get_app_info) */
static gint jpilot_get_file_info( JPilotFile *pilotFile, unsigned char **buf, int *buf_size ) {
FILE *in;
int num;
#define FULLNAME_BUFSIZE 256
#define EMAIL_BUFSIZE 256
-/* Read address file into address cache. Based on JPilot's
- jp_read_DB_files (from libplugin.c) */
+/* Read address file into address cache. Based on JPilot's */
+/* jp_read_DB_files (from libplugin.c) */
static gint jpilot_read_file( JPilotFile *pilotFile ) {
FILE *in;
gchar *buf;
i++;
}
- /* Now go load all records */
+ /* Now go load all records */
while(!feof(in)) {
/* struct CategoryAppInfo *cat = &ai->category; */
g_list_free( remList );
}
-/* ============================================================================================
-
+/* ============================================================================================ */
+/*
* Read file into list. Main entry point
* Return: TRUE if file read successfully.
-
- ============================================================================================ */
+*/
+/* ============================================================================================ */
gint jpilot_read_data( JPilotFile *pilotFile ) {
g_return_val_if_fail( pilotFile != NULL, -1 );
GList *customLabels;
GList *labelInd;
gint retVal;
- // ItemFolder *rootFolder;
+ /* ItemFolder *rootFolder; */
gboolean accessFlag;
};
-// Limits
-#define JPILOT_NUM_LABELS 22 // Number of labels
-#define JPILOT_NUM_PHONELABELS 8 // Number of phone number labels
-#define JPILOT_NUM_CATEG 16 // Number of categories
-#define JPILOT_LEN_LABEL 15 // Max length of label
-#define JPILOT_LEN_CATEG 15 // Max length of category
-#define JPILOT_NUM_ADDR_PHONE 5 // Number of phone entries a person can have
+/* Limits */
+#define JPILOT_NUM_LABELS 22 /* Number of labels */
+#define JPILOT_NUM_PHONELABELS 8 /* Number of phone number labels */
+#define JPILOT_NUM_CATEG 16 /* Number of categories */
+#define JPILOT_LEN_LABEL 15 /* Max length of label */
+#define JPILOT_LEN_CATEG 15 /* Max length of category */
+#define JPILOT_NUM_ADDR_PHONE 5 /* Number of phone entries a person
+ can have */
/* Function prototypes */
JPilotFile *jpilot_create ( void );
body_label = gtk_label_new (_("Find text:"));
gtk_widget_show (body_label);
gtk_box_pack_start (GTK_BOX (hbox1), body_label, FALSE, FALSE, 0);
- //gtk_label_set_justify (GTK_LABEL (body_label), GTK_JUSTIFY_RIGHT);
- //gtk_misc_set_alignment (GTK_MISC (body_label), 1, 0.5);
body_entry = gtk_entry_new ();
gtk_widget_show (body_entry);
gchar *str;
AlertValue val;
- if (messageview_search_string(messageview, body_str, case_sens)
- == TRUE)
- break;
+ if (backward) {
+ if (messageview_search_string_backward
+ (messageview, body_str, case_sens) == TRUE)
+ break;
+ } else {
+ if (messageview_search_string
+ (messageview, body_str, case_sens) == TRUE)
+ break;
+ }
if (all_searched) {
alertpanel_message
val = alertpanel(_("Search finished"), str,
_("Yes"), _("No"), NULL);
- if (G_ALERTDEFAULT == val)
+ if (G_ALERTDEFAULT == val) {
manage_window_focus_in(window, NULL, NULL);
- else
+ messageview_set_position(messageview,
+ backward ? -1 : 0);
+ } else
break;
}
}
(GTK_EDITABLE(messageview->textview->text), 0, -1);
}
+void messageview_set_position(MessageView *messageview, gint pos)
+{
+ if (messageview->type == MVIEW_TEXT)
+ textview_set_position(messageview->textview, pos);
+}
+
gboolean messageview_search_string(MessageView *messageview, const gchar *str,
gboolean case_sens)
{
return FALSE;
}
+gboolean messageview_search_string_backward(MessageView *messageview,
+ const gchar *str,
+ gboolean case_sens)
+{
+ if (messageview->type == MVIEW_TEXT)
+ return textview_search_string_backward(messageview->textview,
+ str, case_sens);
+ return FALSE;
+}
+
GtkWidget *messageview_get_text_widget(MessageView *messageview)
{
return messageview->textview->text;
void messageview_set_font (MessageView *messageview);
void messageview_copy_clipboard (MessageView *messageview);
void messageview_select_all (MessageView *messageview);
+void messageview_set_position (MessageView *messageview,
+ gint pos);
gboolean messageview_search_string (MessageView *messageview,
const gchar *str,
gboolean case_sens);
+gboolean messageview_search_string_backward (MessageView *messageview,
+ const gchar *str,
+ gboolean case_sens);
GtkWidget *messageview_get_text_widget (MessageView *messageview);
if( ! list ) return NULL;
- // Calculate maximum length of text
+ /* Calculate maximum length of text */
len = 0;
node = list;
while( node ) {
node = g_slist_next( node );
}
- // Create new buffer.
+ /* Create new buffer. */
buf = g_new0( gchar, len+1 );
start = buf;
node = list;
#include <stdio.h>
#include <glib.h>
-// Error codes
+/* Error codes */
#define MGU_SUCCESS 0
#define MGU_BAD_ARGS -1
#define MGU_NO_FILE -2
#define MGU_OPEN_DIRECTORY -16
#define MGU_NO_PATH -17
-// Function prototypes
+/* Function prototypes */
void mgu_print_list ( GSList *list, FILE *stream );
void mgu_print_dlist ( GList *list, FILE *stream );
void mgu_free_list ( GSList *list );
fputs(buf, outfp);
}
}
- if (conv_fail) g_warning(_("Code conversion failed.\n"));
+ if (conv_fail)
+ g_warning(_("procmime_get_text_content(): Code conversion failed.\n"));
fclose(tmpfp);
rewind(outfp);
{
if (!window)
summary_search_create(summaryview);
+ else
+ gtk_widget_hide(window);
gtk_widget_grab_focus(search_btn);
gtk_widget_grab_focus(subject_entry);
if (search_all)
gtk_ctree_select(ctree, node);
else {
- summary_select_node(summaryview, node, TRUE);
- if (body_matched) {
- messageview_search_string
- (summaryview->messageview,
- body_str, case_sens);
+ if (summaryview->msg_is_toggled_on) {
+ summary_select_node
+ (summaryview, node, TRUE);
+ if (body_matched) {
+ messageview_search_string
+ (summaryview->messageview,
+ body_str, case_sens);
+ }
+ } else {
+ summary_select_node
+ (summaryview, node, FALSE);
}
break;
}
ldapServer->callBack = NULL;
- // Free internal stuff
+ /* Free internal stuff */
g_free( ldapServer->name );
g_free( ldapServer->hostName );
g_free( ldapServer->baseDN );
ldapServer->maxEntries = 0;
ldapServer->newSearch = FALSE;
- // Clear cache
+ /* Clear cache */
addrcache_clear( ldapServer->addressCache );
addrcache_free( ldapServer->addressCache );
- // Clear pointers
+ /* Clear pointers */
ldapServer->name = NULL;
ldapServer->hostName = NULL;
ldapServer->baseDN = NULL;
ldapServer->retVal = MGU_SUCCESS;
ldapServer->accessFlag = FALSE;
- // Now release LDAP object
+ /* Now release LDAP object */
g_free( ldapServer );
}
ItemPerson *person;
ItemEMail *email;
- // Find longest first name in list
+ /* Find longest first name in list */
while( nodeFirst ) {
if( firstName == NULL ) {
firstName = nodeFirst->data;
nodeFirst = g_slist_next( nodeFirst );
}
- // Format name
+ /* Format name */
if( listLast ) {
lastName = listLast->data;
}
addrcache_add_person( ldapServer->addressCache, person );
}
- // Add address item
+ /* Add address item */
while( nodeAddress ) {
email = addritem_create_item_email();
addritem_email_set_address( email, nodeAddress->data );
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] );
+ /* printf( "lv\t%s: %s\n", attr, vals[i] ); */
list = g_slist_append( list, g_strdup( vals[i] ) );
}
}
if( ( vals = ldap_get_values( ld, entry, attr ) ) != NULL ) {
if( vals[0] != NULL ) {
- // printf( "sv\t%s: %s\n", attr, vals[0] );
+ /* printf( "sv\t%s: %s\n", attr, vals[0] ); */
list = g_slist_append( list, g_strdup( vals[0] ) );
}
}
ldapServer->retVal = MGU_LDAP_CRITERIA;
- // Test search criteria
+ /* Test search criteria */
if( ldapServer->searchCriteria == NULL ) {
return FALSE;
}
return ldapServer->retVal;
}
- // Set timeout
+ /* Set timeout */
timeout.tv_sec = ldapServer->timeOut;
timeout.tv_usec = 0L;
return ldapServer->retVal;
}
- // printf( "connected to LDAP host %s on port %d\n", ldapServer->hostName, ldapServer->port );
+ /* printf( "connected to LDAP host %s on port %d\n", ldapServer->hostName, ldapServer->port ); */
- // Bind to the server, if required
+ /* Bind to the server, if required */
if( ldapServer->bindDN ) {
if( * ldapServer->bindDN != '\0' ) {
- // printf( "binding...\n" );
+ /* printf( "binding...\n" ); */
rc = ldap_simple_bind_s( ld, ldapServer->bindDN, ldapServer->bindPass );
- // printf( "rc=%d\n", rc );
+ /* printf( "rc=%d\n", rc ); */
if( rc != LDAP_SUCCESS ) {
- // printf( "LDAP Error: ldap_simple_bind_s: %s\n", ldap_err2string( rc ) );
+ /* printf( "LDAP Error: ldap_simple_bind_s: %s\n", ldap_err2string( rc ) ); */
ldap_unbind( ld );
ldapServer->retVal = MGU_LDAP_BIND;
return ldapServer->retVal;
}
}
- // Define all attributes we are interested in.
+ /* Define all attributes we are interested in. */
attribs[0] = SYLDAP_ATTR_DN;
attribs[1] = SYLDAP_ATTR_COMMONNAME;
attribs[2] = SYLDAP_ATTR_GIVENNAME;
attribs[5] = SYLDAP_ATTR_UID;
attribs[6] = NULL;
- // Create LDAP search string and apply search criteria
+ /* Create LDAP search string and apply search criteria */
criteria = g_strdup_printf( ldapServer->searchCriteria, ldapServer->searchValue );
rc = ldap_search_ext_s( ld, ldapServer->baseDN, LDAP_SCOPE_SUBTREE, criteria, attribs, 0, NULL, NULL,
&timeout, 0, &result );
return ldapServer->retVal;
}
if( rc != LDAP_SUCCESS ) {
- // printf( "LDAP Error: ldap_search_st: %s\n", ldap_err2string( rc ) );
+ /* printf( "LDAP Error: ldap_search_st: %s\n", ldap_err2string( rc ) ); */
ldap_unbind( ld );
ldapServer->retVal = MGU_LDAP_SEARCH;
return ldapServer->retVal;
}
- // printf( "Total results are: %d\n", ldap_count_entries( ld, result ) );
+ /* printf( "Total results are: %d\n", ldap_count_entries( ld, result ) ); */
- // Clear the cache if we have new entries, otherwise leave untouched.
+ /* Clear the cache if we have new entries, otherwise leave untouched. */
if( ldap_count_entries( ld, result ) > 0 ) {
addrcache_clear( ldapServer->addressCache );
}
- // Process results
+ /* Process results */
ldapServer->entriesRead = 0;
for( e = ldap_first_entry( ld, result ); e != NULL; e = ldap_next_entry( ld, e ) ) {
entriesFound = TRUE;
if( ldapServer->entriesRead >= ldapServer->maxEntries ) break;
- // printf( "DN: %s\n", ldap_get_dn( ld, e ) );
+ /* printf( "DN: %s\n", ldap_get_dn( ld, e ) ); */
- // Process all attributes
+ /* Process all attributes */
for( attribute = ldap_first_attribute( ld, e, &ber ); attribute != NULL;
attribute = ldap_next_attribute( ld, e, ber ) ) {
if( strcasecmp( attribute, SYLDAP_ATTR_COMMONNAME ) == 0 ) {
}
}
- // Free memory used to store attribute
+ /* Free memory used to store attribute */
ldap_memfree( attribute );
- // Format and add items to cache
+ /* Format and add items to cache */
syldap_build_items_fl( ldapServer, listAddress, listFirst, listLast );
- // Free up
+ /* Free up */
syldap_free_lists( listName, listAddress, listID, listDN, listFirst, listLast );
listName = listAddress = listID = listFirst = listLast = listDN = NULL;
syldap_free_lists( listName, listAddress, listID, listDN, listFirst, listLast );
listName = listAddress = listID = listFirst = listLast = listDN = NULL;
- // Free up and disconnect
+ /* Free up and disconnect */
ldap_msgfree( result );
ldap_unbind( ld );
ldapServer->newSearch = FALSE;
return ldapServer->retVal;
}
-// ============================================================================================
+/* ============================================================================================ */
/*
* Read data into list. Main entry point
* Return: TRUE if file read successfully.
*/
-// ============================================================================================
+/* ============================================================================================ */
gint syldap_read_data( SyldapServer *ldapServer ) {
g_return_val_if_fail( ldapServer != NULL, -1 );
ldapServer->accessFlag = FALSE;
pthread_detach( pthread_self() );
if( ldapServer->newSearch ) {
- // Read data into the list
+ /* Read data into the list */
syldap_search( ldapServer );
- // Mark cache
+ /* Mark cache */
ldapServer->addressCache->modified = FALSE;
ldapServer->addressCache->dataRead = TRUE;
ldapServer->accessFlag = FALSE;
}
- // Callback
+ /* Callback */
ldapServer->busyFlag = FALSE;
if( ldapServer->callBack ) {
sched_yield();
return ldapServer->retVal;
}
-// ============================================================================================
+/* ============================================================================================ */
/*
* Cancel read with thread.
*/
-// ============================================================================================
+/* ============================================================================================ */
void syldap_cancel_read( SyldapServer *ldapServer ) {
g_return_if_fail( ldapServer != NULL );
if( ldapServer->thread ) {
- // printf( "thread cancelled\n" );
+ /* printf( "thread cancelled\n" ); */
pthread_cancel( *ldapServer->thread );
}
ldapServer->thread = NULL;
ldapServer->busyFlag = FALSE;
}
-// ============================================================================================
+/* ============================================================================================ */
/*
* Read data into list using a background thread.
* Return: TRUE if file read successfully. Callback function will be
* notified when search is complete.
*/
-// ============================================================================================
+/* ============================================================================================ */
gint syldap_read_data_th( SyldapServer *ldapServer ) {
pthread_t thread;
if( host == NULL ) return baseDN;
if( port < 1 ) return baseDN;
- // Set timeout
+ /* Set timeout */
timeout.tv_usec = 0L;
if( tov > 0 ) {
timeout.tv_sec = tov;
timeout.tv_sec = 30L;
}
- // Connect to server.
+ /* Connect to server. */
if( ( ld = ldap_init( host, port ) ) == NULL ) {
return baseDN;
}
- // Bind to the server, if required
+ /* Bind to the server, if required */
if( bindDN ) {
if( *bindDN != '\0' ) {
rc = ldap_simple_bind_s( ld, bindDN, bindPW );
if( rc != LDAP_SUCCESS ) {
- // printf( "LDAP Error: ldap_simple_bind_s: %s\n", ldap_err2string( rc ) );
+ /* printf( "LDAP Error: ldap_simple_bind_s: %s\n", ldap_err2string( rc ) ); */
ldap_unbind( ld );
return baseDN;
}
}
}
- // Test for LDAP version 3
+ /* Test for LDAP version 3 */
attribs[0] = SYLDAP_V3_TEST_ATTR;
attribs[1] = NULL;
rc = ldap_search_ext_s( ld, SYLDAP_SEARCHBASE_V3, LDAP_SCOPE_BASE, SYLDAP_TEST_FILTER, attribs,
0, NULL, NULL, &timeout, 0, &result );
if( rc == LDAP_SUCCESS ) {
- // Process entries
+ /* Process entries */
for( e = ldap_first_entry( ld, result ); e != NULL; e = ldap_next_entry( ld, e ) ) {
- // printf( "DN: %s\n", ldap_get_dn( ld, e ) );
+ /* printf( "DN: %s\n", ldap_get_dn( ld, e ) ); */
- // Process attributes
+ /* Process attributes */
for( attribute = ldap_first_attribute( ld, e, &ber ); attribute != NULL;
attribute = ldap_next_attribute( ld, e, ber ) ) {
if( strcasecmp( attribute, SYLDAP_V3_TEST_ATTR ) == 0 ) {
if( ( vals = ldap_get_values( ld, e, attribute ) ) != NULL ) {
for( i = 0; vals[i] != NULL; i++ ) {
- // printf( "\t%s: %s\n", attribute, vals[i] );
+ /* printf( "\t%s: %s\n", attribute, vals[i] ); */
baseDN = g_list_append( baseDN, g_strdup( vals[i] ) );
}
}
}
if( baseDN == NULL ) {
- // Test for LDAP version 2
+ /* Test for LDAP version 2 */
attribs[0] = NULL;
rc = ldap_search_ext_s( ld, SYLDAP_SEARCHBASE_V2, LDAP_SCOPE_BASE, SYLDAP_TEST_FILTER, attribs,
0, NULL, NULL, &timeout, 0, &result );
if( rc == LDAP_SUCCESS ) {
- // Process entries
+ /* Process entries */
for( e = ldap_first_entry( ld, result ); e != NULL; e = ldap_next_entry( ld, e ) ) {
- // if( baseDN ) break;
- // printf( "DN: %s\n", ldap_get_dn( ld, e ) );
+ /* if( baseDN ) break; */
+ /* printf( "DN: %s\n", ldap_get_dn( ld, e ) ); */
- // Process attributes
+ /* Process attributes */
for( attribute = ldap_first_attribute( ld, e, &ber ); attribute != NULL;
attribute = ldap_next_attribute( ld, e, ber ) ) {
- // if( baseDN ) break;
+ /* if( baseDN ) break; */
if( strcasecmp( attribute, SYLDAP_V2_TEST_ATTR ) == 0 ) {
if( ( vals = ldap_get_values( ld, e, attribute ) ) != NULL ) {
for( i = 0; vals[i] != NULL; i++ ) {
char *ch;
- // Strip the 'ldb:' from the front of the value
+ /* Strip the 'ldb:' from the front of the value */
ch = ( char * ) strchr( vals[i], ':' );
if( ch ) {
gchar *bn = g_strdup( ++ch );
if( ldapServer->hostName == NULL ) return baseDN;
if( ldapServer->port < 1 ) return baseDN;
- // Set timeout
+ /* Set timeout */
timeout.tv_usec = 0L;
if( ldapServer->timeOut > 0 ) {
timeout.tv_sec = ldapServer->timeOut;
timeout.tv_sec = 30L;
}
- // Connect to server.
+ /* Connect to server. */
if( ( ld = ldap_init( ldapServer->hostName, ldapServer->port ) ) == NULL ) {
ldapServer->retVal = MGU_LDAP_INIT;
return baseDN;
}
- // Bind to the server, if required
+ /* Bind to the server, if required */
if( ldapServer->bindDN ) {
if( *ldapServer->bindDN != '\0' ) {
rc = ldap_simple_bind_s( ld, ldapServer->bindDN, ldapServer->bindPass );
if( rc != LDAP_SUCCESS ) {
- //printf( "LDAP Error: ldap_simple_bind_s: %s\n", ldap_err2string( rc ) );
+ /* printf( "LDAP Error: ldap_simple_bind_s: %s\n", ldap_err2string( rc ) ); */
ldap_unbind( ld );
ldapServer->retVal = MGU_LDAP_BIND;
return baseDN;
ldapServer->retVal = MGU_LDAP_SEARCH;
- // Test for LDAP version 3
+ /* Test for LDAP version 3 */
attribs[0] = SYLDAP_V3_TEST_ATTR;
attribs[1] = NULL;
rc = ldap_search_ext_s( ld, SYLDAP_SEARCHBASE_V3, LDAP_SCOPE_BASE, SYLDAP_TEST_FILTER, attribs,
0, NULL, NULL, &timeout, 0, &result );
if( rc == LDAP_SUCCESS ) {
- // Process entries
+ /* Process entries */
for( e = ldap_first_entry( ld, result ); e != NULL; e = ldap_next_entry( ld, e ) ) {
- // printf( "DN: %s\n", ldap_get_dn( ld, e ) );
+ /* printf( "DN: %s\n", ldap_get_dn( ld, e ) ); */
- // Process attributes
+ /* Process attributes */
for( attribute = ldap_first_attribute( ld, e, &ber ); attribute != NULL;
attribute = ldap_next_attribute( ld, e, ber ) ) {
if( strcasecmp( attribute, SYLDAP_V3_TEST_ATTR ) == 0 ) {
if( ( vals = ldap_get_values( ld, e, attribute ) ) != NULL ) {
for( i = 0; vals[i] != NULL; i++ ) {
- // printf( "\t%s: %s\n", attribute, vals[i] );
+ /* printf( "\t%s: %s\n", attribute, vals[i] ); */
baseDN = g_list_append( baseDN, g_strdup( vals[i] ) );
}
}
}
if( baseDN == NULL ) {
- // Test for LDAP version 2
+ /* Test for LDAP version 2 */
attribs[0] = NULL;
rc = ldap_search_ext_s( ld, SYLDAP_SEARCHBASE_V2, LDAP_SCOPE_BASE, SYLDAP_TEST_FILTER, attribs,
0, NULL, NULL, &timeout, 0, &result );
if( rc == LDAP_SUCCESS ) {
- // Process entries
+ /* Process entries */
for( e = ldap_first_entry( ld, result ); e != NULL; e = ldap_next_entry( ld, e ) ) {
- // if( baseDN ) break;
- // printf( "DN: %s\n", ldap_get_dn( ld, e ) );
+ /* if( baseDN ) break; */
+ /* printf( "DN: %s\n", ldap_get_dn( ld, e ) ); */
- // Process attributes
+ /* Process attributes */
for( attribute = ldap_first_attribute( ld, e, &ber ); attribute != NULL;
attribute = ldap_next_attribute( ld, e, ber ) ) {
- // if( baseDN ) break;
+ /* if( baseDN ) break; */
if( strcasecmp( attribute, SYLDAP_V2_TEST_ATTR ) == 0 ) {
if( ( vals = ldap_get_values( ld, e, attribute ) ) != NULL ) {
for( i = 0; vals[i] != NULL; i++ ) {
char *ch;
- // Strip the 'ldb:' from the front of the value
+ /* Strip the 'ldb:' from the front of the value */
ch = ( char * ) strchr( vals[i], ':' );
if( ch ) {
gchar *bn = g_strdup( ++ch );
gboolean syldap_test_ldap_lib() {
void *handle, *fun;
- // Get library
+ /* Get library */
handle = dlopen( LDAP_LINK_LIB_NAME_1, RTLD_LAZY );
if( ! handle ) {
return FALSE;
}
- // Test for symbols we need
+ /* Test for symbols we need */
fun = dlsym( handle, "ldap_init" );
if( ! fun ) {
dlclose( handle );
#define SYLDAP_ATTR_EMAIL "mail"
#define SYLDAP_ATTR_UID "uid"
-// VCard object
typedef struct _SyldapServer SyldapServer;
struct _SyldapServer {
gchar *name;
gint timeOut;
gboolean newSearch;
AddressCache *addressCache;
- // ItemFolder *rootFolder;
+ /* ItemFolder *rootFolder; */
gboolean accessFlag;
gint retVal;
pthread_t *thread;
gint syldap_read_data_th ( SyldapServer *ldapServer );
void syldap_cancel_read ( SyldapServer *ldapServer );
-// GList *syldap_get_address_list ( const SyldapServer *ldapServer );
+/* GList *syldap_get_address_list ( const SyldapServer *ldapServer ); */
ItemFolder *syldap_get_root_folder ( SyldapServer *ldapServer );
GList *syldap_get_list_person ( SyldapServer *ldapServer );
GList *syldap_get_list_folder ( SyldapServer *ldapServer );
gtk_signal_connect(GTK_OBJECT(text_sb), "key_press_event",
GTK_SIGNAL_FUNC(textview_key_pressed),
textview);
- gtk_signal_connect(GTK_OBJECT(text_sb), "button_press_event",
- GTK_SIGNAL_FUNC(textview_button_pressed),
- textview);
+ gtk_signal_connect_after(GTK_OBJECT(text_sb), "button_press_event",
+ GTK_SIGNAL_FUNC(textview_button_pressed),
+ textview);
gtk_signal_connect(GTK_OBJECT(text_mb), "key_press_event",
GTK_SIGNAL_FUNC(textview_key_pressed),
textview);
- gtk_signal_connect(GTK_OBJECT(text_mb), "button_press_event",
- GTK_SIGNAL_FUNC(textview_button_pressed),
- textview);
+ gtk_signal_connect_after(GTK_OBJECT(text_mb), "button_press_event",
+ GTK_SIGNAL_FUNC(textview_button_pressed),
+ textview);
gtk_widget_show(scrolledwin_sb);
gtk_widget_show(scrolledwin_mb);
textview->text_is_mb = FALSE;
textview->uri_list = NULL;
textview->body_pos = 0;
+ textview->cur_pos = 0;
return textview;
}
gtk_text_freeze(text);
textview->body_pos = 0;
+ textview->cur_pos = 0;
if (headers) {
textview_show_header(textview, headers);
H_ORGANIZATION = 11,
};
+void textview_set_position(TextView *textview, gint pos)
+{
+ if (pos < 0) {
+ textview->cur_pos =
+ gtk_text_get_length(GTK_TEXT(textview->text));
+ } else {
+ textview->cur_pos = pos;
+ }
+}
+
static GPtrArray *textview_scan_header(TextView *textview, FILE *fp)
{
gchar buf[BUFFSIZE];
wcs = strdup_mbstowcs(str);
g_return_val_if_fail(wcs != NULL, FALSE);
len = wcslen(wcs);
- pos = gtk_editable_get_position(GTK_EDITABLE(text));
+ pos = textview->cur_pos;
if (pos < textview->body_pos)
pos = textview->body_pos;
text_len = gtk_text_get_length(text);
+ if (text_len - pos < len) {
+ g_free(wcs);
+ return FALSE;
+ }
for (; pos < text_len; pos++) {
if (text_len - pos < len) break;
if (gtkut_text_match_string(text, pos, wcs, len, case_sens)
== TRUE) {
- gtk_text_freeze(text);
- gtk_text_set_point(text, pos + len);
- gtk_editable_set_position(GTK_EDITABLE(text), pos + len);
+ gtk_editable_set_position(GTK_EDITABLE(text),
+ pos + len);
gtk_editable_select_region(GTK_EDITABLE(text),
pos, pos + len);
- gtk_text_thaw(text);
+ textview_set_position(textview, pos + len);
found = TRUE;
break;
}
+ if (text_len - pos == len) break;
+ }
+
+ g_free(wcs);
+ return found;
+}
+
+gboolean textview_search_string_backward(TextView *textview, const gchar *str,
+ gboolean case_sens)
+{
+ GtkText *text = GTK_TEXT(textview->text);
+ gint pos;
+ wchar_t *wcs;
+ gint len;
+ gint text_len;
+ gboolean found = FALSE;
+
+ g_return_val_if_fail(str != NULL, FALSE);
+
+ wcs = strdup_mbstowcs(str);
+ g_return_val_if_fail(wcs != NULL, FALSE);
+ len = wcslen(wcs);
+ pos = textview->cur_pos;
+ text_len = gtk_text_get_length(text);
+ if (text_len - textview->body_pos < len) {
+ g_free(wcs);
+ return FALSE;
+ }
+ if (pos <= textview->body_pos || text_len - pos < len)
+ pos = text_len - len;
+
+ for (; pos >= textview->body_pos; pos--) {
+ if (gtkut_text_match_string(text, pos, wcs, len, case_sens)
+ == TRUE) {
+ gtk_editable_set_position(GTK_EDITABLE(text), pos);
+ gtk_editable_select_region(GTK_EDITABLE(text),
+ pos, pos + len);
+ textview_set_position(textview, pos - 1);
+ found = TRUE;
+ break;
+ }
+ if (pos == textview->body_pos) break;
}
g_free(wcs);
static void textview_button_pressed(GtkWidget *widget, GdkEventButton *event,
TextView *textview)
{
+ textview->cur_pos =
+ gtk_editable_get_position(GTK_EDITABLE(textview->text));
+
if (event &&
((event->button == 1 && event->type == GDK_2BUTTON_PRESS)
|| event->button == 2 || event->button == 3)) {
GSList *cur;
- guint current_pos;
-
- current_pos = GTK_EDITABLE(textview->text)->current_pos;
for (cur = textview->uri_list; cur != NULL; cur = cur->next) {
RemoteURI *uri = (RemoteURI *)cur->data;
- if (current_pos >= uri->start &&
- current_pos < uri->end) {
+ if (textview->cur_pos >= uri->start &&
+ textview->cur_pos < uri->end) {
if (!g_strncasecmp(uri->uri, "mailto:", 7)) {
if (event->button == 3) {
gchar *fromname, *fromaddress;
GSList *uri_list;
gint body_pos;
+ gint cur_pos;
GdkFont *msgfont;
GdkFont *boldfont;
void textview_destroy (TextView *textview);
void textview_set_font (TextView *textview,
const gchar *codeset);
+void textview_set_position (TextView *textview,
+ gint pos);
void textview_scroll_one_line (TextView *textview,
gboolean up);
gboolean textview_scroll_page (TextView *textview,
void textview_update_message_colors (void);
-gboolean textview_search_string (TextView *textview,
- const gchar *str,
- gboolean case_sens);
+gboolean textview_search_string (TextView *textview,
+ const gchar *str,
+ gboolean case_sens);
+gboolean textview_search_string_backward (TextView *textview,
+ const gchar *str,
+ gboolean case_sens);
#endif /* __TEXTVIEW_H__ */
*/
/*
- * Functions necessary to access VCard files. VCard files are used
+ * Functions necessary to access vCard files. vCard files are used
* by GnomeCard for addressbook, and Netscape for sending business
* card information. Refer to RFC2426 for more information.
*/
addrcache_clear( cardFile->addressCache );
addrcache_free( cardFile->addressCache );
- // Clear pointers
+ /* Clear pointers */
cardFile->file = NULL;
cardFile->name = NULL;
cardFile->path = NULL;
static gint vcard_open_file( VCardFile* cardFile ) {
g_return_val_if_fail( cardFile != NULL, -1 );
- // fprintf( stdout, "Opening file\n" );
+ /* fprintf( stdout, "Opening file\n" ); */
cardFile->addressCache->dataRead = FALSE;
if( cardFile->path ) {
cardFile->file = fopen( cardFile->path, "r" );
if( ! cardFile->file ) {
- // fprintf( stderr, "can't open %s\n", cardFile->path );
+ /* fprintf( stderr, "can't open %s\n", cardFile->path ); */
cardFile->retVal = MGU_OPEN_FILE;
return cardFile->retVal;
}
}
else {
- // fprintf( stderr, "file not specified\n" );
+ /* fprintf( stderr, "file not specified\n" ); */
cardFile->retVal = MGU_NO_FILE;
return cardFile->retVal;
}
line = vcard_get_line( cardFile );
}
- // Coalesce linked list into one long buffer.
+ /* Coalesce linked list into one long buffer. */
line = mgu_list_coalesce( listQP );
- // Clean up
+ /* Clean up */
mgu_free_list( listQP );
listQP = NULL;
return line;
value = g_strndup( start, len+1 );
}
else {
- // Ensure that we get an empty string
+ /* Ensure that we get an empty string */
value = g_strndup( "", 1 );
}
value[ len ] = '\0';
}
}
-// Unescape characters in quoted-printable string.
+/* Unescape characters in quoted-printable string. */
static void vcard_unescape_qp( gchar *value ) {
gchar *ptr, *src, *dest;
gint d, v = 0;
}
}
if( gotch ) {
- // Replace = with char and move down in buffer
+ /* Replace = with char and move down in buffer */
*ptr = v;
src = ptr + 3;
dest = ptr + 1;
/*
* Read file data into root folder.
-* Note that one VCard can have multiple E-Mail addresses (MAIL tags);
+* Note that one vCard can have multiple E-Mail addresses (MAIL tags);
* these are broken out into separate address items. An address item
* is generated for the person identified by FN tag and each EMAIL tag.
* If a sub-type is included in the EMAIL entry, this will be used as
-* the Remarks member. Also note that it is possible for one VCard
+* the Remarks member. Also note that it is possible for one vCard
* entry to have multiple FN tags; this might not make sense. However,
* 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;
GSList *listName = NULL, *listAddress = NULL, *listRemarks = NULL, *listID = NULL;
- //GSList *listQP = NULL;
+ /* GSList *listQP = NULL; */
for( ;; ) {
gchar *line = vcard_get_line( cardFile );
if( line == NULL ) break;
- // fprintf( stdout, "%s\n", line );
+ /* fprintf( stdout, "%s\n", line ); */
/* Parse line */
tagtemp = vcard_get_tagname( line, VCARD_SEP_TAG );
if( tagtemp ) {
- // fprintf( stdout, "\ttemp: %s\n", tagtemp );
+ /* fprintf( stdout, "\ttemp: %s\n", tagtemp ); */
tagvalue = vcard_get_tagvalue( line, VCARD_SEP_TAG );
tagname = vcard_get_tagname( tagtemp, VCARD_SEP_TYPE );
tagtype = vcard_get_tagvalue( tagtemp, VCARD_SEP_TYPE );
tagtemp = NULL;
}
- // fprintf( stdout, "\tname: %s\n", tagname );
- // fprintf( stdout, "\ttype: %s\n", tagtype );
- // fprintf( stdout, "\tvalue: %s\n", tagvalue );
+ /* fprintf( stdout, "\tname: %s\n", tagname ); */
+ /* fprintf( stdout, "\ttype: %s\n", tagtype ); */
+ /* fprintf( stdout, "\tvalue: %s\n", tagvalue ); */
if( tagvalue ) {
if( g_strcasecmp( tagtype, VCARD_TYPE_QP ) == 0 ) {
- // Quoted-Printable: could span multiple lines
+ /* Quoted-Printable: could span multiple lines */
tagvalue = vcard_read_qp( cardFile, tagvalue );
vcard_unescape_qp( tagvalue );
- // fprintf( stdout, "QUOTED-PRINTABLE !!! final\n>%s<\n", tagvalue );
+ /* fprintf( stdout, "QUOTED-PRINTABLE !!! final\n>%s<\n", tagvalue ); */
}
if( g_strcasecmp( tagname, VCARD_TAG_START ) == 0 &&
g_strcasecmp( tagvalue, VCARD_NAME ) == 0 ) {
- // fprintf( stdout, "start card\n" );
+ /* fprintf( stdout, "start card\n" ); */
vcard_free_lists( listName, listAddress, listRemarks, listID );
listName = listAddress = listRemarks = listID = NULL;
}
if( g_strcasecmp( tagname, VCARD_TAG_FULLNAME ) == 0 ) {
- // fprintf( stdout, "- full name: %s\n", tagvalue );
+ /* fprintf( stdout, "- full name: %s\n", tagvalue ); */
listName = g_slist_append( listName, g_strdup( tagvalue ) );
}
if( g_strcasecmp( tagname, VCARD_TAG_EMAIL ) == 0 ) {
- // fprintf( stdout, "- address: %s\n", tagvalue );
+ /* fprintf( stdout, "- address: %s\n", tagvalue ); */
listAddress = g_slist_append( listAddress, g_strdup( tagvalue ) );
listRemarks = g_slist_append( listRemarks, g_strdup( tagtype ) );
}
if( g_strcasecmp( tagname, VCARD_TAG_UID ) == 0 ) {
- // fprintf( stdout, "- id: %s\n", tagvalue );
+ /* fprintf( stdout, "- id: %s\n", tagvalue ); */
listID = g_slist_append( listID, g_strdup( tagvalue ) );
}
if( g_strcasecmp( tagname, VCARD_TAG_END ) == 0 &&
g_strcasecmp( tagvalue, VCARD_NAME ) == 0 ) {
- // VCard is complete
- // fprintf( stdout, "end card\n--\n" );
- // vcard_dump_lists( listName, listAddress, listRemarks, listID, stdout );
+ /* vCard is complete */
+ /* fprintf( stdout, "end card\n--\n" ); */
+ /* vcard_dump_lists( listName, listAddress, listRemarks, listID, stdout ); */
vcard_build_items( cardFile, listName, listAddress, listRemarks, listID );
vcard_free_lists( listName, listAddress, listRemarks, listID );
listName = listAddress = listRemarks = listID = NULL;
}
}
- // Free lists
+ /* Free lists */
vcard_free_lists( listName, listAddress, listRemarks, listID );
listName = listAddress = listRemarks = listID = NULL;
}
-// ============================================================================================
+/* ============================================================================================ */
/*
* Read file into list. Main entry point
* Return: TRUE if file read successfully.
*/
-// ============================================================================================
+/* ============================================================================================ */
gint vcard_read_data( VCardFile *cardFile ) {
g_return_val_if_fail( cardFile != NULL, -1 );
addrcache_clear( cardFile->addressCache );
vcard_open_file( cardFile );
if( cardFile->retVal == MGU_SUCCESS ) {
- // Read data into the list
+ /* Read data into the list */
vcard_read_file( cardFile );
vcard_close_file( cardFile );
- // Mark cache
+ /* Mark cache */
addrcache_mark_file( cardFile->addressCache, cardFile->path );
cardFile->addressCache->modified = FALSE;
cardFile->addressCache->dataRead = TRUE;
fileSpec = NULL;
if( ( fp = fopen( str, "r" ) ) != NULL ) {
- // Read configuration file
+ /* Read configuration file */
lenlbl = strlen( GNOMECARD_SECTION );
while( fgets( buf, sizeof( buf ), fp ) != NULL ) {
if( 0 == g_strncasecmp( buf, GNOMECARD_SECTION, lenlbl ) ) {
}
if( fileSpec == NULL ) {
- // Use the home directory
+ /* Use the home directory */
str[ len ] = '\0';
fileSpec = g_strdup( str );
}
}
/*
-* Attempt to read file, testing for valid VCard format.
+* Attempt to read file, testing for valid vCard format.
* Return: TRUE if file appears to be valid format.
*/
gint vcard_test_read_file( const gchar *fileSpec ) {
if( tagvalue ) {
if( g_strcasecmp( tagtype, VCARD_TYPE_QP ) == 0 ) {
- // Quoted-Printable: could span multiple lines
+ /* Quoted-Printable: could span multiple lines */
tagvalue = vcard_read_qp( cardFile, tagvalue );
vcard_unescape_qp( tagvalue );
}
}
if( g_strcasecmp( tagname, VCARD_TAG_END ) == 0 &&
g_strcasecmp( tagvalue, VCARD_NAME ) == 0 ) {
- // VCard is complete
+ /* vCard is complete */
if( haveStart ) cardFile->retVal = MGU_SUCCESS;
}
g_free( tagvalue );
*/
/*
- * Definitions necessary to access VCard files. VCard files are used
+ * Definitions necessary to access vCard files. vCard files are used
* by GnomeCard for addressbook, and Netscape for sending business
* card information. Refer to RFC2426 for more information.
*/
#define VCARD_SEP_TYPE ';'
/*
-// Typical VCard entry:
+// Typical vCard entry:
//
// BEGIN:VCARD
// FN:Axle Rose
// END:VCARD
*/
-// VCard object
+/* vCard object */
typedef struct _VCardFile VCardFile;
struct _VCardFile {
gchar *name;