mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-11 06:05:21 -05:00
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:
parent
1aa6cde3ea
commit
76e6ad9069
4 changed files with 64 additions and 17 deletions
|
|
@ -32,6 +32,7 @@ Install::Install(RbSettings *sett,QWidget *parent) : QDialog(parent)
|
||||||
connect(ui.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool)));
|
connect(ui.radioCurrent, SIGNAL(toggled(bool)), this, SLOT(setDetailsCurrent(bool)));
|
||||||
connect(ui.radioArchived, SIGNAL(toggled(bool)), this, SLOT(setDetailsArchived(bool)));
|
connect(ui.radioArchived, SIGNAL(toggled(bool)), this, SLOT(setDetailsArchived(bool)));
|
||||||
connect(ui.changeBackup,SIGNAL(pressed()),this,SLOT(changeBackupPath()));
|
connect(ui.changeBackup,SIGNAL(pressed()),this,SLOT(changeBackupPath()));
|
||||||
|
connect(ui.backup,SIGNAL(stateChanged(int)),this,SLOT(backupCheckboxChanged(int)));
|
||||||
|
|
||||||
//! check if rockbox is already installed
|
//! check if rockbox is already installed
|
||||||
QString version = installedVersion(settings->mountpoint());
|
QString version = installedVersion(settings->mountpoint());
|
||||||
|
|
@ -39,12 +40,29 @@ Install::Install(RbSettings *sett,QWidget *parent) : QDialog(parent)
|
||||||
if(version != "")
|
if(version != "")
|
||||||
{
|
{
|
||||||
ui.Backupgroup->show();
|
ui.Backupgroup->show();
|
||||||
ui.backupLocation->setText(settings->mountpoint() + ".backup/rockbox-backup-"+version+".zip");
|
ui.backupLocation->setText(settings->mountpoint() + "/.backup/rockbox-backup-"+version+".zip");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui.Backupgroup->hide();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,6 @@ class Install : public QDialog
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void accept(void);
|
void accept(void);
|
||||||
void updateDataReadProgress(int read, int total);
|
|
||||||
void changeBackupPath();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::InstallFrm ui;
|
Ui::InstallFrm ui;
|
||||||
|
|
@ -56,6 +54,9 @@ class Install : public QDialog
|
||||||
void setDetailsStable(bool);
|
void setDetailsStable(bool);
|
||||||
void setDetailsArchived(bool);
|
void setDetailsArchived(bool);
|
||||||
void done(bool);
|
void done(bool);
|
||||||
|
void updateDataReadProgress(int read, int total);
|
||||||
|
void changeBackupPath();
|
||||||
|
void backupCheckboxChanged(int state);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>600</width>
|
<width>644</width>
|
||||||
<height>450</height>
|
<height>500</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
|
|
@ -163,17 +163,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
|
||||||
<widget class="QLabel" name="label_3" >
|
|
||||||
<property name="text" >
|
|
||||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
|
||||||
p, li { white-space: pre-wrap; }
|
|
||||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
|
||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">Backup Location:</span></p></body></html></string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" >
|
<item row="1" column="1" >
|
||||||
<widget class="QLabel" name="backupLocation" >
|
<widget class="QLabel" name="backupLocation" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
|
|
@ -183,12 +172,51 @@ p, li { white-space: pre-wrap; }
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2" >
|
<item row="1" column="2" >
|
||||||
<widget class="QPushButton" name="changeBackup" >
|
<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" >
|
<property name="text" >
|
||||||
<string>Change</string>
|
<string>Change</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||||
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
|
p, li { white-space: pre-wrap; }
|
||||||
|
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||||
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt; font-weight:600;">Backup Location:</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
<zorder>backup</zorder>
|
||||||
|
<zorder>backupLocation</zorder>
|
||||||
|
<zorder>changeBackup</zorder>
|
||||||
|
<zorder>backupLabel</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1" >
|
<item row="5" column="1" >
|
||||||
|
|
|
||||||
|
|
@ -473,7 +473,7 @@ bool RbUtilQt::installAuto()
|
||||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
|
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
logger->addItem(tr("Beginning Backup..."),LOGINFO);
|
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
|
//! create dir, if it doesnt exist
|
||||||
QFileInfo backupFile(backupName);
|
QFileInfo backupFile(backupName);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue