{ "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 ) },
{ "start-all-torrents", GTK_STOCK_MEDIA_PLAY, N_( "_Start All" ), NULL, N_( "Start all torrents" ), G_CALLBACK( action_cb ) },
- { "relocate-torrent", NULL, N_("Set _Location" ), NULL, NULL, G_CALLBACK( action_cb ) },
+ { "relocate-torrent", NULL, N_("Set _Location..." ), NULL, NULL, G_CALLBACK( action_cb ) },
{ "remove-torrent", GTK_STOCK_REMOVE, NULL, "Delete", N_( "Remove torrent" ), G_CALLBACK( action_cb ) },
{ "delete-torrent", GTK_STOCK_DELETE, N_( "_Delete Files and Remove" ), "<shift>Delete", NULL, G_CALLBACK( action_cb ) },
{ "new-torrent", GTK_STOCK_NEW, N_( "_New..." ), NULL, N_( "Create a torrent" ), G_CALLBACK( action_cb ) },
gtr_widget_set_tooltip_text( w, s );
hig_workarea_add_wide_control( t, &row, w );
- s = _( "Use Local Peer Discovery to find more peers" );
+ s = _( "Use _Local Peer Discovery to find more peers" );
w = new_check_button( s, TR_PREFS_KEY_LPD_ENABLED, core );
s = _( "LPD is a tool for finding peers on your local network." );
gtr_widget_set_tooltip_text( w, s );
data->prefsTag = g_signal_connect( TR_CORE( core ), "prefs-changed", G_CALLBACK( onCorePrefsChanged ), data );
g_object_weak_ref( G_OBJECT( t ), peerPageDestroyed, data );
- s = _( "Pick a _random port on startup" );
+ s = _( "Pick a _random port every time Transmission is started" );
w = new_check_button( s, TR_PREFS_KEY_PEER_PORT_RANDOM_ON_START, core );
hig_workarea_add_wide_control( t, &row, w );
connect( mySession, SIGNAL(sourceChanged()), this, SLOT(onSessionSourceChanged()) );
// when the model sees a torrent for the first time, ask the session for full info on it
connect( myModel, SIGNAL(torrentsAdded(QSet<int>)), mySession, SLOT(initTorrents(QSet<int>)) );
- connect( myModel, SIGNAL(torrentsAdded(QSet<int>)), this, SLOT(torrentsAdded(QSet<int>)) );
+ connect( myModel, SIGNAL(torrentsAdded(QSet<int>)), this, SLOT(onTorrentsAdded(QSet<int>)) );
mySession->initTorrents( );
mySession->refreshSessionStats( );
std::cerr << "couldn't register " << DBUS_OBJECT_PATH << std::endl;
}
+/* these two functions are for popping up desktop notification
+ * when new torrents are added */
void
-MyApp :: torrentsAdded( QSet<int> torrents )
+MyApp :: onTorrentsAdded( QSet<int> torrents )
{
+ if( !myPrefs->getBool( Prefs::SHOW_DESKTOP_NOTIFICATION ) )
+ return;
+
foreach( int id, torrents )
{
Torrent * tor = myModel->getTorrentFromId( id );
if( !tor->name().isEmpty( ) )
- torrentChanged( id );
+ onNewTorrentChanged( id );
else // wait until the torrent's INFO fields are loaded
- connect( tor, SIGNAL(torrentChanged(int)), this, SLOT(torrentChanged(int)) );
+ connect( tor, SIGNAL(torrentChanged(int)), this, SLOT(onNewTorrentChanged(int)) );
}
}
-
void
-MyApp :: torrentChanged( int id )
+MyApp :: onNewTorrentChanged( int id )
{
Torrent * tor = myModel->getTorrentFromId( id );
if( age_secs < 30 )
notify( tr( "Torrent Added" ), tor->name( ) );
- disconnect( tor, SIGNAL(torrentChanged(int)), this, SLOT(torrentChanged(int)) );
+ disconnect( tor, SIGNAL(torrentChanged(int)), this, SLOT(onNewTorrentChanged(int)) );
}
}
void onSessionSourceChanged( );
void refreshPref( int key );
void refreshTorrents( );
- void torrentsAdded( QSet<int> );
- void torrentChanged( int );
+ void onTorrentsAdded( QSet<int> );
+ void onNewTorrentChanged( int );
public slots:
void addTorrent( const QString& );
// ui signals
connect( ui.action_Toolbar, SIGNAL(toggled(bool)), this, SLOT(setToolbarVisible(bool)));
- connect( ui.action_TrayIcon, SIGNAL(toggled(bool)), this, SLOT(setTrayIconVisible(bool)));
connect( ui.action_Filterbar, SIGNAL(toggled(bool)), this, SLOT(setFilterbarVisible(bool)));
connect( ui.action_Statusbar, SIGNAL(toggled(bool)), this, SLOT(setStatusbarVisible(bool)));
connect( ui.action_CompactView, SIGNAL(toggled(bool)), this, SLOT(setCompactView(bool)));
connect( ui.action_New, SIGNAL(triggered()), this, SLOT(newTorrent()));
connect( ui.action_Preferences, SIGNAL(triggered()), this, SLOT(openPreferences()));
connect( ui.action_Statistics, SIGNAL(triggered()), myStatsDialog, SLOT(show()));
+ connect( ui.action_Donate, SIGNAL(triggered()), this, SLOT(openDonate()));
connect( ui.action_About, SIGNAL(triggered()), myAboutDialog, SLOT(show()));
connect( ui.action_Contents, SIGNAL(triggered()), this, SLOT(openHelp()));
connect( ui.action_OpenFolder, SIGNAL(triggered()), this, SLOT(openFolder()));
mySession.copyMagnetLinkToClipboard( id );
}
+void
+TrMainWindow :: openDonate( )
+{
+ QDesktopServices :: openUrl( QUrl( "http://www.transmissionbt.com/donate.php" ) );
+}
+
void
TrMainWindow :: openHelp( )
{
sscanf( SHORT_VERSION_STRING, "%d.%d", &major, &minor );
char url[128];
tr_snprintf( url, sizeof( url ), fmt, major, minor/10 );
- QDesktopServices :: openUrl( QUrl( QString( url ) ) );
+ QDesktopServices :: openUrl( QUrl( url ) );
}
void
myPrefs.set( Prefs :: COMPACT_VIEW, visible );
}
void
-TrMainWindow :: setTrayIconVisible( bool visible )
-{
- myPrefs.set( Prefs :: SHOW_TRAY_ICON, visible );
-}
-void
TrMainWindow :: toggleSpeedMode( )
{
myPrefs.toggleBool( Prefs :: ALT_SPEED_LIMIT_ENABLED );
void refreshPref( int key );
void addTorrents( const QStringList& filenames );
void removeTorrents( const bool deleteFiles );
+ void openDonate( );
void openHelp( );
void openFolder( );
void copyMagnetLinkToClipboard( );
void setToolbarVisible( bool );
void setFilterbarVisible( bool );
void setStatusbarVisible( bool );
- void setTrayIconVisible( bool );
void setCompactView( bool );
void refreshActionSensitivity( );
void wrongAuthentication( );
</property>
<addaction name="action_Statistics"/>
<addaction name="separator"/>
+ <addaction name="action_Donate"/>
+ <addaction name="separator"/>
<addaction name="action_Contents"/>
<addaction name="action_About"/>
</widget>
<addaction name="action_Toolbar"/>
<addaction name="action_Filterbar"/>
<addaction name="action_Statusbar"/>
- <addaction name="action_TrayIcon"/>
<addaction name="separator"/>
<addaction name="action_SortByActivity"/>
<addaction name="action_SortByAge"/>
<property name="text">
<string>&Contents</string>
</property>
+ <property name="shortcut">
+ <string>F1</string>
+ </property>
</action>
<action name="action_About">
<property name="text">
<string>Add &URL...</string>
</property>
</action>
+ <action name="action_Donate">
+ <property name="text">
+ <string>&Donate</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="application.qrc"/>
hig->addSectionTitle( tr( "Web Client" ) );
QWidget * w;
QHBoxLayout * h = new QHBoxLayout( );
- QIcon i( style()->standardIcon( QStyle::StandardPixmap( QStyle::SP_DirOpenIcon ) ) );
- QPushButton * b = new QPushButton( i, tr( "&Open web client" ) );
+ QPushButton * b = new QPushButton( tr( "&Open web client" ) );
connect( b, SIGNAL(clicked()), &session, SLOT(launchWebInterface()) );
h->addWidget( b, 0, Qt::AlignRight );
QWidget * l = checkBoxNew( tr( "&Enable web client" ), Prefs::RPC_ENABLED );
QString s = tr( "<small>Override normal speed limits manually or at scheduled times</small>" );
hig->addWideControl( new QLabel( s ) );
- s = tr( "Limit d&ownload speed (%1):" ).arg( speed_K_str );
+ s = tr( "Limit do&wnload speed (%1):" ).arg( speed_K_str );
r = spinBoxNew( Prefs :: ALT_SPEED_LIMIT_DOWN, 0, INT_MAX, 5 );
hig->addRow( s, r );
****
***/
+QWidget *
+PrefsDialog :: createDesktopTab( )
+{
+ HIG * hig = new HIG( this );
+ hig->addSectionTitle( tr( "Desktop" ) );
+
+ hig->addWideControl( checkBoxNew( tr( "Show Transmission icon in the ¬ification area" ), Prefs::SHOW_TRAY_ICON ) );
+ hig->addWideControl( checkBoxNew( tr( "Show &popup notifications" ), Prefs::SHOW_DESKTOP_NOTIFICATION ) );
+
+ hig->finish( );
+ return hig;
+}
+
+/***
+****
+***/
+
void
PrefsDialog :: onPortTested( bool isOpen )
{
QSpinBox * s = spinBoxNew( Prefs::PEER_PORT, 1, 65535, 1 );
QHBoxLayout * h = new QHBoxLayout( );
- QPushButton * b = myPortButton = new QPushButton( tr( "&Test Port" ) );
+ QPushButton * b = myPortButton = new QPushButton( tr( "Te&st Port" ) );
QLabel * l = myPortLabel = new QLabel( tr( "Status unknown" ) );
h->addWidget( l );
h->addSpacing( HIG :: PAD_BIG );
hig->addRow( tr( "&Port for incoming connections:" ), s );
hig->addRow( "", h, 0 );
- hig->addWideControl( checkBoxNew( tr( "Use UPnP or NAT-PMP port &forwarding from my router" ), Prefs::PORT_FORWARDING ) );
hig->addWideControl( checkBoxNew( tr( "Pick a &random port every time Transmission is started" ), Prefs :: PEER_PORT_RANDOM_ON_START ) );
+ hig->addWideControl( checkBoxNew( tr( "Use UPnP or NAT-PMP port &forwarding from my router" ), Prefs::PORT_FORWARDING ) );
hig->addSectionDivider( );
hig->addSectionTitle( tr( "Limits" ) );
HIG * hig = new HIG( this );
hig->addSectionTitle( tr( "Blocklist" ) );
QHBoxLayout * h = new QHBoxLayout( );
- QIcon i( style()->standardIcon( QStyle::StandardPixmap( QStyle::SP_BrowserReload ) ) );
- QWidget * w = new QPushButton( i, tr( "&Update blocklist" ) );
+ QWidget * w = new QPushButton( tr( "&Update" ) );
connect( w, SIGNAL(clicked(bool)), this, SLOT(onUpdateBlocklistClicked()));
myBlockWidgets << w;
QWidget * l = checkBoxNew( "", Prefs::BLOCKLIST_ENABLED );
hig->addWideControl( checkBoxNew( tr( "Append \".&part\" to incomplete files' names" ), Prefs::RENAME_PARTIAL_FILES ) );
+ b = myDestinationButton = new QPushButton;
+ b->setIcon( folderPixmap );
+ b->setStyleSheet( "text-align: left; padding-left: 5; padding-right: 5" );
+ connect( b, SIGNAL(clicked(bool)), this, SLOT(onDestinationClicked(void)) );
+ hig->addRow( tr( "Save to &Location:" ), b );
+
l = myIncompleteCheckbox = checkBoxNew( tr( "Keep &incomplete files in:" ), Prefs::INCOMPLETE_DIR_ENABLED );
b = myIncompleteButton = new QPushButton;
b->setIcon( folderPixmap );
hig->addRow( myIncompleteCheckbox, b );
enableBuddyWhenChecked( qobject_cast<QCheckBox*>(l), b );
- l = myTorrentDoneScriptCheckbox = checkBoxNew( tr( "Call scrip&t when torrent is completed" ), Prefs::SCRIPT_TORRENT_DONE_ENABLED );
+ l = myTorrentDoneScriptCheckbox = checkBoxNew( tr( "Call scrip&t when torrent is completed:" ), Prefs::SCRIPT_TORRENT_DONE_ENABLED );
b = myTorrentDoneScriptButton = new QPushButton;
b->setIcon( filePixmap );
b->setStyleSheet( "text-align: left; padding-left: 5; padding-right: 5" );
hig->addRow( myTorrentDoneScriptCheckbox, b );
enableBuddyWhenChecked( qobject_cast<QCheckBox*>(l), b );
- b = myDestinationButton = new QPushButton;
- b->setIcon( folderPixmap );
- b->setStyleSheet( "text-align: left; padding-left: 5; padding-right: 5" );
- connect( b, SIGNAL(clicked(bool)), this, SLOT(onDestinationClicked(void)) );
- hig->addRow( tr( "Save to &Location:" ), b );
-
hig->addSectionDivider( );
hig->addSectionTitle( tr( "Seeding Limits" ) );
t->addTab( createSpeedTab( ), tr( "Speed" ) );
t->addTab( createPrivacyTab( ), tr( "Privacy" ) );
t->addTab( createNetworkTab( ), tr( "Network" ) );
+ t->addTab( createDesktopTab( ), tr( "Desktop" ) );
t->addTab( createWebTab( session ), tr( "Web" ) );
//t->addTab( createTrackerTab( ), tr( "Trackers" ) );
myLayout->addWidget( t );
private:
bool isAllowed( int key ) const;
QWidget * createTorrentsTab( );
- QWidget * createNetworkTab( );
- QWidget * createPrivacyTab( );
QWidget * createSpeedTab( );
+ QWidget * createPrivacyTab( );
+ QWidget * createNetworkTab( );
+ QWidget * createDesktopTab( );
QWidget * createWebTab( Session& );
QWidget * createTrackerTab( );