simple_mtglife

view mainwin.cc @ 1:d76fb2ffe7f5

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