mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix PlayerSettings conflicting names
This commit is contained in:
@@ -21,7 +21,7 @@ set(editor_SRCS
|
||||
mapsettings/rumorsettings.cpp
|
||||
mapsettings/translations.cpp
|
||||
PlayerSelectionDialog.cpp
|
||||
playersettings.cpp
|
||||
PlayerSettingsDialog.cpp
|
||||
playerparams.cpp
|
||||
scenelayer.cpp
|
||||
mapcontroller.cpp
|
||||
@@ -72,7 +72,7 @@ set(editor_HEADERS
|
||||
mapsettings/rumorsettings.h
|
||||
mapsettings/translations.h
|
||||
PlayerSelectionDialog.h
|
||||
playersettings.h
|
||||
PlayerSettingsDialog.h
|
||||
playerparams.h
|
||||
scenelayer.h
|
||||
mapcontroller.h
|
||||
@@ -116,7 +116,7 @@ set(editor_FORMS
|
||||
mapsettings/eventsettings.ui
|
||||
mapsettings/rumorsettings.ui
|
||||
mapsettings/translations.ui
|
||||
playersettings.ui
|
||||
PlayerSettingsDialog.ui
|
||||
playerparams.ui
|
||||
validator.ui
|
||||
inspector/townbuildingswidget.ui
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
*/
|
||||
|
||||
#include "StdInc.h"
|
||||
#include "playersettings.h"
|
||||
#include "ui_playersettings.h"
|
||||
#include "PlayerSettingsDialog.h"
|
||||
#include "ui_PlayerSettingsDialog.h"
|
||||
#include "playerparams.h"
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "../lib/mapping/CMap.h"
|
||||
|
||||
PlayerSettings::PlayerSettings(MapController & ctrl, QWidget *parent) :
|
||||
PlayerSettingsDialog::PlayerSettingsDialog(MapController & ctrl, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::PlayerSettings),
|
||||
ui(new Ui::PlayerSettingsDialog),
|
||||
controller(ctrl)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -48,13 +48,13 @@ PlayerSettings::PlayerSettings(MapController & ctrl, QWidget *parent) :
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
}
|
||||
|
||||
PlayerSettings::~PlayerSettings()
|
||||
PlayerSettingsDialog::~PlayerSettingsDialog()
|
||||
{
|
||||
controller.settingsDialog = nullptr;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void PlayerSettings::on_playersCount_currentIndexChanged(int index)
|
||||
void PlayerSettingsDialog::on_playersCount_currentIndexChanged(int index)
|
||||
{
|
||||
const auto selectedPlayerCount = index + 1;
|
||||
assert(selectedPlayerCount <= controller.map()->players.size());
|
||||
@@ -90,7 +90,7 @@ void PlayerSettings::on_playersCount_currentIndexChanged(int index)
|
||||
}
|
||||
|
||||
|
||||
void PlayerSettings::on_pushButton_clicked()
|
||||
void PlayerSettingsDialog::on_pushButton_clicked()
|
||||
{
|
||||
for(auto * w : paramWidgets)
|
||||
{
|
||||
@@ -14,16 +14,16 @@
|
||||
#include "playerparams.h"
|
||||
|
||||
namespace Ui {
|
||||
class PlayerSettings;
|
||||
class PlayerSettingsDialog;
|
||||
}
|
||||
|
||||
class PlayerSettings : public QDialog
|
||||
class PlayerSettingsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PlayerSettings(MapController & controller, QWidget *parent = nullptr);
|
||||
~PlayerSettings();
|
||||
explicit PlayerSettingsDialog(MapController & controller, QWidget *parent = nullptr);
|
||||
~PlayerSettingsDialog();
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -32,7 +32,7 @@ private slots:
|
||||
void on_pushButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::PlayerSettings *ui;
|
||||
Ui::PlayerSettingsDialog *ui;
|
||||
|
||||
std::vector<PlayerParams*> paramWidgets;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>PlayerSettings</class>
|
||||
<widget class="QDialog" name="PlayerSettings">
|
||||
<class>PlayerSettingsDialog</class>
|
||||
<widget class="QDialog" name="PlayerSettingsDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::WindowModal</enum>
|
||||
<enum>Qt::WindowModality::WindowModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
@@ -14,7 +14,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
<enum>Qt::FocusPolicy::NoFocus</enum>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Player settings</string>
|
||||
@@ -33,8 +33,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>628</width>
|
||||
<height>187</height>
|
||||
<width>634</width>
|
||||
<height>201</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "mapsettings/mapsettings.h"
|
||||
#include "mapsettings/translations.h"
|
||||
#include "mapsettings/modsettings.h"
|
||||
#include "playersettings.h"
|
||||
#include "PlayerSettingsDialog.h"
|
||||
#include "validator.h"
|
||||
#include "helper.h"
|
||||
#include "campaigneditor/campaigneditor.h"
|
||||
@@ -1143,7 +1143,7 @@ void MainWindow::on_actionMapSettings_triggered()
|
||||
|
||||
void MainWindow::on_actionPlayers_settings_triggered()
|
||||
{
|
||||
auto settingsDialog = new PlayerSettings(controller, this);
|
||||
auto settingsDialog = new PlayerSettingsDialog(controller, this);
|
||||
settingsDialog->setWindowModality(Qt::WindowModal);
|
||||
settingsDialog->setModal(true);
|
||||
connect(settingsDialog, &QDialog::finished, this, &MainWindow::onPlayersChanged);
|
||||
|
||||
@@ -18,6 +18,8 @@ namespace Ui {
|
||||
class PlayerParams;
|
||||
}
|
||||
|
||||
class QListWidgetItem;
|
||||
|
||||
class PlayerParams : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user