Skip to content

Commit cb2d158

Browse files
committed
Version 1.0.3
1 parent 4e8b302 commit cb2d158

12 files changed

+171
-14
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.0.3 - 2013-05-04
2+
* Added summary screen
3+
* Fix: prevent finish button from being clicked before torrent creation is complete
4+
* Fix: prevent empty tracker/webseed lines from being added
5+
* Minor refactoring
6+
17
# 1.0.2 - 2013-03-18
28
* Removed requirement to add trackers/webseeds (for DHT-only torrents)
39
* Removed ability to customize creator string (will always be set to qMakeTorrent <version>)

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# qMakeTorrent
2-
* Current version: 1.0.2
2+
* Current version: 1.0.3
33
* Author: whitehat2k9
44
* License: BSD
55
* [Website](http://whitehat2k9.github.com/qMakeTorrent)
@@ -10,7 +10,7 @@ qMakeTorrent is an advanced torrent creator with batch capability.
1010

1111
## Installation
1212
### Windows
13-
[Click here](http://whitehat2k9.github.com/qMakeTorrent/bin/qMakeTorrent-1.0.2-win32.zip) to download
13+
[Click here](http://whitehat2k9.github.com/qMakeTorrent/bin/qMakeTorrent-1.0.3-win32.zip) to download
1414
a prebuilt version for Windows.
1515

1616
You may need to download the [Microsoft Visual C++ 2010 SP1 Redistributable Package (x86)](http://www.microsoft.com/en-us/download/details.aspx?id=8328).

Diff for: createtorrent.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ void CreateTorrent::makeTorrentFiles(QString source, QString outputLocation, boo
4646
this->webSeeds = webSeeds.split("\n");
4747
this->comment = comment;
4848
this->creator = creator;
49-
if(pieceSizeIndex == 0)
50-
this->pieceSize = 0;
51-
else
52-
this->pieceSize = 1024 * (2 << (pieceSizeIndex + 2));
49+
this->pieceSize = pieceSize;
5350
this->flags = flags;
5451
this->isPrivate = isPrivate;
5552
start();
@@ -122,13 +119,16 @@ void CreateTorrent::run() {
122119
this->pieceCount = torrent.num_pieces();
123120

124121
foreach(const QString &webSeed, this->webSeeds) {
125-
torrent.add_url_seed(webSeed.trimmed().toStdString());
122+
if (!webSeeds.isEmpty())
123+
torrent.add_url_seed(webSeed.trimmed().toStdString());
126124
}
127125

128126
int tier = 0;
129127
foreach(const QString &tracker, this->announceUrls) {
130-
torrent.add_tracker(tracker.trimmed().toStdString(), tier);
131-
tier++;
128+
if (!tracker.isEmpty()) {
129+
torrent.add_tracker(tracker.trimmed().toStdString(), tier);
130+
tier++;
131+
}
132132
}
133133

134134
torrent.set_priv(this->isPrivate);

Diff for: creationpage.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,12 @@ void CreationPage::initializePage() {
7373
int includeSymlinks = field("includeSymlinks").toBool() ? create_torrent::symlinks : 0;
7474
int flags = includeFileModTimes | includeSymlinks;
7575

76-
ctThread->makeTorrentFiles(field("inputPath").toString(), field("outputPath").toString(), field("batchMode").toBool(), field("announceUrls").toString(), field("webSeeds").toString(), field("comment").toString(), QString("%1 %2").arg(PROGRAM_NAME, PROGRAM_VERSION), field("pieceSize").toInt(), flags, field("privateTorrent").toBool());
76+
int pieceSizeIndex = field("pieceSize").toInt();
77+
int pieceSize;
78+
if(pieceSizeIndex == 0)
79+
pieceSize = 0;
80+
else
81+
pieceSize = 1024 * (2 << (pieceSizeIndex + 2));
82+
83+
ctThread->makeTorrentFiles(field("inputPath").toString(), field("outputPath").toString(), field("batchMode").toBool(), field("announceUrls").toString(), field("webSeeds").toString(), field("comment").toString(), QString("%1 %2").arg(PROGRAM_NAME, PROGRAM_VERSION), pieceSize, flags, field("privateTorrent").toBool());
7784
}

Diff for: qMakeTorrent.pro

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ SOURCES += main.cpp\
1818
propertiespage.cpp \
1919
creationpage.cpp \
2020
createtorrent.cpp \
21-
outputpage.cpp
21+
outputpage.cpp \
22+
summarypage.cpp
2223

2324
HEADERS += wizard.h \
2425
intropage.h \
@@ -28,7 +29,8 @@ HEADERS += wizard.h \
2829
creationpage.h \
2930
version.h \
3031
createtorrent.h \
31-
outputpage.h
32+
outputpage.h \
33+
summarypage.h
3234

3335
FORMS += \
3436
wizard.ui \
@@ -37,7 +39,8 @@ FORMS += \
3739
trackerspage.ui \
3840
propertiespage.ui \
3941
creationpage.ui \
40-
outputpage.ui
42+
outputpage.ui \
43+
summarypage.ui
4144

4245
LIBS += -lboost_system -ltorrent-rasterbar -lboost_filesystem
4346

Diff for: summarypage.cpp

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#include "summarypage.h"
2+
#include "ui_summarypage.h"
3+
4+
#include <QtGui>
5+
6+
SummaryPage::SummaryPage(QWidget *parent) :
7+
QWizardPage(parent),
8+
ui(new Ui::SummaryPage)
9+
{
10+
ui->setupUi(this);
11+
}
12+
13+
void SummaryPage::initializePage() {
14+
QString inputPath = field("inputPath").toString();
15+
ui->summaryTextBox->append(QString("<b>Input path:</b> %1\n").arg(inputPath));
16+
if (QFileInfo(inputPath).isDir())
17+
ui->summaryTextBox->append("<b>Input type:</b> directory\n");
18+
else
19+
ui->summaryTextBox->append("<b>Input type:</b> file\n");
20+
ui->summaryTextBox->append(QString("<b>Batch mode: %1\n").arg(field("batchMode").toString()));
21+
ui->summaryTextBox->append(QString("<b>Output path:</b> %1\n").arg(field("outputPath").toString()));
22+
23+
foreach(const QString &webSeed, field("webSeeds").toString().split('\n')) {
24+
if (!webSeed.isEmpty())
25+
ui->summaryTextBox->append(QString("<b>Web seed:</b> %1\n").arg(webSeed));
26+
}
27+
28+
foreach(const QString &tracker, field("announceUrls").toString().split('\n')) {
29+
if (!tracker.isEmpty())
30+
ui->summaryTextBox->append(QString("<b>Tracker:</b> %1\n").arg(tracker));
31+
}
32+
33+
ui->summaryTextBox->append(QString("<b>Comment:</b> <pre>%1</pre>\n").arg(field("comment").toString()));
34+
35+
int pieceSizeIndex = field("pieceSize").toInt();
36+
int pieceSize;
37+
if(pieceSizeIndex == 0)
38+
pieceSize = 0;
39+
else
40+
pieceSize = 1024 * (2 << (pieceSizeIndex + 2));
41+
if (pieceSize == 0)
42+
ui->summaryTextBox->append(QString("<b>Piece size:</b> Auto\n"));
43+
else
44+
ui->summaryTextBox->append(QString("<b>Piece size:</b> %1 KB\n").arg(pieceSize));
45+
ui->summaryTextBox->append(QString("<b>Include file modification times:</b> %1\n").arg(field("includeFileModTimes").toString()));
46+
ui->summaryTextBox->append(QString("<b>Private torrent:</b> %1\n").arg(field("privateTorrent").toString()));
47+
48+
49+
50+
51+
}
52+
53+
SummaryPage::~SummaryPage()
54+
{
55+
delete ui;
56+
}

Diff for: summarypage.h

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#ifndef SUMMARYPAGE_H
2+
#define SUMMARYPAGE_H
3+
4+
#include <QWizardPage>
5+
6+
namespace Ui {
7+
class SummaryPage;
8+
}
9+
10+
class SummaryPage : public QWizardPage
11+
{
12+
Q_OBJECT
13+
14+
public:
15+
explicit SummaryPage(QWidget *parent = 0);
16+
~SummaryPage();
17+
18+
void initializePage();
19+
20+
private:
21+
Ui::SummaryPage *ui;
22+
};
23+
24+
#endif // SUMMARYPAGE_H

Diff for: summarypage.ui

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>SummaryPage</class>
4+
<widget class="QWizardPage" name="SummaryPage">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>400</width>
10+
<height>300</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>WizardPage</string>
15+
</property>
16+
<widget class="QLabel" name="label">
17+
<property name="geometry">
18+
<rect>
19+
<x>10</x>
20+
<y>0</y>
21+
<width>141</width>
22+
<height>17</height>
23+
</rect>
24+
</property>
25+
<property name="font">
26+
<font>
27+
<pointsize>14</pointsize>
28+
<weight>75</weight>
29+
<bold>true</bold>
30+
</font>
31+
</property>
32+
<property name="text">
33+
<string>Summary</string>
34+
</property>
35+
</widget>
36+
<widget class="QTextEdit" name="summaryTextBox">
37+
<property name="geometry">
38+
<rect>
39+
<x>10</x>
40+
<y>20</y>
41+
<width>381</width>
42+
<height>221</height>
43+
</rect>
44+
</property>
45+
<property name="readOnly">
46+
<bool>true</bool>
47+
</property>
48+
</widget>
49+
</widget>
50+
<resources/>
51+
<connections/>
52+
</ui>

Diff for: trackerspage.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ TrackersPage::TrackersPage(QWidget *parent) :
3737

3838
}
3939

40+
bool TrackersPage::validatePage() {
41+
ui->announceUrls->setPlainText(ui->announceUrls->toPlainText().trimmed());
42+
ui->webSeeds->setPlainText(ui->webSeeds->toPlainText().trimmed());
43+
return true;
44+
}
45+
4046
TrackersPage::~TrackersPage()
4147
{
4248
delete ui;

Diff for: trackerspage.h

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class TrackersPage : public QWizardPage
3737

3838
public:
3939
explicit TrackersPage(QWidget *parent = 0);
40+
bool validatePage();
4041
~TrackersPage();
4142

4243
public slots:

Diff for: version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define VERSION_H
2727

2828
#define PROGRAM_NAME "qMakeTorrent"
29-
#define PROGRAM_VERSION "1.0.2"
29+
#define PROGRAM_VERSION "1.0.3"
3030
#define PROGRAM_URL "http://whitehat2k9.github.com/qMakeTorrent"
3131

3232
#endif

Diff for: wizard.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "outputpage.h"
3131
#include "trackerspage.h"
3232
#include "propertiespage.h"
33+
#include "summarypage.h"
3334
#include "creationpage.h"
3435
#include "version.h"
3536

@@ -46,6 +47,7 @@ Wizard::Wizard(QWidget *parent) :
4647
this->addPage(new OutputPage);
4748
this->addPage(new TrackersPage);
4849
this->addPage(new PropertiesPage);
50+
this->addPage(new SummaryPage);
4951
this->addPage(new CreationPage);
5052
this->setOption(this->DisabledBackButtonOnLastPage, true);
5153
}

0 commit comments

Comments
 (0)