Skip to content
Permalink
Browse files

Fix some HIG string violations

  • Loading branch information
nyalldawson committed Mar 22, 2018
1 parent a2ba566 commit 9c06d86ad8d4540fac84ed0173cbf0b303a3e8de
@@ -89,7 +89,7 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
mLayerTreeView->resizeColumnToContents( 0 );

// enable button
mEnabledAction = new QAction( tr( "Toggle snapping" ), this );
mEnabledAction = new QAction( tr( "Toggle Snapping" ), this );
mEnabledAction->setCheckable( true );
mEnabledAction->setIcon( QIcon( QgsApplication::getThemeIcon( "/mIconSnapping.svg" ) ) );
mEnabledAction->setToolTip( tr( "Enable Snapping (S)" ) );
@@ -111,7 +111,7 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
if ( mDisplayMode == ToolBar )
{
modeMenu->addSeparator();
QAction *openDialogAction = new QAction( tr( "Open snapping options" ), modeMenu );
QAction *openDialogAction = new QAction( tr( "Open Snapping Options…" ), modeMenu );
connect( openDialogAction, &QAction::triggered, QgisApp::instance(), &QgisApp::snappingOptions );
modeMenu->addAction( openDialogAction );
}
@@ -159,23 +159,23 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
connect( mUnitsComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsSnappingWidget::changeUnit );

// topological editing button
mTopologicalEditingAction = new QAction( tr( "Topological editing" ), this );
mTopologicalEditingAction = new QAction( tr( "Topological Editing" ), this );
mTopologicalEditingAction->setCheckable( true );
mTopologicalEditingAction->setIcon( QIcon( QgsApplication::getThemeIcon( "/mIconTopologicalEditing.svg" ) ) );
mTopologicalEditingAction->setToolTip( tr( "Enable Topological Editing" ) );
mTopologicalEditingAction->setObjectName( QStringLiteral( "TopologicalEditingAction" ) );
connect( mTopologicalEditingAction, &QAction::toggled, this, &QgsSnappingWidget::enableTopologicalEditing );

// snapping on intersection button
mIntersectionSnappingAction = new QAction( tr( "Snapping on intersection" ), this );
mIntersectionSnappingAction = new QAction( tr( "Snapping on Intersection" ), this );
mIntersectionSnappingAction->setCheckable( true );
mIntersectionSnappingAction->setIcon( QIcon( QgsApplication::getThemeIcon( "/mIconSnappingIntersection.svg" ) ) );
mIntersectionSnappingAction->setToolTip( tr( "Enable Snapping on Intersection" ) );
mIntersectionSnappingAction->setObjectName( QStringLiteral( "IntersectionSnappingAction" ) );
connect( mIntersectionSnappingAction, &QAction::toggled, this, &QgsSnappingWidget::enableIntersectionSnapping );

// snapping on intersection button
mEnableTracingAction = new QAction( tr( "Enable tracing" ), this );
mEnableTracingAction = new QAction( tr( "Enable Tracing" ), this );
mEnableTracingAction->setCheckable( true );
mEnableTracingAction->setIcon( QIcon( QgsApplication::getThemeIcon( "/mActionTracing.svg" ) ) );
mEnableTracingAction->setToolTip( tr( "Enable Tracing (T)" ) );
@@ -545,7 +545,7 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd

QModelIndex sourceIndex = mFilterModel->mapToSource( atIndex );

QAction *copyContentAction = new QAction( tr( "Copy cell content" ), this );
QAction *copyContentAction = new QAction( tr( "Copy Cell Content" ), this );
copyContentAction->setData( QVariant::fromValue<QModelIndex>( sourceIndex ) );
menu->addAction( copyContentAction );
connect( copyContentAction, &QAction::triggered, this, &QgsDualView::copyCellContent );
@@ -554,16 +554,16 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd
QgsMapCanvas *canvas = mFilterModel->mapCanvas();
if ( canvas && vl && vl->geometryType() != QgsWkbTypes::NullGeometry )
{
menu->addAction( tr( "Zoom to feature" ), this, SLOT( zoomToCurrentFeature() ) );
menu->addAction( tr( "Pan to feature" ), this, SLOT( panToCurrentFeature() ) );
menu->addAction( tr( "Flash feature" ), this, SLOT( flashCurrentFeature() ) );
menu->addAction( tr( "Zoom to Feature" ), this, SLOT( zoomToCurrentFeature() ) );
menu->addAction( tr( "Pan to Feature" ), this, SLOT( panToCurrentFeature() ) );
menu->addAction( tr( "Flash Feature" ), this, SLOT( flashCurrentFeature() ) );
}

