Skip to content

Commit 050ec71

Browse files
Refactoring slots names
1 parent cdd8673 commit 050ec71

File tree

3 files changed

+39
-33
lines changed

3 files changed

+39
-33
lines changed

src/GUI/HotkeysMainWindow.cpp

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,17 @@ HotkeysMainWindow::HotkeysMainWindow(const QVariant& configuration, QWidget* par
164164
void HotkeysMainWindow::ConfigureMenu()
165165
{
166166
QMenu* mnFileOptions = new QMenu(tr("File"));
167-
mnFileOptions->addAction(tr("Open"));
168-
mnFileOptions->addAction(tr("Save"));
169-
mnFileOptions->addAction(tr("Save As..."));
170-
mnFileOptions->addAction(tr("Special"));
167+
QAction* actOpen = new QAction(tr("Open"));
168+
QAction* actSave = new QAction(tr("Save"));
169+
QAction* actSaveAs = new QAction(tr("Save As..."));
170+
QAction* actSpecial = new QAction(tr("Special"));
171+
mnFileOptions->addAction(actOpen);
172+
mnFileOptions->addAction(actSave);
173+
mnFileOptions->addAction(actSaveAs);
174+
mnFileOptions->addAction(actSpecial);
171175
menuBar()->addMenu(mnFileOptions);
172-
connect(mnFileOptions, &QMenu::triggered, this, &HotkeysMainWindow::mnFileOptions_triggered);
176+
177+
connect(actSave, &QAction::triggered, this, &HotkeysMainWindow::actSave_triggered);
173178

174179
QMenu* mnViewOptions = new QMenu(tr("View"));
175180
QMenu* mnStatusBarChecbox = new QMenu(tr("Status Bar"));
@@ -182,11 +187,11 @@ void HotkeysMainWindow::ConfigureMenu()
182187
menuBar()->addMenu(mnSettingsOptions);
183188

184189
QAction* actLanguage = new QAction(tr("Language"));
185-
connect(actLanguage, &QAction::triggered, this, &HotkeysMainWindow::OnLanguageChange);
190+
connect(actLanguage, &QAction::triggered, this, &HotkeysMainWindow::actLanguage_triggered);
186191
mnSettingsOptions->addAction(actLanguage);
187192

188193
QAction* actAbout = new QAction(tr("About"));
189-
connect(actAbout, &QAction::triggered, this, &HotkeysMainWindow::OnAbout);
194+
connect(actAbout, &QAction::triggered, this, &HotkeysMainWindow::actAbout_triggered);
190195
mnSettingsOptions->addAction(actAbout);
191196
}
192197

@@ -429,7 +434,7 @@ void HotkeysMainWindow::SetActionHotkey(const QString& fctShortName, const QStri
429434
}
430435
}
431436

432-
void HotkeysMainWindow::OnAbout()
437+
void HotkeysMainWindow::actAbout_triggered()
433438
{
434439
// if dialog already exists
435440
if (pAboutDialog != nullptr)
@@ -484,7 +489,7 @@ void HotkeysMainWindow::OnAbout()
484489
pAboutDialog->activateWindow();
485490
}
486491

487-
void HotkeysMainWindow::OnLanguageChange()
492+
void HotkeysMainWindow::actLanguage_triggered()
488493
{
489494
// if dialog already exists
490495
if (pWindowToChangeLanguage != nullptr)
@@ -571,9 +576,11 @@ QHBoxLayout* HotkeysMainWindow::CreateKeysOnKeyboard(const QString& str)
571576
return pKeys;
572577
}
573578

574-
void HotkeysMainWindow::mnFileOptions_triggered(QAction* option)
579+
void HotkeysMainWindow::actSave_triggered()
575580
{
576-
LOGMSG("mnFileOptions has been triggered // option text = " + option->text());
581+
LOGMSG("Saving changes to .csf file...");
582+
CSF_PARSER->Save();
583+
LOGMSG("Changes has been saved");
577584
}
578585

579586
void HotkeysMainWindow::Save()

src/GUI/HotkeysMainWindow.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ class HotkeysMainWindow final : public QMainWindow
6060
void Save();
6161

6262
private slots:
63-
void OnAbout();
64-
void OnLanguageChange();
6563
void UpdateKeyboardStatus(int id = 0);
66-
67-
void mnFileOptions_triggered(QAction* option);
64+
void actAbout_triggered();
65+
void actLanguage_triggered();
66+
void actSave_triggered();
6867

6968
signals:
7069
Languages languageChanged(int index);

