Skip to content

Commit

Permalink
Merge 5c411e1 into c7dff4a
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Nov 6, 2018
2 parents c7dff4a + 5c411e1 commit 6d40727
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 10 deletions.
3 changes: 2 additions & 1 deletion doc/downloads/index.js
Expand Up @@ -37,7 +37,8 @@ var jsonData = { "versions": [
}
],
"changes": [
{ "change": "<strong>Graph Panel widget:</strong> don't skip the first data point (see issue <a href=\"https://github.com/opencor/opencor/issues/1860\">#1860</a>)." }
{ "change": "<strong>Graph Panel widget:</strong> don't skip the first data point (see issue <a href=\"https://github.com/opencor/opencor/issues/1860\">#1860</a>)." },
{ "change": "<strong>PMR-based windows:</strong> make sure that the spinning wheel is hidden when changing instances of PMR (see issue <a href=\"https://github.com/opencor/opencor/issues/1862\">#1862</a>)." }
]
},
{ "major": 0, "minor": 4, "patch": 1, "day": 20, "month": 5, "year": 2015, "type": 0,
Expand Down
24 changes: 21 additions & 3 deletions src/plugins/organisation/PMRWindow/src/pmrwindowwindow.cpp
Expand Up @@ -145,7 +145,7 @@ PmrWindowWindow::PmrWindowWindow(QWidget *pParent) :
// Some connections to process responses from our PMR web service

connect(mPmrWebService, &PMRSupport::PmrWebService::busy,
this, &PmrWindowWindow::busy);
this, QOverload<bool>::of(&PmrWindowWindow::busy));

