Commit 08b24a7c04176e76ab74e95397c39dfa06771bf8

Authored by Perry Werneck
1 parent ca9221dd

Updating dialogs.

src/pw3270/dialog.c
@@ -32,7 +32,9 @@ @@ -32,7 +32,9 @@
32 #include <config.h> 32 #include <config.h>
33 #include "private.h" 33 #include "private.h"
34 #include <v3270.h> 34 #include <v3270.h>
  35 + #include <v3270/dialogs.h>
35 36
  37 + /*
36 #ifdef _WIN32 38 #ifdef _WIN32
37 #include <gdk/gdkwin32.h> 39 #include <gdk/gdkwin32.h>
38 40
@@ -46,14 +48,18 @@ @@ -46,14 +48,18 @@
46 48
47 49
48 #endif // _WIN32 50 #endif // _WIN32
  51 + */
49 52
  53 + /*
50 #if defined(HAVE_LIBSSL) 54 #if defined(HAVE_LIBSSL)
51 #include <openssl/ssl.h> 55 #include <openssl/ssl.h>
52 #include <openssl/err.h> 56 #include <openssl/err.h>
53 #endif 57 #endif
  58 + */
54 59
55 /*--[ Globals ]--------------------------------------------------------------------------------------*/ 60 /*--[ Globals ]--------------------------------------------------------------------------------------*/
56 61
  62 +/*
57 static const struct _charset 63 static const struct _charset
58 { 64 {
59 const gchar *name; 65 const gchar *name;
@@ -67,10 +73,11 @@ @@ -67,10 +73,11 @@
67 73
68 { NULL, NULL } 74 { NULL, NULL }
69 }; 75 };
70 - 76 +*/
71 77
72 /*--[ Implement ]------------------------------------------------------------------------------------*/ 78 /*--[ Implement ]------------------------------------------------------------------------------------*/
73 79
  80 +/*
74 static void charset_changed(GtkComboBox *widget,gchar **encoding) 81 static void charset_changed(GtkComboBox *widget,gchar **encoding)
75 { 82 {
76 gchar *new_encoding = NULL; 83 gchar *new_encoding = NULL;
@@ -101,6 +108,9 @@ @@ -101,6 +108,9 @@
101 108
102 *encoding = new_encoding; 109 *encoding = new_encoding;
103 } 110 }
  111 +*/
  112 +
  113 + /*
104 static void add_option_menus(GtkWidget *widget, GtkAction *action, gchar **encoding) 114 static void add_option_menus(GtkWidget *widget, GtkAction *action, gchar **encoding)
105 { 115 {
106 #if GTK_CHECK_VERSION(3,0,0) 116 #if GTK_CHECK_VERSION(3,0,0)
@@ -184,6 +194,7 @@ @@ -184,6 +194,7 @@
184 gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(widget),box); 194 gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(widget),box);
185 195
186 } 196 }
  197 + */
