Finished about dialog.
This commit is contained in:
parent
6dd4069abe
commit
07c1ad7579
3 changed files with 26 additions and 34 deletions
|
@ -162,9 +162,7 @@ module Qasim
|
||||||
act_about.setIconVisibleInMenu true
|
act_about.setIconVisibleInMenu true
|
||||||
act_about.setEnabled true
|
act_about.setEnabled true
|
||||||
act_about.connect(SIGNAL(:triggered)) do
|
act_about.connect(SIGNAL(:triggered)) do
|
||||||
puts "Show about dialog!"
|
res = @about_dialog.show
|
||||||
dialog = Qasim::Ui::About.new
|
|
||||||
dialog.show
|
|
||||||
end
|
end
|
||||||
@context_menu.addAction act_about;
|
@context_menu.addAction act_about;
|
||||||
|
|
||||||
|
@ -184,26 +182,30 @@ module Qasim
|
||||||
def build_interface
|
def build_interface
|
||||||
|
|
||||||
@app = Qt::Application.new(ARGV)
|
@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( ":/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
|
alt_icon = Qt::Icon.new
|
||||||
blinking = false
|
blinking = false
|
||||||
|
|
||||||
si.icon = std_icon
|
@systray.icon = std_icon
|
||||||
si.show
|
@systray.show
|
||||||
|
|
||||||
|
|
||||||
si.setToolTip("Qasim %s" % APP_VERSION);
|
@systray.setToolTip("Qasim %s" % APP_VERSION);
|
||||||
|
|
||||||
build_map_menu
|
build_map_menu
|
||||||
build_context_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
|
case reason
|
||||||
when Qt::SystemTrayIcon::Trigger then
|
when Qt::SystemTrayIcon::Trigger then
|
||||||
build_map_menu
|
build_map_menu
|
||||||
|
|
|
@ -50,7 +50,9 @@ module Qasim ; module Ui
|
||||||
# FIXME handle error on licence reading
|
# FIXME handle error on licence reading
|
||||||
end
|
end
|
||||||
|
|
||||||
#FIXME: set first tab
|
# set first tab
|
||||||
|
@ui.tab_widget.setCurrentIndex(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end ; end
|
end ; end
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>519</width>
|
<width>470</width>
|
||||||
<height>461</height>
|
<height>500</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -53,19 +53,7 @@
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tab_widget">
|
||||||
<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>
|
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -105,7 +93,7 @@
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Authors</string>
|
<string>Authors</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextEdit" name="authors_textedit">
|
<widget class="QTextEdit" name="authors_textedit">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -182,17 +170,17 @@ p, li { white-space: pre-wrap; }
|
||||||
<connections>
|
<connections>
|
||||||
<connection>
|
<connection>
|
||||||
<sender>button_box</sender>
|
<sender>button_box</sender>
|
||||||
<signal>accepted()</signal>
|
<signal>clicked(QAbstractButton*)</signal>
|
||||||
<receiver>About</receiver>
|
<receiver>About</receiver>
|
||||||
<slot>close()</slot>
|
<slot>accept()</slot>
|
||||||
<hints>
|
<hints>
|
||||||
<hint type="sourcelabel">
|
<hint type="sourcelabel">
|
||||||
<x>259</x>
|
<x>463</x>
|
||||||
<y>441</y>
|
<y>493</y>
|
||||||
</hint>
|
</hint>
|
||||||
<hint type="destinationlabel">
|
<hint type="destinationlabel">
|
||||||
<x>259</x>
|
<x>469</x>
|
||||||
<y>230</y>
|
<y>12</y>
|
||||||
</hint>
|
</hint>
|
||||||
</hints>
|
</hints>
|
||||||
</connection>
|
</connection>
|
||||||
|
|
Loading…
Reference in a new issue