Skip to content

Commit 99ee543

Browse files
Rename GretingWidget to GreetingWindow
1 parent b8b12a4 commit 99ee543

File tree

6 files changed

+54
-35
lines changed

6 files changed

+54
-35
lines changed

src/GUI/GreetingWidget.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "ImageManager.hpp"
1212
#include "GreetingWidget.hpp"
1313

14-
GreetingWidget::GreetingWidget(QWidget* parent) : QWidget(parent)
14+
GreetingWindow::GreetingWindow(QWidget* parent) : QWidget(parent)
1515
{
1616
QPushButton* btnNewProject = nullptr;
1717
QPushButton* btnLoadProject = nullptr;
@@ -28,15 +28,15 @@ GreetingWidget::GreetingWidget(QWidget* parent) : QWidget(parent)
2828
btnNewProject->setObjectName(nameof(btnNewProject));
2929
connect(btnNewProject, &QPushButton::clicked, this, [this](bool)
3030
{
31-
emit pressed(GreetingWidget::StandartButtons::NewProject);
31+
emit pressed(GreetingWindow::StandartButtons::NewProject);
3232
});
3333

3434
btnLoadProject = new QPushButton(tr("LOAD") + '\n' + tr("PROJECT"));
3535
btnLoadProject->setFixedSize(PROGRAM_CONSTANTS->START_BUTTON_SIZE);
3636
btnLoadProject->setObjectName(nameof(btnLoadProject));
3737
connect(btnLoadProject, &QPushButton::clicked, this, [this](bool)
3838
{
39-
emit pressed(GreetingWidget::StandartButtons::LoadProject);
39+
emit pressed(GreetingWindow::StandartButtons::LoadProject);
4040
});
4141

4242
lblLanguage = new QLabel(tr("LANGUAGE"));
@@ -48,15 +48,15 @@ GreetingWidget::GreetingWidget(QWidget* parent) : QWidget(parent)
4848
cmbLangList->addItem(Unsorted::GetLanguageFullName(static_cast<Languages>(i)));
4949
cmbLangList->setCurrentIndex(static_cast<int>(WINDOW_MANAGER->GetLanguage()));
5050
cmbLangList->setCurrentText(PROGRAM_CONSTANTS->LANGUAGES_STRINGS.value(WINDOW_MANAGER->GetLanguage()).second);
51-
connect(cmbLangList, QOverload<int>::of(&QComboBox::activated), this, &GreetingWidget::languageChanged);
51+
connect(cmbLangList, QOverload<int>::of(&QComboBox::activated), this, &GreetingWindow::languageChanged);
5252

5353
QPushButton* btnSettings = new QPushButton();
5454
QPixmap pxmSettings = QPixmap{PROGRAM_CONSTANTS->GEARS_ICON_FILE};
5555
btnSettings->setObjectName(nameof(btnSettings));
5656
btnSettings->setIcon(pxmSettings);
5757
btnSettings->setIconSize(pxmSettings.size());
5858
btnSettings->setFixedSize(pxmSettings.size());
59-
connect(btnSettings, &QPushButton::clicked, this, &GreetingWidget::btnSettings_Clicked);
59+
connect(btnSettings, &QPushButton::clicked, this, &GreetingWindow::btnSettings_Clicked);
6060

6161
ltLanguages = new QVBoxLayout();
6262
ltLanguages->addStretch(1);
@@ -86,7 +86,7 @@ GreetingWidget::GreetingWidget(QWidget* parent) : QWidget(parent)
8686
}
8787

8888
/// @brief Calculate size of long description text block.
89-
int GreetingWidget::GetGreetingTextAverageSize(const QString& text) const
89+
int GreetingWindow::GetGreetingTextAverageSize(const QString& text) const
9090
{
9191
QLabel lblSizeCounting(text);
9292
lblSizeCounting.setWordWrap(true);

src/GUI/GreetingWidget.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <QWidget>
33
#include "../ProgramConstants.hpp"
44

5-
class GreetingWidget : public QWidget
5+
class GreetingWindow : public QWidget
66
{
77
Q_OBJECT
88
public: // Data
@@ -13,12 +13,12 @@ class GreetingWidget : public QWidget
1313
};
1414

1515
public: // Methods
16-
GreetingWidget(QWidget* parent = nullptr);
16+
GreetingWindow(QWidget* parent = nullptr);
1717
private:
1818
int GetGreetingTextAverageSize(const QString& text) const;
1919

2020
signals:
21-
void pressed(GreetingWidget::StandartButtons standartButton);
21+
void pressed(GreetingWindow::StandartButtons standartButton);
2222
void languageChanged(int index);
2323
void btnSettings_Clicked();
2424
};

