From 5f56ab623c99c12ce246f775e065632fbfbbfc1f Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 04 Nov 2004 15:12:01 +0000 Subject: - prepare for backing up root file systems (aka clone) - add file headers - add version to .pro --- (limited to 'noncore') diff --git a/noncore/settings/backup/backup.pro b/noncore/settings/backup/backup.pro index 390c599..e964c3a 100644 --- a/noncore/settings/backup/backup.pro +++ b/noncore/settings/backup/backup.pro @@ -6,5 +6,5 @@ DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopiecore2 -lopieui2 INTERFACES = backuprestorebase.ui errordialog.ui TARGET = backup - +VERSION = 0.8.1 include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index 1748e8d..c944c6d 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp @@ -1,20 +1,45 @@ +/* +                This file is part of the Opie Project + =. +             .=l. Copyright (c) 2002-2004 The Opie Team +           .>+-= + _;:,     .>    :=|. This file is free software; you can +.> <`_,   >  .   <= redistribute it and/or modify it under +:`=1 )Y*s>-.--   : the terms of the GNU General Public +.="- .-=="i,     .._ License as published by the Free Software + - .   .-<_>     .<> Foundation; either version 2 of the License, +     ._= =}       : or (at your option) any later version. +    .%`+i>       _;_. +    .i_,=:_.      -`: PARTICULAR PURPOSE. See the GNU General +..}^=.=       =       ; Public License for more details. +++=   -.     .`     .: + :     =  ...= . :.=- You should have received a copy of the GNU + -.   .:....=;==+<; General Public License along with this file; +  -_. . .   )=.  = see the file COPYING. If not, write to the +    --        :-=` Free Software Foundation, Inc., + 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + #include "backuprestore.h" #include "errordialog.h" - /* OPIE */ +#include +#include +#include #include #include -using namespace Opie::Core; - #include #include +using namespace Opie::Core; using namespace Opie::Ui; -#include -#include -#include - /* QT */ #include #include @@ -23,6 +48,7 @@ using namespace Opie::Ui; #include #include #include +#include #include #include #include @@ -244,6 +270,20 @@ void BackupAndRestore::scanForApplicationSettings() */ void BackupAndRestore::backup() { + if ( cb_type_userdata->isChecked() ) + backupUserData(); + else + backupRootFs(); +} + + +void BackupAndRestore::backupRootFs() +{ + QMessageBox::critical(this, "Message", "Not Yet Implemented", "Ok" ); +} + +void BackupAndRestore::backupUserData() +{ QString backupFiles; if(getBackupFiles(backupFiles, NULL) == 0) { @@ -256,7 +296,7 @@ void BackupAndRestore::backup() Global::statusMessage( tr( "Backing up..." ) ); owait->show(); qApp->processEvents(); - + QString outputFile = backupLocations[storeToLocation->currentText()]; QDateTime datetime = QDateTime::currentDateTime(); @@ -291,7 +331,7 @@ void BackupAndRestore::backup() owait->hide(); delete owait; - + //Error-Handling if(r != 0) { @@ -443,7 +483,7 @@ void BackupAndRestore::restore() tr( "Please select something to restore." ),QString( tr( "Ok") ) ); return; } - + OWait *owait = new OWait(); Global::statusMessage( tr( "Restore Backup..." ) ); owait->show(); @@ -482,7 +522,7 @@ void BackupAndRestore::restore() owait->hide(); delete owait; - + //error handling if(r != 0) { diff --git a/noncore/settings/backup/backuprestore.h b/noncore/settings/backup/backuprestore.h index 332123a..015f854 100644 --- a/noncore/settings/backup/backuprestore.h +++ b/noncore/settings/backup/backuprestore.h @@ -1,3 +1,31 @@ +/* +                This file is part of the Opie Project + =. +             .=l. Copyright (c) 2002-2004 The Opie Team +           .>+-= + _;:,     .>    :=|. This file is free software; you can +.> <`_,   >  .   <= redistribute it and/or modify it under +:`=1 )Y*s>-.--   : the terms of the GNU General Public +.="- .-=="i,     .._ License as published by the Free Software + - .   .-<_>     .<> Foundation; either version 2 of the License, +     ._= =}       : or (at your option) any later version. +    .%`+i>       _;_. +    .i_,=:_.      -`: PARTICULAR PURPOSE. See the GNU General +..}^=.=       =       ; Public License for more details. +++=   -.     .`     .: + :     =  ...= . :.=- You should have received a copy of the GNU + -.   .:....=;==+<; General Public License along with this file; +  -_. . .   )=.  = see the file COPYING. If not, write to the +    --        :-=` Free Software Foundation, Inc., + 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + #ifndef WINDOW_H #define WINDOW_H @@ -43,6 +71,9 @@ private: void refreshBackupLocations(); void refreshLocations(); + void backupUserData(); + void backupRootFs(); + QListViewItem *systemSettings; QListViewItem *applicationSettings; QListViewItem *documents; diff --git a/noncore/settings/backup/backuprestorebase.ui b/noncore/settings/backup/backuprestorebase.ui index b464556..6186d68 100644 --- a/noncore/settings/backup/backuprestorebase.ui +++ b/noncore/settings/backup/backuprestorebase.ui @@ -11,8 +11,8 @@ 0 0 - 282 - 243 + 278 + 298 @@ -63,65 +63,142 @@ spacing - 4 + 2 - QLabel - - name - TextLabel1 - - - text - Save To - - - - QComboBox + QLayoutWidget name - storeToLocation + Layout1 - - - QPushButton - - name - backupButton - - - text - &Backup - - - - QListView - - - text - Applications + + + margin + 0 - - clickable - true - - - resizeable - true + + spacing + 6 - - - name - backupList - - - allColumnsShowFocus - true - - - rootIsDecorated - true - + + QComboBox + + name + storeToLocation + + + sizePolicy + + 3 + 1 + + + + + QLabel + + name + TextLabel1 + + + text + Destination + + + + QPushButton + + name + backupButton + + + text + &Backup + + + + QButtonGroup + + name + frame_type + + + title + Type + + + layoutMargin + + + layoutSpacing + + + + margin + 4 + + + spacing + 2 + + + QRadioButton + + name + cb_type_userdata + + + text + User Data (Configuration + PIM) + + + checked + true + + + + QRadioButton + + name + cb_type_fullbackup + + + text + Full Backup (Root File System) + + + + + + QListView + + + text + Applications + + + clickable + true + + + resizeable + true + + + + name + backupList + + + allColumnsShowFocus + true + + + rootIsDecorated + true + + + -- cgit v0.9.0.2