Show a splash screen if config needs creating.
authorCarl Hetherington <cth@carlh.net>
Tue, 11 Aug 2015 00:36:05 +0000 (01:36 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 11 Aug 2015 18:39:04 +0000 (19:39 +0100)
13 files changed:
cscript
graphics/splash.png [new file with mode: 0644]
graphics/splash.svg
platform/osx/make_dmg.sh
platform/windows/wscript
src/lib/config.cc
src/lib/config.h
src/tools/dcpomatic.cc
windows/dcpomatic.bmp [deleted file]
windows/dcpomatic.ico [deleted file]
windows/dcpomatic.rc [deleted file]
windows/dcpomatic_taskbar.ico [deleted file]
wscript

diff --git a/cscript b/cscript
index 906c296d6a5eff19ce1e1842d1f740db6bef7328..cdb6abac1bcc52e50a97f1db26729cc15e5a3e4c 100644 (file)
--- a/cscript
+++ b/cscript
@@ -261,6 +261,7 @@ def build(target, options):
 def package_windows(target):
     shutil.copyfile('build/platform/windows/installer.%s.nsi' % target.bits, 'build/platform/windows/installer2.%s.nsi' % target.bits)
     target.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
+    target.command('sed -i "s~%%graphics%%~%s/graphics~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
     target.command('sed -i "s~%%static_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.windows_prefix, target.bits))
     target.command('sed -i "s~%%cdist_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.directory, target.bits))
     target.command('sed -i "s~%%mingw%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.mingw_path, target.bits))
diff --git a/graphics/splash.png b/graphics/splash.png
new file mode 100644 (file)
index 0000000..8a0ce53
Binary files /dev/null and b/graphics/splash.png differ
index 36e6b84a6de53e070693108a444db5d14d9d3fb4..122cca77e3f2b9814c2e1d40cda0e48676d859c7 100644 (file)
    id="svg2"
    version="1.1"
    inkscape:version="0.91 r13725"
-   sodipodi:docname="splash.svg">
+   sodipodi:docname="splash.svg"
+   inkscape:export-filename="/home/carl/src/dcpomatic2/graphics/splash.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
   <defs
      id="defs4" />
   <sodipodi:namedview
      pagecolor="#ffffff"
      bordercolor="#666666"
      borderopacity="1.0"
-     inkscape:pageopacity="0.0"
+     inkscape:pageopacity="0"
      inkscape:pageshadow="2"
-     inkscape:zoom="0.64555556"
-     inkscape:cx="198.81239"
-     inkscape:cy="150.53356"
+     inkscape:zoom="0.48805595"
+     inkscape:cx="157.61086"
+     inkscape:cy="133.21225"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
@@ -36,7 +39,8 @@
      inkscape:window-height="719"
      inkscape:window-x="170"
      inkscape:window-y="1077"
-     inkscape:window-maximized="1" />
+     inkscape:window-maximized="1"
+     showguides="false" />
   <metadata
      id="metadata7">
     <rdf:RDF>
      inkscape:groupmode="layer"
      id="layer1"
      transform="translate(0,-752.36216)">
+    <rect
+       style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+       id="rect4315"
+       width="400"
+       height="300"
+       x="-0.045666847"
+       y="752.41266" />
     <g
        id="layer1-9"
        inkscape:label="Layer 1"
     </g>
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:'libre baskerville';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;-inkscape-font-specification:'libre baskerville';font-stretch:normal;font-variant:normal;"
-       x="74.648438"
-       y="950.12463"
+       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:'Libre Baskerville';-inkscape-font-specification:'Libre Baskerville';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       x="63.455936"
+       y="978.57825"
        id="text4236"
        sodipodi:linespacing="125%"><tspan
          sodipodi:role="line"
          id="tspan4238"
-         x="74.648438"
-         y="950.12463">DCP-o-matic</tspan></text>
+         x="63.455936"
+         y="978.57825">DCP-o-matic</tspan></text>
     <text
        xml:space="preserve"
-       style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       x="139.1748"
+       style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:'Libre Baskerville';-inkscape-font-specification:'Libre Baskerville';text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:0px;word-spacing:0px;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+       x="154.86711"
        y="1033.7736"
        id="text4240"
        sodipodi:linespacing="125%"><tspan
          sodipodi:role="line"
          id="tspan4242"
-         x="139.1748"
+         x="154.86711"
          y="1033.7736">Setting up...</tspan></text>
+    <text
+       xml:space="preserve"
+       style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:'Libre Baskerville';-inkscape-font-specification:'Libre Baskerville';text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:0px;word-spacing:0px;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+       x="154.3168"
+       y="938.3111"
+       id="text4240-6"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan4242-6"
+         x="154.3168"
+         y="938.3111">Welcome to</tspan></text>
   </g>
 </svg>
index e0e029009a2f68d46c459c223be8e5f879cc1947..377ae6a4cd4c39823893f15e38e0d23eb0d643bf 100644 (file)
@@ -139,6 +139,7 @@ cp $ROOT/32/src/dcpomatic2/graphics/servers.png "$WORK/$resources"
 cp $ROOT/32/src/dcpomatic2/graphics/tms.png "$WORK/$resources"
 cp $ROOT/32/src/dcpomatic2/graphics/keys.png "$WORK/$resources"
 cp $ROOT/32/src/dcpomatic2/LiberationSans-Regular.ttf "$WORK/$resources"
+cp $ROOT/32/src/dcpomatic2/graphics/splash.png "$WORK/$resources"
 
 # i18n: DCP-o-matic .mo files
 for lang in de_DE es_ES fr_FR it_IT sv_SE nl_NL ru_RU pl_PL da_DK; do
index fc1d07b71eaaccd8341e7ccdecad7c96c458b658..5f11977b436a7604a6a21a6ccbc0edb585c7d7e9 100644 (file)
@@ -210,6 +210,7 @@ File "%static_deps%/share/locale/da/LC_MESSAGES/wxstd.mo"
 
 SetOutPath "$INSTDIR"
 File "%resources%/../../LiberationSans-Regular.ttf"
+File "%graphics%/splash.png"
     """, file=f)
 
     if debug:
index f71fff86ce4fc3cbdcc94f43d5695c0ee283fbbb..cc62bfed3473329e58ac2782ae47a60af6766753 100644 (file)
@@ -119,7 +119,7 @@ Config::restore_defaults ()
 void
 Config::read ()
 {
-       if (!boost::filesystem::exists (file ())) {
+       if (!have_existing ()) {
                /* Make a new set of signing certificates and key */
                _signer_chain.reset (new dcp::CertificateChain (openssl_path ()));
                /* And similar for decryption of KDMs */
@@ -263,7 +263,7 @@ Config::read ()
 
 /** @return Filename to write configuration to */
 boost::filesystem::path
-Config::file () const
+Config::file ()
 {
        boost::filesystem::path p;
 #ifdef DCPOMATIC_OSX
@@ -456,3 +456,9 @@ Config::add_to_history (boost::filesystem::path p)
 
        changed ();
 }
+
+bool
+Config::have_existing ()
+{
+       return boost::filesystem::exists (file ());
+}
index eeb167d0d0c52b964c85fb9b8e17d9522dd3d344..70971085a907176383f4b2ff08a330284c1c29bb 100644 (file)
@@ -417,10 +417,11 @@ public:
        static Config* instance ();
        static void drop ();
        static void restore_defaults ();
+       static bool have_existing ();
 
 private:
        Config ();
-       boost::filesystem::path file () const;
+       static boost::filesystem::path file ();
        void read ();
        void set_defaults ();
        void set_kdm_email_to_default ();
index cc85da0ef2faaa2b89aaea33c8d469198dd3dc45..743172e9b74e95a668883d04c49cf86e0ab76cbf 100644 (file)
@@ -35,6 +35,7 @@
 #include "lib/send_kdm_email_job.h"
 #include "lib/server_finder.h"
 #include "lib/update.h"
+#include "lib/cross.h"
 #include "lib/content_factory.h"
 #include "wx/film_viewer.h"
 #include "wx/film_editor.h"
@@ -55,6 +56,7 @@
 #include <wx/stdpaths.h>
 #include <wx/cmdline.h>
 #include <wx/preferences.h>
+#include <wx/splash.h>
 #ifdef __WXMSW__
 #include <shellapi.h>
 #endif
@@ -776,6 +778,18 @@ private:
        bool OnInit ()
        try
        {
+               wxInitAllImageHandlers ();
+
+               wxSplashScreen* splash = 0;
+               if (!Config::have_existing ()) {
+                       wxBitmap bitmap;
+                       boost::filesystem::path p = shared_path () / "splash.png";
+                       if (bitmap.LoadFile (std_to_wx (p.string ()), wxBITMAP_TYPE_PNG)) {
+                               splash = new wxSplashScreen (bitmap, wxSPLASH_CENTRE_ON_SCREEN | wxSPLASH_NO_TIMEOUT, 0, 0, -1);
+                               wxYield ();
+                       }
+               }
+
                SetAppName (_("DCP-o-matic"));
 
                if (!wxApp::OnInit()) {
@@ -792,8 +806,6 @@ private:
                TransformProcessType (&serial, kProcessTransformToForegroundApplication);
 #endif
 
-               wxInitAllImageHandlers ();
-
                dcpomatic_setup_path_encoding ();
 
                /* Enable i18n; this will create a Config object
@@ -817,6 +829,9 @@ private:
                _frame = new DOMFrame (_("DCP-o-matic"));
                SetTopWindow (_frame);
                _frame->Maximize ();
+               if (splash) {
+                       splash->Destroy ();
+               }
                _frame->Show ();
 
                if (!_film_to_load.empty() && boost::filesystem::is_directory (_film_to_load)) {
diff --git a/windows/dcpomatic.bmp b/windows/dcpomatic.bmp
deleted file mode 100644 (file)
index 0a196f7..0000000
Binary files a/windows/dcpomatic.bmp and /dev/null differ
diff --git a/windows/dcpomatic.ico b/windows/dcpomatic.ico
deleted file mode 100644 (file)
index 225008c..0000000
Binary files a/windows/dcpomatic.ico and /dev/null differ
diff --git a/windows/dcpomatic.rc b/windows/dcpomatic.rc
deleted file mode 100644 (file)
index 3963873..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-id ICON "dcpomatic.ico"
-taskbar_icon ICON "dcpomatic_taskbar.ico"
-#include "wx-2.9/wx/msw/wx.rc"
diff --git a/windows/dcpomatic_taskbar.ico b/windows/dcpomatic_taskbar.ico
deleted file mode 100644 (file)
index f4489fa..0000000
Binary files a/windows/dcpomatic_taskbar.ico and /dev/null differ
diff --git a/wscript b/wscript
index a5742eb7b5170f32c6fa4bdb71777a7c42ede32e..9a6da65a132e2d621538aedaea40af16bf8093e0 100644 (file)
--- a/wscript
+++ b/wscript
@@ -277,7 +277,7 @@ def configure(conf):
 
             conf.env['LIB_%s' % name.upper()] = libs
             conf.env['STLIB_%s' % name.upper()] = stlibs
-            conf.env['INCLUDE_%s' % name.upper()] = include
+            conf.env['INCLUDES_%s' % name.upper()] = include
             conf.env['LIBPATH_%s' % name.upper()] = libpath
     else:
         conf.check_cfg(package='libavformat', args='--cflags --libs', uselib_store='AVFORMAT', mandatory=True)
@@ -414,6 +414,7 @@ def build(bld):
 
     if not bld.env.TARGET_WINDOWS:
         bld.install_files('${PREFIX}/share/dcpomatic2', 'graphics/taskbar_icon.png')
+        bld.install_files('${PREFIX}/share/dcpomatic2', 'graphics/splash.png')
         bld.install_files('${PREFIX}/share/dcpomatic2', 'LiberationSans-Regular.ttf')
 
     bld.add_post_fun(post)