mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Added language option. Closes #336.
This commit is contained in:
parent
0ecc4b5966
commit
41b89de83f
7 changed files with 197 additions and 97 deletions
|
@ -20,7 +20,7 @@ void lcPreferences::LoadDefaults()
|
||||||
mDrawAxes = lcGetProfileInt(LC_PROFILE_DRAW_AXES);
|
mDrawAxes = lcGetProfileInt(LC_PROFILE_DRAW_AXES);
|
||||||
mDrawEdgeLines = lcGetProfileInt(LC_PROFILE_DRAW_EDGE_LINES);
|
mDrawEdgeLines = lcGetProfileInt(LC_PROFILE_DRAW_EDGE_LINES);
|
||||||
mLineWidth = lcGetProfileFloat(LC_PROFILE_LINE_WIDTH);
|
mLineWidth = lcGetProfileFloat(LC_PROFILE_LINE_WIDTH);
|
||||||
mAllowLOD = lcGetProfileFloat(LC_PROFILE_ALLOW_LOD);
|
mAllowLOD = lcGetProfileInt(LC_PROFILE_ALLOW_LOD);
|
||||||
mDrawGridStuds = lcGetProfileInt(LC_PROFILE_GRID_STUDS);
|
mDrawGridStuds = lcGetProfileInt(LC_PROFILE_GRID_STUDS);
|
||||||
mGridStudColor = lcGetProfileInt(LC_PROFILE_GRID_STUD_COLOR);
|
mGridStudColor = lcGetProfileInt(LC_PROFILE_GRID_STUD_COLOR);
|
||||||
mDrawGridLines = lcGetProfileInt(LC_PROFILE_GRID_LINES);
|
mDrawGridLines = lcGetProfileInt(LC_PROFILE_GRID_LINES);
|
||||||
|
@ -669,6 +669,7 @@ void lcApplication::ShowPreferencesDialog()
|
||||||
Options.POVRayPath = lcGetProfileString(LC_PROFILE_POVRAY_PATH);
|
Options.POVRayPath = lcGetProfileString(LC_PROFILE_POVRAY_PATH);
|
||||||
Options.LGEOPath = lcGetProfileString(LC_PROFILE_POVRAY_LGEO_PATH);
|
Options.LGEOPath = lcGetProfileString(LC_PROFILE_POVRAY_LGEO_PATH);
|
||||||
Options.DefaultAuthor = lcGetProfileString(LC_PROFILE_DEFAULT_AUTHOR_NAME);
|
Options.DefaultAuthor = lcGetProfileString(LC_PROFILE_DEFAULT_AUTHOR_NAME);
|
||||||
|
Options.Language = lcGetProfileString(LC_PROFILE_LANGUAGE);
|
||||||
Options.CheckForUpdates = lcGetProfileInt(LC_PROFILE_CHECK_UPDATES);
|
Options.CheckForUpdates = lcGetProfileInt(LC_PROFILE_CHECK_UPDATES);
|
||||||
|
|
||||||
Options.AASamples = CurrentAASamples;
|
Options.AASamples = CurrentAASamples;
|
||||||
|
@ -689,6 +690,7 @@ void lcApplication::ShowPreferencesDialog()
|
||||||
if (Dialog.exec() != QDialog::Accepted)
|
if (Dialog.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool LanguageChanged = Options.Language != lcGetProfileString(LC_PROFILE_LANGUAGE);
|
||||||
bool LibraryChanged = Options.LibraryPath != lcGetProfileString(LC_PROFILE_PARTS_LIBRARY);
|
bool LibraryChanged = Options.LibraryPath != lcGetProfileString(LC_PROFILE_PARTS_LIBRARY);
|
||||||
bool ColorsChanged = Options.ColorConfigPath != lcGetProfileString(LC_PROFILE_COLOR_CONFIG);
|
bool ColorsChanged = Options.ColorConfigPath != lcGetProfileString(LC_PROFILE_COLOR_CONFIG);
|
||||||
bool AAChanged = CurrentAASamples != Options.AASamples;
|
bool AAChanged = CurrentAASamples != Options.AASamples;
|
||||||
|
@ -704,11 +706,12 @@ void lcApplication::ShowPreferencesDialog()
|
||||||
lcSetProfileString(LC_PROFILE_MINIFIG_SETTINGS, Options.MinifigSettingsPath);
|
lcSetProfileString(LC_PROFILE_MINIFIG_SETTINGS, Options.MinifigSettingsPath);
|
||||||
lcSetProfileString(LC_PROFILE_POVRAY_PATH, Options.POVRayPath);
|
lcSetProfileString(LC_PROFILE_POVRAY_PATH, Options.POVRayPath);
|
||||||
lcSetProfileString(LC_PROFILE_POVRAY_LGEO_PATH, Options.LGEOPath);
|
lcSetProfileString(LC_PROFILE_POVRAY_LGEO_PATH, Options.LGEOPath);
|
||||||
|
lcSetProfileString(LC_PROFILE_LANGUAGE, Options.Language);
|
||||||
lcSetProfileInt(LC_PROFILE_CHECK_UPDATES, Options.CheckForUpdates);
|
lcSetProfileInt(LC_PROFILE_CHECK_UPDATES, Options.CheckForUpdates);
|
||||||
lcSetProfileInt(LC_PROFILE_ANTIALIASING_SAMPLES, Options.AASamples);
|
lcSetProfileInt(LC_PROFILE_ANTIALIASING_SAMPLES, Options.AASamples);
|
||||||
lcSetProfileInt(LC_PROFILE_STUD_LOGO, Options.StudLogo);
|
lcSetProfileInt(LC_PROFILE_STUD_LOGO, Options.StudLogo);
|
||||||
|
|
||||||
if (LibraryChanged || ColorsChanged || AAChanged)
|
if (LanguageChanged || LibraryChanged || ColorsChanged || AAChanged)
|
||||||
QMessageBox::information(gMainWindow, tr("LeoCAD"), tr("Some changes will only take effect the next time you start LeoCAD."));
|
QMessageBox::information(gMainWindow, tr("LeoCAD"), tr("Some changes will only take effect the next time you start LeoCAD."));
|
||||||
|
|
||||||
if (Options.CategoriesModified)
|
if (Options.CategoriesModified)
|
||||||
|
|
|
@ -26,6 +26,7 @@ struct lcPreferencesDialogOptions
|
||||||
QString POVRayPath;
|
QString POVRayPath;
|
||||||
QString LGEOPath;
|
QString LGEOPath;
|
||||||
QString DefaultAuthor;
|
QString DefaultAuthor;
|
||||||
|
QString Language;
|
||||||
int CheckForUpdates;
|
int CheckForUpdates;
|
||||||
|
|
||||||
int AASamples;
|
int AASamples;
|
||||||
|
|
|
@ -73,6 +73,7 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
|
||||||
lcProfileEntry("Settings", "ViewSphereTextColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_VIEW_SPHERE_TEXT_COLOR
|
lcProfileEntry("Settings", "ViewSphereTextColor", LC_RGBA(0, 0, 0, 255)), // LC_PROFILE_VIEW_SPHERE_TEXT_COLOR
|
||||||
lcProfileEntry("Settings", "ViewSphereHighlightColor", LC_RGBA(255, 0, 0, 255)), // LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR
|
lcProfileEntry("Settings", "ViewSphereHighlightColor", LC_RGBA(255, 0, 0, 255)), // LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR
|
||||||
|
|
||||||
|
lcProfileEntry("Settings", "Language", ""), // LC_PROFILE_LANGUAGE
|
||||||
lcProfileEntry("Settings", "CheckUpdates", 1), // LC_PROFILE_CHECK_UPDATES
|
lcProfileEntry("Settings", "CheckUpdates", 1), // LC_PROFILE_CHECK_UPDATES
|
||||||
lcProfileEntry("Settings", "ProjectsPath", ""), // LC_PROFILE_PROJECTS_PATH
|
lcProfileEntry("Settings", "ProjectsPath", ""), // LC_PROFILE_PROJECTS_PATH
|
||||||
lcProfileEntry("Settings", "PartsLibrary", ""), // LC_PROFILE_PARTS_LIBRARY
|
lcProfileEntry("Settings", "PartsLibrary", ""), // LC_PROFILE_PARTS_LIBRARY
|
||||||
|
|
|
@ -21,6 +21,7 @@ enum LC_PROFILE_KEY
|
||||||
LC_PROFILE_VIEW_SPHERE_TEXT_COLOR,
|
LC_PROFILE_VIEW_SPHERE_TEXT_COLOR,
|
||||||
LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR,
|
LC_PROFILE_VIEW_SPHERE_HIGHLIGHT_COLOR,
|
||||||
|
|
||||||
|
LC_PROFILE_LANGUAGE,
|
||||||
LC_PROFILE_CHECK_UPDATES,
|
LC_PROFILE_CHECK_UPDATES,
|
||||||
LC_PROFILE_PROJECTS_PATH,
|
LC_PROFILE_PROJECTS_PATH,
|
||||||
LC_PROFILE_PARTS_LIBRARY,
|
LC_PROFILE_PARTS_LIBRARY,
|
||||||
|
|
|
@ -10,6 +10,11 @@
|
||||||
#include "lc_glextensions.h"
|
#include "lc_glextensions.h"
|
||||||
#include "pieceinf.h"
|
#include "pieceinf.h"
|
||||||
|
|
||||||
|
static const char* gLanguageLocales[] =
|
||||||
|
{
|
||||||
|
"", "de_DE", "en_US", "fr_FR", "pt_PT"
|
||||||
|
};
|
||||||
|
|
||||||
lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogOptions* Options)
|
lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogOptions* Options)
|
||||||
: QDialog(Parent), mOptions(Options), ui(new Ui::lcQPreferencesDialog)
|
: QDialog(Parent), mOptions(Options), ui(new Ui::lcQPreferencesDialog)
|
||||||
{
|
{
|
||||||
|
@ -41,6 +46,14 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
|
||||||
ui->lgeoPath->setText(mOptions->LGEOPath);
|
ui->lgeoPath->setText(mOptions->LGEOPath);
|
||||||
ui->authorName->setText(mOptions->DefaultAuthor);
|
ui->authorName->setText(mOptions->DefaultAuthor);
|
||||||
ui->mouseSensitivity->setValue(mOptions->Preferences.mMouseSensitivity);
|
ui->mouseSensitivity->setValue(mOptions->Preferences.mMouseSensitivity);
|
||||||
|
for (unsigned int LanguageIdx = 0; LanguageIdx < sizeof(gLanguageLocales) / sizeof(gLanguageLocales[0]); LanguageIdx++)
|
||||||
|
{
|
||||||
|
if (mOptions->Language == gLanguageLocales[LanguageIdx])
|
||||||
|
{
|
||||||
|
ui->Language->setCurrentIndex(LanguageIdx);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
ui->checkForUpdates->setCurrentIndex(mOptions->CheckForUpdates);
|
ui->checkForUpdates->setCurrentIndex(mOptions->CheckForUpdates);
|
||||||
ui->fixedDirectionKeys->setChecked(mOptions->Preferences.mFixedAxes);
|
ui->fixedDirectionKeys->setChecked(mOptions->Preferences.mFixedAxes);
|
||||||
ui->autoLoadMostRecent->setChecked(mOptions->Preferences.mAutoLoadMostRecent);
|
ui->autoLoadMostRecent->setChecked(mOptions->Preferences.mAutoLoadMostRecent);
|
||||||
|
@ -153,6 +166,12 @@ void lcQPreferencesDialog::accept()
|
||||||
mOptions->LGEOPath = ui->lgeoPath->text();
|
mOptions->LGEOPath = ui->lgeoPath->text();
|
||||||
mOptions->DefaultAuthor = ui->authorName->text();
|
mOptions->DefaultAuthor = ui->authorName->text();
|
||||||
mOptions->Preferences.mMouseSensitivity = ui->mouseSensitivity->value();
|
mOptions->Preferences.mMouseSensitivity = ui->mouseSensitivity->value();
|
||||||
|
|
||||||
|
int Language = ui->Language->currentIndex();
|
||||||
|
if (Language < 0 || Language > sizeof(gLanguageLocales) / sizeof(gLanguageLocales[0]))
|
||||||
|
Language = 0;
|
||||||
|
mOptions->Language = gLanguageLocales[Language];
|
||||||
|
|
||||||
mOptions->CheckForUpdates = ui->checkForUpdates->currentIndex();
|
mOptions->CheckForUpdates = ui->checkForUpdates->currentIndex();
|
||||||
mOptions->Preferences.mFixedAxes = ui->fixedDirectionKeys->isChecked();
|
mOptions->Preferences.mFixedAxes = ui->fixedDirectionKeys->isChecked();
|
||||||
mOptions->Preferences.mAutoLoadMostRecent = ui->autoLoadMostRecent->isChecked();
|
mOptions->Preferences.mAutoLoadMostRecent = ui->autoLoadMostRecent->isChecked();
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>598</width>
|
<width>598</width>
|
||||||
<height>450</height>
|
<height>454</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -27,20 +27,23 @@
|
||||||
<property name="fieldGrowthPolicy">
|
<property name="fieldGrowthPolicy">
|
||||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QGroupBox" name="ApplicationGroup">
|
||||||
|
<property name="title">
|
||||||
|
<string>Application</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_19">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Default author name:</string>
|
<string>Language:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy">
|
<property name="buddy">
|
||||||
<cstring>authorName</cstring>
|
<cstring>Language</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="0">
|
||||||
<widget class="QLineEdit" name="authorName"/>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
|
||||||
<widget class="QLabel" name="label_10">
|
<widget class="QLabel" name="label_10">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Check for updates:</string>
|
<string>Check for updates:</string>
|
||||||
|
@ -50,7 +53,36 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="Language">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Deutsch </string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>English</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Français</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Português</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
<widget class="QComboBox" name="checkForUpdates">
|
<widget class="QComboBox" name="checkForUpdates">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -69,14 +101,43 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0" colspan="2">
|
<item row="0" column="2">
|
||||||
|
<spacer name="horizontalSpacer_8">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Default author name:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>authorName</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="authorName"/>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="fixedDirectionKeys">
|
<widget class="QCheckBox" name="fixedDirectionKeys">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Fixed direction keys</string>
|
<string>Fixed direction keys</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0" colspan="2">
|
<item row="10" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="autoLoadMostRecent">
|
<widget class="QCheckBox" name="autoLoadMostRecent">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open most recent file on startup</string>
|
<string>Open most recent file on startup</string>
|
||||||
|
@ -84,7 +145,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_6">
|
<widget class="QGroupBox" name="CustomPathsGroup">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Custom Paths</string>
|
<string>Custom Paths</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -99,40 +160,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="povrayLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>PO&V-Ray Executable:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>povrayExecutable</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="label_9">
|
|
||||||
<property name="text">
|
|
||||||
<string>&LGEO Library:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>lgeoPath</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="lgeoPath"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="lgeoPathBrowse">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
|
@ -156,31 +183,13 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
|
||||||
<layout class="QHBoxLayout" name="povrayLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="povrayExecutable"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QToolButton" name="povrayExecutableBrowse">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_17">
|
<widget class="QLabel" name="label_17">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Color Configuration:</string>
|
<string>Color Configuration:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="buddy">
|
||||||
</item>
|
<cstring>ColorConfigEdit</cstring>
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_18">
|
|
||||||
<property name="text">
|
|
||||||
<string>Minifig Settings:</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -198,6 +207,16 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_18">
|
||||||
|
<property name="text">
|
||||||
|
<string>Minifig Settings:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>MinifigSettingsEdit</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<layout class="QHBoxLayout" name="MinifigSettingsLayout">
|
<layout class="QHBoxLayout" name="MinifigSettingsLayout">
|
||||||
<item>
|
<item>
|
||||||
|
@ -212,6 +231,54 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="povrayLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>PO&V-Ray Executable:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>povrayExecutable</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="povrayLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="povrayExecutable"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="povrayExecutableBrowse">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_9">
|
||||||
|
<property name="text">
|
||||||
|
<string>&LGEO Library:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>lgeoPath</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_10">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lgeoPath"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QToolButton" name="lgeoPathBrowse">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -1097,8 +1164,9 @@
|
||||||
<tabstop>povrayExecutableBrowse</tabstop>
|
<tabstop>povrayExecutableBrowse</tabstop>
|
||||||
<tabstop>lgeoPath</tabstop>
|
<tabstop>lgeoPath</tabstop>
|
||||||
<tabstop>lgeoPathBrowse</tabstop>
|
<tabstop>lgeoPathBrowse</tabstop>
|
||||||
<tabstop>authorName</tabstop>
|
<tabstop>Language</tabstop>
|
||||||
<tabstop>checkForUpdates</tabstop>
|
<tabstop>checkForUpdates</tabstop>
|
||||||
|
<tabstop>authorName</tabstop>
|
||||||
<tabstop>fixedDirectionKeys</tabstop>
|
<tabstop>fixedDirectionKeys</tabstop>
|
||||||
<tabstop>autoLoadMostRecent</tabstop>
|
<tabstop>autoLoadMostRecent</tabstop>
|
||||||
<tabstop>antiAliasing</tabstop>
|
<tabstop>antiAliasing</tabstop>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "lc_application.h"
|
#include "lc_application.h"
|
||||||
#include "lc_qupdatedialog.h"
|
#include "lc_qupdatedialog.h"
|
||||||
#include "lc_mainwindow.h"
|
#include "lc_mainwindow.h"
|
||||||
|
#include "lc_profile.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
||||||
|
@ -125,24 +126,30 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
lcApplication Application(argc, argv);
|
lcApplication Application(argc, argv);
|
||||||
|
|
||||||
|
QString Language = lcGetProfileString(LC_PROFILE_LANGUAGE);
|
||||||
|
QLocale Locale;
|
||||||
|
|
||||||
|
if (!Language.isEmpty())
|
||||||
|
Locale = QLocale(Language);
|
||||||
|
|
||||||
QTranslator QtTranslator;
|
QTranslator QtTranslator;
|
||||||
if (QtTranslator.load(QLocale::system(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
if (QtTranslator.load(Locale, "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||||
Application.installTranslator(&QtTranslator);
|
Application.installTranslator(&QtTranslator);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
else if (QtTranslator.load(QLocale::system(), "qt", "_", qApp->applicationDirPath() + "/translations"))
|
else if (QtTranslator.load(Locale, "qt", "_", qApp->applicationDirPath() + "/translations"))
|
||||||
Application.installTranslator(&QtTranslator);
|
Application.installTranslator(&QtTranslator);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QTranslator QtBaseTranslator;
|
QTranslator QtBaseTranslator;
|
||||||
if (QtBaseTranslator.load("qtbase_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
if (QtBaseTranslator.load("qtbase_" + Locale.name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||||
Application.installTranslator(&QtBaseTranslator);
|
Application.installTranslator(&QtBaseTranslator);
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
else if (QtBaseTranslator.load("qtbase_" + QLocale::system().name(), qApp->applicationDirPath() + "/translations"))
|
else if (QtBaseTranslator.load("qtbase_" + Locale.name(), qApp->applicationDirPath() + "/translations"))
|
||||||
Application.installTranslator(&QtBaseTranslator);
|
Application.installTranslator(&QtBaseTranslator);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QTranslator Translator;
|
QTranslator Translator;
|
||||||
if (Translator.load("leocad_" + QLocale::system().name(), ":/resources"))
|
if (Translator.load("leocad_" + Locale.name(), ":/resources"))
|
||||||
Application.installTranslator(&Translator);
|
Application.installTranslator(&Translator);
|
||||||
|
|
||||||
qRegisterMetaTypeStreamOperators<QList<int> >("QList<int>");
|
qRegisterMetaTypeStreamOperators<QList<int> >("QList<int>");
|
||||||
|
|
Loading…
Add table
Reference in a new issue