Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/qgis/Quantum-GIS
Conflicts:
	python/plugins/sextante/algs/ftools/Difference.py
	python/plugins/sextante/algs/ftools/Intersection.py
	python/plugins/sextante/outputs/OutputTable.py
  • Loading branch information
volaya committed Jan 21, 2013
2 parents 995ede3 + 0757e42 commit 2231971
Show file tree
Hide file tree
Showing 152 changed files with 5,847 additions and 4,326 deletions.
46 changes: 23 additions & 23 deletions doc/TRANSLATORS

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions doc/msvc.t2t
Expand Up @@ -112,8 +112,9 @@ box, browse to the top level QGIS directory.
In the //Where to build the binaries:// box, browse to the 'build' directory you
created.

Adjust the path to bison and flex so that the shortened ``C:/Progra~1`` is used
rather than ``C:/Program Files``.
If the path to bison and flex contains blanks, you need to use the short name
for the directory (i.e. ``C:\Program Files`` should be rewritten to
``C:\Progra~n``, where ``n`` is the number as shown in `dir /x C:\``).

Verify that the 'BINDINGS_GLOBAL_INSTALL' option is not checked, so that python
bindings are placed into the output directory when you run the INSTALL target.
Expand Down
3,111 changes: 1,597 additions & 1,514 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

967 changes: 491 additions & 476 deletions i18n/qgis_pt_PT.ts

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions images/images.qrc
Expand Up @@ -225,6 +225,8 @@
<file>themes/default/mIconRenderingDisabled.png</file>
<file>themes/default/mIconSymbology.png</file>
<file>themes/default/mIconTableLayer.png</file>
<file>themes/default/mIconTimerPause.png</file>
<file>themes/default/mIconTimerContinue.png</file>
<file>themes/default/mIconUnknownLayerType.png</file>
<file>themes/default/mIconVectorLayer.png</file>
<file>themes/default/mIconWaitingForLayerType.png</file>
Expand Down
Binary file added images/themes/default/mIconTimerContinue.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/mIconTimerPause.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion python/analysis/network/qgsarcproperter.sip
Expand Up @@ -29,7 +29,7 @@ class QgsArcProperter
* default constructor
*/
QgsArcProperter();

/**
* QgsGraphDirector call this method for fetching attribute from source layer
* \return required attributes list
Expand Down
2 changes: 1 addition & 1 deletion python/analysis/network/qgsdistancearcproperter.sip
Expand Up @@ -4,7 +4,7 @@ class QgsDistanceArcProperter : QgsArcProperter
%TypeHeaderCode
#include <qgsdistancearcproperter.h>
%End

public:
virtual QVariant property( double distance, const QgsFeature& ) const;
};
Expand Down
12 changes: 6 additions & 6 deletions python/analysis/network/qgsgraphanalyzer.sip
Expand Up @@ -3,7 +3,7 @@ class QgsGraphAnalyzer
%TypeHeaderCode
#include <qgsgraphanalyzer.h>
%End

public:
/**
* solve shortest path problem using dijkstra algorithm
Expand All @@ -17,8 +17,8 @@ class QgsGraphAnalyzer
%MethodCode
QVector< int > treeResult;
QVector< double > costResult;
QgsGraphAnalyzer::dijkstra( a0, a1, a2, &treeResult, &costResult );
QgsGraphAnalyzer::dijkstra( a0, a1, a2, &treeResult, &costResult );

PyObject *l1 = PyList_New( treeResult.size() );
if ( l1 == NULL )
{
Expand All @@ -31,13 +31,13 @@ class QgsGraphAnalyzer
}
int i;
for ( i = 0; i < costResult.size(); ++i )
{
{
PyObject *Int = PyInt_FromLong( treeResult[i] );
PyList_SET_ITEM( l1, i, Int );
PyObject *Float = PyFloat_FromDouble( costResult[i] );
PyList_SET_ITEM( l2, i, Float );
PyList_SET_ITEM( l2, i, Float );
}

sipRes = PyTuple_New( 2 );
PyTuple_SET_ITEM( sipRes, 0, l1 );
PyTuple_SET_ITEM( sipRes, 1, l2 );
Expand Down
8 changes: 4 additions & 4 deletions python/analysis/network/qgsgraphbuilderintr.sip
Expand Up @@ -24,20 +24,20 @@ class QgsGraphBuilderInterface
/**
* QgsGraphBuilderInterface constructor
* @param crs Coordinate reference system for new graph vertex
* @param ctfEnabled enable coordinate transform from source graph CRS to CRS graph
* @param ctfEnabled enable coordinate transform from source graph CRS to CRS graph
* @param topologyTolerance sqrt distance between source point as one graph vertex
* @param ellipsoidID ellipsoid for edge measurement
*/
QgsGraphBuilderInterface( const QgsCoordinateReferenceSystem& crs, bool ctfEnabled = true, double topologyTolerance = 0.0, const QString& ellipsoidID = "WGS84" );

