Use icons at the top of the batch converter rather than text buttons at the bottom...
authorCarl Hetherington <cth@carlh.net>
Sun, 25 Dec 2022 20:33:48 +0000 (21:33 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 25 Dec 2022 20:33:48 +0000 (21:33 +0100)
graphics/add_black.png [new file with mode: 0644]
graphics/add_white.png [new file with mode: 0644]
graphics/pause_black.png [new file with mode: 0644]
graphics/pause_white.png [new file with mode: 0644]
graphics/src/batch_black.svg [new file with mode: 0644]
graphics/src/batch_white.svg [new file with mode: 0644]
graphics/update
src/tools/dcpomatic_batch.cc

diff --git a/graphics/add_black.png b/graphics/add_black.png
new file mode 100644 (file)
index 0000000..60f5dae
Binary files /dev/null and b/graphics/add_black.png differ
diff --git a/graphics/add_white.png b/graphics/add_white.png
new file mode 100644 (file)
index 0000000..64d8ca6
Binary files /dev/null and b/graphics/add_white.png differ
diff --git a/graphics/pause_black.png b/graphics/pause_black.png
new file mode 100644 (file)
index 0000000..e2584b7
Binary files /dev/null and b/graphics/pause_black.png differ
diff --git a/graphics/pause_white.png b/graphics/pause_white.png
new file mode 100644 (file)
index 0000000..6e2b181
Binary files /dev/null and b/graphics/pause_white.png differ
diff --git a/graphics/src/batch_black.svg b/graphics/src/batch_black.svg
new file mode 100644 (file)
index 0000000..3affcc9
--- /dev/null
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="210mm"
+   height="297mm"
+   viewBox="0 0 793.70081 1122.5197"
+   version="1.1"
+   id="svg831"
+   inkscape:version="1.1.1 (3bf5ae0, 2021-09-20)"
+   sodipodi:docname="batch_black.svg"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview833"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="0"
+     inkscape:document-units="px"
+     showgrid="true"
+     inkscape:zoom="1.6975968"
+     inkscape:cx="4.4180102"
+     inkscape:cy="221.48958"
+     inkscape:window-width="1920"
+     inkscape:window-height="1011"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="layer2">
+    <inkscape:grid
+       type="xygrid"
+       id="grid1158"
+       spacingx="0.13229167"
+       spacingy="0.13229167"
+       empspacing="2" />
+    <sodipodi:guide
+       position="24.077084,216.30208"
+       orientation="0,18"
+       id="guide1500" />
+    <sodipodi:guide
+       position="30.427083,218.28646"
+       orientation="8.0000013,0"
+       id="guide1617" />
+  </sodipodi:namedview>
+  <defs
+     id="defs828" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="Bounding"
+     style="display:none"
+     sodipodi:insensitive="true">
+    <rect
+       y="81"
+       x="-60"
+       height="32"
+       width="32"
+       id="batch-add"
+       style="font-variation-settings:normal;display:inline;vector-effect:none;fill:#f2f2f2;fill-opacity:1;stroke:none;stroke-width:0.528903;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000" />
+    <rect
+       y="81"
+       x="-24"
+       height="32"
+       width="32"
+       id="batch-pause"
+       style="font-variation-settings:normal;display:inline;vector-effect:none;fill:#f2f2f2;fill-opacity:1;stroke:none;stroke-width:0.528903;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000" />
+  </g>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     style="display:inline">
+    <path
+       style="font-variation-settings:normal;opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none;stop-color:#000000;stop-opacity:1"
+       d="M -44,84.666669 V 110.06667"
+       id="path1056" />
+    <path
+       style="font-variation-settings:normal;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none;stop-color:#000000"
+       d="M -12.879167,87.108331 V 106.89167"
+       id="path1056-3" />
+    <path
+       style="font-variation-settings:normal;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none;stop-color:#000000"
+       d="M -3.120833,87.108331 V 106.89166"
+       id="path1056-56" />
+    <path
+       style="font-variation-settings:normal;display:inline;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none;stop-color:#000000"
+       d="M -31.300001,97.366669 H -56.699999"
+       id="path1056-5" />
+  </g>
+</svg>
diff --git a/graphics/src/batch_white.svg b/graphics/src/batch_white.svg
new file mode 100644 (file)
index 0000000..bf7bb09
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   width="210mm"
+   height="297mm"
+   viewBox="0 0 793.70081 1122.5197"
+   version="1.1"
+   id="svg831"
+   inkscape:version="1.1.1 (3bf5ae0, 2021-09-20)"
+   sodipodi:docname="batch_white.svg"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:svg="http://www.w3.org/2000/svg">
+  <sodipodi:namedview
+     id="namedview833"
+     pagecolor="#1f1f1f"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageshadow="2"
+     inkscape:pageopacity="0"
+     inkscape:pagecheckerboard="0"
+     inkscape:document-units="px"
+     showgrid="true"
+     inkscape:zoom="1.6975968"
+     inkscape:cx="4.4180102"
+     inkscape:cy="221.48958"
+     inkscape:window-width="1920"
+     inkscape:window-height="1011"
+     inkscape:window-x="0"
+     inkscape:window-y="0"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="layer2">
+    <inkscape:grid
+       type="xygrid"
+       id="grid1158"
+       spacingx="0.13229167"
+       spacingy="0.13229167"
+       empspacing="2" />
+    <sodipodi:guide
+       position="24.077084,216.30208"
+       orientation="0,18"
+       id="guide1500" />
+    <sodipodi:guide
+       position="30.427083,218.28646"
+       orientation="8.0000013,0"
+       id="guide1617" />
+  </sodipodi:namedview>
+  <defs
+     id="defs828" />
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="Bounding"
+     style="display:inline">
+    <rect
+       y="81"
+       x="-60"
+       height="32"
+       width="32"
+       id="batch-add"
+       style="font-variation-settings:normal;display:inline;vector-effect:none;fill:#f2f2f2;fill-opacity:1;stroke:none;stroke-width:0.528903;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000" />
+    <rect
+       y="81"
+       x="-24"
+       height="32"
+       width="32"
+       id="batch-pause"
+       style="font-variation-settings:normal;display:inline;vector-effect:none;fill:#f2f2f2;fill-opacity:1;stroke:none;stroke-width:0.528903;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000" />
+  </g>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     style="display:inline">
+    <path
+       style="font-variation-settings:normal;opacity:1;fill:#333333;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none;stop-color:#000000;stop-opacity:1"
+       d="M -44,84.666669 V 110.06667"
+       id="path1056" />
+    <path
+       style="font-variation-settings:normal;display:inline;fill:#333333;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none;stop-color:#000000"
+       d="M -12.879167,87.108331 V 106.89167"
+       id="path1056-3" />
+    <path
+       style="font-variation-settings:normal;display:inline;fill:#333333;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none;stop-color:#000000"
+       d="M -3.120833,87.108331 V 106.89166"
+       id="path1056-56" />
+    <path
+       style="font-variation-settings:normal;display:inline;fill:#333333;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-end:none;stop-color:#000000"
+       d="M -31.300001,97.366669 H -56.699999"
+       id="path1056-5" />
+  </g>
+</svg>
index f42c3182b80d4b06b667c70be737b9bccec3b6ac..ff3baca04e5245bae728e2ef217714c3b0f3a1f9 100755 (executable)
@@ -101,6 +101,13 @@ else
         done
     done
 
         done
     done
 
+    # Batch converter toolbar icons (all platforms)
+    for c in black white; do
+        for i in add pause; do
+            inkbatch --inkscape $INKSCAPE -i batch-$i -o ${i}_${c}.png --width 32 --height 32 src/batch_$c.svg
+        done
+    done
+
     # Playlist editor tick/no-tick
     $INKSCAPE_EXPORT --export-filename=tick.png src/tick.svg -w 16 -h 16
     $INKSCAPE_EXPORT --export-filename=no_tick.png src/no_tick.svg -w 16 -h 16
     # Playlist editor tick/no-tick
     $INKSCAPE_EXPORT --export-filename=tick.png src/tick.svg -w 16 -h 16
     $INKSCAPE_EXPORT --export-filename=no_tick.png src/no_tick.svg -w 16 -h 16
index 6e054edf8d8921b2b3793bfe4dcebe398f7d514a..8bb36476d1b3a6d22d94eea4efcdb223644c9762 100644 (file)
@@ -110,6 +110,11 @@ setup_menu (wxMenuBar* m)
 class DOMFrame : public wxFrame
 {
 public:
 class DOMFrame : public wxFrame
 {
 public:
+       enum class Tool {
+               ADD,
+               PAUSE
+       };
+
        explicit DOMFrame (wxString const & title)
                : wxFrame (nullptr, -1, title)
                , _sizer (new wxBoxSizer(wxVERTICAL))
        explicit DOMFrame (wxString const & title)
                : wxFrame (nullptr, -1, title)
                , _sizer (new wxBoxSizer(wxVERTICAL))
@@ -131,23 +136,21 @@ public:
                s->Add (panel, 1, wxEXPAND);
                SetSizer (s);
 
                s->Add (panel, 1, wxEXPAND);
                SetSizer (s);
 
-               auto job_manager_view = new JobManagerView (panel, true);
-               _sizer->Add (job_manager_view, 1, wxALL | wxEXPAND, 6);
+               wxBitmap add(icon_path("add"), wxBITMAP_TYPE_PNG);
+               wxBitmap pause(icon_path("pause"), wxBITMAP_TYPE_PNG);
 
 
-               auto buttons = new wxBoxSizer (wxHORIZONTAL);
-               auto add = new Button (panel, _("Add Film..."));
-               add->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::add_film, this));
-               buttons->Add (add, 1, wxALL, 6);
-               _pause = new Button (panel, _("Pause"));
-               _pause->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::pause, this));
-               buttons->Add (_pause, 1, wxALL, 6);
-               _resume = new Button (panel, _("Resume"));
-               _resume->Bind (wxEVT_BUTTON, boost::bind(&DOMFrame::resume, this));
-               buttons->Add (_resume, 1, wxALL, 6);
+               auto toolbar = new wxToolBar(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL);
+               toolbar->SetMargins(4, 4);
+               toolbar->SetToolBitmapSize(wxSize(32, 32));
+               toolbar->AddTool(static_cast<int>(Tool::ADD), _("Add film"), add, _("Add film for conversion"));
+               toolbar->AddCheckTool(static_cast<int>(Tool::PAUSE), _("Pause/resume"), pause, wxNullBitmap, _("Pause or resume conversion"));
+               toolbar->Realize();
+               _sizer->Add(toolbar, 0, wxALL, 6);
 
 
-               setup_sensitivity ();
+               toolbar->Bind(wxEVT_TOOL, bind(&DOMFrame::tool_clicked, this, _1));
 
 
-               _sizer->Add (buttons, 0, wxALL, 6);
+               auto job_manager_view = new JobManagerView (panel, true);
+               _sizer->Add (job_manager_view, 1, wxALL | wxEXPAND, 6);
 
                panel->SetSizer (_sizer);
 
 
                panel->SetSizer (_sizer);
 
