Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ enum CommandIDs
viewMediaClipboard = 0x2001,

// Help
welcome = 0x3000,
about = 0x3001
about = 0x3000,
tutorial = 0x3001
};

StringArray MainComponent::getMenuBarNames()
Expand Down Expand Up @@ -75,7 +75,7 @@ PopupMenu MainComponent::getMenuForIndex([[maybe_unused]] int menuIndex, const S
else if (menuName == "Help")
{
menu.addCommandItem(&commandManager, CommandIDs::about);
menu.addCommandItem(&commandManager, CommandIDs::welcome);
menu.addCommandItem(&commandManager, CommandIDs::tutorial);
}
else
{
Expand Down Expand Up @@ -140,7 +140,7 @@ void MainComponent::getAllCommands(Array<CommandID>& commands)

commands.addArray(viewIDs, numElementsInArray(viewIDs));

const CommandID helpIDs[] = { CommandIDs::about, CommandIDs::welcome };
const CommandID helpIDs[] = { CommandIDs::about, CommandIDs::tutorial };

commands.addArray(helpIDs, numElementsInArray(helpIDs));
}
Expand Down Expand Up @@ -209,15 +209,15 @@ void MainComponent::getCommandInfo(CommandID commandID, ApplicationCommandInfo&
break;

/* --Help-- */
case CommandIDs::welcome:
case CommandIDs::about:
result.setInfo(
"Welcome Page", "Provides helpful information for first-time users", "Help", 0);
"About HARP", "Provides helpful information and links for application", "Help", 0);

break;

case CommandIDs::about:
case CommandIDs::tutorial:
result.setInfo(
"About HARP", "Provides helpful information and links for application", "Help", 0);
"Welcome Tutorial", "Provides helpful information for first-time users", "Help", 0);

break;
}
Expand Down Expand Up @@ -279,18 +279,18 @@ bool MainComponent::perform(const InvocationInfo& info)
break;

/* --Help-- */
case CommandIDs::welcome:
DBG_AND_LOG("MainComponent::perform: \"welcome\" command invoked.");
// TODO - openWelcomeWindow();

break;

case CommandIDs::about:
DBG_AND_LOG("MainComponent::perform: \"about\" command invoked.");
openAboutWindow();

break;

case CommandIDs::tutorial:
DBG_AND_LOG("MainComponent::perform: \"tutorial\" command invoked.");
openWelcomeWindow();

break;

default:
return false;
}
Expand Down
33 changes: 6 additions & 27 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,38 +76,17 @@ class GuiAppApplication : public JUCEApplication, public FocusChangeListener

mainWindow.reset(new HARPWindow(windowTitle));

bool forceShowWelcome = false;
bool showWelcome = Settings::getBoolValue("view.showWelcomePopup", true);

bool showWelcome = true;

if (! forceShowWelcome)
if (showWelcome)
{
if (Settings::containsKey("view.showWelcomePopup"))
if (auto* mainComp =
dynamic_cast<MainComponent*>(getMainWindowPtr()->getContentComponent()))
{
showWelcome = Settings::getIntValue("view.showWelcomePopup", 1) == 1;
mainComp->openWelcomeWindow();
}
}

if (showWelcome)
{
MessageManager::callAsync(
[this]()
{
DialogWindow::LaunchOptions opts;
opts.dialogTitle = "Welcome";
opts.content.setOwned(new WelcomeWindow(
[this]()
{
if (auto* mainComp =
dynamic_cast<MainComponent*>(mainWindow->getContentComponent()))
mainComp->openSettingsWindow();
}));
opts.content->setSize(480, 500);
opts.useNativeTitleBar = true;
opts.launchAsync();
});
}

StringArray args;

// Split command line arguments at spaces
Expand Down Expand Up @@ -585,7 +564,7 @@ class GuiAppApplication : public JUCEApplication, public FocusChangeListener
debugAndLog(
"GuiAppApplication::handleFileOpenChoice: No window currently focused. Importing file to main window.");

windowForFileImport = mainWindow.get();
windowForFileImport = getMainWindowPtr();
}

if (auto* mainComp =
Expand Down
Loading
Loading