src/GUI/Translations/ru.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,88 +139,88 @@
139139
<translation>Дополнительно</translation>
140140
</message>
141141
<message>
142-
<location filename="../HotkeysMainWindow.cpp" line="174"/>
142+
<location filename="../HotkeysMainWindow.cpp" line="179"/>
143143
<source>View</source>
144144
<translation>Вид</translation>
145145
</message>
146146
<message>
147-
<location filename="../HotkeysMainWindow.cpp" line="175"/>
147+
<location filename="../HotkeysMainWindow.cpp" line="180"/>
148148
<source>Status Bar</source>
149149
<translation>Строка состояния</translation>
150150
</message>
151151
<message>
152-
<location filename="../HotkeysMainWindow.cpp" line="176"/>
152+
<location filename="../HotkeysMainWindow.cpp" line="181"/>
153153
<source>Enable</source>
154154
<translation>Включить</translation>
155155
</message>
156156
<message>
157-
<location filename="../HotkeysMainWindow.cpp" line="177"/>
157+
<location filename="../HotkeysMainWindow.cpp" line="182"/>
158158
<source>Disable</source>
159159
<translation>Отключить</translation>
160160
</message>
161161
<message>
162-
<location filename="../HotkeysMainWindow.cpp" line="181"/>
162+
<location filename="../HotkeysMainWindow.cpp" line="186"/>
163163
<source>Settings</source>
164164
<translation>Настройки</translation>
165165
</message>
166166
<message>
167-
<location filename="../HotkeysMainWindow.cpp" line="184"/>
167+
<location filename="../HotkeysMainWindow.cpp" line="189"/>
168168
<source>Language</source>
169169
<translation>Язык</translation>
170170
</message>
171171
<message>
172-
<location filename="../HotkeysMainWindow.cpp" line="188"/>
173-
<location filename="../HotkeysMainWindow.cpp" line="466"/>
172+
<location filename="../HotkeysMainWindow.cpp" line="193"/>
173+
<location filename="../HotkeysMainWindow.cpp" line="471"/>
174174
<source>About</source>
175175
<translation>О программе</translation>
176176
</message>
177177
<message>
178-
<location filename="../HotkeysMainWindow.cpp" line="319"/>
178+
<location filename="../HotkeysMainWindow.cpp" line="324"/>
179179
<source>Layout %1</source>
180180
<translation>Раскладка %1</translation>
181181
</message>
182182
<message>
183-
<location filename="../HotkeysMainWindow.cpp" line="446"/>
183+
<location filename="../HotkeysMainWindow.cpp" line="451"/>
184184
<source>Authors: </source>
185185
<translation>Авторы: </translation>
186186
</message>
187187
<message>
188-
<location filename="../HotkeysMainWindow.cpp" line="447"/>
188+
<location filename="../HotkeysMainWindow.cpp" line="452"/>
189189
<source>Version: </source>
190190
<translation>Версия: </translation>
191191
</message>
192192
<message>
193-
<location filename="../HotkeysMainWindow.cpp" line="448"/>
193+
<location filename="../HotkeysMainWindow.cpp" line="453"/>
194194
<source>Program licensed with </source>
195195
<translation>Программа лицензирована под </translation>
196196
</message>
197197
<message>
198-
<location filename="../HotkeysMainWindow.cpp" line="449"/>
198+
<location filename="../HotkeysMainWindow.cpp" line="454"/>
199199
<source>GitHub repository:</source>
200200
<translation>Репозиторий на GitHub:</translation>
201201
</message>
202202
<message>
203-
<location filename="../HotkeysMainWindow.cpp" line="451"/>
203+
<location filename="../HotkeysMainWindow.cpp" line="456"/>
204204
<source>Support development:</source>
205205
<translation>Поддержать разработку:</translation>
206206
</message>
207207
<message>
208-
<location filename="../HotkeysMainWindow.cpp" line="500"/>
208+
<location filename="../HotkeysMainWindow.cpp" line="505"/>
209209
<source>Lanugage</source>
210210
<translation>Язык</translation>
211211
</message>
212212
<message>
213-
<location filename="../HotkeysMainWindow.cpp" line="509"/>
213+
<location filename="../HotkeysMainWindow.cpp" line="514"/>
214214
<source>LANGUAGE</source>
215215
<translation>ЯЗЫК</translation>
216216
</message>
217217
<message>
218-
<location filename="../HotkeysMainWindow.cpp" line="521"/>
218+
<location filename="../HotkeysMainWindow.cpp" line="526"/>
219219
<source>OK</source>
220220
<translation>Ок</translation>
221221
</message>
222222
<message>
223-
<location filename="../HotkeysMainWindow.cpp" line="522"/>
223+
<location filename="../HotkeysMainWindow.cpp" line="527"/>
224224
<source>Cancel</source>
225225
<translation>Отмена</translation>
226226
</message>

0 commit comments

Comments
 (0)