Skip to content

Commit 7ead88f

Browse files
Add text label to the file loading window
1 parent 32837ed commit 7ead88f

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

src/GUI/LoadFromTheFileWindow.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <QFileDialog>
66
#include <QLineEdit>
77
#include <QFontMetrics>
8+
#include <QLabel>
89

910
#include "../NameOfExt.hpp"
1011
#include "LoadFromTheFileWindow.hpp"
@@ -16,6 +17,8 @@ LoadFromTheFileWindow::LoadFromTheFileWindow(QWidget* parent) : QWidget(parent)
1617
QPushButton* btnCancel = new QPushButton(tr("BACK"));
1718
QHBoxLayout* ltBtnOk = new QHBoxLayout();
1819
QHBoxLayout* ltBtnCancel = new QHBoxLayout();
20+
QLabel* lblSelectFile = new QLabel(tr("Select .csf file:"));
21+
1922
btnOk->setObjectName(nameof(btnOk));
2023
btnOk->setFixedWidth(80);
2124
ltBtnOk->setAlignment(Qt::Alignment::enum_type::AlignRight);
@@ -29,6 +32,9 @@ LoadFromTheFileWindow::LoadFromTheFileWindow(QWidget* parent) : QWidget(parent)
2932
connect(btnOk, &QPushButton::clicked, this, [=, this] { emit btnStartClicked(); });
3033
connect(btnCancel, &QPushButton::clicked, this, [=, this] { emit btnBackClicked(); });
3134

35+
lblSelectFile->setObjectName(nameof(lblSelectFile));
36+
lblSelectFile->setAlignment(Qt::AlignLeft);
37+
3238
// configure file path selection
3339
QLineEdit* lneFilePath = new QLineEdit();
3440
lneFilePath->setObjectName(nameof(lneFilePath));
@@ -57,14 +63,16 @@ LoadFromTheFileWindow::LoadFromTheFileWindow(QWidget* parent) : QWidget(parent)
5763
ltReview->addWidget(btnReview);
5864

5965
// configure dialog view
60-
QVBoxLayout* ltMainBlock = new QVBoxLayout();
61-
ltMainBlock->setContentsMargins(80,0,80,0);
62-
ltMainBlock->setAlignment(Qt::Alignment::enum_type::AlignCenter);
63-
ltMainBlock->addStretch(5);
64-
ltMainBlock->addLayout(ltReview);
65-
ltMainBlock->addStretch(2);
66-
ltMainBlock->addLayout(ltOkAndCancel);
67-
ltMainBlock->addStretch(1);
66+
QVBoxLayout* ltMain = new QVBoxLayout();
67+
ltMain->setContentsMargins(80,0,80,0);
68+
ltMain->setAlignment(Qt::Alignment::enum_type::AlignCenter);
69+
ltMain->addStretch(3);
70+
ltMain->addWidget(lblSelectFile);
71+
ltMain->addSpacing(5);
72+
ltMain->addLayout(ltReview);
73+
ltMain->addStretch(2);
74+
ltMain->addLayout(ltOkAndCancel);
75+
ltMain->addStretch(1);
6876

69-
setLayout(ltMainBlock);
77+
setLayout(ltMain);
7078
}

src/GUI/Translations/ru.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@
199199
<context>
200200
<name>LoadFromTheFileWindow</name>
201201
<message>
202-
<location filename="../LoadFromTheFileWindow.cpp" line="15"/>
202+
<location filename="../LoadFromTheFileWindow.cpp" line="16"/>
203203
<source>START</source>
204204
<translation>НАЧАТЬ</translation>
205205
</message>
206206
<message>
207-
<location filename="../LoadFromTheFileWindow.cpp" line="16"/>
207+
<location filename="../LoadFromTheFileWindow.cpp" line="17"/>
208208
<source>BACK</source>
209209
<translation>НАЗАД</translation>
210210
</message>
@@ -213,17 +213,22 @@
213213
<translation type="obsolete">Текстовые файлы</translation>
214214
</message>
215215
<message>
216-
<location filename="../LoadFromTheFileWindow.cpp" line="44"/>
216+
<location filename="../LoadFromTheFileWindow.cpp" line="20"/>
217+
<source>Select .csf file:</source>
218+
<translation>Выберите .csf файл:</translation>
219+
</message>
220+
<message>
221+
<location filename="../LoadFromTheFileWindow.cpp" line="50"/>
217222
<source>Binary files</source>
218223
<translation>Двоичные файлы</translation>
219224
</message>
220225
<message>
221-
<location filename="../LoadFromTheFileWindow.cpp" line="45"/>
226+
<location filename="../LoadFromTheFileWindow.cpp" line="51"/>
222227
<source>Any files</source>
223228
<translation>Все файлы</translation>
224229
</message>
225230
<message>
226-
<location filename="../LoadFromTheFileWindow.cpp" line="49"/>
231+
<location filename="../LoadFromTheFileWindow.cpp" line="55"/>
227232
<source>REVIEW</source>
228233
<translation>ОБЗОР</translation>
229234
</message>

0 commit comments

Comments
 (0)