Correctly set up the about dialog.

This commit is contained in:
Glenn Y. Rolland 2012-08-02 12:19:11 +02:00
parent 79e4cf6dd1
commit 0d118ad844
3 changed files with 28 additions and 15 deletions

View file

@ -2,6 +2,7 @@ module Qasim
APP_ICON_PATH = File.join QASIM_DATA_DIR, "icons" APP_ICON_PATH = File.join QASIM_DATA_DIR, "icons"
APP_NAME = "Qasim" APP_NAME = "Qasim"
APP_VERSION = "0.1" APP_VERSION = "0.1"
APP_DATE = "2012-08-02"
APP_SYSCONFIG_DIR = "/etc/qasim/maps.d" APP_SYSCONFIG_DIR = "/etc/qasim/maps.d"

View file

@ -8,7 +8,18 @@ module Qasim ; module Ui
u = Ui_About.new u = Ui_About.new
u.setup_ui(self) u.setup_ui(self)
#FIXME: attach events to close #FIXME: attach button events to dialog.close
# 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(
"About",
"<html><head/><body><p><span style=\" font-size:11pt; font-weight:600;\">#{title_str}" +
"</span></p></body></html>",
nil,
Qt::Application::UnicodeUTF8
)
#FIXME: set first tab #FIXME: set first tab
end end
end end

View file

@ -18,21 +18,21 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="vertical_layout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontal_layout">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="icon_label">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap resource="../../../qasim.qrc">:/qasim/icons/qasim.svg</pixmap> <pixmap resource="../qasim.qrc">:/qasim/qasim-icon</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="titleLabel"> <widget class="QLabel" name="title_label">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum"> <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -61,7 +61,7 @@
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="about_tab"> <widget class="QWidget" name="about_tab">
<attribute name="title"> <attribute name="title">
@ -69,7 +69,7 @@
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="about_label">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -83,7 +83,7 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;A cross playform SSHFS Mapping tool.&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Copyright © 2011-2012 The Qasim Team&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;http://github.com/Glenux/Qasim&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;http://github.com/Glenux/Qasim&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;A cross platform SSHFS Mapping tool.&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;Copyright © 2011-2012 The Qasim Team&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;http://github.com/Glenux/Qasim&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0057ae;&quot;&gt;http://github.com/Glenux/Qasim&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="scaledContents"> <property name="scaledContents">
<bool>false</bool> <bool>false</bool>
@ -101,7 +101,7 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QTextEdit" name="textEdit"> <widget class="QTextEdit" name="author_textedit">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -127,17 +127,17 @@ p, li { white-space: pre-wrap; }
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="QTextEdit" name="textEdit_2"/> <widget class="QTextEdit" name="thanks_textedit"/>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="license_tab">
<attribute name="title"> <attribute name="title">
<string>License</string> <string>License</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<widget class="QTextEdit" name="textEdit_3"> <widget class="QTextEdit" name="license_textedit">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>300</width> <width>300</width>
@ -162,7 +162,7 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="button_box">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -174,11 +174,12 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="../qasim.qrc"/>
<include location="../../../qasim.qrc"/> <include location="../../../qasim.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>
<sender>buttonBox</sender> <sender>button_box</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>About</receiver> <receiver>About</receiver>
<slot>close()</slot> <slot>close()</slot>