Okokokokokokokok
This commit is contained in:
@@ -1,20 +1,17 @@
|
||||
#include <MainWindow.hpp>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <MainWindow.hpp>
|
||||
|
||||
MainWindowController::MainWindowController() noexcept
|
||||
{
|
||||
MainWindowController::MainWindowController() noexcept {
|
||||
view.setupUi(this);
|
||||
ConnectSignalsToSlots();
|
||||
}
|
||||
|
||||
void MainWindowController::ConnectSignalsToSlots() noexcept
|
||||
{
|
||||
void MainWindowController::ConnectSignalsToSlots() noexcept {
|
||||
connect(view.actionOpen, &QAction::triggered, this, [this]() {
|
||||
QString file_name = QFileDialog::getOpenFileName(this);
|
||||
|
||||
if (!file_name.isEmpty())
|
||||
{
|
||||
if (!file_name.isEmpty()) {
|
||||
view.actionPause->setEnabled(true);
|
||||
view.actionReset->setEnabled(true);
|
||||
view.actionStop->setEnabled(true);
|
||||
@@ -24,24 +21,24 @@ void MainWindowController::ConnectSignalsToSlots() noexcept
|
||||
|
||||
connect(view.actionExit, &QAction::triggered, this, [this]() {
|
||||
emit Exit();
|
||||
});
|
||||
});
|
||||
|
||||
connect(view.actionReset, &QAction::triggered, this, [this]() {
|
||||
emit Reset();
|
||||
});
|
||||
});
|
||||
|
||||
connect(view.actionStop, &QAction::triggered, this, [this]() {
|
||||
view.actionPause->setDisabled(true);
|
||||
view.actionReset->setDisabled(true);
|
||||
view.actionStop->setDisabled(true);
|
||||
emit Stop();
|
||||
});
|
||||
});
|
||||
|
||||
connect(view.actionPause, &QAction::triggered, this, [this]() {
|
||||
textPauseToggle = !textPauseToggle;
|
||||
view.actionPause->setText(textPauseToggle ? "Resume" : "Pause");
|
||||
emit Pause();
|
||||
});
|
||||
});
|
||||
|
||||
connect(view.actionAbout, &QAction::triggered, this, [this]() {
|
||||
QMessageBox::about(
|
||||
@@ -50,5 +47,5 @@ void MainWindowController::ConnectSignalsToSlots() noexcept
|
||||
"experience and great compatibility.\n"
|
||||
"sliice is licensed under the BSD 3-clause license.\n"
|
||||
"Nintendo 64 is a registered trademarks of Nintendo Co., Ltd."));
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user