forked from qt-creator/qt-creator
RemoteDialog: Fix button states after adding remote
As adding a remote leads to a model reset which does not trigger the selectionChanged signal, all buttons were enabled despite no remote was selected. Change-Id: I2f752fcf5f1830728d1bcf9810ca4648bd2f287b Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
André Hartmann
parent
23a58a320e
commit
2dfb9ff539
@@ -145,6 +145,8 @@ RemoteDialog::RemoteDialog(QWidget *parent) :
|
|||||||
|
|
||||||
connect(m_ui->remoteView->selectionModel(), &QItemSelectionModel::selectionChanged,
|
connect(m_ui->remoteView->selectionModel(), &QItemSelectionModel::selectionChanged,
|
||||||
this, &RemoteDialog::updateButtonState);
|
this, &RemoteDialog::updateButtonState);
|
||||||
|
connect(m_remoteModel, &RemoteModel::refreshed,
|
||||||
|
this, &RemoteDialog::updateButtonState);
|
||||||
|
|
||||||
updateButtonState();
|
updateButtonState();
|
||||||
}
|
}
|
||||||
|
@@ -199,6 +199,7 @@ bool RemoteModel::refresh(const FilePath &workingDirectory, QString *errorMessag
|
|||||||
m_remotes.push_back(newRemote);
|
m_remotes.push_back(newRemote);
|
||||||
}
|
}
|
||||||
endResetModel();
|
endResetModel();
|
||||||
|
emit refreshed();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -65,6 +65,9 @@ public:
|
|||||||
Utils::FilePath workingDirectory() const;
|
Utils::FilePath workingDirectory() const;
|
||||||
int findRemoteByName(const QString &name) const;
|
int findRemoteByName(const QString &name) const;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void refreshed();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
class Remote {
|
class Remote {
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user