Skip to content

Commit

Permalink
added a finish dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Aug 12, 2015
1 parent 5de7596 commit 8ca6f2f
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions src/lib/migration/finish_dialog.rb
@@ -0,0 +1,98 @@
# ------------------------------------------------------------------------------
# Copyright (c) 2015 SUSE LLC, All Rights Reserved.
#
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, contact SUSE LLC.
#
# To contact SUSE about this file by physical or electronic mail, you may find
# current contact information at www.suse.com.
# ------------------------------------------------------------------------------

require "yast"

module Migration
# Check for possible repository issues in the libzypp products
class FinishDialog
include Yast::Logger
include Yast::I18n
include Yast::UIShortcuts

Yast.import "UI"
Yast.import "Wizard"

attr_accessor :reboot

# run the dialog
def self.run
dialog = FinishDialog.new
dialog.run
end

# constructor
def initialize
textdomain "migration"

@reboot = false
end

# display and run the dialog
# @return [Symbol] user input
def run
Yast::Wizard.SetContents(
# TRANSLATORS: dialog title
_("Migration Finished"),
dialog_content,
# TRANSLATORS: a short help text (the details are directly in the dialog)
_("<p>The migration has finished.</p>"),
# going back is not possible
false,
true
)

update_details

loop do
ret = Yast::UI.UserInput
store_values if ret == :next

return ret if [:next, :back, :cancel, :abort].include?(ret)
end
end

private

# the main dialog content
# @return [Yast::Term] UI term
def dialog_content
VBox(
VSpacing(1),

MinHeight(8,
VWeight(25,
RichText(Id(:details), Opt(:vstretch), "")
)),

VSpacing(1),
# TRANSLATORS: check button label
CheckBox(Id(:reboot), _("Manually Select Migration Repositories"), reboot),
VSpacing(1)
)
end

# store the current UI values
def store_values
self.reboot = Yast::UI.QueryWidget(:reboot, :Value)
log.info "Reboot flag: #{reboot}"
end
end
end

0 comments on commit 8ca6f2f

Please sign in to comment.