From: Dirk H Bartley Date: Mon, 28 May 2007 22:25:11 +0000 (+0000) Subject: Fix of restore issue with double click not unmarking. X-Git-Tag: Release-7.0.0~6217 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3e46a1076fb2dde2d85a18e2b2a4721d091e08eb;p=bacula%2Fbacula Fix of restore issue with double click not unmarking. Use folder.svg instead of folder.png git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4928 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/images/folder.png b/bacula/src/qt-console/images/folder.png deleted file mode 100644 index 901edc9624..0000000000 Binary files a/bacula/src/qt-console/images/folder.png and /dev/null differ diff --git a/bacula/src/qt-console/images/folder.svg b/bacula/src/qt-console/images/folder.svg new file mode 100644 index 0000000000..2027f56849 --- /dev/null +++ b/bacula/src/qt-console/images/folder.svg @@ -0,0 +1,422 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Folder Icon + + + + Jakub Steiner + + + + http://jimmac.musichall.cz + + + folder + directory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bacula/src/qt-console/main.qrc b/bacula/src/qt-console/main.qrc index ddd0cdb18f..55eb8a3062 100644 --- a/bacula/src/qt-console/main.qrc +++ b/bacula/src/qt-console/main.qrc @@ -15,7 +15,7 @@ images/edit-delete.svg images/emblem-system.svg images/estimate-job.svg - images/folder.png + images/folder.svg images/help-browser.svg images/home.png images/label.png diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 456e511ef8..00c11ac447 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -142,9 +142,11 @@ void restorePage::fillDirectory() QTreeWidgetItem *ti = new QTreeWidgetItem((QTreeWidget *)0, item); ti->setTextAlignment(5, Qt::AlignRight); /* right align size */ if (strcmp(marked, "*") == 0) { - ti->setIcon(0,QIcon(QString::fromUtf8(":images/check.png"))); + ti->setIcon(0, QIcon(QString::fromUtf8(":images/check.png"))); + ti->setData(0, Qt::UserRole, true); } else { - ti->setIcon(0,QIcon(QString::fromUtf8(":images/unchecked.png"))); + ti->setIcon(0, QIcon(QString::fromUtf8(":images/unchecked.png"))); + ti->setData(0, Qt::UserRole, false); } treeItemList.append(ti); } @@ -180,6 +182,8 @@ void restorePage::addDirectory(QString &newdirr) /* add unix '/' directory first */ if (m_dirPaths.empty() && (regex.indexIn(fullpath,0) == -1)) { QTreeWidgetItem *item = new QTreeWidgetItem(directoryWidget); + item->setIcon(0,QIcon(QString::fromUtf8(":images/folder.svg"))); + QString text("/"); item->setText(0, text.toUtf8().data()); if (mainWin->m_miscDebug) { @@ -192,7 +196,7 @@ void restorePage::addDirectory(QString &newdirr) if (regex.indexIn(fullpath,0) == 0) { /* this is a windows drive */ if (mainWin->m_miscDebug) { - printf("Need to do windows \"letter\":/\n"); + Pmsg0(000, "Need to do windows \"letter\":/\n"); } fullpath.replace(0,1,""); windrive = true; @@ -205,12 +209,14 @@ void restorePage::addDirectory(QString &newdirr) /* this is the base widget */ item = new QTreeWidgetItem(directoryWidget); item->setText(0, fullpath.toUtf8().data()); + item->setIcon(0,QIcon(QString::fromUtf8(":images/folder.svg"))); } else { QTreeWidgetItem *parent = m_dirPaths.value(m_cwd); if (parent) { /* new directories to add */ item = new QTreeWidgetItem(parent); item->setText(0, newdir.toUtf8().data()); + item->setIcon(0,QIcon(QString::fromUtf8(":images/folder.svg"))); directoryWidget->expandItem(parent); } else { ok = false; @@ -273,12 +279,14 @@ void restorePage::fileDoubleClicked(QTreeWidgetItem *item, int column) { char cmd[1000]; if (column == 0) { /* mark/unmark */ - if (item->text(0) == "*") { + if (item->data(0, Qt::UserRole).toBool()) { bsnprintf(cmd, sizeof(cmd), "unmark \"%s\"", item->text(1).toUtf8().data()); item->setIcon(0, QIcon(QString::fromUtf8(":images/unchecked.png"))); + item->setData(0, Qt::UserRole, false); } else { bsnprintf(cmd, sizeof(cmd), "mark \"%s\"", item->text(1).toUtf8().data()); item->setIcon(0, QIcon(QString::fromUtf8(":images/check.png"))); + item->setData(0, Qt::UserRole, true); } m_console->write_dir(cmd); if (m_console->read() > 0) {