Commit 228b06a67df7a671408c5812065c5dda977908f0
1 parent
34e5473b
Exists in
master
and in
5 other branches
Incluindo dialogo de about
Showing
9 changed files
with
70 additions
and
12 deletions
Show diff stats
src/gtk/actions.c
| @@ -182,6 +182,7 @@ static void connect_standard_action(GtkAction *action, GtkWidget *widget, const | @@ -182,6 +182,7 @@ static void connect_standard_action(GtkAction *action, GtkWidget *widget, const | ||
| 182 | { "disconnect", disconnect_action }, | 182 | { "disconnect", disconnect_action }, |
| 183 | { "hostname", hostname_action }, | 183 | { "hostname", hostname_action }, |
| 184 | { "editcolors", editcolors_action }, | 184 | { "editcolors", editcolors_action }, |
| 185 | + { "about", about_dialog_action }, | ||
| 185 | }; | 186 | }; |
| 186 | 187 | ||
| 187 | int f; | 188 | int f; |
| @@ -492,12 +493,7 @@ GtkAction * ui_get_action(GtkWidget *widget, const gchar *name, GHashTable *hash | @@ -492,12 +493,7 @@ GtkAction * ui_get_action(GtkWidget *widget, const gchar *name, GHashTable *hash | ||
| 492 | } | 493 | } |
| 493 | else if(!g_strcasecmp(name,"select")) | 494 | else if(!g_strcasecmp(name,"select")) |
| 494 | { | 495 | { |
| 495 | - static const gchar * src[] = { "all", | ||
| 496 | - "field", | ||
| 497 | - "none", | ||
| 498 | - "last", | ||
| 499 | - NULL | ||
| 500 | - }; | 496 | + static const gchar * src[] = { "all", "field", "none", "last", NULL }; |
| 501 | 497 | ||
| 502 | static const GCallback cbk[] = { G_CALLBACK(action_select_all), | 498 | static const GCallback cbk[] = { G_CALLBACK(action_select_all), |
| 503 | G_CALLBACK(action_select_field), | 499 | G_CALLBACK(action_select_field), |
src/gtk/dialog.c
| @@ -514,3 +514,44 @@ | @@ -514,3 +514,44 @@ | ||
| 514 | g_free(encattr); | 514 | g_free(encattr); |
| 515 | } | 515 | } |
| 516 | 516 | ||
| 517 | + G_GNUC_INTERNAL void about_dialog_action(GtkAction *action, GtkWidget *widget) | ||
| 518 | + { | ||
| 519 | + static const gchar *authors[] = { "Paul Mattes <Paul.Mattes@usa.net>", | ||
| 520 | + "GTRC", | ||
| 521 | + "Perry Werneck <perry.werneck@gmail.com>", | ||
| 522 | + "and others", | ||
| 523 | + NULL }; | ||
| 524 | + | ||
| 525 | + static const gchar *license = | ||
| 526 | + N_( "This program is free software; you can redistribute it and/or " | ||
| 527 | + "modify it under the terms of the GNU General Public License as " | ||
| 528 | + "published by the Free Software Foundation; either version 2 of the " | ||
| 529 | + "License, or (at your option) any later version.\n\n" | ||
| 530 | + "This program is distributed in the hope that it will be useful, " | ||
| 531 | + "but WITHOUT ANY WARRANTY; without even the implied warranty of " | ||
| 532 | + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " | ||
| 533 | + "GNU General Public License for more details.\n\n" | ||
| 534 | + "You should have received a copy of the GNU General Public License " | ||
| 535 | + "along with this program; if not, write to the Free Software " | ||
| 536 | + "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 " | ||
| 537 | + "USA" ); | ||
| 538 | + | ||
| 539 | + GtkAboutDialog *dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new()); | ||
| 540 | + | ||
| 541 | + gtk_about_dialog_set_version(dialog, PACKAGE_VERSION ); | ||
| 542 | + gtk_about_dialog_set_copyright(dialog, "Copyright © 2008 Banco do Brasil S.A." ); | ||
| 543 | + gtk_about_dialog_set_comments(dialog, _( "3270 terminal emulator for GTK+" ) ); | ||
| 544 | + | ||
| 545 | + gtk_about_dialog_set_license(dialog, gettext( license ) ); | ||
| 546 | + gtk_about_dialog_set_wrap_license(dialog,TRUE); | ||
| 547 | + | ||
| 548 | + gtk_about_dialog_set_website(dialog,"http://www.softwarepublico.gov.br/dotlrn/clubs/pw3270"); | ||
| 549 | + gtk_about_dialog_set_website_label(dialog,_( "Brazilian Public Software Portal" )); | ||
| 550 | + | ||
| 551 | + gtk_about_dialog_set_authors(dialog,authors); | ||
| 552 | + gtk_about_dialog_set_translator_credits(dialog,_("translator-credits")); | ||
| 553 | + | ||
| 554 | + gtk_widget_show_all(GTK_WIDGET(dialog)); | ||
| 555 | + gtk_dialog_run(GTK_DIALOG(dialog)); | ||
| 556 | + gtk_widget_destroy(GTK_WIDGET(dialog)); | ||
| 557 | + } |
src/gtk/globals.h
| @@ -73,4 +73,5 @@ | @@ -73,4 +73,5 @@ | ||
| 73 | G_GNUC_INTERNAL void print_selected_action(GtkAction *action, GtkWidget *widget); | 73 | G_GNUC_INTERNAL void print_selected_action(GtkAction *action, GtkWidget *widget); |
| 74 | G_GNUC_INTERNAL void print_copy_action(GtkAction *action, GtkWidget *widget); | 74 | G_GNUC_INTERNAL void print_copy_action(GtkAction *action, GtkWidget *widget); |
| 75 | G_GNUC_INTERNAL void editcolors_action(GtkAction *action, GtkWidget *widget); | 75 | G_GNUC_INTERNAL void editcolors_action(GtkAction *action, GtkWidget *widget); |
| 76 | + G_GNUC_INTERNAL void about_dialog_action(GtkAction *action, GtkWidget *widget); | ||
| 76 | 77 |
src/gtk/mainwindow.c
| @@ -368,7 +368,7 @@ | @@ -368,7 +368,7 @@ | ||
| 368 | 368 | ||
| 369 | g_free(path); | 369 | g_free(path); |
| 370 | 370 | ||
| 371 | - if(lib3270_get_toggle(host,LIB3270_TOGGLE_FULL_SCREEN)) | 371 | + if(v3270_get_toggle(terminal,LIB3270_TOGGLE_FULL_SCREEN)) |
| 372 | gtk_window_fullscreen(GTK_WINDOW(window)); | 372 | gtk_window_fullscreen(GTK_WINDOW(window)); |
| 373 | 373 | ||
| 374 | #ifdef DEBUG | 374 | #ifdef DEBUG |
| @@ -378,7 +378,7 @@ | @@ -378,7 +378,7 @@ | ||
| 378 | trace("%s ends",__FUNCTION__); | 378 | trace("%s ends",__FUNCTION__); |
| 379 | gtk_window_set_focus(GTK_WINDOW(window),terminal); | 379 | gtk_window_set_focus(GTK_WINDOW(window),terminal); |
| 380 | 380 | ||
| 381 | - if(lib3270_get_toggle(host,LIB3270_TOGGLE_CONNECT_ON_STARTUP)) | 381 | + if(v3270_get_toggle(terminal,LIB3270_TOGGLE_CONNECT_ON_STARTUP)) |
| 382 | lib3270_connect(host,NULL,0); | 382 | lib3270_connect(host,NULL,0); |
| 383 | 383 | ||
| 384 | return window; | 384 | return window; |
src/gtk/v3270/clipboard.c
| @@ -96,6 +96,14 @@ gchar * v3270_get_text(GtkWidget *widget, int offset, int len) | @@ -96,6 +96,14 @@ gchar * v3270_get_text(GtkWidget *widget, int offset, int len) | ||
| 96 | return text; | 96 | return text; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | +/** | ||
| 100 | + * Get lib3270 selection as a g_malloc buffer. | ||
| 101 | + * | ||
| 102 | + * @param widget Widget containing the desired section. | ||
| 103 | + * | ||
| 104 | + * @return NULL if error, otherwise the selected buffer contents (release with g_free). | ||
| 105 | + * | ||
| 106 | + */ | ||
| 99 | static gchar * v3270_get_selected(v3270 *widget) | 107 | static gchar * v3270_get_selected(v3270 *widget) |
| 100 | { | 108 | { |
| 101 | gchar *text = lib3270_get_selected(widget->host); | 109 | gchar *text = lib3270_get_selected(widget->host); |
src/gtk/v3270/v3270.h
| @@ -171,6 +171,8 @@ | @@ -171,6 +171,8 @@ | ||
| 171 | 171 | ||
| 172 | // Misc | 172 | // Misc |
| 173 | GtkIMContext * v3270_get_im_context(GtkWidget *widget); | 173 | GtkIMContext * v3270_get_im_context(GtkWidget *widget); |
| 174 | + gboolean v3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix); | ||
| 175 | + | ||
| 174 | 176 | ||
| 175 | 177 | ||
| 176 | G_END_DECLS | 178 | G_END_DECLS |
src/gtk/v3270/widget.c
| @@ -1180,3 +1180,13 @@ GtkIMContext * v3270_get_im_context(GtkWidget *widget) | @@ -1180,3 +1180,13 @@ GtkIMContext * v3270_get_im_context(GtkWidget *widget) | ||
| 1180 | return GTK_V3270(widget)->input_method; | 1180 | return GTK_V3270(widget)->input_method; |
| 1181 | } | 1181 | } |
| 1182 | 1182 | ||
| 1183 | + gboolean v3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix) | ||
| 1184 | + { | ||
| 1185 | + g_return_val_if_fail(GTK_IS_V3270(widget),FALSE); | ||
| 1186 | + | ||
| 1187 | + if(ix < LIB3270_TOGGLE_COUNT) | ||
| 1188 | + return lib3270_get_toggle(GTK_V3270(widget)->host,ix) ? TRUE : FALSE; | ||
| 1189 | + | ||
| 1190 | + return FALSE; | ||
| 1191 | + } | ||
| 1192 | + |
src/lib3270/Makefile.in
| @@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
| 28 | 28 | ||
| 29 | PACKAGE=@PACKAGE_NAME@ | 29 | PACKAGE=@PACKAGE_NAME@ |
| 30 | 30 | ||
| 31 | -CFLAGS=@CFLAGS@ @DLL_CFLAGS@ -DAPPDATA=\"$(datarootdir)/$(PACKAGE_NAME)\" -I../../src/include | 31 | +CFLAGS=@CFLAGS@ @DLL_CFLAGS@ -DAPPDATA=\"$(datarootdir)/$(PACKAGE_NAME)\" -I../include |
| 32 | SSL_CFLAGS=@LIBSSL_CFLAGS@ | 32 | SSL_CFLAGS=@LIBSSL_CFLAGS@ |
| 33 | 33 | ||
| 34 | DLL_FLAGS=@DLL_FLAGS@ | 34 | DLL_FLAGS=@DLL_FLAGS@ |
| @@ -37,7 +37,7 @@ LDFLAGS=@LDFLAGS@ | @@ -37,7 +37,7 @@ LDFLAGS=@LDFLAGS@ | ||
| 37 | LIBS=@LIBS@ @LIBSSL_LIBS@ @INTL_LIBS@ @SOCKET_LIBS@ | 37 | LIBS=@LIBS@ @LIBSSL_LIBS@ @INTL_LIBS@ @SOCKET_LIBS@ |
| 38 | 38 | ||
| 39 | DEBUG_CFLAGS=-DDEBUG=1 -g | 39 | DEBUG_CFLAGS=-DDEBUG=1 -g |
| 40 | -DEPENDS ?= *.h ../../src/include/*.h Makefile | 40 | +DEPENDS ?= *.h ../include/*.h Makefile |
| 41 | 41 | ||
| 42 | #---[ Paths ]------------------------------------------------------------------ | 42 | #---[ Paths ]------------------------------------------------------------------ |
| 43 | 43 | ||
| @@ -118,7 +118,7 @@ $(BINRLS)/@DLLPREFIX@3270@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJR | @@ -118,7 +118,7 @@ $(BINRLS)/@DLLPREFIX@3270@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJR | ||
| 118 | @$(LD) $(DLL_FLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) | 118 | @$(LD) $(DLL_FLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) |
| 119 | @$(STRIP) $@ | 119 | @$(STRIP) $@ |
| 120 | 120 | ||
| 121 | -$(BINDIR)/Debug/testprogram$(EXEEXT): testprogram.o $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) | 121 | +$(BINDBG)/testprogram$(EXEEXT): $(OBJDBG)/testprogram.o $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) |
| 122 | 122 | ||
| 123 | @echo $@ ... | 123 | @echo $@ ... |
| 124 | @$(MKDIR) `dirname $@` | 124 | @$(MKDIR) `dirname $@` |
ui/00default.xml
| @@ -137,7 +137,7 @@ | @@ -137,7 +137,7 @@ | ||
| 137 | </menu> | 137 | </menu> |
| 138 | 138 | ||
| 139 | <menu name='HelpMenu' label='Help' > | 139 | <menu name='HelpMenu' label='Help' > |
| 140 | - <menuitem action='About' icon='about' sysmenu='yes' /> | 140 | + <menuitem action='about' icon='about' sysmenu='yes' /> |
| 141 | </menu> | 141 | </menu> |
| 142 | 142 | ||
| 143 | </menubar> | 143 | </menubar> |