1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

Spreadsheet: Properly pass parent window to Workbook

Change the parent of the WizardDialog to that of the Spreadsheet window.
Previously the WizardDialog was using the open file dialog as the
parent resulting in the csv import dialog
This commit is contained in:
Glenford Williams 2022-01-09 14:31:51 -05:00 committed by Linus Groh
parent 876424923a
commit f5ff011c1b
5 changed files with 10 additions and 7 deletions

View file

@ -19,6 +19,7 @@
#include <LibGUI/StackWidget.h>
#include <LibGUI/TableView.h>
#include <LibGUI/TextBox.h>
#include <LibGUI/Window.h>
#include <LibGUI/Wizards/WizardDialog.h>
#include <LibGUI/Wizards/WizardPage.h>
@ -174,9 +175,9 @@ void CSVImportDialogPage::update_preview()
m_data_preview_table_view->update();
}
Result<NonnullRefPtrVector<Sheet>, String> ImportDialog::make_and_run_for(StringView mime, Core::File& file, Workbook& workbook)
Result<NonnullRefPtrVector<Sheet>, String> ImportDialog::make_and_run_for(GUI::Window* parent, StringView mime, Core::File& file, Workbook& workbook)
{
auto wizard = GUI::WizardDialog::construct(GUI::Application::the()->active_window());
auto wizard = GUI::WizardDialog::construct(parent);
wizard->set_title("File Import Wizard");
wizard->set_icon(GUI::Icon::default_icon("app-spreadsheet").bitmap_for_size(16));