Skip to content

Commit f7f8877

Browse files
committed
Override the debug and feedback menu URLs.
1 parent a8fcdcc commit f7f8877

File tree

4 files changed

+51
-11
lines changed

4 files changed

+51
-11
lines changed

src/gui2/build.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
421421
"dep/imhex/plugins/builtin/source/content/main_menu_items.cpp",
422422
"dep/imhex/plugins/builtin/source/content/welcome_screen.cpp",
423423
"dep/imhex/plugins/builtin/source/content/out_of_box_experience.cpp",
424+
"dep/imhex/plugins/builtin/source/content/ui_items.cpp",
424425
"dep/imhex/plugins/builtin/source/content/views.cpp",
425426
"dep/imhex/plugins/builtin/source/content/views/view_data_processor.cpp",
426427
"dep/imhex/plugins/builtin/source/content/views/view_tutorials.cpp",
@@ -434,6 +435,7 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
434435
+ [
435436
"./imhex_overrides/welcome.cc",
436437
"./imhex_overrides/stubs.cc",
438+
"./imhex_overrides/ui_items.cc",
437439
"./imhex_overrides/views.cpp",
438440
"./imhex_overrides/main_menu_items.cpp",
439441
],
@@ -446,6 +448,7 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
446448
".+libwolv",
447449
".+ui-plugin",
448450
".+fonts-plugin",
451+
"dep/imhex/plugins/builtin/source/content/ui_items.cpp",
449452
],
450453
)
451454

@@ -578,16 +581,16 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
578581
"mkdir -p $[dir]/FluxEngine.app/Contents/Resources",
579582
"cp $[ins[1]] $[dir]/FluxEngine.app/Contents/Resources/FluxEngine.icns",
580583
"dylibbundler -of -x $[dir]/FluxEngine.app/Contents/MacOS/fluxengine-gui -b -d $[dir]/FluxEngine.app/Contents/libs -cd > /dev/null",
581-
#"cp $$(brew --prefix wxwidgets)/README.md FluxEngine.app/Contents/libs/wxWidgets.md",
582-
#"cp $$(brew --prefix protobuf)/LICENSE FluxEngine.app/Contents/libs/protobuf.txt",
583-
#"cp $$(brew --prefix fmt)/LICENSE* FluxEngine.app/Contents/libs/fmt.rst",
584-
#"cp $$(brew --prefix libpng)/LICENSE FluxEngine.app/Contents/libs/libpng.txt",
585-
#"cp $$(brew --prefix libjpeg)/README FluxEngine.app/Contents/libs/libjpeg.txt",
586-
#"cp $$(brew --prefix abseil)/LICENSE FluxEngine.app/Contents/libs/abseil.txt",
587-
#"cp $$(brew --prefix libtiff)/LICENSE.md FluxEngine.app/Contents/libs/libtiff.txt",
588-
#"cp $$(brew --prefix zstd)/LICENSE FluxEngine.app/Contents/libs/zstd.txt",
584+
# "cp $$(brew --prefix wxwidgets)/README.md FluxEngine.app/Contents/libs/wxWidgets.md",
585+
# "cp $$(brew --prefix protobuf)/LICENSE FluxEngine.app/Contents/libs/protobuf.txt",
586+
# "cp $$(brew --prefix fmt)/LICENSE* FluxEngine.app/Contents/libs/fmt.rst",
587+
# "cp $$(brew --prefix libpng)/LICENSE FluxEngine.app/Contents/libs/libpng.txt",
588+
# "cp $$(brew --prefix libjpeg)/README FluxEngine.app/Contents/libs/libjpeg.txt",
589+
# "cp $$(brew --prefix abseil)/LICENSE FluxEngine.app/Contents/libs/abseil.txt",
590+
# "cp $$(brew --prefix libtiff)/LICENSE.md FluxEngine.app/Contents/libs/libtiff.txt",
591+
# "cp $$(brew --prefix zstd)/LICENSE FluxEngine.app/Contents/libs/zstd.txt",
589592
"(cd $[dir] && zip -rq FluxEngine.app.zip FluxEngine.app)",
590-
"mv $[dir]/FluxEngine.app.zip $[outs[0]]"
593+
"mv $[dir]/FluxEngine.app.zip $[outs[0]]",
591594
],
592595
label="MKAPP",
593596
)
@@ -605,4 +608,3 @@ def plugin(name, id, srcs, hdrs, romfsdir, deps):
605608
],
606609
label="MKPKG",
607610
)
608-

src/gui2/controlpanelview.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ static void saveFluxFile()
4747
fs::openFileBrowser(fs::DialogMode::Save, {}, Datastore::writeFluxFile);
4848
}
4949

50-
static void showOptions() {}
5150
void ControlPanelView::drawContent()
5251
{
5352
auto diskFlux = Datastore::getDiskFlux();
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#define addTitleBarButtons addTitleBarButtons_disabled
2+
#include "../../../dep/imhex/plugins/builtin/source/content/ui_items.cpp"
3+
#undef addTitleBarButtons
4+
5+
namespace hex::plugin::builtin
6+
{
7+
void addTitleBarButtons()
8+
{
9+
if (dbg::debugModeEnabled())
10+
{
11+
ContentRegistry::UserInterface::addTitleBarButton(ICON_VS_DEBUG,
12+
ImGuiCustomCol_ToolbarGray,
13+
"hex.builtin.title_bar_button.debug_build",
14+
[]
15+
{
16+
if (ImGui::GetIO().KeyShift)
17+
{
18+
RequestOpenPopup::post("DebugMenu");
19+
}
20+
else
21+
{
22+
hex::openWebpage("https://cowlark.com/fluxengine");
23+
}
24+
});
25+
}
26+
27+
ContentRegistry::UserInterface::addTitleBarButton(ICON_VS_SMILEY,
28+
ImGuiCustomCol_ToolbarGray,
29+
"hex.builtin.title_bar_button.feedback",
30+
[]
31+
{
32+
hex::openWebpage(
33+
"https://github.com/davidgiven/fluxengine/discussions/"
34+
"categories/general");
35+
});
36+
}
37+
}

src/gui2/summaryview.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ void SummaryView::drawContent()
8484
{
8585
auto diskFlux = Datastore::getDiskFlux();
8686
auto diskLayout = Datastore::getDiskLayout();
87+
if (!diskFlux || !diskLayout)
88+
return;
8789

8890
auto [minPhysicalCylinder,
8991
maxPhysicalCylinder,

0 commit comments

Comments
 (0)