Finished about dialog.

This commit is contained in:
Glenn Y. Rolland 2012-08-03 01:52:14 +02:00
parent 6dd4069abe
commit 07c1ad7579
3 changed files with 26 additions and 34 deletions

View file

@ -162,9 +162,7 @@ module Qasim
act_about.setIconVisibleInMenu true
act_about.setEnabled true
act_about.connect(SIGNAL(:triggered)) do
puts "Show about dialog!"
dialog = Qasim::Ui::About.new
dialog.show
res = @about_dialog.show
end
@context_menu.addAction act_about;
@ -184,26 +182,30 @@ module Qasim
def build_interface
@app = Qt::Application.new(ARGV)
si = Qt::SystemTrayIcon.new
#Qt.debug_level = Qt::DebugLevel::High
#Qt.debug_level = Qt::DebugLevel::Extensive
@app.setQuitOnLastWindowClosed false
@main_win = Qt::MainWindow.new
@systray = Qt::SystemTrayIcon.new @main_win
@about_dialog = Qasim::Ui::About.new @main_win
std_icon = Qt::Icon.new( ":/qasim/qasim-icon" )
#std_icon = Qt::Icon.new( File.join APP_ICON_PATH, "qasim.svg" )
#std_icon = Qt::Icon.new
alt_icon = Qt::Icon.new
blinking = false
si.icon = std_icon
si.show
@systray.icon = std_icon
@systray.show
si.setToolTip("Qasim %s" % APP_VERSION);
@systray.setToolTip("Qasim %s" % APP_VERSION);
build_map_menu
build_context_menu
si.contextMenu = @context_menu
@systray.contextMenu = @context_menu
si.connect(SIGNAL('activated(QSystemTrayIcon::ActivationReason)')) do |reason|
@systray.connect(SIGNAL('activated(QSystemTrayIcon::ActivationReason)')) do |reason|
case reason
when Qt::SystemTrayIcon::Trigger then
build_map_menu

View file

@ -50,7 +50,9 @@ module Qasim ; module Ui
# FIXME handle error on licence reading
end
#FIXME: set first tab
# set first tab
@ui.tab_widget.setCurrentIndex(0)
end
end
end ; end

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<height>461</height>
<width>470</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
@ -53,19 +53,7 @@
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>300</height>
</size>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QTabWidget" name="tab_widget">
<property name="currentIndex">
<number>0</number>
</property>
@ -105,7 +93,7 @@
<attribute name="title">
<string>Authors</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<layout class="QVBoxLayout" name="_2">
<item>
<widget class="QTextEdit" name="authors_textedit">
<property name="sizePolicy">
@ -182,17 +170,17 @@ p, li { white-space: pre-wrap; }
<connections>
<connection>
<sender>button_box</sender>
<signal>accepted()</signal>
<signal>clicked(QAbstractButton*)</signal>
<receiver>About</receiver>
<slot>close()</slot>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>259</x>
<y>441</y>
<x>463</x>
<y>493</y>
</hint>
<hint type="destinationlabel">
<x>259</x>
<y>230</y>
<x>469</x>
<y>12</y>
</hint>
</hints>
</connection>