@@ -155,22 +158,23 @@ public:
                Bind (wxEVT_SIZE, boost::bind(&DOMFrame::sized, this, _1));
        }
 
                Bind (wxEVT_SIZE, boost::bind(&DOMFrame::sized, this, _1));
        }
 
-       void setup_sensitivity ()
-       {
-               _pause->Enable (!JobManager::instance()->paused());
-               _resume->Enable (JobManager::instance()->paused());
-       }
-
-       void pause ()
+       void tool_clicked(wxCommandEvent& ev)
        {
        {
-               JobManager::instance()->pause();
-               setup_sensitivity ();
-       }
-
-       void resume ()
-       {
-               JobManager::instance()->resume();
-               setup_sensitivity ();
+               switch (static_cast<Tool>(ev.GetId())) {
+               case Tool::ADD:
+                       add_film();
+                       break;
+               case Tool::PAUSE:
+               {
+                       auto jm = JobManager::instance();
+                       if (jm->paused()) {
+                               jm->resume();
+                       } else {
+                               jm->pause();
+                       }
+                       break;
+               }
+               }
        }
 
        void start_job (boost::filesystem::path path)
        }
 
        void start_job (boost::filesystem::path path)
@@ -354,8 +358,6 @@ private:
        wxSizer* _sizer;
        wxPreferencesEditor* _config_dialog = nullptr;
        ServersListDialog* _servers_list_dialog = nullptr;
        wxSizer* _sizer;
        wxPreferencesEditor* _config_dialog = nullptr;
        ServersListDialog* _servers_list_dialog = nullptr;
-       wxButton* _pause;
-       wxButton* _resume;
 };
 
 
 };