SpreadsheetWidget.cpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. /*
  2. * Copyright (c) 2020-2022, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include "SpreadsheetWidget.h"
  7. #include "CellSyntaxHighlighter.h"
  8. #include "HelpWindow.h"
  9. #include "LibFileSystemAccessClient/Client.h"
  10. #include <LibGUI/Application.h>
  11. #include <LibGUI/BoxLayout.h>
  12. #include <LibGUI/Button.h>
  13. #include <LibGUI/FilePicker.h>
  14. #include <LibGUI/InputBox.h>
  15. #include <LibGUI/Label.h>
  16. #include <LibGUI/Menu.h>
  17. #include <LibGUI/MessageBox.h>
  18. #include <LibGUI/Splitter.h>
  19. #include <LibGUI/TabWidget.h>
  20. #include <LibGUI/TextEditor.h>
  21. #include <LibGUI/Toolbar.h>
  22. #include <LibGUI/ToolbarContainer.h>
  23. #include <LibGfx/FontDatabase.h>
  24. #include <string.h>
  25. namespace Spreadsheet {
  26. SpreadsheetWidget::SpreadsheetWidget(GUI::Window& parent_window, NonnullRefPtrVector<Sheet>&& sheets, bool should_add_sheet_if_empty)
  27. : m_workbook(make<Workbook>(move(sheets), parent_window))
  28. {
  29. set_fill_with_background_color(true);
  30. set_layout<GUI::VerticalBoxLayout>().set_margins(2);
  31. auto& toolbar_container = add<GUI::ToolbarContainer>();
  32. auto& toolbar = toolbar_container.add<GUI::Toolbar>();
  33. auto& container = add<GUI::VerticalSplitter>();
  34. auto& top_bar = container.add<GUI::Frame>();
  35. top_bar.set_layout<GUI::HorizontalBoxLayout>().set_spacing(1);
  36. top_bar.set_fixed_height(26);
  37. auto& current_cell_label = top_bar.add<GUI::Label>("");
  38. current_cell_label.set_fixed_width(50);
  39. auto& help_button = top_bar.add<GUI::Button>("");
  40. help_button.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png").release_value_but_fixme_should_propagate_errors());
  41. help_button.set_tooltip("Functions Help");
  42. help_button.set_fixed_size(20, 20);
  43. help_button.on_click = [&](auto) {
  44. if (!current_view()) {
  45. GUI::MessageBox::show_error(window(), "Can only show function documentation/help when a worksheet exists and is open");
  46. } else if (auto* sheet_ptr = current_worksheet_if_available()) {
  47. auto docs = sheet_ptr->gather_documentation();
  48. auto help_window = HelpWindow::the(window());
  49. help_window->set_docs(move(docs));
  50. help_window->show();
  51. }
  52. };
  53. auto& cell_value_editor = top_bar.add<GUI::TextEditor>(GUI::TextEditor::Type::SingleLine);
  54. cell_value_editor.set_font(Gfx::FontDatabase::default_fixed_width_font());
  55. cell_value_editor.set_scrollbars_enabled(false);
  56. cell_value_editor.on_return_pressed = [this]() {
  57. current_view()->move_cursor(GUI::AbstractView::CursorMovement::Down);
  58. };
  59. cell_value_editor.set_syntax_highlighter(make<CellSyntaxHighlighter>());
  60. cell_value_editor.set_enabled(false);
  61. current_cell_label.set_enabled(false);
  62. m_tab_widget = container.add<GUI::TabWidget>();
  63. m_tab_widget->set_tab_position(GUI::TabWidget::TabPosition::Bottom);
  64. m_cell_value_editor = cell_value_editor;
  65. m_current_cell_label = current_cell_label;
  66. m_inline_documentation_window = GUI::Window::construct(window());
  67. m_inline_documentation_window->set_rect(m_cell_value_editor->rect().translated(0, m_cell_value_editor->height() + 7).inflated(6, 6));
  68. m_inline_documentation_window->set_window_type(GUI::WindowType::Tooltip);
  69. m_inline_documentation_window->set_resizable(false);
  70. auto& inline_widget = m_inline_documentation_window->set_main_widget<GUI::Frame>();
  71. inline_widget.set_fill_with_background_color(true);
  72. inline_widget.set_layout<GUI::VerticalBoxLayout>().set_margins(4);
  73. inline_widget.set_frame_shape(Gfx::FrameShape::Box);
  74. m_inline_documentation_label = inline_widget.add<GUI::Label>();
  75. m_inline_documentation_label->set_fill_with_background_color(true);
  76. m_inline_documentation_label->set_autosize(false);
  77. m_inline_documentation_label->set_text_alignment(Gfx::TextAlignment::CenterLeft);
  78. if (!m_workbook->has_sheets() && should_add_sheet_if_empty)
  79. m_workbook->add_sheet("Sheet 1");
  80. m_tab_context_menu = GUI::Menu::construct();
  81. m_rename_action = GUI::Action::create("Rename...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/rename.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) {
  82. VERIFY(m_tab_context_menu_sheet_view);
  83. auto* sheet_ptr = m_tab_context_menu_sheet_view->sheet_if_available();
  84. VERIFY(sheet_ptr); // How did we get here without a sheet?
  85. auto& sheet = *sheet_ptr;
  86. String new_name;
  87. if (GUI::InputBox::show(window(), new_name, String::formatted("New name for '{}'", sheet.name()), "Rename sheet") == GUI::Dialog::ExecOK) {
  88. sheet.set_name(new_name);
  89. sheet.update();
  90. m_tab_widget->set_tab_title(static_cast<GUI::Widget&>(*m_tab_context_menu_sheet_view), new_name);
  91. }
  92. });
  93. m_tab_context_menu->add_action(*m_rename_action);
  94. m_tab_context_menu->add_action(GUI::Action::create("Add new sheet...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new-tab.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) {
  95. String name;
  96. if (GUI::InputBox::show(window(), name, "Name for new sheet", "Create sheet") == GUI::Dialog::ExecOK) {
  97. NonnullRefPtrVector<Sheet> new_sheets;
  98. new_sheets.append(m_workbook->add_sheet(name));
  99. setup_tabs(move(new_sheets));
  100. }
  101. }));
  102. setup_tabs(m_workbook->sheets());
  103. m_new_action = GUI::Action::create("Add New Sheet", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/new-tab.png").release_value_but_fixme_should_propagate_errors(), [&](auto&) {
  104. add_sheet();
  105. });
  106. m_open_action = GUI::CommonActions::make_open_action([&](auto&) {
  107. if (!request_close())
  108. return;
  109. Optional<String> load_path = GUI::FilePicker::get_open_filepath(window());
  110. if (!load_path.has_value())
  111. return;
  112. auto response = FileSystemAccessClient::Client::the().try_request_file_read_only_approved(window(), *load_path);
  113. if (response.is_error())
  114. return;
  115. load_file(*response.value());
  116. });
  117. m_save_action = GUI::CommonActions::make_save_action([&](auto&) {
  118. if (current_filename().is_empty()) {
  119. m_save_as_action->activate();
  120. return;
  121. }
  122. save(current_filename());
  123. });
  124. m_save_as_action = GUI::CommonActions::make_save_as_action([&](auto&) {
  125. String name = "workbook";
  126. Optional<String> save_path = GUI::FilePicker::get_save_filepath(window(), name, "sheets");
  127. if (!save_path.has_value())
  128. return;
  129. save(save_path.value());
  130. update_window_title();
  131. });
  132. m_quit_action = GUI::CommonActions::make_quit_action([&](auto&) {
  133. if (!request_close())
  134. return;
  135. GUI::Application::the()->quit(0);
  136. });
  137. m_cut_action = GUI::CommonActions::make_cut_action([&](auto&) { clipboard_action(true); }, window());
  138. m_copy_action = GUI::CommonActions::make_copy_action([&](auto&) { clipboard_action(false); }, window());
  139. m_paste_action = GUI::CommonActions::make_paste_action([&](auto&) {
  140. ScopeGuard update_after_paste { [&] { update(); } };
  141. auto* worksheet_ptr = current_worksheet_if_available();
  142. if (!worksheet_ptr) {
  143. GUI::MessageBox::show_error(window(), "There are no active worksheets");
  144. return;
  145. }
  146. auto& sheet = *worksheet_ptr;
  147. auto& cells = sheet.selected_cells();
  148. VERIFY(!cells.is_empty());
  149. const auto& data = GUI::Clipboard::the().fetch_data_and_type();
  150. if (auto spreadsheet_data = data.metadata.get("text/x-spreadsheet-data"); spreadsheet_data.has_value()) {
  151. Vector<Spreadsheet::Position> source_positions, target_positions;
  152. auto lines = spreadsheet_data.value().split_view('\n');
  153. auto action = lines.take_first();
  154. for (auto& line : lines) {
  155. dbgln("Paste line '{}'", line);
  156. auto position = sheet.position_from_url(line);
  157. if (position.has_value())
  158. source_positions.append(position.release_value());
  159. }
  160. for (auto& position : sheet.selected_cells())
  161. target_positions.append(position);
  162. if (source_positions.is_empty())
  163. return;
  164. auto first_position = source_positions.take_first();
  165. sheet.copy_cells(move(source_positions), move(target_positions), first_position, action == "cut" ? Spreadsheet::Sheet::CopyOperation::Cut : Spreadsheet::Sheet::CopyOperation::Copy);
  166. } else {
  167. for (auto& cell : sheet.selected_cells())
  168. sheet.ensure(cell).set_data(StringView { data.data.data(), data.data.size() });
  169. update();
  170. }
  171. },
  172. window());
  173. m_undo_action = GUI::CommonActions::make_undo_action([&](auto&) {
  174. undo();
  175. });
  176. m_redo_action = GUI::CommonActions::make_redo_action([&](auto&) {
  177. redo();
  178. });
  179. m_undo_stack.on_state_change = [this] {
  180. m_undo_action->set_enabled(m_undo_stack.can_undo());
  181. m_redo_action->set_enabled(m_undo_stack.can_redo());
  182. };
  183. m_undo_action->set_enabled(false);
  184. m_redo_action->set_enabled(false);
  185. m_functions_help_action = GUI::Action::create(
  186. "&Functions Help", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png").release_value_but_fixme_should_propagate_errors(), [&](auto&) {
  187. if (auto* worksheet_ptr = current_worksheet_if_available()) {
  188. auto docs = worksheet_ptr->gather_documentation();
  189. auto help_window = Spreadsheet::HelpWindow::the(window());
  190. help_window->set_docs(move(docs));
  191. help_window->show();
  192. } else {
  193. GUI::MessageBox::show_error(window(), "Cannot prepare documentation/help without an active worksheet");
  194. }
  195. },
  196. window());
  197. m_about_action = GUI::CommonActions::make_about_action("Spreadsheet", GUI::Icon::default_icon("app-spreadsheet"), window());
  198. toolbar.add_action(*m_new_action);
  199. toolbar.add_action(*m_open_action);
  200. toolbar.add_action(*m_save_action);
  201. toolbar.add_separator();
  202. toolbar.add_action(*m_cut_action);
  203. toolbar.add_action(*m_copy_action);
  204. toolbar.add_action(*m_paste_action);
  205. toolbar.add_action(*m_undo_action);
  206. toolbar.add_action(*m_redo_action);
  207. m_cut_action->set_enabled(false);
  208. m_copy_action->set_enabled(false);
  209. m_tab_widget->on_context_menu_request = [&](auto& widget, auto& event) {
  210. m_tab_context_menu_sheet_view = static_cast<SpreadsheetView&>(widget);
  211. m_tab_context_menu->popup(event.screen_position());
  212. };
  213. m_tab_widget->on_double_click = [&](auto& widget) {
  214. m_tab_context_menu_sheet_view = static_cast<SpreadsheetView&>(widget);
  215. m_rename_action->activate();
  216. };
  217. }
  218. void SpreadsheetWidget::resize_event(GUI::ResizeEvent& event)
  219. {
  220. GUI::Widget::resize_event(event);
  221. if (m_inline_documentation_window && m_cell_value_editor && window())
  222. m_inline_documentation_window->set_rect(m_cell_value_editor->screen_relative_rect().translated(0, m_cell_value_editor->height() + 7).inflated(6, 6));
  223. }
  224. void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
  225. {
  226. for (auto& sheet : new_sheets) {
  227. auto& new_view = m_tab_widget->add_tab<SpreadsheetView>(sheet.name(), sheet);
  228. new_view.model()->on_cell_data_change = [&](auto& cell, auto& previous_data) {
  229. undo_stack().push(make<CellUndoCommand>(cell, previous_data));
  230. window()->set_modified(true);
  231. };
  232. new_view.on_selection_changed = [&](Vector<Position>&& selection) {
  233. auto* sheet_ptr = current_worksheet_if_available();
  234. // How did this even happen?
  235. VERIFY(sheet_ptr);
  236. auto& sheet = *sheet_ptr;
  237. VERIFY(!selection.is_empty());
  238. m_cut_action->set_enabled(true);
  239. m_copy_action->set_enabled(true);
  240. m_current_cell_label->set_enabled(true);
  241. m_cell_value_editor->set_enabled(true);
  242. if (selection.size() == 1) {
  243. auto& position = selection.first();
  244. m_current_cell_label->set_text(position.to_cell_identifier(sheet));
  245. auto& cell = sheet.ensure(position);
  246. m_cell_value_editor->on_change = nullptr;
  247. m_cell_value_editor->set_text(cell.source());
  248. m_cell_value_editor->on_change = [&] {
  249. auto text = m_cell_value_editor->text();
  250. // FIXME: Lines?
  251. auto offset = m_cell_value_editor->cursor().column();
  252. try_generate_tip_for_input_expression(text, offset);
  253. cell.set_data(move(text));
  254. sheet.update();
  255. update();
  256. };
  257. static_cast<CellSyntaxHighlighter*>(const_cast<Syntax::Highlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(&cell);
  258. return;
  259. }
  260. // There are many cells selected, change all of them.
  261. StringBuilder builder;
  262. builder.appendff("<{}>", selection.size());
  263. m_current_cell_label->set_text(builder.string_view());
  264. Vector<Cell&> cells;
  265. for (auto& position : selection)
  266. cells.append(sheet.ensure(position));
  267. auto& first_cell = cells.first();
  268. m_cell_value_editor->on_change = nullptr;
  269. m_cell_value_editor->set_text("");
  270. m_should_change_selected_cells = false;
  271. m_cell_value_editor->on_focusin = [this] { m_should_change_selected_cells = true; };
  272. m_cell_value_editor->on_focusout = [this] { m_should_change_selected_cells = false; };
  273. m_cell_value_editor->on_change = [cells = move(cells), this]() mutable {
  274. if (m_should_change_selected_cells) {
  275. auto* sheet_ptr = current_worksheet_if_available();
  276. if (!sheet_ptr)
  277. return;
  278. auto& sheet = *sheet_ptr;
  279. auto text = m_cell_value_editor->text();
  280. // FIXME: Lines?
  281. auto offset = m_cell_value_editor->cursor().column();
  282. try_generate_tip_for_input_expression(text, offset);
  283. for (auto& cell : cells)
  284. cell.set_data(text);
  285. sheet.update();
  286. update();
  287. }
  288. };
  289. static_cast<CellSyntaxHighlighter*>(const_cast<Syntax::Highlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(&first_cell);
  290. };
  291. new_view.on_selection_dropped = [&]() {
  292. m_current_cell_label->set_enabled(false);
  293. m_current_cell_label->set_text({});
  294. m_cell_value_editor->on_change = nullptr;
  295. m_cell_value_editor->on_focusin = nullptr;
  296. m_cell_value_editor->on_focusout = nullptr;
  297. m_cell_value_editor->set_text({});
  298. m_cell_value_editor->set_enabled(false);
  299. m_cut_action->set_enabled(false);
  300. m_copy_action->set_enabled(false);
  301. static_cast<CellSyntaxHighlighter*>(const_cast<Syntax::Highlighter*>(m_cell_value_editor->syntax_highlighter()))->set_cell(nullptr);
  302. };
  303. }
  304. }
  305. void SpreadsheetWidget::try_generate_tip_for_input_expression(StringView source, size_t cursor_offset)
  306. {
  307. auto* sheet_ptr = current_view()->sheet_if_available();
  308. if (!sheet_ptr)
  309. return;
  310. auto& sheet = *sheet_ptr;
  311. m_inline_documentation_window->set_rect(m_cell_value_editor->screen_relative_rect().translated(0, m_cell_value_editor->height() + 7).inflated(6, 6));
  312. if (!current_view() || !source.starts_with('=')) {
  313. m_inline_documentation_window->hide();
  314. return;
  315. }
  316. auto maybe_function_and_argument = get_function_and_argument_index(source.substring_view(0, cursor_offset));
  317. if (!maybe_function_and_argument.has_value()) {
  318. m_inline_documentation_window->hide();
  319. return;
  320. }
  321. auto& [name, index] = maybe_function_and_argument.value();
  322. auto text = sheet.generate_inline_documentation_for(name, index);
  323. if (text.is_empty()) {
  324. m_inline_documentation_window->hide();
  325. } else {
  326. m_inline_documentation_label->set_text(move(text));
  327. m_inline_documentation_window->show();
  328. }
  329. }
  330. void SpreadsheetWidget::undo()
  331. {
  332. if (!m_undo_stack.can_undo())
  333. return;
  334. m_undo_stack.undo();
  335. update();
  336. }
  337. void SpreadsheetWidget::redo()
  338. {
  339. if (!m_undo_stack.can_redo())
  340. return;
  341. m_undo_stack.redo();
  342. update();
  343. }
  344. void SpreadsheetWidget::save(StringView filename)
  345. {
  346. auto result = m_workbook->save(filename);
  347. if (result.is_error()) {
  348. GUI::MessageBox::show_error(window(), result.error());
  349. return;
  350. }
  351. undo_stack().set_current_unmodified();
  352. window()->set_modified(false);
  353. }
  354. void SpreadsheetWidget::load_file(Core::File& file)
  355. {
  356. auto result = m_workbook->open_file(file);
  357. if (result.is_error()) {
  358. GUI::MessageBox::show_error(window(), result.error());
  359. return;
  360. }
  361. m_tab_widget->on_change = nullptr;
  362. m_cell_value_editor->on_change = nullptr;
  363. m_current_cell_label->set_text("");
  364. m_should_change_selected_cells = false;
  365. while (auto* widget = m_tab_widget->active_widget()) {
  366. m_tab_widget->remove_tab(*widget);
  367. }
  368. setup_tabs(m_workbook->sheets());
  369. update_window_title();
  370. }
  371. bool SpreadsheetWidget::request_close()
  372. {
  373. if (!undo_stack().is_current_modified())
  374. return true;
  375. auto result = GUI::MessageBox::ask_about_unsaved_changes(window(), current_filename());
  376. if (result == GUI::MessageBox::ExecYes) {
  377. m_save_action->activate();
  378. return !m_workbook->dirty();
  379. }
  380. if (result == GUI::MessageBox::ExecNo)
  381. return true;
  382. return false;
  383. }
  384. void SpreadsheetWidget::add_sheet()
  385. {
  386. StringBuilder name;
  387. name.append("Sheet");
  388. name.appendff(" {}", m_workbook->sheets().size() + 1);
  389. NonnullRefPtrVector<Sheet> new_sheets;
  390. new_sheets.append(m_workbook->add_sheet(name.string_view()));
  391. setup_tabs(move(new_sheets));
  392. }
  393. void SpreadsheetWidget::add_sheet(NonnullRefPtr<Sheet>&& sheet)
  394. {
  395. VERIFY(m_workbook == &sheet->workbook());
  396. NonnullRefPtrVector<Sheet> new_sheets;
  397. new_sheets.append(move(sheet));
  398. m_workbook->sheets().extend(new_sheets);
  399. setup_tabs(new_sheets);
  400. }
  401. void SpreadsheetWidget::update_window_title()
  402. {
  403. StringBuilder builder;
  404. if (current_filename().is_empty())
  405. builder.append("Untitled");
  406. else
  407. builder.append(current_filename());
  408. builder.append("[*] - Spreadsheet");
  409. window()->set_title(builder.to_string());
  410. }
  411. void SpreadsheetWidget::clipboard_action(bool is_cut)
  412. {
  413. /// text/x-spreadsheet-data:
  414. /// - action: copy/cut
  415. /// - currently selected cell
  416. /// - selected cell+
  417. auto* worksheet_ptr = current_worksheet_if_available();
  418. if (!worksheet_ptr) {
  419. GUI::MessageBox::show_error(window(), "There are no active worksheets");
  420. return;
  421. }
  422. auto& worksheet = *worksheet_ptr;
  423. auto& cells = worksheet.selected_cells();
  424. VERIFY(!cells.is_empty());
  425. StringBuilder text_builder, url_builder;
  426. url_builder.append(is_cut ? "cut\n" : "copy\n");
  427. bool first = true;
  428. auto cursor = current_selection_cursor();
  429. if (cursor) {
  430. Spreadsheet::Position position { (size_t)cursor->column(), (size_t)cursor->row() };
  431. url_builder.append(position.to_url(worksheet).to_string());
  432. url_builder.append('\n');
  433. }
  434. for (auto& cell : cells) {
  435. if (first && !cursor) {
  436. url_builder.append(cell.to_url(worksheet).to_string());
  437. url_builder.append('\n');
  438. }
  439. url_builder.append(cell.to_url(worksheet).to_string());
  440. url_builder.append('\n');
  441. auto cell_data = worksheet.at(cell);
  442. if (!first)
  443. text_builder.append('\t');
  444. if (cell_data)
  445. text_builder.append(cell_data->data());
  446. first = false;
  447. }
  448. HashMap<String, String> metadata;
  449. metadata.set("text/x-spreadsheet-data", url_builder.to_string());
  450. dbgln(url_builder.to_string());
  451. GUI::Clipboard::the().set_data(text_builder.string_view().bytes(), "text/plain", move(metadata));
  452. }
  453. void SpreadsheetWidget::initialize_menubar(GUI::Window& window)
  454. {
  455. auto& file_menu = window.add_menu("&File");
  456. file_menu.add_action(*m_new_action);
  457. file_menu.add_action(*m_open_action);
  458. file_menu.add_action(*m_save_action);
  459. file_menu.add_action(*m_save_as_action);
  460. file_menu.add_separator();
  461. file_menu.add_action(*m_quit_action);
  462. auto& edit_menu = window.add_menu("&Edit");
  463. edit_menu.add_action(*m_undo_action);
  464. edit_menu.add_action(*m_redo_action);
  465. edit_menu.add_separator();
  466. edit_menu.add_action(*m_cut_action);
  467. edit_menu.add_action(*m_copy_action);
  468. edit_menu.add_action(*m_paste_action);
  469. auto& help_menu = window.add_menu("&Help");
  470. help_menu.add_action(*m_functions_help_action);
  471. help_menu.add_action(*m_about_action);
  472. }
  473. }