(trunk qt) "Priority Selection in `Add' Window" -- implemented for Qt client
This commit is contained in:
parent
dca795f759
commit
af3e64f383
|
@ -14,6 +14,7 @@
|
|||
#include <iostream>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QEvent>
|
||||
#include <QFileDialog>
|
||||
|
@ -99,6 +100,17 @@ Options :: Options( Session& session, const Prefs& prefs, const QString& filenam
|
|||
if( !session.isLocal( ) )
|
||||
myTree->hideColumn( 1 ); // hide the % done, since we've no way of knowing
|
||||
|
||||
QComboBox * m = new QComboBox;
|
||||
m->addItem( tr( "High" ), TR_PRI_HIGH );
|
||||
m->addItem( tr( "Normal" ), TR_PRI_NORMAL );
|
||||
m->addItem( tr( "Low" ), TR_PRI_LOW );
|
||||
m->setCurrentIndex( 1 ); // Normal
|
||||
myPriorityCombo = m;
|
||||
l = new QLabel( tr( "Torrent &priority:" ) );
|
||||
l->setBuddy( m );
|
||||
layout->addWidget( l, ++row, 0, Qt::AlignLeft );
|
||||
layout->addWidget( m, row, 1 );
|
||||
|
||||
if( session.isLocal( ) )
|
||||
{
|
||||
p = myVerifyButton = new QPushButton( tr( "&Verify Local Data" ) );
|
||||
|
@ -275,6 +287,11 @@ Options :: onAccepted( )
|
|||
// paused
|
||||
tr_bencDictAddBool( args, "paused", !myStartCheck->isChecked( ) );
|
||||
|
||||
// priority
|
||||
const int index = myPriorityCombo->currentIndex( );
|
||||
const int priority = myPriorityCombo->itemData(index).toInt( );
|
||||
tr_bencDictAddInt( args, "bandwidthPriority", priority );
|
||||
|
||||
// files-unwanted
|
||||
int count = myWanted.count( false );
|
||||
if( count > 0 ) {
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
class FileTreeView;
|
||||
class Prefs;
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
class Session;
|
||||
|
||||
extern "C" { struct tr_benc; };
|
||||
|
@ -79,6 +80,7 @@ class Options: public QDialog
|
|||
FileTreeView * myTree;
|
||||
QCheckBox * myStartCheck;
|
||||
QCheckBox * myTrashCheck;
|
||||
QComboBox * myPriorityCombo;
|
||||
QPushButton * myFileButton;
|
||||
QPushButton * myDestinationButton;
|
||||
QPushButton * myVerifyButton;
|
||||
|
|
Loading…
Reference in New Issue