Class: RegisterPage

Inherits:
LicenseWizardPage show all
Defined in:
ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb

Instance Method Summary collapse

Methods inherited from WizardPage

#isLastPage

Methods inherited from Qt::Widget

#raise

Methods inherited from Qt::Base

#%, #&, #*, #**, #+, #-, #-@, #/, #<, #<<, #<=, #==, #>, #>=, #>>, #QCOMPARE, #QEXPECT_FAIL, #QFAIL, #QSKIP, #QTEST, #QVERIFY, #QVERIFY2, #QWARN, #^, ancestors, #is_a?, #methods, private_slots, #protected_methods, #public_methods, q_classinfo, q_signal, q_slot, signals, #singleton_methods, slots, #|, #~

Constructor Details

#initialize(wizard) ⇒ RegisterPage

Returns a new instance of RegisterPage.



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
# File 'ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb', line 140

def initialize(wizard)
    super(wizard)
    @topLabel = Qt::Label.new(tr("<center><b>Register your copy of Super Product " +
                             "One</b></center>"))

    @nameLabel = Qt::Label.new(tr("&Name:"))
    @nameLineEdit = Qt::LineEdit.new
    @nameLabel.buddy = @nameLineEdit
    setFocusProxy(@nameLineEdit)

    @upgradeKeyLabel = Qt::Label.new(tr("&Upgrade key:"))
    @upgradeKeyLineEdit = Qt::LineEdit.new
    @upgradeKeyLabel.buddy = @upgradeKeyLineEdit

    @bottomLabel = Qt::Label.new(tr("If you have an upgrade key, please fill in " +
                                "the appropriate field."))

    connect(@nameLineEdit, SIGNAL('textChanged(QString)'),
            self, SIGNAL('completeStateChanged()'))

    layout = Qt::GridLayout.new
    layout.addWidget(@topLabel, 0, 0, 1, 2)
    layout.setRowMinimumHeight(1, 10)
    layout.addWidget(@nameLabel, 2, 0)
    layout.addWidget(@nameLineEdit, 2, 1)
    layout.addWidget(@upgradeKeyLabel, 3, 0)
    layout.addWidget(@upgradeKeyLineEdit, 3, 1)
    layout.setRowMinimumHeight(4, 10)
    layout.addWidget(@bottomLabel, 5, 0, 1, 2)
    layout.setRowStretch(6, 1)
    setLayout(layout)
end

Instance Method Details

#isCompleteObject



186
187
188
# File 'ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb', line 186

def isComplete()
    return !@nameLineEdit.text.empty?
end

#nextPageObject



178
179
180
181
182
183
184
# File 'ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb', line 178

def nextPage()
    if @upgradeKeyLineEdit.text.empty?
        return @wizard.detailsPage
    else
        return @wizard.finishPage
    end
end

#resetPageObject



173
174
175
176
# File 'ext/ruby/qtruby/examples/dialogs/complexwizard/licensewizard.rb', line 173

def resetPage()
    @nameLineEdit.clear()
    @upgradeKeyLineEdit.clear()
end