From ff01daf6662834a635872c94ab19407b3362c7dd Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Thu, 24 May 2007 21:06:17 +0000 Subject: [PATCH] Experimenting with adding icons to a tree widget in the restore class. This shows a green check if checked and a verrry light grey check if unchecked. I created these icons myself in inkscape. *.svg are also committed. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4902 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/images/check.png | Bin 0 -> 551 bytes bacula/src/qt-console/images/check.svg | 94 ++++++++++++++++++++ bacula/src/qt-console/images/unchecked.png | Bin 0 -> 461 bytes bacula/src/qt-console/images/unchecked.svg | 97 +++++++++++++++++++++ bacula/src/qt-console/main.qrc | 2 + bacula/src/qt-console/restore/restore.cpp | 17 ++-- 6 files changed, 204 insertions(+), 6 deletions(-) create mode 100644 bacula/src/qt-console/images/check.png create mode 100644 bacula/src/qt-console/images/check.svg create mode 100644 bacula/src/qt-console/images/unchecked.png create mode 100644 bacula/src/qt-console/images/unchecked.svg diff --git a/bacula/src/qt-console/images/check.png b/bacula/src/qt-console/images/check.png new file mode 100644 index 0000000000000000000000000000000000000000..84055cc7a6399cd039928120f60a776dff31575e GIT binary patch literal 551 zcmV+?0@(eDP)5 zlRHS8VHAd+|BnzcL=D!uHC`4`hiVYCM2kA=;DsWHLljihK_hC#OC0P_P$=THG~l3< z4h2h-Bk-Cnf8_f$MCIrx;_~ z6Pg&nmRqNZ0aW*m2g_^`Uk>K*|MLflFMMuh_nq1~K_5?_wJWGcZL-)%H>J}2t%Izo zd?t54YmPo{eZuSit2H-U8Zev8K>$TW#B=?JLT4GCn@a#nQj2NKtEXkTgWJ0YS1E>< z{A%AJ+3+G10I+oQmAa)y?j#U4iw~tk47}|Lx!1n&U3L}kt@g0uv_vzV1#My9g63eP zY>3LtijXFIVLJxBAuJ$d4!pNsO6My0d36Lpc5)_%t=q)tVj?>LNQz5hp~gvuDGh)g pYv-e4;PGudzB-ZGMO(xLy9eKYE`V^F@m&A_002ovPDHLkV1nj_?OOl< literal 0 HcmV?d00001 diff --git a/bacula/src/qt-console/images/check.svg b/bacula/src/qt-console/images/check.svg new file mode 100644 index 0000000000..81095a37c0 --- /dev/null +++ b/bacula/src/qt-console/images/check.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/bacula/src/qt-console/images/unchecked.png b/bacula/src/qt-console/images/unchecked.png new file mode 100644 index 0000000000000000000000000000000000000000..ccd9e8b3950ec969020e0e728f5674239a3de324 GIT binary patch literal 461 zcmV;;0W$uHP)5 zlS_-jFcgKqn$c<_U5Fq)(4`1<;s5_1K6X{{(IOfUO--wv#V}z+9W<*v&iT$wxN#=Y{=#&+T^m7t&}n?0i0-+jM|} zloBZ=X_}Iz>7DU%xzOo!?D}vxkY(AOrr^3RNs=%e4rw-_kBFiqucG$ZnqIaSmAoT zen__!08}a!rqiiS`DCfM3XXJbn;GQDl4IUx4E{T(4Iai-p|_!w}bXpPC;4 z@bex@DWWJM&vSOW-OKU;oLAr37=tkeDJ72Myaap$%o~>Xf@A4#00000NkvXXu0mjf DRgKCQ literal 0 HcmV?d00001 diff --git a/bacula/src/qt-console/images/unchecked.svg b/bacula/src/qt-console/images/unchecked.svg new file mode 100644 index 0000000000..a4dc57955e --- /dev/null +++ b/bacula/src/qt-console/images/unchecked.svg @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/bacula/src/qt-console/main.qrc b/bacula/src/qt-console/main.qrc index 862d71edfb..bb946e4485 100644 --- a/bacula/src/qt-console/main.qrc +++ b/bacula/src/qt-console/main.qrc @@ -24,5 +24,7 @@ images/undo.png images/unmark.png images/up.png + images/check.png + images/unchecked.png diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 0b3d252661..d4e2dd1a09 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -132,12 +132,17 @@ void restorePage::fillDirectory() } split_path_and_filename(p, &path, &pnl, &file, &fnl); item.clear(); - item << marked << file << modes << user << group << size << date; + item << "" << file << modes << user << group << size << date; if (item[1].endsWith("/")) { addDirectory(item[1]); - } + } 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"))); + } else { + ti->setIcon(0,QIcon(QString::fromUtf8(":images/unchecked.png"))); + } treeItemList.append(ti); } fileWidget->clear(); @@ -267,10 +272,10 @@ void restorePage::fileDoubleClicked(QTreeWidgetItem *item, int column) if (column == 0) { /* mark/unmark */ if (item->text(0) == "*") { bsnprintf(cmd, sizeof(cmd), "unmark \"%s\"", item->text(1).toUtf8().data()); - item->setText(0, " "); + item->setIcon(0, QIcon(QString::fromUtf8(":images/unchecked.png"))); } else { bsnprintf(cmd, sizeof(cmd), "mark \"%s\"", item->text(1).toUtf8().data()); - item->setText(0, "*"); + item->setIcon(0, QIcon(QString::fromUtf8(":images/check.png"))); } m_console->write_dir(cmd); if (m_console->read() > 0) { @@ -325,7 +330,7 @@ void restorePage::markButtonPushed() char cmd[1000]; foreach (item, treeItemList) { bsnprintf(cmd, sizeof(cmd), "mark \"%s\"", item->text(1).toUtf8().data()); - item->setText(0, "*"); + item->setIcon(0, QIcon(QString::fromUtf8(":images/check.png"))); m_console->write_dir(cmd); if (m_console->read() > 0) { strip_trailing_junk(m_console->msg()); @@ -346,7 +351,7 @@ void restorePage::unmarkButtonPushed() char cmd[1000]; foreach (item, treeItemList) { bsnprintf(cmd, sizeof(cmd), "unmark \"%s\"", item->text(1).toUtf8().data()); - item->setText(0, " "); + item->setIcon(0, QIcon(QString::fromUtf8(":images/unchecked.png"))); m_console->write_dir(cmd); if (m_console->read() > 0) { strip_trailing_junk(m_console->msg()); -- 2.39.5