@@ -209,7 +209,7 @@ struct AppearanceEditor | |||||
void closeButtonPressed() | void closeButtonPressed() | ||||
{ | { | ||||
JucerApplication::getApp()->appearanceEditorWindow = nullptr; | |||||
JucerApplication::getApp().appearanceEditorWindow = nullptr; | |||||
} | } | ||||
private: | private: | ||||
@@ -132,9 +132,11 @@ public: | |||||
openFile (commandLine.unquoted()); | openFile (commandLine.unquoted()); | ||||
} | } | ||||
static JucerApplication* getApp() | |||||
static JucerApplication& getApp() | |||||
{ | { | ||||
return dynamic_cast<JucerApplication*> (JUCEApplication::getInstance()); | |||||
JucerApplication* const app = dynamic_cast<JucerApplication*> (JUCEApplication::getInstance()); | |||||
jassert (app != nullptr); | |||||
return *app; | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
@@ -148,126 +150,131 @@ public: | |||||
StringArray getMenuBarNames() | StringArray getMenuBarNames() | ||||
{ | { | ||||
const char* const names[] = { "File", "Edit", "View", "Window", "Tools", 0 }; | |||||
return StringArray ((const char**) names); | |||||
return getApp().getMenuNames(); | |||||
} | } | ||||
PopupMenu getMenuForIndex (int topLevelMenuIndex, const String& /*menuName*/) | |||||
PopupMenu getMenuForIndex (int /*topLevelMenuIndex*/, const String& menuName) | |||||
{ | { | ||||
PopupMenu menu; | PopupMenu menu; | ||||
getApp().createMenu (menu, menuName); | |||||
return menu; | |||||
} | |||||
if (topLevelMenuIndex == 0) // "File" menu | |||||
void menuItemSelected (int menuItemID, int /*topLevelMenuIndex*/) | |||||
{ | |||||
if (menuItemID >= 100 && menuItemID < 200) | |||||
{ | { | ||||
menu.addCommandItem (commandManager, CommandIDs::newProject); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::open); | |||||
PopupMenu recentFiles; | |||||
getAppSettings().recentFiles.createPopupMenuItems (recentFiles, 100, true, true); | |||||
menu.addSubMenu ("Open recent file", recentFiles); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::closeDocument); | |||||
menu.addCommandItem (commandManager, CommandIDs::saveDocument); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::closeProject); | |||||
menu.addCommandItem (commandManager, CommandIDs::saveProject); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::openInIDE); | |||||
menu.addCommandItem (commandManager, CommandIDs::saveAndOpenInIDE); | |||||
#if ! JUCE_MAC | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::quit); | |||||
#endif | |||||
// open a file from the "recent files" menu | |||||
getApp().openFile (getAppSettings().recentFiles.getFile (menuItemID - 100)); | |||||
} | } | ||||
else if (topLevelMenuIndex == 1) // "Edit" menu | |||||
else if (menuItemID >= 300 && menuItemID < 400) | |||||
{ | { | ||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::undo); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::redo); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::cut); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::copy); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::paste); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::del); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::selectAll); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::deselectAll); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::toFront); | |||||
menu.addCommandItem (commandManager, CommandIDs::toBack); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::group); | |||||
menu.addCommandItem (commandManager, CommandIDs::ungroup); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::bringBackLostItems); | |||||
OpenDocumentManager::Document* doc = getApp().openDocumentManager.getOpenDocument (menuItemID - 300); | |||||
jassert (doc != nullptr); | |||||
getApp().mainWindowList.openDocument (doc); | |||||
} | } | ||||
else if (topLevelMenuIndex == 2) // "View" menu | |||||
{ | |||||
menu.addCommandItem (commandManager, CommandIDs::showProjectSettings); | |||||
menu.addSeparator(); | |||||
} | |||||
}; | |||||
menu.addCommandItem (commandManager, CommandIDs::showAppearanceSettings); | |||||
menu.addSeparator(); | |||||
virtual StringArray getMenuNames() | |||||
{ | |||||
const char* const names[] = { "File", "Edit", "View", "Window", "Tools", nullptr }; | |||||
return StringArray (names); | |||||
} | |||||
menu.addCommandItem (commandManager, CommandIDs::showGrid); | |||||
menu.addCommandItem (commandManager, CommandIDs::enableSnapToGrid); | |||||
virtual void createMenu (PopupMenu& menu, const String& menuName) | |||||
{ | |||||
if (menuName == "File") createFileMenu (menu); | |||||
else if (menuName == "Edit") createEditMenu (menu); | |||||
else if (menuName == "View") createViewMenu (menu); | |||||
else if (menuName == "Window") createWindowMenu (menu); | |||||
else if (menuName == "Tools") createToolsMenu (menu); | |||||
else jassertfalse; // names have changed? | |||||
} | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::zoomIn); | |||||
menu.addCommandItem (commandManager, CommandIDs::zoomOut); | |||||
menu.addCommandItem (commandManager, CommandIDs::zoomNormal); | |||||
virtual void createFileMenu (PopupMenu& menu) | |||||
{ | |||||
menu.addCommandItem (commandManager, CommandIDs::newProject); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::open); | |||||
PopupMenu recentFiles; | |||||
getAppSettings().recentFiles.createPopupMenuItems (recentFiles, 100, true, true); | |||||
menu.addSubMenu ("Open recent file", recentFiles); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::closeDocument); | |||||
menu.addCommandItem (commandManager, CommandIDs::saveDocument); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::closeProject); | |||||
menu.addCommandItem (commandManager, CommandIDs::saveProject); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::openInIDE); | |||||
menu.addCommandItem (commandManager, CommandIDs::saveAndOpenInIDE); | |||||
#if ! JUCE_MAC | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::quit); | |||||
#endif | |||||
} | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::useTabbedWindows); | |||||
} | |||||
else if (topLevelMenuIndex == 3) // "Window" menu | |||||
{ | |||||
menu.addCommandItem (commandManager, CommandIDs::closeWindow); | |||||
menu.addSeparator(); | |||||
virtual void createEditMenu (PopupMenu& menu) | |||||
{ | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::undo); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::redo); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::cut); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::copy); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::paste); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::del); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::selectAll); | |||||
menu.addCommandItem (commandManager, StandardApplicationCommandIDs::deselectAll); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::toFront); | |||||
menu.addCommandItem (commandManager, CommandIDs::toBack); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::group); | |||||
menu.addCommandItem (commandManager, CommandIDs::ungroup); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::bringBackLostItems); | |||||
} | |||||
menu.addCommandItem (commandManager, CommandIDs::goToPreviousDoc); | |||||
menu.addCommandItem (commandManager, CommandIDs::goToNextDoc); | |||||
menu.addSeparator(); | |||||
virtual void createViewMenu (PopupMenu& menu) | |||||
{ | |||||
menu.addCommandItem (commandManager, CommandIDs::showFilePanel); | |||||
menu.addCommandItem (commandManager, CommandIDs::showConfigPanel); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::showAppearanceSettings); | |||||
} | |||||
const int numDocs = jmin (50, getApp()->openDocumentManager.getNumOpenDocuments()); | |||||
virtual void createWindowMenu (PopupMenu& menu) | |||||
{ | |||||
menu.addCommandItem (commandManager, CommandIDs::closeWindow); | |||||
menu.addSeparator(); | |||||
for (int i = 0; i < numDocs; ++i) | |||||
{ | |||||
OpenDocumentManager::Document* doc = getApp()->openDocumentManager.getOpenDocument(i); | |||||
menu.addCommandItem (commandManager, CommandIDs::goToPreviousDoc); | |||||
menu.addCommandItem (commandManager, CommandIDs::goToNextDoc); | |||||
menu.addSeparator(); | |||||
menu.addItem (300 + i, doc->getName()); | |||||
} | |||||
const int numDocs = jmin (50, getApp().openDocumentManager.getNumOpenDocuments()); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::closeAllDocuments); | |||||
} | |||||
else if (topLevelMenuIndex == 4) // "Tools" menu | |||||
{ | |||||
menu.addCommandItem (commandManager, CommandIDs::updateModules); | |||||
menu.addCommandItem (commandManager, CommandIDs::showUTF8Tool); | |||||
} | |||||
for (int i = 0; i < numDocs; ++i) | |||||
{ | |||||
OpenDocumentManager::Document* doc = getApp().openDocumentManager.getOpenDocument(i); | |||||
return menu; | |||||
menu.addItem (300 + i, doc->getName()); | |||||
} | } | ||||
void menuItemSelected (int menuItemID, int /*topLevelMenuIndex*/) | |||||
{ | |||||
if (menuItemID >= 100 && menuItemID < 200) | |||||
{ | |||||
// open a file from the "recent files" menu | |||||
const File file (getAppSettings().recentFiles.getFile (menuItemID - 100)); | |||||
getApp()->openFile (file); | |||||
} | |||||
else if (menuItemID >= 300 && menuItemID < 400) | |||||
{ | |||||
OpenDocumentManager::Document* doc = getApp()->openDocumentManager.getOpenDocument (menuItemID - 300); | |||||
jassert (doc != nullptr); | |||||
menu.addSeparator(); | |||||
menu.addCommandItem (commandManager, CommandIDs::closeAllDocuments); | |||||
} | |||||
getApp()->mainWindowList.openDocument (doc); | |||||
} | |||||
} | |||||
}; | |||||
virtual void createToolsMenu (PopupMenu& menu) | |||||
{ | |||||
menu.addCommandItem (commandManager, CommandIDs::updateModules); | |||||
menu.addCommandItem (commandManager, CommandIDs::showUTF8Tool); | |||||
} | |||||
//============================================================================== | //============================================================================== | ||||
void getAllCommands (Array <CommandID>& commands) | void getAllCommands (Array <CommandID>& commands) | ||||
@@ -345,9 +352,7 @@ public: | |||||
case CommandIDs::showUTF8Tool: showUTF8ToolWindow(); break; | case CommandIDs::showUTF8Tool: showUTF8ToolWindow(); break; | ||||
case CommandIDs::showAppearanceSettings: showAppearanceEditorWindow(); break; | case CommandIDs::showAppearanceSettings: showAppearanceEditorWindow(); break; | ||||
case CommandIDs::updateModules: runModuleUpdate (String::empty); break; | case CommandIDs::updateModules: runModuleUpdate (String::empty); break; | ||||
default: | |||||
return JUCEApplication::perform (info); | |||||
default: return JUCEApplication::perform (info); | |||||
} | } | ||||
return true; | return true; | ||||
@@ -455,8 +460,9 @@ private: | |||||
stopTimer(); | stopTimer(); | ||||
delete this; | delete this; | ||||
if (getApp() != nullptr) | |||||
getApp()->systemRequestedQuit(); | |||||
JUCEApplication* app = JUCEApplication::getInstance(); | |||||
if (app != nullptr) | |||||
app->systemRequestedQuit(); | |||||
} | } | ||||
JUCE_DECLARE_NON_COPYABLE (AsyncQuitRetrier); | JUCE_DECLARE_NON_COPYABLE (AsyncQuitRetrier); | ||||
@@ -37,10 +37,11 @@ namespace CommandIDs | |||||
static const int saveProject = 0x200060; | static const int saveProject = 0x200060; | ||||
static const int openInIDE = 0x200072; | static const int openInIDE = 0x200072; | ||||
static const int saveAndOpenInIDE = 0x200073; | static const int saveAndOpenInIDE = 0x200073; | ||||
static const int showProjectSettings = 0x200074; | |||||
static const int updateModules = 0x200075; | static const int updateModules = 0x200075; | ||||
static const int showUTF8Tool = 0x200076; | static const int showUTF8Tool = 0x200076; | ||||
static const int showAppearanceSettings = 0x200077; | static const int showAppearanceSettings = 0x200077; | ||||
static const int showConfigPanel = 0x200074; | |||||
static const int showFilePanel = 0x200078; | |||||
static const int saveAll = 0x200080; | static const int saveAll = 0x200080; | ||||
@@ -32,12 +32,12 @@ | |||||
DocumentEditorComponent::DocumentEditorComponent (OpenDocumentManager::Document* document_) | DocumentEditorComponent::DocumentEditorComponent (OpenDocumentManager::Document* document_) | ||||
: document (document_) | : document (document_) | ||||
{ | { | ||||
JucerApplication::getApp()->openDocumentManager.addListener (this); | |||||
JucerApplication::getApp().openDocumentManager.addListener (this); | |||||
} | } | ||||
DocumentEditorComponent::~DocumentEditorComponent() | DocumentEditorComponent::~DocumentEditorComponent() | ||||
{ | { | ||||
JucerApplication::getApp()->openDocumentManager.removeListener (this); | |||||
JucerApplication::getApp().openDocumentManager.removeListener (this); | |||||
} | } | ||||
void DocumentEditorComponent::documentAboutToClose (OpenDocumentManager::Document* closingDoc) | void DocumentEditorComponent::documentAboutToClose (OpenDocumentManager::Document* closingDoc) | ||||
@@ -35,7 +35,7 @@ ScopedPointer<ApplicationCommandManager> commandManager; | |||||
//============================================================================== | //============================================================================== | ||||
MainWindow::MainWindow() | MainWindow::MainWindow() | ||||
: DocumentWindow (JucerApplication::getApp()->getApplicationName(), | |||||
: DocumentWindow (JucerApplication::getApp().getApplicationName(), | |||||
Colour::greyLevel (0.6f), | Colour::greyLevel (0.6f), | ||||
DocumentWindow::allButtons, | DocumentWindow::allButtons, | ||||
false) | false) | ||||
@@ -44,7 +44,7 @@ MainWindow::MainWindow() | |||||
createProjectContentCompIfNeeded(); | createProjectContentCompIfNeeded(); | ||||
#if ! JUCE_MAC | #if ! JUCE_MAC | ||||
setMenuBar (JucerApplication::getApp()->menuModel); | |||||
setMenuBar (JucerApplication::getApp().menuModel); | |||||
#endif | #endif | ||||
setResizable (true, false); | setResizable (true, false); | ||||
@@ -93,7 +93,7 @@ void MainWindow::createProjectContentCompIfNeeded() | |||||
if (getProjectContentComponent() == nullptr) | if (getProjectContentComponent() == nullptr) | ||||
{ | { | ||||
clearContentComponent(); | clearContentComponent(); | ||||
setContentOwned (JucerApplication::getApp()->createProjectContentComponent(), false); | |||||
setContentOwned (JucerApplication::getApp().createProjectContentComponent(), false); | |||||
jassert (getProjectContentComponent() != nullptr); | jassert (getProjectContentComponent() != nullptr); | ||||
} | } | ||||
} | } | ||||
@@ -115,7 +115,7 @@ ProjectContentComponent* MainWindow::getProjectContentComponent() const | |||||
void MainWindow::closeButtonPressed() | void MainWindow::closeButtonPressed() | ||||
{ | { | ||||
JucerApplication::getApp()->mainWindowList.closeWindow (this); | |||||
JucerApplication::getApp().mainWindowList.closeWindow (this); | |||||
} | } | ||||
bool MainWindow::closeProject (Project* project) | bool MainWindow::closeProject (Project* project) | ||||
@@ -136,7 +136,7 @@ bool MainWindow::closeProject (Project* project) | |||||
pcc->hideEditor(); | pcc->hideEditor(); | ||||
} | } | ||||
if (! JucerApplication::getApp()->openDocumentManager.closeAllDocumentsUsingProject (*project, true)) | |||||
if (! JucerApplication::getApp().openDocumentManager.closeAllDocumentsUsingProject (*project, true)) | |||||
return false; | return false; | ||||
FileBasedDocument::SaveResult r = project->saveIfNeededAndUserAgrees(); | FileBasedDocument::SaveResult r = project->saveIfNeededAndUserAgrees(); | ||||
@@ -179,7 +179,7 @@ void MainWindow::restoreWindowPosition() | |||||
bool MainWindow::canOpenFile (const File& file) const | bool MainWindow::canOpenFile (const File& file) const | ||||
{ | { | ||||
return file.hasFileExtension (Project::projectFileExtension) | return file.hasFileExtension (Project::projectFileExtension) | ||||
|| JucerApplication::getApp()->openDocumentManager.canOpenFile (file); | |||||
|| JucerApplication::getApp().openDocumentManager.canOpenFile (file); | |||||
} | } | ||||
bool MainWindow::openFile (const File& file) | bool MainWindow::openFile (const File& file) | ||||
@@ -232,12 +232,12 @@ void MainWindow::activeWindowStatusChanged() | |||||
if (getProjectContentComponent() != nullptr) | if (getProjectContentComponent() != nullptr) | ||||
getProjectContentComponent()->updateMissingFileStatuses(); | getProjectContentComponent()->updateMissingFileStatuses(); | ||||
JucerApplication::getApp()->openDocumentManager.reloadModifiedFiles(); | |||||
JucerApplication::getApp().openDocumentManager.reloadModifiedFiles(); | |||||
} | } | ||||
void MainWindow::updateTitle (const String& documentName) | void MainWindow::updateTitle (const String& documentName) | ||||
{ | { | ||||
String name (JucerApplication::getApp()->getApplicationName()); | |||||
String name (JucerApplication::getApp().getApplicationName()); | |||||
if (currentProject != nullptr) | if (currentProject != nullptr) | ||||
name = currentProject->getDocumentTitle() + " - " + name; | name = currentProject->getDocumentTitle() + " - " + name; | ||||
@@ -304,12 +304,12 @@ void OpenDocumentManager::fileHasBeenRenamed (const File& oldFile, const File& n | |||||
//============================================================================== | //============================================================================== | ||||
RecentDocumentList::RecentDocumentList() | RecentDocumentList::RecentDocumentList() | ||||
{ | { | ||||
JucerApplication::getApp()->openDocumentManager.addListener (this); | |||||
JucerApplication::getApp().openDocumentManager.addListener (this); | |||||
} | } | ||||
RecentDocumentList::~RecentDocumentList() | RecentDocumentList::~RecentDocumentList() | ||||
{ | { | ||||
JucerApplication::getApp()->openDocumentManager.removeListener (this); | |||||
JucerApplication::getApp().openDocumentManager.removeListener (this); | |||||
} | } | ||||
void RecentDocumentList::clear() | void RecentDocumentList::clear() | ||||
@@ -378,7 +378,7 @@ static void restoreDocList (Project& project, Array <OpenDocumentManager::Docume | |||||
{ | { | ||||
if (xml != nullptr) | if (xml != nullptr) | ||||
{ | { | ||||
OpenDocumentManager& odm = JucerApplication::getApp()->openDocumentManager; | |||||
OpenDocumentManager& odm = JucerApplication::getApp().openDocumentManager; | |||||
forEachXmlChildElementWithTagName (*xml, e, "DOC") | forEachXmlChildElementWithTagName (*xml, e, "DOC") | ||||
{ | { | ||||
@@ -358,7 +358,7 @@ namespace ProjectSettingsTreeClasses | |||||
void addSubItems() | void addSubItems() | ||||
{ | { | ||||
addSubItem (new ModulesItem (project)); | addSubItem (new ModulesItem (project)); | ||||
JucerApplication::getApp()->addExtraConfigItems (project, *this); | |||||
JucerApplication::getApp().addExtraConfigItems (project, *this); | |||||
int i = 0; | int i = 0; | ||||
for (Project::ExporterIterator exporter (project); exporter.next(); ++i) | for (Project::ExporterIterator exporter (project); exporter.next(); ++i) | ||||
@@ -495,7 +495,7 @@ public: | |||||
MainWindow* mw = dynamic_cast<MainWindow*> (getTopLevelComponent()); | MainWindow* mw = dynamic_cast<MainWindow*> (getTopLevelComponent()); | ||||
jassert (mw != nullptr); | jassert (mw != nullptr); | ||||
JucerApplication::getApp()->mainWindowList.closeWindow (mw); | |||||
JucerApplication::getApp().mainWindowList.closeWindow (mw); | |||||
} | } | ||||
} | } | ||||
@@ -66,7 +66,7 @@ Project::Project (const File& file_) | |||||
Project::~Project() | Project::~Project() | ||||
{ | { | ||||
projectRoot.removeListener (this); | projectRoot.removeListener (this); | ||||
JucerApplication::getApp()->openDocumentManager.closeAllDocumentsUsingProject (*this, false); | |||||
JucerApplication::getApp().openDocumentManager.closeAllDocumentsUsingProject (*this, false); | |||||
} | } | ||||
//============================================================================== | //============================================================================== | ||||
@@ -537,7 +537,7 @@ bool Project::Item::renameFile (const File& newFile) | |||||
|| (newFile.exists() && ! oldFile.exists())) | || (newFile.exists() && ! oldFile.exists())) | ||||
{ | { | ||||
setFile (newFile); | setFile (newFile); | ||||
JucerApplication::getApp()->openDocumentManager.fileHasBeenRenamed (oldFile, newFile); | |||||
JucerApplication::getApp().openDocumentManager.fileHasBeenRenamed (oldFile, newFile); | |||||
return true; | return true; | ||||
} | } | ||||
@@ -259,7 +259,7 @@ void ProjectContentComponent::updateMissingFileStatuses() | |||||
bool ProjectContentComponent::showEditorForFile (const File& f) | bool ProjectContentComponent::showEditorForFile (const File& f) | ||||
{ | { | ||||
return getCurrentFile() == f | return getCurrentFile() == f | ||||
|| showDocument (JucerApplication::getApp()->openDocumentManager.openFile (project, f)); | |||||
|| showDocument (JucerApplication::getApp().openDocumentManager.openFile (project, f)); | |||||
} | } | ||||
File ProjectContentComponent::getCurrentFile() const | File ProjectContentComponent::getCurrentFile() const | ||||
@@ -375,7 +375,8 @@ void ProjectContentComponent::getAllCommands (Array <CommandID>& commands) | |||||
CommandIDs::closeProject, | CommandIDs::closeProject, | ||||
CommandIDs::openInIDE, | CommandIDs::openInIDE, | ||||
CommandIDs::saveAndOpenInIDE, | CommandIDs::saveAndOpenInIDE, | ||||
CommandIDs::showProjectSettings, | |||||
CommandIDs::showFilePanel, | |||||
CommandIDs::showConfigPanel, | |||||
CommandIDs::goToPreviousDoc, | CommandIDs::goToPreviousDoc, | ||||
CommandIDs::goToNextDoc, | CommandIDs::goToNextDoc, | ||||
StandardApplicationCommandIDs::del }; | StandardApplicationCommandIDs::del }; | ||||
@@ -472,16 +473,24 @@ void ProjectContentComponent::getCommandInfo (const CommandID commandID, Applica | |||||
result.defaultKeypresses.add (KeyPress ('l', ModifierKeys::commandModifier, 0)); | result.defaultKeypresses.add (KeyPress ('l', ModifierKeys::commandModifier, 0)); | ||||
break; | break; | ||||
case CommandIDs::showProjectSettings: | |||||
result.setInfo ("Show Project Build Settings", | |||||
case CommandIDs::showFilePanel: | |||||
result.setInfo ("Show File Panel", | |||||
"Shows the tree of files for this project", | |||||
CommandCategories::general, 0); | |||||
result.setActive (project != nullptr); | |||||
result.defaultKeypresses.add (KeyPress ('p', ModifierKeys::commandModifier, 0)); | |||||
break; | |||||
case CommandIDs::showConfigPanel: | |||||
result.setInfo ("Show Config Panel", | |||||
"Shows the build options for the project", | "Shows the build options for the project", | ||||
CommandCategories::general, 0); | CommandCategories::general, 0); | ||||
result.setActive (project != nullptr); | result.setActive (project != nullptr); | ||||
result.defaultKeypresses.add (KeyPress ('i', ModifierKeys::commandModifier | ModifierKeys::shiftModifier, 0)); | |||||
result.defaultKeypresses.add (KeyPress ('i', ModifierKeys::commandModifier, 0)); | |||||
break; | break; | ||||
case StandardApplicationCommandIDs::del: | case StandardApplicationCommandIDs::del: | ||||
result.setInfo ("Delete", String::empty, CommandCategories::general, 0); | |||||
result.setInfo ("Delete Selected File", String::empty, CommandCategories::general, 0); | |||||
result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0)); | result.defaultKeypresses.add (KeyPress (KeyPress::deleteKey, 0, 0)); | ||||
result.defaultKeypresses.add (KeyPress (KeyPress::backspaceKey, 0, 0)); | result.defaultKeypresses.add (KeyPress (KeyPress::backspaceKey, 0, 0)); | ||||
result.setActive (dynamic_cast<TreePanelBase*> (treeViewTabs.getCurrentContentComponent()) != nullptr); | result.setActive (dynamic_cast<TreePanelBase*> (treeViewTabs.getCurrentContentComponent()) != nullptr); | ||||
@@ -530,7 +539,7 @@ bool ProjectContentComponent::perform (const InvocationInfo& info) | |||||
case CommandIDs::closeDocument: | case CommandIDs::closeDocument: | ||||
if (currentDocument != nullptr) | if (currentDocument != nullptr) | ||||
JucerApplication::getApp()->openDocumentManager.closeDocument (currentDocument, true); | |||||
JucerApplication::getApp().openDocumentManager.closeDocument (currentDocument, true); | |||||
break; | break; | ||||
case CommandIDs::goToPreviousDoc: | case CommandIDs::goToPreviousDoc: | ||||
@@ -567,7 +576,11 @@ bool ProjectContentComponent::perform (const InvocationInfo& info) | |||||
} | } | ||||
break; | break; | ||||
case CommandIDs::showProjectSettings: | |||||
case CommandIDs::showFilePanel: | |||||
treeViewTabs.setCurrentTabIndex (0); | |||||
break; | |||||
case CommandIDs::showConfigPanel: | |||||
treeViewTabs.setCurrentTabIndex (1); | treeViewTabs.setCurrentTabIndex (1); | ||||
break; | break; | ||||
@@ -220,7 +220,7 @@ void ProjectTreeViewBase::deleteAllSelectedItems() | |||||
if (treeRootItem != nullptr) | if (treeRootItem != nullptr) | ||||
{ | { | ||||
OpenDocumentManager& om = JucerApplication::getApp()->openDocumentManager; | |||||
OpenDocumentManager& om = JucerApplication::getApp().openDocumentManager; | |||||
for (int i = filesToTrash.size(); --i >= 0;) | for (int i = filesToTrash.size(); --i >= 0;) | ||||
{ | { | ||||
@@ -191,7 +191,7 @@ public: | |||||
void resized() | void resized() | ||||
{ | { | ||||
item.textX = item.getIconSize() + 8; | |||||
item.textX = (int) item.getIconSize() + 8; | |||||
} | } | ||||
JucerTreeViewBase& item; | JucerTreeViewBase& item; | ||||
@@ -30,7 +30,7 @@ | |||||
//============================================================================== | //============================================================================== | ||||
StoredSettings& getAppSettings() | StoredSettings& getAppSettings() | ||||
{ | { | ||||
return JucerApplication::getApp()->settings; | |||||
return JucerApplication::getApp().settings; | |||||
} | } | ||||
PropertiesFile& getAppProperties() | PropertiesFile& getAppProperties() | ||||
@@ -211,7 +211,7 @@ File StoredSettings::getSchemesFolder() | |||||
//============================================================================== | //============================================================================== | ||||
const Icons& getIcons() | const Icons& getIcons() | ||||
{ | { | ||||
return JucerApplication::getApp()->icons; | |||||
return JucerApplication::getApp().icons; | |||||
} | } | ||||
Icons::Icons() | Icons::Icons() | ||||