{
m_console = console;
setupUi(this);
- fillDirectory("/");
+ fillDirectory("/home/kern/bacula/k");
this->show();
}
/*
* Fill the CList box with files at path
*/
-void restoreDialog::fillDirectory(const char *path)
+void restoreDialog::fillDirectory(const char *dir)
{
char pathbuf[MAXSTRING];
char modes[20], user[20], group[20], size[20], date[30];
- char file[1000];
char marked[10];
int row = 0;
+ int pnl, fnl;
+ POOLMEM *file = get_pool_memory(PM_FNAME);
+ POOLMEM *path = get_pool_memory(PM_FNAME);
m_console->setEnabled(false);
- m_fname = path;
+ m_fname = dir;
m_console->displayToPrompt();
- bsnprintf(pathbuf, sizeof(pathbuf), "cd %s", path);
+ bsnprintf(pathbuf, sizeof(pathbuf), "cd %s", dir);
Dmsg1(100, "%s\n", pathbuf);
+ QStringList titles;
+ titles << "Mark" << "File" << "Mode" << "User" << "Group" << "Size" << "Date";
+ fileWidget->setHeaderLabels(titles);
+
m_console->write(pathbuf);
m_console->display_text(pathbuf);
m_console->displayToPrompt();
m_console-> write_dir("dir");
m_console->display_text("dir");
+
+ QList<QTreeWidgetItem *> items;
+ QStringList item;
while (m_console->read() > 0) {
char *p = m_console->msg();
char *l;
if (*p == '$') {
break;
}
- Dmsg1(200, "Got: %s\n", p);
+// Dmsg1(000, "Got: %s\n", p);
if (!*p) {
continue;
}
} else {
bstrncpy(marked, " ", sizeof(marked));
}
-// split_path_and_filename(p, &restore->path, &restore->pnl,
-// &restore->file, &restore->fnl);
+ split_path_and_filename(p, &path, &pnl,
+ &file, &fnl);
-// Dmsg1(000, "restore->fname=%s\n", restore->fname);
-// bstrncpy(file, restore->file, sizeof(file));
- printf("modes=%s user=%s group=%s size=%s date=%s file=%s\n",
- modes, user, group, size, date, file);
+// printf("modes=%s user=%s group=%s size=%s date=%s path=%s file=%s\n",
+// modes, user, group, size, date, path, file);
-// append to list
+ item.clear();
+ item << "" << file << modes << user << group << size << date;
+ items.append(new QTreeWidgetItem((QTreeWidget *)0, item));
row++;
}
+ fileWidget->insertTopLevelItems(0, items);
- m_console->setEnabled(true);
+ m_console->setEnabled(true);
}
<rect>
<x>0</x>
<y>0</y>
- <width>1047</width>
- <height>764</height>
+ <width>688</width>
+ <height>649</height>
</rect>
</property>
<property name="windowTitle" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <widget class="QTreeWidget" name="treeWidget" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>7</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize" >
- <size>
- <width>16777215</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="sizeIncrement" >
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="alternatingRowColors" >
- <bool>true</bool>
- </property>
- <property name="columnCount" >
- <number>1</number>
- </property>
- <column>
- <property name="text" >
- <string>1</string>
- </property>
- </column>
- </widget>
- <widget class="QTreeWidget" name="fileWidget" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>188</horstretch>
- <verstretch>1</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>400</width>
- <height>0</height>
- </size>
- </property>
- <property name="sizeIncrement" >
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="alternatingRowColors" >
- <bool>true</bool>
- </property>
- <property name="columnCount" >
- <number>7</number>
- </property>
- <column>
- <property name="text" >
- <string>1</string>
- </property>
- </column>
- <column>
- <property name="text" >
- <string>1</string>
- </property>
- </column>
- <column>
- <property name="text" >
- <string>2</string>
+ <widget class="QWidget" name="" >
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
</property>
- </column>
- <column>
- <property name="text" >
- <string>3</string>
- </property>
- </column>
- <column>
- <property name="text" >
- <string>4</string>
+ <property name="spacing" >
+ <number>6</number>
</property>
- </column>
- <column>
- <property name="text" >
- <string>5</string>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </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="QLabel" name="label_3" >
+ <property name="text" >
+ <string><h2>Directories</h2></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QTreeWidget" name="treeWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="sizeIncrement" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="columnCount" >
+ <number>1</number>
+ </property>
+ <column>
+ <property name="text" >
+ <string>1</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="" >
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
</property>
- </column>
- <column>
- <property name="text" >
- <string>6</string>
+ <property name="spacing" >
+ <number>6</number>
</property>
- </column>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>61</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string><h2>Files</h2></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>91</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QTreeWidget" name="fileWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>144</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>400</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="sizeIncrement" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
+ <property name="columnCount" >
+ <number>7</number>
+ </property>
+ <column>
+ <property name="text" >
+ <string>1</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>1</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>2</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>3</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>4</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>5</string>
+ </property>
+ </column>
+ <column>
+ <property name="text" >
+ <string>6</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
</widget>
</widget>
</item>
</item>
</layout>
</item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Status:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit_2" />
+ </item>
+ </layout>
+ </item>
</layout>
</widget>
<resources/>