//add user-defined actions to context menu
QList<QgsAction> actions = mLayer->actions()->actions( QStringLiteral( "Field" ) );
if ( !actions.isEmpty() )
{
QAction *a = menu->addAction( tr( "Run layer action" ) );
QAction *a = menu->addAction( tr( "Run Layer Action" ) );
a->setEnabled( false );

Q_FOREACH ( const QgsAction &action, actions )
@@ -602,11 +602,11 @@ void QgsDualView::viewWillShowContextMenu( QMenu *menu, const QModelIndex &atInd
}

menu->addSeparator();
QgsAttributeTableAction *a = new QgsAttributeTableAction( tr( "Open form" ), this, QString(), sourceIndex );
QgsAttributeTableAction *a = new QgsAttributeTableAction( tr( "Open Form" ), this, QString(), sourceIndex );
#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0)
menu->addAction( tr( "Open form" ), a, SLOT( featureForm() ) );
menu->addAction( tr( "Open Form" ), a, SLOT( featureForm() ) );
#else
menu->addAction( tr( "Open form" ), a, &QgsAttributeTableAction::featureForm );
menu->addAction( tr( "Open Form" ), a, &QgsAttributeTableAction::featureForm );
#endif
}

@@ -624,11 +624,11 @@ void QgsDualView::showViewHeaderMenu( QPoint point )
delete mHorizontalHeaderMenu;
mHorizontalHeaderMenu = new QMenu( this );

QAction *hide = new QAction( tr( "&Hide column" ), mHorizontalHeaderMenu );
QAction *hide = new QAction( tr( "&Hide Column" ), mHorizontalHeaderMenu );
connect( hide, &QAction::triggered, this, &QgsDualView::hideColumn );
hide->setData( col );
mHorizontalHeaderMenu->addAction( hide );
QAction *setWidth = new QAction( tr( "&Set width" ), mHorizontalHeaderMenu );
QAction *setWidth = new QAction( tr( "&Set Width" ), mHorizontalHeaderMenu );
connect( setWidth, &QAction::triggered, this, &QgsDualView::resizeColumn );
setWidth->setData( col );
mHorizontalHeaderMenu->addAction( setWidth );
@@ -638,7 +638,7 @@ void QgsDualView::showViewHeaderMenu( QPoint point )
mHorizontalHeaderMenu->addAction( optimizeWidth );

mHorizontalHeaderMenu->addSeparator();
QAction *organize = new QAction( tr( "&Organize columns" ), mHorizontalHeaderMenu );
QAction *organize = new QAction( tr( "&Organize Columns" ), mHorizontalHeaderMenu );
connect( organize, &QAction::triggered, this, &QgsDualView::organizeColumns );
mHorizontalHeaderMenu->addAction( organize );
QAction *sort = new QAction( tr( "&Sort…" ), mHorizontalHeaderMenu );
@@ -129,9 +129,9 @@ QAction *QgsLayerTreeViewDefaultActions::actionCheckAndAllChildren( QObject *par
if ( !node || !QgsLayerTree::isGroup( node ) || node->isItemVisibilityCheckedRecursive() )
return nullptr;
#ifdef Q_OS_MACX
QAction *a = new QAction( tr( "Check and all its children (⌘-click)" ), parent );
QAction *a = new QAction( tr( "Check and all its Children (⌘-click)" ), parent );
#else
QAction *a = new QAction( tr( "Check and all its children (Ctrl-click)" ), parent );
QAction *a = new QAction( tr( "Check and all its Children (Ctrl-click)" ), parent );
#endif
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::checkAndAllChildren );
return a;
@@ -143,9 +143,9 @@ QAction *QgsLayerTreeViewDefaultActions::actionUncheckAndAllChildren( QObject *p
if ( !node || !QgsLayerTree::isGroup( node ) || node->isItemVisibilityUncheckedRecursive() )
return nullptr;
#ifdef Q_OS_MACX
QAction *a = new QAction( tr( "Uncheck and all its children (⌘-click)" ), parent );
QAction *a = new QAction( tr( "Uncheck and all its Children (⌘-click)" ), parent );
#else
QAction *a = new QAction( tr( "Uncheck and all its children (Ctrl-click)" ), parent );
QAction *a = new QAction( tr( "Uncheck and all its Children (Ctrl-click)" ), parent );
#endif
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::uncheckAndAllChildren );
return a;
@@ -156,7 +156,7 @@ QAction *QgsLayerTreeViewDefaultActions::actionCheckAndAllParents( QObject *pare
QgsLayerTreeNode *node = mView->currentNode();
if ( !node || !QgsLayerTree::isLayer( node ) || node->isVisible() )
return nullptr;
QAction *a = new QAction( tr( "Check and all its parents" ), parent );
QAction *a = new QAction( tr( "Check and all its Parents" ), parent );
connect( a, &QAction::triggered, this, &QgsLayerTreeViewDefaultActions::checkAndAllParents );
return a;
}
@@ -433,7 +433,7 @@ void QgsColorButton::prepareMenu()

