From 96cceeafeb7a52e0dd2005677deec0af2fa4db92 Mon Sep 17 00:00:00 2001 From: TakSuyu Date: Sat, 6 Jul 2013 19:11:24 -0700 Subject: implemented ModEditUI and mapped ModEditUI Buttons for implementation enabled EditMods button on MainWindowUI added validation check for renaming instances --- gui/mainwindow.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'gui/mainwindow.cpp') diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 3f0221b2..5336b12c 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -42,6 +42,7 @@ #include "gui/versionselectdialog.h" #include "gui/lwjglselectdialog.h" #include "gui/consolewindow.h" +#include "gui/modeditwindow.h" #include "kcategorizedview.h" #include "kcategorydrawer.h" @@ -313,9 +314,12 @@ void MainWindow::on_actionRenameInstance_triggered() QString name ( inst->name() ); name = QInputDialog::getText ( this, tr ( "Instance name" ), tr ( "Enter a new instance name." ), QLineEdit::Normal, name, &ok ); - //FIXME: dialog should do the validation!!! - if(ok && name.length() && name.length() <= 25) - inst->setName(name); + + if (name.length() > 0) + { + if(ok && name.length() && name.length() <= 25) + inst->setName(name); + } } } @@ -329,6 +333,15 @@ void MainWindow::on_actionViewSelectedInstFolder_triggered() } } +void MainWindow::on_actionEditInstMods_triggered() +{ + Instance* inst = selectedInstance(); + if (inst) + { + ModEditWindow dialog ( this, inst ); + dialog.exec(); + } +} void MainWindow::closeEvent ( QCloseEvent *event ) { -- cgit v1.2.3