rbutil: more improvements for the backup mechanism.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17465 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Wenger 2008-05-11 18:53:24 +00:00
parent 1aa6cde3ea
commit 76e6ad9069
4 changed files with 64 additions and 17 deletions

View file

@ -32,6 +32,7 @@ Install::Install(RbSettings *sett,QWidget *parent) : QDialog(parent)
connect(ui.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool)));
connect(ui.radioArchived, SIGNAL(toggled(bool)), this, SLOT(setDetailsArchived(bool)));
connect(ui.changeBackup,SIGNAL(pressed()),this,SLOT(changeBackupPath()));
connect(ui.backup,SIGNAL(stateChanged(int)),this,SLOT(backupCheckboxChanged(int)));
//! check if rockbox is already installed
QString version = installedVersion(settings->mountpoint());
@ -39,12 +40,29 @@ Install::Install(RbSettings *sett,QWidget *parent) : QDialog(parent)
if(version != "")
{
ui.Backupgroup->show();
ui.backupLocation->setText(settings->mountpoint() + ".backup/rockbox-backup-"+version+".zip");
ui.backupLocation->setText(settings->mountpoint() + "/.backup/rockbox-backup-"+version+".zip");
}
else
{
ui.Backupgroup->hide();
}
backupCheckboxChanged(Qt::Unchecked);
}
void Install::backupCheckboxChanged(int state)
{
if(state == Qt::Checked)
{
ui.backupLabel->show();
ui.backupLocation->show();
ui.changeBackup->show();
}
else
{
ui.backupLabel->hide();
ui.backupLocation->hide();
ui.changeBackup->hide();
}
}

View file

@ -36,8 +36,6 @@ class Install : public QDialog
public slots:
void accept(void);
void updateDataReadProgress(int read, int total);
void changeBackupPath();
private:
Ui::InstallFrm ui;
@ -56,6 +54,9 @@ class Install : public QDialog
void setDetailsStable(bool);
void setDetailsArchived(bool);
void done(bool);
void updateDataReadProgress(int read, int total);
void changeBackupPath();
void backupCheckboxChanged(int state);
};

View file

@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>450</height>
<width>644</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle" >
@ -163,17 +163,6 @@
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:8pt; font-weight:600;">Backup Location:&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="backupLocation" >
<property name="text" >
@ -183,12 +172,51 @@ p, li { white-space: pre-wrap; }
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="changeBackup" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>Change</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="backupLabel" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:8pt; font-weight:600;">Backup Location:&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
</layout>
<zorder>backup</zorder>
<zorder>backupLocation</zorder>
<zorder>changeBackup</zorder>
<zorder>backupLabel</zorder>
</widget>
</item>
<item row="5" column="1" >

View file

@ -473,7 +473,7 @@ bool RbUtilQt::installAuto()
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
{
logger->addItem(tr("Beginning Backup..."),LOGINFO);
QString backupName = settings->mountpoint() + ".backup/rockbox-backup-"+rbVersion+".zip";
QString backupName = settings->mountpoint() + "/.backup/rockbox-backup-"+rbVersion+".zip";
//! create dir, if it doesnt exist
QFileInfo backupFile(backupName);