Commit b7e60da5 authored by Nils Steinger's avatar Nils Steinger

Added preference 'ssh_parseconfig' to enable/disable parsing of ~/.ssh/config...

Added preference 'ssh_parseconfig' to enable/disable parsing of ~/.ssh/config before establishing an SSH connection
parent 87a89f0f
......@@ -211,6 +211,7 @@ typedef struct _RemminaPluginService
gint (* pref_get_scale_quality) (void);
gint (* pref_get_sshtunnel_port) (void);
gint (* pref_get_ssh_loglevel) (void);
gboolean (* pref_get_ssh_parseconfig) (void);
guint (* pref_keymap_get_keyval) (const gchar *keymap, guint keyval);
void (* log_print) (const gchar *text);
......
......@@ -141,6 +141,7 @@ RemminaPluginService remmina_plugin_manager_service =
remmina_pref_get_scale_quality,
remmina_pref_get_sshtunnel_port,
remmina_pref_get_ssh_loglevel,
remmina_pref_get_ssh_parseconfig,
remmina_pref_keymap_get_keyval,
remmina_log_print,
......
......@@ -307,6 +307,11 @@ void remmina_pref_init(void)
else
remmina_pref.ssh_loglevel = DEFAULT_SSH_LOGLEVEL;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_parseconfig", NULL))
remmina_pref.ssh_parseconfig = g_key_file_get_boolean(gkeyfile, "remmina_pref", "ssh_parseconfig", NULL);
else
remmina_pref.ssh_parseconfig = DEFAULT_SSH_PARSECONFIG;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "sshtunnel_port", NULL))
remmina_pref.sshtunnel_port = g_key_file_get_integer(gkeyfile, "remmina_pref", "sshtunnel_port", NULL);
else
......@@ -508,6 +513,7 @@ void remmina_pref_save(void)
g_key_file_set_integer(gkeyfile, "remmina_pref", "default_action", remmina_pref.default_action);
g_key_file_set_integer(gkeyfile, "remmina_pref", "scale_quality", remmina_pref.scale_quality);
g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_loglevel", remmina_pref.ssh_loglevel);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "ssh_parseconfig", remmina_pref.ssh_parseconfig);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_toolbar", remmina_pref.hide_toolbar);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_statusbar", remmina_pref.hide_statusbar);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "show_quick_search", remmina_pref.show_quick_search);
......@@ -713,6 +719,12 @@ gint remmina_pref_get_ssh_loglevel(void)
return remmina_pref.ssh_loglevel;
}
gboolean remmina_pref_get_ssh_parseconfig(void)
{
TRACE_CALL("remmina_pref_get_ssh_parseconfig");
return remmina_pref.ssh_parseconfig;
}
gint remmina_pref_get_sshtunnel_port(void)
{
TRACE_CALL("remmina_pref_get_sshtunnel_port");
......
......@@ -84,6 +84,7 @@ typedef struct _RemminaPref
gint default_action;
gint scale_quality;
gint ssh_loglevel;
gboolean ssh_parseconfig;
gint sshtunnel_port;
gint auto_scroll_step;
gint recent_maximum;
......@@ -144,6 +145,7 @@ typedef struct _RemminaPref
gchar *secret;
} RemminaPref;
#define DEFAULT_SSH_PARSECONFIG TRUE
#define DEFAULT_SSHTUNNEL_PORT 4732
#define DEFAULT_SSH_PORT 22
#define DEFAULT_SSH_LOGLEVEL 1
......@@ -164,6 +166,7 @@ gchar** remmina_pref_keymap_groups(void);
gint remmina_pref_get_scale_quality(void);
gint remmina_pref_get_ssh_loglevel(void);
gboolean remmina_pref_get_ssh_parseconfig(void);
gint remmina_pref_get_sshtunnel_port(void);
void remmina_pref_set_value(const gchar *key, const gchar *value);
......
......@@ -132,6 +132,7 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data)
remmina_pref.show_menu_icons = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_appearance_show_menu_icons);
remmina_pref.scale_quality = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_options_scale_quality);
remmina_pref.ssh_loglevel = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_options_ssh_loglevel);
remmina_pref.ssh_parseconfig = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_ssh_parseconfig));
remmina_pref.sshtunnel_port = atoi(gtk_entry_get_text(remmina_pref_dialog->entry_options_ssh_port));
if (remmina_pref.sshtunnel_port <= 0)
......@@ -338,6 +339,7 @@ static void remmina_pref_dialog_init(void)
gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_appearance_show_menu_icons, remmina_pref.show_menu_icons);
gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_options_scale_quality, remmina_pref.scale_quality);
gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_options_ssh_loglevel, remmina_pref.ssh_loglevel);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_options_ssh_parseconfig), remmina_pref.ssh_parseconfig);
gtk_button_set_label(remmina_pref_dialog->button_keyboard_copy, remmina_key_chooser_get_value(remmina_pref.vte_shortcutkey_copy, 0));
gtk_button_set_label(remmina_pref_dialog->button_keyboard_paste, remmina_key_chooser_get_value(remmina_pref.vte_shortcutkey_paste, 0));
......@@ -373,6 +375,7 @@ GtkDialog* remmina_pref_dialog_new(gint default_tab, GtkWindow *parent)
remmina_pref_dialog->comboboxtext_appearance_show_buttons_icons = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_show_buttons_icons"));
remmina_pref_dialog->comboboxtext_appearance_show_menu_icons = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_show_menu_icons"));
remmina_pref_dialog->comboboxtext_options_scale_quality = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_options_scale_quality"));
remmina_pref_dialog->checkbutton_options_ssh_parseconfig = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_options_ssh_parseconfig"));
remmina_pref_dialog->comboboxtext_options_ssh_loglevel = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_options_ssh_loglevel"));
remmina_pref_dialog->entry_options_ssh_port = GTK_ENTRY(GET_OBJECT("entry_options_ssh_port"));
remmina_pref_dialog->entry_options_scroll = GTK_ENTRY(GET_OBJECT("entry_options_scroll"));
......
......@@ -62,6 +62,7 @@ typedef struct _RemminaPrefDialog
GtkComboBox *comboboxtext_appearance_show_menu_icons;
GtkComboBox *comboboxtext_options_scale_quality;
GtkComboBox *comboboxtext_options_ssh_loglevel;
GtkCheckButton *checkbutton_options_ssh_parseconfig;
GtkEntry *entry_options_ssh_port;
GtkEntry *entry_options_scroll;
GtkEntry *entry_options_recent_items;
......
......@@ -420,7 +420,10 @@ remmina_ssh_init_session (RemminaSSH *ssh)
ssh_set_callbacks(ssh->session, ssh->callback);
/* As the latest parse the ~/.ssh/config file */
ssh_options_parse_config(ssh->session, NULL);
if (remmina_pref.ssh_parseconfig) {
ssh_options_parse_config(ssh->session, NULL);
}
if (ssh_connect (ssh->session))
{
remmina_ssh_set_error (ssh, _("Failed to startup SSH session: %s"));
......
......@@ -187,7 +187,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
......@@ -198,7 +198,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
<property name="top_attach">7</property>
<property name="width">2</property>
</packing>
</child>
......@@ -211,7 +211,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
......@@ -223,7 +223,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
......@@ -236,7 +236,7 @@
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">7</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
......@@ -248,7 +248,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
......@@ -261,7 +261,7 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
<property name="top_attach">9</property>
<property name="width">2</property>
</packing>
</child>
......@@ -274,7 +274,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
<property name="top_attach">10</property>
</packing>
</child>
<child>
......@@ -287,10 +287,25 @@
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">9</property>
<property name="top_attach">10</property>
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_options_ssh_parseconfig">
<property name="label" translatable="yes">Parse ~/.ssh/config</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="width">3</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="comboboxtext_options_ssh_loglevel">
<property name="visible">True</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment