Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/qgis/Quantum-GIS into style…
Browse files Browse the repository at this point in the history
…s_to_db
  • Loading branch information
Emilio Loi committed Apr 23, 2013
1 parent b4b779c commit 49f1b53
Show file tree
Hide file tree
Showing 20 changed files with 225 additions and 802 deletions.
10 changes: 5 additions & 5 deletions doc/INSTALL.html
Expand Up @@ -5,7 +5,7 @@
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Quantum GIS (QGIS)</TITLE>

<!-- Included style.css -->
<!-- Included /home/el1073/Faunalia/Quantum-GIS-master/doc/style.css -->
<STYLE TYPE="text/css">
body{ background: white;
color: black;
Expand Down Expand Up @@ -77,13 +77,13 @@
<DIV CLASS="header" ID="header">
<H1>Quantum GIS (QGIS)</H1>
<H2>Building QGIS from source - step by step</H2>
<H3>Sunday April 07, 2013</H3>
<H3>Tuesday April 23, 2013</H3>
</DIV>

<DIV CLASS="body" ID="body">
<P>
Last Updated: Sunday April 07, 2013
Last Change : Saturday December 08, 2012
Last Updated: Tuesday April 23, 2013
Last Change : Tuesday April 23, 2013
</P>
<DIV CLASS="toc">

Expand Down Expand Up @@ -3188,5 +3188,5 @@ <H1>9. Authors and Acknowledgments</H1>

</DIV>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -t html -o INSTALL.html INSTALL.t2t -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS-master/doc/INSTALL.html -t html /home/el1073/Faunalia/Quantum-GIS-master/doc/INSTALL.t2t -->
</BODY></HTML>
16 changes: 8 additions & 8 deletions doc/news.html
Expand Up @@ -5,7 +5,7 @@
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Quantum GIS (QGIS) News</TITLE>

<!-- Included style.css -->
<!-- Included /home/el1073/Faunalia/Quantum-GIS-master/doc/style.css -->
<STYLE TYPE="text/css">
body{ background: white;
color: black;
Expand Down Expand Up @@ -77,7 +77,7 @@
<DIV CLASS="header" ID="header">
<H1>Quantum GIS (QGIS) News</H1>
<H2>Change history for the QGIS Project</H2>
<H3>Saturday May 26, 2012</H3>
<H3>Tuesday April 23, 2013</H3>
</DIV>

<DIV CLASS="toc">
Expand Down Expand Up @@ -145,8 +145,8 @@ <H3>Saturday May 26, 2012</H3>
</DIV>
<DIV CLASS="body" ID="body">
<P>
Last Updated: Saturday May 26, 2012
Last Change : Saturday May 26, 2012
Last Updated: Tuesday April 23, 2013
Last Change : Tuesday April 23, 2013
</P>

<A NAME="toc1"></A>
Expand All @@ -173,7 +173,7 @@ <H1>1. Whats new in Version 1.8.0 'Lisboa'?</H1>
<LI>Menu Re-organisation - The menus were re-organised a little - we now have separate menus for Vector and Raster and many plugins were updated to place their menus in the new Vector and Raster top level menus.
<LI>Offset Curves - a new digitising tool for creating offset curves was added.
<LI>Terrain Analysis Plugin - a new core plugin was added for doing terrain analysis - and it can make really good looking coloured relief maps.
<LI>Ellipse renderer symbollayer to render ellipse shapes (and also rectangles, triangles, crosses by specifying width and height). Moreover, the symbol layer allows to set all parameters (width, height, colors, rotation, outline with) from data fields, in mm or map units
<LI>Ellipse renderer - symbollayer to render ellipse shapes (and also rectangles, triangles, crosses by specifying width and height). Moreover, the symbol layer allows to set all parameters (width, height, colors, rotation, outline with) from data fields, in mm or map units
<LI>New scale selector with predefined scales
<LI>Option to add layers to selected or active group
<LI>Pan To Selected tool
Expand Down Expand Up @@ -327,8 +327,8 @@ <H1>3. Whats new in Version 1.7.1 'Wroclaw'?</H1>
<H1>4. Whats new in Version 1.7.0 'Wroclaw'?</H1>

<P>
This release is named after the town of Wrocław in Poland. The Department of
Climatology and Atmosphere Protection, University of Wrocław kindly hosted our
This release is named after the town of Wroclaw in Poland. The Department of
Climatology and Atmosphere Protection, University of Wroclaw kindly hosted our
developer meeting in November 2010. Please note that this is a release in
our 'cutting edge' release series. As such it contains new features and extends
the programmatic interface over QGIS 1.0.x and QGIS 1.6.0. As with any
Expand Down Expand Up @@ -2613,5 +2613,5 @@ <H1>18. 0.5</H1>
</DIV>

<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -t html -o news.html news.t2t -->
<!-- cmdline: txt2tags -o/home/el1073/Faunalia/Quantum-GIS-master/doc/news.html -t html /home/el1073/Faunalia/Quantum-GIS-master/doc/news.t2t -->
</BODY></HTML>
5 changes: 3 additions & 2 deletions python/console/console.py
Expand Up @@ -586,9 +586,10 @@ def saveAsScriptFile(self):
return
filename = QFileDialog.getSaveFileName(self,
"Save File As",
"*.py", "Script file (*.py)")
tabWidget.path, "Script file (*.py)")
if not filename.isEmpty():
self.tabListScript.remove(tabWidget.path)
#print tabWidget.path
self.tabListScript.remove(unicode(tabWidget.path))
tabWidget.path = filename
self.saveScriptFile()

Expand Down
49 changes: 31 additions & 18 deletions python/console/console_editor.py
Expand Up @@ -477,7 +477,7 @@ def __init__(self, parent, parentConsole, filename, *args):
self.newEditor.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.newEditor.modificationChanged.connect(self.modified)
if filename:
self.newEditor.setText(open(filename, "rt").read())
self.newEditor.setText(open(unicode(filename), "rt").read())
self.newEditor.setModified(False)
self.path = filename

Expand Down Expand Up @@ -513,22 +513,23 @@ def save(self):
'Script was correctly saved.')
self.pc.callWidgetMessageBarEditor(msgText)
# Rename the original file, if it exists
overwrite = os.path.exists(self.path)
path = unicode(self.path)
overwrite = os.path.exists(path)
if overwrite:
temp_path = self.path + "~"
temp_path = path + "~"
if os.path.exists(temp_path):
os.remove(temp_path)
os.rename(self.path, temp_path)
os.rename(path, temp_path)
# Save the new contents
with open(self.path, "w") as f:
with open(path, "w") as f:
f.write(self.newEditor.text())
if overwrite:
os.remove(temp_path)
fN = self.path.split('/')[-1]
fN = path.split('/')[-1]
self.mw.setTabTitle(self, fN)
self.mw.setTabToolTip(self.mw.currentIndex(), self.path)
self.mw.setTabToolTip(self.mw.currentIndex(), path)
self.newEditor.setModified(False)
self.pc.updateTabListScript(self.path, action='append')
self.pc.updateTabListScript(path, action='append')
self.mw.listObject(self)

