Set locale according to global options.
--HG-- branch : feature
This commit is contained in:
parent
a12eb73bec
commit
0056ec49e0
|
@ -35,7 +35,6 @@
|
|||
#include "vmaingraphicsview.h"
|
||||
#include "../container/calculator.h"
|
||||
#include "../version.h"
|
||||
#include "vsettings.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "../options.h"
|
||||
#include "../widgets/vmaingraphicsview.h"
|
||||
#include "../../libs/qmuparser/qmutranslation.h"
|
||||
#include "vsettings.h"
|
||||
|
||||
class VApplication;// used in define
|
||||
class QUndoStack;
|
||||
|
@ -40,7 +41,6 @@ class VMainGraphicsView;
|
|||
class VMainGraphicsScene;
|
||||
class VPattern;
|
||||
class QFile;
|
||||
class VSettings;
|
||||
class QLockFile;
|
||||
|
||||
#if defined(qApp)
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <QVBoxLayout>
|
||||
#include <QStackedWidget>
|
||||
#include <QCloseEvent>
|
||||
#include "../core/vapplication.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
ConfigDialog::ConfigDialog(QWidget *parent) :
|
||||
|
@ -93,6 +94,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) :
|
|||
|
||||
this->setFixedSize(QSize(750, 550));
|
||||
this->setWindowFlags(Qt::Tool | Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint);
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -156,6 +158,7 @@ void ConfigDialog::Apply()
|
|||
default:
|
||||
break;
|
||||
}
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
emit UpdateProperties();
|
||||
setResult(QDialog::Accepted);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <QDesktopServices>
|
||||
#include <QMessageBox>
|
||||
#include "../../options.h"
|
||||
#include "../core/vapplication.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogAboutApp::DialogAboutApp(QWidget *parent) :
|
||||
|
@ -41,6 +42,8 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) :
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
ui->label_Valentina_Version->setText(QString("Valentina %1").arg(APP_VERSION));
|
||||
ui->labelBuildRevision->setText(QString("Build revision: %1").arg(BUILD_REVISION));
|
||||
ui->label_QT_Version->setText(buildCompatibilityString());
|
||||
|
|
|
@ -49,6 +49,9 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
|||
cursorToolRecordRow(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||
connect(bOk, &QPushButton::clicked, this, &DialogHistory::DialogAccepted);
|
||||
FillTable();
|
||||
|
|
|
@ -55,6 +55,8 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
qCDebug(vDialog)<<"Showing variables.";
|
||||
if (qApp->patternType() == MeasurementsType::Individual)
|
||||
{
|
||||
|
|
|
@ -47,6 +47,8 @@ DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, con
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
QRect position = this->frameGeometry();
|
||||
position.moveCenter(QDesktopWidget().availableGeometry().center());
|
||||
move(position.topLeft());
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "dialoglayoutprogress.h"
|
||||
#include "ui_dialoglayoutprogress.h"
|
||||
#include "../options.h"
|
||||
#include "../core/vapplication.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
|
@ -38,6 +39,9 @@ DialogLayoutProgress::DialogLayoutProgress(int count, QWidget *parent)
|
|||
:QDialog(parent), ui(new Ui::DialogLayoutProgress)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
ui->progressBar->setMaximum(count);
|
||||
ui->progressBar->setValue(0);
|
||||
|
||||
|
|
|
@ -42,6 +42,9 @@ DialogLayoutSettings::DialogLayoutSettings(QWidget *parent)
|
|||
: QDialog(parent), ui(new Ui::DialogLayoutSettings), oldPaperUnit(Unit::Mm), oldLayoutUnit(Unit::Mm)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
InitPaperUnits();
|
||||
InitLayoutUnits();
|
||||
InitTemplates();
|
||||
|
|
|
@ -28,12 +28,16 @@
|
|||
|
||||
#include "dialogmeasurements.h"
|
||||
#include "ui_dialogmeasurements.h"
|
||||
#include "../core/vapplication.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogMeasurements::DialogMeasurements(QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogMeasurements), result(MeasurementsType::Individual)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
connect(ui->toolButtonStandard, &QToolButton::clicked, this, &DialogMeasurements::StandardMeasurements);
|
||||
connect(ui->toolButtonIndividual, &QToolButton::clicked, this, &DialogMeasurements::IndividualMeasurements);
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent)
|
|||
|
||||
SCASSERT(doc != nullptr);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
ui->lineEditAuthor->setText(doc->GetAuthor());
|
||||
connect(ui->lineEditAuthor, &QLineEdit::editingFinished, this, &DialogPatternProperties::DescEdited);
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "dialogpatternxmledit.h"
|
||||
#include "ui_dialogpatternxmledit.h"
|
||||
#include "../core/vapplication.h"
|
||||
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
@ -36,7 +37,6 @@ const short int DialogPatternXmlEdit::ChangeTypeDelete=1;
|
|||
const short int DialogPatternXmlEdit::ChangeTypeAdd=2;
|
||||
const short int DialogPatternXmlEdit::ChangeTypeModify=3;
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPatternXmlEdit::DialogPatternXmlEdit(QWidget *parent, VPattern *xmldoc)
|
||||
:QDialog(parent), treeChange(false), currentNodeEdited(nullptr), currentNodeEditedStatus(0),
|
||||
|
@ -46,6 +46,8 @@ DialogPatternXmlEdit::DialogPatternXmlEdit(QWidget *parent, VPattern *xmldoc)
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
this->xmlmodel = new VXMLTreeView();
|
||||
this->doc=xmldoc;
|
||||
this->root = this->doc->documentElement();
|
||||
|
|
|
@ -43,6 +43,8 @@ DialogSaveLayout::DialogSaveLayout(const QMap<QString, QString> &formates, int c
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
QPushButton *bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
|
||||
SCASSERT(bOk != nullptr);
|
||||
bOk->setEnabled(false);
|
||||
|
|
|
@ -46,6 +46,8 @@ DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const Q
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
QRect position = this->frameGeometry();
|
||||
position.moveCenter(QDesktopWidget().availableGeometry().center());
|
||||
move(position.topLeft());
|
||||
|
|
|
@ -39,6 +39,8 @@ DialogUndo::DialogUndo(QWidget *parent)
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
bool opening = qApp->getOpeningPattern();
|
||||
if (opening)
|
||||
{
|
||||
|
|
|
@ -34,8 +34,6 @@
|
|||
#include "../../geometry/vsplinepath.h"
|
||||
#include "../../tools/vabstracttool.h"
|
||||
#include "../../../libs/qmuparser/qmuparsererror.h"
|
||||
#include "../../core/vapplication.h"
|
||||
#include "../../core/vsettings.h"
|
||||
#include "../../libs/ifc/xml/vdomdocument.h"
|
||||
#include <QTimer>
|
||||
#include <QCloseEvent>
|
||||
|
|
|
@ -321,6 +321,8 @@ protected:
|
|||
QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
|
||||
SCASSERT(bCancel != nullptr);
|
||||
connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
}
|
||||
template <typename T>
|
||||
/**
|
||||
|
|
|
@ -84,6 +84,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
recentFileActs[i] = nullptr;
|
||||
}
|
||||
|
||||
WindowsLocale();
|
||||
CreateActions();
|
||||
CreateMenus();
|
||||
ToolBarDraws();
|
||||
|
@ -1403,6 +1404,7 @@ void MainWindow::Preferences()
|
|||
{
|
||||
ConfigDialog dlg(this);
|
||||
connect(&dlg, &ConfigDialog::UpdateProperties, toolOptions, &VToolOptionsPropertyBrowser::UpdateOptions);
|
||||
connect(&dlg, &ConfigDialog::UpdateProperties, this, &MainWindow::WindowsLocale);
|
||||
if (dlg.exec() == QDialog::Accepted)
|
||||
{
|
||||
InitAutoSave();
|
||||
|
@ -2474,6 +2476,12 @@ QStringList MainWindow::GetUnlokedRestoreFileList() const
|
|||
return restoreFiles;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::WindowsLocale()
|
||||
{
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ReopenFilesAfterCrash(QStringList &args)
|
||||
{
|
||||
|
|
|
@ -130,6 +130,7 @@ public slots:
|
|||
void Layout();
|
||||
void UpdateGradation();
|
||||
void GlobalChangePP(const QString &patternPiece);
|
||||
void WindowsLocale();
|
||||
signals:
|
||||
/**
|
||||
* @brief ModelChosen emit after calculation all details.
|
||||
|
|
|
@ -60,6 +60,9 @@ TableWindow::TableWindow(QWidget *parent)
|
|||
description(QString()), tempScene(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
qApp->getSettings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
|
||||
|
||||
tempScene = new QGraphicsScene(QRectF(0, 0, qApp->toPixel(823, Unit::Mm), qApp->toPixel(1171, Unit::Mm)));
|
||||
QBrush brush;
|
||||
brush.setStyle( Qt::SolidPattern );
|
||||
|
|
Loading…
Reference in New Issue
Block a user