summaryrefslogtreecommitdiff
Unidiff
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
@@ -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
6LIBS += -lqpe -lopiecore2 6LIBS += -lqpe -lopiecore2 -lopieui2
7 INTERFACES= backuprestorebase.ui errordialog.ui 7 INTERFACES= backuprestorebase.ui errordialog.ui
8 TARGET = backup 8 TARGET = backup
9 9
10include ( $(OPIEDIR)/include.pro ) 10include ( $(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
@@ -1,251 +1,255 @@
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>
22#include <qheader.h> 25#include <qheader.h>
23#include <qmessagebox.h> 26#include <qmessagebox.h>
24#include <qcombobox.h> 27#include <qcombobox.h>
25#include <qlist.h> 28#include <qlist.h>
26#include <qregexp.h> 29#include <qregexp.h>
27#include <qtextstream.h> 30#include <qtextstream.h>
28#include <qtextview.h> 31#include <qtextview.h>
29#include <qlineedit.h> 32#include <qlineedit.h>
30#include <qstringlist.h> 33#include <qstringlist.h>
31 34
32/* STD */ 35/* STD */
33#include <errno.h> 36#include <errno.h>
34#include <stdlib.h> 37#include <stdlib.h>
35#include <unistd.h> 38#include <unistd.h>
36#include <sys/stat.h> 39#include <sys/stat.h>
37#include <dirent.h> 40#include <dirent.h>
38 41
39#define HEADER_NAME 0 42#define HEADER_NAME 0
40#define HEADER_BACKUP 1 43#define HEADER_BACKUP 1
41#define BACKUP_LOCATION 2 44#define BACKUP_LOCATION 2
42 45
43#define EXTENSION ".bck" 46#define EXTENSION ".bck"
44 47
45const QString tempFileName = "/tmp/backup.err"; 48const QString tempFileName = "/tmp/backup.err";
46 49
47BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) 50BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl)
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();
72 76
73 // Read the list of items to ignore. 77 // Read the list of items to ignore.
74 QList<QString> dontBackupList; 78 QList<QString> dontBackupList;
75 dontBackupList.setAutoDelete(true); 79 dontBackupList.setAutoDelete(true);
76 Config config("BackupAndRestore"); 80 Config config("BackupAndRestore");
77 config.setGroup("DontBackup"); 81 config.setGroup("DontBackup");
78 int total = config.readNumEntry("Total", 0); 82 int total = config.readNumEntry("Total", 0);
79 for(int i = 0; i < total; i++) 83 for(int i = 0; i < total; i++)
80 { 84 {
81 dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), ""))); 85 dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), "")));
82 } 86 }
83 87
84 QList<QListViewItem> list; 88 QList<QListViewItem> list;
85 getAllItems(backupList->firstChild(), list); 89 getAllItems(backupList->firstChild(), list);
86 90
87 for(uint i = 0; i < list.count(); i++) 91 for(uint i = 0; i < list.count(); i++)
88 { 92 {
89 QString text = list.at(i)->text(HEADER_NAME); 93 QString text = list.at(i)->text(HEADER_NAME);
90 for(uint i2 = 0; i2 < dontBackupList.count(); i2++) 94 for(uint i2 = 0; i2 < dontBackupList.count(); i2++)
91 { 95 {
92 if(*dontBackupList.at(i2) == text) 96 if(*dontBackupList.at(i2) == text)
93 { 97 {
94 selectItem(list.at(i)); 98 selectItem(list.at(i));
95 break; 99 break;
96 } 100 }
97 } 101 }
98 } 102 }
99 QPEApplication::showWidget( this ); 103 QPEApplication::showWidget( this );
100} 104}
101 105
102BackupAndRestore::~BackupAndRestore() 106BackupAndRestore::~BackupAndRestore()
103{ 107{
104 QList<QListViewItem> list; 108 QList<QListViewItem> list;
105 getAllItems(backupList->firstChild(), list); 109 getAllItems(backupList->firstChild(), list);
106 110
107 Config config("BackupAndRestore"); 111 Config config("BackupAndRestore");
108 config.setGroup("DontBackup"); 112 config.setGroup("DontBackup");
109 config.clearGroup(); 113 config.clearGroup();
110 114
111 int count = 0; 115 int count = 0;
112 for(uint i = 0; i < list.count(); i++) 116 for(uint i = 0; i < list.count(); i++)
113 { 117 {
114 if(list.at(i)->text(HEADER_BACKUP) == "") 118 if(list.at(i)->text(HEADER_BACKUP) == "")
115 { 119 {
116 config.writeEntry(QString("%1").arg(count), list.at(i)->text(HEADER_NAME)); 120 config.writeEntry(QString("%1").arg(count), list.at(i)->text(HEADER_NAME));
117 count++; 121 count++;
118 } 122 }
119 } 123 }
120 config.writeEntry("Total", count); 124 config.writeEntry("Total", count);
121 125
122 // Remove Temp File 126 // Remove Temp File
123 if ( QFile::exists( tempFileName ) ) 127 if ( QFile::exists( tempFileName ) )
124 QFile::remove( tempFileName ); 128 QFile::remove( tempFileName );
125} 129}
126 130
127void BackupAndRestore::refreshBackupLocations() 131void BackupAndRestore::refreshBackupLocations()
128{ 132{
129 backupLocations.clear(); 133 backupLocations.clear();
130 // Add cards 134 // Add cards
131 Opie::Core::OStorageInfo storage; 135 Opie::Core::OStorageInfo storage;
132 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" ); 136 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" );
133 if ( storage.hasCf() ) 137 if ( storage.hasCf() )
134 { 138 {
135 backupLocations.insert( "CF", storage.cfPath() ); 139 backupLocations.insert( "CF", storage.cfPath() );
136 odebug << "Cf Path: " + storage.cfPath() << oendl; 140 odebug << "Cf Path: " + storage.cfPath() << oendl;
137 } 141 }
138 if ( storage.hasSd() ) 142 if ( storage.hasSd() )
139 { 143 {
140 backupLocations.insert( "SD", storage.sdPath() ); 144 backupLocations.insert( "SD", storage.sdPath() );
141 odebug << " Sd Path: " + storage.sdPath() << oendl; 145 odebug << " Sd Path: " + storage.sdPath() << oendl;
142 } 146 }
143 if ( storage.hasMmc() ) 147 if ( storage.hasMmc() )
144 { 148 {
145 backupLocations.insert( "MMC", storage.mmcPath() ); 149 backupLocations.insert( "MMC", storage.mmcPath() );
146 odebug << "Mmc Path: " + storage.mmcPath() << oendl; 150 odebug << "Mmc Path: " + storage.mmcPath() << oendl;
147 } 151 }
148 152
149 for ( QListViewItemIterator it( locationList ); it.current(); ++it ) 153 for ( QListViewItemIterator it( locationList ); it.current(); ++it )
150 { 154 {
151 backupLocations.insert( it.current()->text( 0 ), it.current()->text( 0 ) ); 155 backupLocations.insert( it.current()->text( 0 ), it.current()->text( 0 ) );
152 } 156 }
153 157
154 //update QComboBox 158 //update QComboBox
155 storeToLocation->clear(); 159 storeToLocation->clear();
156 restoreSource->clear(); 160 restoreSource->clear();
157 161
158 //read last locations 162 //read last locations
159 Config config("BackupAndRestore"); 163 Config config("BackupAndRestore");
160 config.setGroup("LastLocation"); 164 config.setGroup("LastLocation");
161 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" ); 165 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" );
162 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" ); 166 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" );
163 int locationIndex = 0; 167 int locationIndex = 0;
164 168
165 //fill QComboBox 169 //fill QComboBox
166 QMap<QString, QString>::Iterator it; 170 QMap<QString, QString>::Iterator it;
167 for( it = backupLocations.begin(); it != backupLocations.end(); ++it ) 171 for( it = backupLocations.begin(); it != backupLocations.end(); ++it )
168 { 172 {
169 storeToLocation->insertItem(it.key()); 173 storeToLocation->insertItem(it.key());
170 restoreSource->insertItem(it.key()); 174 restoreSource->insertItem(it.key());
171 175
172 //check for last locations 176 //check for last locations
173 if ( it.key() == lastStoreLocation ) 177 if ( it.key() == lastStoreLocation )
174 storeToLocation->setCurrentItem( locationIndex ); 178 storeToLocation->setCurrentItem( locationIndex );
175 if ( it.key() == lastRestoreLocation ) 179 if ( it.key() == lastRestoreLocation )
176 restoreSource->setCurrentItem( locationIndex ); 180 restoreSource->setCurrentItem( locationIndex );
177 locationIndex++; 181 locationIndex++;
178 } 182 }
179} 183}
180 184
181QList<QListViewItem> BackupAndRestore::getAllItems(QListViewItem *item, QList<QListViewItem> &list) 185QList<QListViewItem> BackupAndRestore::getAllItems(QListViewItem *item, QList<QListViewItem> &list)
182{ 186{
183 while(item) 187 while(item)
184 { 188 {
185 if(item->childCount() > 0) 189 if(item->childCount() > 0)
186 getAllItems(item->firstChild(), list); 190 getAllItems(item->firstChild(), list);
187 list.append(item); 191 list.append(item);
188 item = item->nextSibling(); 192 item = item->nextSibling();
189 } 193 }
190 return list; 194 return list;
191} 195}
192 196
193/** 197/**
194 * Selects and unselects the item by setting the HEADER_BACKUP to B or !. 198 * Selects and unselects the item by setting the HEADER_BACKUP to B or !.
195 * and changing the icon to match 199 * and changing the icon to match
196 * @param currentItem the item to swich the selection choice. 200 * @param currentItem the item to swich the selection choice.
197 */ 201 */
198void BackupAndRestore::selectItem(QListViewItem *currentItem) 202void BackupAndRestore::selectItem(QListViewItem *currentItem)
199{ 203{
200 if(!currentItem) 204 if(!currentItem)
201 return; 205 return;
202 206
203 if(currentItem->text(HEADER_BACKUP) == "B") 207 if(currentItem->text(HEADER_BACKUP) == "B")
204 { 208 {
205 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/null")); 209 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/null"));
206 currentItem->setText(HEADER_BACKUP, ""); 210 currentItem->setText(HEADER_BACKUP, "");
207 } 211 }
208 else 212 else
209 { 213 {
210 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/check")); 214 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/check"));
211 currentItem->setText(HEADER_BACKUP, "B"); 215 currentItem->setText(HEADER_BACKUP, "B");
212 } 216 }
213} 217}
214 218
215void BackupAndRestore::scanForApplicationSettings() 219void BackupAndRestore::scanForApplicationSettings()
216{ 220{
217 QDir d( QDir::homeDirPath() + "/" + QString( applicationSettings->text(BACKUP_LOCATION) ) ); 221 QDir d( QDir::homeDirPath() + "/" + QString( applicationSettings->text(BACKUP_LOCATION) ) );
218 d.setFilter( QDir::Dirs | QDir::Files | QDir::NoSymLinks ); 222 d.setFilter( QDir::Dirs | QDir::Files | QDir::NoSymLinks );
219 const QFileInfoList *list = d.entryInfoList(); 223 const QFileInfoList *list = d.entryInfoList();
220 QFileInfoListIterator it( *list ); 224 QFileInfoListIterator it( *list );
221 QFileInfo *fi; 225 QFileInfo *fi;
222 while ( (fi=it.current()) ) 226 while ( (fi=it.current()) )
223 { 227 {
224 //odebug << (d.path()+"/"+fi->fileName()).latin1() << oendl; 228 //odebug << (d.path()+"/"+fi->fileName()).latin1() << oendl;
225 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) ) 229 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) )
226 { 230 {
227 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName()); 231 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName());
228 selectItem(newItem); 232 selectItem(newItem);
229 } 233 }
230 ++it; 234 ++it;
231 } 235 }
232} 236}
233 237
234/** 238/**
235 * The "Backup" button has been pressed. Get a list of all of the files that 239 * The "Backup" button has been pressed. Get a list of all of the files that
236 * should be backed up. If there are no files, emit and error and exit. 240 * should be backed up. If there are no files, emit and error and exit.
237 * Determine the file name to store the backup in. Backup the file(s) using 241 * Determine the file name to store the backup in. Backup the file(s) using
238 * tar and gzip --best. Report failure or success 242 * tar and gzip --best. Report failure or success
239 */ 243 */
240void BackupAndRestore::backup() 244void BackupAndRestore::backup()
241{ 245{
242 QString backupFiles; 246 QString backupFiles;
243 if(getBackupFiles(backupFiles, NULL) == 0) 247 if(getBackupFiles(backupFiles, NULL) == 0)
244 { 248 {
245 QMessageBox::critical(this, "Message", 249 QMessageBox::critical(this, "Message",
246 "No items selected.",QString("Ok") ); 250 "No items selected.",QString("Ok") );
247 return; 251 return;
248 } 252 }
249 253
250 setCaption(tr("Backup and Restore... working...")); 254 setCaption(tr("Backup and Restore... working..."));
251 QString outputFile = backupLocations[storeToLocation->currentText()]; 255 QString outputFile = backupLocations[storeToLocation->currentText()];
@@ -400,194 +404,203 @@ void BackupAndRestore::rescanFolder(QString directory)
400 while ( (file=it.current()) ) 404 while ( (file=it.current()) )
401 { // for each file... 405 { // for each file...
402 // If it is a dir and not .. or . then add it as a tab and go down. 406 // If it is a dir and not .. or . then add it as a tab and go down.
403 if(file->isDir()) 407 if(file->isDir())
404 { 408 {
405 if(file->fileName() != ".." && file->fileName() != ".") 409 if(file->fileName() != ".." && file->fileName() != ".")
406 { 410 {
407 rescanFolder(directory + "/" + file->fileName()); 411 rescanFolder(directory + "/" + file->fileName());
408 } 412 }
409 } 413 }
410 else 414 else
411 { 415 {
412 // If it is a backup file add to list. 416 // If it is a backup file add to list.
413 if(file->fileName().contains(EXTENSION)) 417 if(file->fileName().contains(EXTENSION))
414 (void)new QListViewItem(restoreList, file->fileName()); 418 (void)new QListViewItem(restoreList, file->fileName());
415 } 419 }
416 ++it; 420 ++it;
417 } 421 }
418} 422}
419 423
420/** 424/**
421 * Restore a backup file. 425 * Restore a backup file.
422 * Report errors or success 426 * Report errors or success
423 */ 427 */
424void BackupAndRestore::restore() 428void BackupAndRestore::restore()
425{ 429{
426 QListViewItem *restoreItem = restoreList->currentItem(); 430 QListViewItem *restoreItem = restoreList->currentItem();
427 if(!restoreItem) 431 if(!restoreItem)
428 { 432 {
429 QMessageBox::critical(this, tr( "Message" ), 433 QMessageBox::critical(this, tr( "Message" ),
430 tr( "Please select something to restore." ),QString( tr( "Ok") ) ); 434 tr( "Please select something to restore." ),QString( tr( "Ok") ) );
431 return; 435 return;
432 } 436 }
433 setCaption(tr("Backup and Restore... working...")); 437 setCaption(tr("Backup and Restore... working..."));
434 438
435 QString restoreFile = backupLocations[restoreSource->currentText()]; 439 QString restoreFile = backupLocations[restoreSource->currentText()];
436 440
437 restoreFile += "/" + restoreItem->text(0); 441 restoreFile += "/" + restoreItem->text(0);
438 442
439 odebug << restoreFile << oendl; 443 odebug << restoreFile << oendl;
440 444
441 //check if backup file come from opie 1.0.x 445 //check if backup file come from opie 1.0.x
442 446
443 QString commandLine = QString( "tar -tzf %1 | grep Applications/backup/exclude" ).arg( restoreFile.latin1() ); 447 QString commandLine = QString( "tar -tzf %1 | grep Applications/backup/exclude" ).arg( restoreFile.latin1() );
444 448
445 int r = system( commandLine ); 449 int r = system( commandLine );
446 450
447 QString startDir; 451 QString startDir;
448 452
449 if( r != 0 ) //Applications/backup/exclude not found - old backup file 453 if( r != 0 ) //Applications/backup/exclude not found - old backup file
450 { 454 {
451 startDir = QString( "/" ); 455 startDir = QString( "/" );
452 } else 456 } else
453 { 457 {
454 startDir = QDir::homeDirPath(); 458 startDir = QDir::homeDirPath();
455 } 459 }
456 460
457 //unpack backup file 461 //unpack backup file
458 commandLine = QString( "cd %1 && tar -zxf %2 2> %3" ).arg( startDir ) 462 commandLine = QString( "cd %1 && tar -zxf %2 2> %3" ).arg( startDir )
459 .arg( restoreFile.latin1() ) 463 .arg( restoreFile.latin1() )
460 .arg( tempFileName.latin1() ); 464 .arg( tempFileName.latin1() );
461 465
462 odebug << commandLine << oendl; 466 odebug << commandLine << oendl;
463 467
464 r = system( commandLine ); 468 r = system( commandLine );
465 469
466 //error handling 470 //error handling
467 if(r != 0) 471 if(r != 0)
468 { 472 {
469 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); 473 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
470 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n" 474 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n"
471 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) ) 475 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) )
472 { 476 {
473 case 1: 477 case 1:
474 owarn << "Details pressed !" << oendl; 478 owarn << "Details pressed !" << oendl;
475 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); 479 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
476 QFile errorFile( tempFileName ); 480 QFile errorFile( tempFileName );
477 if ( errorFile.open(IO_ReadOnly) ) 481 if ( errorFile.open(IO_ReadOnly) )
478 { 482 {
479 QTextStream t( &errorFile ); 483 QTextStream t( &errorFile );
480 QString s; 484 QString s;
481 while ( !t.eof() ) 485 while ( !t.eof() )
482 { // until end of file... 486 { // until end of file...
483 s += t.readLine(); // line of text excluding '\n' 487 s += t.readLine(); // line of text excluding '\n'
484 } 488 }
485 errorFile.close(); 489 errorFile.close();
486 490
487 pErrDialog->m_textarea->setText( s ); 491 pErrDialog->m_textarea->setText( s );
488 } 492 }
489 else 493 else
490 { 494 {
491 pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) ); 495 pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) );
492 } 496 }
493 QPEApplication::execDialog( pErrDialog ); 497 QPEApplication::execDialog( pErrDialog );
494 delete pErrDialog; 498 delete pErrDialog;
495 499
496 setCaption(tr("Backup and Restore.. Failed !!")); 500 setCaption(tr("Backup and Restore.. Failed !!"));
497 return; 501 return;
498 502
499 break; 503 break;
500 504
501 } 505 }
502 } 506 }
503 else 507 else
504 { 508 {
505 QMessageBox::information(this, tr( "Message" ), tr( "Restore Successful." ), QString( tr( "Ok") ) ); 509 QMessageBox::information(this, tr( "Message" ), tr( "Restore Successful." ), QString( tr( "Ok") ) );
506 } 510 }
507 511
508 //write restore-location 512 //write restore-location
509 Config config( "BackupAndRestore" ); 513 Config config( "BackupAndRestore" );
510 config.setGroup( "LastLocation" ); 514 config.setGroup( "LastLocation" );
511 config.writeEntry( "LastRestoreLocation", restoreSource->currentText() ); 515 config.writeEntry( "LastRestoreLocation", restoreSource->currentText() );
512 516
513 setCaption(tr("Backup and Restore")); 517 setCaption(tr("Backup and Restore"));
514} 518}
515 519
516/** 520/**
517 * Check for exclude in Applications/backup 521 * Check for exclude in Applications/backup
518 * If it does not exist, the function will create the file with *.bck as content 522 * If it does not exist, the function will create the file with *.bck as content
519 * The exclude_files is read by tar and will provide to exclude special files out from backup. 523 * The exclude_files is read by tar and will provide to exclude special files out from backup.
520 * e.g. alle *.bck files (backup-files) will not be backed up by default 524 * e.g. alle *.bck files (backup-files) will not be backed up by default
521 */ 525 */
522 526
523QString BackupAndRestore::getExcludeFile() 527QString BackupAndRestore::getExcludeFile()
524{ 528{
525 QString excludeFileName = Global::applicationFileName( "backup", "exclude" ); 529 QString excludeFileName = Global::applicationFileName( "backup", "exclude" );
526 if ( !QFile::exists( excludeFileName ) ) 530 if ( !QFile::exists( excludeFileName ) )
527 { 531 {
528 QFile excludeFile( excludeFileName); 532 QFile excludeFile( excludeFileName);
529 if ( excludeFile.open( IO_WriteOnly ) == true ) 533 if ( excludeFile.open( IO_WriteOnly ) == true )
530 { 534 {
531 QTextStream writeStream( &excludeFile ); 535 QTextStream writeStream( &excludeFile );
532 writeStream << "*.bck" << "\n"; 536 writeStream << "*.bck" << "\n";
533 excludeFile.close(); 537 excludeFile.close();
534 } 538 }
535 else 539 else
536 { 540 {
537 return QString::null; 541 return QString::null;
538 } 542 }
539 } 543 }
540 544
541 return excludeFileName; 545 return excludeFileName;
542} 546}
543 547
544void BackupAndRestore::refreshLocations() 548void BackupAndRestore::refreshLocations()
545{ 549{
546 locationList->clear(); 550 locationList->clear();
547 551
548 //todo: implement add locations 552 //todo: implement add locations
549 Config config( "BackupAndRestore" ); 553 Config config( "BackupAndRestore" );
550 config.setGroup( "Locations" ); 554 config.setGroup( "Locations" );
551 555
552 QStringList locations( config.readListEntry( "locations", '|' ) ); 556 QStringList locations( config.readListEntry( "locations", '|' ) );
553 557
554 for ( QStringList::Iterator it = locations.begin(); it != locations.end(); ++it ) { 558 for ( QStringList::Iterator it = locations.begin(); it != locations.end(); ++it ) {
555 (void) new QListViewItem( locationList, *it ); 559 (void) new QListViewItem( locationList, *it );
556 } 560 }
557} 561}
558 562
559void BackupAndRestore::addLocation() 563void BackupAndRestore::addLocation()
560{ 564{
561 if ( ( !locationEdit->text().isEmpty() ) && 565 if ( ( !locationEdit->text().isEmpty() ) &&
562 ( QDir( locationEdit->text() ).exists() ) ) 566 ( QDir( locationEdit->text() ).exists() ) )
563 { 567 {
564 (void) new QListViewItem( locationList, locationEdit->text() ); 568 (void) new QListViewItem( locationList, locationEdit->text() );
565 locationEdit->setText( "" ); 569 locationEdit->setText( "" );
566 } 570 }
567} 571}
568 572
569void BackupAndRestore::removeLocation() 573void BackupAndRestore::removeLocation()
570{ 574{
571 if ( locationList->selectedItem() ) 575 if ( locationList->selectedItem() )
572 { 576 {
573 delete( locationList->selectedItem() ); 577 delete( locationList->selectedItem() );
574 } 578 }
575} 579}
576 580
577void BackupAndRestore::saveLocations() 581void BackupAndRestore::saveLocations()
578{ 582{
579 Config config("BackupAndRestore"); 583 Config config("BackupAndRestore");
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
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
@@ -1,53 +1,54 @@
1#ifndef WINDOW_H 1#ifndef WINDOW_H
2#define WINDOW_H 2#define WINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include "backuprestorebase.h" 5#include "backuprestorebase.h"
6#include <qmap.h> 6#include <qmap.h>
7#include <qlist.h> 7#include <qlist.h>
8 8
9class QListViewItem; 9class QListViewItem;
10class QStringList; 10class QStringList;
11 11
12class BackupAndRestore : public BackupAndRestoreBase 12class BackupAndRestore : public BackupAndRestoreBase
13{ 13{
14 14
15 Q_OBJECT 15 Q_OBJECT
16 16
17public: 17public:
18 18
19 BackupAndRestore( QWidget* parent = 0, const char* name = 0, WFlags fl = 0); 19 BackupAndRestore( QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
20 ~BackupAndRestore(); 20 ~BackupAndRestore();
21 21
22 static QString appName() { return QString::fromLatin1("backup"); } 22 static QString appName() { return QString::fromLatin1("backup"); }
23 23
24private slots: 24private slots:
25 void backup(); 25 void backup();
26 void restore(); 26 void restore();
27 void selectItem(QListViewItem *currentItem); 27 void selectItem(QListViewItem *currentItem);
28 void sourceDirChanged(int); 28 void sourceDirChanged(int);
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
36private: 37private:
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;
41 QList<QListViewItem> getAllItems(QListViewItem *item, QList<QListViewItem> &list); 42 QList<QListViewItem> getAllItems(QListViewItem *item, QList<QListViewItem> &list);
42 void refreshBackupLocations(); 43 void refreshBackupLocations();
43 void refreshLocations(); 44 void refreshLocations();
44 45
45 QListViewItem *systemSettings; 46 QListViewItem *systemSettings;
46 QListViewItem *applicationSettings; 47 QListViewItem *applicationSettings;
47 QListViewItem *documents; 48 QListViewItem *documents;
48}; 49};
49 50
50#endif 51#endif
51 52
52// backuprestore.h 53// backuprestore.h
53 54
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
@@ -1,309 +1,316 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>BackupAndRestoreBase</class> 2<class>BackupAndRestoreBase</class>
3<widget> 3<widget>
4 <class>QWidget</class> 4 <class>QWidget</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>BackupAndRestoreBase</cstring> 7 <cstring>BackupAndRestoreBase</cstring>
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>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <vbox> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>0</number> 31 <number>0</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>0</number> 35 <number>0</number>
36 </property> 36 </property>
37 <widget> 37 <widget>
38 <class>QTabWidget</class> 38 <class>QTabWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>tabWidget</cstring> 41 <cstring>tabWidget</cstring>
42 </property> 42 </property>
43 <property> 43 <property>
44 <name>layoutMargin</name> 44 <name>layoutMargin</name>
45 </property> 45 </property>
46 <property> 46 <property>
47 <name>layoutSpacing</name> 47 <name>layoutSpacing</name>
48 </property> 48 </property>
49 <widget> 49 <widget>
50 <class>QWidget</class> 50 <class>QWidget</class>
51 <property stdset="1"> 51 <property stdset="1">
52 <name>name</name> 52 <name>name</name>
53 <cstring>Widget2</cstring> 53 <cstring>Widget2</cstring>
54 </property> 54 </property>
55 <attribute> 55 <attribute>
56 <name>title</name> 56 <name>title</name>
57 <string>Backup</string> 57 <string>Backup</string>
58 </attribute> 58 </attribute>
59 <grid> 59 <grid>
60 <property stdset="1"> 60 <property stdset="1">
61 <name>margin</name> 61 <name>margin</name>
62 <number>4</number> 62 <number>4</number>
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>4</number>
67 </property> 67 </property>
68 <widget row="0" column="0" > 68 <widget row="0" column="0" >
69 <class>QLabel</class> 69 <class>QLabel</class>
70 <property stdset="1"> 70 <property stdset="1">
71 <name>name</name> 71 <name>name</name>
72 <cstring>TextLabel1</cstring> 72 <cstring>TextLabel1</cstring>
73 </property> 73 </property>
74 <property stdset="1"> 74 <property stdset="1">
75 <name>text</name> 75 <name>text</name>
76 <string>Save To</string> 76 <string>Save To</string>
77 </property> 77 </property>
78 </widget> 78 </widget>
79 <widget row="0" column="1" > 79 <widget row="0" column="1" >
80 <class>QComboBox</class> 80 <class>QComboBox</class>
81 <property stdset="1"> 81 <property stdset="1">
82 <name>name</name> 82 <name>name</name>
83 <cstring>storeToLocation</cstring> 83 <cstring>storeToLocation</cstring>
84 </property> 84 </property>
85 </widget> 85 </widget>
86 <widget row="2" column="0" rowspan="1" colspan="2" > 86 <widget row="2" column="0" rowspan="1" colspan="2" >
87 <class>QPushButton</class> 87 <class>QPushButton</class>
88 <property stdset="1"> 88 <property stdset="1">
89 <name>name</name> 89 <name>name</name>
90 <cstring>backupButton</cstring> 90 <cstring>backupButton</cstring>
91 </property> 91 </property>
92 <property stdset="1"> 92 <property stdset="1">
93 <name>text</name> 93 <name>text</name>
94 <string>&amp;Backup</string> 94 <string>&amp;Backup</string>
95 </property> 95 </property>
96 </widget> 96 </widget>
97 <widget row="1" column="0" rowspan="1" colspan="2" > 97 <widget row="1" column="0" rowspan="1" colspan="2" >
98 <class>QListView</class> 98 <class>QListView</class>
99 <column> 99 <column>
100 <property> 100 <property>
101 <name>text</name> 101 <name>text</name>
102 <string>Applications</string> 102 <string>Applications</string>
103 </property> 103 </property>
104 <property> 104 <property>
105 <name>clickable</name> 105 <name>clickable</name>
106 <bool>true</bool> 106 <bool>true</bool>
107 </property> 107 </property>
108 <property> 108 <property>
109 <name>resizeable</name> 109 <name>resizeable</name>
110 <bool>true</bool> 110 <bool>true</bool>
111 </property> 111 </property>
112 </column> 112 </column>
113 <property stdset="1"> 113 <property stdset="1">
114 <name>name</name> 114 <name>name</name>
115 <cstring>backupList</cstring> 115 <cstring>backupList</cstring>
116 </property> 116 </property>
117 <property stdset="1"> 117 <property stdset="1">
118 <name>allColumnsShowFocus</name> 118 <name>allColumnsShowFocus</name>
119 <bool>true</bool> 119 <bool>true</bool>
120 </property> 120 </property>
121 <property stdset="1"> 121 <property stdset="1">
122 <name>rootIsDecorated</name> 122 <name>rootIsDecorated</name>
123 <bool>true</bool> 123 <bool>true</bool>
124 </property> 124 </property>
125 </widget> 125 </widget>
126 </grid> 126 </grid>
127 </widget> 127 </widget>
128 <widget> 128 <widget>
129 <class>QWidget</class> 129 <class>QWidget</class>
130 <property stdset="1"> 130 <property stdset="1">
131 <name>name</name> 131 <name>name</name>
132 <cstring>Widget3</cstring> 132 <cstring>Widget3</cstring>
133 </property> 133 </property>
134 <attribute> 134 <attribute>
135 <name>title</name> 135 <name>title</name>
136 <string>Restore</string> 136 <string>Restore</string>
137 </attribute> 137 </attribute>
138 <grid> 138 <grid>
139 <property stdset="1"> 139 <property stdset="1">
140 <name>margin</name> 140 <name>margin</name>
141 <number>4</number> 141 <number>4</number>
142 </property> 142 </property>
143 <property stdset="1"> 143 <property stdset="1">
144 <name>spacing</name> 144 <name>spacing</name>
145 <number>4</number> 145 <number>4</number>
146 </property> 146 </property>
147 <widget row="0" column="1" > 147 <widget row="0" column="1" >
148 <class>QComboBox</class> 148 <class>QComboBox</class>
149 <property stdset="1"> 149 <property stdset="1">
150 <name>name</name> 150 <name>name</name>
151 <cstring>restoreSource</cstring> 151 <cstring>restoreSource</cstring>
152 </property> 152 </property>
153 </widget> 153 </widget>
154 <widget row="2" column="0" rowspan="1" colspan="2" > 154 <widget row="2" column="0" rowspan="1" colspan="2" >
155 <class>QPushButton</class> 155 <class>QPushButton</class>
156 <property stdset="1"> 156 <property stdset="1">
157 <name>name</name> 157 <name>name</name>
158 <cstring>restoreButton</cstring> 158 <cstring>restoreButton</cstring>
159 </property> 159 </property>
160 <property stdset="1"> 160 <property stdset="1">
161 <name>text</name> 161 <name>text</name>
162 <string>&amp;Restore</string> 162 <string>&amp;Restore</string>
163 </property> 163 </property>
164 </widget> 164 </widget>
165 <widget row="0" column="0" > 165 <widget row="0" column="0" >
166 <class>QLabel</class> 166 <class>QLabel</class>
167 <property stdset="1"> 167 <property stdset="1">
168 <name>name</name> 168 <name>name</name>
169 <cstring>TextLabel1_2</cstring> 169 <cstring>TextLabel1_2</cstring>
170 </property> 170 </property>
171 <property stdset="1"> 171 <property stdset="1">
172 <name>text</name> 172 <name>text</name>
173 <string>Select Source</string> 173 <string>Select Source</string>
174 </property> 174 </property>
175 </widget> 175 </widget>
176 <widget row="1" column="0" rowspan="1" colspan="2" > 176 <widget row="1" column="0" rowspan="1" colspan="2" >
177 <class>QListView</class> 177 <class>QListView</class>
178 <column> 178 <column>
179 <property> 179 <property>
180 <name>text</name> 180 <name>text</name>
181 <string>Column 1</string> 181 <string>Column 1</string>
182 </property> 182 </property>
183 <property> 183 <property>
184 <name>clickable</name> 184 <name>clickable</name>
185 <bool>true</bool> 185 <bool>true</bool>
186 </property> 186 </property>
187 <property> 187 <property>
188 <name>resizeable</name> 188 <name>resizeable</name>
189 <bool>true</bool> 189 <bool>true</bool>
190 </property> 190 </property>
191 </column> 191 </column>
192 <property stdset="1"> 192 <property stdset="1">
193 <name>name</name> 193 <name>name</name>
194 <cstring>restoreList</cstring> 194 <cstring>restoreList</cstring>
195 </property> 195 </property>
196 <property stdset="1"> 196 <property stdset="1">
197 <name>minimumSize</name> 197 <name>minimumSize</name>
198 <size> 198 <size>
199 <width>0</width> 199 <width>0</width>
200 <height>100</height> 200 <height>100</height>
201 </size> 201 </size>
202 </property> 202 </property>
203 </widget> 203 </widget>
204 </grid> 204 </grid>
205 </widget> 205 </widget>
206 <widget> 206 <widget>
207 <class>QWidget</class> 207 <class>QWidget</class>
208 <property stdset="1"> 208 <property stdset="1">
209 <name>name</name> 209 <name>name</name>
210 <cstring>tab</cstring> 210 <cstring>tab</cstring>
211 </property> 211 </property>
212 <attribute> 212 <attribute>
213 <name>title</name> 213 <name>title</name>
214 <string>Locations</string> 214 <string>Locations</string>
215 </attribute> 215 </attribute>
216 <grid> 216 <grid>
217 <property stdset="1"> 217 <property stdset="1">
218 <name>margin</name> 218 <name>margin</name>
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>
256 </property> 231 </property>
257 <property> 232 <property>
258 <name>clickable</name> 233 <name>clickable</name>
259 <bool>true</bool> 234 <bool>true</bool>
260 </property> 235 </property>
261 <property> 236 <property>
262 <name>resizeable</name> 237 <name>resizeable</name>
263 <bool>true</bool> 238 <bool>true</bool>
264 </property> 239 </property>
265 </column> 240 </column>
266 <property stdset="1"> 241 <property stdset="1">
267 <name>name</name> 242 <name>name</name>
268 <cstring>locationList</cstring> 243 <cstring>locationList</cstring>
269 </property> 244 </property>
270 </widget> 245 </widget>
271 <widget row="2" column="0" > 246 <widget row="2" column="0" >
272 <class>QPushButton</class> 247 <class>QPushButton</class>
273 <property stdset="1"> 248 <property stdset="1">
274 <name>name</name> 249 <name>name</name>
275 <cstring>addLocationButton</cstring> 250 <cstring>addLocationButton</cstring>
276 </property> 251 </property>
277 <property stdset="1"> 252 <property stdset="1">
278 <name>text</name> 253 <name>text</name>
279 <string>Add</string> 254 <string>Add</string>
280 </property> 255 </property>
281 </widget> 256 </widget>
282 <widget row="2" column="1" > 257 <widget row="2" column="1" >
283 <class>QPushButton</class> 258 <class>QPushButton</class>
284 <property stdset="1"> 259 <property stdset="1">
285 <name>name</name> 260 <name>name</name>
286 <cstring>removeLocationButton</cstring> 261 <cstring>removeLocationButton</cstring>
287 </property> 262 </property>
288 <property stdset="1"> 263 <property stdset="1">
289 <name>text</name> 264 <name>text</name>
290 <string>Remove</string> 265 <string>Remove</string>
291 </property> 266 </property>
292 </widget> 267 </widget>
293 <widget row="2" column="2" rowspan="1" colspan="2" > 268 <widget row="2" column="2" rowspan="1" colspan="2" >
294 <class>QPushButton</class> 269 <class>QPushButton</class>
295 <property stdset="1"> 270 <property stdset="1">
296 <name>name</name> 271 <name>name</name>
297 <cstring>saveLocationsButton</cstring> 272 <cstring>saveLocationsButton</cstring>
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