diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-02-14 21:02:52 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-02-14 21:10:54 +0100 |
commit | f7fdf134681a35950edeb1054a1e095f7acec058 (patch) | |
tree | 684e59f2f84d11b507065f25d5cfd592680cffda | |
parent | 3933afcc0942a635ff253a59d6138983e6fd90b8 (diff) | |
download | rockbox-f7fdf134681a35950edeb1054a1e095f7acec058.tar.gz rockbox-f7fdf134681a35950edeb1054a1e095f7acec058.zip |
Move manual tab contents to separate widget.
Create a new widget which holds the contents of the manual tab and its logic.
Unify its display / download code. Fixes FS#12587, which was caused by
duplicated code.
Change-Id: I5721d2a95ebeaf80481c1fd149eda22cf1328501
-rw-r--r-- | rbutil/rbutilqt/gui/manualwidget.cpp | 140 | ||||
-rw-r--r-- | rbutil/rbutilqt/gui/manualwidget.h | 46 | ||||
-rw-r--r-- | rbutil/rbutilqt/gui/manualwidgetfrm.ui | 116 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 93 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.h | 4 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pri | 3 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pro | 3 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqtfrm.ui | 102 |
8 files changed, 317 insertions, 190 deletions
diff --git a/rbutil/rbutilqt/gui/manualwidget.cpp b/rbutil/rbutilqt/gui/manualwidget.cpp new file mode 100644 index 0000000000..f84da69a2a --- /dev/null +++ b/rbutil/rbutilqt/gui/manualwidget.cpp | |||
@@ -0,0 +1,140 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2012 by Dominik Riebeling | ||
10 | * | ||
11 | * All files in this archive are subject to the GNU General Public License. | ||
12 | * See the file COPYING in the source tree root for full license agreement. | ||
13 | * | ||
14 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
15 | * KIND, either express or implied. | ||
16 | * | ||
17 | ****************************************************************************/ | ||
18 | |||
19 | #include <QtGui> | ||
20 | #include <QDebug> | ||
21 | #include "manualwidget.h" | ||
22 | #include "rbutilqt.h" | ||
23 | #include "rbsettings.h" | ||
24 | #include "serverinfo.h" | ||
25 | #include "systeminfo.h" | ||
26 | |||
27 | ManualWidget::ManualWidget(QWidget *parent) : QWidget(parent) | ||
28 | { | ||
29 | ui.setupUi(this); | ||
30 | ui.radioPdf->setChecked(true); | ||
31 | connect(ui.buttonDownloadManual, SIGNAL(clicked()), this, SLOT(downloadManual())); | ||
32 | } | ||
33 | |||
34 | |||
35 | QString ManualWidget::manualUrl(ManualFormat format) | ||
36 | { | ||
37 | if(RbSettings::value(RbSettings::Platform).toString().isEmpty()) { | ||
38 | return QString(); | ||
39 | } | ||
40 | |||
41 | QString buildservermodel = SystemInfo::value(SystemInfo::CurBuildserverModel).toString(); | ||
42 | QString modelman = SystemInfo::value(SystemInfo::CurManual).toString(); | ||
43 | QString manualbasename; | ||
44 | |||
45 | if(modelman.isEmpty()) { | ||
46 | manualbasename = "rockbox-" + buildservermodel; | ||
47 | } | ||
48 | else { | ||
49 | manualbasename = "rockbox-" + modelman; | ||
50 | } | ||
51 | |||
52 | QString manual = SystemInfo::value(SystemInfo::ManualUrl).toString(); | ||
53 | switch(format) { | ||
54 | case ManualPdf: | ||
55 | manual.replace("%EXTENSION%", "pdf"); | ||
56 | break; | ||
57 | case ManualHtml: | ||
58 | manual.replace("%EXTENSION%", "html"); | ||
59 | manualbasename += "/rockbox-build"; | ||
60 | break; | ||
61 | case ManualZip: | ||
62 | manual.replace("%EXTENSION%", "-html.zip"); | ||
63 | manualbasename += "/rockbox-build"; | ||
64 | break; | ||
65 | default: | ||
66 | break; | ||
67 | }; | ||
68 | |||
69 | manual.replace("%MANUALBASENAME%", manualbasename); | ||
70 | return manual; | ||
71 | } | ||
72 | |||
73 | |||
74 | void ManualWidget::updateManual() | ||
75 | { | ||
76 | if(!RbSettings::value(RbSettings::Platform).toString().isEmpty()) | ||
77 | { | ||
78 | ui.labelPdfManual->setText(tr("<a href='%1'>PDF Manual</a>") | ||
79 | .arg(manualUrl(ManualPdf))); | ||
80 | ui.labelHtmlManual->setText(tr("<a href='%1'>HTML Manual (opens in browser)</a>") | ||
81 | .arg(manualUrl(ManualHtml))); | ||
82 | } | ||
83 | else { | ||
84 | ui.labelPdfManual->setText(tr("Select a device for a link to the correct manual")); | ||
85 | ui.labelHtmlManual->setText(tr("<a href='%1'>Manual Overview</a>") | ||
86 | .arg("http://www.rockbox.org/manual.shtml")); | ||
87 | } | ||
88 | } | ||
89 | |||
90 | |||
91 | void ManualWidget::downloadManual(void) | ||
92 | { | ||
93 | if(RbUtilQt::chkConfig(this)) { | ||
94 | return; | ||
95 | } | ||
96 | if(QMessageBox::question(this, tr("Confirm download"), | ||
97 | tr("Do you really want to download the manual? The manual will be saved " | ||
98 | "to the root folder of your player."), | ||
99 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) { | ||
100 | return; | ||
101 | } | ||
102 | QString manual = SystemInfo::value(SystemInfo::CurManual).toString(); | ||
103 | if(manual.isEmpty()) { | ||
104 | manual = "rockbox-" + SystemInfo::value(SystemInfo::CurBuildserverModel).toString(); | ||
105 | } | ||
106 | |||
107 | QDate date = QDate::fromString(ServerInfo::value( | ||
108 | ServerInfo::DailyDate).toString(), Qt::ISODate); | ||
109 | QString manualurl; | ||
110 | |||
111 | ProgressLoggerGui* logger = new ProgressLoggerGui(this); | ||
112 | logger->show(); | ||
113 | ZipInstaller *installer = new ZipInstaller(this); | ||
114 | installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); | ||
115 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) | ||
116 | installer->setCache(true); | ||
117 | |||
118 | if(ui.radioPdf->isChecked()) { | ||
119 | manualurl = manualUrl(ManualPdf); | ||
120 | installer->setLogSection("Manual (PDF)"); | ||
121 | installer->setTarget("/" + manual + ".pdf"); | ||
122 | } | ||
123 | else { | ||
124 | manualurl = manualUrl(ManualZip); | ||
125 | installer->setLogSection("Manual (HTML)"); | ||
126 | installer->setTarget("/" + manual + "-" + date.toString("yyyyMMdd") + "-html.zip"); | ||
127 | } | ||
128 | qDebug() << "[ManualWidget] Manual URL:" << manualurl; | ||
129 | |||
130 | installer->setLogVersion(ServerInfo::value(ServerInfo::DailyDate).toString()); | ||
131 | installer->setUrl(manualurl); | ||
132 | installer->setUnzip(false); | ||
133 | |||
134 | connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); | ||
135 | connect(installer, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); | ||
136 | connect(installer, SIGNAL(done(bool)), logger, SLOT(setFinished())); | ||
137 | connect(logger, SIGNAL(aborted()), installer, SLOT(abort())); | ||
138 | installer->install(); | ||
139 | } | ||
140 | |||
diff --git a/rbutil/rbutilqt/gui/manualwidget.h b/rbutil/rbutilqt/gui/manualwidget.h new file mode 100644 index 0000000000..6de2de55bd --- /dev/null +++ b/rbutil/rbutilqt/gui/manualwidget.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2012 by Dominik Riebeling | ||
10 | * | ||
11 | * All files in this archive are subject to the GNU General Public License. | ||
12 | * See the file COPYING in the source tree root for full license agreement. | ||
13 | * | ||
14 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
15 | * KIND, either express or implied. | ||
16 | * | ||
17 | ****************************************************************************/ | ||
18 | |||
19 | #ifndef MANUALWIDGET_H | ||
20 | #define MANUALWIDGET_H | ||
21 | |||
22 | #include <QtGui> | ||
23 | #include "ui_manualwidgetfrm.h" | ||
24 | |||
25 | class ManualWidget : public QWidget | ||
26 | { | ||
27 | Q_OBJECT | ||
28 | public: | ||
29 | enum ManualFormat { | ||
30 | ManualPdf, | ||
31 | ManualHtml, | ||
32 | ManualZip, | ||
33 | }; | ||
34 | ManualWidget(QWidget *parent = 0); | ||
35 | |||
36 | public slots: | ||
37 | void downloadManual(void); | ||
38 | void updateManual(); | ||
39 | QString manualUrl(ManualFormat format); | ||
40 | |||
41 | private: | ||
42 | Ui::ManualWidgetFrm ui; | ||
43 | }; | ||
44 | |||
45 | #endif | ||
46 | |||
diff --git a/rbutil/rbutilqt/gui/manualwidgetfrm.ui b/rbutil/rbutilqt/gui/manualwidgetfrm.ui new file mode 100644 index 0000000000..8757c4569e --- /dev/null +++ b/rbutil/rbutilqt/gui/manualwidgetfrm.ui | |||
@@ -0,0 +1,116 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <ui version="4.0"> | ||
3 | <class>ManualWidgetFrm</class> | ||
4 | <widget class="QWidget" name="ManualWidgetFrm"> | ||
5 | <property name="geometry"> | ||
6 | <rect> | ||
7 | <x>0</x> | ||
8 | <y>0</y> | ||
9 | <width>543</width> | ||
10 | <height>255</height> | ||
11 | </rect> | ||
12 | </property> | ||
13 | <property name="windowTitle"> | ||
14 | <string>Form</string> | ||
15 | </property> | ||
16 | <layout class="QGridLayout" name="gridLayout"> | ||
17 | <item row="0" column="0"> | ||
18 | <widget class="QGroupBox" name="groupBox_2"> | ||
19 | <property name="title"> | ||
20 | <string>Read the manual</string> | ||
21 | </property> | ||
22 | <layout class="QGridLayout"> | ||
23 | <item row="0" column="0"> | ||
24 | <widget class="QLabel" name="labelPdfManual"> | ||
25 | <property name="text"> | ||
26 | <string>PDF manual</string> | ||
27 | </property> | ||
28 | <property name="openExternalLinks"> | ||
29 | <bool>true</bool> | ||
30 | </property> | ||
31 | <property name="textInteractionFlags"> | ||
32 | <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set> | ||
33 | </property> | ||
34 | </widget> | ||
35 | </item> | ||
36 | <item row="1" column="0"> | ||
37 | <widget class="QLabel" name="labelHtmlManual"> | ||
38 | <property name="text"> | ||
39 | <string>HTML manual</string> | ||
40 | </property> | ||
41 | <property name="openExternalLinks"> | ||
42 | <bool>true</bool> | ||
43 | </property> | ||
44 | <property name="textInteractionFlags"> | ||
45 | <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set> | ||
46 | </property> | ||
47 | </widget> | ||
48 | </item> | ||
49 | </layout> | ||
50 | </widget> | ||
51 | </item> | ||
52 | <item row="1" column="0"> | ||
53 | <widget class="QGroupBox" name="groupBox"> | ||
54 | <property name="title"> | ||
55 | <string>Download the manual</string> | ||
56 | </property> | ||
57 | <layout class="QGridLayout" name="_2"> | ||
58 | <item row="0" column="0"> | ||
59 | <layout class="QVBoxLayout" name="_3"> | ||
60 | <item> | ||
61 | <widget class="QRadioButton" name="radioPdf"> | ||
62 | <property name="text"> | ||
63 | <string>&PDF version</string> | ||
64 | </property> | ||
65 | </widget> | ||
66 | </item> | ||
67 | <item> | ||
68 | <widget class="QRadioButton" name="radioHtmlzip"> | ||
69 | <property name="text"> | ||
70 | <string>&HTML version (zip file)</string> | ||
71 | </property> | ||
72 | </widget> | ||
73 | </item> | ||
74 | </layout> | ||
75 | </item> | ||
76 | <item row="0" column="1"> | ||
77 | <spacer> | ||
78 | <property name="orientation"> | ||
79 | <enum>Qt::Horizontal</enum> | ||
80 | </property> | ||
81 | <property name="sizeHint" stdset="0"> | ||
82 | <size> | ||
83 | <width>40</width> | ||
84 | <height>20</height> | ||
85 | </size> | ||
86 | </property> | ||
87 | </spacer> | ||
88 | </item> | ||
89 | <item row="0" column="2"> | ||
90 | <widget class="QPushButton" name="buttonDownloadManual"> | ||
91 | <property name="text"> | ||
92 | <string>Down&load</string> | ||
93 | </property> | ||
94 | </widget> | ||
95 | </item> | ||
96 | </layout> | ||
97 | </widget> | ||
98 | </item> | ||
99 | <item row="2" column="0"> | ||
100 | <spacer name="verticalSpacer"> | ||
101 | <property name="orientation"> | ||
102 | <enum>Qt::Vertical</enum> | ||
103 | </property> | ||
104 | <property name="sizeHint" stdset="0"> | ||
105 | <size> | ||
106 | <width>20</width> | ||
107 | <height>40</height> | ||
108 | </size> | ||
109 | </property> | ||
110 | </spacer> | ||
111 | </item> | ||
112 | </layout> | ||
113 | </widget> | ||
114 | <resources/> | ||
115 | <connections/> | ||
116 | </ui> | ||
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 466f379666..310f775ff6 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "serverinfo.h" | 38 | #include "serverinfo.h" |
39 | #include "systeminfo.h" | 39 | #include "systeminfo.h" |
40 | #include "ziputil.h" | 40 | #include "ziputil.h" |
41 | #include "manualwidget.h" | ||
41 | 42 | ||
42 | #include "progressloggerinterface.h" | 43 | #include "progressloggerinterface.h" |
43 | 44 | ||
@@ -113,8 +114,11 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) | |||
113 | m_gotInfo = false; | 114 | m_gotInfo = false; |
114 | m_auto = false; | 115 | m_auto = false; |
115 | 116 | ||
116 | // manual tab | 117 | // insert ManualWidget() widget in manual tab |
117 | ui.radioPdf->setChecked(true); | 118 | QGridLayout *mantablayout = new QGridLayout(this); |
119 | ui.manual->setLayout(mantablayout); | ||
120 | manual = new ManualWidget(this); | ||
121 | mantablayout->addWidget(manual); | ||
118 | 122 | ||
119 | // info tab | 123 | // info tab |
120 | ui.treeInfo->setAlternatingRowColors(true); | 124 | ui.treeInfo->setAlternatingRowColors(true); |
@@ -145,7 +149,6 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) | |||
145 | connect(ui.buttonThemes, SIGNAL(clicked()), this, SLOT(installThemes())); | 149 | connect(ui.buttonThemes, SIGNAL(clicked()), this, SLOT(installThemes())); |
146 | connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall())); | 150 | connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall())); |
147 | connect(ui.buttonRemoveBootloader, SIGNAL(clicked()), this, SLOT(uninstallBootloader())); | 151 | connect(ui.buttonRemoveBootloader, SIGNAL(clicked()), this, SLOT(uninstallBootloader())); |
148 | connect(ui.buttonDownloadManual, SIGNAL(clicked()), this, SLOT(downloadManual())); | ||
149 | connect(ui.buttonSmall, SIGNAL(clicked()), this, SLOT(smallInstall())); | 152 | connect(ui.buttonSmall, SIGNAL(clicked()), this, SLOT(smallInstall())); |
150 | connect(ui.buttonComplete, SIGNAL(clicked()), this, SLOT(completeInstall())); | 153 | connect(ui.buttonComplete, SIGNAL(clicked()), this, SLOT(completeInstall())); |
151 | 154 | ||
@@ -343,7 +346,7 @@ void RbUtilQt::updateSettings() | |||
343 | { | 346 | { |
344 | qDebug() << "[RbUtil] updating current settings"; | 347 | qDebug() << "[RbUtil] updating current settings"; |
345 | updateDevice(); | 348 | updateDevice(); |
346 | updateManual(); | 349 | manual->updateManual(); |
347 | HttpGet::setGlobalProxy(proxy()); | 350 | HttpGet::setGlobalProxy(proxy()); |
348 | HttpGet::setGlobalCache(RbSettings::value(RbSettings::CachePath).toString()); | 351 | HttpGet::setGlobalCache(RbSettings::value(RbSettings::CachePath).toString()); |
349 | HttpGet::setGlobalDumbCache(RbSettings::value(RbSettings::CacheOffline).toBool()); | 352 | HttpGet::setGlobalDumbCache(RbSettings::value(RbSettings::CacheOffline).toBool()); |
@@ -416,39 +419,6 @@ void RbUtilQt::updateDevice() | |||
416 | } | 419 | } |
417 | 420 | ||
418 | 421 | ||
419 | void RbUtilQt::updateManual() | ||
420 | { | ||
421 | if(RbSettings::value(RbSettings::Platform) != "") | ||
422 | { | ||
423 | QString manual = SystemInfo::value(SystemInfo::CurManual).toString(); | ||
424 | QString buildservermodel = SystemInfo::value(SystemInfo::CurBuildserverModel).toString(); | ||
425 | QString pdfmanual = SystemInfo::value(SystemInfo::ManualUrl).toString(); | ||
426 | QString htmlmanual = pdfmanual; | ||
427 | |||
428 | pdfmanual.replace("%EXTENSION%", "pdf"); | ||
429 | htmlmanual.replace("%EXTENSION%", "html"); | ||
430 | if(manual.isEmpty()) { | ||
431 | pdfmanual.replace("%MANUALBASENAME%", "rockbox-" + buildservermodel); | ||
432 | htmlmanual.replace("%MANUALBASENAME%", "rockbox-" + buildservermodel + "/rockbox-build"); | ||
433 | } | ||
434 | else { | ||
435 | pdfmanual.replace("%MANUALBASENAME%", "rockbox-" + manual); | ||
436 | htmlmanual.replace("%MANUALBASENAME%", "rockbox-" + manual + "/rockbox-build"); | ||
437 | } | ||
438 | |||
439 | ui.labelPdfManual->setText(tr("<a href='%1'>PDF Manual</a>") | ||
440 | .arg(pdfmanual)); | ||
441 | ui.labelHtmlManual->setText(tr("<a href='%1'>HTML Manual (opens in browser)</a>") | ||
442 | .arg(htmlmanual)); | ||
443 | } | ||
444 | else { | ||
445 | ui.labelPdfManual->setText(tr("Select a device for a link to the correct manual")); | ||
446 | ui.labelHtmlManual->setText(tr("<a href='%1'>Manual Overview</a>") | ||
447 | .arg("http://www.rockbox.org/manual.shtml")); | ||
448 | |||
449 | } | ||
450 | } | ||
451 | |||
452 | void RbUtilQt::completeInstall() | 422 | void RbUtilQt::completeInstall() |
453 | { | 423 | { |
454 | if(chkConfig(this)) return; | 424 | if(chkConfig(this)) return; |
@@ -1115,55 +1085,6 @@ void RbUtilQt::uninstallBootloader(void) | |||
1115 | } | 1085 | } |
1116 | 1086 | ||
1117 | 1087 | ||
1118 | void RbUtilQt::downloadManual(void) | ||
1119 | { | ||
1120 | if(chkConfig(this)) return; | ||
1121 | if(QMessageBox::question(this, tr("Confirm download"), | ||
1122 | tr("Do you really want to download the manual? The manual will be saved " | ||
1123 | "to the root folder of your player."), | ||
1124 | QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) | ||
1125 | return; | ||
1126 | |||
1127 | QString manual = SystemInfo::value(SystemInfo::CurManual).toString(); | ||
1128 | if(manual.isEmpty()) | ||
1129 | manual = "rockbox-" | ||
1130 | + SystemInfo::value(SystemInfo::CurBuildserverModel).toString(); | ||
1131 | |||
1132 | QDate date = QDate::fromString(ServerInfo::value(ServerInfo::DailyDate).toString(),Qt::ISODate); | ||
1133 | |||
1134 | QString manualurl; | ||
1135 | QString target; | ||
1136 | QString section; | ||
1137 | if(ui.radioPdf->isChecked()) { | ||
1138 | target = "/" + manual + ".pdf"; | ||
1139 | section = "Manual (PDF)"; | ||
1140 | } | ||
1141 | else { | ||
1142 | target = "/" + manual + "-" + date.toString("yyyyMMdd") + "-html.zip"; | ||
1143 | section = "Manual (HTML)"; | ||
1144 | } | ||
1145 | manualurl = SystemInfo::value(SystemInfo::ManualUrl).toString() + "/" + target; | ||
1146 | qDebug() << "[RbUtil] Manual URL:" << manualurl; | ||
1147 | |||
1148 | ProgressLoggerGui* logger = new ProgressLoggerGui(this); | ||
1149 | logger->show(); | ||
1150 | installer = new ZipInstaller(this); | ||
1151 | installer->setMountPoint(RbSettings::value(RbSettings::Mountpoint).toString()); | ||
1152 | if(!RbSettings::value(RbSettings::CacheDisabled).toBool()) | ||
1153 | installer->setCache(true); | ||
1154 | installer->setLogSection(section); | ||
1155 | installer->setLogVersion(ServerInfo::value(ServerInfo::DailyDate).toString()); | ||
1156 | installer->setUrl(manualurl); | ||
1157 | installer->setUnzip(false); | ||
1158 | installer->setTarget(target); | ||
1159 | connect(installer, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); | ||
1160 | connect(installer, SIGNAL(logProgress(int, int)), logger, SLOT(setProgress(int, int))); | ||
1161 | connect(installer, SIGNAL(done(bool)), logger, SLOT(setFinished())); | ||
1162 | connect(logger, SIGNAL(aborted()), installer, SLOT(abort())); | ||
1163 | installer->install(); | ||
1164 | } | ||
1165 | |||
1166 | |||
1167 | void RbUtilQt::installPortable(void) | 1088 | void RbUtilQt::installPortable(void) |
1168 | { | 1089 | { |
1169 | if(QMessageBox::question(this, tr("Confirm installation"), | 1090 | if(QMessageBox::question(this, tr("Confirm installation"), |
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h index 5cc1f0de94..e10569ff2f 100644 --- a/rbutil/rbutilqt/rbutilqt.h +++ b/rbutil/rbutilqt/rbutilqt.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "zipinstaller.h" | 32 | #include "zipinstaller.h" |
33 | #include "progressloggergui.h" | 33 | #include "progressloggergui.h" |
34 | #include "bootloaderinstallbase.h" | 34 | #include "bootloaderinstallbase.h" |
35 | #include "manualwidget.h" | ||
35 | 36 | ||
36 | class RbUtilQt : public QMainWindow | 37 | class RbUtilQt : public QMainWindow |
37 | { | 38 | { |
@@ -43,6 +44,7 @@ class RbUtilQt : public QMainWindow | |||
43 | static bool chkConfig(QWidget *parent = 0); | 44 | static bool chkConfig(QWidget *parent = 0); |
44 | 45 | ||
45 | private: | 46 | private: |
47 | ManualWidget *manual; | ||
46 | Ui::RbUtilQtFrm ui; | 48 | Ui::RbUtilQtFrm ui; |
47 | 49 | ||
48 | void changeEvent(QEvent *e); | 50 | void changeEvent(QEvent *e); |
@@ -55,7 +57,6 @@ class RbUtilQt : public QMainWindow | |||
55 | QString absolutePath; | 57 | QString absolutePath; |
56 | QTemporaryFile buildInfo; | 58 | QTemporaryFile buildInfo; |
57 | QTemporaryFile bleedingInfo; | 59 | QTemporaryFile bleedingInfo; |
58 | void updateManual(void); | ||
59 | ProgressLoggerGui *logger; | 60 | ProgressLoggerGui *logger; |
60 | ZipInstaller *installer; | 61 | ZipInstaller *installer; |
61 | QUrl proxy(void); | 62 | QUrl proxy(void); |
@@ -109,7 +110,6 @@ class RbUtilQt : public QMainWindow | |||
109 | void installThemes(void); | 110 | void installThemes(void); |
110 | void uninstall(void); | 111 | void uninstall(void); |
111 | void uninstallBootloader(void); | 112 | void uninstallBootloader(void); |
112 | void downloadManual(void); | ||
113 | void installPortable(void); | 113 | void installPortable(void); |
114 | void updateInfo(void); | 114 | void updateInfo(void); |
115 | void updateTabs(int); | 115 | void updateTabs(int); |
diff --git a/rbutil/rbutilqt/rbutilqt.pri b/rbutil/rbutilqt/rbutilqt.pri index d83804443d..308a08585e 100644 --- a/rbutil/rbutilqt/rbutilqt.pri +++ b/rbutil/rbutilqt/rbutilqt.pri | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | # common files | 18 | # common files |
19 | SOURCES += \ | 19 | SOURCES += \ |
20 | gui/manualwidget.cpp \ | ||
20 | rbutilqt.cpp \ | 21 | rbutilqt.cpp \ |
21 | main.cpp \ | 22 | main.cpp \ |
22 | installwindow.cpp \ | 23 | installwindow.cpp \ |
@@ -78,6 +79,7 @@ SOURCES += \ | |||
78 | 79 | ||
79 | 80 | ||
80 | HEADERS += \ | 81 | HEADERS += \ |
82 | gui/manualwidget.h \ | ||
81 | rbutilqt.h \ | 83 | rbutilqt.h \ |
82 | installwindow.h \ | 84 | installwindow.h \ |
83 | base/httpget.h \ | 85 | base/httpget.h \ |
@@ -146,6 +148,7 @@ HEADERS += \ | |||
146 | 148 | ||
147 | 149 | ||
148 | FORMS += \ | 150 | FORMS += \ |
151 | gui/manualwidgetfrm.ui \ | ||
149 | rbutilqtfrm.ui \ | 152 | rbutilqtfrm.ui \ |
150 | aboutbox.ui \ | 153 | aboutbox.ui \ |
151 | installwindowfrm.ui \ | 154 | installwindowfrm.ui \ |
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro index 46a332ece4..366cc486e0 100644 --- a/rbutil/rbutilqt/rbutilqt.pro +++ b/rbutil/rbutilqt/rbutilqt.pro | |||
@@ -145,7 +145,8 @@ QMAKE_EXTRA_TARGETS += lrelease | |||
145 | 145 | ||
146 | # Needed by QT on Win | 146 | # Needed by QT on Win |
147 | INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools \ | 147 | INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools \ |
148 | $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base | 148 | $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base \ |
149 | $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/gui | ||
149 | INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher \ | 150 | INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher \ |
150 | $$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools | 151 | $$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools |
151 | 152 | ||
diff --git a/rbutil/rbutilqt/rbutilqtfrm.ui b/rbutil/rbutilqt/rbutilqtfrm.ui index 5233022061..ff8dda3d7d 100644 --- a/rbutil/rbutilqt/rbutilqtfrm.ui +++ b/rbutil/rbutilqt/rbutilqtfrm.ui | |||
@@ -650,103 +650,6 @@ | |||
650 | <attribute name="toolTip"> | 650 | <attribute name="toolTip"> |
651 | <string>View and download the manual</string> | 651 | <string>View and download the manual</string> |
652 | </attribute> | 652 | </attribute> |
653 | <layout class="QGridLayout"> | ||
654 | <item row="0" column="0"> | ||
655 | <widget class="QGroupBox" name="groupBox_2"> | ||
656 | <property name="title"> | ||
657 | <string>Read the manual</string> | ||
658 | </property> | ||
659 | <layout class="QGridLayout"> | ||
660 | <item row="0" column="0"> | ||
661 | <widget class="QLabel" name="labelPdfManual"> | ||
662 | <property name="text"> | ||
663 | <string>PDF manual</string> | ||
664 | </property> | ||
665 | <property name="openExternalLinks"> | ||
666 | <bool>true</bool> | ||
667 | </property> | ||
668 | <property name="textInteractionFlags"> | ||
669 | <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set> | ||
670 | </property> | ||
671 | </widget> | ||
672 | </item> | ||
673 | <item row="1" column="0"> | ||
674 | <widget class="QLabel" name="labelHtmlManual"> | ||
675 | <property name="text"> | ||
676 | <string>HTML manual</string> | ||
677 | </property> | ||
678 | <property name="openExternalLinks"> | ||
679 | <bool>true</bool> | ||
680 | </property> | ||
681 | <property name="textInteractionFlags"> | ||
682 | <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set> | ||
683 | </property> | ||
684 | </widget> | ||
685 | </item> | ||
686 | </layout> | ||
687 | </widget> | ||
688 | </item> | ||
689 | <item row="1" column="0"> | ||
690 | <widget class="QGroupBox" name="groupBox"> | ||
691 | <property name="title"> | ||
692 | <string>Download the manual</string> | ||
693 | </property> | ||
694 | <layout class="QGridLayout"> | ||
695 | <item row="0" column="0"> | ||
696 | <layout class="QVBoxLayout"> | ||
697 | <item> | ||
698 | <widget class="QRadioButton" name="radioPdf"> | ||
699 | <property name="text"> | ||
700 | <string>&PDF version</string> | ||
701 | </property> | ||
702 | </widget> | ||
703 | </item> | ||
704 | <item> | ||
705 | <widget class="QRadioButton" name="radioHtmlzip"> | ||
706 | <property name="text"> | ||
707 | <string>&HTML version (zip file)</string> | ||
708 | </property> | ||
709 | </widget> | ||
710 | </item> | ||
711 | </layout> | ||
712 | </item> | ||
713 | <item row="0" column="1"> | ||
714 | <spacer> | ||
715 | <property name="orientation"> | ||
716 | <enum>Qt::Horizontal</enum> | ||
717 | </property> | ||
718 | <property name="sizeHint" stdset="0"> | ||
719 | <size> | ||
720 | <width>40</width> | ||
721 | <height>20</height> | ||
722 | </size> | ||
723 | </property> | ||
724 | </spacer> | ||
725 | </item> | ||
726 | <item row="0" column="2"> | ||
727 | <widget class="QPushButton" name="buttonDownloadManual"> | ||
728 | <property name="text"> | ||
729 | <string>Down&load</string> | ||
730 | </property> | ||
731 | </widget> | ||
732 | </item> | ||
733 | </layout> | ||
734 | </widget> | ||
735 | </item> | ||
736 | <item row="2" column="0"> | ||
737 | <spacer> | ||
738 | <property name="orientation"> | ||
739 | <enum>Qt::Vertical</enum> | ||
740 | </property> | ||
741 | <property name="sizeHint" stdset="0"> | ||
742 | <size> | ||
743 | <width>20</width> | ||
744 | <height>40</height> | ||
745 | </size> | ||
746 | </property> | ||
747 | </spacer> | ||
748 | </item> | ||
749 | </layout> | ||
750 | </widget> | 653 | </widget> |
751 | <widget class="QWidget" name="info"> | 654 | <widget class="QWidget" name="info"> |
752 | <attribute name="title"> | 655 | <attribute name="title"> |
@@ -787,7 +690,7 @@ | |||
787 | <x>0</x> | 690 | <x>0</x> |
788 | <y>0</y> | 691 | <y>0</y> |
789 | <width>650</width> | 692 | <width>650</width> |
790 | <height>18</height> | 693 | <height>27</height> |
791 | </rect> | 694 | </rect> |
792 | </property> | 695 | </property> |
793 | <widget class="QMenu" name="menu_File"> | 696 | <widget class="QMenu" name="menu_File"> |
@@ -1064,9 +967,6 @@ | |||
1064 | <tabstop>buttonGames</tabstop> | 967 | <tabstop>buttonGames</tabstop> |
1065 | <tabstop>buttonRemoveBootloader</tabstop> | 968 | <tabstop>buttonRemoveBootloader</tabstop> |
1066 | <tabstop>buttonRemoveRockbox</tabstop> | 969 | <tabstop>buttonRemoveRockbox</tabstop> |
1067 | <tabstop>radioPdf</tabstop> | ||
1068 | <tabstop>radioHtmlzip</tabstop> | ||
1069 | <tabstop>buttonDownloadManual</tabstop> | ||
1070 | <tabstop>buttonChangeDevice</tabstop> | 970 | <tabstop>buttonChangeDevice</tabstop> |
1071 | <tabstop>buttonVoice</tabstop> | 971 | <tabstop>buttonVoice</tabstop> |
1072 | <tabstop>buttonCreateVoice</tabstop> | 972 | <tabstop>buttonCreateVoice</tabstop> |