Changeset 9631
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/actions.c
r9624 r9631 109 109 { "edit-menu", NULL, N_( "_Edit" ), NULL, NULL, NULL }, 110 110 { "help-menu", NULL, N_( "_Help" ), NULL, NULL, NULL }, 111 { "copy-magnet-link-to-clipboard", GTK_STOCK_COPY, N_("Copy _Magnet Link to Clipboard" ), "<control>M", NULL, G_CALLBACK( action_cb ) }, 111 112 { "add-torrent-from-url", GTK_STOCK_ADD, N_("Add _URL..." ), NULL, N_( "Add URL..." ), G_CALLBACK( action_cb ) }, 112 113 { "add-torrent-toolbar", GTK_STOCK_ADD, NULL, NULL, N_( "Add a torrent" ), G_CALLBACK( action_cb ) }, … … 115 116 { "show-stats", NULL, N_( "_Statistics" ), NULL, NULL, G_CALLBACK( action_cb ) }, 116 117 { "donate", NULL, N_( "_Donate" ), NULL, NULL, G_CALLBACK( action_cb ) }, 117 { "verify-torrent", NULL, N_( "_Verify Local Data" ), NULL, NULL, G_CALLBACK( action_cb ) },118 { "verify-torrent", NULL, N_( "_Verify Local Data" ), "<control>V", NULL, G_CALLBACK( action_cb ) }, 118 119 { "pause-torrent", GTK_STOCK_MEDIA_PAUSE, N_( "_Pause" ), "<control>P", N_( "Pause torrent" ), G_CALLBACK( action_cb ) }, 119 120 { "pause-all-torrents", GTK_STOCK_MEDIA_PAUSE, N_( "_Pause All" ), NULL, N_( "Pause all torrents" ), G_CALLBACK( action_cb ) }, -
trunk/gtk/details.c
r9627 r9631 77 77 78 78 GtkWidget * hash_lb; 79 GtkWidget * magnet_lb;80 79 GtkWidget * privacy_lb; 81 80 GtkWidget * origin_lb; … … 621 620 { 622 621 int i; 623 char * freeme;624 622 const char * str; 625 623 const char * none = _( "None" ); … … 887 885 str = mixed; 888 886 gtr_label_set_text( GTK_LABEL( di->hash_lb ), str ); 889 890 /* magnet lb */891 freeme = NULL;892 if( n<=0 )893 str = none;894 else if ( n>1 )895 str = mixed;896 else if( infos[0]->isPrivate )897 str = _( "Private Torrent" );898 else899 str = freeme = tr_torrentGetMagnetLink( torrents[0] );900 gtr_label_set_text( GTK_LABEL( di->magnet_lb ), str );901 tr_free( freeme );902 887 903 888 /* error */ … … 1014 999 hig_workarea_add_row( t, &row, _( "Hash:" ), l, NULL ); 1015 1000 di->hash_lb = l; 1016 1017 /* magnet url */1018 l = g_object_new( GTK_TYPE_LABEL, "selectable", TRUE,1019 "ellipsize", PANGO_ELLIPSIZE_END,1020 NULL );1021 hig_workarea_add_row( t, &row, _( "Magnet link:" ), l, NULL );1022 di->magnet_lb = l;1023 1001 1024 1002 /* privacy */ -
trunk/gtk/main.c
r9581 r9631 180 180 action_sensitize( "open-torrent-folder", counts.totalCount == 1 ); 181 181 action_sensitize( "relocate-torrent", counts.totalCount == 1 ); 182 action_sensitize( "copy-magnet-link-to-clipboard", counts.totalCount == 1 ); 182 183 183 184 canUpdate = 0; … … 1344 1345 } 1345 1346 1347 static void 1348 copyMagnetLinkToClipboard( GtkWidget * w, tr_torrent * tor ) 1349 { 1350 char * magnet = tr_torrentGetMagnetLink( tor ); 1351 GdkDisplay * display = gtk_widget_get_display( w ); 1352 GdkAtom selection = GDK_SELECTION_CLIPBOARD; 1353 GtkClipboard * clipboard = gtk_clipboard_get_for_display( display, selection ); 1354 gtk_clipboard_set_text( clipboard, magnet, -1 ); 1355 tr_free( magnet ); 1356 } 1357 1346 1358 void 1347 1359 doAction( const char * action_name, gpointer user_data ) … … 1382 1394 startAllTorrents( data ); 1383 1395 } 1396 else if( !strcmp( action_name, "copy-magnet-link-to-clipboard" ) ) 1397 { 1398 tr_torrent * tor = getFirstSelectedTorrent( data ); 1399 if( tor != NULL ) 1400 { 1401 copyMagnetLinkToClipboard( GTK_WIDGET( data->wind ), tor ); 1402 } 1403 } 1384 1404 else if( !strcmp( action_name, "relocate-torrent" ) ) 1385 1405 { 1386 1406 tr_torrent * tor = getFirstSelectedTorrent( data ); 1387 if( tor )1407 if( tor != NULL ) 1388 1408 { 1389 1409 GtkWindow * parent = GTK_WINDOW( data->wind ); -
trunk/gtk/ui.h
r9624 r9631 20 20 " <menu action='torrent-menu'>\n" 21 21 " <menuitem action='show-torrent-properties'/>\n" 22 " <menuitem action='open-torrent-folder'/>\n"23 " <menuitem action='relocate-torrent'/>\n"24 22 " <separator/>\n" 25 23 " <menuitem action='start-torrent'/>\n" 26 24 " <menuitem action='update-tracker'/>\n" 27 25 " <menuitem action='pause-torrent'/>\n" 26 " <menuitem action='copy-magnet-link-to-clipboard'/>\n" 27 " <separator/>\n" 28 " <menuitem action='open-torrent-folder'/>\n" 29 " <menuitem action='relocate-torrent'/>\n" 28 30 " <menuitem action='verify-torrent'/>\n" 29 31 " <separator/>\n" … … 72 74 " <popup name='main-window-popup'>\n" 73 75 " <menuitem action='show-torrent-properties'/>\n" 74 " <menuitem action='open-torrent-folder'/>\n"75 " <separator/>\n"76 " <menuitem action='start-torrent'/>\n"77 " <menuitem action='update-tracker'/>\n"78 " <menuitem action='pause-torrent'/>\n"79 " <menuitem action='verify-torrent'/>\n"80 76 " <separator/>\n" 81 77 " <menu action='sort-menu'>\n" … … 93 89 " </menu>\n" 94 90 " <separator/>\n" 91 " <menuitem action='start-torrent'/>\n" 92 " <menuitem action='update-tracker'/>\n" 93 " <menuitem action='pause-torrent'/>\n" 94 " <menuitem action='copy-magnet-link-to-clipboard'/>\n" 95 " <separator/>\n" 96 " <menuitem action='open-torrent-folder'/>\n" 97 " <menuitem action='verify-torrent'/>\n" 95 98 " <menuitem action='relocate-torrent'/>\n" 96 99 " <separator/>\n"
Note: See TracChangeset
for help on using the changeset viewer.