Commit 7fbca4eb54f183dfd6c243a18802161fed13bcca
1 parent
3f33967d
Exists in
master
and in
1 other branch
Starting the clipboard settings widget.
Showing
4 changed files
with
111 additions
and
4 deletions
Show diff stats
... | ... | @@ -0,0 +1,92 @@ |
1 | +/* | |
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | + * | |
21 | + * Este programa está nomeado como - e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
27 | + * | |
28 | + */ | |
29 | + | |
30 | + /** | |
31 | + * @brief Implements the cut & paste settings widget. | |
32 | + * | |
33 | + */ | |
34 | + | |
35 | + #include <internals.h> | |
36 | + #include <v3270/settings.h> | |
37 | + #include <lib3270/log.h> | |
38 | + | |
39 | +/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
40 | + | |
41 | + typedef struct _V3270ClipboardSettings { | |
42 | + | |
43 | + V3270Settings parent; | |
44 | + | |
45 | + | |
46 | + } V3270ClipboardSettings; | |
47 | + | |
48 | + typedef struct _V3270ClipboardSettingsClass { | |
49 | + | |
50 | + V3270SettingsClass parent_class; | |
51 | + | |
52 | + | |
53 | + } V3270ClipboardSettingsClass; | |
54 | + | |
55 | + static void load(GtkWidget *w, GtkWidget *terminal); | |
56 | + static void apply(GtkWidget *w, GtkWidget *terminal); | |
57 | + | |
58 | + G_DEFINE_TYPE(V3270ClipboardSettings, V3270ClipboardSettings, GTK_TYPE_V3270_SETTINGS); | |
59 | + | |
60 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
61 | + | |
62 | +static void V3270ClipboardSettings_class_init(V3270ClipboardSettingsClass *klass) { | |
63 | + | |
64 | + V3270SettingsClass * widget = GTK_V3270_SETTINGS_CLASS(klass); | |
65 | + | |
66 | + widget->apply = apply; | |
67 | + widget->load = load; | |
68 | + | |
69 | +} | |
70 | + | |
71 | +static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) { | |
72 | + | |
73 | +} | |
74 | + | |
75 | +GtkWidget * v3270_clipboard_settings_new() { | |
76 | + | |
77 | + V3270Settings * settings = GTK_V3270_SETTINGS(g_object_new(V3270ClipboardSettings_get_type(), NULL)); | |
78 | + | |
79 | + settings->title = _("Cut & Paste settings"); | |
80 | + settings->label = _("Clipboard"); | |
81 | + | |
82 | + return GTK_WIDGET(settings); | |
83 | +} | |
84 | + | |
85 | +static void apply(GtkWidget *w, GtkWidget *terminal) { | |
86 | + | |
87 | +} | |
88 | + | |
89 | +static void load(GtkWidget *w, GtkWidget *terminal) { | |
90 | + | |
91 | +} | |
92 | + | ... | ... |
src/include/v3270/settings.h
... | ... | @@ -143,6 +143,9 @@ |
143 | 143 | /// @brief Create color settings widget. |
144 | 144 | LIB3270_EXPORT GtkWidget * v3270_color_settings_new(); |
145 | 145 | |
146 | + /// @brief Create cut & paste settings widget. | |
147 | + LIB3270_EXPORT GtkWidget * v3270_clipboard_settings_new(); | |
148 | + | |
146 | 149 | G_END_DECLS |
147 | 150 | |
148 | 151 | #endif // V3270SETTINGS_H_INCLUDED | ... | ... |
src/testprogram/toolbar.c
... | ... | @@ -65,13 +65,22 @@ |
65 | 65 | |
66 | 66 | static void preferences_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) |
67 | 67 | { |
68 | + size_t ix; | |
68 | 69 | GtkWidget * dialog = v3270_settings_dialog_new(); |
69 | 70 | |
70 | 71 | gtk_window_set_title(GTK_WINDOW(dialog),"Session properties"); |
71 | - gtk_container_add(GTK_CONTAINER(dialog), v3270_host_settings_new()); | |
72 | - gtk_container_add(GTK_CONTAINER(dialog), v3270_color_settings_new()); | |
73 | - gtk_container_add(GTK_CONTAINER(dialog), v3270_font_settings_new()); | |
74 | - gtk_container_add(GTK_CONTAINER(dialog), v3270_accelerator_settings_new()); | |
72 | + | |
73 | + GtkWidget * widgets[] = { | |
74 | + v3270_host_settings_new(), | |
75 | + v3270_color_settings_new(), | |
76 | + v3270_font_settings_new(), | |
77 | + v3270_accelerator_settings_new(), | |
78 | + v3270_clipboard_settings_new() | |
79 | + }; | |
80 | + | |
81 | + for(ix = 0; ix < G_N_ELEMENTS(widgets); ix++) { | |
82 | + gtk_container_add(GTK_CONTAINER(dialog), widgets[ix]); | |
83 | + } | |
75 | 84 | |
76 | 85 | gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(gtk_widget_get_toplevel(terminal))); |
77 | 86 | ... | ... |
v3270.cbp
... | ... | @@ -102,6 +102,9 @@ |
102 | 102 | <Unit filename="src/dialogs/settings/accelerator.c"> |
103 | 103 | <Option compilerVar="CC" /> |
104 | 104 | </Unit> |
105 | + <Unit filename="src/dialogs/settings/clipboard.c"> | |
106 | + <Option compilerVar="CC" /> | |
107 | + </Unit> | |
105 | 108 | <Unit filename="src/dialogs/settings/colors.c"> |
106 | 109 | <Option compilerVar="CC" /> |
107 | 110 | </Unit> | ... | ... |