Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |