diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-01-12 23:04:05 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-01-12 23:04:05 +0100 |
commit | 54a9ee5eb03b6d1be6294e47179b9eb76f7a3949 (patch) | |
tree | 6454c95549fe42183d8b285a89517a734a6da5dc /gui | |
parent | f552366e03cd6bd693850e24503bf3bf3559cfd0 (diff) | |
parent | 8950953d915ba234f62da93b520a1b82594cb9dc (diff) | |
download | MultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.tar MultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.tar.gz MultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.tar.lz MultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.tar.xz MultiMC-54a9ee5eb03b6d1be6294e47179b9eb76f7a3949.zip |
Merge branch 'feature_localization' of https://github.com/02JanDal/MultiMC5 into develop
Conflicts:
gui/dialogs/SettingsDialog.cpp
gui/dialogs/SettingsDialog.ui
Diffstat (limited to 'gui')
-rw-r--r-- | gui/dialogs/ModEditDialogCommon.cpp | 4 | ||||
-rw-r--r-- | gui/dialogs/SettingsDialog.cpp | 16 | ||||
-rw-r--r-- | gui/dialogs/SettingsDialog.ui | 488 |
3 files changed, 273 insertions, 235 deletions
diff --git a/gui/dialogs/ModEditDialogCommon.cpp b/gui/dialogs/ModEditDialogCommon.cpp index 9a15d92d..eee42e5e 100644 --- a/gui/dialogs/ModEditDialogCommon.cpp +++ b/gui/dialogs/ModEditDialogCommon.cpp @@ -50,8 +50,8 @@ void showWebsiteForMod(QWidget *parentDlg, Mod &m) else { CustomMessageBox::selectable( - parentDlg, parentDlg->tr("How sad!"), - parentDlg->tr("The mod author didn't provide a website link for this mod."), + parentDlg, QObject::tr("How sad!"), + QObject::tr("The mod author didn't provide a website link for this mod."), QMessageBox::Warning); } } diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp index 00b3b1fd..b90434b0 100644 --- a/gui/dialogs/SettingsDialog.cpp +++ b/gui/dialogs/SettingsDialog.cpp @@ -284,6 +284,9 @@ void SettingsDialog::refreshUpdateChannelDesc() void SettingsDialog::applySettings(SettingsObject *s) { + // Language + s->set("Language", ui->languageBox->itemData(ui->languageBox->currentIndex()).toLocale().bcp47Name()); + // Updates s->set("AutoUpdate", ui->autoUpdateCheckBox->isChecked()); s->set("UpdateChannel", m_currentUpdateChannel); @@ -365,6 +368,19 @@ void SettingsDialog::applySettings(SettingsObject *s) void SettingsDialog::loadSettings(SettingsObject *s) { + // Language + ui->languageBox->clear(); + ui->languageBox->addItem(tr("English"), QLocale(QLocale::English)); + foreach(const QString & lang, + QDir(MMC->root() + "/translations").entryList(QStringList() << "*.qm", QDir::Files)) + { + QLocale locale(lang.section(QRegExp("[_\.]"), 1)); + ui->languageBox->addItem( + QLocale::languageToString(locale.language()), + locale); + } + ui->languageBox->setCurrentIndex(ui->languageBox->findData(QLocale(s->get("Language").toString()))); + // Updates ui->autoUpdateCheckBox->setChecked(s->get("AutoUpdate").toBool()); m_currentUpdateChannel = s->get("UpdateChannel").toString(); diff --git a/gui/dialogs/SettingsDialog.ui b/gui/dialogs/SettingsDialog.ui index b95b3c8c..54e7db7a 100644 --- a/gui/dialogs/SettingsDialog.ui +++ b/gui/dialogs/SettingsDialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>526</width> - <height>723</height> + <width>545</width> + <height>609</height> </rect> </property> <property name="sizePolicy"> @@ -35,83 +35,47 @@ <property name="currentIndex"> <number>0</number> </property> - <widget class="QWidget" name="generalTab"> + <widget class="QWidget" name="featuresTab"> <attribute name="title"> - <string>General</string> + <string>Features</string> </attribute> - <layout class="QVBoxLayout" name="verticalLayout"> + <layout class="QVBoxLayout" name="verticalLayout_9"> <item> - <widget class="QGroupBox" name="sortingModeBox"> - <property name="enabled"> - <bool>true</bool> - </property> + <widget class="QGroupBox" name="updateSettingsBox"> <property name="title"> - <string>Sorting Mode</string> + <string>Update Settings</string> </property> - <layout class="QHBoxLayout" name="sortingModeBoxLayout"> + <layout class="QVBoxLayout" name="verticalLayout_7"> <item> - <widget class="QRadioButton" name="sortLastLaunchedBtn"> + <widget class="QCheckBox" name="autoUpdateCheckBox"> <property name="text"> - <string>By last launched</string> + <string>Check for updates when MultiMC starts?</string> </property> - <attribute name="buttonGroup"> - <string notr="true">sortingModeGroup</string> - </attribute> </widget> </item> <item> - <widget class="QRadioButton" name="sortByNameBtn"> + <widget class="QLabel" name="updateChannelLabel"> <property name="text"> - <string>By name</string> + <string>Update Channel:</string> </property> - <attribute name="buttonGroup"> - <string notr="true">sortingModeGroup</string> - </attribute> </widget> </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="updateSettingsBox"> - <property name="title"> - <string>Update Settings</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_7"> <item> - <widget class="QCheckBox" name="autoUpdateCheckBox"> - <property name="text"> - <string>Check for updates when MultiMC starts?</string> + <widget class="QComboBox" name="updateChannelComboBox"> + <property name="enabled"> + <bool>false</bool> </property> </widget> </item> <item> - <layout class="QVBoxLayout" name="channelVerticalLayout"> - <item> - <widget class="QLabel" name="updateChannelLabel"> - <property name="text"> - <string>Update Channel:</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="updateChannelComboBox"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="updateChannelDescLabel"> - <property name="text"> - <string>No channel selected.</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> + <widget class="QLabel" name="updateChannelDescLabel"> + <property name="text"> + <string>No channel selected.</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> </item> </layout> </widget> @@ -281,6 +245,78 @@ </widget> </item> <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <widget class="QWidget" name="generalTab"> + <attribute name="title"> + <string>User Interface</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <layout class="QGridLayout" name="_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Language (needs restart):</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="languageBox"/> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="sortingModeBox"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="title"> + <string>Sorting Mode</string> + </property> + <layout class="QHBoxLayout" name="sortingModeBoxLayout"> + <item> + <widget class="QRadioButton" name="sortLastLaunchedBtn"> + <property name="text"> + <string>By last launched</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">sortingModeGroup</string> + </attribute> + </widget> + </item> + <item> + <widget class="QRadioButton" name="sortByNameBtn"> + <property name="text"> + <string>By name</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">sortingModeGroup</string> + </attribute> + </widget> + </item> + </layout> + </widget> + </item> + <item> <widget class="QGroupBox" name="editorsBox"> <property name="title"> <string>External Editors (leave empty for system default)</string> @@ -427,165 +463,6 @@ </item> </layout> </widget> - <widget class="QWidget" name="networkTab"> - <property name="toolTip"> - <string>Network settings.</string> - </property> - <attribute name="title"> - <string>Network</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QGroupBox" name="proxySettingsBox"> - <property name="title"> - <string>Proxy</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <item> - <widget class="QGroupBox" name="proxyTypeBox"> - <property name="title"> - <string>Type</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QRadioButton" name="proxyDefaultBtn"> - <property name="toolTip"> - <string>Uses your system's default proxy settings.</string> - </property> - <property name="text"> - <string>Default</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">proxyGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="proxyNoneBtn"> - <property name="text"> - <string>None</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">proxyGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="proxySOCKS5Btn"> - <property name="text"> - <string>SOCKS5</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">proxyGroup</string> - </attribute> - </widget> - </item> - <item> - <widget class="QRadioButton" name="proxyHTTPBtn"> - <property name="text"> - <string>HTTP</string> - </property> - <attribute name="buttonGroup"> - <string notr="true">proxyGroup</string> - </attribute> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="proxyAddrBox"> - <property name="title"> - <string>Address and Port</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLineEdit" name="proxyAddrEdit"> - <property name="placeholderText"> - <string>127.0.0.1</string> - </property> - </widget> - </item> - <item> - <widget class="QSpinBox" name="proxyPortEdit"> - <property name="alignment"> - <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> - </property> - <property name="buttonSymbols"> - <enum>QAbstractSpinBox::PlusMinus</enum> - </property> - <property name="maximum"> - <number>65535</number> - </property> - <property name="value"> - <number>8080</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="proxyAuthBox"> - <property name="title"> - <string>Authentication</string> - </property> - <layout class="QGridLayout" name="gridLayout_5"> - <item row="0" column="1"> - <widget class="QLineEdit" name="proxyUserEdit"/> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="proxyUsernameLabel"> - <property name="text"> - <string>Username:</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="proxyPasswordLabel"> - <property name="text"> - <string>Password:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QLineEdit" name="proxyPassEdit"> - <property name="echoMode"> - <enum>QLineEdit::Password</enum> - </property> - </widget> - </item> - <item row="2" column="0" colspan="2"> - <widget class="QLabel" name="proxyPlainTextWarningLabel"> - <property name="text"> - <string>Note: Proxy username and password are stored in plain text inside MultiMC's configuration file!</string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> <widget class="QWidget" name="javaTab"> <attribute name="title"> <string>Java</string> @@ -827,6 +704,165 @@ </item> </layout> </widget> + <widget class="QWidget" name="networkTab"> + <property name="toolTip"> + <string>Network settings.</string> + </property> + <attribute name="title"> + <string>Network</string> + </attribute> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <item> + <widget class="QGroupBox" name="proxySettingsBox"> + <property name="title"> + <string>Proxy</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <item> + <widget class="QGroupBox" name="proxyTypeBox"> + <property name="title"> + <string>Type</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QRadioButton" name="proxyDefaultBtn"> + <property name="toolTip"> + <string>Uses your system's default proxy settings.</string> + </property> + <property name="text"> + <string>Default</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">proxyGroup</string> + </attribute> + </widget> + </item> + <item> + <widget class="QRadioButton" name="proxyNoneBtn"> + <property name="text"> + <string>None</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">proxyGroup</string> + </attribute> + </widget> + </item> + <item> + <widget class="QRadioButton" name="proxySOCKS5Btn"> + <property name="text"> + <string>SOCKS5</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">proxyGroup</string> + </attribute> + </widget> + </item> + <item> + <widget class="QRadioButton" name="proxyHTTPBtn"> + <property name="text"> + <string>HTTP</string> + </property> + <attribute name="buttonGroup"> + <string notr="true">proxyGroup</string> + </attribute> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="proxyAddrBox"> + <property name="title"> + <string>Address and Port</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <item> + <widget class="QLineEdit" name="proxyAddrEdit"> + <property name="placeholderText"> + <string>127.0.0.1</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="proxyPortEdit"> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="buttonSymbols"> + <enum>QAbstractSpinBox::PlusMinus</enum> + </property> + <property name="maximum"> + <number>65535</number> + </property> + <property name="value"> + <number>8080</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="proxyAuthBox"> + <property name="title"> + <string>Authentication</string> + </property> + <layout class="QGridLayout" name="gridLayout_5"> + <item row="0" column="1"> + <widget class="QLineEdit" name="proxyUserEdit"/> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="proxyUsernameLabel"> + <property name="text"> + <string>Username:</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="proxyPasswordLabel"> + <property name="text"> + <string>Password:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QLineEdit" name="proxyPassEdit"> + <property name="echoMode"> + <enum>QLineEdit::Password</enum> + </property> + </widget> + </item> + <item row="2" column="0" colspan="2"> + <widget class="QLabel" name="proxyPlainTextWarningLabel"> + <property name="text"> + <string>Note: Proxy username and password are stored in plain text inside MultiMC's configuration file!</string> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> </widget> </item> <item> @@ -845,20 +881,6 @@ <tabstop>buttonBox</tabstop> <tabstop>sortLastLaunchedBtn</tabstop> <tabstop>sortByNameBtn</tabstop> - <tabstop>autoUpdateCheckBox</tabstop> - <tabstop>trackFtbBox</tabstop> - <tabstop>ftbLauncherBox</tabstop> - <tabstop>ftbLauncherBrowseBtn</tabstop> - <tabstop>ftbBox</tabstop> - <tabstop>ftbBrowseBtn</tabstop> - <tabstop>instDirTextBox</tabstop> - <tabstop>instDirBrowseBtn</tabstop> - <tabstop>modsDirTextBox</tabstop> - <tabstop>modsDirBrowseBtn</tabstop> - <tabstop>lwjglDirTextBox</tabstop> - <tabstop>lwjglDirBrowseBtn</tabstop> - <tabstop>iconsDirTextBox</tabstop> - <tabstop>iconsDirBrowseBtn</tabstop> <tabstop>jsonEditorTextBox</tabstop> <tabstop>jsonEditorBrowseBtn</tabstop> <tabstop>maximizedCheckBox</tabstop> @@ -916,7 +938,7 @@ </connection> </connections> <buttongroups> - <buttongroup name="sortingModeGroup"/> <buttongroup name="proxyGroup"/> + <buttongroup name="sortingModeGroup"/> </buttongroups> </ui> |