*/
runCmdPage::runCmdPage()
{
+ m_dtformat = "yyyy-MM-dd HH:mm:ss";
m_name = "Restore Run";
pgInitialize();
setupUi(this);
dockPage();
setCurrent();
this->show();
+
}
void runCmdPage::fill()
QStringList items;
QRegExp rx("^.*:\\s*(\\S.*$)"); /* Regex to get value */
+ clientCombo->addItems(m_console->client_list);
+ filesetCombo->addItems(m_console->fileset_list);
+ replaceCombo->addItems(QStringList() << "never" << "always" << "ifnewer" << "ifolder");
+ storageCombo->addItems(m_console->storage_list);
+ dateTimeEdit->setDisplayFormat(m_dtformat);
+
m_console->read();
item = m_console->msg();
items = item.split("\n");
continue;
}
if (item.startsWith("Backup Client:")) {
- clientCombo->addItem(val);
+ clientCombo->setCurrentIndex(clientCombo->findText(val, Qt::MatchExactly));
continue;
}
if (item.startsWith("Storage:")) {
- storageCombo->addItem(val);
+ storageCombo->setCurrentIndex(storageCombo->findText(val, Qt::MatchExactly));
continue;
}
if (item.startsWith("Where:")) {
continue;
}
if (item.startsWith("When:")) {
+ dateTimeEdit->setDateTime(QDateTime::fromString(val,m_dtformat));
continue;
}
if (item.startsWith("Catalog:")) {
catalogCombo->addItem(val);
continue;
}
- if (item.startsWith("Fileset:")) {
- filesetCombo->addItem(val);
+ if (item.startsWith("FileSet:")) {
+ filesetCombo->setCurrentIndex(filesetCombo->findText(val, Qt::MatchExactly));
continue;
}
if (item.startsWith("Priority:")) {
-// prioritySpin->setValue(atoi(val));
+ bool okay;
+ int pri = val.toInt(&okay, 10);
+ if (okay)
+ prioritySpin->setValue(pri);
+ continue;
+ }
+ if (item.startsWith("Replace:")) {
+ replaceCombo->setCurrentIndex(replaceCombo->findText(val, Qt::MatchExactly));
continue;
}
}
void runCmdPage::okButtonPushed()
{
-
- this->hide();
+ QString cmd(".mod");
+ cmd += " restoreclient=\"" + clientCombo->currentText() + "\"";
+ cmd += " fileset=\"" + filesetCombo->currentText() + "\"";
+ cmd += " storage=\"" + storageCombo->currentText() + "\"";
+ cmd += " replace=\"" + replaceCombo->currentText() + "\"";
+ cmd += " when=\"" + dateTimeEdit->dateTime().toString(m_dtformat) + "\"";
+ cmd += " bootstrap=\"" + bootstrap->text() + "\"";
+ cmd += " where=\"" + where->text() + "\"";
+ QString pri;
+ QTextStream(&pri) << "priority=\"" << prioritySpin->value() << "\"";
+ cmd += pri;
+ cmd += " yes\n";
- m_console->write_dir("yes");
- m_console->displayToPrompt();
+ consoleCommand(cmd);
m_console->notify(true);
closeStackPage();
- mainWin->resetFocus();
}
<rect>
<x>0</x>
<y>0</y>
- <width>678</width>
- <height>386</height>
+ <width>704</width>
+ <height>466</height>
</rect>
</property>
<property name="windowTitle" >
<property name="spacing" >
<number>6</number>
</property>
- <item row="1" column="1" colspan="2" >
- <layout class="QHBoxLayout" >
+ <item row="2" column="2" >
+ <layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<number>6</number>
</property>
<item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>131</width>
- <height>25</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="run" >
- <property name="maximumSize" >
- <size>
- <width>16777215</width>
- <height>30</height>
- </size>
- </property>
- <property name="text" >
- <string><h3>Restore Run</h3></string>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
</property>
- <property name="alignment" >
- <set>Qt::AlignCenter</set>
+ <property name="spacing" >
+ <number>6</number>
</property>
- </widget>
+ <item>
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Priority:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>prioritySpin</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="prioritySpin" >
+ <property name="maximum" >
+ <number>10000</number>
+ </property>
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ <property name="value" >
+ <number>12</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
<item>
<spacer>
<property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Fixed</enum>
+ <enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
- <width>131</width>
- <height>25</height>
+ <width>20</width>
+ <height>171</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
- <item row="3" column="1" colspan="2" >
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
+ <item rowspan="3" row="1" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="spacing" >
- <number>6</number>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
</property>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="okButton" >
- <property name="text" >
- <string>OK</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="cancelButton" >
- <property name="text" >
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- </layout>
+ </spacer>
+ </item>
+ <item row="4" column="1" colspan="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>572</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item rowspan="3" row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" colspan="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>572</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
</item>
<item row="2" column="1" >
<layout class="QGridLayout" >
<item row="8" column="1" >
<widget class="QLineEdit" name="where" >
<property name="enabled" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="minimumSize" >
<size>
<item row="7" column="1" >
<widget class="QLineEdit" name="bootstrap" >
<property name="enabled" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="minimumSize" >
<size>
</item>
</layout>
</item>
- <item row="2" column="2" >
- <layout class="QVBoxLayout" >
+ <item row="3" column="1" colspan="2" >
+ <layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<number>6</number>
</property>
<item>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>0</number>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="spacing" >
- <number>6</number>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
</property>
- <item row="1" column="1" >
- <widget class="QSpinBox" name="prioritySpin" >
- <property name="maximum" >
- <number>10000</number>
- </property>
- <property name="minimum" >
- <number>1</number>
- </property>
- <property name="value" >
- <number>10</number>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="typeCombo" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>150</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label_4" >
- <property name="text" >
- <string>Priority:</string>
- </property>
- <property name="buddy" >
- <cstring>prioritySpin</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="label_7" >
- <property name="text" >
- <string>Type:</string>
- </property>
- <property name="buddy" >
- <cstring>typeCombo</cstring>
- </property>
- </widget>
- </item>
- </layout>
+ </spacer>
</item>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="1" colspan="2" >
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
<item>
<spacer>
<property name="orientation" >
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
- <width>20</width>
- <height>171</height>
+ <width>131</width>
+ <height>25</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="run" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string><h3>Run Restore Job</h3></string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>131</width>
+ <height>25</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
- <item row="0" column="1" colspan="2" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::MinimumExpanding</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>572</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
- <item rowspan="3" row="1" column="3" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item rowspan="3" row="1" column="0" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="1" colspan="2" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::MinimumExpanding</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>572</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<resources/>