Skip to content

Commit

Permalink
make custom widget tooltips translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Aug 20, 2014
1 parent dbf2834 commit a05c4c8
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 28 deletions.
6 changes: 3 additions & 3 deletions python/core/composer/qgscomposerpicture.sip
Expand Up @@ -53,10 +53,10 @@ class QgsComposerPicture: QgsComposerItem
* @returns path to the source image
* @see usePictureExpression
* @see setPictureFile
* @deprecated use picturePath instead
* @deprecated use picturePath instead
*/
QString pictureFile() const /Deprecated/;

/**Sets the source path of the image (may be svg or a raster format). Data defined
* picture source may override this value. The path can either be a local path
* or a remote (http) path.
Expand All @@ -74,7 +74,7 @@ class QgsComposerPicture: QgsComposerItem
* @see setPicturePath
* @note added in QGIS 2.5
*/
QString picturePath() const;
QString picturePath() const;


/**Sets this items bound in scene coordinates such that 1 item size units
Expand Down
7 changes: 3 additions & 4 deletions python/core/qgsnetworkcontentfetcher.sip
Expand Up @@ -23,18 +23,17 @@ class QgsNetworkContentFetcher : QObject
* @param url URL to fetch
*/
void fetchContent( const QUrl url );

/**Returns a reference to the network reply
* @returns QNetworkReply for fetched URL content
*/
QNetworkReply* reply();



/**Returns the fetched content as a string
* @returns string containing network content
*/
QString contentAsString() const;

signals:

/**Emitted when content has loaded
Expand Down
31 changes: 30 additions & 1 deletion python/gui/qgisinterface.sip
Expand Up @@ -512,15 +512,44 @@ class QgisInterface : QObject

/**
* Open feature form
* @return true when dialog was accepted
* @param l vector layer
* @param f feature to show/modify
* @param updateFeatureOnly only update the feature update (don't change any attributes of the layer) [UNUSED]
* @param showModal if true, will wait for the dialog to be executed (only shown otherwise)
* @note added in 1.6
*/
virtual bool openFeatureForm( QgsVectorLayer *l, QgsFeature &f, bool updateFeatureOnly = false, bool showModal = true ) = 0;

/**
* Returns a feature form for a given feature
*
* @param l The layer for which the dialog will be created
* @param f The feature for which the dialog will be created
*
* @return A feature form
*/
virtual QgsAttributeDialog* getFeatureForm( QgsVectorLayer *l, QgsFeature &f ) = 0;

/**
* Access the vector layer tools instance.
* With the help of this you can access methods like addFeature, startEditing
* or stopEditing while giving the user the appropriate dialogs.
*
* @return An instance of the vector layer tools
*/
virtual QgsVectorLayerTools* vectorLayerTools() = 0;

/** This method is only needed when using a UI form with a custom widget plugin and calling
* openFeatureForm or getFeatureForm from Python (PyQt4) and you havn't used the info tool first.
* Python will crash bringing QGIS wtih it
* if the custom form is not loaded from a C++ method call.
*
* This method uses a QTimer to call QUiLoader in order to load the form via C++
* you only need to call this once after that you can call openFeatureForm/getFeatureForm
* like normal
*
* More information here: http://qt-project.org/forums/viewthread/27098/
*/
virtual void preloadForm( QString uifile ) = 0;

/** Return vector layers in edit mode
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisappinterface.h
Expand Up @@ -437,7 +437,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
* returns true when dialog was accepted (if shown modal, true otherwise)
* @param l vector layer
* @param f feature to show/modify
* @param updateFeatureOnly only update the feature update (don't change any attributes of the layer)
* @param updateFeatureOnly only update the feature update (don't change any attributes of the layer) [UNUSED]
* @param showModal if true, will wait for the dialog to be executed (only shown otherwise)
* @note added in 1.6
*/
Expand Down
1 change: 1 addition & 0 deletions src/core/pal/layer.h
Expand Up @@ -317,6 +317,7 @@ namespace pal
* @param xOffset map unit (+/-) to x-offset the label
* @param yOffset map unit (+/-) to y-offset the label
* @param alwaysShow whether to skip priority and always show the label (causes overlapping)
* @param repeatDistance distance for repeating the label
*
* @throws PalException::FeatureExists
*
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsnetworkcontentfetcher.h
Expand Up @@ -37,7 +37,6 @@ class CORE_EXPORT QgsNetworkContentFetcher : public QObject
Q_OBJECT

public:

QgsNetworkContentFetcher();

