author | ar <ar> | 2004-08-14 19:24:28 (UTC) |
---|---|---|
committer | ar <ar> | 2004-08-14 19:24:28 (UTC) |
commit | 6b3277b1ff29c9fba53e62fc1b83a045b73a17af (patch) (unidiff) | |
tree | 1cee073c95061330c8e0b32a44bd5f694b8193c1 /noncore/settings | |
parent | b7e50e77e0b22b3dd0feee43b15d0152d9ca8abb (diff) | |
download | opie-6b3277b1ff29c9fba53e62fc1b83a045b73a17af.zip opie-6b3277b1ff29c9fba53e62fc1b83a045b73a17af.tar.gz opie-6b3277b1ff29c9fba53e62fc1b83a045b73a17af.tar.bz2 |
- use OFileDialog::getDirectory() to select directory in locations tab.
-rw-r--r-- | noncore/settings/backup/backup.pro | 2 | ||||
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 13 | ||||
-rw-r--r-- | noncore/settings/backup/backuprestore.h | 1 | ||||
-rw-r--r-- | noncore/settings/backup/backuprestorebase.ui | 59 | ||||
-rw-r--r-- | noncore/settings/backup/config.in | 2 |
5 files changed, 49 insertions, 28 deletions
diff --git a/noncore/settings/backup/backup.pro b/noncore/settings/backup/backup.pro index 2adb428..390c599 100644 --- a/noncore/settings/backup/backup.pro +++ b/noncore/settings/backup/backup.pro | |||
@@ -1,10 +1,10 @@ | |||
1 | CONFIG = qt warn_on quick-app | 1 | CONFIG = qt warn_on quick-app |
2 | HEADERS = backuprestore.h | 2 | HEADERS = backuprestore.h |
3 | SOURCES = main.cpp backuprestore.cpp | 3 | SOURCES = main.cpp backuprestore.cpp |
4 | INCLUDEPATH+= $(OPIEDIR)/include | 4 | INCLUDEPATH+= $(OPIEDIR)/include |
5 | DEPENDPATH+= $(OPIEDIR)/include | 5 | DEPENDPATH+= $(OPIEDIR)/include |
6 | LIBS += -lqpe -lopiecore2 | 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 | ||
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 478b22f..36b101c 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp | |||
@@ -4,12 +4,15 @@ | |||
4 | 4 | ||
5 | /* OPIE */ | 5 | /* OPIE */ |
6 | #include <opie2/odebug.h> | 6 | #include <opie2/odebug.h> |
7 | #include <opie2/ostorageinfo.h> | 7 | #include <opie2/ostorageinfo.h> |
8 | using namespace Opie::Core; | 8 | using namespace Opie::Core; |
9 | 9 | ||
10 | #include <opie2/ofiledialog.h> | ||
11 | using namespace Opie::Ui; | ||
12 | |||
10 | #include <qpe/qpeapplication.h> | 13 | #include <qpe/qpeapplication.h> |
11 | #include <qpe/resource.h> | 14 | #include <qpe/resource.h> |
12 | #include <qpe/config.h> | 15 | #include <qpe/config.h> |
13 | 16 | ||
14 | /* QT */ | 17 | /* QT */ |
15 | #include <qapplication.h> | 18 | #include <qapplication.h> |
@@ -54,12 +57,13 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f | |||
54 | connect( restoreButton, SIGNAL( clicked() ), this, SLOT( restore() ) ); | 57 | connect( restoreButton, SIGNAL( clicked() ), this, SLOT( restore() ) ); |
55 | connect( backupList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectItem( QListViewItem* ) ) ); | 58 | connect( backupList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectItem( QListViewItem* ) ) ); |
56 | connect( restoreSource, SIGNAL( activated( int ) ), this, SLOT( sourceDirChanged( int ) ) ); | 59 | connect( restoreSource, SIGNAL( activated( int ) ), this, SLOT( sourceDirChanged( int ) ) ); |
57 | connect( addLocationButton, SIGNAL( clicked() ), this, SLOT( addLocation() ) ); | 60 | connect( addLocationButton, SIGNAL( clicked() ), this, SLOT( addLocation() ) ); |
58 | connect( removeLocationButton, SIGNAL( clicked() ), this, SLOT( removeLocation() ) ); | 61 | connect( removeLocationButton, SIGNAL( clicked() ), this, SLOT( removeLocation() ) ); |
59 | connect( saveLocationsButton, SIGNAL( clicked() ), this, SLOT( saveLocations() ) ); | 62 | connect( saveLocationsButton, SIGNAL( clicked() ), this, SLOT( saveLocations() ) ); |
63 | connect( selectLocationButton, SIGNAL( clicked() ), this, SLOT( selectLocation() ) ); | ||
60 | 64 | ||
61 | //add directorys for backing up | 65 | //add directorys for backing up |
62 | applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); | 66 | applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); |
63 | selectItem(applicationSettings); | 67 | selectItem(applicationSettings); |
64 | applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); | 68 | applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); |
65 | selectItem(applicationSettings); | 69 | selectItem(applicationSettings); |
@@ -586,8 +590,17 @@ void BackupAndRestore::saveLocations() | |||
586 | } | 590 | } |
587 | config.writeEntry( "locations", locations, '|' ); | 591 | config.writeEntry( "locations", locations, '|' ); |
588 | 592 | ||
589 | refreshBackupLocations(); | 593 | refreshBackupLocations(); |
590 | } | 594 | } |
591 | 595 | ||
596 | void BackupAndRestore::selectLocation() | ||
597 | { | ||
598 | QString location = OFileDialog::getDirectory( OFileSelector::DIRECTORYSELECTOR ); | ||
599 | if ( !location.isEmpty() ) | ||
600 | { | ||
601 | locationEdit->setText( location ); | ||
602 | } | ||
603 | } | ||
604 | |||
592 | // backuprestore.cpp | 605 | // backuprestore.cpp |
593 | 606 | ||
diff --git a/noncore/settings/backup/backuprestore.h b/noncore/settings/backup/backuprestore.h index caf6243..332123a 100644 --- a/noncore/settings/backup/backuprestore.h +++ b/noncore/settings/backup/backuprestore.h | |||
@@ -29,12 +29,13 @@ private slots: | |||
29 | void rescanFolder(QString directory); | 29 | void rescanFolder(QString directory); |
30 | void fileListUpdate(); | 30 | void fileListUpdate(); |
31 | 31 | ||
32 | void addLocation(); | 32 | void addLocation(); |
33 | void removeLocation(); | 33 | void removeLocation(); |
34 | void saveLocations(); | 34 | void saveLocations(); |
35 | void selectLocation(); | ||
35 | 36 | ||
36 | private: | 37 | private: |
37 | void scanForApplicationSettings(); | 38 | void scanForApplicationSettings(); |
38 | int getBackupFiles(QString &backupFiles, QListViewItem *parent); | 39 | int getBackupFiles(QString &backupFiles, QListViewItem *parent); |
39 | QString getExcludeFile(); | 40 | QString getExcludeFile(); |
40 | QMap<QString, QString> backupLocations; | 41 | QMap<QString, QString> backupLocations; |
diff --git a/noncore/settings/backup/backuprestorebase.ui b/noncore/settings/backup/backuprestorebase.ui index b4624bb..b464556 100644 --- a/noncore/settings/backup/backuprestorebase.ui +++ b/noncore/settings/backup/backuprestorebase.ui | |||
@@ -8,13 +8,13 @@ | |||
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>290</width> | 14 | <width>282</width> |
15 | <height>243</height> | 15 | <height>243</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Backup And Restore</string> | 20 | <string>Backup And Restore</string> |
@@ -219,37 +219,12 @@ | |||
219 | <number>4</number> | 219 | <number>4</number> |
220 | </property> | 220 | </property> |
221 | <property stdset="1"> | 221 | <property stdset="1"> |
222 | <name>spacing</name> | 222 | <name>spacing</name> |
223 | <number>4</number> | 223 | <number>4</number> |
224 | </property> | 224 | </property> |
225 | <widget row="0" column="0" rowspan="1" colspan="3" > | ||
226 | <class>QLineEdit</class> | ||
227 | <property stdset="1"> | ||
228 | <name>name</name> | ||
229 | <cstring>locationEdit</cstring> | ||
230 | </property> | ||
231 | </widget> | ||
232 | <widget row="0" column="3" > | ||
233 | <class>QToolButton</class> | ||
234 | <property stdset="1"> | ||
235 | <name>name</name> | ||
236 | <cstring>locationSelectBtn</cstring> | ||
237 | </property> | ||
238 | <property stdset="1"> | ||
239 | <name>maximumSize</name> | ||
240 | <size> | ||
241 | <width>20</width> | ||
242 | <height>30</height> | ||
243 | </size> | ||
244 | </property> | ||
245 | <property stdset="1"> | ||
246 | <name>text</name> | ||
247 | <string>...</string> | ||
248 | </property> | ||
249 | </widget> | ||
250 | <widget row="1" column="0" rowspan="1" colspan="4" > | 225 | <widget row="1" column="0" rowspan="1" colspan="4" > |
251 | <class>QListView</class> | 226 | <class>QListView</class> |
252 | <column> | 227 | <column> |
253 | <property> | 228 | <property> |
254 | <name>text</name> | 229 | <name>text</name> |
255 | <string>Locations</string> | 230 | <string>Locations</string> |
@@ -298,12 +273,44 @@ | |||
298 | </property> | 273 | </property> |
299 | <property stdset="1"> | 274 | <property stdset="1"> |
300 | <name>text</name> | 275 | <name>text</name> |
301 | <string>Save</string> | 276 | <string>Save</string> |
302 | </property> | 277 | </property> |
303 | </widget> | 278 | </widget> |
279 | <widget row="0" column="3" > | ||
280 | <class>QPushButton</class> | ||
281 | <property stdset="1"> | ||
282 | <name>name</name> | ||
283 | <cstring>selectLocationButton</cstring> | ||
284 | </property> | ||
285 | <property stdset="1"> | ||
286 | <name>sizePolicy</name> | ||
287 | <sizepolicy> | ||
288 | <hsizetype>0</hsizetype> | ||
289 | <vsizetype>0</vsizetype> | ||
290 | </sizepolicy> | ||
291 | </property> | ||
292 | <property stdset="1"> | ||
293 | <name>maximumSize</name> | ||
294 | <size> | ||
295 | <width>20</width> | ||
296 | <height>30</height> | ||
297 | </size> | ||
298 | </property> | ||
299 | <property stdset="1"> | ||
300 | <name>text</name> | ||
301 | <string>...</string> | ||
302 | </property> | ||
303 | </widget> | ||
304 | <widget row="0" column="0" rowspan="1" colspan="3" > | ||
305 | <class>QLineEdit</class> | ||
306 | <property stdset="1"> | ||
307 | <name>name</name> | ||
308 | <cstring>locationEdit</cstring> | ||
309 | </property> | ||
310 | </widget> | ||
304 | </grid> | 311 | </grid> |
305 | </widget> | 312 | </widget> |
306 | </widget> | 313 | </widget> |
307 | </vbox> | 314 | </vbox> |
308 | </widget> | 315 | </widget> |
309 | </UI> | 316 | </UI> |
diff --git a/noncore/settings/backup/config.in b/noncore/settings/backup/config.in index 27a5408..fddde4b 100644 --- a/noncore/settings/backup/config.in +++ b/noncore/settings/backup/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config BACKUP | 1 | config BACKUP |
2 | boolean "opie-backup (save and restore current Opie settings)" | 2 | boolean "opie-backup (save and restore current Opie settings)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI |