simple_mtglife

annotate mainwin.cc @ 3:292c9a4b18d7

added hgignore
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 26 Jan 2015 06:03:12 +0200
parents 6321cfa2ad62
children 7cac97dca573
rev   line source
nuclear@1 1 #include <QMessageBox>
nuclear@0 2 #include "mainwin.h"
nuclear@0 3 #include "ui_mainwin.h"
nuclear@0 4
nuclear@0 5 MainWin::MainWin(QWidget *parent) :
nuclear@0 6 QMainWindow(parent),
nuclear@0 7 ui(new Ui::MainWin)
nuclear@0 8 {
nuclear@0 9 ui->setupUi(this);
nuclear@0 10 }
nuclear@0 11
nuclear@0 12 MainWin::~MainWin()
nuclear@0 13 {
nuclear@0 14 delete ui;
nuclear@0 15 }
nuclear@0 16
nuclear@0 17 void MainWin::on_bn_p1_reset_clicked()
nuclear@0 18 {
nuclear@0 19 ui->spin_p1_life->setValue(20);
nuclear@0 20 }
nuclear@0 21
nuclear@0 22 void MainWin::on_bn_p2_reset_clicked()
nuclear@0 23 {
nuclear@0 24 ui->spin_p2_life->setValue(20);
nuclear@0 25 }
nuclear@0 26
nuclear@0 27 void MainWin::on_bn_p1_inc10_clicked()
nuclear@0 28 {
nuclear@0 29 ui->spin_p1_life->setValue(ui->spin_p1_life->value() + 10);
nuclear@0 30 }
nuclear@0 31
nuclear@0 32 void MainWin::on_bn_p1_dec10_clicked()
nuclear@0 33 {
nuclear@0 34 ui->spin_p1_life->setValue(ui->spin_p1_life->value() - 10);
nuclear@0 35 }
nuclear@0 36
nuclear@0 37 void MainWin::on_bn_p2_inc10_clicked()
nuclear@0 38 {
nuclear@0 39 ui->spin_p2_life->setValue(ui->spin_p2_life->value() + 10);
nuclear@0 40 }
nuclear@0 41
nuclear@0 42 void MainWin::on_bn_p2_dec10_clicked()
nuclear@0 43 {
nuclear@0 44 ui->spin_p2_life->setValue(ui->spin_p2_life->value() - 10);
nuclear@0 45 }
nuclear@1 46
nuclear@1 47 void MainWin::on_action_reset_triggered()
nuclear@1 48 {
nuclear@1 49 on_bn_p1_reset_clicked();
nuclear@1 50 on_bn_p2_reset_clicked();
nuclear@1 51 }
nuclear@1 52
nuclear@1 53 void MainWin::on_action_quit_triggered()
nuclear@1 54 {
nuclear@1 55 QApplication::quit();
nuclear@1 56 }
nuclear@1 57
nuclear@1 58 void MainWin::on_action_about_triggered()
nuclear@1 59 {
nuclear@1 60 static const char *about_text =
nuclear@1 61 "simple_mtglife is an extremely simple and lightweight life counter "
nuclear@1 62 "for magic: the gathering.\n"
nuclear@1 63 "\n"
nuclear@1 64 "Copyright (C) 2015 John Tsiombikas <nuclear@member.fsf.org>\n"
nuclear@1 65 "http://nuclear.mutantstargoat.com\n"
nuclear@1 66 "\n"
nuclear@1 67 "This program is free software. Feel free to copy, modify, and "
nuclear@1 68 "distribute copies of this application, under the terms of the "
nuclear@1 69 "GNU General Public License version 3 (or any later version).";
nuclear@1 70 QMessageBox::about(this, "About simple_mtglife", about_text);
nuclear@1 71 }