data: Move all UI text as resource files.
This commit is contained in:
parent
f2479e972e
commit
6dd4069abe
5 changed files with 54 additions and 13 deletions
7
data/text/authors.html
Normal file
7
data/text/authors.html
Normal 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
0
data/text/thanks.html
Normal 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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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><html><head/><body><p><span style=" font-size:11pt; font-weight:600;">Qasim vVERSION (DATE)</span></p></body></html></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 @@
|
|||
<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></string>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -149,8 +153,6 @@ p, li { white-space: pre-wrap; }
|
|||
<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:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">THE LICENCE&lt;resource type=&quot;other&quot; file=&quot;:/qasim/LICENSE-GPL-3&quot;/&gt;</p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;resource type=&quot;other&quot; file=&quot;:/qasim/LICENSE-GPL-3&quot;/&gt;</p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
|
|
Loading…
Reference in a new issue