- Allow to open destination folder on double-click

This commit is contained in:
Christophe Dumez 2007-11-16 18:26:00 +00:00
parent b47073901f
commit 18ee43225e
7 changed files with 20 additions and 44 deletions

View file

@ -980,26 +980,10 @@ void GUI::torrentDoubleClicked(QString hash, bool finished) {
case TOGGLE_PAUSE:
this->togglePausedState(hash);
break;
case DELETE_IT: {
int ret = QMessageBox::question(
this,
tr("Are you sure? -- qBittorrent"),
tr("Are you sure you want to delete the selected item(s) from download list and from hard drive?"),
tr("&Yes"), tr("&No"),
QString(), 0, 1);
if(ret)
return;
QString fileName = h.name();
// Remove the torrent
BTSession->deleteTorrent(hash, true);
// Delete item from list
if(finished) {
finishedTorrentTab->deleteTorrent(hash);
} else {
downloadingTorrentTab->deleteTorrent(hash);
}
// Update info bar
downloadingTorrentTab->setInfoBar(tr("'%1' was removed permanently.", "'xxx.avi' was removed permanently.").arg(fileName));
case OPEN_DEST: {
QTorrentHandle h = BTSession->getTorrentHandle(hash);
QString savePath = h.save_path();
QDesktopServices::openUrl(QUrl(savePath));
break;
}
case SHOW_PROPERTIES :

View file

@ -610,12 +610,12 @@
</item>
<item>
<property name="text" >
<string>Delete torrent</string>
<string>Open destination folder</string>
</property>
</item>
<item>
<property name="text" >
<string>Show torrent's properties</string>
<string>Display torrent properties</string>
</property>
</item>
</widget>
@ -653,12 +653,12 @@
</item>
<item>
<property name="text" >
<string>Delete torrent</string>
<string>Open destination folder</string>
</property>
</item>
<item>
<property name="text" >
<string>Show torrent's properties</string>
<string>Display torrent properties</string>
</property>
</item>
</widget>

View file

@ -998,14 +998,14 @@ QString options_imp::getScanDir() const {
// Return action on double-click on a downloading torrent set in options
int options_imp::getActionOnDblClOnTorrentDl() const {
if(actionTorrentDlOnDblClBox->currentIndex()<1)
return 1;
return 0;
return actionTorrentDlOnDblClBox->currentIndex();
}
// Return action on double-click on a finished torrent set in options
int options_imp::getActionOnDblClOnTorrentFn() const {
if(actionTorrentFnOnDblClBox->currentIndex()<1)
return 1;
return 0;
return actionTorrentFnOnDblClBox->currentIndex();
}

View file

@ -38,7 +38,7 @@
// actions on double-click on torrents
#define TOGGLE_PAUSE 0
#define DELETE_IT 1
#define OPEN_DEST 1
#define SHOW_PROPERTIES 2
using namespace libtorrent;