-rw-r--r-- | noncore/settings/backup/backup.pro | 2 | ||||
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 62 | ||||
-rw-r--r-- | noncore/settings/backup/backuprestore.h | 31 | ||||
-rw-r--r-- | noncore/settings/backup/backuprestorebase.ui | 185 |
4 files changed, 214 insertions, 66 deletions
diff --git a/noncore/settings/backup/backup.pro b/noncore/settings/backup/backup.pro index 390c599..e964c3a 100644 --- a/noncore/settings/backup/backup.pro +++ b/noncore/settings/backup/backup.pro | |||
@@ -6,5 +6,5 @@ DEPENDPATH += $(OPIEDIR)/include | |||
6 | LIBS += -lqpe -lopiecore2 -lopieui2 | 6 | LIBS += -lqpe -lopiecore2 -lopieui2 |
7 | INTERFACES= backuprestorebase.ui errordialog.ui | 7 | INTERFACES= backuprestorebase.ui errordialog.ui |
8 | TARGET = backup | 8 | TARGET = backup |
9 | 9 | VERSION = 0.8.1 | |
10 | include ( $(OPIEDIR)/include.pro ) | 10 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index 1748e8d..c944c6d 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp | |||
@@ -1,20 +1,45 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | =. | ||
4 | .=l. Copyright (c) 2002-2004 The Opie Team <opie-devel@handhelds.org> | ||
5 | .>+-= | ||
6 | _;:, .> :=|. This file is free software; you can | ||
7 | .> <`_, > . <= redistribute it and/or modify it under | ||
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
9 | .="- .-=="i, .._ License as published by the Free Software | ||
10 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
11 | ._= =} : or (at your option) any later version. | ||
12 | .%`+i> _;_. | ||
13 | .i_,=:_. -<s. This file is distributed in the hope that | ||
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
15 | : .. .:, . . . without even the implied warranty of | ||
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | ||
18 | ..}^=.= = ; Public License for more details. | ||
19 | ++= -. .` .: | ||
20 | : = ...= . :.=- You should have received a copy of the GNU | ||
21 | -. .:....=;==+<; General Public License along with this file; | ||
22 | -_. . . )=. = see the file COPYING. If not, write to the | ||
23 | -- :-=` Free Software Foundation, Inc., | ||
24 | 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | |||
1 | #include "backuprestore.h" | 29 | #include "backuprestore.h" |
2 | #include "errordialog.h" | 30 | #include "errordialog.h" |
3 | 31 | ||
4 | |||
5 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <qpe/qpeapplication.h> | ||
34 | #include <qpe/resource.h> | ||
35 | #include <qpe/config.h> | ||
6 | #include <opie2/odebug.h> | 36 | #include <opie2/odebug.h> |
7 | #include <opie2/ostorageinfo.h> | 37 | #include <opie2/ostorageinfo.h> |
8 | using namespace Opie::Core; | ||
9 | |||
10 | #include <opie2/ofiledialog.h> | 38 | #include <opie2/ofiledialog.h> |
11 | #include <opie2/owait.h> | 39 | #include <opie2/owait.h> |
40 | using namespace Opie::Core; | ||
12 | using namespace Opie::Ui; | 41 | using namespace Opie::Ui; |
13 | 42 | ||
14 | #include <qpe/qpeapplication.h> | ||
15 | #include <qpe/resource.h> | ||
16 | #include <qpe/config.h> | ||
17 | |||
18 | /* QT */ | 43 | /* QT */ |
19 | #include <qapplication.h> | 44 | #include <qapplication.h> |
20 | #include <qmultilineedit.h> | 45 | #include <qmultilineedit.h> |
@@ -23,6 +48,7 @@ using namespace Opie::Ui; | |||
23 | #include <qfileinfo.h> | 48 | #include <qfileinfo.h> |
24 | #include <qlistview.h> | 49 | #include <qlistview.h> |
25 | #include <qpushbutton.h> | 50 | #include <qpushbutton.h> |
51 | #include <qradiobutton.h> | ||
26 | #include <qheader.h> | 52 | #include <qheader.h> |
27 | #include <qmessagebox.h> | 53 | #include <qmessagebox.h> |
28 | #include <qcombobox.h> | 54 | #include <qcombobox.h> |
@@ -244,6 +270,20 @@ void BackupAndRestore::scanForApplicationSettings() | |||
244 | */ | 270 | */ |
245 | void BackupAndRestore::backup() | 271 | void BackupAndRestore::backup() |
246 | { | 272 | { |
273 | if ( cb_type_userdata->isChecked() ) | ||
274 | backupUserData(); | ||
275 | else | ||
276 | backupRootFs(); | ||
277 | } | ||
278 | |||
279 | |||
280 | void BackupAndRestore::backupRootFs() | ||
281 | { | ||
282 | QMessageBox::critical(this, "Message", "Not Yet Implemented", "Ok" ); | ||
283 | } | ||
284 | |||
285 | void BackupAndRestore::backupUserData() | ||
286 | { | ||
247 | QString backupFiles; | 287 | QString backupFiles; |
248 | if(getBackupFiles(backupFiles, NULL) == 0) | 288 | if(getBackupFiles(backupFiles, NULL) == 0) |
249 | { | 289 | { |
@@ -256,7 +296,7 @@ void BackupAndRestore::backup() | |||
256 | Global::statusMessage( tr( "Backing up..." ) ); | 296 | Global::statusMessage( tr( "Backing up..." ) ); |
257 | owait->show(); | 297 | owait->show(); |
258 | qApp->processEvents(); | 298 | qApp->processEvents(); |
259 | 299 | ||
260 | QString outputFile = backupLocations[storeToLocation->currentText()]; | 300 | QString outputFile = backupLocations[storeToLocation->currentText()]; |
261 | 301 | ||
262 | QDateTime datetime = QDateTime::currentDateTime(); | 302 | QDateTime datetime = QDateTime::currentDateTime(); |
@@ -291,7 +331,7 @@ void BackupAndRestore::backup() | |||
291 | 331 | ||
292 | owait->hide(); | 332 | owait->hide(); |
293 | delete owait; | 333 | delete owait; |
294 | 334 | ||
295 | //Error-Handling | 335 | //Error-Handling |
296 | if(r != 0) | 336 | if(r != 0) |
297 | { | 337 | { |
@@ -443,7 +483,7 @@ void BackupAndRestore::restore() | |||
443 | tr( "Please select something to restore." ),QString( tr( "Ok") ) ); | 483 | tr( "Please select something to restore." ),QString( tr( "Ok") ) ); |
444 | return; | 484 | return; |
445 | } | 485 | } |
446 | 486 | ||
447 | OWait *owait = new OWait(); | 487 | OWait *owait = new OWait(); |
448 | Global::statusMessage( tr( "Restore Backup..." ) ); | 488 | Global::statusMessage( tr( "Restore Backup..." ) ); |
449 | owait->show(); | 489 | owait->show(); |
@@ -482,7 +522,7 @@ void BackupAndRestore::restore() | |||
482 | 522 | ||
483 | owait->hide(); | 523 | owait->hide(); |
484 | delete owait; | 524 | delete owait; |
485 | 525 | ||
486 | //error handling | 526 | //error handling |
487 | if(r != 0) | 527 | if(r != 0) |
488 | { | 528 | { |
diff --git a/noncore/settings/backup/backuprestore.h b/noncore/settings/backup/backuprestore.h index 332123a..015f854 100644 --- a/noncore/settings/backup/backuprestore.h +++ b/noncore/settings/backup/backuprestore.h | |||
@@ -1,3 +1,31 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | =. | ||
4 | .=l. Copyright (c) 2002-2004 The Opie Team <opie-devel@handhelds.org> | ||
5 | .>+-= | ||
6 | _;:, .> :=|. This file is free software; you can | ||
7 | .> <`_, > . <= redistribute it and/or modify it under | ||
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
9 | .="- .-=="i, .._ License as published by the Free Software | ||
10 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
11 | ._= =} : or (at your option) any later version. | ||
12 | .%`+i> _;_. | ||
13 | .i_,=:_. -<s. This file is distributed in the hope that | ||
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
15 | : .. .:, . . . without even the implied warranty of | ||
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | ||
18 | ..}^=.= = ; Public License for more details. | ||
19 | ++= -. .` .: | ||
20 | : = ...= . :.=- You should have received a copy of the GNU | ||
21 | -. .:....=;==+<; General Public License along with this file; | ||
22 | -_. . . )=. = see the file COPYING. If not, write to the | ||
23 | -- :-=` Free Software Foundation, Inc., | ||
24 | 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | |||
1 | #ifndef WINDOW_H | 29 | #ifndef WINDOW_H |
2 | #define WINDOW_H | 30 | #define WINDOW_H |
3 | 31 | ||
@@ -43,6 +71,9 @@ private: | |||
43 | void refreshBackupLocations(); | 71 | void refreshBackupLocations(); |
44 | void refreshLocations(); | 72 | void refreshLocations(); |
45 | 73 | ||
74 | void backupUserData(); | ||
75 | void backupRootFs(); | ||
76 | |||
46 | QListViewItem *systemSettings; | 77 | QListViewItem *systemSettings; |
47 | QListViewItem *applicationSettings; | 78 | QListViewItem *applicationSettings; |
48 | QListViewItem *documents; | 79 | QListViewItem *documents; |
diff --git a/noncore/settings/backup/backuprestorebase.ui b/noncore/settings/backup/backuprestorebase.ui index b464556..6186d68 100644 --- a/noncore/settings/backup/backuprestorebase.ui +++ b/noncore/settings/backup/backuprestorebase.ui | |||
@@ -11,8 +11,8 @@ | |||
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>282</width> | 14 | <width>278</width> |
15 | <height>243</height> | 15 | <height>298</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
@@ -63,65 +63,142 @@ | |||
63 | </property> | 63 | </property> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>spacing</name> | 65 | <name>spacing</name> |
66 | <number>4</number> | 66 | <number>2</number> |
67 | </property> | 67 | </property> |
68 | <widget row="0" column="0" > | 68 | <widget row="0" column="0" > |
69 | <class>QLabel</class> | 69 | <class>QLayoutWidget</class> |
70 | <property stdset="1"> | ||
71 | <name>name</name> | ||
72 | <cstring>TextLabel1</cstring> | ||
73 | </property> | ||
74 | <property stdset="1"> | ||
75 | <name>text</name> | ||
76 | <string>Save To</string> | ||
77 | </property> | ||
78 | </widget> | ||
79 | <widget row="0" column="1" > | ||
80 | <class>QComboBox</class> | ||
81 | <property stdset="1"> | 70 | <property stdset="1"> |
82 | <name>name</name> | 71 | <name>name</name> |
83 | <cstring>storeToLocation</cstring> | 72 | <cstring>Layout1</cstring> |
84 | </property> | 73 | </property> |
85 | </widget> | 74 | <grid> |
86 | <widget row="2" column="0" rowspan="1" colspan="2" > | 75 | <property stdset="1"> |
87 | <class>QPushButton</class> | 76 | <name>margin</name> |
88 | <property stdset="1"> | 77 | <number>0</number> |
89 | <name>name</name> | ||
90 | <cstring>backupButton</cstring> | ||
91 | </property> | ||
92 | <property stdset="1"> | ||
93 | <name>text</name> | ||
94 | <string>&Backup</string> | ||
95 | </property> | ||
96 | </widget> | ||
97 | <widget row="1" column="0" rowspan="1" colspan="2" > | ||
98 | <class>QListView</class> | ||
99 | <column> | ||
100 | <property> | ||
101 | <name>text</name> | ||
102 | <string>Applications</string> | ||
103 | </property> | 78 | </property> |
104 | <property> | 79 | <property stdset="1"> |
105 | <name>clickable</name> | 80 | <name>spacing</name> |
106 | <bool>true</bool> | 81 | <number>6</number> |
107 | </property> | ||
108 | <property> | ||
109 | <name>resizeable</name> | ||
110 | <bool>true</bool> | ||
111 | </property> | 82 | </property> |
112 | </column> | 83 | <widget row="1" column="1" > |
113 | <property stdset="1"> | 84 | <class>QComboBox</class> |
114 | <name>name</name> | 85 | <property stdset="1"> |
115 | <cstring>backupList</cstring> | 86 | <name>name</name> |
116 | </property> | 87 | <cstring>storeToLocation</cstring> |
117 | <property stdset="1"> | 88 | </property> |
118 | <name>allColumnsShowFocus</name> | 89 | <property stdset="1"> |
119 | <bool>true</bool> | 90 | <name>sizePolicy</name> |
120 | </property> | 91 | <sizepolicy> |
121 | <property stdset="1"> | 92 | <hsizetype>3</hsizetype> |
122 | <name>rootIsDecorated</name> | 93 | <vsizetype>1</vsizetype> |
123 | <bool>true</bool> | 94 | </sizepolicy> |
124 | </property> | 95 | </property> |
96 | </widget> | ||
97 | <widget row="1" column="0" > | ||
98 | <class>QLabel</class> | ||
99 | <property stdset="1"> | ||
100 | <name>name</name> | ||
101 | <cstring>TextLabel1</cstring> | ||
102 | </property> | ||
103 | <property stdset="1"> | ||
104 | <name>text</name> | ||
105 | <string>Destination</string> | ||
106 | </property> | ||
107 | </widget> | ||
108 | <widget row="3" column="0" rowspan="1" colspan="2" > | ||
109 | <class>QPushButton</class> | ||
110 | <property stdset="1"> | ||
111 | <name>name</name> | ||
112 | <cstring>backupButton</cstring> | ||
113 | </property> | ||
114 | <property stdset="1"> | ||
115 | <name>text</name> | ||
116 | <string>&Backup</string> | ||
117 | </property> | ||
118 | </widget> | ||
119 | <widget row="0" column="0" rowspan="1" colspan="2" > | ||
120 | <class>QButtonGroup</class> | ||
121 | <property stdset="1"> | ||
122 | <name>name</name> | ||
123 | <cstring>frame_type</cstring> | ||
124 | </property> | ||
125 | <property stdset="1"> | ||
126 | <name>title</name> | ||
127 | <string>Type</string> | ||
128 | </property> | ||
129 | <property> | ||
130 | <name>layoutMargin</name> | ||
131 | </property> | ||
132 | <property> | ||
133 | <name>layoutSpacing</name> | ||
134 | </property> | ||
135 | <vbox> | ||
136 | <property stdset="1"> | ||
137 | <name>margin</name> | ||
138 | <number>4</number> | ||
139 | </property> | ||
140 | <property stdset="1"> | ||
141 | <name>spacing</name> | ||
142 | <number>2</number> | ||
143 | </property> | ||
144 | <widget> | ||
145 | <class>QRadioButton</class> | ||
146 | <property stdset="1"> | ||
147 | <name>name</name> | ||
148 | <cstring>cb_type_userdata</cstring> | ||
149 | </property> | ||
150 | <property stdset="1"> | ||
151 | <name>text</name> | ||
152 | <string>User Data (Configuration + PIM)</string> | ||
153 | </property> | ||
154 | <property stdset="1"> | ||
155 | <name>checked</name> | ||
156 | <bool>true</bool> | ||
157 | </property> | ||
158 | </widget> | ||
159 | <widget> | ||
160 | <class>QRadioButton</class> | ||
161 | <property stdset="1"> | ||
162 | <name>name</name> | ||
163 | <cstring>cb_type_fullbackup</cstring> | ||
164 | </property> | ||
165 | <property stdset="1"> | ||
166 | <name>text</name> | ||
167 | <string>Full Backup (Root File System)</string> | ||
168 | </property> | ||
169 | </widget> | ||
170 | </vbox> | ||
171 | </widget> | ||
172 | <widget row="2" column="0" rowspan="1" colspan="2" > | ||
173 | <class>QListView</class> | ||
174 | <column> | ||
175 | <property> | ||
176 | <name>text</name> | ||
177 | <string>Applications</string> | ||
178 | </property> | ||
179 | <property> | ||
180 | <name>clickable</name> | ||
181 | <bool>true</bool> | ||
182 | </property> | ||
183 | <property> | ||
184 | <name>resizeable</name> | ||
185 | <bool>true</bool> | ||
186 | </property> | ||
187 | </column> | ||
188 | <property stdset="1"> | ||
189 | <name>name</name> | ||
190 | <cstring>backupList</cstring> | ||
191 | </property> | ||
192 | <property stdset="1"> | ||
193 | <name>allColumnsShowFocus</name> | ||
194 | <bool>true</bool> | ||
195 | </property> | ||
196 | <property stdset="1"> | ||
197 | <name>rootIsDecorated</name> | ||
198 | <bool>true</bool> | ||
199 | </property> | ||
200 | </widget> | ||
201 | </grid> | ||
125 | </widget> | 202 | </widget> |
126 | </grid> | 203 | </grid> |
127 | </widget> | 204 | </widget> |