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>
|
<RCC>
|
||||||
<qresource prefix="qasim">
|
<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="licence-gpl3">../../data/text/gpl-3.0-standalone.html</file>
|
||||||
<file alias="qasim-icon">../../data/icons/qasim.svg</file>
|
<file alias="qasim-icon">../../data/icons/qasim.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
|
|
@ -3,23 +3,53 @@ require 'qasim/ui/about_ui'
|
||||||
|
|
||||||
module Qasim ; module Ui
|
module Qasim ; module Ui
|
||||||
class About < Qt::Dialog
|
class About < Qt::Dialog
|
||||||
def initialize
|
def initialize(parent = nil)
|
||||||
super
|
super
|
||||||
u = Ui_About.new
|
@ui = Ui_About.new
|
||||||
u.setup_ui(self)
|
@ui.setup_ui(self)
|
||||||
|
|
||||||
#FIXME: attach button events to dialog.close
|
#FIXME: attach button events to dialog.close
|
||||||
|
#Qt::Object.connect( w, SIGNAL( :clicked ), a, SLOT( :quit ) )
|
||||||
|
|
||||||
# Change title according to current version
|
# Change title according to current version
|
||||||
title_str = "Qasim v%s (%s)" % [ Qasim::APP_VERSION, Qasim::APP_DATE ]
|
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",
|
"About",
|
||||||
"<html><head/><body><p><span style=\" font-size:11pt; font-weight:600;\">#{title_str}" +
|
title_str,
|
||||||
"</span></p></body></html>",
|
|
||||||
nil,
|
nil,
|
||||||
Qt::Application::UnicodeUTF8
|
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
|
#FIXME: set first tab
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,8 +39,14 @@
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -101,7 +107,7 @@
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextEdit" name="author_textedit">
|
<widget class="QTextEdit" name="authors_textedit">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -113,9 +119,7 @@
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
</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="-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>
|
||||||
<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>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -149,8 +153,6 @@ p, li { white-space: pre-wrap; }
|
||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
|
</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>
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
Loading…
Reference in a new issue