Make kgtk-qt3 hook into gtk_dialog_add_button to monitor for response ID changes

This, when combined with the previous patch, should fix Firefox not opening files when requested
Bugs affected: 505


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kgtk-qt3@1258110 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent f3cecf25bb
commit d48bdbc94b

@ -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;

Loading…
Cancel
Save