GH-329 update description text in MainWindow when instance Minecraft version changes
This commit is contained in:
parent
f061bf7a27
commit
1f9dd45e49
@ -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 ¤t, 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...
|
||||
|
@ -154,6 +154,8 @@ slots:
|
||||
|
||||
void instanceChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
||||
|
||||
void instanceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
|
||||
|
||||
void selectionBad();
|
||||
|
||||
void startTask(Task *task);
|
||||
|
@ -264,6 +264,7 @@ bool OneSixInstance::setIntendedVersionId(QString version)
|
||||
{
|
||||
clearProfile();
|
||||
}
|
||||
emit propertiesChanged(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user