Skip to content

Commit

Permalink
python fixes:
Browse files Browse the repository at this point in the history
- update sip bindings (including QgsRasterPipe and QgsOWSSourceSelect)
- helpConsole: show icons from resources
  • Loading branch information
jef-n committed Oct 5, 2012
1 parent b326276 commit 3c525fd
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
4 changes: 2 additions & 2 deletions python/core/raster/qgsrasterlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class QgsRasterLayer : QgsMapLayer
QList< QPair< QString, QColor > > legendSymbologyItems() const;

/** \brief Get a legend image for this layer */
QPixmap legendAsPixmap();
QPixmap legendAsPixmap() /Deprecated/;

/** \brief Overloaded version of above function that can print layer name onto legend */
QPixmap legendAsPixmapBool( bool ) /Deprecated/;
Expand Down Expand Up @@ -481,7 +481,7 @@ class QgsRasterLayer : QgsMapLayer
/** \brief Draws a thumbnail of the rasterlayer into the supplied QImage pointer
* @note added in QGIS 1.6
* */
/* void thumbnailAsImage( QImage * thepImage ); */
/* void thumbnailAsImage( QImage * thepImage ) /Deprecated/; */

/** \brief Emit a signal asking for a repaint. (inherited from maplayer) */
void triggerRepaint();
Expand Down
10 changes: 10 additions & 0 deletions python/core/raster/qgsrasterpipe.sip
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ class QgsRasterPipe
/** Try to insert interface at specified index and connect
* if connection would fail, the interface is not inserted and false is returned */
bool insert( int idx, QgsRasterInterface* theInterface /Transfer/ );
%MethodCode
sipRes = sipCpp->insert( a0, a1 );
if( !sipRes )
{
// if insertion failed transfer ownership back to python
PyObject *o = sipGetPyObject( a1, sipType_QgsRasterInterface );
if( o )
sipTransferBreak( o );
}
%End

/** Try to replace interface at specified index and connect
* if connection would fail, the interface is not inserted and false is returned */
Expand Down
1 change: 1 addition & 0 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class QgisInterface : QObject

public slots: // TODO: do these functions really need to be slots?

/* Exposed functions */
/** Set the app font size
* @param fontSize point size of font
* @note added in 2.0
Expand Down
10 changes: 10 additions & 0 deletions python/gui/qgsowssourceselect.sip
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,15 @@ class QgsOWSSourceSelect : QDialog
//! Set supported CRSs
void populateCRS();

//! Clear CRSs
void clearCRS();

//! Populate times
void populateTimes();

//! Clear times
void clearTimes();

//! Connection name
QString connName();

Expand Down Expand Up @@ -154,4 +160,8 @@ class QgsOWSSourceSelect : QDialog

//! Returns currently selected time
QString selectedTime();

//! Returns currently selected cache load control
QNetworkRequest::CacheLoadControl selectedCacheLoadControl();

};
26 changes: 13 additions & 13 deletions python/helpConsole/help.htm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "httpqrc://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="httpqrc://www.w3.org/1999/xhtml">
<head>
<title>Help Python Console</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Expand All @@ -26,7 +26,7 @@
<table id="header">
<tr>
<td>
<img src="../iconConsole/imgHelpDialog.png" />
<img src="qrc:/iconConsole/imgHelpDialog.png" />
</td>
<td>
<h2 id="headerTitle">Python Console for QGIS</h2>
Expand Down Expand Up @@ -87,35 +87,35 @@ <h4 id="toolbar">Toolbar</h4>
<p><span id="toolbarTitle">The following is a description of the tools in the toolbar:</span></p>
<table width="100%" border="0" id="headerTool">
<tr>
<td><img src="../iconConsole/iconClearConsole.png" /></td>
<td><img src="qrc:/images/console/iconClearConsole.png" /></td>
<td colspan="2"><span id="toolbarClear">Tool to clear python console</span></td>
</tr>
<tr>
<td><img src="../iconConsole/iconClassConsole.png" /></td>
<td><img src="../iconConsole/iconIfaceConsole.png" /></td>
<td><img src="qrc:/images/console/iconClassConsole.png" /></td>
<td><img src="qrc:/images/console/iconIfaceConsole.png" /></td>
<td><span id="toolbarIfaceClass">Tool to import iface class</span></td>
</tr>
<tr>
<td></td>
<td><img src="../iconConsole/iconSextanteConsole.png" /></td>
<td><img src="qrc:/images/console/iconSextanteConsole.png" /></td>
<td><span id="toolbarSextClass">Tool to import Sextante class</span></td>
</tr>
<tr>
<td><img src="../iconConsole/iconScriptConsole.png" /></td>
<td><img src="../iconConsole/iconOpenConsole.png" /></td>
<td><img src="qrc:/images/console/iconScriptConsole.png" /></td>
<td><img src="qrc:/images/console/iconOpenConsole.png" /></td>
<td><span id="toolbarScriptOpen">Tool to open a python script and load in console</span></td>
</tr>
<tr>
<td></td>
<td><img src="../iconConsole/iconSaveConsole.png" /></td>
<td><img src="qrc:/images/console/iconSaveConsole.png" /></td>
<td><span id="toolbarScriptSave">Tool to save a python script</span></td>
</tr>
<tr>
<td><img src="../iconConsole/iconHelpConsole.png" /></td>
<td><img src="qrc:/images/console/iconHelpConsole.png" /></td>
<td colspan="2"><span id="toolbarHelp">Help</span></td>
</tr>
<tr>
<td><img src="../iconConsole/iconRunConsole.png" /></td>
<td><img src="qrc:/images/console/iconRunConsole.png" /></td>
<td colspan="2"><span id="toolbarRun">Run command (like Enter key pressed)</span></td>
</tr>
</table>
Expand Down Expand Up @@ -155,4 +155,4 @@ <h4 id="thanks">Acknowledgments</h4>
encode.src = "js/encoding.js";
document.body.appendChild(encode);
</script>
</html>
</html>

0 comments on commit 3c525fd

Please sign in to comment.