Skip to content

Commit

Permalink
fix about window and welcome screen
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Feb 28, 2022
1 parent ec8725e commit c9049d6
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 38 deletions.
19 changes: 1 addition & 18 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,7 @@ contents.xcworkspacedata
profile
**/MacOSX/build
**/iOS/build
**/VisualStudio2005/Debug
**/VisualStudio2005/Release
**/VisualStudio2008/Debug
**/VisualStudio2008/Release
**/VisualStudio2010/Debug
**/VisualStudio2010/Release
**/VisualStudio2012/Debug
**/VisualStudio2012/Release
**/VisualStudio2013/Debug
**/VisualStudio2013/Release
**/VisualStudio2013/x64
**/VisualStudio2015/Debug
**/VisualStudio2015/Release
**/VisualStudio2015/x64
**/VisualStudio2017/x64
**/VisualStudio2019/x64
**/VisualStudio2022/x64
**/VisualStudio2022
**/Android/bin
**/Android/libs
**/Android/gen
Expand All @@ -65,7 +49,6 @@ Builds/CodeBlocksLinux/*\.cbp

Builds/VisualStudio2017/\.vs/
Builds/VisualStudio2019/\.vs/
Builds/VisualStudio2022/\.vs/
Builds/VisualStudio2019/packages/
Builds/VisualStudio2017_Win7/

Expand Down
6 changes: 5 additions & 1 deletion Builds/VisualStudio2019_CI/Chataigne_App.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6524,10 +6524,14 @@
<None Include="..\..\Modules\juce_simpleweb\README.md"/>
<None Include="..\..\Modules\juce_timeline\README.md"/>
<None Include=".\icon.ico"/>
<None Include="packages.config"/>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include=".\resources.rc"/>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<ImportGroup Label="ExtensionTargets"/>
<ImportGroup Label="ExtensionTargets">
<Import Project="packages\Microsoft.Web.WebView2.1.0.902.49\build\native\Microsoft.Web.WebView2.targets"
Condition="Exists('packages\Microsoft.Web.WebView2.1.0.902.49\build\native\Microsoft.Web.WebView2.targets')"/>
</ImportGroup>
</Project>
1 change: 1 addition & 0 deletions Builds/VisualStudio2019_CI/Chataigne_App.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -13175,6 +13175,7 @@
<None Include=".\icon.ico">
<Filter>JUCE Library Code</Filter>
</None>
<None Include="packages.config"/>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include=".\resources.rc">
Expand Down
2 changes: 1 addition & 1 deletion Builds/VisualStudio2019_CI/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Web.WebView2" version="0.9.488" />
<package id="Microsoft.Web.WebView2" version="1.0.902.49" />
</packages>
6 changes: 5 additions & 1 deletion Builds/VisualStudio2019_Win7CI/Chataigne_App.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6523,10 +6523,14 @@
<None Include="..\..\Modules\juce_simpleweb\README.md"/>
<None Include="..\..\Modules\juce_timeline\README.md"/>
<None Include=".\icon.ico"/>
<None Include="packages.config"/>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include=".\resources.rc"/>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<ImportGroup Label="ExtensionTargets"/>
<ImportGroup Label="ExtensionTargets">
<Import Project="packages\Microsoft.Web.WebView2.1.0.902.49\build\native\Microsoft.Web.WebView2.targets"
Condition="Exists('packages\Microsoft.Web.WebView2.1.0.902.49\build\native\Microsoft.Web.WebView2.targets')"/>
</ImportGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13175,6 +13175,7 @@
<None Include=".\icon.ico">
<Filter>JUCE Library Code</Filter>
</None>
<None Include="packages.config"/>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include=".\resources.rc">
Expand Down
2 changes: 1 addition & 1 deletion Builds/VisualStudio2019_Win7CI/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Web.WebView2" version="0.9.488" />
<package id="Microsoft.Web.WebView2" version="1.0.902.49" />
</packages>
6 changes: 5 additions & 1 deletion Builds/VisualStudio2022/Chataigne_App.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6522,10 +6522,14 @@
<None Include="..\..\Modules\juce_simpleweb\README.md"/>
<None Include="..\..\Modules\juce_timeline\README.md"/>
<None Include=".\icon.ico"/>
<None Include="packages.config"/>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include=".\resources.rc"/>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets"/>
<ImportGroup Label="ExtensionTargets"/>
<ImportGroup Label="ExtensionTargets">
<Import Project="packages\Microsoft.Web.WebView2.1.0.902.49\build\native\Microsoft.Web.WebView2.targets"
Condition="Exists('packages\Microsoft.Web.WebView2.1.0.902.49\build\native\Microsoft.Web.WebView2.targets')"/>
</ImportGroup>
</Project>
1 change: 1 addition & 0 deletions Builds/VisualStudio2022/Chataigne_App.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -13175,6 +13175,7 @@
<None Include=".\icon.ico">
<Filter>JUCE Library Code</Filter>
</None>
<None Include="packages.config"/>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include=".\resources.rc">
Expand Down
2 changes: 1 addition & 1 deletion Chataigne.jucer
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@
JUCE_USE_MP3AUDIOFORMAT="1" JUCE_USE_LAME_AUDIO_FORMAT="1" JUCE_USE_WINDOWS_MEDIA_FORMAT="1"
JUCE_ENABLE_BROADCAST_BY_DEFAULT="1" JUCE_EXCLUSIVE_BINDING_BY_DEFAULT="1"
ORGANICUI_USE_WEBSERVER="1" JUCE_USE_WINRT_MIDI="1" JUCE_IP_AND_PORT_DETECTION="1"
ORGANICUI_USE_SHAREDTEXTURE="1"/>
ORGANICUI_USE_SHAREDTEXTURE="1" JUCE_USE_WIN_WEBVIEW2="1"/>
<LIVE_SETTINGS>
<WINDOWS/>
<OSX/>
Expand Down
2 changes: 1 addition & 1 deletion JuceLibraryCode/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
#endif

#ifndef JUCE_USE_WIN_WEBVIEW2
//#define JUCE_USE_WIN_WEBVIEW2 0
#define JUCE_USE_WIN_WEBVIEW2 1
#endif

#ifndef JUCE_ENABLE_LIVE_CONSTANT_EDITOR
Expand Down
3 changes: 3 additions & 0 deletions Source/MainComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class MainContentComponent :

void init() override;

std::unique_ptr<WelcomeScreen> welcomeScreen;
std::unique_ptr<AboutWindow> aboutWindow;

static SequenceManagerUI* createSequenceManagerUI(const String& name);

void getAllCommands(Array<CommandID>& commands) override;
Expand Down
22 changes: 12 additions & 10 deletions Source/MainComponentCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ namespace ChataigneCommandIDs
static const int gotoChangelog = 0x60007;

static const int guideStart = 0x300; //up to 0x300 +100
static const int exitGuide = 0x399;
static const int exitGuide = 0x399;
static const int goToCommunityModules = 0x500;
static const int reloadCustomModules = 0x501;
static const int exportSelection = 0x800;
static const int importSelection = 0x801;

}

void MainContentComponent::getCommandInfo(CommandID commandID, ApplicationCommandInfo& result)
void MainContentComponent::getCommandInfo(CommandID commandID, ApplicationCommandInfo& result)
{
if (commandID >= ChataigneCommandIDs::guideStart && commandID < ChataigneCommandIDs::guideStart + 99)
{
Expand Down Expand Up @@ -136,7 +136,7 @@ void MainContentComponent::getAllCommands(Array<CommandID>& commands) {
}


PopupMenu MainContentComponent::getMenuForIndex(int topLevelMenuIndex, const String& menuName)
PopupMenu MainContentComponent::getMenuForIndex(int topLevelMenuIndex, const String& menuName)
{
PopupMenu menu = OrganicMainContentComponent::getMenuForIndex(topLevelMenuIndex, menuName);

Expand All @@ -153,7 +153,8 @@ PopupMenu MainContentComponent::getMenuForIndex(int topLevelMenuIndex, const Str
menu.addCommandItem(&getCommandManager(), ChataigneCommandIDs::gotoChangelog);
menu.addCommandItem(&getCommandManager(), ChataigneCommandIDs::postGithubIssue);

}else if (menuName == "Guides")
}
else if (menuName == "Guides")
{
for (int i = 0; i < Guider::getInstance()->factory.defs.size(); ++i)
{
Expand All @@ -167,7 +168,7 @@ PopupMenu MainContentComponent::getMenuForIndex(int topLevelMenuIndex, const Str
return menu;
}

void MainContentComponent::fillFileMenuInternal(PopupMenu & menu)
void MainContentComponent::fillFileMenuInternal(PopupMenu& menu)
{
menu.addCommandItem(&getCommandManager(), ChataigneCommandIDs::importSelection);
menu.addCommandItem(&getCommandManager(), ChataigneCommandIDs::exportSelection);
Expand All @@ -191,15 +192,16 @@ bool MainContentComponent::perform(const InvocationInfo& info)

case ChataigneCommandIDs::showAbout:
{
AboutWindow w;
DialogWindow::showDialog("About", &w, getTopLevelComponent(), Colours::transparentBlack, true);
if (aboutWindow == nullptr) aboutWindow.reset(new AboutWindow());
DialogWindow::showDialog("About", aboutWindow.get(), getTopLevelComponent(), Colours::transparentBlack, true);
}
break;

case ChataigneCommandIDs::showWelcome:
{
WelcomeScreen w;
DialogWindow::showDialog("Welcome", &w, getTopLevelComponent(), Colours::black, true);
if (welcomeScreen == nullptr) welcomeScreen.reset(new WelcomeScreen());
DialogWindow::showDialog("Welcome", welcomeScreen.get(), getTopLevelComponent(), Colours::transparentBlack, true);

}
break;

Expand Down
1 change: 0 additions & 1 deletion Source/UI/WelcomeScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ ApplicationProperties& getAppProperties();

WelcomeScreen::WelcomeScreen()
{

String lastVersion = getAppProperties().getUserSettings()->getValue("lastVersion", "0");
bool firstRun = lastVersion.isEmpty();

Expand Down
12 changes: 10 additions & 2 deletions Source/UI/WelcomeScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@ class WelcomeScreen :
void resized() override;

class WebComp :
public WebBrowserComponent
#if JUCE_WINDOWS
public WindowsWebView2WebBrowserComponent
#else
public WebBrowserComponenet
#endif
{
public:
WebComp() {}
WebComp()
#if JUCE_WINDOWS
: WindowsWebView2WebBrowserComponent(true,WebView2Preferences())
#endif
{}
~WebComp() {}
String baseURL;
void setBaseURL(StringRef url);
Expand Down

0 comments on commit c9049d6

Please sign in to comment.