connect(mPmrWebService, &PMRSupport::PmrWebService::information,
this, &PmrWindowWindow::showInformation);
Expand Down Expand Up @@ -223,11 +223,17 @@ void PmrWindowWindow::resizeEvent(QResizeEvent *pEvent)
void PmrWindowWindow::update(const QString &pPmrUrl)
{
// Update our PMR web service and then reload ourselves, if needed
// Note: we make sure that no busy widget is visible. Indeed, this is in
// case an instance wasn't working and we decided to switch to another
// that does (in which case the busy widget of the first instance
// would still have been visible)...

if (pPmrUrl.compare(mPmrUrl)) {
if (mPmrWindowWidget->hasExposures())
mPmrWindowWidget->initialize(PMRSupport::PmrExposures(), QString(), QString());

busy(false, true);

mPmrUrl = pPmrUrl;

mPmrWebService->update(pPmrUrl);
Expand All @@ -250,7 +256,7 @@ void PmrWindowWindow::filterValueChanged(const QString &pText)

//==============================================================================

void PmrWindowWindow::busy(bool pBusy)
void PmrWindowWindow::busy(bool pBusy, bool pResetCounter)
{
// Show ourselves as busy or not busy anymore

Expand All @@ -259,7 +265,10 @@ void PmrWindowWindow::busy(bool pBusy)
if (!pBusy && !counter)
return;

counter += pBusy?1:-1;
if (pResetCounter)
counter = 0;
else
counter += pBusy?1:-1;

if (pBusy && (counter == 1)) {
mGui->dockWidgetContents->setEnabled(false);
Expand All @@ -286,6 +295,15 @@ void PmrWindowWindow::busy(bool pBusy)

//==============================================================================

void PmrWindowWindow::busy(bool pBusy)
{
// Show ourselves as busy or not busy anymore

busy(pBusy, false);
}

//==============================================================================

void PmrWindowWindow::showInformation(const QString &pMessage)
{
// Show the given message as an information message box, but only if we
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/organisation/PMRWindow/src/pmrwindowwindow.h
Expand Up @@ -94,6 +94,8 @@ class PmrWindowWindow : public Core::OrganisationWidget

void retrieveExposures(bool pVisible, bool pForceRetrieval);

void busy(bool pBusy, bool pResetCounter);

private slots:
void actionReloadTriggered();

Expand Down
Expand Up @@ -175,7 +175,7 @@ PmrWorkspacesWindowWindow::PmrWorkspacesWindowWindow(QWidget *pParent) :
// Some connections to process responses from our PMR web service

connect(mPmrWebService, &PMRSupport::PmrWebService::busy,
this, &PmrWorkspacesWindowWindow::busy);
this, QOverload<bool>::of(&PmrWorkspacesWindowWindow::busy));

connect(mPmrWebService, &PMRSupport::PmrWebService::information,
this, &PmrWorkspacesWindowWindow::showInformation);
Expand Down Expand Up @@ -292,11 +292,17 @@ void PmrWorkspacesWindowWindow::update(const QString &pPmrUrl)
// Update both our PMR web service and workspaces widget, and then update
// our GUI (which will, as a result, also update our workspaces widget), if
// needed
// Note: we make sure that no busy widget is visible. Indeed, this is in
// case an instance wasn't working and we decided to switch to another
// that does (in which case the busy widget of the first instance
// would still have been visible)...

if (pPmrUrl.compare(mPmrUrl)) {
if (PMRSupport::PmrWorkspaceManager::instance()->hasWorkspaces())
mPmrWorkspacesWindowWidget->initialize();

busy(false, true);

mPmrUrl = pPmrUrl;

mPmrWebService->update(pPmrUrl);
Expand All @@ -310,7 +316,7 @@ void PmrWorkspacesWindowWindow::update(const QString &pPmrUrl)

//==============================================================================

void PmrWorkspacesWindowWindow::busy(bool pBusy)
void PmrWorkspacesWindowWindow::busy(bool pBusy, bool pResetCounter)
{
// Show ourselves as busy or not busy anymore

Expand All @@ -319,7 +325,10 @@ void PmrWorkspacesWindowWindow::busy(bool pBusy)
if (!pBusy && !counter)
return;

counter += pBusy?1:-1;
if (pResetCounter)
counter = 0;
else
counter += pBusy?1:-1;

if (pBusy && (counter == 1)) {
mGui->dockWidgetContents->setEnabled(false);
Expand All @@ -336,6 +345,15 @@ void PmrWorkspacesWindowWindow::busy(bool pBusy)

//==============================================================================

void PmrWorkspacesWindowWindow::busy(bool pBusy)
{
// Show ourselves as busy or not busy anymore

busy(pBusy, false);
}

//==============================================================================

void PmrWorkspacesWindowWindow::showInformation(const QString &pMessage)
{
// Show the given message as an information message box, but only if our
Expand Down
Expand Up @@ -105,6 +105,8 @@ class PmrWorkspacesWindowWindow : public Core::OrganisationWidget

void retranslateActionPmr();

void busy(bool pBusy, bool pResetCounter);

private slots:
void actionNewTriggered();
void actionReloadTriggered();
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/support/PMRSupport/i18n/PMRSupport_fr.ts
Expand Up @@ -12,8 +12,8 @@
<translation>le site de transit est sélectionné. Il est utilisé pour publiquement tester/prévisualiser les développements de PMR. Les données sur ce site sont effacées périodiquement chaque fois qu&apos;un nouveau test/aperçu public de la suite logicielle PMR est publié pour l&apos;exercice de test requis.</translation>
</message>
<message>
<source>the teaching site is selected. The functionality of this site should match the primary site, but without the data persistency guarantees. While data on this site is also not permanent, any wipes to data stored will be announced on the cellml-discussion mailing list.</source>
<translation>le site d&apos;enseignement est sélectionné. Les fonctionnalités de ce site devraient correspondre à celles du site principal, mais sans les garanties de persistance des données. Bien que les données sur ce site ne soient pas non plus permanentes, tout effacement des données stockées sera annoncé sur la liste de discussion cellml-discussion.</translation>
<source>the teaching site is selected. The functionality of this site should match the primary site, but without the data persistency guarantees. While data on this site is also not permanent, any wipes to data stored will be announced on the &lt;a href=&quot;https://lists.cellml.org/sympa/info/cellml-discussion&quot;&gt;cellml-discussion mailing list&lt;/a&gt;.</source>
<translation>le site d&apos;enseignement est sélectionné. Les fonctionnalités de ce site devraient correspondre à celles du site principal, mais sans les garanties de persistance des données. Bien que les données sur ce site ne soient pas non plus permanentes, tout effacement des données stockées sera annoncé sur la &lt;a href=&quot;https://lists.cellml.org/sympa/info/cellml-discussion&quot;&gt;liste de discussion cellml-discussion&lt;/a&gt;.</translation>
</message>
</context>
<context>
Expand Down
Expand Up @@ -29,7 +29,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

//==============================================================================

#include <QDesktopServices>
#include <QSettings>
#include <QUrl>

//==============================================================================

Expand All @@ -53,6 +55,8 @@ PmrSupportPreferencesWidget::PmrSupportPreferencesWidget(QWidget *pParent) :

connect(mGui->pmrUrlValue, &QComboBox::currentTextChanged,
this, &PmrSupportPreferencesWidget::pmrUrlValueCurrentTextChanged);
connect(mGui->noteValue, &QLabel::linkActivated,
this, &PmrSupportPreferencesWidget::noteValueLinkActivated);

mGui->pmrUrlValue->addItems(QStringList() << SettingsPreferencesPmrUrlDefault
<< StagingInstance
Expand Down Expand Up @@ -127,7 +131,7 @@ void PmrSupportPreferencesWidget::pmrUrlValueCurrentTextChanged(const QString &p
else if (!pCurrentText.compare(StagingInstance))
mGui->noteValue->setText(tr("the staging site is selected. It is used for public testing/preview of PMR developments. Data on this site is wiped periodically whenever a new public testing/preview of the PMR software suite is released for the required testing exercise."));
else if (!pCurrentText.compare(TeachingInstance))
mGui->noteValue->setText(tr("the teaching site is selected. The functionality of this site should match the primary site, but without the data persistency guarantees. While data on this site is also not permanent, any wipes to data stored will be announced on the cellml-discussion mailing list."));
mGui->noteValue->setText(tr("the teaching site is selected. The functionality of this site should match the primary site, but without the data persistency guarantees. While data on this site is also not permanent, any wipes to data stored will be announced on the <a href=\"https://lists.cellml.org/sympa/info/cellml-discussion\">cellml-discussion mailing list</a>."));
else
mGui->noteValue->setText(QString());

Expand All @@ -136,6 +140,15 @@ void PmrSupportPreferencesWidget::pmrUrlValueCurrentTextChanged(const QString &p

//==============================================================================

void PmrSupportPreferencesWidget::noteValueLinkActivated(const QString &pLink)
{
// Open the link in the user's browser

QDesktopServices::openUrl(pLink);
}

//==============================================================================

} // namespace PMRSupport
} // namespace OpenCOR

Expand Down
Expand Up @@ -78,6 +78,7 @@ class PmrSupportPreferencesWidget : public Preferences::PreferencesWidget

private slots:
void pmrUrlValueCurrentTextChanged(const QString &pCurrentText);
void noteValueLinkActivated(const QString &pLink);
};

//==============================================================================
Expand Down

0 comments on commit 6d40727

Please sign in to comment.