Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite the setup dialog #3820

Merged
merged 57 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
a09e8af
Setup dialog improvements.
Sep 2, 2017
e7de7e3
General improvements & correction of mistakes that prevented building.
Sep 5, 2017
3d22930
Fixed some typos.
Sep 10, 2017
4ca1534
Fixes.
Sep 14, 2017
d6c9fa4
Fixes and improvements.
Sep 21, 2017
26b5566
Fix.
Sep 21, 2017
481ca01
Fix.
Sep 22, 2017
61d2715
Fix build errors and warnings
PhysSong Sep 23, 2017
c6eafcb
UI improvements.
Sep 23, 2017
2479748
Code style improvements.
Sep 23, 2017
af37f6e
Fixes.
Oct 3, 2017
edac2ed
Fix.
Oct 4, 2017
1e502ac
Fix typos.
Oct 21, 2017
ab759dd
Geometry improvements.
Oct 25, 2017
8abe566
SF to SoundFont.
Nov 2, 2017
849650f
Revert "SF to SoundFont."
Nov 2, 2017
ded1765
Better restart warning. (WIP #1)
Dec 1, 2017
b95768c
Better restart warning. (WIP 2)
Dec 2, 2017
ed669db
Merge branch 'master' into SDI
Dec 21, 2017
1c9ff9a
Better look for plugins embedding settings.
Dec 21, 2017
0f52be7
Fix paths settings. (WIP 1)
Dec 22, 2017
cfb2ede
Merge branch 'master' into SDI
Mar 9, 2018
0c64f5f
Cosmetic fixes
Apr 23, 2018
09fcf1e
Fix paths settings
Apr 23, 2018
ecafce6
Buffer size is a setting that requires restarting...
Apr 24, 2018
389b60e
Fix `changeLang` connection
Apr 24, 2018
ca7dbbb
Fix crash introduced by 389b60e
May 1, 2018
2c14e1a
Take advantage of setSpacing()
May 6, 2018
8689e51
Remove useless context help button
May 6, 2018
8f14382
Fix some comments
May 6, 2018
0d641c0
Some fixes
May 16, 2018
87fec93
Remove STK related code from ConfigManager...
May 17, 2018
9687783
Merge branch 'master' into SDI
PhysSong May 18, 2018
3fc8e86
Merge branch 'master' into SDI
Sawuare Jun 5, 2018
d4f8338
Fixup merge
PhysSong Jun 6, 2018
8bec799
Merge branch 'master' into SDI
PhysSong Dec 26, 2018
196e412
Revert "Remove STK related code from ConfigManager..."
Sawuare Dec 27, 2018
5838bf7
Fix revert
Sawuare Dec 27, 2018
6a1862a
Merge branch 'master' into SDI
Sawuare Jun 12, 2019
045c7af
Fix
Sawuare Jun 12, 2019
548cbad
Fix
Sawuare Jun 12, 2019
d22c33a
Fixes
Sawuare Jun 12, 2019
abda9e3
Use a single counter for positioning LedCeckBoxes
Sawuare Jun 13, 2019
c45451f
Fix position of some LedCheckBoxes
Sawuare Jun 13, 2019
0bbd589
Sort includes alphabetically
Sawuare Jun 13, 2019
3c05c73
Misc. style fixes
Sawuare Jun 13, 2019
1dfba29
Shorten restart warning to fit
Sawuare Jun 13, 2019
e9f96cd
Some settings should not show restart warning
Sawuare Jun 13, 2019
832832b
Fix previous commit
Sawuare Jun 13, 2019
25b0a2b
Revise arrangement and wording
Sawuare Jun 14, 2019
629b1e4
Fix regression
Sawuare Jun 14, 2019
23da154
Simpler way to set WindowContextHelpButtonHint off
Sawuare Jun 15, 2019
8c5a88c
Revert previous commit for compatibility
Sawuare Jun 15, 2019
201d336
Fix latest merge
Sawuare Jun 30, 2019
5f31fa5
Fix
Sawuare Jun 30, 2019
51fff61
Nitpick
Sawuare Sep 5, 2019
5fb7c30
Typo
Sawuare Sep 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 97 additions & 94 deletions include/ConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include "lmms_export.h"


class LmmsCore;


Expand All @@ -57,23 +58,45 @@ class LMMS_EXPORT ConfigManager : public QObject
public:
static inline ConfigManager * inst()
{
if( s_instanceOfMe == NULL )
if(s_instanceOfMe == NULL )
{
s_instanceOfMe = new ConfigManager();
}
return s_instanceOfMe;
}


const QString & workingDir() const
{
return m_workingDir;
}

const QString & dataDir() const
{
return m_dataDir;
}

const QString & workingDir() const
QString factoryProjectsDir() const
{
return m_workingDir;
return dataDir() + PROJECTS_PATH;
}

QString factoryTemplatesDir() const
{
return factoryProjectsDir() + TEMPLATE_PATH;
}

QString factoryPresetsDir() const
{
return dataDir() + PRESETS_PATH;
}

QString factorySamplesDir() const
{
return dataDir() + SAMPLES_PATH;
}


QString userProjectsDir() const
{
return workingDir() + PROJECTS_PATH;
Expand All @@ -94,155 +117,137 @@ class LMMS_EXPORT ConfigManager : public QObject
return workingDir() + SAMPLES_PATH;
}

QString userGigDir() const
{
return workingDir() + GIG_PATH;
}

QString userSf2Dir() const
{
return workingDir() + SF2_PATH;
}

QString userLadspaDir() const
const QString & vstDir() const
{
return workingDir() + LADSPA_PATH;
return m_vstDir;
}

QString userVstDir() const
const QString & ladspaDir() const
{
return m_vstDir;
return m_ladspaDir;
}

QString factoryProjectsDir() const
const QString & sf2Dir() const
{
return dataDir() + PROJECTS_PATH;
return m_sf2Dir;
}

QString factoryTemplatesDir() const
#ifdef LMMS_HAVE_FLUIDSYNTH
const QString & sf2File() const
{
return factoryProjectsDir() + TEMPLATE_PATH;
return m_sf2File;
}
#endif

QString factoryPresetsDir() const
#ifdef LMMS_HAVE_STK
const QString & stkDir() const
{
return dataDir() + PRESETS_PATH;
return m_stkDir;
}
#endif

QString factorySamplesDir() const
const QString & gigDir() const
{
return dataDir() + SAMPLES_PATH;
return m_gigDir;
}

QString defaultVersion() const;

QString defaultArtworkDir() const
QString userVstDir() const
{
return m_dataDir + DEFAULT_THEME_PATH;
return m_vstDir;
}

QString artworkDir() const
QString userLadspaDir() const
{
return m_artworkDir;
return workingDir() + LADSPA_PATH;
}

QString trackIconsDir() const
QString userSf2Dir() const
{
return m_dataDir + TRACK_ICON_PATH;
return workingDir() + SF2_PATH;
}

QString localeDir() const
QString userGigDir() const
{
return m_dataDir + LOCALE_PATH;
return workingDir() + GIG_PATH;
}

const QString & gigDir() const
QString defaultThemeDir() const
{
return m_gigDir;
return m_dataDir + DEFAULT_THEME_PATH;
}

const QString & sf2Dir() const
QString themeDir() const
{
return m_sf2Dir;
return m_themeDir;
}

const QString & vstDir() const
const QString & backgroundPicFile() const
{
return m_vstDir;
return m_backgroundPicFile;
}

const QString & ladspaDir() const
QString trackIconsDir() const
{
return m_ladDir;
return m_dataDir + TRACK_ICON_PATH;
}

const QString recoveryFile() const
{
return m_workingDir + "recover.mmp";
}

const QString & version() const
{
return m_version;
}

#ifdef LMMS_HAVE_STK
const QString & stkDir() const
inline const QStringList & recentlyOpenedProjects() const
{
return m_stkDir;
return m_recentlyOpenedProjects;
}
#endif

#ifdef LMMS_HAVE_FLUIDSYNTH
const QString & defaultSoundfont() const
QString localeDir() const
{
return m_defaultSoundfont;
return m_dataDir + LOCALE_PATH;
}
#endif

const QString & backgroundArtwork() const
const QString & version() const
{
return m_backgroundArtwork;
return m_version;
}

inline const QStringList & recentlyOpenedProjects() const
{
return m_recentlyOpenedProjects;
}
QString defaultVersion() const;


static QStringList availabeVstEmbedMethods();
QString vstEmbedMethod() const;

// returns true if the working dir (e.g. ~/lmms) exists on disk
// Returns true if the working dir (e.g. ~/lmms) exists on disk.
bool hasWorkingDir() const;

void addRecentlyOpenedProject( const QString & _file );
void addRecentlyOpenedProject(const QString & _file);

const QString & value( const QString & cls,
const QString & attribute ) const;
const QString & value( const QString & cls,
const QString & value(const QString & cls,
const QString & attribute) const;
const QString & value(const QString & cls,
const QString & attribute,
const QString & defaultVal ) const;
void setValue( const QString & cls, const QString & attribute,
const QString & value );
void deleteValue( const QString & cls, const QString & attribute);
const QString & defaultVal) const;
void setValue(const QString & cls, const QString & attribute,
const QString & value);
void deleteValue(const QString & cls, const QString & attribute);

void loadConfigFile( const QString & configFile = "" );
void loadConfigFile(const QString & configFile = "");
void saveConfigFile();


void setWorkingDir( const QString & _wd );
void setVSTDir( const QString & _vd );
void setArtworkDir( const QString & _ad );
void setLADSPADir( const QString & _fd );
void setVersion( const QString & _cv );
void setSTKDir( const QString & _fd );
void setDefaultSoundfont( const QString & _sf );
void setBackgroundArtwork( const QString & _ba );
void setGIGDir( const QString & gd );
void setSF2Dir( const QString & sfd );
void setWorkingDir(const QString & workingDir);
void setVSTDir(const QString & vstDir);
void setLADSPADir(const QString & ladspaDir);
void setSF2Dir(const QString & sf2Dir);
void setSF2File(const QString & sf2File);
void setSTKDir(const QString & stkDir);
void setGIGDir(const QString & gigDir);
void setThemeDir(const QString & themeDir);
void setBackgroundPicFile(const QString & backgroundPicFile);

// creates the working directory & subdirectories on disk.
// Creates the working directory & subdirectories on disk.
void createWorkingDir();

signals:
Expand All @@ -252,29 +257,29 @@ class LMMS_EXPORT ConfigManager : public QObject
static ConfigManager * s_instanceOfMe;

ConfigManager();
ConfigManager( const ConfigManager & _c );
ConfigManager(const ConfigManager & _c);
~ConfigManager();

void upgrade_1_1_90();
void upgrade_1_1_91();
void upgrade();

QString m_lmmsRcFile;
QString m_workingDir;
QString m_dataDir;
QString m_artworkDir;
QString m_vstDir;
QString m_ladDir;
QString m_gigDir;
QString m_ladspaDir;
QString m_sf2Dir;
QString m_version;
#ifdef LMMS_HAVE_FLUIDSYNTH
QString m_sf2File;
#endif
#ifdef LMMS_HAVE_STK
QString m_stkDir;
#endif
#ifdef LMMS_HAVE_FLUIDSYNTH
QString m_defaultSoundfont;
#endif
QString m_backgroundArtwork;
QString m_gigDir;
QString m_themeDir;
QString m_backgroundPicFile;
QString m_lmmsRcFile;
QString m_version;
QStringList m_recentlyOpenedProjects;

PhysSong marked this conversation as resolved.
Show resolved Hide resolved
typedef QVector<QPair<QString, QString> > stringPairVector;
Expand All @@ -283,7 +288,5 @@ class LMMS_EXPORT ConfigManager : public QObject


friend class LmmsCore;

} ;

};
#endif
Loading