Skip to content

Commit

Permalink
[auth] Move startup system-is-disabled blocking dialog to message bar
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Oct 6, 2015
1 parent c757446 commit 2e2e381
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
12 changes: 4 additions & 8 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,14 +562,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
mSplash->showMessage( tr( "Initializing authentication" ), Qt::AlignHCenter | Qt::AlignBottom );
qApp->processEvents();
QgsAuthManager::instance()->init( QgsApplication::pluginPath() );
if ( QgsAuthManager::instance()->isDisabled() )
{
// Don't pass 'this' as parent, or menubar doesn't complete loading of submenus (at least on Mac)
QMessageBox::warning( 0, tr( "Authentication System" ),
QgsAuthManager::instance()->disabledMessage() + "\n\n" +
tr( "Resources authenticating via the system can not be accessed." ) );
}
else
if ( !QgsAuthManager::instance()->isDisabled() )
{
masterPasswordSetup();
}
Expand Down Expand Up @@ -907,6 +900,9 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
// update windows
qApp->processEvents();

// notify user if authentication system is disabled
( void )QgsAuthGuiUtils::isDisabled( messageBar() );

fileNewBlank(); // prepare empty project, also skips any default templates from loading

// request notification of FileOpen events (double clicking a file icon in Mac OS X Finder)
Expand Down
6 changes: 3 additions & 3 deletions src/gui/auth/qgsauthguiutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ bool QgsAuthGuiUtils::isDisabled( QgsMessageBar *msgbar, int timeout )
{
if ( QgsAuthManager::instance()->isDisabled() )
{
msgbar->pushMessage( QgsAuthManager::instance()->authManTag(),
QObject::tr( "DISABLED: QCA's OpenSSL plugin missing" ),
QgsMessageBar::WARNING, timeout );
msgbar->pushMessage( QObject::tr( "Authentication System" ),
QObject::tr( "DISABLED. Resources authenticating via the system can not be accessed" ),
QgsMessageBar::CRITICAL, timeout );
return true;
}
return false;
Expand Down

0 comments on commit 2e2e381

Please sign in to comment.