prerestorePage::prerestorePage()
{
+ m_dtformat = "yyyy-MM-dd HH:MM:ss";
m_name = "Pre-Restore";
setupUi(this);
pgInitialize();
jobCombo->addItems(m_console->job_list);
filesetCombo->addItems(m_console->fileset_list);
clientCombo->addItems(m_console->client_list);
+ poolCombo->addItem("Any");
poolCombo->addItems(m_console->pool_list);
storageCombo->addItems(m_console->storage_list);
+ /* current or before . . Start out with current checked */
+ recentCheckBox->setCheckState(Qt::Checked);
+ beforeDateTime->setDisplayFormat(m_dtformat);
beforeDateTime->setDateTime(QDateTime::currentDateTime());
beforeDateTime->setEnabled(false);
+ selectFilesRadio->setChecked(true);
+ selectJobsRadio->setChecked(true);
+ jobIdEdit->setText("Comma separted list of jobs id's");
+ jobIdEdit->setEnabled(false);
job_name_change(0);
connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(job_name_change(int)));
connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
+ connect(recentCheckBox, SIGNAL(stateChanged(int)), this, SLOT(recentChanged(int)));
+ connect(selectJobsRadio, SIGNAL(toggled(bool)), this, SLOT(jobsRadioClicked(bool)));
dockPage();
setCurrent();
QString cmd;
this->hide();
-
- cmd = QString(
- "restore select current fileset=\"%1\" client=\"%2\" pool=\"%3\" "
- "storage=\"%4\"\n")
- .arg(filesetCombo->currentText())
- .arg(clientCombo->currentText())
- .arg(poolCombo->currentText())
- .arg(storageCombo->currentText());
+
+ cmd = QString("restore ");
+ if (selectFilesRadio->isChecked()) {
+ cmd += "select ";
+ } else {
+ cmd += "all done ";
+ }
+ cmd += "fileset=\"" + filesetCombo->currentText() + "\" ";
+ if (selectJobsRadio->isChecked()) {
+ cmd += "client=\"" + clientCombo->currentText() + "\" ";
+ if (poolCombo->currentText() != "Any" ){
+ cmd += "pool=\"" + poolCombo->currentText() + "\" ";
+ }
+ cmd += "storage=\"" + storageCombo->currentText() + "\" ";
+ if (recentCheckBox->checkState() == Qt::Checked) {
+ cmd += " current";
+ } else {
+ QDateTime stamp = beforeDateTime->dateTime();
+ QString before = stamp.toString(m_dtformat);
+ cmd += " before=\"" + before + "\"";
+ }
+ } else {
+ cmd += "jobid=\"" + jobIdEdit->text() + "\"";
+ }
/* ***FIXME*** */
- //printf("preRestore command \"%s\"\n", cmd.toUtf8().data());
- m_console->write(cmd);
- m_console->display_text(cmd);
+ //printf("preRestore command \'%s\'\n", cmd.toUtf8().data());
+ consoleCommand(cmd);
/* Note, do not turn notifier back on here ... */
- new restorePage();
- closeStackPage();
+ if (selectFilesRadio->isChecked()) {
+ new restorePage();
+ closeStackPage();
+ } else {
+ m_console->notify(true);
+ closeStackPage();
+ mainWin->resetFocus();
+ }
}
storageCombo->setCurrentIndex(storageCombo->findText(job_defs.store_name, Qt::MatchExactly));
}
}
+
+void prerestorePage::recentChanged(int state)
+{
+ if ((state == Qt::Unchecked) && (selectJobsRadio->isChecked())) {
+ beforeDateTime->setEnabled(true);
+ } else {
+ beforeDateTime->setEnabled(false);
+ }
+}
+
+void prerestorePage::jobsRadioClicked(bool checked)
+{
+ if (checked) {
+ printf("In prerestorePage::jobsRadioClicked checked\n");
+ jobCombo->setEnabled(true);
+// filesetCombo->setEnabled(true);
+ clientCombo->setEnabled(true);
+ poolCombo->setEnabled(true);
+ storageCombo->setEnabled(true);
+ recentCheckBox->setEnabled(true);
+ if (!recentCheckBox->isChecked()) {
+ beforeDateTime->setEnabled(true);
+ }
+ jobIdEdit->setEnabled(false);
+ } else {
+ printf("In prerestorePage::jobsRadioClicked UNchecked\n");
+ jobCombo->setEnabled(false);
+// filesetCombo->setEnabled(false);
+ clientCombo->setEnabled(false);
+ poolCombo->setEnabled(false);
+ storageCombo->setEnabled(false);
+ recentCheckBox->setEnabled(false);
+ beforeDateTime->setEnabled(false);
+ jobIdEdit->setEnabled(true);
+ }
+}
<rect>
<x>0</x>
<y>0</y>
- <width>578</width>
- <height>406</height>
+ <width>589</width>
+ <height>458</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
+ <property name="autoFillBackground" >
+ <bool>true</bool>
+ </property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
<property name="spacing" >
<number>6</number>
</property>
- <item row="1" column="0" >
+ <item row="0" column="1" >
<spacer>
<property name="orientation" >
- <enum>Qt::Horizontal</enum>
+ <enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
- <width>40</width>
- <height>20</height>
+ <width>20</width>
+ <height>40</height>
</size>
</property>
</spacer>
</property>
</spacer>
</item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>93</width>
+ <height>301</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
<item row="1" column="1" >
<layout class="QGridLayout" >
<property name="margin" >
<property name="spacing" >
<number>6</number>
</property>
- <item row="2" column="1" >
- <widget class="QComboBox" name="clientCombo" />
+ <item row="10" column="0" >
+ <widget class="QLabel" name="label_6" >
+ <property name="text" >
+ <string>Before:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>beforeDateTime</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="1" colspan="2" >
+ <widget class="QComboBox" name="storageCombo" />
+ </item>
+ <item row="7" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Pool:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>poolCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="10" column="1" colspan="2" >
+ <widget class="QDateTimeEdit" name="beforeDateTime" >
+ <property name="minimumDate" >
+ <date>
+ <year>2000</year>
+ <month>1</month>
+ <day>1</day>
+ </date>
+ </property>
+ <property name="displayFormat" >
+ <string>yyyy-mm-dd h:mm:ss</string>
+ </property>
+ <property name="calendarPopup" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="3" >
+ <widget class="QFrame" name="frame_2" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="lineWidth" >
+ <number>0</number>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" 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" >
+ <widget class="QRadioButton" name="selectJobsRadio" >
+ <property name="text" >
+ <string>Select Jobs</string>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QRadioButton" name="listJobsRadio" >
+ <property name="text" >
+ <string>List Jobs</string>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" 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>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="1" colspan="2" >
+ <widget class="QLineEdit" name="jobIdEdit" />
+ </item>
+ <item row="6" column="1" colspan="2" >
+ <widget class="QComboBox" name="filesetCombo" />
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Job:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>jobCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1" colspan="2" >
+ <widget class="QComboBox" name="poolCombo" />
+ </item>
+ <item row="9" column="0" colspan="2" >
+ <widget class="QCheckBox" name="recentCheckBox" >
+ <property name="layoutDirection" >
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="text" >
+ <string>Use Most Recent</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>221</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="8" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>Storage:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>storageCombo</cstring>
+ </property>
+ </widget>
</item>
<item row="3" column="0" >
+ <widget class="QLabel" name="label_7" >
+ <property name="text" >
+ <string>JobIds:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>jobCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>File Set:</string>
</property>
</widget>
</item>
- <item row="7" column="0" colspan="2" >
+ <item row="4" column="1" colspan="2" >
+ <widget class="QComboBox" name="jobCombo" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>600</width>
+ <height>600</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="11" column="0" colspan="3" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</item>
</layout>
</item>
- <item row="4" column="1" >
- <widget class="QComboBox" name="poolCombo" />
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="label_2" >
- <property name="text" >
- <string>Client:</string>
- </property>
- <property name="buddy" >
- <cstring>clientCombo</cstring>
- </property>
- </widget>
+ <item row="5" column="1" colspan="2" >
+ <widget class="QComboBox" name="clientCombo" />
</item>
- <item row="0" column="0" colspan="2" >
+ <item row="0" column="0" colspan="3" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</size>
</property>
<property name="text" >
- <string><h3>Pre - Restore</h3></string>
+ <string><h3>Select Jobs</h3></string>
</property>
</widget>
</item>
</item>
</layout>
</item>
- <item row="4" column="0" >
- <widget class="QLabel" name="label_4" >
- <property name="text" >
- <string>Pool:</string>
- </property>
- <property name="buddy" >
- <cstring>poolCombo</cstring>
- </property>
- </widget>
- </item>
- <item row="5" column="1" >
- <widget class="QComboBox" name="storageCombo" />
- </item>
- <item row="3" column="1" >
- <widget class="QComboBox" name="filesetCombo" />
- </item>
- <item row="6" column="0" >
- <widget class="QLabel" name="label_6" >
- <property name="text" >
- <string>Before:</string>
- </property>
- <property name="buddy" >
- <cstring>beforeDateTime</cstring>
- </property>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Job:</string>
+ <item row="1" column="0" colspan="3" >
+ <widget class="QFrame" name="frame" >
+ <property name="frameShape" >
+ <enum>QFrame::NoFrame</enum>
</property>
- <property name="buddy" >
- <cstring>jobCombo</cstring>
- </property>
- </widget>
- </item>
- <item row="6" column="1" >
- <widget class="QDateTimeEdit" name="beforeDateTime" >
- <property name="minimumDate" >
- <date>
- <year>2000</year>
- <month>1</month>
- <day>1</day>
- </date>
- </property>
- <property name="displayFormat" >
- <string>yyyy-mm-dd h:mm:ss</string>
- </property>
- <property name="calendarPopup" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QComboBox" name="jobCombo" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize" >
- <size>
- <width>600</width>
- <height>600</height>
- </size>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
</property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="2" >
+ <widget class="QRadioButton" name="allFilesRadio" >
+ <property name="text" >
+ <string>All Files</string>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QRadioButton" name="selectFilesRadio" >
+ <property name="text" >
+ <string>Select Files</string>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" 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 row="0" 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>
+ </layout>
</widget>
</item>
<item row="5" column="0" >
- <widget class="QLabel" name="label_5" >
+ <widget class="QLabel" name="label_2" >
<property name="text" >
- <string>Storage:</string>
+ <string>Client:</string>
</property>
<property name="buddy" >
- <cstring>storageCombo</cstring>
+ <cstring>clientCombo</cstring>
</property>
</widget>
</item>
</layout>
</item>
- <item row="0" column="1" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="1" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<resources/>