ui: Show trial in window title
This commit is contained in:
+21
-7
@@ -40,7 +40,7 @@ void Application::createInstance(
|
|||||||
s_instance->m_componentManager = ComponentManager::create(viewFactory, s_instance->m_storageCache.get());
|
s_instance->m_componentManager = ComponentManager::create(viewFactory, s_instance->m_storageCache.get());
|
||||||
|
|
||||||
s_instance->m_mainView = viewFactory->createMainView();
|
s_instance->m_mainView = viewFactory->createMainView();
|
||||||
s_instance->m_mainView->setTitle("Coati");
|
s_instance->updateTitle();
|
||||||
|
|
||||||
s_instance->m_componentManager->setup(s_instance->m_mainView.get());
|
s_instance->m_componentManager->setup(s_instance->m_mainView.get());
|
||||||
s_instance->m_mainView->loadLayout();
|
s_instance->m_mainView->loadLayout();
|
||||||
@@ -130,11 +130,6 @@ int Application::handleDialog(const std::string& message, const std::vector<std:
|
|||||||
return getDialogView()->confirm(message, options);
|
return getDialogView()->confirm(message, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::setTitle(const std::string& title)
|
|
||||||
{
|
|
||||||
m_mainView->setTitle(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Application::isInTrial() const
|
bool Application::isInTrial() const
|
||||||
{
|
{
|
||||||
return m_isInTrial;
|
return m_isInTrial;
|
||||||
@@ -156,7 +151,7 @@ void Application::createAndLoadProject(const FilePath& projectSettingsFilePath)
|
|||||||
{
|
{
|
||||||
if (m_hasGUI)
|
if (m_hasGUI)
|
||||||
{
|
{
|
||||||
setTitle("Coati - " + projectSettingsFilePath.fileName());
|
updateTitle();
|
||||||
m_mainView->hideStartScreen();
|
m_mainView->hideStartScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,6 +199,8 @@ void Application::handleMessage(MessageEnteredLicense* message)
|
|||||||
MessageStatus("Found valid license key, unlocked application.").dispatch();
|
MessageStatus("Found valid license key, unlocked application.").dispatch();
|
||||||
|
|
||||||
m_isInTrial = false;
|
m_isInTrial = false;
|
||||||
|
|
||||||
|
updateTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::handleMessage(MessageFinishedParsing* message)
|
void Application::handleMessage(MessageFinishedParsing* message)
|
||||||
@@ -341,3 +338,20 @@ void Application::logStorageStats() const
|
|||||||
|
|
||||||
LOG_INFO(ss.str());
|
LOG_INFO(ss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Application::updateTitle()
|
||||||
|
{
|
||||||
|
std::string title = m_isInTrial ? "Coati Trial" : "Coati";
|
||||||
|
|
||||||
|
if (m_project)
|
||||||
|
{
|
||||||
|
FilePath projectPath = m_project->getProjectSettingsFilePath();
|
||||||
|
|
||||||
|
if (!projectPath.empty())
|
||||||
|
{
|
||||||
|
title += " - " + projectPath.fileName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_mainView->setTitle(title);
|
||||||
|
}
|
||||||
|
|||||||
@@ -52,8 +52,6 @@ public:
|
|||||||
int handleDialog(const std::string& message);
|
int handleDialog(const std::string& message);
|
||||||
int handleDialog(const std::string& message, const std::vector<std::string>& options);
|
int handleDialog(const std::string& message, const std::vector<std::string>& options);
|
||||||
|
|
||||||
void setTitle(const std::string& title);
|
|
||||||
|
|
||||||
bool isInTrial() const;
|
bool isInTrial() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -75,6 +73,8 @@ private:
|
|||||||
DialogView* getDialogView() const;
|
DialogView* getDialogView() const;
|
||||||
void logStorageStats() const;
|
void logStorageStats() const;
|
||||||
|
|
||||||
|
void updateTitle();
|
||||||
|
|
||||||
const bool m_hasGUI;
|
const bool m_hasGUI;
|
||||||
ProjectFactory m_projectFactory;
|
ProjectFactory m_projectFactory;
|
||||||
std::shared_ptr<Project> m_project;
|
std::shared_ptr<Project> m_project;
|
||||||
|
|||||||
Reference in New Issue
Block a user