Skip to content

Commit 5ff9071

Browse files
committed
Fix summary page layout
1 parent a871f31 commit 5ff9071

File tree

2 files changed

+29
-38
lines changed

2 files changed

+29
-38
lines changed

summarypage.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ SummaryPage::SummaryPage(QWidget *parent) :
3636
}
3737

3838
void SummaryPage::initializePage() {
39+
ui->summaryTextBox->clear();
3940
QString inputPath = field("inputPath").toString();
4041
ui->summaryTextBox->append(QString("<b>Input path:</b> %1\n").arg(inputPath));
4142
if (QFileInfo(inputPath).isDir())
@@ -59,14 +60,14 @@ void SummaryPage::initializePage() {
5960

6061
int pieceSizeIndex = field("pieceSize").toInt();
6162
int pieceSize;
62-
if(pieceSizeIndex == 0)
63+
if(pieceSizeIndex == 0) {
6364
pieceSize = 0;
64-
else
65-
pieceSize = 1024 * (2 << (pieceSizeIndex + 2));
66-
if (pieceSize == 0)
6765
ui->summaryTextBox->append(QString("<b>Piece size:</b> Auto\n"));
68-
else
66+
}
67+
else {
68+
pieceSize = 1024 * (2 << (pieceSizeIndex + 2));
6969
ui->summaryTextBox->append(QString("<b>Piece size:</b> %1 KB\n").arg(pieceSize));
70+
}
7071
ui->summaryTextBox->append(QString("<b>Include file modification times:</b> %1\n").arg(field("includeFileModTimes").toString()));
7172
ui->summaryTextBox->append(QString("<b>Private torrent:</b> %1\n").arg(field("privateTorrent").toString()));
7273

summarypage.ui

+23-33
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,29 @@
1313
<property name="windowTitle">
1414
<string>WizardPage</string>
1515
</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>
16+
<layout class="QVBoxLayout" name="verticalLayout">
17+
<item>
18+
<widget class="QLabel" name="label">
19+
<property name="font">
20+
<font>
21+
<pointsize>14</pointsize>
22+
<weight>75</weight>
23+
<bold>true</bold>
24+
</font>
25+
</property>
26+
<property name="text">
27+
<string>Summary</string>
28+
</property>
29+
</widget>
30+
</item>
31+
<item>
32+
<widget class="QTextEdit" name="summaryTextBox">
33+
<property name="readOnly">
34+
<bool>true</bool>
35+
</property>
36+
</widget>
37+
</item>
38+
</layout>
4939
</widget>
5040
<resources/>
5141
<connections/>

0 commit comments

Comments
 (0)