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
  • Loading branch information
volaya committed Oct 20, 2012
2 parents 6546d74 + 2765220 commit a42071d
Show file tree
Hide file tree
Showing 92 changed files with 3,663 additions and 2,161 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -95,6 +95,10 @@ SET (WITH_GLOBE FALSE CACHE BOOL "Determines whether Globe plugin should be buil
IF (WITH_GLOBE)
SET(QT_USE_QTOPENGL 1)
FIND_PACKAGE(OSGEARTH REQUIRED)
IF (OSGEARTHQT_LIBRARY)
# following variable is used in qgsconfig.h
SET(HAVE_OSGEARTHQT TRUE)
ENDIF (OSGEARTHQT_LIBRARY)
ENDIF (WITH_GLOBE)

# Compile flag. Make it possible to turn it off.
Expand Down
3 changes: 3 additions & 0 deletions cmake/FindOSGEARTH.cmake
Expand Up @@ -92,6 +92,9 @@ FIND_OSGEARTH_LIBRARY( OSGEARTHFEATURES_LIBRARY_DEBUG osgEarthFeaturesd )
FIND_OSGEARTH_LIBRARY( OSGEARTHSYMBOLOGY_LIBRARY osgEarthSymbology )
FIND_OSGEARTH_LIBRARY( OSGEARTHSYMBOLOGY_LIBRARY_DEBUG osgEarthSymbologyd )

FIND_OSGEARTH_LIBRARY( OSGEARTHQT_LIBRARY osgEarthQt )
FIND_OSGEARTH_LIBRARY( OSGEARTHQT_LIBRARY_DEBUG osgEarthQtd )


SET( OSGEARTH_FOUND "NO" )
IF( OSGEARTH_LIBRARY AND OSGEARTH_INCLUDE_DIR )
Expand Down
2 changes: 2 additions & 0 deletions cmake_templates/qgsconfig.h.in
Expand Up @@ -38,5 +38,7 @@

#cmakedefine HAVE_TOUCH

#cmakedefine HAVE_OSGEARTHQT

#endif

46 changes: 23 additions & 23 deletions doc/TRANSLATORS

Large diffs are not rendered by default.

1,371 changes: 703 additions & 668 deletions i18n/qgis_de.ts

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions i18n/qgis_it.ts
Expand Up @@ -6452,6 +6452,10 @@ Cambiare questa situazione prima, perché il plugin OSM non quale layer è la de
<source>Save to script file</source>
<translation>Salva file</translation>
</message>
<message>
<source>Settings</source>
<translation>Impostazioni</translation>
</message>
<message>
<source>Help</source>
<translation>Aiuto</translation>
Expand Down
Binary file added images/console/iconAboutConsole.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
4 changes: 3 additions & 1 deletion images/images.qrc
Expand Up @@ -67,6 +67,7 @@
<file>themes/default/mActionEditCut.png</file>
<file>themes/default/mActionEditPaste.png</file>
<file>themes/default/mActionExpandTree.png</file>
<file>themes/default/mActionExpandNewTree.png</file>
<file>themes/default/mActionExportMapServer.png</file>
<file>themes/default/mActionFileExit.png</file>
<file>themes/default/mActionFileNew.png</file>
Expand Down Expand Up @@ -467,7 +468,7 @@
<file>console/iconClassConsole.png</file>
<file>console/iconSaveConsole.png</file>
<file>console/iconHelpConsole.png</file>
<file>console/iconTempConsole.png</file>
<file>console/iconSettingsConsole.png</file>
<file>console/iconOpenConsole.png</file>
<file>console/iconClearConsole.png</file>
<file>console/imgHelpDialog.png</file>
Expand All @@ -477,6 +478,7 @@
<file>console/iconQtCoreConsole.png</file>
<file>console/iconQtGuiConsole.png</file>
<file>console/iconRunConsole.png</file>
<file>console/iconAboutConsole.png</file>
<file>flags/sr_Cyrl.png</file>
<file>flags/sr_Latn.png</file>
</qresource>
Expand Down
Binary file added images/themes/default/mActionExpandNewTree.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions python/CMakeLists.txt
@@ -1,9 +1,8 @@
SET (PYTHON_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/python)

ADD_SUBDIRECTORY(plugins)
ADD_SUBDIRECTORY(qsci_apis)

SET (PYTHON_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/python)
SET (QGIS_PYTHON_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/qgis)

IF (WITH_PYSPATIALITE)
ADD_SUBDIRECTORY(pyspatialite)
ENDIF (WITH_PYSPATIALITE)
Expand All @@ -15,6 +14,7 @@ IF (WITH_INTERNAL_SPATIALITE)
)
ENDIF (WITH_INTERNAL_SPATIALITE)

