Broke instance loading(?), also attempted to make Toolbar grayed out when no instance is selected. For debug purposes it is initially not grayed out
This commit is contained in:
parent
ce253ded0e
commit
b5450042b5
@ -175,6 +175,7 @@ gui/instancedelegate.h
|
||||
gui/versionselectdialog.h
|
||||
gui/lwjglselectdialog.h
|
||||
gui/iconcache.h
|
||||
gui/instancesettings.h
|
||||
|
||||
multimc_pragma.h
|
||||
|
||||
@ -206,6 +207,7 @@ gui/instancedelegate.cpp
|
||||
gui/versionselectdialog.cpp
|
||||
gui/lwjglselectdialog.cpp
|
||||
gui/iconcache.cpp
|
||||
gui/instancesettings.cpp
|
||||
|
||||
java/javautils.cpp
|
||||
java/annotations.cpp
|
||||
@ -225,6 +227,7 @@ gui/aboutdialog.ui
|
||||
gui/consolewindow.ui
|
||||
gui/versionselectdialog.ui
|
||||
gui/lwjglselectdialog.ui
|
||||
gui/instancesettings.ui
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
/* Copyright 2013 MultiMC Contributors
|
||||
*
|
||||
* Authors: Andrew Okin
|
||||
* Peterix
|
||||
* Orochimarufan <orochimarufan.x3@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "instancesettings.h"
|
||||
#include "ui_instancesettings.h"
|
||||
|
||||
@ -35,7 +54,7 @@ void InstanceSettings::applySettings(SettingsObject *s)
|
||||
s->set("OverrideWindow", ui->windowSizeGroupBox->isChecked());
|
||||
|
||||
// Auto Login
|
||||
s->set("AutoLogin", ui->autoLoginCheckBox->isChecked());
|
||||
s->set("AutoLogin", ui->autoLoginChecBox->isChecked());
|
||||
s->set("OverrideLogin", ui->accountSettingsGroupBox->isChecked());
|
||||
|
||||
// Memory
|
||||
@ -56,6 +75,7 @@ void InstanceSettings::applySettings(SettingsObject *s)
|
||||
|
||||
void InstanceSettings::loadSettings(SettingsObject *s)
|
||||
{
|
||||
|
||||
// Console
|
||||
ui->showConsoleCheck->setChecked(s->get("ShowConsole").toBool());
|
||||
ui->autoCloseConsoleCheck->setChecked(s->get("AutoCloseConsole").toBool());
|
||||
@ -69,7 +89,7 @@ void InstanceSettings::loadSettings(SettingsObject *s)
|
||||
ui->windowSizeGroupBox->setChecked(s->get("OverrideWindow").toBool());
|
||||
|
||||
// Auto Login
|
||||
ui->autoLoginCheckBox->setChecked(s->get("AutoLogin").toBool());
|
||||
ui->autoLoginChecBox->setChecked(s->get("AutoLogin").toBool());
|
||||
ui->accountSettingsGroupBox->setChecked(s->get("OverrideLogin").toBool());
|
||||
|
||||
// Memory
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define INSTANCESETTINGS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "settingsobject.h"
|
||||
|
||||
namespace Ui {
|
||||
class InstanceSettings;
|
||||
@ -21,8 +22,6 @@ public:
|
||||
void loadSettings(SettingsObject* s);
|
||||
|
||||
private slots:
|
||||
void on_overrideGlobalMcCheck_clicked(bool checked);
|
||||
|
||||
void on_customCommandsGroupBox_toggled(bool arg1);
|
||||
|
||||
private:
|
||||
|
@ -11,7 +11,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
<string/>
|
||||
</property>
|
||||
<widget class="QTabWidget" name="settingsTabs">
|
||||
<property name="geometry">
|
||||
@ -162,7 +162,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="autoLoginChecBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Login automatically when an instance icon is double clicked?</string>
|
||||
@ -370,12 +370,15 @@
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>270</x>
|
||||
<x>9</x>
|
||||
<y>530</y>
|
||||
<width>166</width>
|
||||
<width>435</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "gui/lwjglselectdialog.h"
|
||||
#include "gui/consolewindow.h"
|
||||
#include "gui/modeditwindow.h"
|
||||
#include "gui/instancesettings.h"
|
||||
|
||||
#include "kcategorizedview.h"
|
||||
#include "kcategorydrawer.h"
|
||||
@ -130,6 +131,9 @@ MainWindow::MainWindow ( QWidget *parent ) :
|
||||
view->setModel ( proxymodel );
|
||||
connect(view, SIGNAL(doubleClicked(const QModelIndex &)),
|
||||
this, SLOT(instanceActivated(const QModelIndex &)));
|
||||
|
||||
connect(view, SIGNAL(clicked(const QModelIndex &)),
|
||||
this, SLOT(instanceChanged(const QModelIndex &)));
|
||||
|
||||
// Load the instances.
|
||||
instList.loadList();
|
||||
@ -563,9 +567,14 @@ void MainWindow::on_actionInstanceSettings_triggered()
|
||||
SettingsObject *s;
|
||||
s = &inst->settings();
|
||||
InstanceSettings *settings = new InstanceSettings (this);
|
||||
settings->setWindowTitle(QString("Instance settings"));
|
||||
settings->loadSettings(s);
|
||||
if (settings->exec()) {
|
||||
settings->applySettings(s);
|
||||
}
|
||||
delete settings;
|
||||
}
|
||||
|
||||
void MainWindow::instanceChanged(QModelIndex idx) {
|
||||
ui->instanceToolBar->setEnabled(idx.isValid());
|
||||
}
|
||||
|
@ -108,8 +108,12 @@ private slots:
|
||||
|
||||
void on_actionChangeInstLWJGLVersion_triggered();
|
||||
|
||||
void on_actionInstanceSettings_triggered();
|
||||
|
||||
public slots:
|
||||
void instanceActivated ( QModelIndex );
|
||||
|
||||
void instanceChanged ( QModelIndex );
|
||||
|
||||
void startTask(Task *task);
|
||||
|
||||
|
@ -65,6 +65,9 @@
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
<widget class="QToolBar" name="instanceToolBar">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Instance Toolbar</string>
|
||||
</property>
|
||||
@ -300,7 +303,7 @@
|
||||
</action>
|
||||
<action name="actionInstanceSettings">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Settings</string>
|
||||
|
Loading…
Reference in New Issue
Block a user