(trunk qt) "Priority Selection in `Add' Window" -- implemented for Qt client

This commit is contained in:
Charles Kerr 2010-02-02 07:52:57 +00:00
parent dca795f759
commit af3e64f383
2 changed files with 19 additions and 0 deletions

View File

@ -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 ) {

View File

@ -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;