39 #include <glib/gi18n.h> 68 # if GCRYPT_VERSION_NUMBER < 0x010600 74 # if GCRYPT_VERSION_NUMBER < 0x010600 84 {
"about",
'a', 0, G_OPTION_ARG_NONE, NULL,
N_(
"Show \'About\'"), NULL },
86 {
"connect",
'c', 0, G_OPTION_ARG_FILENAME, NULL,
N_(
"Connect to desktop described in file (.remmina or type supported by plugin)"),
"FILE" },
88 { G_OPTION_REMAINING,
'\0', 0, G_OPTION_ARG_FILENAME_ARRAY, NULL,
N_(
"Connect to desktop described in file (.remmina or type supported by plugin)"),
"FILE" },
90 {
"edit",
'e', 0, G_OPTION_ARG_FILENAME, NULL,
N_(
"Edit desktop connection described in file (.remmina or type supported by plugin)"),
"FILE" },
91 {
"help",
'?', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, NULL, NULL, NULL },
93 {
"kiosk",
'k', 0, G_OPTION_ARG_NONE, NULL,
N_(
"Start in kiosk mode"), NULL },
95 {
"new",
'n', 0, G_OPTION_ARG_NONE, NULL,
N_(
"Create new connection profile"), NULL },
97 {
"pref",
'p', 0, G_OPTION_ARG_STRING, NULL,
N_(
"Show preferences"),
"PAGENR" },
99 {
"plugin",
'x', 0, G_OPTION_ARG_STRING, NULL,
N_(
"Run a plugin"),
"PLUGIN" },
101 {
"quit",
'q', 0, G_OPTION_ARG_NONE, NULL,
N_(
"Quit"), NULL },
103 {
"server",
's', 0, G_OPTION_ARG_STRING, NULL,
N_(
"Use default server name (for --new)"),
"SERVER" },
105 {
"protocol",
't', 0, G_OPTION_ARG_STRING, NULL,
N_(
"Use default protocol (for --new)"),
"PROTOCOL" },
107 {
"icon",
'i', 0, G_OPTION_ARG_NONE, NULL,
N_(
"Start in tray"), NULL },
109 {
"version",
'v', 0, G_OPTION_ARG_NONE, NULL,
N_(
"Show the application version"), NULL },
111 {
"full-version",
'V', 0, G_OPTION_ARG_NONE, NULL,
N_(
"Show version of the application and its plugins"), NULL },
113 {
"update-profile", 0, 0, G_OPTION_ARG_FILENAME, NULL,
N_(
"Modify connection profile (requires --set-option)"), NULL },
115 {
"set-option", 0, 0, G_OPTION_ARG_STRING_ARRAY, NULL,
N_(
"Set one or more profile settings, to be used with --update-profile"), NULL },
119 #ifdef WITH_LIBGCRYPT 124 if (e == GPG_ERR_NO_ERROR)
133 TRACE_CALL(__func__);
136 gboolean executed = FALSE;
139 const gchar **remaining_args;
143 #if SODIUM_VERSION_INT >= 90200 148 opts = g_application_command_line_get_options_dict(cmdline);
150 if (g_variant_dict_lookup_value(opts,
"quit", NULL)) {
156 if (g_variant_dict_lookup_value(opts,
"about", NULL)) {
165 if (g_variant_dict_lookup(opts,
"connect",
"^ay", &str)) {
171 if (g_variant_dict_lookup(opts, G_OPTION_REMAINING,
"^a&ay", &remaining_args)) {
173 g_free(remaining_args);
177 if (g_variant_dict_lookup(opts,
"edit",
"^ay", &str)) {
183 if (g_variant_dict_lookup_value(opts,
"kiosk", NULL)) {
189 if (g_variant_dict_lookup_value(opts,
"new", NULL)) {
190 if (!g_variant_dict_lookup(opts,
"protocol",
"&s", &protocol))
193 if (g_variant_dict_lookup(opts,
"server",
"&s", &server))
194 str = g_strdup_printf(
"%s,%s", protocol, server);
196 str = g_strdup(protocol);
203 if (g_variant_dict_lookup(opts,
"pref",
"&s", &str)) {
208 if (g_variant_dict_lookup(opts,
"plugin",
"&s", &str)) {
213 if (g_variant_dict_lookup_value(opts,
"icon", NULL)) {
226 TRACE_CALL(__func__);
235 g_set_application_name(
"Remmina");
236 gtk_window_set_default_icon_name(REMMINA_APP_ID);
240 gdk_set_program_class(REMMINA_APP_ID);
242 gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
243 REMMINA_RUNTIME_DATADIR G_DIR_SEPARATOR_S
"icons");
244 g_application_hold(app);
252 if (!secret_plugin) {
253 g_print(
"Warning: Remmina is running without a secret plugin. Passwords will be saved in a less secure way.\n");
256 g_print(
"Warning: Remmina is running with a secrecy plugin, but it cannot connect to a secrecy service.\n");
264 TRACE_CALL(__func__);
273 if (g_variant_dict_lookup_value(opts,
"version", NULL)) {
278 if (g_variant_dict_lookup_value(opts,
"full-version", NULL)) {
283 if (g_variant_dict_lookup(opts,
"update-profile",
"^&ay", &str)) {
284 if (g_variant_dict_lookup(opts,
"set-option",
"^a&s", &settings)) {
285 if (settings != NULL) {
293 g_print(
"Error: --update-profile requires --set-option\n");
301 int main(
int argc,
char *argv[])
303 TRACE_CALL(__func__);
308 g_unsetenv (
"GDK_CORE_DEVICE_EVENTS");
313 gdk_set_allowed_backends(
"wayland,x11,broadway,quartz,mir");
315 gdk_set_allowed_backends(
"x11,broadway,quartz,mir");
319 bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
320 bind_textdomain_codeset(GETTEXT_PACKAGE,
"UTF-8");
321 textdomain(GETTEXT_PACKAGE);
323 #ifdef HAVE_LIBGCRYPT 324 # if GCRYPT_VERSION_NUMBER < 0x010600 327 if ((e = gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread)) != GPG_ERR_NO_ERROR)
332 gcry_check_version(NULL);
333 gcry_control(GCRYCTL_DISABLE_SECMEM, 0);
334 gcry_control(GCRYCTL_INITIALIZATION_FINISHED, 0);
343 app_id = g_application_id_is_valid(REMMINA_APP_ID) ? REMMINA_APP_ID : NULL;
344 app = gtk_application_new(app_id, G_APPLICATION_HANDLES_COMMAND_LINE | G_APPLICATION_CAN_OVERRIDE_APP_ID);
345 #if !GTK_CHECK_VERSION(4, 0, 0) 346 g_set_prgname(app_id);
352 g_application_add_main_option_entries(G_APPLICATION(app),
remmina_options);
354 g_application_set_inactivity_timeout(G_APPLICATION(app), 10000);
355 status = g_application_run(G_APPLICATION(app), argc, argv);
int remmina_exec_set_setting(gchar *profilefilename, gchar **settings)
static GOptionEntry remmina_options[]
static void remmina_on_startup(GApplication *app)
void remmina_plugin_manager_init(void)
RemminaSecretPlugin * remmina_plugin_manager_get_secret_plugin(void)
void remmina_masterthread_exec_save_main_thread_id()
void remmina_sftp_plugin_register(void)
int main(int argc, char *argv[])
gboolean(* is_service_available)(void)
static int _gpg_error_to_errno(gcry_error_t e)
static gint remmina_on_command_line(GApplication *app, GApplicationCommandLine *cmdline)
void remmina_file_manager_init(void)
void remmina_ssh_plugin_register(void)
void remmina_icon_init(void)
static gint remmina_on_local_cmdline(GApplication *app, GVariantDict *opts, gpointer user_data)
static int gcrypt_thread_initialized
void remmina_exec_command(RemminaCommandType command, const gchar *data)
gboolean remmina_gtk_check_version(guint major, guint minor, guint micro)
void remmina_stats_sender_schedule()
void remmina_pref_init(void)
GCRY_THREAD_OPTION_PTHREAD_IMPL
N_("Unable to connect to VNC server")
void remmina_sodium_init(void)