diff --git a/bin/qasim-gui.rb b/bin/qasim-gui.rb index 3c41814..4b5cb32 100755 --- a/bin/qasim-gui.rb +++ b/bin/qasim-gui.rb @@ -154,13 +154,16 @@ module Qasim act_pref = Qt::Action.new _('&Preferences'), @context_menu act_pref.setIcon( Qt::Icon::fromTheme("configure") ) rescue nil act_pref.setIconVisibleInMenu true - act_pref.setEnabled false + #act_pref.setEnabled true + act_pref.connect(SIGNAL(:triggered)) do + res = @pref_dialog.show + end @context_menu.addAction act_pref; act_about = Qt::Action.new '&About', @context_menu act_about.setIcon( Qt::Icon::fromTheme("help-about") ) rescue nil act_about.setIconVisibleInMenu true - act_about.setEnabled true + #act_about.setEnabled true act_about.connect(SIGNAL(:triggered)) do res = @about_dialog.show end @@ -189,6 +192,7 @@ module Qasim @main_win = Qt::MainWindow.new @systray = Qt::SystemTrayIcon.new @main_win @about_dialog = Qasim::Ui::About.new @main_win + @pref_dialog = Qasim::Ui::Preferences.new @main_win std_icon = Qt::Icon.new( ":/qasim/qasim-icon" ) alt_icon = Qt::Icon.new diff --git a/lib/qasim/ui.rb b/lib/qasim/ui.rb index e0e110e..b431223 100644 --- a/lib/qasim/ui.rb +++ b/lib/qasim/ui.rb @@ -2,5 +2,6 @@ require 'qasim/constants' module Qasim ; module Ui - autoload :About, 'qasim/ui/about' + autoload :About, 'qasim/ui/about' + autoload :Preferences, 'qasim/ui/preferences' end ; end diff --git a/lib/qasim/ui/preferences.rb b/lib/qasim/ui/preferences.rb new file mode 100644 index 0000000..46e075a --- /dev/null +++ b/lib/qasim/ui/preferences.rb @@ -0,0 +1,12 @@ + +require 'qasim/ui/preferences_ui' + +module Qasim ; module Ui + class Preferences < Qt::Dialog + def initialize(parent = nil) + super + @ui = Ui_Preferences.new + @ui.setup_ui(self) + end + end +end ; end diff --git a/lib/qasim/ui/preferences.ui b/lib/qasim/ui/preferences.ui index a0c10f3..38dd421 100644 --- a/lib/qasim/ui/preferences.ui +++ b/lib/qasim/ui/preferences.ui @@ -1,6 +1,6 @@ - MapDialog + Preferences