QgsCoordinateReferenceSystem& destinationCrs();

//! get coordinate transformation enabled
bool coordinateTransformationEnabled();

//! get topology tolerance
double topologyTolerance();

//! get measurement tool
QgsDistanceArea* distanceArea();

Expand All @@ -59,5 +59,5 @@ class QgsGraphBuilderInterface
* @note pt1id, pt1 and pt2id, pt2 is a redundant interface. You can use vertex coordinates or their identificators.
*/
virtual void addArc( int pt1id, const QgsPoint& pt1, int pt2id, const QgsPoint& pt2, const QVector< QVariant >& properties );

};
6 changes: 3 additions & 3 deletions python/analysis/network/qgsgraphdirector.sip
Expand Up @@ -20,7 +20,7 @@ class QgsGraphDirector : QObject
sipClass = NULL;
%End


signals:
void buildProgress( int, int ) const;
void buildMessage( QString ) const;
Expand All @@ -43,9 +43,9 @@ class QgsGraphDirector : QObject
virtual void makeGraph( QgsGraphBuilderInterface *builder,
const QVector< QgsPoint > &additionalPoints,
QVector< QgsPoint> &tiedPoints /Out/ );

void addProperter( QgsArcProperter* prop /Transfer/ ) ;

/**
* return Director name
*/
Expand Down
19 changes: 4 additions & 15 deletions python/console/console.py
Expand Up @@ -167,16 +167,6 @@ def __init__(self, parent=None):
self.loadSextanteButton.setIconVisibleInMenu(True)
self.loadSextanteButton.setToolTip(loadSextanteBt)
self.loadSextanteButton.setText(loadSextanteBt)
## Import QgisInterface class
loadIfaceBt = QCoreApplication.translate("PythonConsole", "Import QgisInterface class")
self.loadIfaceButton = QAction(parent)
self.loadIfaceButton.setCheckable(False)
self.loadIfaceButton.setEnabled(True)
self.loadIfaceButton.setIcon(QgsApplication.getThemeIcon("console/iconIfaceConsole.png"))
self.loadIfaceButton.setMenuRole(QAction.PreferencesRole)
self.loadIfaceButton.setIconVisibleInMenu(True)
self.loadIfaceButton.setToolTip(loadIfaceBt)
self.loadIfaceButton.setText(loadIfaceBt)
## Import QtCore class
loadQtCoreBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtCore class")
self.loadQtCoreButton = QAction(parent)
Expand Down Expand Up @@ -246,7 +236,6 @@ def __init__(self, parent=None):
self.toolBar.addAction(self.runButton)
## Menu Import Class
self.classMenu = QMenu(self)
self.classMenu.addAction(self.loadIfaceButton)
self.classMenu.addAction(self.loadSextanteButton)
self.classMenu.addAction(self.loadQtCoreButton)
self.classMenu.addAction(self.loadQtGuiButton)
Expand Down Expand Up @@ -293,7 +282,6 @@ def __init__(self, parent=None):

