|
2 | 2 | #include "g4dialog.h" |
3 | 3 | #include "g4dialog_options.h" // Provides G4DIALOG_LOGGER constant and option definitions |
4 | 4 | #include "tabs/gcommands.h" |
5 | | -#include "gui_session.h" |
6 | 5 |
|
7 | | -// geant4 |
8 | | -#include "G4UImanager.hh" |
9 | 6 |
|
10 | 7 |
|
11 | 8 | G4Dialog::G4Dialog(const std::shared_ptr<GOptions>& gopt, QWidget* parent) : |
12 | 9 | GBase(gopt, G4DIALOG_LOGGER), |
13 | 10 | QWidget(parent) { |
14 | 11 | auto dialogTabs = new QTabWidget; |
15 | 12 |
|
16 | | - gboard = new GBoard(gopt, this); |
17 | | - auto UIM = G4UImanager::GetUIpointer(); |
18 | | - |
19 | | - gui_session = std::make_unique<GUI_Session>(gopt, gboard); |
20 | | - UIM->SetCoutDestination(gui_session.get()); |
21 | | - |
22 | 13 | dialogTabs->addTab(new G4Commands(this), "Geant4 Commands"); |
23 | | - dialogTabs->addTab(gboard, "Log"); |
24 | 14 |
|
25 | 15 | auto* mainLayout = new QVBoxLayout; |
26 | 16 | mainLayout->addWidget(dialogTabs); |
27 | 17 | setLayout(mainLayout); |
28 | 18 |
|
29 | 19 | log->debug(NORMAL, "View and Utilities tabs added."); |
30 | 20 | } |
31 | | - |
32 | | - |
33 | | -G4Dialog::~G4Dialog() { |
34 | | - |
35 | | - // Detach G4 cout/cerr from our GUI session (avoid dangling callback) |
36 | | - if (auto* UIM = G4UImanager::GetUIpointer()) { |
37 | | - // If available in your G4 version, prefer checking current destination: |
38 | | - // if (UIM->GetCoutDestination() == gui_session.get()) { ... } |
39 | | - UIM->SetCoutDestination(nullptr); |
40 | | - } |
41 | | - |
42 | | - // Destroy the session *now*, before member teardown sequence |
43 | | - gui_session.reset(); |
44 | | - |
45 | | -} |
0 commit comments