def modified(self, modified):
Expand Down Expand Up @@ -722,12 +723,12 @@ def closeCurrentWidget(self):

def restoreTabs(self):
for script in self.restoreTabList:
pathFile = str(script.toString())
if os.path.exists(pathFile):
tabName = pathFile.split('/')[-1]
self.newTabEditor(tabName, pathFile)
else:
self.newTabEditor(filename=None)
pathFile = unicode(script.toString())
if os.path.exists(pathFile):
tabName = pathFile.split('/')[-1]
self.newTabEditor(tabName, pathFile)
else:
self.newTabEditor(filename=None)
self.topFrame.close()
self.enableToolBarEditor(True)

Expand Down Expand Up @@ -755,22 +756,34 @@ def listObject(self, tab):
else:
tabWidget = self.widget(tab)
if tabWidget.path:
pathFile, file = os.path.split(str(tabWidget.path))
pathFile, file = os.path.split(unicode(tabWidget.path))
module, ext = os.path.splitext(file)
#print sys.modules[module]
if pathFile not in sys.path:
sys.path.append(pathFile)
try:
reload(pyclbr)
dictObject = {}
superClassName = []
readModule = pyclbr.readmodule(module)
readModuleFunction = pyclbr.readmodule_ex(module)
for name, class_data in sorted(readModule.items(), key=lambda x:x[1].lineno):
if class_data.file == tabWidget.path:
for superClass in class_data.super:
if superClass == 'object':
continue
if isinstance(superClass, basestring):
superClassName.append(superClass)
else:
superClassName.append(superClass.name)
classItem = QTreeWidgetItem()
classItem.setText(0, name)
if superClassName:
for i in superClassName: super = i
classItem.setText(0, name + ' [' + super + ']')
classItem.setToolTip(0, name + ' [' + super + ']')
else:
classItem.setText(0, name)
classItem.setToolTip(0, name)
classItem.setText(1, str(class_data.lineno))
classItem.setToolTip(0, name)
classItem.setIcon(0, QgsApplication.getThemeIcon("console/iconClassTreeWidgetConsole.png"))
dictObject[name] = class_data.lineno
for meth, lineno in sorted(class_data.methods.items(), key=itemgetter(1)):
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectordataprovider.sip
Expand Up @@ -27,7 +27,7 @@ class QgsVectorDataProvider : QgsDataProvider
RandomSelectGeometryAtId = 1024,
SequentialSelectGeometryAtId = 2048,
CreateAttributeIndex = 4096,
SetEncoding = 8192,
SelectEncoding = 8192,
};

