Changeset 8392


Ignore:
Timestamp:
May 13, 2009, 7:16:31 PM (12 years ago)
Author:
charles
Message:

(trunk qt) tweak qt "set torrent location" a little

Location:
trunk/qt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/mainwin.cc

    r8389 r8392  
    623623TrMainWindow :: setLocation( )
    624624{
    625     const int torrentId( *getSelectedTorrents().begin() );
    626     QDialog * d = new RelocateDialog( mySession, torrentId, this );
     625    QDialog * d = new RelocateDialog( mySession, getSelectedTorrents(), this );
    627626    d->show( );
    628627}
     
    745744    ui.action_Properties->setEnabled( haveSelection );
    746745    ui.action_DeselectAll->setEnabled( haveSelection );
     746    ui.action_SetLocation->setEnabled( haveSelection );
    747747
    748748    const bool oneSelection( selected == 1 );
    749749    ui.action_OpenFolder->setEnabled( oneSelection && mySession.isLocal( ) );
    750     ui.action_SetLocation->setEnabled( oneSelection );
    751750
    752751    ui.action_SelectAll->setEnabled( selected < rowCount );
  • trunk/qt/relocate.cc

    r8389 r8392  
    2020#include <QDialogButtonBox>
    2121#include <QWidget>
     22#include <QApplication>
     23#include <QStyle>
    2224
    2325#include "hig.h"
    2426#include "relocate.h"
    2527#include "session.h"
     28#include "qticonloader.h"
    2629
    2730QString RelocateDialog :: myPath;
     
    3235RelocateDialog :: onSetLocation( )
    3336{
    34     QSet<int> ids;
    35     ids << myTorrentId;
    36     mySession.torrentSetLocation( ids, myPath, myMoveFlag );
     37    mySession.torrentSetLocation( myIds, myPath, myMoveFlag );
    3738    deleteLater( );
    3839}
     
    6162}
    6263
    63 RelocateDialog :: RelocateDialog( Session& session, int torrentId, QWidget * parent ):
     64RelocateDialog :: RelocateDialog( Session& session, const QSet<int>& ids, QWidget * parent ):
    6465    QDialog( parent ),
    6566    mySession( session ),
    66     myTorrentId( torrentId )
     67    myIds( ids )
    6768{
     69    const int iconSize( style( )->pixelMetric( QStyle :: PM_SmallIconSize ) );
     70    const QIcon folderIcon = QtIconLoader :: icon( "folder", style()->standardIcon( QStyle::SP_DirIcon ) );
     71    const QPixmap folderPixmap = folderIcon.pixmap( iconSize );
     72
    6873    QRadioButton * find_rb;
    6974    setWindowTitle( tr( "Set Torrent Location" ) );
     
    7378
    7479    HIG * hig = new HIG( );
    75     hig->addSectionTitle( tr( "Location" ) );
    76     hig->addRow( tr( "Torrent &location:" ), myDirButton = new QPushButton( myPath ) );
     80    hig->addSectionTitle( tr( "Set Location" ) );
     81    hig->addRow( tr( "New &location:" ), myDirButton = new QPushButton( folderPixmap, myPath ) );
    7782    hig->addWideControl( myMoveRadio = new QRadioButton( tr( "&Move from the current folder" ), this ) );
    7883    hig->addWideControl( find_rb = new QRadioButton( tr( "Local data is &already there" ), this ) );
  • trunk/qt/relocate.h

    r8389 r8392  
    1515
    1616#include <QDialog>
     17#include <QSet>
    1718#include <QString>
    1819
     
    3132    private:
    3233        Session & mySession;
    33         const int myTorrentId;
     34        QSet<int> myIds;
    3435        QPushButton * myDirButton;
    3536        QRadioButton * myMoveRadio;
     
    4243
    4344    public:
    44         RelocateDialog( Session&, int torrentId, QWidget * parent = 0 );
     45        RelocateDialog( Session&, const QSet<int>& ids, QWidget * parent = 0 );
    4546        ~RelocateDialog( ) { }
    4647};
Note: See TracChangeset for help on using the changeset viewer.