Mercurial > hg > svapp
changeset 222:ed5804224121 templating
Store default template name in MainWindowBase
author | Chris Cannam |
---|---|
date | Mon, 09 May 2011 11:56:24 +0100 |
parents | e06a0124c662 |
children | e8ae978e1a3d |
files | framework/MainWindowBase.cpp framework/MainWindowBase.h |
diffstat | 2 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp Wed Apr 27 14:46:06 2011 +0100 +++ b/framework/MainWindowBase.cpp Mon May 09 11:56:24 2011 +0100 @@ -327,6 +327,18 @@ } void +MainWindowBase::setDefaultSessionTemplate(QString name) +{ + m_defaultSessionTemplate = name; +} + +QString +MainWindowBase::getDefaultSessionTemplate() const +{ + return m_defaultSessionTemplate; +} + +void MainWindowBase::updateMenuStates() { Pane *currentPane = 0; @@ -1075,7 +1087,9 @@ { // std::cerr << "MainWindowBase::openAudio(" << source.getLocation().toStdString() << ")" << std::endl; - if (templateName == "") templateName = "testtemplate"; + if (templateName == "") { + templateName = m_defaultSessionTemplate; + } if (!source.isAvailable()) return FileOpenFailed; source.waitForData();
--- a/framework/MainWindowBase.h Wed Apr 27 14:46:06 2011 +0100 +++ b/framework/MainWindowBase.h Mon May 09 11:56:24 2011 +0100 @@ -281,6 +281,7 @@ QString m_sessionFile; QString m_audioFile; Document *m_document; + QString m_defaultSessionTemplate; QLabel *m_descriptionLabel; PaneStack *m_paneStack; @@ -395,6 +396,9 @@ virtual QString getSaveFileName(FileFinder::FileType type); virtual void registerLastOpenedFilePath(FileFinder::FileType type, QString path); + virtual void setDefaultSessionTemplate(QString name); + virtual QString getDefaultSessionTemplate() const; + virtual void createPlayTarget(); virtual void openHelpUrl(QString url);