-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
Hopefully for now until I work out better UX
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1283,7 +1283,6 @@ QgisApp::QgisApp() | |
, mDatabaseMenu( nullptr ) | ||
, mWebMenu( nullptr ) | ||
, mConfigMenu( nullptr ) | ||
, mConfigMenuBar( nullptr ) | ||
, mToolPopupOverviews( nullptr ) | ||
, mToolPopupDisplay( nullptr ) | ||
, mMapCanvas( nullptr ) | ||
|
@@ -2302,40 +2301,52 @@ void QgisApp::refreshProfileMenu() | |
{ | ||
mConfigMenu->clear(); | ||
QgsUserProfile *profile = userProfileManager()->userProfile(); | ||
mConfigMenu->setTitle( tr( "&User Profile: %1" ).arg( profile->alias() ) ); | ||
QString activeName = profile->name(); | ||
mConfigMenu->setTitle( tr( "&User Profiles" ) ); | ||
|
||
mConfigMenu->addSection( tr( "Active Profile" ) ); | ||
|
||
QAction *profileSection = mConfigMenu->addSection( tr( "Profiles" ) ); | ||
|
||
QAction *configSection = mConfigMenu->addSection( tr( "Config" ) ); | ||
|
||
QAction *openProfileFolderAction = mConfigMenu->addAction( tr( "Open current profile folder" ) ); | ||
connect( openProfileFolderAction, &QAction::triggered, this, [this]() | ||
{ | ||
QDesktopServices::openUrl( QUrl::fromLocalFile( userProfileManager()->userProfile()->folder() ) ); | ||
} ); | ||
|
||
QAction *newProfileAction = mConfigMenu->addAction( tr( "New profile" ) ); | ||
connect( newProfileAction, &QAction::triggered, this, &QgisApp::newProfile ); | ||
|
||
Q_FOREACH ( const QString &name, userProfileManager()->allProfiles() ) | ||
{ | ||
profile = userProfileManager()->profileForName( name ); | ||
QAction *action = mConfigMenu->addAction( profile->icon(), profile->alias() ); | ||
QAction *action = new QAction( profile->icon(), profile->alias() ); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
NathanW2
via email
Author
Member
|
||
action->setToolTip( profile->folder() ); | ||
action->setToolTip( profile->folder() ); | ||
delete profile; | ||
|
||
if ( name == activeName ) | ||
{ | ||
mConfigMenu->insertAction( profileSection, action ); | ||
} | ||
else | ||
{ | ||
mConfigMenu->insertAction( configSection, action ); | ||
} | ||
connect( action, &QAction::triggered, this, [this, name]() | ||
{ | ||
userProfileManager()->loadUserProfile( name ); | ||
} ); | ||
} | ||
mConfigMenu->addSeparator(); | ||
QAction *openProfileFolderAction = mConfigMenu->addAction( tr( "Open profile folder" ) ); | ||
connect( openProfileFolderAction, &QAction::triggered, this, [this]() | ||
{ | ||
QDesktopServices::openUrl( QUrl::fromLocalFile( userProfileManager()->userProfile()->folder() ) ); | ||
} ); | ||
|
||
QAction *newProfileAction = mConfigMenu->addAction( tr( "New profile" ) ); | ||
connect( newProfileAction, &QAction::triggered, this, &QgisApp::newProfile ); | ||
} | ||
|
||
void QgisApp::createProfileMenu() | ||
{ | ||
mConfigMenu = new QMenu(); | ||
mConfigMenu->addSeparator(); | ||
mConfigMenu->addAction( tr( "Manage Configs" ) ); | ||
|
||
mConfigMenuBar = new QMenuBar( menuBar() ); | ||
mConfigMenuBar->addMenu( mConfigMenu ); | ||
menuBar()->setCornerWidget( mConfigMenuBar ); | ||
mConfigMenuBar->show(); | ||
menuBar()->addMenu( mConfigMenu ); | ||
|
||
refreshProfileMenu(); | ||
} | ||
|
5 comments
on commit b9e545a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or slot it in the settings menu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to move it into the settings menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NathanW2 this line is failing on Travis https://dash.orfeo-toolbox.org/viewBuildError.php?buildid=283145
no issue locally here....any idea?
also, next line is duplicated.