"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "print_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.

print_gui.c  (jpilot-1.8.2):print_gui.c  (jpilot-2_0_1)
skipping to change at line 61 skipping to change at line 61
static gboolean cb_destroy(GtkWidget *widget) static gboolean cb_destroy(GtkWidget *widget)
{ {
const char *entry_text; const char *entry_text;
const char *lines_text; const char *lines_text;
int num_lines; int num_lines;
jp_logf(JP_LOG_DEBUG, "Cleanup print_gui\n"); jp_logf(JP_LOG_DEBUG, "Cleanup print_gui\n");
/* Get radio button prefs */ /* Get radio button prefs */
if (radio_button_one) { if (radio_button_one) {
if (GTK_TOGGLE_BUTTON(radio_button_one)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_button_one))) {
jp_logf(JP_LOG_DEBUG, "print one"); jp_logf(JP_LOG_DEBUG, "print one");
set_pref(PREF_PRINT_THIS_MANY, 1, NULL, FALSE); set_pref(PREF_PRINT_THIS_MANY, 1, NULL, FALSE);
} }
if (GTK_TOGGLE_BUTTON(radio_button_shown)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_button_shown))) {
jp_logf(JP_LOG_DEBUG, "print shown"); jp_logf(JP_LOG_DEBUG, "print shown");
set_pref(PREF_PRINT_THIS_MANY, 2, NULL, FALSE); set_pref(PREF_PRINT_THIS_MANY, 2, NULL, FALSE);
} }
if (GTK_TOGGLE_BUTTON(radio_button_all)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_button_all))) {
jp_logf(JP_LOG_DEBUG, "print all"); jp_logf(JP_LOG_DEBUG, "print all");
set_pref(PREF_PRINT_THIS_MANY, 3, NULL, FALSE); set_pref(PREF_PRINT_THIS_MANY, 3, NULL, FALSE);
} }
} }
/* Get radio button prefs */ /* Get radio button prefs */
if (radio_button_daily) { if (radio_button_daily) {
if (GTK_TOGGLE_BUTTON(radio_button_daily)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_button_daily))) {
jp_logf(JP_LOG_DEBUG, "print daily"); jp_logf(JP_LOG_DEBUG, "print daily");
print_day_week_month=1; print_day_week_month=1;
} }
if (GTK_TOGGLE_BUTTON(radio_button_weekly)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_button_weekly))) {
jp_logf(JP_LOG_DEBUG, "print weekly"); jp_logf(JP_LOG_DEBUG, "print weekly");
print_day_week_month=2; print_day_week_month=2;
} }
if (GTK_TOGGLE_BUTTON(radio_button_monthly)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(radio_button_monthly))) {
jp_logf(JP_LOG_DEBUG, "print monthly"); jp_logf(JP_LOG_DEBUG, "print monthly");
print_day_week_month=3; print_day_week_month=3;
} }
} }
/* Get one record per page pref */ /* Get one record per page pref */
if (one_record_checkbutton) { if (one_record_checkbutton) {
if (GTK_TOGGLE_BUTTON(one_record_checkbutton)->active) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(one_record_checkbutton) )) {
jp_logf(JP_LOG_DEBUG, "one record per page"); jp_logf(JP_LOG_DEBUG, "one record per page");
set_pref(PREF_PRINT_ONE_PER_PAGE, 1, NULL, FALSE); set_pref(PREF_PRINT_ONE_PER_PAGE, 1, NULL, FALSE);
} else { } else {
set_pref(PREF_PRINT_ONE_PER_PAGE, 0, NULL, FALSE); set_pref(PREF_PRINT_ONE_PER_PAGE, 0, NULL, FALSE);
} }
} }
/* Get number of blank lines */ /* Get number of blank lines */
if (lines_entry) { if (lines_entry) {
lines_text = gtk_entry_get_text(GTK_ENTRY(lines_entry)); lines_text = gtk_entry_get_text(GTK_ENTRY(lines_entry));
skipping to change at line 168 skipping to change at line 168
GtkWidget *pref_menu; GtkWidget *pref_menu;
long ivalue; long ivalue;
char temp_str[10]; char temp_str[10];
char temp[256]; char temp[256];
const char *svalue; const char *svalue;
GSList *group; GSList *group;
jp_logf(JP_LOG_DEBUG, "print_gui\n"); jp_logf(JP_LOG_DEBUG, "print_gui\n");
if (GTK_IS_WINDOW(window)) { if (GTK_IS_WINDOW(window)) {
jp_logf(JP_LOG_DEBUG, "print_gui window is already up\n"); jp_logf(JP_LOG_DEBUG, "print_gui window is already up\n");
gdk_window_raise(window->window); gdk_window_raise(gtk_widget_get_window(window));
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
print_dialog=0; print_dialog=0;
radio_button_one=NULL; radio_button_one=NULL;
radio_button_daily=NULL; radio_button_daily=NULL;
one_record_checkbutton=NULL; one_record_checkbutton=NULL;
lines_entry=NULL; lines_entry=NULL;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_MOUSE); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_MOUSE);
gtk_window_set_modal(GTK_WINDOW(window), TRUE); gtk_window_set_modal(GTK_WINDOW(window), TRUE);
gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(main_window)); gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(main_window));
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, _("Print Options")); g_snprintf(temp, sizeof(temp), "%s %s", PN, _("Print Options"));
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, 0); vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(window), vbox); gtk_container_add(GTK_CONTAINER(window), vbox);
/* Paper Size */ /* Paper Size */
hbox = gtk_hbox_new(FALSE, 0); hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new(_("Paper Size")); label = gtk_label_new(_("Paper Size"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
make_pref_menu(&pref_menu, PREF_PAPER_SIZE); make_pref_menu(&pref_menu, PREF_PAPER_SIZE);
gtk_box_pack_start(GTK_BOX(hbox), pref_menu, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), pref_menu, FALSE, FALSE, 0);
get_pref(PREF_PAPER_SIZE, &ivalue, NULL); get_pref(PREF_PAPER_SIZE, &ivalue, NULL);
gtk_option_menu_set_history(GTK_OPTION_MENU(pref_menu), ivalue); gtk_combo_box_set_active(GTK_COMBO_BOX(pref_menu), ivalue);
/* Radio buttons for Datebook */ /* Radio buttons for Datebook */
radio_button_daily=radio_button_weekly=radio_button_monthly=NULL; radio_button_daily=radio_button_weekly=radio_button_monthly=NULL;
if (app == DATEBOOK) { if (app == DATEBOOK) {
group = NULL; group = NULL;
if (mon_week_day & 0x01) { if (mon_week_day & 0x01) {
radio_button_daily = gtk_radio_button_new_with_label radio_button_daily = gtk_radio_button_new_with_label
(group, _("Daily Printout")); (group, _("Daily Printout"));
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_daily)); group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_daily) );
} }
if (mon_week_day & 0x02) { if (mon_week_day & 0x02) {
radio_button_weekly = gtk_radio_button_new_with_label radio_button_weekly = gtk_radio_button_new_with_label
(group, _("Weekly Printout")); (group, _("Weekly Printout"));
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_weekly)); group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_weekly ));
} }
if (mon_week_day & 0x04) { if (mon_week_day & 0x04) {
radio_button_monthly = gtk_radio_button_new_with_label radio_button_monthly = gtk_radio_button_new_with_label
(group, _("Monthly Printout")); (group, _("Monthly Printout"));
} }
switch (date_button) { switch (date_button) {
case 1: case 1:
if (mon_week_day & 0x01) { if (mon_week_day & 0x01) {
skipping to change at line 266 skipping to change at line 266
} }
} }
if (app != DATEBOOK) { if (app != DATEBOOK) {
/* Radio buttons for number of records to print */ /* Radio buttons for number of records to print */
group = NULL; group = NULL;
radio_button_one = gtk_radio_button_new_with_label radio_button_one = gtk_radio_button_new_with_label
(group, _("Selected record")); (group, _("Selected record"));
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_one)); group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_one));
radio_button_shown = gtk_radio_button_new_with_label radio_button_shown = gtk_radio_button_new_with_label
(group, _("All records in this category")); (group, _("All records in this category"));
group = gtk_radio_button_group(GTK_RADIO_BUTTON(radio_button_shown)); group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_button_shown));
radio_button_all = gtk_radio_button_new_with_label radio_button_all = gtk_radio_button_new_with_label
(group, _("Print all records")); (group, _("Print all records"));
get_pref(PREF_PRINT_THIS_MANY, &ivalue, NULL); get_pref(PREF_PRINT_THIS_MANY, &ivalue, NULL);
switch (ivalue) { switch (ivalue) {
case 1: case 1:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_one), TRUE) ; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_one), TRUE) ;
break; break;
case 2: case 2:
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_shown), TRU E); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_shown), TRU E);
skipping to change at line 293 skipping to change at line 293
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_all), TRUE) ; gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio_button_all), TRUE) ;
} }
gtk_box_pack_start(GTK_BOX(vbox), radio_button_one, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), radio_button_one, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), radio_button_shown, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), radio_button_shown, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), radio_button_all, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), radio_button_all, FALSE, FALSE, 0);
} }
if (app != DATEBOOK) { if (app != DATEBOOK) {
/* One record per page check box */ /* One record per page check box */
one_record_checkbutton = gtk_check_button_new_with_label one_record_checkbutton = gtk_check_button_new_with_label(_("One record per
(_("One record per page")); page"));
gtk_box_pack_start(GTK_BOX(vbox), one_record_checkbutton, FALSE, FALSE, 0) ; gtk_box_pack_start(GTK_BOX(vbox), one_record_checkbutton, FALSE, FALSE, 0) ;
get_pref(PREF_PRINT_ONE_PER_PAGE, &ivalue, NULL); get_pref(PREF_PRINT_ONE_PER_PAGE, &ivalue, NULL);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(one_record_checkbutton), iv alue); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(one_record_checkbutton), iv alue);
} }
if (app != DATEBOOK) { if (app != DATEBOOK) {
/* Number of blank lines */ /* Number of blank lines */
hbox = gtk_hbox_new(FALSE, 0); hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
lines_entry = gtk_entry_new_with_max_length(2); lines_entry = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(lines_entry), 2);
entry_set_multiline_truncate(GTK_ENTRY(lines_entry), TRUE); entry_set_multiline_truncate(GTK_ENTRY(lines_entry), TRUE);
gtk_widget_set_usize(lines_entry, 30, 0); gtk_widget_set_size_request(lines_entry, 30, 0);
gtk_box_pack_start(GTK_BOX(hbox), lines_entry, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), lines_entry, FALSE, FALSE, 0);
label = gtk_label_new(_("Blank lines between each record")); label = gtk_label_new(_("Blank lines between each record"));
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
get_pref(PREF_NUM_BLANK_LINES, &ivalue, NULL); get_pref(PREF_NUM_BLANK_LINES, &ivalue, NULL);
sprintf(temp_str, "%ld", ivalue); sprintf(temp_str, "%ld", ivalue);
gtk_entry_set_text(GTK_ENTRY(lines_entry), temp_str); gtk_entry_set_text(GTK_ENTRY(lines_entry), temp_str);
} }
/* Print Command */ /* Print Command */
label = gtk_label_new(_("Print Command (e.g. lpr, or cat > file.ps)")); label = gtk_label_new(_("Print Command (e.g. lpr, or cat > file.ps)"));
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
print_command_entry = gtk_entry_new_with_max_length(250); print_command_entry = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(print_command_entry), 250);
gtk_box_pack_start(GTK_BOX(vbox), print_command_entry, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), print_command_entry, FALSE, FALSE, 0);
get_pref(PREF_PRINT_COMMAND, NULL, &svalue); get_pref(PREF_PRINT_COMMAND, NULL, &svalue);
gtk_entry_set_text(GTK_ENTRY(print_command_entry), svalue); gtk_entry_set_text(GTK_ENTRY(print_command_entry), svalue);
/* Dialog button box */ /* Dialog button box */
hbox = gtk_hbutton_box_new(); hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
gtk_container_set_border_width(GTK_CONTAINER(hbox), 6); gtk_container_set_border_width(GTK_CONTAINER(hbox), 6);
gtk_button_box_set_layout(GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_END); gtk_button_box_set_layout(GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbox), 6); gtk_box_set_spacing(GTK_BOX(hbox), 6);
gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
/* Cancel button */ /* Cancel button */
button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); button = gtk_button_new_with_label("Cancel");
gtk_signal_connect(GTK_OBJECT(button), "clicked", g_signal_connect(G_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(cb_cancel), window); G_CALLBACK(cb_cancel), window);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
/* Print button */ /* Print button */
button = gtk_button_new_from_stock(GTK_STOCK_PRINT); button = gtk_button_new_with_label("Print");
gtk_signal_connect(GTK_OBJECT(button), "clicked", g_signal_connect(G_OBJECT(button), "clicked",
GTK_SIGNAL_FUNC(cb_print), window); G_CALLBACK(cb_print), window);
gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
gtk_widget_show_all(window); gtk_widget_show_all(window);
gtk_main(); gtk_main();
return print_dialog; return print_dialog;
} }
 End of changes. 25 change blocks. 
31 lines changed or deleted 33 lines changed or added

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