summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-07-31 19:11:44 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-07-31 19:11:44 +0000
commit5df9fc5c4086f8349d41c3c3f6d57050b0fdce40 (patch)
tree69a7e44c92295f74a5652b820f1138d9a4d7edc0
parentc3a72f1b0a90436b92d68a8da2c2544dc4d581ad (diff)
downloadrockbox-5df9fc5c4086f8349d41c3c3f6d57050b0fdce40.tar.gz
rockbox-5df9fc5c4086f8349d41c3c3f6d57050b0fdce40.zip
rbutilQt: the progressloggergui now uses little icons along the text.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14105 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/icons/log-error.pngbin0 -> 784 bytes
-rw-r--r--rbutil/rbutilqt/icons/log-info.pngbin0 -> 543 bytes
-rw-r--r--rbutil/rbutilqt/icons/log-ok.pngbin0 -> 652 bytes
-rw-r--r--rbutil/rbutilqt/icons/log-warning.pngbin0 -> 809 bytes
-rw-r--r--rbutil/rbutilqt/install.cpp2
-rw-r--r--rbutil/rbutilqt/installbl.cpp8
-rw-r--r--rbutil/rbutilqt/installbl.h1
-rw-r--r--rbutil/rbutilqt/installbootloader.cpp168
-rw-r--r--rbutil/rbutilqt/installzip.cpp18
-rw-r--r--rbutil/rbutilqt/installzipwindow.cpp8
-rw-r--r--rbutil/rbutilqt/irivertools/irivertools.cpp44
-rw-r--r--rbutil/rbutilqt/progressloggergui.cpp25
-rw-r--r--rbutil/rbutilqt/progressloggergui.h2
-rw-r--r--rbutil/rbutilqt/progressloggerinterface.h7
-rw-r--r--rbutil/rbutilqt/rbutilqt.qrc11
15 files changed, 166 insertions, 128 deletions
diff --git a/rbutil/rbutilqt/icons/log-error.png b/rbutil/rbutilqt/icons/log-error.png
new file mode 100644
index 0000000000..4c485f75b1
--- /dev/null
+++ b/rbutil/rbutilqt/icons/log-error.png
Binary files differ
diff --git a/rbutil/rbutilqt/icons/log-info.png b/rbutil/rbutilqt/icons/log-info.png
new file mode 100644
index 0000000000..bbd5dbaf5e
--- /dev/null
+++ b/rbutil/rbutilqt/icons/log-info.png
Binary files differ
diff --git a/rbutil/rbutilqt/icons/log-ok.png b/rbutil/rbutilqt/icons/log-ok.png
new file mode 100644
index 0000000000..5e0c2b5d6f
--- /dev/null
+++ b/rbutil/rbutilqt/icons/log-ok.png
Binary files differ
diff --git a/rbutil/rbutilqt/icons/log-warning.png b/rbutil/rbutilqt/icons/log-warning.png
new file mode 100644
index 0000000000..9a8c5bb9c5
--- /dev/null
+++ b/rbutil/rbutilqt/icons/log-warning.png
Binary files differ
diff --git a/rbutil/rbutilqt/install.cpp b/rbutil/rbutilqt/install.cpp
index 49bdb14c53..2818d1af61 100644
--- a/rbutil/rbutilqt/install.cpp
+++ b/rbutil/rbutilqt/install.cpp
@@ -105,7 +105,7 @@ void Install::accept()
105 userSettings->setValue("defaults/mountpoint", mountPoint); 105 userSettings->setValue("defaults/mountpoint", mountPoint);
106 } 106 }
107 else { 107 else {
108 logger->addItem(tr("Mount point is wrong!")); 108 logger->addItem(tr("Mount point is wrong!"),LOGERROR);
109 logger->abort(); 109 logger->abort();
110 return; 110 return;
111 } 111 }
diff --git a/rbutil/rbutilqt/installbl.cpp b/rbutil/rbutilqt/installbl.cpp
index 3eaf9afdaf..627fa961b6 100644
--- a/rbutil/rbutilqt/installbl.cpp
+++ b/rbutil/rbutilqt/installbl.cpp
@@ -98,7 +98,7 @@ void InstallBl::accept()
98 userSettings->setValue("defaults/mountpoint", mountPoint); 98 userSettings->setValue("defaults/mountpoint", mountPoint);
99 } 99 }
100 else { 100 else {
101 logger->addItem(tr("Mount point is wrong!")); 101 logger->addItem(tr("Mount point is wrong!"),LOGERROR);
102 logger->abort(); 102 logger->abort();
103 return; 103 return;
104 } 104 }
@@ -107,9 +107,9 @@ void InstallBl::accept()
107 { 107 {
108 m_OrigFirmware = ui.lineOriginalFirmware->text(); 108 m_OrigFirmware = ui.lineOriginalFirmware->text();
109 } 109 }
110 else 110 else if(needextrafile)
111 { 111 {
112 logger->addItem(tr("Original Firmware Path is wrong!")); 112 logger->addItem(tr("Original Firmware Path is wrong!"),LOGERROR);
113 logger->abort(); 113 logger->abort();
114 return; 114 return;
115 } 115 }
@@ -160,12 +160,14 @@ void InstallBl::setDeviceSettings(QSettings *dev)
160 ui.buttonBrowseOF->show(); 160 ui.buttonBrowseOF->show();
161 ui.lineOriginalFirmware->show(); 161 ui.lineOriginalFirmware->show();
162 ui.label_3->show(); 162 ui.label_3->show();
163 needextrafile = true;
163 } 164 }
164 else 165 else
165 { 166 {
166 ui.buttonBrowseOF->hide(); 167 ui.buttonBrowseOF->hide();
167 ui.lineOriginalFirmware->hide(); 168 ui.lineOriginalFirmware->hide();
168 ui.label_3->hide(); 169 ui.label_3->hide();
170 needextrafile = false;
169 } 171 }
170 qDebug() << "Install::setDeviceSettings:" << devices; 172 qDebug() << "Install::setDeviceSettings:" << devices;
171} 173}
diff --git a/rbutil/rbutilqt/installbl.h b/rbutil/rbutilqt/installbl.h
index 4f38242040..09e3492e43 100644
--- a/rbutil/rbutilqt/installbl.h
+++ b/rbutil/rbutilqt/installbl.h
@@ -57,6 +57,7 @@ class InstallBl : public QDialog
57 QString mountPoint; 57 QString mountPoint;
58 QString m_OrigFirmware; 58 QString m_OrigFirmware;
59 BootloaderInstaller* binstaller; 59 BootloaderInstaller* binstaller;
60 bool needextrafile;
60 61
61 private slots: 62 private slots:
62 void browseFolder(void); 63 void browseFolder(void);
diff --git a/rbutil/rbutilqt/installbootloader.cpp b/rbutil/rbutilqt/installbootloader.cpp
index f6973259ff..e6dc302281 100644
--- a/rbutil/rbutilqt/installbootloader.cpp
+++ b/rbutil/rbutilqt/installbootloader.cpp
@@ -29,7 +29,7 @@ void BootloaderInstaller::install(ProgressloggerInterface* dp)
29{ 29{
30 m_dp = dp; 30 m_dp = dp;
31 m_install = true; 31 m_install = true;
32 m_dp->addItem(tr("Starting bootloader installation")); 32 m_dp->addItem(tr("Starting bootloader installation"),LOGINFO);
33 33
34 if(m_bootloadermethod == "gigabeatf") 34 if(m_bootloadermethod == "gigabeatf")
35 { 35 {
@@ -69,7 +69,7 @@ void BootloaderInstaller::install(ProgressloggerInterface* dp)
69 } 69 }
70 else 70 else
71 { 71 {
72 m_dp->addItem(tr("unsupported install Method")); 72 m_dp->addItem(tr("unsupported install Method"),LOGERROR);
73 emit done(true); 73 emit done(true);
74 return; 74 return;
75 } 75 }
@@ -81,7 +81,7 @@ void BootloaderInstaller::uninstall(ProgressloggerInterface* dp)
81{ 81{
82 m_dp = dp; 82 m_dp = dp;
83 m_install = false; 83 m_install = false;
84 m_dp->addItem(tr("Starting bootloader uninstallation")); 84 m_dp->addItem(tr("Starting bootloader uninstallation"),LOGINFO);
85 85
86 if(m_bootloadermethod == "gigabeatf") 86 if(m_bootloadermethod == "gigabeatf")
87 { 87 {
@@ -90,7 +90,7 @@ void BootloaderInstaller::uninstall(ProgressloggerInterface* dp)
90 } 90 }
91 else if(m_bootloadermethod == "iaudio") 91 else if(m_bootloadermethod == "iaudio")
92 { 92 {
93 m_dp->addItem(tr("No uninstallation possible")); 93 m_dp->addItem(tr("No uninstallation possible"),LOGWARNING);
94 emit done(true); 94 emit done(true);
95 return; 95 return;
96 } 96 }
@@ -111,13 +111,13 @@ void BootloaderInstaller::uninstall(ProgressloggerInterface* dp)
111 } 111 }
112 else if(m_bootloadermethod == "fwpatcher") 112 else if(m_bootloadermethod == "fwpatcher")
113 { 113 {
114 m_dp->addItem(tr("No uninstallation possible")); 114 m_dp->addItem(tr("No uninstallation possible"),LOGWARNING);
115 emit done(true); 115 emit done(true);
116 return; 116 return;
117 } 117 }
118 else 118 else
119 { 119 {
120 m_dp->addItem(tr("unsupported install Method")); 120 m_dp->addItem(tr("unsupported install Method"),LOGERROR);
121 emit done(true); 121 emit done(true);
122 return; 122 return;
123 } 123 }
@@ -146,18 +146,18 @@ void BootloaderInstaller::downloadDone(bool error)
146 } 146 }
147 m_dp->setProgressValue(max); 147 m_dp->setProgressValue(max);
148 if(getter->httpResponse() != 200) { 148 if(getter->httpResponse() != 200) {
149 m_dp->addItem(tr("Download error: received HTTP error %1.").arg(getter->httpResponse())); 149 m_dp->addItem(tr("Download error: received HTTP error %1.").arg(getter->httpResponse()),LOGERROR);
150 m_dp->abort(); 150 m_dp->abort();
151 emit done(true); 151 emit done(true);
152 return; 152 return;
153 } 153 }
154 if(error) { 154 if(error) {
155 m_dp->addItem(tr("Download error: %1").arg(getter->errorString())); 155 m_dp->addItem(tr("Download error: %1").arg(getter->errorString()),LOGERROR);
156 m_dp->abort(); 156 m_dp->abort();
157 emit done(true); 157 emit done(true);
158 return; 158 return;
159 } 159 }
160 else m_dp->addItem(tr("Download finished.")); 160 else m_dp->addItem(tr("Download finished."),LOGOK);
161 161
162 emit finish(); 162 emit finish();
163 163
@@ -182,7 +182,7 @@ void BootloaderInstaller::gigabeatPrepare()
182 QString url = m_bootloaderUrlBase + "/gigabeat/" + m_bootloadername; 182 QString url = m_bootloaderUrlBase + "/gigabeat/" + m_bootloadername;
183 183
184 m_dp->addItem(tr("Downloading file %1.%2") 184 m_dp->addItem(tr("Downloading file %1.%2")
185 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix())); 185 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
186 186
187 // temporary file needs to be opened to get the filename 187 // temporary file needs to be opened to get the filename
188 downloadFile.open(); 188 downloadFile.open();
@@ -209,7 +209,7 @@ void BootloaderInstaller::gigabeatPrepare()
209 if(!firmwareOrigFI.exists()) 209 if(!firmwareOrigFI.exists())
210 { 210 {
211 m_dp->addItem(tr("Could not find the Original Firmware at: %1") 211 m_dp->addItem(tr("Could not find the Original Firmware at: %1")
212 .arg(firmwareOrig)); 212 .arg(firmwareOrig),LOGERROR);
213 emit done(true); 213 emit done(true);
214 return; 214 return;
215 } 215 }
@@ -221,7 +221,7 @@ void BootloaderInstaller::gigabeatPrepare()
221 if(!firmwareFile.remove()) 221 if(!firmwareFile.remove())
222 { 222 {
223 m_dp->addItem(tr("Could not remove the Firmware at: %1") 223 m_dp->addItem(tr("Could not remove the Firmware at: %1")
224 .arg(firmware)); 224 .arg(firmware),LOGERROR);
225 emit done(true); 225 emit done(true);
226 return; 226 return;
227 } 227 }
@@ -230,7 +230,7 @@ void BootloaderInstaller::gigabeatPrepare()
230 if(!firmwareOrigFile.copy(firmware)) 230 if(!firmwareOrigFile.copy(firmware))
231 { 231 {
232 m_dp->addItem(tr("Could not copy the Firmware from: %1 to %2") 232 m_dp->addItem(tr("Could not copy the Firmware from: %1 to %2")
233 .arg(firmwareOrig,firmware)); 233 .arg(firmwareOrig,firmware),LOGERROR);
234 emit done(true); 234 emit done(true);
235 return; 235 return;
236 } 236 }
@@ -244,7 +244,7 @@ void BootloaderInstaller::gigabeatFinish()
244{ 244{
245 // this step is only need for installation, so no code for uninstall here 245 // this step is only need for installation, so no code for uninstall here
246 246
247 m_dp->addItem(tr("Finishing bootloader install")); 247 m_dp->addItem(tr("Finishing bootloader install"),LOGINFO);
248 248
249 QString firmware = m_mountpoint + "/GBSYSTEM/FWIMG/" + m_bootloadername; 249 QString firmware = m_mountpoint + "/GBSYSTEM/FWIMG/" + m_bootloadername;
250 250
@@ -254,7 +254,7 @@ void BootloaderInstaller::gigabeatFinish()
254 if(!firmwareFI.exists()) 254 if(!firmwareFI.exists())
255 { 255 {
256 m_dp->addItem(tr("Could not find the Firmware at: %1") 256 m_dp->addItem(tr("Could not find the Firmware at: %1")
257 .arg(firmware)); 257 .arg(firmware),LOGERROR);
258 emit done(true); 258 emit done(true);
259 return; 259 return;
260 } 260 }
@@ -270,7 +270,7 @@ void BootloaderInstaller::gigabeatFinish()
270 if(!firmwareFile.rename(firmwareOrig)) 270 if(!firmwareFile.rename(firmwareOrig))
271 { 271 {
272 m_dp->addItem(tr("Could not rename: %1 to %2") 272 m_dp->addItem(tr("Could not rename: %1 to %2")
273 .arg(firmware,firmwareOrig)); 273 .arg(firmware,firmwareOrig),LOGERROR);
274 emit done(true); 274 emit done(true);
275 return; 275 return;
276 } 276 }
@@ -285,14 +285,14 @@ void BootloaderInstaller::gigabeatFinish()
285 if(!downloadFile.copy(firmware)) 285 if(!downloadFile.copy(firmware))
286 { 286 {
287 m_dp->addItem(tr("Could not copy: %1 to %2") 287 m_dp->addItem(tr("Could not copy: %1 to %2")
288 .arg(m_tempfilename,firmware)); 288 .arg(m_tempfilename,firmware),LOGERROR);
289 emit done(true); 289 emit done(true);
290 return; 290 return;
291 } 291 }
292 292
293 downloadFile.remove(); 293 downloadFile.remove();
294 294
295 m_dp->addItem(tr("Bootloader install finished successfully.")); 295 m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
296 m_dp->abort(); 296 m_dp->abort();
297 297
298 emit done(false); // success 298 emit done(false); // success
@@ -308,7 +308,7 @@ void BootloaderInstaller::iaudioPrepare()
308 QString url = m_bootloaderUrlBase + "/iaudio/" + m_bootloadername; 308 QString url = m_bootloaderUrlBase + "/iaudio/" + m_bootloadername;
309 309
310 m_dp->addItem(tr("Downloading file %1.%2") 310 m_dp->addItem(tr("Downloading file %1.%2")
311 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix())); 311 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
312 312
313 // temporary file needs to be opened to get the filename 313 // temporary file needs to be opened to get the filename
314 downloadFile.open(); 314 downloadFile.open();
@@ -333,14 +333,14 @@ void BootloaderInstaller::iaudioFinish()
333 if(!downloadFile.copy(firmware)) 333 if(!downloadFile.copy(firmware))
334 { 334 {
335 m_dp->addItem(tr("Could not copy: %1 to %2") 335 m_dp->addItem(tr("Could not copy: %1 to %2")
336 .arg(m_tempfilename,firmware)); 336 .arg(m_tempfilename,firmware),LOGERROR);
337 emit done(true); 337 emit done(true);
338 return; 338 return;
339 } 339 }
340 340
341 downloadFile.remove(); 341 downloadFile.remove();
342 342
343 m_dp->addItem(tr("Bootloader install finished successfully.")); 343 m_dp->addItem(tr("Bootloader install finished successfully."),LOGERROR);
344 m_dp->abort(); 344 m_dp->abort();
345 345
346 emit done(false); // success 346 emit done(false); // success
@@ -358,7 +358,7 @@ void BootloaderInstaller::h10Prepare()
358 QString url = m_bootloaderUrlBase + "/iriver/" + m_bootloadername; 358 QString url = m_bootloaderUrlBase + "/iriver/" + m_bootloadername;
359 359
360 m_dp->addItem(tr("Downloading file %1.%2") 360 m_dp->addItem(tr("Downloading file %1.%2")
361 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix())); 361 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
362 362
363 // temporary file needs to be opened to get the filename 363 // temporary file needs to be opened to get the filename
364 downloadFile.open(); 364 downloadFile.open();
@@ -390,7 +390,7 @@ void BootloaderInstaller::h10Prepare()
390 if(!firmwareFI.exists()) //Firmware dosent exists on player 390 if(!firmwareFI.exists()) //Firmware dosent exists on player
391 { 391 {
392 m_dp->addItem(tr("Firmware doesn not exist: %1") 392 m_dp->addItem(tr("Firmware doesn not exist: %1")
393 .arg(firmware)); 393 .arg(firmware),LOGERROR);
394 emit done(true); 394 emit done(true);
395 return; 395 return;
396 } 396 }
@@ -400,7 +400,7 @@ void BootloaderInstaller::h10Prepare()
400 if(!firmwareOrigFI.exists()) //Original Firmware dosent exists on player 400 if(!firmwareOrigFI.exists()) //Original Firmware dosent exists on player
401 { 401 {
402 m_dp->addItem(tr("Original Firmware doesn not exist: %1") 402 m_dp->addItem(tr("Original Firmware doesn not exist: %1")
403 .arg(firmwareOrig)); 403 .arg(firmwareOrig),LOGERROR);
404 emit done(true); 404 emit done(true);
405 return; 405 return;
406 } 406 }
@@ -412,7 +412,7 @@ void BootloaderInstaller::h10Prepare()
412 if(!firmwareFile.remove()) 412 if(!firmwareFile.remove())
413 { 413 {
414 m_dp->addItem(tr("Could not remove the Firmware at: %1") 414 m_dp->addItem(tr("Could not remove the Firmware at: %1")
415 .arg(firmware)); 415 .arg(firmware),LOGERROR);
416 emit done(true); 416 emit done(true);
417 return; 417 return;
418 } 418 }
@@ -421,7 +421,7 @@ void BootloaderInstaller::h10Prepare()
421 if(!firmwareOrigFile.copy(firmware)) 421 if(!firmwareOrigFile.copy(firmware))
422 { 422 {
423 m_dp->addItem(tr("Could not copy the Firmware from: %1 to %2") 423 m_dp->addItem(tr("Could not copy the Firmware from: %1 to %2")
424 .arg(firmwareOrig,firmware)); 424 .arg(firmwareOrig,firmware),LOGERROR);
425 emit done(true); 425 emit done(true);
426 return; 426 return;
427 } 427 }
@@ -447,7 +447,7 @@ void BootloaderInstaller::h10Finish()
447 if(!firmwareFI.exists()) //Firmware dosent exists on player 447 if(!firmwareFI.exists()) //Firmware dosent exists on player
448 { 448 {
449 m_dp->addItem(tr("Firmware does not exist: %1") 449 m_dp->addItem(tr("Firmware does not exist: %1")
450 .arg(firmware)); 450 .arg(firmware),LOGERROR);
451 emit done(true); 451 emit done(true);
452 return; 452 return;
453 } 453 }
@@ -461,7 +461,7 @@ void BootloaderInstaller::h10Finish()
461 if(!firmwareFile.rename(firmwareOrig)) //rename Firmware to Original 461 if(!firmwareFile.rename(firmwareOrig)) //rename Firmware to Original
462 { 462 {
463 m_dp->addItem(tr("Could not rename: %1 to %2") 463 m_dp->addItem(tr("Could not rename: %1 to %2")
464 .arg(firmware,firmwareOrig)); 464 .arg(firmware,firmwareOrig),LOGERROR);
465 emit done(true); 465 emit done(true);
466 return; 466 return;
467 } 467 }
@@ -475,14 +475,14 @@ void BootloaderInstaller::h10Finish()
475 if(!downloadFile.copy(firmware)) 475 if(!downloadFile.copy(firmware))
476 { 476 {
477 m_dp->addItem(tr("Could not copy: %1 to %2") 477 m_dp->addItem(tr("Could not copy: %1 to %2")
478 .arg(m_tempfilename,firmware)); 478 .arg(m_tempfilename,firmware),LOGERROR);
479 emit done(true); 479 emit done(true);
480 return; 480 return;
481 } 481 }
482 482
483 downloadFile.remove(); 483 downloadFile.remove();
484 484
485 m_dp->addItem(tr("Bootloader install finished successfully.")); 485 m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
486 m_dp->abort(); 486 m_dp->abort();
487 487
488 emit done(false); // success 488 emit done(false); // success
@@ -502,19 +502,19 @@ bool initIpodpatcher()
502 502
503void BootloaderInstaller::ipodPrepare() 503void BootloaderInstaller::ipodPrepare()
504{ 504{
505 m_dp->addItem(tr("Searching for ipods")); 505 m_dp->addItem(tr("Searching for ipods"),LOGINFO);
506 struct ipod_t ipod; 506 struct ipod_t ipod;
507 507
508 int n = ipod_scan(&ipod); 508 int n = ipod_scan(&ipod);
509 if (n == 0) 509 if (n == 0)
510 { 510 {
511 m_dp->addItem(tr("No Ipods found")); 511 m_dp->addItem(tr("No Ipods found"),LOGERROR);
512 emit done(true); 512 emit done(true);
513 return; 513 return;
514 } 514 }
515 if (n > 1) 515 if (n > 1)
516 { 516 {
517 m_dp->addItem(tr("Too many Ipods found")); 517 m_dp->addItem(tr("Too many Ipods found"),LOGERROR);
518 emit done(true); 518 emit done(true);
519 } 519 }
520 520
@@ -524,7 +524,7 @@ void BootloaderInstaller::ipodPrepare()
524 QString url = m_bootloaderUrlBase + "/ipod/bootloader-" + m_bootloadername + ".ipod"; 524 QString url = m_bootloaderUrlBase + "/ipod/bootloader-" + m_bootloadername + ".ipod";
525 525
526 m_dp->addItem(tr("Downloading file %1.%2") 526 m_dp->addItem(tr("Downloading file %1.%2")
527 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix())); 527 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
528 528
529 // temporary file needs to be opened to get the filename 529 // temporary file needs to be opened to get the filename
530 downloadFile.open(); 530 downloadFile.open();
@@ -544,25 +544,25 @@ void BootloaderInstaller::ipodPrepare()
544 { 544 {
545 if (ipod_open(&ipod, 0) < 0) 545 if (ipod_open(&ipod, 0) < 0)
546 { 546 {
547 m_dp->addItem(tr("could not open ipod")); 547 m_dp->addItem(tr("could not open ipod"),LOGERROR);
548 emit done(true); 548 emit done(true);
549 return; 549 return;
550 } 550 }
551 551
552 if (read_partinfo(&ipod,0) < 0) 552 if (read_partinfo(&ipod,0) < 0)
553 { 553 {
554 m_dp->addItem(tr("could not read partitiontable")); 554 m_dp->addItem(tr("could not read partitiontable"),LOGERROR);
555 emit done(true); 555 emit done(true);
556 return; 556 return;
557 } 557 }
558 558
559 if (ipod.pinfo[0].start==0) 559 if (ipod.pinfo[0].start==0)
560 { 560 {
561 m_dp->addItem(tr("No partition 0 on disk")); 561 m_dp->addItem(tr("No partition 0 on disk"),LOGERROR);
562 562
563 int i; 563 int i;
564 double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size; 564 double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size;
565 m_dp->addItem(tr("[INFO] Part Start Sector End Sector Size (MB) Type\n")); 565 m_dp->addItem(tr("[INFO] Part Start Sector End Sector Size (MB) Type\n"),LOGINFO);
566 for ( i = 0; i < 4; i++ ) 566 for ( i = 0; i < 4; i++ )
567 { 567 {
568 if (ipod.pinfo[i].start != 0) 568 if (ipod.pinfo[i].start != 0)
@@ -573,7 +573,7 @@ void BootloaderInstaller::ipodPrepare()
573 ipod.pinfo[i].start+ipod.pinfo[i].size-1).arg( 573 ipod.pinfo[i].start+ipod.pinfo[i].size-1).arg(
574 ipod.pinfo[i].size/sectors_per_MB).arg( 574 ipod.pinfo[i].size/sectors_per_MB).arg(
575 get_parttype(ipod.pinfo[i].type)).arg( 575 get_parttype(ipod.pinfo[i].type)).arg(
576 ipod.pinfo[i].type)); 576 ipod.pinfo[i].type),LOGINFO);
577 } 577 }
578 } 578 }
579 emit done(true); 579 emit done(true);
@@ -584,46 +584,46 @@ void BootloaderInstaller::ipodPrepare()
584 584
585 if (ipod.nimages <= 0) 585 if (ipod.nimages <= 0)
586 { 586 {
587 m_dp->addItem(tr("Failed to read firmware directory")); 587 m_dp->addItem(tr("Failed to read firmware directory"),LOGERROR);
588 emit done(true); 588 emit done(true);
589 return; 589 return;
590 } 590 }
591 if (getmodel(&ipod,(ipod.ipod_directory[0].vers>>8)) < 0) 591 if (getmodel(&ipod,(ipod.ipod_directory[0].vers>>8)) < 0)
592 { 592 {
593 m_dp->addItem(tr("Unknown version number in firmware (%1)").arg( 593 m_dp->addItem(tr("Unknown version number in firmware (%1)").arg(
594 ipod.ipod_directory[0].vers)); 594 ipod.ipod_directory[0].vers),LOGERROR);
595 emit done(true); 595 emit done(true);
596 return; 596 return;
597 } 597 }
598 598
599 if (ipod.macpod) 599 if (ipod.macpod)
600 { 600 {
601 m_dp->addItem(tr("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod")); 601 m_dp->addItem(tr("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod"),LOGWARNING);
602 } 602 }
603 603
604 if (ipod_reopen_rw(&ipod) < 0) 604 if (ipod_reopen_rw(&ipod) < 0)
605 { 605 {
606 m_dp->addItem(tr("Could not open Ipod in RW mode")); 606 m_dp->addItem(tr("Could not open Ipod in RW mode"),LOGERROR);
607 emit done(true); 607 emit done(true);
608 return; 608 return;
609 } 609 }
610 610
611 if (ipod.ipod_directory[0].entryOffset==0) { 611 if (ipod.ipod_directory[0].entryOffset==0) {
612 m_dp->addItem(tr("No bootloader detected.")); 612 m_dp->addItem(tr("No bootloader detected."),LOGERROR);
613 emit done(true); 613 emit done(true);
614 return; 614 return;
615 } 615 }
616 616
617 if (delete_bootloader(&ipod)==0) 617 if (delete_bootloader(&ipod)==0)
618 { 618 {
619 m_dp->addItem(tr("Successfully removed Bootloader")); 619 m_dp->addItem(tr("Successfully removed Bootloader"),LOGOK);
620 emit done(false); 620 emit done(false);
621 ipod_close(&ipod); 621 ipod_close(&ipod);
622 return; 622 return;
623 } 623 }
624 else 624 else
625 { 625 {
626 m_dp->addItem(tr("--delete-bootloader failed.")); 626 m_dp->addItem(tr("--delete-bootloader failed."),LOGERROR);
627 emit done(true); 627 emit done(true);
628 ipod_close(&ipod); 628 ipod_close(&ipod);
629 return; 629 return;
@@ -638,26 +638,26 @@ void BootloaderInstaller::ipodFinish()
638 638
639 if (ipod_open(&ipod, 0) < 0) 639 if (ipod_open(&ipod, 0) < 0)
640 { 640 {
641 m_dp->addItem(tr("could not open ipod")); 641 m_dp->addItem(tr("could not open ipod"),LOGERROR);
642 emit done(true); 642 emit done(true);
643 return; 643 return;
644 } 644 }
645 645
646 if (read_partinfo(&ipod,0) < 0) 646 if (read_partinfo(&ipod,0) < 0)
647 { 647 {
648 m_dp->addItem(tr("could not read partitiontable")); 648 m_dp->addItem(tr("could not read partitiontable"),LOGERROR);
649 emit done(true); 649 emit done(true);
650 return; 650 return;
651 } 651 }
652 652
653 if (ipod.pinfo[0].start==0) 653 if (ipod.pinfo[0].start==0)
654 { 654 {
655 m_dp->addItem(tr("No partition 0 on disk")); 655 m_dp->addItem(tr("No partition 0 on disk"),LOGERROR);
656 656
657 int i; 657 int i;
658 double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size; 658 double sectors_per_MB = (1024.0*1024.0)/ipod.sector_size;
659 659
660 m_dp->addItem(tr("[INFO] Part Start Sector End Sector Size (MB) Type\n")); 660 m_dp->addItem(tr("[INFO] Part Start Sector End Sector Size (MB) Type\n"),LOGINFO);
661 661
662 for ( i = 0; i < 4; i++ ) 662 for ( i = 0; i < 4; i++ )
663 { 663 {
@@ -669,7 +669,7 @@ void BootloaderInstaller::ipodFinish()
669 ipod.pinfo[i].start+ipod.pinfo[i].size-1).arg( 669 ipod.pinfo[i].start+ipod.pinfo[i].size-1).arg(
670 ipod.pinfo[i].size/sectors_per_MB).arg( 670 ipod.pinfo[i].size/sectors_per_MB).arg(
671 get_parttype(ipod.pinfo[i].type)).arg( 671 get_parttype(ipod.pinfo[i].type)).arg(
672 ipod.pinfo[i].type)); 672 ipod.pinfo[i].type),LOGWARNING);
673 } 673 }
674 } 674 }
675 emit done(true); 675 emit done(true);
@@ -680,40 +680,40 @@ void BootloaderInstaller::ipodFinish()
680 680
681 if (ipod.nimages <= 0) 681 if (ipod.nimages <= 0)
682 { 682 {
683 m_dp->addItem(tr("Failed to read firmware directory")); 683 m_dp->addItem(tr("Failed to read firmware directory"),LOGERROR);
684 emit done(true); 684 emit done(true);
685 return; 685 return;
686 } 686 }
687 if (getmodel(&ipod,(ipod.ipod_directory[0].vers>>8)) < 0) 687 if (getmodel(&ipod,(ipod.ipod_directory[0].vers>>8)) < 0)
688 { 688 {
689 m_dp->addItem(tr("Unknown version number in firmware (%1)").arg( 689 m_dp->addItem(tr("Unknown version number in firmware (%1)").arg(
690 ipod.ipod_directory[0].vers)); 690 ipod.ipod_directory[0].vers),LOGERROR);
691 emit done(true); 691 emit done(true);
692 return; 692 return;
693 } 693 }
694 694
695 if (ipod.macpod) 695 if (ipod.macpod)
696 { 696 {
697 m_dp->addItem(tr("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod")); 697 m_dp->addItem(tr("Warning this is a MacPod, Rockbox doesnt work on this. Convert it to WinPod"),LOGWARNING);
698 } 698 }
699 699
700 if (ipod_reopen_rw(&ipod) < 0) 700 if (ipod_reopen_rw(&ipod) < 0)
701 { 701 {
702 m_dp->addItem(tr("Could not open Ipod in RW mode")); 702 m_dp->addItem(tr("Could not open Ipod in RW mode"),LOGERROR);
703 emit done(true); 703 emit done(true);
704 return; 704 return;
705 } 705 }
706 706
707 if (add_bootloader(&ipod, m_tempfilename.toLatin1().data(), FILETYPE_DOT_IPOD)==0) 707 if (add_bootloader(&ipod, m_tempfilename.toLatin1().data(), FILETYPE_DOT_IPOD)==0)
708 { 708 {
709 m_dp->addItem(tr("Successfully added Bootloader")); 709 m_dp->addItem(tr("Successfully added Bootloader"),LOGOK);
710 emit done(false); 710 emit done(false);
711 ipod_close(&ipod); 711 ipod_close(&ipod);
712 return; 712 return;
713 } 713 }
714 else 714 else
715 { 715 {
716 m_dp->addItem(tr("failed to add Bootloader")); 716 m_dp->addItem(tr("failed to add Bootloader"),LOGERROR);
717 ipod_close(&ipod); 717 ipod_close(&ipod);
718 emit done(true); 718 emit done(true);
719 return; 719 return;
@@ -733,19 +733,19 @@ bool initSansaPatcher()
733 733
734void BootloaderInstaller::sansaPrepare() 734void BootloaderInstaller::sansaPrepare()
735{ 735{
736 m_dp->addItem(tr("Searching for sansas")); 736 m_dp->addItem(tr("Searching for sansas"),LOGINFO);
737 struct sansa_t sansa; 737 struct sansa_t sansa;
738 738
739 int n = sansa_scan(&sansa); 739 int n = sansa_scan(&sansa);
740 if (n == 0) 740 if (n == 0)
741 { 741 {
742 m_dp->addItem(tr("No Sansa found")); 742 m_dp->addItem(tr("No Sansa found"),LOGERROR);
743 emit done(true); 743 emit done(true);
744 return; 744 return;
745 } 745 }
746 if (n > 1) 746 if (n > 1)
747 { 747 {
748 m_dp->addItem(tr("Too many Sansas found")); 748 m_dp->addItem(tr("Too many Sansas found"),LOGERROR);
749 emit done(true); 749 emit done(true);
750 } 750 }
751 751
@@ -754,7 +754,7 @@ void BootloaderInstaller::sansaPrepare()
754 QString url = m_bootloaderUrlBase + "/sandisk-sansa/e200/" + m_bootloadername; 754 QString url = m_bootloaderUrlBase + "/sandisk-sansa/e200/" + m_bootloadername;
755 755
756 m_dp->addItem(tr("Downloading file %1.%2") 756 m_dp->addItem(tr("Downloading file %1.%2")
757 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix())); 757 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
758 758
759 // temporary file needs to be opened to get the filename 759 // temporary file needs to be opened to get the filename
760 downloadFile.open(); 760 downloadFile.open();
@@ -775,21 +775,21 @@ void BootloaderInstaller::sansaPrepare()
775 775
776 if (sansa_open(&sansa, 0) < 0) 776 if (sansa_open(&sansa, 0) < 0)
777 { 777 {
778 m_dp->addItem(tr("could not open Sansa")); 778 m_dp->addItem(tr("could not open Sansa"),LOGERROR);
779 emit done(true); 779 emit done(true);
780 return; 780 return;
781 } 781 }
782 782
783 if (sansa_read_partinfo(&sansa,0) < 0) 783 if (sansa_read_partinfo(&sansa,0) < 0)
784 { 784 {
785 m_dp->addItem(tr("could not read partitiontable")); 785 m_dp->addItem(tr("could not read partitiontable"),LOGERROR);
786 emit done(true); 786 emit done(true);
787 return; 787 return;
788 } 788 }
789 789
790 int i = is_e200(&sansa); 790 int i = is_e200(&sansa);
791 if (i < 0) { 791 if (i < 0) {
792 m_dp->addItem(tr("Disk is not an E200 (%1), aborting.").arg(i)); 792 m_dp->addItem(tr("Disk is not an E200 (%1), aborting.").arg(i),LOGERROR);
793 emit done(true); 793 emit done(true);
794 return; 794 return;
795 } 795 }
@@ -801,7 +801,7 @@ void BootloaderInstaller::sansaPrepare()
801 "You must reinstall the original Sansa firmware before running\n" 801 "You must reinstall the original Sansa firmware before running\n"
802 "sansapatcher for the first time.\n" 802 "sansapatcher for the first time.\n"
803 "See http://www.rockbox.org/twiki/bin/view/Main/SansaE200Install\n" 803 "See http://www.rockbox.org/twiki/bin/view/Main/SansaE200Install\n"
804 "*********************************************\n")); 804 "*********************************************\n"),LOGERROR);
805 emit done(true); 805 emit done(true);
806 return; 806 return;
807 } 807 }
@@ -809,21 +809,21 @@ void BootloaderInstaller::sansaPrepare()
809 809
810 if (sansa_reopen_rw(&sansa) < 0) 810 if (sansa_reopen_rw(&sansa) < 0)
811 { 811 {
812 m_dp->addItem(tr("Could not open Sansa in RW mode")); 812 m_dp->addItem(tr("Could not open Sansa in RW mode"),LOGERROR);
813 emit done(true); 813 emit done(true);
814 return; 814 return;
815 } 815 }
816 816
817 if (sansa_delete_bootloader(&sansa)==0) 817 if (sansa_delete_bootloader(&sansa)==0)
818 { 818 {
819 m_dp->addItem(tr("Successfully removed Bootloader")); 819 m_dp->addItem(tr("Successfully removed Bootloader"),LOGOK);
820 emit done(false); 820 emit done(false);
821 sansa_close(&sansa); 821 sansa_close(&sansa);
822 return; 822 return;
823 } 823 }
824 else 824 else
825 { 825 {
826 m_dp->addItem(tr("--delete-bootloader failed.")); 826 m_dp->addItem(tr("--delete-bootloader failed."),LOGERROR);
827 emit done(true); 827 emit done(true);
828 sansa_close(&sansa); 828 sansa_close(&sansa);
829 return; 829 return;
@@ -838,14 +838,14 @@ void BootloaderInstaller::sansaFinish()
838 838
839 if (sansa_open(&sansa, 0) < 0) 839 if (sansa_open(&sansa, 0) < 0)
840 { 840 {
841 m_dp->addItem(tr("could not open Sansa")); 841 m_dp->addItem(tr("could not open Sansa"),LOGERROR);
842 emit done(true); 842 emit done(true);
843 return; 843 return;
844 } 844 }
845 845
846 if (sansa_read_partinfo(&sansa,0) < 0) 846 if (sansa_read_partinfo(&sansa,0) < 0)
847 { 847 {
848 m_dp->addItem(tr("could not read partitiontable")); 848 m_dp->addItem(tr("could not read partitiontable"),LOGERROR);
849 emit done(true); 849 emit done(true);
850 return; 850 return;
851 } 851 }
@@ -854,7 +854,7 @@ void BootloaderInstaller::sansaFinish()
854 int i = is_e200(&sansa); 854 int i = is_e200(&sansa);
855 if (i < 0) { 855 if (i < 0) {
856 856
857 m_dp->addItem(tr("Disk is not an E200 (%1), aborting.").arg(i)); 857 m_dp->addItem(tr("Disk is not an E200 (%1), aborting.").arg(i),LOGERROR);
858 emit done(true); 858 emit done(true);
859 return; 859 return;
860 } 860 }
@@ -866,28 +866,28 @@ void BootloaderInstaller::sansaFinish()
866 "You must reinstall the original Sansa firmware before running\n" 866 "You must reinstall the original Sansa firmware before running\n"
867 "sansapatcher for the first time.\n" 867 "sansapatcher for the first time.\n"
868 "See http://www.rockbox.org/twiki/bin/view/Main/SansaE200Install\n" 868 "See http://www.rockbox.org/twiki/bin/view/Main/SansaE200Install\n"
869 "*********************************************\n")); 869 "*********************************************\n"),LOGERROR);
870 emit done(true); 870 emit done(true);
871 return; 871 return;
872 } 872 }
873 873
874 if (sansa_reopen_rw(&sansa) < 0) 874 if (sansa_reopen_rw(&sansa) < 0)
875 { 875 {
876 m_dp->addItem(tr("Could not open Sansa in RW mode")); 876 m_dp->addItem(tr("Could not open Sansa in RW mode"),LOGERROR);
877 emit done(true); 877 emit done(true);
878 return; 878 return;
879 } 879 }
880 880
881 if (sansa_add_bootloader(&sansa, m_tempfilename.toLatin1().data(), FILETYPE_MI4)==0) 881 if (sansa_add_bootloader(&sansa, m_tempfilename.toLatin1().data(), FILETYPE_MI4)==0)
882 { 882 {
883 m_dp->addItem(tr("Successfully added Bootloader")); 883 m_dp->addItem(tr("Successfully added Bootloader"),LOGOK);
884 emit done(false); 884 emit done(false);
885 sansa_close(&sansa); 885 sansa_close(&sansa);
886 return; 886 return;
887 } 887 }
888 else 888 else
889 { 889 {
890 m_dp->addItem(tr("failed to add Bootloader")); 890 m_dp->addItem(tr("failed to add Bootloader"),LOGERROR);
891 sansa_close(&sansa); 891 sansa_close(&sansa);
892 emit done(true); 892 emit done(true);
893 return; 893 return;
@@ -903,7 +903,7 @@ void BootloaderInstaller::iriverPrepare()
903{ 903{
904 char md5sum_str[32]; 904 char md5sum_str[32];
905 if (!FileMD5(m_origfirmware, md5sum_str)) { 905 if (!FileMD5(m_origfirmware, md5sum_str)) {
906 m_dp->addItem(tr("Could not MD5Sum original firmware")); 906 m_dp->addItem(tr("Could not MD5Sum original firmware"),LOGERROR);
907 emit done(true); 907 emit done(true);
908 return; 908 return;
909 } 909 }
@@ -933,7 +933,7 @@ void BootloaderInstaller::iriverPrepare()
933 } 933 }
934 if (series == 0) 934 if (series == 0)
935 { 935 {
936 m_dp->addItem(tr("Could not detect firmware type")); 936 m_dp->addItem(tr("Could not detect firmware type"),LOGERROR);
937 emit done(true); 937 emit done(true);
938 return; 938 return;
939 } 939 }
@@ -941,7 +941,7 @@ void BootloaderInstaller::iriverPrepare()
941 QString url = m_bootloaderUrlBase + "/iriver/" + m_bootloadername; 941 QString url = m_bootloaderUrlBase + "/iriver/" + m_bootloadername;
942 942
943 m_dp->addItem(tr("Downloading file %1.%2") 943 m_dp->addItem(tr("Downloading file %1.%2")
944 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix())); 944 .arg(QFileInfo(url).baseName(), QFileInfo(url).completeSuffix()),LOGINFO);
945 945
946 // temporary file needs to be opened to get the filename 946 // temporary file needs to be opened to get the filename
947 downloadFile.open(); 947 downloadFile.open();
@@ -996,7 +996,7 @@ void BootloaderInstaller::iriverFinish()
996 // iriver decode 996 // iriver decode
997 if (iriver_decode(m_origfirmware, firmwareBinName, FALSE, STRIP_NONE,m_dp) == -1) 997 if (iriver_decode(m_origfirmware, firmwareBinName, FALSE, STRIP_NONE,m_dp) == -1)
998 { 998 {
999 m_dp->addItem(tr("Error in descramble")); 999 m_dp->addItem(tr("Error in descramble"),LOGERROR);
1000 firmwareBin.remove(); 1000 firmwareBin.remove();
1001 newBin.remove(); 1001 newBin.remove();
1002 newHex.remove(); 1002 newHex.remove();
@@ -1006,7 +1006,7 @@ void BootloaderInstaller::iriverFinish()
1006 // mkboot 1006 // mkboot
1007 if (!mkboot(firmwareBinName, newBinName, m_tempfilename, origin,m_dp)) 1007 if (!mkboot(firmwareBinName, newBinName, m_tempfilename, origin,m_dp))
1008 { 1008 {
1009 m_dp->addItem(tr("Error in patching")); 1009 m_dp->addItem(tr("Error in patching"),LOGERROR);
1010 firmwareBin.remove(); 1010 firmwareBin.remove();
1011 newBin.remove(); 1011 newBin.remove();
1012 newHex.remove(); 1012 newHex.remove();
@@ -1016,7 +1016,7 @@ void BootloaderInstaller::iriverFinish()
1016 // iriver_encode 1016 // iriver_encode
1017 if (iriver_encode(newBinName, newHexName, FALSE,m_dp) == -1) 1017 if (iriver_encode(newBinName, newHexName, FALSE,m_dp) == -1)
1018 { 1018 {
1019 m_dp->addItem(tr("Error in scramble")); 1019 m_dp->addItem(tr("Error in scramble"),LOGERROR);
1020 firmwareBin.remove(); 1020 firmwareBin.remove();
1021 newBin.remove(); 1021 newBin.remove();
1022 newHex.remove(); 1022 newHex.remove();
@@ -1027,7 +1027,7 @@ void BootloaderInstaller::iriverFinish()
1027 /* now md5sum it */ 1027 /* now md5sum it */
1028 if (!FileMD5(newHexName, md5sum_str)) 1028 if (!FileMD5(newHexName, md5sum_str))
1029 { 1029 {
1030 m_dp->addItem(tr("Error in checksumming")); 1030 m_dp->addItem(tr("Error in checksumming"),LOGERROR);
1031 firmwareBin.remove(); 1031 firmwareBin.remove();
1032 newBin.remove(); 1032 newBin.remove();
1033 newHex.remove(); 1033 newHex.remove();
@@ -1052,7 +1052,7 @@ void BootloaderInstaller::iriverFinish()
1052 if(!newHex.copy(dest)) 1052 if(!newHex.copy(dest))
1053 { 1053 {
1054 m_dp->addItem(tr("Could not copy: %1 to %2") 1054 m_dp->addItem(tr("Could not copy: %1 to %2")
1055 .arg(newHexName,dest)); 1055 .arg(newHexName,dest),LOGERROR);
1056 emit done(true); 1056 emit done(true);
1057 return; 1057 return;
1058 } 1058 }
@@ -1060,7 +1060,7 @@ void BootloaderInstaller::iriverFinish()
1060 downloadFile.remove(); 1060 downloadFile.remove();
1061 newHex.remove(); 1061 newHex.remove();
1062 1062
1063 m_dp->addItem(tr("Bootloader install finished successfully.")); 1063 m_dp->addItem(tr("Bootloader install finished successfully."),LOGOK);
1064 m_dp->abort(); 1064 m_dp->abort();
1065 1065
1066 emit done(false); // success 1066 emit done(false); // success
diff --git a/rbutil/rbutilqt/installzip.cpp b/rbutil/rbutilqt/installzip.cpp
index b947553f33..4f99d7bc31 100644
--- a/rbutil/rbutilqt/installzip.cpp
+++ b/rbutil/rbutilqt/installzip.cpp
@@ -33,7 +33,7 @@ void ZipInstaller::install(ProgressloggerInterface* dp)
33 m_dp = dp; 33 m_dp = dp;
34 34
35 m_dp->addItem(tr("Downloading file %1.%2") 35 m_dp->addItem(tr("Downloading file %1.%2")
36 .arg(QFileInfo(m_url).baseName(), QFileInfo(m_url).completeSuffix())); 36 .arg(QFileInfo(m_url).baseName(), QFileInfo(m_url).completeSuffix()),LOGINFO);
37 37
38 // temporary file needs to be opened to get the filename 38 // temporary file needs to be opened to get the filename
39 downloadFile.open(); 39 downloadFile.open();
@@ -72,23 +72,23 @@ void ZipInstaller::downloadDone(bool error)
72 } 72 }
73 m_dp->setProgressValue(max); 73 m_dp->setProgressValue(max);
74 if(getter->httpResponse() != 200) { 74 if(getter->httpResponse() != 200) {
75 m_dp->addItem(tr("Download error: received HTTP error %1.").arg(getter->httpResponse())); 75 m_dp->addItem(tr("Download error: received HTTP error %1.").arg(getter->httpResponse()),LOGERROR);
76 m_dp->abort(); 76 m_dp->abort();
77 emit done(true); 77 emit done(true);
78 return; 78 return;
79 } 79 }
80 if(error) { 80 if(error) {
81 m_dp->addItem(tr("Download error: %1").arg(getter->errorString())); 81 m_dp->addItem(tr("Download error: %1").arg(getter->errorString()),LOGERROR);
82 m_dp->abort(); 82 m_dp->abort();
83 emit done(true); 83 emit done(true);
84 return; 84 return;
85 } 85 }
86 else m_dp->addItem(tr("Download finished.")); 86 else m_dp->addItem(tr("Download finished."),LOGOK);
87 87
88 // unzip downloaded file 88 // unzip downloaded file
89 qDebug() << "about to unzip the downloaded file" << m_file << "to" << m_mountpoint; 89 qDebug() << "about to unzip the downloaded file" << m_file << "to" << m_mountpoint;
90 90
91 m_dp->addItem(tr("Extracting file.")); 91 m_dp->addItem(tr("Extracting file."),LOGINFO);
92 92
93 qDebug() << "file to unzip: " << m_file; 93 qDebug() << "file to unzip: " << m_file;
94 UnZip::ErrorCode ec; 94 UnZip::ErrorCode ec;
@@ -96,7 +96,7 @@ void ZipInstaller::downloadDone(bool error)
96 ec = uz.openArchive(m_file); 96 ec = uz.openArchive(m_file);
97 if(ec != UnZip::Ok) { 97 if(ec != UnZip::Ok) {
98 m_dp->addItem(tr("Opening archive failed: %1.") 98 m_dp->addItem(tr("Opening archive failed: %1.")
99 .arg(uz.formatError(ec))); 99 .arg(uz.formatError(ec)),LOGERROR);
100 m_dp->abort(); 100 m_dp->abort();
101 emit done(false); 101 emit done(false);
102 return; 102 return;
@@ -105,13 +105,13 @@ void ZipInstaller::downloadDone(bool error)
105 ec = uz.extractAll(m_mountpoint); 105 ec = uz.extractAll(m_mountpoint);
106 if(ec != UnZip::Ok) { 106 if(ec != UnZip::Ok) {
107 m_dp->addItem(tr("Extracting failed: %1.") 107 m_dp->addItem(tr("Extracting failed: %1.")
108 .arg(uz.formatError(ec))); 108 .arg(uz.formatError(ec)),LOGERROR);
109 m_dp->abort(); 109 m_dp->abort();
110 emit done(false); 110 emit done(false);
111 return; 111 return;
112 } 112 }
113 113
114 m_dp->addItem(tr("creating installation log")); 114 m_dp->addItem(tr("creating installation log"),LOGINFO);
115 115
116 QStringList zipContents = uz.fileList(); 116 QStringList zipContents = uz.fileList();
117 117
@@ -127,7 +127,7 @@ void ZipInstaller::downloadDone(bool error)
127 // remove temporary file 127 // remove temporary file
128 downloadFile.remove(); 128 downloadFile.remove();
129 129
130 m_dp->addItem(tr("Extraction finished successfully.")); 130 m_dp->addItem(tr("Extraction finished successfully."),LOGOK);
131 m_dp->abort(); 131 m_dp->abort();
132 emit done(false); 132 emit done(false);
133} 133}
diff --git a/rbutil/rbutilqt/installzipwindow.cpp b/rbutil/rbutilqt/installzipwindow.cpp
index cd85305eba..9e4381dce0 100644
--- a/rbutil/rbutilqt/installzipwindow.cpp
+++ b/rbutil/rbutilqt/installzipwindow.cpp
@@ -76,7 +76,7 @@ void InstallZipWindow::accept()
76 userSettings->setValue("defaults/mountpoint", mountPoint); 76 userSettings->setValue("defaults/mountpoint", mountPoint);
77 } 77 }
78 else { 78 else {
79 logger->addItem(tr("Mount point is wrong!")); 79 logger->addItem(tr("Mount point is wrong!"),LOGERROR);
80 logger->abort(); 80 logger->abort();
81 return; 81 return;
82 } 82 }
@@ -84,9 +84,9 @@ void InstallZipWindow::accept()
84 userSettings->sync(); 84 userSettings->sync();
85 85
86 // create Zip installer 86 // create Zip installer
87 installer = new ZipInstaller(this); 87 installer = new ZipInstaller(this);
88 88
89 QString fileName = url.section('/', -1); 89 QString fileName = url.section('/', -1);
90 installer->setFilename(fileName); 90 installer->setFilename(fileName);
91 installer->setUrl(url); 91 installer->setUrl(url);
92 installer->setProxy(proxy); 92 installer->setProxy(proxy);
diff --git a/rbutil/rbutilqt/irivertools/irivertools.cpp b/rbutil/rbutilqt/irivertools/irivertools.cpp
index ee91193dc4..af06e86e06 100644
--- a/rbutil/rbutilqt/irivertools/irivertools.cpp
+++ b/rbutil/rbutilqt/irivertools/irivertools.cpp
@@ -59,12 +59,12 @@ bool mkboot(QString infile, QString outfile,QString bootloader,int origin,Progre
59 QFile f(infile); 59 QFile f(infile);
60 if(!f.open(QIODevice::ReadOnly)) 60 if(!f.open(QIODevice::ReadOnly))
61 { 61 {
62 dp->addItem("Could not open: %1" + infile); 62 dp->addItem("Could not open: %1" + infile,LOGERROR);
63 return false; 63 return false;
64 } 64 }
65 i = f.read((char*)image,16); 65 i = f.read((char*)image,16);
66 if(i < 16) { 66 if(i < 16) {
67 dp->addItem("reading header failed"); 67 dp->addItem("reading header failed",LOGERROR);
68 return false; 68 return false;
69 } 69 }
70 70
@@ -77,7 +77,7 @@ bool mkboot(QString infile, QString outfile,QString bootloader,int origin,Progre
77 len = binary_length+0x200-16; 77 len = binary_length+0x200-16;
78 i = f.read((char*)image+16, len); 78 i = f.read((char*)image+16, len);
79 if(i < len) { 79 if(i < len) {
80 dp->addItem("reading firmware failed"); 80 dp->addItem("reading firmware failed",LOGERROR);
81 return false; 81 return false;
82 } 82 }
83 83
@@ -86,7 +86,7 @@ bool mkboot(QString infile, QString outfile,QString bootloader,int origin,Progre
86 f.setFileName(bootloader); 86 f.setFileName(bootloader);
87 if(!f.open(QIODevice::ReadOnly)) 87 if(!f.open(QIODevice::ReadOnly))
88 { 88 {
89 dp->addItem("Could not open: %1" + bootloader); 89 dp->addItem("Could not open: %1" + bootloader,LOGERROR);
90 return false; 90 return false;
91 } 91 }
92 92
@@ -94,7 +94,7 @@ bool mkboot(QString infile, QString outfile,QString bootloader,int origin,Progre
94 94
95 i = f.read((char*)image+0x220 + origin, bllen); 95 i = f.read((char*)image+0x220 + origin, bllen);
96 if(i < bllen) { 96 if(i < bllen) {
97 dp->addItem("reading bootloader failed"); 97 dp->addItem("reading bootloader failed",LOGERROR);
98 return false; 98 return false;
99 } 99 }
100 100
@@ -102,7 +102,7 @@ bool mkboot(QString infile, QString outfile,QString bootloader,int origin,Progre
102 f.setFileName(outfile); 102 f.setFileName(outfile);
103 if(!f.open(QIODevice::WriteOnly)) 103 if(!f.open(QIODevice::WriteOnly))
104 { 104 {
105 dp->addItem("Could not open: %1" + outfile); 105 dp->addItem("Could not open: %1" + outfile,LOGERROR);
106 return false; 106 return false;
107 } 107 }
108 108
@@ -154,7 +154,7 @@ bool mkboot(QString infile, QString outfile,QString bootloader,int origin,Progre
154 154
155 i = f.write((char*)image,total_length); 155 i = f.write((char*)image,total_length);
156 if(i < total_length) { 156 if(i < total_length) {
157 dp->addItem("writing bootloader failed"); 157 dp->addItem("writing bootloader failed",LOGERROR);
158 return false; 158 return false;
159 } 159 }
160 160
@@ -226,19 +226,19 @@ int iriver_decode(QString infile_name, QString outfile_name, unsigned int modify
226 226
227 if(!infile.open(QIODevice::ReadOnly)) 227 if(!infile.open(QIODevice::ReadOnly))
228 { 228 {
229 dp->addItem("Could not open: %1" + infile_name); 229 dp->addItem("Could not open: %1" + infile_name,LOGERROR);
230 return -1; 230 return -1;
231 } 231 }
232 if(!outfile.open(QIODevice::WriteOnly)) 232 if(!outfile.open(QIODevice::WriteOnly))
233 { 233 {
234 dp->addItem("Could not open: %1" + outfile_name); 234 dp->addItem("Could not open: %1" + outfile_name,LOGERROR);
235 return -1; 235 return -1;
236 } 236 }
237 lenread = infile.read( (char*)headerdata, 512); 237 lenread = infile.read( (char*)headerdata, 512);
238 if( lenread != 512 ) 238 if( lenread != 512 )
239 { 239 {
240 dp->addItem("This doesn't look like a valid encrypted iHP" 240 dp->addItem("This doesn't look like a valid encrypted iHP"
241 "firmware - reason: header length."); 241 "firmware - reason: header length.",LOGERROR);
242 infile.close(); 242 infile.close();
243 outfile.close(); 243 outfile.close();
244 return -1; 244 return -1;
@@ -248,7 +248,7 @@ int iriver_decode(QString infile_name, QString outfile_name, unsigned int modify
248 if( i == -1 ) 248 if( i == -1 )
249 { 249 {
250 dp->addItem("This firmware is for an unknown model, or is not" 250 dp->addItem("This firmware is for an unknown model, or is not"
251 " a valid encrypted iHP firmware."); 251 " a valid encrypted iHP firmware.",LOGERROR);
252 infile.close(); 252 infile.close();
253 outfile.close(); 253 outfile.close();
254 return -1; 254 return -1;
@@ -271,7 +271,7 @@ int iriver_decode(QString infile_name, QString outfile_name, unsigned int modify
271 dwLength2+dwLength3+512 != dwLength1 ) 271 dwLength2+dwLength3+512 != dwLength1 )
272 { 272 {
273 dp->addItem("This doesn't look like a valid encrypted " 273 dp->addItem("This doesn't look like a valid encrypted "
274 "iHP firmware - reason: file 'length' data."); 274 "iHP firmware - reason: file 'length' data.",LOGERROR);
275 infile.close(); 275 infile.close();
276 outfile.close(); 276 outfile.close();
277 return -1; 277 return -1;
@@ -333,7 +333,7 @@ int iriver_decode(QString infile_name, QString outfile_name, unsigned int modify
333 if( fp != dwLength2 ) 333 if( fp != dwLength2 )
334 { 334 {
335 dp->addItem("This doesn't look like a valid encrypted " 335 dp->addItem("This doesn't look like a valid encrypted "
336 "iHP firmware - reason: 'length2' mismatch."); 336 "iHP firmware - reason: 'length2' mismatch.",LOGERROR);
337 infile.close(); 337 infile.close();
338 outfile.close(); 338 outfile.close();
339 return -1; 339 return -1;
@@ -350,7 +350,7 @@ int iriver_decode(QString infile_name, QString outfile_name, unsigned int modify
350 if( memcmp( ppChecksums, blockdata, lenread ) != 0 ) 350 if( memcmp( ppChecksums, blockdata, lenread ) != 0 )
351 { 351 {
352 dp->addItem("This doesn't look like a valid encrypted " 352 dp->addItem("This doesn't look like a valid encrypted "
353 "iHP firmware - reason: Checksum mismatch!"); 353 "iHP firmware - reason: Checksum mismatch!",LOGERROR);
354 infile.close(); 354 infile.close();
355 outfile.close(); 355 outfile.close();
356 return -1; 356 return -1;
@@ -361,7 +361,7 @@ int iriver_decode(QString infile_name, QString outfile_name, unsigned int modify
361 if( fp != dwLength3 ) 361 if( fp != dwLength3 )
362 { 362 {
363 dp->addItem("This doesn't look like a valid encrypted " 363 dp->addItem("This doesn't look like a valid encrypted "
364 "iHP firmware - reason: 'length3' mismatch."); 364 "iHP firmware - reason: 'length3' mismatch.",LOGERROR);
365 infile.close(); 365 infile.close();
366 outfile.close(); 366 outfile.close();
367 return -1; 367 return -1;
@@ -409,12 +409,12 @@ int iriver_encode(QString infile_name, QString outfile_name, unsigned int modify
409 409
410 if(!infile.open(QIODevice::ReadOnly)) 410 if(!infile.open(QIODevice::ReadOnly))
411 { 411 {
412 dp->addItem("Could not open: %1" + infile_name); 412 dp->addItem("Could not open: %1" + infile_name,LOGERROR);
413 return -1; 413 return -1;
414 } 414 }
415 if(!outfile.open(QIODevice::WriteOnly)) 415 if(!outfile.open(QIODevice::WriteOnly))
416 { 416 {
417 dp->addItem("Could not open: %1" + outfile_name); 417 dp->addItem("Could not open: %1" + outfile_name,LOGERROR);
418 return -1; 418 return -1;
419 } 419 }
420 420
@@ -422,7 +422,7 @@ int iriver_encode(QString infile_name, QString outfile_name, unsigned int modify
422 if( lenread != 512 ) 422 if( lenread != 512 )
423 { 423 {
424 dp->addItem("This doesn't look like a valid decoded " 424 dp->addItem("This doesn't look like a valid decoded "
425 "iHP firmware - reason: header length."); 425 "iHP firmware - reason: header length.",LOGERROR);
426 infile.close(); 426 infile.close();
427 outfile.close(); 427 outfile.close();
428 }; 428 };
@@ -436,7 +436,7 @@ int iriver_encode(QString infile_name, QString outfile_name, unsigned int modify
436 if( i == -1 ) 436 if( i == -1 )
437 { 437 {
438 dp->addItem("This firmware is for an unknown model, or is not" 438 dp->addItem("This firmware is for an unknown model, or is not"
439 " a valid decoded iHP firmware."); 439 " a valid decoded iHP firmware.",LOGERROR);
440 infile.close(); 440 infile.close();
441 outfile.close(); 441 outfile.close();
442 }; 442 };
@@ -457,7 +457,7 @@ int iriver_encode(QString infile_name, QString outfile_name, unsigned int modify
457 dwLength2+dwLength3+512 != dwLength1 ) 457 dwLength2+dwLength3+512 != dwLength1 )
458 { 458 {
459 dp->addItem("This doesn't look like a valid decoded " 459 dp->addItem("This doesn't look like a valid decoded "
460 "iHP firmware - reason:file 'length' data."); 460 "iHP firmware - reason:file 'length' data.",LOGERROR);
461 infile.close(); 461 infile.close();
462 outfile.close(); 462 outfile.close();
463 }; 463 };
@@ -495,7 +495,7 @@ int iriver_encode(QString infile_name, QString outfile_name, unsigned int modify
495 if( fp != dwLength2 ) 495 if( fp != dwLength2 )
496 { 496 {
497 dp->addItem("This doesn't look like a valid decoded " 497 dp->addItem("This doesn't look like a valid decoded "
498 "iHP firmware - reason: 'length1' mismatch."); 498 "iHP firmware - reason: 'length1' mismatch.",LOGERROR);
499 infile.close(); 499 infile.close();
500 outfile.close(); 500 outfile.close();
501 }; 501 };
@@ -515,7 +515,7 @@ int iriver_encode(QString infile_name, QString outfile_name, unsigned int modify
515 if( fp != dwLength3 ) 515 if( fp != dwLength3 )
516 { 516 {
517 dp->addItem("This doesn't look like a valid decoded " 517 dp->addItem("This doesn't look like a valid decoded "
518 "iHP firmware - 'length2' mismatch."); 518 "iHP firmware - 'length2' mismatch.",LOGERROR);
519 infile.close(); 519 infile.close();
520 outfile.close(); 520 outfile.close();
521 }; 521 };
diff --git a/rbutil/rbutilqt/progressloggergui.cpp b/rbutil/rbutilqt/progressloggergui.cpp
index f348d5b96d..8dc3e71844 100644
--- a/rbutil/rbutilqt/progressloggergui.cpp
+++ b/rbutil/rbutilqt/progressloggergui.cpp
@@ -31,7 +31,30 @@ ProgressLoggerGui::ProgressLoggerGui(QObject* parent): ProgressloggerInterface(p
31void ProgressLoggerGui::addItem(QString text) 31void ProgressLoggerGui::addItem(QString text)
32{ 32{
33 dp.listProgress->addItem(text); 33 dp.listProgress->addItem(text);
34} 34}
35
36void ProgressLoggerGui::addItem(QString text,int flag)
37{
38 QListWidgetItem* item = new QListWidgetItem(text);
39
40 switch(flag)
41 {
42 case LOGOK:
43 item->setIcon(QIcon(":/icons/icons/log-ok.png"));
44 break;
45 case LOGINFO:
46 item->setIcon(QIcon(":/icons/icons/log-info.png"));
47 break;
48 case LOGWARNING:
49 item->setIcon(QIcon(":/icons/icons/log-warning.png"));
50 break;
51 case LOGERROR:
52 item->setIcon(QIcon(":/icons/icons/log-error.png"));
53 break;
54 }
55
56 dp.listProgress->addItem(item);
57}
35 58
36void ProgressLoggerGui::setProgressValue(int value) 59void ProgressLoggerGui::setProgressValue(int value)
37{ 60{
diff --git a/rbutil/rbutilqt/progressloggergui.h b/rbutil/rbutilqt/progressloggergui.h
index 2290fcb080..3b70c966be 100644
--- a/rbutil/rbutilqt/progressloggergui.h
+++ b/rbutil/rbutilqt/progressloggergui.h
@@ -32,6 +32,8 @@ public:
32 32
33 virtual void addItem(QString text) ; //adds a string to the list 33 virtual void addItem(QString text) ; //adds a string to the list
34 34
35 virtual void addItem(QString text, int flag) ; //adds a string to the list
36
35 virtual void setProgressValue(int value); 37 virtual void setProgressValue(int value);
36 virtual void setProgressMax(int max); 38 virtual void setProgressMax(int max);
37 virtual int getProgressMax(); 39 virtual int getProgressMax();
diff --git a/rbutil/rbutilqt/progressloggerinterface.h b/rbutil/rbutilqt/progressloggerinterface.h
index c2075a15f4..65c2a23282 100644
--- a/rbutil/rbutilqt/progressloggerinterface.h
+++ b/rbutil/rbutilqt/progressloggerinterface.h
@@ -21,6 +21,12 @@
21#define PROGRESSLOGGERINTERFACE_H 21#define PROGRESSLOGGERINTERFACE_H
22 22
23#include <QtGui> 23#include <QtGui>
24
25#define LOGOK 1
26#define LOGINFO 2
27#define LOGWARNING 3
28#define LOGERROR 4
29
24 30
25class ProgressloggerInterface : public QObject 31class ProgressloggerInterface : public QObject
26{ 32{
@@ -29,6 +35,7 @@ class ProgressloggerInterface : public QObject
29public: 35public:
30 ProgressloggerInterface(QObject* parent) : QObject(parent) {} 36 ProgressloggerInterface(QObject* parent) : QObject(parent) {}
31 virtual void addItem(QString text) =0 ; //adds a string to the list 37 virtual void addItem(QString text) =0 ; //adds a string to the list
38 virtual void addItem(QString text,int flag) =0 ; //adds a string to the list, with icon
32 39
33 virtual void setProgressValue(int value)=0; 40 virtual void setProgressValue(int value)=0;
34 virtual void setProgressMax(int max)=0; 41 virtual void setProgressMax(int max)=0;
diff --git a/rbutil/rbutilqt/rbutilqt.qrc b/rbutil/rbutilqt/rbutilqt.qrc
index 98d8aa2fd3..913d600897 100644
--- a/rbutil/rbutilqt/rbutilqt.qrc
+++ b/rbutil/rbutilqt/rbutilqt.qrc
@@ -7,17 +7,20 @@
7 <file>icons/bootloader_btn.png</file> 7 <file>icons/bootloader_btn.png</file>
8 <file>icons/doom_btn.png</file> 8 <file>icons/doom_btn.png</file>
9 <file>icons/font_btn.png</file> 9 <file>icons/font_btn.png</file>
10 <file>icons/log-error.png</file>
11 <file>icons/log-info.png</file>
12 <file>icons/log-ok.png</file>
13 <file>icons/log-warning.png</file>
10 <file>icons/rbinstall_btn.png</file> 14 <file>icons/rbinstall_btn.png</file>
15 <file>icons/rblogo.xpm</file>
16 <file>icons/rbutil.xpm</file>
11 <file>icons/rembootloader_btn.png</file> 17 <file>icons/rembootloader_btn.png</file>
12 <file>icons/remrb_btn.png</file> 18 <file>icons/remrb_btn.png</file>
13 <file>icons/themes_btn.png</file> 19 <file>icons/themes_btn.png</file>
14 <file>icons/wizard.xpm</file> 20 <file>icons/wizard.xpm</file>
15 <file>icons/rblogo.xpm</file>
16 <file>icons/rbutil.xpm</file>
17 </qresource> 21 </qresource>
18 <qresource prefix="/ini" > 22 <qresource prefix="/ini" >
19 <file>rbutil.ini</file> 23 <file>rbutil.ini</file>
20 </qresource> 24 </qresource>
21 <qresource prefix="/lang" > 25 <qresource prefix="/lang" />
22 </qresource>
23</RCC> 26</RCC>