-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #613 from yast/polish-new-storage-ui
[Storage UI] Fine tuning the interface
- Loading branch information
Showing
25 changed files
with
906 additions
and
295 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
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
54 changes: 54 additions & 0 deletions
54
src/lib/autoinstall/widgets/storage/delete_section_button.rb
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,54 @@ | ||
# Copyright (c) [2020] 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 LLC about this file by physical or electronic mail, you may | ||
# find current contact information at www.suse.com. | ||
|
||
require "yast" | ||
require "cwm/common_widgets" | ||
|
||
module Y2Autoinstallation | ||
module Widgets | ||
module Storage | ||
# Button to remove the selected section | ||
class DeleteSectionButton < CWM::PushButton | ||
# Constructor | ||
# | ||
# @param controller [Y2Autoinstallation::StorageController] UI controller | ||
def initialize(controller) | ||
textdomain "autoinst" | ||
@controller = controller | ||
end | ||
|
||
# @macro seeAbstractWidget | ||
def label | ||
_("Delete") | ||
end | ||
|
||
# @macro seeAbstractWidget | ||
def handle | ||
controller.delete_section | ||
:redraw | ||
end | ||
|
||
private | ||
|
||
# @return [Y2Autoinstallation::StorageController] | ||
attr_reader :controller | ||
end | ||
end | ||
end | ||
end |
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
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
94 changes: 94 additions & 0 deletions
94
src/lib/autoinstall/widgets/storage/not_lvm_partition_attrs.rb
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,94 @@ | ||
# Copyright (c) [2020] 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 LLC about this file by physical or electronic mail, you may | ||
# find current contact information at www.suse.com. | ||
|
||
require "yast" | ||
require "cwm/custom_widget" | ||
require "autoinstall/widgets/storage/partition_id" | ||
require "autoinstall/widgets/storage/partition_type" | ||
|
||
module Y2Autoinstallation | ||
module Widgets | ||
module Storage | ||
# Not LVM partitions specific widgets | ||
# | ||
# It holds widgets managing specific attributes for a partition not related to a CT_LVM drive. | ||
# | ||
# @see PartitionGeneralTab | ||
class NotLvmPartitionAttrs < CWM::CustomWidget | ||
# Constructor | ||
# | ||
# @param section [Presenters::Partition] presenter for the partition section | ||
def initialize(section) | ||
textdomain "autoinst" | ||
super() | ||
@section = section | ||
end | ||
|
||
# @macro seeAbstractWidget | ||
def label | ||
"" | ||
end | ||
|
||
# @macro seeCustomWidget | ||
def contents | ||
VBox( | ||
Left( | ||
HBox( | ||
HSquash(MinWidth(15, partition_id_widget)), | ||
HSpacing(2), | ||
partition_type_widget | ||
) | ||
) | ||
) | ||
end | ||
|
||
# @macro seeAbstractWidget | ||
def init | ||
partition_id_widget.value = section.partition_id | ||
partition_type_widget.value = section.partition_type | ||
end | ||
|
||
# Returns the widgets values | ||
# | ||
# @return [Hash<String,Object>] | ||
def values | ||
{ | ||
"partition_id" => partition_id_widget.value, | ||
"partition_type" => partition_type_widget.value | ||
} | ||
end | ||
|
||
private | ||
|
||
# @return [Presenters::Partition] presenter for the partition section | ||
attr_reader :section | ||
|
||
# Widget for setting the partition id | ||
def partition_id_widget | ||
@partition_id_widget ||= PartitionId.new | ||
end | ||
|
||
# Widget for setting the partition type | ||
def partition_type_widget | ||
@partition_type_widget ||= PartitionType.new | ||
end | ||
end | ||
end | ||
end | ||
end |
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
Oops, something went wrong.