annotate src/aboutwindow.cpp @ 295:0f345852b3ed

Bump copyright years.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 09 May 2023 13:18:38 +0300
parents 0644b1529d13
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
242
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 //
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 // Syntilista - debt list/management database program
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 // Programmed and designed by Matti Hämäläinen <ccr@tnsp.org>
295
0f345852b3ed Bump copyright years.
Matti Hamalainen <ccr@tnsp.org>
parents: 287
diff changeset
4 // (C) Copyright 2017-2023 Tecnic Software productions (TNSP)
242
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 //
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 // Distributed under 3-clause BSD style license, refer to
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 // included file "COPYING" for exact terms.
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 //
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 #include "main.h"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 #include "ui_aboutwindow.h"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 AboutWindow::AboutWindow(QWidget *parent) :
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 QDialog(parent),
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 ui(new Ui::AboutWindow)
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 {
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 ui->setupUi(this);
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
287
0644b1529d13 Use logo sized image instead of icon sized.
Matti Hamalainen <ccr@tnsp.org>
parents: 277
diff changeset
19 ui->label_Logo->setPixmap(QPixmap(QStringLiteral(":/logo")));
242
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 ui->label_Logo->setAlignment(Qt::AlignCenter);
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 ui->label_About->setOpenExternalLinks(true);
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 ui->label_About->setWordWrap(true);
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 ui->label_About->setTextFormat(Qt::RichText);
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 ui->label_About->setText(tr(
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 "<h1>%1 v%2</h1>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 "<p>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 "<b>Ohjelmoinut ja kehittänyt Matti Hämäläinen &lt;ccr@tnsp.org&gt;<br>"
295
0f345852b3ed Bump copyright years.
Matti Hamalainen <ccr@tnsp.org>
parents: 287
diff changeset
29 "(C) Copyright 2017-2023 Tecnic Software productions (TNSP)</b>"
242
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 "</p>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 "<p>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 "Kehitetty Raahen kaupungin Hanketoiminta ja Kehittäminen -yksikön "
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 "alaisuudessa Café Kampuksen käyttöön."
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 "</p>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 "<p>AppDataPath: <a href=\"file:///%3\">%3</a></p>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 ).
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 arg(tr(APP_NAME)).
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 arg(APP_VERSION).
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 arg(settings.dataPath)
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 );
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 ui->label_ShortCuts->setText(tr(
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 "<h1>Pikanäppäimet</h1>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 "<table>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 "<tr><td><b>F1</b></td><td>Tämä tietoikkuna</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 "<tr><td><b>CTRL + Q</b></td><td>Ohjelman lopetus</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 "<tr><td><b>CTRL + P</b></td><td>Henkilölistan tulostus/esikatselu</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 "<tr><td><b>CTRL + T</b></td><td>Tapahtumalistaikkuna</td></tr>"
277
d666f0bf5245 Fix help.
Matti Hamalainen <ccr@tnsp.org>
parents: 272
diff changeset
49 "<tr><td><b>CTRL + +</b></td><td>Suurenna ohjelman tekstejä/käyttöliittymää</td></tr>"
d666f0bf5245 Fix help.
Matti Hamalainen <ccr@tnsp.org>
parents: 272
diff changeset
50 "<tr><td><b>CTRL + -</b></td><td>Pienennä ohjelman tekstejä/käyttöliittymää</td></tr>"
272
d18f1a8cb4df Add alt+enter key shortcut for toggling fullscreen window.
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
51 "<tr><td><b>Alt + Enter</b></td><td>Vaihda kokoruudun tilaan tai pos</td></tr>"
242
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 "<tr></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 "<tr><td><b>Esc</b></td><td>Tyhjennä 'Etsi / suodata' kenttä ja siirry siihen</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 "<tr><td><b>CTRL + Enter</b></td><td>Siirry summan syöttökenttään</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 "<tr><td><b>Page Up</b></td><td>Siirry ylös henkilölistassa</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 "<tr><td><b>Page Down</b></td><td>Siirry alas henkilölistassa</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 "<tr></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 "<tr><td><b>F5</b></td><td>Lisää uusi henkilö</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 "<tr><td><b>F6</b></td><td>Muokkaa henkilöä</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 "<tr><td><b>F8</b></td><td>Poista henkilö</td></tr>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 "</table>"
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 ));
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 QFile fh(":/license");
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 if (fh.open(QIODevice::ReadOnly | QIODevice::Text))
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 {
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 QString text = "";
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 while (!fh.atEnd())
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 text += fh.readLine();
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 ui->text_License->setHtml(text);
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 fh.close();
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 }
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 ui->text_License->setOpenExternalLinks(true);
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 setModal(true);
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 setAttribute(Qt::WA_DeleteOnClose);
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 show();
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 activateWindow();
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 raise();
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81 setFocus();
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 }
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 AboutWindow::~AboutWindow()
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 {
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 delete ui;
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 }
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 void AboutWindow::on_button_Close_clicked()
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 {
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 close();
3d3ba5759cac Move about-window code to separate file.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94 }