diff options
-rw-r--r-- | rbutil/rbutilqt/base/serverinfo.cpp | 29 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/serverinfo.h | 3 | ||||
-rw-r--r-- | rbutil/rbutilqt/gui/manualwidget.cpp | 48 | ||||
-rw-r--r-- | rbutil/rbutilqt/gui/manualwidget.h | 7 | ||||
-rw-r--r-- | rbutil/rbutilqt/installwindowfrm.ui | 2 |
5 files changed, 39 insertions, 50 deletions
diff --git a/rbutil/rbutilqt/base/serverinfo.cpp b/rbutil/rbutilqt/base/serverinfo.cpp index fd46f13a8b..8d91309e66 100644 --- a/rbutil/rbutilqt/base/serverinfo.cpp +++ b/rbutil/rbutilqt/base/serverinfo.cpp | |||
@@ -35,6 +35,9 @@ const static struct { | |||
35 | { ServerInfo::RelCandidateVersion, ":platform:/rcversion", "" }, | 35 | { ServerInfo::RelCandidateVersion, ":platform:/rcversion", "" }, |
36 | { ServerInfo::RelCandidateUrl, ":platform:/rcurl", "" }, | 36 | { ServerInfo::RelCandidateUrl, ":platform:/rcurl", "" }, |
37 | { ServerInfo::CurStatus, ":platform:/status", "Unknown" }, | 37 | { ServerInfo::CurStatus, ":platform:/status", "Unknown" }, |
38 | { ServerInfo::ManualPdfUrl, ":platform:/manual_pdf", "" }, | ||
39 | { ServerInfo::ManualHtmlUrl, ":platform:/manual_html", "" }, | ||
40 | { ServerInfo::ManualZipUrl, ":platform:/manual_zip", "" }, | ||
38 | { ServerInfo::BleedingRevision, "bleedingrev", "" }, | 41 | { ServerInfo::BleedingRevision, "bleedingrev", "" }, |
39 | { ServerInfo::BleedingDate, "bleedingdate", "" }, | 42 | { ServerInfo::BleedingDate, "bleedingdate", "" }, |
40 | { ServerInfo::CurDevelUrl, ":platform:/develurl", "" }, | 43 | { ServerInfo::CurDevelUrl, ":platform:/develurl", "" }, |
@@ -126,6 +129,28 @@ void ServerInfo::readBuildInfo(QString file) | |||
126 | break; | 129 | break; |
127 | } | 130 | } |
128 | info.endGroup(); | 131 | info.endGroup(); |
132 | |||
133 | // manual URLs | ||
134 | QString manualPdfUrl = manualBaseUrl; | ||
135 | QString manualHtmlUrl = manualBaseUrl; | ||
136 | QString manualZipUrl = manualBaseUrl; | ||
137 | |||
138 | QString buildservermodel = SystemInfo::platformValue(platforms.at(i), | ||
139 | SystemInfo::CurBuildserverModel).toString(); | ||
140 | QString modelman = SystemInfo::platformValue(platforms.at(i), | ||
141 | SystemInfo::CurManual).toString(); | ||
142 | QString manualBaseName = "rockbox-"; | ||
143 | |||
144 | if(modelman.isEmpty()) manualBaseName += buildservermodel; | ||
145 | else manualBaseName += modelman; | ||
146 | |||
147 | manualPdfUrl.replace("%EXTENSION%", "pdf"); | ||
148 | manualPdfUrl.replace("%MANUALBASENAME%", manualBaseName); | ||
149 | manualHtmlUrl.replace("%EXTENSION%", "html"); | ||
150 | manualHtmlUrl.replace("%MANUALBASENAME%", manualBaseName + "/rockbox-build"); | ||
151 | manualZipUrl.replace("%EXTENSION%", "zip"); | ||
152 | manualZipUrl.replace("%MANUALBASENAME%", manualBaseName + "-html"); | ||
153 | |||
129 | // set variants (if any) | 154 | // set variants (if any) |
130 | for(int j = 0; j < variants.size(); ++j) { | 155 | for(int j = 0; j < variants.size(); ++j) { |
131 | setPlatformValue(variants.at(j), ServerInfo::CurStatus, status); | 156 | setPlatformValue(variants.at(j), ServerInfo::CurStatus, status); |
@@ -138,6 +163,10 @@ void ServerInfo::readBuildInfo(QString file) | |||
138 | setPlatformValue(variants.at(j), ServerInfo::RelCandidateUrl, relCandidateUrl); | 163 | setPlatformValue(variants.at(j), ServerInfo::RelCandidateUrl, relCandidateUrl); |
139 | } | 164 | } |
140 | setPlatformValue(variants.at(j), ServerInfo::CurDevelUrl, develUrl); | 165 | setPlatformValue(variants.at(j), ServerInfo::CurDevelUrl, develUrl); |
166 | |||
167 | setPlatformValue(variants.at(j), ServerInfo::ManualPdfUrl, manualPdfUrl); | ||
168 | setPlatformValue(variants.at(j), ServerInfo::ManualHtmlUrl, manualHtmlUrl); | ||
169 | setPlatformValue(variants.at(j), ServerInfo::ManualZipUrl, manualZipUrl); | ||
141 | } | 170 | } |
142 | } | 171 | } |
143 | } | 172 | } |
diff --git a/rbutil/rbutilqt/base/serverinfo.h b/rbutil/rbutilqt/base/serverinfo.h index ea68fd7fc4..94b2818f73 100644 --- a/rbutil/rbutilqt/base/serverinfo.h +++ b/rbutil/rbutilqt/base/serverinfo.h | |||
@@ -34,6 +34,9 @@ class ServerInfo : public QObject | |||
34 | CurStatus, | 34 | CurStatus, |
35 | CurReleaseUrl, | 35 | CurReleaseUrl, |
36 | CurDevelUrl, | 36 | CurDevelUrl, |
37 | ManualPdfUrl, | ||
38 | ManualHtmlUrl, | ||
39 | ManualZipUrl, | ||
37 | BleedingRevision, | 40 | BleedingRevision, |
38 | BleedingDate, | 41 | BleedingDate, |
39 | RelCandidateVersion, | 42 | RelCandidateVersion, |
diff --git a/rbutil/rbutilqt/gui/manualwidget.cpp b/rbutil/rbutilqt/gui/manualwidget.cpp index 7be9145162..4dac771627 100644 --- a/rbutil/rbutilqt/gui/manualwidget.cpp +++ b/rbutil/rbutilqt/gui/manualwidget.cpp | |||
@@ -28,57 +28,19 @@ ManualWidget::ManualWidget(QWidget *parent) : QWidget(parent) | |||
28 | { | 28 | { |
29 | ui.setupUi(this); | 29 | ui.setupUi(this); |
30 | ui.radioPdf->setChecked(true); | 30 | ui.radioPdf->setChecked(true); |
31 | platform = RbSettings::value(RbSettings::Platform).toString(); | ||
31 | connect(ui.buttonDownloadManual, SIGNAL(clicked()), this, SLOT(downloadManual())); | 32 | connect(ui.buttonDownloadManual, SIGNAL(clicked()), this, SLOT(downloadManual())); |
32 | } | 33 | } |
33 | 34 | ||
34 | 35 | ||
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%", "zip"); | ||
63 | manualbasename += "-html"; | ||
64 | break; | ||
65 | default: | ||
66 | break; | ||
67 | }; | ||
68 | |||
69 | manual.replace("%MANUALBASENAME%", manualbasename); | ||
70 | return manual; | ||
71 | } | ||
72 | |||
73 | |||
74 | void ManualWidget::updateManual() | 36 | void ManualWidget::updateManual() |
75 | { | 37 | { |
76 | if(!RbSettings::value(RbSettings::Platform).toString().isEmpty()) | 38 | if(!RbSettings::value(RbSettings::Platform).toString().isEmpty()) |
77 | { | 39 | { |
78 | ui.labelPdfManual->setText(tr("<a href='%1'>PDF Manual</a>") | 40 | ui.labelPdfManual->setText(tr("<a href='%1'>PDF Manual</a>") |
79 | .arg(manualUrl(ManualPdf))); | 41 | .arg(ServerInfo::platformValue(platform, ServerInfo::ManualPdfUrl).toString())); |
80 | ui.labelHtmlManual->setText(tr("<a href='%1'>HTML Manual (opens in browser)</a>") | 42 | ui.labelHtmlManual->setText(tr("<a href='%1'>HTML Manual (opens in browser)</a>") |
81 | .arg(manualUrl(ManualHtml))); | 43 | .arg(ServerInfo::platformValue(platform, ServerInfo::ManualHtmlUrl).toString())); |
82 | } | 44 | } |
83 | else { | 45 | else { |
84 | ui.labelPdfManual->setText(tr("Select a device for a link to the correct manual")); | 46 | ui.labelPdfManual->setText(tr("Select a device for a link to the correct manual")); |
@@ -114,12 +76,12 @@ void ManualWidget::downloadManual(void) | |||
114 | installer->setCache(true); | 76 | installer->setCache(true); |
115 | 77 | ||
116 | if(ui.radioPdf->isChecked()) { | 78 | if(ui.radioPdf->isChecked()) { |
117 | manualurl = manualUrl(ManualPdf); | 79 | manualurl = ServerInfo::platformValue(platform, ServerInfo::ManualPdfUrl).toString(); |
118 | installer->setLogSection("Manual (PDF)"); | 80 | installer->setLogSection("Manual (PDF)"); |
119 | installer->setTarget("/" + manual + ".pdf"); | 81 | installer->setTarget("/" + manual + ".pdf"); |
120 | } | 82 | } |
121 | else { | 83 | else { |
122 | manualurl = manualUrl(ManualZip); | 84 | manualurl = ServerInfo::platformValue(platform, ServerInfo::ManualZipUrl).toString(); |
123 | installer->setLogSection("Manual (HTML)"); | 85 | installer->setLogSection("Manual (HTML)"); |
124 | installer->setTarget("/" + manual + "-" + "-html.zip"); | 86 | installer->setTarget("/" + manual + "-" + "-html.zip"); |
125 | } | 87 | } |
diff --git a/rbutil/rbutilqt/gui/manualwidget.h b/rbutil/rbutilqt/gui/manualwidget.h index 6de2de55bd..4548391af5 100644 --- a/rbutil/rbutilqt/gui/manualwidget.h +++ b/rbutil/rbutilqt/gui/manualwidget.h | |||
@@ -26,20 +26,15 @@ class ManualWidget : public QWidget | |||
26 | { | 26 | { |
27 | Q_OBJECT | 27 | Q_OBJECT |
28 | public: | 28 | public: |
29 | enum ManualFormat { | ||
30 | ManualPdf, | ||
31 | ManualHtml, | ||
32 | ManualZip, | ||
33 | }; | ||
34 | ManualWidget(QWidget *parent = 0); | 29 | ManualWidget(QWidget *parent = 0); |
35 | 30 | ||
36 | public slots: | 31 | public slots: |
37 | void downloadManual(void); | 32 | void downloadManual(void); |
38 | void updateManual(); | 33 | void updateManual(); |
39 | QString manualUrl(ManualFormat format); | ||
40 | 34 | ||
41 | private: | 35 | private: |
42 | Ui::ManualWidgetFrm ui; | 36 | Ui::ManualWidgetFrm ui; |
37 | QString platform; | ||
43 | }; | 38 | }; |
44 | 39 | ||
45 | #endif | 40 | #endif |
diff --git a/rbutil/rbutilqt/installwindowfrm.ui b/rbutil/rbutilqt/installwindowfrm.ui index a06908214f..80bdc63c15 100644 --- a/rbutil/rbutilqt/installwindowfrm.ui +++ b/rbutil/rbutilqt/installwindowfrm.ui | |||
@@ -10,7 +10,7 @@ | |||
10 | <x>0</x> | 10 | <x>0</x> |
11 | <y>0</y> | 11 | <y>0</y> |
12 | <width>644</width> | 12 | <width>644</width> |
13 | <height>500</height> | 13 | <height>448</height> |
14 | </rect> | 14 | </rect> |
15 | </property> | 15 | </property> |
16 | <property name="windowTitle" > | 16 | <property name="windowTitle" > |