if ( mShowNull )
{
QAction *nullAction = new QAction( tr( "Clear color" ), this );
QAction *nullAction = new QAction( tr( "Clear Color" ), this );
nullAction->setIcon( createMenuIcon( Qt::transparent, false ) );
mMenu->addAction( nullAction );
connect( nullAction, &QAction::triggered, this, &QgsColorButton::setToNull );
@@ -442,7 +442,7 @@ void QgsColorButton::prepareMenu()
//show default color option if set
if ( mDefaultColor.isValid() )
{
QAction *defaultColorAction = new QAction( tr( "Default color" ), this );
QAction *defaultColorAction = new QAction( tr( "Default Color" ), this );
defaultColorAction->setIcon( createMenuIcon( mDefaultColor ) );
mMenu->addAction( defaultColorAction );
connect( defaultColorAction, &QAction::triggered, this, &QgsColorButton::setToDefaultColor );
@@ -494,11 +494,11 @@ void QgsColorButton::prepareMenu()

mMenu->addSeparator();

QAction *copyColorAction = new QAction( tr( "Copy color" ), this );
QAction *copyColorAction = new QAction( tr( "Copy Color" ), this );
mMenu->addAction( copyColorAction );
connect( copyColorAction, &QAction::triggered, this, &QgsColorButton::copyColor );

QAction *pasteColorAction = new QAction( tr( "Paste color" ), this );
QAction *pasteColorAction = new QAction( tr( "Paste Color" ), this );
//enable or disable paste action based on current clipboard contents. We always show the paste
//action, even if it's disabled, to give hint to the user that pasting colors is possible
QColor clipColor;
@@ -516,11 +516,11 @@ void QgsColorButton::prepareMenu()
//disabled for OSX, as it is impossible to grab the mouse under OSX
//see note for QWidget::grabMouse() re OSX Cocoa
//http://qt-project.org/doc/qt-4.8/qwidget.html#grabMouse
QAction *pickColorAction = new QAction( tr( "Pick color" ), this );
QAction *pickColorAction = new QAction( tr( "Pick Color" ), this );
mMenu->addAction( pickColorAction );
connect( pickColorAction, &QAction::triggered, this, &QgsColorButton::activatePicker );

QAction *chooseColorAction = new QAction( tr( "Choose color" ), this );
QAction *chooseColorAction = new QAction( tr( "Choose Color" ), this );
mMenu->addAction( chooseColorAction );
connect( chooseColorAction, &QAction::triggered, this, &QgsColorButton::showColorDialog );
}
@@ -230,14 +230,14 @@ void QgsColorRampButton::prepareMenu()
{
mMenu->clear();

QAction *invertAction = new QAction( tr( "Invert color ramp" ), this );
QAction *invertAction = new QAction( tr( "Invert Color Ramp" ), this );
invertAction->setEnabled( !isNull() && !isRandomColorRamp() );
mMenu->addAction( invertAction );
connect( invertAction, &QAction::triggered, this, &QgsColorRampButton::invertColorRamp );

if ( mShowNull )
{
QAction *nullAction = new QAction( tr( "Clear current ramp" ), this );
QAction *nullAction = new QAction( tr( "Clear Current Ramp" ), this );
mMenu->addAction( nullAction );
connect( nullAction, &QAction::triggered, this, &QgsColorRampButton::setToNull );
}
@@ -247,23 +247,23 @@ void QgsColorRampButton::prepareMenu()
//show default color option if set
if ( mDefaultColorRamp )
{
QAction *defaultColorRampAction = new QAction( tr( "Default color ramp" ), this );
QAction *defaultColorRampAction = new QAction( tr( "Default Color Ramp" ), this );
defaultColorRampAction->setIcon( createMenuIcon( mDefaultColorRamp ) );
mMenu->addAction( defaultColorRampAction );
connect( defaultColorRampAction, &QAction::triggered, this, &QgsColorRampButton::setToDefaultColorRamp );
}

if ( mShowRandomColorRamp )
{
QAction *randomColorRampAction = new QAction( tr( "Random color ramp" ), this );
QAction *randomColorRampAction = new QAction( tr( "Random Color Ramp" ), this );
randomColorRampAction->setCheckable( true );
randomColorRampAction->setChecked( isRandomColorRamp() );
mMenu->addAction( randomColorRampAction );
connect( randomColorRampAction, &QAction::triggered, this, &QgsColorRampButton::setRandomColorRamp );

if ( isRandomColorRamp() || dynamic_cast<QgsLimitedRandomColorRamp *>( mColorRamp ) )
{
QAction *shuffleRandomColorRampAction = new QAction( tr( "Shuffle random colors" ), this );
QAction *shuffleRandomColorRampAction = new QAction( tr( "Shuffle Random Colors" ), this );
mMenu->addAction( shuffleRandomColorRampAction );
connect( shuffleRandomColorRampAction, &QAction::triggered, this, &QgsColorRampButton::colorRampChanged );
}
@@ -309,16 +309,16 @@ void QgsColorRampButton::prepareMenu()

mMenu->addSeparator();

QAction *newColorRampAction = new QAction( tr( "Create new color ramp" ), this );
QAction *newColorRampAction = new QAction( tr( "Create New Color Ramp" ), this );
connect( newColorRampAction, &QAction::triggered, this, &QgsColorRampButton::createColorRamp );
mMenu->addAction( newColorRampAction );

QAction *editColorRampAction = new QAction( tr( "Edit color ramp" ), this );
QAction *editColorRampAction = new QAction( tr( "Edit Color Ramp" ), this );
editColorRampAction->setEnabled( !isNull() && !isRandomColorRamp() );
connect( editColorRampAction, &QAction::triggered, this, &QgsColorRampButton::showColorRampDialog );
mMenu->addAction( editColorRampAction );

QAction *saveColorRampAction = new QAction( tr( "Save color ramp" ), this );
QAction *saveColorRampAction = new QAction( tr( "Save Color Ramp" ), this );
saveColorRampAction->setEnabled( !isNull() && !isRandomColorRamp() );
connect( saveColorRampAction, &QAction::triggered, this, &QgsColorRampButton::saveColorRamp );
mMenu->addAction( saveColorRampAction );
@@ -582,14 +582,14 @@ void QgsFontButton::prepareMenu()
}
mMenu->addMenu( recentFontMenu );

QAction *configureAction = new QAction( tr( "Configure format" ), this );
QAction *configureAction = new QAction( tr( "Configure Format" ), this );
mMenu->addAction( configureAction );
connect( configureAction, &QAction::triggered, this, &QgsFontButton::showSettingsDialog );

QAction *copyFormatAction = new QAction( tr( "Copy format" ), this );
QAction *copyFormatAction = new QAction( tr( "Copy Format" ), this );
mMenu->addAction( copyFormatAction );
connect( copyFormatAction, &QAction::triggered, this, &QgsFontButton::copyFormat );
QAction *pasteFormatAction = new QAction( tr( "Paste format" ), this );
QAction *pasteFormatAction = new QAction( tr( "Paste Format" ), this );
//enable or disable paste action based on current clipboard contents. We always show the paste
//action, even if it's disabled, to give hint to the user that pasting colors is possible
QgsTextFormat tempFormat;
@@ -654,11 +654,11 @@ void QgsFontButton::prepareMenu()

mMenu->addSeparator();

QAction *copyColorAction = new QAction( tr( "Copy color" ), this );
QAction *copyColorAction = new QAction( tr( "Copy Color" ), this );
mMenu->addAction( copyColorAction );
connect( copyColorAction, &QAction::triggered, this, &QgsFontButton::copyColor );

QAction *pasteColorAction = new QAction( tr( "Paste color" ), this );
QAction *pasteColorAction = new QAction( tr( "Paste Color" ), this );
//enable or disable paste action based on current clipboard contents. We always show the paste
//action, even if it's disabled, to give hint to the user that pasting colors is possible
QColor clipColor;
@@ -26,10 +26,10 @@ QgsLegendFilterButton::QgsLegendFilterButton( QWidget *parent )

{
mMenu = new QMenu( this );
mSetExpressionAction = new QAction( tr( "Edit filter expression" ), mMenu );
mSetExpressionAction = new QAction( tr( "Edit Filter Expression…" ), mMenu );
connect( mSetExpressionAction, &QAction::triggered, this, &QgsLegendFilterButton::onSetLegendFilterExpression );

mClearExpressionAction = new QAction( tr( "Clear filter expression" ), mMenu );
mClearExpressionAction = new QAction( tr( "Clear Filter Fxpression" ), mMenu );
connect( mClearExpressionAction, &QAction::triggered, this, &QgsLegendFilterButton::onClearFilterExpression );
mClearExpressionAction->setEnabled( false );

@@ -70,7 +70,7 @@ QgsMessageBar::QgsMessageBar( QWidget *parent )

mCloseMenu = new QMenu( this );
mCloseMenu->setObjectName( QStringLiteral( "mCloseMenu" ) );
mActionCloseAll = new QAction( tr( "Close all" ), this );
mActionCloseAll = new QAction( tr( "Close All" ), this );
mCloseMenu->addAction( mActionCloseAll );
connect( mActionCloseAll, &QAction::triggered, this, &QgsMessageBar::clearWidgets );

@@ -71,7 +71,7 @@ QgsPropertyOverrideButton::QgsPropertyOverrideButton( QWidget *parent,

mActionDescription = new QAction( tr( "Description…" ), this );

mActionCreateAuxiliaryField = new QAction( tr( "Store data in the project" ), this );
mActionCreateAuxiliaryField = new QAction( tr( "Store Data in the Project" ), this );
mActionCreateAuxiliaryField->setCheckable( true );

mActionExpDialog = new QAction( tr( "Edit…" ), this );
@@ -307,14 +307,14 @@ void QgsSymbolButton::prepareMenu()
//menu is opened, otherwise color schemes like the recent color scheme grid are meaningless
mMenu->clear();

QAction *configureAction = new QAction( tr( "Configure symbol" ), this );
QAction *configureAction = new QAction( tr( "Configure Symbol" ), this );
mMenu->addAction( configureAction );
connect( configureAction, &QAction::triggered, this, &QgsSymbolButton::showSettingsDialog );

QAction *copySymbolAction = new QAction( tr( "Copy symbol" ), this );
QAction *copySymbolAction = new QAction( tr( "Copy Symbol" ), this );
mMenu->addAction( copySymbolAction );
connect( copySymbolAction, &QAction::triggered, this, &QgsSymbolButton::copySymbol );
QAction *pasteSymbolAction = new QAction( tr( "Paste symbol" ), this );
QAction *pasteSymbolAction = new QAction( tr( "Paste Symbol" ), this );
//enable or disable paste action based on current clipboard contents. We always show the paste
//action, even if it's disabled, to give hint to the user that pasting symbols is possible
std::unique_ptr< QgsSymbol > tempSymbol( QgsSymbolLayerUtils::symbolFromMimeData( QApplication::clipboard()->mimeData() ) );
@@ -369,11 +369,11 @@ void QgsSymbolButton::prepareMenu()

mMenu->addSeparator();

QAction *copyColorAction = new QAction( tr( "Copy color" ), this );
QAction *copyColorAction = new QAction( tr( "Copy Color" ), this );
mMenu->addAction( copyColorAction );
connect( copyColorAction, &QAction::triggered, this, &QgsSymbolButton::copyColor );

QAction *pasteColorAction = new QAction( tr( "Paste color" ), this );
QAction *pasteColorAction = new QAction( tr( "Paste Color" ), this );
//enable or disable paste action based on current clipboard contents. We always show the paste
//action, even if it's disabled, to give hint to the user that pasting colors is possible
QColor clipColor;

0 comments on commit 9c06d86

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