1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-13 07:33:02 +00:00

nice job.

This commit is contained in:
Charles Kerr 2010-08-05 13:24:46 +00:00
parent 2db6183add
commit 70be70d85f
5 changed files with 20 additions and 17 deletions

View file

@ -64,7 +64,8 @@
***/
#define LINEWIDTH 80
#define MY_NAME "transmissioncli"
#define MY_CONFIG_NAME "transmission"
#define MY_READABLE_NAME "transmission-cli"
static tr_bool verify = 0;
static sig_atomic_t gotsig = 0;
@ -99,7 +100,7 @@ getUsage( void )
{
return "A fast and easy BitTorrent client\n"
"\n"
"Usage: " MY_NAME " [options] <file|url|magnet>";
"Usage: " MY_READABLE_NAME " [options] <file|url|magnet>";
}
static int parseCommandLine( tr_benc*, int argc, const char ** argv );
@ -206,7 +207,7 @@ getConfigDir( int argc, const char ** argv )
tr_optind = ind;
if( configDir == NULL )
configDir = tr_getDefaultConfigDir( MY_NAME );
configDir = tr_getDefaultConfigDir( MY_CONFIG_NAME );
return configDir;
}
@ -232,14 +233,14 @@ main( int argc, char ** argv )
/* user needs to pass in at least one argument */
if( argc < 2 ) {
tr_getopt_usage( MY_NAME, getUsage( ), options );
tr_getopt_usage( MY_READABLE_NAME, getUsage( ), options );
return EXIT_FAILURE;
}
/* load the defaults from config file + libtransmission defaults */
tr_bencInitDict( &settings, 0 );
configDir = getConfigDir( argc, (const char**)argv );
tr_sessionLoadSettings( &settings, configDir, MY_NAME );
tr_sessionLoadSettings( &settings, configDir, MY_CONFIG_NAME );
/* the command line overrides defaults */
if( parseCommandLine( &settings, argc, (const char**)argv ) )

View file

@ -40,7 +40,8 @@
#include "tr-prefs.h"
#include "util.h"
#define MY_NAME "transmission"
#define MY_CONFIG_NAME "transmission"
#define MY_READABLE_NAME "transmission-gtk"
static char * gl_confdir = NULL;
static char * gl_lockpath = NULL;
@ -220,7 +221,7 @@ getPrefs( void )
{
tr_bencInitDict( &settings, 0 );
tr_prefs_init_defaults( &settings );
tr_sessionLoadSettings( &settings, gl_confdir, MY_NAME );
tr_sessionLoadSettings( &settings, gl_confdir, MY_CONFIG_NAME );
loaded = TRUE;
}

View file

@ -59,7 +59,8 @@
#include "util.h"
#include "ui.h"
#define MY_NAME "transmission"
#define MY_CONFIG_NAME "transmission"
#define MY_READABLE_NAME "transmission-gtk"
#if GTK_CHECK_VERSION( 2, 8, 0 )
#define SHOW_LICENSE
@ -505,7 +506,7 @@ main( int argc, char ** argv )
gboolean showversion = FALSE;
gboolean startpaused = FALSE;
gboolean startminimized = FALSE;
const char * domain = MY_NAME;
const char * domain = MY_READABLE_NAME;
char * configDir = NULL;
gtr_lockfile_state_t tr_state;
@ -554,7 +555,7 @@ main( int argc, char ** argv )
}
if( configDir == NULL )
configDir = (char*) tr_getDefaultConfigDir( MY_NAME );
configDir = (char*) tr_getDefaultConfigDir( MY_CONFIG_NAME );
tr_notify_init( );
didinit = cf_init( configDir, NULL ); /* must come before actions_init */
@ -635,7 +636,7 @@ main( int argc, char ** argv )
actions_init ( myUIManager, cbdata );
gtk_ui_manager_add_ui_from_string ( myUIManager, fallback_ui_file, -1, NULL );
gtk_ui_manager_ensure_update ( myUIManager );
gtk_window_set_default_icon_name ( MY_NAME );
gtk_window_set_default_icon_name ( MY_READABLE_NAME );
/* create main window now to be a parent to any error dialogs */
win = GTK_WINDOW( tr_window_new( myUIManager, cbdata->core ) );
@ -1398,7 +1399,7 @@ about( GtkWindow * parent )
"website-label", website_url,
"copyright",
_( "Copyright (c) The Transmission Project" ),
"logo-icon-name", MY_NAME,
"logo-icon-name", MY_READABLE_NAME,
#ifdef SHOW_LICENSE
"license", LICENSE,
"wrap-license", TRUE,

View file

@ -21,7 +21,7 @@
#include "tr-icon.h"
#include "util.h"
#define MY_NAME "transmission"
#define ICON_NAME "transmission"
#ifndef STATUS_ICON_SUPPORTED
@ -134,12 +134,12 @@ getIconName( void )
/* if the tray's icon is a 48x48 file, use it;
* otherwise, use the fallback builtin icon */
if( !gtk_icon_theme_has_icon( theme, TRAY_ICON ) )
icon_name = MY_NAME;
icon_name = ICON_NAME;
else {
GtkIconInfo * icon_info = gtk_icon_theme_lookup_icon( theme, TRAY_ICON, 48, GTK_ICON_LOOKUP_USE_BUILTIN );
const gboolean icon_is_builtin = gtk_icon_info_get_filename ( icon_info ) == NULL;
gtk_icon_info_free ( icon_info );
icon_name = icon_is_builtin ? MY_NAME : TRAY_ICON;
icon_name = icon_is_builtin ? ICON_NAME : TRAY_ICON;
}
return icon_name;
@ -151,7 +151,7 @@ tr_icon_new( TrCore * core)
{
GtkWidget * w;
const char * icon_name = getIconName( );
AppIndicator * indicator = app_indicator_new( MY_NAME, icon_name, APP_INDICATOR_CATEGORY_SYSTEM_SERVICES );
AppIndicator * indicator = app_indicator_new( ICON_NAME, icon_name, APP_INDICATOR_CATEGORY_SYSTEM_SERVICES );
app_indicator_set_status( indicator, APP_INDICATOR_STATUS_ACTIVE );
w = action_get_widget( "/icon-popup" );
app_indicator_set_menu( indicator, GTK_MENU ( w ) );

View file

@ -16,7 +16,7 @@ gtk/sexy-icon-entry.c
gtk/stats.c
gtk/torrent-cell-renderer.c
gtk/tracker-list.c
gtk/transmission.desktop.in
gtk/transmission-gtk.desktop.in
gtk/tr-core.c
gtk/tr-icon.c
gtk/tr-prefs.c