From 6b3277b1ff29c9fba53e62fc1b83a045b73a17af Mon Sep 17 00:00:00 2001 From: ar Date: Sat, 14 Aug 2004 19:24:28 +0000 Subject: - use OFileDialog::getDirectory() to select directory in locations tab. --- 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 @@ -3,7 +3,7 @@ HEADERS = backuprestore.h SOURCES = main.cpp backuprestore.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiecore2 +LIBS += -lqpe -lopiecore2 -lopieui2 INTERFACES = backuprestorebase.ui errordialog.ui TARGET = backup 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 @@ -7,6 +7,9 @@ #include using namespace Opie::Core; +#include +using namespace Opie::Ui; + #include #include #include @@ -57,6 +60,7 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f connect( addLocationButton, SIGNAL( clicked() ), this, SLOT( addLocation() ) ); connect( removeLocationButton, SIGNAL( clicked() ), this, SLOT( removeLocation() ) ); connect( saveLocationsButton, SIGNAL( clicked() ), this, SLOT( saveLocations() ) ); + connect( selectLocationButton, SIGNAL( clicked() ), this, SLOT( selectLocation() ) ); //add directorys for backing up applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); @@ -589,5 +593,14 @@ void BackupAndRestore::saveLocations() refreshBackupLocations(); } +void BackupAndRestore::selectLocation() +{ + QString location = OFileDialog::getDirectory( OFileSelector::DIRECTORYSELECTOR ); + if ( !location.isEmpty() ) + { + locationEdit->setText( location ); + } +} + // backuprestore.cpp 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 @@ -32,6 +32,7 @@ private slots: void addLocation(); void removeLocation(); void saveLocations(); + void selectLocation(); private: void scanForApplicationSettings(); 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 @@ -11,7 +11,7 @@ 0 0 - 290 + 282 243 @@ -222,31 +222,6 @@ spacing 4 - - QLineEdit - - name - locationEdit - - - - QToolButton - - name - locationSelectBtn - - - maximumSize - - 20 - 30 - - - - text - ... - - QListView @@ -301,6 +276,38 @@ Save + + QPushButton + + name + selectLocationButton + + + sizePolicy + + 0 + 0 + + + + maximumSize + + 20 + 30 + + + + text + ... + + + + QLineEdit + + name + locationEdit + + 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 @@ config BACKUP boolean "opie-backup (save and restore current Opie settings)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI -- cgit v0.9.0.2