mirror of
https://github.com/transmission/transmission
synced 2025-02-07 23:14:41 +00:00
(trunk gtk) add a Donate item to the Help menu
This commit is contained in:
parent
5282a62733
commit
149f8c90d8
4 changed files with 14 additions and 2 deletions
|
@ -106,6 +106,7 @@ static GtkActionEntry entries[] =
|
|||
{ "add-torrent-menu", GTK_STOCK_ADD, N_( "_Add..." ), "<control>D", N_( "Add a torrent" ), G_CALLBACK( action_cb ) },
|
||||
{ "start-torrent", GTK_STOCK_MEDIA_PLAY, N_( "_Start" ), "<control>S", N_( "Start torrent" ), G_CALLBACK( action_cb ) },
|
||||
{ "show-stats", NULL, N_( "_Statistics" ), NULL, NULL, G_CALLBACK( action_cb ) },
|
||||
{ "donate", NULL, N_( "_Donate" ), NULL, NULL, G_CALLBACK( action_cb ) },
|
||||
{ "verify-torrent", NULL, N_( "_Verify Local Data" ), NULL, NULL, G_CALLBACK( action_cb ) },
|
||||
{ "pause-torrent", GTK_STOCK_MEDIA_PAUSE, N_( "_Pause" ), "<control>P", N_( "Pause torrent" ), G_CALLBACK( action_cb ) },
|
||||
{ "pause-all-torrents", GTK_STOCK_MEDIA_PAUSE, N_( "_Pause All" ), NULL, N_( "Pause all torrents" ), G_CALLBACK( action_cb ) },
|
||||
|
|
|
@ -1329,6 +1329,10 @@ doAction( const char * action_name, gpointer user_data )
|
|||
GtkWidget * dialog = stats_dialog_create( data->wind, data->core );
|
||||
gtk_widget_show( dialog );
|
||||
}
|
||||
else if( !strcmp( action_name, "donate" ) )
|
||||
{
|
||||
gtr_open_file( "http://www.transmissionbt.com/donate.php" );
|
||||
}
|
||||
else if( !strcmp( action_name, "start-torrent" ) )
|
||||
{
|
||||
GtkTreeSelection * s = tr_window_get_selection( data->wind );
|
||||
|
|
2
gtk/ui.h
2
gtk/ui.h
|
@ -50,6 +50,8 @@ static const char * fallback_ui_file =
|
|||
" <menuitem action='toggle-message-log'/>\n"
|
||||
" <menuitem action='show-stats'/>\n"
|
||||
" <separator/>\n"
|
||||
" <menuitem action='donate'/>\n"
|
||||
" <separator/>\n"
|
||||
" <menuitem action='help'/>\n"
|
||||
" <menuitem action='show-about-dialog'/>\n"
|
||||
" </menu>\n"
|
||||
|
|
|
@ -504,8 +504,13 @@ gtr_open_file( const char * path )
|
|||
if( !opened )
|
||||
{
|
||||
char * argv[] = { (char*)"xdg-open", (char*)path, NULL };
|
||||
g_spawn_async( NULL, argv, NULL, G_SPAWN_SEARCH_PATH,
|
||||
NULL, NULL, NULL, NULL );
|
||||
opened = g_spawn_async( NULL, argv, NULL, G_SPAWN_SEARCH_PATH,
|
||||
NULL, NULL, NULL, NULL );
|
||||
}
|
||||
|
||||
if( !opened )
|
||||
{
|
||||
g_message( "Unable to open \"%s\"", path );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue