mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
- Allow to open destination folder on double-click
This commit is contained in:
24
src/GUI.cpp
24
src/GUI.cpp
@@ -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 :
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user