diff --git a/po/pt_BR.po b/po/pt_BR.po index f288065..e1a909c 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-10-01 10:20-0300\n" +"POT-Creation-Date: 2012-10-01 12:22-0300\n" "PO-Revision-Date: 2012-09-27 10:51-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português \n" @@ -18,32 +18,32 @@ msgstr "" "X-Poedit-SourceCharset: utf-8\n" "Plural-Forms: nplurals=2; plural=(n!=1);\n" -#: kybd.c:2667 +#: kybd.c:2678 #, c-format msgid "%s: Bell not supported" msgstr "%s: Alerta sonoro não suportado" -#: kybd.c:2826 +#: kybd.c:2837 #, c-format msgid "%s: Missing hex digits after \\x" msgstr "%s: Faltando dígitos hexadecimais após \\x" -#: kybd.c:2766 +#: kybd.c:2777 #, c-format msgid "%s: Unknown character after \\p" msgstr "%s: Unknown character after \\p" -#: kybd.c:2802 +#: kybd.c:2813 #, c-format msgid "%s: Unknown character after \\pa" msgstr "%s: Unknown character after \\pa" -#: kybd.c:2780 +#: kybd.c:2791 #, c-format msgid "%s: Unknown character after \\pf" msgstr "%s: Unknown character after \\pf" -#: kybd.c:2718 +#: kybd.c:2729 #, c-format msgid "%s: Vertical tab not supported" msgstr "%s: Tabulação verticao não suportada" @@ -79,19 +79,19 @@ msgstr "" msgid "Action failed" msgstr "Ação falhou" -#: ui/00default.xml:286 +#: ui/00default.xml:64 msgid "Add to copy" msgstr "Adicionar à cópia" -#: ui/00default.xml:356 +#: ui/00default.xml:134 msgid "Alert sound" msgstr "Aviso sonoro" -#: ui/10keypad.xml:155 +#: ui/10keypad.xml:420 msgid "Attn" msgstr "Attn" -#: ui/00default.xml:351 +#: ui/00default.xml:129 msgid "Auto-Reconnect" msgstr "Reconectar automaticamente" @@ -99,19 +99,19 @@ msgstr "Reconectar automaticamente" msgid "Bad winsock version" msgstr "Versão winsock inválida" -#: ui/00default.xml:349 +#: ui/00default.xml:127 msgid "Blank Fill" msgstr "Completar com espaços" -#: ui/00default.xml:342 +#: ui/00default.xml:120 msgid "Blinking Cursor" msgstr "Cursor piscante" -#: ui/00default.xml:352 +#: ui/00default.xml:130 msgid "Bold" msgstr "Negrito" -#: ui/10keypad.xml:156 +#: ui/10keypad.xml:421 msgid "Break" msgstr "Break" @@ -176,11 +176,11 @@ msgstr "Tabela de tradução tem %d entradas, precisa de 256" msgid "Charset has more than 256 entries" msgstr "Tabela de tradução tem mais de 256 caracteres" -#: ui/10keypad.xml:147 +#: ui/00default.xml:79 msgid "Clear" msgstr "Limpar" -#: ui/00default.xml:331 +#: ui/00default.xml:109 msgid "Colors" msgstr "Cores" @@ -188,7 +188,7 @@ msgstr "Cores" msgid "Complete" msgstr "Completo" -#: ui/00default.xml:341 +#: ui/00default.xml:119 msgid "Connect on startup" msgstr "Conectar ao iniciar" @@ -200,27 +200,27 @@ msgstr "Conexão falhou" msgid "Connection reset by peer" msgstr "Conexão foi cancelada pelo servidor" -#: ui/00default.xml:283 +#: ui/00default.xml:61 msgid "Copy" msgstr "Copiar" -#: ui/99debug.xml:200 +#: ui/99debug.xml:465 msgid "Copy as HTML" msgstr "Copiar como HTML" -#: ui/00default.xml:284 +#: ui/00default.xml:62 msgid "Copy as table" msgstr "Copiar como tabela" -#: ui/00default.xml:348 +#: ui/00default.xml:126 msgid "Cross Hair Cursor" msgstr "Cursor mira" -#: ui/00default.xml:287 +#: ui/00default.xml:65 msgid "Cut" msgstr "Recortar" -#: ui/99debug.xml:205 +#: ui/99debug.xml:470 msgid "DS Trace" msgstr "DS Trace" @@ -228,15 +228,15 @@ msgstr "DS Trace" msgid "Data conversion error" msgstr "Erro na conversão de dados" -#: ui/99debug.xml:213 +#: ui/99debug.xml:478 msgid "Debug" msgstr "Depuração" -#: ui/99debug.xml:215 +#: ui/99debug.xml:480 msgid "Debug window updates" msgstr "Mostrar atualizações de janela" -#: ui/00default.xml:303 +#: ui/00default.xml:81 msgid "Delete field" msgstr "Apagar campo" @@ -264,7 +264,7 @@ msgstr "Nome do servidor em branco" msgid "Empty port name" msgstr "Porta em branco" -#: ui/10keypad.xml:151 +#: ui/10keypad.xml:416 msgid "" "Erase\n" "EOF" @@ -272,7 +272,7 @@ msgstr "" "Apagar\n" "Campo" -#: ui/10keypad.xml:152 +#: ui/10keypad.xml:417 msgid "" "Erase\n" "Input" @@ -280,15 +280,15 @@ msgstr "" "Apagar\n" "Campos" -#: ui/00default.xml:302 +#: ui/00default.xml:80 msgid "Erase input" msgstr "Apagar campos" -#: ui/00default.xml:304 +#: ui/00default.xml:82 msgid "Erase to end of field" msgstr "Apagar até o final do campo" -#: ui/00default.xml:305 +#: ui/00default.xml:83 msgid "Erase to end of line" msgstr "Apagar até o final da linha" @@ -326,7 +326,7 @@ msgstr "Erro em ioctl(%s) ao ativar o modo não blocante" msgid "Error resolving %s: %s" msgstr "Erro ao resolver %s: %s" -#: ui/99debug.xml:207 +#: ui/99debug.xml:472 msgid "Event Trace" msgstr "Trace de eventos" @@ -338,11 +338,11 @@ msgstr "Extra CGCSGID(s), ignoring" msgid "File transfer is already active in this session" msgstr "Transferência de arquivos já está ativa nesta sessão" -#: ui/00default.xml:345 +#: ui/00default.xml:123 msgid "Full Screen" msgstr "Tela cheia" -#: ui/10functions.xml:35 +#: ui/10functions.xml:300 msgid "Function bar" msgstr "Barra de funções" @@ -375,7 +375,7 @@ msgstr "HTTP Proxy: EOF inesperado" msgid "HTTP Proxy: unrecognized reply" msgstr "HTTP Proxy: Resposta desconhecida" -#: ui/00default.xml:366 +#: ui/00default.xml:144 msgid "Help" msgstr "Ajuda" @@ -404,7 +404,7 @@ msgstr "Formato inválido no nome do servidor" msgid "Illegal frame length" msgstr "Comprimento de frame inválido" -#: ui/00default.xml:361 +#: ui/00default.xml:139 msgid "Input method" msgstr "Método de entrada" @@ -439,7 +439,7 @@ msgstr "Sintaxe de proxy inválida" msgid "Invalid proxy type '%.*s'" msgstr "Tipo de proxy invalido '%.*s'" -#: ui/00default.xml:354 +#: ui/00default.xml:132 msgid "Keep selected" msgstr "Manter selecionado" @@ -447,7 +447,7 @@ msgstr "Manter selecionado" msgid "Keyboard is locked" msgstr "Teclado está bloqueado" -#: ui/10keypad.xml:101 +#: ui/10keypad.xml:366 msgid "Lateral keypad" msgstr "Barra lateral" @@ -455,7 +455,7 @@ msgstr "Barra lateral" msgid "Missing ']'" msgstr "Faltando ']'" -#: ui/00default.xml:343 +#: ui/00default.xml:121 msgid "Monocase" msgstr "Só Maiúsculas" @@ -475,7 +475,7 @@ msgstr "Erro de rede" msgid "Network startup error" msgstr "Erro ao iniciar a rede" -#: ui/00default.xml:413 +#: ui/00default.xml:191 msgid "Next field" msgstr "Próximo campo" @@ -492,111 +492,111 @@ msgstr "Não está no modo 3270, transferência cancelada" msgid "Option '%c:' is not supported" msgstr "Opção não suportada: '%c:'" -#: ui/10keypad.xml:138 +#: ui/10keypad.xml:403 msgid "PA1" msgstr "PA1" -#: ui/10keypad.xml:139 +#: ui/10keypad.xml:404 msgid "PA2" msgstr "PA2" -#: ui/10keypad.xml:140 +#: ui/10keypad.xml:405 msgid "PA3" msgstr "PA3" -#: ui/10functions.xml:36 +#: ui/10functions.xml:301 msgid "PF1" msgstr "PF1" -#: ui/10functions.xml:45 +#: ui/10functions.xml:310 msgid "PF10" msgstr "PF10" -#: ui/10functions.xml:46 +#: ui/10functions.xml:311 msgid "PF11" msgstr "PF11" -#: ui/10functions.xml:47 +#: ui/10functions.xml:312 msgid "PF12" msgstr "PF12" -#: ui/10functions.xml:50 +#: ui/10functions.xml:315 msgid "PF13" msgstr "PF13" -#: ui/10functions.xml:51 +#: ui/10functions.xml:316 msgid "PF14" msgstr "PF14" -#: ui/10functions.xml:52 +#: ui/10functions.xml:317 msgid "PF15" msgstr "PF15" -#: ui/10functions.xml:53 +#: ui/10functions.xml:318 msgid "PF16" msgstr "PF16" -#: ui/10functions.xml:54 +#: ui/10functions.xml:319 msgid "PF17" msgstr "PF17" -#: ui/10functions.xml:55 +#: ui/10functions.xml:320 msgid "PF18" msgstr "PF18" -#: ui/10functions.xml:56 +#: ui/10functions.xml:321 msgid "PF19" msgstr "PF19" -#: ui/10functions.xml:37 +#: ui/10functions.xml:302 msgid "PF2" msgstr "PF2" -#: ui/10functions.xml:57 +#: ui/10functions.xml:322 msgid "PF20" msgstr "PF20" -#: ui/10functions.xml:58 +#: ui/10functions.xml:323 msgid "PF21" msgstr "PF21" -#: ui/10functions.xml:59 +#: ui/10functions.xml:324 msgid "PF22" msgstr "PF22" -#: ui/10functions.xml:60 +#: ui/10functions.xml:325 msgid "PF23" msgstr "PF23" -#: ui/10functions.xml:61 +#: ui/10functions.xml:326 msgid "PF24" msgstr "PF24" -#: ui/10functions.xml:38 +#: ui/10functions.xml:303 msgid "PF3" msgstr "PF3" -#: ui/10functions.xml:39 +#: ui/10functions.xml:304 msgid "PF4" msgstr "PF4" -#: ui/10functions.xml:40 +#: ui/10functions.xml:305 msgid "PF5" msgstr "PF5" -#: ui/10functions.xml:41 +#: ui/10functions.xml:306 msgid "PF6" msgstr "PF6" -#: ui/10functions.xml:42 +#: ui/10functions.xml:307 msgid "PF7" msgstr "PF7" -#: ui/10functions.xml:43 +#: ui/10functions.xml:308 msgid "PF8" msgstr "PF8" -#: ui/10functions.xml:44 +#: ui/10functions.xml:309 msgid "PF9" msgstr "PF9" @@ -604,39 +604,39 @@ msgstr "PF9" msgid "Passthru Proxy: send error" msgstr "Passthru Proxy: Erro ao enviar" -#: ui/00default.xml:288 +#: ui/00default.xml:66 msgid "Paste" msgstr "Colar" -#: ui/00default.xml:289 +#: ui/00default.xml:67 msgid "Paste next" msgstr "Colar próximo" -#: ui/00default.xml:292 +#: ui/00default.xml:70 msgid "Paste text file" msgstr "Colar arquivo texto" -#: ui/00default.xml:347 +#: ui/00default.xml:125 msgid "Paste with left margin" msgstr "Colar com margem esquerda" -#: ui/00default.xml:412 +#: ui/00default.xml:190 msgid "Previous field" msgstr "Campo anterior" -#: ui/00default.xml:271 +#: ui/00default.xml:49 msgid "Print" msgstr "Imprimir" -#: ui/00default.xml:273 +#: ui/00default.xml:51 msgid "Print copy" msgstr "Imprimir cópia" -#: ui/00default.xml:272 +#: ui/00default.xml:50 msgid "Print selected" msgstr "Imprimir seleção" -#: ui/00default.xml:332 +#: ui/00default.xml:110 msgid "Print settings" msgstr "Configurações de impressão" @@ -707,31 +707,31 @@ msgstr "RPQ: can't resolve '%s': %s" msgid "RPQ: gethostbyname error" msgstr "RPQ: Erro em gethostbyname" -#: ui/00default.xml:276 +#: ui/00default.xml:54 msgid "Receive file" msgstr "Receber arquivo" -#: ui/99debug.xml:214 +#: ui/99debug.xml:479 msgid "Reload buffer contents" msgstr "Recarregar conteúdo do buffer" -#: ui/00default.xml:297 +#: ui/00default.xml:75 msgid "Remove selection" msgstr "Remover seleção" -#: ui/00default.xml:298 +#: ui/00default.xml:76 msgid "Reselect" msgstr "Reselecionar" -#: ui/10keypad.xml:148 +#: ui/10keypad.xml:413 msgid "Reset" msgstr "Reset" -#: ui/00default.xml:346 +#: ui/00default.xml:124 msgid "Resize on alternate screen" msgstr "Mudar tamanho do terminal em tela alternativa" -#: ui/00default.xml:414 +#: ui/00default.xml:192 msgid "Return" msgstr "Return" @@ -888,67 +888,67 @@ msgstr "" "SSL_write:\n" "%s" -#: ui/00default.xml:268 +#: ui/00default.xml:46 msgid "Save copy" msgstr "Salvar cópia" -#: ui/00default.xml:266 +#: ui/00default.xml:44 msgid "Save screen" msgstr "Salvar tela" -#: ui/00default.xml:267 +#: ui/00default.xml:45 msgid "Save selected" msgstr "Salvar seleção" -#: ui/99debug.xml:206 +#: ui/99debug.xml:471 msgid "Screen Trace" msgstr "Trace de tela" -#: ui/00default.xml:338 +#: ui/00default.xml:116 msgid "Screen size" msgstr "Tamanho da tela" -#: ui/00default.xml:296 +#: ui/00default.xml:74 msgid "Select Field" msgstr "Selecionar campo" -#: ui/00default.xml:295 +#: ui/00default.xml:73 msgid "Select all" msgstr "Selecionar tudo" -#: ui/00default.xml:350 +#: ui/00default.xml:128 msgid "Select by rectangles" msgstr "Seleção retangular" -#: ui/00default.xml:335 +#: ui/00default.xml:113 msgid "Select font" msgstr "Selecione fonte" -#: ui/00default.xml:277 +#: ui/00default.xml:55 msgid "Send file" msgstr "Enviar arquivo" -#: ui/00default.xml:276 +#: ui/00default.xml:54 msgid "Send/Receive" msgstr "Enviar/Receber" -#: ui/00default.xml:316 +#: ui/00default.xml:94 msgid "Set hostname" msgstr "Selecione servidor" -#: ui/00default.xml:331 +#: ui/00default.xml:109 msgid "Settings" msgstr "Configurações" -#: ui/00default.xml:353 +#: ui/00default.xml:131 msgid "Show Underline" msgstr "Mostrar sublinhado" -#: ui/99debug.xml:213 +#: ui/99debug.xml:478 msgid "Show test pattern" msgstr "Mostrar padrão de teste" -#: ui/00default.xml:355 +#: ui/00default.xml:133 msgid "Smart paste" msgstr "Colar inteligente" @@ -986,15 +986,15 @@ msgid "" "This version of %s was built without support for secure sockets layer (SSL)." msgstr "Esta versão do %s foi gerada sem suporte para conexões seguras (SSL)." -#: ui/00default.xml:372 +#: ui/00default.xml:150 msgid "Toolbar" msgstr "Barra de ferramentas" -#: ui/99debug.xml:205 +#: ui/99debug.xml:470 msgid "Trace" msgstr "Trace" -#: ui/00default.xml:344 +#: ui/00default.xml:122 msgid "Track Cursor" msgstr "Mostrar posição do cursor" @@ -1030,7 +1030,7 @@ msgstr "Não foi possível enviar a requisição de transferência de arquivo" msgid "Unexpected error" msgstr "Erro inesperado" -#: kybd.c:338 +#: kybd.c:339 #, c-format msgid "Unexpected type %d in typeahead queue" msgstr "Tipo inesperado %d na fila de teclado" @@ -1044,12 +1044,12 @@ msgstr "Unknown 3270 Data Stream command: 0x%X" msgid "Unknown FT control code from host" msgstr "Servidor enviou código de controle FT desconhecido" -#: kybd.c:2416 +#: kybd.c:2427 #, c-format msgid "Unknown PA key %d" msgstr "PA %d desconhecida" -#: kybd.c:2431 +#: kybd.c:2442 #, c-format msgid "Unknown PF key %d" msgstr "PF %d desconhecida" @@ -1089,11 +1089,11 @@ msgstr "Unsupported passthru host session" msgid "Unsupported socks 4 proxy" msgstr "Unsupported socks 4 proxy" -#: ui/00default.xml:357 +#: ui/00default.xml:135 msgid "Use +/- for field navigation" msgstr "Usar teclas +/- para navegar por campos" -#: ui/99debug.xml:208 +#: ui/99debug.xml:473 msgid "View Field Delimiters" msgstr "Mostrar delimitadores de campo" @@ -1113,35 +1113,35 @@ msgstr "Aguardando resposta do pedido de download" msgid "Waiting for PUT response" msgstr "Aguardando resposta do pedido de upload" -#: ui/00default.xml:383 +#: ui/00default.xml:161 msgid "Window" msgstr "Janela" -#: ui/00default.xml:326 +#: ui/00default.xml:104 msgid "_Connect" msgstr "_Conectar" -#: ui/00default.xml:327 +#: ui/00default.xml:105 msgid "_Disconnect" msgstr "_Desconectar" -#: ui/99debug.xml:200 +#: ui/00default.xml:61 msgid "_Edit" msgstr "_Editar" -#: ui/00default.xml:258 +#: ui/00default.xml:36 msgid "_File" msgstr "_Arquivo" -#: ui/00default.xml:316 +#: ui/00default.xml:94 msgid "_Network" msgstr "_Rede" -#: ui/00default.xml:341 +#: ui/00default.xml:119 msgid "_Options" msgstr "_Opções" -#: ui/00default.xml:309 +#: ui/00default.xml:87 msgid "_View" msgstr "_Exibir" diff --git a/src/include/pw3270.h b/src/include/pw3270.h index 3ba35a1..d64c7e1 100644 --- a/src/include/pw3270.h +++ b/src/include/pw3270.h @@ -77,7 +77,7 @@ PW3270_SRC_USER } PW3270_SRC; - LIB3270_EXPORT void pw3270_print(GtkWidget *widget, GObject *action, GtkPrintOperationAction oper, PW3270_SRC src); + LIB3270_EXPORT int pw3270_print(GtkWidget *widget, GObject *action, GtkPrintOperationAction oper, PW3270_SRC src); #ifdef HAVE_GTKMAC #include diff --git a/src/plugins/remotectl/remotectl.c b/src/plugins/remotectl/remotectl.c index cdb6178..8c283cd 100644 --- a/src/plugins/remotectl/remotectl.c +++ b/src/plugins/remotectl/remotectl.c @@ -98,7 +98,7 @@ 1, // number of instances PIPE_BUFFER_LENGTH, // output buffer size PIPE_BUFFER_LENGTH, // input buffer size - 0, // client time-out + NMPWAIT_USE_DEFAULT_WAIT, // client time-out NULL); // default security attributes trace("%s = %p",pipename,hPipe); @@ -185,6 +185,7 @@ text = g_convert(buffer,length,lib3270_get_charset(hSession),charset,&bytes_read,&bytes_written,&error); if(text) { + rc = 0; if(strchr(text,control_char)) { // Convert control char @@ -200,7 +201,7 @@ switch(*(ptr++)) { case 'P': // Print - pw3270_print(pw3270_get_toplevel(), NULL, GTK_PRINT_OPERATION_ACTION_PRINT, PW3270_SRC_ALL); + rc = pw3270_print(pw3270_get_terminal_widget(NULL), NULL, GTK_PRINT_OPERATION_ACTION_PRINT, PW3270_SRC_ALL); break; case 'E': // Enter @@ -270,7 +271,6 @@ lib3270_emulate_input(hSession,text,strlen(text),0); } g_free(text); - rc = 0; } else { diff --git a/src/pw3270/print.c b/src/pw3270/print.c index 41848ab..258c477 100644 --- a/src/pw3270/print.c +++ b/src/pw3270/print.c @@ -436,6 +436,7 @@ static gchar * enum_to_string(GType type, guint enum_value) #ifdef WIN32 void update_settings(const gchar *key, const gchar *val, gpointer *settings) { + trace("%s: %s=\"%s\"",__FUNCTION__,key,val); gtk_print_settings_set(GTK_PRINT_SETTINGS(settings), key, val); } #endif // WIN32 @@ -537,65 +538,11 @@ static gchar * enum_to_string(GType type, guint enum_value) void print_all_action(GtkAction *action, GtkWidget *widget) { pw3270_print(widget,G_OBJECT(action),GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, PW3270_SRC_ALL); - -/* - PRINT_INFO * info = NULL; - GtkPrintOperation * print = begin_print_operation(G_OBJECT(action),widget,&info); - - #ifdef X3270_TRACE - lib3270_trace_event(NULL,"Action %s activated on widget %p\n",gtk_action_get_name(action),widget); - #endif - - lib3270_get_screen_size(info->session,&info->rows,&info->cols); - - info->all = 1; - g_signal_connect(print,"begin_print",G_CALLBACK(begin_print),info); - g_signal_connect(print,"draw_page",G_CALLBACK(draw_screen),info); - - // Run Print dialog - gtk_print_operation_run(print,GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,GTK_WINDOW(gtk_widget_get_toplevel(widget)),NULL); - - - g_object_unref(print); -*/ } void print_selected_action(GtkAction *action, GtkWidget *widget) { pw3270_print(widget,G_OBJECT(action),GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, PW3270_SRC_SELECTED); - -/* - PRINT_INFO * info = NULL; - int start, end, rows; - GtkPrintOperation * print = begin_print_operation(G_OBJECT(action),widget,&info);; - - #ifdef X3270_TRACE - lib3270_trace_event(NULL,"Action %s activated on widget %p\n",gtk_action_get_name(action),widget); - #endif - - if(!lib3270_get_selection_bounds(info->session,&start,&end)) - { - g_warning("Can't get selected addresses for action %s",gtk_action_get_name(action)); - g_object_unref(print); - return; - } - - info->baddr = start; - lib3270_get_screen_size(info->session,&rows,&info->cols); - - info->rows = ((end / info->cols) - (start / info->cols))+1; - - trace("First row: %d End row: %d Num rows: %d",(start / info->cols),(end / info->cols),info->rows); - - info->all = 0; - g_signal_connect(print,"begin_print",G_CALLBACK(begin_print),info); - g_signal_connect(print,"draw_page",G_CALLBACK(draw_screen),info); - - // Run Print dialog - gtk_print_operation_run(print,GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,GTK_WINDOW(gtk_widget_get_toplevel(widget)),NULL); - - g_object_unref(print); -*/ } static void draw_text(GtkPrintOperation *prt, GtkPrintContext *context, gint pg, PRINT_INFO *info) @@ -626,45 +573,12 @@ static gchar * enum_to_string(GType type, guint enum_value) void print_copy_action(GtkAction *action, GtkWidget *widget) { pw3270_print(widget,G_OBJECT(action),GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, PW3270_SRC_COPY); - -/* - PRINT_INFO * info = NULL; - GtkPrintOperation * print; - const gchar * text = v3270_get_copy(widget); - int r; - - #ifdef X3270_TRACE - lib3270_trace_event(NULL,"Action %s activated on widget %p\n",gtk_action_get_name(action),widget); - #endif - - if(!text) - return; - - print = begin_print_operation(G_OBJECT(action),widget,&info); - info->text = g_strsplit(text,"\n",-1); - info->rows = g_strv_length(info->text); - - for(r=0;r < info->rows;r++) - { - size_t sz = strlen(info->text[r]); - if(sz > info->cols) - info->cols = sz; - } - - g_signal_connect(print,"begin_print",G_CALLBACK(begin_print),info); - g_signal_connect(print,"draw_page",G_CALLBACK(draw_text),info); - - // Run Print dialog - gtk_print_operation_run(print,GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,GTK_WINDOW(gtk_widget_get_toplevel(widget)),NULL); - - g_object_unref(print); -*/ } - LIB3270_EXPORT void pw3270_print(GtkWidget *widget, GObject *action, GtkPrintOperationAction oper, PW3270_SRC src) + LIB3270_EXPORT int pw3270_print(GtkWidget *widget, GObject *action, GtkPrintOperationAction oper, PW3270_SRC src) { PRINT_INFO * info = NULL; - GtkPrintOperation * print = begin_print_operation(action,widget,&info); + GtkPrintOperation * print; const gchar * text; #ifdef X3270_TRACE @@ -672,6 +586,12 @@ static gchar * enum_to_string(GType type, guint enum_value) lib3270_trace_event(v3270_get_session(widget),"Action %s activated on widget %p\n",gtk_action_get_name(GTK_ACTION(action)),widget); #endif + g_return_val_if_fail(GTK_IS_V3270(widget),EINVAL); + + print = begin_print_operation(action,widget,&info); + if(!print) + return -1; + lib3270_get_screen_size(info->session,&info->rows,&info->cols); info->src = src; @@ -710,6 +630,8 @@ static gchar * enum_to_string(GType type, guint enum_value) // Run Print dialog gtk_print_operation_run(print,oper,GTK_WINDOW(gtk_widget_get_toplevel(widget)),NULL); g_object_unref(print); + + return 0; } void print_settings_action(GtkAction *action, GtkWidget *terminal) -- libgit2 0.21.2