Skip to content

Commit

Permalink
Merge 7890a50 into 60c0956
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Mar 5, 2019
2 parents 60c0956 + 7890a50 commit 6c00a7a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
Expand Up @@ -61,6 +61,7 @@ PmrWorkspacesWindowWindow::PmrWorkspacesWindowWindow(QWidget *pParent) :
mGui(new Ui::PmrWorkspacesWindowWindow),
mInitialized(false),
mFirstTimeRetrievingWorkspaces(true),
mPmrUrl(QString()),
mAuthenticated(false),
mWaitingForPmrWebService(false)
{
Expand Down Expand Up @@ -157,6 +158,12 @@ PmrWorkspacesWindowWindow::PmrWorkspacesWindowWindow(QWidget *pParent) :
#error Unsupported platform
#endif

// Initialise (update) our PMR URL

update(PreferencesInterface::preference(PMRSupport::PluginName,
PMRSupport::SettingsPreferencesPmrUrl,
PMRSupport::SettingsPreferencesPmrUrlDefault).toString());

// Keep track of the window's visibility, so that we can request the list of
// workspaces, if necessary

Expand All @@ -165,6 +172,9 @@ PmrWorkspacesWindowWindow::PmrWorkspacesWindowWindow(QWidget *pParent) :

// Some connections to process responses from our PMR web service

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

connect(mPmrWebService, &PMRSupport::PmrWebService::information,
this, &PmrWorkspacesWindowWindow::showInformation);
connect(mPmrWebService, &PMRSupport::PmrWebService::warning,
Expand Down Expand Up @@ -195,8 +205,6 @@ PmrWorkspacesWindowWindow::PmrWorkspacesWindowWindow(QWidget *pParent) :
// Retranslate our GUI

retranslateUi();

mInitialized = true;
}

//==============================================================================
Expand Down Expand Up @@ -235,21 +243,9 @@ void PmrWorkspacesWindowWindow::loadSettings(QSettings &pSettings)
mPmrWorkspacesWindowWidget->loadSettings(pSettings);
pSettings.endGroup();

// Initialise (update) our PMR URL
// Note: we do it here rather than in our constructor because we need
// mPmrWorkspacesWindowWidget to be fully initialised...
// We are fully initialised now

update(PreferencesInterface::preference(PMRSupport::PluginName,
PMRSupport::SettingsPreferencesPmrUrl,
PMRSupport::SettingsPreferencesPmrUrlDefault).toString());

// A connection to show ourselves busy when our PMR web service is
// Note: we do it here rather than in our constructor otherwise our main
// window won't properly resize upon startup, in case we are floating
// (as opposed to being docked)...

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

//==============================================================================
Expand Down Expand Up @@ -320,7 +316,11 @@ void PmrWorkspacesWindowWindow::update(const QString &pPmrUrl)

void PmrWorkspacesWindowWindow::busy(bool pBusy, bool pResetCounter)
{
// Show ourselves as busy or not busy anymore
// Show ourselves as busy or not busy anymore, but only if we are
// initialised

if (!mInitialized)
return;

static int counter = 0;

Expand Down
7 changes: 6 additions & 1 deletion src/plugins/support/PMRSupport/src/pmrwebservicemanager.cpp
Expand Up @@ -124,7 +124,7 @@ void PmrWebServiceManager::authenticationFailed()

void PmrWebServiceManager::openBrowser(const QUrl &pUrl)
{
// Open the given URL in a temporary web browser of ours
// Open the given URL in our web browser

mWebViewerDialogUsed = true;

Expand All @@ -134,6 +134,11 @@ void PmrWebServiceManager::openBrowser(const QUrl &pUrl)
connect(mWebViewerDialog, &Core::Dialog::rejected,
this, &PmrWebServiceManager::authenticationCancelled);
} else {
mWebViewerDialog->load(QString());
// Note: this is in case we used our web brower before, in which case it
// will contain something, which we don't want to see when
// reopening it...

mWebViewerDialog->retranslateUi();
}

Expand Down
1 change: 0 additions & 1 deletion src/plugins/support/PMRSupport/src/pmrwebviewerdialog.cpp
Expand Up @@ -48,7 +48,6 @@ PmrWebViewerDialog::PmrWebViewerDialog(QWidget *pParent) :
mSettings.beginGroup(SettingsPlugins);
mSettings.beginGroup(PluginName);
mSettings.beginGroup("PmrWebViewerDialog");
qDebug(">>> %s", qPrintable(mSettings.group()));

// Customise ourselves

Expand Down

0 comments on commit 6c00a7a

Please sign in to comment.