From c13b18000eafa103696d4032eb74351582e8943e Mon Sep 17 00:00:00 2001 From: Antenore Gatta Date: Wed, 28 Jun 2023 15:58:23 +0000 Subject: Automatic doc build by remmina-ci --- public/rcw_8c_source.html | 8 ++--- public/remmina_8c_source.html | 2 +- public/remmina__exec_8c_source.html | 4 +-- public/remmina__file__editor_8c_source.html | 4 +-- public/remmina__file__manager_8c_source.html | 2 +- public/remmina__icon_8c.html | 12 ++++---- public/remmina__icon_8c_source.html | 16 +++++----- public/remmina__icon_8h.html | 8 ++--- public/remmina__icon_8h_source.html | 8 ++--- public/remmina__log_8c_source.html | 2 +- public/remmina__main_8c_source.html | 4 +-- public/remmina__plugin__manager_8c_source.html | 16 +++++----- public/remmina__pref_8c.html | 38 +++++++++++------------ public/remmina__pref_8c_source.html | 40 ++++++++++++------------- public/remmina__pref_8h.html | 38 +++++++++++------------ public/remmina__pref_8h_source.html | 38 +++++++++++------------ public/remmina__pref__dialog_8c_source.html | 14 ++++----- public/remmina__protocol__widget_8c_source.html | 2 +- public/remmina__stats_8c_source.html | 4 +-- public/remmina__unlock_8c_source.html | 4 +-- 20 files changed, 132 insertions(+), 132 deletions(-) diff --git a/public/rcw_8c_source.html b/public/rcw_8c_source.html index 2cddfcc68..155c647a5 100644 --- a/public/rcw_8c_source.html +++ b/public/rcw_8c_source.html @@ -199,7 +199,7 @@ $(document).ready(function(){initNavTree('rcw_8c_source.html','');});
static GtkWidget * nb_find_page_by_cnnobj(GtkNotebook *notebook, RemminaConnectionObject *cnnobj)
Definition: rcw.c:3452
gchar * protocol
static gboolean rcw_keyboard_grab_retry(gpointer user_data)
Definition: rcw.c:484
-
void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
Definition: remmina_pref.c:929
+
void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
Definition: remmina_pref.c:934
static gboolean rcw_floating_toolbar_hide(RemminaConnectionWindow *cnnwin)
Definition: rcw.c:2991
static gboolean rcw_floating_toolbar_on_enter(GtkWidget *widget, GdkEventCrossing *event, RemminaConnectionWindow *cnnwin)
Definition: rcw.c:2791
static const GtkTargetEntry dnd_targets_tb[]
Definition: rcw.c:212
@@ -213,7 +213,7 @@ $(document).ready(function(){initNavTree('rcw_8c_source.html','');});
static void rco_get_desktop_size(RemminaConnectionObject *cnnobj, gint *width, gint *height)
Definition: rcw.c:906
Definition: types.h:49
int height
Definition: types.h:88
-
gchar * remmina_pref_get_value(const gchar *key)
+
gchar * remmina_pref_get_value(const gchar *key)
static RemminaConnectionObject * rcw_get_visible_cnnobj(RemminaConnectionWindow *cnnwin)
Definition: rcw.c:377
static gboolean rcw_focus_in_event(GtkWidget *widget, GdkEventWindowState *event, gpointer user_data)
Definition: rcw.c:3240
void remmina_protocol_widget_open_connection(RemminaProtocolWidget *gp)
@@ -311,7 +311,7 @@ $(document).ready(function(){initNavTree('rcw_8c_source.html','');});
int bitsPerPixel
Definition: types.h:85
gboolean remmina_protocol_widget_plugin_screenshot(RemminaProtocolWidget *gp, RemminaPluginScreenshotData *rpsd)
void remmina_applet_menu_populate(RemminaAppletMenu *menu)
-
gboolean remmina_pref_get_boolean(const gchar *key)
+
gboolean remmina_pref_get_boolean(const gchar *key)
GTKSOCKET_NOT_AVAIL_RESPONSE_TYPE
These define the response id's of the gtksocket-is-not-available-warning-dialog buttons.
Definition: rcw.c:4465
static void rcw_kp_ungrab(RemminaConnectionWindow *cnnwin)
Definition: rcw.c:429
void remmina_protocol_widget_grab_focus(RemminaProtocolWidget *gp)
@@ -371,7 +371,7 @@ $(document).ready(function(){initNavTree('rcw_8c_source.html','');});
static void rcw_update_notebook(RemminaConnectionWindow *cnnwin)
Definition: rcw.c:3603
Definition: types.h:50
-
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:778
+
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:783
void rcw_toolbar_switch_page_popdown(GtkWidget *widget, RemminaConnectionWindow *cnnwin)
Definition: rcw.c:1571
static gboolean rcw_floating_toolbar_make_invisible(gpointer data)
Definition: rcw.c:869
const gchar * screenshot_name
Definition: remmina_pref.h:139
diff --git a/public/remmina_8c_source.html b/public/remmina_8c_source.html index 0113bdc82..ea2bb0af6 100644 --- a/public/remmina_8c_source.html +++ b/public/remmina_8c_source.html @@ -112,7 +112,7 @@ $(document).ready(function(){initNavTree('remmina_8c_source.html','');});
void remmina_ssh_plugin_register(void)
Definition: remmina_exec.h:44
-
void remmina_icon_init(void)
Definition: remmina_icon.c:350
+
void remmina_icon_init(void)
Definition: remmina_icon.c:355
static gint remmina_on_local_cmdline(GApplication *app, GVariantDict *opts, gpointer user_data)
Definition: remmina.c:308
gboolean disabletoolbar
Definition: remmina.c:88
diff --git a/public/remmina__exec_8c_source.html b/public/remmina__exec_8c_source.html index b5b714d10..9b7eae3ac 100644 --- a/public/remmina__exec_8c_source.html +++ b/public/remmina__exec_8c_source.html @@ -103,7 +103,7 @@ $(document).ready(function(){initNavTree('remmina__exec_8c_source.html','');});
Definition: remmina_exec.h:55
-
gboolean remmina_icon_is_available(void)
Determine whenever the Remmina icon is available.
Definition: remmina_icon.c:318
+
gboolean remmina_icon_is_available(void)
Determine whenever the Remmina icon is available.
Definition: remmina_icon.c:323
GtkWidget * remmina_file_editor_new_full(const gchar *server, const gchar *protocol)
GtkWidget * remmina_main_new(void)
void remmina_main_save_before_destroy()
Save the Remmina Main Window size and the expanded group before to close Remmina. ...
Definition: remmina_main.c:180
@@ -127,7 +127,7 @@ $(document).ready(function(){initNavTree('remmina__exec_8c_source.html','');});
Definition: remmina_exec.h:46
void remmina_exec_exitremmina()
Definition: remmina_exec.c:89
-
gboolean remmina_pref_get_boolean(const gchar *key)
+
gboolean remmina_pref_get_boolean(const gchar *key)
Definition: remmina_exec.h:54
GtkWidget * remmina_file_editor_new_from_filename(const gchar *filename)
void remmina_main_destroy()
Definition: remmina_main.c:193
diff --git a/public/remmina__file__editor_8c_source.html b/public/remmina__file__editor_8c_source.html index 67617c8a9..48ea6a57a 100644 --- a/public/remmina__file__editor_8c_source.html +++ b/public/remmina__file__editor_8c_source.html @@ -94,7 +94,7 @@ $(document).ready(function(){initNavTree('remmina__file__editor_8c_source.html',
Definition: plugin.h:56
const gchar * remmina_file_get_string(RemminaFile *remminafile, const gchar *setting)
Definition: remmina_file.c:516
-
gchar ** remmina_pref_keymap_groups(void)
+
gchar ** remmina_pref_keymap_groups(void)
static void remmina_file_editor_create_resolution(RemminaFileEditor *gfe, const RemminaProtocolSetting *setting, GtkWidget *grid, gint row)
Definition: types.h:106
@@ -129,7 +129,7 @@ $(document).ready(function(){initNavTree('remmina__file__editor_8c_source.html',
gboolean remmina_public_resolution_validation_func(const gchar *new_str, gchar **error)
const gchar * domain
Definition: plugin.h:60
-
gchar * remmina_pref_get_recent(const gchar *protocol)
Definition: remmina_pref.c:967
+
gchar * remmina_pref_get_recent(const gchar *protocol)
Definition: remmina_pref.c:972
static void remmina_file_editor_create_server(RemminaFileEditor *gfe, const RemminaProtocolSetting *setting, GtkWidget *grid, gint row)
void remmina_icon_populate_menu(void)
Definition: remmina_icon.c:250
diff --git a/public/remmina__file__manager_8c_source.html b/public/remmina__file__manager_8c_source.html index deedcd799..2f235f392 100644 --- a/public/remmina__file__manager_8c_source.html +++ b/public/remmina__file__manager_8c_source.html @@ -104,7 +104,7 @@ $(document).ready(function(){initNavTree('remmina__file__manager_8c_source.html'
gchar * remmina_string_array_to_string(RemminaStringArray *array)
node_t * node
Definition: remmina_ssh.c:142
static gboolean remmina_file_manager_do_copy(const char *src_path, const char *dst_path)
-
gchar * remmina_pref_get_value(const gchar *key)
+
gchar * remmina_pref_get_value(const gchar *key)
void remmina_file_manager_init(void)
It creates the Remmina data and cache folders.
diff --git a/public/remmina__icon_8c.html b/public/remmina__icon_8c.html index 9a68f460a..3b532524d 100644 --- a/public/remmina__icon_8c.html +++ b/public/remmina__icon_8c.html @@ -231,7 +231,7 @@ Variables
-

Definition at line 343 of file remmina_icon.c.

+

Definition at line 348 of file remmina_icon.c.

@@ -259,7 +259,7 @@ Variables
-

Definition at line 283 of file remmina_icon.c.

+

Definition at line 288 of file remmina_icon.c.

@@ -337,7 +337,7 @@ Variables
-

Definition at line 350 of file remmina_icon.c.

+

Definition at line 355 of file remmina_icon.c.

@@ -357,7 +357,7 @@ Variables
-

Definition at line 426 of file remmina_icon.c.

+

Definition at line 431 of file remmina_icon.c.

@@ -381,7 +381,7 @@ Variables

Return TRUE if a remmina_icon (status indicator/systray menu) is available and shown to the user, so the user can continue its work without the remmina main window.

Returns
TRUE if the Remmina icon is available.

Special treatment under GNOME Shell Remmina > v1.4.18 won't be shipped in distributions with GNOME Shell <= 3.18 therefore checking the the GNOME Shell version is useless. We just return TRUE

-

Definition at line 318 of file remmina_icon.c.

+

Definition at line 323 of file remmina_icon.c.

@@ -649,7 +649,7 @@ Variables
-

Definition at line 439 of file remmina_icon.c.

+

Definition at line 451 of file remmina_icon.c.

diff --git a/public/remmina__icon_8c_source.html b/public/remmina__icon_8c_source.html index b086561f9..a56fe5d2d 100644 --- a/public/remmina__icon_8c_source.html +++ b/public/remmina__icon_8c_source.html @@ -86,7 +86,7 @@ $(document).ready(function(){initNavTree('remmina__icon_8c_source.html','');});
remmina_icon.c
-Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010 Vic Lee
4  * Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5  * Copyright (C) 2016-2023 Antenore Gatta, Giovanni Panozzo
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  * In addition, as a special exception, the copyright holders give
23  * permission to link the code of portions of this program with the
24  * OpenSSL library under certain conditions as described in each
25  * individual source file, and distribute linked combinations
26  * including the two.
27  * You must obey the GNU General Public License in all respects
28  * for all of the code used other than OpenSSL. * If you modify
29  * file(s) with this exception, you may extend this exception to your
30  * version of the file(s), but you are not obligated to do so. * If you
31  * do not wish to do so, delete this exception statement from your
32  * version. * If you delete this exception statement from all source
33  * files in the program, then also delete it here.
34  *
35  */
36 
37 #include "config.h"
38 
39 #include <glib/gi18n.h>
40 
41 #include "remmina_icon.h"
42 
43 #ifdef HAVE_LIBAPPINDICATOR
44 # ifdef HAVE_AYATANA_LIBAPPINDICATOR
45 # include <libayatana-appindicator/app-indicator.h>
46 # else
47 # include <libappindicator/app-indicator.h>
48 # endif
49 #include "remmina_widget_pool.h"
50 #include "remmina_pref.h"
51 #include "remmina_exec.h"
52 #ifdef HAVE_LIBAVAHI_CLIENT
53 #include "remmina_avahi.h"
54 #endif
56 #include "remmina_applet_menu.h"
57 #include "rcw.h"
58 #include "remmina_log.h"
60 #include "remmina_sysinfo.h"
61 
62 typedef struct _RemminaIcon {
63  AppIndicator * icon;
65 #ifdef HAVE_LIBAVAHI_CLIENT
67 #endif
68  guint32 popup_time;
69  gchar * autostart_file;
70 } RemminaIcon;
71 
73 { 0 };
74 
76 {
77  TRACE_CALL(__func__);
78  if (remmina_icon.icon) {
79  app_indicator_set_status(remmina_icon.icon, APP_INDICATOR_STATUS_PASSIVE);
80  remmina_icon.icon = NULL;
81  }
82 #ifdef HAVE_LIBAVAHI_CLIENT
83  if (remmina_icon.avahi) {
84  remmina_avahi_free(remmina_icon.avahi);
85  remmina_icon.avahi = NULL;
86  }
87 #endif
88  if (remmina_icon.autostart_file) {
89  g_free(remmina_icon.autostart_file);
90  remmina_icon.autostart_file = NULL;
91  }
92 }
93 
94 static void remmina_icon_main(void)
95 {
96  TRACE_CALL(__func__);
98 }
99 
100 static void remmina_icon_preferences(void)
101 {
102  TRACE_CALL(__func__);
104 }
105 
106 static void remmina_icon_about(void)
107 {
108  TRACE_CALL(__func__);
110 }
111 
112 #ifdef HAVE_LIBAVAHI_CLIENT
113 static void remmina_icon_enable_avahi(GtkCheckMenuItem *checkmenuitem, gpointer data)
114 {
115  TRACE_CALL(__func__);
116  if (!remmina_icon.avahi)
117  return;
118 
119  if (gtk_check_menu_item_get_active(checkmenuitem)) {
121  if (!remmina_icon.avahi->started)
122  remmina_avahi_start(remmina_icon.avahi);
123  } else {
125  remmina_avahi_stop(remmina_icon.avahi);
126  }
128 }
129 #endif
130 
131 static void remmina_icon_populate_additional_menu_item(GtkWidget *menu)
132 {
133  TRACE_CALL(__func__);
134  GtkWidget *menuitem;
135 
136  menuitem = gtk_menu_item_new_with_label(_("Open Main Window"));
137  gtk_widget_show(menuitem);
138  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
139  g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_icon_main), NULL);
140 
141  menuitem = gtk_menu_item_new_with_mnemonic(_("_Preferences"));
142  gtk_widget_show(menuitem);
143  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
144  g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_icon_preferences), NULL);
145 
146  menuitem = gtk_menu_item_new_with_mnemonic(_("_About"));
147  gtk_widget_show(menuitem);
148  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
149  g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_icon_about), NULL);
150 
151  menuitem = gtk_separator_menu_item_new();
152  gtk_widget_show(menuitem);
153  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
154 
155 #ifdef HAVE_LIBAVAHI_CLIENT
156  menuitem = gtk_check_menu_item_new_with_label(_("Enable Service Discovery"));
158  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
159  gtk_widget_show(menuitem);
160  g_signal_connect(G_OBJECT(menuitem), "toggled", G_CALLBACK(remmina_icon_enable_avahi), NULL);
161  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
162 
163  menuitem = gtk_separator_menu_item_new();
164  gtk_widget_show(menuitem);
165  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
166 #endif
167 
168  menuitem = gtk_menu_item_new_with_mnemonic(_("_Quit"));
169  gtk_widget_show(menuitem);
170  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
171  g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_exec_exitremmina), NULL);
172 }
173 
174 static void remmina_icon_on_launch_item(RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem, gpointer data)
175 {
176  TRACE_CALL(__func__);
177  gchar *s;
178 
179  switch (menuitem->item_type) {
182  break;
185  break;
187  s = g_strdup_printf("%s,%s", menuitem->protocol, menuitem->name);
189  g_free(s);
190  break;
191  }
192 }
193 
194 static void remmina_icon_on_edit_item(RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem, gpointer data)
195 {
196  TRACE_CALL(__func__);
197  gchar *s;
198 
199  switch (menuitem->item_type) {
202  break;
205  break;
207  s = g_strdup_printf("%s,%s", menuitem->protocol, menuitem->name);
209  g_free(s);
210  break;
211  }
212 }
213 
214 static void remmina_icon_populate_extra_menu_item(GtkWidget *menu)
215 {
216  TRACE_CALL(__func__);
217  GtkWidget *menuitem;
218  gboolean new_ontop;
219 
220  new_ontop = remmina_pref.applet_new_ontop;
221 
222 #ifdef HAVE_LIBAVAHI_CLIENT
223  GHashTableIter iter;
224  gchar *tmp;
225  /* Iterate all discovered services from Avahi */
226  if (remmina_icon.avahi) {
227  g_hash_table_iter_init(&iter, remmina_icon.avahi->discovered_services);
228  while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&tmp)) {
230  gtk_widget_show(menuitem);
231  remmina_applet_menu_add_item(REMMINA_APPLET_MENU(menu), REMMINA_APPLET_MENU_ITEM(menuitem));
232  }
233  }
234 #endif
235 
236  /* New Connection */
238  gtk_widget_show(menuitem);
239  remmina_applet_menu_register_item(REMMINA_APPLET_MENU(menu), REMMINA_APPLET_MENU_ITEM(menuitem));
240  if (new_ontop)
241  gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), menuitem);
242  else
243  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
244 
245  g_signal_connect(G_OBJECT(menu), "launch-item", G_CALLBACK(remmina_icon_on_launch_item), NULL);
246  g_signal_connect(G_OBJECT(menu), "edit-item", G_CALLBACK(remmina_icon_on_edit_item), NULL);
247 }
248 
249 void
251 {
252  TRACE_CALL(__func__);
253  GtkWidget *menu;
254  GtkWidget *menuitem;
255 
256  if (remmina_icon.icon && !remmina_pref.disable_tray_icon) {
257  menu = remmina_applet_menu_new();
258  app_indicator_set_menu(remmina_icon.icon, GTK_MENU(menu));
259 
261  remmina_applet_menu_populate(REMMINA_APPLET_MENU(menu));
263 
264  menuitem = gtk_separator_menu_item_new();
265  gtk_widget_show(menuitem);
266  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
267 
269  }
270 }
271 
272 static void remmina_icon_save_autostart_file(GKeyFile *gkeyfile)
273 {
274  TRACE_CALL(__func__);
275  gchar *content;
276  gsize length;
277 
278  content = g_key_file_to_data(gkeyfile, &length, NULL);
279  g_file_set_contents(remmina_icon.autostart_file, content, length, NULL);
280  g_free(content);
281 }
282 
284 {
285  TRACE_CALL(__func__);
286  if (g_file_test(remmina_icon.autostart_file, G_FILE_TEST_EXISTS))
287  return;
288 
289  GKeyFile *gkeyfile;
290 
291  gkeyfile = g_key_file_new();
292  g_key_file_set_string(gkeyfile, "Desktop Entry", "Version", "1.0");
293  // TRANSLATORS: Applet name as per the Freedesktop Desktop entry specification https://specifications.freedesktop.org/desktop-entry-spec/latest/
294  g_key_file_set_string(gkeyfile, "Desktop Entry", "Name", _("Remmina Applet"));
295  // TRANSLATORS: Applet comment/description as per the Freedesktop Desktop entry specification https://specifications.freedesktop.org/desktop-entry-spec/latest/
296  g_key_file_set_string(gkeyfile, "Desktop Entry", "Comment", _("Connect to remote desktops through the applet menu"));
297  g_key_file_set_string(gkeyfile, "Desktop Entry", "Icon", REMMINA_APP_ID);
298  if (getenv("FLATPAK_ID")){
299  g_key_file_set_string(gkeyfile, "Desktop Entry", "Exec", "flatpak run org.remmina.Remmina -i");
300  }
301  else{
302  g_key_file_set_string(gkeyfile, "Desktop Entry", "Exec", "remmina -i");
303  }
304  g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Terminal", FALSE);
305  g_key_file_set_string(gkeyfile, "Desktop Entry", "Type", "Application");
306  g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Hidden", FALSE);
308  g_key_file_free(gkeyfile);
309 }
310 
319 {
320  TRACE_CALL(__func__);
321 
322  if (!remmina_icon.icon)
323  return FALSE;
325  return FALSE;
326 
327  if (remmina_icon.indicator_connected == FALSE) {
328  REMMINA_DEBUG("Indicator is not connected to panel, thus it cannot be displayed.");
329  return FALSE;
330  } else {
331  REMMINA_DEBUG("Indicator is connected to panel, thus it can be displayed.");
332  return TRUE;
333  }
339  return TRUE;
340 }
341 
342 static void
343 remmina_icon_connection_changed_cb(AppIndicator *indicator, gboolean connected, gpointer data)
344 {
345  TRACE_CALL(__func__);
346  REMMINA_DEBUG("Indicator connection changed to: %d", connected);
347  remmina_icon.indicator_connected = connected;
348 }
349 
351 {
352  TRACE_CALL(__func__);
353 
354  gchar remmina_panel[29];
355  gboolean sni_supported;
356 
357  g_stpcpy(remmina_panel, "org.remmina.Remmina-status");
358 
359  /* Print on stdout the availability of appindicators on DBUS */
361 
362  g_autofree gchar *wmname = g_ascii_strdown(remmina_sysinfo_get_wm_name(), -1);
363  //TRANSLATORS: These are Linux desktop components to show icons in the system tray, after the “ there's the Desktop Name (like GNOME).
364  g_autofree gchar *msg = g_strconcat(
365  _("StatusNotifier/Appindicator support in “"),
366  wmname,
367  "”:",
368  NULL);
369 
370  if (sni_supported) {
371  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
372  REMMINA_INFO(_("%s your desktop does support it"), msg);
373  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
374  REMMINA_INFO(_("%s and Remmina has built-in (compiled) support for libappindicator."), msg);
375  } else {
376  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
377  REMMINA_INFO(_("%s not supported natively by your Desktop Environment. libappindicator will try to fallback to GtkStatusIcon/xembed"), msg);
378  }
379  if (g_strrstr(wmname, "mate") != NULL)
380  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
381  REMMINA_INFO(_("%s You may need to install, and use XApp Status Applet"), msg);
382  if (g_strrstr(wmname, "kde") != NULL)
383  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
384  REMMINA_INFO(_("%s You may need to install, and use KStatusNotifierItem"), msg);
385  if (g_strrstr(wmname, "plasma") != NULL)
386  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
387  REMMINA_INFO(_("%s You may need to install, and use XEmbed SNI Proxy"), msg);
388  if (g_strrstr(wmname, "gnome") != NULL)
389  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
390  REMMINA_INFO(_("%s You may need to install, and use Gnome Shell Extension Appindicator"), msg);
391 
392  if (!remmina_icon.icon && !remmina_pref.disable_tray_icon) {
393  remmina_icon.icon = app_indicator_new("remmina-icon", remmina_panel, APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
394  app_indicator_set_status(remmina_icon.icon, APP_INDICATOR_STATUS_ACTIVE);
395  app_indicator_set_title(remmina_icon.icon, "Remmina");
397  } else if (remmina_icon.icon) {
398  app_indicator_set_status(remmina_icon.icon, remmina_pref.disable_tray_icon ?
399  APP_INDICATOR_STATUS_PASSIVE : APP_INDICATOR_STATUS_ACTIVE);
400  /* With libappindicator we can also change the icon on the fly */
401  app_indicator_set_icon(remmina_icon.icon, remmina_panel);
402  }
403  remmina_icon.indicator_connected = TRUE;
404 #ifdef HAVE_LIBAVAHI_CLIENT
405  if (!remmina_icon.avahi)
406  remmina_icon.avahi = remmina_avahi_new();
407  if (remmina_icon.avahi) {
409  if (!remmina_icon.avahi->started)
410  remmina_avahi_start(remmina_icon.avahi);
411  } else {
412  remmina_avahi_stop(remmina_icon.avahi);
413  }
414  }
415 #endif
416  if (!remmina_icon.autostart_file && !remmina_pref.disable_tray_icon) {
417  remmina_icon.autostart_file = g_strdup_printf("%s/.config/autostart/remmina-applet.desktop", g_get_home_dir());
419  }
420  // "connected" property means a visible indicator, otherwise could be hidden. or fall back to GtkStatusIcon
421  if (remmina_icon.icon)
422  g_signal_connect(G_OBJECT(remmina_icon.icon), "connection-changed", G_CALLBACK(remmina_icon_connection_changed_cb), NULL);
423  //g_object_get(G_OBJECT(remmina_icon.icon), "connected", &remmina_icon.indicator_connected, NULL);
424 }
425 
427 {
428  TRACE_CALL(__func__);
429  GKeyFile *gkeyfile;
430  gboolean b;
431 
432  gkeyfile = g_key_file_new();
433  g_key_file_load_from_file(gkeyfile, remmina_icon.autostart_file, G_KEY_FILE_NONE, NULL);
434  b = !g_key_file_get_boolean(gkeyfile, "Desktop Entry", "Hidden", NULL);
435  g_key_file_free(gkeyfile);
436  return b;
437 }
438 
439 void remmina_icon_set_autostart(gboolean autostart)
440 {
441  TRACE_CALL(__func__);
442  GKeyFile *gkeyfile;
443  gboolean b;
444 
445  gkeyfile = g_key_file_new();
446  g_key_file_load_from_file(gkeyfile, remmina_icon.autostart_file, G_KEY_FILE_NONE, NULL);
447  b = !g_key_file_get_boolean(gkeyfile, "Desktop Entry", "Hidden", NULL);
448  if (b != autostart) {
449  g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Hidden", !autostart);
450  /* Refresh it in case translation is updated */
451  // TRANSLATORS: Applet Name as per the Freedesktop Desktop entry specification https://specifications.freedesktop.org/desktop-entry-spec/latest/
452  g_key_file_set_string(gkeyfile, "Desktop Entry", "Name", _("Remmina Applet"));
453  // TRANSLATORS: Applet comment/description as per the Freedesktop Desktop entry specification https://specifications.freedesktop.org/desktop-entry-spec/latest/
454  g_key_file_set_string(gkeyfile, "Desktop Entry", "Comment", _("Connect to remote desktops through the applet menu"));
456  }
457  g_key_file_free(gkeyfile);
458 }
459 
460 #else
461 void remmina_icon_init(void) {};
462 void remmina_icon_destroy(void) {};
463 gboolean remmina_icon_is_available(void) {return FALSE;};
464 void remmina_icon_populate_menu(void) {};
465 void remmina_icon_set_autostart(gboolean autostart) {} ;
466 gboolean remmina_icon_is_autostart(void) {return FALSE;};
467 #endif
gboolean indicator_connected
Definition: remmina_icon.c:64
+Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010 Vic Lee
4  * Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5  * Copyright (C) 2016-2023 Antenore Gatta, Giovanni Panozzo
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  * In addition, as a special exception, the copyright holders give
23  * permission to link the code of portions of this program with the
24  * OpenSSL library under certain conditions as described in each
25  * individual source file, and distribute linked combinations
26  * including the two.
27  * You must obey the GNU General Public License in all respects
28  * for all of the code used other than OpenSSL. * If you modify
29  * file(s) with this exception, you may extend this exception to your
30  * version of the file(s), but you are not obligated to do so. * If you
31  * do not wish to do so, delete this exception statement from your
32  * version. * If you delete this exception statement from all source
33  * files in the program, then also delete it here.
34  *
35  */
36 
37 #include "config.h"
38 
39 #include <glib/gi18n.h>
40 
41 #include "remmina_icon.h"
42 
43 #ifdef HAVE_LIBAPPINDICATOR
44 # ifdef HAVE_AYATANA_LIBAPPINDICATOR
45 # include <libayatana-appindicator/app-indicator.h>
46 # else
47 # include <libappindicator/app-indicator.h>
48 # endif
49 #include "remmina_widget_pool.h"
50 #include "remmina_pref.h"
51 #include "remmina_exec.h"
52 #ifdef HAVE_LIBAVAHI_CLIENT
53 #include "remmina_avahi.h"
54 #endif
56 #include "remmina_applet_menu.h"
57 #include "rcw.h"
58 #include "remmina_log.h"
60 #include "remmina_sysinfo.h"
61 
62 typedef struct _RemminaIcon {
63  AppIndicator * icon;
65 #ifdef HAVE_LIBAVAHI_CLIENT
67 #endif
68  guint32 popup_time;
69  gchar * autostart_file;
70 } RemminaIcon;
71 
73 { 0 };
74 
76 {
77  TRACE_CALL(__func__);
78  if (remmina_icon.icon) {
79  app_indicator_set_status(remmina_icon.icon, APP_INDICATOR_STATUS_PASSIVE);
80  remmina_icon.icon = NULL;
81  }
82 #ifdef HAVE_LIBAVAHI_CLIENT
83  if (remmina_icon.avahi) {
84  remmina_avahi_free(remmina_icon.avahi);
85  remmina_icon.avahi = NULL;
86  }
87 #endif
88  if (remmina_icon.autostart_file) {
89  g_free(remmina_icon.autostart_file);
90  remmina_icon.autostart_file = NULL;
91  }
92 }
93 
94 static void remmina_icon_main(void)
95 {
96  TRACE_CALL(__func__);
98 }
99 
100 static void remmina_icon_preferences(void)
101 {
102  TRACE_CALL(__func__);
104 }
105 
106 static void remmina_icon_about(void)
107 {
108  TRACE_CALL(__func__);
110 }
111 
112 #ifdef HAVE_LIBAVAHI_CLIENT
113 static void remmina_icon_enable_avahi(GtkCheckMenuItem *checkmenuitem, gpointer data)
114 {
115  TRACE_CALL(__func__);
116  if (!remmina_icon.avahi)
117  return;
118 
119  if (gtk_check_menu_item_get_active(checkmenuitem)) {
121  if (!remmina_icon.avahi->started)
122  remmina_avahi_start(remmina_icon.avahi);
123  } else {
125  remmina_avahi_stop(remmina_icon.avahi);
126  }
128 }
129 #endif
130 
131 static void remmina_icon_populate_additional_menu_item(GtkWidget *menu)
132 {
133  TRACE_CALL(__func__);
134  GtkWidget *menuitem;
135 
136  menuitem = gtk_menu_item_new_with_label(_("Open Main Window"));
137  gtk_widget_show(menuitem);
138  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
139  g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_icon_main), NULL);
140 
141  menuitem = gtk_menu_item_new_with_mnemonic(_("_Preferences"));
142  gtk_widget_show(menuitem);
143  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
144  g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_icon_preferences), NULL);
145 
146  menuitem = gtk_menu_item_new_with_mnemonic(_("_About"));
147  gtk_widget_show(menuitem);
148  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
149  g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_icon_about), NULL);
150 
151  menuitem = gtk_separator_menu_item_new();
152  gtk_widget_show(menuitem);
153  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
154 
155 #ifdef HAVE_LIBAVAHI_CLIENT
156  menuitem = gtk_check_menu_item_new_with_label(_("Enable Service Discovery"));
158  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
159  gtk_widget_show(menuitem);
160  g_signal_connect(G_OBJECT(menuitem), "toggled", G_CALLBACK(remmina_icon_enable_avahi), NULL);
161  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
162 
163  menuitem = gtk_separator_menu_item_new();
164  gtk_widget_show(menuitem);
165  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
166 #endif
167 
168  menuitem = gtk_menu_item_new_with_mnemonic(_("_Quit"));
169  gtk_widget_show(menuitem);
170  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
171  g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_exec_exitremmina), NULL);
172 }
173 
174 static void remmina_icon_on_launch_item(RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem, gpointer data)
175 {
176  TRACE_CALL(__func__);
177  gchar *s;
178 
179  switch (menuitem->item_type) {
182  break;
185  break;
187  s = g_strdup_printf("%s,%s", menuitem->protocol, menuitem->name);
189  g_free(s);
190  break;
191  }
192 }
193 
194 static void remmina_icon_on_edit_item(RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem, gpointer data)
195 {
196  TRACE_CALL(__func__);
197  gchar *s;
198 
199  switch (menuitem->item_type) {
202  break;
205  break;
207  s = g_strdup_printf("%s,%s", menuitem->protocol, menuitem->name);
209  g_free(s);
210  break;
211  }
212 }
213 
214 static void remmina_icon_populate_extra_menu_item(GtkWidget *menu)
215 {
216  TRACE_CALL(__func__);
217  GtkWidget *menuitem;
218  gboolean new_ontop;
219 
220  new_ontop = remmina_pref.applet_new_ontop;
221 
222 #ifdef HAVE_LIBAVAHI_CLIENT
223  GHashTableIter iter;
224  gchar *tmp;
225  /* Iterate all discovered services from Avahi */
226  if (remmina_icon.avahi) {
227  g_hash_table_iter_init(&iter, remmina_icon.avahi->discovered_services);
228  while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&tmp)) {
230  gtk_widget_show(menuitem);
231  remmina_applet_menu_add_item(REMMINA_APPLET_MENU(menu), REMMINA_APPLET_MENU_ITEM(menuitem));
232  }
233  }
234 #endif
235 
236  /* New Connection */
238  gtk_widget_show(menuitem);
239  remmina_applet_menu_register_item(REMMINA_APPLET_MENU(menu), REMMINA_APPLET_MENU_ITEM(menuitem));
240  if (new_ontop)
241  gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), menuitem);
242  else
243  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
244 
245  g_signal_connect(G_OBJECT(menu), "launch-item", G_CALLBACK(remmina_icon_on_launch_item), NULL);
246  g_signal_connect(G_OBJECT(menu), "edit-item", G_CALLBACK(remmina_icon_on_edit_item), NULL);
247 }
248 
249 void
251 {
252  TRACE_CALL(__func__);
253  GtkWidget *menu;
254  GtkWidget *menuitem;
255 
256  if (remmina_icon.icon && !remmina_pref.disable_tray_icon) {
257  menu = remmina_applet_menu_new();
258  app_indicator_set_menu(remmina_icon.icon, GTK_MENU(menu));
259 
261  remmina_applet_menu_populate(REMMINA_APPLET_MENU(menu));
263 
264  menuitem = gtk_separator_menu_item_new();
265  gtk_widget_show(menuitem);
266  gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
267 
269  }
270 }
271 
272 static void remmina_icon_save_autostart_file(GKeyFile *gkeyfile)
273 {
274  TRACE_CALL(__func__);
275  gchar *content;
276  gsize length;
277 
278  content = g_key_file_to_data(gkeyfile, &length, NULL);
279  if (remmina_icon.autostart_file != NULL) {
280  g_file_set_contents(remmina_icon.autostart_file, content, length, NULL);
281  }
282  else {
283  REMMINA_WARNING("Cannot save remmina icon autostart file. Uncheck Preferences -> Applet -> No Tray Icon to recreate it.");
284  }
285  g_free(content);
286 }
287 
289 {
290  TRACE_CALL(__func__);
291  if (g_file_test(remmina_icon.autostart_file, G_FILE_TEST_EXISTS))
292  return;
293 
294  GKeyFile *gkeyfile;
295 
296  gkeyfile = g_key_file_new();
297  g_key_file_set_string(gkeyfile, "Desktop Entry", "Version", "1.0");
298  // TRANSLATORS: Applet name as per the Freedesktop Desktop entry specification https://specifications.freedesktop.org/desktop-entry-spec/latest/
299  g_key_file_set_string(gkeyfile, "Desktop Entry", "Name", _("Remmina Applet"));
300  // TRANSLATORS: Applet comment/description as per the Freedesktop Desktop entry specification https://specifications.freedesktop.org/desktop-entry-spec/latest/
301  g_key_file_set_string(gkeyfile, "Desktop Entry", "Comment", _("Connect to remote desktops through the applet menu"));
302  g_key_file_set_string(gkeyfile, "Desktop Entry", "Icon", REMMINA_APP_ID);
303  if (getenv("FLATPAK_ID")){
304  g_key_file_set_string(gkeyfile, "Desktop Entry", "Exec", "flatpak run org.remmina.Remmina -i");
305  }
306  else{
307  g_key_file_set_string(gkeyfile, "Desktop Entry", "Exec", "remmina -i");
308  }
309  g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Terminal", FALSE);
310  g_key_file_set_string(gkeyfile, "Desktop Entry", "Type", "Application");
311  g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Hidden", FALSE);
313  g_key_file_free(gkeyfile);
314 }
315 
324 {
325  TRACE_CALL(__func__);
326 
327  if (!remmina_icon.icon)
328  return FALSE;
330  return FALSE;
331 
332  if (remmina_icon.indicator_connected == FALSE) {
333  REMMINA_DEBUG("Indicator is not connected to panel, thus it cannot be displayed.");
334  return FALSE;
335  } else {
336  REMMINA_DEBUG("Indicator is connected to panel, thus it can be displayed.");
337  return TRUE;
338  }
344  return TRUE;
345 }
346 
347 static void
348 remmina_icon_connection_changed_cb(AppIndicator *indicator, gboolean connected, gpointer data)
349 {
350  TRACE_CALL(__func__);
351  REMMINA_DEBUG("Indicator connection changed to: %d", connected);
352  remmina_icon.indicator_connected = connected;
353 }
354 
356 {
357  TRACE_CALL(__func__);
358 
359  gchar remmina_panel[29];
360  gboolean sni_supported;
361 
362  g_stpcpy(remmina_panel, "org.remmina.Remmina-status");
363 
364  /* Print on stdout the availability of appindicators on DBUS */
366 
367  g_autofree gchar *wmname = g_ascii_strdown(remmina_sysinfo_get_wm_name(), -1);
368  //TRANSLATORS: These are Linux desktop components to show icons in the system tray, after the “ there's the Desktop Name (like GNOME).
369  g_autofree gchar *msg = g_strconcat(
370  _("StatusNotifier/Appindicator support in “"),
371  wmname,
372  "”:",
373  NULL);
374 
375  if (sni_supported) {
376  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
377  REMMINA_INFO(_("%s your desktop does support it"), msg);
378  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
379  REMMINA_INFO(_("%s and Remmina has built-in (compiled) support for libappindicator."), msg);
380  } else {
381  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
382  REMMINA_INFO(_("%s not supported natively by your Desktop Environment. libappindicator will try to fallback to GtkStatusIcon/xembed"), msg);
383  }
384  if (g_strrstr(wmname, "mate") != NULL)
385  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
386  REMMINA_INFO(_("%s You may need to install, and use XApp Status Applet"), msg);
387  if (g_strrstr(wmname, "kde") != NULL)
388  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
389  REMMINA_INFO(_("%s You may need to install, and use KStatusNotifierItem"), msg);
390  if (g_strrstr(wmname, "plasma") != NULL)
391  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
392  REMMINA_INFO(_("%s You may need to install, and use XEmbed SNI Proxy"), msg);
393  if (g_strrstr(wmname, "gnome") != NULL)
394  //TRANSLATORS: %s is a placeholder for "StatusNotifier/Appindicator suppor in “DESKTOP NAME”: "
395  REMMINA_INFO(_("%s You may need to install, and use Gnome Shell Extension Appindicator"), msg);
396 
397  if (!remmina_icon.icon && !remmina_pref.disable_tray_icon) {
398  remmina_icon.icon = app_indicator_new("remmina-icon", remmina_panel, APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
399  app_indicator_set_status(remmina_icon.icon, APP_INDICATOR_STATUS_ACTIVE);
400  app_indicator_set_title(remmina_icon.icon, "Remmina");
402  } else if (remmina_icon.icon) {
403  app_indicator_set_status(remmina_icon.icon, remmina_pref.disable_tray_icon ?
404  APP_INDICATOR_STATUS_PASSIVE : APP_INDICATOR_STATUS_ACTIVE);
405  /* With libappindicator we can also change the icon on the fly */
406  app_indicator_set_icon(remmina_icon.icon, remmina_panel);
407  }
408  remmina_icon.indicator_connected = TRUE;
409 #ifdef HAVE_LIBAVAHI_CLIENT
410  if (!remmina_icon.avahi)
411  remmina_icon.avahi = remmina_avahi_new();
412  if (remmina_icon.avahi) {
414  if (!remmina_icon.avahi->started)
415  remmina_avahi_start(remmina_icon.avahi);
416  } else {
417  remmina_avahi_stop(remmina_icon.avahi);
418  }
419  }
420 #endif
421  if (!remmina_icon.autostart_file && !remmina_pref.disable_tray_icon) {
422  remmina_icon.autostart_file = g_strdup_printf("%s/.config/autostart/remmina-applet.desktop", g_get_home_dir());
424  }
425  // "connected" property means a visible indicator, otherwise could be hidden. or fall back to GtkStatusIcon
426  if (remmina_icon.icon)
427  g_signal_connect(G_OBJECT(remmina_icon.icon), "connection-changed", G_CALLBACK(remmina_icon_connection_changed_cb), NULL);
428  //g_object_get(G_OBJECT(remmina_icon.icon), "connected", &remmina_icon.indicator_connected, NULL);
429 }
430 
432 {
433  TRACE_CALL(__func__);
434  GKeyFile *gkeyfile;
435  gboolean b;
436 
437  gkeyfile = g_key_file_new();
438 
439  if (remmina_icon.autostart_file != NULL) {
440  g_key_file_load_from_file(gkeyfile, remmina_icon.autostart_file, G_KEY_FILE_NONE, NULL);
441  }
442  else {
443  REMMINA_WARNING("Cannot load remmina icon autostart file. Uncheck Preferences -> Applet -> No Tray Icon to recreate it.");
444  }
445 
446  b = !g_key_file_get_boolean(gkeyfile, "Desktop Entry", "Hidden", NULL);
447  g_key_file_free(gkeyfile);
448  return b;
449 }
450 
451 void remmina_icon_set_autostart(gboolean autostart)
452 {
453  TRACE_CALL(__func__);
454  GKeyFile *gkeyfile;
455  gboolean b;
456 
457  if (remmina_icon.autostart_file != NULL) {
458  gkeyfile = g_key_file_new();
459  g_key_file_load_from_file(gkeyfile, remmina_icon.autostart_file, G_KEY_FILE_NONE, NULL);
460  b = !g_key_file_get_boolean(gkeyfile, "Desktop Entry", "Hidden", NULL);
461  if (b != autostart) {
462  g_key_file_set_boolean(gkeyfile, "Desktop Entry", "Hidden", !autostart);
463  /* Refresh it in case translation is updated */
464  // TRANSLATORS: Applet Name as per the Freedesktop Desktop entry specification https://specifications.freedesktop.org/desktop-entry-spec/latest/
465  g_key_file_set_string(gkeyfile, "Desktop Entry", "Name", _("Remmina Applet"));
466  // TRANSLATORS: Applet comment/description as per the Freedesktop Desktop entry specification https://specifications.freedesktop.org/desktop-entry-spec/latest/
467  g_key_file_set_string(gkeyfile, "Desktop Entry", "Comment", _("Connect to remote desktops through the applet menu"));
469  g_key_file_free(gkeyfile);
470  }
471  }
472  else {
473  REMMINA_WARNING("Cannot load remmina icon autostart file. Uncheck Preferences -> Applet -> No Tray Icon to recreate it.");
474  }
475 }
476 
477 #else
478 void remmina_icon_init(void) {};
479 void remmina_icon_destroy(void) {};
480 gboolean remmina_icon_is_available(void) {return FALSE;};
481 void remmina_icon_populate_menu(void) {};
482 void remmina_icon_set_autostart(gboolean autostart) {} ;
483 gboolean remmina_icon_is_autostart(void) {return FALSE;};
484 #endif
gboolean indicator_connected
Definition: remmina_icon.c:64
static void remmina_icon_main(void)
Definition: remmina_icon.c:94
@@ -98,7 +98,7 @@ $(document).ready(function(){initNavTree('remmina__icon_8c_source.html','');});
static void remmina_icon_on_launch_item(RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem, gpointer data)
Definition: remmina_icon.c:174
void remmina_icon_populate_menu(void)
Definition: remmina_icon.c:250
-
gboolean remmina_icon_is_available(void)
Determine whenever the Remmina icon is available.
Definition: remmina_icon.c:318
+
gboolean remmina_icon_is_available(void)
Determine whenever the Remmina icon is available.
Definition: remmina_icon.c:323
RemminaAppletMenuItemType item_type
@@ -106,7 +106,7 @@ $(document).ready(function(){initNavTree('remmina__icon_8c_source.html','');});
GtkWidget * remmina_applet_menu_new(void)
-
void remmina_icon_init(void)
Definition: remmina_icon.c:350
+
void remmina_icon_init(void)
Definition: remmina_icon.c:355
RemminaAvahi * avahi
Definition: remmina_icon.c:66
void remmina_icon_destroy(void)
Definition: remmina_icon.c:75
@@ -123,7 +123,7 @@ $(document).ready(function(){initNavTree('remmina__icon_8c_source.html','');});
void remmina_avahi_stop(RemminaAvahi *ga)
-
gboolean remmina_icon_is_autostart(void)
Definition: remmina_icon.c:426
+
gboolean remmina_icon_is_autostart(void)
Definition: remmina_icon.c:431
static void remmina_icon_populate_extra_menu_item(GtkWidget *menu)
Definition: remmina_icon.c:214
void remmina_exec_exitremmina()
Definition: remmina_exec.c:89
void remmina_applet_menu_populate(RemminaAppletMenu *menu)
@@ -142,16 +142,16 @@ $(document).ready(function(){initNavTree('remmina__icon_8c_source.html','');}); -
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:778
+
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:783
gboolean remmina_sysinfo_is_appindicator_available()
gboolean applet_new_ontop
Definition: remmina_pref.h:162
static void remmina_icon_about(void)
Definition: remmina_icon.c:106
AppIndicator * icon
Definition: remmina_icon.c:63
GtkWidget * remmina_applet_menu_item_new(RemminaAppletMenuItemType item_type,...)
-
static void remmina_icon_connection_changed_cb(AppIndicator *indicator, gboolean connected, gpointer data)
Definition: remmina_icon.c:343
-
static void remmina_icon_create_autostart_file(void)
Definition: remmina_icon.c:283
-
void remmina_icon_set_autostart(gboolean autostart)
Definition: remmina_icon.c:439
+
static void remmina_icon_connection_changed_cb(AppIndicator *indicator, gboolean connected, gpointer data)
Definition: remmina_icon.c:348
+
static void remmina_icon_create_autostart_file(void)
Definition: remmina_icon.c:288
+
void remmina_icon_set_autostart(gboolean autostart)
Definition: remmina_icon.c:451
void remmina_applet_menu_add_item(RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem)
diff --git a/public/remmina__icon_8h.html b/public/remmina__icon_8h.html index d77f678f2..70de211ab 100644 --- a/public/remmina__icon_8h.html +++ b/public/remmina__icon_8h.html @@ -144,7 +144,7 @@ Functions
-

