window title changes, standard paths completed
This commit is contained in:
parent
96c6d5072d
commit
517f446d12
4 changed files with 78 additions and 1 deletions
|
@ -25,6 +25,25 @@
|
|||
|
||||
StandardPaths::StandardPaths()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString StandardPaths::applicationsLocation()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
return QStandardPaths::writableLocation(QStandardPaths::ApplicationsLocation);
|
||||
#else
|
||||
return QDesktopServices::storageLocation(QDesktopServices::ApplicationsLocation);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString StandardPaths::cacheLocation()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
return QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
|
||||
#else
|
||||
return QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString StandardPaths::dataLocation()
|
||||
|
@ -53,3 +72,48 @@ QString StandardPaths::documentsLocation()
|
|||
return QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString StandardPaths::moviesLocation()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
return QStandardPaths::writableLocation(QStandardPaths::MoviesLocation);
|
||||
#else
|
||||
return QDesktopServices::storageLocation(QDesktopServices::MoviesLocation);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString StandardPaths::fontsLocation()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
return QStandardPaths::writableLocation(QStandardPaths::FontsLocation);
|
||||
#else
|
||||
return QDesktopServices::storageLocation(QDesktopServices::FontsLocation);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString StandardPaths::homeLocation()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
return QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
|
||||
#else
|
||||
return QDesktopServices::storageLocation(QDesktopServices::HomeLocation);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString StandardPaths::musicLocation()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
return QStandardPaths::writableLocation(QStandardPaths::MusicLocation);
|
||||
#else
|
||||
return QDesktopServices::storageLocation(QDesktopServices::MusicLocation);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString StandardPaths::tempLocation()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
return QStandardPaths::writableLocation(QStandardPaths::TempLocation);
|
||||
#else
|
||||
return QDesktopServices::storageLocation(QDesktopServices::TempLocation);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -25,9 +25,16 @@ class StandardPaths
|
|||
{
|
||||
public:
|
||||
StandardPaths();
|
||||
static QString applicationsLocation();
|
||||
static QString cacheLocation();
|
||||
static QString dataLocation();
|
||||
static QString desktopLocation();
|
||||
static QString documentsLocation();
|
||||
static QString fontsLocation();
|
||||
static QString homeLocation();
|
||||
static QString moviesLocation();
|
||||
static QString musicLocation();
|
||||
static QString tempLocation();
|
||||
};
|
||||
|
||||
#endif // STANDARDPATHS_H
|
||||
|
|
|
@ -37,9 +37,12 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, D
|
|||
ui(new Ui::UserInterface)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowIcon(QIcon(":/img/5sync.png"));
|
||||
profileOpen = 0;
|
||||
profileUI = 0;
|
||||
defaultWindowTitle = this->windowTitle();
|
||||
|
||||
this->setWindowIcon(QIcon(":/img/5sync.png"));
|
||||
this->setWindowTitle(defaultWindowTitle.arg(tr("Select profile")));
|
||||
|
||||
// init settings
|
||||
QSettings SyncSettings("Syping", "gta5sync");
|
||||
|
@ -134,6 +137,7 @@ void UserInterface::openProfile(QString profileName)
|
|||
profileUI->setProfileFolder(GTAV_ProfilesFolder + "/" + profileName, profileName);
|
||||
profileUI->setupProfileInterface();
|
||||
QObject::connect(profileUI, SIGNAL(profileClosed()), this, SLOT(closeProfile()));
|
||||
this->setWindowTitle(defaultWindowTitle.arg(profileName));
|
||||
}
|
||||
|
||||
void UserInterface::closeProfile()
|
||||
|
@ -145,6 +149,7 @@ void UserInterface::closeProfile()
|
|||
profileUI->deleteLater();
|
||||
delete profileUI;
|
||||
}
|
||||
this->setWindowTitle(defaultWindowTitle.arg(tr("Select profile")));
|
||||
}
|
||||
|
||||
UserInterface::~UserInterface()
|
||||
|
|
|
@ -52,6 +52,7 @@ private:
|
|||
Ui::UserInterface *ui;
|
||||
ProfileInterface *profileUI;
|
||||
bool profileOpen;
|
||||
QString defaultWindowTitle;
|
||||
QString GTAV_Folder;
|
||||
QString GTAV_ProfilesFolder;
|
||||
void setupProfileUi(QStringList GTAV_Profiles);
|
||||
|
|
Loading…
Reference in a new issue