summaryrefslogtreecommitdiff
path: root/noncore/settings/backup/backuprestore.cpp
Unidiff
Diffstat (limited to 'noncore/settings/backup/backuprestore.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/backup/backuprestore.cpp13
1 files changed, 13 insertions, 0 deletions
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
@@ -1,21 +1,24 @@
1#include "backuprestore.h" 1#include "backuprestore.h"
2#include "errordialog.h" 2#include "errordialog.h"
3 3
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>
8using namespace Opie::Core; 8using namespace Opie::Core;
9 9
10#include <opie2/ofiledialog.h>
11using 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>
16#include <qmultilineedit.h> 19#include <qmultilineedit.h>
17#include <qdir.h> 20#include <qdir.h>
18#include <qfile.h> 21#include <qfile.h>
19#include <qfileinfo.h> 22#include <qfileinfo.h>
20#include <qlistview.h> 23#include <qlistview.h>
21#include <qpushbutton.h> 24#include <qpushbutton.h>
@@ -48,24 +51,25 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f
48 : BackupAndRestoreBase(parent, name, fl) 51 : BackupAndRestoreBase(parent, name, fl)
49{ 52{
50 backupList->header()->hide(); 53 backupList->header()->hide();
51 restoreList->header()->hide(); 54 restoreList->header()->hide();
52 locationList->header()->hide(); 55 locationList->header()->hide();
53 connect( backupButton, SIGNAL( clicked() ), this, SLOT( backup() ) ); 56 connect( backupButton, SIGNAL( clicked() ), this, SLOT( backup() ) );
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);
66 documents= new QListViewItem(backupList, "Documents", "", "Documents/"); 70 documents= new QListViewItem(backupList, "Documents", "", "Documents/");
67 selectItem(documents); 71 selectItem(documents);
68 72
69 scanForApplicationSettings(); 73 scanForApplicationSettings();
70 refreshLocations(); 74 refreshLocations();
71 refreshBackupLocations(); 75 refreshBackupLocations();
@@ -580,14 +584,23 @@ void BackupAndRestore::saveLocations()
580 config.setGroup("Locations"); 584 config.setGroup("Locations");
581 585
582 QStringList locations; 586 QStringList locations;
583 for ( QListViewItemIterator it( locationList ); it.current(); ++it ) 587 for ( QListViewItemIterator it( locationList ); it.current(); ++it )
584 { 588 {
585 locations.append( it.current()->text( 0 ) ); 589 locations.append( it.current()->text( 0 ) );
586 } 590 }
587 config.writeEntry( "locations", locations, '|' ); 591 config.writeEntry( "locations", locations, '|' );
588 592
589 refreshBackupLocations(); 593 refreshBackupLocations();
590} 594}
591 595
596void 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