Commit 08b24a7c04176e76ab74e95397c39dfa06771bf8

Authored by Perry Werneck
1 parent ca9221dd

Updating dialogs.

src/pw3270/dialog.c
... ... @@ -32,7 +32,9 @@
32 32 #include <config.h>
33 33 #include "private.h"
34 34 #include <v3270.h>
  35 + #include <v3270/dialogs.h>
35 36  
  37 + /*
36 38 #ifdef _WIN32
37 39 #include <gdk/gdkwin32.h>
38 40  
... ... @@ -46,14 +48,18 @@
46 48  
47 49  
48 50 #endif // _WIN32
  51 + */
49 52  
  53 + /*
50 54 #if defined(HAVE_LIBSSL)
51 55 #include <openssl/ssl.h>
52 56 #include <openssl/err.h>
53 57 #endif
  58 + */
54 59  
55 60 /*--[ Globals ]--------------------------------------------------------------------------------------*/
56 61  
  62 +/*
57 63 static const struct _charset
58 64 {
59 65 const gchar *name;
... ... @@ -67,10 +73,11 @@
67 73  
68 74 { NULL, NULL }
69 75 };
70   -
  76 +*/
71 77  
72 78 /*--[ Implement ]------------------------------------------------------------------------------------*/
73 79  
  80 +/*
74 81 static void charset_changed(GtkComboBox *widget,gchar **encoding)
75 82 {
76 83 gchar *new_encoding = NULL;
... ... @@ -101,6 +108,9 @@
101 108  
102 109 *encoding = new_encoding;
103 110 }
  111 +*/
  112 +
  113 + /*
104 114 static void add_option_menus(GtkWidget *widget, GtkAction *action, gchar **encoding)
105 115 {
106 116 #if GTK_CHECK_VERSION(3,0,0)
... ... @@ -184,6 +194,7 @@
184 194 gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(widget),box);
185 195  
186 196 }
  197 + */
187 198  
188 199 void save_all_action(GtkAction *action, GtkWidget *widget)
189 200 {
... ... @@ -200,6 +211,7 @@
200 211 v3270_save_copy(widget,g_object_get_data(G_OBJECT(action),"filename"),NULL);
201 212 }
202 213  
  214 + /*
203 215 static void paste_filename(GtkWidget *widget, const gchar *filename, const gchar *encoding)
204 216 {
205 217 GError *error = NULL;
... ... @@ -235,9 +247,22 @@
235 247 }
236 248  
237 249 }
238   -
  250 + */
239 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 266 const gchar * user_title = g_object_get_data(G_OBJECT(action),"title");
242 267 const gchar * filename = g_object_get_data(G_OBJECT(action),"filename");
243 268 gchar * encattr = NULL;
... ... @@ -289,6 +314,7 @@
289 314  
290 315 if(encattr)
291 316 g_free(encattr);
  317 + */
292 318 }
293 319  
294 320 G_GNUC_INTERNAL void about_dialog_action(GtkAction *action, GtkWidget *widget)
... ... @@ -366,9 +392,14 @@
366 392 gtk_about_dialog_set_authors(dialog,authors);
367 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 397 gtk_widget_show_all(GTK_WIDGET(dialog));
  398 +
  399 + /*
370 400 gtk_dialog_run(GTK_DIALOG(dialog));
371 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 312 gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),_( "There's no available settings for charset \"%s\"" ),name);
313 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 320 gtk_dialog_run(GTK_DIALOG (dialog));
316 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 417  
418 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  
... ...