nuclear@1: #include nuclear@0: #include "mainwin.h" nuclear@0: #include "ui_mainwin.h" nuclear@0: nuclear@0: MainWin::MainWin(QWidget *parent) : nuclear@0: QMainWindow(parent), nuclear@0: ui(new Ui::MainWin) nuclear@0: { nuclear@0: ui->setupUi(this); nuclear@0: } nuclear@0: nuclear@0: MainWin::~MainWin() nuclear@0: { nuclear@0: delete ui; nuclear@0: } nuclear@0: nuclear@0: void MainWin::on_bn_p1_reset_clicked() nuclear@0: { nuclear@0: ui->spin_p1_life->setValue(20); nuclear@0: } nuclear@0: nuclear@0: void MainWin::on_bn_p2_reset_clicked() nuclear@0: { nuclear@0: ui->spin_p2_life->setValue(20); nuclear@0: } nuclear@0: nuclear@0: void MainWin::on_bn_p1_inc10_clicked() nuclear@0: { nuclear@0: ui->spin_p1_life->setValue(ui->spin_p1_life->value() + 10); nuclear@0: } nuclear@0: nuclear@0: void MainWin::on_bn_p1_dec10_clicked() nuclear@0: { nuclear@0: ui->spin_p1_life->setValue(ui->spin_p1_life->value() - 10); nuclear@0: } nuclear@0: nuclear@0: void MainWin::on_bn_p2_inc10_clicked() nuclear@0: { nuclear@0: ui->spin_p2_life->setValue(ui->spin_p2_life->value() + 10); nuclear@0: } nuclear@0: nuclear@0: void MainWin::on_bn_p2_dec10_clicked() nuclear@0: { nuclear@0: ui->spin_p2_life->setValue(ui->spin_p2_life->value() - 10); nuclear@0: } nuclear@1: nuclear@1: void MainWin::on_action_reset_triggered() nuclear@1: { nuclear@1: on_bn_p1_reset_clicked(); nuclear@1: on_bn_p2_reset_clicked(); nuclear@1: } nuclear@1: nuclear@1: void MainWin::on_action_quit_triggered() nuclear@1: { nuclear@1: QApplication::quit(); nuclear@1: } nuclear@1: nuclear@1: void MainWin::on_action_about_triggered() nuclear@1: { nuclear@1: static const char *about_text = nuclear@1: "simple_mtglife is an extremely simple and lightweight life counter " nuclear@1: "for magic: the gathering.\n" nuclear@1: "\n" nuclear@1: "Copyright (C) 2015 John Tsiombikas \n" nuclear@1: "http://nuclear.mutantstargoat.com\n" nuclear@1: "\n" nuclear@1: "This program is free software. Feel free to copy, modify, and " nuclear@1: "distribute copies of this application, under the terms of the " nuclear@1: "GNU General Public License version 3 (or any later version)."; nuclear@1: QMessageBox::about(this, "About simple_mtglife", about_text); nuclear@1: }