Changeset 11094
- Timestamp:
- Aug 2, 2010, 3:07:42 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/actions.c
r10547 r11094 121 121 { "pause-all-torrents", GTK_STOCK_MEDIA_PAUSE, N_( "_Pause All" ), NULL, N_( "Pause all torrents" ), G_CALLBACK( action_cb ) }, 122 122 { "start-all-torrents", GTK_STOCK_MEDIA_PLAY, N_( "_Start All" ), NULL, N_( "Start all torrents" ), G_CALLBACK( action_cb ) }, 123 { "relocate-torrent", NULL, N_("Set _Location " ), NULL, NULL, G_CALLBACK( action_cb ) },123 { "relocate-torrent", NULL, N_("Set _Location..." ), NULL, NULL, G_CALLBACK( action_cb ) }, 124 124 { "remove-torrent", GTK_STOCK_REMOVE, NULL, "Delete", N_( "Remove torrent" ), G_CALLBACK( action_cb ) }, 125 125 { "delete-torrent", GTK_STOCK_DELETE, N_( "_Delete Files and Remove" ), "<shift>Delete", NULL, G_CALLBACK( action_cb ) }, -
trunk/gtk/tr-prefs.c
r11044 r11094 532 532 hig_workarea_add_wide_control( t, &row, w ); 533 533 534 s = _( "Use Local Peer Discovery to find more peers" );534 s = _( "Use _Local Peer Discovery to find more peers" ); 535 535 w = new_check_button( s, TR_PREFS_KEY_LPD_ENABLED, core ); 536 536 s = _( "LPD is a tool for finding peers on your local network." ); … … 1288 1288 g_object_weak_ref( G_OBJECT( t ), peerPageDestroyed, data ); 1289 1289 1290 s = _( "Pick a _random port on startup" );1290 s = _( "Pick a _random port every time Transmission is started" ); 1291 1291 w = new_check_button( s, TR_PREFS_KEY_PEER_PORT_RANDOM_ON_START, core ); 1292 1292 hig_workarea_add_wide_control( t, &row, w ); -
trunk/qt/app.cc
r11092 r11094 170 170 // when the model sees a torrent for the first time, ask the session for full info on it 171 171 connect( myModel, SIGNAL(torrentsAdded(QSet<int>)), mySession, SLOT(initTorrents(QSet<int>)) ); 172 connect( myModel, SIGNAL(torrentsAdded(QSet<int>)), this, SLOT( torrentsAdded(QSet<int>)) );172 connect( myModel, SIGNAL(torrentsAdded(QSet<int>)), this, SLOT(onTorrentsAdded(QSet<int>)) ); 173 173 174 174 mySession->initTorrents( ); … … 246 246 } 247 247 248 void 249 MyApp :: torrentsAdded( QSet<int> torrents ) 250 { 248 /* these two functions are for popping up desktop notification 249 * when new torrents are added */ 250 void 251 MyApp :: onTorrentsAdded( QSet<int> torrents ) 252 { 253 if( !myPrefs->getBool( Prefs::SHOW_DESKTOP_NOTIFICATION ) ) 254 return; 255 251 256 foreach( int id, torrents ) 252 257 { 253 258 Torrent * tor = myModel->getTorrentFromId( id ); 254 259 if( !tor->name().isEmpty( ) ) 255 torrentChanged( id );260 onNewTorrentChanged( id ); 256 261 else // wait until the torrent's INFO fields are loaded 257 connect( tor, SIGNAL(torrentChanged(int)), this, SLOT(torrentChanged(int)) ); 258 } 259 } 260 261 void 262 MyApp :: torrentChanged( int id ) 262 connect( tor, SIGNAL(torrentChanged(int)), this, SLOT(onNewTorrentChanged(int)) ); 263 } 264 } 265 void 266 MyApp :: onNewTorrentChanged( int id ) 263 267 { 264 268 Torrent * tor = myModel->getTorrentFromId( id ); … … 270 274 notify( tr( "Torrent Added" ), tor->name( ) ); 271 275 272 disconnect( tor, SIGNAL(torrentChanged(int)), this, SLOT( torrentChanged(int)) );276 disconnect( tor, SIGNAL(torrentChanged(int)), this, SLOT(onNewTorrentChanged(int)) ); 273 277 } 274 278 } -
trunk/qt/app.h
r11092 r11094 58 58 void refreshPref( int key ); 59 59 void refreshTorrents( ); 60 void torrentsAdded( QSet<int> );61 void torrentChanged( int );60 void onTorrentsAdded( QSet<int> ); 61 void onNewTorrentChanged( int ); 62 62 63 63 public slots: -
trunk/qt/mainwin.cc
r11092 r11094 126 126 // ui signals 127 127 connect( ui.action_Toolbar, SIGNAL(toggled(bool)), this, SLOT(setToolbarVisible(bool))); 128 connect( ui.action_TrayIcon, SIGNAL(toggled(bool)), this, SLOT(setTrayIconVisible(bool)));129 128 connect( ui.action_Filterbar, SIGNAL(toggled(bool)), this, SLOT(setFilterbarVisible(bool))); 130 129 connect( ui.action_Statusbar, SIGNAL(toggled(bool)), this, SLOT(setStatusbarVisible(bool))); … … 153 152 connect( ui.action_Preferences, SIGNAL(triggered()), this, SLOT(openPreferences())); 154 153 connect( ui.action_Statistics, SIGNAL(triggered()), myStatsDialog, SLOT(show())); 154 connect( ui.action_Donate, SIGNAL(triggered()), this, SLOT(openDonate())); 155 155 connect( ui.action_About, SIGNAL(triggered()), myAboutDialog, SLOT(show())); 156 156 connect( ui.action_Contents, SIGNAL(triggered()), this, SLOT(openHelp())); … … 609 609 610 610 void 611 TrMainWindow :: openDonate( ) 612 { 613 QDesktopServices :: openUrl( QUrl( "http://www.transmissionbt.com/donate.php" ) ); 614 } 615 616 void 611 617 TrMainWindow :: openHelp( ) 612 618 { … … 616 622 char url[128]; 617 623 tr_snprintf( url, sizeof( url ), fmt, major, minor/10 ); 618 QDesktopServices :: openUrl( QUrl( QString( url )) );624 QDesktopServices :: openUrl( QUrl( url ) ); 619 625 } 620 626 … … 817 823 } 818 824 void 819 TrMainWindow :: setTrayIconVisible( bool visible )820 {821 myPrefs.set( Prefs :: SHOW_TRAY_ICON, visible );822 }823 void824 825 TrMainWindow :: toggleSpeedMode( ) 825 826 { -
trunk/qt/mainwin.h
r11092 r11094 112 112 void addTorrents( const QStringList& filenames ); 113 113 void removeTorrents( const bool deleteFiles ); 114 void openDonate( ); 114 115 void openHelp( ); 115 116 void openFolder( ); … … 174 175 void setFilterbarVisible( bool ); 175 176 void setStatusbarVisible( bool ); 176 void setTrayIconVisible( bool );177 177 void setCompactView( bool ); 178 178 void refreshActionSensitivity( ); -
trunk/qt/mainwin.ui
r11077 r11094 97 97 <addaction name="action_Statistics"/> 98 98 <addaction name="separator"/> 99 <addaction name="action_Donate"/> 100 <addaction name="separator"/> 99 101 <addaction name="action_Contents"/> 100 102 <addaction name="action_About"/> … … 109 111 <addaction name="action_Filterbar"/> 110 112 <addaction name="action_Statusbar"/> 111 <addaction name="action_TrayIcon"/>112 113 <addaction name="separator"/> 113 114 <addaction name="action_SortByActivity"/> … … 465 466 <string>&Contents</string> 466 467 </property> 468 <property name="shortcut"> 469 <string>F1</string> 470 </property> 467 471 </action> 468 472 <action name="action_About"> … … 572 576 <property name="text"> 573 577 <string>Add &URL...</string> 578 </property> 579 </action> 580 <action name="action_Donate"> 581 <property name="text"> 582 <string>&Donate</string> 574 583 </property> 575 584 </action> -
trunk/qt/prefs-dialog.cc
r11092 r11094 225 225 QWidget * w; 226 226 QHBoxLayout * h = new QHBoxLayout( ); 227 QIcon i( style()->standardIcon( QStyle::StandardPixmap( QStyle::SP_DirOpenIcon ) ) ); 228 QPushButton * b = new QPushButton( i, tr( "&Open web client" ) ); 227 QPushButton * b = new QPushButton( tr( "&Open web client" ) ); 229 228 connect( b, SIGNAL(clicked()), &session, SLOT(launchWebInterface()) ); 230 229 h->addWidget( b, 0, Qt::AlignRight ); … … 295 294 hig->addWideControl( new QLabel( s ) ); 296 295 297 s = tr( "Limit d &ownload speed (%1):" ).arg( speed_K_str );296 s = tr( "Limit do&wnload speed (%1):" ).arg( speed_K_str ); 298 297 r = spinBoxNew( Prefs :: ALT_SPEED_LIMIT_DOWN, 0, INT_MAX, 5 ); 299 298 hig->addRow( s, r ); … … 344 343 ***/ 345 344 345 QWidget * 346 PrefsDialog :: createDesktopTab( ) 347 { 348 HIG * hig = new HIG( this ); 349 hig->addSectionTitle( tr( "Desktop" ) ); 350 351 hig->addWideControl( checkBoxNew( tr( "Show Transmission icon in the ¬ification area" ), Prefs::SHOW_TRAY_ICON ) ); 352 hig->addWideControl( checkBoxNew( tr( "Show &popup notifications" ), Prefs::SHOW_DESKTOP_NOTIFICATION ) ); 353 354 hig->finish( ); 355 return hig; 356 } 357 358 /*** 359 **** 360 ***/ 361 346 362 void 347 363 PrefsDialog :: onPortTested( bool isOpen ) … … 370 386 QSpinBox * s = spinBoxNew( Prefs::PEER_PORT, 1, 65535, 1 ); 371 387 QHBoxLayout * h = new QHBoxLayout( ); 372 QPushButton * b = myPortButton = new QPushButton( tr( " &Test Port" ) );388 QPushButton * b = myPortButton = new QPushButton( tr( "Te&st Port" ) ); 373 389 QLabel * l = myPortLabel = new QLabel( tr( "Status unknown" ) ); 374 390 h->addWidget( l ); … … 381 397 hig->addRow( tr( "&Port for incoming connections:" ), s ); 382 398 hig->addRow( "", h, 0 ); 399 hig->addWideControl( checkBoxNew( tr( "Pick a &random port every time Transmission is started" ), Prefs :: PEER_PORT_RANDOM_ON_START ) ); 383 400 hig->addWideControl( checkBoxNew( tr( "Use UPnP or NAT-PMP port &forwarding from my router" ), Prefs::PORT_FORWARDING ) ); 384 hig->addWideControl( checkBoxNew( tr( "Pick a &random port every time Transmission is started" ), Prefs :: PEER_PORT_RANDOM_ON_START ) );385 401 386 402 hig->addSectionDivider( ); … … 452 468 hig->addSectionTitle( tr( "Blocklist" ) ); 453 469 QHBoxLayout * h = new QHBoxLayout( ); 454 QIcon i( style()->standardIcon( QStyle::StandardPixmap( QStyle::SP_BrowserReload ) ) ); 455 QWidget * w = new QPushButton( i, tr( "&Update blocklist" ) ); 470 QWidget * w = new QPushButton( tr( "&Update" ) ); 456 471 connect( w, SIGNAL(clicked(bool)), this, SLOT(onUpdateBlocklistClicked())); 457 472 myBlockWidgets << w; … … 573 588 hig->addWideControl( checkBoxNew( tr( "Append \".&part\" to incomplete files' names" ), Prefs::RENAME_PARTIAL_FILES ) ); 574 589 590 b = myDestinationButton = new QPushButton; 591 b->setIcon( folderPixmap ); 592 b->setStyleSheet( "text-align: left; padding-left: 5; padding-right: 5" ); 593 connect( b, SIGNAL(clicked(bool)), this, SLOT(onDestinationClicked(void)) ); 594 hig->addRow( tr( "Save to &Location:" ), b ); 595 575 596 l = myIncompleteCheckbox = checkBoxNew( tr( "Keep &incomplete files in:" ), Prefs::INCOMPLETE_DIR_ENABLED ); 576 597 b = myIncompleteButton = new QPushButton; … … 581 602 enableBuddyWhenChecked( qobject_cast<QCheckBox*>(l), b ); 582 603 583 l = myTorrentDoneScriptCheckbox = checkBoxNew( tr( "Call scrip&t when torrent is completed " ), Prefs::SCRIPT_TORRENT_DONE_ENABLED );604 l = myTorrentDoneScriptCheckbox = checkBoxNew( tr( "Call scrip&t when torrent is completed:" ), Prefs::SCRIPT_TORRENT_DONE_ENABLED ); 584 605 b = myTorrentDoneScriptButton = new QPushButton; 585 606 b->setIcon( filePixmap ); … … 589 610 enableBuddyWhenChecked( qobject_cast<QCheckBox*>(l), b ); 590 611 591 b = myDestinationButton = new QPushButton;592 b->setIcon( folderPixmap );593 b->setStyleSheet( "text-align: left; padding-left: 5; padding-right: 5" );594 connect( b, SIGNAL(clicked(bool)), this, SLOT(onDestinationClicked(void)) );595 hig->addRow( tr( "Save to &Location:" ), b );596 597 612 hig->addSectionDivider( ); 598 613 hig->addSectionTitle( tr( "Seeding Limits" ) ); … … 630 645 t->addTab( createPrivacyTab( ), tr( "Privacy" ) ); 631 646 t->addTab( createNetworkTab( ), tr( "Network" ) ); 647 t->addTab( createDesktopTab( ), tr( "Desktop" ) ); 632 648 t->addTab( createWebTab( session ), tr( "Web" ) ); 633 649 //t->addTab( createTrackerTab( ), tr( "Trackers" ) ); -
trunk/qt/prefs-dialog.h
r11092 r11094 80 80 bool isAllowed( int key ) const; 81 81 QWidget * createTorrentsTab( ); 82 QWidget * createSpeedTab( ); 83 QWidget * createPrivacyTab( ); 82 84 QWidget * createNetworkTab( ); 83 QWidget * createPrivacyTab( ); 84 QWidget * createSpeedTab( ); 85 QWidget * createDesktopTab( ); 85 86 QWidget * createWebTab( Session& ); 86 87 QWidget * createTrackerTab( );
Note: See TracChangeset
for help on using the changeset viewer.