"Fossies" - the Fresh Open Source Software Archive  

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

password.c  (jpilot-1.8.2):password.c  (jpilot-2_0_1)
skipping to change at line 234 skipping to change at line 234
*/ */
/* Start of Dialog window code */ /* Start of Dialog window code */
static void cb_dialog_button(GtkWidget *widget, static void cb_dialog_button(GtkWidget *widget,
gpointer data) gpointer data)
{ {
struct dialog_data *Pdata; struct dialog_data *Pdata;
GtkWidget *w; GtkWidget *w;
w = gtk_widget_get_toplevel(widget); w = gtk_widget_get_toplevel(widget);
Pdata = gtk_object_get_data(GTK_OBJECT(w), "dialog_data"); Pdata = g_object_get_data(G_OBJECT(w), "dialog_data");
if (Pdata) { if (Pdata) {
Pdata->button_hit = GPOINTER_TO_INT(data); Pdata->button_hit = GPOINTER_TO_INT(data);
} }
gtk_widget_destroy(GTK_WIDGET(w)); gtk_widget_destroy(GTK_WIDGET(w));
} }
static gboolean cb_destroy_dialog(GtkWidget *widget) static gboolean cb_destroy_dialog(GtkWidget *widget)
{ {
struct dialog_data *Pdata; struct dialog_data *Pdata;
const char *entry; const char *entry;
Pdata = gtk_object_get_data(GTK_OBJECT(widget), "dialog_data"); Pdata = g_object_get_data(G_OBJECT(widget), "dialog_data");
if (!Pdata) { if (!Pdata) {
return TRUE; return TRUE;
} }
entry = gtk_entry_get_text(GTK_ENTRY(Pdata->entry)); entry = gtk_entry_get_text(GTK_ENTRY(Pdata->entry));
if (entry) { if (entry) {
g_strlcpy(Pdata->text, entry, PASSWD_LEN+1); g_strlcpy(Pdata->text, entry, PASSWD_LEN+1);
} }
gtk_main_quit(); gtk_main_quit();
skipping to change at line 288 skipping to change at line 288
dialog = gtk_widget_new(GTK_TYPE_WINDOW, dialog = gtk_widget_new(GTK_TYPE_WINDOW,
"type", GTK_WINDOW_TOPLEVEL, "type", GTK_WINDOW_TOPLEVEL,
"title", _("Palm Password"), "title", _("Palm Password"),
NULL); NULL);
gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE); gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_MOUSE);
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(main_window)); gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(main_window));
gtk_signal_connect(GTK_OBJECT(dialog), "destroy", g_signal_connect(G_OBJECT(dialog), "destroy",
GTK_SIGNAL_FUNC(cb_destroy_dialog), dialog); G_CALLBACK(cb_destroy_dialog), dialog);
hbox1 = gtk_hbox_new(FALSE, 2); hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
gtk_container_add(GTK_CONTAINER(dialog), hbox1); gtk_container_add(GTK_CONTAINER(dialog), hbox1);
gtk_box_pack_start(GTK_BOX(hbox1), gtk_image_new_from_stock(GTK_STOCK_DIALOG_ AUTHENTICATION, GTK_ICON_SIZE_DIALOG), FALSE, FALSE, 2); gtk_box_pack_start(GTK_BOX(hbox1), gtk_image_new_from_icon_name("dialog-passw ord", GTK_ICON_SIZE_DIALOG), FALSE, FALSE, 2);
vbox1 = gtk_vbox_new(FALSE, 2); vbox1 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
gtk_container_set_border_width(GTK_CONTAINER(vbox1), 5); gtk_container_set_border_width(GTK_CONTAINER(vbox1), 5);
gtk_container_add(GTK_CONTAINER(hbox1), vbox1); gtk_container_add(GTK_CONTAINER(hbox1), vbox1);
hbox1 = gtk_hbox_new(TRUE, 2); hbox1 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 2);
gtk_container_set_border_width(GTK_CONTAINER(hbox1), 5); gtk_container_set_border_width(GTK_CONTAINER(hbox1), 5);
gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 2); gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 2);
/* Instruction label */ /* Instruction label */
if (retry) { if (retry) {
label = gtk_label_new(_("Incorrect, Reenter PalmOS Password")); label = gtk_label_new(_("Incorrect, Reenter PalmOS Password"));
} else { } else {
label = gtk_label_new(_("Enter PalmOS Password")); label = gtk_label_new(_("Enter PalmOS Password"));
} }
gtk_box_pack_start(GTK_BOX(hbox1), label, FALSE, FALSE, 2); gtk_box_pack_start(GTK_BOX(hbox1), label, FALSE, FALSE, 2);
/* Password entry field */ /* Password entry field */
entry = gtk_entry_new_with_max_length(PASSWD_LEN); entry = gtk_entry_new();
gtk_entry_set_max_length(GTK_ENTRY(entry), PASSWD_LEN);
gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
gtk_signal_connect(GTK_OBJECT(entry), "activate", g_signal_connect(G_OBJECT(entry), "activate",
GTK_SIGNAL_FUNC(cb_dialog_button), G_CALLBACK(cb_dialog_button),
GINT_TO_POINTER(DIALOG_SAID_2)); GINT_TO_POINTER(DIALOG_SAID_2));
gtk_box_pack_start(GTK_BOX(hbox1), entry, TRUE, TRUE, 1); gtk_box_pack_start(GTK_BOX(hbox1), entry, TRUE, TRUE, 1);
/* Button Box */ /* Button Box */
hbox1 = gtk_hbutton_box_new(); hbox1 = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
gtk_button_box_set_layout(GTK_BUTTON_BOX (hbox1), GTK_BUTTONBOX_END); gtk_button_box_set_layout(GTK_BUTTON_BOX (hbox1), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbox1), 6); gtk_box_set_spacing(GTK_BOX(hbox1), 6);
gtk_container_set_border_width(GTK_CONTAINER(hbox1), 5); gtk_container_set_border_width(GTK_CONTAINER(hbox1), 5);
gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 2); gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 2);
/* 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_dialog_button), G_CALLBACK(cb_dialog_button),
GINT_TO_POINTER(DIALOG_SAID_1)); GINT_TO_POINTER(DIALOG_SAID_1));
gtk_box_pack_start(GTK_BOX(hbox1), button, FALSE, FALSE, 1); gtk_box_pack_start(GTK_BOX(hbox1), button, FALSE, FALSE, 1);
/* OK Button */ /* OK Button */
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_dialog_button), G_CALLBACK(cb_dialog_button),
GINT_TO_POINTER(DIALOG_SAID_2)); GINT_TO_POINTER(DIALOG_SAID_2));
gtk_box_pack_start(GTK_BOX(hbox1), button, FALSE, FALSE, 1); gtk_box_pack_start(GTK_BOX(hbox1), button, FALSE, FALSE, 1);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); gtk_widget_set_can_default(button,TRUE);
gtk_widget_grab_default(button); gtk_widget_grab_default(button);
/* Set the default button pressed to CANCEL */ /* Set the default button pressed to CANCEL */
Pdata.button_hit = DIALOG_SAID_1; Pdata.button_hit = DIALOG_SAID_1;
Pdata.entry=entry; Pdata.entry=entry;
Pdata.text[0]='\0'; Pdata.text[0]='\0';
gtk_object_set_data(GTK_OBJECT(dialog), "dialog_data", &Pdata); g_object_set_data(G_OBJECT(dialog), "dialog_data", &Pdata);
gtk_widget_grab_focus(GTK_WIDGET(entry)); gtk_widget_grab_focus(GTK_WIDGET(entry));
gtk_widget_show_all(dialog); gtk_widget_show_all(dialog);
gtk_main(); gtk_main();
if (Pdata.button_hit==DIALOG_SAID_1) { if (Pdata.button_hit==DIALOG_SAID_1) {
ret = 1; ret = 1;
} }
 End of changes. 15 change blocks. 
21 lines changed or deleted 22 lines changed or added

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