virtual ~QgsNetworkContentFetcher();
Expand Down
4 changes: 2 additions & 2 deletions src/customwidgets/qgscollapsiblegroupboxplugin.cpp
Expand Up @@ -71,12 +71,12 @@ void QgsCollapsibleGroupBoxPlugin::initialize( QDesignerFormEditorInterface *cor

QString QgsCollapsibleGroupBoxPlugin::toolTip() const
{
return "A collapsible group box";
return tr( "A collapsible group box" );
}

QString QgsCollapsibleGroupBoxPlugin::whatsThis() const
{
return "A collapsible group box with save state capability";
return tr( "A collapsible group box with save state capability" );
}

QString QgsCollapsibleGroupBoxPlugin::domXml() const
Expand Down
2 changes: 1 addition & 1 deletion src/customwidgets/qgscolorbuttonplugin.cpp
Expand Up @@ -71,7 +71,7 @@ void QgsColorButtonPlugin::initialize( QDesignerFormEditorInterface *core )

QString QgsColorButtonPlugin::toolTip() const
{
return "Select color";
return tr( "Select color" );
}

QString QgsColorButtonPlugin::whatsThis() const
Expand Down
2 changes: 1 addition & 1 deletion src/customwidgets/qgscolorbuttonv2plugin.cpp
Expand Up @@ -71,7 +71,7 @@ void QgsColorButtonV2Plugin::initialize( QDesignerFormEditorInterface *core )

QString QgsColorButtonV2Plugin::toolTip() const
{
return "Select color";
return tr( "Select color" );
}

QString QgsColorButtonV2Plugin::whatsThis() const
Expand Down
4 changes: 2 additions & 2 deletions src/customwidgets/qgsdatadefinedbuttonplugin.cpp
Expand Up @@ -71,12 +71,12 @@ void QgsDataDefinedButtonPlugin::initialize( QDesignerFormEditorInterface *core

QString QgsDataDefinedButtonPlugin::toolTip() const
{
return "A widget to define the scale range";
return tr( "A widget to define the scale range" );
}

QString QgsDataDefinedButtonPlugin::whatsThis() const
{
return "A widget to define the scale range.";
return tr( "A widget to define the scale range." );
}

QString QgsDataDefinedButtonPlugin::domXml() const
Expand Down
4 changes: 2 additions & 2 deletions src/customwidgets/qgsfieldcomboboxplugin.cpp
Expand Up @@ -71,12 +71,12 @@ void QgsFieldComboBoxPlugin::initialize( QDesignerFormEditorInterface *core )

QString QgsFieldComboBoxPlugin::toolTip() const
{
return "A combo box to list the fields of a layer";
return tr( "A combo box to list the fields of a layer" );
}

QString QgsFieldComboBoxPlugin::whatsThis() const
{
return "A combo box to list the field of a layer.";
return tr( "A combo box to list the field of a layer." );
}

QString QgsFieldComboBoxPlugin::domXml() const
Expand Down
4 changes: 2 additions & 2 deletions src/customwidgets/qgsfieldexpressionwidgetplugin.cpp
Expand Up @@ -71,12 +71,12 @@ void QgsFieldExpressionWidgetPlugin::initialize( QDesignerFormEditorInterface *c

QString QgsFieldExpressionWidgetPlugin::toolTip() const
{
return "An editable combo box to enter an expression";
return tr( "An editable combo box to enter an expression" );
}

QString QgsFieldExpressionWidgetPlugin::whatsThis() const
{
return "An editable combo box to enter an expression. A button allows opening the expression dialog. Expression are evaluated to detect errors.";
return tr( "An editable combo box to enter an expression. A button allows opening the expression dialog. Expression are evaluated to detect errors." );
}

QString QgsFieldExpressionWidgetPlugin::domXml() const
Expand Down
4 changes: 2 additions & 2 deletions src/customwidgets/qgsmaplayercomboboxplugin.cpp
Expand Up @@ -71,12 +71,12 @@ void QgsMapLayerComboBoxPlugin::initialize( QDesignerFormEditorInterface *core )

QString QgsMapLayerComboBoxPlugin::toolTip() const
{
return "A combo box to list the layers";
return tr( "A combo box to list the layers" );
}

QString QgsMapLayerComboBoxPlugin::whatsThis() const
{
return "A combo box to list the layers registered in QGIS. Layers might be filtered according to their type.";
return tr( "A combo box to list the layers registered in QGIS. Layers might be filtered according to their type." );
}

QString QgsMapLayerComboBoxPlugin::domXml() const
Expand Down
2 changes: 1 addition & 1 deletion src/customwidgets/qgsrelationreferencewidgetplugin.cpp
Expand Up @@ -71,7 +71,7 @@ void QgsRelationReferenceWidgetPlugin::initialize( QDesignerFormEditorInterface

QString QgsRelationReferenceWidgetPlugin::toolTip() const
{
return "Relation reference";
return tr( "Relation reference" );
}

QString QgsRelationReferenceWidgetPlugin::whatsThis() const
Expand Down
4 changes: 2 additions & 2 deletions src/customwidgets/qgsscalerangewidgetplugin.cpp
Expand Up @@ -71,12 +71,12 @@ void QgsScaleRangeWidgetPlugin::initialize( QDesignerFormEditorInterface *core )

QString QgsScaleRangeWidgetPlugin::toolTip() const
{
return "A widget to define the scale range";
return tr( "A widget to define the scale range" );
}

QString QgsScaleRangeWidgetPlugin::whatsThis() const
{
return "A widget to define the scale range.";
return tr( "A widget to define the scale range." );
}

QString QgsScaleRangeWidgetPlugin::domXml() const
Expand Down
9 changes: 6 additions & 3 deletions src/gui/qgisinterface.h
Expand Up @@ -567,16 +567,19 @@ class GUI_EXPORT QgisInterface : public QObject

/**
* Open feature form
* @return true when dialog was accepted
* @param l vector layer
* @param f feature to show/modify
* @param updateFeatureOnly only update the feature update (don't change any attributes of the layer) [UNUSED]
* @param showModal if true, will wait for the dialog to be executed (only shown otherwise)
* @note added in 1.6
*/
virtual bool openFeatureForm( QgsVectorLayer *l, QgsFeature &f, bool updateFeatureOnly = false, bool showModal = true ) = 0;

/**
* Returns a feature form for a given feature
*
* @param layer The layer for which the dialog will be created
* @param feature The feature for which the dialog will be created
* @param l The layer for which the dialog will be created
* @param f The feature for which the dialog will be created
*
* @return A feature form
*/
Expand Down

0 comments on commit a05c4c8

Please sign in to comment.