/** bitmask of all provider's editing capabilities */
Expand Down
8 changes: 4 additions & 4 deletions src/app/CMakeLists.txt
Expand Up @@ -42,6 +42,8 @@ SET(QGIS_APP_SRCS
qgslabelengineconfigdialog.cpp
qgslabelinggui.cpp
qgslabelpreview.cpp
qgsloadstylefromdbdialog.cpp
qgssavestyletodbdialog.cpp

qgsmaptooladdfeature.cpp
qgsmaptooladdvertex.cpp
Expand Down Expand Up @@ -81,8 +83,6 @@ SET(QGIS_APP_SRCS
qgsmaptoolsvgannotation.cpp
qgsmaptooltextannotation.cpp
qgsmaptoolvertexedit.cpp
qgssavestyletodbdialog.cpp
qgsloadstylefromdbdialog.cpp

nodetool/qgsmaptoolnodetool.cpp
nodetool/qgsselectedfeature.cpp
Expand Down Expand Up @@ -197,6 +197,8 @@ SET (QGIS_APP_MOC_HDRS
qgslabelengineconfigdialog.h
qgslabelinggui.h
qgslabelpropertydialog.h
qgsloadstylefromdbdialog.h
qgssavestyletodbdialog.h
qgsshortcutsmanager.h

qgsmaptooladdfeature.h
Expand Down Expand Up @@ -229,8 +231,6 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptoolsimplify.h
qgsmaptoolsplitfeatures.h
qgsmaptoolvertexedit.h
qgssavestyletodbdialog.h
qgsloadstylefromdbdialog.h

nodetool/qgsmaptoolnodetool.h
nodetool/qgsselectedfeature.h
Expand Down
15 changes: 11 additions & 4 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -34,7 +34,6 @@
#include "qgslabelinggui.h"
#include "qgslabel.h"
#include "qgslegenditem.h"

#include "qgsgenericprojectionselector.h"
#include "qgslogger.h"
#include "qgsmaplayerregistry.h"
Expand Down Expand Up @@ -182,7 +181,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
pbnIndex->setEnabled( false );
}

if ( capabilities & QgsVectorDataProvider::SetEncoding )
if ( capabilities & QgsVectorDataProvider::SelectEncoding )
{
cboProviderEncoding->addItems( QgsVectorDataProvider::availableEncodings() );
QString enc = layer->dataProvider()->encoding();
Expand All @@ -194,8 +193,16 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
}
cboProviderEncoding->setCurrentIndex( encindex );
}
else if ( layer->dataProvider()->name() == "ogr" )
{
// if OGR_L_TestCapability(OLCStringsAsUTF8) returns true, OGR provider encoding can be set to only UTF-8
// so make encoding box grayed out
cboProviderEncoding->addItem( layer->dataProvider()->encoding() );
cboProviderEncoding->setEnabled( false );
}
else
{
// other providers do not use mEncoding, so hide the group completely
mDataSourceEncodingFrame->hide();
}
}
Expand Down Expand Up @@ -413,7 +420,7 @@ void QgsVectorLayerProperties::apply()
// provider-specific options
if ( layer->dataProvider() )
{
if ( layer->dataProvider()->capabilities() & QgsVectorDataProvider::SetEncoding )
if ( layer->dataProvider()->capabilities() & QgsVectorDataProvider::SelectEncoding )
{
layer->setProviderEncoding( cboProviderEncoding->currentText() );
}
Expand Down Expand Up @@ -598,7 +605,6 @@ void QgsVectorLayerProperties::on_pbnLoadDefaultStyle_clicked()
//something went wrong - let them know why
QMessageBox::information( this, tr( "Default Style" ), myMessage );
}

}

