#45 use standard icon names

open
nobody
None
5
2008-08-12
2008-08-12
Anonymous
No

tsclient should use standard icon names for the providers, where available. And it should use fallback
when loading the icon, so that folder-remote-ssh falls back to folder-remote

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I would have attached the patch if the sf bug tracker was less awkward...

    +++ tsclient-2.0.1/src/plugins/default/tsc-generic-provider.c 2008-08-11 23:55:42.000000000 -0400
    @@ -34,7 +34,7 @@ tsc_generic_provider_init (TSCGenericPro
    parent->name = "Generic";
    parent->display_name = _("Custom Command");
    parent->description = _("Create a generic freeform connection");
    - parent->icon_name = "gnome-run";
    + parent->icon_name = "system-run";
    parent->enabled = TRUE;
    }

    diff -up tsclient-2.0.1/src/plugins/default/tsc-ssh-provider.c.icon-names tsclient-2.0.1/src/plugins/default/tsc-ssh-provider.c
    --- tsclient-2.0.1/src/plugins/default/tsc-ssh-provider.c.icon-names 2008-05-20 12:50:13.000000000 -0400
    +++ tsclient-2.0.1/src/plugins/default/tsc-ssh-provider.c 2008-08-11 23:55:42.000000000 -0400
    @@ -35,7 +35,7 @@ tsc_ssh_provider_init (TSCSshProvider *p
    parent->name = "SSH";
    parent->display_name = _("SSH");
    parent->description = _("Create an ssh connection");
    - parent->icon_name = "gnome-fs-ssh";
    + parent->icon_name = "folder-remote-ssh";
    parent->enabled = tsc_util_program_exists ("ssh");
    }

    diff -up tsclient-2.0.1/src/plugins/default/tsc-vnc-provider.c.icon-names tsclient-2.0.1/src/plugins/default/tsc-vnc-provider.c
    --- tsclient-2.0.1/src/plugins/default/tsc-vnc-provider.c.icon-names 2008-05-09 16:22:54.000000000 -0400
    +++ tsclient-2.0.1/src/plugins/default/tsc-vnc-provider.c 2008-08-11 23:55:42.000000000 -0400
    @@ -64,7 +64,7 @@ tsc_vnc_provider_init (TSCVncProvider *p
    parent->name = "VNC";
    parent->display_name = _("VNC");
    parent->description = _("Create a VNC connection");
    - parent->icon_name = "gnome-remote-desktop";
    + parent->icon_name = "preferences-desktop-remote-desktop";
    parent->enabled = tsc_util_program_exists ("vncviewer");
    }

    diff -up tsclient-2.0.1/src/tsc-util.c.icon-names tsclient-2.0.1/src/tsc-util.c
    --- tsclient-2.0.1/src/tsc-util.c.icon-names 2008-08-12 00:00:50.000000000 -0400
    +++ tsclient-2.0.1/src/tsc-util.c 2008-08-12 00:01:27.000000000 -0400
    @@ -186,7 +186,7 @@ tsc_util_get_icon (const char *name, int
    GtkIconTheme *theme;

    theme = gtk_icon_theme_get_default ();
    - return gtk_icon_theme_load_icon (theme, name, size, 0, NULL);
    + return gtk_icon_theme_load_icon (theme, name, size, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL);
    }

    TSCUserLevel

     
  • Nobody/Anonymous

    Logged In: NO

    Hmm, should have tested the patch first... to make the generic fallback work,
    you actually need this:

    diff -up tsclient-2.0.1/src/tsc-window.c.icon-names tsclient-2.0.1/src/tsc-window.c
    --- tsclient-2.0.1/src/tsc-window.c.icon-names 2008-08-12 00:18:54.000000000 -0400
    +++ tsclient-2.0.1/src/tsc-window.c 2008-08-12 00:19:03.000000000 -0400
    @@ -248,6 +248,7 @@ tsc_window_create_connection_menu (TSCWi
    GtkWidget *item;
    GtkImage *image;
    const GList *l;
    + GIcon *gicon;

    menu = gtk_menu_new ();

    @@ -264,8 +265,10 @@ tsc_window_create_connection_menu (TSCWi
    }

    item = gtk_image_menu_item_new_with_label (tsc_provider_get_display_name (provider));
    - image = GTK_IMAGE (gtk_image_new_from_icon_name (tsc_provider_get_icon_name (provider),
    - GTK_ICON_SIZE_MENU));
    + gicon = g_themed_icon_new_with_default_fallbacks (tsc_provider_get_icon_name (provider));
    + image = GTK_IMAGE (gtk_image_new_from_gicon (gicon,
    + GTK_ICON_SIZE_MENU));
    + g_object_unref (gicon);

    gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), GTK_WIDGET (image));

     

Log in to post a comment.