Skip to content

Commit 9849d77

Browse files
Add clearing of extra symbols for file input
1 parent fc8906d commit 9849d77

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

src/GUI/LoadFromTheFileWindow.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,24 @@ LoadFromTheFileWindow::LoadFromTheFileWindow(QWidget* parent) : QWidget(parent)
3838
QLineEdit* lneFilePath = new QLineEdit();
3939
lneFilePath->setObjectName(nameof(lneFilePath));
4040
lneFilePath->setMaximumWidth(700);
41+
connect(lneFilePath, &QLineEdit::textChanged, this, [=, this]
42+
{
43+
QString tmp = lneFilePath->text();
44+
45+
if (tmp.startsWith("file:///"))
46+
tmp.remove("file:///");
47+
48+
while (tmp.startsWith("\"") || tmp.endsWith("\""))
49+
{
50+
if (tmp.startsWith("\""))
51+
tmp.remove(0, 1);
52+
53+
if (tmp.endsWith("\""))
54+
tmp.remove(tmp.length() - 1, 1);
55+
}
56+
57+
lneFilePath->setText(tmp);
58+
});
4159

4260
QFont font(lneFilePath->font());
4361
font.setPointSize(font.pointSize()-2); // reduce standart font size

src/GUI/Translations/ru.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,17 @@
156156
<translation>Выберите .csf или .big файл:</translation>
157157
</message>
158158
<message>
159-
<location filename="../LoadFromTheFileWindow.cpp" line="49"/>
159+
<location filename="../LoadFromTheFileWindow.cpp" line="67"/>
160160
<source>Binary files</source>
161161
<translation>Двоичные файлы</translation>
162162
</message>
163163
<message>
164-
<location filename="../LoadFromTheFileWindow.cpp" line="50"/>
164+
<location filename="../LoadFromTheFileWindow.cpp" line="68"/>
165165
<source>Any files</source>
166166
<translation>Все файлы</translation>
167167
</message>
168168
<message>
169-
<location filename="../LoadFromTheFileWindow.cpp" line="53"/>
169+
<location filename="../LoadFromTheFileWindow.cpp" line="71"/>
170170
<source>REVIEW</source>
171171
<translation>ОБЗОР</translation>
172172
</message>
@@ -226,32 +226,30 @@
226226
<translation>Невозможно найти CSF файл внутри BIG архива &quot;%1&quot;</translation>
227227
</message>
228228
<message>
229-
<location filename="../../ProgramConstants.hpp" line="85"/>
230229
<source>Game files search error</source>
231-
<translation>Ошибка поиска по игровым файлам</translation>
230+
<translation type="vanished">Ошибка поиска по игровым файлам</translation>
232231
</message>
233232
<message>
234-
<location filename="../../ProgramConstants.hpp" line="86"/>
235233
<source>Unable to find &quot;EnglishZH.big&quot; archive in &quot;%1&quot; folder.</source>
236-
<translation>Невозможно найти &quot;EnglishZH.big&quot; в папке &quot;%1&quot;.</translation>
234+
<translation type="vanished">Невозможно найти &quot;EnglishZH.big&quot; в папке &quot;%1&quot;.</translation>
237235
</message>
238236
<message>
239-
<location filename="../../ProgramConstants.hpp" line="114"/>
237+
<location filename="../../ProgramConstants.hpp" line="112"/>
240238
<source>Buildings</source>
241239
<translation>Здания</translation>
242240
</message>
243241
<message>
244-
<location filename="../../ProgramConstants.hpp" line="115"/>
242+
<location filename="../../ProgramConstants.hpp" line="113"/>
245243
<source>Infantry</source>
246244
<translation>Пехота</translation>
247245
</message>
248246
<message>
249-
<location filename="../../ProgramConstants.hpp" line="116"/>
247+
<location filename="../../ProgramConstants.hpp" line="114"/>
250248
<source>Vehicles</source>
251249
<translation>Техника</translation>
252250
</message>
253251
<message>
254-
<location filename="../../ProgramConstants.hpp" line="117"/>
252+
<location filename="../../ProgramConstants.hpp" line="115"/>
255253
<source>Aircrafts</source>
256254
<translation>Авиация</translation>
257255
</message>

0 commit comments

Comments
 (0)