Definition at line 350 of file remmina_icon.c.

+

Definition at line 355 of file remmina_icon.c.

@@ -164,7 +164,7 @@ Functions
-

Definition at line 426 of file remmina_icon.c.

+

Definition at line 431 of file remmina_icon.c.

@@ -188,7 +188,7 @@ Functions

Return TRUE if a remmina_icon (status indicator/systray menu) is available and shown to the user, so the user can continue its work without the remmina main window.

Returns
TRUE if the Remmina icon is available.

Special treatment under GNOME Shell Remmina > v1.4.18 won't be shipped in distributions with GNOME Shell <= 3.18 therefore checking the the GNOME Shell version is useless. We just return TRUE

-

Definition at line 318 of file remmina_icon.c.

+

Definition at line 323 of file remmina_icon.c.

@@ -228,7 +228,7 @@ Functions
-

Definition at line 439 of file remmina_icon.c.

+

Definition at line 451 of file remmina_icon.c.

diff --git a/public/remmina__icon_8h_source.html b/public/remmina__icon_8h_source.html index e1024976b..9d45d9d1e 100644 --- a/public/remmina__icon_8h_source.html +++ b/public/remmina__icon_8h_source.html @@ -86,11 +86,11 @@ $(document).ready(function(){initNavTree('remmina__icon_8h_source.html','');});
remmina_icon.h
-Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010 Vic Lee
4  * Copyright (C) 2017-2023 Antenore Gatta, Giovanni Panozzo
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
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.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * In addition, as a special exception, the copyright holders give
22  * permission to link the code of portions of this program with the
23  * OpenSSL library under certain conditions as described in each
24  * individual source file, and distribute linked combinations
25  * including the two.
26  * You must obey the GNU General Public License in all respects
27  * for all of the code used other than OpenSSL. * If you modify
28  * file(s) with this exception, you may extend this exception to your
29  * version of the file(s), but you are not obligated to do so. * If you
30  * do not wish to do so, delete this exception statement from your
31  * version. * If you delete this exception statement from all source
32  * files in the program, then also delete it here.
33  *
34  */
35 
36 #pragma once
37 
38 #include <gtk/gtk.h>
39 
40 G_BEGIN_DECLS
41 
42 void remmina_icon_init(void);
43 gboolean remmina_icon_is_autostart(void);
44 void remmina_icon_set_autostart(gboolean autostart);
46 void remmina_icon_destroy(void);
47 gboolean remmina_icon_is_available(void);
48 
49 G_END_DECLS
gboolean remmina_icon_is_available(void)
Determine whenever the Remmina icon is available.
Definition: remmina_icon.c:318
-
gboolean remmina_icon_is_autostart(void)
Definition: remmina_icon.c:426
+Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2010 Vic Lee
4  * Copyright (C) 2017-2023 Antenore Gatta, Giovanni Panozzo
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
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.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * In addition, as a special exception, the copyright holders give
22  * permission to link the code of portions of this program with the
23  * OpenSSL library under certain conditions as described in each
24  * individual source file, and distribute linked combinations
25  * including the two.
26  * You must obey the GNU General Public License in all respects
27  * for all of the code used other than OpenSSL. * If you modify
28  * file(s) with this exception, you may extend this exception to your
29  * version of the file(s), but you are not obligated to do so. * If you
30  * do not wish to do so, delete this exception statement from your
31  * version. * If you delete this exception statement from all source
32  * files in the program, then also delete it here.
33  *
34  */
35 
36 #pragma once
37 
38 #include <gtk/gtk.h>
39 
40 G_BEGIN_DECLS
41 
42 void remmina_icon_init(void);
43 gboolean remmina_icon_is_autostart(void);
44 void remmina_icon_set_autostart(gboolean autostart);
46 void remmina_icon_destroy(void);
47 gboolean remmina_icon_is_available(void);
48 
49 G_END_DECLS
gboolean remmina_icon_is_available(void)
Determine whenever the Remmina icon is available.
Definition: remmina_icon.c:323
+
gboolean remmina_icon_is_autostart(void)
Definition: remmina_icon.c:431
void remmina_icon_destroy(void)
Definition: remmina_icon.c:75
-
void remmina_icon_set_autostart(gboolean autostart)
Definition: remmina_icon.c:439
-
G_BEGIN_DECLS void remmina_icon_init(void)
Definition: remmina_icon.c:350
+
void remmina_icon_set_autostart(gboolean autostart)
Definition: remmina_icon.c:451
+
G_BEGIN_DECLS void remmina_icon_init(void)
Definition: remmina_icon.c:355
void remmina_icon_populate_menu(void)
Definition: remmina_icon.c:250
diff --git a/public/remmina__log_8c_source.html b/public/remmina__log_8c_source.html index 79d14ca21..09a539447 100644 --- a/public/remmina__log_8c_source.html +++ b/public/remmina__log_8c_source.html @@ -106,7 +106,7 @@ $(document).ready(function(){initNavTree('remmina__log_8c_source.html','');});
Definition: remmina_log.c:62
-
gboolean remmina_pref_get_boolean(const gchar *key)
+
gboolean remmina_pref_get_boolean(const gchar *key)
static void remmina_log_window_init(RemminaLogWindow *logwin)
Definition: remmina_log.c:445
void _remmina_info(const gchar *fmt,...)
Definition: remmina_log.c:206
static gboolean remmina_log_on_keypress(GtkWidget *widget, GdkEvent *event, gpointer user_data)
Definition: remmina_log.c:426
diff --git a/public/remmina__main_8c_source.html b/public/remmina__main_8c_source.html index fc4154db8..ef52f165d 100644 --- a/public/remmina__main_8c_source.html +++ b/public/remmina__main_8c_source.html @@ -230,7 +230,7 @@ $(document).ready(function(){initNavTree('remmina__main_8c_source.html','');});
void remmina_main_on_action_connection_delete(GSimpleAction *action, GVariant *param, gpointer data)
Definition: remmina_main.c:977
static gboolean is_empty(const gchar *s)
RemminaStringArray * remmina_string_array_new_from_string(const gchar *strs)
-
gboolean remmina_pref_get_boolean(const gchar *key)
+
gboolean remmina_pref_get_boolean(const gchar *key)
gint view_file_mode
Definition: remmina_pref.h:213
RemminaStringArray * remmina_string_array_new(void)
void remmina_file_touch(RemminaFile *remminafile)
Update the atime and mtime of a given filename.
@@ -269,7 +269,7 @@ $(document).ready(function(){initNavTree('remmina__main_8c_source.html','');});
Definition: remmina_main.c:77
gboolean connected
-
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:778
+
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:783
Definition: remmina_main.c:74
void remmina_main_on_action_connection_edit(GSimpleAction *action, GVariant *param, gpointer data)
Definition: remmina_main.c:946
void remmina_main_toggle_password_view(GtkWidget *widget, gpointer data)
diff --git a/public/remmina__plugin__manager_8c_source.html b/public/remmina__plugin__manager_8c_source.html index ce304aa72..ca504c6c9 100644 --- a/public/remmina__plugin__manager_8c_source.html +++ b/public/remmina__plugin__manager_8c_source.html @@ -94,7 +94,7 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
void remmina_protocol_widget_set_error(RemminaProtocolWidget *gp, const gchar *fmt,...)
Definition: plugin.h:56
gboolean remmina_plugin_manager_is_encrypted_setting(RemminaProtocolPlugin *pp, const char *setting)
-
gint remmina_pref_get_scale_quality(void)
+
gint remmina_pref_get_scale_quality(void)
const gchar * remmina_file_get_string(RemminaFile *remminafile, const gchar *setting)
Definition: remmina_file.c:516
void remmina_protocol_widget_panel_hide(RemminaProtocolWidget *gp)
@@ -107,7 +107,7 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
gboolean remmina_plugin_native_load(RemminaPluginService *service, const char *name)
gboolean remmina_plugin_manager_loader_supported(const char *filetype)
gint remmina_protocol_widget_get_profile_remote_width(RemminaProtocolWidget *gp)
-
gint remmina_pref_get_sshtunnel_port(void)
+
gint remmina_pref_get_sshtunnel_port(void)
gint remmina_protocol_widget_panel_auth(RemminaProtocolWidget *gp, RemminaMessagePanelFlags pflags, const gchar *title, const gchar *default_username, const gchar *default_password, const gchar *default_domain, const gchar *password_prompt)
Definition: plugin.h:53
@@ -134,7 +134,7 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
int init_order
Definition: plugin.h:141
gchar * remmina_file_get_secret(RemminaFile *remminafile, const gchar *setting)
Definition: remmina_file.c:551
-
gint remmina_pref_get_ssh_loglevel(void)
+
gint remmina_pref_get_ssh_loglevel(void)
Definition: plugin.h:47
const RemminaProtocolFeature * features
Definition: plugin.h:77
RemminaFilePlugin * remmina_plugin_manager_get_export_file_handler(RemminaFile *remminafile)
@@ -150,7 +150,7 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
RemminaScaleMode remmina_protocol_widget_get_current_scale_mode(RemminaProtocolWidget *gp)
void remmina_protocol_widget_update_align(RemminaProtocolWidget *gp)
gint remmina_protocol_widget_panel_authx509(RemminaProtocolWidget *gp)
-
void remmina_pref_set_value(const gchar *key, const gchar *value)
+
void remmina_pref_set_value(const gchar *key, const gchar *value)
Definition: plugin.h:65
const gchar * description
Definition: plugin.h:59
const gchar * version
Definition: plugin.h:61
@@ -160,16 +160,16 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
void remmina_protocol_widget_set_display(RemminaProtocolWidget *gp, gint display)
void remmina_protocol_widget_set_width(RemminaProtocolWidget *gp, gint width)
static gboolean remmina_plugin_manager_show_for_each(RemminaPlugin *plugin, GtkListStore *store)
-
gchar * remmina_pref_get_value(const gchar *key)
+
gchar * remmina_pref_get_value(const gchar *key)
Definition: plugin.h:135
-
gboolean remmina_pref_get_ssh_parseconfig(void)
+
gboolean remmina_pref_get_ssh_parseconfig(void)
const gchar * remmina_protocol_widget_get_name(RemminaProtocolWidget *gp)
const char * get_filename_ext(const char *filename)
void remmina_protocol_widget_panel_show_listen(RemminaProtocolWidget *gp, gint port)
void remmina_plugin_manager_show(GtkWindow *parent)
gboolean remmina_masterthread_exec_is_main_thread()
-
guint * remmina_pref_keymap_get_table(const gchar *keymap)
+
guint * remmina_pref_keymap_get_table(const gchar *keymap)
void remmina_protocol_widget_signal_connection_closed(RemminaProtocolWidget *gp)
RemminaPluginService remmina_plugin_manager_service
static const gchar * remmina_plugin_type_name[]
@@ -202,7 +202,7 @@ $(document).ready(function(){initNavTree('remmina__plugin__manager_8c_source.htm
Definition: types.h:116
Definition: types.h:102
RemminaFile * remmina_file_new(void)
Definition: remmina_file.c:93
-
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
+
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
gboolean remmina_protocol_widget_is_closed(RemminaProtocolWidget *gp)
gchar * remmina_protocol_widget_get_clientkey(RemminaProtocolWidget *gp)
diff --git a/public/remmina__pref_8c.html b/public/remmina__pref_8c.html index 1f869d5ba..18f342f9e 100644 --- a/public/remmina__pref_8c.html +++ b/public/remmina__pref_8c.html @@ -185,7 +185,7 @@ Variables
-

Definition at line 929 of file remmina_pref.c.

+

Definition at line 934 of file remmina_pref.c.

@@ -205,7 +205,7 @@ Variables
-

Definition at line 986 of file remmina_pref.c.

+

Definition at line 991 of file remmina_pref.c.

@@ -322,7 +322,7 @@ Variables
-

Definition at line 1151 of file remmina_pref.c.

+

Definition at line 1156 of file remmina_pref.c.

@@ -370,7 +370,7 @@ Variables
-

Definition at line 967 of file remmina_pref.c.

+

Definition at line 972 of file remmina_pref.c.

@@ -390,7 +390,7 @@ Variables
-

Definition at line 1064 of file remmina_pref.c.

+

Definition at line 1069 of file remmina_pref.c.

@@ -410,7 +410,7 @@ Variables
-

Definition at line 1073 of file remmina_pref.c.

+

Definition at line 1078 of file remmina_pref.c.

@@ -430,7 +430,7 @@ Variables
-

Definition at line 1079 of file remmina_pref.c.

+

Definition at line 1084 of file remmina_pref.c.

@@ -450,7 +450,7 @@ Variables
-

Definition at line 1103 of file remmina_pref.c.

+

Definition at line 1108 of file remmina_pref.c.

@@ -470,7 +470,7 @@ Variables
-

Definition at line 1091 of file remmina_pref.c.

+

Definition at line 1096 of file remmina_pref.c.

@@ -490,7 +490,7 @@ Variables
-

Definition at line 1097 of file remmina_pref.c.

+

Definition at line 1102 of file remmina_pref.c.

@@ -510,7 +510,7 @@ Variables
-

Definition at line 1109 of file remmina_pref.c.

+

Definition at line 1114 of file remmina_pref.c.

@@ -530,7 +530,7 @@ Variables
-

Definition at line 1085 of file remmina_pref.c.

+

Definition at line 1090 of file remmina_pref.c.

@@ -550,7 +550,7 @@ Variables
-

Definition at line 1137 of file remmina_pref.c.

+

Definition at line 1142 of file remmina_pref.c.

@@ -618,7 +618,7 @@ Variables
-

Definition at line 768 of file remmina_pref.c.

+

Definition at line 773 of file remmina_pref.c.

@@ -648,7 +648,7 @@ Variables
-

Definition at line 1022 of file remmina_pref.c.

+

Definition at line 1027 of file remmina_pref.c.

@@ -668,7 +668,7 @@ Variables
-

Definition at line 1012 of file remmina_pref.c.

+

Definition at line 1017 of file remmina_pref.c.

@@ -688,7 +688,7 @@ Variables
-

Definition at line 1041 of file remmina_pref.c.

+

Definition at line 1046 of file remmina_pref.c.

@@ -708,7 +708,7 @@ Variables
-

Definition at line 778 of file remmina_pref.c.

+

Definition at line 783 of file remmina_pref.c.

@@ -738,7 +738,7 @@ Variables
-

Definition at line 1115 of file remmina_pref.c.

+

Definition at line 1120 of file remmina_pref.c.

diff --git a/public/remmina__pref_8c_source.html b/public/remmina__pref_8c_source.html index 4d23cbd4e..5b553db43 100644 --- a/public/remmina__pref_8c_source.html +++ b/public/remmina__pref_8c_source.html @@ -86,17 +86,17 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');});
remmina_pref.c
-Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2009-2011 Vic Lee
4  * Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5  * Copyright (C) 2016-2022 Antenore Gatta, Giovanni Panozzo
6  * Copyright (C) 2022-2023 Antenore Gatta, Giovanni Panozzo, Hiroyuki Tanaka
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  * In addition, as a special exception, the copyright holders give
24  * permission to link the code of portions of this program with the
25  * OpenSSL library under certain conditions as described in each
26  * individual source file, and distribute linked combinations
27  * including the two.
28  * You must obey the GNU General Public License in all respects
29  * for all of the code used other than OpenSSL. * If you modify
30  * file(s) with this exception, you may extend this exception to your
31  * version of the file(s), but you are not obligated to do so. * If you
32  * do not wish to do so, delete this exception statement from your
33  * version. * If you delete this exception statement from all source
34  * files in the program, then also delete it here.
35  *
36  */
37 
38 #include "config.h"
39 
40 #include <stdlib.h>
41 #include <string.h>
42 #include <unistd.h>
43 #include <sys/time.h>
44 #include <sys/utsname.h>
45 
46 #include <glib/gstdio.h>
47 #include <gdk/gdkkeysyms.h>
48 #include <gtk/gtk.h>
49 
50 #include "remmina_sodium.h"
51 
52 #include "remmina_public.h"
53 #include "remmina_string_array.h"
54 #include "remmina_pref.h"
55 #include "remmina_log.h"
57 
58 const gchar *default_resolutions = "640x480,800x600,1024x768,1152x864,1280x960,1400x1050,1920x1080";
59 const gchar *default_keystrokes = "Send hello world§hello world\\n";
60 
62 static GHashTable *remmina_keymap_table = NULL;
63 
64 /* We could customize this further if there are more requirements */
65 static const gchar *default_keymap_data = "# Please check gdk/gdkkeysyms.h for a full list of all key names or hex key values\n"
66  "\n"
67  "[Map Meta Keys]\n"
68  "Super_L = Meta_L\n"
69  "Super_R = Meta_R\n"
70  "Meta_L = Super_L\n"
71  "Meta_R = Super_R\n";
72 
73 static void remmina_pref_gen_secret(void)
74 {
75  TRACE_CALL(__func__);
76  guchar s[32];
77  gint i;
78  GKeyFile *gkeyfile;
79  g_autofree gchar *content = NULL;
80  gsize length;
81 
82  for (i = 0; i < 32; i++)
83  s[i] = (guchar)(randombytes_uniform(257));
84  remmina_pref.secret = g_base64_encode(s, 32);
85 
86  gkeyfile = g_key_file_new();
87  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
88  g_key_file_set_string(gkeyfile, "remmina_pref", "secret", remmina_pref.secret);
89  content = g_key_file_to_data(gkeyfile, &length, NULL);
90  g_file_set_contents(remmina_pref_file, content, length, NULL);
91 
92  g_key_file_free(gkeyfile);
93 }
94 
95 static guint remmina_pref_get_keyval_from_str(const gchar *str)
96 {
97  TRACE_CALL(__func__);
98  guint k;
99 
100  if (!str)
101  return 0;
102 
103  k = gdk_keyval_from_name(str);
104  if (!k)
105  if (sscanf(str, "%x", &k) < 1)
106  k = 0;
107  return k;
108 }
109 
110 static void remmina_pref_init_keymap(void)
111 {
112  TRACE_CALL(__func__);
113  GKeyFile *gkeyfile;
114  gchar **groups;
115  gchar **gptr;
116  gchar **keys;
117  gchar **kptr;
118  gsize nkeys;
119  g_autofree gchar *value = NULL;
120  guint *table;
121  guint *tableptr;
122  guint k1, k2;
123 
125  g_hash_table_destroy(remmina_keymap_table);
126  remmina_keymap_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
127 
128  gkeyfile = g_key_file_new();
129  if (!g_key_file_load_from_file(gkeyfile, remmina_keymap_file, G_KEY_FILE_NONE, NULL)) {
130  if (!g_key_file_load_from_data(gkeyfile, default_keymap_data, strlen(default_keymap_data), G_KEY_FILE_NONE,
131  NULL)) {
132  g_print("Failed to initialize keymap table\n");
133  g_key_file_free(gkeyfile);
134  return;
135  }
136  }
137 
138  groups = g_key_file_get_groups(gkeyfile, NULL);
139  gptr = groups;
140  while (*gptr) {
141  keys = g_key_file_get_keys(gkeyfile, *gptr, &nkeys, NULL);
142  table = g_new0(guint, nkeys * 2 + 1);
143  g_hash_table_insert(remmina_keymap_table, g_strdup(*gptr), table);
144 
145  kptr = keys;
146  tableptr = table;
147  while (*kptr) {
149  if (k1) {
150  value = g_key_file_get_string(gkeyfile, *gptr, *kptr, NULL);
152  *tableptr++ = k1;
153  *tableptr++ = k2;
154  }
155  kptr++;
156  }
157  g_strfreev(keys);
158  gptr++;
159  }
160  g_strfreev(groups);
161  g_key_file_free(gkeyfile);
162 }
163 
165 static gboolean remmina_pref_file_do_copy(const char *src_path, const char *dst_path)
166 {
167  GFile *src = g_file_new_for_path(src_path), *dst = g_file_new_for_path(dst_path);
168  /* We don’t overwrite the target if it exists, because overwrite is not set */
169  const gboolean ok = g_file_copy(src, dst, G_FILE_COPY_NONE, NULL, NULL, NULL, NULL);
170 
171  g_object_unref(dst);
172  g_object_unref(src);
173 
174  return ok;
175 }
176 
177 void remmina_pref_file_load_colors(GKeyFile *gkeyfile, RemminaColorPref *color_pref)
178 {
179  const struct {
180  const char * name;
181  char ** setting;
182  char * fallback;
183  } colors[] = {
184  { "background", &color_pref->background, "#d5ccba" },
185  { "cursor", &color_pref->cursor, "#45373c" },
186  { "cursor_foreground", &color_pref->cursor_foreground, "#d5ccba" },
187  { "highlight", &color_pref->highlight, "#45373c" },
188  { "highlight_foreground", &color_pref->highlight_foreground, "#d5ccba" },
189  { "colorBD", &color_pref->colorBD, "#45373c" },
190  { "foreground", &color_pref->foreground, "#45373c" },
191  { "color0", &color_pref->color0, "#20111b" },
192  { "color1", &color_pref->color1, "#be100e" },
193  { "color2", &color_pref->color2, "#858162" },
194  { "color3", &color_pref->color3, "#eaa549" },
195  { "color4", &color_pref->color4, "#426a79" },
196  { "color5", &color_pref->color5, "#97522c" },
197  { "color6", &color_pref->color6, "#989a9c" },
198  { "color7", &color_pref->color7, "#968c83" },
199  { "color8", &color_pref->color8, "#5e5252" },
200  { "color9", &color_pref->color9, "#be100e" },
201  { "color10", &color_pref->color10, "#858162" },
202  { "color11", &color_pref->color11, "#eaa549" },
203  { "color12", &color_pref->color12, "#426a79" },
204  { "color13", &color_pref->color13, "#97522c" },
205  { "color14", &color_pref->color14, "#989a9c" },
206  { "color15", &color_pref->color15, "#d5ccba" },
207  };
208 
209  int i;
210 
211  for (i = 0; i < (sizeof(colors) / sizeof(colors[0])); i++) {
212  if (g_key_file_has_key(gkeyfile, "ssh_colors", colors[i].name, NULL))
213  *colors[i].setting = g_key_file_get_string(gkeyfile, "ssh_colors", colors[i].name,
214  NULL);
215  else
216  *colors[i].setting = colors[i].fallback;
217  }
218 }
219 
221 {
222  TRACE_CALL(__func__);
223  GKeyFile *gkeyfile;
224  gchar *remmina_dir;
225  const gchar *filename = "remmina.pref";
226  const gchar *colors_filename = "remmina.colors";
227  g_autofree gchar *remmina_colors_file = NULL;
228  GDir *dir;
229  const gchar *legacy = ".remmina";
230  int i;
231 
232  remmina_dir = g_build_path("/", g_get_user_config_dir(), "remmina", NULL);
233  /* Create the XDG_CONFIG_HOME directory */
234  g_mkdir_with_parents(remmina_dir, 0750);
235 
236  g_free(remmina_dir), remmina_dir = NULL;
237  /* Legacy ~/.remmina we copy the existing remmina.pref file inside
238  * XDG_CONFIG_HOME */
239  remmina_dir = g_build_path("/", g_get_home_dir(), legacy, NULL);
240  if (g_file_test(remmina_dir, G_FILE_TEST_IS_DIR)) {
241  dir = g_dir_open(remmina_dir, 0, NULL);
243  g_build_path("/", remmina_dir, filename, NULL),
244  g_build_path("/", g_get_user_config_dir(),
245  "remmina", filename, NULL));
246  g_dir_close(dir);
247  }
248 
249  /* /usr/local/etc/remmina */
250  const gchar *const *dirs = g_get_system_config_dirs();
251 
252  g_free(remmina_dir), remmina_dir = NULL;
253  for (i = 0; dirs[i] != NULL; ++i) {
254  remmina_dir = g_build_path("/", dirs[i], "remmina", NULL);
255  if (g_file_test(remmina_dir, G_FILE_TEST_IS_DIR)) {
256  dir = g_dir_open(remmina_dir, 0, NULL);
257  while ((filename = g_dir_read_name(dir)) != NULL) {
259  g_build_path("/", remmina_dir, filename, NULL),
260  g_build_path("/", g_get_user_config_dir(),
261  "remmina", filename, NULL));
262  }
263  g_free(remmina_dir), remmina_dir = NULL;
264  }
265  }
266 
267  /* The last case we use the home ~/.config/remmina */
268  if (remmina_dir != NULL)
269  g_free(remmina_dir), remmina_dir = NULL;
270  remmina_dir = g_build_path("/", g_get_user_config_dir(),
271  "remmina", NULL);
272 
273  remmina_pref_file = g_strdup_printf("%s/remmina.pref", remmina_dir);
274  /* remmina.colors */
275  remmina_colors_file = g_strdup_printf("%s/%s", remmina_dir, colors_filename);
276 
277  remmina_keymap_file = g_strdup_printf("%s/remmina.keymap", remmina_dir);
278 
279  gkeyfile = g_key_file_new();
280 
281  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
282 
283  if (g_key_file_has_key(gkeyfile, "remmina_pref", "save_view_mode", NULL))
284  remmina_pref.save_view_mode = g_key_file_get_boolean(gkeyfile, "remmina_pref", "save_view_mode", NULL);
285  else
287 
288  if (g_key_file_has_key(gkeyfile, "remmina_pref", "confirm_close", NULL))
289  remmina_pref.confirm_close = g_key_file_get_boolean(gkeyfile, "remmina_pref", "confirm_close", NULL);
290  else
292 
293  if (extrahardening)
294  remmina_pref.confirm_close = FALSE;
295 
296  if (g_key_file_has_key(gkeyfile, "remmina_pref", "use_master_password", NULL)) {
297  remmina_pref.use_primary_password = g_key_file_get_boolean(gkeyfile, "remmina_pref", "use_master_password", NULL);
298  } else if (g_key_file_has_key(gkeyfile, "remmina_pref", "use_primary_password", NULL))
299  remmina_pref.use_primary_password = g_key_file_get_boolean(gkeyfile, "remmina_pref", "use_primary_password", NULL);
300  else
302 
303  if (g_key_file_has_key(gkeyfile, "remmina_pref", "unlock_timeout", NULL))
304  remmina_pref.unlock_timeout = g_key_file_get_integer(gkeyfile, "remmina_pref", "unlock_timeout", NULL);
305  else
307 
308  if (g_key_file_has_key(gkeyfile, "remmina_pref", "unlock_password", NULL))
309  remmina_pref.unlock_password = g_key_file_get_string(gkeyfile, "remmina_pref", "unlock_password", NULL);
310  else
311  remmina_pref.unlock_password = g_strdup("");
312 
313  if (g_key_file_has_key(gkeyfile, "remmina_pref", "lock_connect", NULL))
314  remmina_pref.lock_connect = g_key_file_get_boolean(gkeyfile, "remmina_pref", "lock_connect", NULL);
315  else
316  remmina_pref.lock_connect = FALSE;
317 
318  if (g_key_file_has_key(gkeyfile, "remmina_pref", "lock_edit", NULL))
319  remmina_pref.lock_edit = g_key_file_get_boolean(gkeyfile, "remmina_pref", "lock_edit", NULL);
320  else
321  remmina_pref.lock_edit = FALSE;
322 
323 
324  if (g_key_file_has_key(gkeyfile, "remmina_pref", "lock_view_passwords", NULL))
325  remmina_pref.lock_view_passwords = g_key_file_get_boolean(gkeyfile, "remmina_pref", "lock_view_passwords", NULL);
326  else
328 
329  if (g_key_file_has_key(gkeyfile, "remmina_pref", "enc_mode", NULL))
330  remmina_pref.enc_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "enc_mode", NULL);
331  else
333 
334  if (g_key_file_has_key(gkeyfile, "remmina_pref", "audit", NULL))
335  remmina_pref.audit = g_key_file_get_boolean(gkeyfile, "remmina_pref", "audit", NULL);
336  else
337  remmina_pref.audit = FALSE;
338 
339  if (g_key_file_has_key(gkeyfile, "remmina_pref", "trust_all", NULL))
340  remmina_pref.trust_all = g_key_file_get_boolean(gkeyfile, "remmina_pref", "trust_all", NULL);
341  else
342  remmina_pref.trust_all = FALSE;
343 
344  if (g_key_file_has_key(gkeyfile, "remmina_pref", "fullscreen_on_auto", NULL))
345  remmina_pref.fullscreen_on_auto = g_key_file_get_boolean(gkeyfile, "remmina_pref", "fullscreen_on_auto", NULL);
346  else
348 
349  if (g_key_file_has_key(gkeyfile, "remmina_pref", "floating_toolbar_placement", NULL))
350  remmina_pref.floating_toolbar_placement = g_key_file_get_integer(gkeyfile, "remmina_pref", "floating_toolbar_placement", NULL);
351  else
353 
354  if (g_key_file_has_key(gkeyfile, "remmina_pref", "prevent_snap_welcome_message", NULL))
355  remmina_pref.prevent_snap_welcome_message = g_key_file_get_boolean(gkeyfile, "remmina_pref", "prevent_snap_welcome_message", NULL);
356  else
358 
359  if (g_key_file_has_key(gkeyfile, "remmina_pref", "last_quickconnect_protocol", NULL))
360  remmina_pref.last_quickconnect_protocol = g_key_file_get_string(gkeyfile, "remmina_pref", "last_quickconnect_protocol", NULL);
361  else
363 
364  if (g_key_file_has_key(gkeyfile, "remmina_pref", "toolbar_placement", NULL))
365  remmina_pref.toolbar_placement = g_key_file_get_integer(gkeyfile, "remmina_pref", "toolbar_placement", NULL);
366  else
368 
369  if (g_key_file_has_key(gkeyfile, "remmina_pref", "always_show_tab", NULL))
370  remmina_pref.always_show_tab = g_key_file_get_boolean(gkeyfile, "remmina_pref", "always_show_tab", NULL);
371  else
373 
374  if (extrahardening)
376 
377  if (g_key_file_has_key(gkeyfile, "remmina_pref", "always_show_notes", NULL))
378  remmina_pref.always_show_notes = g_key_file_get_boolean(gkeyfile, "remmina_pref", "always_show_notes", NULL);
379  else
381 
382  if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_connection_toolbar", NULL))
383  remmina_pref.hide_connection_toolbar = g_key_file_get_boolean(gkeyfile, "remmina_pref",
384  "hide_connection_toolbar", NULL);
385  else
387 
388  if (disabletoolbar)
390 
391  if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_searchbar", NULL))
392  remmina_pref.hide_searchbar = g_key_file_get_boolean(gkeyfile, "remmina_pref",
393  "hide_searchbar", NULL);
394  else
396 
397  if (extrahardening)
399 
400  if (g_key_file_has_key(gkeyfile, "remmina_pref", "default_action", NULL))
401  remmina_pref.default_action = g_key_file_get_integer(gkeyfile, "remmina_pref", "default_action", NULL);
402  else
404 
405  if (g_key_file_has_key(gkeyfile, "remmina_pref", "scale_quality", NULL))
406  remmina_pref.scale_quality = g_key_file_get_integer(gkeyfile, "remmina_pref", "scale_quality", NULL);
407  else
408  remmina_pref.scale_quality = GDK_INTERP_HYPER;
409 
410  if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_toolbar", NULL))
411  remmina_pref.hide_toolbar = g_key_file_get_boolean(gkeyfile, "remmina_pref", "hide_toolbar", NULL);
412  else
413  remmina_pref.hide_toolbar = FALSE;
414 
415  if (g_key_file_has_key(gkeyfile, "remmina_pref", "small_toolbutton", NULL))
416  remmina_pref.small_toolbutton = g_key_file_get_boolean(gkeyfile, "remmina_pref", "small_toolbutton", NULL);
417  else
419 
420  if (g_key_file_has_key(gkeyfile, "remmina_pref", "view_file_mode", NULL))
421  remmina_pref.view_file_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "view_file_mode", NULL);
422  else
424 
425  if (g_key_file_has_key(gkeyfile, "remmina_pref", "resolutions", NULL))
426  remmina_pref.resolutions = g_key_file_get_string(gkeyfile, "remmina_pref", "resolutions", NULL);
427  else
429 
430  if (g_key_file_has_key(gkeyfile, "remmina_pref", "keystrokes", NULL))
431  remmina_pref.keystrokes = g_key_file_get_string(gkeyfile, "remmina_pref", "keystrokes", NULL);
432  else
434 
435  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_width", NULL))
436  remmina_pref.main_width = MAX(600, g_key_file_get_integer(gkeyfile, "remmina_pref", "main_width", NULL));
437  else
438  remmina_pref.main_width = 600;
439 
440  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_height", NULL))
441  remmina_pref.main_height = MAX(400, g_key_file_get_integer(gkeyfile, "remmina_pref", "main_height", NULL));
442  else
444 
445  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_maximize", NULL))
446  remmina_pref.main_maximize = g_key_file_get_boolean(gkeyfile, "remmina_pref", "main_maximize", NULL);
447  else
448  remmina_pref.main_maximize = FALSE;
449 
450  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_sort_column_id", NULL))
451  remmina_pref.main_sort_column_id = g_key_file_get_integer(gkeyfile, "remmina_pref", "main_sort_column_id",
452  NULL);
453  else
455 
456  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_sort_order", NULL))
457  remmina_pref.main_sort_order = g_key_file_get_integer(gkeyfile, "remmina_pref", "main_sort_order", NULL);
458  else
460 
461  if (g_key_file_has_key(gkeyfile, "remmina_pref", "expanded_group", NULL))
462  remmina_pref.expanded_group = g_key_file_get_string(gkeyfile, "remmina_pref", "expanded_group", NULL);
463  else
464  remmina_pref.expanded_group = g_strdup("");
465 
466  if (g_key_file_has_key(gkeyfile, "remmina_pref", "toolbar_pin_down", NULL))
467  remmina_pref.toolbar_pin_down = g_key_file_get_boolean(gkeyfile, "remmina_pref", "toolbar_pin_down", NULL);
468  else
470 
471  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_loglevel", NULL))
472  remmina_pref.ssh_loglevel = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_loglevel", NULL);
473  else
474  remmina_pref.ssh_loglevel = DEFAULT_SSH_LOGLEVEL;
475 
476  if (g_key_file_has_key(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", NULL))
477  remmina_pref.deny_screenshot_clipboard = g_key_file_get_boolean(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", NULL);
478  else
480 
481  if (g_key_file_has_key(gkeyfile, "remmina_pref", "datadir_path", NULL))
482  remmina_pref.datadir_path = g_key_file_get_string(gkeyfile, "remmina_pref", "datadir_path", NULL);
483  else
484  remmina_pref.datadir_path = g_strdup("");
485 
486  if (g_key_file_has_key(gkeyfile, "remmina_pref", "remmina_file_name", NULL))
487  remmina_pref.remmina_file_name = g_key_file_get_string(gkeyfile, "remmina_pref", "remmina_file_name", NULL);
488  else
489  remmina_pref.remmina_file_name = g_strdup("%G_%P_%N_%h");
490 
491  if (g_key_file_has_key(gkeyfile, "remmina_pref", "screenshot_path", NULL)) {
492  remmina_pref.screenshot_path = g_key_file_get_string(gkeyfile, "remmina_pref", "screenshot_path", NULL);
493  } else {
494  remmina_pref.screenshot_path = g_get_user_special_dir(G_USER_DIRECTORY_PICTURES);
495  if (remmina_pref.screenshot_path == NULL)
496  remmina_pref.screenshot_path = g_get_home_dir();
497  }
498 
499  if (g_key_file_has_key(gkeyfile, "remmina_pref", "screenshot_name", NULL))
500  remmina_pref.screenshot_name = g_key_file_get_string(gkeyfile, "remmina_pref", "screenshot_name", NULL);
501  else
502  remmina_pref.screenshot_name = g_strdup("remmina_%p_%h_%Y%m%d-%H%M%S");
503 
504  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_parseconfig", NULL))
505  remmina_pref.ssh_parseconfig = g_key_file_get_boolean(gkeyfile, "remmina_pref", "ssh_parseconfig", NULL);
506  else
507  remmina_pref.ssh_parseconfig = DEFAULT_SSH_PARSECONFIG;
508 
509  if (g_key_file_has_key(gkeyfile, "remmina_pref", "sshtunnel_port", NULL))
510  remmina_pref.sshtunnel_port = g_key_file_get_integer(gkeyfile, "remmina_pref", "sshtunnel_port", NULL);
511  else
512  remmina_pref.sshtunnel_port = DEFAULT_SSHTUNNEL_PORT;
513 
514  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_tcp_keepidle", NULL))
515  remmina_pref.ssh_tcp_keepidle = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepidle", NULL);
516  else
517  remmina_pref.ssh_tcp_keepidle = SSH_SOCKET_TCP_KEEPIDLE;
518 
519  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_tcp_keepintvl", NULL))
520  remmina_pref.ssh_tcp_keepintvl = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepintvl", NULL);
521  else
522  remmina_pref.ssh_tcp_keepintvl = SSH_SOCKET_TCP_KEEPINTVL;
523 
524  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_tcp_keepcnt", NULL))
525  remmina_pref.ssh_tcp_keepcnt = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepcnt", NULL);
526  else
527  remmina_pref.ssh_tcp_keepcnt = SSH_SOCKET_TCP_KEEPCNT;
528 
529  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_tcp_usrtimeout", NULL))
530  remmina_pref.ssh_tcp_usrtimeout = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_tcp_usrtimeout", NULL);
531  else
532  remmina_pref.ssh_tcp_usrtimeout = SSH_SOCKET_TCP_USER_TIMEOUT;
533 
534  if (g_key_file_has_key(gkeyfile, "remmina_pref", "applet_new_ontop", NULL))
535  remmina_pref.applet_new_ontop = g_key_file_get_boolean(gkeyfile, "remmina_pref", "applet_new_ontop", NULL);
536  else
538 
539  if (g_key_file_has_key(gkeyfile, "remmina_pref", "applet_hide_count", NULL))
540  remmina_pref.applet_hide_count = g_key_file_get_boolean(gkeyfile, "remmina_pref", "applet_hide_count", NULL);
541  else
543 
544  if (g_key_file_has_key(gkeyfile, "remmina_pref", "applet_enable_avahi", NULL))
545  remmina_pref.applet_enable_avahi = g_key_file_get_boolean(gkeyfile, "remmina_pref", "applet_enable_avahi",
546  NULL);
547  else
549 
550  if (g_key_file_has_key(gkeyfile, "remmina_pref", "disable_tray_icon", NULL))
551  remmina_pref.disable_tray_icon = g_key_file_get_boolean(gkeyfile, "remmina_pref", "disable_tray_icon", NULL);
552  else
554 
555  if (disabletrayicon)
557 
558  if (g_key_file_has_key(gkeyfile, "remmina_pref", "dark_theme", NULL))
559  remmina_pref.dark_theme = g_key_file_get_boolean(gkeyfile, "remmina_pref", "dark_theme", NULL);
560  else
561  remmina_pref.dark_theme = FALSE;
562 
563  if (g_key_file_has_key(gkeyfile, "remmina_pref", "list_refresh_workaround", NULL))
564  remmina_pref.list_refresh_workaround = g_key_file_get_boolean(gkeyfile, "remmina_pref", "list_refresh_workaround", NULL);
565  else
567 
568  if (g_key_file_has_key(gkeyfile, "remmina_pref", "grab_color_switch", NULL))
569  remmina_pref.grab_color_switch = g_key_file_get_boolean(gkeyfile, "remmina_pref", "grab_color_switch", NULL);
570  else
572 
573  if (g_key_file_has_key(gkeyfile, "remmina_pref", "grab_color", NULL))
574  remmina_pref.grab_color = g_key_file_get_string(gkeyfile, "remmina_pref", "grab_color", NULL);
575  else
576  remmina_pref.grab_color = "#00ff00";
577 
578  if (g_key_file_has_key(gkeyfile, "remmina_pref", "recent_maximum", NULL))
579  remmina_pref.recent_maximum = g_key_file_get_integer(gkeyfile, "remmina_pref", "recent_maximum", NULL);
580  else
582 
583  if (g_key_file_has_key(gkeyfile, "remmina_pref", "default_mode", NULL))
584  remmina_pref.default_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "default_mode", NULL);
585  else
587 
588  if (fullscreen)
590 
591  if (g_key_file_has_key(gkeyfile, "remmina_pref", "tab_mode", NULL))
592  remmina_pref.tab_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "tab_mode", NULL);
593  else
595 
596  if (g_key_file_has_key(gkeyfile, "remmina_pref", "fullscreen_toolbar_visibility", NULL))
597  remmina_pref.fullscreen_toolbar_visibility = g_key_file_get_integer(gkeyfile, "remmina_pref", "fullscreen_toolbar_visibility", NULL);
598  else
600 
601  if (disabletoolbar)
603 
604  if (g_key_file_has_key(gkeyfile, "remmina_pref", "auto_scroll_step", NULL))
605  remmina_pref.auto_scroll_step = g_key_file_get_integer(gkeyfile, "remmina_pref", "auto_scroll_step", NULL);
606  else
608 
609  if (g_key_file_has_key(gkeyfile, "remmina_pref", "hostkey", NULL))
610  remmina_pref.hostkey = g_key_file_get_integer(gkeyfile, "remmina_pref", "hostkey", NULL);
611  else
612  remmina_pref.hostkey = GDK_KEY_Control_R;
613 
614  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_fullscreen", NULL))
615  remmina_pref.shortcutkey_fullscreen = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_fullscreen",
616  NULL);
617  else
619 
620  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_autofit", NULL))
621  remmina_pref.shortcutkey_autofit = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_autofit",
622  NULL);
623  else
624  remmina_pref.shortcutkey_autofit = GDK_KEY_1;
625 
626  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_nexttab", NULL))
627  remmina_pref.shortcutkey_nexttab = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_nexttab",
628  NULL);
629  else
630  remmina_pref.shortcutkey_nexttab = GDK_KEY_Right;
631 
632  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_prevtab", NULL))
633  remmina_pref.shortcutkey_prevtab = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_prevtab",
634  NULL);
635  else
636  remmina_pref.shortcutkey_prevtab = GDK_KEY_Left;
637 
638  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_scale", NULL))
639  remmina_pref.shortcutkey_scale = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_scale", NULL);
640  else
641  remmina_pref.shortcutkey_scale = GDK_KEY_s;
642 
643  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_viewonly", NULL))
644  remmina_pref.shortcutkey_viewonly = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_viewonly", NULL);
645  else
647 
648  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_multimon", NULL))
649  remmina_pref.shortcutkey_multimon = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_multimon", NULL);
650  else
651  remmina_pref.shortcutkey_multimon = GDK_KEY_Page_Up;
652 
653  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_grab", NULL))
654  remmina_pref.shortcutkey_grab = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_grab", NULL);
655  else
656  remmina_pref.shortcutkey_grab = GDK_KEY_Control_R;
657 
658  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_minimize", NULL))
659  remmina_pref.shortcutkey_minimize = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_minimize", NULL);
660  else
661  remmina_pref.shortcutkey_minimize = GDK_KEY_F9;
662 
663  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_screenshot", NULL))
664  remmina_pref.shortcutkey_screenshot = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_screenshot", NULL);
665  else
666  remmina_pref.shortcutkey_screenshot = GDK_KEY_F12;
667 
668  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_disconnect", NULL))
669  remmina_pref.shortcutkey_disconnect = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_disconnect",
670  NULL);
671  else
673 
674  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_toolbar", NULL))
675  remmina_pref.shortcutkey_toolbar = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_toolbar",
676  NULL);
677  else
678  remmina_pref.shortcutkey_toolbar = GDK_KEY_t;
679 
680  if (g_key_file_has_key(gkeyfile, "remmina_pref", "secret", NULL))
681  remmina_pref.secret = g_key_file_get_string(gkeyfile, "remmina_pref", "secret", NULL);
682  else
683  remmina_pref.secret = NULL;
684 
685  if (g_key_file_has_key(gkeyfile, "remmina_pref", "uid", NULL))
686  remmina_pref.uid = g_key_file_get_string(gkeyfile, "remmina_pref", "uid", NULL);
687  else
688  remmina_pref.uid = NULL;
689 
690  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_font", NULL))
691  remmina_pref.vte_font = g_key_file_get_string(gkeyfile, "remmina_pref", "vte_font", NULL);
692  else
694 
695  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_allow_bold_text", NULL))
696  remmina_pref.vte_allow_bold_text = g_key_file_get_boolean(gkeyfile, "remmina_pref", "vte_allow_bold_text",
697  NULL);
698  else
700 
701  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_lines", NULL))
702  remmina_pref.vte_lines = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_lines", NULL);
703  else
704  remmina_pref.vte_lines = 512;
705 
706  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_copy", NULL))
707  remmina_pref.vte_shortcutkey_copy = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_copy",
708  NULL);
709  else
711 
712  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_paste", NULL))
713  remmina_pref.vte_shortcutkey_paste = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_paste",
714  NULL);
715  else
717 
718  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_select_all", NULL))
719  remmina_pref.vte_shortcutkey_select_all = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_select_all",
720  NULL);
721  else
723 
724  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_increase_font", NULL))
725  remmina_pref.vte_shortcutkey_increase_font = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_increase_font",
726  NULL);
727  else
729 
730  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_decrease_font", NULL))
731  remmina_pref.vte_shortcutkey_decrease_font = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_decrease_font",
732  NULL);
733  else
734  remmina_pref.vte_shortcutkey_decrease_font = GDK_KEY_Page_Down;
735 
736  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_search_text", NULL))
737  remmina_pref.vte_shortcutkey_search_text = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_search_text",
738  NULL);
739  else
741 
742 
744 
745  /* If we have a color scheme file, we switch to it, GIO will merge it in the
746  * remmina.pref file */
747  if (g_file_test(remmina_colors_file, G_FILE_TEST_IS_REGULAR)) {
748  g_key_file_load_from_file(gkeyfile, remmina_colors_file, G_KEY_FILE_NONE, NULL);
749  g_remove(remmina_colors_file);
750  }
751 
752  /* Default settings */
753  if (!g_key_file_has_key(gkeyfile, "remmina", "name", NULL)) {
754  g_key_file_set_string(gkeyfile, "remmina", "name", "");
755  g_key_file_set_integer(gkeyfile, "remmina", "ignore-tls-errors", 1);
756  g_key_file_set_integer(gkeyfile, "remmina", "enable-plugins", 1);
758  }
759 
760  g_key_file_free(gkeyfile);
761 
762  if (remmina_pref.secret == NULL)
764 
766 }
767 
768 gboolean remmina_pref_is_rw(void)
769 {
770  TRACE_CALL(__func__);
771  if (access(remmina_pref_file, W_OK) == 0)
772  return TRUE;
773  else
774  return FALSE;
775  return FALSE;
776 }
777 
778 gboolean remmina_pref_save(void)
779 {
780  TRACE_CALL(__func__);
781 
782  if (remmina_pref_is_rw() == FALSE) {
783  g_debug("remmina.pref is not writable, returning");
784  return FALSE;
785  }
786  GKeyFile *gkeyfile;
787  GError *error = NULL;
788  g_autofree gchar *content = NULL;
789  gsize length;
790 
791  gkeyfile = g_key_file_new();
792 
793  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
794 
795  g_key_file_set_string(gkeyfile, "remmina_pref", "datadir_path", remmina_pref.datadir_path);
796  g_key_file_set_string(gkeyfile, "remmina_pref", "remmina_file_name", remmina_pref.remmina_file_name);
797  g_key_file_set_string(gkeyfile, "remmina_pref", "screenshot_path", remmina_pref.screenshot_path);
798  g_key_file_set_string(gkeyfile, "remmina_pref", "screenshot_name", remmina_pref.screenshot_name);
799  g_key_file_set_boolean(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", remmina_pref.deny_screenshot_clipboard);
800  g_key_file_set_boolean(gkeyfile, "remmina_pref", "save_view_mode", remmina_pref.save_view_mode);
801  g_key_file_set_boolean(gkeyfile, "remmina_pref", "confirm_close", remmina_pref.confirm_close);
802  if (g_key_file_remove_key(gkeyfile, "remmina_pref", "use_master_password", NULL))
803  REMMINA_DEBUG("use_master_password removed…");
804  else
805  REMMINA_INFO("use_master_password already migrated");
806 #if SODIUM_VERSION_INT >= 90200
807  g_key_file_set_boolean(gkeyfile, "remmina_pref", "use_primary_password", remmina_pref.use_primary_password);
808  g_key_file_set_integer(gkeyfile, "remmina_pref", "unlock_timeout", remmina_pref.unlock_timeout);
809  g_key_file_set_string(gkeyfile, "remmina_pref", "unlock_password", remmina_pref.unlock_password);
810  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_connect", remmina_pref.lock_connect);
811  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_edit", remmina_pref.lock_edit);
812  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_view_passwords", remmina_pref.lock_view_passwords);
813 #else
814  g_key_file_set_boolean(gkeyfile, "remmina_pref", "use_primary_password", FALSE);
815  g_key_file_set_integer(gkeyfile, "remmina_pref", "unlock_timeout", 0);
816  g_key_file_set_string(gkeyfile, "remmina_pref", "unlock_password", g_strdup(""));
817  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_connect", FALSE);
818  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_edit", FALSE);
819  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_view_passwords", FALSE);
820 #endif
821  g_key_file_set_integer(gkeyfile, "remmina_pref", "enc_mode", remmina_pref.enc_mode);
822  g_key_file_set_boolean(gkeyfile, "remmina_pref", "audit", remmina_pref.audit);
823  g_key_file_set_boolean(gkeyfile, "remmina_pref", "trust_all", remmina_pref.trust_all);
824  g_key_file_set_integer(gkeyfile, "remmina_pref", "floating_toolbar_placement", remmina_pref.floating_toolbar_placement);
825  g_key_file_set_integer(gkeyfile, "remmina_pref", "toolbar_placement", remmina_pref.toolbar_placement);
826  g_key_file_set_boolean(gkeyfile, "remmina_pref", "prevent_snap_welcome_message", remmina_pref.prevent_snap_welcome_message);
827  g_key_file_set_string(gkeyfile, "remmina_pref", "last_quickconnect_protocol", remmina_pref.last_quickconnect_protocol);
828  g_key_file_set_boolean(gkeyfile, "remmina_pref", "fullscreen_on_auto", remmina_pref.fullscreen_on_auto);
829  g_key_file_set_boolean(gkeyfile, "remmina_pref", "always_show_tab", remmina_pref.always_show_tab);
830  g_key_file_set_boolean(gkeyfile, "remmina_pref", "always_show_notes", remmina_pref.always_show_notes);
831  g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_connection_toolbar", remmina_pref.hide_connection_toolbar);
832  g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_searchbar", remmina_pref.hide_searchbar);
833  g_key_file_set_integer(gkeyfile, "remmina_pref", "default_action", remmina_pref.default_action);
834  g_key_file_set_integer(gkeyfile, "remmina_pref", "scale_quality", remmina_pref.scale_quality);
835  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_loglevel", remmina_pref.ssh_loglevel);
836  g_key_file_set_boolean(gkeyfile, "remmina_pref", "ssh_parseconfig", remmina_pref.ssh_parseconfig);
837  g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_toolbar", remmina_pref.hide_toolbar);
838  g_key_file_set_boolean(gkeyfile, "remmina_pref", "small_toolbutton", remmina_pref.small_toolbutton);
839  g_key_file_set_integer(gkeyfile, "remmina_pref", "view_file_mode", remmina_pref.view_file_mode);
840  g_key_file_set_string(gkeyfile, "remmina_pref", "resolutions", remmina_pref.resolutions);
841  g_key_file_set_string(gkeyfile, "remmina_pref", "keystrokes", remmina_pref.keystrokes);
842  g_key_file_set_integer(gkeyfile, "remmina_pref", "main_width", remmina_pref.main_width);
843  g_key_file_set_integer(gkeyfile, "remmina_pref", "main_height", remmina_pref.main_height);
844  g_key_file_set_boolean(gkeyfile, "remmina_pref", "main_maximize", remmina_pref.main_maximize);
845  g_key_file_set_integer(gkeyfile, "remmina_pref", "main_sort_column_id", remmina_pref.main_sort_column_id);
846  g_key_file_set_integer(gkeyfile, "remmina_pref", "main_sort_order", remmina_pref.main_sort_order);
847  g_key_file_set_string(gkeyfile, "remmina_pref", "expanded_group", remmina_pref.expanded_group);
848  g_key_file_set_boolean(gkeyfile, "remmina_pref", "toolbar_pin_down", remmina_pref.toolbar_pin_down);
849  g_key_file_set_integer(gkeyfile, "remmina_pref", "sshtunnel_port", remmina_pref.sshtunnel_port);
850  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepidle", remmina_pref.ssh_tcp_keepidle);
851  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepintvl", remmina_pref.ssh_tcp_keepintvl);
852  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepcnt", remmina_pref.ssh_tcp_keepcnt);
853  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_tcp_usrtimeout", remmina_pref.ssh_tcp_usrtimeout);
854  g_key_file_set_boolean(gkeyfile, "remmina_pref", "applet_new_ontop", remmina_pref.applet_new_ontop);
855  g_key_file_set_boolean(gkeyfile, "remmina_pref", "applet_hide_count", remmina_pref.applet_hide_count);
856  g_key_file_set_boolean(gkeyfile, "remmina_pref", "applet_enable_avahi", remmina_pref.applet_enable_avahi);
857  g_key_file_set_boolean(gkeyfile, "remmina_pref", "disable_tray_icon", remmina_pref.disable_tray_icon);
858  g_key_file_set_boolean(gkeyfile, "remmina_pref", "dark_theme", remmina_pref.dark_theme);
859  g_key_file_set_integer(gkeyfile, "remmina_pref", "recent_maximum", remmina_pref.recent_maximum);
860  g_key_file_set_integer(gkeyfile, "remmina_pref", "default_mode", remmina_pref.default_mode);
861  g_key_file_set_integer(gkeyfile, "remmina_pref", "tab_mode", remmina_pref.tab_mode);
862  g_key_file_set_integer(gkeyfile, "remmina_pref", "fullscreen_toolbar_visibility", remmina_pref.fullscreen_toolbar_visibility);
863  g_key_file_set_integer(gkeyfile, "remmina_pref", "auto_scroll_step", remmina_pref.auto_scroll_step);
864  g_key_file_set_integer(gkeyfile, "remmina_pref", "hostkey", remmina_pref.hostkey);
865  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_fullscreen", remmina_pref.shortcutkey_fullscreen);
866  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_autofit", remmina_pref.shortcutkey_autofit);
867  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_nexttab", remmina_pref.shortcutkey_nexttab);
868  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_prevtab", remmina_pref.shortcutkey_prevtab);
869  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_scale", remmina_pref.shortcutkey_scale);
870  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_grab", remmina_pref.shortcutkey_grab);
871  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_multimon", remmina_pref.shortcutkey_multimon);
872  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_viewonly", remmina_pref.shortcutkey_viewonly);
873  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_screenshot", remmina_pref.shortcutkey_screenshot);
874  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_minimize", remmina_pref.shortcutkey_minimize);
875  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_disconnect", remmina_pref.shortcutkey_disconnect);
876  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_toolbar", remmina_pref.shortcutkey_toolbar);
877  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_copy", remmina_pref.vte_shortcutkey_copy);
878  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_paste", remmina_pref.vte_shortcutkey_paste);
879  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_select_all", remmina_pref.vte_shortcutkey_select_all);
880  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_increase_font", remmina_pref.vte_shortcutkey_increase_font);
881  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_decrease_font", remmina_pref.vte_shortcutkey_decrease_font);
882  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_search_text", remmina_pref.vte_shortcutkey_search_text);
883  g_key_file_set_string(gkeyfile, "remmina_pref", "vte_font", remmina_pref.vte_font ? remmina_pref.vte_font : "");
884  g_key_file_set_string(gkeyfile, "remmina_pref", "grab_color", remmina_pref.grab_color ? remmina_pref.grab_color : "");
885  g_key_file_set_boolean(gkeyfile, "remmina_pref", "grab_color_switch", remmina_pref.grab_color_switch);
886  g_key_file_set_boolean(gkeyfile, "remmina_pref", "vte_allow_bold_text", remmina_pref.vte_allow_bold_text);
887  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_lines", remmina_pref.vte_lines);
888  g_key_file_set_string(gkeyfile, "ssh_colors", "background", remmina_pref.color_pref.background ? remmina_pref.color_pref.background : "");
889  g_key_file_set_string(gkeyfile, "ssh_colors", "cursor", remmina_pref.color_pref.cursor ? remmina_pref.color_pref.cursor : "");
890  g_key_file_set_string(gkeyfile, "ssh_colors", "cursor_foreground", remmina_pref.color_pref.cursor_foreground ? remmina_pref.color_pref.cursor_foreground : "");
891  g_key_file_set_string(gkeyfile, "ssh_colors", "highlight", remmina_pref.color_pref.highlight ? remmina_pref.color_pref.highlight : "");
892  g_key_file_set_string(gkeyfile, "ssh_colors", "highlight_foreground", remmina_pref.color_pref.highlight_foreground ? remmina_pref.color_pref.highlight_foreground : "");
893  g_key_file_set_string(gkeyfile, "ssh_colors", "colorBD", remmina_pref.color_pref.colorBD ? remmina_pref.color_pref.colorBD : "");
894  g_key_file_set_string(gkeyfile, "ssh_colors", "foreground", remmina_pref.color_pref.foreground ? remmina_pref.color_pref.foreground : "");
895  g_key_file_set_string(gkeyfile, "ssh_colors", "color0", remmina_pref.color_pref.color0 ? remmina_pref.color_pref.color0 : "");
896  g_key_file_set_string(gkeyfile, "ssh_colors", "color1", remmina_pref.color_pref.color1 ? remmina_pref.color_pref.color1 : "");
897  g_key_file_set_string(gkeyfile, "ssh_colors", "color2", remmina_pref.color_pref.color2 ? remmina_pref.color_pref.color2 : "");
898  g_key_file_set_string(gkeyfile, "ssh_colors", "color3", remmina_pref.color_pref.color3 ? remmina_pref.color_pref.color3 : "");
899  g_key_file_set_string(gkeyfile, "ssh_colors", "color4", remmina_pref.color_pref.color4 ? remmina_pref.color_pref.color4 : "");
900  g_key_file_set_string(gkeyfile, "ssh_colors", "color5", remmina_pref.color_pref.color5 ? remmina_pref.color_pref.color5 : "");
901  g_key_file_set_string(gkeyfile, "ssh_colors", "color6", remmina_pref.color_pref.color6 ? remmina_pref.color_pref.color6 : "");
902  g_key_file_set_string(gkeyfile, "ssh_colors", "color7", remmina_pref.color_pref.color7 ? remmina_pref.color_pref.color7 : "");
903  g_key_file_set_string(gkeyfile, "ssh_colors", "color8", remmina_pref.color_pref.color8 ? remmina_pref.color_pref.color8 : "");
904  g_key_file_set_string(gkeyfile, "ssh_colors", "color9", remmina_pref.color_pref.color9 ? remmina_pref.color_pref.color9 : "");
905  g_key_file_set_string(gkeyfile, "ssh_colors", "color10", remmina_pref.color_pref.color10 ? remmina_pref.color_pref.color10 : "");
906  g_key_file_set_string(gkeyfile, "ssh_colors", "color11", remmina_pref.color_pref.color11 ? remmina_pref.color_pref.color11 : "");
907  g_key_file_set_string(gkeyfile, "ssh_colors", "color12", remmina_pref.color_pref.color12 ? remmina_pref.color_pref.color12 : "");
908  g_key_file_set_string(gkeyfile, "ssh_colors", "color13", remmina_pref.color_pref.color13 ? remmina_pref.color_pref.color13 : "");
909  g_key_file_set_string(gkeyfile, "ssh_colors", "color14", remmina_pref.color_pref.color14 ? remmina_pref.color_pref.color14 : "");
910  g_key_file_set_string(gkeyfile, "ssh_colors", "color15", remmina_pref.color_pref.color15 ? remmina_pref.color_pref.color15 : "");
911 
912  /* Default settings */
913  g_key_file_set_string(gkeyfile, "remmina", "name", "");
914  g_key_file_set_integer(gkeyfile, "remmina", "ignore-tls-errors", 1);
915 
916  content = g_key_file_to_data(gkeyfile, &length, NULL);
917  g_file_set_contents(remmina_pref_file, content, length, &error);
918 
919  if (error != NULL) {
920  g_warning("remmina_pref_save error: %s", error->message);
921  g_clear_error(&error);
922  g_key_file_free(gkeyfile);
923  return FALSE;
924  }
925  g_key_file_free(gkeyfile);
926  return TRUE;
927 }
928 
929 void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
930 {
931  TRACE_CALL(__func__);
932  RemminaStringArray *array;
933  GKeyFile *gkeyfile;
934  gchar key[20];
935  g_autofree gchar *val = NULL;
936  g_autofree gchar *content = NULL;
937  gsize length;
938 
939  if (remmina_pref.recent_maximum <= 0 || server == NULL || server[0] == 0)
940  return;
941 
942  /* Load original value into memory */
943  gkeyfile = g_key_file_new();
944 
945  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
946 
947  g_snprintf(key, sizeof(key), "recent_%s", protocol);
948  array = remmina_string_array_new_from_allocated_string(g_key_file_get_string(gkeyfile, "remmina_pref", key, NULL));
949 
950  /* Add the new value */
951  remmina_string_array_remove(array, server);
952  while (array->len >= remmina_pref.recent_maximum)
954  remmina_string_array_add(array, server);
955 
956  /* Save */
957  val = remmina_string_array_to_string(array);
958  g_key_file_set_string(gkeyfile, "remmina_pref", key, val);
959 
960  content = g_key_file_to_data(gkeyfile, &length, NULL);
961  g_file_set_contents(remmina_pref_file, content, length, NULL);
962 
963  g_key_file_free(gkeyfile);
964 }
965 
966 gchar *
967 remmina_pref_get_recent(const gchar *protocol)
968 {
969  TRACE_CALL(__func__);
970  GKeyFile *gkeyfile;
971  gchar key[20];
972  gchar *val = NULL;
973 
974  gkeyfile = g_key_file_new();
975 
976  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
977 
978  g_snprintf(key, sizeof(key), "recent_%s", protocol);
979  val = g_key_file_get_string(gkeyfile, "remmina_pref", key, NULL);
980 
981  g_key_file_free(gkeyfile);
982 
983  return val;
984 }
985 
987 {
988  TRACE_CALL(__func__);
989  GKeyFile *gkeyfile;
990  gchar **keys;
991  gint i;
992  g_autofree gchar *content = NULL;
993  gsize length;
994 
995  gkeyfile = g_key_file_new();
996 
997  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
998  keys = g_key_file_get_keys(gkeyfile, "remmina_pref", NULL, NULL);
999  if (keys) {
1000  for (i = 0; keys[i]; i++)
1001  if (strncmp(keys[i], "recent_", 7) == 0)
1002  g_key_file_set_string(gkeyfile, "remmina_pref", keys[i], "");
1003  g_strfreev(keys);
1004  }
1005 
1006  content = g_key_file_to_data(gkeyfile, &length, NULL);
1007  g_file_set_contents(remmina_pref_file, content, length, NULL);
1008 
1009  g_key_file_free(gkeyfile);
1010 }
1011 
1012 guint *remmina_pref_keymap_get_table(const gchar *keymap)
1013 {
1014  TRACE_CALL(__func__);
1015 
1016  if (!keymap || keymap[0] == '\0')
1017  return NULL;
1018 
1019  return (guint *)g_hash_table_lookup(remmina_keymap_table, keymap);
1020 }
1021 
1022 guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
1023 {
1024  TRACE_CALL(__func__);
1025  guint *table;
1026  gint i;
1027 
1028  if (!keymap || keymap[0] == '\0')
1029  return keyval;
1030 
1031  table = (guint *)g_hash_table_lookup(remmina_keymap_table, keymap);
1032  if (!table)
1033  return keyval;
1034  for (i = 0; table[i] > 0; i += 2)
1035  if (table[i] == keyval)
1036  return table[i + 1];
1037  return keyval;
1038 }
1039 
1040 gchar **
1042 {
1043  TRACE_CALL(__func__);
1044  GList *list;
1045  guint len;
1046  gchar **keys;
1047  guint i;
1048 
1049  list = g_hash_table_get_keys(remmina_keymap_table);
1050  len = g_list_length(list);
1051 
1052  keys = g_new0(gchar *, (len + 1) * 2 + 1);
1053  keys[0] = g_strdup("");
1054  keys[1] = g_strdup("");
1055  for (i = 0; i < len; i++) {
1056  keys[(i + 1) * 2] = g_strdup((gchar *)g_list_nth_data(list, i));
1057  keys[(i + 1) * 2 + 1] = g_strdup((gchar *)g_list_nth_data(list, i));
1058  }
1059  g_list_free(list);
1060 
1061  return keys;
1062 }
1063 
1065 {
1066  TRACE_CALL(__func__);
1067  /* Paranoid programming */
1068  if (remmina_pref.scale_quality < 0)
1070  return remmina_pref.scale_quality;
1071 }
1072 
1074 {
1075  TRACE_CALL(__func__);
1076  return remmina_pref.ssh_loglevel;
1077 }
1078 
1080 {
1081  TRACE_CALL(__func__);
1083 }
1084 
1086 {
1087  TRACE_CALL(__func__);
1089 }
1090 
1092 {
1093  TRACE_CALL(__func__);
1095 }
1096 
1098 {
1099  TRACE_CALL(__func__);
1101 }
1102 
1104 {
1105  TRACE_CALL(__func__);
1107 }
1108 
1110 {
1111  TRACE_CALL(__func__);
1113 }
1114 
1115 void remmina_pref_set_value(const gchar *key, const gchar *value)
1116 {
1117  TRACE_CALL(__func__);
1118  GKeyFile *gkeyfile;
1119  gsize length;
1120 
1121  gkeyfile = g_key_file_new();
1122  if (g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL)) {
1123  g_key_file_set_string(gkeyfile, "remmina_pref", key, value);
1124  gchar *content = g_key_file_to_data(gkeyfile, &length, NULL);
1125  if (g_file_set_contents(remmina_pref_file, content, length, NULL)) {
1126  g_free(content);
1127  } else {
1128  REMMINA_WARNING("Cannot save Remmina preferences");
1129  REMMINA_WARNING("Key was \"%s\", and value \"%s\"", key, value);
1130  }
1131  g_key_file_free(gkeyfile);
1132  } else {
1133  REMMINA_WARNING("Cannot load Remmina preferences file");
1134  }
1135 }
1136 
1137 gchar *remmina_pref_get_value(const gchar *key)
1138 {
1139  TRACE_CALL(__func__);
1140  GKeyFile *gkeyfile;
1141  gchar *value = NULL;
1142 
1143  gkeyfile = g_key_file_new();
1144  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
1145  value = g_key_file_get_string(gkeyfile, "remmina_pref", key, NULL);
1146  g_key_file_free(gkeyfile);
1147 
1148  return value;
1149 }
1150 
1151 gboolean remmina_pref_get_boolean(const gchar *key)
1152 {
1153  TRACE_CALL(__func__);
1154  GKeyFile *gkeyfile;
1155  gboolean value;
1156 
1157  gkeyfile = g_key_file_new();
1158  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
1159  value = g_key_file_get_boolean(gkeyfile, "remmina_pref", key, NULL);
1160  g_key_file_free(gkeyfile);
1161 
1162  return value;
1163 }
guint shortcutkey_fullscreen
Definition: remmina_pref.h:175
+Go to the documentation of this file.
1 /*
2  * Remmina - The GTK+ Remote Desktop Client
3  * Copyright (C) 2009-2011 Vic Lee
4  * Copyright (C) 2014-2015 Antenore Gatta, Fabio Castelli, Giovanni Panozzo
5  * Copyright (C) 2016-2022 Antenore Gatta, Giovanni Panozzo
6  * Copyright (C) 2022-2023 Antenore Gatta, Giovanni Panozzo, Hiroyuki Tanaka
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  * In addition, as a special exception, the copyright holders give
24  * permission to link the code of portions of this program with the
25  * OpenSSL library under certain conditions as described in each
26  * individual source file, and distribute linked combinations
27  * including the two.
28  * You must obey the GNU General Public License in all respects
29  * for all of the code used other than OpenSSL. * If you modify
30  * file(s) with this exception, you may extend this exception to your
31  * version of the file(s), but you are not obligated to do so. * If you
32  * do not wish to do so, delete this exception statement from your
33  * version. * If you delete this exception statement from all source
34  * files in the program, then also delete it here.
35  *
36  */
37 
38 #include "config.h"
39 
40 #include <stdlib.h>
41 #include <string.h>
42 #include <unistd.h>
43 #include <sys/time.h>
44 #include <sys/utsname.h>
45 
46 #include <glib/gstdio.h>
47 #include <gdk/gdkkeysyms.h>
48 #include <gtk/gtk.h>
49 
50 #include "remmina_sodium.h"
51 
52 #include "remmina_public.h"
53 #include "remmina_string_array.h"
54 #include "remmina_pref.h"
55 #include "remmina_log.h"
57 
58 const gchar *default_resolutions = "640x480,800x600,1024x768,1152x864,1280x960,1400x1050,1920x1080";
59 const gchar *default_keystrokes = "Send hello world§hello world\\n";
60 
62 static GHashTable *remmina_keymap_table = NULL;
63 
64 /* We could customize this further if there are more requirements */
65 static const gchar *default_keymap_data = "# Please check gdk/gdkkeysyms.h for a full list of all key names or hex key values\n"
66  "\n"
67  "[Map Meta Keys]\n"
68  "Super_L = Meta_L\n"
69  "Super_R = Meta_R\n"
70  "Meta_L = Super_L\n"
71  "Meta_R = Super_R\n";
72 
73 static void remmina_pref_gen_secret(void)
74 {
75  TRACE_CALL(__func__);
76  guchar s[32];
77  gint i;
78  GKeyFile *gkeyfile;
79  g_autofree gchar *content = NULL;
80  gsize length;
81 
82  for (i = 0; i < 32; i++)
83  s[i] = (guchar)(randombytes_uniform(257));
84  remmina_pref.secret = g_base64_encode(s, 32);
85 
86  gkeyfile = g_key_file_new();
87  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
88  g_key_file_set_string(gkeyfile, "remmina_pref", "secret", remmina_pref.secret);
89  content = g_key_file_to_data(gkeyfile, &length, NULL);
90  g_file_set_contents(remmina_pref_file, content, length, NULL);
91 
92  g_key_file_free(gkeyfile);
93 }
94 
95 static guint remmina_pref_get_keyval_from_str(const gchar *str)
96 {
97  TRACE_CALL(__func__);
98  guint k;
99 
100  if (!str)
101  return 0;
102 
103  k = gdk_keyval_from_name(str);
104  if (!k)
105  if (sscanf(str, "%x", &k) < 1)
106  k = 0;
107  return k;
108 }
109 
110 static void remmina_pref_init_keymap(void)
111 {
112  TRACE_CALL(__func__);
113  GKeyFile *gkeyfile;
114  gchar **groups;
115  gchar **gptr;
116  gchar **keys;
117  gchar **kptr;
118  gsize nkeys;
119  g_autofree gchar *value = NULL;
120  guint *table;
121  guint *tableptr;
122  guint k1, k2;
123 
125  g_hash_table_destroy(remmina_keymap_table);
126  remmina_keymap_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
127 
128  gkeyfile = g_key_file_new();
129  if (!g_key_file_load_from_file(gkeyfile, remmina_keymap_file, G_KEY_FILE_NONE, NULL)) {
130  if (!g_key_file_load_from_data(gkeyfile, default_keymap_data, strlen(default_keymap_data), G_KEY_FILE_NONE,
131  NULL)) {
132  g_print("Failed to initialize keymap table\n");
133  g_key_file_free(gkeyfile);
134  return;
135  }
136  }
137 
138  groups = g_key_file_get_groups(gkeyfile, NULL);
139  gptr = groups;
140  while (*gptr) {
141  keys = g_key_file_get_keys(gkeyfile, *gptr, &nkeys, NULL);
142  table = g_new0(guint, nkeys * 2 + 1);
143  g_hash_table_insert(remmina_keymap_table, g_strdup(*gptr), table);
144 
145  kptr = keys;
146  tableptr = table;
147  while (*kptr) {
149  if (k1) {
150  value = g_key_file_get_string(gkeyfile, *gptr, *kptr, NULL);
152  *tableptr++ = k1;
153  *tableptr++ = k2;
154  }
155  kptr++;
156  }
157  g_strfreev(keys);
158  gptr++;
159  }
160  g_strfreev(groups);
161  g_key_file_free(gkeyfile);
162 }
163 
165 static gboolean remmina_pref_file_do_copy(const char *src_path, const char *dst_path)
166 {
167  GFile *src = g_file_new_for_path(src_path), *dst = g_file_new_for_path(dst_path);
168  /* We don’t overwrite the target if it exists, because overwrite is not set */
169  const gboolean ok = g_file_copy(src, dst, G_FILE_COPY_NONE, NULL, NULL, NULL, NULL);
170 
171  g_object_unref(dst);
172  g_object_unref(src);
173 
174  return ok;
175 }
176 
177 void remmina_pref_file_load_colors(GKeyFile *gkeyfile, RemminaColorPref *color_pref)
178 {
179  const struct {
180  const char * name;
181  char ** setting;
182  char * fallback;
183  } colors[] = {
184  { "background", &color_pref->background, "#d5ccba" },
185  { "cursor", &color_pref->cursor, "#45373c" },
186  { "cursor_foreground", &color_pref->cursor_foreground, "#d5ccba" },
187  { "highlight", &color_pref->highlight, "#45373c" },
188  { "highlight_foreground", &color_pref->highlight_foreground, "#d5ccba" },
189  { "colorBD", &color_pref->colorBD, "#45373c" },
190  { "foreground", &color_pref->foreground, "#45373c" },
191  { "color0", &color_pref->color0, "#20111b" },
192  { "color1", &color_pref->color1, "#be100e" },
193  { "color2", &color_pref->color2, "#858162" },
194  { "color3", &color_pref->color3, "#eaa549" },
195  { "color4", &color_pref->color4, "#426a79" },
196  { "color5", &color_pref->color5, "#97522c" },
197  { "color6", &color_pref->color6, "#989a9c" },
198  { "color7", &color_pref->color7, "#968c83" },
199  { "color8", &color_pref->color8, "#5e5252" },
200  { "color9", &color_pref->color9, "#be100e" },
201  { "color10", &color_pref->color10, "#858162" },
202  { "color11", &color_pref->color11, "#eaa549" },
203  { "color12", &color_pref->color12, "#426a79" },
204  { "color13", &color_pref->color13, "#97522c" },
205  { "color14", &color_pref->color14, "#989a9c" },
206  { "color15", &color_pref->color15, "#d5ccba" },
207  };
208 
209  int i;
210 
211  for (i = 0; i < (sizeof(colors) / sizeof(colors[0])); i++) {
212  if (g_key_file_has_key(gkeyfile, "ssh_colors", colors[i].name, NULL))
213  *colors[i].setting = g_key_file_get_string(gkeyfile, "ssh_colors", colors[i].name,
214  NULL);
215  else
216  *colors[i].setting = colors[i].fallback;
217  }
218 }
219 
221 {
222  TRACE_CALL(__func__);
223  GKeyFile *gkeyfile;
224  gchar *remmina_dir, *remmina_pref_path, *user_config_path;
225  const gchar *filename = "remmina.pref";
226  const gchar *colors_filename = "remmina.colors";
227  g_autofree gchar *remmina_colors_file = NULL;
228  GDir *dir;
229  const gchar *legacy = ".remmina";
230  int i;
231 
232  remmina_dir = g_build_path("/", g_get_user_config_dir(), "remmina", NULL);
233  /* Create the XDG_CONFIG_HOME directory */
234  g_mkdir_with_parents(remmina_dir, 0750);
235 
236  g_free(remmina_dir), remmina_dir = NULL;
237  /* Legacy ~/.remmina we copy the existing remmina.pref file inside
238  * XDG_CONFIG_HOME */
239  remmina_dir = g_build_path("/", g_get_home_dir(), legacy, NULL);
240  if (g_file_test(remmina_dir, G_FILE_TEST_IS_DIR)) {
241  dir = g_dir_open(remmina_dir, 0, NULL);
242  remmina_pref_path = g_build_path("/", remmina_dir, filename, NULL);
243  user_config_path = g_build_path("/", g_get_user_config_dir(),
244  "remmina", filename, NULL);
245  remmina_pref_file_do_copy(remmina_pref_path, user_config_path);
246  g_dir_close(dir);
247  }
248 
249  /* /usr/local/etc/remmina */
250  const gchar *const *dirs = g_get_system_config_dirs();
251 
252  g_free(remmina_dir), remmina_dir = NULL;
253  for (i = 0; dirs[i] != NULL; ++i) {
254  remmina_dir = g_build_path("/", dirs[i], "remmina", NULL);
255  if (g_file_test(remmina_dir, G_FILE_TEST_IS_DIR)) {
256  dir = g_dir_open(remmina_dir, 0, NULL);
257  while ((filename = g_dir_read_name(dir)) != NULL) {
258  remmina_pref_path = g_build_path("/", remmina_dir, filename, NULL);
259  user_config_path = g_build_path("/", g_get_user_config_dir(),
260  "remmina", filename, NULL);
261  remmina_pref_file_do_copy(remmina_pref_path, user_config_path);
262  }
263  g_free(remmina_dir), remmina_dir = NULL;
264  }
265  }
266 
267  g_free(remmina_pref_path);
268  g_free(user_config_path);
269 
270  /* The last case we use the home ~/.config/remmina */
271  if (remmina_dir != NULL)
272  g_free(remmina_dir), remmina_dir = NULL;
273  remmina_dir = g_build_path("/", g_get_user_config_dir(),
274  "remmina", NULL);
275 
276  remmina_pref_file = g_strdup_printf("%s/remmina.pref", remmina_dir);
277  /* remmina.colors */
278  remmina_colors_file = g_strdup_printf("%s/%s", remmina_dir, colors_filename);
279 
280  remmina_keymap_file = g_strdup_printf("%s/remmina.keymap", remmina_dir);
281 
282  g_free(remmina_dir);
283 
284  gkeyfile = g_key_file_new();
285 
286  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
287 
288  if (g_key_file_has_key(gkeyfile, "remmina_pref", "save_view_mode", NULL))
289  remmina_pref.save_view_mode = g_key_file_get_boolean(gkeyfile, "remmina_pref", "save_view_mode", NULL);
290  else
292 
293  if (g_key_file_has_key(gkeyfile, "remmina_pref", "confirm_close", NULL))
294  remmina_pref.confirm_close = g_key_file_get_boolean(gkeyfile, "remmina_pref", "confirm_close", NULL);
295  else
297 
298  if (extrahardening)
299  remmina_pref.confirm_close = FALSE;
300 
301  if (g_key_file_has_key(gkeyfile, "remmina_pref", "use_master_password", NULL)) {
302  remmina_pref.use_primary_password = g_key_file_get_boolean(gkeyfile, "remmina_pref", "use_master_password", NULL);
303  } else if (g_key_file_has_key(gkeyfile, "remmina_pref", "use_primary_password", NULL))
304  remmina_pref.use_primary_password = g_key_file_get_boolean(gkeyfile, "remmina_pref", "use_primary_password", NULL);
305  else
307 
308  if (g_key_file_has_key(gkeyfile, "remmina_pref", "unlock_timeout", NULL))
309  remmina_pref.unlock_timeout = g_key_file_get_integer(gkeyfile, "remmina_pref", "unlock_timeout", NULL);
310  else
312 
313  if (g_key_file_has_key(gkeyfile, "remmina_pref", "unlock_password", NULL))
314  remmina_pref.unlock_password = g_key_file_get_string(gkeyfile, "remmina_pref", "unlock_password", NULL);
315  else
316  remmina_pref.unlock_password = g_strdup("");
317 
318  if (g_key_file_has_key(gkeyfile, "remmina_pref", "lock_connect", NULL))
319  remmina_pref.lock_connect = g_key_file_get_boolean(gkeyfile, "remmina_pref", "lock_connect", NULL);
320  else
321  remmina_pref.lock_connect = FALSE;
322 
323  if (g_key_file_has_key(gkeyfile, "remmina_pref", "lock_edit", NULL))
324  remmina_pref.lock_edit = g_key_file_get_boolean(gkeyfile, "remmina_pref", "lock_edit", NULL);
325  else
326  remmina_pref.lock_edit = FALSE;
327 
328 
329  if (g_key_file_has_key(gkeyfile, "remmina_pref", "lock_view_passwords", NULL))
330  remmina_pref.lock_view_passwords = g_key_file_get_boolean(gkeyfile, "remmina_pref", "lock_view_passwords", NULL);
331  else
333 
334  if (g_key_file_has_key(gkeyfile, "remmina_pref", "enc_mode", NULL))
335  remmina_pref.enc_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "enc_mode", NULL);
336  else
338 
339  if (g_key_file_has_key(gkeyfile, "remmina_pref", "audit", NULL))
340  remmina_pref.audit = g_key_file_get_boolean(gkeyfile, "remmina_pref", "audit", NULL);
341  else
342  remmina_pref.audit = FALSE;
343 
344  if (g_key_file_has_key(gkeyfile, "remmina_pref", "trust_all", NULL))
345  remmina_pref.trust_all = g_key_file_get_boolean(gkeyfile, "remmina_pref", "trust_all", NULL);
346  else
347  remmina_pref.trust_all = FALSE;
348 
349  if (g_key_file_has_key(gkeyfile, "remmina_pref", "fullscreen_on_auto", NULL))
350  remmina_pref.fullscreen_on_auto = g_key_file_get_boolean(gkeyfile, "remmina_pref", "fullscreen_on_auto", NULL);
351  else
353 
354  if (g_key_file_has_key(gkeyfile, "remmina_pref", "floating_toolbar_placement", NULL))
355  remmina_pref.floating_toolbar_placement = g_key_file_get_integer(gkeyfile, "remmina_pref", "floating_toolbar_placement", NULL);
356  else
358 
359  if (g_key_file_has_key(gkeyfile, "remmina_pref", "prevent_snap_welcome_message", NULL))
360  remmina_pref.prevent_snap_welcome_message = g_key_file_get_boolean(gkeyfile, "remmina_pref", "prevent_snap_welcome_message", NULL);
361  else
363 
364  if (g_key_file_has_key(gkeyfile, "remmina_pref", "last_quickconnect_protocol", NULL))
365  remmina_pref.last_quickconnect_protocol = g_key_file_get_string(gkeyfile, "remmina_pref", "last_quickconnect_protocol", NULL);
366  else
368 
369  if (g_key_file_has_key(gkeyfile, "remmina_pref", "toolbar_placement", NULL))
370  remmina_pref.toolbar_placement = g_key_file_get_integer(gkeyfile, "remmina_pref", "toolbar_placement", NULL);
371  else
373 
374  if (g_key_file_has_key(gkeyfile, "remmina_pref", "always_show_tab", NULL))
375  remmina_pref.always_show_tab = g_key_file_get_boolean(gkeyfile, "remmina_pref", "always_show_tab", NULL);
376  else
378 
379  if (extrahardening)
381 
382  if (g_key_file_has_key(gkeyfile, "remmina_pref", "always_show_notes", NULL))
383  remmina_pref.always_show_notes = g_key_file_get_boolean(gkeyfile, "remmina_pref", "always_show_notes", NULL);
384  else
386 
387  if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_connection_toolbar", NULL))
388  remmina_pref.hide_connection_toolbar = g_key_file_get_boolean(gkeyfile, "remmina_pref",
389  "hide_connection_toolbar", NULL);
390  else
392 
393  if (disabletoolbar)
395 
396  if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_searchbar", NULL))
397  remmina_pref.hide_searchbar = g_key_file_get_boolean(gkeyfile, "remmina_pref",
398  "hide_searchbar", NULL);
399  else
401 
402  if (extrahardening)
404 
405  if (g_key_file_has_key(gkeyfile, "remmina_pref", "default_action", NULL))
406  remmina_pref.default_action = g_key_file_get_integer(gkeyfile, "remmina_pref", "default_action", NULL);
407  else
409 
410  if (g_key_file_has_key(gkeyfile, "remmina_pref", "scale_quality", NULL))
411  remmina_pref.scale_quality = g_key_file_get_integer(gkeyfile, "remmina_pref", "scale_quality", NULL);
412  else
413  remmina_pref.scale_quality = GDK_INTERP_HYPER;
414 
415  if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_toolbar", NULL))
416  remmina_pref.hide_toolbar = g_key_file_get_boolean(gkeyfile, "remmina_pref", "hide_toolbar", NULL);
417  else
418  remmina_pref.hide_toolbar = FALSE;
419 
420  if (g_key_file_has_key(gkeyfile, "remmina_pref", "small_toolbutton", NULL))
421  remmina_pref.small_toolbutton = g_key_file_get_boolean(gkeyfile, "remmina_pref", "small_toolbutton", NULL);
422  else
424 
425  if (g_key_file_has_key(gkeyfile, "remmina_pref", "view_file_mode", NULL))
426  remmina_pref.view_file_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "view_file_mode", NULL);
427  else
429 
430  if (g_key_file_has_key(gkeyfile, "remmina_pref", "resolutions", NULL))
431  remmina_pref.resolutions = g_key_file_get_string(gkeyfile, "remmina_pref", "resolutions", NULL);
432  else
434 
435  if (g_key_file_has_key(gkeyfile, "remmina_pref", "keystrokes", NULL))
436  remmina_pref.keystrokes = g_key_file_get_string(gkeyfile, "remmina_pref", "keystrokes", NULL);
437  else
439 
440  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_width", NULL))
441  remmina_pref.main_width = MAX(600, g_key_file_get_integer(gkeyfile, "remmina_pref", "main_width", NULL));
442  else
443  remmina_pref.main_width = 600;
444 
445  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_height", NULL))
446  remmina_pref.main_height = MAX(400, g_key_file_get_integer(gkeyfile, "remmina_pref", "main_height", NULL));
447  else
449 
450  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_maximize", NULL))
451  remmina_pref.main_maximize = g_key_file_get_boolean(gkeyfile, "remmina_pref", "main_maximize", NULL);
452  else
453  remmina_pref.main_maximize = FALSE;
454 
455  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_sort_column_id", NULL))
456  remmina_pref.main_sort_column_id = g_key_file_get_integer(gkeyfile, "remmina_pref", "main_sort_column_id",
457  NULL);
458  else
460 
461  if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_sort_order", NULL))
462  remmina_pref.main_sort_order = g_key_file_get_integer(gkeyfile, "remmina_pref", "main_sort_order", NULL);
463  else
465 
466  if (g_key_file_has_key(gkeyfile, "remmina_pref", "expanded_group", NULL))
467  remmina_pref.expanded_group = g_key_file_get_string(gkeyfile, "remmina_pref", "expanded_group", NULL);
468  else
469  remmina_pref.expanded_group = g_strdup("");
470 
471  if (g_key_file_has_key(gkeyfile, "remmina_pref", "toolbar_pin_down", NULL))
472  remmina_pref.toolbar_pin_down = g_key_file_get_boolean(gkeyfile, "remmina_pref", "toolbar_pin_down", NULL);
473  else
475 
476  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_loglevel", NULL))
477  remmina_pref.ssh_loglevel = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_loglevel", NULL);
478  else
479  remmina_pref.ssh_loglevel = DEFAULT_SSH_LOGLEVEL;
480 
481  if (g_key_file_has_key(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", NULL))
482  remmina_pref.deny_screenshot_clipboard = g_key_file_get_boolean(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", NULL);
483  else
485 
486  if (g_key_file_has_key(gkeyfile, "remmina_pref", "datadir_path", NULL))
487  remmina_pref.datadir_path = g_key_file_get_string(gkeyfile, "remmina_pref", "datadir_path", NULL);
488  else
489  remmina_pref.datadir_path = g_strdup("");
490 
491  if (g_key_file_has_key(gkeyfile, "remmina_pref", "remmina_file_name", NULL))
492  remmina_pref.remmina_file_name = g_key_file_get_string(gkeyfile, "remmina_pref", "remmina_file_name", NULL);
493  else
494  remmina_pref.remmina_file_name = g_strdup("%G_%P_%N_%h");
495 
496  if (g_key_file_has_key(gkeyfile, "remmina_pref", "screenshot_path", NULL)) {
497  remmina_pref.screenshot_path = g_key_file_get_string(gkeyfile, "remmina_pref", "screenshot_path", NULL);
498  } else {
499  remmina_pref.screenshot_path = g_get_user_special_dir(G_USER_DIRECTORY_PICTURES);
500  if (remmina_pref.screenshot_path == NULL)
501  remmina_pref.screenshot_path = g_get_home_dir();
502  }
503 
504  if (g_key_file_has_key(gkeyfile, "remmina_pref", "screenshot_name", NULL))
505  remmina_pref.screenshot_name = g_key_file_get_string(gkeyfile, "remmina_pref", "screenshot_name", NULL);
506  else
507  remmina_pref.screenshot_name = g_strdup("remmina_%p_%h_%Y%m%d-%H%M%S");
508 
509  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_parseconfig", NULL))
510  remmina_pref.ssh_parseconfig = g_key_file_get_boolean(gkeyfile, "remmina_pref", "ssh_parseconfig", NULL);
511  else
512  remmina_pref.ssh_parseconfig = DEFAULT_SSH_PARSECONFIG;
513 
514  if (g_key_file_has_key(gkeyfile, "remmina_pref", "sshtunnel_port", NULL))
515  remmina_pref.sshtunnel_port = g_key_file_get_integer(gkeyfile, "remmina_pref", "sshtunnel_port", NULL);
516  else
517  remmina_pref.sshtunnel_port = DEFAULT_SSHTUNNEL_PORT;
518 
519  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_tcp_keepidle", NULL))
520  remmina_pref.ssh_tcp_keepidle = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepidle", NULL);
521  else
522  remmina_pref.ssh_tcp_keepidle = SSH_SOCKET_TCP_KEEPIDLE;
523 
524  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_tcp_keepintvl", NULL))
525  remmina_pref.ssh_tcp_keepintvl = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepintvl", NULL);
526  else
527  remmina_pref.ssh_tcp_keepintvl = SSH_SOCKET_TCP_KEEPINTVL;
528 
529  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_tcp_keepcnt", NULL))
530  remmina_pref.ssh_tcp_keepcnt = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepcnt", NULL);
531  else
532  remmina_pref.ssh_tcp_keepcnt = SSH_SOCKET_TCP_KEEPCNT;
533 
534  if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_tcp_usrtimeout", NULL))
535  remmina_pref.ssh_tcp_usrtimeout = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_tcp_usrtimeout", NULL);
536  else
537  remmina_pref.ssh_tcp_usrtimeout = SSH_SOCKET_TCP_USER_TIMEOUT;
538 
539  if (g_key_file_has_key(gkeyfile, "remmina_pref", "applet_new_ontop", NULL))
540  remmina_pref.applet_new_ontop = g_key_file_get_boolean(gkeyfile, "remmina_pref", "applet_new_ontop", NULL);
541  else
543 
544  if (g_key_file_has_key(gkeyfile, "remmina_pref", "applet_hide_count", NULL))
545  remmina_pref.applet_hide_count = g_key_file_get_boolean(gkeyfile, "remmina_pref", "applet_hide_count", NULL);
546  else
548 
549  if (g_key_file_has_key(gkeyfile, "remmina_pref", "applet_enable_avahi", NULL))
550  remmina_pref.applet_enable_avahi = g_key_file_get_boolean(gkeyfile, "remmina_pref", "applet_enable_avahi",
551  NULL);
552  else
554 
555  if (g_key_file_has_key(gkeyfile, "remmina_pref", "disable_tray_icon", NULL))
556  remmina_pref.disable_tray_icon = g_key_file_get_boolean(gkeyfile, "remmina_pref", "disable_tray_icon", NULL);
557  else
559 
560  if (disabletrayicon)
562 
563  if (g_key_file_has_key(gkeyfile, "remmina_pref", "dark_theme", NULL))
564  remmina_pref.dark_theme = g_key_file_get_boolean(gkeyfile, "remmina_pref", "dark_theme", NULL);
565  else
566  remmina_pref.dark_theme = FALSE;
567 
568  if (g_key_file_has_key(gkeyfile, "remmina_pref", "list_refresh_workaround", NULL))
569  remmina_pref.list_refresh_workaround = g_key_file_get_boolean(gkeyfile, "remmina_pref", "list_refresh_workaround", NULL);
570  else
572 
573  if (g_key_file_has_key(gkeyfile, "remmina_pref", "grab_color_switch", NULL))
574  remmina_pref.grab_color_switch = g_key_file_get_boolean(gkeyfile, "remmina_pref", "grab_color_switch", NULL);
575  else
577 
578  if (g_key_file_has_key(gkeyfile, "remmina_pref", "grab_color", NULL))
579  remmina_pref.grab_color = g_key_file_get_string(gkeyfile, "remmina_pref", "grab_color", NULL);
580  else
581  remmina_pref.grab_color = "#00ff00";
582 
583  if (g_key_file_has_key(gkeyfile, "remmina_pref", "recent_maximum", NULL))
584  remmina_pref.recent_maximum = g_key_file_get_integer(gkeyfile, "remmina_pref", "recent_maximum", NULL);
585  else
587 
588  if (g_key_file_has_key(gkeyfile, "remmina_pref", "default_mode", NULL))
589  remmina_pref.default_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "default_mode", NULL);
590  else
592 
593  if (fullscreen)
595 
596  if (g_key_file_has_key(gkeyfile, "remmina_pref", "tab_mode", NULL))
597  remmina_pref.tab_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "tab_mode", NULL);
598  else
600 
601  if (g_key_file_has_key(gkeyfile, "remmina_pref", "fullscreen_toolbar_visibility", NULL))
602  remmina_pref.fullscreen_toolbar_visibility = g_key_file_get_integer(gkeyfile, "remmina_pref", "fullscreen_toolbar_visibility", NULL);
603  else
605 
606  if (disabletoolbar)
608 
609  if (g_key_file_has_key(gkeyfile, "remmina_pref", "auto_scroll_step", NULL))
610  remmina_pref.auto_scroll_step = g_key_file_get_integer(gkeyfile, "remmina_pref", "auto_scroll_step", NULL);
611  else
613 
614  if (g_key_file_has_key(gkeyfile, "remmina_pref", "hostkey", NULL))
615  remmina_pref.hostkey = g_key_file_get_integer(gkeyfile, "remmina_pref", "hostkey", NULL);
616  else
617  remmina_pref.hostkey = GDK_KEY_Control_R;
618 
619  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_fullscreen", NULL))
620  remmina_pref.shortcutkey_fullscreen = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_fullscreen",
621  NULL);
622  else
624 
625  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_autofit", NULL))
626  remmina_pref.shortcutkey_autofit = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_autofit",
627  NULL);
628  else
629  remmina_pref.shortcutkey_autofit = GDK_KEY_1;
630 
631  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_nexttab", NULL))
632  remmina_pref.shortcutkey_nexttab = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_nexttab",
633  NULL);
634  else
635  remmina_pref.shortcutkey_nexttab = GDK_KEY_Right;
636 
637  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_prevtab", NULL))
638  remmina_pref.shortcutkey_prevtab = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_prevtab",
639  NULL);
640  else
641  remmina_pref.shortcutkey_prevtab = GDK_KEY_Left;
642 
643  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_scale", NULL))
644  remmina_pref.shortcutkey_scale = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_scale", NULL);
645  else
646  remmina_pref.shortcutkey_scale = GDK_KEY_s;
647 
648  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_viewonly", NULL))
649  remmina_pref.shortcutkey_viewonly = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_viewonly", NULL);
650  else
652 
653  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_multimon", NULL))
654  remmina_pref.shortcutkey_multimon = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_multimon", NULL);
655  else
656  remmina_pref.shortcutkey_multimon = GDK_KEY_Page_Up;
657 
658  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_grab", NULL))
659  remmina_pref.shortcutkey_grab = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_grab", NULL);
660  else
661  remmina_pref.shortcutkey_grab = GDK_KEY_Control_R;
662 
663  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_minimize", NULL))
664  remmina_pref.shortcutkey_minimize = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_minimize", NULL);
665  else
666  remmina_pref.shortcutkey_minimize = GDK_KEY_F9;
667 
668  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_screenshot", NULL))
669  remmina_pref.shortcutkey_screenshot = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_screenshot", NULL);
670  else
671  remmina_pref.shortcutkey_screenshot = GDK_KEY_F12;
672 
673  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_disconnect", NULL))
674  remmina_pref.shortcutkey_disconnect = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_disconnect",
675  NULL);
676  else
678 
679  if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_toolbar", NULL))
680  remmina_pref.shortcutkey_toolbar = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_toolbar",
681  NULL);
682  else
683  remmina_pref.shortcutkey_toolbar = GDK_KEY_t;
684 
685  if (g_key_file_has_key(gkeyfile, "remmina_pref", "secret", NULL))
686  remmina_pref.secret = g_key_file_get_string(gkeyfile, "remmina_pref", "secret", NULL);
687  else
688  remmina_pref.secret = NULL;
689 
690  if (g_key_file_has_key(gkeyfile, "remmina_pref", "uid", NULL))
691  remmina_pref.uid = g_key_file_get_string(gkeyfile, "remmina_pref", "uid", NULL);
692  else
693  remmina_pref.uid = NULL;
694 
695  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_font", NULL))
696  remmina_pref.vte_font = g_key_file_get_string(gkeyfile, "remmina_pref", "vte_font", NULL);
697  else
699 
700  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_allow_bold_text", NULL))
701  remmina_pref.vte_allow_bold_text = g_key_file_get_boolean(gkeyfile, "remmina_pref", "vte_allow_bold_text",
702  NULL);
703  else
705 
706  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_lines", NULL))
707  remmina_pref.vte_lines = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_lines", NULL);
708  else
709  remmina_pref.vte_lines = 512;
710 
711  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_copy", NULL))
712  remmina_pref.vte_shortcutkey_copy = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_copy",
713  NULL);
714  else
716 
717  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_paste", NULL))
718  remmina_pref.vte_shortcutkey_paste = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_paste",
719  NULL);
720  else
722 
723  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_select_all", NULL))
724  remmina_pref.vte_shortcutkey_select_all = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_select_all",
725  NULL);
726  else
728 
729  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_increase_font", NULL))
730  remmina_pref.vte_shortcutkey_increase_font = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_increase_font",
731  NULL);
732  else
734 
735  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_decrease_font", NULL))
736  remmina_pref.vte_shortcutkey_decrease_font = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_decrease_font",
737  NULL);
738  else
739  remmina_pref.vte_shortcutkey_decrease_font = GDK_KEY_Page_Down;
740 
741  if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_search_text", NULL))
742  remmina_pref.vte_shortcutkey_search_text = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_search_text",
743  NULL);
744  else
746 
747 
749 
750  /* If we have a color scheme file, we switch to it, GIO will merge it in the
751  * remmina.pref file */
752  if (g_file_test(remmina_colors_file, G_FILE_TEST_IS_REGULAR)) {
753  g_key_file_load_from_file(gkeyfile, remmina_colors_file, G_KEY_FILE_NONE, NULL);
754  g_remove(remmina_colors_file);
755  }
756 
757  /* Default settings */
758  if (!g_key_file_has_key(gkeyfile, "remmina", "name", NULL)) {
759  g_key_file_set_string(gkeyfile, "remmina", "name", "");
760  g_key_file_set_integer(gkeyfile, "remmina", "ignore-tls-errors", 1);
761  g_key_file_set_integer(gkeyfile, "remmina", "enable-plugins", 1);
763  }
764 
765  g_key_file_free(gkeyfile);
766 
767  if (remmina_pref.secret == NULL)
769 
771 }
772 
773 gboolean remmina_pref_is_rw(void)
774 {
775  TRACE_CALL(__func__);
776  if (access(remmina_pref_file, W_OK) == 0)
777  return TRUE;
778  else
779  return FALSE;
780  return FALSE;
781 }
782 
783 gboolean remmina_pref_save(void)
784 {
785  TRACE_CALL(__func__);
786 
787  if (remmina_pref_is_rw() == FALSE) {
788  g_debug("remmina.pref is not writable, returning");
789  return FALSE;
790  }
791  GKeyFile *gkeyfile;
792  GError *error = NULL;
793  g_autofree gchar *content = NULL;
794  gsize length;
795 
796  gkeyfile = g_key_file_new();
797 
798  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
799 
800  g_key_file_set_string(gkeyfile, "remmina_pref", "datadir_path", remmina_pref.datadir_path);
801  g_key_file_set_string(gkeyfile, "remmina_pref", "remmina_file_name", remmina_pref.remmina_file_name);
802  g_key_file_set_string(gkeyfile, "remmina_pref", "screenshot_path", remmina_pref.screenshot_path);
803  g_key_file_set_string(gkeyfile, "remmina_pref", "screenshot_name", remmina_pref.screenshot_name);
804  g_key_file_set_boolean(gkeyfile, "remmina_pref", "deny_screenshot_clipboard", remmina_pref.deny_screenshot_clipboard);
805  g_key_file_set_boolean(gkeyfile, "remmina_pref", "save_view_mode", remmina_pref.save_view_mode);
806  g_key_file_set_boolean(gkeyfile, "remmina_pref", "confirm_close", remmina_pref.confirm_close);
807  if (g_key_file_remove_key(gkeyfile, "remmina_pref", "use_master_password", NULL))
808  REMMINA_DEBUG("use_master_password removed…");
809  else
810  REMMINA_INFO("use_master_password already migrated");
811 #if SODIUM_VERSION_INT >= 90200
812  g_key_file_set_boolean(gkeyfile, "remmina_pref", "use_primary_password", remmina_pref.use_primary_password);
813  g_key_file_set_integer(gkeyfile, "remmina_pref", "unlock_timeout", remmina_pref.unlock_timeout);
814  g_key_file_set_string(gkeyfile, "remmina_pref", "unlock_password", remmina_pref.unlock_password);
815  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_connect", remmina_pref.lock_connect);
816  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_edit", remmina_pref.lock_edit);
817  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_view_passwords", remmina_pref.lock_view_passwords);
818 #else
819  g_key_file_set_boolean(gkeyfile, "remmina_pref", "use_primary_password", FALSE);
820  g_key_file_set_integer(gkeyfile, "remmina_pref", "unlock_timeout", 0);
821  g_key_file_set_string(gkeyfile, "remmina_pref", "unlock_password", g_strdup(""));
822  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_connect", FALSE);
823  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_edit", FALSE);
824  g_key_file_set_boolean(gkeyfile, "remmina_pref", "lock_view_passwords", FALSE);
825 #endif
826  g_key_file_set_integer(gkeyfile, "remmina_pref", "enc_mode", remmina_pref.enc_mode);
827  g_key_file_set_boolean(gkeyfile, "remmina_pref", "audit", remmina_pref.audit);
828  g_key_file_set_boolean(gkeyfile, "remmina_pref", "trust_all", remmina_pref.trust_all);
829  g_key_file_set_integer(gkeyfile, "remmina_pref", "floating_toolbar_placement", remmina_pref.floating_toolbar_placement);
830  g_key_file_set_integer(gkeyfile, "remmina_pref", "toolbar_placement", remmina_pref.toolbar_placement);
831  g_key_file_set_boolean(gkeyfile, "remmina_pref", "prevent_snap_welcome_message", remmina_pref.prevent_snap_welcome_message);
832  g_key_file_set_string(gkeyfile, "remmina_pref", "last_quickconnect_protocol", remmina_pref.last_quickconnect_protocol);
833  g_key_file_set_boolean(gkeyfile, "remmina_pref", "fullscreen_on_auto", remmina_pref.fullscreen_on_auto);
834  g_key_file_set_boolean(gkeyfile, "remmina_pref", "always_show_tab", remmina_pref.always_show_tab);
835  g_key_file_set_boolean(gkeyfile, "remmina_pref", "always_show_notes", remmina_pref.always_show_notes);
836  g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_connection_toolbar", remmina_pref.hide_connection_toolbar);
837  g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_searchbar", remmina_pref.hide_searchbar);
838  g_key_file_set_integer(gkeyfile, "remmina_pref", "default_action", remmina_pref.default_action);
839  g_key_file_set_integer(gkeyfile, "remmina_pref", "scale_quality", remmina_pref.scale_quality);
840  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_loglevel", remmina_pref.ssh_loglevel);
841  g_key_file_set_boolean(gkeyfile, "remmina_pref", "ssh_parseconfig", remmina_pref.ssh_parseconfig);
842  g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_toolbar", remmina_pref.hide_toolbar);
843  g_key_file_set_boolean(gkeyfile, "remmina_pref", "small_toolbutton", remmina_pref.small_toolbutton);
844  g_key_file_set_integer(gkeyfile, "remmina_pref", "view_file_mode", remmina_pref.view_file_mode);
845  g_key_file_set_string(gkeyfile, "remmina_pref", "resolutions", remmina_pref.resolutions);
846  g_key_file_set_string(gkeyfile, "remmina_pref", "keystrokes", remmina_pref.keystrokes);
847  g_key_file_set_integer(gkeyfile, "remmina_pref", "main_width", remmina_pref.main_width);
848  g_key_file_set_integer(gkeyfile, "remmina_pref", "main_height", remmina_pref.main_height);
849  g_key_file_set_boolean(gkeyfile, "remmina_pref", "main_maximize", remmina_pref.main_maximize);
850  g_key_file_set_integer(gkeyfile, "remmina_pref", "main_sort_column_id", remmina_pref.main_sort_column_id);
851  g_key_file_set_integer(gkeyfile, "remmina_pref", "main_sort_order", remmina_pref.main_sort_order);
852  g_key_file_set_string(gkeyfile, "remmina_pref", "expanded_group", remmina_pref.expanded_group);
853  g_key_file_set_boolean(gkeyfile, "remmina_pref", "toolbar_pin_down", remmina_pref.toolbar_pin_down);
854  g_key_file_set_integer(gkeyfile, "remmina_pref", "sshtunnel_port", remmina_pref.sshtunnel_port);
855  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepidle", remmina_pref.ssh_tcp_keepidle);
856  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepintvl", remmina_pref.ssh_tcp_keepintvl);
857  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_tcp_keepcnt", remmina_pref.ssh_tcp_keepcnt);
858  g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_tcp_usrtimeout", remmina_pref.ssh_tcp_usrtimeout);
859  g_key_file_set_boolean(gkeyfile, "remmina_pref", "applet_new_ontop", remmina_pref.applet_new_ontop);
860  g_key_file_set_boolean(gkeyfile, "remmina_pref", "applet_hide_count", remmina_pref.applet_hide_count);
861  g_key_file_set_boolean(gkeyfile, "remmina_pref", "applet_enable_avahi", remmina_pref.applet_enable_avahi);
862  g_key_file_set_boolean(gkeyfile, "remmina_pref", "disable_tray_icon", remmina_pref.disable_tray_icon);
863  g_key_file_set_boolean(gkeyfile, "remmina_pref", "dark_theme", remmina_pref.dark_theme);
864  g_key_file_set_integer(gkeyfile, "remmina_pref", "recent_maximum", remmina_pref.recent_maximum);
865  g_key_file_set_integer(gkeyfile, "remmina_pref", "default_mode", remmina_pref.default_mode);
866  g_key_file_set_integer(gkeyfile, "remmina_pref", "tab_mode", remmina_pref.tab_mode);
867  g_key_file_set_integer(gkeyfile, "remmina_pref", "fullscreen_toolbar_visibility", remmina_pref.fullscreen_toolbar_visibility);
868  g_key_file_set_integer(gkeyfile, "remmina_pref", "auto_scroll_step", remmina_pref.auto_scroll_step);
869  g_key_file_set_integer(gkeyfile, "remmina_pref", "hostkey", remmina_pref.hostkey);
870  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_fullscreen", remmina_pref.shortcutkey_fullscreen);
871  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_autofit", remmina_pref.shortcutkey_autofit);
872  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_nexttab", remmina_pref.shortcutkey_nexttab);
873  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_prevtab", remmina_pref.shortcutkey_prevtab);
874  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_scale", remmina_pref.shortcutkey_scale);
875  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_grab", remmina_pref.shortcutkey_grab);
876  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_multimon", remmina_pref.shortcutkey_multimon);
877  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_viewonly", remmina_pref.shortcutkey_viewonly);
878  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_screenshot", remmina_pref.shortcutkey_screenshot);
879  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_minimize", remmina_pref.shortcutkey_minimize);
880  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_disconnect", remmina_pref.shortcutkey_disconnect);
881  g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_toolbar", remmina_pref.shortcutkey_toolbar);
882  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_copy", remmina_pref.vte_shortcutkey_copy);
883  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_paste", remmina_pref.vte_shortcutkey_paste);
884  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_select_all", remmina_pref.vte_shortcutkey_select_all);
885  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_increase_font", remmina_pref.vte_shortcutkey_increase_font);
886  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_decrease_font", remmina_pref.vte_shortcutkey_decrease_font);
887  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_search_text", remmina_pref.vte_shortcutkey_search_text);
888  g_key_file_set_string(gkeyfile, "remmina_pref", "vte_font", remmina_pref.vte_font ? remmina_pref.vte_font : "");
889  g_key_file_set_string(gkeyfile, "remmina_pref", "grab_color", remmina_pref.grab_color ? remmina_pref.grab_color : "");
890  g_key_file_set_boolean(gkeyfile, "remmina_pref", "grab_color_switch", remmina_pref.grab_color_switch);
891  g_key_file_set_boolean(gkeyfile, "remmina_pref", "vte_allow_bold_text", remmina_pref.vte_allow_bold_text);
892  g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_lines", remmina_pref.vte_lines);
893  g_key_file_set_string(gkeyfile, "ssh_colors", "background", remmina_pref.color_pref.background ? remmina_pref.color_pref.background : "");
894  g_key_file_set_string(gkeyfile, "ssh_colors", "cursor", remmina_pref.color_pref.cursor ? remmina_pref.color_pref.cursor : "");
895  g_key_file_set_string(gkeyfile, "ssh_colors", "cursor_foreground", remmina_pref.color_pref.cursor_foreground ? remmina_pref.color_pref.cursor_foreground : "");
896  g_key_file_set_string(gkeyfile, "ssh_colors", "highlight", remmina_pref.color_pref.highlight ? remmina_pref.color_pref.highlight : "");
897  g_key_file_set_string(gkeyfile, "ssh_colors", "highlight_foreground", remmina_pref.color_pref.highlight_foreground ? remmina_pref.color_pref.highlight_foreground : "");
898  g_key_file_set_string(gkeyfile, "ssh_colors", "colorBD", remmina_pref.color_pref.colorBD ? remmina_pref.color_pref.colorBD : "");
899  g_key_file_set_string(gkeyfile, "ssh_colors", "foreground", remmina_pref.color_pref.foreground ? remmina_pref.color_pref.foreground : "");
900  g_key_file_set_string(gkeyfile, "ssh_colors", "color0", remmina_pref.color_pref.color0 ? remmina_pref.color_pref.color0 : "");
901  g_key_file_set_string(gkeyfile, "ssh_colors", "color1", remmina_pref.color_pref.color1 ? remmina_pref.color_pref.color1 : "");
902  g_key_file_set_string(gkeyfile, "ssh_colors", "color2", remmina_pref.color_pref.color2 ? remmina_pref.color_pref.color2 : "");
903  g_key_file_set_string(gkeyfile, "ssh_colors", "color3", remmina_pref.color_pref.color3 ? remmina_pref.color_pref.color3 : "");
904  g_key_file_set_string(gkeyfile, "ssh_colors", "color4", remmina_pref.color_pref.color4 ? remmina_pref.color_pref.color4 : "");
905  g_key_file_set_string(gkeyfile, "ssh_colors", "color5", remmina_pref.color_pref.color5 ? remmina_pref.color_pref.color5 : "");
906  g_key_file_set_string(gkeyfile, "ssh_colors", "color6", remmina_pref.color_pref.color6 ? remmina_pref.color_pref.color6 : "");
907  g_key_file_set_string(gkeyfile, "ssh_colors", "color7", remmina_pref.color_pref.color7 ? remmina_pref.color_pref.color7 : "");
908  g_key_file_set_string(gkeyfile, "ssh_colors", "color8", remmina_pref.color_pref.color8 ? remmina_pref.color_pref.color8 : "");
909  g_key_file_set_string(gkeyfile, "ssh_colors", "color9", remmina_pref.color_pref.color9 ? remmina_pref.color_pref.color9 : "");
910  g_key_file_set_string(gkeyfile, "ssh_colors", "color10", remmina_pref.color_pref.color10 ? remmina_pref.color_pref.color10 : "");
911  g_key_file_set_string(gkeyfile, "ssh_colors", "color11", remmina_pref.color_pref.color11 ? remmina_pref.color_pref.color11 : "");
912  g_key_file_set_string(gkeyfile, "ssh_colors", "color12", remmina_pref.color_pref.color12 ? remmina_pref.color_pref.color12 : "");
913  g_key_file_set_string(gkeyfile, "ssh_colors", "color13", remmina_pref.color_pref.color13 ? remmina_pref.color_pref.color13 : "");
914  g_key_file_set_string(gkeyfile, "ssh_colors", "color14", remmina_pref.color_pref.color14 ? remmina_pref.color_pref.color14 : "");
915  g_key_file_set_string(gkeyfile, "ssh_colors", "color15", remmina_pref.color_pref.color15 ? remmina_pref.color_pref.color15 : "");
916 
917  /* Default settings */
918  g_key_file_set_string(gkeyfile, "remmina", "name", "");
919  g_key_file_set_integer(gkeyfile, "remmina", "ignore-tls-errors", 1);
920 
921  content = g_key_file_to_data(gkeyfile, &length, NULL);
922  g_file_set_contents(remmina_pref_file, content, length, &error);
923 
924  if (error != NULL) {
925  g_warning("remmina_pref_save error: %s", error->message);
926  g_clear_error(&error);
927  g_key_file_free(gkeyfile);
928  return FALSE;
929  }
930  g_key_file_free(gkeyfile);
931  return TRUE;
932 }
933 
934 void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
935 {
936  TRACE_CALL(__func__);
937  RemminaStringArray *array;
938  GKeyFile *gkeyfile;
939  gchar key[20];
940  g_autofree gchar *val = NULL;
941  g_autofree gchar *content = NULL;
942  gsize length;
943 
944  if (remmina_pref.recent_maximum <= 0 || server == NULL || server[0] == 0)
945  return;
946 
947  /* Load original value into memory */
948  gkeyfile = g_key_file_new();
949 
950  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
951 
952  g_snprintf(key, sizeof(key), "recent_%s", protocol);
953  array = remmina_string_array_new_from_allocated_string(g_key_file_get_string(gkeyfile, "remmina_pref", key, NULL));
954 
955  /* Add the new value */
956  remmina_string_array_remove(array, server);
957  while (array->len >= remmina_pref.recent_maximum)
959  remmina_string_array_add(array, server);
960 
961  /* Save */
962  val = remmina_string_array_to_string(array);
963  g_key_file_set_string(gkeyfile, "remmina_pref", key, val);
964 
965  content = g_key_file_to_data(gkeyfile, &length, NULL);
966  g_file_set_contents(remmina_pref_file, content, length, NULL);
967 
968  g_key_file_free(gkeyfile);
969 }
970 
971 gchar *
972 remmina_pref_get_recent(const gchar *protocol)
973 {
974  TRACE_CALL(__func__);
975  GKeyFile *gkeyfile;
976  gchar key[20];
977  gchar *val = NULL;
978 
979  gkeyfile = g_key_file_new();
980 
981  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
982 
983  g_snprintf(key, sizeof(key), "recent_%s", protocol);
984  val = g_key_file_get_string(gkeyfile, "remmina_pref", key, NULL);
985 
986  g_key_file_free(gkeyfile);
987 
988  return val;
989 }
990 
992 {
993  TRACE_CALL(__func__);
994  GKeyFile *gkeyfile;
995  gchar **keys;
996  gint i;
997  g_autofree gchar *content = NULL;
998  gsize length;
999 
1000  gkeyfile = g_key_file_new();
1001 
1002  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
1003  keys = g_key_file_get_keys(gkeyfile, "remmina_pref", NULL, NULL);
1004  if (keys) {
1005  for (i = 0; keys[i]; i++)
1006  if (strncmp(keys[i], "recent_", 7) == 0)
1007  g_key_file_set_string(gkeyfile, "remmina_pref", keys[i], "");
1008  g_strfreev(keys);
1009  }
1010 
1011  content = g_key_file_to_data(gkeyfile, &length, NULL);
1012  g_file_set_contents(remmina_pref_file, content, length, NULL);
1013 
1014  g_key_file_free(gkeyfile);
1015 }
1016 
1017 guint *remmina_pref_keymap_get_table(const gchar *keymap)
1018 {
1019  TRACE_CALL(__func__);
1020 
1021  if (!keymap || keymap[0] == '\0')
1022  return NULL;
1023 
1024  return (guint *)g_hash_table_lookup(remmina_keymap_table, keymap);
1025 }
1026 
1027 guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
1028 {
1029  TRACE_CALL(__func__);
1030  guint *table;
1031  gint i;
1032 
1033  if (!keymap || keymap[0] == '\0')
1034  return keyval;
1035 
1036  table = (guint *)g_hash_table_lookup(remmina_keymap_table, keymap);
1037  if (!table)
1038  return keyval;
1039  for (i = 0; table[i] > 0; i += 2)
1040  if (table[i] == keyval)
1041  return table[i + 1];
1042  return keyval;
1043 }
1044 
1045 gchar **
1047 {
1048  TRACE_CALL(__func__);
1049  GList *list;
1050  guint len;
1051  gchar **keys;
1052  guint i;
1053 
1054  list = g_hash_table_get_keys(remmina_keymap_table);
1055  len = g_list_length(list);
1056 
1057  keys = g_new0(gchar *, (len + 1) * 2 + 1);
1058  keys[0] = g_strdup("");
1059  keys[1] = g_strdup("");
1060  for (i = 0; i < len; i++) {
1061  keys[(i + 1) * 2] = g_strdup((gchar *)g_list_nth_data(list, i));
1062  keys[(i + 1) * 2 + 1] = g_strdup((gchar *)g_list_nth_data(list, i));
1063  }
1064  g_list_free(list);
1065 
1066  return keys;
1067 }
1068 
1070 {
1071  TRACE_CALL(__func__);
1072  /* Paranoid programming */
1073  if (remmina_pref.scale_quality < 0)
1075  return remmina_pref.scale_quality;
1076 }
1077 
1079 {
1080  TRACE_CALL(__func__);
1081  return remmina_pref.ssh_loglevel;
1082 }
1083 
1085 {
1086  TRACE_CALL(__func__);
1088 }
1089 
1091 {
1092  TRACE_CALL(__func__);
1094 }
1095 
1097 {
1098  TRACE_CALL(__func__);
1100 }
1101 
1103 {
1104  TRACE_CALL(__func__);
1106 }
1107 
1109 {
1110  TRACE_CALL(__func__);
1112 }
1113 
1115 {
1116  TRACE_CALL(__func__);
1118 }
1119 
1120 void remmina_pref_set_value(const gchar *key, const gchar *value)
1121 {
1122  TRACE_CALL(__func__);
1123  GKeyFile *gkeyfile;
1124  gsize length;
1125 
1126  gkeyfile = g_key_file_new();
1127  if (g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL)) {
1128  g_key_file_set_string(gkeyfile, "remmina_pref", key, value);
1129  gchar *content = g_key_file_to_data(gkeyfile, &length, NULL);
1130  if (g_file_set_contents(remmina_pref_file, content, length, NULL)) {
1131  g_free(content);
1132  } else {
1133  REMMINA_WARNING("Cannot save Remmina preferences");
1134  REMMINA_WARNING("Key was \"%s\", and value \"%s\"", key, value);
1135  }
1136  g_key_file_free(gkeyfile);
1137  } else {
1138  REMMINA_WARNING("Cannot load Remmina preferences file");
1139  }
1140 }
1141 
1142 gchar *remmina_pref_get_value(const gchar *key)
1143 {
1144  TRACE_CALL(__func__);
1145  GKeyFile *gkeyfile;
1146  gchar *value = NULL;
1147 
1148  gkeyfile = g_key_file_new();
1149  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
1150  value = g_key_file_get_string(gkeyfile, "remmina_pref", key, NULL);
1151  g_key_file_free(gkeyfile);
1152 
1153  return value;
1154 }
1155 
1156 gboolean remmina_pref_get_boolean(const gchar *key)
1157 {
1158  TRACE_CALL(__func__);
1159  GKeyFile *gkeyfile;
1160  gboolean value;
1161 
1162  gkeyfile = g_key_file_new();
1163  g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
1164  value = g_key_file_get_boolean(gkeyfile, "remmina_pref", key, NULL);
1165  g_key_file_free(gkeyfile);
1166 
1167  return value;
1168 }
guint shortcutkey_fullscreen
Definition: remmina_pref.h:175
gint floating_toolbar_placement
Definition: remmina_pref.h:224
gboolean hide_searchbar
Definition: remmina_pref.h:155
guint vte_shortcutkey_search_text
Definition: remmina_pref.h:209
-
gint remmina_pref_get_scale_quality(void)
+
gint remmina_pref_get_scale_quality(void)
guint shortcutkey_minimize
Definition: remmina_pref.h:185
static void remmina_pref_gen_secret(void)
Definition: remmina_pref.c:73
gboolean lock_connect
Definition: remmina_pref.h:193
-
gchar ** remmina_pref_keymap_groups(void)
+
gchar ** remmina_pref_keymap_groups(void)
const gchar * default_keystrokes
Definition: remmina_pref.c:59
const gchar * grab_color
Definition: remmina_pref.h:159
guint vte_shortcutkey_increase_font
Definition: remmina_pref.h:207
@@ -104,7 +104,7 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');});
gint default_action
Definition: remmina_pref.h:141
gchar * remmina_pref_file
Definition: rcw.c:78
G_BEGIN_DECLS typedef GPtrArray RemminaStringArray
-
gint remmina_pref_get_sshtunnel_port(void)
+
gint remmina_pref_get_sshtunnel_port(void)
gchar * keystrokes
Definition: remmina_pref.h:146
@@ -120,13 +120,13 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');}); -
gint remmina_pref_get_ssh_loglevel(void)
+
gint remmina_pref_get_ssh_loglevel(void)
gint auto_scroll_step
Definition: remmina_pref.h:143
guint vte_shortcutkey_copy
Definition: remmina_pref.h:204
static guint remmina_pref_get_keyval_from_str(const gchar *str)
Definition: remmina_pref.c:95
-
gchar * remmina_pref_get_recent(const gchar *protocol)
Definition: remmina_pref.c:967
+
gchar * remmina_pref_get_recent(const gchar *protocol)
Definition: remmina_pref.c:972
@@ -137,8 +137,8 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');});
gchar * highlight_foreground
Definition: remmina_pref.h:112
gchar * remmina_string_array_to_string(RemminaStringArray *array)
gint scale_quality
Definition: remmina_pref.h:142
-
void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
Definition: remmina_pref.c:929
-
void remmina_pref_set_value(const gchar *key, const gchar *value)
+
void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
Definition: remmina_pref.c:934
+
void remmina_pref_set_value(const gchar *key, const gchar *value)
gboolean deny_screenshot_clipboard
Definition: remmina_pref.h:138
gchar * resolutions
Definition: remmina_pref.h:145
guint vte_shortcutkey_select_all
Definition: remmina_pref.h:206
@@ -146,20 +146,20 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');});
gint main_sort_order
Definition: remmina_pref.h:221
gboolean vte_allow_bold_text
Definition: remmina_pref.h:201
-
gchar * remmina_pref_get_value(const gchar *key)
+
gchar * remmina_pref_get_value(const gchar *key)
gboolean disable_tray_icon
Definition: remmina_pref.h:164
gboolean lock_view_passwords
Definition: remmina_pref.h:195
gint recent_maximum
Definition: remmina_pref.h:144
-
gboolean remmina_pref_get_ssh_parseconfig(void)
+
gboolean remmina_pref_get_ssh_parseconfig(void)
static GHashTable * remmina_keymap_table
Definition: remmina_pref.c:62
gchar * vte_font
Definition: remmina_pref.h:200
guint shortcutkey_multimon
Definition: remmina_pref.h:181
const gchar * screenshot_path
Definition: remmina_pref.h:137
void remmina_string_array_remove_index(RemminaStringArray *array, gint i)
-
guint * remmina_pref_keymap_get_table(const gchar *keymap)
+
guint * remmina_pref_keymap_get_table(const gchar *keymap)
gint unlock_timeout
Definition: remmina_pref.h:192
gboolean confirm_close
Definition: remmina_pref.h:147
@@ -186,13 +186,13 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');});
RemminaStringArray * remmina_string_array_new_from_allocated_string(gchar *strs)
gboolean fullscreen
Definition: remmina.c:89
-
gboolean remmina_pref_get_boolean(const gchar *key)
+
gboolean remmina_pref_get_boolean(const gchar *key)
gint view_file_mode
Definition: remmina_pref.h:213
-
gint remmina_pref_get_ssh_tcp_keepcnt(void)
-
void remmina_pref_clear_recent(void)
Definition: remmina_pref.c:986
+
gint remmina_pref_get_ssh_tcp_keepcnt(void)
+
void remmina_pref_clear_recent(void)
Definition: remmina_pref.c:991
const gchar * default_resolutions
Definition: remmina_pref.c:58
guint shortcutkey_nexttab
Definition: remmina_pref.h:178
gboolean applet_hide_count
Definition: remmina_pref.h:163
@@ -200,7 +200,7 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');});
gint ssh_tcp_keepidle
Definition: remmina_pref.h:169
gboolean lock_edit
Definition: remmina_pref.h:194
-
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
+
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
gboolean hide_toolbar
Definition: remmina_pref.h:211
void remmina_string_array_remove(RemminaStringArray *array, const gchar *str)
RemminaPref remmina_pref
Definition: rcw.c:79
@@ -217,7 +217,7 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');});
guint shortcutkey_toolbar
Definition: remmina_pref.h:187
-
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:778
+
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:783
gchar * remmina_colors_file
gint ssh_tcp_keepcnt
Definition: remmina_pref.h:171
gboolean applet_new_ontop
Definition: remmina_pref.h:162
@@ -232,7 +232,7 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');});
gchar * cursor_foreground
Definition: remmina_pref.h:110
gboolean extrahardening
Definition: remmina.c:90
-
gboolean remmina_pref_is_rw(void)
Definition: remmina_pref.c:768
+
gboolean remmina_pref_is_rw(void)
Definition: remmina_pref.c:773
gboolean always_show_notes
Definition: remmina_pref.h:153
void remmina_string_array_add(RemminaStringArray *array, const gchar *str)
@@ -245,10 +245,10 @@ $(document).ready(function(){initNavTree('remmina__pref_8c_source.html','');});
gboolean save_view_mode
Definition: remmina_pref.h:140
gint fullscreen_toolbar_visibility
Definition: remmina_pref.h:158
-
gint remmina_pref_get_ssh_tcp_usrtimeout(void)
-
gint remmina_pref_get_ssh_tcp_keepidle(void)
+
gint remmina_pref_get_ssh_tcp_usrtimeout(void)
+
gint remmina_pref_get_ssh_tcp_keepidle(void)
gboolean grab_color_switch
Definition: remmina_pref.h:160
-
gint remmina_pref_get_ssh_tcp_keepintvl(void)
+
gint remmina_pref_get_ssh_tcp_keepintvl(void)
diff --git a/public/remmina__pref_8h.html b/public/remmina__pref_8h.html index fde165fe4..9da00c077 100644 --- a/public/remmina__pref_8h.html +++ b/public/remmina__pref_8h.html @@ -455,7 +455,7 @@ Variables
-

