Changeset 9989


Ignore:
Timestamp:
Jan 21, 2010, 8:51:48 PM (12 years ago)
Author:
charles
Message:

(trunk gtk) #2780 "for themability, T needs unique icon names for window, system tray, and popup icons" -- added to trunk for 1.81

Location:
trunk/gtk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/actions.c

    r9930 r9989  
    145145static const BuiltinIconInfo my_fallback_icons[] =
    146146{
    147     { tr_icon_logo, "transmission"      },
     147    { tr_icon_logo, WINDOW_ICON         },
     148    { tr_icon_logo, TRAY_ICON           },
     149    { tr_icon_logo, NOTIFICATION_ICON   },
    148150    { tr_icon_lock, "transmission-lock" },
    149151    { options_icon, "options"           },
  • trunk/gtk/actions.h

    r9868 r9989  
    1616#include <gtk/gtk.h>
    1717#include "tr-core.h"
     18
     19#define WINDOW_ICON        "transmission-main-window-icon"
     20#define TRAY_ICON          "transmission-tray-icon"
     21#define NOTIFICATION_ICON  "transmission-notification-icon"
     22
    1823
    1924void       actions_init( GtkUIManager * ui_manager,
  • trunk/gtk/notify.c

    r9868 r9989  
    2222
    2323#include <glib/gi18n.h>
     24#include "actions.h" /* NOTIFICATION_ICON */
    2425#include "conf.h"
    2526#include "notify.h"
     
    9091}
    9192
     93static void
     94addIcon( NotifyNotification * notify )
     95{
     96    int size = 32;
     97    GtkIconTheme * theme;
     98    GdkPixbuf * icon;
     99
     100    gtk_icon_size_lookup( GTK_ICON_SIZE_DIALOG, &size, &size );
     101    theme = gtk_icon_theme_get_default( );
     102    icon = gtk_icon_theme_load_icon( theme, NOTIFICATION_ICON, size, 0, NULL );
     103
     104    if( icon != NULL )
     105    {
     106        notify_notification_set_icon_from_pixbuf( notify, icon );
     107        g_object_unref( icon );
     108    }
     109}
     110
    92111void
    93112tr_notify_send( TrTorrent *tor )
     
    112131        n = notify_notification_new( _( "Torrent Complete" ),
    113132                                     info->name,
    114                                      "transmission", NULL );
     133                                     NULL, NULL );
     134        addIcon( n );
    115135
    116136        if( can_support_actions( ) )
     
    137157    {
    138158        NotifyNotification * n = notify_notification_new(
    139             _( "Torrent Added" ), name, "transmission", NULL );
     159            _( "Torrent Added" ), name, NULL, NULL );
     160        addIcon( n );
    140161        notify_notification_set_timeout( n, NOTIFY_EXPIRES_DEFAULT );
    141162        notify_notification_show( n, NULL );
  • trunk/gtk/tr-icon.c

    r9868 r9989  
    112112tr_icon_new( TrCore * core )
    113113{
    114     GtkStatusIcon * icon = gtk_status_icon_new_from_icon_name(
    115         "transmission" );
     114    const char * icon_name = TRAY_ICON;
     115    GtkStatusIcon * icon = gtk_status_icon_new_from_icon_name( icon_name );
    116116
    117117    g_signal_connect( icon, "activate", G_CALLBACK( activated ), NULL );
Note: See TracChangeset for help on using the changeset viewer.