]> git.sur5r.net Git - bacula/bacula/commitdiff
Experimenting with adding icons to a tree widget in the restore class. This
authorDirk H Bartley <dbartley@schupan.com>
Thu, 24 May 2007 21:06:17 +0000 (21:06 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Thu, 24 May 2007 21:06:17 +0000 (21:06 +0000)
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 [new file with mode: 0644]
bacula/src/qt-console/images/check.svg [new file with mode: 0644]
bacula/src/qt-console/images/unchecked.png [new file with mode: 0644]
bacula/src/qt-console/images/unchecked.svg [new file with mode: 0644]
bacula/src/qt-console/main.qrc
bacula/src/qt-console/restore/restore.cpp

diff --git a/bacula/src/qt-console/images/check.png b/bacula/src/qt-console/images/check.png
new file mode 100644 (file)
index 0000000..84055cc
Binary files /dev/null and b/bacula/src/qt-console/images/check.png differ
diff --git a/bacula/src/qt-console/images/check.svg b/bacula/src/qt-console/images/check.svg
new file mode 100644 (file)
index 0000000..81095a3
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="800pt"
+   height="800pt"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.43"
+   sodipodi:docbase="/home/dbartley/src/bacula/src/qt-console/images"
+   sodipodi:docname="check.svg"
+   version="1.0">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient2207">
+      <stop
+         style="stop-color:#00ff00;stop-opacity:1;"
+         offset="0"
+         id="stop2225" />
+      <stop
+         id="stop2227"
+         offset="0"
+         style="stop-color:#000700;stop-opacity:0.02745098;" />
+      <stop
+         style="stop-color:#000300;stop-opacity:0.01176471;"
+         offset="0"
+         id="stop2229" />
+      <stop
+         id="stop2231"
+         offset="0"
+         style="stop-color:#000100;stop-opacity:0.00392157;" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop2211" />
+    </linearGradient>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#010101"
+     borderopacity="1"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.753"
+     inkscape:cx="500"
+     inkscape:cy="495.71315"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer2"
+     inkscape:window-width="1280"
+     inkscape:window-height="932"
+     inkscape:window-x="0"
+     inkscape:window-y="35"
+     inkscape:showpageshadow="false" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer3"
+     inkscape:label="bottom" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="top">
+    <path
+       style="opacity:1;fill:#007e0d;fill-opacity:1;fill-rule:nonzero;stroke:#007e0d;stroke-width:2.87991929px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 994.41249,4.9545532 C 672.90536,4.1558286 413.38841,626.48951 413.38841,626.48951 C 413.38841,626.48951 126.31369,426.95495 3.7150412,410.07172 C -37.117913,404.44855 356.5329,885.93325 356.5329,885.93325 C 356.5329,885.93325 485.24171,1019.6825 467.84626,991.68579 C 462.68126,983.37309 757.16849,447.92512 994.41249,4.9545532 z "
+       id="path1323"
+       sodipodi:nodetypes="ccscsc"
+       inkscape:export-filename="/home/dbartley/rect3112.png"
+       inkscape:export-xdpi="1.4449884"
+       inkscape:export-ydpi="1.4449884" />
+  </g>
+</svg>
diff --git a/bacula/src/qt-console/images/unchecked.png b/bacula/src/qt-console/images/unchecked.png
new file mode 100644 (file)
index 0000000..ccd9e8b
Binary files /dev/null and b/bacula/src/qt-console/images/unchecked.png differ
diff --git a/bacula/src/qt-console/images/unchecked.svg b/bacula/src/qt-console/images/unchecked.svg
new file mode 100644 (file)
index 0000000..a4dc579
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="800pt"
+   height="800pt"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.43"
+   sodipodi:docbase="/home/dbartley/src/bacula/src/qt-console/images"
+   sodipodi:docname="unchecked.svg"
+   version="1.0"
+   inkscape:export-filename="/home/dbartley/src/bacula/src/qt-console/images/unchecked.png"
+   inkscape:export-xdpi="1.4449884"
+   inkscape:export-ydpi="1.4449884">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient2207">
+      <stop
+         style="stop-color:#00ff00;stop-opacity:1;"
+         offset="0"
+         id="stop2225" />
+      <stop
+         id="stop2227"
+         offset="0"
+         style="stop-color:#000700;stop-opacity:0.02745098;" />
+      <stop
+         style="stop-color:#000300;stop-opacity:0.01176471;"
+         offset="0"
+         id="stop2229" />
+      <stop
+         id="stop2231"
+         offset="0"
+         style="stop-color:#000100;stop-opacity:0.00392157;" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0;"
+         offset="1"
+         id="stop2211" />
+    </linearGradient>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#e2e2e2"
+     bordercolor="#010101"
+     borderopacity="1"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.753"
+     inkscape:cx="500"
+     inkscape:cy="495.71315"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer2"
+     inkscape:window-width="1280"
+     inkscape:window-height="932"
+     inkscape:window-x="0"
+     inkscape:window-y="35"
+     inkscape:showpageshadow="false" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer3"
+     inkscape:label="bottom" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="top">
+    <path
+       style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#545454;stroke-width:7.88;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;marker-start:none"
+       d="M 994.41249,4.9545532 C 672.90536,4.1558286 413.38841,626.48951 413.38841,626.48951 C 413.38841,626.48951 126.31369,426.95495 3.7150412,410.07172 C -37.117913,404.44855 356.5329,885.93325 356.5329,885.93325 C 356.5329,885.93325 485.24171,1019.6825 467.84626,991.68579 C 462.68126,983.37309 757.16849,447.92512 994.41249,4.9545532 z "
+       id="path1323"
+       sodipodi:nodetypes="ccscsc"
+       inkscape:export-filename="/home/dbartley/src/bacula/src/qt-console/images/check.png"
+       inkscape:export-xdpi="1.4449884"
+       inkscape:export-ydpi="1.4449884" />
+  </g>
+</svg>
index 862d71edfbab8eabbea63078c11c5cd6dfedf0bd..bb946e448582828146cdcd3620222114d21396b3 100644 (file)
@@ -24,5 +24,7 @@
    <file>images/undo.png</file>
    <file>images/unmark.png</file>
    <file>images/up.png</file>
+   <file>images/check.png</file>
+   <file>images/unchecked.png</file>
 </qresource>
 </RCC>
index 0b3d2526612a62ab288cc289bd3022a6f726d41d..d4e2dd1a09258132909e86d4731d15e39019ad32 100644 (file)
@@ -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());