RestoreList->setRowCount(0);
}
+void bRestore::runRestore()
+{
+ bRunRestore *r = new bRunRestore(this);
+ r->setVisible(true);
+}
+
void bRestore::setupPage()
{
ClientList->addItem("Client list");
connect(LocationBp, SIGNAL(pressed()), this, SLOT(applyLocation()));
connect(MergeChk, SIGNAL(clicked()), this, SLOT(setJob()));
connect(ClearBp, SIGNAL(clicked()), this, SLOT(clearRestoreList()));
+ connect(RestoreBp, SIGNAL(clicked()), this, SLOT(runRestore()));
m_populated = true;
}
}
}
+void bRunRestore::UFRcb()
+{
+ if (UseFileRelocationChk->checkState() == Qt::Checked) {
+ WhereEntry->setEnabled(false);
+ UseRegexpChk->setEnabled(true);
+ if (UseRegexpChk->checkState() == Qt::Checked) {
+ AddSuffixEntry->setEnabled(false);
+ AddPrefixEntry->setEnabled(false);
+ StripPrefixEntry->setEnabled(false);
+ WhereRegexpEntry->setEnabled(true);
+ } else {
+ AddSuffixEntry->setEnabled(true);
+ AddPrefixEntry->setEnabled(true);
+ StripPrefixEntry->setEnabled(true);
+ WhereRegexpEntry->setEnabled(false);
+ }
+ } else {
+ WhereEntry->setEnabled(true);
+ AddSuffixEntry->setEnabled(false);
+ AddPrefixEntry->setEnabled(false);
+ StripPrefixEntry->setEnabled(false);
+ UseRegexpChk->setEnabled(false);
+ WhereRegexpEntry->setEnabled(false);
+ }
+}
+
+void bRunRestore::useRegexp()
+{
+ if (UseRegexpChk->checkState() == Qt::Checked) {
+ AddSuffixEntry->setEnabled(false);
+ AddPrefixEntry->setEnabled(false);
+ StripPrefixEntry->setEnabled(false);
+ WhereRegexpEntry->setEnabled(true);
+ } else {
+ AddSuffixEntry->setEnabled(true);
+ AddPrefixEntry->setEnabled(true);
+ StripPrefixEntry->setEnabled(true);
+ WhereRegexpEntry->setEnabled(false);
+ }
+}
+
+bRunRestore::bRunRestore(bRestore *parent)
+{
+ setupUi(this);
+ ClientCb->addItems(parent->console()->client_list);
+ int i = ClientCb->findText(parent->m_client);
+ if (i >= 0) {
+ ClientCb->setCurrentIndex(i);
+ }
+ StorageCb->addItem(QString(""));
+ RestoreCb->addItems(parent->console()->restore_list);
+ WhenEditor->setDateTime(QDateTime::currentDateTime());
+ StorageCb->addItems(parent->console()->storage_list);
+ connect(UseFileRelocationChk, SIGNAL(clicked()), this, SLOT(UFRcb()));
+ connect(UseRegexpChk, SIGNAL(clicked()), this, SLOT(useRegexp()));
+ struct job_defaults jd;
+ jd.job_name = parent->console()->restore_list[0];
+ parent->console()->get_job_defaults(jd);
+ WhereEntry->setText(jd.where);
+}
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>Dialog</class>
- <widget class="QDialog" name="Dialog">
+ <class>bRunRestoreForm</class>
+ <widget class="QDialog" name="bRunRestoreForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>385</width>
- <height>437</height>
+ <height>438</height>
</rect>
</property>
<property name="windowTitle">
<string>Restore options</string>
</property>
<layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
+ <property name="fieldGrowthPolicy">
+ <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ </property>
+ <item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Client:</string>
</property>
</widget>
</item>
- <item row="0" column="1">
+ <item row="1" column="1">
<widget class="QComboBox" name="ClientCb"/>
</item>
- <item row="1" column="0">
+ <item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Where:</string>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QLineEdit" name="WhereEntry"/>
</item>
- <item row="2" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Replace:</string>
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<widget class="QComboBox" name="ReplaceCb"/>
</item>
- <item row="3" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Comment:</string>
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QLineEdit" name="CommentEntry"/>
</item>
</layout>
<string>Other options</string>
</property>
<layout class="QFormLayout" name="formLayout_3">
- <item row="0" column="0">
+ <item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>When:</string>
</property>
</widget>
</item>
- <item row="1" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Priority:</string>
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QSpinBox" name="PrioritySb"/>
+ <item row="3" column="1">
+ <widget class="QSpinBox" name="PrioritySb">
+ <property name="value">
+ <number>10</number>
+ </property>
+ </widget>
</item>
- <item row="3" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Storage:</string>
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="5" column="1">
<widget class="QComboBox" name="StorageCb"/>
</item>
- <item row="0" column="1">
+ <item row="2" column="1">
<widget class="QDateTimeEdit" name="WhenEditor">
<property name="time">
<time>
</property>
</widget>
</item>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_14">
+ <property name="text">
+ <string>Job:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QComboBox" name="RestoreCb"/>
+ </item>
</layout>
- <zorder>label_5</zorder>
- <zorder>label_6</zorder>
- <zorder>label_7</zorder>
- <zorder>PrioritySb</zorder>
- <zorder>StorageCb</zorder>
- <zorder>groupBox_3</zorder>
- <zorder>WhenEditor</zorder>
</widget>
</item>
</layout>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
- <receiver>Dialog</receiver>
+ <receiver>bRunRestoreForm</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
- <receiver>Dialog</receiver>
+ <receiver>bRunRestoreForm</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">