summaryrefslogtreecommitdiff
authorar <ar>2005-02-18 20:21:32 (UTC)
committer ar <ar>2005-02-18 20:21:32 (UTC)
commitd8254f2f295b07bdadf6b4b25f0bd125d8121c28 (patch) (unidiff)
treebc3edde3980b5c568e630ef4418e7508e3d5d374
parent03da1c30d7d6c7197a551219e3a36c9a3f469cc8 (diff)
downloadopie-d8254f2f295b07bdadf6b4b25f0bd125d8121c28.zip
opie-d8254f2f295b07bdadf6b4b25f0bd125d8121c28.tar.gz
opie-d8254f2f295b07bdadf6b4b25f0bd125d8121c28.tar.bz2
- #1570 - Confirmation needed before restore backup and overwrite local data
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog1
-rw-r--r--noncore/settings/backup/backuprestore.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 8ac976d..218aacf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,223 +1,224 @@
1 2005-??-??Opie 1.2.0 1 2005-??-??Opie 1.2.0
2 2
3 New Features 3 New Features
4 ------------ 4 ------------
5 * Launcher: Support a static background pixmap (mickeyl) 5 * Launcher: Support a static background pixmap (mickeyl)
6 * LauncherSettings: Choose whether to have a static background pixmap (mickeyl) 6 * LauncherSettings: Choose whether to have a static background pixmap (mickeyl)
7 7
8 Fixed Bugs 8 Fixed Bugs
9 ---------- 9 ----------
10 * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers) 10 * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers)
11 * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke) 11 * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke)
12 * #1482 - Fix double '/' in paths (zecke) 12 * #1482 - Fix double '/' in paths (zecke)
13 * #1536 - Autosave of custom locations in opie backup (ar) 13 * #1536 - Autosave of custom locations in opie backup (ar)
14 * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke) 14 * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke)
15 * #1540 - Implemented deletion of DocLnks in opie-eye (zecke) 15 * #1540 - Implemented deletion of DocLnks in opie-eye (zecke)
16 * #1542 - Fix Todo crash when priority < 1 or > 5 (drw) 16 * #1542 - Fix Todo crash when priority < 1 or > 5 (drw)
17 * #1554 - Fixed Opie-Console name in .desktop file (mickeyl) 17 * #1554 - Fixed Opie-Console name in .desktop file (mickeyl)
18 * #1556 - Start to look for sound files in /opt/QtPalmtop/sounds (zecke) 18 * #1556 - Start to look for sound files in /opt/QtPalmtop/sounds (zecke)
19 * #1558 - Fixed opie-login breaking opie startup (mickeyl) 19 * #1558 - Fixed opie-login breaking opie startup (mickeyl)
20 * #1570 - Confirmation needed befor Restore a backup and overwrite local data (ar)
20 * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw) 21 * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw)
21 22
22 Internal 23 Internal
23 -------- 24 --------
24 * Work around bug in Qt/Embedded 2.3.10: qt_version() returns 231 (mickeyl) 25 * Work around bug in Qt/Embedded 2.3.10: qt_version() returns 231 (mickeyl)
25 * Killed the need for weak symbols in QtE (zecke) 26 * Killed the need for weak symbols in QtE (zecke)
26 27
27 2005-02-03Opie 1.1.9 28 2005-02-03Opie 1.1.9
28 29
29 New Features 30 New Features
30 ------------ 31 ------------
31 * Number of icon columns in Launcher is customizable through Launcher.conf (hrw,zecke,mickeyl) 32 * Number of icon columns in Launcher is customizable through Launcher.conf (hrw,zecke,mickeyl)
32 * Number of icon columns in Launcher is customizable through LauncherSettings (mickeyl) 33 * Number of icon columns in Launcher is customizable through LauncherSettings (mickeyl)
33 * Usability enhancements in OpieIRC (skyhusker) 34 * Usability enhancements in OpieIRC (skyhusker)
34 35
35 Fixed Bugs 36 Fixed Bugs
36 ---------- 37 ----------
37 * #1501 - Fixed bug in todo sql backend (eilers) 38 * #1501 - Fixed bug in todo sql backend (eilers)
38 * #1505 - Added more Swap sizes in memoryapplet (mickeyl) 39 * #1505 - Added more Swap sizes in memoryapplet (mickeyl)
39 * #1525 - Hopefully fixed double alarms and not removing alarms set with the Clock application (zecke) 40 * #1525 - Hopefully fixed double alarms and not removing alarms set with the Clock application (zecke)
40 * #1533 - Security Owner Dialog (shown in case of unsuccessfull authentiacation) wasn't able to display information in non latin1 encoding (zecke) 41 * #1533 - Security Owner Dialog (shown in case of unsuccessfull authentiacation) wasn't able to display information in non latin1 encoding (zecke)
41 * n.a. - Removed hard coded font sizes in a couple of inputmethods (mickeyl) 42 * n.a. - Removed hard coded font sizes in a couple of inputmethods (mickeyl)
42 * n.a. - Removed MediumDlg appearing prior to FirstUsage wizard (i.e. calibration) (mickeyl) 43 * n.a. - Removed MediumDlg appearing prior to FirstUsage wizard (i.e. calibration) (mickeyl)
43 * n.a. - Fixed numerous buglets in OpieIRC (skyhusker) 44 * n.a. - Fixed numerous buglets in OpieIRC (skyhusker)
44 45
45 Internal 46 Internal
46 -------- 47 --------
47 * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl) 48 * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl)
48 * You can now use the Opie build system in combination with a OpenEmbedded staging area which makes a nice cross development environment (mickeyl) 49 * You can now use the Opie build system in combination with a OpenEmbedded staging area which makes a nice cross development environment (mickeyl)
49 * Made Opie compilable with Qt/Embedded 2.3.10 (ar) 50 * Made Opie compilable with Qt/Embedded 2.3.10 (ar)
50 * Changed Launcher to get default orientation from ODevice w/ QWS_DISPLAY overriding (mickeyl) 51 * Changed Launcher to get default orientation from ODevice w/ QWS_DISPLAY overriding (mickeyl)
51 * Build tree cleanups (mickeyl) 52 * Build tree cleanups (mickeyl)
52 53
53 2004-11-26Opie 1.1.8 54 2004-11-26Opie 1.1.8
54 55
55 New Features 56 New Features
56 ------------ 57 ------------
57 * PackageManager supports installation of local ipkg files (drw) 58 * PackageManager supports installation of local ipkg files (drw)
58 * PackageManager supports linking of applications to root (drw) 59 * PackageManager supports linking of applications to root (drw)
59 * PackageManager supports src/gz feeds (drw,wimpie) 60 * PackageManager supports src/gz feeds (drw,wimpie)
60 * Added a syslog information tab to sysinfo (mickeyl) 61 * Added a syslog information tab to sysinfo (mickeyl)
61 * Added new, more consistent, PIM icons + a GIMP teplate (ar) 62 * Added new, more consistent, PIM icons + a GIMP teplate (ar)
62 63
63 Fixed Bugs 64 Fixed Bugs
64 ---------- 65 ----------
65 * #1017 - Tetrix doesn't display correctly for high resolution screens (drw) 66 * #1017 - Tetrix doesn't display correctly for high resolution screens (drw)
66 * #1269 - VCards were imported into personal area if it was activated (eilers) 67 * #1269 - VCards were imported into personal area if it was activated (eilers)
67 * #1464 - Packagemanager dont set active filter after install a package (drw) 68 * #1464 - Packagemanager dont set active filter after install a package (drw)
68 * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers) 69 * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers)
69 * #1493 - Fixed one column layout bug of the launcher (hrw) 70 * #1493 - Fixed one column layout bug of the launcher (hrw)
70 * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw) 71 * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw)
71 * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw) 72 * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw)
72 * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl) 73 * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl)
73 74
74 Internal 75 Internal
75 -------- 76 --------
76 * Moved libopie1 to unsupported (mickeyl) 77 * Moved libopie1 to unsupported (mickeyl)
77 * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers) 78 * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers)
78 * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers) 79 * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers)
79 80
80 2004-11-14Opie 1.1.7 81 2004-11-14Opie 1.1.7
81 82
82 New Features 83 New Features
83 ------------ 84 ------------
84 * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers) 85 * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers)
85 * Backup now uses the busy indicator when backing up and restore (ar) 86 * Backup now uses the busy indicator when backing up and restore (ar)
86 * OpiePlayer2 gained adding of Directories to the playlist (zecke) 87 * OpiePlayer2 gained adding of Directories to the playlist (zecke)
87 * OpiePlayer2 better error handling (zecke) 88 * OpiePlayer2 better error handling (zecke)
88 * OpiePlayer2 progress indication while streaming (zecke) 89 * OpiePlayer2 progress indication while streaming (zecke)
89 * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke) 90 * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke)
90 * Ported brightnessapplet from Qtopia 1.7 (mickeyl) 91 * Ported brightnessapplet from Qtopia 1.7 (mickeyl)
91 * Opie-Eye got a Digital Camera File Backend (alwin,zecke) 92 * Opie-Eye got a Digital Camera File Backend (alwin,zecke)
92 * Support for Tuxpad1 of Tradesquare.NL (mickeyl,zecke) 93 * Support for Tuxpad1 of Tradesquare.NL (mickeyl,zecke)
93 * Opie-Console use Custom Font and Size in a Profile (harlekin) 94 * Opie-Console use Custom Font and Size in a Profile (harlekin)
94 * Opie-Console transparently log the Output and Input to a file (harlekin) 95 * Opie-Console transparently log the Output and Input to a file (harlekin)
95 * Added new O-menu icon to lock the PDA immediately: opie-lockapplet (clem) 96 * Added new O-menu icon to lock the PDA immediately: opie-lockapplet (clem)
96 * Opie-Security now hides the plugin-based authentication tabs if no auth. plugin package is installed (clem) 97 * Opie-Security now hides the plugin-based authentication tabs if no auth. plugin package is installed (clem)
97 * Opie-Security gained a 'test authentication' button (clem) 98 * Opie-Security gained a 'test authentication' button (clem)
98 * Opie-Eye got a more unique layout (menubar), a slideshow, user can setup some defaults 99 * Opie-Eye got a more unique layout (menubar), a slideshow, user can setup some defaults
99 * Opie-Mail improve the handling of POP mail boxes (alwin) 100 * Opie-Mail improve the handling of POP mail boxes (alwin)
100 * Both Opie-Eye and Opie-Mail were greatly improved due the hard work of Rajko Albrecht(alwin) 101 * Both Opie-Eye and Opie-Mail were greatly improved due the hard work of Rajko Albrecht(alwin)
101 * Opie IRC - backports of the 'NeIRC fork' (zecke) 102 * Opie IRC - backports of the 'NeIRC fork' (zecke)
102 103
103 Fixed Bugs 104 Fixed Bugs
104 ---------- 105 ----------
105 * #501 - Pickboard is able to show 'Umlaute' (TT,zecke) 106 * #501 - Pickboard is able to show 'Umlaute' (TT,zecke)
106 * #608 - Make Opie usable for left handed users (zecke) 107 * #608 - Make Opie usable for left handed users (zecke)
107 * #957 - Import of VCards/VTodos/VEvents with BASE64 encoding (ljp,zecke) 108 * #957 - Import of VCards/VTodos/VEvents with BASE64 encoding (ljp,zecke)
108 * #1245 - Opie-Go 'paused' (zecke) 109 * #1245 - Opie-Go 'paused' (zecke)
109 * #1358 - DocTab didn't show any MimeTypes (was fixed earlier) (zecke) 110 * #1358 - DocTab didn't show any MimeTypes (was fixed earlier) (zecke)
110 * #1380 - QDateBookAccess::remove() doesn't remove entries (eilers, zecke) 111 * #1380 - QDateBookAccess::remove() doesn't remove entries (eilers, zecke)
111 * #1395 - Build VNC Backend with gcc3.4 112 * #1395 - Build VNC Backend with gcc3.4
112 * #1440 - The icon of opie-mobilemsg is missing (CoreDump) 113 * #1440 - The icon of opie-mobilemsg is missing (CoreDump)
113 * #1426 - Add missing opie-bartender Icon (CoreDump) 114 * #1426 - Add missing opie-bartender Icon (CoreDump)
114 * #1445 - Opie-Sheet Has No Icon (CoreDump) 115 * #1445 - Opie-Sheet Has No Icon (CoreDump)
115 * #1448 - Brightness Applet added (mickeyl) 116 * #1448 - Brightness Applet added (mickeyl)
116 * #1450 - ZSame didn't clear the bonus item after winning a game (zecke) 117 * #1450 - ZSame didn't clear the bonus item after winning a game (zecke)
117 * #1482 - Fix OFileSelector to be able to sort by size (zecke) 118 * #1482 - Fix OFileSelector to be able to sort by size (zecke)
118 * n.a. - Opie-mail: fixed some crasher, some layout-problems 119 * n.a. - Opie-mail: fixed some crasher, some layout-problems
119 * n.a. - Converted applications to not hardcode /opt/QtPalmtop but to use QPEApplication::qpeDir (zecke) 120 * n.a. - Converted applications to not hardcode /opt/QtPalmtop but to use QPEApplication::qpeDir (zecke)
120 * n.a. - Converted usage of qpeDir() not to include a '/' as first charachter of the string (zecke) 121 * n.a. - Converted usage of qpeDir() not to include a '/' as first charachter of the string (zecke)
121 * n.a. - Build system: Enable distcc and ccache when crosscompiling too, and use them everywhere we can (clem) 122 * n.a. - Build system: Enable distcc and ccache when crosscompiling too, and use them everywhere we can (clem)
122 * n.a. - Build system: Fix deps in several config.in (and fix scripts/deps.pl too) to stop breaking builds, especially with make -j highNumber (clem) 123 * n.a. - Build system: Fix deps in several config.in (and fix scripts/deps.pl too) to stop breaking builds, especially with make -j highNumber (clem)
123 * n.a. - Removed hardcoded icon size in a couple of applets (mickeyl) 124 * n.a. - Removed hardcoded icon size in a couple of applets (mickeyl)
124 125
125 Internal 126 Internal
126 -------- 127 --------
127 * Opie-Qashmoney has been moved to unsupported (mickeyl) 128 * Opie-Qashmoney has been moved to unsupported (mickeyl)
128 * Opie-Ubrowser has been moved to unsupported (mickeyl) 129 * Opie-Ubrowser has been moved to unsupported (mickeyl)
129 130
130 2004-09-17Opie 1.1.6 131 2004-09-17Opie 1.1.6
131 132
132 New Features 133 New Features
133 ------------ 134 ------------
134 * Fifteen gained configurable number of items (zecke) 135 * Fifteen gained configurable number of items (zecke)
135 * Fifteen can have custom background images (zecke) 136 * Fifteen can have custom background images (zecke)
136 * Added daemonizing capabilities to QWS Server [via Qt/Embedded] (mickeyl) 137 * Added daemonizing capabilities to QWS Server [via Qt/Embedded] (mickeyl)
137 * Integrated the new security framework into libopie2 (zecke,clem) 138 * Integrated the new security framework into libopie2 (zecke,clem)
138 * Converted the launcher to use the new security framework (zecke) 139 * Converted the launcher to use the new security framework (zecke)
139 * Backup can now handle custom locations for backup and restore (ar) 140 * Backup can now handle custom locations for backup and restore (ar)
140 * Implemented right-on-hold feedback (wimpie,zecke) 141 * Implemented right-on-hold feedback (wimpie,zecke)
141 * Lots of new features in opie-reader (tim,pohly) 142 * Lots of new features in opie-reader (tim,pohly)
142 * Build system cleanups (schurig) 143 * Build system cleanups (schurig)
143 144
144 Fixed Bugs 145 Fixed Bugs
145 -------- 146 --------
146 * #1005 - Fixed backup to CompactFlash (ar) 147 * #1005 - Fixed backup to CompactFlash (ar)
147 * #1167 - Fixed Opie write crashing on more text than one page (ar) 148 * #1167 - Fixed Opie write crashing on more text than one page (ar)
148 * #1225 - Fixed repeated light flashing on Zaurus with keyz (mickeyl) 149 * #1225 - Fixed repeated light flashing on Zaurus with keyz (mickeyl)
149 * #1359 - Fixed bookmarks in Gutenbrowser (ljp) 150 * #1359 - Fixed bookmarks in Gutenbrowser (ljp)
150 * #1361 - Fixed auto upercase in Opie-Addressbook (eilers) 151 * #1361 - Fixed auto upercase in Opie-Addressbook (eilers)
151 * #1370 - Pimconverter now reacts on cancel key (eilers) 152 * #1370 - Pimconverter now reacts on cancel key (eilers)
152 * #1376 - Bring back the capslock/numlock display (zecke) 153 * #1376 - Bring back the capslock/numlock display (zecke)
153 * #1383 - Language settings now warns about losing open apps (Markus Litz) 154 * #1383 - Language settings now warns about losing open apps (Markus Litz)
154 * #1393 - Fixed line wrap issues in opie-console for the default profile (mickeyl) 155 * #1393 - Fixed line wrap issues in opie-console for the default profile (mickeyl)
155 * #1394 - Fixed oversized headline in opie-login (coredump) 156 * #1394 - Fixed oversized headline in opie-login (coredump)
156 * #1396 - Opie-console captures the escape key and vim is working (zecke) 157 * #1396 - Opie-console captures the escape key and vim is working (zecke)
157 * #1401 - Scrollbar is now only visible if necessary in DocTab (mickeyl) 158 * #1401 - Scrollbar is now only visible if necessary in DocTab (mickeyl)
158 159
159 2004-07-06Opie 1.1.4 160 2004-07-06Opie 1.1.4
160 161
161 New Features 162 New Features
162 ------------ 163 ------------
163 * Added four themes courtesy Robert Griebl (http://www.softforge.de/zstyle) 164 * Added four themes courtesy Robert Griebl (http://www.softforge.de/zstyle)
164 * Added Conversion tool for pim-data (eilers) 165 * Added Conversion tool for pim-data (eilers)
165 * Introduced new OPimAccessFactory and OBackendFactory which simplyfies database access (eilers) 166 * Introduced new OPimAccessFactory and OBackendFactory which simplyfies database access (eilers)
166 * Modified the PIM API for providing generic use of OPimRecords (eilers) 167 * Modified the PIM API for providing generic use of OPimRecords (eilers)
167 * Clicking on the application symbol now iterates over the application's top level widgets if already raised (zecke) 168 * Clicking on the application symbol now iterates over the application's top level widgets if already raised (zecke)
168 169
169 Fixed Bugs 170 Fixed Bugs
170 -------- 171 --------
171 * #1068 - Country Drop Down Box Off Screen 172 * #1068 - Country Drop Down Box Off Screen
172 * #1291 - Opie tinykate does not open .desktop files (ar) 173 * #1291 - Opie tinykate does not open .desktop files (ar)
173 * #1291 - Opie sheet not saving correctly (ar) 174 * #1291 - Opie sheet not saving correctly (ar)
174 * #1294 - Opie does not know about British Summer Time 175 * #1294 - Opie does not know about British Summer Time
175 * #1314 - Drawpad initialization (mickeyl) 176 * #1314 - Drawpad initialization (mickeyl)
176 * #1317 - Packagemanager crashes on hold-down or install (chicken) 177 * #1317 - Packagemanager crashes on hold-down or install (chicken)
177 * #1321 - Batteryapplet graphic glitch (harlekin) 178 * #1321 - Batteryapplet graphic glitch (harlekin)
178 * #1324 - ZSafe not starting up (mickeyl) 179 * #1324 - ZSafe not starting up (mickeyl)
179 * #1328 - Personal Home Address fields is trimmed to 1char (eilers) 180 * #1328 - Personal Home Address fields is trimmed to 1char (eilers)
180 * #1327 - Opie-mail ipk does not depend on libopiedb2 (chicken) 181 * #1327 - Opie-mail ipk does not depend on libopiedb2 (chicken)
181 * #1345 - Networksettingsplugin wlan plugin dependency on libpcap0 (mickeyl) 182 * #1345 - Networksettingsplugin wlan plugin dependency on libpcap0 (mickeyl)
182 * #1348 - Datebook dependency on libopiedb2 (chicken) 183 * #1348 - Datebook dependency on libopiedb2 (chicken)
183 * #1328 - Switched SQLDatabase and VCards char encoding from latin1 to unicode (eilers) 184 * #1328 - Switched SQLDatabase and VCards char encoding from latin1 to unicode (eilers)
184 185
185 2004-04-25Opie 1.1.3 186 2004-04-25Opie 1.1.3
186 187
187 * Introduced first implementation of SQL-Support using SQLite (eilers) 188 * Introduced first implementation of SQL-Support using SQLite (eilers)
188 * Added a new Gutenberg Project reader app - opie-gutenbrowser (ljp) 189 * Added a new Gutenberg Project reader app - opie-gutenbrowser (ljp)
189 * Added a real system graffiti character set (brad) 190 * Added a real system graffiti character set (brad)
190 * Added Generic Keyconfig Widget (zecke) 191 * Added Generic Keyconfig Widget (zecke)
191 * Improved Screenshotapplet and Drawpad integration. You can now open a screenshot in drawpad and take notes (zecke) 192 * Improved Screenshotapplet and Drawpad integration. You can now open a screenshot in drawpad and take notes (zecke)
192 * Added new Bible reader app - opie-dagger (drw) 193 * Added new Bible reader app - opie-dagger (drw)
193 * Added a new Image Viewer. Work is ongoing (zecke,alwin) 194 * Added a new Image Viewer. Work is ongoing (zecke,alwin)
194 * Added namespace usage in libopie2 and everywhere (zecke,alwin) 195 * Added namespace usage in libopie2 and everywhere (zecke,alwin)
195 * Enabled the possibility to pass command line arguments to applications (mickeyl) 196 * Enabled the possibility to pass command line arguments to applications (mickeyl)
196 * Added an about applet showing some credits and information about Opie (mickeyl) 197 * Added an about applet showing some credits and information about Opie (mickeyl)
197 * Added benchmarking functionality to sysinfo (mickeyl) 198 * Added benchmarking functionality to sysinfo (mickeyl)
198 * Added applet and configuration application for switching hardware keyboard layouts (alwin) 199 * Added applet and configuration application for switching hardware keyboard layouts (alwin)
199 * Ported applications from libopie1 to libopie2* (drw,ar,alwin) 200 * Ported applications from libopie1 to libopie2* (drw,ar,alwin)
200 * Imported fullscreen and font improvements from the Qkonsole fork to embeddedkonsole (waspe) 201 * Imported fullscreen and font improvements from the Qkonsole fork to embeddedkonsole (waspe)
201 * Clean-up of package information in control files (drw) 202 * Clean-up of package information in control files (drw)
202 * Repaired mediummount which was broken since integrating the quicklauncher (alwin) 203 * Repaired mediummount which was broken since integrating the quicklauncher (alwin)
203 * Improved big-screen support (zecke,ar) 204 * Improved big-screen support (zecke,ar)
204 * Improved multikeyboard support, added keyboard layout switching applet (mouse) 205 * Improved multikeyboard support, added keyboard layout switching applet (mouse)
205 * Added a new mail client based on libetpan (harlekin,alwin,jgf) 206 * Added a new mail client based on libetpan (harlekin,alwin,jgf)
206 * Added new package manager - opie-packagemanager (drw) 207 * Added new package manager - opie-packagemanager (drw)
207 * Improved light-n-power for C7x0 (mickeyl) 208 * Improved light-n-power for C7x0 (mickeyl)
208 * Added automatic rotation support for C7x0 (treke) 209 * Added automatic rotation support for C7x0 (treke)
209 * Split libopie1 up into a set of smaller - functionally grouped - libraries (mickeyl) 210 * Split libopie1 up into a set of smaller - functionally grouped - libraries (mickeyl)
210 * Added scanning the wireless network neighbourhood to networksettings (mickeyl) 211 * Added scanning the wireless network neighbourhood to networksettings (mickeyl)
211 212
212 2003-11-29Opie 1.0.3 213 2003-11-29Opie 1.0.3
213 214
214 * Released as Version 1.0.3 215 * Released as Version 1.0.3
215 * Improved i18n (various contributors) 216 * Improved i18n (various contributors)
216 * Reduced application startup time by integrating the TT quicklauncher (zecke,harlekin) 217 * Reduced application startup time by integrating the TT quicklauncher (zecke,harlekin)
217 * Made the Documents Tab optional (mickeyl) 218 * Made the Documents Tab optional (mickeyl)
218 * Integrated basic support for HP iPAQ 54xx and the Jornada 5xx (chicken) 219 * Integrated basic support for HP iPAQ 54xx and the Jornada 5xx (chicken)
219 220
220 2003-08-04Opie 1.0.0 221 2003-08-04Opie 1.0.0
221 222
222 * Released as Version 1.0.0 223 * Released as Version 1.0.0
223 * Including a PPP module for easy dial up (tille,harlekin,zecke) 224 * Including a PPP module for easy dial up (tille,harlekin,zecke)
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 8928cda..180980a 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -1,767 +1,772 @@
1/* 1/*
2                This file is part of the Opie Project 2                This file is part of the Opie Project
3 =. 3 =.
4             .=l. Copyright (c) 2002-2004 The Opie Team <opie-devel@handhelds.org> 4             .=l. Copyright (c) 2002-2004 The Opie Team <opie-devel@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "backuprestore.h" 29#include "backuprestore.h"
30#include "errordialog.h" 30#include "errordialog.h"
31 31
32/* OPIE */ 32/* OPIE */
33#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
34#include <qpe/resource.h> 34#include <qpe/resource.h>
35#include <qpe/config.h> 35#include <qpe/config.h>
36#include <opie2/odebug.h> 36#include <opie2/odebug.h>
37#include <opie2/odevice.h> 37#include <opie2/odevice.h>
38#include <opie2/ostorageinfo.h> 38#include <opie2/ostorageinfo.h>
39#include <opie2/ofiledialog.h> 39#include <opie2/ofiledialog.h>
40#include <opie2/owait.h> 40#include <opie2/owait.h>
41using namespace Opie::Core; 41using namespace Opie::Core;
42using namespace Opie::Ui; 42using namespace Opie::Ui;
43 43
44/* QT */ 44/* QT */
45#include <qapplication.h> 45#include <qapplication.h>
46#include <qmultilineedit.h> 46#include <qmultilineedit.h>
47#include <qdir.h> 47#include <qdir.h>
48#include <qfile.h> 48#include <qfile.h>
49#include <qfileinfo.h> 49#include <qfileinfo.h>
50#include <qlistview.h> 50#include <qlistview.h>
51#include <qpushbutton.h> 51#include <qpushbutton.h>
52#include <qradiobutton.h> 52#include <qradiobutton.h>
53#include <qheader.h> 53#include <qheader.h>
54#include <qmessagebox.h> 54#include <qmessagebox.h>
55#include <qcombobox.h> 55#include <qcombobox.h>
56#include <qlist.h> 56#include <qlist.h>
57#include <qregexp.h> 57#include <qregexp.h>
58#include <qtextstream.h> 58#include <qtextstream.h>
59#include <qtextview.h> 59#include <qtextview.h>
60#include <qlineedit.h> 60#include <qlineedit.h>
61#include <qstringlist.h> 61#include <qstringlist.h>
62 62
63/* STD */ 63/* STD */
64#include <errno.h> 64#include <errno.h>
65#include <stdlib.h> 65#include <stdlib.h>
66#include <unistd.h> 66#include <unistd.h>
67#include <sys/stat.h> 67#include <sys/stat.h>
68#include <dirent.h> 68#include <dirent.h>
69 69
70#define HEADER_NAME 0 70#define HEADER_NAME 0
71#define HEADER_BACKUP 1 71#define HEADER_BACKUP 1
72#define BACKUP_LOCATION 2 72#define BACKUP_LOCATION 2
73 73
74#define EXTENSION ".bck" 74#define EXTENSION ".bck"
75 75
76const QString tempFileName = "/tmp/backup.err"; 76const QString tempFileName = "/tmp/backup.err";
77 77
78BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) 78BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl)
79 : BackupAndRestoreBase(parent, name, fl) 79 : BackupAndRestoreBase(parent, name, fl)
80{ 80{
81 backupList->header()->hide(); 81 backupList->header()->hide();
82 restoreList->header()->hide(); 82 restoreList->header()->hide();
83 locationList->header()->hide(); 83 locationList->header()->hide();
84 connect( backupButton, SIGNAL( clicked() ), this, SLOT( backup() ) ); 84 connect( backupButton, SIGNAL( clicked() ), this, SLOT( backup() ) );
85 connect( restoreButton, SIGNAL( clicked() ), this, SLOT( restore() ) ); 85 connect( restoreButton, SIGNAL( clicked() ), this, SLOT( restore() ) );
86 connect( backupList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectItem( QListViewItem* ) ) ); 86 connect( backupList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectItem( QListViewItem* ) ) );
87 connect( restoreSource, SIGNAL( activated( int ) ), this, SLOT( sourceDirChanged( int ) ) ); 87 connect( restoreSource, SIGNAL( activated( int ) ), this, SLOT( sourceDirChanged( int ) ) );
88 connect( addLocationButton, SIGNAL( clicked() ), this, SLOT( addLocation() ) ); 88 connect( addLocationButton, SIGNAL( clicked() ), this, SLOT( addLocation() ) );
89 connect( removeLocationButton, SIGNAL( clicked() ), this, SLOT( removeLocation() ) ); 89 connect( removeLocationButton, SIGNAL( clicked() ), this, SLOT( removeLocation() ) );
90 connect( selectLocationButton, SIGNAL( clicked() ), this, SLOT( selectLocation() ) ); 90 connect( selectLocationButton, SIGNAL( clicked() ), this, SLOT( selectLocation() ) );
91 91
92 //add directorys for backing up 92 //add directorys for backing up
93 applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); 93 applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/");
94 selectItem(applicationSettings); 94 selectItem(applicationSettings);
95 applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); 95 applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/");
96 selectItem(applicationSettings); 96 selectItem(applicationSettings);
97 documents= new QListViewItem(backupList, "Documents", "", "Documents/"); 97 documents= new QListViewItem(backupList, "Documents", "", "Documents/");
98 selectItem(documents); 98 selectItem(documents);
99 99
100 scanForApplicationSettings(); 100 scanForApplicationSettings();
101 refreshLocations(); 101 refreshLocations();
102 refreshBackupLocations(); 102 refreshBackupLocations();
103 103
104 // Read the list of items to ignore. 104 // Read the list of items to ignore.
105 QList<QString> dontBackupList; 105 QList<QString> dontBackupList;
106 dontBackupList.setAutoDelete(true); 106 dontBackupList.setAutoDelete(true);
107 Config config("BackupAndRestore"); 107 Config config("BackupAndRestore");
108 config.setGroup("DontBackup"); 108 config.setGroup("DontBackup");
109 int total = config.readNumEntry("Total", 0); 109 int total = config.readNumEntry("Total", 0);
110 for(int i = 0; i < total; i++) 110 for(int i = 0; i < total; i++)
111 { 111 {
112 dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), ""))); 112 dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), "")));
113 } 113 }
114 114
115 QList<QListViewItem> list; 115 QList<QListViewItem> list;
116 getAllItems(backupList->firstChild(), list); 116 getAllItems(backupList->firstChild(), list);
117 117
118 for(uint i = 0; i < list.count(); i++) 118 for(uint i = 0; i < list.count(); i++)
119 { 119 {
120 QString text = list.at(i)->text(HEADER_NAME); 120 QString text = list.at(i)->text(HEADER_NAME);
121 for(uint i2 = 0; i2 < dontBackupList.count(); i2++) 121 for(uint i2 = 0; i2 < dontBackupList.count(); i2++)
122 { 122 {
123 if(*dontBackupList.at(i2) == text) 123 if(*dontBackupList.at(i2) == text)
124 { 124 {
125 selectItem(list.at(i)); 125 selectItem(list.at(i));
126 break; 126 break;
127 } 127 }
128 } 128 }
129 } 129 }
130 QPEApplication::showWidget( this ); 130 QPEApplication::showWidget( this );
131} 131}
132 132
133BackupAndRestore::~BackupAndRestore() 133BackupAndRestore::~BackupAndRestore()
134{ 134{
135 QList<QListViewItem> list; 135 QList<QListViewItem> list;
136 getAllItems(backupList->firstChild(), list); 136 getAllItems(backupList->firstChild(), list);
137 137
138 Config config("BackupAndRestore"); 138 Config config("BackupAndRestore");
139 config.setGroup("DontBackup"); 139 config.setGroup("DontBackup");
140 config.clearGroup(); 140 config.clearGroup();
141 141
142 int count = 0; 142 int count = 0;
143 for(uint i = 0; i < list.count(); i++) 143 for(uint i = 0; i < list.count(); i++)
144 { 144 {
145 if(list.at(i)->text(HEADER_BACKUP) == "") 145 if(list.at(i)->text(HEADER_BACKUP) == "")
146 { 146 {
147 config.writeEntry(QString("%1").arg(count), list.at(i)->text(HEADER_NAME)); 147 config.writeEntry(QString("%1").arg(count), list.at(i)->text(HEADER_NAME));
148 count++; 148 count++;
149 } 149 }
150 } 150 }
151 config.writeEntry("Total", count); 151 config.writeEntry("Total", count);
152 152
153 // Remove Temp File 153 // Remove Temp File
154 if ( QFile::exists( tempFileName ) ) 154 if ( QFile::exists( tempFileName ) )
155 QFile::remove( tempFileName ); 155 QFile::remove( tempFileName );
156} 156}
157 157
158void BackupAndRestore::refreshBackupLocations() 158void BackupAndRestore::refreshBackupLocations()
159{ 159{
160 backupLocations.clear(); 160 backupLocations.clear();
161 // Add cards 161 // Add cards
162 Opie::Core::OStorageInfo storage; 162 Opie::Core::OStorageInfo storage;
163 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" ); 163 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" );
164 if ( storage.hasCf() ) 164 if ( storage.hasCf() )
165 { 165 {
166 backupLocations.insert( "CF", storage.cfPath() ); 166 backupLocations.insert( "CF", storage.cfPath() );
167 odebug << "Cf Path: " + storage.cfPath() << oendl; 167 odebug << "Cf Path: " + storage.cfPath() << oendl;
168 } 168 }
169 if ( storage.hasSd() ) 169 if ( storage.hasSd() )
170 { 170 {
171 backupLocations.insert( "SD", storage.sdPath() ); 171 backupLocations.insert( "SD", storage.sdPath() );
172 odebug << " Sd Path: " + storage.sdPath() << oendl; 172 odebug << " Sd Path: " + storage.sdPath() << oendl;
173 } 173 }
174 if ( storage.hasMmc() ) 174 if ( storage.hasMmc() )
175 { 175 {
176 backupLocations.insert( "MMC", storage.mmcPath() ); 176 backupLocations.insert( "MMC", storage.mmcPath() );
177 odebug << "Mmc Path: " + storage.mmcPath() << oendl; 177 odebug << "Mmc Path: " + storage.mmcPath() << oendl;
178 } 178 }
179 179
180 for ( QListViewItemIterator it( locationList ); it.current(); ++it ) 180 for ( QListViewItemIterator it( locationList ); it.current(); ++it )
181 { 181 {
182 backupLocations.insert( it.current()->text( 0 ), it.current()->text( 0 ) ); 182 backupLocations.insert( it.current()->text( 0 ), it.current()->text( 0 ) );
183 } 183 }
184 184
185 //update QComboBox 185 //update QComboBox
186 storeToLocation->clear(); 186 storeToLocation->clear();
187 restoreSource->clear(); 187 restoreSource->clear();
188 188
189 //read last locations 189 //read last locations
190 Config config("BackupAndRestore"); 190 Config config("BackupAndRestore");
191 config.setGroup("LastLocation"); 191 config.setGroup("LastLocation");
192 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" ); 192 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" );
193 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" ); 193 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" );
194 int locationIndex = 0; 194 int locationIndex = 0;
195 195
196 //fill QComboBox 196 //fill QComboBox
197 QMap<QString, QString>::Iterator it; 197 QMap<QString, QString>::Iterator it;
198 for( it = backupLocations.begin(); it != backupLocations.end(); ++it ) 198 for( it = backupLocations.begin(); it != backupLocations.end(); ++it )
199 { 199 {
200 storeToLocation->insertItem(it.key()); 200 storeToLocation->insertItem(it.key());
201 restoreSource->insertItem(it.key()); 201 restoreSource->insertItem(it.key());
202 202
203 //check for last locations 203 //check for last locations
204 if ( it.key() == lastStoreLocation ) 204 if ( it.key() == lastStoreLocation )
205 storeToLocation->setCurrentItem( locationIndex ); 205 storeToLocation->setCurrentItem( locationIndex );
206 if ( it.key() == lastRestoreLocation ) 206 if ( it.key() == lastRestoreLocation )
207 restoreSource->setCurrentItem( locationIndex ); 207 restoreSource->setCurrentItem( locationIndex );
208 locationIndex++; 208 locationIndex++;
209 } 209 }
210} 210}
211 211
212QList<QListViewItem> BackupAndRestore::getAllItems(QListViewItem *item, QList<QListViewItem> &list) 212QList<QListViewItem> BackupAndRestore::getAllItems(QListViewItem *item, QList<QListViewItem> &list)
213{ 213{
214 while(item) 214 while(item)
215 { 215 {
216 if(item->childCount() > 0) 216 if(item->childCount() > 0)
217 getAllItems(item->firstChild(), list); 217 getAllItems(item->firstChild(), list);
218 list.append(item); 218 list.append(item);
219 item = item->nextSibling(); 219 item = item->nextSibling();
220 } 220 }
221 return list; 221 return list;
222} 222}
223 223
224/** 224/**
225 * Selects and unselects the item by setting the HEADER_BACKUP to B or !. 225 * Selects and unselects the item by setting the HEADER_BACKUP to B or !.
226 * and changing the icon to match 226 * and changing the icon to match
227 * @param currentItem the item to swich the selection choice. 227 * @param currentItem the item to swich the selection choice.
228 */ 228 */
229void BackupAndRestore::selectItem(QListViewItem *currentItem) 229void BackupAndRestore::selectItem(QListViewItem *currentItem)
230{ 230{
231 if(!currentItem) 231 if(!currentItem)
232 return; 232 return;
233 233
234 if(currentItem->text(HEADER_BACKUP) == "B") 234 if(currentItem->text(HEADER_BACKUP) == "B")
235 { 235 {
236 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/null")); 236 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/null"));
237 currentItem->setText(HEADER_BACKUP, ""); 237 currentItem->setText(HEADER_BACKUP, "");
238 } 238 }
239 else 239 else
240 { 240 {
241 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/check")); 241 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/check"));
242 currentItem->setText(HEADER_BACKUP, "B"); 242 currentItem->setText(HEADER_BACKUP, "B");
243 } 243 }
244} 244}
245 245
246void BackupAndRestore::scanForApplicationSettings() 246void BackupAndRestore::scanForApplicationSettings()
247{ 247{
248 QDir d( QDir::homeDirPath() + "/" + QString( applicationSettings->text(BACKUP_LOCATION) ) ); 248 QDir d( QDir::homeDirPath() + "/" + QString( applicationSettings->text(BACKUP_LOCATION) ) );
249 d.setFilter( QDir::Dirs | QDir::Files | QDir::NoSymLinks ); 249 d.setFilter( QDir::Dirs | QDir::Files | QDir::NoSymLinks );
250 const QFileInfoList *list = d.entryInfoList(); 250 const QFileInfoList *list = d.entryInfoList();
251 QFileInfoListIterator it( *list ); 251 QFileInfoListIterator it( *list );
252 QFileInfo *fi; 252 QFileInfo *fi;
253 while ( (fi=it.current()) ) 253 while ( (fi=it.current()) )
254 { 254 {
255 //odebug << (d.path()+"/"+fi->fileName()).latin1() << oendl; 255 //odebug << (d.path()+"/"+fi->fileName()).latin1() << oendl;
256 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) ) 256 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) )
257 { 257 {
258 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName()); 258 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName());
259 selectItem(newItem); 259 selectItem(newItem);
260 } 260 }
261 ++it; 261 ++it;
262 } 262 }
263} 263}
264 264
265/** 265/**
266 * The "Backup" button has been pressed. Get a list of all of the files that 266 * The "Backup" button has been pressed. Get a list of all of the files that
267 * should be backed up. If there are no files, emit and error and exit. 267 * should be backed up. If there are no files, emit and error and exit.
268 * Determine the file name to store the backup in. Backup the file(s) using 268 * Determine the file name to store the backup in. Backup the file(s) using
269 * tar and gzip --best. Report failure or success 269 * tar and gzip --best. Report failure or success
270 */ 270 */
271void BackupAndRestore::backup() 271void BackupAndRestore::backup()
272{ 272{
273 if ( cb_type_userdata->isChecked() ) 273 if ( cb_type_userdata->isChecked() )
274 backupUserData(); 274 backupUserData();
275 else 275 else
276 backupRootFs(); 276 backupRootFs();
277} 277}
278 278
279 279
280void BackupAndRestore::backupRootFs() 280void BackupAndRestore::backupRootFs()
281{ 281{
282 if ( ( ODevice::inst()->model() != Model_Zaurus_SL5000 ) && ( ODevice::inst()->model() != Model_Zaurus_SL5500 ) ) 282 if ( ( ODevice::inst()->model() != Model_Zaurus_SL5000 ) && ( ODevice::inst()->model() != Model_Zaurus_SL5500 ) )
283 { 283 {
284 QMessageBox::critical( this, "Not yet implemented!", "<qt>Sorry, support for this model is not yet done.</qt>", "Ok" ); 284 QMessageBox::critical( this, "Not yet implemented!", "<qt>Sorry, support for this model is not yet done.</qt>", "Ok" );
285 return; 285 return;
286 } 286 }
287 287
288 if ( !QFile::exists( "/usr/bin/mkfs.jffs2" ) && !QFile::exists( "/usr/sbin/mkfs.jffs2" ) ) 288 if ( !QFile::exists( "/usr/bin/mkfs.jffs2" ) && !QFile::exists( "/usr/sbin/mkfs.jffs2" ) )
289 { 289 {
290 QMessageBox::critical( this, "Can't find utility!", "<qt>Can't find mkfs.jffs2 - Install mtd-utils.</qt>", "Ok" ); 290 QMessageBox::critical( this, "Can't find utility!", "<qt>Can't find mkfs.jffs2 - Install mtd-utils.</qt>", "Ok" );
291 return; 291 return;
292 } 292 }
293 293
294 // call 'mount' and parse its output to gather the device on which the root partition is mounted 294 // call 'mount' and parse its output to gather the device on which the root partition is mounted
295 FILE* mountp = popen( "mount", "r" ); 295 FILE* mountp = popen( "mount", "r" );
296 QString device; 296 QString device;
297 QString mountpoint; 297 QString mountpoint;
298 { 298 {
299 QTextStream mounto( mountp, IO_ReadOnly ); 299 QTextStream mounto( mountp, IO_ReadOnly );
300 QString on; 300 QString on;
301 QString type; 301 QString type;
302 QString filesystem; 302 QString filesystem;
303 QString options; 303 QString options;
304 while ( !mounto.atEnd() ) 304 while ( !mounto.atEnd() )
305 { 305 {
306 mounto >> device >> on >> mountpoint >> type >> filesystem >> options; 306 mounto >> device >> on >> mountpoint >> type >> filesystem >> options;
307 if ( mountpoint == "/" ) break; 307 if ( mountpoint == "/" ) break;
308 } 308 }
309 odebug << device << " is formatted w/ '" << filesystem << "' and mounted on '" << mountpoint << "'" << oendl; 309 odebug << device << " is formatted w/ '" << filesystem << "' and mounted on '" << mountpoint << "'" << oendl;
310 310
311 if ( !device.startsWith( "/dev/mtdblock" ) ) 311 if ( !device.startsWith( "/dev/mtdblock" ) )
312 { 312 {
313 QMessageBox::critical( this, "Can't backup!", QString( "<qt>unsupported root device '%1' - needs to be /dev/mtdblockN</qt>").arg( device ), "Ok" ); 313 QMessageBox::critical( this, "Can't backup!", QString( "<qt>unsupported root device '%1' - needs to be /dev/mtdblockN</qt>").arg( device ), "Ok" );
314 return; 314 return;
315 } 315 }
316 } // at this point, the QTextStream has been destroy and we can close the FILE* 316 } // at this point, the QTextStream has been destroy and we can close the FILE*
317 pclose( mountp ); 317 pclose( mountp );
318 318
319#if 1 319#if 1
320 int rootmtd = device.right( 1 ).toInt(); 320 int rootmtd = device.right( 1 ).toInt();
321#else 321#else
322 int rootmtd = 0; 322 int rootmtd = 0;
323#endif 323#endif
324 odebug << "root mtdblock seems to be '" << rootmtd << "'" << oendl; 324 odebug << "root mtdblock seems to be '" << rootmtd << "'" << oendl;
325 325
326 // scan /proc/mtd to gather the size and erasesize of the root mtdblock 326 // scan /proc/mtd to gather the size and erasesize of the root mtdblock
327 QFile procmtdf( "/proc/mtd" ); 327 QFile procmtdf( "/proc/mtd" );
328 if ( !procmtdf.open( IO_ReadOnly ) ) 328 if ( !procmtdf.open( IO_ReadOnly ) )
329 { 329 {
330 QMessageBox::critical( this, "Can't backup!", "<qt>Can't open /proc/mtd</qt>", "Ok" ); 330 QMessageBox::critical( this, "Can't backup!", "<qt>Can't open /proc/mtd</qt>", "Ok" );
331 return; 331 return;
332 } 332 }
333 333
334 QTextStream procmtd( &procmtdf ); 334 QTextStream procmtd( &procmtdf );
335 for ( int i = 0; i <= rootmtd; ++i ) procmtd.readLine(); // skip uninteresting things 335 for ( int i = 0; i <= rootmtd; ++i ) procmtd.readLine(); // skip uninteresting things
336 QString dev; 336 QString dev;
337 QString size; 337 QString size;
338 QString erasesize; 338 QString erasesize;
339 QString devname; 339 QString devname;
340 procmtd >> dev >> size >> erasesize >> devname; 340 procmtd >> dev >> size >> erasesize >> devname;
341 341
342 odebug << "device " << dev << " size = " << size << ", erase size = " << erasesize << ", name = " << devname << "\"" << oendl; 342 odebug << "device " << dev << " size = " << size << ", erase size = " << erasesize << ", name = " << devname << "\"" << oendl;
343 343
344 // compute pad 344 // compute pad
345 QString pad = "--pad"; 345 QString pad = "--pad";
346 switch ( ODevice::inst()->model() ) 346 switch ( ODevice::inst()->model() )
347 { 347 {
348 case Model_Zaurus_SL5000: pad = "--pad=14680064"; break; 348 case Model_Zaurus_SL5000: pad = "--pad=14680064"; break;
349 case Model_Zaurus_SL5500: pad = "--pad=14680064"; break; 349 case Model_Zaurus_SL5500: pad = "--pad=14680064"; break;
350 // FIXME: Add Beagle and SIMpad 350 // FIXME: Add Beagle and SIMpad
351 } 351 }
352 352
353 // compute eraseblock 353 // compute eraseblock
354 QString eraseblock = "--eraseblock=0x" + erasesize; 354 QString eraseblock = "--eraseblock=0x" + erasesize;
355 355
356 // compute output 356 // compute output
357 QString outputFile = "--output=" + backupLocations[storeToLocation->currentText()]; 357 QString outputFile = "--output=" + backupLocations[storeToLocation->currentText()];
358 QDateTime datetime = QDateTime::currentDateTime(); 358 QDateTime datetime = QDateTime::currentDateTime();
359 QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') + 359 QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') +
360 QString::number( datetime.date().day() ).rightJustify(2, '0'); 360 QString::number( datetime.date().day() ).rightJustify(2, '0');
361 outputFile += "/initrd.bin-" + dateString; 361 outputFile += "/initrd.bin-" + dateString;
362 362
363 // call mkfs.jffs2 to create the backup 363 // call mkfs.jffs2 to create the backup
364 QString cmdline = QString( "mkfs.jffs2 --faketime --root=/ %1 --little-endian %2 %3 -n" ).arg( outputFile ).arg( pad ).arg( eraseblock ); 364 QString cmdline = QString( "mkfs.jffs2 --faketime --root=/ %1 --little-endian %2 %3 -n" ).arg( outputFile ).arg( pad ).arg( eraseblock );
365 cmdline.append( " --ignore=/tmp --ignore=/mnt --ignore=/var --ignore=/proc" ); 365 cmdline.append( " --ignore=/tmp --ignore=/mnt --ignore=/var --ignore=/proc" );
366 owarn << "Calling '" << cmdline << "'" << oendl; 366 owarn << "Calling '" << cmdline << "'" << oendl;
367 367
368 OWait *owait = new OWait(); 368 OWait *owait = new OWait();
369 Global::statusMessage( tr( "Backing up..." ) ); 369 Global::statusMessage( tr( "Backing up..." ) );
370 owait->show(); 370 owait->show();
371 qApp->processEvents(); 371 qApp->processEvents();
372 372
373 int r = ::system( cmdline ); 373 int r = ::system( cmdline );
374 374
375 owait->hide(); 375 owait->hide();
376 delete owait; 376 delete owait;
377 377
378 if ( r != 0 ) 378 if ( r != 0 )
379 { 379 {
380 perror("Error: "); 380 perror("Error: ");
381 QString errorMsg = QString( tr( "<qt>%1</qt>" ).arg( strerror( errno ) ) ); 381 QString errorMsg = QString( tr( "<qt>%1</qt>" ).arg( strerror( errno ) ) );
382 QMessageBox::critical(this, tr( "Backup Failed!" ), errorMsg, QString( tr( "Ok" ) ) ); 382 QMessageBox::critical(this, tr( "Backup Failed!" ), errorMsg, QString( tr( "Ok" ) ) );
383 } 383 }
384 384
385 // FIXME: Add image postprocessing for C7x0 and C8x0, for Beagle, for SIMpad 385 // FIXME: Add image postprocessing for C7x0 and C8x0, for Beagle, for SIMpad
386} 386}
387 387
388void BackupAndRestore::backupUserData() 388void BackupAndRestore::backupUserData()
389{ 389{
390 QString backupFiles; 390 QString backupFiles;
391 if(getBackupFiles(backupFiles, NULL) == 0) 391 if(getBackupFiles(backupFiles, NULL) == 0)
392 { 392 {
393 QMessageBox::critical(this, "Message", 393 QMessageBox::critical(this, "Message",
394 "No items selected.",QString("Ok") ); 394 "No items selected.",QString("Ok") );
395 return; 395 return;
396 } 396 }
397 397
398 OWait *owait = new OWait(); 398 OWait *owait = new OWait();
399 Global::statusMessage( tr( "Backing up..." ) ); 399 Global::statusMessage( tr( "Backing up..." ) );
400 owait->show(); 400 owait->show();
401 qApp->processEvents(); 401 qApp->processEvents();
402 402
403 QString outputFile = backupLocations[storeToLocation->currentText()]; 403 QString outputFile = backupLocations[storeToLocation->currentText()];
404 404
405 QDateTime datetime = QDateTime::currentDateTime(); 405 QDateTime datetime = QDateTime::currentDateTime();
406 QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') + 406 QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') +
407 QString::number( datetime.date().day() ).rightJustify(2, '0'); 407 QString::number( datetime.date().day() ).rightJustify(2, '0');
408 408
409 outputFile += "/" + dateString; 409 outputFile += "/" + dateString;
410 410
411 QString t = outputFile; 411 QString t = outputFile;
412 int c = 1; 412 int c = 1;
413 while(QFile::exists(outputFile + EXTENSION)) 413 while(QFile::exists(outputFile + EXTENSION))
414 { 414 {
415 outputFile = t + QString("%1").arg(c); 415 outputFile = t + QString("%1").arg(c);
416 c++; 416 c++;
417 } 417 }
418 418
419 // We execute tar and compressing its output with gzip.. 419 // We execute tar and compressing its output with gzip..
420 // The error output will be written into a temp-file which could be provided 420 // The error output will be written into a temp-file which could be provided
421 // for debugging.. 421 // for debugging..
422 odebug << "Storing file: " << outputFile.latin1() << "" << oendl; 422 odebug << "Storing file: " << outputFile.latin1() << "" << oendl;
423 outputFile += EXTENSION; 423 outputFile += EXTENSION;
424 424
425 QString commandLine = QString( "cd %1 && (tar -X %1 -cz %2 Applications/backup/exclude -f %3 ) 2> %4" ).arg( QDir::homeDirPath() ) 425 QString commandLine = QString( "cd %1 && (tar -X %1 -cz %2 Applications/backup/exclude -f %3 ) 2> %4" ).arg( QDir::homeDirPath() )
426 .arg( getExcludeFile() ) 426 .arg( getExcludeFile() )
427 .arg( backupFiles ) 427 .arg( backupFiles )
428 .arg( outputFile.latin1() ) 428 .arg( outputFile.latin1() )
429 .arg( tempFileName.latin1() ); 429 .arg( tempFileName.latin1() );
430 430
431 odebug << commandLine << oendl; 431 odebug << commandLine << oendl;
432 432
433 int r = system( commandLine ); 433 int r = system( commandLine );
434 434
435 owait->hide(); 435 owait->hide();
436 delete owait; 436 delete owait;
437 437
438 //Error-Handling 438 //Error-Handling
439 if(r != 0) 439 if(r != 0)
440 { 440 {
441 perror("Error: "); 441 perror("Error: ");
442 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); 442 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
443 443
444 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n" 444 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n"
445 + errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) ) 445 + errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) )
446 { 446 {
447 447
448 case 1: 448 case 1:
449 owarn << "Details pressed !" << oendl; 449 owarn << "Details pressed !" << oendl;
450 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); 450 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
451 QFile errorFile( tempFileName ); 451 QFile errorFile( tempFileName );
452 if ( errorFile.open(IO_ReadOnly) ) 452 if ( errorFile.open(IO_ReadOnly) )
453 { 453 {
454 QTextStream t( &errorFile ); 454 QTextStream t( &errorFile );
455 QString s; 455 QString s;
456 while ( !t.eof() ) 456 while ( !t.eof() )
457 { // until end of file... 457 { // until end of file...
458 s += t.readLine(); // line of text excluding '\n' 458 s += t.readLine(); // line of text excluding '\n'
459 } 459 }
460 errorFile.close(); 460 errorFile.close();
461 461
462 pErrDialog->m_textarea->setText( s ); 462 pErrDialog->m_textarea->setText( s );
463 } 463 }
464 else 464 else
465 { 465 {
466 pErrDialog->m_textarea->setText( "Unable to open File: /tmp/backup.er" ); 466 pErrDialog->m_textarea->setText( "Unable to open File: /tmp/backup.er" );
467 } 467 }
468 QPEApplication::execDialog( pErrDialog ); 468 QPEApplication::execDialog( pErrDialog );
469 delete pErrDialog; 469 delete pErrDialog;
470 break; 470 break;
471 } 471 }
472 setCaption(tr("Backup and Restore.. Failed !!")); 472 setCaption(tr("Backup and Restore.. Failed !!"));
473 return; 473 return;
474 } 474 }
475 else 475 else
476 { 476 {
477 QMessageBox::information(this, tr( "Message" ), tr( "Backup Successful." ), QString(tr( "Ok" ) ) ); 477 QMessageBox::information(this, tr( "Message" ), tr( "Backup Successful." ), QString(tr( "Ok" ) ) );
478 } 478 }
479 479
480 //write store-location 480 //write store-location
481 Config config( "BackupAndRestore" ); 481 Config config( "BackupAndRestore" );
482 config.setGroup( "LastLocation" ); 482 config.setGroup( "LastLocation" );
483 config.writeEntry( "LastStoreLocation", storeToLocation->currentText() ); 483 config.writeEntry( "LastStoreLocation", storeToLocation->currentText() );
484 484
485 setCaption(tr("Backup and Restore")); 485 setCaption(tr("Backup and Restore"));
486} 486}
487 487
488/*** 488/***
489 * Get a list of all of the files to backup. 489 * Get a list of all of the files to backup.
490 */ 490 */
491int BackupAndRestore::getBackupFiles(QString &backupFiles, QListViewItem *parent) 491int BackupAndRestore::getBackupFiles(QString &backupFiles, QListViewItem *parent)
492{ 492{
493 QListViewItem * currentItem; 493 QListViewItem * currentItem;
494 QString currentHome; 494 QString currentHome;
495 if(!parent) 495 if(!parent)
496 currentItem = backupList->firstChild(); 496 currentItem = backupList->firstChild();
497 else 497 else
498 { 498 {
499 currentItem = parent->firstChild(); 499 currentItem = parent->firstChild();
500 currentHome = parent->text(BACKUP_LOCATION); 500 currentHome = parent->text(BACKUP_LOCATION);
501 } 501 }
502 502
503 uint count = 0; 503 uint count = 0;
504 while( currentItem != 0 ) 504 while( currentItem != 0 )
505 { 505 {
506 if(currentItem->text(HEADER_BACKUP) == "B" ) 506 if(currentItem->text(HEADER_BACKUP) == "B" )
507 { 507 {
508 if(currentItem->childCount() == 0 ) 508 if(currentItem->childCount() == 0 )
509 { 509 {
510 if(parent == NULL) 510 if(parent == NULL)
511 backupFiles += currentItem->text(BACKUP_LOCATION); 511 backupFiles += currentItem->text(BACKUP_LOCATION);
512 else 512 else
513 backupFiles += currentHome + currentItem->text(HEADER_NAME); 513 backupFiles += currentHome + currentItem->text(HEADER_NAME);
514 backupFiles += " "; 514 backupFiles += " ";
515 count++; 515 count++;
516 } 516 }
517 else 517 else
518 { 518 {
519 count += getBackupFiles(backupFiles, currentItem); 519 count += getBackupFiles(backupFiles, currentItem);
520 } 520 }
521 } 521 }
522 currentItem = currentItem->nextSibling(); 522 currentItem = currentItem->nextSibling();
523 } 523 }
524 return count; 524 return count;
525} 525}
526 526
527void BackupAndRestore::sourceDirChanged(int selection) 527void BackupAndRestore::sourceDirChanged(int selection)
528{ 528{
529 restoreList->clear(); 529 restoreList->clear();
530 rescanFolder(backupLocations[restoreSource->text(selection)]); 530 rescanFolder(backupLocations[restoreSource->text(selection)]);
531} 531}
532 532
533void BackupAndRestore::fileListUpdate() 533void BackupAndRestore::fileListUpdate()
534{ 534{
535 owarn << "void BackupAndRestore::fileListUpdate()" << oendl; 535 owarn << "void BackupAndRestore::fileListUpdate()" << oendl;
536 restoreList->clear(); 536 restoreList->clear();
537 rescanFolder( backupLocations[restoreSource->currentText()] ); 537 rescanFolder( backupLocations[restoreSource->currentText()] );
538} 538}
539 539
540/** 540/**
541 * Scans directory for any backup files. Will recursivly go down, 541 * Scans directory for any backup files. Will recursivly go down,
542 * but will not follow symlinks. 542 * but will not follow symlinks.
543 * @param directory - the directory to look in. 543 * @param directory - the directory to look in.
544 */ 544 */
545void BackupAndRestore::rescanFolder(QString directory) 545void BackupAndRestore::rescanFolder(QString directory)
546{ 546{
547 //odebug << QString("rescanFolder: ") + directory.latin1() << oendl; 547 //odebug << QString("rescanFolder: ") + directory.latin1() << oendl;
548 QDir d(directory); 548 QDir d(directory);
549 if(!d.exists()) 549 if(!d.exists())
550 return; 550 return;
551 551
552 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs); 552 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs);
553 const QFileInfoList *list = d.entryInfoList(); 553 const QFileInfoList *list = d.entryInfoList();
554 QFileInfoListIterator it( *list ); 554 QFileInfoListIterator it( *list );
555 QFileInfo *file; 555 QFileInfo *file;
556 while ( (file=it.current()) ) 556 while ( (file=it.current()) )
557 { // for each file... 557 { // for each file...
558 // If it is a dir and not .. or . then add it as a tab and go down. 558 // If it is a dir and not .. or . then add it as a tab and go down.
559 if(file->isDir()) 559 if(file->isDir())
560 { 560 {
561 if(file->fileName() != ".." && file->fileName() != ".") 561 if(file->fileName() != ".." && file->fileName() != ".")
562 { 562 {
563 rescanFolder(directory + "/" + file->fileName()); 563 rescanFolder(directory + "/" + file->fileName());
564 } 564 }
565 } 565 }
566 else 566 else
567 { 567 {
568 // If it is a backup file add to list. 568 // If it is a backup file add to list.
569 if(file->fileName().contains(EXTENSION)) 569 if(file->fileName().contains(EXTENSION))
570 (void)new QListViewItem(restoreList, file->fileName()); 570 (void)new QListViewItem(restoreList, file->fileName());
571 } 571 }
572 ++it; 572 ++it;
573 } 573 }
574} 574}
575 575
576/** 576/**
577 * Restore a backup file. 577 * Restore a backup file.
578 * Report errors or success 578 * Report errors or success
579 */ 579 */
580void BackupAndRestore::restore() 580void BackupAndRestore::restore()
581{ 581{
582 QListViewItem *restoreItem = restoreList->currentItem(); 582 QListViewItem *restoreItem = restoreList->currentItem();
583 if(!restoreItem) 583 if(!restoreItem)
584 { 584 {
585 QMessageBox::critical(this, tr( "Message" ), 585 QMessageBox::critical(this, tr( "Message" ),
586 tr( "Please select something to restore." ),QString( tr( "Ok") ) ); 586 tr( "Please select something to restore." ),QString( tr( "Ok") ) );
587 return; 587 return;
588 } 588 }
589 589
590 if ( QMessageBox::warning( this, tr( "Restore" ),
591 tr( "Would you really overwrite your local data?" ),
592 tr( "Yes" ), tr( "No" ), "", 1 ) == 1 )
593 return;
594
590 OWait *owait = new OWait(); 595 OWait *owait = new OWait();
591 Global::statusMessage( tr( "Restore Backup..." ) ); 596 Global::statusMessage( tr( "Restore Backup..." ) );
592 owait->show(); 597 owait->show();
593 qApp->processEvents(); 598 qApp->processEvents();
594 599
595 QString restoreFile = backupLocations[restoreSource->currentText()]; 600 QString restoreFile = backupLocations[restoreSource->currentText()];
596 601
597 restoreFile += "/" + restoreItem->text(0); 602 restoreFile += "/" + restoreItem->text(0);
598 603
599 odebug << restoreFile << oendl; 604 odebug << restoreFile << oendl;
600 605
601 //check if backup file come from opie 1.0.x 606 //check if backup file come from opie 1.0.x
602 607
603 QString commandLine = QString( "tar -tzf %1 | grep Applications/backup/exclude" ).arg( restoreFile.latin1() ); 608 QString commandLine = QString( "tar -tzf %1 | grep Applications/backup/exclude" ).arg( restoreFile.latin1() );
604 609
605 int r = system( commandLine ); 610 int r = system( commandLine );
606 611
607 QString startDir; 612 QString startDir;
608 613
609 if( r != 0 ) //Applications/backup/exclude not found - old backup file 614 if( r != 0 ) //Applications/backup/exclude not found - old backup file
610 { 615 {
611 startDir = QString( "/" ); 616 startDir = QString( "/" );
612 } else 617 } else
613 { 618 {
614 startDir = QDir::homeDirPath(); 619 startDir = QDir::homeDirPath();
615 } 620 }
616 621
617 //unpack backup file 622 //unpack backup file
618 commandLine = QString( "cd %1 && tar -zxf %2 2> %3" ).arg( startDir ) 623 commandLine = QString( "cd %1 && tar -zxf %2 2> %3" ).arg( startDir )
619 .arg( restoreFile.latin1() ) 624 .arg( restoreFile.latin1() )
620 .arg( tempFileName.latin1() ); 625 .arg( tempFileName.latin1() );
621 626
622 odebug << commandLine << oendl; 627 odebug << commandLine << oendl;
623 628
624 r = system( commandLine ); 629 r = system( commandLine );
625 630
626 owait->hide(); 631 owait->hide();
627 delete owait; 632 delete owait;
628 633
629 //error handling 634 //error handling
630 if(r != 0) 635 if(r != 0)
631 { 636 {
632 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); 637 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
633 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n" 638 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n"
634 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) ) 639 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) )
635 { 640 {
636 case 1: 641 case 1:
637 owarn << "Details pressed !" << oendl; 642 owarn << "Details pressed !" << oendl;
638 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); 643 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
639 QFile errorFile( tempFileName ); 644 QFile errorFile( tempFileName );
640 if ( errorFile.open(IO_ReadOnly) ) 645 if ( errorFile.open(IO_ReadOnly) )
641 { 646 {
642 QTextStream t( &errorFile ); 647 QTextStream t( &errorFile );
643 QString s; 648 QString s;
644 while ( !t.eof() ) 649 while ( !t.eof() )
645 { // until end of file... 650 { // until end of file...
646 s += t.readLine(); // line of text excluding '\n' 651 s += t.readLine(); // line of text excluding '\n'
647 } 652 }
648 errorFile.close(); 653 errorFile.close();
649 654
650 pErrDialog->m_textarea->setText( s ); 655 pErrDialog->m_textarea->setText( s );
651 } 656 }
652 else 657 else
653 { 658 {
654 pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) ); 659 pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) );
655 } 660 }
656 QPEApplication::execDialog( pErrDialog ); 661 QPEApplication::execDialog( pErrDialog );
657 delete pErrDialog; 662 delete pErrDialog;
658 663
659 setCaption(tr("Backup and Restore.. Failed !!")); 664 setCaption(tr("Backup and Restore.. Failed !!"));
660 return; 665 return;
661 666
662 break; 667 break;
663 668
664 } 669 }
665 } 670 }
666 else 671 else
667 { 672 {
668 QMessageBox::information(this, tr( "Message" ), tr( "Restore Successful." ), QString( tr( "Ok") ) ); 673 QMessageBox::information(this, tr( "Message" ), tr( "Restore Successful." ), QString( tr( "Ok") ) );
669 } 674 }
670 675
671 //write restore-location 676 //write restore-location
672 Config config( "BackupAndRestore" ); 677 Config config( "BackupAndRestore" );
673 config.setGroup( "LastLocation" ); 678 config.setGroup( "LastLocation" );
674 config.writeEntry( "LastRestoreLocation", restoreSource->currentText() ); 679 config.writeEntry( "LastRestoreLocation", restoreSource->currentText() );
675 680
676 setCaption(tr("Backup and Restore")); 681 setCaption(tr("Backup and Restore"));
677} 682}
678 683
679/** 684/**
680 * Check for exclude in Applications/backup 685 * Check for exclude in Applications/backup
681 * If it does not exist, the function will create the file with *.bck as content 686 * If it does not exist, the function will create the file with *.bck as content
682 * The exclude_files is read by tar and will provide to exclude special files out from backup. 687 * The exclude_files is read by tar and will provide to exclude special files out from backup.
683 * e.g. alle *.bck files (backup-files) will not be backed up by default 688 * e.g. alle *.bck files (backup-files) will not be backed up by default
684 */ 689 */
685 690
686QString BackupAndRestore::getExcludeFile() 691QString BackupAndRestore::getExcludeFile()
687{ 692{
688 QString excludeFileName = Global::applicationFileName( "backup", "exclude" ); 693 QString excludeFileName = Global::applicationFileName( "backup", "exclude" );
689 if ( !QFile::exists( excludeFileName ) ) 694 if ( !QFile::exists( excludeFileName ) )
690 { 695 {
691 QFile excludeFile( excludeFileName); 696 QFile excludeFile( excludeFileName);
692 if ( excludeFile.open( IO_WriteOnly ) == true ) 697 if ( excludeFile.open( IO_WriteOnly ) == true )
693 { 698 {
694 QTextStream writeStream( &excludeFile ); 699 QTextStream writeStream( &excludeFile );
695 writeStream << "*.bck" << "\n"; 700 writeStream << "*.bck" << "\n";
696 excludeFile.close(); 701 excludeFile.close();
697 } 702 }
698 else 703 else
699 { 704 {
700 return QString::null; 705 return QString::null;
701 } 706 }
702 } 707 }
703 708
704 return excludeFileName; 709 return excludeFileName;
705} 710}
706 711
707void BackupAndRestore::refreshLocations() 712void BackupAndRestore::refreshLocations()
708{ 713{
709 locationList->clear(); 714 locationList->clear();
710 715
711 //todo: implement add locations 716 //todo: implement add locations
712 Config config( "BackupAndRestore" ); 717 Config config( "BackupAndRestore" );
713 config.setGroup( "Locations" ); 718 config.setGroup( "Locations" );
714 719
715 QStringList locations( config.readListEntry( "locations", '|' ) ); 720 QStringList locations( config.readListEntry( "locations", '|' ) );
716 721
717 for ( QStringList::Iterator it = locations.begin(); it != locations.end(); ++it ) { 722 for ( QStringList::Iterator it = locations.begin(); it != locations.end(); ++it ) {
718 (void) new QListViewItem( locationList, *it ); 723 (void) new QListViewItem( locationList, *it );
719 } 724 }
720} 725}
721 726
722void BackupAndRestore::addLocation() 727void BackupAndRestore::addLocation()
723{ 728{
724 if ( ( !locationEdit->text().isEmpty() ) && 729 if ( ( !locationEdit->text().isEmpty() ) &&
725 ( QDir( locationEdit->text() ).exists() ) ) 730 ( QDir( locationEdit->text() ).exists() ) )
726 { 731 {
727 (void) new QListViewItem( locationList, locationEdit->text() ); 732 (void) new QListViewItem( locationList, locationEdit->text() );
728 locationEdit->setText( "" ); 733 locationEdit->setText( "" );
729 saveLocations(); 734 saveLocations();
730 } 735 }
731} 736}
732 737
733void BackupAndRestore::removeLocation() 738void BackupAndRestore::removeLocation()
734{ 739{
735 if ( locationList->selectedItem() ) 740 if ( locationList->selectedItem() )
736 { 741 {
737 delete( locationList->selectedItem() ); 742 delete( locationList->selectedItem() );
738 saveLocations(); 743 saveLocations();
739 } 744 }
740} 745}
741 746
742void BackupAndRestore::saveLocations() 747void BackupAndRestore::saveLocations()
743{ 748{
744 Config config("BackupAndRestore"); 749 Config config("BackupAndRestore");
745 config.setGroup("Locations"); 750 config.setGroup("Locations");
746 751
747 QStringList locations; 752 QStringList locations;
748 for ( QListViewItemIterator it( locationList ); it.current(); ++it ) 753 for ( QListViewItemIterator it( locationList ); it.current(); ++it )
749 { 754 {
750 locations.append( it.current()->text( 0 ) ); 755 locations.append( it.current()->text( 0 ) );
751 } 756 }
752 config.writeEntry( "locations", locations, '|' ); 757 config.writeEntry( "locations", locations, '|' );
753 758
754 refreshBackupLocations(); 759 refreshBackupLocations();
755} 760}
756 761
757void BackupAndRestore::selectLocation() 762void BackupAndRestore::selectLocation()
758{ 763{
759 QString location = OFileDialog::getDirectory( OFileSelector::DIRECTORYSELECTOR ); 764 QString location = OFileDialog::getDirectory( OFileSelector::DIRECTORYSELECTOR );
760 if ( !location.isEmpty() ) 765 if ( !location.isEmpty() )
761 { 766 {
762 locationEdit->setText( location ); 767 locationEdit->setText( location );
763 } 768 }
764} 769}
765 770
766// backuprestore.cpp 771// backuprestore.cpp
767 772