Browse Source

Finished about box.

Neal Wilson 11 years ago
parent
commit
cdb78d9fa4
5 changed files with 948 additions and 775 deletions
  1. 29
    4
      src/abouttypica.cpp
  2. 5
    0
      src/abouttypica.h
  3. 31
    0
      src/abouttypica.w
  4. 112
    0
      src/resources/html/about.html
  5. 771
    771
      src/typica.cpp

+ 29
- 4
src/abouttypica.cpp View File

@@ -1,10 +1,10 @@
1 1
 /*224:*/
2
-#line 31 "./abouttypica.w"
2
+#line 36 "./abouttypica.w"
3 3
 
4 4
 #include "abouttypica.h"
5 5
 
6 6
 /*225:*/
7
-#line 40 "./abouttypica.w"
7
+#line 45 "./abouttypica.w"
8 8
 
9 9
 AboutTypica::AboutTypica():QMainWindow(NULL)
10 10
 {
@@ -15,12 +15,37 @@ QWebView*banner= new QWebView;
15 15
 banner->setHtml(content,QUrl("qrc:/resources/html/about.html"));
16 16
 aboutFile.close();
17 17
 setCentralWidget(banner);
18
+QWebPage*page= banner->page();
19
+page->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
20
+connect(page,SIGNAL(linkClicked(QUrl)),this,SLOT(linkClicked(QUrl)));
18 21
 }
19 22
 
23
+/*:225*//*226:*/
24
+#line 63 "./abouttypica.w"
25
+
26
+void AboutTypica::linkClicked(const QUrl&url)
27
+{
28
+if(url.scheme()=="typica")
29
+{
30
+QString address(url.toEncoded());
31
+if(address=="typica://aboutqt")
32
+{
33
+QMessageBox::aboutQt(this);
34
+}
35
+else
36
+{
37
+qDebug()<<"Unexpected link. Got: "<<address;
38
+}
39
+}
40
+else
41
+{
42
+QDesktopServices::openUrl(url);
43
+}
44
+}
20 45
 #line 5656 "./typica.w"
21 46
 
22
-/*:225*/
23
-#line 34 "./abouttypica.w"
47
+/*:226*/
48
+#line 39 "./abouttypica.w"
24 49
 
25 50
 
26 51
 /*:224*/

+ 5
- 0
src/abouttypica.h View File

@@ -4,6 +4,9 @@
4 4
 #include <QMainWindow> 
5 5
 #include <QWebView> 
6 6
 #include <QFile> 
7
+#include <QtDebug> 
8
+#include <QMessageBox> 
9
+#include <QDesktopServices> 
7 10
 
8 11
 #ifndef AboutTypicaHeader
9 12
 #define AboutTypicaHeader
@@ -13,6 +16,8 @@ class AboutTypica:public QMainWindow
13 16
 Q_OBJECT
14 17
 public:
15 18
 AboutTypica();
19
+public slots:
20
+void linkClicked(const QUrl&url);
16 21
 };
17 22
 
18 23
 #endif

+ 31
- 0
src/abouttypica.w View File

@@ -13,6 +13,9 @@ browser or email client.
13 13
 #include <QMainWindow>
14 14
 #include <QWebView>
15 15
 #include <QFile>
16
+#include <QtDebug>
17
+#include <QMessageBox>
18
+#include <QDesktopServices>
16 19
 
17 20
 #ifndef AboutTypicaHeader
18 21
 #define AboutTypicaHeader
@@ -22,6 +25,8 @@ class AboutTypica : public QMainWindow
22 25
 	Q_OBJECT
23 26
 	public:
24 27
 		AboutTypica();
28
+	public slots:
29
+		void linkClicked(const QUrl &url);
25 30
 };
26 31
 
27 32
 #endif
@@ -47,5 +52,31 @@ AboutTypica::AboutTypica() : QMainWindow(NULL)
47 52
  	banner->setHtml(content, QUrl("qrc:/resources/html/about.html"));
48 53
 	aboutFile.close();
49 54
 	setCentralWidget(banner);
55
+	QWebPage *page = banner->page();
56
+	page->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
57
+	connect(page, SIGNAL(linkClicked(QUrl)), this, SLOT(linkClicked(QUrl)));
50 58
 }
51 59
 
60
+@ In order to display the About Qt window, we detect a special URL from a link
61
+clicked in the about box.
62
+
63
+@<AboutTypica implementation@>=
64
+void AboutTypica::linkClicked(const QUrl &url)
65
+{
66
+	if(url.scheme() == "typica")
67
+	{
68
+		QString address(url.toEncoded());
69
+		if(address == "typica://aboutqt")
70
+		{
71
+			QMessageBox::aboutQt(this);
72
+		}
73
+		else
74
+		{
75
+			qDebug() << "Unexpected link. Got: " << address;
76
+		}
77
+	}
78
+	else
79
+	{
80
+		QDesktopServices::openUrl(url);
81
+	}
82
+}

+ 112
- 0
src/resources/html/about.html View File

@@ -14,6 +14,118 @@
14 14
 				</div>
15 15
 			<div id="maintext">
16 16
 				<p>Copyright &copy; 2007&ndash;2013 Neal Evan Wilson</p>
