Update SettingsPanel.cpp and SettingsPanel.ui | remove useless settings
This commit is contained in:
@@ -44,54 +44,6 @@ namespace Noggit
|
|||||||
|
|
||||||
setWindowFlags(windowFlags() | Qt::Tool | Qt::WindowStaysOnTopHint);
|
setWindowFlags(windowFlags() | Qt::Tool | Qt::WindowStaysOnTopHint);
|
||||||
|
|
||||||
connect(ui->gamePathField, &QLineEdit::textChanged, [&](QString value)
|
|
||||||
{
|
|
||||||
_settings->setValue("project/game_path", value);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
connect(ui->gamePathField_browse, &QPushButton::clicked, [=]
|
|
||||||
{
|
|
||||||
auto result(QFileDialog::getExistingDirectory(
|
|
||||||
nullptr, "WoW Client Path", ui->gamePathField->text()));
|
|
||||||
|
|
||||||
if (!result.isNull())
|
|
||||||
{
|
|
||||||
if (!(result.endsWith("/") || result.endsWith("\\")))
|
|
||||||
{
|
|
||||||
result += "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->gamePathField->setText(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
connect(ui->clientPathField, &QLineEdit::textChanged, [&](QString value)
|
|
||||||
{
|
|
||||||
_settings->setValue("project/path", value);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
connect(ui->clientPathField_browse, &QPushButton::clicked, [=]
|
|
||||||
{
|
|
||||||
auto result(QFileDialog::getExistingDirectory(
|
|
||||||
nullptr, "Project Path", ui->clientPathField->text()));
|
|
||||||
|
|
||||||
if (!result.isNull())
|
|
||||||
{
|
|
||||||
if (!(result.endsWith("/") || result.endsWith("\\")))
|
|
||||||
{
|
|
||||||
result += "/";
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->clientPathField->setText(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
connect(ui->importPathField, &QLineEdit::textChanged, [&](QString value)
|
connect(ui->importPathField, &QLineEdit::textChanged, [&](QString value)
|
||||||
{
|
{
|
||||||
_settings->setValue("project/import_file", value);
|
_settings->setValue("project/import_file", value);
|
||||||
@@ -205,8 +157,6 @@ namespace Noggit
|
|||||||
|
|
||||||
void settings::discard_changes()
|
void settings::discard_changes()
|
||||||
{
|
{
|
||||||
ui->gamePathField->setText(_settings->value("project/game_path").toString());
|
|
||||||
ui->clientPathField->setText(_settings->value("project/path").toString());
|
|
||||||
ui->importPathField->setText(_settings->value("project/import_file", "import.txt").toString());
|
ui->importPathField->setText(_settings->value("project/import_file", "import.txt").toString());
|
||||||
ui->wmvLogPathField->setText(_settings->value("project/wmv_log_file").toString());
|
ui->wmvLogPathField->setText(_settings->value("project/wmv_log_file").toString());
|
||||||
ui->viewDistanceField->setValue(_settings->value("view_distance", 1000.f).toFloat());
|
ui->viewDistanceField->setValue(_settings->value("view_distance", 1000.f).toFloat());
|
||||||
@@ -269,8 +219,6 @@ namespace Noggit
|
|||||||
|
|
||||||
void settings::save_changes()
|
void settings::save_changes()
|
||||||
{
|
{
|
||||||
_settings->setValue("project/game_path", ui->gamePathField->text());
|
|
||||||
_settings->setValue("project/path", ui->clientPathField->text());
|
|
||||||
_settings->setValue("project/import_file", ui->importPathField->text());
|
_settings->setValue("project/import_file", ui->importPathField->text());
|
||||||
_settings->setValue("project/wmv_log_file", ui->wmvLogPathField->text());
|
_settings->setValue("project/wmv_log_file", ui->wmvLogPathField->text());
|
||||||
_settings->setValue("farZ", ui->farZField->value());
|
_settings->setValue("farZ", ui->farZField->value());
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="tabBarAutoHide">
|
<property name="tabBarAutoHide">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@@ -108,68 +108,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_21">
|
<layout class="QVBoxLayout" name="verticalLayout_21">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_24">
|
<layout class="QHBoxLayout" name="horizontalLayout_25"/>
|
||||||
<property name="spacing">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_25">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>90</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Game Path</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="gamePathField">
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="gamePathField_browse">
|
|
||||||
<property name="text">
|
|
||||||
<string>Browse</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_25">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_26">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>90</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Project Path</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="clientPathField"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="clientPathField_browse">
|
|
||||||
<property name="text">
|
|
||||||
<string>Browse</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_36">
|
<layout class="QHBoxLayout" name="horizontalLayout_36">
|
||||||
|
|||||||
Reference in New Issue
Block a user