summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk2/kgtk2.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/gtk2/kgtk2.c b/gtk2/kgtk2.c
index 933d4db..fe2ce7a 100644
--- a/gtk2/kgtk2.c
+++ b/gtk2/kgtk2.c
@@ -1904,6 +1904,46 @@ void g_signal_stop_emission_by_name(gpointer instance, const gchar *detailed_sig
#endif
}
+GtkWidget * gtk_dialog_add_button(GtkDialog *dialog, const gchar *button_text, gint response_id)
+{
+ static void * (*realFunction)() = NULL;
+
+ GtkWidget *dlg=NULL;
+ KGtkFileData *data=NULL;
+
+ if(!realFunction)
+ realFunction = (void *(*)()) real_dlsym(RTLD_NEXT, "gtk_dialog_add_button");
+ dlg = realFunction(dialog, button_text, response_id);
+
+ determineAppName();
+ if ((kgtkApp == APP_UNKNOWN) && BLACKLIST_UNKNOWN_GTK_APPS && realFunction) {
+#ifdef KGTK_DEBUG
+ printf("KGTK::gtk_dialog_add_button Bypassing internal function\n\r"); fflush(stdout);
+#endif
+ return dlg;
+ }
+
+#ifdef KGTK_DEBUG
+ printf("KGTK::gtk_dialog_add_button\n");
+#endif
+ data=lookupHash(dialog, TRUE);
+
+ if(button_text && (0==strcmp(button_text, GTK_STOCK_CANCEL) || 0==strcmp(button_text, GTK_STOCK_CLOSE) ||
+ 0==strcmp(button_text, GTK_STOCK_QUIT) || 0==strcmp(button_text, GTK_STOCK_NO))) {
+ data->cancel=response_id;
+#ifdef KGTK_DEBUG
+ printf("KGTK::gtk_dialog_add_button Overriding data->cancel: %d\n\r", data->cancel);
+#endif
+ }
+ else if(button_text && (0==strcmp(button_text, GTK_STOCK_OK) || 0==strcmp(button_text, GTK_STOCK_OPEN) ||
+ 0==strcmp(button_text, GTK_STOCK_SAVE) || 0==strcmp(button_text, GTK_STOCK_YES))) {
+ data->ok=response_id;
+#ifdef KGTK_DEBUG
+ printf("KGTK::gtk_dialog_add_button Overriding data->ok: %d\n\r", data->ok);
+#endif
+ }
+}
+
void gtk_dialog_add_buttons(GtkDialog *dialog, const gchar *first_button_text, ...)
{
KGtkFileData *data=NULL;
@@ -2134,6 +2174,9 @@ static void * kgtk_get_fnptr(const char *raw_name)
else if(0==strcmp(raw_name, "gtk_file_chooser_dialog_new"))
return &gtk_file_chooser_dialog_new;
+ else if(0==strcmp(raw_name, "gtk_dialog_add_button"))
+ return &gtk_dialog_add_button;
+
else if(0==strcmp(raw_name, "gtk_dialog_add_buttons"))
return &gtk_dialog_add_buttons;