[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (20c22af4437f3f054e3d09a598c74630ff42d064)
The branch, master has been updated
via 20c22af4437f3f054e3d09a598c74630ff42d064 (commit)
from db06c2c7a74cdf44a3e84482ba980d1a45b7e2d4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
src/hid/gtk/gtkhid-main.c | 29 +++++++++++++++++++++++++----
1 files changed, 25 insertions(+), 4 deletions(-)
=================
Commit Messages
=================
commit 20c22af4437f3f054e3d09a598c74630ff42d064
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>
Allow for only one confirm button.
The GTK confirm_dialog() hook now supports the user passing only one
button. Before, if you passed just "ok" it would create two OK buttons.
:100644 100644 fb2aff1... 90d1485... M src/hid/gtk/gtkhid-main.c
=========
Changes
=========
commit 20c22af4437f3f054e3d09a598c74630ff42d064
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>
Allow for only one confirm button.
The GTK confirm_dialog() hook now supports the user passing only one
button. Before, if you passed just "ok" it would create two OK buttons.
diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index fb2aff1..90d1485 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -785,9 +785,12 @@ ghid_stop_block_hook (hidval mlpoll)
int
ghid_confirm_dialog (char *msg, ...)
{
- int rv;
+ int rv = 0;
va_list ap;
char *cancelmsg = NULL, *okmsg = NULL;
+ static gint x = -1, y = -1;
+ GtkWidget *dialog;
+ GHidPort *out = &ghid_port;
va_start (ap, msg);
cancelmsg = va_arg (ap, char *);
@@ -799,13 +802,31 @@ ghid_confirm_dialog (char *msg, ...)
cancelmsg = _("_Cancel");
okmsg = _("_OK");
}
- if (!okmsg)
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (out->top_window),
+ GTK_DIALOG_MODAL |
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_NONE,
+ "%s", msg);
+ gtk_dialog_add_button (GTK_DIALOG (dialog),
+ cancelmsg, GTK_RESPONSE_CANCEL);
+ if (okmsg)
{
- okmsg = _("_OK");
+ gtk_dialog_add_button (GTK_DIALOG (dialog),
+ okmsg, GTK_RESPONSE_OK);
}
- rv = ghid_dialog_confirm (msg, cancelmsg, okmsg);
+ if(x != -1) {
+ gtk_window_move(GTK_WINDOW (dialog), x, y);
+ }
+
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
+ rv = 1;
+
+ gtk_window_get_position(GTK_WINDOW (dialog), &x, &y);
+ gtk_widget_destroy (dialog);
return rv;
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs