aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/dialog.cc16
-rw-r--r--src/menu.cc2
3 files changed, 11 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index db61b047..06356a43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,7 @@ dillo-2.1
- Standardised the installation of dpid/dpidrc with auto* tools.
- Set the ScrollGroup as the resizable widget in downloads dpi.
- Cleaned up and normalized D_SUN_LEN usage.
+ - Fixed incorrect use of VOIDP2INT in Dialog_user_password_cb().
Patches: Jeremy Henty
+- Implemented Basic authentication!
Patch: Jeremy Henty, Jorge Arellano Cid
diff --git a/src/dialog.cc b/src/dialog.cc
index ca457c40..e19eede0 100644
--- a/src/dialog.cc
+++ b/src/dialog.cc
@@ -217,7 +217,7 @@ int a_Dialog_choice5(const char *QuestionTxt,
b = new HighlightButton(xpos, wh-bh, bw, bh, txt[i]);
b->align(ALIGN_WRAP|ALIGN_CLIP);
b->box(UP_BOX);
- b->callback(choice5_cb, (void*)i);
+ b->callback(choice5_cb, INT2VOIDP(i));
xpos += bw + gap;
}
window->end();
@@ -232,12 +232,14 @@ int a_Dialog_choice5(const char *QuestionTxt,
/*--------------------------------------------------------------------------*/
-static int ok_answer = 1, cancel_answer = 0;
+/*
+ * ret: 0 = Cancel, 1 = OK
+ */
static void Dialog_user_password_cb(Widget *button, void *vIntPtr)
{
- int ok = VOIDP2INT(vIntPtr);
- _MSG("Dialog_user_password_cb: %d\n", ok);
- button->window()->make_exec_return(ok);
+ int ret = VOIDP2INT(vIntPtr);
+ _MSG("Dialog_user_password_cb: %d\n", ret);
+ button->window()->make_exec_return(ret);
}
/*
@@ -279,14 +281,14 @@ int a_Dialog_user_password(const char *message, UserPasswordCB cb, void *vp)
new Button(200,button_y,50,button_h,"OK");
ok_button->labelsize(14);
ok_button->callback(Dialog_user_password_cb);
- ok_button->user_data(&ok_answer);
+ ok_button->user_data(INT2VOIDP(1));
/* "Cancel" button */
Button *cancel_button =
new Button(50,button_y,100,button_h,"Cancel");
cancel_button->labelsize(14);
cancel_button->callback(Dialog_user_password_cb);
- cancel_button->user_data(&cancel_answer);
+ cancel_button->user_data(INT2VOIDP(0));
window->end();
window->size_range(window_w,window_h,window_w,window_h);
diff --git a/src/menu.cc b/src/menu.cc
index 54babc0b..a95ed0ec 100644
--- a/src/menu.cc
+++ b/src/menu.cc
@@ -615,7 +615,7 @@ void a_Menu_history_popup(BrowserWindow *bw, int direction)
for (i = 0; history_list[i] != -1; i += 1) {
// TODO: restrict title size
it = new CustItem(a_History_get_title(history_list[i], 1));
- it->callback(Menu_history_cb, (void*)(i+1));
+ it->callback(Menu_history_cb, INT2VOIDP(i+1));
}
pm->type(PopupMenu::POPUP123);
pm->end();