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)
5  2017, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
22 #include "stage/gtk-base.hpp"
23 #include "stage/config-keys.hpp"
31 #include "lib/format-string.hpp"
32 //#include "lib/util.hpp"
33 
34 #include <boost/algorithm/string/classification.hpp>
35 #include <boost/algorithm/string/split.hpp>
36 #include <vector>
37 #include <string>
38 
39 //using util::cStr;
40 //using util::isnil;
41 using ::util::_Fmt;
42 using std::vector;
43 using std::string;
44 
45 
46 namespace stage {
47 namespace interact {
48 
49  using boost::algorithm::is_any_of;
50  using boost::algorithm::split;
51  using workspace::WorkspaceWindow;
52  using ctrl::NotificationHub;
53  using ctrl::GlobalCtx;
54  using Gtk::AboutDialog;
55 
56 
57  // dtors via smart-ptr invoked from here... (TODO any to come here?)
58  Wizard::~Wizard()
59  { }
60 
61 
62  Wizard::Wizard (GlobalCtx& globals)
63  : globalCtx_{globals}
64  , notificationHub_{new NotificationHub{getErrorLogID()
65  ,globals.uiBus_.getAccessPoint()
66  ,[&]() -> widget::ErrorLogDisplay&
67  {
68  return globalCtx_.windowLoc_.locatePanel()
69  .find_or_create<panel::InfoBoxPanel>()
70  .getLog();
71  }} }
72  { }
73 
74 
75 
80  void
81  Wizard::show_HelpAbout()
82  {
83  // Configure the about dialog
84  AboutDialog dialog;
85 
86  cuString copyrightNotice {_Fmt(_("© %s the original Authors\n"
87  "-- Lumiera Team --\n"
88  "Lumiera is Free Software (GPL)"))
89  % Config::get (KEY_COPYRIGHT)};
90 
91  string authors = Config::get (KEY_AUTHORS);
92  vector<uString> authorsList;
93  split (authorsList, authors, is_any_of (",|"));
94 
95 
96  dialog.set_program_name(Config::get (KEY_TITLE));
97  dialog.set_version(Config::get (KEY_VERSION));
98  dialog.set_copyright(copyrightNotice);
99  dialog.set_website(Config::get (KEY_WEBSITE));
100  dialog.set_authors(authorsList);
101 
102  WorkspaceWindow& currentWindow = globalCtx_.windowLoc_.findActiveWindow();
103  dialog.set_transient_for (currentWindow);
104 
105  // Show the about dialog
106  dialog.run();
107  }
108 
109 
116  void
117  Wizard::launchTestCtrl()
118  {
119  if (testControlWindow_)
120  testControlWindow_->present(); // just (re)show the existing window
121  else
122  testControlWindow_ = std::make_unique<dialog::TestControl> (globalCtx_.uiBus_.getAccessPoint(),
123  globalCtx_.windowLoc_.findActiveWindow());
124  }
125 
126 
127 
128 }}// 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:37
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.