author | ar <ar> | 2005-02-01 19:54:57 (UTC) |
---|---|---|
committer | ar <ar> | 2005-02-01 19:54:57 (UTC) |
commit | 62aad63f824740f15357c28e6bb61fbdf2120585 (patch) (side-by-side diff) | |
tree | 079a6f219f8eed3743414b64b68e45d7003a08d7 | |
parent | 17a8d1d5d2d9ec7a5e09da00e055d566fbd85353 (diff) | |
download | opie-62aad63f824740f15357c28e6bb61fbdf2120585.zip opie-62aad63f824740f15357c28e6bb61fbdf2120585.tar.gz opie-62aad63f824740f15357c28e6bb61fbdf2120585.tar.bz2 |
- fix bug #1536
custom locations are stored and removed immadiately after add and remove in location list.
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 3 | ||||
-rw-r--r-- | noncore/settings/backup/backuprestorebase.ui | 308 |
2 files changed, 142 insertions, 169 deletions
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp index d028379..8928cda 100644 --- a/noncore/settings/backup/backuprestore.cpp +++ b/noncore/settings/backup/backuprestore.cpp @@ -78,25 +78,24 @@ const QString tempFileName = "/tmp/backup.err"; BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) : BackupAndRestoreBase(parent, name, fl) { backupList->header()->hide(); restoreList->header()->hide(); locationList->header()->hide(); connect( backupButton, SIGNAL( clicked() ), this, SLOT( backup() ) ); connect( restoreButton, SIGNAL( clicked() ), this, SLOT( restore() ) ); connect( backupList, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectItem( QListViewItem* ) ) ); 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); applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); selectItem(applicationSettings); documents= new QListViewItem(backupList, "Documents", "", "Documents/"); selectItem(documents); scanForApplicationSettings(); refreshLocations(); @@ -718,32 +717,34 @@ void BackupAndRestore::refreshLocations() for ( QStringList::Iterator it = locations.begin(); it != locations.end(); ++it ) { (void) new QListViewItem( locationList, *it ); } } void BackupAndRestore::addLocation() { if ( ( !locationEdit->text().isEmpty() ) && ( QDir( locationEdit->text() ).exists() ) ) { (void) new QListViewItem( locationList, locationEdit->text() ); locationEdit->setText( "" ); + saveLocations(); } } void BackupAndRestore::removeLocation() { if ( locationList->selectedItem() ) { delete( locationList->selectedItem() ); + saveLocations(); } } void BackupAndRestore::saveLocations() { Config config("BackupAndRestore"); config.setGroup("Locations"); QStringList locations; for ( QListViewItemIterator it( locationList ); it.current(); ++it ) { locations.append( it.current()->text( 0 ) ); diff --git a/noncore/settings/backup/backuprestorebase.ui b/noncore/settings/backup/backuprestorebase.ui index 6186d68..cca3dee 100644 --- a/noncore/settings/backup/backuprestorebase.ui +++ b/noncore/settings/backup/backuprestorebase.ui @@ -2,48 +2,48 @@ <class>BackupAndRestoreBase</class> <widget> <class>QWidget</class> <property stdset="1"> <name>name</name> <cstring>BackupAndRestoreBase</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>278</width> - <height>298</height> + <width>246</width> + <height>338</height> </rect> </property> <property stdset="1"> <name>caption</name> <string>Backup And Restore</string> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> - <vbox> + <grid> <property stdset="1"> <name>margin</name> - <number>0</number> + <number>2</number> </property> <property stdset="1"> <name>spacing</name> - <number>0</number> + <number>2</number> </property> - <widget> + <widget row="0" column="0" > <class>QTabWidget</class> <property stdset="1"> <name>name</name> <cstring>tabWidget</cstring> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <widget> @@ -56,203 +56,186 @@ <name>title</name> <string>Backup</string> </attribute> <grid> <property stdset="1"> <name>margin</name> <number>4</number> </property> <property stdset="1"> <name>spacing</name> <number>2</number> </property> - <widget row="0" column="0" > - <class>QLayoutWidget</class> + <widget row="1" column="1" > + <class>QComboBox</class> + <property stdset="1"> + <name>name</name> + <cstring>storeToLocation</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>3</hsizetype> + <vsizetype>1</vsizetype> + </sizepolicy> + </property> + </widget> + <widget row="1" column="0" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>labelDestination</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Destination</string> + </property> + </widget> + <widget row="3" column="0" rowspan="1" colspan="2" > + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>backupButton</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>&Backup</string> + </property> + </widget> + <widget row="2" column="0" rowspan="1" colspan="2" > + <class>QListView</class> + <column> + <property> + <name>text</name> + <string>Applications</string> + </property> + <property> + <name>clickable</name> + <bool>true</bool> + </property> + <property> + <name>resizeable</name> + <bool>true</bool> + </property> + </column> <property stdset="1"> <name>name</name> - <cstring>Layout1</cstring> + <cstring>backupList</cstring> + </property> + <property stdset="1"> + <name>allColumnsShowFocus</name> + <bool>true</bool> + </property> + <property stdset="1"> + <name>rootIsDecorated</name> + <bool>true</bool> + </property> + </widget> + <widget row="0" column="0" rowspan="1" colspan="2" > + <class>QButtonGroup</class> + <property stdset="1"> + <name>name</name> + <cstring>frame_type</cstring> + </property> + <property stdset="1"> + <name>title</name> + <string>Type</string> + </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> </property> <grid> <property stdset="1"> <name>margin</name> - <number>0</number> + <number>6</number> </property> <property stdset="1"> <name>spacing</name> - <number>6</number> + <number>2</number> </property> - <widget row="1" column="1" > - <class>QComboBox</class> - <property stdset="1"> - <name>name</name> - <cstring>storeToLocation</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>3</hsizetype> - <vsizetype>1</vsizetype> - </sizepolicy> - </property> - </widget> <widget row="1" column="0" > - <class>QLabel</class> + <class>QRadioButton</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1</cstring> + <cstring>cb_type_fullbackup</cstring> </property> <property stdset="1"> <name>text</name> - <string>Destination</string> + <string>Full Backup (Root File System)</string> </property> </widget> - <widget row="3" column="0" rowspan="1" colspan="2" > - <class>QPushButton</class> + <widget row="0" column="0" > + <class>QRadioButton</class> <property stdset="1"> <name>name</name> - <cstring>backupButton</cstring> + <cstring>cb_type_userdata</cstring> </property> <property stdset="1"> <name>text</name> - <string>&Backup</string> + <string>User Data (Configuration + PIM)</string> </property> - </widget> - <widget row="0" column="0" rowspan="1" colspan="2" > - <class>QButtonGroup</class> <property stdset="1"> - <name>name</name> - <cstring>frame_type</cstring> - </property> - <property stdset="1"> - <name>title</name> - <string>Type</string> - </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> - </property> - <vbox> - <property stdset="1"> - <name>margin</name> - <number>4</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>2</number> - </property> - <widget> - <class>QRadioButton</class> - <property stdset="1"> - <name>name</name> - <cstring>cb_type_userdata</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>User Data (Configuration + PIM)</string> - </property> - <property stdset="1"> - <name>checked</name> - <bool>true</bool> - </property> - </widget> - <widget> - <class>QRadioButton</class> - <property stdset="1"> - <name>name</name> - <cstring>cb_type_fullbackup</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Full Backup (Root File System)</string> - </property> - </widget> - </vbox> - </widget> - <widget row="2" column="0" rowspan="1" colspan="2" > - <class>QListView</class> - <column> - <property> - <name>text</name> - <string>Applications</string> - </property> - <property> - <name>clickable</name> - <bool>true</bool> - </property> - <property> - <name>resizeable</name> - <bool>true</bool> - </property> - </column> - <property stdset="1"> - <name>name</name> - <cstring>backupList</cstring> - </property> - <property stdset="1"> - <name>allColumnsShowFocus</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>rootIsDecorated</name> + <name>checked</name> <bool>true</bool> </property> </widget> </grid> </widget> </grid> </widget> <widget> <class>QWidget</class> <property stdset="1"> <name>name</name> <cstring>Widget3</cstring> </property> <attribute> <name>title</name> <string>Restore</string> </attribute> <grid> <property stdset="1"> <name>margin</name> <number>4</number> </property> <property stdset="1"> <name>spacing</name> - <number>4</number> + <number>2</number> </property> <widget row="0" column="1" > <class>QComboBox</class> <property stdset="1"> <name>name</name> <cstring>restoreSource</cstring> </property> </widget> <widget row="2" column="0" rowspan="1" colspan="2" > <class>QPushButton</class> <property stdset="1"> <name>name</name> <cstring>restoreButton</cstring> </property> <property stdset="1"> <name>text</name> <string>&Restore</string> </property> </widget> <widget row="0" column="0" > <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel1_2</cstring> + <cstring>destinationLabel</cstring> </property> <property stdset="1"> <name>text</name> <string>Select Source</string> </property> </widget> <widget row="1" column="0" rowspan="1" colspan="2" > <class>QListView</class> <column> <property> <name>text</name> <string>Column 1</string> @@ -288,106 +271,95 @@ </property> <attribute> <name>title</name> <string>Locations</string> </attribute> <grid> <property stdset="1"> <name>margin</name> <number>4</number> </property> <property stdset="1"> <name>spacing</name> - <number>4</number> + <number>2</number> </property> - <widget row="1" column="0" rowspan="1" colspan="4" > - <class>QListView</class> - <column> - <property> - <name>text</name> - <string>Locations</string> - </property> - <property> - <name>clickable</name> - <bool>true</bool> - </property> - <property> - <name>resizeable</name> - <bool>true</bool> - </property> - </column> + <widget row="0" column="2" > + <class>QPushButton</class> <property stdset="1"> <name>name</name> - <cstring>locationList</cstring> + <cstring>selectLocationButton</cstring> </property> - </widget> - <widget row="2" column="0" > - <class>QPushButton</class> <property stdset="1"> - <name>name</name> - <cstring>addLocationButton</cstring> + <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>Add</string> + <string>...</string> </property> </widget> - <widget row="2" column="1" > - <class>QPushButton</class> + <widget row="0" column="0" rowspan="1" colspan="2" > + <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>removeLocationButton</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Remove</string> + <cstring>locationEdit</cstring> </property> </widget> - <widget row="2" column="2" rowspan="1" colspan="2" > + <widget row="2" column="0" > <class>QPushButton</class> <property stdset="1"> <name>name</name> - <cstring>saveLocationsButton</cstring> + <cstring>addLocationButton</cstring> </property> <property stdset="1"> <name>text</name> - <string>Save</string> + <string>Add</string> </property> </widget> - <widget row="0" column="3" > + <widget row="2" column="1" rowspan="1" colspan="2" > <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> + <cstring>removeLocationButton</cstring> </property> <property stdset="1"> <name>text</name> - <string>...</string> + <string>Remove</string> </property> </widget> - <widget row="0" column="0" rowspan="1" colspan="3" > - <class>QLineEdit</class> + <widget row="1" column="0" rowspan="1" colspan="3" > + <class>QListView</class> + <column> + <property> + <name>text</name> + <string>Locations</string> + </property> + <property> + <name>clickable</name> + <bool>true</bool> + </property> + <property> + <name>resizeable</name> + <bool>true</bool> + </property> + </column> <property stdset="1"> <name>name</name> - <cstring>locationEdit</cstring> + <cstring>locationList</cstring> </property> </widget> </grid> </widget> </widget> - </vbox> + </grid> </widget> </UI> |