Definition at line 929 of file remmina_pref.c.

+

Definition at line 934 of file remmina_pref.c.

@@ -475,7 +475,7 @@ Variables
-

Definition at line 986 of file remmina_pref.c.

+

Definition at line 991 of file remmina_pref.c.

@@ -525,7 +525,7 @@ Variables
-

Definition at line 1151 of file remmina_pref.c.

+

Definition at line 1156 of file remmina_pref.c.

@@ -545,7 +545,7 @@ Variables
-

Definition at line 967 of file remmina_pref.c.

+

Definition at line 972 of file remmina_pref.c.

@@ -565,7 +565,7 @@ Variables
-

Definition at line 1064 of file remmina_pref.c.

+

Definition at line 1069 of file remmina_pref.c.

@@ -585,7 +585,7 @@ Variables
-

Definition at line 1073 of file remmina_pref.c.

+

Definition at line 1078 of file remmina_pref.c.

@@ -605,7 +605,7 @@ Variables
-

Definition at line 1079 of file remmina_pref.c.

+

Definition at line 1084 of file remmina_pref.c.

@@ -625,7 +625,7 @@ Variables
-

Definition at line 1103 of file remmina_pref.c.

+

Definition at line 1108 of file remmina_pref.c.

@@ -645,7 +645,7 @@ Variables
-

