summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-07-07 09:14:11 -0700
committerPetr Mrázek <peterix@gmail.com>2013-07-07 09:14:11 -0700
commit8f5516ceb6b897c4e3452d424d55d02023eab270 (patch)
tree93708ea1d149d504e92c1ec33add85ecc41b0498
parenteb16d977c86844c9562e9bbe2e3dc6f58dddcc04 (diff)
parent96cceeafeb7a52e0dd2005677deec0af2fa4db92 (diff)
downloadMultiMC-8f5516ceb6b897c4e3452d424d55d02023eab270.tar
MultiMC-8f5516ceb6b897c4e3452d424d55d02023eab270.tar.gz
MultiMC-8f5516ceb6b897c4e3452d424d55d02023eab270.tar.lz
MultiMC-8f5516ceb6b897c4e3452d424d55d02023eab270.tar.xz
MultiMC-8f5516ceb6b897c4e3452d424d55d02023eab270.zip
Merge pull request #2 from TakSuyu/master
Did some grunt work for the Edit Mods Dialog
-rw-r--r--gui/mainwindow.cpp19
-rw-r--r--gui/mainwindow.h2
-rw-r--r--gui/mainwindow.ui2
-rw-r--r--gui/modeditwindow.cpp10
-rw-r--r--gui/modeditwindow.h27
5 files changed, 54 insertions, 6 deletions
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 )
{
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index b861cbe7..f13d9395 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -92,6 +92,8 @@ private slots:
void on_actionChangeInstMCVersion_triggered();
+ void on_actionEditInstMods_triggered();
+
void doLogin(const QString& errorMsg = "");
diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui
index 44b8a31f..771e7096 100644
--- a/gui/mainwindow.ui
+++ b/gui/mainwindow.ui
@@ -342,7 +342,7 @@
</action>
<action name="actionEditInstMods">
<property name="enabled">
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="text">
<string>Edit Mods</string>
diff --git a/gui/modeditwindow.cpp b/gui/modeditwindow.cpp
index e457252a..322197ef 100644
--- a/gui/modeditwindow.cpp
+++ b/gui/modeditwindow.cpp
@@ -15,8 +15,11 @@
#include "modeditwindow.h"
#include "ui_modeditwindow.h"
+#include "instance.h"
-ModEditWindow::ModEditWindow(QWidget *parent) :
+#include <QDebug>
+
+ModEditWindow::ModEditWindow(QWidget *parent, Instance* m_inst) :
QDialog(parent),
ui(new Ui::ModEditWindow)
{
@@ -27,3 +30,8 @@ ModEditWindow::~ModEditWindow()
{
delete ui;
}
+
+void ModEditWindow::on_buttonBox_rejected()
+{
+ close();
+} \ No newline at end of file
diff --git a/gui/modeditwindow.h b/gui/modeditwindow.h
index c669e0b1..87b02938 100644
--- a/gui/modeditwindow.h
+++ b/gui/modeditwindow.h
@@ -18,6 +18,8 @@
#include <QDialog>
+#include "instance.h"
+
namespace Ui {
class ModEditWindow;
}
@@ -27,9 +29,32 @@ class ModEditWindow : public QDialog
Q_OBJECT
public:
- explicit ModEditWindow(QWidget *parent = 0);
+ explicit ModEditWindow(QWidget *parent = 0, Instance* m_inst = 0);
~ModEditWindow();
+private slots:
+ /* Mapped for implementation
+ void on_addTPackButton_clicked();
+ void on_delTPackButton_clicked();
+ void on_viewTPackButton_clicked();
+
+ void on_addMlModButton_clicked();
+ void on_delMlModButton_clicked();
+ void on_viewMlModbutton_clicked();
+
+ void on_addCoreModButton_clicked();
+ void on_delCoreModButton_clicked();
+ void on_viewCoreModButton_clicked();
+
+ void on_addJarModButton_clicked();
+ void on_delJarModButton_clicked();
+ void on_mcforgeButton_clicked();
+ void on_jarModMoveUpButton_clicked();
+ void on_jarModMoveDownButton_clicked();
+ */
+ // Questionable: SettingsDialog doesn't need this for some reason?
+ void on_buttonBox_rejected();
+
private:
Ui::ModEditWindow *ui;
};