Skip to content
Permalink
Browse files

make custom widget tooltips translatable

  • Loading branch information
jef-n committed Aug 20, 2014
1 parent dbf2834 commit a05c4c8030dd1edf53685d39a0c87a290635985d
@@ -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.
@@ -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
@@ -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
@@ -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
@@ -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
*/
@@ -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
*
@@ -37,7 +37,6 @@ class CORE_EXPORT QgsNetworkContentFetcher : public QObject
Q_OBJECT

public:

QgsNetworkContentFetcher();

virtual ~QgsNetworkContentFetcher();
@@ -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
@@ -71,7 +71,7 @@ void QgsColorButtonPlugin::initialize( QDesignerFormEditorInterface *core )

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

QString QgsColorButtonPlugin::whatsThis() const
@@ -71,7 +71,7 @@ void QgsColorButtonV2Plugin::initialize( QDesignerFormEditorInterface *core )

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

QString QgsColorButtonV2Plugin::whatsThis() const
@@ -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
@@ -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
@@ -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
@@ -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
@@ -71,7 +71,7 @@ void QgsRelationReferenceWidgetPlugin::initialize( QDesignerFormEditorInterface

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

QString QgsRelationReferenceWidgetPlugin::whatsThis() const
@@ -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
@@ -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
*/

0 comments on commit a05c4c8

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