2017-03-02 23:49:23 +01:00
|
|
|
/*
|
|
|
|
|
Wizard - controller user help and assistance
|
|
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2017, Hermann Vosseler <Ichthyostega@web.de>
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
|
|
* *****************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @file wizard.cpp
|
|
|
|
|
** Implementation of the global help controller to show the user manual.
|
|
|
|
|
**
|
|
|
|
|
** @todo WIP 3/2017 early draft of the UI top-level controllers
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2017-04-23 18:28:32 +02:00
|
|
|
#include "gui/gtk-base.hpp"
|
|
|
|
|
#include "gui/config-keys.hpp"
|
2017-03-02 23:49:23 +01:00
|
|
|
#include "gui/interact/wizard.hpp"
|
|
|
|
|
#include "gui/interact/spot-locator.hpp"
|
2017-04-23 18:28:32 +02:00
|
|
|
#include "gui/workspace/workspace-window.hpp"
|
2018-08-17 18:17:13 +02:00
|
|
|
#include "gui/panel/infobox-panel.hpp"
|
2018-08-09 01:23:20 +02:00
|
|
|
#include "gui/ctrl/notification-hub.hpp"
|
2017-03-02 23:49:23 +01:00
|
|
|
#include "gui/ctrl/global-ctx.hpp"
|
2017-04-23 18:28:32 +02:00
|
|
|
#include "lib/format-string.hpp"
|
2017-03-02 23:49:23 +01:00
|
|
|
//#include "lib/util.hpp"
|
|
|
|
|
|
2017-04-23 18:28:32 +02:00
|
|
|
#include <boost/algorithm/string/classification.hpp>
|
|
|
|
|
#include <boost/algorithm/string/split.hpp>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
2017-03-02 23:49:23 +01:00
|
|
|
//using util::cStr;
|
|
|
|
|
//using util::isnil;
|
2017-04-23 18:28:32 +02:00
|
|
|
using ::util::_Fmt;
|
|
|
|
|
using std::vector;
|
|
|
|
|
using std::string;
|
2017-03-02 23:49:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace gui {
|
|
|
|
|
namespace interact {
|
|
|
|
|
|
2017-04-23 18:28:32 +02:00
|
|
|
using boost::algorithm::is_any_of;
|
|
|
|
|
using boost::algorithm::split;
|
|
|
|
|
using workspace::WorkspaceWindow;
|
2018-08-13 00:44:52 +02:00
|
|
|
using ctrl::NotificationHub;
|
2017-03-02 23:49:23 +01:00
|
|
|
using ctrl::GlobalCtx;
|
2017-04-23 18:28:32 +02:00
|
|
|
using Gtk::AboutDialog;
|
2017-03-02 23:49:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// dtors via smart-ptr invoked from here... (TODO any to come here?)
|
|
|
|
|
Wizard::~Wizard()
|
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Wizard::Wizard (GlobalCtx& globals)
|
|
|
|
|
: globalCtx_{globals}
|
2018-08-17 14:19:37 +02:00
|
|
|
, notificationHub_{new NotificationHub{getErrorLogID()
|
|
|
|
|
,globals.uiBus_.getAccessPoint()
|
|
|
|
|
,[&]() -> widget::ErrorLogDisplay&
|
|
|
|
|
{
|
|
|
|
|
return allocateErrorLogView();
|
|
|
|
|
}} }
|
2017-03-02 23:49:23 +01:00
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-23 18:28:32 +02:00
|
|
|
/**
|
|
|
|
|
* show the notorious "about Lumiera" dialog.
|
|
|
|
|
* Something every application has and no user really cares about.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
Wizard::show_HelpAbout()
|
|
|
|
|
{
|
|
|
|
|
// Configure the about dialog
|
|
|
|
|
AboutDialog dialog;
|
|
|
|
|
|
|
|
|
|
cuString copyrightNotice {_Fmt(_("© %s the original Authors\n"
|
|
|
|
|
"-- Lumiera Team --\n"
|
|
|
|
|
"Lumiera is Free Software (GPL)"))
|
|
|
|
|
% Config::get (KEY_COPYRIGHT)};
|
|
|
|
|
|
|
|
|
|
string authors = Config::get (KEY_AUTHORS);
|
|
|
|
|
vector<uString> authorsList;
|
|
|
|
|
split (authorsList, authors, is_any_of (",|"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialog.set_program_name(Config::get (KEY_TITLE));
|
|
|
|
|
dialog.set_version(Config::get (KEY_VERSION));
|
|
|
|
|
dialog.set_copyright(copyrightNotice);
|
|
|
|
|
dialog.set_website(Config::get (KEY_WEBSITE));
|
|
|
|
|
dialog.set_authors(authorsList);
|
|
|
|
|
|
2017-09-02 18:36:58 +02:00
|
|
|
WorkspaceWindow& currentWindow = globalCtx_.windowLoc_.findActiveWindow();
|
2017-04-23 18:28:32 +02:00
|
|
|
dialog.set_transient_for (currentWindow);
|
|
|
|
|
|
|
|
|
|
// Show the about dialog
|
|
|
|
|
dialog.run();
|
|
|
|
|
}
|
2017-03-02 23:49:23 +01:00
|
|
|
|
|
|
|
|
|
2018-08-17 14:19:37 +02:00
|
|
|
|
|
|
|
|
/** @internal reach out to attach or allocate a display widget for the error log.
|
|
|
|
|
* @todo as of 8/2018 we use "inside knowledge" to create this view in a hard wired location.
|
|
|
|
|
* But in the end, this allocation task should be delegated to the ViewLocator
|
|
|
|
|
*/
|
|
|
|
|
widget::ErrorLogDisplay&
|
|
|
|
|
Wizard::allocateErrorLogView()
|
|
|
|
|
{
|
2018-08-17 18:17:13 +02:00
|
|
|
auto& infoBox = globalCtx_.windowLoc_.locatePanel().find_or_create<panel::InfoBoxPanel>();
|
2018-08-17 14:19:37 +02:00
|
|
|
UNIMPLEMENTED("reach out to attach or allocate a display widget for the error log");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-02 23:49:23 +01:00
|
|
|
}}// namespace gui::interact
|