<RCC>
- <qresource prefix="/" >
- <file>images/0p.png</file>
- <file>images/16p.png</file>
- <file>images/32p.png</file>
- <file>images/48p.png</file>
- <file>images/64p.png</file>
- <file>images/80p.png</file>
- <file>images/96p.png</file>
- <file>images/A.png</file>
- <file>images/R.png</file>
- <file>images/T.png</file>
- <file>images/W.png</file>
- <file>images/applications-graphics.png</file>
- <file>images/bat.png</file>
- <file>images/bat_icon.png</file>
- <file>images/browse.png</file>
- <file>images/cartridge-edit.png</file>
- <file>images/cartridge.png</file>
- <file>images/check.png</file>
- <file>images/connected.png</file>
- <file>images/copy.png</file>
- <file>images/cut.png</file>
- <file>images/disconnected.png</file>
- <file>images/edit-cut.png</file>
- <file>images/edit-delete.png</file>
- <file>images/edit.png</file>
- <file>images/emblem-system.png</file>
- <file>images/estimate-job.png</file>
- <file>images/extern.png</file>
- <file>images/f.png</file>
- <file>images/folder.png</file>
- <file>images/folderbothchecked.png</file>
- <file>images/folderchecked.png</file>
- <file>images/folderunchecked.png</file>
- <file>images/go-down.png</file>
- <file>images/go-jump.png</file>
- <file>images/go-up.png</file>
- <file>images/graph1.png</file>
- <file>images/help-browser.png</file>
- <file>images/inflag0.png</file>
- <file>images/inflag1.png</file>
- <file>images/inflag2.png</file>
- <file>images/intern.png</file>
- <file>images/joblog.png</file>
- <file>images/label.png</file>
- <file>images/mail-message-new.png</file>
- <file>images/mail-message-pending.png</file>
- <file>images/mark.png</file>
- <file>images/network-server.png</file>
- <file>images/new.png</file>
- <file>images/open.png</file>
- <file>images/package-x-generic.png</file>
- <file>images/paste.png</file>
- <file>images/print.png</file>
- <file>images/purge.png</file>
- <file>images/restore.png</file>
- <file>images/run.png</file>
- <file>images/runit.png</file>
- <file>images/save.png</file>
- <file>images/status-console.png</file>
- <file>images/status.png</file>
- <file>images/system-file-manager.png</file>
- <file>images/unchecked.png</file>
- <file>images/undo.png</file>
- <file>images/unmark.png</file>
- <file>images/up.png</file>
- <file>images/utilities-terminal.png</file>
- <file>images/view-refresh.png</file>
- <file>images/weather-severe-alert.png</file>
- <file>images/zoom.png</file>
- </qresource>
+ <qresource prefix="/">
+ <file>images/page-prev.gif</file>
+ <file>images/page-next.gif</file>
+ <file>images/0p.png</file>
+ <file>images/16p.png</file>
+ <file>images/32p.png</file>
+ <file>images/48p.png</file>
+ <file>images/64p.png</file>
+ <file>images/80p.png</file>
+ <file>images/96p.png</file>
+ <file>images/A.png</file>
+ <file>images/R.png</file>
+ <file>images/T.png</file>
+ <file>images/W.png</file>
+ <file>images/applications-graphics.png</file>
+ <file>images/bat.png</file>
+ <file>images/bat_icon.png</file>
+ <file>images/browse.png</file>
+ <file>images/cartridge-edit.png</file>
+ <file>images/cartridge.png</file>
+ <file>images/check.png</file>
+ <file>images/connected.png</file>
+ <file>images/copy.png</file>
+ <file>images/cut.png</file>
+ <file>images/disconnected.png</file>
+ <file>images/edit-cut.png</file>
+ <file>images/edit-delete.png</file>
+ <file>images/edit.png</file>
+ <file>images/emblem-system.png</file>
+ <file>images/estimate-job.png</file>
+ <file>images/extern.png</file>
+ <file>images/f.png</file>
+ <file>images/folder.png</file>
+ <file>images/folderbothchecked.png</file>
+ <file>images/folderchecked.png</file>
+ <file>images/folderunchecked.png</file>
+ <file>images/go-down.png</file>
+ <file>images/go-jump.png</file>
+ <file>images/go-up.png</file>
+ <file>images/graph1.png</file>
+ <file>images/help-browser.png</file>
+ <file>images/inflag0.png</file>
+ <file>images/inflag1.png</file>
+ <file>images/inflag2.png</file>
+ <file>images/intern.png</file>
+ <file>images/joblog.png</file>
+ <file>images/label.png</file>
+ <file>images/mail-message-new.png</file>
+ <file>images/mail-message-pending.png</file>
+ <file>images/mark.png</file>
+ <file>images/network-server.png</file>
+ <file>images/new.png</file>
+ <file>images/open.png</file>
+ <file>images/package-x-generic.png</file>
+ <file>images/paste.png</file>
+ <file>images/print.png</file>
+ <file>images/purge.png</file>
+ <file>images/restore.png</file>
+ <file>images/run.png</file>
+ <file>images/runit.png</file>
+ <file>images/save.png</file>
+ <file>images/status-console.png</file>
+ <file>images/status.png</file>
+ <file>images/system-file-manager.png</file>
+ <file>images/unchecked.png</file>
+ <file>images/undo.png</file>
+ <file>images/unmark.png</file>
+ <file>images/up.png</file>
+ <file>images/utilities-terminal.png</file>
+ <file>images/view-refresh.png</file>
+ <file>images/weather-severe-alert.png</file>
+ <file>images/zoom.png</file>
+ </qresource>
</RCC>
arg = " path=\"" + m_path + "\"";
}
LocationEntry->setText(m_path);
-
- QString q = ".bvfs_lsdir jobid=" + m_jobids + arg;
+ QString offset = QString().setNum(Offset1Spin->value());
+ QString limit=QString().setNum(Offset2Spin->value() - Offset1Spin->value());
+ QString q = ".bvfs_lsdir jobid=" + m_jobids + arg
+ + " limit=" + limit + " offset=" + offset ;
if (m_console->dir_cmd(q, results)) {
nb = results.size();
FileList->setRowCount(nb);
item.setTextFld(col++, fieldlist.at(5)); // path
decode_stat(fieldlist.at(4).toLocal8Bit().data(),
&statp, &LinkFI);
+ item.setBytesFld(col++, QString().setNum(statp.st_size));
item.setDateFld(col++, statp.st_mtime); // date
fieldlist.replace(3, m_jobids); // use current jobids selection
item.widget(1)->setData(Qt::UserRole, fieldlist.join("\t")); // keep info
}
results.clear();
- q = ".bvfs_lsfiles jobid=" + m_jobids + arg;
+ q = ".bvfs_lsfiles jobid=" + m_jobids + arg
+ + " limit=" + limit + " offset=" + offset ;
if (m_console->dir_cmd(q, results)) {
FileList->setRowCount(results.size() + nb);
foreach (QString resultline, results) {
bRunRestore::bRunRestore(bRestore *parent)
{
+ brestore = parent;
setupUi(this);
ClientCb->addItems(parent->console()->client_list);
int i = ClientCb->findText(parent->m_client);
StorageCb->addItems(parent->console()->storage_list);
connect(UseFileRelocationChk, SIGNAL(clicked()), this, SLOT(UFRcb()));
connect(UseRegexpChk, SIGNAL(clicked()), this, SLOT(useRegexp()));
+ connect(ActionBp, SIGNAL(accepted()), this, SLOT(computeRestore()));
struct job_defaults jd;
jd.job_name = parent->console()->restore_list[0];
- parent->console()->get_job_defaults(jd);
+ brestore->console()->get_job_defaults(jd);
WhereEntry->setText(jd.where);
+ computeVolumeList();
+}
+
+void bRestore::get_info_from_selection(QStringList &fileids,
+ QStringList &jobids,
+ QStringList &dirids,
+ QStringList &findexes)
+{
+ struct stat statp;
+ int32_t LinkFI;
+ for (int i=0; i < RestoreList->rowCount(); i++) {
+ QTableWidgetItem *item = RestoreList->item(i, 1);
+ QString data = item->data(Qt::UserRole).toString();
+ QStringList lst = data.split("\t");
+ if (lst.at(1) != "0") { // skip path
+ fileids << lst.at(2);
+ jobids << lst.at(3);
+ decode_stat(lst.at(4).toLocal8Bit().data(),
+ &statp, &LinkFI);
+ if (LinkFI) {
+ findexes << lst.at(3) + "," + QString().setNum(LinkFI);
+ }
+ } else {
+ dirids << lst.at(0);
+ jobids << lst.at(3).split(","); // Can have multiple jobids
+ }
+ }
+ fileids.removeDuplicates();
+ jobids.removeDuplicates();
+ dirids.removeDuplicates();
+ findexes.removeDuplicates();
+ qDebug() << fileids << jobids << dirids << findexes;
+}
+
+void bRunRestore::computeVolumeList()
+{
+ brestore->get_info_from_selection(m_fileids, m_jobids, m_dirids, m_findexes);
+ if (m_fileids.size() == 0) {
+ return;
+ }
+
+ Freeze frz_lst(*TableMedia); /* disable updating*/
+ QString q =
+" SELECT DISTINCT VolumeName, Enabled, InChanger "
+ " FROM File, "
+ " ( " // -- Get all media from this job
+ " SELECT MIN(FirstIndex) AS FirstIndex, MAX(LastIndex) AS LastIndex, "
+ " VolumeName, Enabled, Inchanger "
+ " FROM JobMedia JOIN Media USING (MediaId) "
+ " WHERE JobId IN (" + m_jobids.join(",") + ") "
+ " GROUP BY VolumeName,Enabled,InChanger "
+ " ) AS allmedia "
+ " WHERE File.FileId IN (" + m_fileids.join(",") + ") "
+ " AND File.FileIndex >= allmedia.FirstIndex "
+ " AND File.FileIndex <= allmedia.LastIndex ";
+ int row=0;
+ QStringList results;
+ if (brestore->console()->sql_cmd(q, results)) {
+ QStringList fieldlist;
+ TableMedia->setRowCount(results.size());
+ /* Iterate through the record returned from the query */
+ foreach (QString resultline, results) {
+ // 0 1 2
+ //volname, enabled, inchanger
+ fieldlist = resultline.split("\t");
+ int col=0;
+ TableItemFormatter item(*TableMedia, row++);
+ item.setInChanger(col++, fieldlist.at(2)); // inchanger
+ item.setTextFld(col++, fieldlist.at(0)); // Volume
+ }
+ }
+ TableMedia->verticalHeader()->hide();
+ TableMedia->resizeColumnsToContents();
+ TableMedia->resizeRowsToContents();
+ TableMedia->setEditTriggers(QAbstractItemView::NoEditTriggers);
+}
+
+void bRunRestore::computeRestore()
+{
+ QString q = ".bvfs_restore path=b2123 jobid=" + m_jobids.join(",");
+ if (m_fileids.size() > 0) {
+ q += " fileid=" + m_fileids.join(",");
+ }
+ if (m_dirids.size() > 0) {
+ q += " dirid=" + m_dirids.join(",");
+ }
+ if (m_findexes.size() > 0) {
+ q += " hardlink=" + m_findexes.join(",");
+ }
+ qDebug() << q;
+
+ QStringList results;
+ if (brestore->console()->dir_cmd(q, results)) {
+ if (results.size() == 1 && results[0] == "OK") {
+ qDebug() << "Run restore!";
+ q = ".bvfs_cleanup path=b2123";
+ brestore->console()->dir_cmd(q, results);
+ }
+ }
}
<property name="spacing">
<number>6</number>
</property>
+ <item row="0" column="0">
+ <layout class="QHBoxLayout">
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QComboBox" name="ClientList">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="JobList">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="sizeAdjustPolicy">
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="MergeChk">
+ <property name="text">
+ <string>Merge Jobs</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="VersionsChk">
+ <property name="text">
+ <string>View all Versions</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="LocationBp">
+ <property name="text">
+ <string>Location</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="LocationEntry"/>
+ </item>
+ </layout>
+ </item>
<item row="1" column="0">
<widget class="QSplitter" name="splitter_2">
<property name="orientation">
<property name="title">
<string>File list</string>
</property>
- <layout class="QVBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>9</number>
- </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="bRestoreTable" name="FileList">
<property name="sizePolicy">
</column>
</widget>
</item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinimumSize</enum>
+ </property>
+ <item>
+ <widget class="QPushButton" name="OffsetPrevBp">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../main.qrc">
+ <normaloff>:/images/page-prev.gif</normaloff>:/images/page-prev.gif</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="Offset1Spin">
+ <property name="buttonSymbols">
+ <enum>QAbstractSpinBox::NoButtons</enum>
+ </property>
+ <property name="maximum">
+ <number>9000000</number>
+ </property>
+ <property name="singleStep">
+ <number>500</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>-</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="Offset2Spin">
+ <property name="buttonSymbols">
+ <enum>QAbstractSpinBox::NoButtons</enum>
+ </property>
+ <property name="accelerated">
+ <bool>false</bool>
+ </property>
+ <property name="minimum">
+ <number>0</number>
+ </property>
+ <property name="maximum">
+ <number>9999999</number>
+ </property>
+ <property name="singleStep">
+ <number>500</number>
+ </property>
+ <property name="value">
+ <number>500</number>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="OffsetNextBp">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../main.qrc">
+ <normaloff>:/images/page-next.gif</normaloff>:/images/page-next.gif</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="FilterEntry">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>111</width>
+ <height>23</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="FilterBp">
+ <property name="baseSize">
+ <size>
+ <width>25</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../main.qrc">
+ <normaloff>:/images/view-refresh.png</normaloff>:/images/view-refresh.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_2">
</widget>
</widget>
</item>
- <item row="0" column="0">
- <layout class="QHBoxLayout">
- <property name="spacing">
- <number>6</number>
- </property>
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QComboBox" name="ClientList">
- <property name="sizePolicy">
- <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="JobList">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="sizeAdjustPolicy">
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QCheckBox" name="MergeChk">
- <property name="text">
- <string>Merge Jobs</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="VersionsChk">
- <property name="text">
- <string>View all Versions</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="LocationBp">
- <property name="text">
- <string>Location</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="LocationEntry"/>
- </item>
- </layout>
- </item>
</layout>
</widget>
<customwidgets>
<header>restore.h</header>
</customwidget>
</customwidgets>
- <resources/>
- <connections/>
+ <resources>
+ <include location="../main.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>OffsetNextBp</sender>
+ <signal>clicked()</signal>
+ <receiver>Offset2Spin</receiver>
+ <slot>stepUp()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>275</x>
+ <y>279</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>232</x>
+ <y>279</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>OffsetNextBp</sender>
+ <signal>clicked()</signal>
+ <receiver>Offset1Spin</receiver>
+ <slot>stepUp()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>272</x>
+ <y>281</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>92</x>
+ <y>279</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>OffsetPrevBp</sender>
+ <signal>clicked()</signal>
+ <receiver>Offset1Spin</receiver>
+ <slot>stepDown()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>44</x>
+ <y>287</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>123</x>
+ <y>282</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>OffsetPrevBp</sender>
+ <signal>clicked()</signal>
+ <receiver>Offset2Spin</receiver>
+ <slot>stepDown()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>50</x>
+ <y>284</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>221</x>
+ <y>282</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
</ui>
void PgSeltreeWidgetClicked();
QString m_client;
QString m_jobids;
+ void get_info_from_selection(QStringList &fileids, QStringList &jobids,
+ QStringList &dirids, QStringList &fileindexes);
public slots:
void setClient();
class bRunRestore : public QDialog, public Ui::bRunRestoreForm
{
Q_OBJECT
+private:
+ bRestore *brestore;
+ QStringList m_fileids, m_jobids, m_dirids, m_findexes;
public:
bRunRestore(bRestore *parent);
~bRunRestore() {}
+ void computeVolumeList();
+
public slots:
void useRegexp();
void UFRcb();
+ void computeRestore();
};
#endif /* _RESTORE_H_ */
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
- <widget class="QTableView" name="TableMedia"/>
+ <widget class="QTableWidget" name="TableMedia">
+ <property name="showGrid">
+ <bool>false</bool>
+ </property>
+ <property name="gridStyle">
+ <enum>Qt::NoPen</enum>
+ </property>
+ <column>
+ <property name="text">
+ <string>InChanger</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Volume</string>
+ </property>
+ </column>
+ </widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
</widget>
</item>
<item>
- <widget class="QDialogButtonBox" name="buttonBox">
+ <widget class="QDialogButtonBox" name="ActionBp">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<resources/>
<connections>
<connection>
- <sender>buttonBox</sender>
+ <sender>ActionBp</sender>
<signal>accepted()</signal>
<receiver>bRunRestoreForm</receiver>
<slot>accept()</slot>
</hints>
</connection>
<connection>
- <sender>buttonBox</sender>
+ <sender>ActionBp</sender>
<signal>rejected()</signal>
<receiver>bRunRestoreForm</receiver>
<slot>reject()</slot>