Definition at line 1091 of file remmina_pref.c.

+

Definition at line 1096 of file remmina_pref.c.

@@ -665,7 +665,7 @@ Variables
-

Definition at line 1097 of file remmina_pref.c.

+

Definition at line 1102 of file remmina_pref.c.

@@ -685,7 +685,7 @@ Variables
-

Definition at line 1109 of file remmina_pref.c.

+

Definition at line 1114 of file remmina_pref.c.

@@ -705,7 +705,7 @@ Variables
-

Definition at line 1085 of file remmina_pref.c.

+

Definition at line 1090 of file remmina_pref.c.

@@ -725,7 +725,7 @@ Variables
-

Definition at line 1137 of file remmina_pref.c.

+

Definition at line 1142 of file remmina_pref.c.

@@ -765,7 +765,7 @@ Variables
-

Definition at line 768 of file remmina_pref.c.

+

Definition at line 773 of file remmina_pref.c.

@@ -795,7 +795,7 @@ Variables
-

Definition at line 1022 of file remmina_pref.c.

+

Definition at line 1027 of file remmina_pref.c.

@@ -815,7 +815,7 @@ Variables
-

Definition at line 1012 of file remmina_pref.c.

+

Definition at line 1017 of file remmina_pref.c.

@@ -835,7 +835,7 @@ Variables
-

