Create TShortcuts class that builds shortcut menu items and updates label, modifiers, enabled status and target. Not every Tracker shortcut is present but ones used multiple times and many others are. Update shortcuts in ContainerWindow, DeskWindow, FilePanelPriv, QueryContainerWindow, VirtualDirectoryWindow and GetInfo HeaderView. There are two versions of the TShortcuts class, one with a window and one without. The without-window version is used in the GetInfo window, everywhere else uses the "smart" window version. This patch is organizational except fixing two small BeOS bugs: * Edit query item is always between Open and Open with... * Repopulate menus when you switch directories in file panels. Enable "Open parent" item in spatial mode as well as navigation mode unless in Root, Desktop (Query or Query template) or volume root if not in "Show disks" mode. Hold down control to override. BContainerWindow updates: * Absorb Set...Item() methods into TShortcuts. Add UpdateMoveToTrashItem() for "Move to Trash"/"Delete" and many more. * Absorb ShowContextMenu() improvements from Disks patch. * Create AddIconSizeMenu() and eliminate duplicate shortcut handling. * Put icon size menu in radio mode and refactor item marking. Replace "New folder" with "New >" menu automatically. Create member vars and convenience methods to facilitate this. Simplifies building menus, adding a "New folder" item will automatically be updated to "New >" if templates are available (except in FilePanel and on the minimal build you'll just get "New folder"). Refactor Arrange by and Attributes menus. Create support methods. Create menu on add, populate on update. Do cleanup of detached menu on Quit(). Refactor SetupOpenWithMenu(). SetupEditQueryItem() got a similar refactor to be added and removed dynamically. Add FSIsQueriesDir() to FSUtils used to detect queries directory for Edit query. * "Edit query" goes between Open and "Open with..." (long story). UpdateMenu() calls Shortcut()->Update() for all known shortcuts. Optimize adding/removing dynamic menus so that they are created and destroyed once and reused again and again. AddFile...(), fFile... and "FileContext" becomes UpdatePose...(), fPose... and "PoseContext". TTracker changes: * Skip Desktop in OpenContainerWindow() we setup pose view earlier. * Move DeskWindow init into DeskWindow constructor and call Init(). DeskWindow changes: * Replace icon size menu with BContainerWindow::AddIconSizeMenu(). * Remove WindowContextMenu(), handle in BContainerWindow instead. BPoseView changes: * Rename kEditItem to kEditName -- better name. Save for Edit someday. * Use BMessenger::SendMessage() instead of PostMessage(), safer. BFilePanel updates: Create the FilePanel menus fresh by overriding the AddMenus() method instead of copying from BContainerWindow and deleting the items it doesn't need. This allows us to omit most of the file panel checks. Add UpdateFileMenu() to update the file menu on RepopulateMenus() and MenusBeginning(). * Create an AddFavoritesMenu() method and use it to add the menu. * Override RepopulateMenus() to update just the File and context menus. * Create Update...Methods() overloading the BContainerWindow versions. * SetTo() becomes SwitchDirectory() Unify OpenParent() so that we can call BPoseView::OpenParent() and it will call the container window or the file panel where appropriate. Remove BPoseView::ParentIsRoot() and make CanOpenParent() work in both cases. This means we don't have to check if you are in a file panel or not when enabling/disabling the "Open parent" item and the Shortcuts class can simply check CanOpenParent(). Call _inherited SwitchDirectory() to RepopulateMenus() on Root, Trash and Volumes in FilePanel. This fixes a 25+ year old BeOS bug by repopulating menus when you switch directories in file panels. Trash, files in Trash and Root will get the appropriate menu options. For example "Delete"/"Restore" instead of "Duplicate"/"Move to Trash". Change-Id: Ic41b148cb6bcf14288cb5588038c13ea12426dc2 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7197 Reviewed-by: John Scipione <jscipione@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku
Homepage | Mailing Lists | IRC Channels | Issue Tracker | API docs
Haiku is an open-source operating system that specifically targets personal computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful.
Goals
- Sensible defaults with minimal configuration required.
- Clean, clear, concise code.
- Unified desktop environment.
Trying Haiku
Haiku provides pre-built nightly images and release images. Haiku is compatible with a large variety of hardware, but in case you don't want to "take the plunge" and install Haiku on bare metal, you can install it on a virtual machine (VM) instead. If you've never used a VM before, you can follow one of the "Emulating Haiku" guides.
Compiling Haiku
See ReadMe.Compiling
.
Contributing
Haiku is a meritocratic open source project with a large variety of tasks. Even if you can't write code, you can still help! Haiku needs designers, (technical) writers, translators, testers... Get involved and help out!
Contributing code
If you're submitting a patch to us, please make sure you're following the patch submitting guidelines.
If you're having trouble finding something in the source tree, you can use one of our web-based source code browsers:
- https://xref.landonf.org/ (OpenGrok, provided by Landon Fuller)
- https://git.haiku-os.org/ (git, provided by Haiku, Inc.)
Contributing documentation
The main piece of documentation that still needs work are the API docs (found
in the tree at docs/user
). Just find an undocumented class, write
documentation for it, and submit a patch.
Contributing translations
See wiki:i18n.
Contributing software ports
See HaikuPorts.
Contributing to our infrastructure
See Infrastructure.