Commit fade02b5dea5fc946a2a3765dd7e50a9b51eb58e

Authored by Perry Werneck
1 parent aa1eb8f9
Exists in master and in 1 other branch develop

Adding settings dialog for the 'open-url' attribute.

Showing 1 changed file with 40 additions and 32 deletions   Show diff stats
src/dialogs/settings/clipboard.c
  1 +/* SPDX-License-Identifier: LGPL-3.0-or-later */
  2 +
1 /* 3 /*
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. 4 + * Copyright (C) 2008 Banco do Brasil S.A.
22 * 5 *
23 - * Contatos: 6 + * This program is free software: you can redistribute it and/or modify
  7 + * it under the terms of the GNU Lesser General Public License as published
  8 + * by the Free Software Foundation, either version 3 of the License, or
  9 + * (at your option) any later version.
24 * 10 *
25 - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)  
26 - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) 11 + * This program is distributed in the hope that it will be useful,
  12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
27 * 15 *
  16 + * You should have received a copy of the GNU Lesser General Public License
  17 + * along with this program. If not, see <https://www.gnu.org/licenses/>.
28 */ 18 */
29 19
30 /** 20 /**
@@ -57,8 +47,8 @@ @@ -57,8 +47,8 @@
57 }, 47 },
58 48
59 { 49 {
60 - .left = 1,  
61 - .top = 2, 50 + .left = 2,
  51 + .top = 1,
62 .width = 1, 52 .width = 1,
63 .grid = COPY_SETTINGS, 53 .grid = COPY_SETTINGS,
64 .id = LIB3270_TOGGLE_KEEP_SELECTED, 54 .id = LIB3270_TOGGLE_KEEP_SELECTED,
@@ -162,8 +152,8 @@ @@ -162,8 +152,8 @@
162 { 152 {
163 .label = N_("Smart copy"), 153 .label = N_("Smart copy"),
164 .tooltip = N_("When set the first copy operation after the selection will set the clipboard contents and the next ones will append"), 154 .tooltip = N_("When set the first copy operation after the selection will set the clipboard contents and the next ones will append"),
165 - .left = 1,  
166 - .top = 4, 155 + .left = 2,
  156 + .top = 3,
167 .width = 1, 157 .width = 1,
168 .height = 1, 158 .height = 1,
169 .grid = COPY_SETTINGS 159 .grid = COPY_SETTINGS
@@ -177,6 +167,16 @@ @@ -177,6 +167,16 @@
177 .width = 1, 167 .width = 1,
178 .height = 1, 168 .height = 1,
179 .grid = COPY_SETTINGS 169 .grid = COPY_SETTINGS
  170 + },
  171 +
  172 + {
  173 + .label = N_("Detect http:// or https://"),
  174 + .tooltip = N_("When set URLs selected with double click will be opened"),
  175 + .left = 1,
  176 + .top = 4,
  177 + .width = 1,
  178 + .height = 1,
  179 + .grid = COPY_SETTINGS
180 } 180 }
181 181
182 }; 182 };
@@ -247,8 +247,8 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) { @@ -247,8 +247,8 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) {
247 // Create grids 247 // Create grids
248 { 248 {
249 static const gchar * labels[GRID_COUNT] = { 249 static const gchar * labels[GRID_COUNT] = {
250 - N_("Copy options"),  
251 - N_("Paste options"), 250 + N_("Select and copy actions"),
  251 + N_("Paste actions"),
252 N_("HTML options") 252 N_("HTML options")
253 }; 253 };
254 254
@@ -334,6 +334,7 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) { @@ -334,6 +334,7 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) {
334 334
335 } 335 }
336 336
  337 +/*
337 // Load color schemes 338 // Load color schemes
338 #ifdef DEBUG 339 #ifdef DEBUG
339 { 340 {
@@ -379,7 +380,7 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) { @@ -379,7 +380,7 @@ static void V3270ClipboardSettings_init(V3270ClipboardSettings *widget) {
379 } 380 }
380 } 381 }
381 #endif // DEBUG 382 #endif // DEBUG
382 - 383 +*/
383 // Copy format combo 384 // Copy format combo
384 static const gchar * copy_formats[] = { 385 static const gchar * copy_formats[] = {
385 N_("Plain text only"), 386 N_("Plain text only"),
@@ -416,8 +417,8 @@ GtkWidget * v3270_clipboard_settings_new() { @@ -416,8 +417,8 @@ GtkWidget * v3270_clipboard_settings_new() {
416 417
417 V3270Settings * settings = GTK_V3270_SETTINGS(g_object_new(V3270ClipboardSettings_get_type(), NULL)); 418 V3270Settings * settings = GTK_V3270_SETTINGS(g_object_new(V3270ClipboardSettings_get_type(), NULL));
418 419
419 - settings->title = _("Clipboard properties");  
420 - settings->label = _("Clipboard"); 420 + settings->title = _("Options for select, cut and paste actions");
  421 + settings->label = _("Selection");
421 422
422 return GTK_WIDGET(settings); 423 return GTK_WIDGET(settings);
423 } 424 }
@@ -484,6 +485,7 @@ static void load(GtkWidget *w, GtkWidget *t) { @@ -484,6 +485,7 @@ static void load(GtkWidget *w, GtkWidget *t) {
484 gtk_toggle_button_set_active(widget->input.checkboxes[1],(terminal->selection.options & V3270_SELECTION_SCREEN_PASTE) != 0); 485 gtk_toggle_button_set_active(widget->input.checkboxes[1],(terminal->selection.options & V3270_SELECTION_SCREEN_PASTE) != 0);
485 gtk_toggle_button_set_active(widget->input.checkboxes[2],(terminal->selection.options & V3270_SELECTION_SMART_COPY) != 0); 486 gtk_toggle_button_set_active(widget->input.checkboxes[2],(terminal->selection.options & V3270_SELECTION_SMART_COPY) != 0);
486 gtk_toggle_button_set_active(widget->input.checkboxes[3],(terminal->selection.options & V3270_SELECTION_PIXBUFF) != 0); 487 gtk_toggle_button_set_active(widget->input.checkboxes[3],(terminal->selection.options & V3270_SELECTION_PIXBUFF) != 0);
  488 + gtk_toggle_button_set_active(widget->input.checkboxes[4],terminal->open_url != 0);
487 489
488 // 490 //
489 // Set font combo-box 491 // Set font combo-box
@@ -577,6 +579,12 @@ static void apply(GtkWidget *w, GtkWidget *t) { @@ -577,6 +579,12 @@ static void apply(GtkWidget *w, GtkWidget *t) {
577 terminal->selection.options &= ~V3270_SELECTION_PIXBUFF; 579 terminal->selection.options &= ~V3270_SELECTION_PIXBUFF;
578 } 580 }
579 581
  582 + if(gtk_toggle_button_get_active(widget->input.checkboxes[4])) {
  583 + terminal->open_url = 1;
  584 + } else {
  585 + terminal->open_url = 0;
  586 + }
  587 +
580 // Get font settings 588 // Get font settings
581 switch(get_active_id(widget,0)) { 589 switch(get_active_id(widget,0)) {
582 case '0': 590 case '0':