Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
goto ok_out;
}
- Jmsg(jcr, M_INFO, 0, _("The following %u JobId%s will be migrated: %s\n"),
+
+ Jmsg(jcr, M_INFO, 0, _("The following %u JobId%s were chosen to be migrated: %s\n"),
ids.count, ids.count==0?"":"s", ids.list);
+
Dmsg2(dbglevel, "Before loop count=%d ids=%s\n", ids.count, ids.list);
for (int i=1; i < (int)ids.count; i++) {
JobId = 0;
}
parse_args_only(ua->cmd, &ua->args, &ua->argc, ua->argk, ua->argv, MAX_CMD_ARGS);
if (ua->argc == 0) {
- bsendmsg(tree->ua, _("Illegal command. Enter \"done\" to exit.\n"));
+ bsendmsg(tree->ua, _("Invalid command. Enter \"done\" to exit.\n"));
continue;
}
break;
}
if (!found) {
- bsendmsg(tree->ua, _("Illegal command. Enter \"done\" to exit.\n"));
+ bsendmsg(tree->ua, _("Invalid command. Enter \"done\" to exit.\n"));
continue;
}
if (!stat) {
if (ua->argc != 2) {
- bsendmsg(ua, _("Too many arguments. Try using double quotes.\n"));
+ bsendmsg(ua, _("Too few or too many arguments. Try using double quotes.\n"));
return 1;
}
node = tree_cwd(ua->argk[1], tree->root, tree->node);
tree->node = node;
}
tree_getpath(tree->node, cwd, sizeof(cwd));
- bsendmsg(ua, _("cwd is: %s\n"), cwd);
+ if (ua->api) {
+ bsendmsg(ua, "%s", cwd);
+ } else {
+ bsendmsg(ua, _("cwd is: %s\n"), cwd);
+ }
return 1;
}
restoreDialog::restoreDialog(Console *console)
{
+ QStringList titles;
m_console = console;
m_console->setEnabled(false);
setupUi(this);
connect(fileWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),
this, SLOT(fileDoubleClicked(QTreeWidgetItem *, int)));
+ connect(upButton, SIGNAL(pressed()), this, SLOT(upButtonPushed()));
+ connect(markButton, SIGNAL(pressed()), this, SLOT(markButtonPushed()));
+ connect(unmarkButton, SIGNAL(pressed()), this, SLOT(unmarkButtonPushed()));
setFont(m_console->get_font());
m_console->displayToPrompt();
+
+
+ titles << "Mark" << "File" << "Mode" << "User" << "Group" << "Size" << "Date";
+ fileWidget->setHeaderLabels(titles);
+
+ get_cwd();
fillDirectory();
this->show();
}
*/
void restoreDialog::fillDirectory()
{
- char cd_cmd[MAXSTRING];
char modes[20], user[20], group[20], size[20], date[30];
char marked[10];
int pnl, fnl;
POOLMEM *file = get_pool_memory(PM_FNAME);
POOLMEM *path = get_pool_memory(PM_FNAME);
- QStringList titles;
-
- titles << "Mark" << "File" << "Mode" << "User" << "Group" << "Size" << "Date";
- fileWidget->setHeaderLabels(titles);
-
- char *dir = get_cwd();
- bsnprintf(cd_cmd, sizeof(cd_cmd), "cd \"%s\"\n", dir);
- Dmsg2(100, "dir=%s cmd=%s\n", dir, cd_cmd);
- m_console->write_dir(cd_cmd);
- m_console->discardToPrompt();
+ fileWidget->clear();
m_console->write_dir("dir");
QList<QTreeWidgetItem *> items;
QStringList item;
void restoreDialog::fileDoubleClicked(QTreeWidgetItem *item, int column)
{
char cmd[1000];
-// printf("cwd=%s Text=%s column=%d\n", m_cwd.toUtf8().data(),
-// item->text(1).toUtf8().data(), column);
if (column == 0) { /* mark/unmark */
if (item->text(0) == "*") {
bsnprintf(cmd, sizeof(cmd), "unmark \"%s\"\n", item->text(1).toUtf8().data());
item->setText(0, "*");
}
m_console->write(cmd);
-// printf("cmd=%s", cmd);
m_console->displayToPrompt();
return;
+ }
+ /*
+ * Double clicking other than column 0 means to decend into
+ * the directory -- or nothing if it is not a directory.
+ */
+ if (item->text(1).endsWith("/")) {
+ cwd(item->text(1).toUtf8().data());
+ fillDirectory();
+ }
+}
+
+void restoreDialog::upButtonPushed()
+{
+ cwd("..");
+ fillDirectory();
+}
+
+void restoreDialog::markButtonPushed()
+{
+ QList<QTreeWidgetItem *> items = fileWidget->selectedItems();
+ QTreeWidgetItem *item;
+ char cmd[1000];
+ foreach (item, items) {
+ Dmsg1(000, "item=%s\n", item->text(1).toUtf8().data());
+ if (item->text(0) == " ") {
+ bsnprintf(cmd, sizeof(cmd), "mark \"%s\"", item->text(1).toUtf8().data());
+ item->setText(0, "*");
+ m_console->write(cmd);
+ Dmsg1(000, "cmd=%s\n", cmd);
+ m_console->displayToPrompt();
+ }
+ }
+}
+
+void restoreDialog::unmarkButtonPushed()
+{
+ QList<QTreeWidgetItem *> items = fileWidget->selectedItems();
+ QTreeWidgetItem *item;
+ char cmd[1000];
+ foreach (item, items) {
+ if (item->text(0) == "*") {
+ bsnprintf(cmd, sizeof(cmd), "unmark \"%s\"", item->text(1).toUtf8().data());
+ item->setText(0, " ");
+ m_console->write(cmd);
+ Dmsg1(000, "cmd=%s\n", cmd);
+ m_console->displayToPrompt();
+ }
}
}
+/*
+ * Change current working directory
+ */
+bool restoreDialog::cwd(const char *dir)
+{
+ int stat;
+ char cd_cmd[MAXSTRING];
+
+ bsnprintf(cd_cmd, sizeof(cd_cmd), "cd \"%s\"\n", dir);
+ Dmsg2(100, "dir=%s cmd=%s\n", dir, cd_cmd);
+ m_console->write_dir(cd_cmd);
+ if ((stat = m_console->read()) > 0) {
+ m_cwd = m_console->msg();
+ Dmsg2(100, "cwd=%s msg=%s\n", m_cwd.toUtf8().data(), m_console->msg());
+ } else {
+ Dmsg1(000, "stat=%d\n", stat);
+ }
+ m_console->discardToPrompt();
+ lineEdit->clear();
+ lineEdit->insert(m_cwd);
+ return true; /* ***FIXME*** return real status */
+}
+
/*
* Return cwd when in tree restore mode
*/
restoreDialog(Console *parent);
void fillDirectory();
char *get_cwd();
+ bool cwd(const char *);
private slots:
void accept();
void reject();
void fileDoubleClicked(QTreeWidgetItem *item, int column);
+ void upButtonPushed();
+ void unmarkButtonPushed();
+ void markButtonPushed();
private:
Console *m_console;
<rect>
<x>0</x>
<y>0</y>
- <width>1196</width>
- <height>649</height>
+ <width>1285</width>
+ <height>759</height>
</rect>
</property>
<property name="windowTitle" >
<property name="spacing" >
<number>6</number>
</property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
<item>
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <widget class="QWidget" name="" >
+ <widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Preferred</enum>
+ </property>
<property name="sizeHint" >
<size>
- <width>40</width>
- <height>20</height>
+ <width>50</width>
+ <height>30</height>
</size>
</property>
</spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Preferred</enum>
+ </property>
<property name="sizeHint" >
<size>
- <width>40</width>
- <height>20</height>
+ <width>50</width>
+ <height>30</height>
</size>
</property>
</spacer>
<widget class="QTreeWidget" name="treeWidget" >
<property name="sizePolicy" >
<sizepolicy>
- <hsizetype>7</hsizetype>
+ <hsizetype>5</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</property>
<property name="minimumSize" >
<size>
- <width>100</width>
+ <width>60</width>
<height>0</height>
</size>
</property>
</property>
<property name="sizeIncrement" >
<size>
- <width>0</width>
+ <width>1</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="baseSize" >
+ <size>
+ <width>50</width>
<height>0</height>
</size>
</property>
</item>
</layout>
</widget>
- <widget class="QWidget" name="" >
+ <widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="upButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Up</string>
+ </property>
+ <property name="icon" >
+ <iconset>../images/up.png</iconset>
+ </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>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="markButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Mark</string>
+ </property>
+ <property name="icon" >
+ <iconset>../images/mark.png</iconset>
+ </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>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="unmarkButton" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Unmark</string>
+ </property>
+ <property name="icon" >
+ <iconset>../images/unmark.png</iconset>
+ </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>61</width>
</property>
<property name="sizeHint" >
<size>
- <width>91</width>
- <height>20</height>
+ <width>261</width>
+ <height>30</height>
</size>
</property>
</spacer>
<property name="text" >
<string>Current Dir:</string>
</property>
+ <property name="buddy" >
+ <cstring>lineEdit</cstring>
+ </property>
</widget>
</item>
<item>
</property>
<item>
<widget class="QLabel" name="label_4" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text" >
<string>Status:</string>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="lineEdit_2" />
+ <widget class="QLabel" name="statusLine" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
</item>
</layout>
</item>
</layout>
+ <action name="actionUp" >
+ <property name="icon" >
+ <iconset>../images/up.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Up</string>
+ </property>
+ </action>
+ <action name="actionMark" >
+ <property name="icon" >
+ <iconset>../images/mark.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Mark</string>
+ </property>
+ </action>
+ <action name="actionUnmark" >
+ <property name="icon" >
+ <iconset>../images/unmark.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Unmark</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
- <x>248</x>
- <y>254</y>
+ <x>955</x>
+ <y>719</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
- <x>316</x>
- <y>260</y>
+ <x>1023</x>
+ <y>719</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>