187 198
188 void save_all_action(GtkAction *action, GtkWidget *widget) 199 void save_all_action(GtkAction *action, GtkWidget *widget)
189 { 200 {
@@ -200,6 +211,7 @@ @@ -200,6 +211,7 @@
200 v3270_save_copy(widget,g_object_get_data(G_OBJECT(action),"filename"),NULL); 211 v3270_save_copy(widget,g_object_get_data(G_OBJECT(action),"filename"),NULL);
201 } 212 }
202 213
  214 + /*
203 static void paste_filename(GtkWidget *widget, const gchar *filename, const gchar *encoding) 215 static void paste_filename(GtkWidget *widget, const gchar *filename, const gchar *encoding)
204 { 216 {
205 GError *error = NULL; 217 GError *error = NULL;
@@ -235,9 +247,22 @@ @@ -235,9 +247,22 @@
235 } 247 }
236 248
237 } 249 }
238 - 250 + */
239 void paste_file_action(GtkAction *action, GtkWidget *widget) 251 void paste_file_action(GtkAction *action, GtkWidget *widget)
240 { 252 {
  253 + const gchar * user_title = g_object_get_data(G_OBJECT(action),"title");
  254 +
  255 + GtkWidget * dialog = v3270_load_dialog_new(widget,g_object_get_data(G_OBJECT(action),"filename"));
  256 +
  257 + if(user_title)
  258 + gtk_window_set_title(GTK_WINDOW(dialog),user_title);
  259 +
  260 + gtk_widget_show_all(dialog);
  261 + v3270_load_dialog_run(dialog);
  262 +
  263 + gtk_widget_destroy(dialog);
  264 +
  265 + /*
241 const gchar * user_title = g_object_get_data(G_OBJECT(action),"title"); 266 const gchar * user_title = g_object_get_data(G_OBJECT(action),"title");
242 const gchar * filename = g_object_get_data(G_OBJECT(action),"filename"); 267 const gchar * filename = g_object_get_data(G_OBJECT(action),"filename");
243 gchar * encattr = NULL; 268 gchar * encattr = NULL;
@@ -289,6 +314,7 @@ @@ -289,6 +314,7 @@
289 314
290 if(encattr) 315 if(encattr)
291 g_free(encattr); 316 g_free(encattr);
  317 + */
292 } 318 }
293 319
294 G_GNUC_INTERNAL void about_dialog_action(GtkAction *action, GtkWidget *widget) 320 G_GNUC_INTERNAL void about_dialog_action(GtkAction *action, GtkWidget *widget)
@@ -366,9 +392,14 @@ @@ -366,9 +392,14 @@
366 gtk_about_dialog_set_authors(dialog,authors); 392 gtk_about_dialog_set_authors(dialog,authors);
367 gtk_about_dialog_set_translator_credits(dialog,_("translator-credits")); 393 gtk_about_dialog_set_translator_credits(dialog,_("translator-credits"));
368 394
  395 + g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL);
  396 + g_signal_connect(dialog,"response",G_CALLBACK(gtk_widget_destroy),NULL);
369 gtk_widget_show_all(GTK_WIDGET(dialog)); 397 gtk_widget_show_all(GTK_WIDGET(dialog));
  398 +
  399 + /*
370 gtk_dialog_run(GTK_DIALOG(dialog)); 400 gtk_dialog_run(GTK_DIALOG(dialog));
371 gtk_widget_destroy(GTK_WIDGET(dialog)); 401 gtk_widget_destroy(GTK_WIDGET(dialog));
  402 + */
372 403
373 } 404 }
374 405
src/pw3270/tools.c
@@ -312,8 +312,14 @@ LIB3270_EXPORT void pw3270_set_host_charset(GtkWidget *widget, const gchar *name @@ -312,8 +312,14 @@ LIB3270_EXPORT void pw3270_set_host_charset(GtkWidget *widget, const gchar *name
312 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),_( "There's no available settings for charset \"%s\"" ),name); 312 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),_( "There's no available settings for charset \"%s\"" ),name);
313 gtk_window_set_title(GTK_WINDOW(dialog),_( "Charset error" )); 313 gtk_window_set_title(GTK_WINDOW(dialog),_( "Charset error" ));
314 314
  315 + g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL);
  316 + g_signal_connect(dialog,"response",G_CALLBACK(gtk_widget_destroy),NULL);
  317 + gtk_widget_show_all(dialog);
  318 +
  319 + /*
315 gtk_dialog_run(GTK_DIALOG (dialog)); 320 gtk_dialog_run(GTK_DIALOG (dialog));
316 gtk_widget_destroy(dialog); 321 gtk_widget_destroy(dialog);
  322 + */
317 323
318 } 324 }
319 325
src/pw3270/window.c
@@ -417,10 +417,15 @@ static GtkWidget * trace_window = NULL; @@ -417,10 +417,15 @@ static GtkWidget * trace_window = NULL;
417 417
418 gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(popup),_( "The known types are %s" ),text); 418 gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(popup),_( "The known types are %s" ),text);
419 419
420 - gtk_dialog_run(GTK_DIALOG(popup));  
421 420
422 - gtk_widget_destroy(popup); 421 + g_signal_connect(popup,"close",G_CALLBACK(gtk_widget_destroy),NULL);
  422 + g_signal_connect(popup,"response",G_CALLBACK(gtk_widget_destroy),NULL);
  423 + gtk_widget_show_all(popup);
423 424
  425 + /*
  426 + gtk_dialog_run(GTK_DIALOG(popup));
  427 + gtk_widget_destroy(popup);
  428 + */
424 429
425 } 430 }
426 431