src/GUI/LaunchWidget.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ LaunchWidget::LaunchWidget(QWidget* parent) : QStackedWidget(parent)
2020

2121
void LaunchWidget::AttachConnections()
2222
{
23-
connect(pGreetingWidget, &GreetingWidget::languageChanged,
23+
connect(pGreetingWidget, &GreetingWindow::languageChanged,
2424
this, &LaunchWidget::GreetingWidget_LanguageChanged);
2525

26-
connect(pGreetingWidget, &GreetingWidget::pressed,
26+
connect(pGreetingWidget, &GreetingWindow::pressed,
2727
this, &LaunchWidget::BtnNewProjectOrBtnLoadProject_Clicked);
2828

2929
connect(pLoadDialog, &LoadDialog::btnBackClicked,
@@ -38,10 +38,10 @@ void LaunchWidget::AttachConnections()
3838

3939
void LaunchWidget::DetachConnections()
4040
{
41-
disconnect(pGreetingWidget, &GreetingWidget::languageChanged,
41+
disconnect(pGreetingWidget, &GreetingWindow::languageChanged,
4242
this, &LaunchWidget::GreetingWidget_LanguageChanged);
4343

44-
disconnect(pGreetingWidget, &GreetingWidget::pressed,
44+
disconnect(pGreetingWidget, &GreetingWindow::pressed,
4545
this, &LaunchWidget::BtnNewProjectOrBtnLoadProject_Clicked);
4646

4747
disconnect(pLoadDialog, &LoadDialog::btnBackClicked,
@@ -56,7 +56,7 @@ void LaunchWidget::DetachConnections()
5656

5757
void LaunchWidget::AddWidgets()
5858
{
59-
pGreetingWidget = new GreetingWidget(this);
59+
pGreetingWidget = new GreetingWindow(this);
6060
pCreationDialog = new CreationDialog(pGreetingWidget);
6161
pLoadDialog = new LoadDialog(pGreetingWidget);
6262

@@ -85,14 +85,14 @@ void LaunchWidget::GreetingWidget_LanguageChanged(int intLngIndex)
8585
setCurrentWidget(pGreetingWidget);
8686
}
8787

88-
void LaunchWidget::BtnNewProjectOrBtnLoadProject_Clicked(GreetingWidget::StandartButtons standartButton)
88+
void LaunchWidget::BtnNewProjectOrBtnLoadProject_Clicked(GreetingWindow::StandartButtons standartButton)
8989
{
9090
switch (standartButton)
9191
{
92-
case GreetingWidget::StandartButtons::NewProject:
92+
case GreetingWindow::StandartButtons::NewProject:
9393
setCurrentWidget(pCreationDialog);
9494
break;
95-
case GreetingWidget::StandartButtons::LoadProject:
95+
case GreetingWindow::StandartButtons::LoadProject:
9696
setCurrentWidget(pLoadDialog);
9797
break;
9898
default:

src/GUI/LaunchWidget.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class LaunchWidget final : public QStackedWidget
88
{
99
Q_OBJECT
1010
private: // Data
11-
GreetingWidget* pGreetingWidget = nullptr;
11+
GreetingWindow* pGreetingWidget = nullptr;
1212
CreationDialog* pCreationDialog = nullptr;
1313
LoadDialog* pLoadDialog = nullptr;
1414

@@ -21,16 +21,16 @@ class LaunchWidget final : public QStackedWidget
2121
LaunchWidget(QWidget* parent = nullptr);
2222

2323
private:
24-
/// @brief Initialize `GreetingWidget`, `CreationDialog`, `LoadDialog`.
24+
/// @brief Initialize `GreetingWindow`, `CreationDialog`, `LoadDialog`.
2525
void AddWidgets();
2626

2727
private slots:
28-
/// @brief Show `GreetingWidget`, if button `Back` has been clicked.
28+
/// @brief Show `GreetingWindow`, if button `Back` has been clicked.
2929
void BtnBack_Clicked();
3030
/// @brief Change language by its index if language has been changed via select list.
3131
void GreetingWidget_LanguageChanged(int intLngIndex);
3232
/// @brief Open create/loader widget if start button has been clicked.
33-
void BtnNewProjectOrBtnLoadProject_Clicked(GreetingWidget::StandartButtons standartButton);
33+
void BtnNewProjectOrBtnLoadProject_Clicked(GreetingWindow::StandartButtons standartButton);
3434
/// @brief Returns checked configuration of user preferences.
3535
void CreationDialog_AcceptConfiguration();
3636
};

src/GUI/Theme/Styles.css

+6-6
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,22 @@ QPushButton
7777
border-radius: 3px;
7878
}
7979

80-
GreetingWidget QPushButton#btnSettings
80+
GreetingWindow QPushButton#btnSettings
8181
{
8282
border-color: transparent;
8383
background-color: transparent;
8484
}
8585

86-
GreetingWidget QPushButton { font-size: 18pt; }
86+
GreetingWindow QPushButton { font-size: 18pt; }
8787

88-
GreetingWidget QLabel, LoadDialog QLabel, CreationDialog QLabel,
89-
GreetingWidget QRadioButton, LoadDialog QRadioButton, CreationDialog QRadioButton,
90-
GreetingWidget QCheckBox, LoadDialog QCheckBox, CreationDialog QCheckBox
88+
GreetingWindow QLabel, LoadDialog QLabel, CreationDialog QLabel,
89+
GreetingWindow QRadioButton, LoadDialog QRadioButton, CreationDialog QRadioButton,
90+
GreetingWindow QCheckBox, LoadDialog QCheckBox, CreationDialog QCheckBox
9191
{
9292
color: white;
9393
}
9494

95-
GreetingWidget QPushButton:hover, LoadDialog QPushButton:hover, CreationDialog QPushButton:hover
95+
GreetingWindow QPushButton:hover, LoadDialog QPushButton:hover, CreationDialog QPushButton:hover
9696
{
9797
background-color: #3543e7;
9898
color: #baff0c;

src/GUI/Translations/ru.ts

+27-8
Original file line numberDiff line numberDiff line change
@@ -90,30 +90,49 @@
9090
<source>LOAD PROJECT</source>
9191
<translation type="vanished">ЗАГРУЗИТЬ ПРОЕКТ</translation>
9292
</message>
93+
<message>
94+
<source>NEW</source>
95+
<translation type="vanished">НОВЫЙ</translation>
96+
</message>
97+
<message>
98+
<source>PROJECT</source>
99+
<translation type="vanished">ПРОЕКТ</translation>
100+
</message>
101+
<message>
102+
<source>LOAD</source>
103+
<translation type="vanished">ЗАГРУЗИТЬ</translation>
104+
</message>
105+
<message>
106+
<source>LANGUAGE</source>
107+
<translation type="vanished">ЯЗЫК</translation>
108+
</message>
109+
<message>
110+
<source>Greetings, %username%. You have launched the hotkey editing program for the game Command and Conquer: Generals and Command and Conquer: Generals — Zero Hour. At the moment, the program supports in test mode only the creation of hotkey maps based on pre-prepared hotkeys. We hope that you will like the program.</source>
111+
<translation type="vanished">Приветствую тебя, %username%. Ты запустил программу редактирования горячих клавиш для игры Command and Conquer: Generals и Command and Conquer: Generals — Zero Hour. На текущий момент программа поддерживает в тестовом режиме только создание карт горячих клавиш на основе заранее подготовленных горячих клавиш. Надеемся, что программа тебе понравится.</translation>
112+
</message>
113+
</context>
114+
<context>
115+
<name>GreetingWindow</name>
93116
<message>
94117
<location filename="../GreetingWidget.cpp" line="26"/>
95118
<source>NEW</source>
96-
<translation>НОВЫЙ</translation>
119+
<translation type="unfinished">НОВЫЙ</translation>
97120
</message>
98121
<message>
99122
<location filename="../GreetingWidget.cpp" line="26"/>
100123
<location filename="../GreetingWidget.cpp" line="34"/>
101124
<source>PROJECT</source>
102-
<translation>ПРОЕКТ</translation>
125+
<translation type="unfinished">ПРОЕКТ</translation>
103126
</message>
104127
<message>
105128
<location filename="../GreetingWidget.cpp" line="34"/>
106129
<source>LOAD</source>
107-
<translation>ЗАГРУЗИТЬ</translation>
130+
<translation type="unfinished">ЗАГРУЗИТЬ</translation>
108131
</message>
109132
<message>
110133
<location filename="../GreetingWidget.cpp" line="42"/>
111134
<source>LANGUAGE</source>
112-
<translation>ЯЗЫК</translation>
113-
</message>
114-
<message>
115-
<source>Greetings, %username%. You have launched the hotkey editing program for the game Command and Conquer: Generals and Command and Conquer: Generals — Zero Hour. At the moment, the program supports in test mode only the creation of hotkey maps based on pre-prepared hotkeys. We hope that you will like the program.</source>
116-
<translation type="vanished">Приветствую тебя, %username%. Ты запустил программу редактирования горячих клавиш для игры Command and Conquer: Generals и Command and Conquer: Generals — Zero Hour. На текущий момент программа поддерживает в тестовом режиме только создание карт горячих клавиш на основе заранее подготовленных горячих клавиш. Надеемся, что программа тебе понравится.</translation>
135+
<translation type="unfinished">ЯЗЫК</translation>
117136
</message>
118137
</context>
119138
<context>

0 commit comments

Comments
 (0)