Commit e6c7efea authored by Giovanni Panozzo's avatar Giovanni Panozzo Committed by GitHub

Merge pull request #1250 from FreeRDP/issue1247_defaults

Better profile editor button labelling and new save button
parents 73a75abc abc924f0
......@@ -1205,6 +1205,23 @@ static void remmina_file_editor_on_connect(GtkWidget* button, RemminaFileEditor*
remmina_file_editor_update(gfe);
gf = remmina_file_dup(gfe->priv->remmina_file);
/* Put server into name for Quick Connect */
if (remmina_file_get_filename(gf) == NULL)
{
remmina_file_set_string(gf, "name", remmina_file_get_string(gf, "server"));
}
gtk_widget_destroy(GTK_WIDGET(gfe));
remmina_connection_window_open_from_file(gf);
}
static void remmina_file_editor_on_save_connect(GtkWidget* button, RemminaFileEditor* gfe)
{
TRACE_CALL("remmina_file_editor_on_save_connect");
RemminaFile* gf;
remmina_file_editor_update(gfe);
remmina_file_save(gfe->priv->remmina_file);
remmina_icon_populate_menu();
......@@ -1236,30 +1253,34 @@ static void remmina_file_editor_init(RemminaFileEditor* gfe)
/* Create the editor dialog */
gtk_window_set_title(GTK_WINDOW(gfe), _("Remote Desktop Preference"));
widget = gtk_dialog_add_button(GTK_DIALOG(gfe), (_("_Cancel")), GTK_RESPONSE_CANCEL);
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(remmina_file_editor_on_cancel), gfe);
/* Default button */
widget = gtk_dialog_add_button(GTK_DIALOG(gfe), (_("Save as Default")), GTK_RESPONSE_OK);
gtk_button_set_image(GTK_BUTTON(widget), gtk_image_new_from_icon_name("preferences-system", GTK_ICON_SIZE_BUTTON));
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(remmina_file_editor_on_default), gfe);
widget = gtk_dialog_add_button(GTK_DIALOG(gfe), (_("_Save")), GTK_RESPONSE_APPLY);
gtk_button_set_image(GTK_BUTTON(widget), gtk_image_new_from_icon_name("document-save", GTK_ICON_SIZE_BUTTON));
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(remmina_file_editor_on_save), gfe);
gtk_widget_set_sensitive(widget, FALSE);
priv->save_button = widget;
widget = gtk_dialog_add_button(GTK_DIALOG(gfe), (_("_Cancel")), GTK_RESPONSE_CANCEL);
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(remmina_file_editor_on_cancel), gfe);
widget = gtk_dialog_add_button(GTK_DIALOG(gfe), (_("Connect")), GTK_RESPONSE_OK);
widget = gtk_dialog_add_button(GTK_DIALOG(gfe), (_("Connect")), GTK_RESPONSE_ACCEPT);
gtk_button_set_image(GTK_BUTTON(widget), gtk_image_new_from_icon_name("gtk-connect", GTK_ICON_SIZE_BUTTON));
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(remmina_file_editor_on_connect), gfe);
widget = gtk_dialog_add_button(GTK_DIALOG(gfe), (_("_Save and Connect")), GTK_RESPONSE_OK);
gtk_button_set_image(GTK_BUTTON(widget), gtk_image_new_from_icon_name("document-save-as", GTK_ICON_SIZE_BUTTON));
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(remmina_file_editor_on_save_connect), gfe);
gtk_dialog_set_default_response(GTK_DIALOG(gfe), GTK_RESPONSE_OK);
gtk_window_set_default_size(GTK_WINDOW(gfe), 800, 600);
g_signal_connect(G_OBJECT(gfe), "destroy", G_CALLBACK(remmina_file_editor_destroy), NULL);
g_signal_connect(G_OBJECT(gfe), "realize", G_CALLBACK(remmina_file_editor_on_realize), NULL);
/* Default button */
widget = gtk_dialog_add_button(GTK_DIALOG(gfe), (_("Default")), GTK_RESPONSE_OK);
gtk_button_set_image(GTK_BUTTON(widget), gtk_image_new_from_icon_name("preferences-system", GTK_ICON_SIZE_BUTTON));
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(remmina_file_editor_on_default), gfe);
priv->setting_widgets = g_hash_table_new(g_str_hash, g_str_equal);
remmina_widget_pool_register(GTK_WIDGET(gfe));
......
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