@@ -205,9 +205,14 @@ QgsStyleManagerDialog::QgsStyleManagerDialog( QgsStyle *style, QWidget *parent,
205
205
}
206
206
if ( mStyle != QgsStyle::defaultStyle () )
207
207
{
208
- mActionCopyToDefault = new QAction ( tr ( " Copy Selection to Default Style" ), this );
208
+ mActionCopyToDefault = new QAction ( tr ( " Copy Selection to Default Style… " ), this );
209
209
shareMenu->addAction ( mActionCopyToDefault );
210
210
connect ( mActionCopyToDefault , &QAction::triggered, this , &QgsStyleManagerDialog::copyItemsToDefault );
211
+ connect ( mCopyToDefaultButton , &QPushButton::clicked, this , &QgsStyleManagerDialog::copyItemsToDefault );
212
+ }
213
+ else
214
+ {
215
+ mCopyToDefaultButton ->hide ();
211
216
}
212
217
213
218
shareMenu->addSeparator ();
@@ -386,6 +391,9 @@ QgsStyleManagerDialog::QgsStyleManagerDialog( QgsStyle *style, QWidget *parent,
386
391
// note -- we have to save state here and not in destructor, as new symbol list widgets are created before the previous ones are destroyed
387
392
QgsSettings ().setValue ( QStringLiteral ( " Windows/StyleV2Manager/treeState" ), mSymbolTreeView ->header ()->saveState (), QgsSettings::Gui );
388
393
} );
394
+
395
+ // set initial disabled state for actions requiring a selection
396
+ selectedSymbolsChanged ( QItemSelection (), QItemSelection () );
389
397
}
390
398
391
399
void QgsStyleManagerDialog::onFinished ()
@@ -1596,6 +1604,7 @@ void QgsStyleManagerDialog::selectedSymbolsChanged( const QItemSelection &select
1596
1604
actnExportAsSVG->setDisabled ( nothingSelected );
1597
1605
if ( mActionCopyToDefault )
1598
1606
mActionCopyToDefault ->setDisabled ( nothingSelected );
1607
+ mCopyToDefaultButton ->setDisabled ( nothingSelected );
1599
1608
actnEditItem->setDisabled ( nothingSelected || mReadOnly );
1600
1609
}
1601
1610
0 commit comments