17
+				<h3>Special Thanks</h3>
18
+				<p>Ongoing development of Typica is made possible through the
19
+				generous financial contributions from the following:</p>
20
+				
21
+				<p>Pinnacle Coffee Roasting</p>
22
+				
23
+				<h3>Get Involved</h3>
24
+				<p>Typica has reached a point in its development where it can
25
+				be considered mature with a feature set appropriate for many
26
+				coffee roasting firms. There is, however, considerable variety
27
+				among roasting firms in the equipment used, roasting styles,
28
+				process traceability requirements, languages understood, and
29
+				other preferences. There is also still considerable room for
30
+				improvement in many areas. The development of Typica has been
31
+				on a budget of approximately $0, but software development is
32
+				not without cost. This is especially the case for cross
33
+				platform development of software that interfaces with external
34
+				hardware. These are some of the things that could be done with
35
+				additional funding:
36
+					<ul>
37
+						<li>Improve development and testing infrastructure.
38
+						This would allow more complete testing of release
39
+						candidates on all platforms and greatly increase the
40
+						quality and speed at which new releases could be made
41
+						available.</li>
42
+						<li>Purchase additional measurement devices. Interest
43
+						has been expressed in using many types of hardware not
44
+						currently supported in Typica. Some of these
45
+						suggestions are quite reasonable and the only reason I
46
+						am not able to include support for them is simply that
47
+						I do not have a sample of the hardware to test my code
48
+						against.</li>
49
+						<li>Pay for web hosting. While the Internet allows
50
+						free software to be distributed cheaply, this is not
51
+						without cost.</li>
52
+						<li>Allow more development time. As of this writing,
53
+						nobody has contributed any improvements to Typica's
54
+						program code. This has all been designed and written
55
+						by a single person working on it as time is available.
56
+						Many of the planned improvements require nothing beyond
57
+						time to plan an implementation, to write the program
58
+						code, to integrate it with the rest of the program, and
59
+						to test that the feature is sound. With sufficient
60
+						sustained funding it would be possible to devote more
61
+						time to continuing development, resulting in a more
62
+						rapid release of features and other improvements to
63
+						Typica.</li>
64
+					</ul>
65
+				</p>
66
+				<p>Financial assistance toward these ends can be sent (checks
67
+				payable in US dollars preferred) to:</p>
68
+				<p>Neal Wilson<br />
69
+				c/o Wilson's Coffee &amp; Tea<br />
70
+				3306 Washington Ave.<br />
71
+				Racine, WI 53405<br />
72
+				USA</p>
73
+				<p>All who contribute in this way will be thanked in the
74
+				Special Thanks section seen above in the next public release,
75
+				so please indicate if you would like to be identified by your
76
+				name, your company name, or in some other way. Anonymous
77
+				funding can also be made through <a href="https://www.gittip.com/N3Roaster/">Gittip</a>.</p>
78
+				<script data-gittip-username="N3Roaster" src="http://www.gittip.com/assets/widgets/0002.js"></script>
79
+				<h3>License Information</h3>
80
+				<p>Permission is hereby granted, free of charge, to any person
81
+				obtaining a copy of this software and associated documentation
82
+				files (the "Software"), to deal in the Software without
83
+				restriction, including without limitation the rights to use,
84
+				copy, modify, merge, publish, distribute, sublicense, and/or
85
+				sell copies of the Software, and to permit persons to whom the
86
+				Software is furnished to do so, subject to the following
87
+				conditions:</p>
88
+				<p>The above copyright notice and this permission notice shall
89
+				be included in all copies or substantial portions of the
90
+				Software.</p>
91
+				<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
92
+				KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
93
+				WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
94
+				AND NONNIFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
95
+				HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
96
+				WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
97
+				FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
98
+				OTHER DEALINGS IN THE SOFTWARE.</p>
99
+				<p>Parts of Typica are from
100
+				<a href="http://code.google.com/p/qextserialport/">QextSerialPort</a>
101
+				which is used under the MIT license as follows:</p>
102
+				<p>Copyright &copy; 2000&ndash;2003 Wayne Roth</p>
103
+				<p>Copyright &copy; 2004&ndash;2007 Stefan Sander</p>
104
+				<p>Copyright &copy; 2007 Michal Policht</p>
105
+				<p>Copyright &copy; 2008 Brandon Fosdick</p>
106
+				<p>Copyright &copy; 2009-2010 Liam Staskawicz</p>
107
+				<p>Copyright &copy; 2011 Debao Zhang</p>
108
+				<p>Permission is hereby granted, free of charge, to any person
109
+				obtaining a copy of this software and associated documentation
110
+				files (the "Software"), to deal in the Software without
111
+				restriction, including without limitation the rights to use,
112
+				copy, modify, merge, publish, distribute, sublicense, and/or
113
+				sell copies of the Software, and to permit persons to whom the
114
+				Software is furnished to do so, subject to the following
115
+				conditions:</p>
116
+				<p>The above copyright notice and this permission notice shall
117
+				be included in all copies or substantial portions of the
118
+				Software.</p>
119
+				<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
120
+				KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
121
+				WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
122
+				AND NONNIFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
123
+				HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
124
+				WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
125
+				FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
126
+				OTHER DEALINGS IN THE SOFTWARE.</p>
127
+				<p>Typica also makes use of the <a href="typica://aboutqt">Qt</a>
128
+				framework.</p>
17 129
 			</div>
18 130
 		</div>
19 131
 	</body>

+ 771
- 771
src/typica.cpp
File diff suppressed because it is too large
View File


Loading…
Cancel
Save