Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libssh fixes - SSH_OPTIONS_LOG_VERBOSITY #640

Merged
merged 2 commits into from
Sep 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions remmina/include/remmina/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
* In addition, as a special exception, the copyright holders give
Expand Down Expand Up @@ -210,6 +210,7 @@ typedef struct _RemminaPluginService
gchar* (* pref_get_value) (const gchar *key);
gint (* pref_get_scale_quality) (void);
gint (* pref_get_sshtunnel_port) (void);
gint (* pref_get_ssh_loglevel) (void);
guint (* pref_keymap_get_keyval) (const gchar *keymap, guint keyval);

void (* log_print) (const gchar *text);
Expand All @@ -218,7 +219,7 @@ typedef struct _RemminaPluginService
void (* ui_register) (GtkWidget *widget);

GtkWidget* (* open_connection) (RemminaFile *remminafile, GCallback disconnect_cb, gpointer data, guint *handler);
void (* get_server_port) (const gchar *server, gint defaultport, gchar **host, gint *port);
void (* get_server_port) (const gchar *server, gint defaultport, gchar **host, gint *port);
gboolean (* is_main_thread) (void);

} RemminaPluginService;
Expand Down
1 change: 1 addition & 0 deletions remmina/src/remmina_plugin_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ RemminaPluginService remmina_plugin_manager_service =
remmina_pref_get_value,
remmina_pref_get_scale_quality,
remmina_pref_get_sshtunnel_port,
remmina_pref_get_ssh_loglevel,
remmina_pref_keymap_get_keyval,

remmina_log_print,
Expand Down
12 changes: 12 additions & 0 deletions remmina/src/remmina_pref.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ void remmina_pref_init(void)
else
remmina_pref.toolbar_pin_down = FALSE;

if (g_key_file_has_key(gkeyfile, "remmina_pref", "ssh_loglevel", NULL))
remmina_pref.ssh_loglevel = g_key_file_get_integer(gkeyfile, "remmina_pref", "ssh_loglevel", NULL);
else
remmina_pref.ssh_loglevel = DEFAULT_SSH_LOGLEVEL;

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
Expand Down Expand Up @@ -502,6 +507,7 @@ void remmina_pref_save(void)
g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_connection_toolbar", remmina_pref.hide_connection_toolbar);
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", "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);
Expand Down Expand Up @@ -701,6 +707,12 @@ gint remmina_pref_get_scale_quality(void)
return remmina_pref.scale_quality;
}

gint remmina_pref_get_ssh_loglevel(void)
{
TRACE_CALL("remmina_pref_get_ssh_loglevel");
return remmina_pref.ssh_loglevel;
}

gint remmina_pref_get_sshtunnel_port(void)
{
TRACE_CALL("remmina_pref_get_sshtunnel_port");
Expand Down
3 changes: 3 additions & 0 deletions remmina/src/remmina_pref.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ typedef struct _RemminaPref
gboolean save_when_connect;
gint default_action;
gint scale_quality;
gint ssh_loglevel;
gint sshtunnel_port;
gint auto_scroll_step;
gint recent_maximum;
Expand Down Expand Up @@ -145,6 +146,7 @@ typedef struct _RemminaPref

#define DEFAULT_SSHTUNNEL_PORT 4732
#define DEFAULT_SSH_PORT 22
#define DEFAULT_SSH_LOGLEVEL 1

extern const gchar *default_resolutions;
extern gchar *remmina_pref_file;
Expand All @@ -161,6 +163,7 @@ guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval);
gchar** remmina_pref_keymap_groups(void);

gint remmina_pref_get_scale_quality(void);
gint remmina_pref_get_ssh_loglevel(void);
gint remmina_pref_get_sshtunnel_port(void);

void remmina_pref_set_value(const gchar *key, const gchar *value);
Expand Down
3 changes: 3 additions & 0 deletions remmina/src/remmina_pref_dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data)
remmina_pref.show_buttons_icons = gtk_combo_box_get_active(remmina_pref_dialog->comboboxtext_appearance_show_buttons_icons);
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.sshtunnel_port = atoi(gtk_entry_get_text(remmina_pref_dialog->entry_options_ssh_port));
if (remmina_pref.sshtunnel_port <= 0)
Expand Down Expand Up @@ -336,6 +337,7 @@ static void remmina_pref_dialog_init(void)
gtk_combo_box_set_active(remmina_pref_dialog->comboboxtext_appearance_show_buttons_icons, remmina_pref.show_buttons_icons);
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_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));
Expand Down Expand Up @@ -371,6 +373,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->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"));
remmina_pref_dialog->entry_options_recent_items = GTK_ENTRY(GET_OBJECT("entry_options_recent_items"));
Expand Down
1 change: 1 addition & 0 deletions remmina/src/remmina_pref_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typedef struct _RemminaPrefDialog
GtkComboBox *comboboxtext_appearance_show_buttons_icons;
GtkComboBox *comboboxtext_appearance_show_menu_icons;
GtkComboBox *comboboxtext_options_scale_quality;
GtkComboBox *comboboxtext_options_ssh_loglevel;
GtkEntry *entry_options_ssh_port;
GtkEntry *entry_options_scroll;
GtkEntry *entry_options_recent_items;
Expand Down
5 changes: 4 additions & 1 deletion remmina/src/remmina_ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#include "remmina_public.h"
#include "remmina_log.h"
#include "remmina_ssh.h"
#include "remmina_pref.h"
#include "remmina/remmina_trace_calls.h"

/*************************** SSH Base *********************************/
Expand Down Expand Up @@ -374,6 +375,7 @@ remmina_ssh_init_session (RemminaSSH *ssh)
{
TRACE_CALL("remmina_ssh_init_session");
gint verbosity;
//gchar* verbosity;

ssh->callback = g_new0 (struct ssh_callbacks_struct, 1);
ssh->callback->userdata = ssh;
Expand All @@ -385,7 +387,7 @@ remmina_ssh_init_session (RemminaSSH *ssh)
ssh_options_set (ssh->session, SSH_OPTIONS_USER, ssh->user);
if (remmina_log_running ())
{
verbosity = SSH_LOG_RARE;
verbosity = remmina_pref.ssh_loglevel;
ssh_options_set (ssh->session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
ssh->callback->log_function = remmina_ssh_log_callback;
}
Expand Down Expand Up @@ -416,6 +418,7 @@ remmina_ssh_init_from_file (RemminaSSH *ssh, RemminaFile *remminafile)
const gchar *ssh_username;
const gchar *ssh_privatekey;
const gchar *server;
gint verbosity;
gchar *s;

ssh->session = NULL;
Expand Down
Loading