- Added Upload limit per torrent in finished list

This commit is contained in:
Christophe Dumez 2007-04-10 10:11:36 +00:00
parent 6428fd4ae0
commit e1660e592b
3 changed files with 23 additions and 0 deletions

View file

@ -49,6 +49,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession){
actionPreview_file->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/preview.png"))); actionPreview_file->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/preview.png")));
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png"))); actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png"))); actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
// TODO: Set icons for upload limit
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(deleteSelection())); connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(deleteSelection()));
connect(actionPreview_file, SIGNAL(triggered()), (GUI*)parent, SLOT(previewFileSelection())); connect(actionPreview_file, SIGNAL(triggered()), (GUI*)parent, SLOT(previewFileSelection()));
connect(actionDelete_Permanently, SIGNAL(triggered()), (GUI*)parent, SLOT(deletePermanently())); connect(actionDelete_Permanently, SIGNAL(triggered()), (GUI*)parent, SLOT(deletePermanently()));
@ -104,6 +105,19 @@ void FinishedTorrents::setRowColor(int row, const QString& color){
} }
} }
void FinishedTorrents::on_actionSet_upload_limit_triggered(){
QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes();
QModelIndex index;
QStringList hashes;
foreach(index, selectedIndexes){
if(index.column() == NAME){
// Get the file hash
hashes << DLListModel->data(DLListModel->index(index.row(), HASH)).toString();
}
}
new BandwidthAllocationDialog(this, true, &BTSession, hashes);
}
void FinishedTorrents::updateFinishedList(){ void FinishedTorrents::updateFinishedList(){
// qDebug("Updating finished list"); // qDebug("Updating finished list");
QString hash; QString hash;
@ -195,6 +209,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
torrent_handle h = BTSession->getTorrentHandle(fileHash); torrent_handle h = BTSession->getTorrentHandle(fileHash);
myFinishedListMenu.addAction(actionDelete); myFinishedListMenu.addAction(actionDelete);
myFinishedListMenu.addAction(actionDelete_Permanently); myFinishedListMenu.addAction(actionDelete_Permanently);
myFinishedListMenu.addAction(actionSet_upload_limit);
myFinishedListMenu.addAction(actionTorrent_Properties); myFinishedListMenu.addAction(actionTorrent_Properties);
if(!previewProgram.isEmpty() && BTSession->isFilePreviewPossible(fileHash) && selectedIndexes.size()<=finishedListModel->columnCount()){ if(!previewProgram.isEmpty() && BTSession->isFilePreviewPossible(fileHash) && selectedIndexes.size()<=finishedListModel->columnCount()){
myFinishedListMenu.addAction(actionPreview_file); myFinishedListMenu.addAction(actionPreview_file);

View file

@ -54,6 +54,9 @@ class FinishedTorrents : public QWidget, public Ui::seeding{
void displayFinishedListMenu(const QPoint&); void displayFinishedListMenu(const QPoint&);
void setRowColor(int row, const QString& color); void setRowColor(int row, const QString& color);
protected slots:
void on_actionSet_upload_limit_triggered();
}; };
#endif #endif

View file

@ -76,6 +76,11 @@
<string>Preview file</string> <string>Preview file</string>
</property> </property>
</action> </action>
<action name="actionSet_upload_limit" >
<property name="text" >
<string>Set upload limit</string>
</property>
</action>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>