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