refactor(ui): name the sidebar page ids instead of hardcoding them
A maintenance page is about to be inserted between two existing entries, and the numeric ids were duplicated across the sidebar, the dashboard shortcuts, the menu bar and the keyboard shortcuts. Naming them keeps those entry points in sync. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
1 parent
4ef37dcda6
commit
b8f8dc569f
2 files changed
+70
-41
No files matched your search
@@ -127,6 +127,29 @@ private slots:
|
||||
private:
|
||||
enum BrowseMode { ModeSearch, ModeInstalled, ModeUpdates };
|
||||
|
||||
// Sidebar entries, in display order. Named so the sidebar, the dashboard
|
||||
// shortcuts, the menu bar and the keyboard shortcuts cannot drift apart
|
||||
// when a page is inserted.
|
||||
enum NavPage {
|
||||
NavDashboard = 0,
|
||||
NavSearch,
|
||||
NavInstalled,
|
||||
NavUpdates,
|
||||
NavHistory,
|
||||
NavLogs,
|
||||
NavPlugins,
|
||||
};
|
||||
|
||||
// Indices in the stacked widget. Search / Installed / Updates share the
|
||||
// browse page, so these deliberately differ from the nav ids.
|
||||
enum StackedPage {
|
||||
PageDashboard = 0,
|
||||
PageBrowse,
|
||||
PageHistory,
|
||||
PageLogs,
|
||||
PagePlugins,
|
||||
};
|
||||
|
||||
// When the sudo password is requested: once per session (at launch) or
|
||||
// before every privileged operation.
|
||||
enum class CredentialMode { AtLaunch, EachTime };
|
||||
|
||||
Reference in new issue
Block a user