"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "prefs_gui.c" between
jpilot-1.8.2.tar.gz and jpilot-2_0_1.tar.gz

About: J-Pilot is a desktop organizer application for Palm Pilot (PalmOS) devices. Ported to GTK3.

prefs_gui.c  (jpilot-1.8.2):prefs_gui.c  (jpilot-2_0_1)
skipping to change at line 45 skipping to change at line 45
static GtkWidget *window; static GtkWidget *window;
static GtkWidget *main_window; static GtkWidget *main_window;
static GtkWidget *port_entry; static GtkWidget *port_entry;
static GtkWidget *backups_entry; static GtkWidget *backups_entry;
static GtkWidget *ext_editor_entry; static GtkWidget *ext_editor_entry;
static GtkWidget *alarm_command_entry; static GtkWidget *alarm_command_entry;
static GtkWidget *mail_command_entry; static GtkWidget *mail_command_entry;
static GtkWidget *todo_days_due_entry; static GtkWidget *todo_days_due_entry;
extern int glob_app; extern int glob_app;
extern GtkTooltips *glob_tooltips;
#ifdef ENABLE_PLUGINS #ifdef ENABLE_PLUGINS
extern unsigned char skip_plugins; extern unsigned char skip_plugins;
#endif #endif
/* Sync Port Menu */ /* Sync Port Menu */
static GtkWidget *port_menu; static GtkWidget *port_menu;
static GtkWidget *port_menu_item[10]; static const char *port_choices[] = {
static const char *port_choices[]={ "other", "usb:",
"other", "usb:", "/dev/ttyUSB0", "/dev/ttyUSB1", "/dev/ttyUSB2", "/dev/ttyUSB3",
"/dev/ttyUSB0", "/dev/ttyUSB1", "/dev/ttyUSB2", "/dev/ttyUSB3", "/dev/ttyS0", "/dev/ttyS1", "/dev/ttyS2", "/dev/ttyS3",
"/dev/ttyS0", "/dev/ttyS1", "/dev/ttyS2", "/dev/ttyS3", NULL
NULL
}; };
/* Serial Rate Menu */ /* Serial Rate Menu */
static GtkWidget *rate_menu; static GtkWidget *rate_menu;
/****************************** Main Code *************************************/ /****************************** Main Code *************************************/
#ifdef COLORS #ifdef COLORS
/* This doesn't work quite right. There is supposedly no way to do it in GTK. * / /* This doesn't work quite right. There is supposedly no way to do it in GTK. * /
static void r(GtkWidget *w, gpointer data) static void r(GtkWidget *w, gpointer data)
{ {
GtkStyle *style; /* GtkStyle *style;
style = gtk_rc_get_style(GTK_WIDGET(w)); style = gtk_rc_get_style(GTK_WIDGET(w));
if (style) gtk_rc_style_unref(style); if (style) gtk_rc_style_unref(style);
if (GTK_IS_CONTAINER(w)) { if (GTK_IS_CONTAINER(w)) {
gtk_container_foreach(GTK_CONTAINER(w), r, w); gtk_container_foreach(GTK_CONTAINER(w), r, w);
} } */
} }
static void set_colors() static void set_colors()
{ {
GtkStyle* style; /* GtkStyle* style;
int i; int i;
r(main_window, NULL); r(main_window, NULL);
r(window, NULL); r(window, NULL);
gtk_rc_reparse_all(); gtk_rc_reparse_all();
read_gtkrc_file(); read_gtkrc_file();
gtk_rc_reparse_all(); gtk_rc_reparse_all();
gtk_widget_reset_rc_styles(window); gtk_widget_reset_rc_styles(window);
gtk_widget_reset_rc_styles(main_window); gtk_widget_reset_rc_styles(main_window);
gtk_rc_reparse_all(); gtk_rc_reparse_all();
gtk_widget_queue_draw(window); gtk_widget_queue_draw(window);
gtk_widget_queue_draw(main_window); gtk_widget_queue_draw(main_window); */
} }
#endif /* #ifdef COLORS */ #endif /* #ifdef COLORS */
/* Sync Port menu code */ /* Sync Port menu code */
static void cb_serial_port_menu(GtkWidget *widget, static void cb_serial_port_menu(GtkComboBox *widget,
gpointer data) gpointer data) {
{ if (!widget)
if (!widget) return;
return; int choice = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
if (!(GTK_CHECK_MENU_ITEM(widget))->active) { //don't do things if 'other' or nothing is selected..
return; if (choice < 1) {
} return;
}
const char *port_str = port_choices[GPOINTER_TO_INT(data)];
gtk_entry_set_text(GTK_ENTRY(port_entry), port_str); const char *port_str = port_choices[choice];
if (! strcmp(port_str, "usb:")) { gtk_entry_set_text(GTK_ENTRY(port_entry), port_str);
gtk_widget_set_sensitive(rate_menu, FALSE); if (!strcmp(port_str, "usb:")) {
} else { gtk_widget_set_sensitive(rate_menu, FALSE);
gtk_widget_set_sensitive(rate_menu, TRUE); } else {
} gtk_widget_set_sensitive(rate_menu, TRUE);
}
return;
} return;
}
static int make_serial_port_menu(GtkWidget **port_menu)
{ static int make_serial_port_menu(GtkWidget **port_menu) {
GtkWidget *menu; int i, selected;
GSList *group; const char *entry_text;
int i, selected;
const char *entry_text; *port_menu = gtk_combo_box_text_new();
*port_menu = gtk_option_menu_new(); // menu = gtk_menu_new();
// group = NULL;
menu = gtk_menu_new(); selected = 0;
group = NULL;
selected=0; entry_text = gtk_entry_get_text(GTK_ENTRY(port_entry));
entry_text = gtk_entry_get_text(GTK_ENTRY(port_entry)); for (i = 0; port_choices[i]; i++) {
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT (*port_menu), port_cho
for (i=0; port_choices[i]; i++) { ices[i]);
port_menu_item[i] = gtk_radio_menu_item_new_with_label(group, port_choices if (!strcmp(entry_text, port_choices[i])) {
[i]); gtk_combo_box_set_active(GTK_COMBO_BOX (*port_menu), i);
group = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(port_menu_item[i])); selected = i;
gtk_menu_append(GTK_MENU(menu), port_menu_item[i]); }
if (!strcmp(entry_text, port_choices[i])) { /* We don't want a callback if "other" is selected */
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(port_menu_item[i]), // gtk_widget_show(port_menu_item[i]);
TRUE); }
selected=i; g_signal_connect(G_OBJECT(*port_menu), "changed",
} G_CALLBACK(cb_serial_port_menu),
GINT_TO_POINTER(selected));
/* We don't want a callback if "other" is selected */ gtk_combo_box_set_active(GTK_COMBO_BOX(*port_menu), selected);
if (i) {
gtk_signal_connect(GTK_OBJECT(port_menu_item[i]), "activate",
GTK_SIGNAL_FUNC(cb_serial_port_menu),
GINT_TO_POINTER(i));
}
gtk_widget_show(port_menu_item[i]);
}
gtk_option_menu_set_menu(GTK_OPTION_MENU(*port_menu), menu);
gtk_option_menu_set_history(GTK_OPTION_MENU(*port_menu), selected);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
/* End Sync Port Menu code */ /* End Sync Port Menu code */
static void cb_pref_menu(GtkWidget *widget, gpointer data) static void cb_pref_menu(GtkComboBox *widget, gpointer data) {
{ int pref;
int pref;
int value;
if (!widget)
return;
if (!(GTK_CHECK_MENU_ITEM(widget))->active) {
return;
}
pref = GPOINTER_TO_INT(data);
value = pref & 0xFF;
pref = pref >> 8;
set_pref_possibility(pref, value, TRUE);
jp_logf(JP_LOG_DEBUG, "pref %d, value %d\n", pref, value);
#ifdef COLORS
if (pref==PREF_RCFILE) {
set_colors();
}
#endif
return;
}
int make_pref_menu(GtkWidget **pref_menu, int pref_num)
{
GtkWidget *menu_item;
GtkWidget *menu;
GSList *group;
int i, r;
long ivalue;
const char *svalue;
char format_text[MAX_PREF_LEN];
char human_text[MAX_PREF_LEN];
time_t ltime;
struct tm *now;
time(&ltime);
now = localtime(&ltime);
*pref_menu = gtk_option_menu_new();
menu = gtk_menu_new();
group = NULL;
get_pref(pref_num, &ivalue, &svalue);
for (i=0; i<MAX_NUM_PREFS; i++) {
r = get_pref_possibility(pref_num, i, format_text);
if (r) {
break;
}
switch (pref_num) {
case PREF_SHORTDATE:
case PREF_TIME:
jp_strftime(human_text, MAX_PREF_LEN, format_text, now);
break;
case PREF_LONGDATE:
jp_strftime(human_text, MAX_PREF_LEN, _(format_text), now);
break;
default:
strncpy(human_text, format_text, MAX_PREF_LEN);
break;
}
menu_item = gtk_radio_menu_item_new_with_label(
group, human_text);
group = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(menu_item));
gtk_menu_append(GTK_MENU(menu), menu_item);
if (ivalue == i) {
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu_item), ivalue);
}
gtk_signal_connect(GTK_OBJECT(menu_item), "activate", GTK_SIGNAL_FUNC(cb_p
ref_menu),
GINT_TO_POINTER(((pref_num*0x100) + (i & 0xFF))));
gtk_widget_show(menu_item);
}
gtk_option_menu_set_menu(GTK_OPTION_MENU(*pref_menu), menu);
return EXIT_SUCCESS;
}
static void cb_backups_entry(GtkWidget *widget, gpointer data)
{
const char *entry_text;
int num_backups;
entry_text = gtk_entry_get_text(GTK_ENTRY(backups_entry));
sscanf(entry_text, "%d", &num_backups);
if (num_backups < 1) { if (!widget) {
num_backups = 1; return;
} }
if (num_backups > 99) { if (gtk_combo_box_get_active(GTK_COMBO_BOX(widget)) < 0) {
num_backups = 99; return;
} }
set_pref(PREF_NUM_BACKUPS, num_backups, NULL, FALSE); pref = get_selected_category_from_combo_box(widget);
} set_pref_possibility(pref, gtk_combo_box_get_active(GTK_COMBO_BOX(widget)),
TRUE);
static void cb_checkbox_todo_days_till_due(GtkWidget *widget, gpointer data)
{
int num_days;
const char *entry_text;
entry_text = gtk_entry_get_text(GTK_ENTRY(todo_days_due_entry)); jp_logf(JP_LOG_DEBUG, "pref %d, value %d\n", pref, GPOINTER_TO_INT(data) & 0
xFF);
sscanf(entry_text, "%d", &num_days); #ifdef COLORS
if (pref==PREF_RCFILE) {
set_pref(PREF_TODO_DAYS_TILL_DUE, num_days, NULL, TRUE); set_colors();
} }
#endif
static void cb_checkbox_show_tooltips(GtkWidget *widget, gpointer data) return;
{ }
set_pref(PREF_SHOW_TOOLTIPS, GTK_TOGGLE_BUTTON(widget)->active, NULL, TRUE);
} int make_pref_menu(GtkWidget **pref_menu, int pref_num) {
int i, r;
static void cb_text_entry(GtkWidget *widget, gpointer data) long ivalue;
{ const char *svalue;
const char *entry_text; char format_text[MAX_PREF_LEN];
int i, found; char human_text[MAX_PREF_LEN];
time_t ltime;
entry_text = gtk_entry_get_text(GTK_ENTRY(widget)); struct tm *now;
set_pref(GPOINTER_TO_INT(data), 0, entry_text, FALSE); GtkListStore *catListStore = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT
);
if (GPOINTER_TO_INT(data) == PREF_PORT) { GtkTreeIter iter;
if (GTK_IS_WIDGET(port_menu_item[0])) {
found=0; time(&ltime);
for (i=0; port_choices[i]; i++) { now = localtime(&ltime);
if (!strcmp(entry_text, port_choices[i])) {
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(port_menu_item //menu = gtk_menu_new();
[i]), TRUE); ///group = NULL;
gtk_option_menu_set_history(GTK_OPTION_MENU(port_menu), i);
found=1; get_pref(pref_num, &ivalue, &svalue);
for (i = 0; i < MAX_NUM_PREFS; i++) {
r = get_pref_possibility(pref_num, i, format_text);
if (r) {
break;
}
switch (pref_num) {
case PREF_SHORTDATE:
case PREF_TIME:
jp_strftime(human_text, MAX_PREF_LEN, format_text, now);
break;
case PREF_LONGDATE:
jp_strftime(human_text, MAX_PREF_LEN, _(format_text), now);
break;
default:
strncpy(human_text, format_text, MAX_PREF_LEN);
break;
}
gtk_list_store_append (catListStore, &iter);
gtk_list_store_set (catListStore, &iter, 0, human_text, 1, pref_num, -1)
;
}
*pref_menu = gtk_combo_box_new_with_model(GTK_TREE_MODEL (catListStore));
gtk_combo_box_set_active(GTK_COMBO_BOX(*pref_menu), ivalue);
g_signal_connect(G_OBJECT(*pref_menu), "changed", G_CALLBACK(cb_pref_menu),
GINT_TO_POINTER(pref_num));
GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (*pref_menu), renderer, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (*pref_menu), renderer,
"text", 0,
NULL);
//gtk_option_menu_set_menu(GTK_(*pref_menu), menu);
return EXIT_SUCCESS;
}
static void cb_backups_entry(GtkWidget *widget, gpointer data) {
const char *entry_text;
int num_backups;
entry_text = gtk_entry_get_text(GTK_ENTRY(backups_entry));
sscanf(entry_text, "%d", &num_backups);
if (num_backups < 1) {
num_backups = 1;
}
if (num_backups > 99) {
num_backups = 99;
}
set_pref(PREF_NUM_BACKUPS, num_backups, NULL, FALSE);
}
static void cb_checkbox_todo_days_till_due(GtkWidget *widget, gpointer data) {
int num_days;
const char *entry_text;
entry_text = gtk_entry_get_text(GTK_ENTRY(todo_days_due_entry));
sscanf(entry_text, "%d", &num_days);
set_pref(PREF_TODO_DAYS_TILL_DUE, num_days, NULL, TRUE);
}
static void cb_checkbox_show_tooltips(GtkWidget *widget, gpointer data) {
set_pref(PREF_SHOW_TOOLTIPS, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
widget)), NULL, TRUE);
}
static void cb_text_entry(GtkWidget *widget, gpointer data) {
const char *entry_text;
int i, found;
entry_text = gtk_entry_get_text(GTK_ENTRY(widget));
set_pref(GPOINTER_TO_INT(data), 0, entry_text, FALSE);
if (GPOINTER_TO_INT(data) == PREF_PORT) {
if (GTK_IS_WIDGET(port_menu)) {
found = 0;
for (i = 0; port_choices[i]; i++) {
if (!strcmp(entry_text, port_choices[i])) {
gtk_combo_box_set_active(GTK_COMBO_BOX(port_menu), i);
found = 1;
}
}
if (!found) {
gtk_combo_box_set_active(GTK_COMBO_BOX(port_menu), 0);
} }
} }
if (!found) { }
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(port_menu_item[0]
), TRUE);
gtk_option_menu_set_history(GTK_OPTION_MENU(port_menu), 0);
}
}
}
} }
static void cb_checkbox_set_pref(GtkWidget *widget, gpointer data) static void cb_checkbox_set_pref(GtkWidget *widget, gpointer data) {
{ unsigned long pref, value;
unsigned long pref, value;
pref = GPOINTER_TO_INT(data); pref = GPOINTER_TO_INT(data);
value = GTK_TOGGLE_BUTTON(widget)->active; value = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
set_pref(pref, value, NULL, TRUE); set_pref(pref, value, NULL, TRUE);
} }
/* /*
* upper 16 bits of data is pref to set * upper 16 bits of data is pref to set
* lower 16 bits of data is value to set it to * lower 16 bits of data is value to set it to
*/ */
static void cb_radio_set_pref(GtkWidget *widget, gpointer data) static void cb_radio_set_pref(GtkWidget *widget, gpointer data) {
{ unsigned long pref, value;
unsigned long pref, value;
pref=GPOINTER_TO_INT(data); pref = GPOINTER_TO_INT(data);
value=pref & 0xFFFF; value = pref & 0xFFFF;
pref >>= 16; pref >>= 16;
set_pref(pref, value, NULL, TRUE); set_pref(pref, value, NULL, TRUE);
} }
#ifdef ENABLE_PLUGINS #ifdef ENABLE_PLUGINS
static void cb_sync_plugin(GtkWidget *widget, gpointer data)
{ static void cb_sync_plugin(GtkWidget *widget, gpointer data) {
GList *plugin_list, *temp_list; GList *plugin_list, *temp_list;
struct plugin_s *Pplugin; struct plugin_s *Pplugin;
int number; int number;
number = GPOINTER_TO_INT(data); number = GPOINTER_TO_INT(data);
plugin_list=NULL; plugin_list = NULL;
plugin_list = get_plugin_list(); plugin_list = get_plugin_list();
for (temp_list = plugin_list; temp_list; temp_list = temp_list->next) { for (temp_list = plugin_list; temp_list; temp_list = temp_list->next) {
Pplugin = (struct plugin_s *)temp_list->data; Pplugin = (struct plugin_s *) temp_list->data;
if (Pplugin) { if (Pplugin) {
if (number == Pplugin->number) { if (number == Pplugin->number) {
if (GTK_TOGGLE_BUTTON(widget)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
Pplugin->sync_on = 1; Pplugin->sync_on = 1;
} else { } else {
Pplugin->sync_on = 0; Pplugin->sync_on = 0;
}
} }
} }
} }
} write_plugin_sync_file();
write_plugin_sync_file();
} }
#endif #endif
static gboolean cb_destroy(GtkWidget *widget) static gboolean cb_destroy(GtkWidget *widget) {
{ jp_logf(JP_LOG_DEBUG, "Pref GUI Cleanup\n");
jp_logf(JP_LOG_DEBUG, "Pref GUI Cleanup\n");
pref_write_rc_file(); pref_write_rc_file();
window = NULL; window = NULL;
/* Preference changes can affect visual elements of applications. /* Preference changes can affect visual elements of applications.
* Redraw the screen to incorporate any changes made. */ * Redraw the screen to incorporate any changes made. */
cb_app_button(NULL, GINT_TO_POINTER(REDRAW)); cb_app_button(NULL, GINT_TO_POINTER(REDRAW));
return FALSE; return FALSE;
} }
static void cb_quit(GtkWidget *widget, gpointer data) static void cb_quit(GtkWidget *widget, gpointer data) {
{ jp_logf(JP_LOG_DEBUG, "cb_quit\n");
jp_logf(JP_LOG_DEBUG, "cb_quit\n"); if (GTK_IS_WIDGET(data)) {
if (GTK_IS_WIDGET(data)) { gtk_widget_destroy(data);
gtk_widget_destroy(data); }
}
} }
/* This function adds a simple option checkbutton for the supplied text + /* This function adds a simple option checkbutton for the supplied text +
* option. */ * option. */
static void add_checkbutton(const char *text, static void add_checkbutton(const char *text,
int which, int which,
GtkWidget *vbox, GtkWidget *vbox,
void cb(GtkWidget *widget, gpointer data)) void cb(GtkWidget *widget, gpointer data)) {
{ /* Create button */
/* Create button */ GtkWidget *checkbutton = gtk_check_button_new_with_label(text);
GtkWidget *checkbutton = gtk_check_button_new_with_label(text); gtk_box_pack_start(GTK_BOX(vbox), checkbutton, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), checkbutton, FALSE, FALSE, 0); gtk_widget_show(checkbutton);
gtk_widget_show(checkbutton);
/* Set the button state based on option value */
/* Set the button state based on option value */ if (get_pref_int_default(which, 0))
if (get_pref_int_default(which, 0)) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton), TRUE);
/* Set button callback */
/* Set button callback */ g_signal_connect(G_OBJECT(checkbutton), "clicked", G_CALLBACK(cb),
gtk_signal_connect(GTK_OBJECT(checkbutton), "clicked", GTK_SIGNAL_FUNC(cb), GINT_TO_POINTER(which));
GINT_TO_POINTER(which)); }
}
void cb_prefs_gui(GtkWidget *widget, gpointer data) {
void cb_prefs_gui(GtkWidget *widget, gpointer data) GtkWidget *checkbutton;
{ // GtkWidget *pref_menu;
GtkWidget *checkbutton; GtkWidget * pref_char_set;
GtkWidget *pref_menu; GtkWidget * pref_short_date;
GtkWidget *label; GtkWidget * pref_long_date;
GtkWidget *button; GtkWidget * pref_time;
GtkWidget *table; GtkWidget * pref_rc_file;
GtkWidget *vbox; GtkWidget *label;
GtkWidget *vbox_locale; GtkWidget *button;
GtkWidget *vbox_settings; GtkWidget *grid;
GtkWidget *vbox_datebook; GtkWidget *vbox;
GtkWidget *vbox_address; GtkWidget *vbox_locale;
GtkWidget *vbox_todo; GtkWidget *vbox_settings;
GtkWidget *vbox_memo; GtkWidget *vbox_datebook;
GtkWidget *vbox_alarms; GtkWidget *vbox_address;
GtkWidget *vbox_conduits; GtkWidget *vbox_todo;
GtkWidget *hbox_temp; GtkWidget *vbox_memo;
GtkWidget *hseparator; GtkWidget *vbox_alarms;
GtkWidget *notebook; GtkWidget *vbox_conduits;
/* FIXME: Uncomment when support for Task has been added */ GtkWidget *hbox_temp;
GtkWidget *hseparator;
GtkWidget *notebook;
/* FIXME: Uncomment when support for Task has been added */
#if 0 #if 0
GtkWidget *radio_button_todo_version[2]; GtkWidget *radio_button_todo_version[2];
#endif #endif
GtkWidget *radio_button_datebook_version[2]; GtkWidget *radio_button_datebook_version[2];
GtkWidget *radio_button_address_version[2]; GtkWidget *radio_button_address_version[2];
GtkWidget *radio_button_memo_version[3]; GtkWidget *radio_button_memo_version[3];
long ivalue; long ivalue;
const char *cstr; const char *cstr;
char temp_str[10]; char temp_str[10];
char temp[256]; char temp[256];
GSList *group; GSList *group;
#ifdef ENABLE_PLUGINS #ifdef ENABLE_PLUGINS
GList *plugin_list, *temp_list; GList *plugin_list, *temp_list;
struct plugin_s *Pplugin; struct plugin_s *Pplugin;
#endif #endif
jp_logf(JP_LOG_DEBUG, "cb_prefs_gui\n"); jp_logf(JP_LOG_DEBUG, "cb_prefs_gui\n");
if (window) { if (window) {
jp_logf(JP_LOG_DEBUG, "pref_window is already up\n"); jp_logf(JP_LOG_DEBUG, "pref_window is already up\n");
/* Shift focus to existing window if called again /* Shift focus to existing window if called again
and window is still alive. */ and window is still alive. */
gtk_window_present(GTK_WINDOW(window)); gtk_window_present(GTK_WINDOW(window));
return; return;
} }
main_window = data; main_window = data;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width(GTK_CONTAINER(window), 10); gtk_container_set_border_width(GTK_CONTAINER(window), 10);
g_snprintf(temp, sizeof(temp), "%s %s", PN, _("Preferences")); g_snprintf(temp, sizeof(temp), "%s %s", PN, _("Preferences"));
gtk_window_set_title(GTK_WINDOW(window), temp); gtk_window_set_title(GTK_WINDOW(window), temp);
gtk_signal_connect(GTK_OBJECT(window), "destroy", g_signal_connect(G_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(cb_destroy), window); G_CALLBACK(cb_destroy), window);
vbox = gtk_vbox_new(FALSE, 5); vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
gtk_container_add(GTK_CONTAINER(window), vbox); gtk_container_add(GTK_CONTAINER(window), vbox);
/* Boxes for each preference tax */ /* Boxes for each preference tax */
vbox_locale = gtk_vbox_new(FALSE, 0); vbox_locale = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
vbox_settings = gtk_vbox_new(FALSE, 0); vbox_settings = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
vbox_datebook = gtk_vbox_new(FALSE, 0); vbox_datebook = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
vbox_address = gtk_vbox_new(FALSE, 0); vbox_address = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
vbox_todo = gtk_vbox_new(FALSE, 0); vbox_todo = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
vbox_memo = gtk_vbox_new(FALSE, 0); vbox_memo = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
vbox_alarms = gtk_vbox_new(FALSE, 0); vbox_alarms = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
vbox_conduits = gtk_vbox_new(FALSE, 0); vbox_conduits = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width(GTK_CONTAINER(vbox_locale), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox_locale), 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox_settings), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox_settings), 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox_datebook), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox_datebook), 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox_address), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox_address), 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox_todo), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox_todo), 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox_memo), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox_memo), 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox_alarms), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox_alarms), 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox_conduits), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox_conduits), 5);
/* Notebook for preference tabs */ /* Notebook for preference tabs */
notebook = gtk_notebook_new(); notebook = gtk_notebook_new();
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
label = gtk_label_new(_("Locale")); label = gtk_label_new(_("Locale"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_locale, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_locale, label);
label = gtk_label_new(_("Settings")); label = gtk_label_new(_("Settings"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_settings, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_settings, label);
label = gtk_label_new(_("Datebook")); label = gtk_label_new(_("Datebook"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_datebook, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_datebook, label);
label = gtk_label_new(C_("prefgui","Address")); label = gtk_label_new(C_("prefgui", "Address"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_address, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_address, label);
label = gtk_label_new(_("ToDo")); label = gtk_label_new(_("ToDo"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_todo, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_todo, label);
label = gtk_label_new(_("Memo")); label = gtk_label_new(_("Memo"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_memo, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_memo, label);
label = gtk_label_new(_("Alarms")); label = gtk_label_new(_("Alarms"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_alarms, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_alarms, label);
label = gtk_label_new(_("Conduits")); label = gtk_label_new(_("Conduits"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_conduits, label); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox_conduits, label);
gtk_box_pack_start(GTK_BOX(vbox), notebook, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), notebook, FALSE, FALSE, 0);
/************************************************************/ /************************************************************/
/* Locale preference tab */ /* Locale preference tab */
table = gtk_table_new(5, 2, FALSE); grid = gtk_grid_new();
gtk_table_set_row_spacings(GTK_TABLE(table),0); gtk_grid_set_row_spacing(GTK_GRID(grid), 2);
gtk_table_set_col_spacings(GTK_TABLE(table),5); gtk_grid_set_column_spacing(GTK_GRID(grid), 5);
gtk_box_pack_start(GTK_BOX(vbox_locale), table, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_locale), grid, FALSE, FALSE, 0);
/* Character Set */ /* Locale preference tab */
label = gtk_label_new(_("Character Set"));
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(label), /* Character Set */
0, 1, 0, 1); label = gtk_label_new(_("Character Set"));
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(label), 0, 0, 1, 1);
make_pref_menu(&pref_menu, PREF_CHAR_SET); make_pref_menu(&pref_char_set, PREF_CHAR_SET);
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(pref_menu), gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(pref_char_set), 1, 0, 1, 1);
1, 2, 0, 1);
get_pref(PREF_CHAR_SET, &ivalue, NULL);
get_pref(PREF_CHAR_SET, &ivalue, NULL); gtk_combo_box_set_active(GTK_COMBO_BOX(pref_char_set), ivalue);
gtk_option_menu_set_history(GTK_OPTION_MENU(pref_menu), ivalue); /* Shortdate */
label = gtk_label_new(_("Short date format"));
/* Shortdate */ gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(label), 0, 1, 1, 1);
label = gtk_label_new(_("Short date format"));
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(label), make_pref_menu(&pref_short_date, PREF_SHORTDATE);
0, 1, 1, 2); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(pref_short_date), 1, 1, 1, 1);
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
get_pref(PREF_SHORTDATE, &ivalue, NULL);
make_pref_menu(&pref_menu, PREF_SHORTDATE); gtk_combo_box_set_active(GTK_COMBO_BOX(pref_short_date), ivalue);
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(pref_menu),
1, 2, 1, 2); /* Longdate */
label = gtk_label_new(_("Long date format"));
get_pref(PREF_SHORTDATE, &ivalue, NULL); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(label), 0, 2, 1, 1);
gtk_option_menu_set_history(GTK_OPTION_MENU(pref_menu), ivalue);
make_pref_menu(&pref_long_date, PREF_LONGDATE);
/* Longdate */ gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(pref_long_date), 1, 2, 1, 1);
label = gtk_label_new(_("Long date format"));
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(label), get_pref(PREF_LONGDATE, &ivalue, NULL);
0, 1, 2, 3); gtk_combo_box_set_active(GTK_COMBO_BOX(pref_long_date), ivalue);
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5);
/* Time */
make_pref_menu(&pref_menu, PREF_LONGDATE); label = gtk_label_new(_("Time format"));
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(pref_menu), gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(label), 0, 3, 1, 1);
1, 2, 2, 3);
make_pref_menu(&pref_time, PREF_TIME);
get_pref(PREF_LONGDATE, &ivalue, NULL); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(pref_time), 1, 3, 1, 1);
gtk_option_menu_set_history(GTK_OPTION_MENU(pref_menu), ivalue);
get_pref(PREF_TIME, &ivalue, NULL);
/* Time */ gtk_combo_box_set_active(GTK_COMBO_BOX(pref_time), ivalue);
label = gtk_label_new(_("Time format"));
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(label), /**********************************************************************/
0, 1, 3, 4); /* Settings preference tab */
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); grid = gtk_grid_new();
gtk_grid_set_row_spacing(GTK_GRID(grid), 2);
make_pref_menu(&pref_menu, PREF_TIME); gtk_grid_set_column_spacing(GTK_GRID(grid), 5);
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(pref_menu), gtk_box_pack_start(GTK_BOX(vbox_settings), grid, FALSE, FALSE, 0);
1, 2, 3, 4);
/* GTK colors file */
get_pref(PREF_TIME, &ivalue, NULL); label = gtk_label_new(_("GTK color theme file"));
gtk_option_menu_set_history(GTK_OPTION_MENU(pref_menu), ivalue); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(label), 1, 0, 1, 1);
/**********************************************************************/ make_pref_menu(&pref_rc_file, PREF_RCFILE);
/* Settings preference tab */ gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(pref_rc_file), 2, 0, 1, 1);
table = gtk_table_new(4, 3, FALSE);
gtk_table_set_row_spacings(GTK_TABLE(table),0); get_pref(PREF_RCFILE, &ivalue, NULL);
gtk_table_set_col_spacings(GTK_TABLE(table),5); gtk_combo_box_set_active(GTK_COMBO_BOX(pref_rc_file), ivalue);
gtk_box_pack_start(GTK_BOX(vbox_settings), table, FALSE, FALSE, 0);
/* Port */
/* GTK colors file */ label = gtk_label_new(_("Sync Port"));
label = gtk_label_new(_("GTK color theme file")); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(label), 0, 1, 1, 1);
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(label),
0, 2, 0, 1); port_entry = gtk_entry_new();
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); gtk_entry_set_max_length(GTK_ENTRY(port_entry), MAX_PREF_LEN - 2);
entry_set_multiline_truncate(GTK_ENTRY(port_entry), TRUE);
make_pref_menu(&pref_menu, PREF_RCFILE); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(port_entry), 2, 1, 1, 1);
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(pref_menu), get_pref(PREF_PORT, NULL, &cstr);
2, 3, 0, 1); if (cstr) {
gtk_entry_set_text(GTK_ENTRY(port_entry), cstr);
get_pref(PREF_RCFILE, &ivalue, NULL); }
gtk_option_menu_set_history(GTK_OPTION_MENU(pref_menu), ivalue); g_signal_connect(G_OBJECT(port_entry),
"changed", G_CALLBACK(cb_text_entry),
/* Port */ GINT_TO_POINTER(PREF_PORT));
label = gtk_label_new(_("Sync Port"));
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(label), /* Sync Port Menu */
0, 1, 1, 2); /* Note that port_entry must exist before we call this function */
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); make_serial_port_menu(&port_menu);
gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(port_menu), 1, 1, 1, 1);
port_entry = gtk_entry_new_with_max_length(MAX_PREF_LEN - 2);
entry_set_multiline_truncate(GTK_ENTRY(port_entry), TRUE); /* Serial Rate */
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(port_entry), label = gtk_label_new(_("Serial Rate"));
2, 3, 1, 2); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(label), 1, 2, 1, 1);
get_pref(PREF_PORT, NULL, &cstr);
if (cstr) { make_pref_menu(&rate_menu, PREF_RATE);
gtk_entry_set_text(GTK_ENTRY(port_entry), cstr); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(rate_menu), 2, 2, 1, 1);
}
gtk_signal_connect(GTK_OBJECT(port_entry), get_pref(PREF_RATE, &ivalue, NULL);
"changed", GTK_SIGNAL_FUNC(cb_text_entry), gtk_combo_box_set_active(GTK_COMBO_BOX(rate_menu), ivalue);
GINT_TO_POINTER(PREF_PORT));
/* Disable Serial Rate menu if sync port is USB */
/* Sync Port Menu */ if (!strcmp(cstr, "usb:")) {
/* Note that port_entry must exist before we call this function */ gtk_widget_set_sensitive(rate_menu, FALSE);
make_serial_port_menu(&port_menu); } else {
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(port_menu), gtk_widget_set_sensitive(rate_menu, TRUE);
1, 2, 1, 2); }
/* Serial Rate */ /* Number of backups */
label = gtk_label_new(_("Serial Rate")); label = gtk_label_new(_("Number of backups to be archived"));
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(label), gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(label), 0, 3, 2, 1);
0, 2, 2, 3);
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); backups_entry = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(backups_entry), 2);
make_pref_menu(&rate_menu, PREF_RATE); entry_set_multiline_truncate(GTK_ENTRY(backups_entry), TRUE);
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(rate_menu), gtk_widget_set_size_request(backups_entry, 30, 0);
2, 3, 2, 3); gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(backups_entry), 2, 3, 1, 1);
get_pref(PREF_NUM_BACKUPS, &ivalue, NULL);
get_pref(PREF_RATE, &ivalue, NULL); sprintf(temp_str, "%ld", ivalue);
gtk_option_menu_set_history(GTK_OPTION_MENU(rate_menu), ivalue); gtk_entry_set_text(GTK_ENTRY(backups_entry), temp_str);
g_signal_connect(G_OBJECT(backups_entry),
/* Disable Serial Rate menu if sync port is USB */ "changed", G_CALLBACK(cb_backups_entry),
if (! strcmp(cstr, "usb:")) { NULL);
gtk_widget_set_sensitive(rate_menu, FALSE);
} else { /* Show deleted files check box */
gtk_widget_set_sensitive(rate_menu, TRUE); add_checkbutton(_("Show deleted records (default NO)"),
} PREF_SHOW_DELETED, vbox_settings, cb_checkbox_set_pref);
/* Number of backups */ /* Show modified files check box */
label = gtk_label_new(_("Number of backups to be archived")); add_checkbutton(_("Show modified deleted records (default NO)"),
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(label), PREF_SHOW_MODIFIED, vbox_settings, cb_checkbox_set_pref);
0, 2, 3, 4);
gtk_misc_set_alignment(GTK_MISC(label), 1.0, 0.5); /* Confirm file installation */
add_checkbutton(
backups_entry = gtk_entry_new_with_max_length(2); _("Ask confirmation for file installation (J-Pilot -> PDA) (default
entry_set_multiline_truncate(GTK_ENTRY(backups_entry), TRUE); YES)"),
gtk_widget_set_usize(backups_entry, 30, 0); PREF_CONFIRM_FILE_INSTALL, vbox_settings, cb_checkbox_set_pref);
gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(backups_entry),
2, 3, 3, 4); /* Show tooltips check box */
get_pref(PREF_NUM_BACKUPS, &ivalue, NULL); add_checkbutton(_("Show popup tooltips (default YES) (requires restart)"),
sprintf(temp_str, "%ld", ivalue); PREF_SHOW_TOOLTIPS, vbox_settings,
gtk_entry_set_text(GTK_ENTRY(backups_entry), temp_str); cb_checkbox_show_tooltips);
gtk_signal_connect(GTK_OBJECT(backups_entry),
"changed", GTK_SIGNAL_FUNC(cb_backups_entry), /**********************************************************************/
NULL); /* Datebook preference tab */
/* Show deleted files check box */ /* Radio box to choose which database to use: Datebook/Calendar */
add_checkbutton(_("Show deleted records (default NO)"), group = NULL;
PREF_SHOW_DELETED, vbox_settings, cb_checkbox_set_pref); radio_button_datebook_version[0] =
gtk_radio_button_new_with_label(group, _("Use Datebook database (Pal
/* Show modified files check box */ m OS < 5.2.1)"));
add_checkbutton(_("Show modified deleted records (default NO)"), group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_datebook_ve
PREF_SHOW_MODIFIED, vbox_settings, cb_checkbox_set_pref); rsion[0]));
radio_button_datebook_version[1] =
/* Confirm file installation */ gtk_radio_button_new_with_label(group, _("Use Calendar database (Pal
add_checkbutton( m OS > 5.2)"));
_("Ask confirmation for file installation (J-Pilot -> PDA) (default YES)") group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_datebook_ve
, rsion[1]));
PREF_CONFIRM_FILE_INSTALL, vbox_settings, cb_checkbox_set_pref); gtk_box_pack_start(GTK_BOX(vbox_datebook), radio_button_datebook_version[0],
FALSE, FALSE, 0);
/* Show tooltips check box */ gtk_box_pack_start(GTK_BOX(vbox_datebook), radio_button_datebook_version[1],
add_checkbutton(_("Show popup tooltips (default YES) (requires restart)"), FALSE, FALSE, 0);
PREF_SHOW_TOOLTIPS, vbox_settings,
cb_checkbox_show_tooltips); g_signal_connect(G_OBJECT(radio_button_datebook_version[0]), "pressed",
G_CALLBACK(cb_radio_set_pref),
/**********************************************************************/ GINT_TO_POINTER((PREF_DATEBOOK_VERSION << 16) | 0));
/* Datebook preference tab */ g_signal_connect(G_OBJECT(radio_button_datebook_version[1]), "pressed",
G_CALLBACK(cb_radio_set_pref),
/* Radio box to choose which database to use: Datebook/Calendar */ GINT_TO_POINTER((PREF_DATEBOOK_VERSION << 16) | 1));
group = NULL;
radio_button_datebook_version[0] = get_pref(PREF_DATEBOOK_VERSION, &ivalue, NULL);
gtk_radio_button_new_with_label(group, _("Use Datebook database (Palm OS < if (ivalue) {
5.2.1)")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_datebook_ver
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_datebook_version sion[1]), TRUE);
[0])); } else {
radio_button_datebook_version[1] = gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_datebook_ver
gtk_radio_button_new_with_label(group, _("Use Calendar database (Palm OS > sion[0]), TRUE);
5.2)")); }
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_datebook_version
[1])); /* Separate database selection from less important options */
gtk_box_pack_start(GTK_BOX(vbox_datebook), radio_button_datebook_version[0], hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_datebook), hseparator, FALSE, FALSE, 3);
gtk_box_pack_start(GTK_BOX(vbox_datebook), radio_button_datebook_version[1],
FALSE, FALSE, 0); /* Show highlight days check box */
add_checkbutton(_("Highlight calendar days with appointments"),
gtk_signal_connect(GTK_OBJECT(radio_button_datebook_version[0]), "pressed", PREF_DATEBOOK_HIGHLIGHT_DAYS, vbox_datebook,
GTK_SIGNAL_FUNC(cb_radio_set_pref), cb_checkbox_set_pref);
GINT_TO_POINTER((PREF_DATEBOOK_VERSION<<16)|0));
gtk_signal_connect(GTK_OBJECT(radio_button_datebook_version[1]), "pressed", /* Highlight today on month and week view */
GTK_SIGNAL_FUNC(cb_radio_set_pref), add_checkbutton(_("Annotate today in day, week, and month views"),
GINT_TO_POINTER((PREF_DATEBOOK_VERSION<<16)|1)); PREF_DATEBOOK_HI_TODAY, vbox_datebook, cb_checkbox_set_pref)
;
get_pref(PREF_DATEBOOK_VERSION, &ivalue, NULL);
if (ivalue) { /* Show number of years on anniversaries in month and week view */
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_datebook_versi add_checkbutton(_("Append years on anniversaries in day, week, and month vie
on[1]), TRUE); ws"),
} else { PREF_DATEBOOK_ANNI_YEARS, vbox_datebook,
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_datebook_versi cb_checkbox_set_pref);
on[0]), TRUE);
}
/* Separate database selection from less important options */
hseparator = gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(vbox_datebook), hseparator, FALSE, FALSE, 3);
/* Show highlight days check box */
add_checkbutton(_("Highlight calendar days with appointments"),
PREF_DATEBOOK_HIGHLIGHT_DAYS, vbox_datebook,
cb_checkbox_set_pref);
/* Highlight today on month and week view */
add_checkbutton(_("Annotate today in day, week, and month views"),
PREF_DATEBOOK_HI_TODAY, vbox_datebook, cb_checkbox_set_pref);
/* Show number of years on anniversaries in month and week view */
add_checkbutton(_("Append years on anniversaries in day, week, and month view
s"),
PREF_DATEBOOK_ANNI_YEARS, vbox_datebook,
cb_checkbox_set_pref);
#ifdef ENABLE_DATEBK #ifdef ENABLE_DATEBK
/* Show use DateBk check box */ /* Show use DateBk check box */
add_checkbutton(_("Use DateBk note tags"), add_checkbutton(_("Use DateBk note tags"),
PREF_USE_DB3, vbox_datebook, cb_checkbox_set_pref); PREF_USE_DB3, vbox_datebook, cb_checkbox_set_pref);
#else #else
checkbutton = gtk_check_button_new_with_label(_("DateBk support disabled in t checkbutton = gtk_check_button_new_with_label(_("DateBk support disabled in
his build")); this build"));
gtk_widget_set_sensitive(checkbutton, FALSE); gtk_widget_set_sensitive(checkbutton, FALSE);
gtk_box_pack_start(GTK_BOX(vbox_datebook), checkbutton, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_datebook), checkbutton, FALSE, FALSE, 0);
gtk_widget_show(checkbutton); gtk_widget_show(checkbutton);
#endif #endif
/**********************************************************************/ /**********************************************************************/
/* Address preference tab */ /* Address preference tab */
/* Radio box to choose which database to use: Address/Contacts */ /* Radio box to choose which database to use: Address/Contacts */
group = NULL; group = NULL;
radio_button_address_version[0] = radio_button_address_version[0] =
gtk_radio_button_new_with_label(group, _("Use Address database (Palm OS < 5 gtk_radio_button_new_with_label(group, _("Use Address database (Palm
.2.1)")); OS < 5.2.1)"));
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_address_version[ group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_address_ver
0])); sion[0]));
radio_button_address_version[1] = radio_button_address_version[1] =
gtk_radio_button_new_with_label(group, _("Use Contacts database (Palm OS > gtk_radio_button_new_with_label(group, _("Use Contacts database (Pal
5.2)")); m OS > 5.2)"));
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_address_version[ group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_address_ver
1])); sion[1]));
gtk_box_pack_start(GTK_BOX(vbox_address), radio_button_address_version[0], gtk_box_pack_start(GTK_BOX(vbox_address), radio_button_address_version[0],
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox_address), radio_button_address_version[1], gtk_box_pack_start(GTK_BOX(vbox_address), radio_button_address_version[1],
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(radio_button_address_version[0]), "pressed", g_signal_connect(G_OBJECT(radio_button_address_version[0]), "pressed",
GTK_SIGNAL_FUNC(cb_radio_set_pref), G_CALLBACK(cb_radio_set_pref),
GINT_TO_POINTER((PREF_ADDRESS_VERSION<<16)|0)); GINT_TO_POINTER((PREF_ADDRESS_VERSION << 16) | 0));
gtk_signal_connect(GTK_OBJECT(radio_button_address_version[1]), "pressed", g_signal_connect(G_OBJECT(radio_button_address_version[1]), "pressed",
GTK_SIGNAL_FUNC(cb_radio_set_pref), G_CALLBACK(cb_radio_set_pref),
GINT_TO_POINTER((PREF_ADDRESS_VERSION<<16)|1)); GINT_TO_POINTER((PREF_ADDRESS_VERSION << 16) | 1));
get_pref(PREF_ADDRESS_VERSION, &ivalue, NULL); get_pref(PREF_ADDRESS_VERSION, &ivalue, NULL);
if (ivalue) { if (ivalue) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_address_versio gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_address_vers
n[1]), TRUE); ion[1]), TRUE);
} else { } else {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_address_versio gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_address_vers
n[0]), TRUE); ion[0]), TRUE);
} }
/* Separate database selection from less important options */ /* Separate database selection from less important options */
hseparator = gtk_hseparator_new(); hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(vbox_address), hseparator, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(vbox_address), hseparator, FALSE, FALSE, 3);
/* Command to use for e-mailing from address book */ /* Command to use for e-mailing from address book */
hbox_temp = gtk_hbox_new(FALSE, 0); hbox_temp = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start(GTK_BOX(vbox_address), hbox_temp, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_address), hbox_temp, FALSE, FALSE, 0);
label = gtk_label_new(_("Mail Command")); label = gtk_label_new(_("Mail Command"));
gtk_box_pack_start(GTK_BOX(hbox_temp), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox_temp), label, FALSE, FALSE, 0);
mail_command_entry = gtk_entry_new_with_max_length(MAX_PREF_LEN - 2); mail_command_entry = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(mail_command_entry), MAX_PREF_LEN - 2);
get_pref(PREF_MAIL_COMMAND, NULL, &cstr);
if (cstr) { get_pref(PREF_MAIL_COMMAND, NULL, &cstr);
gtk_entry_set_text(GTK_ENTRY(mail_command_entry), cstr); if (cstr) {
} gtk_entry_set_text(GTK_ENTRY(mail_command_entry), cstr);
gtk_signal_connect(GTK_OBJECT(mail_command_entry), }
"changed", GTK_SIGNAL_FUNC(cb_text_entry), g_signal_connect(G_OBJECT(mail_command_entry),
GINT_TO_POINTER(PREF_MAIL_COMMAND)); "changed", G_CALLBACK(cb_text_entry),
gtk_box_pack_start(GTK_BOX(hbox_temp), mail_command_entry, TRUE, TRUE, 1); GINT_TO_POINTER(PREF_MAIL_COMMAND));
gtk_box_pack_start(GTK_BOX(hbox_temp), mail_command_entry, TRUE, TRUE, 1);
label = gtk_label_new(_("%s is replaced by the e-mail address"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); label = gtk_label_new(_("%s is replaced by the e-mail address"));
gtk_box_pack_start(GTK_BOX(vbox_address), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_address), label, FALSE, FALSE, 0);
gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
/**********************************************************************/ /**********************************************************************/
/* ToDo preference tab */ /* ToDo preference tab */
/* FIXME: undef when support for Task has been coded */ /* FIXME: undef when support for Task has been coded */
#if 0 #if 0
/* Radio box to choose which database to use: Todo/Task */ /* Radio box to choose which database to use: Todo/Task */
group = NULL; group = NULL;
radio_button_task_version[0] = radio_button_task_version[0] =
gtk_radio_button_new_with_label(group, _("Use ToDo database (Palm OS < 5.2. gtk_radio_button_new_with_label(group, _("Use ToDo database (Palm OS < 5.2
1)")); .1)"));
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_todo_version[0]) group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_todo_versio
); n[0]));
radio_button_todo_version[1] = radio_button_todo_version[1] =
gtk_radio_button_new_with_label(group, _("Use Task database (Palm OS > 5.2) gtk_radio_button_new_with_label(group, _("Use Task database (Palm OS > 5.2
")); )"));
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_todo_version[1]) group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_todo_versio
); n[1]));
gtk_box_pack_start(GTK_BOX(vbox_todo), radio_button_todo_version[0], gtk_box_pack_start(GTK_BOX(vbox_todo), radio_button_todo_version[0],
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox_todo), radio_button_todo_version[1], gtk_box_pack_start(GTK_BOX(vbox_todo), radio_button_todo_version[1],
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_signal_connect(GTK_OBJECT(radio_button_todo_version[0]), "pressed", g_signal_connect(G_OBJECT(radio_button_todo_version[0]), "pressed",
GTK_SIGNAL_FUNC(cb_radio_set_pref), G_CALLBACK(cb_radio_set_pref),
GINT_TO_POINTER((PREF_TODO_VERSION<<16)|0)); GINT_TO_POINTER((PREF_TODO_VERSION<<16)|0));
gtk_signal_connect(GTK_OBJECT(radio_button_todo_version[1]), "pressed", g_signal_connect(G_OBJECT(radio_button_todo_version[1]), "pressed",
GTK_SIGNAL_FUNC(cb_radio_set_pref), G_CALLBACK(cb_radio_set_pref),
GINT_TO_POINTER((PREF_TODO_VERSION<<16)|1)); GINT_TO_POINTER((PREF_TODO_VERSION<<16)|1));
get_pref(PREF_TODO_VERSION, &ivalue, NULL); get_pref(PREF_TODO_VERSION, &ivalue, NULL);
if (ivalue) { if (ivalue) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_todo_version[1 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_todo_version[
]), TRUE); 1]), TRUE);
} else { } else {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_todo_version[0 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_todo_version[
]), TRUE); 0]), TRUE);
} }
/* Separate database selection from less important options */ /* Separate database selection from less important options */
hseparator = gtk_hseparator_new(); hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start(GTK_BOX(vbox_todo), hseparator, FALSE, FALSE, 3); gtk_box_pack_start(GTK_BOX(vbox_todo), hseparator, FALSE, FALSE, 3);
#endif #endif
/* hide completed check box */ /* hide completed check box */
add_checkbutton(_("Hide Completed ToDos"), add_checkbutton(_("Hide Completed ToDos"),
PREF_TODO_HIDE_COMPLETED, vbox_todo, cb_checkbox_set_pref); PREF_TODO_HIDE_COMPLETED, vbox_todo, cb_checkbox_set_pref);
/* hide todos not yet due check box */ /* hide todos not yet due check box */
add_checkbutton(_("Hide ToDos not yet due"), add_checkbutton(_("Hide ToDos not yet due"),
PREF_TODO_HIDE_NOT_DUE, vbox_todo, cb_checkbox_set_pref); PREF_TODO_HIDE_NOT_DUE, vbox_todo, cb_checkbox_set_pref);
/* record todo completion date check box */ /* record todo completion date check box */
add_checkbutton(_("Record Completion Date"), add_checkbutton(_("Record Completion Date"),
PREF_TODO_COMPLETION_DATE, vbox_todo, cb_checkbox_set_pref); PREF_TODO_COMPLETION_DATE, vbox_todo, cb_checkbox_set_pref);
#ifdef ENABLE_MANANA #ifdef ENABLE_MANANA
/* Use Manana check box */ /* Use Manana check box */
add_checkbutton(_("Use Manana database"), add_checkbutton(_("Use Manana database"),
PREF_MANANA_MODE, vbox_todo, cb_checkbox_set_pref); PREF_MANANA_MODE, vbox_todo, cb_checkbox_set_pref);
#endif #endif
/* Default Number of Days Due for ToDos */ /* Default Number of Days Due for ToDos */
hbox_temp = gtk_hbox_new(FALSE, 0); hbox_temp = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start(GTK_BOX(vbox_todo), hbox_temp, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_todo), hbox_temp, FALSE, FALSE, 0);
add_checkbutton(_("Use default number of days due"), add_checkbutton(_("Use default number of days due"),
PREF_TODO_DAYS_DUE, hbox_temp, cb_checkbox_set_pref); PREF_TODO_DAYS_DUE, hbox_temp, cb_checkbox_set_pref);
todo_days_due_entry = gtk_entry_new_with_max_length(MAX_PREF_LEN - 2); todo_days_due_entry = gtk_entry_new();
entry_set_multiline_truncate(GTK_ENTRY(todo_days_due_entry), TRUE); gtk_entry_set_max_length(GTK_ENTRY(todo_days_due_entry), MAX_PREF_LEN - 2);
get_pref(PREF_TODO_DAYS_TILL_DUE, &ivalue, NULL); entry_set_multiline_truncate(GTK_ENTRY(todo_days_due_entry), TRUE);
temp[0]='\0'; get_pref(PREF_TODO_DAYS_TILL_DUE, &ivalue, NULL);
g_snprintf(temp, sizeof(temp), "%ld", ivalue); temp[0] = '\0';
gtk_entry_set_text(GTK_ENTRY(todo_days_due_entry), temp); g_snprintf(temp, sizeof(temp), "%ld", ivalue);
gtk_box_pack_start(GTK_BOX(hbox_temp), todo_days_due_entry, FALSE, FALSE, 0); gtk_entry_set_text(GTK_ENTRY(todo_days_due_entry), temp);
gtk_box_pack_start(GTK_BOX(hbox_temp), todo_days_due_entry, FALSE, FALSE, 0)
gtk_signal_connect(GTK_OBJECT(todo_days_due_entry), ;
"changed", GTK_SIGNAL_FUNC(cb_checkbox_todo_days_till_due)
, g_signal_connect(G_OBJECT(todo_days_due_entry),
NULL); "changed", G_CALLBACK(cb_checkbox_todo_days_till_due),
NULL);
gtk_widget_show_all(hbox_temp);
gtk_widget_show_all(hbox_temp);
/**********************************************************************/
/* Memo preference tab */ /**********************************************************************/
/* Radio box to choose which database to use: Memo/Memos/Memo32 */ /* Memo preference tab */
group = NULL; /* Radio box to choose which database to use: Memo/Memos/Memo32 */
radio_button_memo_version[0] = group = NULL;
gtk_radio_button_new_with_label(group, _("Use Memo database (Palm OS < 5.2. radio_button_memo_version[0] =
1)")); gtk_radio_button_new_with_label(group, _("Use Memo database (Palm OS
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_memo_version[0]) < 5.2.1)"));
); group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_memo_versio
radio_button_memo_version[1] = n[0]));
gtk_radio_button_new_with_label(group, _("Use Memos database (Palm OS > 5.2 radio_button_memo_version[1] =
)")); gtk_radio_button_new_with_label(group, _("Use Memos database (Palm O
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_memo_version[1]) S > 5.2)"));
); group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_memo_versio
radio_button_memo_version[2] = n[1]));
gtk_radio_button_new_with_label(group, _("Use Memo32 database (pedit32)")); radio_button_memo_version[2] =
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_memo_version[2]) gtk_radio_button_new_with_label(group, _("Use Memo32 database (pedit
); 32)"));
gtk_box_pack_start(GTK_BOX(vbox_memo), radio_button_memo_version[0], group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_memo_versio
FALSE, FALSE, 0); n[2]));
gtk_box_pack_start(GTK_BOX(vbox_memo), radio_button_memo_version[1], gtk_box_pack_start(GTK_BOX(vbox_memo), radio_button_memo_version[0],
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox_memo), radio_button_memo_version[2], gtk_box_pack_start(GTK_BOX(vbox_memo), radio_button_memo_version[1],
FALSE, FALSE, 0); FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox_memo), radio_button_memo_version[2],
gtk_signal_connect(GTK_OBJECT(radio_button_memo_version[0]), "pressed", FALSE, FALSE, 0);
GTK_SIGNAL_FUNC(cb_radio_set_pref),
GINT_TO_POINTER((PREF_MEMO_VERSION<<16)|0)); g_signal_connect(G_OBJECT(radio_button_memo_version[0]), "pressed",
gtk_signal_connect(GTK_OBJECT(radio_button_memo_version[1]), "pressed", G_CALLBACK(cb_radio_set_pref),
GTK_SIGNAL_FUNC(cb_radio_set_pref), GINT_TO_POINTER((PREF_MEMO_VERSION << 16) | 0));
GINT_TO_POINTER((PREF_MEMO_VERSION<<16)|1)); g_signal_connect(G_OBJECT(radio_button_memo_version[1]), "pressed",
gtk_signal_connect(GTK_OBJECT(radio_button_memo_version[2]), "pressed", G_CALLBACK(cb_radio_set_pref),
GTK_SIGNAL_FUNC(cb_radio_set_pref), GINT_TO_POINTER((PREF_MEMO_VERSION << 16) | 1));
GINT_TO_POINTER((PREF_MEMO_VERSION<<16)|2)); g_signal_connect(G_OBJECT(radio_button_memo_version[2]), "pressed",
G_CALLBACK(cb_radio_set_pref),
get_pref(PREF_MEMO_VERSION, &ivalue, NULL); GINT_TO_POINTER((PREF_MEMO_VERSION << 16) | 2));
switch (ivalue) {
case 0: get_pref(PREF_MEMO_VERSION, &ivalue, NULL);
default: switch (ivalue) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_memo_version[0 case 0:
]), TRUE); default:
break; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_memo_ver
case 1: sion[0]), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_memo_version[1 break;
]), TRUE); case 1:
break; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_memo_ver
case 2: sion[1]), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_memo_version[2 break;
]), TRUE); case 2:
break; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_memo_ver
} sion[2]), TRUE);
break;
hseparator = gtk_hseparator_new(); }
gtk_box_pack_start(GTK_BOX(vbox_memo), hseparator, FALSE, FALSE, 3);
hseparator = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
/* External Editor Command to execute */ gtk_box_pack_start(GTK_BOX(vbox_memo), hseparator, FALSE, FALSE, 3);
hbox_temp = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox_memo), hbox_temp, FALSE, FALSE, 0); /* External Editor Command to execute */
hbox_temp = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
label = gtk_label_new(_("External Editor")); gtk_box_pack_start(GTK_BOX(vbox_memo), hbox_temp, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox_temp), label, FALSE, FALSE, 0);
label = gtk_label_new(_("External Editor"));
ext_editor_entry = gtk_entry_new_with_max_length(MAX_PREF_LEN - 2); gtk_box_pack_start(GTK_BOX(hbox_temp), label, FALSE, FALSE, 0);
get_pref(PREF_EXTERNAL_EDITOR, NULL, &cstr);
if (cstr) { ext_editor_entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(ext_editor_entry), cstr); gtk_entry_set_max_length(GTK_ENTRY(ext_editor_entry), MAX_PREF_LEN - 2);
} get_pref(PREF_EXTERNAL_EDITOR, NULL, &cstr);
gtk_signal_connect(GTK_OBJECT(ext_editor_entry), if (cstr) {
"changed", GTK_SIGNAL_FUNC(cb_text_entry), gtk_entry_set_text(GTK_ENTRY(ext_editor_entry), cstr);
GINT_TO_POINTER(PREF_EXTERNAL_EDITOR)); }
gtk_box_pack_start(GTK_BOX(hbox_temp), ext_editor_entry, TRUE, TRUE, 1); g_signal_connect(G_OBJECT(ext_editor_entry),
"changed", G_CALLBACK(cb_text_entry),
label = gtk_label_new(_("Use Ctrl-E inside a memo to launch external editor f GINT_TO_POINTER(PREF_EXTERNAL_EDITOR));
or memo text")); gtk_box_pack_start(GTK_BOX(hbox_temp), ext_editor_entry, TRUE, TRUE, 1);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX(vbox_memo), label, FALSE, FALSE, 0); label = gtk_label_new(_("Use Ctrl-E inside a memo to launch external editor
for memo text"));
/**********************************************************************/ gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
/* Alarms preference tab */ gtk_box_pack_start(GTK_BOX(vbox_memo), label, FALSE, FALSE, 0);
/* Open alarm windows check box */ /**********************************************************************/
add_checkbutton(_("Open alarm windows for appointment reminders"), /* Alarms preference tab */
PREF_OPEN_ALARM_WINDOWS, vbox_alarms, cb_checkbox_set_pref);
/* Open alarm windows check box */
/* Execute alarm command check box */ add_checkbutton(_("Open alarm windows for appointment reminders"),
add_checkbutton(_("Execute this command"), PREF_OPEN_ALARM_WINDOWS, vbox_alarms, cb_checkbox_set_pref);
PREF_DO_ALARM_COMMAND, vbox_alarms, cb_checkbox_set_pref);
/* Execute alarm command check box */
/* Shell warning label */ add_checkbutton(_("Execute this command"),
label = gtk_label_new(_("WARNING: executing arbitrary shell commands can be d PREF_DO_ALARM_COMMAND, vbox_alarms, cb_checkbox_set_pref);
angerous!!!"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); /* Shell warning label */
gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0); label = gtk_label_new(_("WARNING: executing arbitrary shell commands can be
dangerous!!!"));
/* Alarm Command to execute */ gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
hbox_temp = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox_alarms), hbox_temp, FALSE, FALSE, 0);
/* Alarm Command to execute */
label = gtk_label_new(_("Alarm Command")); hbox_temp = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start(GTK_BOX(hbox_temp), label, FALSE, FALSE, 10); gtk_box_pack_start(GTK_BOX(vbox_alarms), hbox_temp, FALSE, FALSE, 0);
alarm_command_entry = gtk_entry_new_with_max_length(MAX_PREF_LEN - 2); label = gtk_label_new(_("Alarm Command"));
get_pref(PREF_ALARM_COMMAND, NULL, &cstr); gtk_box_pack_start(GTK_BOX(hbox_temp), label, FALSE, FALSE, 10);
if (cstr) {
gtk_entry_set_text(GTK_ENTRY(alarm_command_entry), cstr); alarm_command_entry = gtk_entry_new();
} gtk_entry_set_max_length(GTK_ENTRY(alarm_command_entry), MAX_PREF_LEN - 2);
gtk_signal_connect(GTK_OBJECT(alarm_command_entry), get_pref(PREF_ALARM_COMMAND, NULL, &cstr);
"changed", GTK_SIGNAL_FUNC(cb_text_entry), if (cstr) {
GINT_TO_POINTER(PREF_ALARM_COMMAND)); gtk_entry_set_text(GTK_ENTRY(alarm_command_entry), cstr);
gtk_box_pack_start(GTK_BOX(hbox_temp), alarm_command_entry, FALSE, FALSE, 0); }
g_signal_connect(G_OBJECT(alarm_command_entry),
label = gtk_label_new(_("%t is replaced with the alarm time")); "changed", G_CALLBACK(cb_text_entry),
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); GINT_TO_POINTER(PREF_ALARM_COMMAND));
gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox_temp), alarm_command_entry, FALSE, FALSE, 0)
;
label = gtk_label_new(_("%d is replaced with the alarm date"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); label = gtk_label_new(_("%t is replaced with the alarm time"));
gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0); gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0);
label = gtk_label_new(_("%d is replaced with the alarm date"));
gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0);
#ifdef ENABLE_ALARM_SHELL_DANGER #ifdef ENABLE_ALARM_SHELL_DANGER
label = gtk_label_new(_("%D is replaced with the alarm description")); label = gtk_label_new(_("%D is replaced with the alarm description"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0);
label = gtk_label_new(_("%N is replaced with the alarm note")); label = gtk_label_new(_("%N is replaced with the alarm note"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0);
#else #else
label = gtk_label_new(_("%D (description substitution) is disabled in this bu label = gtk_label_new(_("%D (description substitution) is disabled in this b
ild")); uild"));
gtk_widget_set_sensitive(label, FALSE); gtk_widget_set_sensitive(label, FALSE);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0);
label = gtk_label_new(_("%N (note substitution) is disabled in this build")); label = gtk_label_new(_("%N (note substitution) is disabled in this build"))
gtk_widget_set_sensitive(label, FALSE); ;
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); gtk_widget_set_sensitive(label, FALSE);
gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0); gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
#endif gtk_box_pack_start(GTK_BOX(vbox_alarms), label, FALSE, FALSE, 0);
#endif
/**********************************************************************/
/* Conduits preference tab */ /**********************************************************************/
/* Conduits preference tab */
/* Sync datebook check box */
add_checkbutton(_("Sync datebook"), /* Sync datebook check box */
PREF_SYNC_DATEBOOK, vbox_conduits, cb_checkbox_set_pref); add_checkbutton(_("Sync datebook"),
PREF_SYNC_DATEBOOK, vbox_conduits, cb_checkbox_set_pref);
/* Sync address check box */
add_checkbutton(_("Sync address"), /* Sync address check box */
PREF_SYNC_ADDRESS, vbox_conduits, cb_checkbox_set_pref); add_checkbutton(_("Sync address"),
PREF_SYNC_ADDRESS, vbox_conduits, cb_checkbox_set_pref);
/* Sync todo check box */
add_checkbutton(_("Sync todo"), /* Sync todo check box */
PREF_SYNC_TODO, vbox_conduits, cb_checkbox_set_pref); add_checkbutton(_("Sync todo"),
PREF_SYNC_TODO, vbox_conduits, cb_checkbox_set_pref);
/* Sync memo check box */
add_checkbutton(_("Sync memo"), /* Sync memo check box */
PREF_SYNC_MEMO, vbox_conduits, cb_checkbox_set_pref); add_checkbutton(_("Sync memo"),
PREF_SYNC_MEMO, vbox_conduits, cb_checkbox_set_pref);
#ifdef ENABLE_MANANA #ifdef ENABLE_MANANA
/* Show sync Manana check box */ /* Show sync Manana check box */
add_checkbutton(_("Sync Manana"), add_checkbutton(_("Sync Manana"),
PREF_SYNC_MANANA, vbox_conduits, cb_checkbox_set_pref); PREF_SYNC_MANANA, vbox_conduits, cb_checkbox_set_pref);
#endif #endif
get_pref(PREF_CHAR_SET, &ivalue, NULL); get_pref(PREF_CHAR_SET, &ivalue, NULL);
if (ivalue == CHAR_SET_JAPANESE || ivalue == CHAR_SET_SJIS_UTF) { if (ivalue == CHAR_SET_JAPANESE || ivalue == CHAR_SET_SJIS_UTF) {
/* Show use Japanese Kana extention check box */ /* Show use Japanese Kana extention check box */
add_checkbutton(_("Use J-OS (Not Japanese PalmOS:WorkPad/CLIE)"), add_checkbutton(_("Use J-OS (Not Japanese PalmOS:WorkPad/CLIE)"),
PREF_USE_JOS, vbox_settings, cb_checkbox_set_pref); PREF_USE_JOS, vbox_settings, cb_checkbox_set_pref);
} }
#ifdef ENABLE_PLUGINS #ifdef ENABLE_PLUGINS
if (!skip_plugins) { if (!skip_plugins) {
plugin_list=NULL; plugin_list = NULL;
plugin_list = get_plugin_list(); plugin_list = get_plugin_list();
for (temp_list = plugin_list; temp_list; temp_list = temp_list->next) { for (temp_list = plugin_list; temp_list; temp_list = temp_list->next) {
Pplugin = (struct plugin_s *)temp_list->data; Pplugin = (struct plugin_s *) temp_list->data;
if (Pplugin) { if (Pplugin) {
/* Make a Sync checkbox for each plugin */ /* Make a Sync checkbox for each plugin */
g_snprintf(temp, sizeof(temp), _("Sync %s (%s)"), Pplugin->name, Ppl g_snprintf(temp, sizeof(temp), _("Sync %s (%s)"), Pplugin->name,
ugin->full_path); Pplugin->full_path);
checkbutton = gtk_check_button_new_with_label(temp); checkbutton = gtk_check_button_new_with_label(temp);
gtk_box_pack_start(GTK_BOX(vbox_conduits), checkbutton, FALSE, FALSE gtk_box_pack_start(GTK_BOX(vbox_conduits), checkbutton, FALSE, F
, 0); ALSE, 0);
gtk_widget_show(checkbutton); gtk_widget_show(checkbutton);
if (Pplugin->sync_on) { if (Pplugin->sync_on) {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton), TRUE gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton),
); TRUE);
}
g_signal_connect(G_OBJECT(checkbutton), "clicked",
G_CALLBACK(cb_sync_plugin),
GINT_TO_POINTER(Pplugin->number));
} }
gtk_signal_connect(GTK_OBJECT(checkbutton), "clicked", }
GTK_SIGNAL_FUNC(cb_sync_plugin), }
GINT_TO_POINTER(Pplugin->number));
}
}
}
#endif #endif
/* Done button */ /* Done button */
hbox_temp = gtk_hbutton_box_new(); hbox_temp = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
gtk_button_box_set_layout(GTK_BUTTON_BOX (hbox_temp), GTK_BUTTONBOX_END); gtk_button_box_set_layout(GTK_BUTTON_BOX (hbox_temp), GTK_BUTTONBOX_END);
gtk_box_pack_start(GTK_BOX(vbox), hbox_temp, FALSE, FALSE, 1); gtk_box_pack_start(GTK_BOX(vbox), hbox_temp, FALSE, FALSE, 1);
button = gtk_button_new_from_stock(GTK_STOCK_OK); button = gtk_button_new_with_label("OK");
gtk_signal_connect(GTK_OBJECT(button), "clicked", g_signal_connect(G_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(cb_quit), window); G_CALLBACK(cb_quit), window);
gtk_box_pack_end(GTK_BOX(hbox_temp), button, FALSE, FALSE, 0); gtk_box_pack_end(GTK_BOX(hbox_temp), button, FALSE, FALSE, 0);
gtk_widget_show_all(window); gtk_widget_show_all(window);
} }
 End of changes. 45 change blocks. 
934 lines changed or deleted 896 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)