Bläddra i källkod

Display basic about information.

Neal Wilson 11 år sedan
förälder
incheckning
4487cf03cc
6 ändrade filer med 80 tillägg och 5 borttagningar
  1. 10
    4
      src/abouttypica.cpp
  2. 2
    0
      src/abouttypica.h
  3. 9
    1
      src/abouttypica.w
  4. 3
    0
      src/resources.qrc
  5. 20
    0
      src/resources/html/about.html
  6. 36
    0
      src/resources/html/style.css

+ 10
- 4
src/abouttypica.cpp Visa fil

@@ -1,20 +1,26 @@
1 1
 /*224:*/
2
-#line 29 "./abouttypica.w"
2
+#line 31 "./abouttypica.w"
3 3
 
4 4
 #include "abouttypica.h"
5 5
 
6 6
 /*225:*/
7
-#line 38 "./abouttypica.w"
7
+#line 40 "./abouttypica.w"
8 8
 
9 9
 AboutTypica::AboutTypica():QMainWindow(NULL)
10 10
 {
11
-
11
+QFile aboutFile(":/resources/html/about.html");
12
+aboutFile.open(QIODevice::ReadOnly);
13
+QByteArray content= aboutFile.readAll();
14
+QWebView*banner= new QWebView;
15
+banner->setHtml(content,QUrl("qrc:/resources/html/about.html"));
16
+aboutFile.close();
17
+setCentralWidget(banner);
12 18
 }
13 19
 
14 20
 #line 5656 "./typica.w"
15 21
 
16 22
 /*:225*/
17
-#line 32 "./abouttypica.w"
23
+#line 34 "./abouttypica.w"
18 24
 
19 25
 
20 26
 /*:224*/

+ 2
- 0
src/abouttypica.h Visa fil

@@ -2,6 +2,8 @@
2 2
 #line 12 "./abouttypica.w"
3 3
 
4 4
 #include <QMainWindow> 
5
+#include <QWebView> 
6
+#include <QFile> 
5 7
 
6 8
 #ifndef AboutTypicaHeader
7 9
 #define AboutTypicaHeader

+ 9
- 1
src/abouttypica.w Visa fil

@@ -11,6 +11,8 @@ browser or email client.
11 11
 
12 12
 @(abouttypica.h@>=
13 13
 #include <QMainWindow>
14
+#include <QWebView>
15
+#include <QFile>
14 16
 
15 17
 #ifndef AboutTypicaHeader
16 18
 #define AboutTypicaHeader
@@ -38,6 +40,12 @@ through a set of tabs.
38 40
 @<AboutTypica implementation@>=
39 41
 AboutTypica::AboutTypica() : QMainWindow(NULL)
40 42
 {
41
-
43
+	QFile aboutFile(":/resources/html/about.html");
44
+	aboutFile.open(QIODevice::ReadOnly);
45
+	QByteArray content = aboutFile.readAll();
46
+	QWebView *banner = new QWebView;
47
+ 	banner->setHtml(content, QUrl("qrc:/resources/html/about.html"));
48
+	aboutFile.close();
49
+	setCentralWidget(banner);
42 50
 }
43 51
 

+ 3
- 0
src/resources.qrc Visa fil

@@ -11,5 +11,8 @@
11 11
         <file>resources/icons/tango/scalable/actions/list-remove.svg</file>
12 12
         <file>resources/icons/tango/index.theme</file>
13 13
         <file>resources/icons/appicons/logo.svg</file>
14
+        <file>resources/icons/appicons/logo96.png</file>
15
+        <file>resources/html/about.html</file>
16
+        <file>resources/html/style.css</file>
14 17
     </qresource>
15 18
 </RCC>

+ 20
- 0
src/resources/html/about.html Visa fil

@@ -0,0 +1,20 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg.dtd">
2
+<html xmlns="http://www.w3.org/1999/xhtml">
3
+	<head>
4
+		<title>Typica - Data for Coffee Roasters</title>
5
+		<link rel="stylesheet" type="text/css" href="style.css" />
6
+	</head>
7
+	<body>
8
+		<div id="page">
9
+			<div id="topmatter">
10
+				<div id="topbanner">
11
+					<img src="../icons/appicons/logo96.png" height="96px" width="96px" alt="Typica logo" />
12
+					<h1>Typica</h1>
13
+					<h2>Version 1.5</h2>
14
+				</div>
15
+			<div id="maintext">
16
+				<p>Copyright &copy; 2007&ndash;2013 Neal Evan Wilson</p>
17
+			</div>
18
+		</div>
19
+	</body>
20
+</html>

+ 36
- 0
src/resources/html/style.css Visa fil

@@ -0,0 +1,36 @@
1
+body {
2
+	background-color: rgb(235,239,249);
3
+}
4
+#page {
5
+	background-color: rgb(255,255,255);
6
+}
7
+h1 {
8
+	font-size: 24px;
9
+}
10
+#topbanner {
11
+	background-color: rgb(235,239,249);
12
+	height: 96px;
13
+	margin-bottom: 2px;
14
+}
15
+#topbanner img {
16
+	float: left;
17
+}
18
+#topbanner h1 {
19
+	padding-top: 20px;
20
+	padding-bottom: 0px;
21
+	margin-bottom: 0px;
22
+}
23
+h2 {
24
+	font-size: 20px;
25
+	padding-top: 0px;
26
+	padding-bottom: 0px;
27
+	margin-top: 0px;
28
+}
29
+#topmatter {
30
+	background-color: rgb(235,239,249);
31
+}
32
+#maintext {
33
+	margin-left: 10px;
34
+	margin-right: 10px;
35
+	padding-bottom: 10px;
36
+}

Laddar…
Avbryt
Spara