Gerrit: Disable buttons while fetch operation is in progress.

Gerrit operations should not be started in parallel since
they use FETCH_HEAD, which can cause mix-ups.

Change-Id: Icb421c8065f680a4bb93acd63e1ffe6309ce774a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Friedemann Kleint
2012-12-07 15:31:00 +01:00
committed by Tobias Hunger
parent ef65ce480d
commit 45b4ff4e74
4 changed files with 45 additions and 3 deletions

View File

@@ -372,6 +372,9 @@ void GerritPlugin::openView()
this, SLOT(fetchApply(QSharedPointer<Gerrit::Internal::GerritChange>)));
connect(gd, SIGNAL(fetchCheckout(QSharedPointer<Gerrit::Internal::GerritChange>)),
this, SLOT(fetchCheckout(QSharedPointer<Gerrit::Internal::GerritChange>)));
connect(this, SIGNAL(fetchStarted(QSharedPointer<Gerrit::Internal::GerritChange>)),
gd, SLOT(fetchStarted(QSharedPointer<Gerrit::Internal::GerritChange>)));
connect(this, SIGNAL(fetchFinished()), gd, SLOT(fetchFinished()));
m_dialog = gd;
}
const Qt::WindowStates state = m_dialog.data()->windowState();
@@ -442,6 +445,8 @@ void GerritPlugin::fetch(const QSharedPointer<Gerrit::Internal::GerritChange> &c
FetchContext *fc = new FetchContext(change, repository, git,
m_parameters, FetchMode(mode), this);
connect(fc, SIGNAL(destroyed(QObject*)), this, SIGNAL(fetchFinished()));
emit fetchStarted(change);
fc->start();
}