Module: Yast::PartitioningEpAllInclude
- Defined in:
- ../../src/include/partitioning/ep-all.rb
Instance Method Summary (collapse)
- - (Object) CreateAllPanel(user_data)
- - (Object) HandleAllPanel(user_data, event)
- - (Object) initialize_partitioning_ep_all(include_target)
Instance Method Details
- (Object) CreateAllPanel(user_data)
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 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 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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 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 172 173 174 175 176 177 178 179 180 181 182 |
# File '../../src/include/partitioning/ep-all.rb', line 35 def CreateAllPanel(user_data) user_data = deep_copy(user_data) _IsAvailable = lambda do |client| #in the installed system, we don't care if the client isn't there #as the user will be prompted to install the pkg anyway (in CallConfig) if !Stage.initial return true else #check if the client is in inst-sys return WFM.ClientExists(client) end end short_hostname = Hostname.CurrentHostname fields = StorageSettings.FilterTable( [ :device, :udev_path, :udev_id, :size, :format, :encrypted, :type, :fs_type, :label, :mount_point, :mount_by, :used_by ] ) target_map = Storage.GetTargetMap table_header = StorageFields.TableHeader(fields) table_contents = StorageFields.TableContents( fields, target_map, fun_ref(StorageFields.method(:PredicateAll), "symbol (map, map)") ) = [] if true # push button text << PushButton(Id(:rescan), Opt(:key_F6), _("Rescan Devices")) end if Mode.installation # push button text << PushButton(Id(:import), _("Import Mount Points...")) end << HStretch() configs = [] if true # menu entry text configs << Item(Id(:cryptpwd), term(:icon, "yast-encrypted"), _("Provide Crypt &Passwords...")) end if _IsAvailable.call("iscsi-client") # menu entry text configs << Item(Id(:iscsi), term(:icon, "yast-iscsi-client"), _("Configure &iSCSI...")) end if _IsAvailable.call("fcoe-client") # menu entry text configs << Item(Id(:fcoe), term(:icon, "fcoe"), _("Configure &FCoE...")) end if true # menu entry text configs << Item(Id(:multipath), term(:icon, "yast-iscsi-server"), _("Configure &Multipath...")) end if Arch.s390 && _IsAvailable.call("dasd") # menu entry text configs << Item(Id(:dasd), term(:icon, "yast-dasd"), _("Configure &DASD...")) end if Arch.s390 && _IsAvailable.call("zfcp") # menu entry text configs << Item(Id(:zfcp), term(:icon, "yast-zfcp"), _("Configure &zFCP...")) end if Arch.s390 && _IsAvailable.call("xpram") # menu entry text configs << Item(Id(:xpram), term(:icon, "yast-xpram"), _("Configure &XPRAM...")) end if !configs.empty? # menu button text << MenuButton(Opt(:key_F7), _("Configure..."), configs) end UI.ReplaceWidget( :tree_panel, Greasemonkey.Transform( VBox( # dialog heading, %1 is replaced with hostname term( :IconAndHeading, Builtins.sformat(_("Available Storage on %1"), short_hostname), StorageIcons.all_icon ), Table( Id(:table), Opt(:keepSorting, :notify, :notifyContextMenu), table_header, table_contents ), ArrangeButtons() ) ) ) # helptext helptext = _("<p>This view shows all storage devices\navailable.</p>") display_info = UI.GetDisplayInfo if !Ops.get_boolean(display_info, "TextMode", false) # helptext helptext = Ops.add( helptext, _( "<p>By double clicking a table entry,\n" + "you navigate to the view with detailed information about the\n" + "device.</p>\n" ) ) else # helptext helptext = Ops.add( helptext, _( "<p>By selecting a table entry you can\nnavigate to the view with detailed information about the device.</p>" ) ) end Wizard.RestoreHelp(Ops.add(helptext, StorageFields.TableHelptext(fields))) nil end |
- (Object) HandleAllPanel(user_data, event)
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File '../../src/include/partitioning/ep-all.rb', line 185 def HandleAllPanel(user_data, event) user_data = deep_copy(user_data) event = deep_copy(event) _CheckAndInstallPackages = lambda do |pkgs| pkgs = deep_copy(pkgs) return true if Stage.initial ret = false #switch off pkg-mgmt loading progress dialogs, #because it just plain sucks PackageCallbacks.RegisterEmptyProgressCallbacks ret = PackageSystem.CheckAndInstallPackages(pkgs) PackageCallbacks.RestorePreviousProgressCallbacks ret end _CallConfig = lambda do |text, pkgs, call| pkgs = deep_copy(pkgs) doit = true if !Storage.EqualBackupStates("expert-partitioner", "", true) doit = Popup.YesNo(text) end if doit if pkgs == nil || _CheckAndInstallPackages.call(pkgs) if call != nil Storage.ActivateHld(false) WFM.call(call) end RescanDisks() Storage.CreateTargetBackup("expert-partitioner") UpdateMainStatus() UpdateNavigationTree(nil) TreePanel.Create end end nil end case Event.IsWidgetActivated(event) when :rescan # popup text _CallConfig.call( _( "Rescaning disks cancels all current changes.\nReally rescan disks?" ), nil, nil ) when :import ImportMountPoints() UpdateMainStatus() UpdateNavigationTree(nil) TreePanel.Create end case Event.IsMenu(event) when :iscsi # popup text _CallConfig.call( _( "Calling iSCSI configuration cancels all current changes.\nReally call iSCSI configuration?" ), ["yast2-iscsi-client"], "iscsi-client" ) when :fcoe # popup text _CallConfig.call( _( "Calling FCoE configuration cancels all current changes.\nReally call FCoE configuration?" ), ["yast2-fcoe-client"], "fcoe-client" ) when :multipath if ProductFeatures.GetBooleanFeature( "partitioning", "use_separate_multipath_module" ) == true || Mode.normal && WFM.ClientExists("multipath") # popup text _CallConfig.call( _( "Calling multipath configuration cancels all current changes.\nReally call multipath configuration?\n" ), ["yast2-multipath"], "multipath" ) else # popup text _CallConfig.call( _( "Calling multipath configuration cancels all current changes.\nReally call multipath configuration?\n" ), nil, "multipath-simple" ) end when :cryptpwd @tg = Storage.GetTargetMap @tg = Storage.AskCryptPasswords(@tg) Storage.SetTargetMap(@tg) UpdateMainStatus() UpdateNavigationTree(nil) TreePanel.Create when :dasd # popup text _CallConfig.call( _( "Calling DASD configuration cancels all current changes.\nReally call DASD configuration?" ), ["yast2-s390"], "dasd" ) when :zfcp # popup text _CallConfig.call( _( "Calling zFCP configuration cancels all current changes.\nReally call zFCP configuration?" ), ["yast2-s390"], "zfcp" ) when :xpram # popup text _CallConfig.call( _( "Calling XPRAM configuration cancels all current changes.\nReally call XPRAM configuration?" ), ["yast2-s390"], "xpram" ) end case Event.IsWidgetContextMenuActivated(event) when :table @device = Convert.to_string(UI.QueryWidget(Id(:table), :CurrentItem)) EpContextMenuDevice(@device) end nil end |
- (Object) initialize_partitioning_ep_all(include_target)
28 29 30 31 32 33 |
# File '../../src/include/partitioning/ep-all.rb', line 28 def initialize_partitioning_ep_all(include_target) textdomain "storage" Yast.import "PackageCallbacks" Yast.import "PackageSystem" end |