Module: Yast::DrbdCommonInclude

Defined in:
../../src/include/drbd/common.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) cmpList(a, b)



94
95
96
97
98
99
100
101
102
103
# File '../../src/include/drbd/common.rb', line 94

def cmpList(a, b)
  a = deep_copy(a)
  b = deep_copy(b)
  same = true
  if Builtins.size(a) != Builtins.size(b)
    same = false 
    #TODO:
  end
  false
end

- (Object) initialize_drbd_common(include_target)



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File '../../src/include/drbd/common.rb', line 30

def initialize_drbd_common(include_target)
  textdomain "drbd"

  Yast.import "Label"
  Yast.import "Wizard"
  Yast.import "Drbd"
  Yast.import "Popup"
  Yast.import "CWM"

  @DIALOG = ["startup_conf", "global_conf", "resource_conf"]

  @PARENT = {}

  @NAME = {
    "startup_conf"  => _("Start-up Configuration"),
    "global_conf"   => _("Global Configuration"),
    "resource_conf" => _("Resource Configuration"),
    "basic_conf"    => _("Resource Basic Configuration"),
    "advance_conf"  => _("Resource Advanced Configuration")
  }
end

- (Object) Modified



56
57
58
# File '../../src/include/drbd/common.rb', line 56

def Modified
  Drbd.modified
end

- (Object) my_SetContents(conf, contents)



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File '../../src/include/drbd/common.rb', line 65

def my_SetContents(conf, contents)
  contents = deep_copy(contents)
  Wizard.SetContents(
    Ops.add("DRBD - ", Ops.get_string(@NAME, conf, "")),
    contents,
    Ops.get_string(@HELPS, conf, ""),
    true,
    true
  )

  if UI.WidgetExists(Id(:wizardTree))
    #  UI::ChangeWidget(`id(`wizardTree), `CurrentItem, current_dialog);
    UI.SetFocus(Id(:wizardTree))
  end 

  #		if (Heartbeat::firstrun) {
  #			UI::ChangeWidget(`id(`back), `Enabled, conf != "node_conf");
  #			if (conf == "startup_conf") {
  #				UI::WizardCommand(`SetNextButtonLabel( Label::FinishButton() ) );
  #				Wizard::SetNextButton(`PushButton(`id(`next), `opt(`key_F10), Label::FinishButton()));
  #			} else {
  #				UI::WizardCommand(`SetNextButtonLabel( Label::NextButton() ) );
  #				Wizard::SetNextButton(`PushButton(`id(`next), `opt(`key_F10), Label::NextButton()));
  #			}
  #		}

  nil
end

- (Object) myHelp(help)



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File '../../src/include/drbd/common.rb', line 105

def myHelp(help)
  UI.OpenDialog(
    Opt(:decorated),
    HBox(
      VSpacing(16),
      VBox(
        HSpacing(60),
        VSpacing(0.5),
        RichText(Ops.get_string(@HELPS, help, "")),
        VSpacing(1.5),
        PushButton(Id(:ok), Opt(:default, :key_F10), Label.OKButton)
      )
    )
  )

  UI.SetFocus(Id(:ok))
  UI.UserInput
  UI.CloseDialog

  nil
end

- (Object) PollAbort



52
53
54
# File '../../src/include/drbd/common.rb', line 52

def PollAbort
  UI.PollInput == :abort
end

- (Object) ReallyAbort



60
61
62
63
# File '../../src/include/drbd/common.rb', line 60

def ReallyAbort
  #	    return !Heartbeat::Modified() || Popup::ReallyAbort(true);
  !Modified() || Popup.ReallyAbort(true)
end