Definition at line 1041 of file remmina_pref.c.

+

Definition at line 1046 of file remmina_pref.c.

@@ -855,7 +855,7 @@ Variables
-

Definition at line 778 of file remmina_pref.c.

+

Definition at line 783 of file remmina_pref.c.

@@ -885,7 +885,7 @@ Variables
-

Definition at line 1115 of file remmina_pref.c.

+

Definition at line 1120 of file remmina_pref.c.

diff --git a/public/remmina__pref_8h_source.html b/public/remmina__pref_8h_source.html index 876adc1e5..b8a548895 100644 --- a/public/remmina__pref_8h_source.html +++ b/public/remmina__pref_8h_source.html @@ -91,19 +91,19 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
gint floating_toolbar_placement
Definition: remmina_pref.h:224
gboolean hide_searchbar
Definition: remmina_pref.h:155
guint vte_shortcutkey_search_text
Definition: remmina_pref.h:209
-
gboolean remmina_pref_get_boolean(const gchar *key)
+
gboolean remmina_pref_get_boolean(const gchar *key)
gint ssh_loglevel
Definition: remmina_pref.h:166
guint shortcutkey_minimize
Definition: remmina_pref.h:185
gboolean lock_connect
Definition: remmina_pref.h:193
Definition: remmina_pref.h:77
-
gint remmina_pref_get_ssh_tcp_keepcnt(void)
-
void remmina_pref_clear_recent(void)
Definition: remmina_pref.c:986
+
gint remmina_pref_get_ssh_tcp_keepcnt(void)
+
void remmina_pref_clear_recent(void)
Definition: remmina_pref.c:991
const gchar * default_resolutions
Definition: remmina_pref.c:58
gboolean vte_system_colors
Definition: remmina_pref.h:202
const gchar * grab_color
Definition: remmina_pref.h:159
guint vte_shortcutkey_increase_font
Definition: remmina_pref.h:207
-
void remmina_pref_set_value(const gchar *key, const gchar *value)
+
void remmina_pref_set_value(const gchar *key, const gchar *value)
Definition: remmina_pref.h:85
Definition: remmina_pref.h:97
gint default_action
Definition: remmina_pref.h:141
@@ -118,7 +118,7 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
gboolean use_primary_password
Definition: remmina_pref.h:189
guint shortcutkey_prevtab
Definition: remmina_pref.h:177
gboolean ssh_parseconfig
Definition: remmina_pref.h:167
-
gchar * remmina_pref_get_value(const gchar *key)
+
gchar * remmina_pref_get_value(const gchar *key)
Definition: remmina_pref.h:106
gchar * color0
Definition: remmina_pref.h:115
gint ssh_tcp_keepintvl
Definition: remmina_pref.h:170
@@ -138,9 +138,9 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
gchar * last_success
Definition: remmina_pref.h:238
Definition: remmina_pref.h:54
guint shortcutkey_autofit
Definition: remmina_pref.h:176
-
gboolean remmina_pref_is_rw(void)
Definition: remmina_pref.c:768
+
gboolean remmina_pref_is_rw(void)
Definition: remmina_pref.c:773
gchar * secret
Definition: remmina_pref.h:230
-
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
+
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
gchar * color12
Definition: remmina_pref.h:127
gint main_width
Definition: remmina_pref.h:217
gchar * highlight_foreground
Definition: remmina_pref.h:112
@@ -166,8 +166,8 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
Definition: remmina_pref.h:78
Definition: remmina_pref.h:96
const gchar * screenshot_path
Definition: remmina_pref.h:137
-
gint remmina_pref_get_scale_quality(void)
-
gchar ** remmina_pref_keymap_groups(void)
+
gint remmina_pref_get_scale_quality(void)
+
gchar ** remmina_pref_keymap_groups(void)
gint unlock_timeout
Definition: remmina_pref.h:192
Definition: remmina_pref.h:86
gboolean confirm_close
Definition: remmina_pref.h:147
@@ -185,7 +185,7 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
Definition: remmina_pref.h:80
gint ssh_tcp_usrtimeout
Definition: remmina_pref.h:172
gchar * color13
Definition: remmina_pref.h:128
-
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:778
+
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:783
gboolean small_toolbutton
Definition: remmina_pref.h:212
guint shortcutkey_grab
Definition: remmina_pref.h:182
gboolean always_show_tab
Definition: remmina_pref.h:152
@@ -195,14 +195,14 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
gboolean main_maximize
Definition: remmina_pref.h:219
Definition: remmina_pref.h:101
const gchar * unlock_repassword
Definition: remmina_pref.h:191
-
gint remmina_pref_get_ssh_tcp_keepintvl(void)
+
gint remmina_pref_get_ssh_tcp_keepintvl(void)
Definition: remmina_pref.h:68
gboolean fullscreen
Definition: remmina.c:89
gchar * color9
Definition: remmina_pref.h:124
gchar * color5
Definition: remmina_pref.h:120
gint view_file_mode
Definition: remmina_pref.h:213
gchar * color7
Definition: remmina_pref.h:122
-
gboolean remmina_pref_get_ssh_parseconfig(void)
+
gboolean remmina_pref_get_ssh_parseconfig(void)
guint shortcutkey_nexttab
Definition: remmina_pref.h:178
gboolean applet_hide_count
Definition: remmina_pref.h:163
gboolean list_refresh_workaround
Definition: remmina_pref.h:150
@@ -211,7 +211,7 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
gint tab_mode
Definition: remmina_pref.h:157
gboolean hide_toolbar
Definition: remmina_pref.h:211
gchar * color6
Definition: remmina_pref.h:121
-
gint remmina_pref_get_sshtunnel_port(void)
+
gint remmina_pref_get_sshtunnel_port(void)
gboolean trust_all
Definition: remmina_pref.h:198
gint enc_mode
Definition: remmina_pref.h:196
gboolean applet_enable_avahi
Definition: remmina_pref.h:215
@@ -220,8 +220,8 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
RemminaPref remmina_pref
Definition: rcw.c:79
gchar * color3
Definition: remmina_pref.h:118
guint shortcutkey_toolbar
Definition: remmina_pref.h:187
-
gint remmina_pref_get_ssh_tcp_usrtimeout(void)
-
gint remmina_pref_get_ssh_tcp_keepidle(void)
+
gint remmina_pref_get_ssh_tcp_usrtimeout(void)
+
gint remmina_pref_get_ssh_tcp_keepidle(void)
Definition: remmina_pref.h:55
gchar * color8
Definition: remmina_pref.h:123
gchar * remmina_colors_file
@@ -234,16 +234,16 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
gint sshtunnel_port
Definition: remmina_pref.h:168
const gchar * datadir_path
Definition: remmina_pref.h:135
gboolean disabletoolbar
Definition: remmina.c:88
-
gchar * remmina_pref_get_recent(const gchar *protocol)
Definition: remmina_pref.c:967
+
gchar * remmina_pref_get_recent(const gchar *protocol)
Definition: remmina_pref.c:972
gchar * color15
Definition: remmina_pref.h:130
gchar * cursor_foreground
Definition: remmina_pref.h:110
gchar * color11
Definition: remmina_pref.h:126
-
guint * remmina_pref_keymap_get_table(const gchar *keymap)
+
guint * remmina_pref_keymap_get_table(const gchar *keymap)
Definition: remmina_pref.h:103
Definition: remmina_pref.h:79
gboolean always_show_notes
Definition: remmina_pref.h:153
Definition: remmina_pref.h:102
-
void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
Definition: remmina_pref.c:929
+
void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
Definition: remmina_pref.c:934
RemminaColorPref color_pref
Definition: remmina_pref.h:235
gint main_height
Definition: remmina_pref.h:218
guint shortcutkey_viewonly
Definition: remmina_pref.h:183
@@ -256,7 +256,7 @@ $(document).ready(function(){initNavTree('remmina__pref_8h_source.html','');});
gchar * color1
Definition: remmina_pref.h:116
Definition: remmina_pref.h:87
gint fullscreen_toolbar_visibility
Definition: remmina_pref.h:158
-
gint remmina_pref_get_ssh_loglevel(void)
+
gint remmina_pref_get_ssh_loglevel(void)
gboolean grab_color_switch
Definition: remmina_pref.h:160
gchar * highlight
Definition: remmina_pref.h:111
diff --git a/public/remmina__pref__dialog_8c_source.html b/public/remmina__pref__dialog_8c_source.html index bb5d2ee53..5a65b0fa4 100644 --- a/public/remmina__pref__dialog_8c_source.html +++ b/public/remmina__pref__dialog_8c_source.html @@ -165,7 +165,7 @@ $(document).ready(function(){initNavTree('remmina__pref__dialog_8c_source.html',
GtkColorButton * colorbutton_color15
gint scale_quality
Definition: remmina_pref.h:142
gboolean remmina_passwd(GtkWindow *parent, gchar **unlock_password)
-
void remmina_pref_set_value(const gchar *key, const gchar *value)
+
void remmina_pref_set_value(const gchar *key, const gchar *value)
gboolean deny_screenshot_clipboard
Definition: remmina_pref.h:138
gchar * resolutions
Definition: remmina_pref.h:145
guint vte_shortcutkey_select_all
Definition: remmina_pref.h:206
@@ -185,7 +185,7 @@ $(document).ready(function(){initNavTree('remmina__pref__dialog_8c_source.html',
gboolean vte_allow_bold_text
Definition: remmina_pref.h:201
GtkFileChooser * filechooserbutton_options_screenshots_path
GtkEntry * entry_options_ssh_tcp_keepidle
-
gchar * remmina_pref_get_value(const gchar *key)
+
gchar * remmina_pref_get_value(const gchar *key)
gboolean disable_tray_icon
Definition: remmina_pref.h:164
GtkEntry * entry_scrollback_lines
GtkColorButton * colorbutton_color4
@@ -199,7 +199,7 @@ $(document).ready(function(){initNavTree('remmina__pref__dialog_8c_source.html',
void remmina_pref_dialog_on_key_chooser(GtkWidget *widget, gpointer user_data)
const gchar * screenshot_path
Definition: remmina_pref.h:137
-
void remmina_icon_init(void)
Definition: remmina_icon.c:350
+
void remmina_icon_init(void)
Definition: remmina_icon.c:355
Definition: plugin.h:51
GtkButton * button_keyboard_screenshot
@@ -241,7 +241,7 @@ $(document).ready(function(){initNavTree('remmina__pref__dialog_8c_source.html',
GtkComboBox * comboboxtext_options_scale_quality
GtkEntry * entry_options_scroll
GtkCheckButton * checkbutton_appearance_show_tabs
-
gboolean remmina_icon_is_autostart(void)
Definition: remmina_icon.c:426
+
gboolean remmina_icon_is_autostart(void)
Definition: remmina_icon.c:431
GtkBuilder * remmina_public_gtk_builder_new_from_resource(gchar *resource)
GtkColorButton * colorbutton_foreground
static RemminaPrefDialog * remmina_pref_dialog
@@ -253,7 +253,7 @@ $(document).ready(function(){initNavTree('remmina__pref__dialog_8c_source.html',
GtkButton * button_keyboard_host_key
void remmina_string_list_set_text(const gchar *text, const gboolean clear_data)
GtkColorButton * colorbutton_highlight
-
void remmina_pref_clear_recent(void)
Definition: remmina_pref.c:986
+
void remmina_pref_clear_recent(void)
Definition: remmina_pref.c:991
GtkComboBox * comboboxtext_appearance_tab_interface
guint shortcutkey_nexttab
Definition: remmina_pref.h:178
void remmina_prefdiag_on_grab_color_activated(GtkSwitch *widget, gpointer user_data)
@@ -290,7 +290,7 @@ $(document).ready(function(){initNavTree('remmina__pref__dialog_8c_source.html',
GtkComboBox * comboboxtext_options_double_click
void remmina_pref_on_button_keystrokes_clicked(GtkWidget *widget, gpointer user_data)
-
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:778
+
gboolean remmina_pref_save(void)
Definition: remmina_pref.c:783
gint ssh_tcp_keepcnt
Definition: remmina_pref.h:171
gboolean applet_new_ontop
Definition: remmina_pref.h:162
const gchar * screenshot_name
Definition: remmina_pref.h:139
@@ -322,7 +322,7 @@ $(document).ready(function(){initNavTree('remmina__pref__dialog_8c_source.html',
guint keyval
GtkColorButton * colorbutton_color7
gint response
-
void remmina_icon_set_autostart(gboolean autostart)
Definition: remmina_icon.c:439
+
void remmina_icon_set_autostart(gboolean autostart)
Definition: remmina_icon.c:451
RemminaColorPref color_pref
Definition: remmina_pref.h:235
guint shortcutkey_viewonly
Definition: remmina_pref.h:183
GtkWidget * remmina_pref_dialog_new(gint default_tab, GtkWindow *parent)
diff --git a/public/remmina__protocol__widget_8c_source.html b/public/remmina__protocol__widget_8c_source.html index ec769c217..520f03743 100644 --- a/public/remmina__protocol__widget_8c_source.html +++ b/public/remmina__protocol__widget_8c_source.html @@ -282,7 +282,7 @@ $(document).ready(function(){initNavTree('remmina__protocol__widget_8c_source.ht
gint remmina_protocol_widget_panel_new_certificate(RemminaProtocolWidget *gp, const gchar *subject, const gchar *issuer, const gchar *fingerprint)
void remmina_protocol_widget_close_connection(RemminaProtocolWidget *gp)
gboolean remmina_protocol_widget_plugin_screenshot(RemminaProtocolWidget *gp, RemminaPluginScreenshotData *rpsd)
-
gboolean remmina_pref_get_boolean(const gchar *key)
+
gboolean remmina_pref_get_boolean(const gchar *key)
void remmina_ssh_tunnel_cancel_accept(RemminaSSHTunnel *tunnel)
void remmina_protocol_widget_grab_focus(RemminaProtocolWidget *gp)
RemminaMessagePanel * connect_message_panel
diff --git a/public/remmina__stats_8c_source.html b/public/remmina__stats_8c_source.html index 8dad577aa..1750e5934 100644 --- a/public/remmina__stats_8c_source.html +++ b/public/remmina__stats_8c_source.html @@ -102,7 +102,7 @@ $(document).ready(function(){initNavTree('remmina__stats_8c_source.html','');});
GHashTable * proto_count
JsonNode * remmina_stats_get_primary_password_status()
Add a JSON member HASPRIMARYPASSWORD which shows the status of the master password.
gchar * remmina_utils_get_lsb_codename()
Print the Distribution codename as specified by the lsb_release command.
-
gboolean remmina_icon_is_available(void)
Determine whenever the Remmina icon is available.
Definition: remmina_icon.c:318
+
gboolean remmina_icon_is_available(void)
Determine whenever the Remmina icon is available.
Definition: remmina_icon.c:323
gchar * remmina_utils_get_lsb_id()
Print the Distributor as specified by the lsb_release command.
const gchar * remmina_utils_get_kernel_name()
Return the OS name as in "uname -s".
JsonNode * remmina_stats_get_secret_plugin()
Add a JSON member ACTIVESECRETPLUGIN which shows the current secret plugin in use by Remmina...
@@ -119,7 +119,7 @@ $(document).ready(function(){initNavTree('remmina__stats_8c_source.html','');});
gchar * remmina_utils_get_lsb_description()
Print the Distribution description as specified by the lsb_release command.
gchar * remmina_sysinfo_get_gnome_shell_version()
Query DBUS to get GNOME Shell version.
JsonNode * remmina_stats_get_gtk_backend()
-
gboolean remmina_pref_get_boolean(const gchar *key)
+
gboolean remmina_pref_get_boolean(const gchar *key)
JsonNode * remmina_stats_get_profiles()
Add a JSON member profile_count with a child for each protocol used by the user.
static void remmina_profiles_get_data(RemminaFile *remminafile, gpointer user_data)
Given a remmina file, fills a structure containing profiles keys/value tuples.
diff --git a/public/remmina__unlock_8c_source.html b/public/remmina__unlock_8c_source.html index 1fe15018c..a6567cd9b 100644 --- a/public/remmina__unlock_8c_source.html +++ b/public/remmina__unlock_8c_source.html @@ -92,8 +92,8 @@ $(document).ready(function(){initNavTree('remmina__unlock_8c_source.html','');})
static void remmina_unlock_cancel_clicked(GtkButton *btn, gpointer user_data)
GtkButton * button_unlock
gboolean remmina_passwd(GtkWindow *parent, gchar **unlock_password)
-
void remmina_pref_set_value(const gchar *key, const gchar *value)
-
gchar * remmina_pref_get_value(const gchar *key)
+
void remmina_pref_set_value(const gchar *key, const gchar *value)
+
gchar * remmina_pref_get_value(const gchar *key)
gint remmina_sodium_pwhash_str_verify(const char *key, const char *pass)
GTimer * timer
-- cgit v1.2.3