-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menu Bar for Partitioner #1122
Merged
shundhammer
merged 30 commits into
yast:partitioner-ui-02
from
shundhammer:huha-menus-02
Aug 27, 2020
Merged
Menu Bar for Partitioner #1122
shundhammer
merged 30 commits into
yast:partitioner-ui-02
from
shundhammer:huha-menus-02
Aug 27, 2020
Conversation
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
Work on top of pr#1120
LGTM. Let's merge and continue from here |
ancorgs
approved these changes
Aug 27, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as a very valid starting point (this is being merged to a separate shared branch). We will refine things afterwards.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trello
https://trello.com/c/cx6LEKsA/1914-5-partitioner-menu-bar
Bugzilla
https://bugzilla.suse.com/show_bug.cgi?id=1175489
Problems
We have too many buttons in the partitioner; they clutter the dialogs. Some of the actions on those buttons are really exotic and rarely needed.
Some of the pages in the partitioner are really out of place; they should not be mixed among all the others that are all related to devices like Hard Disks, Volume Management, Bcache:
Solutions
Add a menu bar and move at least the exotic actions out of the main dialog; remove those buttons from there.
Convert the pages that are out of place into pop-up dialogs and move them out of the tree on the left side. They should be initiated by a menu entry.
Screenshots
Partitioner with menu bar.
Notice that some of the views are now gone from the tree on the left:
They are now accessible from the menus.
NCurses 80x24
Pop-up Dialogs that were Main Dialog Views
Installation summary invoked from the "View" menu
If there was any change, the user will still get a full-screen version of this as a final wizard step to confirm the actions that will be performed:
Menus
The "System" Menu
All items here are fully functional.
"Settings" opens the "Settings" dialog which is now no longer a page of the main view, but a separate pop-up dialog.
"Abort" and "Finish" are alternatives to the wizard buttons with the same name.
The "Edit" Menu
Not supported yet, thus all disabled:
The general idea is that these menu items should perform the same action as the buttons with the same name on the currently selected page: If a partition is selected, the menu will add or edit or delete etc. a partition. If a disk is selected, only "Edit" will be enabled, and the user can modify the disk, e.g. create a filesystem directly on disk. If an NFS is selected, the menu will add or edit or delete an NFS mount etc.
We will have to decide if that still works well with volume management where a user can add or edit or delete a volume group or a logical volume.
But wherever possible, this menu should provide a uniform user interface for common operations.
We decided against adding a separate menu for each of the different kinds of objects (disk, partition, RAID, LVM volume group, LVM logical volume, bcache, NFS mount, Btrfs); not only would we run out of screen space (especially in NCurses), the sheer number of entries would also defeat the purpose of having a menu. Only one of them would ever be enabled at the same time anyway, depending on what page in the main view is selected.
This is work in progress.
The "View" Menu
All entries are fully functional
Each one opens a view that was formerly a page of the main view, but is now a separate pop-up dialog.
The "Configure" Menu
All entries are fully functional.
Formerly, they were on a menu button in the first page of the main view. That button is now gone.
Most of those items (except "Provide Crypt Passwords") start another YaST module to configure one of the more exotic storage subsystems.
On the IBM s/390 architecture, this also includes storage technologies specific to s/390:
The "Options" Menu
"Options" menu in the installed system
Those entries are not functional yet (thus disabled).
"Options" menu during installation
Notice the extra menu item for "Import Mount Points" which is only available during installation (functional).
Implementation Details
Event Handling via Ruby Introspection
This adds a custom CWM widget to the partitioner that receives all events. It filters out events of type MenuEvent and checks the ID of that event. If the MainMenu class has a matching handler, that handler is called:
For a menu entry
Item(Id(:transmogrify), _("Transmogrify")_)
, the MainMenu class checks if it has a methodhandle_transmogrify()
, and if it does, that method is called. If not, the event is passed up the chain of event handlers.In particular, that means that a menu entry with an unknown ID that belongs to a separate MenuButton is handled correctly by that MenuButton. However, if menu item IDs clash, the MainMenu comes first and will handle the event.