Changeset 11094


Ignore:
Timestamp:
Aug 2, 2010, 3:07:42 AM (12 years ago)
Author:
charles
Message:

(trunk) consistency tweaks between the GTK+ and Qt client:

  1. synchronize some of the keyboard shortcuts
  2. synchronize some text in the preferences dialog
  3. add a "Desktop" tab in the Qt client's preferences dialog
  4. add a "Donate" button to the Qt client's help menu
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/actions.c

    r10547 r11094  
    121121    { "pause-all-torrents", GTK_STOCK_MEDIA_PAUSE, N_( "_Pause All" ), NULL, N_( "Pause all torrents" ), G_CALLBACK( action_cb ) },
    122122    { "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 ) },
    124124    { "remove-torrent", GTK_STOCK_REMOVE, NULL, "Delete", N_( "Remove torrent" ), G_CALLBACK( action_cb ) },
    125125    { "delete-torrent", GTK_STOCK_DELETE, N_( "_Delete Files and Remove" ), "<shift>Delete", NULL, G_CALLBACK( action_cb ) },
  • trunk/gtk/tr-prefs.c

    r11044 r11094  
    532532    hig_workarea_add_wide_control( t, &row, w );
    533533
    534     s = _( "Use Local Peer Discovery to find more peers" );
     534    s = _( "Use _Local Peer Discovery to find more peers" );
    535535    w = new_check_button( s, TR_PREFS_KEY_LPD_ENABLED, core );
    536536    s = _( "LPD is a tool for finding peers on your local network." );
     
    12881288    g_object_weak_ref( G_OBJECT( t ), peerPageDestroyed, data );
    12891289
    1290     s = _( "Pick a _random port on startup" );
     1290    s = _( "Pick a _random port every time Transmission is started" );
    12911291    w = new_check_button( s, TR_PREFS_KEY_PEER_PORT_RANDOM_ON_START, core );
    12921292    hig_workarea_add_wide_control( t, &row, w );
  • trunk/qt/app.cc

    r11092 r11094  
    170170    // when the model sees a torrent for the first time, ask the session for full info on it
    171171    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>)) );
    173173
    174174    mySession->initTorrents( );
     
    246246}
    247247
    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 */
     250void
     251MyApp :: onTorrentsAdded( QSet<int> torrents )
     252{
     253    if( !myPrefs->getBool( Prefs::SHOW_DESKTOP_NOTIFICATION ) )
     254        return;
     255
    251256    foreach( int id, torrents )
    252257    {
    253258        Torrent * tor = myModel->getTorrentFromId( id );
    254259        if( !tor->name().isEmpty( ) )
    255             torrentChanged( id );
     260            onNewTorrentChanged( id );
    256261        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}
     265void
     266MyApp :: onNewTorrentChanged( int id )
    263267{
    264268    Torrent * tor = myModel->getTorrentFromId( id );
     
    270274            notify( tr( "Torrent Added" ), tor->name( ) );
    271275
    272         disconnect( tor, SIGNAL(torrentChanged(int)), this, SLOT(torrentChanged(int)) );
     276        disconnect( tor, SIGNAL(torrentChanged(int)), this, SLOT(onNewTorrentChanged(int)) );
    273277    }
    274278}
  • trunk/qt/app.h

    r11092 r11094  
    5858        void refreshPref( int key );
    5959        void refreshTorrents( );
    60         void torrentsAdded( QSet<int> );
    61         void torrentChanged( int );
     60        void onTorrentsAdded( QSet<int> );
     61        void onNewTorrentChanged( int );
    6262
    6363    public slots:
  • trunk/qt/mainwin.cc

    r11092 r11094  
    126126    // ui signals
    127127    connect( ui.action_Toolbar, SIGNAL(toggled(bool)), this, SLOT(setToolbarVisible(bool)));
    128     connect( ui.action_TrayIcon, SIGNAL(toggled(bool)), this, SLOT(setTrayIconVisible(bool)));
    129128    connect( ui.action_Filterbar, SIGNAL(toggled(bool)), this, SLOT(setFilterbarVisible(bool)));
    130129    connect( ui.action_Statusbar, SIGNAL(toggled(bool)), this, SLOT(setStatusbarVisible(bool)));
     
    153152    connect( ui.action_Preferences, SIGNAL(triggered()), this, SLOT(openPreferences()));
    154153    connect( ui.action_Statistics, SIGNAL(triggered()), myStatsDialog, SLOT(show()));
     154    connect( ui.action_Donate, SIGNAL(triggered()), this, SLOT(openDonate()));
    155155    connect( ui.action_About, SIGNAL(triggered()), myAboutDialog, SLOT(show()));
    156156    connect( ui.action_Contents, SIGNAL(triggered()), this, SLOT(openHelp()));
     
    609609
    610610void
     611TrMainWindow :: openDonate( )
     612{
     613    QDesktopServices :: openUrl( QUrl( "http://www.transmissionbt.com/donate.php" ) );
     614}
     615
     616void
    611617TrMainWindow :: openHelp( )
    612618{
     
    616622    char url[128];
    617623    tr_snprintf( url, sizeof( url ), fmt, major, minor/10 );
    618     QDesktopServices :: openUrl( QUrl( QString( url ) ) );
     624    QDesktopServices :: openUrl( QUrl( url ) );
    619625}
    620626
     
    817823}
    818824void
    819 TrMainWindow :: setTrayIconVisible( bool visible )
    820 {
    821     myPrefs.set( Prefs :: SHOW_TRAY_ICON, visible );
    822 }
    823 void
    824825TrMainWindow :: toggleSpeedMode( )
    825826{
  • trunk/qt/mainwin.h

    r11092 r11094  
    112112        void addTorrents( const QStringList& filenames );
    113113        void removeTorrents( const bool deleteFiles );
     114        void openDonate( );
    114115        void openHelp( );
    115116        void openFolder( );
     
    174175        void setFilterbarVisible( bool );
    175176        void setStatusbarVisible( bool );
    176         void setTrayIconVisible( bool );
    177177        void setCompactView( bool );
    178178        void refreshActionSensitivity( );
  • trunk/qt/mainwin.ui

    r11077 r11094  
    9797    <addaction name="action_Statistics"/>
    9898    <addaction name="separator"/>
     99    <addaction name="action_Donate"/>
     100    <addaction name="separator"/>
    99101    <addaction name="action_Contents"/>
    100102    <addaction name="action_About"/>
     
    109111    <addaction name="action_Filterbar"/>
    110112    <addaction name="action_Statusbar"/>
    111     <addaction name="action_TrayIcon"/>
    112113    <addaction name="separator"/>
    113114    <addaction name="action_SortByActivity"/>
     
    465466    <string>&amp;Contents</string>
    466467   </property>
     468   <property name="shortcut">
     469    <string>F1</string>
     470   </property>
    467471  </action>
    468472  <action name="action_About">
     
    572576   <property name="text">
    573577    <string>Add &amp;URL...</string>
     578   </property>
     579  </action>
     580  <action name="action_Donate">
     581   <property name="text">
     582    <string>&amp;Donate</string>
    574583   </property>
    575584  </action>
  • trunk/qt/prefs-dialog.cc

    r11092 r11094  
    225225    QWidget * w;
    226226    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" ) );
    229228    connect( b, SIGNAL(clicked()), &session, SLOT(launchWebInterface()) );
    230229    h->addWidget( b, 0, Qt::AlignRight );
     
    295294        hig->addWideControl( new QLabel( s ) );
    296295
    297         s = tr( "Limit d&ownload speed (%1):" ).arg( speed_K_str );
     296        s = tr( "Limit do&wnload speed (%1):" ).arg( speed_K_str );
    298297        r = spinBoxNew( Prefs :: ALT_SPEED_LIMIT_DOWN, 0, INT_MAX, 5 );
    299298        hig->addRow( s, r );
     
    344343***/
    345344
     345QWidget *
     346PrefsDialog :: createDesktopTab( )
     347{
     348    HIG * hig = new HIG( this );
     349    hig->addSectionTitle( tr( "Desktop" ) );
     350
     351    hig->addWideControl( checkBoxNew( tr( "Show Transmission icon in the &notification 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
    346362void
    347363PrefsDialog :: onPortTested( bool isOpen )
     
    370386    QSpinBox * s = spinBoxNew( Prefs::PEER_PORT, 1, 65535, 1 );
    371387    QHBoxLayout * h = new QHBoxLayout( );
    372     QPushButton * b = myPortButton = new QPushButton( tr( "&Test Port" ) );
     388    QPushButton * b = myPortButton = new QPushButton( tr( "Te&st Port" ) );
    373389    QLabel * l = myPortLabel = new QLabel( tr( "Status unknown" ) );
    374390    h->addWidget( l );
     
    381397    hig->addRow( tr( "&Port for incoming connections:" ), s );
    382398    hig->addRow( "", h, 0 );
     399    hig->addWideControl( checkBoxNew( tr( "Pick a &random port every time Transmission is started" ), Prefs :: PEER_PORT_RANDOM_ON_START ) );
    383400    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 ) );
    385401
    386402    hig->addSectionDivider( );
     
    452468    hig->addSectionTitle( tr( "Blocklist" ) );
    453469    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" ) );
    456471    connect( w, SIGNAL(clicked(bool)), this, SLOT(onUpdateBlocklistClicked()));
    457472    myBlockWidgets << w;
     
    573588        hig->addWideControl( checkBoxNew( tr( "Append \".&part\" to incomplete files' names" ), Prefs::RENAME_PARTIAL_FILES ) );
    574589
     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
    575596        l = myIncompleteCheckbox = checkBoxNew( tr( "Keep &incomplete files in:" ), Prefs::INCOMPLETE_DIR_ENABLED );
    576597        b = myIncompleteButton = new QPushButton;
     
    581602        enableBuddyWhenChecked( qobject_cast<QCheckBox*>(l), b );
    582603
    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 );
    584605        b = myTorrentDoneScriptButton = new QPushButton;
    585606        b->setIcon( filePixmap );
     
    589610        enableBuddyWhenChecked( qobject_cast<QCheckBox*>(l), b );
    590611
    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 
    597612    hig->addSectionDivider( );
    598613    hig->addSectionTitle( tr( "Seeding Limits" ) );
     
    630645    t->addTab( createPrivacyTab( ),      tr( "Privacy" ) );
    631646    t->addTab( createNetworkTab( ),      tr( "Network" ) );
     647    t->addTab( createDesktopTab( ),      tr( "Desktop" ) );
    632648    t->addTab( createWebTab( session ),  tr( "Web" ) );
    633649    //t->addTab( createTrackerTab( ),    tr( "Trackers" ) );
  • trunk/qt/prefs-dialog.h

    r11092 r11094  
    8080        bool isAllowed( int key ) const;
    8181        QWidget * createTorrentsTab( );
     82        QWidget * createSpeedTab( );
     83        QWidget * createPrivacyTab( );
    8284        QWidget * createNetworkTab( );
    83         QWidget * createPrivacyTab( );
    84         QWidget * createSpeedTab( );
     85        QWidget * createDesktopTab( );
    8586        QWidget * createWebTab( Session& );
    8687        QWidget * createTrackerTab( );
Note: See TracChangeset for help on using the changeset viewer.