self.clearButton.triggered.connect(self.textEditOut.clearConsole)
self.optionsButton.triggered.connect(self.openSettings)
self.loadIfaceButton.triggered.connect(self.iface)
self.loadSextanteButton.triggered.connect(self.sextante)
self.loadQtCoreButton.triggered.connect(self.qtCore)
self.loadQtGuiButton.triggered.connect(self.qtGui)
Expand All @@ -307,9 +295,6 @@ def __init__(self, parent=None):
def sextante(self):
self.edit.commandConsole('sextante')

def iface(self):
self.edit.commandConsole('iface')

def qtCore(self):
self.edit.commandConsole('qtCore')

Expand Down Expand Up @@ -355,6 +340,7 @@ def saveScriptFile(self):
sF.write('\n')
sF.write(s)
sF.close()
self.callWidgetMessageBar('Script was correctly saved.')

def openHelp(self):
self.helpDlg.show()
Expand All @@ -366,6 +352,9 @@ def openSettings(self):
def prefChanged(self):
self.edit.refreshLexerProperties()
self.textEditOut.refreshLexerProperties()

def callWidgetMessageBar(self, text):
self.textEditOut.widgetMessageBar(iface, text)

if __name__ == '__main__':
a = QApplication(sys.argv)
Expand Down
23 changes: 19 additions & 4 deletions python/console/console_output.py
Expand Up @@ -25,6 +25,7 @@
QsciScintillaBase,
QsciLexerPython)
from qgis.core import QgsApplication
from qgis.gui import QgsMessageBar
import sys

class writeOut:
Expand Down Expand Up @@ -72,6 +73,17 @@ def __init__(self, parent=None):
self.parent = parent
self.edit = self.parent.edit

# Creates layout for message bar
self.layout = QGridLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
spacerItem = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
self.layout.addItem(spacerItem, 1, 0, 1, 1)
# messageBar instance
self.infoBar = QgsMessageBar()
sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
self.infoBar.setSizePolicy(sizePolicy)
self.layout.addWidget(self.infoBar, 0, 0, 1, 1)

# Enable non-ascii chars for editor
self.setUtf8(True)

Expand Down Expand Up @@ -125,7 +137,7 @@ def __init__(self, parent=None):
def insertInitText(self):
txtInit = QCoreApplication.translate("PythonConsole",
"## To access Quantum GIS environment from this console\n"
"## iface object (instance of QgisInterface class). \n"
"## use iface object (instance of QgisInterface class). \n"
"## Type help(iface) for more info and list of methods.\n\n")
initText = self.setText(txtInit)

Expand Down Expand Up @@ -265,7 +277,10 @@ def pastebin(self):
link = i.replace('<a href="',"").strip()
if link:
QApplication.clipboard().setText(link)
print "## URL copied to clipboard ##"
self.parent.callWidgetMessageBar('URL copied to clipboard')
except urllib2.URLError, e:
print "## Connection error ##"
print "## " + str(e.args) + " ##"
self.parent.callWidgetMessageBar('Connection error: ' + str(e.args))

def widgetMessageBar(self, iface, text):
timeout = iface.messageTimeout()
self.infoBar.pushMessage(text, QgsMessageBar.INFO, timeout)
18 changes: 7 additions & 11 deletions python/console/console_sci.py
Expand Up @@ -31,7 +31,7 @@
import code

_init_commands = ["from qgis.core import *", "import qgis.utils",
"from qgis.utils import iface"]
"from qgis.utils import iface"]
_historyFile = os.path.join(str(QDir.homePath()),".qgis","console_history.txt")

class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
Expand All @@ -40,6 +40,8 @@ def __init__(self, parent=None):
super(PythonEdit,self).__init__(parent)
code.InteractiveInterpreter.__init__(self, locals=None)

self.parent = parent

# Enable non-ascii chars for editor
self.setUtf8(True)

