Lumiera  0.pre.03
»edit your freedom«
wizard.cpp
Go to the documentation of this file.
1 /*
2  Wizard - controller user help and assistance
3 
4  Copyright (C) Lumiera.org
5  2017, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
31 #include "stage/gtk-base.hpp"
32 #include "stage/config-keys.hpp"
40 #include "lib/format-string.hpp"
41 //#include "lib/util.hpp"
42 
43 #include <boost/algorithm/string/classification.hpp>
44 #include <boost/algorithm/string/split.hpp>
45 #include <vector>
46 #include <string>
47 
48 //using util::cStr;
49 //using util::isnil;
50 using ::util::_Fmt;
51 using std::vector;
52 using std::string;
53 
54 
55 namespace stage {
56 namespace interact {
57 
58  using boost::algorithm::is_any_of;
59  using boost::algorithm::split;
60  using workspace::WorkspaceWindow;
61  using ctrl::NotificationHub;
62  using ctrl::GlobalCtx;
63  using Gtk::AboutDialog;
64 
65 
66  // dtors via smart-ptr invoked from here... (TODO any to come here?)
67  Wizard::~Wizard()
68  { }
69 
70 
71  Wizard::Wizard (GlobalCtx& globals)
72  : globalCtx_{globals}
73  , notificationHub_{new NotificationHub{getErrorLogID()
74  ,globals.uiBus_.getAccessPoint()
75  ,[&]() -> widget::ErrorLogDisplay&
76  {
77  return globalCtx_.windowLoc_.locatePanel()
78  .find_or_create<panel::InfoBoxPanel>()
79  .getLog();
80  }} }
81  { }
82 
83 
84 
89  void
90  Wizard::show_HelpAbout()
91  {
92  // Configure the about dialog
93  AboutDialog dialog;
94 
95  cuString copyrightNotice {_Fmt(_("© %s the original Authors\n"
96  "-- Lumiera Team --\n"
97  "Lumiera is Free Software (GPL)"))
98  % Config::get (KEY_COPYRIGHT)};
99 
100  string authors = Config::get (KEY_AUTHORS);
101  vector<uString> authorsList;
102  split (authorsList, authors, is_any_of (",|"));
103 
104 
105  dialog.set_program_name(Config::get (KEY_TITLE));
106  dialog.set_version(Config::get (KEY_VERSION));
107  dialog.set_copyright(copyrightNotice);
108  dialog.set_website(Config::get (KEY_WEBSITE));
109  dialog.set_authors(authorsList);
110 
111  WorkspaceWindow& currentWindow = globalCtx_.windowLoc_.findActiveWindow();
112  dialog.set_transient_for (currentWindow);
113 
114  // Show the about dialog
115  dialog.run();
116  }
117 
118 
125  void
126  Wizard::launchTestCtrl()
127  {
128  if (testControlWindow_)
129  testControlWindow_->present(); // just (re)show the existing window
130  else
131  testControlWindow_ = std::make_unique<dialog::TestControl> (globalCtx_.uiBus_.getAccessPoint(),
132  globalCtx_.windowLoc_.findActiveWindow());
133  }
134 
135 
136 
137 }}// namespace stage::interact
Definition of access keys for global UI configuration.
Global help controller.
Navigating a centre of user activity globally.
Dependency context to hold all the global UI top-level entities.
Front-end for printf-style string template interpolation.
A front-end for using printf-style formatting.
Controller to receive and handle notification messages for the user.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
Non-modal dialog window to trigger diagnostics and self test routines.
A (dockable) panel to display and manage information and parameters.
The main Lumiera workspace window.
This file contains the definition of the main workspace window parent, which is the toplevel parent o...
A set of basic GTK includes for the UI.