diff options
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r-- | src/mainwindow.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 5dbc226..f80f0ab 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -1,6 +1,6 @@ /* mainwindow.cc - This file is part of the Project::OSiRiON zone editor + This file is part of the Project::OSiRiON world editor and is distributed under the terms and conditions of the GNU General Public License version 2 */ @@ -18,7 +18,7 @@ namespace editor MainWindow::MainWindow() { // set window title - setWindowTitle(tr("Project::OSiRiON zone editor")); + setWindowTitle(tr("Project::OSiRiON world editor")); // initialize MDI (multiple document interface) area mainwindow_mdiarea = new QMdiArea(); @@ -66,29 +66,35 @@ void MainWindow::init_menu() mainwindow_editmenu = menuBar()->addMenu(tr("&Edit")); } -void MainWindow::add_child() +EditorWindow *MainWindow::addEditorWindow() { // create a child widget EditorWindow *child_widget = new EditorWindow(); // add the widget to the MDI area, // this will wrap an QMdiSubWindow around it - mainwindow_mdiarea->addSubWindow(child_widget); + QMdiSubWindow *subwindow = mainwindow_mdiarea->addSubWindow(child_widget); child_widget->show(); + + // FIXME check if maximized + subwindow->resize(768, 512); + + return child_widget; } void MainWindow::slot_new() { - add_child(); + addEditorWindow(); } void MainWindow::slot_open() { - QString filename = QFileDialog::getOpenFileName(this); + QString filename = QFileDialog::getOpenFileName(this, tr("Open file")); if (!filename.isEmpty()) { - add_child(); + EditorWindow *editorwindow = addEditorWindow(); + editorwindow->loadFile(filename); } } |