Browse Source

- FEATURE: Allow to buy downloads using ShareMonkey

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
b2950afd5c
  1. 1
      Changelog
  2. 3
      src/FinishedTorrents.cpp
  3. 20
      src/GUI.cpp
  4. 1
      src/GUI.h
  5. 5
      src/download.ui
  6. 3
      src/downloadingTorrents.cpp
  7. 5
      src/seeding.ui

1
Changelog

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
- FEATURE: Allow to define double-click actions in torrents lists
- FEATURE: Allow to open torrent destination folder
- FEATURE: Real progress bar in torrent properties that displays downloaded pieces
- FEATURE: Allow to buy downloads using ShareMonkey
- BUGFIX: Do not display seeds number in seeding list (always 0)
- COSMETIC: Do not display progress bar in seeding list (always 100%)

3
src/FinishedTorrents.cpp

@ -73,6 +73,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par @@ -73,6 +73,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
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(actionBuy_it, SIGNAL(triggered()), (GUI*)parent, SLOT(goBuyPage()));
connect(actionTorrent_Properties, SIGNAL(triggered()), this, SLOT(propertiesSelection()));
connect(actionHOSColName, SIGNAL(triggered()), this, SLOT(hideOrShowColumnName()));
@ -379,6 +380,8 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){ @@ -379,6 +380,8 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint& pos){
myFinishedListMenu.addSeparator();
myFinishedListMenu.addAction(actionOpen_destination_folder);
myFinishedListMenu.addAction(actionTorrent_Properties);
myFinishedListMenu.addSeparator();
myFinishedListMenu.addAction(actionBuy_it);
// Call menu
// XXX: why mapToGlobal() is not enough?

20
src/GUI.cpp

@ -411,6 +411,26 @@ void GUI::openDestinationFolder() const { @@ -411,6 +411,26 @@ void GUI::openDestinationFolder() const {
}
}
void GUI::goBuyPage() 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);
QDesktopServices::openUrl("http://match.sharemonkey.com/?info_hash="+hash+"&fileName="+h.name());
}
}
// 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

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

5
src/download.ui

@ -428,6 +428,11 @@ @@ -428,6 +428,11 @@
<string>ETA</string>
</property>
</action>
<action name="actionBuy_it" >
<property name="text" >
<string>Buy it</string>
</property>
</action>
</widget>
<resources>
<include location="icons.qrc" />

3
src/downloadingTorrents.cpp

@ -98,6 +98,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession) @@ -98,6 +98,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
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()));
connect(actionBuy_it, SIGNAL(triggered()), (GUI*)parent, SLOT(goBuyPage()));
connect(actionHOSColName, SIGNAL(triggered()), this, SLOT(hideOrShowColumnName()));
connect(actionHOSColSize, SIGNAL(triggered()), this, SLOT(hideOrShowColumnSize()));
@ -298,6 +299,8 @@ void DownloadingTorrents::displayDLListMenu(const QPoint& pos) { @@ -298,6 +299,8 @@ void DownloadingTorrents::displayDLListMenu(const QPoint& pos) {
myDLLlistMenu.addSeparator();
myDLLlistMenu.addAction(actionOpen_destination_folder);
myDLLlistMenu.addAction(actionTorrent_Properties);
myDLLlistMenu.addSeparator();
myDLLlistMenu.addAction(actionBuy_it);
// Call menu
// XXX: why mapToGlobal() is not enough?
myDLLlistMenu.exec(mapToGlobal(pos)+QPoint(10,60));

5
src/seeding.ui

@ -126,6 +126,11 @@ @@ -126,6 +126,11 @@
<string>Ratio</string>
</property>
</action>
<action name="actionBuy_it" >
<property name="text" >
<string>Buy it</string>
</property>
</action>
</widget>
<resources>
<include location="icons.qrc" />

Loading…
Cancel
Save