Class: InstallOptionsPage

Inherits:
Qt::Widget
  • Object
show all
Defined in:
lib/settings.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil) ⇒ InstallOptionsPage

Returns a new instance of InstallOptionsPage.



118
119
120
121
# File 'lib/settings.rb', line 118

def initialize(parent=nil)
    super(parent)
    createWidget
end

Instance Method Details

#createWidgetObject



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/settings.rb', line 123

def createWidget
    @installInSystemCheckBox = Qt::CheckBox.new(i18n("Install in System Directory. (Root access Required)"))
    @rdocCheckBox = Qt::CheckBox.new(i18n('Generate RDoc Documentation'))
    @riCheckBox = Qt::CheckBox.new(i18n('Generate RI Documentation'))
    @sheBangCheckBox = Qt::CheckBox.new(i18n('Rewrite the shebang line on installed scripts to use /usr/bin/env'))
    @utestCheckBox = Qt::CheckBox.new(i18n('Run unit tests prior to installation'))
    @binWrapCheckBox = Qt::CheckBox.new(i18n('Use bin wrappers for executables'))
#         @policyCheckBox = Qt::ComboBox.new
#             Qt::Label.new(i18n('Specify gem trust policy'))
    @ignoreDepsCheckBox = Qt::CheckBox.new(i18n('Do not install any required dependent gems'))
    @includeDepsCheckBox = Qt::CheckBox.new(i18n('Unconditionally install the required dependent gems'))
    @developmentDepsCheckBox = Qt::CheckBox.new(i18n('Install any additional development dependencies'))
    @formatExecutableCheckBox = Qt::CheckBox.new(i18n('Make installed executable names match ruby.'))
    formatExeLabel = Qt::Label.new(i18n('     If ruby is ruby18, foo_exec will be foo_exec18'))
#         formatExeLabel.wordWrap = true
    @trustPolicyComboBox = Qt::ComboBox.new
    @trustPolicyComboBox.addItems(TrustPolicies)

    # connect signals,slots
    connect(@utestCheckBox, SIGNAL('stateChanged(int)'), self, \
            SLOT('utestChanged(int)'))
    connect(@developmentDepsCheckBox, SIGNAL('stateChanged(int)'), self, \
            SLOT('devDepsChanged(int)'))

    # objectNames
    #  'kcfg_' + class Settings's instance name.
    @installInSystemCheckBox.objectName = 'kcfg_installInSystemDirFlag'
    @rdocCheckBox.objectName = 'kcfg_installRdocFlag'
    @riCheckBox.objectName = 'kcfg_installRiFlag'
    @sheBangCheckBox.objectName = 'kcfg_installSheBangFlag'
    @utestCheckBox.objectName = 'kcfg_installUnitTestFlag'
    @binWrapCheckBox.objectName = 'kcfg_installBinWrapFlag'
    @ignoreDepsCheckBox.objectName = 'kcfg_installIgnoreDepsFlag'
    @includeDepsCheckBox.objectName = 'kcfg_installIncludeDepsFlag'
    @developmentDepsCheckBox.objectName = 'kcfg_installDevelopmentDepsFlag'
    @formatExecutableCheckBox.objectName = 'kcfg_installformatExecutableFlag'
    @trustPolicyComboBox.objectName = 'kcfg_installTrustPolicy'

    # layout
    lo = Qt::VBoxLayout.new do |l|
        l.addWidget(@installInSystemCheckBox)
        l.addWidget(@rdocCheckBox)
        l.addWidget(@riCheckBox)
        l.addWidget(@sheBangCheckBox)
        l.addWidget(@utestCheckBox)
        l.addWidget(@binWrapCheckBox)
        l.addWidget(@ignoreDepsCheckBox)
        l.addWidget(@includeDepsCheckBox)
        l.addWidget(@developmentDepsCheckBox)
        l.addWidget(@formatExecutableCheckBox)
        l.addWidget(formatExeLabel)
        l.addWidgets(i18n('Trust Policy :'), @trustPolicyComboBox, nil)
        l.addStretch
    end
    setLayout(lo)
end

#devDepsChanged(state) ⇒ Object



186
187
188
# File 'lib/settings.rb', line 186

def devDepsChanged(state)
    @utestCheckBox.setCheckState(state) if state == Qt::Unchecked
end

#installInSystemVisible=(flag) ⇒ Object



190
191
192
# File 'lib/settings.rb', line 190

def installInSystemVisible=(flag)
    @installInSystemCheckBox.visible = flag
end

#utestChanged(state) ⇒ Object



181
182
183
# File 'lib/settings.rb', line 181

def utestChanged(state)
    @developmentDepsCheckBox.setCheckState(state)
end