preferences: Minimal setup for preferences dialog.
This commit is contained in:
parent
07c1ad7579
commit
f2c8c14a83
4 changed files with 21 additions and 4 deletions
|
@ -154,13 +154,16 @@ module Qasim
|
||||||
act_pref = Qt::Action.new _('&Preferences'), @context_menu
|
act_pref = Qt::Action.new _('&Preferences'), @context_menu
|
||||||
act_pref.setIcon( Qt::Icon::fromTheme("configure") ) rescue nil
|
act_pref.setIcon( Qt::Icon::fromTheme("configure") ) rescue nil
|
||||||
act_pref.setIconVisibleInMenu true
|
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;
|
@context_menu.addAction act_pref;
|
||||||
|
|
||||||
act_about = Qt::Action.new '&About', @context_menu
|
act_about = Qt::Action.new '&About', @context_menu
|
||||||
act_about.setIcon( Qt::Icon::fromTheme("help-about") ) rescue nil
|
act_about.setIcon( Qt::Icon::fromTheme("help-about") ) rescue nil
|
||||||
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
|
||||||
res = @about_dialog.show
|
res = @about_dialog.show
|
||||||
end
|
end
|
||||||
|
@ -189,6 +192,7 @@ module Qasim
|
||||||
@main_win = Qt::MainWindow.new
|
@main_win = Qt::MainWindow.new
|
||||||
@systray = Qt::SystemTrayIcon.new @main_win
|
@systray = Qt::SystemTrayIcon.new @main_win
|
||||||
@about_dialog = Qasim::Ui::About.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" )
|
std_icon = Qt::Icon.new( ":/qasim/qasim-icon" )
|
||||||
alt_icon = Qt::Icon.new
|
alt_icon = Qt::Icon.new
|
||||||
|
|
|
@ -2,5 +2,6 @@
|
||||||
require 'qasim/constants'
|
require 'qasim/constants'
|
||||||
|
|
||||||
module Qasim ; module Ui
|
module Qasim ; module Ui
|
||||||
autoload :About, 'qasim/ui/about'
|
autoload :About, 'qasim/ui/about'
|
||||||
|
autoload :Preferences, 'qasim/ui/preferences'
|
||||||
end ; end
|
end ; end
|
||||||
|
|
12
lib/qasim/ui/preferences.rb
Normal file
12
lib/qasim/ui/preferences.rb
Normal file
|
@ -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
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>MapDialog</class>
|
<class>Preferences</class>
|
||||||
<widget class="QDialog" name="MapDialog">
|
<widget class="QDialog" name="MapDialog">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
|
|
Loading…
Reference in a new issue