void QgsVectorLayerProperties::on_pbnSaveDefaultStyle_clicked()
Expand Down Expand Up @@ -704,6 +710,7 @@ void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
QSettings myQSettings; // where we keep last used filter in persistent state
QString myLastUsedDir = myQSettings.value( "style/lastStyleDir", "." ).toString();

QString format, extension;
if( styleType == DB )
{
QString infoWindowTitle = QObject::tr( "Save style to DB (%1)" ).arg( layer->providerType() );
Expand Down
8 changes: 3 additions & 5 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -743,7 +743,6 @@ bool QgsMapLayer::loadNamedStyleFromDb( const QString db, const QString theURI,
sqlite3_close( myDatabase );

return theResultFlag;

}

QString QgsMapLayer::loadNamedStyle( const QString theURI, bool &theResultFlag )
Expand All @@ -753,8 +752,8 @@ QString QgsMapLayer::loadNamedStyle( const QString theURI, bool &theResultFlag )
theResultFlag = false;

QDomDocument myDocument( "qgis" );
// location of problem associated with errorMsg

// location of problem associated with errorMsg
int line, column;
QString myErrorMessage;

Expand All @@ -775,7 +774,7 @@ QString QgsMapLayer::loadNamedStyle( const QString theURI, bool &theResultFlag )
QString qml;
if ( loadNamedStyleFromDb( QDir( QgsApplication::qgisSettingsDirPath() ).absoluteFilePath( "qgis.qmldb" ), theURI, qml ) ||
( project.exists() && loadNamedStyleFromDb( project.absoluteDir().absoluteFilePath( project.baseName() + ".qmldb" ), theURI, qml ) ) ||
loadNamedStyleFromDb( QDir( QgsApplication::pkgDataPath() ).absoluteFilePath( "resources/qgis.qmldb" ), theURI, qml )/* || (loadStyleExternalMethod && loadStyleExternalMethod(theURI, qml, myErrorMessage))*/)
loadNamedStyleFromDb( QDir( QgsApplication::pkgDataPath() ).absoluteFilePath( "resources/qgis.qmldb" ), theURI, qml ) )
{
theResultFlag = myDocument.setContent( qml, &myErrorMessage, &line, &column );
if ( !theResultFlag )
Expand Down Expand Up @@ -881,12 +880,11 @@ void QgsMapLayer::exportNamedStyle(QDomDocument &doc, QString &errorMsg)

QString QgsMapLayer::saveDefaultStyle( bool & theResultFlag )
{
return saveNamedStyle( styleURI(), theResultFlag );
return saveNamedStyle( styleURI(), theResultFlag );
}

QString QgsMapLayer::saveNamedStyle( const QString theURI, bool & theResultFlag )
{

QString myErrorMessage;
QDomDocument myDocument;
exportNamedStyle( myDocument, myErrorMessage );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectordataprovider.h
Expand Up @@ -84,8 +84,8 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
/** DEPRECATED - do not use */
SequentialSelectGeometryAtId = 1 << 11,
CreateAttributeIndex = 1 << 12,
/** Uses mEncoding for conversion of 8-bit strings to unicode */
SetEncoding = 1 << 13,
/** allows user to select encoding */
SelectEncoding = 1 << 13,
};

/** bitmask of all provider's editing capabilities */
Expand Down

0 comments on commit 49f1b53

Please sign in to comment.