Skip to content
Permalink
Browse files

Correct use of ellipsis in style menus (fix #10549)

  • Loading branch information
nyalldawson committed Jul 13, 2015
1 parent 36992b3 commit d36cd0272287342b2fabc7eb9134c23905132e4b
@@ -33,7 +33,7 @@ QgsMapLayerStyleGuiUtils* QgsMapLayerStyleGuiUtils::instance()

QAction* QgsMapLayerStyleGuiUtils::actionAddStyle( QgsMapLayer* layer, QObject* parent )
{
QAction* a = new QAction( tr( "Add" ), parent );
QAction* a = new QAction( tr( "Add..." ), parent );
a->setData( QVariant::fromValue<QObject*>( layer ) );
connect( a, SIGNAL( triggered() ), this, SLOT( addStyle() ) );
return a;
@@ -50,7 +50,7 @@ QAction* QgsMapLayerStyleGuiUtils::actionRemoveStyle( QgsMapLayer* layer, QObjec

QAction* QgsMapLayerStyleGuiUtils::actionRenameStyle( QgsMapLayer* layer, QObject* parent )
{
QAction* a = new QAction( tr( "Rename Current" ), parent );
QAction* a = new QAction( tr( "Rename Current..." ), parent );
a->connect( a, SIGNAL( triggered() ), this, SLOT( renameStyle() ) );
a->setData( QVariant::fromValue<QObject*>( layer ) );
return a;
@@ -97,7 +97,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
m->addAction( tr( "Load Style..." ), this, SLOT( loadStyle_clicked() ) );
m->addAction( tr( "Save Style..." ), this, SLOT( saveStyleAs_clicked() ) );
m->addSeparator();
m->addAction( tr( "Save As Default" ), this, SLOT( saveDefaultStyle_clicked() ) );
m->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultStyle_clicked() ) );
m->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultStyle_clicked() ) );
b->setMenu( m );
connect( m, SIGNAL( aboutToShow() ), this, SLOT( aboutToShowStyleMenu() ) );
@@ -92,10 +92,10 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(

QPushButton* b = new QPushButton( tr( "Style" ) );
QMenu* m = new QMenu( this );
mActionLoadStyle = m->addAction( tr( "Load Style..." ), this, SLOT( loadStyle_clicked() ) );
mActionSaveStyleAs = m->addAction( tr( "Save Style..." ), this, SLOT( saveStyleAs_clicked() ) );
mActionLoadStyle = m->addAction( tr( "Load Style" ), this, SLOT( loadStyle_clicked() ) );
mActionSaveStyleAs = m->addAction( tr( "Save Style" ), this, SLOT( saveStyleAs_clicked() ) );
m->addSeparator();
m->addAction( tr( "Save As Default" ), this, SLOT( saveDefaultStyle_clicked() ) );
m->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultStyle_clicked() ) );
m->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultStyle_clicked() ) );
b->setMenu( m );
connect( m, SIGNAL( aboutToShow() ), this, SLOT( aboutToShowStyleMenu() ) );
@@ -161,15 +161,15 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(

// Create the menu for the save style button to choose the output format
mSaveAsMenu = new QMenu( this );
mSaveAsMenu->addAction( tr( "QGIS Layer Style File" ) );
mSaveAsMenu->addAction( tr( "SLD File" ) );
mSaveAsMenu->addAction( tr( "QGIS Layer Style File..." ) );
mSaveAsMenu->addAction( tr( "SLD File..." ) );

//Only if the provider support loading & saving styles to db add new choices
if ( layer->dataProvider()->isSaveAndLoadStyleToDBSupported() )
{
//for loading
mLoadStyleMenu = new QMenu();
mLoadStyleMenu->addAction( tr( "Load from file" ) );
mLoadStyleMenu->addAction( tr( "Load from file..." ) );
mLoadStyleMenu->addAction( tr( "Load from database" ) );
//mActionLoadStyle->setContextMenuPolicy( Qt::PreventContextMenu );
mActionLoadStyle->setMenu( mLoadStyleMenu );

0 comments on commit d36cd02

Please sign in to comment.
You can’t perform that action at this time.