Browse Source

- Allow to open destination folder on right click on a torrent

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
c580285fe8
  1. 8
      TODO
  2. 2
      src/FinishedTorrents.cpp
  3. 24
      src/GUI.cpp
  4. 1
      src/GUI.h
  5. 60
      src/download.ui
  6. 2
      src/downloadingTorrents.cpp
  7. 27
      src/seeding.ui

8
TODO

@ -46,13 +46,5 @@ @@ -46,13 +46,5 @@
- Display in torrent addition dialog:
* free disk space on selected drive
* free disk space after torrent download (and/or torrent size)
- Add "Open destination dir" on right click
- Use ShareMonkey Web service (http://www.sharemonkey.com/)
// in v1.0.0 - FEATURE FREEZE
- Fix all (or almost all) opened bugs in bug tracker
- Recheck doc
- Translations update (IN PROGRESS)
// RC8
- BUGFIX: Fix destination save dir in addition dialog

2
src/FinishedTorrents.cpp

@ -69,6 +69,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par @@ -69,6 +69,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_triggered()));
connect(actionPreview_file, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPreview_file_triggered()));
connect(actionDelete_Permanently, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_Permanently_triggered()));
connect(actionOpen_destination_folder, SIGNAL(triggered()), (GUI*)parent, SLOT(openDestinationFolder()));
connect(actionTorrent_Properties, SIGNAL(triggered()), this, SLOT(propertiesSelection()));
}
@ -352,6 +353,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){ @@ -352,6 +353,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
myFinishedListMenu.addSeparator();
myFinishedListMenu.addAction(actionSet_upload_limit);
myFinishedListMenu.addSeparator();
myFinishedListMenu.addAction(actionOpen_destination_folder);
myFinishedListMenu.addAction(actionTorrent_Properties);
// Call menu
// XXX: why mapToGlobal() is not enough?

24
src/GUI.cpp

@ -386,6 +386,30 @@ void GUI::on_actionPreview_file_triggered() { @@ -386,6 +386,30 @@ void GUI::on_actionPreview_file_triggered() {
new previewSelect(this, h);
}
void GUI::openDestinationFolder() const {
QStringList hashes;
switch(tabs->currentIndex()){
case 0:
hashes = downloadingTorrentTab->getSelectedTorrents(true);
break;
case 1:
hashes = finishedTorrentTab->getSelectedTorrents(true);
break;
default:
return;
}
QString hash;
QStringList pathsList;
foreach(hash, hashes) {
QTorrentHandle h = BTSession->getTorrentHandle(hash);
QString savePath = h.save_path();
if(!pathsList.contains(savePath)) {
pathsList.append(savePath);
QDesktopServices::openUrl(QUrl(savePath));
}
}
}
// Necessary if we want to close the window
// in one time if "close to systray" is enabled
void GUI::on_actionExit_triggered() {

1
src/GUI.h

@ -146,6 +146,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ @@ -146,6 +146,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
public slots:
void trackerAuthenticationRequired(QTorrentHandle& h);
void setTabText(int index, QString text) const;
void openDestinationFolder() const;
protected:
void closeEvent(QCloseEvent *);

60
src/download.ui

@ -18,7 +18,16 @@ @@ -18,7 +18,16 @@
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
@ -26,7 +35,16 @@ @@ -26,7 +35,16 @@
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
@ -249,15 +267,22 @@ @@ -249,15 +267,22 @@
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QTextBrowser" name="infoBar" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -283,7 +308,16 @@ @@ -283,7 +308,16 @@
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
@ -346,7 +380,17 @@ @@ -346,7 +380,17 @@
<string>Torrent Properties</string>
</property>
</action>
<action name="actionOpen_destination_folder" >
<property name="icon" >
<iconset resource="icons.qrc" >:/Icons/folder.png</iconset>
</property>
<property name="text" >
<string>Open destination folder</string>
</property>
</action>
</widget>
<resources/>
<resources>
<include location="icons.qrc" />
</resources>
<connections/>
</ui>

2
src/downloadingTorrents.cpp

@ -93,6 +93,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession) @@ -93,6 +93,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_triggered()));
connect(actionPreview_file, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPreview_file_triggered()));
connect(actionDelete_Permanently, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_Permanently_triggered()));
connect(actionOpen_destination_folder, SIGNAL(triggered()), (GUI*)parent, SLOT(openDestinationFolder()));
connect(actionTorrent_Properties, SIGNAL(triggered()), this, SLOT(propertiesSelection()));
// Set info Bar infos
setInfoBar(tr("qBittorrent %1 started.", "e.g: qBittorrent v0.x started.").arg(QString::fromUtf8(""VERSION)));
@ -286,6 +287,7 @@ void DownloadingTorrents::displayDLListMenu(const QPoint& pos) { @@ -286,6 +287,7 @@ void DownloadingTorrents::displayDLListMenu(const QPoint& pos) {
myDLLlistMenu.addAction(actionSet_download_limit);
myDLLlistMenu.addAction(actionSet_upload_limit);
myDLLlistMenu.addSeparator();
myDLLlistMenu.addAction(actionOpen_destination_folder);
myDLLlistMenu.addAction(actionTorrent_Properties);
// Call menu
// XXX: why mapToGlobal() is not enough?

27
src/seeding.ui

@ -13,12 +13,21 @@ @@ -13,12 +13,21 @@
<string>Search</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item>
<widget class="QLabel" name="lbl_finished" >
<property name="text" >
@ -84,7 +93,17 @@ @@ -84,7 +93,17 @@
<string>Set upload limit</string>
</property>
</action>
<action name="actionOpen_destination_folder" >
<property name="icon" >
<iconset resource="icons.qrc" >:/Icons/folder.png</iconset>
</property>
<property name="text" >
<string>Open destination folder</string>
</property>
</action>
</widget>
<resources/>
<resources>
<include location="icons.qrc" />
</resources>
<connections/>
</ui>

Loading…
Cancel
Save