Expand Down Expand Up @@ -128,10 +130,7 @@ def commandConsole(self, command):
selCmdLenght = self.text(line).length()
self.setSelection(line, 4, line, selCmdLenght)
self.removeSelectedText()
if command == "iface":
# import QgisInterface class
self.append('from qgis.utils import iface')
elif command == "sextante":
if command == "sextante":
# import Sextante class
self.append('import sextante')
elif command == "qtCore":
Expand Down Expand Up @@ -503,17 +502,14 @@ def runCommand(self, cmd):
if cmd in ('_save', '_clear', '_clearAll', '_pyqgis', '_api'):
if cmd == '_save':
self.writeHistoryFile()
print QCoreApplication.translate("PythonConsole",
"## History saved successfully ##")
self.parent.callWidgetMessageBar('History saved successfully')
elif cmd == '_clear':
self.clearHistoryFile()
print QCoreApplication.translate("PythonConsole",
"## History cleared successfully ##")
self.parent.callWidgetMessageBar('History cleared successfully')
elif cmd == '_clearAll':
self.history = QStringList()
self.clearHistoryFile()
print QCoreApplication.translate("PythonConsole",
"## Session and file history cleared successfully ##")
self.parent.callWidgetMessageBar('Session and file history cleared successfully')
elif cmd == '_pyqgis':
webbrowser.open( "http://www.qgis.org/pyqgis-cookbook/" )
elif cmd == '_api':
Expand Down
6 changes: 6 additions & 0 deletions python/core/composer/qgscomposition.sip
Expand Up @@ -65,6 +65,12 @@ class QgsComposition : QGraphicsScene
void setGridStyle( GridStyle s );
GridStyle gridStyle() const;

void setAlignmentSnap( bool s );
bool alignmentSnap() const;

void setAlignmentSnapTolerance( double t );
double alignmentSnapTolerance() const;

/**Returns pointer to undo/redo command storage*/
QUndoStack* undoStack();

Expand Down
1 change: 1 addition & 0 deletions python/core/core.sip
Expand Up @@ -42,6 +42,7 @@
%Include qgsmessageoutput.sip
%Include qgsmimedatautils.sip
%Include qgsnetworkaccessmanager.sip
%Include qgsofflineediting.sip
%Include qgsoverlayobject.sip
%Include qgsowsconnection.sip
%Include qgspaintenginehack.sip
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgscredentials.sip
Expand Up @@ -8,7 +8,7 @@ class QgsCredentials
//! virtual destructor
virtual ~QgsCredentials();

bool get( QString realm, QString &username /In,Out/, QString &password /In,Out/, QString message = QString::null );
bool get( QString realm, QString &username, QString &password, QString message = QString::null );
void put( QString realm, QString username, QString password );

//! retrieves instance
Expand Down
61 changes: 61 additions & 0 deletions python/core/qgsofflineediting.sip
@@ -0,0 +1,61 @@
/** \class QgsOfflineEditing
* \brief Class for accessing functionality of Offline Editing Plugin.
* This class can be used to access offline editing functionality from plugins.
*/
class QgsOfflineEditing : QObject
{
%TypeHeaderCode
#include <qgsofflineediting.h>
%End

public:
enum ProgressMode {
CopyFeatures = 0,
ProcessFeatures,
AddFields,
AddFeatures,
RemoveFeatures,
UpdateFeatures,
UpdateGeometries
};

QgsOfflineEditing();
~QgsOfflineEditing();

/** convert current project for offline editing
* @param offlineDataPath path to offline db file
* @param offlineDbFile offline db file name
* @param layerIds list of layer names to convert
*/
bool convertToOfflineProject( const QString& offlineDataPath, const QString& offlineDbFile, const QStringList& layerIds );

/** return true if current project is offline */
bool isOfflineProject();

/** synchronize to remote layers */
void synchronize();

signals:
/** emit a signal that processing has started */
void progressStarted();

/** emit a signal that the next layer of numLayers has started processing
* @param layer current layer index
* @param numLayers total number of layers
*/
void layerProgressUpdated( int layer, int numLayers );

/** emit a signal that sets the mode for the progress of the current operation
* @param mode progress mode
* @param maximum total number of entities to process in the current operation
*/
void progressModeSet( QgsOfflineEditing::ProgressMode mode, int maximum );

/** emit a signal with the progress of the current mode
* @param progress current index of processed entities
*/
void progressUpdated( int progress );

/** emit a signal that processing of all layers has finished */
void progressStopped();
};

0 comments on commit 2231971

Please sign in to comment.