Commit da68275d authored by Marc-André Moreau's avatar Marc-André Moreau

remmina: run eclipse code formatter

parent ac64bf21
......@@ -58,175 +58,171 @@ static gchar *remmina_option_protocol;
static GOptionEntry remmina_options[] =
{
{ "about", 'a', 0, G_OPTION_ARG_NONE, &remmina_option_about, "Show about dialog", NULL },
{ "connect", 'c', 0, G_OPTION_ARG_FILENAME, &remmina_option_connect, "Connect to a .remmina file F", "F" },
{ "edit", 'e', 0, G_OPTION_ARG_FILENAME, &remmina_option_edit, "Edit a .remmina file F", "F" },
{ "help", '?', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &remmina_option_help, NULL, NULL },
{ "new", 'n', 0, G_OPTION_ARG_NONE, &remmina_option_new, "Create a new connection profile", NULL },
{ "pref", 'p', 0, G_OPTION_ARG_STRING, &remmina_option_pref, "Show preference dialog", NULL },
{ "plugin", 'x', 0, G_OPTION_ARG_STRING, &remmina_option_plugin, "Execute plugin P", "P" },
{ "quit", 'q', 0, G_OPTION_ARG_NONE, &remmina_option_quit, "Quit the application", NULL },
{ "server", 's', 0, G_OPTION_ARG_STRING, &remmina_option_server, "Use default server name S", "S" },
{ "protocol", 't', 0, G_OPTION_ARG_STRING, &remmina_option_protocol, "Use default protocol T", "T" },
{ NULL }
};
static gint
remmina_on_command_line (GApplication *app, GApplicationCommandLine *cmdline)
{ "about", 'a', 0, G_OPTION_ARG_NONE, &remmina_option_about, "Show about dialog", NULL },
{ "connect", 'c', 0, G_OPTION_ARG_FILENAME, &remmina_option_connect, "Connect to a .remmina file F", "F" },
{ "edit", 'e', 0, G_OPTION_ARG_FILENAME, &remmina_option_edit, "Edit a .remmina file F", "F" },
{ "help", '?', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &remmina_option_help, NULL, NULL },
{ "new", 'n', 0, G_OPTION_ARG_NONE, &remmina_option_new, "Create a new connection profile", NULL },
{ "pref", 'p', 0, G_OPTION_ARG_STRING, &remmina_option_pref, "Show preference dialog", NULL },
{ "plugin", 'x', 0, G_OPTION_ARG_STRING, &remmina_option_plugin, "Execute plugin P", "P" },
{ "quit", 'q', 0, G_OPTION_ARG_NONE, &remmina_option_quit, "Quit the application", NULL },
{ "server", 's', 0, G_OPTION_ARG_STRING, &remmina_option_server, "Use default server name S", "S" },
{ "protocol", 't', 0, G_OPTION_ARG_STRING, &remmina_option_protocol, "Use default protocol T", "T" },
{ NULL } };
static gint remmina_on_command_line(GApplication *app, GApplicationCommandLine *cmdline)
{
gint status = 0;
gint argc;
gchar **argv;
GError *error = NULL;
GOptionContext *context;
gboolean parsed;
gchar *s;
gboolean executed = FALSE;
remmina_option_about = FALSE;
remmina_option_connect = NULL;
remmina_option_edit = NULL;
remmina_option_help = FALSE;
remmina_option_new = FALSE;
remmina_option_pref = NULL;
remmina_option_plugin = NULL;
remmina_option_server = NULL;
remmina_option_protocol = NULL;
argv = g_application_command_line_get_arguments (cmdline, &argc);
context = g_option_context_new ("- The GTK+ Remote Desktop Client");
g_option_context_add_main_entries (context, remmina_options, GETTEXT_PACKAGE);
g_option_context_set_help_enabled (context, FALSE);
parsed = g_option_context_parse (context, &argc, &argv, &error);
g_strfreev (argv);
if (!parsed)
{
g_print ("option parsing failed: %s\n", error->message);
status = 1;
}
if (remmina_option_quit)
{
gtk_main_quit ();
status = 1;
}
if (remmina_option_about)
{
remmina_exec_command (REMMINA_COMMAND_ABOUT, NULL);
executed = TRUE;
}
if (remmina_option_connect)
{
remmina_exec_command (REMMINA_COMMAND_CONNECT, remmina_option_connect);
executed = TRUE;
}
if (remmina_option_edit)
{
remmina_exec_command (REMMINA_COMMAND_EDIT, remmina_option_edit);
executed = TRUE;
}
if (remmina_option_help)
{
s = g_option_context_get_help (context, TRUE, NULL);
g_print ("%s", s);
g_free (s);
status = 1;
}
if (remmina_option_new)
{
if (remmina_option_server)
{
s = g_strdup_printf ("%s,%s", remmina_option_protocol, remmina_option_server);
}
else
{
s = g_strdup (remmina_option_protocol);
}
remmina_exec_command (REMMINA_COMMAND_NEW, s);
g_free (s);
executed = TRUE;
}
if (remmina_option_pref)
{
remmina_exec_command (REMMINA_COMMAND_PREF, remmina_option_pref);
executed = TRUE;
}
if (remmina_option_plugin)
{
remmina_exec_command (REMMINA_COMMAND_PLUGIN, remmina_option_plugin);
executed = TRUE;
}
if (!executed)
{
remmina_exec_command (REMMINA_COMMAND_MAIN, NULL);
}
g_option_context_free (context);
return status;
gint status = 0;
gint argc;
gchar **argv;
GError *error = NULL;
GOptionContext *context;
gboolean parsed;
gchar *s;
gboolean executed = FALSE;
remmina_option_about = FALSE;
remmina_option_connect = NULL;
remmina_option_edit = NULL;
remmina_option_help = FALSE;
remmina_option_new = FALSE;
remmina_option_pref = NULL;
remmina_option_plugin = NULL;
remmina_option_server = NULL;
remmina_option_protocol = NULL;
argv = g_application_command_line_get_arguments(cmdline, &argc);
context = g_option_context_new("- The GTK+ Remote Desktop Client");
g_option_context_add_main_entries(context, remmina_options, GETTEXT_PACKAGE);
g_option_context_set_help_enabled(context, FALSE);
parsed = g_option_context_parse(context, &argc, &argv, &error);
g_strfreev(argv);
if (!parsed)
{
g_print("option parsing failed: %s\n", error->message);
status = 1;
}
if (remmina_option_quit)
{
gtk_main_quit();
status = 1;
}
if (remmina_option_about)
{
remmina_exec_command(REMMINA_COMMAND_ABOUT, NULL);
executed = TRUE;
}
if (remmina_option_connect)
{
remmina_exec_command(REMMINA_COMMAND_CONNECT, remmina_option_connect);
executed = TRUE;
}
if (remmina_option_edit)
{
remmina_exec_command(REMMINA_COMMAND_EDIT, remmina_option_edit);
executed = TRUE;
}
if (remmina_option_help)
{
s = g_option_context_get_help(context, TRUE, NULL);
g_print("%s", s);
g_free(s);
status = 1;
}
if (remmina_option_new)
{
if (remmina_option_server)
{
s = g_strdup_printf("%s,%s", remmina_option_protocol, remmina_option_server);
}
else
{
s = g_strdup(remmina_option_protocol);
}
remmina_exec_command(REMMINA_COMMAND_NEW, s);
g_free(s);
executed = TRUE;
}
if (remmina_option_pref)
{
remmina_exec_command(REMMINA_COMMAND_PREF, remmina_option_pref);
executed = TRUE;
}
if (remmina_option_plugin)
{
remmina_exec_command(REMMINA_COMMAND_PLUGIN, remmina_option_plugin);
executed = TRUE;
}
if (!executed)
{
remmina_exec_command(REMMINA_COMMAND_MAIN, NULL);
}
g_option_context_free(context);
return status;
}
static void
remmina_on_startup (GApplication *app)
static void remmina_on_startup(GApplication *app)
{
remmina_file_manager_init ();
remmina_pref_init ();
remmina_plugin_manager_init ();
remmina_widget_pool_init ();
remmina_sftp_plugin_register ();
remmina_ssh_plugin_register ();
remmina_icon_init ();
g_set_application_name ("Remmina");
gtk_window_set_default_icon_name ("remmina");
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
REMMINA_DATADIR G_DIR_SEPARATOR_S "icons");
remmina_file_manager_init();
remmina_pref_init();
remmina_plugin_manager_init();
remmina_widget_pool_init();
remmina_sftp_plugin_register();
remmina_ssh_plugin_register();
remmina_icon_init();
g_set_application_name("Remmina");
gtk_window_set_default_icon_name("remmina");
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
REMMINA_DATADIR G_DIR_SEPARATOR_S "icons");
}
int
main (int argc, char* argv[])
int main(int argc, char* argv[])
{
GApplication *app;
int status;
GApplication *app;
int status;
bindtextdomain (GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
bindtextdomain(GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
#ifdef HAVE_PTHREAD
g_thread_init (NULL);
gdk_threads_init ();
g_thread_init (NULL);
gdk_threads_init ();
#endif
#ifdef HAVE_LIBGCRYPT
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
gcry_check_version (NULL);
gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
gcry_check_version (NULL);
gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
#endif
gtk_init (&argc, &argv);
gtk_init(&argc, &argv);
app = g_application_new ("org.Remmina", G_APPLICATION_HANDLES_COMMAND_LINE);
g_signal_connect (app, "startup", G_CALLBACK (remmina_on_startup), NULL);
g_signal_connect (app, "command-line", G_CALLBACK (remmina_on_command_line), NULL);
g_application_set_inactivity_timeout (app, 10000);
app = g_application_new("org.Remmina", G_APPLICATION_HANDLES_COMMAND_LINE);
g_signal_connect(app, "startup", G_CALLBACK(remmina_on_startup), NULL);
g_signal_connect(app, "command-line", G_CALLBACK(remmina_on_command_line), NULL);
g_application_set_inactivity_timeout(app, 10000);
status = g_application_run (app, argc, argv);
status = g_application_run(app, argc, argv);
if (status == 0 && !g_application_get_is_remote (app))
{
THREADS_ENTER
gtk_main ();
THREADS_LEAVE
}
if (status == 0 && !g_application_get_is_remote(app))
{
THREADS_ENTER
gtk_main();
THREADS_LEAVE
}
g_object_unref (app);
g_object_unref(app);
return status;
return status;
}
......@@ -24,68 +24,53 @@
#include "remmina_widget_pool.h"
#include "remmina_about.h"
void
remmina_about_open (GtkWindow *parent)
void remmina_about_open(GtkWindow *parent)
{
const gchar *authors[] =
{
N_("Maintainers:"),
"Vic Lee <llyzs@163.com>",
"",
N_("Contributors:"),
"Alex Chateau <ash@zednet.lv>",
"Alexander Logvinov <avl@logvinov.com>",
"Harun Trefry <aihtdikh@gmail.com>",
"Nikolay Botev <bono8106@gmail.com>",
NULL
};
const gchar *artists[] =
{
"Martin Lettner <m.lettner@gmail.com>",
NULL
};
const gchar *licenses[] =
{
N_("Remmina is free software; you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
"the Free Software Foundation; either version 2 of the License, or "
"(at your option) any later version."),
N_("Remmina is distributed in the hope that it will be useful, "
"but WITHOUT ANY WARRANTY; without even the implied warranty of "
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
"GNU General Public License for more details."),
N_("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., 59 Temple Place, Suite 330, "
"Boston, MA 02111-1307, USA.")
};
gchar *license = g_strjoin ("\n\n", _(licenses[0]), _(licenses[1]), _(licenses[2]), NULL);
GtkWidget *dialog;
const gchar *authors[] =
{ N_("Maintainers:"), "Vic Lee <llyzs@163.com>", "", N_("Contributors:"), "Alex Chateau <ash@zednet.lv>",
"Alexander Logvinov <avl@logvinov.com>", "Harun Trefry <aihtdikh@gmail.com>",
"Nikolay Botev <bono8106@gmail.com>", NULL };
const gchar *artists[] =
{ "Martin Lettner <m.lettner@gmail.com>", NULL };
const gchar *licenses[] =
{ N_("Remmina is free software; you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
"the Free Software Foundation; either version 2 of the License, or "
"(at your option) any later version."), N_("Remmina is distributed in the hope that it will be useful, "
"but WITHOUT ANY WARRANTY; without even the implied warranty of "
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
"GNU General Public License for more details."), N_(
"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., 59 Temple Place, Suite 330, "
"Boston, MA 02111-1307, USA.") };
gchar *license = g_strjoin("\n\n", _(licenses[0]), _(licenses[1]), _(licenses[2]), NULL);
GtkWidget *dialog;
dialog = gtk_about_dialog_new ();
dialog = gtk_about_dialog_new();
gtk_about_dialog_set_program_name (GTK_ABOUT_DIALOG (dialog), "Remmina");
gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (dialog), VERSION);
gtk_about_dialog_set_copyright (GTK_ABOUT_DIALOG (dialog), "Copyright (C) 2009-2010 Vic Lee");
gtk_about_dialog_set_comments (GTK_ABOUT_DIALOG (dialog), _("The GTK+ Remote Desktop Client")),
gtk_about_dialog_set_license (GTK_ABOUT_DIALOG (dialog), license);
gtk_about_dialog_set_wrap_license (GTK_ABOUT_DIALOG (dialog), TRUE);
gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), "http://remmina.sourceforge.net");
gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (dialog), authors);
gtk_about_dialog_set_artists (GTK_ABOUT_DIALOG (dialog), artists);
gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (dialog), _("translator-credits"));
gtk_about_dialog_set_logo_icon_name (GTK_ABOUT_DIALOG (dialog), "remmina");
gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(dialog), "Remmina");
gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION);
gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(dialog), "Copyright (C) 2009-2010 Vic Lee");
gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(dialog), _("The GTK+ Remote Desktop Client")), gtk_about_dialog_set_license(
GTK_ABOUT_DIALOG(dialog), license);
gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(dialog), TRUE);
gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(dialog), "http://remmina.sourceforge.net");
gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(dialog), authors);
gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(dialog), artists);
gtk_about_dialog_set_translator_credits(GTK_ABOUT_DIALOG(dialog), _("translator-credits"));
gtk_about_dialog_set_logo_icon_name(GTK_ABOUT_DIALOG(dialog), "remmina");
if (parent)
{
gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
}
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
gtk_window_present (GTK_WINDOW (dialog));
if (parent)
{
gtk_window_set_transient_for(GTK_WINDOW(dialog), parent);
gtk_window_set_destroy_with_parent(GTK_WINDOW(dialog), TRUE);
}
g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
gtk_window_present(GTK_WINDOW(dialog));
remmina_widget_pool_register (dialog);
remmina_widget_pool_register(dialog);
g_free (license);
g_free(license);
}
......@@ -17,14 +17,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __REMMINAABOUT_H__
#define __REMMINAABOUT_H__
G_BEGIN_DECLS
GdkPixbuf* remmina_about_get_logo (void);
void remmina_about_open (GtkWindow *parent);
GdkPixbuf* remmina_about_get_logo(void);
void remmina_about_open(GtkWindow *parent);
G_END_DECLS
......
This diff is collapsed.
......@@ -17,7 +17,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __REMMINAAPPLETMENU_H__
#define __REMMINAAPPLETMENU_H__
......@@ -33,35 +32,36 @@ G_BEGIN_DECLS
typedef enum
{
REMMINA_APPLET_MENU_NEW_CONNECTION_NONE,
REMMINA_APPLET_MENU_NEW_CONNECTION_TOP,
REMMINA_APPLET_MENU_NEW_CONNECTION_BOTTOM
REMMINA_APPLET_MENU_NEW_CONNECTION_NONE,
REMMINA_APPLET_MENU_NEW_CONNECTION_TOP,
REMMINA_APPLET_MENU_NEW_CONNECTION_BOTTOM
} RemminaAppletMenuNewConnectionType;
typedef struct _RemminaAppletMenuPriv RemminaAppletMenuPriv;
typedef struct _RemminaAppletMenu
{
GtkMenu menu;
GtkMenu menu;
RemminaAppletMenuPriv *priv;
RemminaAppletMenuPriv *priv;
} RemminaAppletMenu;
typedef struct _RemminaAppletMenuClass
{
GtkMenuClass parent_class;
GtkMenuClass parent_class;
void (* launch_item) (RemminaAppletMenu *menu);
void (* edit_item) (RemminaAppletMenu *menu);
void (*launch_item)(RemminaAppletMenu *menu);
void (*edit_item)(RemminaAppletMenu *menu);
} RemminaAppletMenuClass;
GType remmina_applet_menu_get_type (void) G_GNUC_CONST;
GType remmina_applet_menu_get_type(void)
G_GNUC_CONST;
void remmina_applet_menu_register_item (RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem);
void remmina_applet_menu_add_item (RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem);
GtkWidget* remmina_applet_menu_new (void);
void remmina_applet_menu_set_hide_count (RemminaAppletMenu *menu, gboolean hide_count);
void remmina_applet_menu_populate (RemminaAppletMenu *menu);
void remmina_applet_menu_register_item(RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem);
void remmina_applet_menu_add_item(RemminaAppletMenu *menu, RemminaAppletMenuItem *menuitem);
GtkWidget* remmina_applet_menu_new(void);
void remmina_applet_menu_set_hide_count(RemminaAppletMenu *menu, gboolean hide_count);
void remmina_applet_menu_populate(RemminaAppletMenu *menu);
G_END_DECLS
......
......@@ -24,163 +24,162 @@
#include <stdarg.h>
#include "remmina_applet_menu_item.h"
G_DEFINE_TYPE (RemminaAppletMenuItem, remmina_applet_menu_item, GTK_TYPE_IMAGE_MENU_ITEM)
G_DEFINE_TYPE( RemminaAppletMenuItem, remmina_applet_menu_item, GTK_TYPE_IMAGE_MENU_ITEM)
#define IS_EMPTY(s) ((!s)||(s[0]==0))
static void
remmina_applet_menu_item_destroy (RemminaAppletMenuItem *item, gpointer data)
static void remmina_applet_menu_item_destroy(RemminaAppletMenuItem *item, gpointer data)
{
g_free (item->filename);
g_free (item->name);
g_free (item->group);
g_free (item->protocol);
g_free (item->server);
g_free(item->filename);
g_free(item->name);
g_free(item->group);
g_free(item->protocol);
g_free(item->server);
}
static void
remmina_applet_menu_item_class_init (RemminaAppletMenuItemClass *klass)
static void remmina_applet_menu_item_class_init(RemminaAppletMenuItemClass *klass)
{
}
static void
remmina_applet_menu_item_init (RemminaAppletMenuItem *item)
static void remmina_applet_menu_item_init(RemminaAppletMenuItem *item)
{
item->filename = NULL;
item->name = NULL;
item->group = NULL;
item->protocol = NULL;
item->server = NULL;
item->ssh_enabled = FALSE;
g_signal_connect (G_OBJECT (item), "destroy", G_CALLBACK (remmina_applet_menu_item_destroy), NULL);
item->filename = NULL;
item->name = NULL;
item->group = NULL;
item->protocol = NULL;
item->server = NULL;
item->ssh_enabled = FALSE;
g_signal_connect(G_OBJECT(item), "destroy", G_CALLBACK(remmina_applet_menu_item_destroy), NULL);
}
GtkWidget*
remmina_applet_menu_item_new (RemminaAppletMenuItemType item_type, ...)
remmina_applet_menu_item_new(RemminaAppletMenuItemType item_type, ...)
{
va_list ap;
RemminaAppletMenuItem *item;
GKeyFile *gkeyfile;
GtkWidget *widget;
const gchar *iconname;
va_start(ap, item_type);
item = REMMINA_APPLET_MENU_ITEM (g_object_new (REMMINA_TYPE_APPLET_MENU_ITEM, NULL));
item->item_type = item_type;
switch (item_type)
{
case REMMINA_APPLET_MENU_ITEM_FILE:
item->filename = g_strdup (va_arg(ap, const gchar *));
/* Load the file */
gkeyfile = g_key_file_new ();
if (!g_key_file_load_from_file (gkeyfile, item->filename, G_KEY_FILE_NONE, NULL)) return NULL;
item->name = g_key_file_get_string (gkeyfile, "remmina", "name", NULL);
item->group = g_key_file_get_string (gkeyfile, "remmina", "group", NULL);
item->protocol = g_key_file_get_string (gkeyfile, "remmina", "protocol", NULL);
item->server = g_key_file_get_string (gkeyfile, "remmina", "server", NULL);
item->ssh_enabled = g_key_file_get_boolean (gkeyfile, "remmina", "ssh_enabled", NULL);
g_key_file_free (gkeyfile);
break;
case REMMINA_APPLET_MENU_ITEM_DISCOVERED:
item->name = g_strdup (va_arg(ap, const gchar *));
item->group = g_strdup (_("Discovered"));
item->protocol = g_strdup ("VNC");
break;
case REMMINA_APPLET_MENU_ITEM_NEW:
item->name = g_strdup (_("New Connection"));
break;
}
va_end(ap);
/* Create the label */
widget = gtk_label_new (item->name);
gtk_widget_show (widget);
gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
gtk_container_add (GTK_CONTAINER (item), widget);
/* Create the image */
if (item_type == REMMINA_APPLET_MENU_ITEM_FILE || item_type == REMMINA_APPLET_MENU_ITEM_DISCOVERED)
{
if (g_strcmp0 (item->protocol, "SFTP") == 0)
{
iconname = "remmina-sftp";
}
else if (g_strcmp0 (item->protocol, "SSH") == 0)
{
iconname = "utilities-terminal";
}
else if (g_strcmp0 (item->protocol, "RDP") == 0)
{
iconname = (item->ssh_enabled ? "remmina-rdp-ssh" : "remmina-rdp");
}
else if (strncmp (item->protocol, "VNC", 3) == 0)
{
iconname = (item->ssh_enabled ? "remmina-vnc-ssh" : "remmina-vnc");
}
else if (g_strcmp0 (item->protocol, "XDMCP") == 0)
{
iconname = (item->ssh_enabled ? "remmina-xdmcp-ssh" : "remmina-xdmcp");
}
else if (g_strcmp0 (item->protocol, "NX") == 0)
{
iconname = "remmina-nx";
}
else
{
iconname = "remmina";
}
widget = gtk_image_new_from_icon_name (iconname, GTK_ICON_SIZE_MENU);
}
else
{
widget = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_MENU);
}
gtk_widget_show (widget);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), widget);
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (item), TRUE);
if (item->server)
{
gtk_widget_set_tooltip_text (GTK_WIDGET (item), item->server);
}
return GTK_WIDGET (item);
va_list ap;
RemminaAppletMenuItem *item;
GKeyFile *gkeyfile;
GtkWidget *widget;
const gchar *iconname;
va_start(ap, item_type);
item = REMMINA_APPLET_MENU_ITEM (g_object_new (REMMINA_TYPE_APPLET_MENU_ITEM, NULL));
item->item_type = item_type;
switch (item_type)
{
<