summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Newgard2016-09-23 22:04:56 -0500
committerDoug Newgard2016-09-23 22:04:56 -0500
commit39eb7b020624fc29706af66c2ec213d8f61a573b (patch)
treef7fc0983c4cafdd73c037396c8066a2151c0b301
parent4f75d71f81bba6356976928691edd97b87d47ab9 (diff)
downloadaur-39eb7b020624fc29706af66c2ec213d8f61a573b.tar.gz
Update to 2.14.7 and sync with qgis package
-rw-r--r--.SRCINFO66
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD230
-rw-r--r--console.py719
-rw-r--r--qgis-ltr.install13
-rw-r--r--qgis-ltr.pngbin4564 -> 0 bytes
-rwxr-xr-xqgis-ltr.sh5
7 files changed, 100 insertions, 937 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 321fa046eec2..691a7fe12e40 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,54 +1,38 @@
pkgbase = qgis-ltr
- pkgdesc = QGIS (long-term release) is a Geographic Information System (GIS) that supports vector, raster & database formats
- pkgver = 2.8.3
- pkgrel = 4
+ pkgdesc = Geographic Information System (GIS) that supports vector, raster & database formats; Long Term Release
+ pkgver = 2.14.7
+ pkgrel = 1
url = http://qgis.org/
- install = qgis-ltr.install
arch = i686
arch = x86_64
license = GPL
makedepends = cmake
- makedepends = flex
- makedepends = bison
- makedepends = txt2tags
+ makedepends = gsl
makedepends = perl
- makedepends = git
- depends = qt4
- depends = proj
- depends = geos
- depends = sqlite
+ makedepends = txt2tags
+ depends = qca-qt4
depends = gdal
- depends = expat
- depends = qwt
depends = qwtpolar
- depends = gsl
- depends = python2
- depends = python2-pyqt4
- depends = python2-qscintilla
- depends = python2-sip
- depends = python2-psycopg2
- depends = python2-pygments
- depends = python2-dateutil
- depends = python2-jinja
- depends = python2-markupsafe
- depends = python2-pytz
- depends = python2-httplib2
- depends = libspatialite
depends = spatialindex
- depends = icu
- optdepends = grass: GRASS plugin support
- optdepends = fcgi: QGIS Map Server support
- optdepends = osgearth: QGIS Globe plugin support
- optdepends = gpsbabel: GPS toolbar support
- provides = qgis=2.8.3
- source = qgis::git://github.com/qgis/QGIS.git#branch=release-2_8
- source = qgis-ltr.png
- source = qgis-ltr.sh
- source = https://raw.githubusercontent.com/Ariki/QGIS/support-configure-ng/python/console/console.py
- md5sums = SKIP
- md5sums = 738cc27475119c899c1ce7bf495459ff
- md5sums = 5bac82b00870c491056cd8705be482f0
- md5sums = 57efd9c869ed2d0a50fb7cf35048d99d
+ depends = python2-httplib2
+ depends = python2-qscintilla-qt4
+ depends = python2-sip
+ depends = python2-six
+ optdepends = gpsbabel: GPS Tool plugin
+ optdepends = gsl: Georeferencer plugin
+ optdepends = python2-jinja: MetaSearch plugin
+ optdepends = python2-owslib: MetaSearch plugin
+ optdepends = python2-pygments: MetaSearch plugin
+ optdepends = python2-psycopg2: DB Manager plugin
+ optdepends = python2-pygments: DB Manager plugin
+ optdepends = python2-pyspatialite: DB Manager plugin
+ optdepends = python2-psycopg2: Processing plugin
+ optdepends = python2-pyspatialite: Processing plugin
+ optdepends = python2-yaml: Processing plugin
+ provides = qgis=2.14.7
+ conflicts = qgis
+ source = https://qgis.org/downloads/qgis-2.14.7.tar.bz2
+ md5sums = 5cc2377dfc40c07d6efde4bac7301ba5
pkgname = qgis-ltr
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..71a9d16c2b38
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*~
+*/
+*.tar.*
+*.log
diff --git a/PKGBUILD b/PKGBUILD
index c77512b55ac1..b999ea76bce5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,191 +1,103 @@
-# Maintainer: SaultDon <sault.don gmail>
+# Maintainer: Doug Newgard <scimmia at archlinux dot info>
+# Contributor: SaultDon <sault.don gmail>
# Contributor: Lantald < lantald at gmx.com >
# Contributor: Thomas Dziedzic < gostrc at gmail >
# Contributor: dibblethewrecker dibblethewrecker.at.jiwe.dot.org
# Contributor: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
# Contributor: Eric Forgeot < http://esclinux.tk >
-# GRASS 6 or 7 Processing and Plugin, Globe Plugin and QGIS Map Server are disabled in cmake by default.
-# Uncomment them in the build() portion if you'd like enabled during the build.
+# Globe Plugin and Map Server are disabled in cmake by default.
+# Uncomment them in the build() portion if you'd like them enabled.
+# You will also need to install osgearth-qt4 or fcgi, respectively, before building.
pkgname=qgis-ltr
_pkgname=${pkgname//-ltr}
-_pkgver=2.8
-pkgver=2.8.3
-pkgrel=5
-pkgdesc='QGIS (long-term release) is a Geographic Information System (GIS) that supports vector, raster & database formats'
+pkgver=2.14.7
+pkgrel=1
+pkgdesc='Geographic Information System (GIS) that supports vector, raster & database formats; Long Term Release'
url='http://qgis.org/'
license=('GPL')
arch=('i686' 'x86_64')
-# https://raw.githubusercontent.com/qgis/QGIS/final-2_6_0/INSTALL
-depends=('qt4'
- 'proj'
- 'geos'
- 'sqlite'
- 'gdal'
- 'expat'
- 'qwt'
- 'qwtpolar'
- 'gsl'
- 'python2'
- 'python2-pyqt4'
- 'python2-qscintilla'
- 'python2-sip'
- 'python2-psycopg2'
- 'python2-pygments'
- 'python2-dateutil'
- 'python2-jinja'
- 'python2-markupsafe'
- 'python2-pytz'
- 'python2-httplib2'
- 'libspatialite'
- 'spatialindex'
- 'icu')
-makedepends=('cmake'
- 'flex'
- 'bison'
- 'txt2tags'
- 'perl'
- 'git')
-optdepends=('grass: GRASS plugin support' # Uncomment relevant cmake option in build() below
- 'fcgi: QGIS Map Server support' # if you want GRASS, QGIS Map Server
- 'osgearth: QGIS Globe plugin support' # or the Globe Plugin enabled
- 'gpsbabel: GPS toolbar support')
+depends=('qca-qt4' 'gdal' 'qwtpolar' 'spatialindex'
+ 'python2-httplib2' 'python2-qscintilla-qt4' 'python2-sip' 'python2-six')
+makedepends=('cmake' 'gsl' 'perl' 'txt2tags')
+optdepends=('gpsbabel: GPS Tool plugin'
+ 'gsl: Georeferencer plugin'
+ 'python2-jinja: MetaSearch plugin'
+ 'python2-owslib: MetaSearch plugin'
+ 'python2-pygments: MetaSearch plugin'
+ 'python2-psycopg2: DB Manager plugin'
+ 'python2-pygments: DB Manager plugin'
+ 'python2-pyspatialite: DB Manager plugin'
+ 'python2-psycopg2: Processing plugin'
+ 'python2-pyspatialite: Processing plugin'
+ 'python2-yaml: Processing plugin')
provides=("$_pkgname=$pkgver")
-install="$pkgname.install"
-source=("${_pkgname}::git://github.com/qgis/QGIS.git#branch=release-${_pkgver//./_}"
- "$pkgname.png"
- "$pkgname.sh"
- "https://raw.githubusercontent.com/Ariki/QGIS/support-configure-ng/python/console/console.py")
-md5sums=('SKIP'
- '738cc27475119c899c1ce7bf495459ff'
- '3ebaf185073badd96e9c1b484b986d54'
- '57efd9c869ed2d0a50fb7cf35048d99d')
-
-
-pkgver() {
- cd "$_pkgname"
- # cutting off 'final' prefix that presents in the git tag
- git describe --long | sed 's/^final-//;s/\([^-]*-g\)/r\1/;s/-/./g;s/_/./g'
-}
-#pkgver() {
-# cd $_pkgname
-#
-# printf "%s.r%s" "${_pkgver}" "$(git rev-list --count HEAD)"
-#}
+conflicts=("$_pkgname")
+source=("https://qgis.org/downloads/$_pkgname-$pkgver.tar.bz2")
+md5sums=('5cc2377dfc40c07d6efde4bac7301ba5')
prepare() {
- cd $_pkgname
+ cd $_pkgname-$pkgver
+
+ # Fix references to "python"
+ sed -i 's/\(env \|\/usr\/bin\/\)python$/&2/' $(find . -iname "*.py")
+ sed -i 's/python /python2 /' scripts/pyuic4-wrapper.sh
- mv "${srcdir}/console.py" python/console/
+ # Remove mime types already defined by freedesktop.org
+ sed -e '/type="image\/tiff"/,/<\/mime-type>/d' \
+ -e '/type="image\/jpeg"/,/<\/mime-type>/d' \
+ -e '/type="image\/jp2"/,/<\/mime-type>/d' \
+ -e '/type="application\/x-adobe-mif"/,/<\/mime-type>/d' \
+ -i debian/qgis.xml
- # Fixing by hand shebang for .py files.
- find . -iname '*.py' | xargs sed -ie 's:^#!/usr/bin/env python$:#!/usr/bin/env python2:'
- find . -iname '*.py' | xargs sed -ie 's:^#!/usr/bin/python$:#!/usr/bin/env python2:'
+ [[ -d build ]] || mkdir build
}
build() {
- # Fix insecure RPATH is weird, but just works ;)
- # echo "os.system(\"sed -i '/^LFLAGS/s|-Wl,-rpath,.\+ ||g' gui/Makefile core/Makefile\")" >> python/configure.py.in
-
- cd $_pkgname
-
- if [ -d build ]; then
- rm -rf build
- fi
- mkdir build
- cd build
+ cd $_pkgname-$pkgver/build
cmake -G "Unix Makefiles" ../ \
- -Wno-dev \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_SKIP_BUILD_RPATH=FALSE \
- -DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE \
- -DCMAKE_INSTALL_RPATH=/opt/$pkgname/lib \
- -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE \
- -DCMAKE_INSTALL_PREFIX=/opt/$pkgname/ \
- -DENABLE_TESTS=OFF \
+ -DCMAKE_INSTALL_PREFIX=/usr \
-DQGIS_MANUAL_SUBDIR=share/man \
+ -DENABLE_TESTS=FALSE \
+ -DCMAKE_SKIP_RPATH=TRUE \
-DPYTHON_EXECUTABLE=/usr/bin/python2 \
- -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so \
- -DPYTHON_INCLUDE_PATH=/usr/include/python2.7 \
- -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python2.7/site-packages \
- -DPYQT4_SIP_DIR=/usr/share/sip/PyQt4 \
- -DQSCI_SIP_DIR=/usr/share/sip/PyQt4 \
- -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4 \
-DWITH_INTERNAL_QWTPOLAR=FALSE \
- -DQWTPOLAR_LIBRARY=/usr/lib/libqwtpolar.so \
- -DQWT_LIBRARY=/usr/lib/libqwt.so \
+ -DWITH_INTERNAL_{HTTPLIB2,JINJA2,MARKUPSAFE,OWSLIB,PYGMENTS,DATEUTIL,PYTZ,YAML,NOSE2,SIX}=FALSE \
# -DWITH_SERVER=TRUE \
-# -DWITH_SERVER_PLUGINS=TRUE \
-# -DWITH_GRASS7=ON \
-# -DGRASS_PREFIX7=/opt/grass \
-# -DGRASS_INCLUDE_DIR7=/opt/grass/include/ \
-# -DWITH_GRASS=ON \
-# -DGRASS_PREFIX=/opt/grass64 \
-# -DGRASS_INCLUDE_DIR=/opt/grass64/include \
-# -DWITH_GLOBE=TRUE \
+# -DWITH_GLOBE=TRUE
make
-
- # TODO: fix $srcdir warning if it's a real problem...
- # Looks like it's only showing up in non-critical files so can ignore warning.
-
}
package() {
- cd $_pkgname/build
-
- make DESTDIR="$pkgdir/" install
-
- # qgis.desktop
- sed -i -e "s,^Name=QGIS Desktop\$,Name=QGIS Desktop (long-term release)," \
- -e "s,^Icon=qgis\$,Icon=$pkgname," \
- -e "s,^TryExec=/usr/bin/qgis\$,TryExec=/usr/bin/$pkgname," \
- -e "s,^Exec=/usr/bin/qgis %F\$,Exec=/usr/bin/$pkgname %F," \
- "${srcdir}/${_pkgname}/debian/qgis.desktop"
-
- # qbrowser.desktop
- sed -i -e "s,^Name=QGIS Browser\$,Name=QGIS Browser (long-term release)," \
- -e "s,^Icon=qgis\$,Icon=qbrowser," \
- -e "s,^TryExec=/usr/bin/qbrowser\$,TryExec=/usr/bin/qbrowser-ltr," \
- -e "s,^Exec=/usr/bin/qbrowser %F\$,Exec=/usr/bin/qbrowser-ltr %F," \
- "${srcdir}/${_pkgname}/debian/qbrowser.desktop"
-
- # install some freedesktop.org compatibility
- install -Dm755 "$srcdir/$_pkgname/debian/qgis.desktop" \
- "$pkgdir/usr/share/applications/$pkgname.desktop"
-
- install -Dm755 "$srcdir/$_pkgname/debian/qbrowser.desktop" \
- "$pkgdir/usr/share/applications/qbrowser-ltr.desktop"
-
- install -Dm644 "$srcdir/$pkgname.png" \
- "$pkgdir/usr/share/pixmaps/$pkgname.png"
-
- #install -Dm644 $srcdir/$_pkgname/debian/qbrowser-icon512x512.png \
- # "$pkgdir/usr/share/pixmaps/qbrowser-ltr.png"
-
- # rename executables so they don't conflict with qgis or qgis-ltr
- mv $pkgdir/opt/$pkgname/bin/$_pkgname $pkgdir/opt/$pkgname/bin/$pkgname
-
- install -Dm755 $srcdir/$pkgname.sh \
- $pkgdir/usr/bin/$pkgname
-
- install -Dm755 $pkgdir/opt/$pkgname/bin/qbrowser \
- $pkgdir/usr/bin/qbrowser-ltr
-
- install -Dm755 $pkgdir/opt/$pkgname/bin/qgis_mapserv.fcgi \
- $pkgdir/usr/bin/qgis_mapserv_ltr.fcgi
-
- # TODO: these aren't working for some reason, ie, .qgs files are not opened by QGIS...
- # Appears to be a conflict with some file types being defaulted to google-chrome/chromium if that's installed as well.
- #install -dm755 "$pkgdir/usr/share/pixmaps" \
- # "$pkgdir/usr/share/mimelnk/application"
-
- #for mime in "$srcdir/$_pkgname/debian/mime/application/"*.desktop
- # do install -m644 "$mime" "$pkgdir/usr/share/mimelnk/application"
- #done
-
- #install -Dm644 "$srcdir/$pkgname/images/icons/qgis-mime-icon.png \
- # "$pkgdir/usr/share/pixmaps/qgis-mime.png"
+ cd $_pkgname-$pkgver/build
+
+ # Add optional deps based on selected or autodetected options
+ [[ -n "$(sed -n '/^GRASS_PREFIX:/ s/.*=//p' CMakeCache.txt)" ]] && optdepends+=('grass6: GRASS6 plugin')
+ [[ -n "$(sed -n '/^GRASS_PREFIX7:/ s/.*=//p' CMakeCache.txt)" ]] && optdepends+=('grass: GRASS7 plugin')
+ [[ "$(sed -n '/^WITH_SERVER:/ s/.*=//p' CMakeCache.txt)" == "TRUE" ]] && optdepends+=('fcgi: Map Server')
+ [[ "$(sed -n '/^WITH_GLOBE:/ s/.*=//p' CMakeCache.txt)" == "TRUE" ]] && optdepends+=('osgearth-qt4: Globe plugin')
+
+ make DESTDIR="$pkgdir" install
+
+ cd "$srcdir/$_pkgname-$pkgver"
+
+ # install desktop files and icons
+ install -Dm644 debian/{qgis,qbrowser}.desktop -t "$pkgdir/usr/share/applications/"
+ for icon in qgis-icon{,-16x16,-60x60} qbrowser-icon{,-60x60}; do
+ local _resolution="${icon##*-}"; [[ "$_resolution" == "icon" ]] && _resolution="512x512"
+ install -Dm644 images/icons/$icon.png "$pkgdir/usr/share/icons/hicolor/$_resolution/apps/${icon%%-*}.png"
+ done
+ for prog in qgis qbrowser; do
+ install -Dm644 images/icons/${prog}_icon.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/$prog.svg"
+ done
+
+ # install mime information and icon
+ install -Dm644 debian/qgis.xml "$pkgdir/usr/share/mime/packages/qgis.xml"
+ install -Dm644 images/icons/qgis-mime-icon.png "$pkgdir/usr/share/icons/hicolor/128x128/mimetypes/qgis-mime.png"
+
+ # compile python files, since the cmake option doesn't seem to account for DESTDIR
+ python2 -m compileall -q "$pkgdir"
}
diff --git a/console.py b/console.py
deleted file mode 100644
index 64ec452dfc90..000000000000
--- a/console.py
+++ /dev/null
@@ -1,719 +0,0 @@
-# -*- coding:utf-8 -*-
-"""
-/***************************************************************************
-Python Console for QGIS
- -------------------
-begin : 2012-09-10
-copyright : (C) 2012 by Salvatore Larosa
-email : lrssvtml (at) gmail (dot) com
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-Some portions of code were taken from https://code.google.com/p/pydee/
-"""
-
-from PyQt4.QtCore import Qt, QTimer, QSettings, QCoreApplication, QSize, QByteArray, QFileInfo, SIGNAL
-from PyQt4.QtGui import QDockWidget, QToolBar, QToolButton, QWidget, QSplitter, QTreeWidget, QAction, QFileDialog, QCheckBox, QSizePolicy, QMenu, QGridLayout, QApplication
-from qgis.utils import iface
-from console_sci import ShellScintilla
-from console_output import ShellOutputScintilla
-from console_editor import EditorTabWidget
-from console_settings import optionsDialog
-from qgis.core import QgsApplication, QgsContextHelp
-from qgis.gui import QgsFilterLineEdit
-
-import sys
-
-try:
- from PyQt4.QtCore import QT_VERSION # works if PyQt4 was built with configure-ng.py
-except ImportError:
- from PyQt4 import pyqtconfig # works if built with configure.py
- QT_VERSION = pyqtconfig.Configuration().qt_version
-
-_console = None
-
-def show_console():
- """ called from QGIS to open the console """
- global _console
- if _console is None:
- 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 console so the user can start typing
- if _console.isVisible():
- _console.activate()
- ## Shows help on first launch of the console
- settings = QSettings()
- if settings.value('pythonConsole/contextHelpOnFirstLaunch', True, type=bool):
- QgsContextHelp.run( "PythonConsole" )
- settings.setValue('pythonConsole/contextHelpOnFirstLaunch', False)
-
-_old_stdout = sys.stdout
-_console_output = None
-
-# hook for python console so all output will be redirected
-# and then shown in console
-def console_displayhook(obj):
- global _console_output
- _console_output = obj
-
-class PythonConsole(QDockWidget):
- def __init__(self, parent=None):
- QDockWidget.__init__(self, parent)
- self.setObjectName("PythonConsole")
- self.setWindowTitle(QCoreApplication.translate("PythonConsole", "Python Console"))
- #self.setAllowedAreas(Qt.BottomDockWidgetArea)
-
- 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)
-
- def closeEvent(self, event):
- self.console.saveSettingsConsole()
- QWidget.closeEvent(self, event)
-
-class PythonConsoleWidget(QWidget):
- def __init__(self, parent=None):
- QWidget.__init__(self, parent)
- self.setWindowTitle(QCoreApplication.translate("PythonConsole", "Python Console"))
-
- self.settings = QSettings()
-
- self.shell = ShellScintilla(self)
- self.setFocusProxy(self.shell)
- self.shellOut = ShellOutputScintilla(self)
- self.tabEditorWidget = EditorTabWidget(self)
-
- ##------------ UI -------------------------------
-
- self.splitterEditor = QSplitter(self)
- self.splitterEditor.setOrientation(Qt.Horizontal)
- self.splitterEditor.setHandleWidth(6)
- self.splitterEditor.setChildrenCollapsible(True)
- self.splitter = QSplitter(self.splitterEditor)
- self.splitter.setOrientation(Qt.Vertical)
- self.splitter.setHandleWidth(3)
- self.splitter.setChildrenCollapsible(False)
- self.splitter.addWidget(self.shellOut)
- self.splitter.addWidget(self.shell)
- #self.splitterEditor.addWidget(self.tabEditorWidget)
-
- self.splitterObj = QSplitter(self.splitterEditor)
- self.splitterObj.setHandleWidth(3)
- self.splitterObj.setOrientation(Qt.Horizontal)
- #self.splitterObj.setSizes([0, 0])
- #self.splitterObj.setStretchFactor(0, 1)
-
- self.widgetEditor = QWidget(self.splitterObj)
- self.widgetFind = QWidget(self)
-
- self.listClassMethod = QTreeWidget(self.splitterObj)
- self.listClassMethod.setColumnCount(2)
- objInspLabel = QCoreApplication.translate("PythonConsole", "Object Inspector")
- self.listClassMethod.setHeaderLabels([objInspLabel, ''])
- self.listClassMethod.setColumnHidden(1, True)
- self.listClassMethod.setAlternatingRowColors(True)
-
-
- #self.splitterEditor.addWidget(self.widgetEditor)
- #self.splitterObj.addWidget(self.listClassMethod)
- #self.splitterObj.addWidget(self.widgetEditor)
-
- # Hide side editor on start up
- self.splitterObj.hide()
- self.listClassMethod.hide()
- # Hide search widget on start up
- self.widgetFind.hide()
-
- sizes = self.splitter.sizes()
- self.splitter.setSizes(sizes)
-
- ##----------------Restore Settings------------------------------------
-
- self.restoreSettingsConsole()
-
- ##------------------Toolbar Editor-------------------------------------
-
- ## Action for Open File
- openFileBt = QCoreApplication.translate("PythonConsole", "Open file")
- self.openFileButton = QAction(self)
- self.openFileButton.setCheckable(False)
- self.openFileButton.setEnabled(True)
- self.openFileButton.setIcon(QgsApplication.getThemeIcon("console/iconOpenConsole.png"))
- self.openFileButton.setMenuRole(QAction.PreferencesRole)
- self.openFileButton.setIconVisibleInMenu(True)
- self.openFileButton.setToolTip(openFileBt)
- self.openFileButton.setText(openFileBt)
- ## Action for Save File
- saveFileBt = QCoreApplication.translate("PythonConsole", "Save")
- self.saveFileButton = QAction(self)
- self.saveFileButton.setCheckable(False)
- self.saveFileButton.setEnabled(False)
- self.saveFileButton.setIcon(QgsApplication.getThemeIcon("console/iconSaveConsole.png"))
- self.saveFileButton.setMenuRole(QAction.PreferencesRole)
- self.saveFileButton.setIconVisibleInMenu(True)
- self.saveFileButton.setToolTip(saveFileBt)
- self.saveFileButton.setText(saveFileBt)
- ## Action for Save File As
- saveAsFileBt = QCoreApplication.translate("PythonConsole", "Save As...")
- self.saveAsFileButton = QAction(self)
- self.saveAsFileButton.setCheckable(False)
- self.saveAsFileButton.setEnabled(True)
- self.saveAsFileButton.setIcon(QgsApplication.getThemeIcon("console/iconSaveAsConsole.png"))
- self.saveAsFileButton.setMenuRole(QAction.PreferencesRole)
- self.saveAsFileButton.setIconVisibleInMenu(True)
- self.saveAsFileButton.setToolTip(saveAsFileBt)
- self.saveAsFileButton.setText(saveAsFileBt)
- ## Action Cut
- cutEditorBt = QCoreApplication.translate("PythonConsole", "Cut")
- self.cutEditorButton = QAction(self)
- self.cutEditorButton.setCheckable(False)
- self.cutEditorButton.setEnabled(True)
- self.cutEditorButton.setIcon(QgsApplication.getThemeIcon("console/iconCutEditorConsole.png"))
- self.cutEditorButton.setMenuRole(QAction.PreferencesRole)
- self.cutEditorButton.setIconVisibleInMenu(True)
- self.cutEditorButton.setToolTip(cutEditorBt)
- self.cutEditorButton.setText(cutEditorBt)
- ## Action Copy
- copyEditorBt = QCoreApplication.translate("PythonConsole", "Copy")
- self.copyEditorButton = QAction(self)
- self.copyEditorButton.setCheckable(False)
- self.copyEditorButton.setEnabled(True)
- self.copyEditorButton.setIcon(QgsApplication.getThemeIcon("console/iconCopyEditorConsole.png"))
- self.copyEditorButton.setMenuRole(QAction.PreferencesRole)
- self.copyEditorButton.setIconVisibleInMenu(True)
- self.copyEditorButton.setToolTip(copyEditorBt)
- self.copyEditorButton.setText(copyEditorBt)
- ## Action Paste
- pasteEditorBt = QCoreApplication.translate("PythonConsole", "Paste")
- self.pasteEditorButton = QAction(self)
- self.pasteEditorButton.setCheckable(False)
- self.pasteEditorButton.setEnabled(True)
- self.pasteEditorButton.setIcon(QgsApplication.getThemeIcon("console/iconPasteEditorConsole.png"))
- self.pasteEditorButton.setMenuRole(QAction.PreferencesRole)
- self.pasteEditorButton.setIconVisibleInMenu(True)
- self.pasteEditorButton.setToolTip(pasteEditorBt)
- self.pasteEditorButton.setText(pasteEditorBt)
- ## Action Run Script (subprocess)
- runScriptEditorBt = QCoreApplication.translate("PythonConsole", "Run script")
- self.runScriptEditorButton = QAction(self)
- self.runScriptEditorButton.setCheckable(False)
- self.runScriptEditorButton.setEnabled(True)
- self.runScriptEditorButton.setIcon(QgsApplication.getThemeIcon("console/iconRunScriptConsole.png"))
- self.runScriptEditorButton.setMenuRole(QAction.PreferencesRole)
- self.runScriptEditorButton.setIconVisibleInMenu(True)
- self.runScriptEditorButton.setToolTip(runScriptEditorBt)
- self.runScriptEditorButton.setText(runScriptEditorBt)
- ## Action Run Script (subprocess)
- commentEditorBt = QCoreApplication.translate("PythonConsole", "Comment")
- self.commentEditorButton = QAction(self)
- self.commentEditorButton.setCheckable(False)
- self.commentEditorButton.setEnabled(True)
- self.commentEditorButton.setIcon(QgsApplication.getThemeIcon("console/iconCommentEditorConsole.png"))
- self.commentEditorButton.setMenuRole(QAction.PreferencesRole)
- self.commentEditorButton.setIconVisibleInMenu(True)
- self.commentEditorButton.setToolTip(commentEditorBt)
- self.commentEditorButton.setText(commentEditorBt)
- ## Action Run Script (subprocess)
- uncommentEditorBt = QCoreApplication.translate("PythonConsole", "Uncomment")
- self.uncommentEditorButton = QAction(self)
- self.uncommentEditorButton.setCheckable(False)
- self.uncommentEditorButton.setEnabled(True)
- self.uncommentEditorButton.setIcon(QgsApplication.getThemeIcon("console/iconUncommentEditorConsole.png"))
- self.uncommentEditorButton.setMenuRole(QAction.PreferencesRole)
- self.uncommentEditorButton.setIconVisibleInMenu(True)
- self.uncommentEditorButton.setToolTip(uncommentEditorBt)
- self.uncommentEditorButton.setText(uncommentEditorBt)
- ## Action for Object browser
- objList = QCoreApplication.translate("PythonConsole", "Object Inspector")
- self.objectListButton = QAction(self)
- self.objectListButton.setCheckable(True)
- self.objectListButton.setEnabled(self.settings.value("pythonConsole/enableObjectInsp",
- False, type=bool))
- self.objectListButton.setIcon(QgsApplication.getThemeIcon("console/iconClassBrowserConsole.png"))
- self.objectListButton.setMenuRole(QAction.PreferencesRole)
- self.objectListButton.setIconVisibleInMenu(True)
- self.objectListButton.setToolTip(objList)
- self.objectListButton.setText(objList)
- ## Action for Find text
- findText = QCoreApplication.translate("PythonConsole", "Find Text")
- self.findTextButton = QAction(self)
- self.findTextButton.setCheckable(True)
- self.findTextButton.setEnabled(True)
- self.findTextButton.setIcon(QgsApplication.getThemeIcon("console/iconSearchEditorConsole.png"))
- self.findTextButton.setMenuRole(QAction.PreferencesRole)
- self.findTextButton.setIconVisibleInMenu(True)
- self.findTextButton.setToolTip(findText)
- self.findTextButton.setText(findText)
-
- ##----------------Toolbar Console-------------------------------------
-
- ## Action Show Editor
- showEditor = QCoreApplication.translate("PythonConsole", "Show editor")
- self.showEditorButton = QAction(self)
- self.showEditorButton.setEnabled(True)
- self.showEditorButton.setCheckable(True)
- self.showEditorButton.setIcon(QgsApplication.getThemeIcon("console/iconShowEditorConsole.png"))
- self.showEditorButton.setMenuRole(QAction.PreferencesRole)
- self.showEditorButton.setIconVisibleInMenu(True)
- self.showEditorButton.setToolTip(showEditor)
- self.showEditorButton.setText(showEditor)
- ## Action for Clear button
- clearBt = QCoreApplication.translate("PythonConsole", "Clear console")
- self.clearButton = QAction(self)
- self.clearButton.setCheckable(False)
- self.clearButton.setEnabled(True)
- self.clearButton.setIcon(QgsApplication.getThemeIcon("console/iconClearConsole.png"))
- self.clearButton.setMenuRole(QAction.PreferencesRole)
- self.clearButton.setIconVisibleInMenu(True)
- self.clearButton.setToolTip(clearBt)
- self.clearButton.setText(clearBt)
- ## Action for settings
- optionsBt = QCoreApplication.translate("PythonConsole", "Settings")
- self.optionsButton = QAction(self)
- self.optionsButton.setCheckable(False)
- self.optionsButton.setEnabled(True)
- self.optionsButton.setIcon(QgsApplication.getThemeIcon("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(self)
- self.actionClass.setCheckable(False)
- self.actionClass.setEnabled(True)
- self.actionClass.setIcon(QgsApplication.getThemeIcon("console/iconClassConsole.png"))
- self.actionClass.setMenuRole(QAction.PreferencesRole)
- self.actionClass.setIconVisibleInMenu(True)
- self.actionClass.setToolTip(actionClassBt)
- self.actionClass.setText(actionClassBt)
- ## Import Processing class
- loadProcessingBt = QCoreApplication.translate("PythonConsole", "Import Processing class")
- self.loadProcessingButton = QAction(self)
- self.loadProcessingButton.setCheckable(False)
- self.loadProcessingButton.setEnabled(True)
- self.loadProcessingButton.setIcon(QgsApplication.getThemeIcon("console/iconProcessingConsole.png"))
- self.loadProcessingButton.setMenuRole(QAction.PreferencesRole)
- self.loadProcessingButton.setIconVisibleInMenu(True)
- self.loadProcessingButton.setToolTip(loadProcessingBt)
- self.loadProcessingButton.setText(loadProcessingBt)
- ## Import QtCore class
- loadQtCoreBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtCore class")
- self.loadQtCoreButton = QAction(self)
- self.loadQtCoreButton.setCheckable(False)
- self.loadQtCoreButton.setEnabled(True)
- self.loadQtCoreButton.setIcon(QgsApplication.getThemeIcon("console/iconQtCoreConsole.png"))
- self.loadQtCoreButton.setMenuRole(QAction.PreferencesRole)
- self.loadQtCoreButton.setIconVisibleInMenu(True)
- self.loadQtCoreButton.setToolTip(loadQtCoreBt)
- self.loadQtCoreButton.setText(loadQtCoreBt)
- ## Import QtGui class
- loadQtGuiBt = QCoreApplication.translate("PythonConsole", "Import PyQt.QtGui class")
- self.loadQtGuiButton = QAction(self)
- self.loadQtGuiButton.setCheckable(False)
- self.loadQtGuiButton.setEnabled(True)
- self.loadQtGuiButton.setIcon(QgsApplication.getThemeIcon("console/iconQtGuiConsole.png"))
- self.loadQtGuiButton.setMenuRole(QAction.PreferencesRole)
- self.loadQtGuiButton.setIconVisibleInMenu(True)
- self.loadQtGuiButton.setToolTip(loadQtGuiBt)
- self.loadQtGuiButton.setText(loadQtGuiBt)
- ## Action for Run script
- runBt = QCoreApplication.translate("PythonConsole", "Run command")
- self.runButton = QAction(self)
- self.runButton.setCheckable(False)
- self.runButton.setEnabled(True)
- self.runButton.setIcon(QgsApplication.getThemeIcon("console/iconRunConsole.png"))
- self.runButton.setMenuRole(QAction.PreferencesRole)
- self.runButton.setIconVisibleInMenu(True)
- self.runButton.setToolTip(runBt)
- self.runButton.setText(runBt)
- ## Help action
- helpBt = QCoreApplication.translate("PythonConsole", "Help")
- self.helpButton = QAction(self)
- self.helpButton.setCheckable(False)
- self.helpButton.setEnabled(True)
- self.helpButton.setIcon(QgsApplication.getThemeIcon("console/iconHelpConsole.png"))
- self.helpButton.setMenuRole(QAction.PreferencesRole)
- self.helpButton.setIconVisibleInMenu(True)
- self.helpButton.setToolTip(helpBt)
- self.helpButton.setText(helpBt)
-
- self.toolBar = QToolBar()
- self.toolBar.setEnabled(True)
- self.toolBar.setFocusPolicy(Qt.NoFocus)
- self.toolBar.setContextMenuPolicy(Qt.DefaultContextMenu)
- self.toolBar.setLayoutDirection(Qt.LeftToRight)
- self.toolBar.setIconSize(QSize(24, 24))
- self.toolBar.setOrientation(Qt.Vertical)
- self.toolBar.setMovable(True)
- self.toolBar.setFloatable(True)
- self.toolBar.addAction(self.clearButton)
- self.toolBar.addAction(self.actionClass)
- self.toolBar.addAction(self.runButton)
- self.toolBar.addSeparator()
- self.toolBar.addAction(self.showEditorButton)
- self.toolBar.addSeparator()
- self.toolBar.addAction(self.optionsButton)
- self.toolBar.addAction(self.helpButton)
-
- self.toolBarEditor = QToolBar()
- # self.toolBarEditor.setStyleSheet('QToolBar{background-color: rgb(%s, %s, %s' % tuple(bkgrcolor) + ');\
- # border-right: 1px solid rgb(%s, %s, %s' % tuple(bordercl) + ');}')
- self.toolBarEditor.setEnabled(False)
- self.toolBarEditor.setFocusPolicy(Qt.NoFocus)
- self.toolBarEditor.setContextMenuPolicy(Qt.DefaultContextMenu)
- self.toolBarEditor.setLayoutDirection(Qt.LeftToRight)
- self.toolBarEditor.setIconSize(QSize(18, 18))
- self.toolBarEditor.setOrientation(Qt.Vertical)
- self.toolBarEditor.setMovable(True)
- self.toolBarEditor.setFloatable(True)
- self.toolBarEditor.addAction(self.openFileButton)
- self.toolBarEditor.addSeparator()
- self.toolBarEditor.addAction(self.saveFileButton)
- self.toolBarEditor.addAction(self.saveAsFileButton)
- self.toolBarEditor.addSeparator()
- self.toolBarEditor.addAction(self.findTextButton)
- self.toolBarEditor.addSeparator()
- self.toolBarEditor.addAction(self.cutEditorButton)
- self.toolBarEditor.addAction(self.copyEditorButton)
- self.toolBarEditor.addAction(self.pasteEditorButton)
- self.toolBarEditor.addSeparator()
- self.toolBarEditor.addAction(self.commentEditorButton)
- self.toolBarEditor.addAction(self.uncommentEditorButton)
- self.toolBarEditor.addSeparator()
- self.toolBarEditor.addAction(self.objectListButton)
- self.toolBarEditor.addSeparator()
- self.toolBarEditor.addAction(self.runScriptEditorButton)
-
- ## Menu Import Class
- self.classMenu = QMenu()
- self.classMenu.addAction(self.loadProcessingButton)
- self.classMenu.addAction(self.loadQtCoreButton)
- self.classMenu.addAction(self.loadQtGuiButton)
- cM = self.toolBar.widgetForAction(self.actionClass)
- cM.setMenu(self.classMenu)
- cM.setPopupMode(QToolButton.InstantPopup)
-
- self.widgetButton = QWidget()
- sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.widgetButton.sizePolicy().hasHeightForWidth())
- self.widgetButton.setSizePolicy(sizePolicy)
-
- self.widgetButtonEditor = QWidget(self.widgetEditor)
- sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.widgetButtonEditor.sizePolicy().hasHeightForWidth())
- self.widgetButtonEditor.setSizePolicy(sizePolicy)
-
- sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.shellOut.sizePolicy().hasHeightForWidth())
- self.shellOut.setSizePolicy(sizePolicy)
-
- self.shellOut.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
- self.shell.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
-
- ##------------ Layout -------------------------------
-
- self.mainLayout = QGridLayout(self)
- self.mainLayout.setMargin(0)
- self.mainLayout.setSpacing(0)
- self.mainLayout.addWidget(self.widgetButton, 0, 0, 1, 1)
- self.mainLayout.addWidget(self.splitterEditor, 0, 1, 1, 1)
-
- self.layoutEditor = QGridLayout(self.widgetEditor)
- self.layoutEditor.setMargin(0)
- self.layoutEditor.setSpacing(0)
- self.layoutEditor.addWidget(self.widgetButtonEditor, 0, 0, 2, 1)
- self.layoutEditor.addWidget(self.tabEditorWidget, 0, 1, 1, 1)
- self.layoutEditor.addWidget(self.widgetFind, 1, 1, 1, 1)
-
- self.toolBarLayout = QGridLayout(self.widgetButton)
- self.toolBarLayout.setMargin(0)
- self.toolBarLayout.setSpacing(0)
- self.toolBarLayout.addWidget(self.toolBar)
- self.toolBarEditorLayout = QGridLayout(self.widgetButtonEditor)
- self.toolBarEditorLayout.setMargin(0)
- self.toolBarEditorLayout.setSpacing(0)
- self.toolBarEditorLayout.addWidget(self.toolBarEditor)
-
- ## Layout for the find widget
- self.layoutFind = QGridLayout(self.widgetFind)
- self.layoutFind.setContentsMargins(0, 0, 0, 0)
- self.lineEditFind = QgsFilterLineEdit()
- placeHolderTxt = QCoreApplication.translate("PythonConsole", "Enter text to find...")
-
- if QT_VERSION >= 0x40700:
- self.lineEditFind.setPlaceholderText(placeHolderTxt)
- else:
- self.lineEditFind.setToolTip(placeHolderTxt)
- self.findNextButton = QToolButton()
- self.findNextButton.setEnabled(False)
- toolTipfindNext = QCoreApplication.translate("PythonConsole", "Find Next")
- self.findNextButton.setToolTip(toolTipfindNext)
- self.findNextButton.setIcon(QgsApplication.getThemeIcon("console/iconSearchNextEditorConsole.png"))
- self.findNextButton.setIconSize(QSize(24, 24))
- self.findNextButton.setAutoRaise(True)
- self.findPrevButton = QToolButton()
- self.findPrevButton.setEnabled(False)
- toolTipfindPrev = QCoreApplication.translate("PythonConsole", "Find Previous")
- self.findPrevButton.setToolTip(toolTipfindPrev)
- self.findPrevButton.setIcon(QgsApplication.getThemeIcon("console/iconSearchPrevEditorConsole.png"))
- self.findPrevButton.setIconSize(QSize(24, 24))
- self.findPrevButton.setAutoRaise(True)
- self.caseSensitive = QCheckBox()
- caseSensTr = QCoreApplication.translate("PythonConsole", "Case Sensitive")
- self.caseSensitive.setText(caseSensTr)
- self.wholeWord = QCheckBox()
- wholeWordTr = QCoreApplication.translate("PythonConsole", "Whole Word")
- self.wholeWord.setText(wholeWordTr)
- self.wrapAround = QCheckBox()
- self.wrapAround.setChecked(True)
- wrapAroundTr = QCoreApplication.translate("PythonConsole", "Wrap Around")
- self.wrapAround.setText(wrapAroundTr)
- self.layoutFind.addWidget(self.lineEditFind, 0, 1, 1, 1)
- self.layoutFind.addWidget(self.findPrevButton, 0, 2, 1, 1)
- self.layoutFind.addWidget(self.findNextButton, 0, 3, 1, 1)
- self.layoutFind.addWidget(self.caseSensitive, 0, 4, 1, 1)
- self.layoutFind.addWidget(self.wholeWord, 0, 5, 1, 1)
- self.layoutFind.addWidget(self.wrapAround, 0, 6, 1, 1)
-
- ##------------ Add first Tab in Editor -------------------------------
-
- #self.tabEditorWidget.newTabEditor(tabName='first', filename=None)
-
- ##------------ Signal -------------------------------
-
- self.findTextButton.toggled.connect(self.findTextEditor)
- self.objectListButton.toggled.connect(self.toggleObjectListWidget)
- self.commentEditorButton.triggered.connect(self.commentCode)
- self.uncommentEditorButton.triggered.connect(self.uncommentCode)
- self.runScriptEditorButton.triggered.connect(self.runScriptEditor)
- self.cutEditorButton.triggered.connect(self.cutEditor)
- self.copyEditorButton.triggered.connect(self.copyEditor)
- self.pasteEditorButton.triggered.connect(self.pasteEditor)
- self.showEditorButton.toggled.connect(self.toggleEditor)
- self.clearButton.triggered.connect(self.shellOut.clearConsole)
- self.optionsButton.triggered.connect(self.openSettings)
- self.loadProcessingButton.triggered.connect(self.processing)
- self.loadQtCoreButton.triggered.connect(self.qtCore)
- self.loadQtGuiButton.triggered.connect(self.qtGui)
- self.runButton.triggered.connect(self.shell.entered)
- self.openFileButton.triggered.connect(self.openScriptFile)
- self.saveFileButton.triggered.connect(self.saveScriptFile)
- self.saveAsFileButton.triggered.connect(self.saveAsScriptFile)
- self.helpButton.triggered.connect(self.openHelp)
- self.connect(self.listClassMethod, SIGNAL('itemClicked(QTreeWidgetItem*, int)'),
- self.onClickGoToLine)
- self.lineEditFind.returnPressed.connect(self._findText)
- self.findNextButton.clicked.connect(self._findNext)
- self.findPrevButton.clicked.connect(self._findPrev)
- self.lineEditFind.textChanged.connect(self._textFindChanged)
-
- def _findText(self):
- self.tabEditorWidget.currentWidget().newEditor.findText(True)
-
- def _findNext(self):
- self.tabEditorWidget.currentWidget().newEditor.findText(True)
-
- def _findPrev(self):
- self.tabEditorWidget.currentWidget().newEditor.findText(False)
-
- def _textFindChanged(self):
- if self.lineEditFind.text():
- self.findNextButton.setEnabled(True)
- self.findPrevButton.setEnabled(True)
- else:
- self.lineEditFind.setStyleSheet('')
- self.findNextButton.setEnabled(False)
- self.findPrevButton.setEnabled(False)
-
- def onClickGoToLine(self, item, column):
- tabEditor = self.tabEditorWidget.currentWidget().newEditor
- if item.text(1) == 'syntaxError':
- check = tabEditor.syntaxCheck(fromContextMenu=False)
- if check and not tabEditor.isReadOnly():
- self.tabEditorWidget.currentWidget().save()
- return
- linenr = int(item.text(1))
- itemName = str(item.text(0))
- charPos = itemName.find(' ')
- if charPos != -1:
- objName = itemName[0:charPos]
- else:
- objName = itemName
- tabEditor.goToLine(objName, linenr)
-
- def processing(self):
- self.shell.commandConsole('processing')
-
- def qtCore(self):
- self.shell.commandConsole('qtCore')
-
- def qtGui(self):
- self.shell.commandConsole('qtGui')
-
- def toggleEditor(self, checked):
- self.splitterObj.show() if checked else self.splitterObj.hide()
- if not self.tabEditorWidget:
- self.tabEditorWidget.enableToolBarEditor(checked)
- self.tabEditorWidget.restoreTabsOrAddNew()
-
- def toggleObjectListWidget(self, checked):
- self.listClassMethod.show() if checked else self.listClassMethod.hide()
-
- def findTextEditor(self, checked):
- self.widgetFind.show() if checked else self.widgetFind.hide()
-
- def pasteEditor(self):
- self.tabEditorWidget.currentWidget().newEditor.paste()
-
- def cutEditor(self):
- self.tabEditorWidget.currentWidget().newEditor.cut()
-
- def copyEditor(self):
- self.tabEditorWidget.currentWidget().newEditor.copy()
-
- def runScriptEditor(self):
- self.tabEditorWidget.currentWidget().newEditor.runScriptCode()
-
- def commentCode(self):
- self.tabEditorWidget.currentWidget().newEditor.commentEditorCode(True)
-
- def uncommentCode(self):
- self.tabEditorWidget.currentWidget().newEditor.commentEditorCode(False)
-
- def openScriptFile(self):
- lastDirPath = self.settings.value("pythonConsole/lastDirPath", "")
- openFileTr = QCoreApplication.translate("PythonConsole", "Open File")
- fileList = QFileDialog.getOpenFileNames(
- self, openFileTr, lastDirPath, "Script file (*.py)")
- if fileList:
- for pyFile in fileList:
- for i in range(self.tabEditorWidget.count()):
- tabWidget = self.tabEditorWidget.widget(i)
- if tabWidget.path == pyFile:
- self.tabEditorWidget.setCurrentWidget(tabWidget)
- break
- else:
- tabName = QFileInfo(pyFile).fileName()
- self.tabEditorWidget.newTabEditor(tabName, pyFile)
-
- lastDirPath = QFileInfo(pyFile).path()
- self.settings.setValue("pythonConsole/lastDirPath", pyFile)
- self.updateTabListScript(pyFile, action='append')
-
- def saveScriptFile(self):
- tabWidget = self.tabEditorWidget.currentWidget()
- try:
- tabWidget.save()
- except (IOError, OSError), error:
- msgText = QCoreApplication.translate('PythonConsole',
- 'The file <b>{0}</b> could not be saved. Error: {1}').format(tabWidget.path,
- error.strerror)
- self.callWidgetMessageBarEditor(msgText, 2, False)
-
- def saveAsScriptFile(self, index=None):
- tabWidget = self.tabEditorWidget.currentWidget()
- if not index:
- index = self.tabEditorWidget.currentIndex()
- if not tabWidget.path:
- pathFileName = self.tabEditorWidget.tabText(index) + '.py'
- fileNone = True
- else:
- pathFileName = tabWidget.path
- fileNone = False
- saveAsFileTr = QCoreApplication.translate("PythonConsole", "Save File As")
- filename = QFileDialog.getSaveFileName(self,
- saveAsFileTr,
- pathFileName, "Script file (*.py)")
- if filename:
- try:
- tabWidget.save(filename)
- except (IOError, OSError), error:
- msgText = QCoreApplication.translate('PythonConsole',
- 'The file <b>{0}</b> could not be saved. Error: {1}').format(tabWidget.path,
- error.strerror)
- self.callWidgetMessageBarEditor(msgText, 2, False)
- if fileNone:
- tabWidget.path = None
- else:
- tabWidget.path = pathFileName
- return
-
- if not fileNone:
- self.updateTabListScript(pathFileName, action='remove')
-
- def openHelp(self):
- QgsContextHelp.run( "PythonConsole" )
-
- def openSettings(self):
- if optionsDialog(self).exec_():
- self.shell.refreshSettingsShell()
- self.shellOut.refreshSettingsOutput()
- self.tabEditorWidget.refreshSettingsEditor()
-
- def callWidgetMessageBar(self, text):
- self.shellOut.widgetMessageBar(iface, text)
-
- def callWidgetMessageBarEditor(self, text, level, timed):
- self.tabEditorWidget.widgetMessageBar(iface, text, level, timed)
-
- def updateTabListScript(self, script, action=None):
- if action == 'remove':
- self.tabListScript.remove(script)
- elif action == 'append':
- if not self.tabListScript:
- self.tabListScript = []
- if script not in self.tabListScript:
- self.tabListScript.append(script)
- else:
- self.tabListScript = []
- self.settings.setValue("pythonConsole/tabScripts",
- self.tabListScript)
-
- def saveSettingsConsole(self):
- self.settings.setValue("pythonConsole/splitterConsole", self.splitter.saveState())
- self.settings.setValue("pythonConsole/splitterObj", self.splitterObj.saveState())
- self.settings.setValue("pythonConsole/splitterEditor", self.splitterEditor.saveState())
-
- self.shell.writeHistoryFile(True)
-
- def restoreSettingsConsole(self):
- storedTabScripts = self.settings.value("pythonConsole/tabScripts", [])
- self.tabListScript = storedTabScripts
- self.splitter.restoreState(self.settings.value("pythonConsole/splitterConsole", QByteArray()))
- self.splitterEditor.restoreState(self.settings.value("pythonConsole/splitterEditor", QByteArray()))
- self.splitterObj.restoreState(self.settings.value("pythonConsole/splitterObj", QByteArray()))
-
-if __name__ == '__main__':
- a = QApplication(sys.argv)
- console = PythonConsoleWidget()
- console.show()
- a.exec_()
diff --git a/qgis-ltr.install b/qgis-ltr.install
deleted file mode 100644
index 584660bf95ff..000000000000
--- a/qgis-ltr.install
+++ /dev/null
@@ -1,13 +0,0 @@
-## arg 1: the new package version
-post_install() {
- /usr/bin/update-desktop-database -q
-}
-## arg 1: the new package version
-## arg 2: the old package version
-post_upgrade() {
- /usr/bin/update-desktop-database -q
-}
-## arg 1: the old package version
-post_remove() {
- /usr/bin/update-desktop-database -q
-}
diff --git a/qgis-ltr.png b/qgis-ltr.png
deleted file mode 100644
index 890c6de9c610..000000000000
--- a/qgis-ltr.png
+++ /dev/null
Binary files differ
diff --git a/qgis-ltr.sh b/qgis-ltr.sh
deleted file mode 100755
index 07a43f91d190..000000000000
--- a/qgis-ltr.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-QGIS_PREFIX_PATH=/opt/qgis-ltr
-
-/opt/qgis-ltr/bin/qgis-ltr --configpath $HOME/.qgis2-ltr \ No newline at end of file