From ecd1a4ddad4b6ad8032c5c5a59b64db74ddd38f1 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 19 Jan 2020 18:03:36 -0500 Subject: Added closing function --- main.cpp | 2 +- player.cpp | 6 ++++++ player.h | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 7968eff..bc83fdc 100644 --- a/main.cpp +++ b/main.cpp @@ -5,7 +5,7 @@ int main(int argc, char *argv[]) { - std::cout << "Starting AleePlayer...\n"; + std::cout << "AleePlayer: A music player by Alee Productions. Licensed with GPL-3.0\n"; QApplication a(argc, argv); Player musicPlayer; musicPlayer.show(); diff --git a/player.cpp b/player.cpp index 121d5e0..9513423 100644 --- a/player.cpp +++ b/player.cpp @@ -1,3 +1,4 @@ +#include #include "player.h" #include "ui_player.h" @@ -13,3 +14,8 @@ Player::~Player() delete ui; } +void Player::on_actionQuit_triggered() +{ + std::cout << "Closing AleePlayer...\n"; + close(); +} diff --git a/player.h b/player.h index aaa5a5d..e9f1c71 100644 --- a/player.h +++ b/player.h @@ -15,6 +15,11 @@ public: Player(QWidget *parent = nullptr); ~Player(); +private slots: + void on_actionQuit_toggled(bool arg1); + + void on_actionQuit_triggered(); + private: Ui::Player *ui; }; -- cgit v1.2.3