Module: Yast::CaManagementPopupInclude

Defined in:
../../src/include/ca-management/popup.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) ExitPopup

Popup to confirm vhen exitting without saving

Returns:

  • exit orback



61
62
63
64
65
66
67
68
69
70
71
# File '../../src/include/ca-management/popup.rb', line 61

def ExitPopup
  if Popup.YesNoHeadline(
      # To translators: YesNo Popup headline
      _("Exit"),
      # To translators: YesNo Popup
      _("Really exit configuration without saving ?")
    )
    return :exit
  end
  :back
end

- (Object) FinishPopup

Popup to confirm after finish is pressed

Returns:

  • yes orback



47
48
49
50
51
52
53
54
55
56
57
# File '../../src/include/ca-management/popup.rb', line 47

def FinishPopup
  if Popup.ContinueCancelHeadline(
      # To translators: ContinueCancel Popup headline
      _("Finish"),
      # To translators: ContinueCancel Popup
      _("Really save configuration ?")
    )
    return :yes
  end
  :back
end

- (Object) initialize_ca_management_popup(include_target)



32
33
34
35
36
37
38
39
40
41
42
43
# File '../../src/include/ca-management/popup.rb', line 32

def initialize_ca_management_popup(include_target)
  Yast.import "UI"
  textdomain "ca-management"

  Yast.import "CaMgm"
  Yast.import "Wizard"
  Yast.import "Label"
  Yast.import "Popup"
  Yast.import "YaPI"
  Yast.import "YaPI::CaManagement"
  Yast.import "CommandLine"
end

- (void) showErrorCaManagement

This method returns an undefined value.

Popup displaying openssl error messages



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File '../../src/include/ca-management/popup.rb', line 76

def showErrorCaManagement
  messageMap = YaPI.Error
  message = Ops.get_string(messageMap, "summary", "")
  description = Ops.get_string(messageMap, "description", "")
  if Ops.greater_than(Builtins.size(message), 0)
    Builtins.y2error("Showing error: %1", messageMap)
    if CommandLine.StartGUI
      if Ops.greater_than(Builtins.size(description), 0)
        if !Popup.AnyQuestion(
            Label.ErrorMsg,
            message,
            Label.OKButton,
            _("Details"),
            :focus
          )
          UI.OpenDialog(
            Opt(:decorated),
            HBox(
              VSpacing(16),
              VBox(
                HSpacing(100),
                # popup window header
                Heading(message),
                VSpacing(0.5),
                RichText(Opt(:plainText), description),
                VSpacing(1.5),
                # push button label
                PushButton(Id(:ok), Opt(:default, :key_F10), Label.OKButton)
              )
            )
          )

          UI.SetFocus(Id(:ok))
          UI.UserInput
          UI.CloseDialog
        end
      else
        Popup.Error(message)
      end
    else
      # output to tty
      CommandLine.Print(message)
    end
  end
  nil
end