mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
OP-723 Changed default locale to English. Updated default configuration files to have <OverrideLanguage> tag set to en_US.
This commit is contained in:
parent
5f4b028a93
commit
0e55f3c74d
@ -6,7 +6,7 @@
|
|||||||
<Description>Default configuration</Description>
|
<Description>Default configuration</Description>
|
||||||
<Details>Default configuration built to work on all screen sizes</Details>
|
<Details>Default configuration built to work on all screen sizes</Details>
|
||||||
<ExpertMode>false</ExpertMode>
|
<ExpertMode>false</ExpertMode>
|
||||||
<OverrideLanguage>en_AU</OverrideLanguage>
|
<OverrideLanguage>en_US</OverrideLanguage>
|
||||||
<SaveSettingsOnExit>true</SaveSettingsOnExit>
|
<SaveSettingsOnExit>true</SaveSettingsOnExit>
|
||||||
<SettingsWindowHeight>700</SettingsWindowHeight>
|
<SettingsWindowHeight>700</SettingsWindowHeight>
|
||||||
<SettingsWindowWidth>800</SettingsWindowWidth>
|
<SettingsWindowWidth>800</SettingsWindowWidth>
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<SaveSettingsOnExit>true</SaveSettingsOnExit>
|
<SaveSettingsOnExit>true</SaveSettingsOnExit>
|
||||||
<SettingsWindowHeight>700</SettingsWindowHeight>
|
<SettingsWindowHeight>700</SettingsWindowHeight>
|
||||||
<SettingsWindowWidth>800</SettingsWindowWidth>
|
<SettingsWindowWidth>800</SettingsWindowWidth>
|
||||||
|
<OverrideLanguage>en_US</OverrideLanguage>
|
||||||
<UDPMirror>false</UDPMirror>
|
<UDPMirror>false</UDPMirror>
|
||||||
<Description>Wide configuration</Description>
|
<Description>Wide configuration</Description>
|
||||||
<Details>Default configuration built for wide screens (17"up)</Details>
|
<Details>Default configuration built for wide screens (17"up)</Details>
|
||||||
|
@ -241,6 +241,11 @@ int main(int argc, char **argv)
|
|||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
QApplication::setAttribute(Qt::AA_X11InitThreads, true);
|
QApplication::setAttribute(Qt::AA_X11InitThreads, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//Set the default locale to EN, if this is not set the system locale will be used
|
||||||
|
//and as of now we dont want that behaviour.
|
||||||
|
QLocale::setDefault(QLocale::English);
|
||||||
|
|
||||||
QApplication::setGraphicsSystem("raster");
|
QApplication::setGraphicsSystem("raster");
|
||||||
|
|
||||||
SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv);
|
SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv);
|
||||||
|
@ -14,6 +14,7 @@ importSettings::importSettings(QWidget *parent) :
|
|||||||
connect(ui->btnLoad, SIGNAL(clicked()), this, SLOT(accept()));
|
connect(ui->btnLoad, SIGNAL(clicked()), this, SLOT(accept()));
|
||||||
QTimer::singleShot(500, this, SLOT(repaint()));
|
QTimer::singleShot(500, this, SLOT(repaint()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void importSettings::loadFiles(QString path)
|
void importSettings::loadFiles(QString path)
|
||||||
{
|
{
|
||||||
QDir myDir(path);
|
QDir myDir(path);
|
||||||
@ -21,8 +22,7 @@ void importSettings::loadFiles(QString path)
|
|||||||
filters << "*.xml";
|
filters << "*.xml";
|
||||||
QStringList list = myDir.entryList(filters,QDir::Files);
|
QStringList list = myDir.entryList(filters,QDir::Files);
|
||||||
int x = 0;
|
int x = 0;
|
||||||
foreach(QString fileStr, list)
|
foreach(QString fileStr, list) {
|
||||||
{
|
|
||||||
fileInfo *info = new fileInfo;
|
fileInfo *info = new fileInfo;
|
||||||
QSettings settings(path+QDir::separator() + fileStr, XmlConfig::XmlSettingsFormat);
|
QSettings settings(path+QDir::separator() + fileStr, XmlConfig::XmlSettingsFormat);
|
||||||
settings.beginGroup("General");
|
settings.beginGroup("General");
|
||||||
@ -41,6 +41,7 @@ void importSettings::updateDetails(int index)
|
|||||||
fileInfo *info = configList.value(ui->cbConfigs->itemData(index).toInt());
|
fileInfo *info = configList.value(ui->cbConfigs->itemData(index).toInt());
|
||||||
ui->lblDetails->setText(info->details);
|
ui->lblDetails->setText(info->details);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString importSettings::choosenConfig()
|
QString importSettings::choosenConfig()
|
||||||
{
|
{
|
||||||
fileInfo *info = configList.value(ui->cbConfigs->itemData(ui->cbConfigs->currentIndex()).toInt());
|
fileInfo *info = configList.value(ui->cbConfigs->itemData(ui->cbConfigs->currentIndex()).toInt());
|
||||||
@ -49,8 +50,7 @@ QString importSettings::choosenConfig()
|
|||||||
|
|
||||||
importSettings::~importSettings()
|
importSettings::~importSettings()
|
||||||
{
|
{
|
||||||
foreach(fileInfo * info,configList.values())
|
foreach(fileInfo * info,configList.values()) {
|
||||||
{
|
|
||||||
delete info;
|
delete info;
|
||||||
}
|
}
|
||||||
delete ui;
|
delete ui;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
#ifndef IMPORTSETTINGS_H
|
#ifndef IMPORTSETTINGS_H
|
||||||
#define IMPORTSETTINGS_H
|
#define IMPORTSETTINGS_H
|
||||||
|
|
||||||
@ -10,8 +11,7 @@ class importSettings;
|
|||||||
class importSettings : public QDialog
|
class importSettings : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
struct fileInfo
|
struct fileInfo {
|
||||||
{
|
|
||||||
QString file;
|
QString file;
|
||||||
QString description;
|
QString description;
|
||||||
QString details;
|
QString details;
|
||||||
@ -23,9 +23,11 @@ public:
|
|||||||
|
|
||||||
void loadFiles(QString path);
|
void loadFiles(QString path);
|
||||||
QString choosenConfig();
|
QString choosenConfig();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::importSettings *ui;
|
Ui::importSettings *ui;
|
||||||
QMap<int,fileInfo*> configList;
|
QMap<int,fileInfo*> configList;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateDetails(int);
|
void updateDetails(int);
|
||||||
};
|
};
|
||||||
|
@ -266,15 +266,12 @@ void MainWindow::modeChanged(Core::IMode */*mode*/)
|
|||||||
|
|
||||||
void MainWindow::extensionsInitialized()
|
void MainWindow::extensionsInitialized()
|
||||||
{
|
{
|
||||||
|
|
||||||
QSettings *qs = m_settings;
|
QSettings *qs = m_settings;
|
||||||
QSettings *settings;
|
QSettings *settings;
|
||||||
QString commandLine;
|
QString commandLine;
|
||||||
if ( ! qs->allKeys().count() ) {
|
if ( ! qs->allKeys().count() ) {
|
||||||
foreach(QString str,qApp->arguments())
|
foreach(QString str, qApp->arguments()) {
|
||||||
{
|
if(str.contains("configfile")) {
|
||||||
if(str.contains("configfile"))
|
|
||||||
{
|
|
||||||
qDebug() << "ass";
|
qDebug() << "ass";
|
||||||
commandLine = str.split("=").at(1);
|
commandLine = str.split("=").at(1);
|
||||||
qDebug() << commandLine;
|
qDebug() << commandLine;
|
||||||
@ -294,18 +291,15 @@ void MainWindow::extensionsInitialized()
|
|||||||
qDebug() << "Looking for default config files in: " + directory.absolutePath();
|
qDebug() << "Looking for default config files in: " + directory.absolutePath();
|
||||||
bool showDialog = true;
|
bool showDialog = true;
|
||||||
QString filename;
|
QString filename;
|
||||||
if(!commandLine.isEmpty())
|
if(!commandLine.isEmpty()) {
|
||||||
{
|
if(QFile::exists(directory.absolutePath() + QDir::separator()+commandLine)) {
|
||||||
if(QFile::exists(directory.absolutePath()+QDir::separator()+commandLine))
|
|
||||||
{
|
|
||||||
filename = directory.absolutePath() + QDir::separator()+commandLine;
|
filename = directory.absolutePath() + QDir::separator()+commandLine;
|
||||||
qDebug() << "Load configuration from command line";
|
qDebug() << "Load configuration from command line";
|
||||||
settings = new QSettings(filename, XmlConfig::XmlSettingsFormat);
|
settings = new QSettings(filename, XmlConfig::XmlSettingsFormat);
|
||||||
showDialog = false;
|
showDialog = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(showDialog)
|
if(showDialog) {
|
||||||
{
|
|
||||||
importSettings *dialog = new importSettings(this);
|
importSettings *dialog = new importSettings(this);
|
||||||
dialog->loadFiles(directory.absolutePath());
|
dialog->loadFiles(directory.absolutePath());
|
||||||
dialog->exec();
|
dialog->exec();
|
||||||
|
Loading…
Reference in New Issue
Block a user