Esempio n. 1
0
bool MainWindow::closeProject (Project* project)
{
    jassert (project == currentProject && project != nullptr);

    if (project == nullptr)
        return true;

    project->getStoredProperties().setValue (getProjectWindowPosName(), getWindowStateAsString());

    if (ProjectContentComponent* const pcc = getProjectContentComponent())
    {
        pcc->saveTreeViewState();
        pcc->saveOpenDocumentList();
        pcc->hideEditor();
    }

    if (! ProjucerApplication::getApp().openDocumentManager.closeAllDocumentsUsingProject (*project, true))
        return false;

    FileBasedDocument::SaveResult r = project->saveIfNeededAndUserAgrees();

    if (r == FileBasedDocument::savedOk)
    {
        setProject (nullptr);
        return true;
    }

    return false;
}
Esempio n. 2
0
void CtrlrStandaloneWindow::moved()
{
	DocumentWindow::moved();

	if (appProperties != nullptr)
	{
		appProperties->getUserSettings()->setValue (CTRLR_PROPERTIES_WINDOW_STATE, getWindowStateAsString());
	}
}
Esempio n. 3
0
MainWindow::~MainWindow()
{
   #if ! JUCE_MAC
    setMenuBar (nullptr);
   #endif

    removeKeyListener (ProjucerApplication::getCommandManager().getKeyMappings());

    // save the current size and position to our settings file..
    getGlobalProperties().setValue ("lastMainWindowPos", getWindowStateAsString());

    clearContentComponent();
    currentProject = nullptr;
}
Esempio n. 4
0
//------------------------------------------------------------------------------
StupidWindow::~StupidWindow()
{
	saveKeyMappings();
	PropertiesSingleton::getInstance().getUserSettings()->setValue("WindowState",
																	getWindowStateAsString());

	setMenuBar(0);
	setContentOwned(0, true);
	LookAndFeel::setDefaultLookAndFeel(0);
	
	AudioPluginFormatManagerSingleton::killInstance();
	AudioFormatManagerSingleton::killInstance();
	AudioThumbnailCacheSingleton::killInstance();
	PropertiesSingleton::killInstance();
}
Esempio n. 5
0
//=================================================================================================
MainWindow::~MainWindow()
{
#if JUCE_MAC  
    setMacMainMenu (nullptr);
#else
    setMenuBar(nullptr);
#endif

    removeKeyListener (commandManager->getKeyMappings());
    appDoc->removeChangeListener(this);

    // 保存窗口状态
    setSize(getWidth(), getHeight());   // 不加此句,每次保存的窗口高度均莫名其妙的增加22,断定是JUCE的BUG
    appProperties->getUserSettings()->setValue("mainWindowState", getWindowStateAsString());
}
Esempio n. 6
0
MainHostWindow::~MainHostWindow()
{
    pluginListWindow = nullptr;

   #if JUCE_MAC
    setMacMainMenu (nullptr);
   #else
    setMenuBar (nullptr);
   #endif

    knownPluginList.removeChangeListener (this);

    appProperties->getUserSettings()->setValue ("mainWindowPos", getWindowStateAsString());
    clearContentComponent();
}
Esempio n. 7
0
MainWindow::~MainWindow()
{
   #if ! JUCE_MAC
    setMenuBar (nullptr);
   #endif

    removeKeyListener (commandManager->getKeyMappings());

    // save the current size and position to our settings file..
    StoredSettings::getInstance()->getProps()
        .setValue ("lastMainWindowPos", getWindowStateAsString());

    clearContentComponent();
    currentProject = nullptr;
}
Esempio n. 8
0
MainWindow::~MainWindow()
{
   #if JUCE_MAC
    setMacMainMenu (0);
   #else
    setMenuBar (0);
   #endif

    removeKeyListener (commandManager->getKeyMappings());

    // save the current size and position to our settings file..
    StoredSettings::getInstance()->getProps()
        .setValue ("lastMainWindowPos", getWindowStateAsString());

    clearContentComponent();

    deleteAndZero (oldLook);
}
Esempio n. 9
0
void CtrlrStandaloneWindow::saveStateNow()
{
    _DBG("CtrlrStandaloneWindow::saveStateNow");

    if (ctrlrProcessor != nullptr && appProperties != nullptr)
    {
		appProperties->getUserSettings()->setValue (CTRLR_PROPERTIES_WINDOW_STATE, getWindowStateAsString());

		MemoryBlock data;
		ctrlrProcessor->getStateInformation(data);

		if (data.getSize() > 0)
		{
			ScopedPointer <XmlElement> xml(CtrlrProcessor::getXmlFromBinary(data.getData(), data.getSize()));

			if (xml)
			{
				appProperties->getUserSettings()->setValue (CTRLR_PROPERTIES_FILTER_STATE, xml);
			}
		}
	}
}
Esempio n. 10
0
bool MainWindow::closeProject (Project* project)
{
    jassert (project == currentProject && project != nullptr);

    if (project == nullptr)
        return true;

    StoredSettings::getInstance()->getProps()
        .setValue (getProjectWindowPosName(), getWindowStateAsString());

    if (! OpenDocumentManager::getInstance()->closeAllDocumentsUsingProject (*project, true))
        return false;

    FileBasedDocument::SaveResult r = project->saveIfNeededAndUserAgrees();

    if (r == FileBasedDocument::savedOk)
    {
        setProject (nullptr);
        return true;
    }

    return false;
}
Esempio n. 11
0
PrefsPanel::~PrefsPanel()
{
    prefsWindowPos = getWindowStateAsString();
}
Esempio n. 12
0
    ~PluginListWindow()
    {
        getAppProperties().getUserSettings()->setValue ("listWindowPos", getWindowStateAsString());

        clearContentComponent();
    }
Esempio n. 13
0
    ~PluginListWindow()
    {
        ApplicationProperties::getInstance()->getUserSettings()->setValue ("listWindowPos", getWindowStateAsString());

        setContentComponent (0);

        jassert (currentPluginListWindow == this);
        currentPluginListWindow = 0;
    }
Esempio n. 14
0
MainHostWindow::~MainHostWindow()
{
    delete PluginListWindow::currentPluginListWindow;

#if JUCE_MAC
    setMacMainMenu (0);
#else
    setMenuBar (0);
#endif

    knownPluginList.removeChangeListener (this);

    ApplicationProperties::getInstance()->getUserSettings()->setValue ("mainWindowPos", getWindowStateAsString());
    setContentComponent (0);
}