Changeset 11720
- Timestamp:
- Jan 20, 2011, 7:48:13 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/actions.c
r11709 r11720 108 108 { "help-menu", NULL, N_( "_Help" ), NULL, NULL, NULL }, 109 109 { "copy-magnet-link-to-clipboard", GTK_STOCK_COPY, N_("Copy _Magnet Link to Clipboard" ), "<control>M", NULL, G_CALLBACK( action_cb ) }, 110 { " add-torrent-from-url", GTK_STOCK_ADD, N_("Add _URL..." ), NULL, N_( "AddURL..." ), G_CALLBACK( action_cb ) },111 { " add-torrent-toolbar", GTK_STOCK_ADD, NULL, NULL, N_( "Adda torrent" ), G_CALLBACK( action_cb ) },112 { " add-torrent-menu", GTK_STOCK_ADD, N_( "_Add File..." ), "<control>D", N_( "Adda torrent" ), G_CALLBACK( action_cb ) },110 { "open-torrent-from-url", GTK_STOCK_OPEN, N_("Open _URL..." ), "<control>U", N_( "Open URL..." ), G_CALLBACK( action_cb ) }, 111 { "open-torrent-toolbar", GTK_STOCK_OPEN, NULL, NULL, N_( "Open a torrent" ), G_CALLBACK( action_cb ) }, 112 { "open-torrent-menu", GTK_STOCK_OPEN, NULL, NULL, N_( "Open a torrent" ), G_CALLBACK( action_cb ) }, 113 113 { "start-torrent", GTK_STOCK_MEDIA_PLAY, N_( "_Start" ), "<control>S", N_( "Start torrent" ), G_CALLBACK( action_cb ) }, 114 114 { "show-stats", NULL, N_( "_Statistics" ), NULL, NULL, G_CALLBACK( action_cb ) }, -
trunk/gtk/add-dialog.c
r11709 r11720 87 87 ****/ 88 88 89 struct AddData89 struct OpenData 90 90 { 91 91 TrCore * core; … … 101 101 102 102 static void 103 removeOldTorrent( struct AddData * data )103 removeOldTorrent( struct OpenData * data ) 104 104 { 105 105 if( data->gtor ) … … 117 117 gpointer gdata ) 118 118 { 119 struct AddData * data = gdata;119 struct OpenData * data = gdata; 120 120 121 121 if( data->gtor ) … … 151 151 152 152 static void 153 updateTorrent( struct AddData * o )153 updateTorrent( struct OpenData * o ) 154 154 { 155 155 const gboolean isLocalFile = tr_ctorGetSourceFile( o->ctor ) != NULL; … … 181 181 sourceChanged( GtkFileChooserButton * b, gpointer gdata ) 182 182 { 183 struct AddData * data = gdata;183 struct OpenData * data = gdata; 184 184 char * filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( b ) ); 185 185 … … 222 222 downloadDirChanged( GtkFileChooserButton * b, gpointer gdata ) 223 223 { 224 struct AddData * data = gdata;224 struct OpenData * data = gdata; 225 225 char * fname = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( b ) ); 226 226 … … 267 267 GtkWidget * grab; 268 268 GtkWidget * source_chooser; 269 struct AddData * data;269 struct OpenData * data; 270 270 uint8_t flag; 271 271 GSList * list; … … 277 277 NULL ); 278 278 gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL ); 279 grab = gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_ ADD, GTK_RESPONSE_ACCEPT );279 grab = gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT ); 280 280 gtk_dialog_set_default_response( GTK_DIALOG( d ), 281 281 GTK_RESPONSE_ACCEPT ); … … 289 289 g_assert( str ); 290 290 291 data = g_new0( struct AddData, 1 );291 data = g_new0( struct OpenData, 1 ); 292 292 data->core = core; 293 293 data->ctor = ctor; … … 394 394 395 395 static void 396 onAddDialogResponse( GtkDialog * dialog, 397 int response, 398 gpointer core ) 396 onOpenDialogResponse( GtkDialog * dialog, int response, gpointer core ) 399 397 { 400 398 char * folder; … … 422 420 423 421 GtkWidget* 424 gtr_torrent_ add_from_file_dialog_new( GtkWindow * parent, TrCore * core )422 gtr_torrent_open_from_file_dialog_new( GtkWindow * parent, TrCore * core ) 425 423 { 426 424 GtkWidget * w; … … 428 426 const char * folder; 429 427 430 w = gtk_file_chooser_dialog_new( _( " Adda Torrent" ), parent,428 w = gtk_file_chooser_dialog_new( _( "Open a Torrent" ), parent, 431 429 GTK_FILE_CHOOSER_ACTION_OPEN, 432 430 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, 433 GTK_STOCK_ ADD, GTK_RESPONSE_ACCEPT,431 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, 434 432 NULL ); 435 433 gtk_dialog_set_alternative_button_order( GTK_DIALOG( w ), … … 439 437 gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER( w ), TRUE ); 440 438 addTorrentFilters( GTK_FILE_CHOOSER( w ) ); 441 g_signal_connect( w, "response", G_CALLBACK( 442 onAddDialogResponse ), core ); 439 g_signal_connect( w, "response", G_CALLBACK( onOpenDialogResponse ), core ); 443 440 444 441 if( ( folder = gtr_pref_string_get( PREF_KEY_OPEN_DIALOG_FOLDER ) ) ) … … 459 456 460 457 static void 461 on AddURLResponse( GtkDialog * dialog, int response, gpointer user_data )458 onOpenURLResponse( GtkDialog * dialog, int response, gpointer user_data ) 462 459 { 463 460 gboolean destroy = TRUE; … … 493 490 494 491 GtkWidget* 495 gtr_torrent_ add_from_url_dialog_new( GtkWindow * parent, TrCore * core )492 gtr_torrent_open_from_url_dialog_new( GtkWindow * parent, TrCore * core ) 496 493 { 497 494 int row; … … 500 497 GtkWidget * w; 501 498 502 w = gtk_dialog_new_with_buttons( _( " AddURL" ), parent,499 w = gtk_dialog_new_with_buttons( _( "Open URL" ), parent, 503 500 GTK_DIALOG_DESTROY_WITH_PARENT, 504 501 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, 505 GTK_STOCK_ ADD, GTK_RESPONSE_ACCEPT,502 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, 506 503 NULL ); 507 504 gtk_dialog_set_alternative_button_order( GTK_DIALOG( w ), … … 509 506 GTK_RESPONSE_CANCEL, 510 507 -1 ); 511 g_signal_connect( w, "response", G_CALLBACK( on AddURLResponse ), core );508 g_signal_connect( w, "response", G_CALLBACK( onOpenURLResponse ), core ); 512 509 513 510 row = 0; 514 511 t = hig_workarea_create( ); 515 hig_workarea_add_section_title( t, &row, _( " Addtorrent from URL" ) );512 hig_workarea_add_section_title( t, &row, _( "Open torrent from URL" ) ); 516 513 e = gtk_entry_new( ); 517 514 gtk_widget_set_size_request( e, 400, -1 ); -
trunk/gtk/add-dialog.h
r11709 r11720 11 11 */ 12 12 13 #ifndef GTR_ ADD_DIALOG_H14 #define GTR_ ADD_DIALOG_H13 #ifndef GTR_OPEN_DIALOG_H 14 #define GTR_OPEN_DIALOG_H 15 15 16 16 #include <gtk/gtk.h> 17 17 #include "tr-core.h" 18 18 19 GtkWidget* gtr_torrent_ add_from_url_dialog_new ( GtkWindow * parent, TrCore * core );20 GtkWidget* gtr_torrent_ add_from_file_dialog_new( GtkWindow * parent, TrCore * core );19 GtkWidget* gtr_torrent_open_from_url_dialog_new ( GtkWindow * parent, TrCore * core ); 20 GtkWidget* gtr_torrent_open_from_file_dialog_new( GtkWindow * parent, TrCore * core ); 21 21 22 22 /* This dialog assumes ownership of the ctor */ -
trunk/gtk/main.c
r11709 r11720 1703 1703 gboolean changed = FALSE; 1704 1704 1705 if( !strcmp( action_name, " add-torrent-from-url" ) )1706 { 1707 GtkWidget * w = gtr_torrent_ add_from_url_dialog_new( data->wind, data->core );1705 if( !strcmp( action_name, "open-torrent-from-url" ) ) 1706 { 1707 GtkWidget * w = gtr_torrent_open_from_url_dialog_new( data->wind, data->core ); 1708 1708 gtk_widget_show( w ); 1709 1709 } 1710 else if( !strcmp( action_name, " add-torrent-menu" )1711 || !strcmp( action_name, " add-torrent-toolbar" ) )1712 { 1713 GtkWidget * w = gtr_torrent_ add_from_file_dialog_new( data->wind, data->core );1710 else if( !strcmp( action_name, "open-torrent-menu" ) 1711 || !strcmp( action_name, "open-torrent-toolbar" ) ) 1712 { 1713 GtkWidget * w = gtr_torrent_open_from_file_dialog_new( data->wind, data->core ); 1714 1714 gtk_widget_show( w ); 1715 1715 } -
trunk/gtk/tr-window.c
r11709 r11720 608 608 /* toolbar */ 609 609 toolbar = p->toolbar = gtr_action_get_widget( "/main-window-toolbar" ); 610 gtr_action_set_important( " add-torrent-toolbar", TRUE );610 gtr_action_set_important( "open-torrent-toolbar", TRUE ); 611 611 gtr_action_set_important( "show-torrent-properties", TRUE ); 612 612 -
trunk/gtk/ui.h
r11197 r11720 3 3 " <menubar name='main-window-menu'>\n" 4 4 " <menu action='file-menu'>\n" 5 " <menuitem action=' add-torrent-menu'/>\n"6 " <menuitem action=' add-torrent-from-url'/>\n"5 " <menuitem action='open-torrent-menu'/>\n" 6 " <menuitem action='open-torrent-from-url'/>\n" 7 7 " <menuitem action='new-torrent'/>\n" 8 8 " <separator/>\n" … … 63 63 "\n" 64 64 " <toolbar name='main-window-toolbar'>\n" 65 " <toolitem action=' add-torrent-toolbar'/>\n"65 " <toolitem action='open-torrent-toolbar'/>\n" 66 66 " <toolitem action='start-torrent'/>\n" 67 67 " <toolitem action='pause-torrent'/>\n" … … 103 103 " <menuitem action='toggle-main-window'/>\n" 104 104 " <separator/>\n" 105 " <menuitem action=' add-torrent-menu'/>\n"106 " <menuitem action=' add-torrent-from-url'/>\n"105 " <menuitem action='open-torrent-menu'/>\n" 106 " <menuitem action='open-torrent-from-url'/>\n" 107 107 " <separator/>\n" 108 108 " <menuitem action='pause-all-torrents'/>\n" -
trunk/qt/mainwin.cc
r11263 r11720 105 105 106 106 // icons 107 ui.action_ AddFile->setIcon( getStockIcon( "list-add", QStyle::SP_DialogOpenButton ) );107 ui.action_OpenFile->setIcon( getStockIcon( "folder-open", QStyle::SP_DialogOpenButton ) ); 108 108 ui.action_New->setIcon( getStockIcon( "document-new", QStyle::SP_DesktopIcon ) ); 109 109 ui.action_Properties->setIcon( getStockIcon( "document-properties", QStyle::SP_DesktopIcon ) ); … … 145 145 connect( ui.action_StartAll, SIGNAL(triggered()), this, SLOT(startAll())); 146 146 connect( ui.action_PauseAll, SIGNAL(triggered()), this, SLOT(pauseAll())); 147 connect( ui.action_ AddFile, SIGNAL(triggered()), this, SLOT(openTorrent()));147 connect( ui.action_OpenFile, SIGNAL(triggered()), this, SLOT(openTorrent())); 148 148 connect( ui.action_AddURL, SIGNAL(triggered()), this, SLOT(openURL())); 149 149 connect( ui.action_New, SIGNAL(triggered()), this, SLOT(newTorrent())); … … 215 215 216 216 QMenu * menu = new QMenu( ); 217 menu->addAction( ui.action_ AddFile );217 menu->addAction( ui.action_OpenFile ); 218 218 menu->addAction( ui.action_AddURL ); 219 219 menu->addSeparator( ); … … 1028 1028 QFileDialog * myFileDialog; 1029 1029 myFileDialog = new QFileDialog( this, 1030 tr( " AddTorrent" ),1030 tr( "Open Torrent" ), 1031 1031 myPrefs.getString( Prefs::OPEN_DIALOG_FOLDER ), 1032 1032 tr( "Torrent Files (*.torrent);;All Files (*.*)" ) ); -
trunk/qt/mainwin.ui
r11196 r11720 127 127 <string>&File</string> 128 128 </property> 129 <addaction name="action_ AddFile"/>129 <addaction name="action_OpenFile"/> 130 130 <addaction name="action_AddURL"/> 131 131 <addaction name="action_New"/> … … 170 170 <bool>false</bool> 171 171 </attribute> 172 <addaction name="action_ AddFile"/>172 <addaction name="action_OpenFile"/> 173 173 <addaction name="action_Start"/> 174 174 <addaction name="action_Pause"/> … … 177 177 <addaction name="action_Properties"/> 178 178 </widget> 179 <action name="action_ AddFile">180 <property name="text"> 181 <string>& Add File...</string>179 <action name="action_OpenFile"> 180 <property name="text"> 181 <string>&Open...</string> 182 182 </property> 183 183 <property name="iconText"> 184 <string> Add</string>185 </property> 186 <property name="toolTip"> 187 <string> Adda torrent</string>184 <string>Open</string> 185 </property> 186 <property name="toolTip"> 187 <string>Open a torrent</string> 188 188 </property> 189 189 <property name="shortcut"> … … 267 267 <string>Verify local data</string> 268 268 </property> 269 <property name="shortcut"> 270 <string>Ctrl+V</string> 271 </property> 269 272 </action> 270 273 <action name="action_Remove"> … … 574 577 <action name="action_AddURL"> 575 578 <property name="text"> 576 <string>Add &URL...</string> 579 <string>Open &URL...</string> 580 </property> 581 <property name="shortcut"> 582 <string>Ctrl+U</string> 577 583 </property> 578 584 </action> -
trunk/qt/options.cc
r11112 r11720 88 88 89 89 { 90 setWindowTitle( tr( " AddTorrent" ) );90 setWindowTitle( tr( "Open Torrent" ) ); 91 91 QFontMetrics fontMetrics( font( ) ); 92 92 QGridLayout * layout = new QGridLayout( this ); … … 160 160 layout->addWidget( c, ++row, 0, 1, 2, Qt::AlignLeft ); 161 161 162 QDialogButtonBox * b = new QDialogButtonBox( QDialogButtonBox::O k|QDialogButtonBox::Cancel, Qt::Horizontal, this );162 QDialogButtonBox * b = new QDialogButtonBox( QDialogButtonBox::Open|QDialogButtonBox::Cancel, Qt::Horizontal, this ); 163 163 connect( b, SIGNAL(rejected()), this, SLOT(deleteLater()) ); 164 164 connect( b, SIGNAL(accepted()), this, SLOT(onAccepted()) ); … … 402 402 { 403 403 QFileDialog * d = new QFileDialog( this, 404 tr( " AddTorrent" ),404 tr( "Open Torrent" ), 405 405 QFileInfo(myAdd.filename).absolutePath(), 406 406 tr( "Torrent Files (*.torrent);;All Files (*.*)" ) ); -
trunk/qt/qtr.pro
r11616 r11720 17 17 18 18 # if you have libevent2 installed in a custom path, specify it here 19 EVENT_TOP = / usr19 EVENT_TOP = /home/charles/opt/libevent 20 20 INCLUDEPATH = $${EVENT_TOP}/include $${INCLUDEPATH} 21 21
Note: See TracChangeset
for help on using the changeset viewer.