swift
mainwindowaccess.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
4 #include "gui/mainwindowaccess.h"
5 
7 #include "gui/managedstatusbar.h"
9 
10 using namespace swift::misc;
11 
12 namespace swift::gui
13 {
14  IMainWindowAccess::~IMainWindowAccess()
15  {
16  // void
17  }
18 
19  bool IMainWindowAccess::displayInStatusBar(const CStatusMessage &message)
20  {
21  if (message.isEmpty()) { return false; }
22  if (!m_mwaStatusBar) { return false; }
23  m_mwaStatusBar->displayStatusMessage(message);
24  return true;
25  }
26 
27  bool IMainWindowAccess::displayInOverlayWindow(const CStatusMessage &message, std::chrono::milliseconds timeout)
28  {
29  if (message.isEmpty()) { return false; }
30  if (!m_mwaOverlayFrame) { return false; }
31  m_mwaOverlayFrame->showOverlayMessage(message, timeout);
32  return true;
33  }
34 
35  bool IMainWindowAccess::displayInOverlayWindow(const CStatusMessageList &messages,
36  std::chrono::milliseconds timeout)
37  {
38  if (messages.isEmpty()) { return false; }
39  if (!m_mwaOverlayFrame) { return false; }
40  m_mwaOverlayFrame->showOverlayMessages(messages, false, timeout);
41  return true;
42  }
43 
44  bool IMainWindowAccess::displayInOverlayWindow(const QString &html, std::chrono::milliseconds timeout)
45  {
46  if (html.isEmpty()) { return false; }
47  if (!m_mwaOverlayFrame) { return false; }
48  m_mwaOverlayFrame->showOverlayHTMLMessage(html, timeout);
49  return true;
50  }
51 } // namespace swift::gui
bool isEmpty() const
Message empty.
bool isEmpty() const
Synonym for empty.
Definition: sequence.h:285
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
GUI related classes.
Free functions in swift::misc.