Browse Source

- Added popup menu for file priorities in torrent addition dialog too

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
8fdd614673
  1. 1
      Changelog
  2. 8
      TODO
  3. 3
      src/addTorrentDialog.ui
  4. 60
      src/torrentAddition.h

1
Changelog

@ -23,6 +23,7 @@
- FEATURE: IPv6 is now fully supported - FEATURE: IPv6 is now fully supported
- FEATURE: Real torrent share ratio is now displayed in transfer list - FEATURE: Real torrent share ratio is now displayed in transfer list
- FEATURE: Added keyboard shortcuts for main actions (see wiki) - FEATURE: Added keyboard shortcuts for main actions (see wiki)
- FEATURE: Added a popup menu to set priority for multiple fies at once
- I18N: Added Hungarian translation - I18N: Added Hungarian translation
- BUGFIX: Progress of paused torrents is now correct on restart - BUGFIX: Progress of paused torrents is now correct on restart
- BUGFIX: Progress column gets sorted on restart it is was during last execution - BUGFIX: Progress column gets sorted on restart it is was during last execution

8
TODO

@ -36,13 +36,11 @@
- Display Url seeds in torrent properties and allow to edit them - Display Url seeds in torrent properties and allow to edit them
- Sorting in Download Status column should be smarter than just an alphabetical sort - Sorting in Download Status column should be smarter than just an alphabetical sort
- Windows port : http://www.peerweb.nl/qbittorrent/experimentalbuild/testing.zip - Windows port : http://www.peerweb.nl/qbittorrent/experimentalbuild/testing.zip
- Write documentation - Allow to scan multiple directories?
- Allow to scan multiple directories
- Fix all (or almost all) opened bugs in bug tracker - Fix all (or almost all) opened bugs in bug tracker
- Fix sorting with Qt 4.3 - Reported to Trolltech, waiting for fix - Fix column sorting with Qt 4.3 - Reported to Trolltech, waiting for their fix
- update sorting when a new torrent is added? - update sorting when a new torrent is added?
- Allow to hide columns - Allow to hide columns (gtsoul)
- Allow to set priorities for multiple files at once
- Complete documentation and english translation - Complete documentation and english translation
* beta2 * beta2
- Wait for some bug fixes in libtorrent : - Wait for some bug fixes in libtorrent :

3
src/addTorrentDialog.ui

@ -105,6 +105,9 @@
<property name="editTriggers" > <property name="editTriggers" >
<set>QAbstractItemView::AllEditTriggers</set> <set>QAbstractItemView::AllEditTriggers</set>
</property> </property>
<property name="selectionMode" >
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget> </widget>
</item> </item>
<item> <item>

60
src/torrentAddition.h

@ -71,6 +71,11 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
PropDelegate = new PropListDelegate(); PropDelegate = new PropListDelegate();
torrentContentList->setItemDelegate(PropDelegate); torrentContentList->setItemDelegate(PropDelegate);
connect(torrentContentList, SIGNAL(clicked(const QModelIndex&)), torrentContentList, SLOT(edit(const QModelIndex&))); connect(torrentContentList, SIGNAL(clicked(const QModelIndex&)), torrentContentList, SLOT(edit(const QModelIndex&)));
connect(torrentContentList, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(displayFilesListMenu(const QPoint&)));
connect(actionIgnored, SIGNAL(triggered()), this, SLOT(ignoreSelection()));
connect(actionNormal, SIGNAL(triggered()), this, SLOT(normalSelection()));
connect(actionHigh, SIGNAL(triggered()), this, SLOT(highSelection()));
connect(actionMaximum, SIGNAL(triggered()), this, SLOT(maximumSelection()));
torrentContentList->header()->resizeSection(0, 200); torrentContentList->header()->resizeSection(0, 200);
QString home = QDir::homePath(); QString home = QDir::homePath();
if(home[home.length()-1] != QDir::separator()){ if(home[home.length()-1] != QDir::separator()){
@ -173,6 +178,61 @@ class torrentAdditionDialog : public QDialog, private Ui_addTorrentDialog{
} }
} }
void displayFilesListMenu(const QPoint& pos){
QMenu myFilesLlistMenu(this);
QModelIndex index;
// Enable/disable pause/start action given the DL state
QModelIndexList selectedIndexes = torrentContentList->selectionModel()->selectedIndexes();
myFilesLlistMenu.setTitle(tr("Priority"));
myFilesLlistMenu.addAction(actionIgnored);
myFilesLlistMenu.addAction(actionNormal);
myFilesLlistMenu.addAction(actionHigh);
myFilesLlistMenu.addAction(actionMaximum);
// Call menu
// XXX: why mapToGlobal() is not enough?
myFilesLlistMenu.exec(mapToGlobal(pos)+QPoint(22,95));
}
void ignoreSelection(){
QModelIndexList selectedIndexes = torrentContentList->selectionModel()->selectedIndexes();
QModelIndex index;
foreach(index, selectedIndexes){
if(index.column() == PRIORITY){
PropListModel->setData(index, QVariant(IGNORED));
}
}
}
void normalSelection(){
QModelIndexList selectedIndexes = torrentContentList->selectionModel()->selectedIndexes();
QModelIndex index;
foreach(index, selectedIndexes){
if(index.column() == PRIORITY){
PropListModel->setData(index, QVariant(NORMAL));
}
}
}
void highSelection(){
QModelIndexList selectedIndexes = torrentContentList->selectionModel()->selectedIndexes();
QModelIndex index;
foreach(index, selectedIndexes){
if(index.column() == PRIORITY){
PropListModel->setData(index, QVariant(HIGH));
}
}
}
void maximumSelection(){
QModelIndexList selectedIndexes = torrentContentList->selectionModel()->selectedIndexes();
QModelIndex index;
foreach(index, selectedIndexes){
if(index.column() == PRIORITY){
PropListModel->setData(index, QVariant(MAXIMUM));
}
}
}
void savePiecesPriorities(){ void savePiecesPriorities(){
qDebug("Saving pieces priorities"); qDebug("Saving pieces priorities");
QFile pieces_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+fileHash+".priorities"); QFile pieces_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+fileHash+".priorities");

Loading…
Cancel
Save