@@ -76,7 +76,7 @@ class ExporterSettingsPanel : public Component
7676 {
7777 auto listboxBounds = getLocalBounds ().removeFromLeft (listBoxWidth);
7878
79- g.setColour (findColour (PlugDataColour::outlineColourId ));
79+ g.setColour (findColour (PlugDataColour::toolbarOutlineColourId ));
8080 g.drawLine (Line<float >(listboxBounds.getTopRight ().toFloat (), listboxBounds.getBottomRight ().toFloat ()));
8181 }
8282
@@ -145,18 +145,31 @@ HeavyExportDialog::HeavyExportDialog(Dialog* dialog)
145145 : exportingView(new ExportingProgressView())
146146 , exporterPanel(new ExporterSettingsPanel(dynamic_cast <PluginEditor*>(dialog->parentComponent), exportingView.get()))
147147 , installer(new ToolchainInstaller(dynamic_cast <PluginEditor*>(dialog->parentComponent)))
148+ , infoButton(new TextButton(Icons::Help))
148149{
149-
150150 hasToolchain = Toolchain::dir.exists ();
151-
152- // Create integer versions by removing the dots
153- // Compare latest version on github to the currently installed version
154- auto const latestVersion = URL (" https://raw.githubusercontent.com/plugdata-team/plugdata-heavy-toolchain/main/VERSION" ).readEntireTextStream ().trim ().removeCharacters (" ." ).getIntValue ();
151+
155152
156153 // Don't do this relative to toolchain variable, that won't work on Windows
157154 auto const versionFile = ProjectInfo::appDataDir.getChildFile (" Toolchain" ).getChildFile (" VERSION" );
158155 auto const installedVersion = versionFile.loadFileAsString ().trim ().removeCharacters (" ." ).getIntValue ();
159156
157+
158+ // Create integer versions by removing the dots
159+ // Compare latest version on github to the currently installed version
160+ int latestVersion;
161+ try {
162+ auto compatTable = JSON::parse (URL (" https://raw.githubusercontent.com/plugdata-team/plugdata-heavy-toolchain/main/COMPATIBILITY" ).readEntireTextStream ());
163+ // Get latest version
164+
165+ latestVersion = compatTable.getDynamicObject ()->getProperty (String (ProjectInfo::versionString).upToFirstOccurrenceOf (" -" , false , false )).toString ().removeCharacters (" ." ).getIntValue ();
166+ }
167+ // Network error, JSON error or empty version string somehow
168+ catch (...) {
169+ latestVersion = installedVersion;
170+ return ;
171+ }
172+
160173 if (hasToolchain && latestVersion > installedVersion) {
161174 installer->needsUpdate = true ;
162175 hasToolchain = false ;
@@ -168,6 +181,12 @@ HeavyExportDialog::HeavyExportDialog(Dialog* dialog)
168181
169182 exportingView->setAlwaysOnTop (true );
170183
184+ infoButton->getProperties ().set (" Style" , " LargeIcon" );
185+ infoButton->onClick = [](){
186+ URL (" https://wasted-audio.github.io/hvcc/docs/01.introduction.html#what-is-heavy" ).launchInDefaultBrowser ();
187+ };
188+ addAndMakeVisible (*infoButton);
189+
171190 installer->toolchainInstalledCallback = [this ]() {
172191 hasToolchain = true ;
173192 exporterPanel->setVisible (true );
@@ -191,12 +210,29 @@ void HeavyExportDialog::paint(Graphics& g)
191210{
192211 g.setColour (findColour (PlugDataColour::panelBackgroundColourId));
193212 g.fillRoundedRectangle (getLocalBounds ().toFloat (), Corners::windowCornerRadius);
213+
214+ auto titlebarBounds = getLocalBounds ().removeFromTop (40 );
215+
216+ Path p;
217+ p.addRoundedRectangle (titlebarBounds.getX (), titlebarBounds.getY (), titlebarBounds.getWidth (), titlebarBounds.getHeight (), Corners::largeCornerRadius, Corners::largeCornerRadius, true , true , false , false );
218+
219+ g.setColour (findColour (PlugDataColour::toolbarBackgroundColourId));
220+ g.fillPath (p);
221+
222+ Fonts::drawStyledText (g, " Compiler" , Rectangle<float >(0 .0f , 4 .0f , getWidth (), 32 .0f ), findColour (PlugDataColour::panelTextColourId), Semibold, 15 , Justification::centred);
223+ }
224+
225+ void HeavyExportDialog::paintOverChildren (Graphics& g)
226+ {
227+ g.setColour (findColour (PlugDataColour::toolbarOutlineColourId));
228+ g.drawHorizontalLine (40 , 0 .0f , getWidth ());
194229}
195230
196231void HeavyExportDialog::resized ()
197232{
198- auto b = getLocalBounds ();
233+ auto b = getLocalBounds (). withTrimmedTop ( 40 ) ;
199234 exporterPanel->setBounds (b);
200235 installer->setBounds (b);
201236 exportingView->setBounds (b);
237+ infoButton->setBounds (Rectangle<int >(40 , 40 ));
202238}
0 commit comments