Skip to content

Commit

Permalink
Refactoring slots names
Browse files Browse the repository at this point in the history
  • Loading branch information
MahBoiDeveloper committed Feb 8, 2025
1 parent cdd8673 commit 050ec71
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 33 deletions.
29 changes: 18 additions & 11 deletions src/GUI/HotkeysMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,17 @@ HotkeysMainWindow::HotkeysMainWindow(const QVariant& configuration, QWidget* par
void HotkeysMainWindow::ConfigureMenu()
{
QMenu* mnFileOptions = new QMenu(tr("File"));
mnFileOptions->addAction(tr("Open"));
mnFileOptions->addAction(tr("Save"));
mnFileOptions->addAction(tr("Save As..."));
mnFileOptions->addAction(tr("Special"));
QAction* actOpen = new QAction(tr("Open"));
QAction* actSave = new QAction(tr("Save"));
QAction* actSaveAs = new QAction(tr("Save As..."));
QAction* actSpecial = new QAction(tr("Special"));
mnFileOptions->addAction(actOpen);
mnFileOptions->addAction(actSave);
mnFileOptions->addAction(actSaveAs);
mnFileOptions->addAction(actSpecial);
menuBar()->addMenu(mnFileOptions);
connect(mnFileOptions, &QMenu::triggered, this, &HotkeysMainWindow::mnFileOptions_triggered);

connect(actSave, &QAction::triggered, this, &HotkeysMainWindow::actSave_triggered);

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

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

QAction* actAbout = new QAction(tr("About"));
connect(actAbout, &QAction::triggered, this, &HotkeysMainWindow::OnAbout);
connect(actAbout, &QAction::triggered, this, &HotkeysMainWindow::actAbout_triggered);
mnSettingsOptions->addAction(actAbout);
}

Expand Down Expand Up @@ -429,7 +434,7 @@ void HotkeysMainWindow::SetActionHotkey(const QString& fctShortName, const QStri
}
}

void HotkeysMainWindow::OnAbout()
void HotkeysMainWindow::actAbout_triggered()
{
// if dialog already exists
if (pAboutDialog != nullptr)
Expand Down Expand Up @@ -484,7 +489,7 @@ void HotkeysMainWindow::OnAbout()
pAboutDialog->activateWindow();
}

void HotkeysMainWindow::OnLanguageChange()
void HotkeysMainWindow::actLanguage_triggered()
{
// if dialog already exists
if (pWindowToChangeLanguage != nullptr)
Expand Down Expand Up @@ -571,9 +576,11 @@ QHBoxLayout* HotkeysMainWindow::CreateKeysOnKeyboard(const QString& str)
return pKeys;
}

void HotkeysMainWindow::mnFileOptions_triggered(QAction* option)
void HotkeysMainWindow::actSave_triggered()
{
LOGMSG("mnFileOptions has been triggered // option text = " + option->text());
LOGMSG("Saving changes to .csf file...");
CSF_PARSER->Save();
LOGMSG("Changes has been saved");
}

void HotkeysMainWindow::Save()
Expand Down
7 changes: 3 additions & 4 deletions src/GUI/HotkeysMainWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ class HotkeysMainWindow final : public QMainWindow
void Save();

private slots:
void OnAbout();
void OnLanguageChange();
void UpdateKeyboardStatus(int id = 0);

void mnFileOptions_triggered(QAction* option);
void actAbout_triggered();
void actLanguage_triggered();
void actSave_triggered();

signals:
Languages languageChanged(int index);
Expand Down
36 changes: 18 additions & 18 deletions src/GUI/Translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,88 +139,88 @@
<translation>Дополнительно</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="174"/>
<location filename="../HotkeysMainWindow.cpp" line="179"/>
<source>View</source>
<translation>Вид</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="175"/>
<location filename="../HotkeysMainWindow.cpp" line="180"/>
<source>Status Bar</source>
<translation>Строка состояния</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="176"/>
<location filename="../HotkeysMainWindow.cpp" line="181"/>
<source>Enable</source>
<translation>Включить</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="177"/>
<location filename="../HotkeysMainWindow.cpp" line="182"/>
<source>Disable</source>
<translation>Отключить</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="181"/>
<location filename="../HotkeysMainWindow.cpp" line="186"/>
<source>Settings</source>
<translation>Настройки</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="184"/>
<location filename="../HotkeysMainWindow.cpp" line="189"/>
<source>Language</source>
<translation>Язык</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="188"/>
<location filename="../HotkeysMainWindow.cpp" line="466"/>
<location filename="../HotkeysMainWindow.cpp" line="193"/>
<location filename="../HotkeysMainWindow.cpp" line="471"/>
<source>About</source>
<translation>О программе</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="319"/>
<location filename="../HotkeysMainWindow.cpp" line="324"/>
<source>Layout %1</source>
<translation>Раскладка %1</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="446"/>
<location filename="../HotkeysMainWindow.cpp" line="451"/>
<source>Authors: </source>
<translation>Авторы: </translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="447"/>
<location filename="../HotkeysMainWindow.cpp" line="452"/>
<source>Version: </source>
<translation>Версия: </translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="448"/>
<location filename="../HotkeysMainWindow.cpp" line="453"/>
<source>Program licensed with </source>
<translation>Программа лицензирована под </translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="449"/>
<location filename="../HotkeysMainWindow.cpp" line="454"/>
<source>GitHub repository:</source>
<translation>Репозиторий на GitHub:</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="451"/>
<location filename="../HotkeysMainWindow.cpp" line="456"/>
<source>Support development:</source>
<translation>Поддержать разработку:</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="500"/>
<location filename="../HotkeysMainWindow.cpp" line="505"/>
<source>Lanugage</source>
<translation>Язык</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="509"/>
<location filename="../HotkeysMainWindow.cpp" line="514"/>
<source>LANGUAGE</source>
<translation>ЯЗЫК</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="521"/>
<location filename="../HotkeysMainWindow.cpp" line="526"/>
<source>OK</source>
<translation>Ок</translation>
</message>
<message>
<location filename="../HotkeysMainWindow.cpp" line="522"/>
<location filename="../HotkeysMainWindow.cpp" line="527"/>
<source>Cancel</source>
<translation>Отмена</translation>
</message>
Expand Down

0 comments on commit 050ec71

Please sign in to comment.