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