summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/backup/backup.pro2
-rw-r--r--noncore/settings/backup/backuprestore.cpp13
-rw-r--r--noncore/settings/backup/backuprestore.h1
-rw-r--r--noncore/settings/backup/backuprestorebase.ui59
-rw-r--r--noncore/settings/backup/config.in2
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
@@ -2,9 +2,9 @@ CONFIG = qt warn_on quick-app
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
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
@@ -6,8 +6,11 @@
#include <opie2/odebug.h>
#include <opie2/ostorageinfo.h>
using namespace Opie::Core;
+#include <opie2/ofiledialog.h>
+using namespace Opie::Ui;
+
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/config.h>
@@ -56,8 +59,9 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f
connect( restoreSource, SIGNAL( activated( int ) ), this, SLOT( sourceDirChanged( int ) ) );
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/");
selectItem(applicationSettings);
@@ -588,6 +592,15 @@ 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
@@ -31,8 +31,9 @@ private slots:
void addLocation();
void removeLocation();
void saveLocations();
+ void selectLocation();
private:
void scanForApplicationSettings();
int getBackupFiles(QString &backupFiles, QListViewItem *parent);
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
@@ -10,9 +10,9 @@
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>290</width>
+ <width>282</width>
<height>243</height>
</rect>
</property>
<property stdset="1">
@@ -221,33 +221,8 @@
<property stdset="1">
<name>spacing</name>
<number>4</number>
</property>
- <widget row="0" column="0" rowspan="1" colspan="3" >
- <class>QLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>locationEdit</cstring>
- </property>
- </widget>
- <widget row="0" column="3" >
- <class>QToolButton</class>
- <property stdset="1">
- <name>name</name>
- <cstring>locationSelectBtn</cstring>
- </property>
- <property stdset="1">
- <name>maximumSize</name>
- <size>
- <width>20</width>
- <height>30</height>
- </size>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>...</string>
- </property>
- </widget>
<widget row="1" column="0" rowspan="1" colspan="4" >
<class>QListView</class>
<column>
<property>
@@ -300,8 +275,40 @@
<name>text</name>
<string>Save</string>
</property>
</widget>
+ <widget row="0" column="3" >
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>selectLocationButton</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>maximumSize</name>
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget row="0" column="0" rowspan="1" colspan="3" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>locationEdit</cstring>
+ </property>
+ </widget>
</grid>
</widget>
</widget>
</vbox>
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