diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-10-10 01:51:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-10-10 01:51:52 +0000 |
commit | d48bdbc94baf74ac70cb47827fc08f33aacde14f (patch) | |
tree | 9832ca78a89b3ee7a7551c6b8f4d518ff1fac2ee /gtk2 | |
parent | f3cecf25bba7ac38a7aef8dc4dda75f97a199b9f (diff) | |
download | kgtk-qt3-d48bdbc94baf74ac70cb47827fc08f33aacde14f.tar.gz kgtk-qt3-d48bdbc94baf74ac70cb47827fc08f33aacde14f.zip |
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
Diffstat (limited to 'gtk2')
-rw-r--r-- | gtk2/kgtk2.c | 43 |
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 >k_file_chooser_dialog_new; + else if(0==strcmp(raw_name, "gtk_dialog_add_button")) + return >k_dialog_add_button; + else if(0==strcmp(raw_name, "gtk_dialog_add_buttons")) return >k_dialog_add_buttons; |