mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Preparing for adding an unstable GIT branch
This commit is contained in:
parent
ce7640f906
commit
3c2ae16976
@ -9,6 +9,33 @@
|
||||
|
||||
#include "profiles.h"
|
||||
|
||||
// Used by internal settings
|
||||
|
||||
|
||||
const QString getDeveloperName()
|
||||
{
|
||||
return STR_DeveloperName;
|
||||
}
|
||||
|
||||
const QString getAppName()
|
||||
{
|
||||
QString name=STR_AppName;
|
||||
#ifdef UNSTABLE_BUILD
|
||||
name+=STR_Unstable;
|
||||
#endif
|
||||
return name;
|
||||
}
|
||||
|
||||
const QString getDefaultAppRoot()
|
||||
{
|
||||
QString approot=STR_AppRoot;
|
||||
#ifdef UNSTABLE_BUILD
|
||||
approot+=STR_Unstable;
|
||||
#endif
|
||||
return approot;
|
||||
}
|
||||
|
||||
|
||||
qint64 timezoneOffset() {
|
||||
static bool ok=false;
|
||||
static qint64 _TZ_offset=0;
|
||||
|
@ -39,6 +39,17 @@ QString weightString(float kg, UnitSystem us=US_Undefined);
|
||||
//! \brief Mercilessly trash a directory
|
||||
bool removeDir(const QString & path);
|
||||
|
||||
|
||||
#ifdef UNSTABLE_BUILD
|
||||
const QString STR_Unstable="-Unstable";
|
||||
#else
|
||||
const QString STR_Unstable="";
|
||||
#endif
|
||||
|
||||
const QString getAppName();
|
||||
const QString getDeveloperName();
|
||||
const QString getDefaultAppRoot();
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Preference Name Strings
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -78,6 +89,9 @@ const QString STR_MACH_ZEO="Zeo";
|
||||
const QString STR_PREF_VersionString="VersionString";
|
||||
const QString STR_PREF_Language="Language";
|
||||
|
||||
const QString STR_AppName="SleepyHead";
|
||||
const QString STR_DeveloperName="Jedimark";
|
||||
const QString STR_AppRoot="SleepyHeadData";
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Commonly used translatable text strings
|
||||
|
@ -22,6 +22,7 @@ License: GPL
|
||||
#include "lmcons.h"
|
||||
#endif
|
||||
|
||||
#include "common.h"
|
||||
#include "preferences.h"
|
||||
|
||||
const QString & getUserName()
|
||||
@ -56,7 +57,7 @@ const QString & getUserName()
|
||||
|
||||
QString GetAppRoot()
|
||||
{
|
||||
QSettings settings("Jedimark", "SleepyHead");
|
||||
QSettings settings(getDeveloperName(), getAppName());
|
||||
|
||||
QString HomeAppRoot=settings.value("Settings/AppRoot").toString();
|
||||
|
||||
@ -67,7 +68,7 @@ QString GetAppRoot()
|
||||
#endif
|
||||
|
||||
if (HomeAppRoot.isEmpty())
|
||||
HomeAppRoot=desktopFolder+"/"+AppRoot;
|
||||
HomeAppRoot=desktopFolder+"/"+getDefaultAppRoot();
|
||||
|
||||
return HomeAppRoot;
|
||||
}
|
||||
@ -179,7 +180,7 @@ bool Preferences::Open(QString filename)
|
||||
|
||||
|
||||
QDomElement root=doc.documentElement();
|
||||
if (root.tagName() != AppName) {
|
||||
if (root.tagName() != STR_AppName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -273,7 +274,7 @@ bool Preferences::Save(QString filename)
|
||||
|
||||
QDomDocument doc(p_name);
|
||||
|
||||
QDomElement droot = doc.createElement(AppName);
|
||||
QDomElement droot = doc.createElement(STR_AppName);
|
||||
doc.appendChild( droot );
|
||||
|
||||
QDomElement root=doc.createElement(p_name);
|
||||
|
@ -17,10 +17,6 @@ License: GPL
|
||||
#include <QDomDocument>
|
||||
#include <map>
|
||||
|
||||
|
||||
const QString AppName="SleepyHead"; // Outer tag of XML files
|
||||
const QString AppRoot="SleepyHeadData"; // The Folder Name
|
||||
|
||||
const QString STR_ext_XML=".xml";
|
||||
|
||||
extern QString GetAppRoot(); //returns app root path plus trailing path separator.
|
||||
|
@ -23,16 +23,7 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -61,16 +52,7 @@
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -358,7 +340,7 @@ QToolButton:pressed {
|
||||
background: transparent;
|
||||
border: 2px solid transparent;
|
||||
border-radius: 8px;
|
||||
width: 5em;
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
#qt_calendar_monthbutton:hover {
|
||||
@ -421,16 +403,7 @@ QToolButton:pressed {
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -459,16 +432,7 @@ QToolButton:pressed {
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -525,16 +489,7 @@ QToolButton:pressed {
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
@ -868,16 +823,7 @@ QSlider::handle:horizontal {
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
|
@ -90,7 +90,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
QString version=FullVersionString;
|
||||
if (QString(GIT_BRANCH)!="master") version+=QString(" ")+QString(GIT_BRANCH);
|
||||
this->setWindowTitle(tr("SleepyHead")+QString(" v%1 ("+tr("Profile")+": %2)").arg(version).arg(PREF[STR_GEN_Profile].toString()));
|
||||
this->setWindowTitle(STR_TR_SleepyHead+QString(" v%1 ("+tr("Profile")+": %2)").arg(version).arg(PREF[STR_GEN_Profile].toString()));
|
||||
//ui->tabWidget->setCurrentIndex(1);
|
||||
|
||||
// Disable Screenshot on Mac Platform,as it doesn't work, and the system provides this functionality anyway.
|
||||
@ -137,7 +137,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
first_load=true;
|
||||
|
||||
// Using the dirty registry here. :(
|
||||
QSettings settings("Jedimark", "SleepyHead");
|
||||
QSettings settings(getDeveloperName(), getAppName());
|
||||
|
||||
// Load previous Window geometry
|
||||
this->restoreGeometry(settings.value("MainWindow/geometry").toByteArray());
|
||||
@ -193,8 +193,8 @@ MainWindow::~MainWindow()
|
||||
if (systray) delete systray;
|
||||
|
||||
// Save current window position
|
||||
QSettings settings("Jedimark", "SleepyHead");
|
||||
settings.setValue("MainWindow/geometry", saveGeometry());
|
||||
QSettings settings(getDeveloperName(), getAppName());
|
||||
settings.setValue("MainWindow/geometry", saveGeometry());
|
||||
|
||||
if (daily) {
|
||||
daily->close();
|
||||
@ -231,7 +231,7 @@ void MainWindow::Notify(QString s,QString title,int ms)
|
||||
|
||||
void MainWindow::Startup()
|
||||
{
|
||||
qDebug() << PREF["AppName"].toString().toLatin1()+" v"+VersionString.toLatin1() << "built with Qt"<< QT_VERSION_STR << "on" << __DATE__ << __TIME__;
|
||||
qDebug() << STR_TR_SleepyHeadVersion.toLocal8Bit().data() << "built with Qt"<< QT_VERSION_STR << "on" << __DATE__ << __TIME__;
|
||||
qstatus->setText(tr("Loading Data"));
|
||||
qprogress->show();
|
||||
//qstatusbar->showMessage(tr("Loading Data"),0);
|
||||
@ -599,7 +599,7 @@ void MainWindow::on_action_About_triggered()
|
||||
"<span style=\"color:#000000; font-weight:600; vertical-align:middle;\">"
|
||||
"<table width=100%><tr><td>"
|
||||
"<p><h1>"+STR_TR_SleepyHead+" v%1.%2.%3-%4 (%8)</h1></p><font color=black><p>"+tr("Build Date")+": %5 %6<br/>%7<br/>"+tr("Data Folder Location")+": %9<hr/>"+
|
||||
tr("Copyright")+" ©2012 Mark Watkins (jedimark) <br/> \n"+
|
||||
tr("Copyright")+" ©2013 Mark Watkins (jedimark) <br/> \n"+
|
||||
tr("This software is released under the GNU Public License v3.0<br/>")+
|
||||
"<hr><p>"+tr("SleepyHead Project Page")+": <a href=\"http://sourceforge.net/projects/sleepyhead\">http://sourceforge.net/projects/sleepyhead</a><br/>"+
|
||||
tr("SleepyHead Wiki")+": <a href=\"http://sleepyhead.sourceforge.net\">http://sleepyhead.sourceforge.net</a><br/>"+
|
||||
|
@ -92,7 +92,7 @@ void NewProfile::on_nextButton_clicked()
|
||||
{
|
||||
const QString xmlext=".xml";
|
||||
|
||||
QSettings settings("Jedimark", "SleepyHead");
|
||||
QSettings settings(getDeveloperName(), getAppName());
|
||||
|
||||
int index=ui->stackedWidget->currentIndex();
|
||||
switch(index) {
|
||||
|
@ -19,7 +19,6 @@ else:!use_bundled_libs:CONFIG += extserialport
|
||||
|
||||
use_bundled_libs:DEFINES += USE_BUNDLED_LIBS
|
||||
|
||||
|
||||
#static {
|
||||
# CONFIG += static
|
||||
# QTPLUGIN += qsvg qgif qpng
|
||||
@ -37,11 +36,19 @@ TEMPLATE = app
|
||||
|
||||
# GIT_VERSION = $$system(git describe --tags --long --abbrev=6 --dirty="*")
|
||||
|
||||
exists(.git):DEFINES += GIT_BRANCH=\\\"$$system(git rev-parse --abbrev-ref HEAD)\\\"
|
||||
else:DEFINES += GIT_BRANCH=\\\"UNKNOWN\\\"
|
||||
exists(../.git):{
|
||||
|
||||
DEFINES += GIT_BRANCH=\\\"$$system(git rev-parse --abbrev-ref HEAD)\\\"
|
||||
DEFINES += GIT_REVISION=\\\"$$system(git rev-parse HEAD)\\\"
|
||||
|
||||
equals(GIT_BRANCH,"unstable"):DEFINES += UNSTABLE_BUILD
|
||||
|
||||
}else{
|
||||
DEFINES += GIT_BRANCH=\\\"UNKNOWN\\\"
|
||||
DEFINES += GIT_REVISION=\\\"UNKNOWN\\\"
|
||||
}
|
||||
|
||||
|
||||
exists(.git):DEFINES += GIT_REVISION=\\\"$$system(git rev-parse HEAD)\\\"
|
||||
else:DEFINES += GIT_REVISION=\\\"UNKNOWN\\\"
|
||||
|
||||
unix:!macx {
|
||||
LIBS += -lX11 -lz -lGLU
|
||||
|
@ -42,9 +42,14 @@ QString htmlHeader()
|
||||
"<body leftmargin=0 topmargin=0 rightmargin=0>"
|
||||
"<div align=center><table cellpadding=3 cellspacing=0 border=0>"
|
||||
"<tr><td><img src='qrc:/icons/bob-v3.0.png' width=140px height=140px><td valign=center align=center><h1>"+
|
||||
QObject::tr("SleepyHead")+" v"+VersionString+"</h1><i>"+
|
||||
STR_TR_SleepyHeadVersion+"</h1><i>"+
|
||||
#ifdef UNSTABLE_BUILD
|
||||
QObject::tr("This is an unstable build so expect the possibility things will go wrong.")+"<br/>"+
|
||||
QObject::tr("Please report bugs you find here to SleepyHead's developer mailing list.")+
|
||||
#else
|
||||
QObject::tr("This is a beta software and some functionality may not work as intended yet.")+"<br/>"+
|
||||
QObject::tr("Please report any bugs you find to SleepyHead's SourceForge page.")+
|
||||
#endif
|
||||
"</i></td></tr></table>"
|
||||
"</div>"
|
||||
"<hr/>");
|
||||
|
@ -8,10 +8,15 @@ const int minor_version=9;
|
||||
const int revision_number=4;
|
||||
const int release_number=0;
|
||||
|
||||
const QString VersionString=QString().sprintf("%i.%i.%i",major_version,minor_version,revision_number);
|
||||
const QString FullVersionString=QString().sprintf("%i.%i.%i-%i",major_version,minor_version,revision_number,release_number);
|
||||
|
||||
#ifdef UNSTABLE_BUILD
|
||||
const QString ReleaseStatus="unstable";
|
||||
#else
|
||||
const QString ReleaseStatus="beta";
|
||||
#endif
|
||||
|
||||
const QString VersionString=QString().sprintf("%i.%i.%i",major_version,minor_version,revision_number);
|
||||
const QString FullVersionString=QString().sprintf("%i.%i.%i-%i",major_version,minor_version,revision_number,release_number)+" "+ReleaseStatus;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
const QString PlatformString="MacOSX";
|
||||
|
Loading…
Reference in New Issue
Block a user