[svn] pinentry - r157 - in trunk: . pinentry
svn author marcus
cvs at cvs.gnupg.org
Thu May 10 16:42:45 CEST 2007
Author: marcus
Date: 2007-05-10 16:42:16 +0200 (Thu, 10 May 2007)
New Revision: 157
Modified:
trunk/ChangeLog
trunk/pinentry/pinentry-curses.c
Log:
2007-05-10 Marcus Brinkmann <marcus at g10code.de>
* pinentry/pinentry-curses.c (dialog_create): Re-add calculation
of cancel button position. Adjust calculation of OK button
position if it is the only one used.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-04-13 00:06:55 UTC (rev 156)
+++ trunk/ChangeLog 2007-05-10 14:42:16 UTC (rev 157)
@@ -1,3 +1,9 @@
+2007-05-10 Marcus Brinkmann <marcus at g10code.de>
+
+ * pinentry/pinentry-curses.c (dialog_create): Re-add calculation
+ of cancel button position. Adjust calculation of OK button
+ position if it is the only one used.
+
2007-04-13 Marcus Brinkmann <marcus at g10code.de>
* qt/secqlineedit.h (SecQLineEdit::contextMenuEvent,
Modified: trunk/pinentry/pinentry-curses.c
===================================================================
--- trunk/pinentry/pinentry-curses.c 2007-04-13 00:06:55 UTC (rev 156)
+++ trunk/pinentry/pinentry-curses.c 2007-05-10 14:42:16 UTC (rev 157)
@@ -404,18 +404,29 @@
}
move (ypos, xpos);
addch (ACS_VLINE);
- dialog->ok_y = ypos;
- /* Calculating the left edge of the left button, rounding down. */
- dialog->ok_x = xpos + 2 + ((x - 4) / 2 - strlen (dialog->ok)) / 2;
- move (dialog->ok_y, dialog->ok_x);
- addstr (dialog->ok);
- if ( dialog->cancel)
+
+ if (dialog->cancel)
{
+ dialog->ok_y = ypos;
+ /* Calculating the left edge of the left button, rounding down. */
+ dialog->ok_x = xpos + 2 + ((x - 4) / 2 - strlen (dialog->ok)) / 2;
+ move (dialog->ok_y, dialog->ok_x);
+ addstr (dialog->ok);
+
dialog->cancel_y = ypos;
/* Calculating the left edge of the right button, rounding up. */
+ dialog->cancel_x = xpos + x - 2 - ((x - 4) / 2 + strlen (dialog->cancel)) / 2;
move (dialog->cancel_y, dialog->cancel_x);
addstr (dialog->cancel);
}
+ else
+ {
+ dialog->ok_y = ypos;
+ /* Calculating the left edge of the OK button, rounding down. */
+ dialog->ok_x = xpos + x / 2 - strlen (dialog->ok) / 2;
+ move (dialog->ok_y, dialog->ok_x);
+ addstr (dialog->ok);
+ }
out:
if (description)
More information about the Gnupg-commits
mailing list