Commit e58d8055 authored by Antenore Gatta's avatar Antenore Gatta

GTK3 migration - @giox069/Remmina.git integration + ccount fix (giox069)

parent a8579ffd
......@@ -154,7 +154,7 @@ GtkWidget* remmina_applet_menu_item_new(RemminaAppletMenuItemType item_type, ...
}
else
{
widget = gtk_image_new_from_icon_name(GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_MENU);
widget = gtk_image_new_from_icon_name("go-jump", GTK_ICON_SIZE_MENU);
}
gtk_widget_show(widget);
......
......@@ -161,7 +161,7 @@ remmina_chat_window_new(GtkWindow* parent, const gchar* chat_with)
{
RemminaChatWindow* window;
gchar buf[100];
GtkGrid* grid;
GtkWidget* grid;
GtkWidget* scrolledwindow;
GtkWidget* widget;
GtkWidget* image;
......@@ -230,7 +230,7 @@ remmina_chat_window_new(GtkWindow* parent, const gchar* chat_with)
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(remmina_chat_window_send), window);
/* Clear button */
image = gtk_image_new_from_icon_name(GTK_STOCK_CLEAR, GTK_ICON_SIZE_BUTTON);
image = gtk_image_new_from_icon_name("edit-clear", GTK_ICON_SIZE_BUTTON);
gtk_widget_show(image);
widget = gtk_button_new_with_mnemonic(_("_Clear"));
......
......@@ -1569,7 +1569,7 @@ static gboolean remmina_connection_window_on_leave(GtkWidget* widget, GdkEventCr
device = gdk_device_manager_get_client_pointer(manager);
if (device != NULL)
{
if ( device != GDK_SOURCE_KEYBOARD ) {
if ( gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD ) {
device = gdk_device_get_associated_device (device);
}
gdk_device_ungrab(device, GDK_CURRENT_TIME);
......@@ -1819,8 +1819,9 @@ static gboolean remmina_connection_window_state_event(GtkWidget* widget, GdkEven
gtk_widget_hide(widget);
return TRUE;
}
return FALSE;
//return FALSE; uncomment if next one gives trouble
#endif
return FALSE; // moved here because a function should return a value. Should be correct
}
static GtkWidget*
......@@ -1943,7 +1944,7 @@ static GtkWidget* remmina_connection_object_create_tab(RemminaConnectionObject*
gtk_widget_set_name(button, "remmina-small-button");
gtk_widget_show(button);
widget = gtk_image_new_from_icon_name(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
widget = gtk_image_new_from_icon_name("Close", GTK_ICON_SIZE_MENU);
gtk_widget_show(widget);
gtk_container_add(GTK_CONTAINER(button), widget);
......@@ -2227,7 +2228,6 @@ static void remmina_connection_holder_create_fullscreen(RemminaConnectionHolder*
GtkWidget* window;
GtkWidget* oldwindow;
GtkWidget* notebook;
GdkColor color;
gchar* tag;
oldwindow = GTK_WIDGET(cnnhld->cnnwin);
......@@ -2240,8 +2240,9 @@ static void remmina_connection_holder_create_fullscreen(RemminaConnectionHolder*
if (view_mode == VIEWPORT_FULLSCREEN_MODE)
{
gdk_color_parse("black", &color);
gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &color);
//gdk_color_parse("black", &color);
GdkRGBA color = {.0, .0, .0, 1.0};
gtk_widget_override_background_color(window, GTK_STATE_NORMAL, &color);
}
notebook = remmina_connection_holder_create_notebook(cnnhld);
......@@ -2641,7 +2642,7 @@ GtkWidget*
remmina_connection_window_open_from_file_full(RemminaFile* remminafile, GCallback disconnect_cb, gpointer data, guint* handler)
{
RemminaConnectionObject* cnnobj;
GdkColor color;
//GdkRGBA color;
remmina_file_update_screen_resolution(remminafile);
......@@ -2679,8 +2680,9 @@ remmina_connection_window_open_from_file_full(RemminaFile* remminafile, GCallbac
/* Create the viewport to make the RemminaProtocolWidget scrollable */
cnnobj->viewport = gtk_viewport_new(NULL, NULL);
gtk_widget_show(cnnobj->viewport);
gdk_color_parse("black", &color);
gtk_widget_modify_bg(cnnobj->viewport, GTK_STATE_NORMAL, &color);
//gdk_color_parse("black", &color);
GdkRGBA color = {.0, .0, .0, 1.0};
gtk_widget_override_background_color(cnnobj->viewport, GTK_STATE_NORMAL, &color);
gtk_container_set_border_width(GTK_CONTAINER(cnnobj->viewport), 0);
gtk_viewport_set_shadow_type(GTK_VIEWPORT(cnnobj->viewport), GTK_SHADOW_NONE);
gtk_container_add(GTK_CONTAINER(cnnobj->viewport), cnnobj->alignment);
......
......@@ -205,7 +205,7 @@ static void remmina_file_editor_create_notebook_container(RemminaFileEditor* gfe
gtk_widget_show(gfe->priv->config_container);
}
static GtkGrid* remmina_file_editor_create_notebook_tab(RemminaFileEditor* gfe,
static GtkWidget* remmina_file_editor_create_notebook_tab(RemminaFileEditor* gfe,
const gchar* stock_id, const gchar* label, gint rows, gint cols)
{
GtkWidget* tablabel;
......@@ -260,7 +260,7 @@ static void remmina_file_editor_ssh_server_custom_radio_on_toggled(GtkToggleButt
static void remmina_file_editor_ssh_auth_publickey_radio_on_toggled(GtkToggleButton* togglebutton, RemminaFileEditor* gfe)
{
gboolean b;
gchar* s;
const gchar* s;
b = ((!gfe->priv->ssh_enabled_check ||
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gfe->priv->ssh_enabled_check))) &&
......@@ -301,7 +301,7 @@ static void remmina_file_editor_ssh_enabled_check_on_toggled(GtkToggleButton* to
}
}
static void remmina_file_editor_create_ssh_privatekey(RemminaFileEditor* gfe, GtkGrid* table, gint row, gint column)
static void remmina_file_editor_create_ssh_privatekey(RemminaFileEditor* gfe, GtkWidget* table, gint row, gint column)
{
gchar* s;
GtkWidget* widget;
......@@ -347,7 +347,7 @@ static void remmina_file_editor_create_ssh_privatekey(RemminaFileEditor* gfe, Gt
}
#endif
static void remmina_file_editor_create_server(RemminaFileEditor* gfe, const RemminaProtocolSetting* setting, GtkGrid* table,
static void remmina_file_editor_create_server(RemminaFileEditor* gfe, const RemminaProtocolSetting* setting, GtkWidget* table,
gint row)
{
RemminaProtocolPlugin* plugin = gfe->priv->plugin;
......@@ -396,7 +396,7 @@ static void remmina_file_editor_create_server(RemminaFileEditor* gfe, const Remm
}
}
static void remmina_file_editor_create_password(RemminaFileEditor* gfe, GtkGrid* table, gint row)
static void remmina_file_editor_create_password(RemminaFileEditor* gfe, GtkWidget* table, gint row)
{
GtkWidget* widget;
gchar* s;
......@@ -438,7 +438,7 @@ static void remmina_file_editor_browse_resolution(GtkWidget* button, RemminaFile
}
static void remmina_file_editor_create_resolution(RemminaFileEditor* gfe, const RemminaProtocolSetting* setting,
GtkGrid* table, gint row)
GtkWidget* table, gint row)
{
GtkWidget* widget;
GtkWidget* hbox;
......@@ -493,7 +493,7 @@ static void remmina_file_editor_create_resolution(RemminaFileEditor* gfe, const
}
}
static GtkWidget* remmina_file_editor_create_text(RemminaFileEditor* gfe, GtkGrid* table,
static GtkWidget* remmina_file_editor_create_text(RemminaFileEditor* gfe, GtkWidget* table,
gint row, gint col, const gchar* label, const gchar* value)
{
GtkWidget* widget;
......@@ -501,9 +501,9 @@ static GtkWidget* remmina_file_editor_create_text(RemminaFileEditor* gfe, GtkGri
widget = gtk_label_new(label);
gtk_widget_show(widget);
#if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_end (GTK_MISC(widget), 40);
gtk_widget_set_margin_end (widget, 40);
#else
gtk_widget_set_margin_right (GTK_MISC(widget), 40);
gtk_widget_set_margin_right (widget, 40);
#endif
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
gtk_grid_attach(GTK_GRID(table), widget, 0, row, 1, 1);
......@@ -519,7 +519,7 @@ static GtkWidget* remmina_file_editor_create_text(RemminaFileEditor* gfe, GtkGri
return widget;
}
static GtkWidget* remmina_file_editor_create_select(RemminaFileEditor* gfe, GtkGrid* table,
static GtkWidget* remmina_file_editor_create_select(RemminaFileEditor* gfe, GtkWidget* table,
gint row, gint col, const gchar* label, const gpointer* list, const gchar* value)
{
GtkWidget* widget;
......@@ -536,7 +536,7 @@ static GtkWidget* remmina_file_editor_create_select(RemminaFileEditor* gfe, GtkG
return widget;
}
static GtkWidget* remmina_file_editor_create_combo(RemminaFileEditor* gfe, GtkGrid* table,
static GtkWidget* remmina_file_editor_create_combo(RemminaFileEditor* gfe, GtkWidget* table,
gint row, gint col, const gchar* label, const gchar* list, const gchar* value)
{
GtkWidget* widget;
......@@ -554,7 +554,7 @@ static GtkWidget* remmina_file_editor_create_combo(RemminaFileEditor* gfe, GtkGr
return widget;
}
static GtkWidget* remmina_file_editor_create_check(RemminaFileEditor* gfe, GtkGrid* table,
static GtkWidget* remmina_file_editor_create_check(RemminaFileEditor* gfe, GtkWidget* table,
gint row, gint top, const gchar* label, gboolean value)
{
GtkWidget* widget;
......@@ -570,7 +570,7 @@ static GtkWidget* remmina_file_editor_create_check(RemminaFileEditor* gfe, GtkGr
}
static GtkWidget*
remmina_file_editor_create_chooser(RemminaFileEditor* gfe, GtkGrid* table, gint row, gint col, const gchar* label,
remmina_file_editor_create_chooser(RemminaFileEditor* gfe, GtkWidget* table, gint row, gint col, const gchar* label,
const gchar* value, gint type)
{
GtkWidget* check;
......@@ -609,7 +609,7 @@ remmina_file_editor_create_chooser(RemminaFileEditor* gfe, GtkGrid* table, gint
return widget;
}
static void remmina_file_editor_create_settings(RemminaFileEditor* gfe, GtkGrid* table,
static void remmina_file_editor_create_settings(RemminaFileEditor* gfe, GtkWidget* table,
const RemminaProtocolSetting* settings)
{
RemminaFileEditorPriv* priv = gfe->priv;
......@@ -617,7 +617,7 @@ static void remmina_file_editor_create_settings(RemminaFileEditor* gfe, GtkGrid*
GtkWidget* widget;
gint row = 0;
gint top = 0;
gint ccount;
gint ccount = 0;
gchar** strarr;
while (settings->type != REMMINA_PROTOCOL_SETTING_TYPE_END)
......@@ -628,7 +628,7 @@ static void remmina_file_editor_create_settings(RemminaFileEditor* gfe, GtkGrid*
switch (settings->type)
{
case REMMINA_PROTOCOL_SETTING_TYPE_SERVER:
remmina_file_editor_create_server(gfe, settings, table, 0);
remmina_file_editor_create_server(gfe, settings, table, row);
break;
case REMMINA_PROTOCOL_SETTING_TYPE_PASSWORD:
......@@ -655,9 +655,9 @@ static void remmina_file_editor_create_settings(RemminaFileEditor* gfe, GtkGrid*
gtk_widget_show(widget);
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
#if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_end (GTK_MISC(widget), 40);
gtk_widget_set_margin_end (widget, 40);
#else
gtk_widget_set_margin_right (GTK_MISC(widget), 40);
gtk_widget_set_margin_right (widget, 40);
#endif
gtk_grid_attach(GTK_GRID(table), widget, 0, row, 1, row + 1);
......@@ -665,9 +665,9 @@ static void remmina_file_editor_create_settings(RemminaFileEditor* gfe, GtkGrid*
gtk_widget_show(widget);
gtk_misc_set_alignment(GTK_MISC(widget), 0.0, 0.5);
#if GTK_CHECK_VERSION(3, 12, 0)
gtk_widget_set_margin_end (GTK_MISC(widget), 40);
gtk_widget_set_margin_end (widget, 40);
#else
gtk_widget_set_margin_right (GTK_MISC(widget), 40);
gtk_widget_set_margin_right (widget, 40);
#endif
gtk_grid_attach(GTK_GRID(table), widget, 0, row + 1, 1, row + 2);
......@@ -759,7 +759,7 @@ static void remmina_file_editor_create_ssh_tab(RemminaFileEditor* gfe, RemminaPr
{
#ifdef HAVE_LIBSSH
RemminaFileEditorPriv* priv = gfe->priv;
GtkGrid* table;
GtkWidget* table;
GtkWidget* hbox;
GtkWidget* widget;
const gchar* cs;
......@@ -773,13 +773,13 @@ static void remmina_file_editor_create_ssh_tab(RemminaFileEditor* gfe, RemminaPr
ssh_setting == REMMINA_PROTOCOL_SSH_SETTING_SFTP)
{
s = remmina_public_combo_get_active_text (GTK_COMBO_BOX (priv->protocol_combo));
table = remmina_file_editor_create_notebook_tab (gfe, GTK_STOCK_DIALOG_AUTHENTICATION,
table = remmina_file_editor_create_notebook_tab (gfe, "dialog-password",
(s ? s : "SSH"), 8, 3);
g_free(s);
}
else
{
table = remmina_file_editor_create_notebook_tab (gfe, GTK_STOCK_DIALOG_AUTHENTICATION,
table = remmina_file_editor_create_notebook_tab (gfe, "dialog-password",
"SSH", 9, 3);
#if GTK_VERSION == 3
......@@ -958,14 +958,14 @@ static void remmina_file_editor_create_all_settings(RemminaFileEditor* gfe)
/* The Basic tab */
if (priv->plugin->basic_settings)
{
table = remmina_file_editor_create_notebook_tab(gfe, GTK_STOCK_DIALOG_INFO, _("Basic"), 20, 2);
table = remmina_file_editor_create_notebook_tab(gfe, "dialog-information", _("Basic"), 20, 2);
remmina_file_editor_create_settings(gfe, table, priv->plugin->basic_settings);
}
/* The Advanced tab */
if (priv->plugin->advanced_settings)
{
table = remmina_file_editor_create_notebook_tab(gfe, GTK_STOCK_DIALOG_WARNING, _("Advanced"), 20, 2);
table = remmina_file_editor_create_notebook_tab(gfe, "dialog-warning", _("Advanced"), 20, 2);
remmina_file_editor_create_settings(gfe, table, priv->plugin->advanced_settings);
}
......@@ -1320,7 +1320,7 @@ GtkWidget* remmina_file_editor_new_from_file(RemminaFile* remminafile)
* This is indeed an important step and it should be done soon or later to
* avoid confusion.
*/
GtkGrid* table;
GtkWidget* table;
GtkWidget* widget;
gchar* groups;
gchar* s;
......
......@@ -679,7 +679,6 @@ static void remmina_ftp_client_popup_menu(RemminaFTPClient *client, GdkEventButt
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_ftp_client_action_upload), client);
//menuitem = gtk_image_menu_item_new_from_stock(GTK_STOCK_DELETE, NULL);
menuitem = gtk_menu_item_new_with_mnemonic(_("_Delete"));
gtk_widget_show(menuitem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
......
......@@ -129,13 +129,11 @@ static void remmina_icon_populate_additional_menu_item(GtkWidget *menu)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_icon_main), NULL);
//menuitem = gtk_image_menu_item_new_from_stock(GTK_STOCK_PREFERENCES, NULL);
menuitem = gtk_menu_item_new_with_mnemonic(_("_Preferences"));
gtk_widget_show(menuitem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(remmina_icon_preferences), NULL);
//menuitem = gtk_image_menu_item_new_from_stock(GTK_STOCK_ABOUT, NULL);
menuitem = gtk_menu_item_new_with_mnemonic(_("_About"));
gtk_widget_show(menuitem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
......@@ -160,7 +158,6 @@ static void remmina_icon_populate_additional_menu_item(GtkWidget *menu)
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
#endif
//menuitem = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL);
menuitem = gtk_menu_item_new_with_mnemonic(_("_Quit"));
gtk_widget_show(menuitem);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
......
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