diff --git a/source/MainComponent.cpp b/source/MainComponent.cpp index 292b449..c54e9eb 100644 --- a/source/MainComponent.cpp +++ b/source/MainComponent.cpp @@ -39,7 +39,7 @@ void mylog(const char* format, ...) //[/MiscUserDefs] //============================================================================== -MainComponent::MainComponent () +MainComponent::MainComponent (const String prjname) : Thread("RBM") , m_stack(nullptr) , m_pLayer(nullptr) @@ -116,7 +116,7 @@ MainComponent::MainComponent () createButton->addListener (this); addAndMakeVisible (projectNameLabel = new Label ("Project Name label", - TRANS("test"))); + prjname)); projectNameLabel->setFont (Font (15.00f, Font::plain)); projectNameLabel->setJustificationType (Justification::centred); projectNameLabel->setEditable (true, true, false); diff --git a/source/MainComponent.hpp b/source/MainComponent.hpp index 229c4d9..7c416f9 100644 --- a/source/MainComponent.hpp +++ b/source/MainComponent.hpp @@ -50,7 +50,7 @@ class MainComponent { public: //============================================================================== - MainComponent (); + MainComponent (const String prjname); ~MainComponent(); //============================================================================== diff --git a/source/gui.cpp b/source/gui.cpp index 54a4b5f..aa80c99 100644 --- a/source/gui.cpp +++ b/source/gui.cpp @@ -30,7 +30,7 @@ public: void initialise (const String& commandLine) override { // Add your application's initialisation code here.. - mainWindow = new MainWindow; + mainWindow = new MainWindow(commandLine); } void shutdown() override @@ -62,11 +62,20 @@ public: class MainWindow : public DocumentWindow { public: - MainWindow() : DocumentWindow ("RBM Gui", + MainWindow(const String& commandLine) : DocumentWindow ("RBM Gui", Colours::lightgrey, DocumentWindow::allButtons) { - setContentOwned (new MainComponent(), true); + StringArray token; + token.addTokens(commandLine, " "); + std::cout << token[0] << std::endl; + + String name = token[0]; + if (name.isEmpty()) + { + name = "test"; + } + setContentOwned (new MainComponent(name), true); centreWithSize (getWidth(), getHeight()); setVisible (true);