summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-04-07 01:21:03 +0200
committerPetr Mrázek <peterix@gmail.com>2015-04-13 00:25:55 +0200
commit1f9dd45e498b812a4884ce8221f9ee8250f475df (patch)
tree5ce2fbfa29fcffa123aea52955892e9bdc4a313e /application
parentf061bf7a27b306f0ef98992673dbf17a502313cb (diff)
downloadMultiMC-1f9dd45e498b812a4884ce8221f9ee8250f475df.tar
MultiMC-1f9dd45e498b812a4884ce8221f9ee8250f475df.tar.gz
MultiMC-1f9dd45e498b812a4884ce8221f9ee8250f475df.tar.lz
MultiMC-1f9dd45e498b812a4884ce8221f9ee8250f475df.tar.xz
MultiMC-1f9dd45e498b812a4884ce8221f9ee8250f475df.zip
GH-329 update description text in MainWindow when instance Minecraft version changes
Diffstat (limited to 'application')
-rw-r--r--application/MainWindow.cpp13
-rw-r--r--application/MainWindow.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 07f0d02f..5b56ca31 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -480,6 +480,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
view->setFrameShape(QFrame::NoFrame);
view->setModel(proxymodel);
+ connect(proxymodel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)), SLOT(instanceDataChanged(QModelIndex,QModelIndex)));
+
view->setContextMenuPolicy(Qt::CustomContextMenu);
connect(view, SIGNAL(customContextMenuRequested(const QPoint &)), this,
SLOT(showInstanceContextMenu(const QPoint &)));
@@ -1939,6 +1941,17 @@ void MainWindow::instanceChanged(const QModelIndex &current, const QModelIndex &
}
}
+void MainWindow::instanceDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
+{
+ auto current = view->selectionModel()->currentIndex();
+ QItemSelection test(topLeft, bottomRight);
+ if(test.contains(current))
+ {
+ instanceChanged(current, current);
+ }
+}
+
+
void MainWindow::selectionBad()
{
// start by reseting everything...
diff --git a/application/MainWindow.h b/application/MainWindow.h
index 96d9c7bb..97111e04 100644
--- a/application/MainWindow.h
+++ b/application/MainWindow.h
@@ -154,6 +154,8 @@ slots:
void instanceChanged(const QModelIndex &current, const QModelIndex &previous);
+ void instanceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
+
void selectionBad();
void startTask(Task *task);