From: Carl Hetherington Date: Tue, 9 Jun 2020 22:50:37 +0000 (+0200) Subject: First hacks on OOBE help. X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=9946c7aabecbb578dcbcb37f27973a98616956ce;p=dcpomatic.git First hacks on OOBE help. --- diff --git a/graphics/fonts/BebasNeue-Regular.ttf b/graphics/fonts/BebasNeue-Regular.ttf new file mode 100644 index 000000000..83a29bfc8 Binary files /dev/null and b/graphics/fonts/BebasNeue-Regular.ttf differ diff --git a/graphics/fonts/IbarraRealNova-Bold.ttf b/graphics/fonts/IbarraRealNova-Bold.ttf new file mode 100644 index 000000000..d37654367 Binary files /dev/null and b/graphics/fonts/IbarraRealNova-Bold.ttf differ diff --git a/graphics/fonts/IbarraRealNova-BoldItalic.ttf b/graphics/fonts/IbarraRealNova-BoldItalic.ttf new file mode 100644 index 000000000..ba80f21ae Binary files /dev/null and b/graphics/fonts/IbarraRealNova-BoldItalic.ttf differ diff --git a/graphics/fonts/IbarraRealNova-Italic.ttf b/graphics/fonts/IbarraRealNova-Italic.ttf new file mode 100644 index 000000000..13b704f76 Binary files /dev/null and b/graphics/fonts/IbarraRealNova-Italic.ttf differ diff --git a/graphics/fonts/IbarraRealNova-Regular.ttf b/graphics/fonts/IbarraRealNova-Regular.ttf new file mode 100644 index 000000000..27c067e22 Binary files /dev/null and b/graphics/fonts/IbarraRealNova-Regular.ttf differ diff --git a/graphics/fonts/IbarraRealNova-SemiBold.ttf b/graphics/fonts/IbarraRealNova-SemiBold.ttf new file mode 100644 index 000000000..6ca3a78fa Binary files /dev/null and b/graphics/fonts/IbarraRealNova-SemiBold.ttf differ diff --git a/graphics/fonts/IbarraRealNova-SemiBoldItalic.ttf b/graphics/fonts/IbarraRealNova-SemiBoldItalic.ttf new file mode 100644 index 000000000..d1f2203af Binary files /dev/null and b/graphics/fonts/IbarraRealNova-SemiBoldItalic.ttf differ diff --git a/graphics/fonts/OFL.txt b/graphics/fonts/OFL.txt new file mode 100644 index 000000000..85efe0293 --- /dev/null +++ b/graphics/fonts/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2007 The Ibarra Real Nova Project Authors (https://github.com/googlefonts/ibarrareal) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/graphics/help/add_content.png b/graphics/help/add_content.png new file mode 100644 index 000000000..ae56c107c Binary files /dev/null and b/graphics/help/add_content.png differ diff --git a/graphics/help/file_new.png b/graphics/help/file_new.png new file mode 100644 index 000000000..1cfa0037d Binary files /dev/null and b/graphics/help/file_new.png differ diff --git a/graphics/help/preview.png b/graphics/help/preview.png new file mode 100644 index 000000000..a5e3a752d Binary files /dev/null and b/graphics/help/preview.png differ diff --git a/graphics/src/help/add_content.svg b/graphics/src/help/add_content.svg new file mode 100644 index 000000000..daa63a87c --- /dev/null +++ b/graphics/src/help/add_content.svg @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + GREAT! NOW FOR some content... + + It's time to add some content. This could be a videofile, some audio, subtitles, another DCP... almost anything!If it's one file, or just a few, click Add Files...If it's a folder containing lots of files, use Add Folder...It it's an existing DCP, click Add DCP... + + + diff --git a/graphics/src/help/file_new.svg b/graphics/src/help/file_new.svg new file mode 100644 index 000000000..ae86086aa --- /dev/null +++ b/graphics/src/help/file_new.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + Welcome to DCP-o-matic! + To get started, click File then New and give your first project a name.You can also specify where the project'sdata will be stored. + + + diff --git a/graphics/src/help/preview.svg b/graphics/src/help/preview.svg new file mode 100644 index 000000000..ca93883ca --- /dev/null +++ b/graphics/src/help/preview.svg @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + SEE hOW IT LOOKS... + Now you can preview your content by clickingPlay. Check that it looks and sounds OK! + + + diff --git a/graphics/update b/graphics/update index 72aaa5f26..4695fcfe0 100755 --- a/graphics/update +++ b/graphics/update @@ -95,4 +95,12 @@ else done convert web/favicon-16x16.png web/favicon-32x32.png web/favicon-64x64.png web/favicon-128x128.png web/favicon-256x256.png web/favicon.ico convert src/web.png -resize 123x123 -transparent white web/logo.png + + # Help + mkdir -p help + for f in src/help/*.svg; do + base=$(basename $f | sed -e "s/.svg//") + $INKSCAPE help/$base.png $f + done + fi diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh index bfb518110..748fb852a 100644 --- a/platform/osx/make_dmg.sh +++ b/platform/osx/make_dmg.sh @@ -215,6 +215,7 @@ function copy_resources { cp $prefix/src/dcpomatic/graphics/sequence.png "$dest" cp $prefix/src/dcpomatic/graphics/me.jpg "$dest" cp $prefix/src/dcpomatic/graphics/link.png "$dest" + cp -r $prefix/src/dcpomatic/graphics/help "$dest" cp -r $prefix/share/libdcp/xsd "$dest" # i18n: DCP-o-matic .mo files diff --git a/platform/windows/wscript b/platform/windows/wscript index c6d4232d4..f3b720cdb 100644 --- a/platform/windows/wscript +++ b/platform/windows/wscript @@ -318,6 +318,9 @@ File "%graphics%/me.jpg" File "%graphics%/tick.png" File "%graphics%/no_tick.png" File "%graphics%/link.png" +File "%graphics%/help/add_content.png" +File "%graphics%/help/file_new.png" +File "%graphics%/help/preview.png" SetOutPath "$INSTDIR\\xsd" File "%cdist_deps%/share/libdcp/xsd/SMPTE-429-7-2006-CPL.xsd" File "%cdist_deps%/share/libdcp/xsd/SMPTE-429-8-2006-PKL.xsd" diff --git a/src/lib/film.cc b/src/lib/film.cc index 1a9e552fe..e7165c955 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -57,6 +57,7 @@ #include "check_content_change_job.h" #include "ffmpeg_subtitle_stream.h" #include "font.h" +#include "help.h" #include #include #include @@ -1270,6 +1271,8 @@ Film::add_content (shared_ptr c) _playlist->add (shared_from_this(), c); maybe_set_container_and_resolution (); + + Help::instance()->event (Help::SUCCESSFUL_ADD_CONTENT); } diff --git a/src/lib/help.cc b/src/lib/help.cc new file mode 100644 index 000000000..a7185686d --- /dev/null +++ b/src/lib/help.cc @@ -0,0 +1,25 @@ +#include "help.h" +#include +#include + + +Help* Help::_instance = 0; + + +Help* +Help::instance () +{ + if (!_instance) { + _instance = new Help (); + } + + return _instance; +} + + +void +Help::event (EventType e) +{ + emit (boost::bind(boost::ref(Event), e)); +} + diff --git a/src/lib/help.h b/src/lib/help.h new file mode 100644 index 000000000..ac36124c2 --- /dev/null +++ b/src/lib/help.h @@ -0,0 +1,26 @@ +#ifndef DCPOMATIC_HELP_H +#define DCPOMATIC_HELP_H + +#include "signaller.h" +#include + +class Help : public Signaller +{ +public: + static Help* instance (); + + enum EventType { + SUCCESSFUL_FILE_NEW, + SUCCESSFUL_ADD_CONTENT, + }; + + void event (EventType e); + + boost::signals2::signal Event; + +private: + static Help* _instance; +}; + +#endif + diff --git a/src/lib/wscript b/src/lib/wscript index c2dfb55d8..fae4ab035 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -114,6 +114,7 @@ sources = """ font.cc frame_interval_checker.cc frame_rate_change.cc + help.cc hints.cc internet.cc image.cc diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 9cd99a265..440151429 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -52,6 +52,8 @@ #include "wx/initial_setup_dialog.h" #include "wx/send_i18n_dialog.h" #include "wx/i18n_hook.h" +#include "wx/static_text.h" +#include "wx/wx_help.h" #include "lib/film.h" #include "lib/analytics.h" #include "lib/emailer.h" @@ -66,6 +68,7 @@ #include "lib/job_manager.h" #include "lib/exceptions.h" #include "lib/cinema.h" +#include "lib/help.h" #include "lib/kdm_with_metadata.h" #include "lib/send_kdm_email_job.h" #include "lib/encode_server_finder.h" @@ -542,6 +545,7 @@ private: error_dialog (this, _("Could not create folder to store film."), std_to_wx(e.what())); #endif } + Help::instance()->event (Help::SUCCESSFUL_FILE_NEW); } d->Destroy (); @@ -1631,6 +1635,8 @@ private: if (Config::instance()->check_for_updates ()) { UpdateChecker::instance()->run (); } + + signal_manager->when_idle (boost::bind(&HelpGUI::start, HelpGUI::instance())); } catch (exception& e) { diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 7d854224d..681761f19 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -28,6 +28,7 @@ #include "image_sequence_dialog.h" #include "film_viewer.h" #include "dcpomatic_button.h" +#include "wx_help.h" #include "lib/audio_content.h" #include "lib/text_content.h" #include "lib/video_content.h" @@ -128,6 +129,7 @@ ContentPanel::ContentPanel (wxNotebook* n, shared_ptr film, weak_ptrSetToolTip (_("Add a folder of image files (which will be used as a moving image sequence) or a folder of sound files.")); b->Add (_add_folder, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP); + HelpGUI::instance()->landmark (_add_folder, HelpGUI::ADD_FOLDER_BUTTON); _add_dcp = new Button (top, _("Add DCP...")); _add_dcp->SetToolTip (_("Add a DCP.")); diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index ae0868f27..5de677c21 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2016 Carl Hetherington + Copyright (C) 2012-2020 Carl Hetherington This file is part of DCP-o-matic. diff --git a/src/wx/standard_controls.cc b/src/wx/standard_controls.cc index 5df89f8fe..11426ff59 100644 --- a/src/wx/standard_controls.cc +++ b/src/wx/standard_controls.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -18,8 +18,9 @@ */ -#include "standard_controls.h" #include "film_viewer.h" +#include "standard_controls.h" +#include "wx_help.h" #include #include @@ -31,6 +32,7 @@ StandardControls::StandardControls (wxWindow* parent, shared_ptr vie { _button_sizer->Add (_play_button, 0, wxEXPAND); _play_button->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&StandardControls::play_clicked, this)); + HelpGUI::instance()->landmark (_play_button, HelpGUI::PLAY_BUTTON); } void diff --git a/src/wx/wscript b/src/wx/wscript index 7acbcc56f..ad1c49806 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -111,8 +111,8 @@ sources = """ playlist_controls.cc playlist_editor_config_dialog.cc question_dialog.cc - rating_dialog.cc qube_certificate_panel.cc + rating_dialog.cc recipients_panel.cc recipient_dialog.cc recreate_chain_dialog.cc @@ -160,8 +160,9 @@ sources = """ video_view.cc video_waveform_dialog.cc video_waveform_plot.cc - wx_util.cc + wx_help.cc wx_signal_manager.cc + wx_util.cc """ def configure(conf): diff --git a/src/wx/wx_help.cc b/src/wx/wx_help.cc new file mode 100644 index 000000000..529977c96 --- /dev/null +++ b/src/wx/wx_help.cc @@ -0,0 +1,111 @@ +#include "wx_help.h" +#include "wx_util.h" +#include + +HelpGUI* HelpGUI::_instance = 0; + + +HelpGUI::HelpGUI () + : _current_index (-1) + , _current_frame (0) +{ + _messages.push_back (Message("file_new", wxPoint(50, 100), Help::SUCCESSFUL_FILE_NEW)); + _messages.push_back (Message("add_content", ADD_FOLDER_BUTTON, wxSize(24, -48), Help::SUCCESSFUL_ADD_CONTENT)); + _messages.push_back (Message("preview", PLAY_BUTTON, wxSize(24, 0))); + + Help::instance()->Event.connect (boost::bind(&HelpGUI::event, this, _1)); +} + + +void +HelpGUI::event (Help::EventType e) +{ + if ( + _current_index >= 0 && + _current_index < int(_messages.size() - 1) && + _messages[_current_index].next_trigger && + *_messages[_current_index].next_trigger == e) { + next (); + } +} + + +void +HelpGUI::landmark (wxWindow* landmark, Landmark id) +{ + _landmarks[id] = landmark; +} + + +void +HelpGUI::next () +{ + ++_current_index; + show (_current_index); +} + + +void +HelpGUI::start () +{ + next (); +} + + +void +HelpGUI::show (int index) +{ + if (_current_frame) { + _current_frame->Destroy (); + _current_frame = 0; + } + + Message const& m = _messages[index]; + wxBitmap bitmap (bitmap_path("help/" + m.id)); + wxPoint pos; + if (m.anchor_point) { + pos = *m.anchor_point; + } else if (m.anchor_landmark) { + DCPOMATIC_ASSERT (_landmarks.find(*m.anchor_landmark) != _landmarks.end()); + wxWindow* lm = _landmarks[*m.anchor_landmark]; + pos = lm->GetScreenPosition(); + pos.x += lm->GetSize().GetWidth(); + } + pos += m.offset; + _current_frame = new wxFrame (0, wxID_ANY, wxT(""), pos, wxSize(bitmap.GetSize().GetWidth() + 16, bitmap.GetSize().GetHeight() + 128), wxFRAME_TOOL_WINDOW); + wxSizer* sizer = new wxBoxSizer (wxVERTICAL); + wxStaticBitmap* static_bitmap = new wxStaticBitmap (_current_frame, wxID_ANY, bitmap); + sizer->Add (static_bitmap, 1, wxEXPAND); + wxSizer* buttons_sizer = new wxBoxSizer (wxHORIZONTAL); + wxButton* close = new wxButton (_current_frame, wxID_ANY, _("Stop showing tips")); + close->Bind (wxEVT_BUTTON, boost::bind(&HelpGUI::stop, this)); + buttons_sizer->Add (close, 1, wxEXPAND | wxALL, 8); + sizer->Add (buttons_sizer, 0, wxALIGN_RIGHT); + _current_frame->SetSizer (sizer); + _current_frame->Show (); +} + + +void +HelpGUI::stop () +{ + _current_index = -1; + if (_current_frame) { + _current_frame->Destroy (); + } + + /* XXX: should write a config entry */ +} + + +HelpGUI * +HelpGUI::instance () +{ + if (!_instance) { + _instance = new HelpGUI (); + } + + return _instance; +} + + diff --git a/src/wx/wx_help.h b/src/wx/wx_help.h new file mode 100644 index 000000000..0d566346d --- /dev/null +++ b/src/wx/wx_help.h @@ -0,0 +1,66 @@ +#include "lib/help.h" +#include +#include +#include +#include +#include + +class HelpGUI +{ +public: + static HelpGUI* instance (); + + void start (); + + enum Landmark { + ADD_FOLDER_BUTTON, + PLAY_BUTTON + }; + + void landmark (wxWindow* landmark, Landmark id); + +private: + class Message + { + public: + Message (std::string id_, wxPoint anchor_, Help::EventType next_trigger_) + : id (id_) + , anchor_point (anchor_) + , next_trigger (next_trigger_) + {} + + Message (std::string id_, Landmark anchor_, wxSize offset_) + : id (id_) + , anchor_landmark (anchor_) + , offset (offset_) + {} + + Message (std::string id_, Landmark anchor_, wxSize offset_, Help::EventType next_trigger_) + : id (id_) + , anchor_landmark (anchor_) + , offset (offset_) + , next_trigger (next_trigger_) + {} + + std::string id; + boost::optional anchor_point; + boost::optional anchor_landmark; + wxSize offset; + boost::optional next_trigger; + }; + + HelpGUI (); + void event (Help::EventType e); + void show (int index); + void next (); + void stop (); + + static HelpGUI* _instance; + + int _current_index; + wxFrame* _current_frame; + std::vector _messages; + std::map _landmarks; +}; + +