SET (QGIS_PYTHON_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/qgis)
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})

Expand Down Expand Up @@ -149,7 +149,12 @@ ADD_CUSTOM_COMMAND(TARGET compile_python_files
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

FOREACH(file __init__.py utils.py console.py console_sci.py console_help.py)
FILE(GLOB UI_FILES *.ui)
PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES})
ADD_CUSTOM_TARGET(console ALL DEPENDS ${PYUI_FILES})
INSTALL(FILES ${PYUI_FILES} DESTINATION ${QGIS_PYTHON_DIR})

FOREACH(file __init__.py utils.py console.py console_sci.py console_help.py console_settings.py)
ADD_CUSTOM_COMMAND(TARGET compile_python_files
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${file} ${QGIS_PYTHON_OUTPUT_DIRECTORY}
Expand All @@ -163,3 +168,4 @@ PYTHON_INSTALL(utils.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console_sci.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console_help.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console_settings.py ${QGIS_PYTHON_DIR})
62 changes: 40 additions & 22 deletions python/console.py
Expand Up @@ -24,6 +24,7 @@
from qgis.utils import iface
from console_sci import PythonEdit
from console_help import HelpDialog
from console_settings import optionsDialog

import sys
import os
Expand All @@ -37,13 +38,16 @@ def show_console():
parent = iface.mainWindow() if iface else None
_console = PythonConsole( parent )
_console.show() # force show even if it was restored as hidden

# set focus to the console so the user can start typing
# defer the set focus event so it works also whether the console not visible yet
QTimer.singleShot(0, _console.activate)
else:
_console.setVisible(not _console.isVisible())

# set focus to the edit box so the user can start typing
if _console.isVisible():
_console.activateWindow()
_console.setFocus()
# set focus to the console so the user can start typing
if _console.isVisible():
_console.activate()

_old_stdout = sys.stdout
_console_output = None
Expand All @@ -66,7 +70,7 @@ def get_and_clean_data(self):
def flush(self):
pass

sys.stdout = QgisOutputCatcher()
sys.stdout = QgisOutputCatcher()

class PythonConsole(QDockWidget):
def __init__(self, parent=None):
Expand All @@ -77,19 +81,26 @@ def __init__(self, parent=None):

self.console = PythonConsoleWidget(self)
self.setWidget( self.console )
self.setFocusProxy( self.console )

# try to restore position from stored main window state
if iface and not iface.mainWindow().restoreDockWidget(self):
iface.mainWindow().addDockWidget(Qt.BottomDockWidgetArea, self)

def activate(self):
self.activateWindow()
self.raise_()
QDockWidget.setFocus(self)


class PythonConsoleWidget(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
self.setWindowTitle(QCoreApplication.translate("PythonConsole", "Python Console"))

self.widgetButton = QWidget()

self.options = optionsDialog(self)

self.toolBar = QToolBar()
self.toolBar.setEnabled(True)
#self.toolBar.setFont(font)
Expand Down Expand Up @@ -121,13 +132,16 @@ def __init__(self, parent=None):
self.clearButton.setIconVisibleInMenu(True)
self.clearButton.setToolTip(clearBt)
self.clearButton.setText(clearBt)
## Action for paste snippets code
# self.currentLayerButton = QAction(parent)
# self.currentLayerButton.setCheckable(False)
# self.currentLayerButton.setEnabled(True)
# self.currentLayerButton.setIcon(QIcon("icon/iconTempConsole.png"))
# self.currentLayerButton.setMenuRole(QAction.PreferencesRole)
# self.currentLayerButton.setIconVisibleInMenu(True)
## Action for settings
optionsBt = QCoreApplication.translate("PythonConsole", "Settings")
self.optionsButton = QAction(parent)
self.optionsButton.setCheckable(False)
self.optionsButton.setEnabled(True)
self.optionsButton.setIcon(QIcon(":/images/console/iconSettingsConsole.png"))
self.optionsButton.setMenuRole(QAction.PreferencesRole)
self.optionsButton.setIconVisibleInMenu(True)
self.optionsButton.setToolTip(optionsBt)
self.optionsButton.setText(optionsBt)
## Action menu for class
actionClassBt = QCoreApplication.translate("PythonConsole", "Import Class")
self.actionClass = QAction(parent)
Expand Down Expand Up @@ -232,6 +246,7 @@ def __init__(self, parent=None):
self.toolBar.addAction(self.clearButton)
self.toolBar.addAction(self.actionClass)
self.toolBar.addAction(self.actionScript)
self.toolBar.addAction(self.optionsButton)
self.toolBar.addAction(self.helpButton)
self.toolBar.addAction(self.runButton)
## Menu Import Class
Expand All @@ -257,11 +272,9 @@ def __init__(self, parent=None):

self.e.addWidget(self.widgetButton)
self.e.addWidget(self.edit)

self.edit.setFocus()

self.clearButton.triggered.connect(self.edit.clearConsole)
#self.currentLayerButton.triggered.connect(self.cLayer)
self.optionsButton.triggered.connect(self.openSettings)
self.loadIfaceButton.triggered.connect(self.iface)
self.loadSextanteButton.triggered.connect(self.sextante)
self.loadQtCoreButton.triggered.connect(self.qtCore)
Expand All @@ -270,9 +283,8 @@ def __init__(self, parent=None):
self.openFileButton.triggered.connect(self.openScriptFile)
self.saveFileButton.triggered.connect(self.saveScriptFile)
self.helpButton.triggered.connect(self.openHelp)

def cLayer(self):
self.edit.commandConsole('cLayer')
QObject.connect(self.options.buttonBox, SIGNAL("accepted()"),
self.prefChanged)

def sextante(self):
self.edit.commandConsole('sextante')
Expand All @@ -288,7 +300,7 @@ def qtGui(self):

def openScriptFile(self):
settings = QSettings()
lastDirPath = settings.value("/pythonConsole/lastDirPath").toString()
lastDirPath = settings.value("pythonConsole/lastDirPath").toString()
scriptFile = QFileDialog.getOpenFileName(
self, "Open File", lastDirPath, "Script file (*.py)")
if scriptFile.isEmpty() == False:
Expand All @@ -300,7 +312,7 @@ def openScriptFile(self):
self.edit.insertTextFromFile(listScriptFile)

lastDirPath = QFileInfo(scriptFile).path()
settings.setValue("/pythonConsole/lastDirPath", QVariant(scriptFile))
settings.setValue("pythonConsole/lastDirPath", QVariant(scriptFile))


def saveScriptFile(self):
Expand Down Expand Up @@ -329,12 +341,18 @@ def saveScriptFile(self):
def openHelp(self):
dlg = HelpDialog()
dlg.exec_()

def openSettings(self):
#options = optionsDialog()
self.options.exec_()

def prefChanged(self):
self.edit.refreshLexerProperties()

def closeEvent(self, event):
self.edit.writeHistoryFile()
QWidget.closeEvent(self, event)


if __name__ == '__main__':
a = QApplication(sys.argv)
console = PythonConsoleWidget()
Expand Down
16 changes: 13 additions & 3 deletions python/console_help/help.htm
Expand Up @@ -34,7 +34,7 @@ <h2 id="headerTitle">Python Console for QGIS</h2>
</tr>
</table>
<p align="justify">
<span id="headerSubject">Python Console based on PyQScintilla2. (Developed by Salvatore Larosa)</span>
<span id="headerSubject">Python Console based on PyQScintilla2.</span>
<br><br>
<span id="headerSubjectMain">To access Quantum GIS environment from this console
use qgis.utils.iface object (instance of QgisInterface class).
Expand Down Expand Up @@ -64,16 +64,22 @@ <h4 id="features">Features</h4>
<br>
<li><span id="featuresB">CTRL+ALT+SPACE to view the command history list.</span></li>
<br>
<li><span id="featuresLoadAPI">Open Quantum GIS API documentation by typing <b>_api</b>.</span></li>
<br>
<li><span id="featuresLoadCookBook">Open PyQGIS Cookbook by typing <b>_pyqgis</b>.</span>
</li>
<br>
<li><span id="featuresC">Saves the command history by typing <b>_save</b> or closing the widget.<br>
This command saves the history command in the file ~/.qgis/console_history.txt</span>
</li>
<br>
<li><span id="featuresD">Clears the command history by typing <b>_clear</b>.<br>
This command clears the command history from file ~/.qgis/console_history.txt</span>
This command clears the temporary command history</span>
</li>
<br>
<li><span id="featuresE">Clears completely command history by typing <b>_clearAll</b>.<br>
This command clears completely the command history. It has an irreversible effect.</span>
This command clears completely the command history (both temporary and ~/.qgis/console_history.txt).
It has an irreversible effect.</span>
</li>
</ul>
</p>
Expand Down Expand Up @@ -120,6 +126,10 @@ <h4 id="toolbar">Toolbar</h4>
<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="qrc:/images/console/iconSettingsConsole.png" /></td>
<td colspan="2"><span id="toolbarSettings">Settings</span></td>
</tr>
<tr>
<td><img src="qrc:/images/console/iconHelpConsole.png" /></td>
<td colspan="2"><span id="toolbarHelp">Help</span></td>
Expand Down
2 changes: 1 addition & 1 deletion python/console_help/i18n/de_DE.properties
@@ -1,6 +1,6 @@
i18n_dict = {
"header.title" : "Python Console für QGIS",
"header.subject" : "Python Console auf PyQScintilla2 basierend (entwickelt von Salvatore Larosa)",
"header.subject" : "Python Console auf PyQScintilla2 basierend",
"header.subject.main" : "Das Objekt qgis.utils.iface (Instanz der Klasse QgisInterface) ermöglicht den Zugriff \
quf die Quantum GIS Umgebung von der Konsole aus. \
Über den defür bestimmten Knopf in der Werkzeugleiste \
Expand Down
5 changes: 4 additions & 1 deletion python/console_help/i18n/en_US.properties
@@ -1,6 +1,6 @@
i18n_dict = {
"header.title" : "Python Console for QGIS",
"header.subject" : "Python Console based on PyQScintilla2. (Developed by Salvatore Larosa)",
"header.subject" : "Python Console based on PyQScintilla2.",
"header.subject.main" : "To access Quantum GIS environment from this console \
use qgis.utils.iface object (instance of QgisInterface class). \
To import the class QgisInterface can also use the dedicated \
Expand All @@ -15,6 +15,8 @@ i18n_dict = {
This command clears the command history from file ~/.qgis/console_history.txt",
"features.e" : "Clears completely command history by typing '_clearAll'. \
This command clears completely the command history. It has an irreversible effect.",
"features.api.doc" : "Open Quantum GIS API documentation by typing '_api'.",
"features.pyqgis.doc" : "Open PyQGIS Cookbook by typing '_pyqgis'.",
"toolbar" : "Toolbar",
"toolbar.title" : "The following is a description of the tools in the toolbar:",
"toolbar.clear" : "Tool to clear python console",
Expand All @@ -24,6 +26,7 @@ i18n_dict = {
"toolbar.qtgui" : "Tool to import PyQt4.QtGui class",
"toolbar.script.open" : "Tool to open a python script and load in console",
"toolbar.script.save" : "Tool to save a python script",
"toolbar.settings" : "Settings",
"toolbar.help" : "Help",
"toolbar.run" : "Run command (like Enter key pressed)",
"thanks" : "Acknowledgments",
Expand Down
5 changes: 4 additions & 1 deletion python/console_help/i18n/it_IT.properties
@@ -1,6 +1,6 @@
i18n_dict = {
"header.title" : "Console Python per QGIS",
"header.subject" : "Console Python basata su PyQScintilla2. (Sviluppata da Salvatore Larosa)",
"header.subject" : "Console Python basata su PyQScintilla2.",
"header.subject.main" : "Per accedere all'ambiente Quantum GIS da questa console \
usa l'oggetto qgis.utils.iface (istanza della classe QgisInterface). \
Per importare la classe QgisInterface puoi usare anche il bottone dedicato che si trova \
Expand All @@ -15,6 +15,8 @@ i18n_dict = {
La cronologia verrà cancellata dal file ~/.qgis/console_history.txt",
"features.e" : "Possibilità di cancellare completamente la cronologia dei comandi digitando '_clearAll'. \
La cronologia verrà cancellata sia dal file che dalla memoria temporanea.",
"features.api.doc" : "Apri la documentazione completa sulle API di QuantumGIS digitando '_api'.",
"features.pyqgis.doc" : "Apri il Cookbook PyQGIS digitando '_pyqgis'.",
"toolbar" : "Toolbar",
"toolbar.title" : "Di seguito la descrizione dei comandi disponibile nella toolbar:",
"toolbar.clear" : "Strumento per pulire la console",
Expand All @@ -24,6 +26,7 @@ i18n_dict = {
"toolbar.qtgui" : "Strumento per importare la classe PyQt4.QtGui",
"toolbar.script.open" : "Strumento per aprire un script python da eseguire in console",
"toolbar.script.save" : "Strumento per salvare uno script python sul disco",
"toolbar.settings" : "Impostazioni",
"toolbar.help" : "Aiuto",
"toolbar.run" : "Esegui comando (simile al tasto <Invio>)",
"thanks" : "Ringraziamenti",
Expand Down
2 changes: 1 addition & 1 deletion python/console_help/i18n/ru_RU.properties
@@ -1,6 +1,6 @@
i18n_dict = {
"header.title" : "Консоль Python для QGIS",
"header.subject" : "Консоль Python на основе PyQScintilla2. (Разработана Salvatore Larosa)",
"header.subject" : "Консоль Python на основе PyQScintilla2.",
"header.subject.main" : "Для доступа к окружению Quantum GIS из консоли \
используйте объект qgis.utils.iface (экземпляр класса QgisInterface). \
Также можно импортировать класс QgisInterface при помощи специальной \
Expand Down
3 changes: 3 additions & 0 deletions python/console_help/js/encoding.js
Expand Up @@ -10,6 +10,8 @@ $('span#featuresB').text($.i18n._('features.b'));
$('span#featuresC').text($.i18n._('features.c'));
$('span#featuresD').text($.i18n._('features.d'));
$('span#featuresE').text($.i18n._('features.e'));
$('span#featuresLoadAPI').text($.i18n._('features.api.doc'));
$('span#featuresLoadCookBook').text($.i18n._('features.pyqgis.doc'));
$('h4#toolbar').text($.i18n._('toolbar'));
$('span#toolbarTitle').text($.i18n._('toolbar.title'));
$('span#toolbarClear').text($.i18n._('toolbar.clear'));
Expand All @@ -20,6 +22,7 @@ $('span#toolbarQtGuiClass').text($.i18n._('toolbar.qtgui'));
$('span#toolbarScriptOpen').text($.i18n._('toolbar.script.open'));
$('span#toolbarScriptSave').text($.i18n._('toolbar.script.save'));
$('span#toolbarHelp').text($.i18n._('toolbar.help'));
$('span#toolbarSettings').text($.i18n._('toolbar.settings'));
$('span#toolbarRun').text($.i18n._('toolbar.run'));
$('h4#thanks').text($.i18n._('thanks'));
$('span#thanksText').text($.i18n._('thanks.text'));

0 comments on commit a42071d

Please sign in to comment.