data: Move all UI text as resource files.

This commit is contained in:
Glenn Y. Rolland 2012-08-03 00:09:11 +02:00
parent f2479e972e
commit 6dd4069abe
5 changed files with 54 additions and 13 deletions

7
data/text/authors.html Normal file
View File

@ -0,0 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Glenn Y. Rolland</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> E-mail: <a href="mailto:glenux@glenux.net"><span style=" text-decoration: underline; color:#0057ae;">glenux@glenux.net</span></a></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Maintainer and Original Author</p></body></html>

0
data/text/thanks.html Normal file
View File

View File

@ -1,5 +1,7 @@
<RCC>
<qresource prefix="qasim">
<file alias="authors">../../data/text/authors.html</file>
<file alias="thanks">../../data/text/thanks.html</file>
<file alias="licence-gpl3">../../data/text/gpl-3.0-standalone.html</file>
<file alias="qasim-icon">../../data/icons/qasim.svg</file>
</qresource>

View File

@ -3,23 +3,53 @@ require 'qasim/ui/about_ui'
module Qasim ; module Ui
class About < Qt::Dialog
def initialize
def initialize(parent = nil)
super
u = Ui_About.new
u.setup_ui(self)
@ui = Ui_About.new
@ui.setup_ui(self)
#FIXME: attach button events to dialog.close
#Qt::Object.connect( w, SIGNAL( :clicked ), a, SLOT( :quit ) )
# Change title according to current version
title_str = "Qasim v%s (%s)" % [ Qasim::APP_VERSION, Qasim::APP_DATE ]
u.title_label.text = Qt::Application.translate(
@ui.title_label.text = Qt::Application.translate(
"About",
"<html><head/><body><p><span style=\" font-size:11pt; font-weight:600;\">#{title_str}" +
"</span></p></body></html>",
title_str,
nil,
Qt::Application::UnicodeUTF8
)
# Read Authors
file = Qt::File.new(':/qasim/authors')
if file.open(Qt::File::ReadOnly | Qt::File::Text)
stream = Qt::TextStream.new( file )
@ui.authors_textedit.text = stream.readAll()
file.close
else
# FIXME handle error on authors reading
end
# Read Thanks
file = Qt::File.new(':/qasim/thanks')
if file.open(Qt::File::ReadOnly | Qt::File::Text)
stream = Qt::TextStream.new( file )
@ui.thanks_textedit.text = stream.readAll()
file.close
else
# FIXME handle error on thanks reading
end
# Read License
file = Qt::File.new(':/qasim/licence-gpl3')
if file.open(Qt::File::ReadOnly | Qt::File::Text)
stream = Qt::TextStream.new( file )
@ui.license_textedit.text = stream.readAll()
file.close
else
# FIXME handle error on licence reading
end
#FIXME: set first tab
end
end

View File

@ -39,8 +39,14 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;Qasim vVERSION (DATE)&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>Qasim vVERSION (DATE)</string>
</property>
</widget>
</item>
@ -101,7 +107,7 @@
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QTextEdit" name="author_textedit">
<widget class="QTextEdit" name="authors_textedit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -113,9 +119,7 @@
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Glenn Y. Rolland&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; E-mail: &lt;a href=&quot;mailto:glenux@glenux.net&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;glenux@glenux.net&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; Maintainer and Original Author&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@ -149,8 +153,6 @@ p, li { white-space: pre-wrap; }
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;THE LICENCE&amp;lt;resource type=&amp;quot;other&amp;quot; file=&amp;quot;:/qasim/LICENSE-GPL-3&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&amp;lt;resource type=&amp;quot;other&amp;quot; file=&amp;quot;:/qasim/LICENSE-GPL-3&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>