77 changes: 54 additions & 23 deletions python/plugins/fTools/tools/doValidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ def __init__(self, iface):
self.storedScale = self.iface.mapCanvas().scale()
# create marker for error
self.marker = MarkerErrorGeometry(self.iface.mapCanvas())

settings = QSettings()
self.restoreGeometry( settings.value("/fTools/ValidateDialog/geometry").toByteArray() )

def closeEvent(self, e):
settings = QSettings()
settings.setValue( "/fTools/ValidateDialog/geometry", QVariant(self.saveGeometry()) )
QMainWindow.closeEvent(self, e)
del self.marker

def keyPressEvent( self, e ):
if ( e.modifiers() == Qt.ControlModifier or \
Expand All @@ -115,34 +124,58 @@ def accept( self ):
elif self.cmbField.isVisible() and self.cmbField.currentText() == "":
QMessageBox.information( self, self.tr("Error!"), self.tr( "Please specify input field" ) )
else:
self.validate( self.inShape.currentText(), self.useSelected.checkState() )
self.vlayer = ftools_utils.getVectorLayerByName( self.inShape.currentText() )
self.validate( self.useSelected.checkState() )

def zoomToError(self, curr, prev):
if curr is None:
return
row = curr.row() # if we clicked in the first column, we want the second
item = self.tblUnique.item(row, 1)
if not item.data(Qt.UserRole) is None:
mc = self.iface.mapCanvas()
x = item.data(Qt.UserRole).toPyObject().x()
y = item.data(Qt.UserRole).toPyObject().y()
self.marker.setGeom(x, y) # Set Marker
mc.zoomToPreviousExtent()
scale = mc.scale()
rect = QgsRectangle(float(x)-(4.0/scale),float(y)-(4.0/scale),
float(x)+(4.0/scale),float(y)+(4.0/scale))
# Set the extent to our new rectangle
mc.setExtent(rect)
# Refresh the map
mc.refresh()

def validate( self, myLayer, mySelection ):
vlayer = ftools_utils.getVectorLayerByName( myLayer )

mc = self.iface.mapCanvas()
mc.zoomToPreviousExtent()

if mc.mapRenderer().hasCrsTransformEnabled():
ct = QgsCoordinateTransform( self.vlayer.crs(), mc.mapRenderer().destinationCrs() )
else:
ct = None

e = item.data(Qt.UserRole).toPyObject()

if type(e)==QgsPoint:
if not ct is None:
e = ct.transform( e )

self.marker.setGeom(e.x(), e.y())

rect = mc.extent()
rect.expand( 0.25, e )

else:
self.marker.reset()

ft = QgsFeature()
(fid,ok) = self.tblUnique.item(row, 0).text().toInt()
if not ok or not self.vlayer.featureAtId( fid, ft, True):
return

rect = ft.geometry().boundingBox()
if not ct is None:
rect = ct.transformBoundingBox( rect )
rect.expand(1.05)

# Set the extent to our new rectangle
mc.setExtent(rect)
# Refresh the map
mc.refresh()

def validate( self, mySelection ):
self.tblUnique.clearContents()
self.tblUnique.setRowCount( 0 )
self.lstCount.clear()
self.buttonOk.setEnabled( False )
self.testThread = validateThread( self.iface.mainWindow(), self, vlayer, mySelection )
self.testThread = validateThread( self.iface.mainWindow(), self, self.vlayer, mySelection )
QObject.connect( self.testThread, SIGNAL( "runFinished(PyQt_PyObject)" ), self.runFinishedFromThread )
QObject.connect( self.testThread, SIGNAL( "runStatus(PyQt_PyObject)" ), self.runStatusFromThread )
QObject.connect( self.testThread, SIGNAL( "runRange(PyQt_PyObject)" ), self.runRangeFromThread )
Expand Down Expand Up @@ -176,11 +209,10 @@ def runFinishedFromThread( self, output ):
self.tblUnique.insertRow(count)
fidItem = QTableWidgetItem( str(rec[0]) )
self.tblUnique.setItem( count, 0, fidItem )
if err.hasWhere(): # if there is a location associated with the error
where = err.where()
message = err.what()
errItem = QTableWidgetItem( message )
errItem.setData(Qt.UserRole, QVariant(where))
if err.hasWhere(): # if there is a location associated with the error
errItem.setData(Qt.UserRole, QVariant(err.where()))
self.tblUnique.setItem( count, 1, errItem )
count += 1
self.tblUnique.setHorizontalHeaderLabels( [ self.tr("Feature"), self.tr("Error(s)") ] )
Expand Down Expand Up @@ -211,7 +243,6 @@ def run( self ):
self.running = True
output = self.check_geometry( self.vlayer )
self.emit( SIGNAL( "runFinished(PyQt_PyObject)" ), output )
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 100 )

def stop(self):
self.running = False
Expand Down Expand Up @@ -240,7 +271,7 @@ def check_geometry( self, vlayer ):
self.emit(SIGNAL("runStatus(PyQt_PyObject)"), nElement)
nElement += 1
# Check Add error
if not (geom.isGeosEmpty() or geom.isGeosValid() ) :
if not geom.isGeosEmpty():
lstErrors.append((feat.id(), list(geom.validateGeometry())))
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nFeat )
return lstErrors
145 changes: 68 additions & 77 deletions python/plugins/fTools/tools/frmSpatialJoin.ui
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label_3">
Expand All @@ -34,7 +34,7 @@
</item>
</layout>
</item>
<item row="1" column="0" colspan="3">
<item>
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label">
Expand All @@ -48,28 +48,24 @@
</item>
</layout>
</item>
<item row="2" column="0" colspan="3">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Attribute Summary</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0" colspan="7">
<widget class="QRadioButton" name="rdoFirst">
<property name="text">
<string>Take attributes of first located feature</string>
</property>
<property name="checked">
<bool>true</bool>
<item row="2" column="6">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="0" colspan="7">
<widget class="QRadioButton" name="rdoSummary">
<property name="text">
<string>Take summary of intersecting features</string>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
<item row="2" column="0">
<spacer>
Expand Down Expand Up @@ -97,23 +93,20 @@
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="chkMin">
<property name="enabled">
<bool>false</bool>
</property>
<item row="1" column="0" colspan="7">
<widget class="QRadioButton" name="rdoSummary">
<property name="text">
<string>Min</string>
<string>Take summary of intersecting features</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QCheckBox" name="chkMax">
<item row="2" column="2">
<widget class="QCheckBox" name="chkMin">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Max</string>
<string>Min</string>
</property>
</widget>
</item>
Expand All @@ -127,19 +120,6 @@
</property>
</widget>
</item>
<item row="2" column="6">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="5">
<widget class="QCheckBox" name="chkMedian">
<property name="enabled">
Expand All @@ -150,10 +130,30 @@
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QCheckBox" name="chkMax">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Max</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="7">
<widget class="QRadioButton" name="rdoFirst">
<property name="text">
<string>Take attributes of first located feature</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" colspan="3">
<item>
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label_2">
Expand Down Expand Up @@ -182,7 +182,7 @@
</item>
</layout>
</item>
<item row="4" column="0" colspan="3">
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Output table</string>
Expand All @@ -208,41 +208,32 @@
</layout>
</widget>
</item>
<item row="5" column="0" rowspan="3" colspan="3">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>359</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="1">
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>24</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="2" rowspan="2">
<widget class="QDialogButtonBox" name="buttonBox_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
</property>
</widget>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>24</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
Expand Down
131 changes: 66 additions & 65 deletions python/plugins/fTools/tools/frmVectorSplit.ui
Original file line number Diff line number Diff line change
@@ -1,105 +1,106 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog" >
<property name="windowModality" >
<widget class="QDialog" name="Dialog">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry" >
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>374</width>
<height>306</height>
<width>378</width>
<height>239</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>Vector Split</string>
</property>
<property name="sizeGripEnabled" >
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" colspan="2" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Input vector layer</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QComboBox" name="inShape" />
</item>
<item row="2" column="0" colspan="2" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Unique ID field</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2" >
<widget class="QComboBox" name="inField" />
</item>
<item row="4" column="0" colspan="2" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>Output folder</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2" >
<layout class="QHBoxLayout" >
<layout class="QGridLayout" name="gridLayout">
<item row="5" column="0" colspan="2">
<layout class="QHBoxLayout">
<item>
<widget class="QLineEdit" name="outShape" >
<property name="readOnly" >
<widget class="QLineEdit" name="outShape">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolOut" >
<property name="text" >
<widget class="QToolButton" name="toolOut">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Unique ID field</string>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QComboBox" name="inField"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="QComboBox" name="inShape"/>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Output folder</string>
</property>
</spacer>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Input vector layer</string>
</property>
</widget>
</item>
<item row="7" column="0" >
<widget class="QProgressBar" name="progressBar" >
<property name="value" >
<item row="7" column="0">
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>0</number>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignHCenter</set>
</property>
<property name="textVisible" >
<property name="textVisible">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="1" >
<widget class="QDialogButtonBox" name="buttonBox_2" >
<property name="orientation" >
<item row="7" column="1">
<widget class="QDialogButtonBox" name="buttonBox_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="6" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
Expand All @@ -110,11 +111,11 @@
<receiver>Dialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>124</x>
<y>355</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>215</x>
<y>290</y>
</hint>
Expand All @@ -126,11 +127,11 @@
<receiver>Dialog</receiver>
<slot>close()</slot>
<hints>
<hint type="sourcelabel" >
<hint type="sourcelabel">
<x>50</x>
<y>350</y>
</hint>
<hint type="destinationlabel" >
<hint type="destinationlabel">
<x>132</x>
<y>239</y>
</hint>
Expand Down
214 changes: 119 additions & 95 deletions scripts/tsstat.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,113 +20,137 @@

# translator names here as a hash where the key is the lang_country code used for the ts file name
my $translators= {
af => 'Hendrik Bosman',
ar => 'Assem Kamal, Latif Jalil',
bg => 'Захари Савов, Jordan Tzvetkov',
ca_ES => 'Xavi',
cs_CZ => 'Martin Landa, Peter Antolik, Martin Dzurov, Jan Helebrant',
da_DK => 'Henriette Roued',
de => 'Jürgen E. Fischer, Stephan Holl, Otto Dassau, Werner Macho',
es => 'Carlos Dávila, Javier César Aldariz, Gabriela Awad, Edwin Amado, Mayeul Kauffmann',
el_GR => 'Evripidis Argyropoulos, Mike Pegnigiannis, Nikos Ves',
et_EE => 'Veiko Viil',
fa => 'Mola Pahnadayan',
fi => 'Marko Jarvenpaa',
fr => 'Eve Rousseau, Marc Monnerat, Lionel Roubeyrie, Jean Roc Morreale, Benjamin Bohard, Jeremy Garniaux, Yves Jacolin, Benjamin Lerre, Stéphane Morel, Marie Silvestre, Tahir Tamba, Xavier M, Mayeul Kauffmann, Mehdi Semchaoui',
gl_ES => 'Xan Vieiro',
hu => 'Zoltan Siki',
hr_HR => 'Zoran Jankovic',
is => 'Thordur Ivarsson',
id => 'Januar V. Simarmata, I Made Anombawa',
it => 'Paolo Cavallini, Flavio Rigolon, Maurizio Napolitano, Roberto Angeletti, Alessandro Fanna, Michele Beneventi, Marco Braida, Luca Casagrande, Luca Delucchi, Anne Gishla',
ja => 'BABA Yoshihiko, Yoichi Kayama',
ka_GE => 'Shota Murtskhvaladze, George Machitidze',
ko_KR => 'BJ Jang',
lo => 'Anousak Souphavanh',
lv => 'Maris Nartiss, Pēteris Brūns',
lt => 'Kestas M',
nl => 'Richard Duivenvoorde, Raymond Nijssen, Carlo van Rijswijk',
mn => 'Bayarmaa Enkhtur',
pl_PL => 'Robert Szczepanek, Milena Nowotarska, Borys Jurgiel, Mateusz Loskot, Tomasz Paul, Andrzej Swiader ',
pt_BR => 'Arthur Nanni, Christian Ferreira, Leandro Kaut',
pt_PT => 'Giovanni Manghi, Joana Simoes, Duarte Carreira, Alexandre Neto, Pedro Pereira',
ro => 'Lonut Losifescu-Enescu',
ru => 'Artem Popov',
sk => 'Lubos Balazovic',
sl_SI => 'Jože Detečnik, Dejan Gregor',
sv => 'Lars Luthman, Magnus Homann',
sq_AL => '',
th => 'Man Chao',
tr => 'Osman Yilmaz',
uk => 'Сергей Якунин',
vi => 'Bùi Hữu Mạnh',
zh_CN => 'Zhang Jun',
zh_TW => 'Nungyao Lin',
af => 'Hendrik Bosman',
ar => 'Assem Kamal, Latif Jalil',
bg => 'Захари Савов, Jordan Tzvetkov',
ca_ES => 'Xavi',
cs_CZ => 'Martin Landa, Peter Antolik, Martin Dzurov, Jan Helebrant',
da_DK => 'Henriette Roued',
de => 'Jürgen E. Fischer, Stephan Holl, Otto Dassau, Werner Macho',
es => 'Carlos Dávila, Javier César Aldariz, Gabriela Awad, Edwin Amado, Mayeul Kauffmann',
el_GR => 'Evripidis Argyropoulos, Mike Pegnigiannis, Nikos Ves',
et_EE => 'Veiko Viil',
fa => 'Mola Pahnadayan',
fi => 'Marko Jarvenpaa',
fr => 'Eve Rousseau, Marc Monnerat, Lionel Roubeyrie, Jean Roc Morreale, Benjamin Bohard, Jeremy Garniaux, Yves Jacolin, Benjamin Lerre, Stéphane Morel, Marie Silvestre, Tahir Tamba, Xavier M, Mayeul Kauffmann, Mehdi Semchaoui',
gl_ES => 'Xan Vieiro',
hu => 'Zoltan Siki',
hr_HR => 'Zoran Jankovic',
is => 'Thordur Ivarsson',
id => 'Januar V. Simarmata, I Made Anombawa',
it => 'Paolo Cavallini, Flavio Rigolon, Maurizio Napolitano, Roberto Angeletti, Alessandro Fanna, Michele Beneventi, Marco Braida, Luca Casagrande, Luca Delucchi, Anne Gishla',
ja => 'BABA Yoshihiko, Yoichi Kayama',
ka_GE => 'Shota Murtskhvaladze, George Machitidze',
ko_KR => 'BJ Jang',
lo => 'Anousak Souphavanh',
lv => 'Maris Nartiss, Pēteris Brūns',
lt => 'Kestas M',
nl => 'Richard Duivenvoorde, Raymond Nijssen, Carlo van Rijswijk',
mn => 'Bayarmaa Enkhtur',
pl_PL => 'Robert Szczepanek, Milena Nowotarska, Borys Jurgiel, Mateusz Loskot, Tomasz Paul, Andrzej Swiader ',
pt_BR => 'Arthur Nanni, Christian Ferreira, Leandro Kaut',
pt_PT => 'Giovanni Manghi, Joana Simoes, Duarte Carreira, Alexandre Neto, Pedro Pereira',
ro => 'Lonut Losifescu-Enescu',
ru => 'Artem Popov',
sk => 'Lubos Balazovic',
sl_SI => 'Jože Detečnik, Dejan Gregor',
sv => 'Lars Luthman, Magnus Homann',
sq_AL => '',
th => 'Man Chao',
tr => 'Osman Yilmaz',
uk => 'Сергей Якунин',
vi => 'Bùi Hữu Mạnh',
zh_CN => 'Zhang Jun',
zh_TW => 'Nungyao Lin',
};

my $maxn;

for my $i (<i18n/qgis_*.ts>) {
my ($langcode) = $i =~ /i18n\/qgis_(.*).ts/;
my ($langcode) = $i =~ /i18n\/qgis_(.*).ts/;

my $name;
if($langcode =~ /(.*)_(.*)/) {
my $lang = code2language(lc $1);
my $country = code2country(lc $2);
$name = "$lang ($country)";
} else {
$name = code2language(lc $langcode);
}
my $name;
if($langcode =~ /(.*)_(.*)/) {
my $lang = code2language(lc $1);
my $country = code2country(lc $2);
$name = "$lang ($country)";
} else {
$name = code2language(lc $langcode);
}


open F, "lrelease $i|";
open F, "lrelease $i|";

my($translations,$finished,$unfinished,$untranslated);
my($translations,$finished,$unfinished,$untranslated);

while(<F>) {
if(/Generated (\d+) translation\(s\) \((\d+) finished and (\d+) unfinished\)/) {
$translations=$1;
$finished=$2;
$unfinished=$3;
} elsif(/Ignored (\d+) untranslated source text\(s\)/) {
$untranslated=$1;
}
}
while(<F>) {
if(/Generated (\d+) translation\(s\) \((\d+) finished and (\d+) unfinished\)/) {
$translations=$1;
$finished=$2;
$unfinished=$3;
} elsif(/Ignored (\d+) untranslated source text\(s\)/) {
$untranslated=$1;
}
}

close F;
close F;

my $n = $translations+$untranslated;
my $n = $translations+$untranslated;
$maxn = $n unless defined $maxn && $maxn>$n;

push @lang, { code=>$langcode, name=>$name, n=>$n, translations=>$translations, finished=>$finished, unfinished=>$unfinished, untranslated=>$untranslated, percentage=>($n-$untranslated)/$n*100 };
push @lang, { code=>$langcode, name=>$name, n=>$n, translations=>$translations, finished=>$finished, unfinished=>$unfinished, untranslated=>$untranslated, };
}

if ($ARGV[0] eq "site"){
print "<html><body>";
print "<head>";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>";
print "<style>";
print "body{font-family:sans-serif;}";
print "table {font-size:80%;border-collapse: collapse;}";
print "td {border-left:solid 1px #aaaaaa;border-right:solid 1px #aaaaaa;padding:1px 10px;}";
print ".bartodo{ background-color:red;width:100px;height:20px;}";
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
print "</style></head>";
print "<table>";
print "<tr><td colspan=\"2\" style=\"width:250px;\">Language</td><td>Count</td><td>Finished</td><td>Unfinished</td><td>Untranslated</td><td>Percentage</td><td>Translators</td></tr>\n";
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
print "\n<tr><td><img src=\"flags/", $l->{code}, ".png\">", "</td><td>", $l->{name}, "</td><td>", join("</td><td>", $l->{n}, $l->{finished}, $l->{unfinished}, $l->{untranslated}, sprintf("<div class=\"bartodo\"><div class=\"bardone\" style=\"width:%.1fpx\">%.1f</div></div>", ($l->{percentage}, $l->{percentage})) ), "</td><td>", $translators->{$l->{code}} ,"</tr></tr>";
}
print "</table></body></html>";
foreach my $l (@lang) {
$l->{diff} = $l->{n}-$maxn;
$l->{percentage} = ($l->{finished}+$l->{unfinished})/$maxn*100;
}
else {
print "<style>";
print "table {font-size:80%;}";
print "th {text-align:left; }";
print ".bartodo{ background-color:red;width:100px;height:20px;}";
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
print "</style>";
print "<table>";
print "<tr><th colspan=\"2\" style=\"width:250px;\">Language</th><th>Finished %</th><th>Translators</th></tr>\n";
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
print "\n<tr><td><img src=\"qrc:/images/flags/", $l->{code}, ".png\">", "</td><td>", $l->{name}, "</td><td>", join("</td><td>", sprintf("<div class=\"bartodo\"><div class=\"bardone\" style=\"width:%.1fpx\">%.1f</div></div>", ($l->{percentage}, $l->{percentage})) ), "</td><td>", $translators->{$l->{code}} ,"</tr></tr>";
}
print "</table>";

if ($ARGV[0] eq "site") {
print "<html><body>";
print "<head>";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>";
print "<style>";
print "body{font-family:sans-serif;}";
print "table {font-size:80%;border-collapse: collapse;}";
print "td {border-left:solid 1px #aaaaaa;border-right:solid 1px #aaaaaa;padding:1px 10px;}";
print ".bartodo{ background-color:red;width:100px;height:20px;}";
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
print "</style></head>";
print "<table>";
print "<tr><td colspan=\"2\" style=\"width:250px;\">Language</td><td>Count</td><td>Finished</td><td>Unfinished</td><td>Untranslated</td><td>Percentage</td><td>Translators</td></tr>\n";
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
printf "\n<tr>"
. '<td><img src="flags/%s.png"></td><td nowrap>%s</td>'
. '<td nowrap>%s</td><td>%d</td><td>%d</td><td>%d</td>'
. '<td><div class="bartodo"><div class="bardone" style="width:%dpx">%.1f</div></div></td>'
. '<td>%s</td>'
. '</tr>',
$l->{code}, $l->{name},
$l->{diff}==0 ? $l->{n} : "$l->{n} ($l->{diff})",
$l->{finished}, $l->{unfinished}, $l->{untranslated},
$l->{percentage}, $l->{percentage},
$translators->{$l->{code}};
}
print "</table></body></html>\n";
} else {
print "<style>";
print "table {font-size:80%;}";
print "th {text-align:left; }";
print ".bartodo{ background-color:red;width:100px;height:20px;}";
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
print "</style>";
print "<table>";
print "<tr><th colspan=\"2\" style=\"width:250px;\">Language</th><th>Finished %</th><th>Translators</th></tr>\n";
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
printf "\n<tr>"
. '<td><img src="qrc:/images/flags/%s.png"></td><td>%s</td>'
. '<td><div class="bartodo"><div class="bardone" style="width:%dpx">%.1f</div></div></td>'
. '<td>%s</td>'
. '</tr>',
$l->{code}, $l->{name},
$l->{percentage}, $l->{percentage},
$translators->{$l->{code}};
}
print "</table>\n";
}
5 changes: 5 additions & 0 deletions scripts/update_ts_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ cleanup() {
do
[ -f "$i.save" ] && mv "$i.save" "$i"
done

trap "" EXIT
}

trap cleanup EXIT
Expand Down Expand Up @@ -110,6 +112,9 @@ if [ -n "$add" ]; then
fi
echo Updating translations
$LUPDATE$opts -verbose qgis_ts.pro

cleanup

echo Updating TRANSLATORS File
./scripts/tsstat.pl > doc/TRANSLATORS

Expand Down
6 changes: 5 additions & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#include <QToolButton>
#include <QVBoxLayout>
#include <QWhatsThis>
#include <QThread>

#include <qgsnetworkaccessmanager.h>

Expand Down Expand Up @@ -318,7 +319,10 @@ static void setTitleBarText_( QWidget & qgisApp )
*/
static QgsMessageOutput *messageOutputViewer_()
{
return new QgsMessageViewer( QgisApp::instance() );
if ( QThread::currentThread() == QApplication::instance()->thread() )
return new QgsMessageViewer( QgisApp::instance() );
else
return new QgsMessageOutputConsole();
}

static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
Expand Down
4 changes: 3 additions & 1 deletion src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ bool QgsApplication::event( QEvent * event )
bool QgsApplication::notify( QObject * receiver, QEvent * event )
{
bool done = false;
emit preNotify( receiver, event, &done );
// Crashes in customization (especially on Mac), if we're not in the main/UI thread, see #5597
if ( thread() == receiver->thread() )
emit preNotify( receiver, event, &done );

if ( done )
return true;
Expand Down
63 changes: 32 additions & 31 deletions src/core/qgsgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ email : morb at ozemail dot com dot au
#include "qgsgeometry.h"
#include "qgsapplication.h"
#include "qgslogger.h"
#include "qgsmessagelog.h"
#include "qgspoint.h"
#include "qgsrectangle.h"

Expand All @@ -36,8 +37,7 @@ email : morb at ozemail dot com dot au
#define CATCH_GEOS(r) \
catch (GEOSException &e) \
{ \
Q_UNUSED(e); \
QgsDebugMsg("GEOS: " + QString( e.what() ) ); \
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr("GEOS") ); \
return r; \
}

Expand Down Expand Up @@ -90,7 +90,7 @@ static void throwGEOSException( const char *fmt, ... )
vsnprintf( buffer, sizeof buffer, fmt, ap );
va_end( ap );

QgsDebugMsg( QString( "GEOS exception encountered: %1" ).arg( buffer ) );
QgsDebugMsg( QString( "GEOS exception: %1" ).arg( buffer ) );

throw GEOSException( QString::fromUtf8( buffer ) );
}
Expand Down Expand Up @@ -166,7 +166,7 @@ static GEOSGeometry *cloneGeosGeom( const GEOSGeometry *geom )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
for ( int i = 0; i < geoms.count(); i++ )
GEOSGeom_destroy( geoms[i] );

Expand Down Expand Up @@ -261,7 +261,7 @@ static GEOSCoordSequence *createGeosCoordSequence( const QgsPolyline& points )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
/*if ( coord )
GEOSCoordSeq_destroy( coord );*/
throw;
Expand All @@ -285,7 +285,7 @@ static GEOSGeometry *createGeosCollection( int typeId, QVector<GEOSGeometry*> ge
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
}

delete [] geomarr;
Expand All @@ -304,7 +304,7 @@ static GEOSGeometry *createGeosLineString( const QgsPolyline& polyline )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
//MH: for strange reasons, geos3 crashes when removing the coordinate sequence
//if ( coord )
//GEOSCoordSeq_destroy( coord );
Expand Down Expand Up @@ -337,7 +337,7 @@ static GEOSGeometry *createGeosLinearRing( const QgsPolyline& polyline )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
/* as MH has noticed ^, this crashes geos
if ( coord )
GEOSCoordSeq_destroy( coord );*/
Expand Down Expand Up @@ -389,7 +389,7 @@ static GEOSGeometry *createGeosPolygon( const QgsPolygon& polygon )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
for ( int i = 0; i < geoms.count(); i++ )
GEOSGeom_destroy( geoms[i] );
return 0;
Expand Down Expand Up @@ -421,7 +421,7 @@ QgsGeometry* QgsGeometry::fromWkt( QString wkt )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
return 0;
}
}
Expand Down Expand Up @@ -456,7 +456,8 @@ QgsGeometry* QgsGeometry::fromMultiPoint( const QgsMultiPoint& multipoint )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );

for ( int i = 0; i < geoms.size(); ++i )
GEOSGeom_destroy( geoms[i] );

Expand All @@ -477,7 +478,8 @@ QgsGeometry* QgsGeometry::fromMultiPolyline( const QgsMultiPolyline& multiline )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );

for ( int i = 0; i < geoms.count(); i++ )
GEOSGeom_destroy( geoms[i] );

Expand All @@ -501,7 +503,8 @@ QgsGeometry* QgsGeometry::fromMultiPolygon( const QgsMultiPolygon& multipoly )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );

for ( int i = 0; i < geoms.count(); i++ )
GEOSGeom_destroy( geoms[i] );

Expand Down Expand Up @@ -2394,7 +2397,7 @@ double QgsGeometry::closestVertexWithContext( const QgsPoint& point, int& atVert
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
return -1;
}

Expand Down Expand Up @@ -2706,7 +2709,8 @@ int QgsGeometry::addRing( const QList<QgsPoint>& ring )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );

if ( newRingPolygon )
GEOSGeom_destroy( newRingPolygon );
else if ( newRing )
Expand Down Expand Up @@ -2739,7 +2743,8 @@ int QgsGeometry::addRing( const QList<QgsPoint>& ring )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );

if ( shell )
GEOSGeom_destroy( shell );
else if ( shellRing )
Expand Down Expand Up @@ -2776,7 +2781,8 @@ int QgsGeometry::addRing( const QList<QgsPoint>& ring )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );

if ( hole )
GEOSGeom_destroy( hole );
else if ( holeRing )
Expand Down Expand Up @@ -2924,7 +2930,8 @@ int QgsGeometry::addPart( const QList<QgsPoint> &points )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );

if ( newRing )
GEOSGeom_destroy( newRing );

Expand All @@ -2947,7 +2954,7 @@ int QgsGeometry::addPart( const QList<QgsPoint> &points )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );

if ( newPart )
GEOSGeom_destroy( newPart );
Expand Down Expand Up @@ -3839,7 +3846,7 @@ bool QgsGeometry::contains( QgsPoint* p )
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
returnval = false;
}

Expand Down Expand Up @@ -5458,7 +5465,7 @@ GEOSGeometry* QgsGeometry::reshapePolygon( const GEOSGeometry* polygon, const GE
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
nIntersections = 0;
}

Expand Down Expand Up @@ -5569,7 +5576,7 @@ GEOSGeometry* QgsGeometry::reshapeLine( const GEOSGeometry* line, const GEOSGeom
}
catch ( GEOSException &e )
{
Q_UNUSED( e );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
atLeastTwoIntersections = false;
}

Expand Down Expand Up @@ -6708,9 +6715,7 @@ int QgsGeometry::avoidIntersections()

void QgsGeometry::validateGeometry( QList<Error> &errors )
{
QgsGeometryValidator *gv = new QgsGeometryValidator( this, &errors );
gv->start();
delete gv;
QgsGeometryValidator::validateGeometry( this, errors );
}

bool QgsGeometry::isGeosValid()
Expand All @@ -6726,9 +6731,7 @@ bool QgsGeometry::isGeosValid()
}
catch ( GEOSException &e )
{
// looks like geometry is fubar
Q_UNUSED( e );
QgsDebugMsg( QString( "GEOS exception caught: %1" ).arg( e.what() ) );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
return false;
}
}
Expand All @@ -6751,9 +6754,7 @@ bool QgsGeometry::isGeosEmpty()
}
catch ( GEOSException &e )
{
// looks like geometry is fubar
Q_UNUSED( e );
QgsDebugMsg( QString( "GEOS exception caught: %1" ).arg( e.what() ) );
QgsMessageLog::logMessage( QObject::tr( "Exception: %1" ).arg( e.what() ), QObject::tr( "GEOS" ) );
return false;
}
}
Expand Down
63 changes: 36 additions & 27 deletions src/core/qgsgeometryvalidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ void QgsGeometryValidator::validatePolyline( int i, QgsPolyline line, bool ring
{
if ( ring )
{
if ( line.size() < 3 )
if ( line.size() < 4 )
{
QString msg = QObject::tr( "ring %1 with less than three points" ).arg( i );
QString msg = QObject::tr( "ring %1 with less than four points" ).arg( i );
QgsDebugMsg( msg );
emit errorFound( QgsGeometry::Error( msg ) );
mErrorCount++;
Expand Down Expand Up @@ -193,47 +193,55 @@ void QgsGeometryValidator::validatePolygon( int idx, const QgsPolygon &polygon )

void QgsGeometryValidator::run()
{
QgsDebugMsg( "validation thread started." );

mErrorCount = 0;
#if defined(GEOS_VERSION_MAJOR) && defined(GEOS_VERSION_MINOR) && \
( (GEOS_VERSION_MAJOR==3 && GEOS_VERSION_MINOR>=3) || GEOS_VERSION_MAJOR>3)
QSettings settings;
if ( settings.value( "/qgis/digitizing/validate_geometries", 1 ).toInt() == 2 )
{
char *r = 0;
GEOSGeometry *g = 0;
if ( GEOSisValidDetail( mG.asGeos(), GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE, &r, &g ) != 1 )
GEOSGeometry *g0 = mG.asGeos();
if ( !g0 )
{
if ( g )
emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error:could not produce geometry for GEOS (check log window)" ) ) );
}
else
{
GEOSGeometry *g1 = 0;
if ( GEOSisValidDetail( g0, GEOSVALID_ALLOW_SELFTOUCHING_RING_FORMING_HOLE, &r, &g1 ) != 1 )
{
const GEOSCoordSequence *cs = GEOSGeom_getCoordSeq( g );
if ( g1 )
{
const GEOSCoordSequence *cs = GEOSGeom_getCoordSeq( g1 );

unsigned int n;
if ( GEOSCoordSeq_getSize( cs, &n ) && n == 1 )
unsigned int n;
if ( GEOSCoordSeq_getSize( cs, &n ) && n == 1 )
{
double x, y;
GEOSCoordSeq_getX( cs, 0, &x );
GEOSCoordSeq_getY( cs, 0, &y );
emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error:%1" ).arg( r ), QgsPoint( x, y ) ) );
mErrorCount++;
}

GEOSGeom_destroy( g1 );
}
else
{
double x, y;
GEOSCoordSeq_getX( cs, 0, &x );
GEOSCoordSeq_getY( cs, 0, &y );
emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error:%1" ).arg( r ), QgsPoint( x, y ) ) );
emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error:%1" ).arg( r ) ) );
mErrorCount++;
}

GEOSGeom_destroy( g );
GEOSFree( r );
}
else
{
emit errorFound( QgsGeometry::Error( QObject::tr( "GEOS error:%1" ).arg( r ) ) );
mErrorCount++;
}

GEOSFree( r );
}

return;
}
#endif

QgsDebugMsg( "validation thread started." );

switch ( mG.wkbType() )
{
case QGis::WKBPoint:
Expand Down Expand Up @@ -309,14 +317,16 @@ void QgsGeometryValidator::run()
{
emit errorFound( QObject::tr( "Geometry validation was aborted." ) );
}
else if ( mErrorCount == 0 )
else if ( mErrorCount > 0 )
{
emit errorFound( QObject::tr( "Geometry is valid." ) );
emit errorFound( QObject::tr( "Geometry has %1 errors." ).arg( mErrorCount ) );
}
#if 0
else
{
emit errorFound( QObject::tr( "Geometry has %1 errors." ).arg( mErrorCount ) );
emit errorFound( QObject::tr( "Geometry is valid." ) );
}
#endif
}

void QgsGeometryValidator::addError( QgsGeometry::Error e )
Expand All @@ -328,8 +338,7 @@ void QgsGeometryValidator::addError( QgsGeometry::Error e )
void QgsGeometryValidator::validateGeometry( QgsGeometry *g, QList<QgsGeometry::Error> &errors )
{
QgsGeometryValidator *gv = new QgsGeometryValidator( g, &errors );
connect( gv, SIGNAL( "errorFound( QString, QgsPoint )" ), gv, SLOT( "addError( QString, QgsPoint )" ) );
connect( gv, SIGNAL( "errorFound( QString )" ), gv, SLOT( "addError( QString )" ) );
connect( gv, SIGNAL( errorFound( QgsGeometry::Error ) ), gv, SLOT( addError( QgsGeometry::Error ) ) );
gv->run();
gv->wait();
}
Expand Down
17 changes: 10 additions & 7 deletions src/core/qgsmessageoutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

#include "qgsmessageoutput.h"
#include "qgslogger.h"
#include "qgsmessagelog.h"

#include <QRegExp>

static QgsMessageOutput* messageOutputConsole_()
{
Expand Down Expand Up @@ -47,9 +50,10 @@ QgsMessageOutputConsole::QgsMessageOutputConsole()
{
}

void QgsMessageOutputConsole::setMessage( const QString& message, MessageType )
void QgsMessageOutputConsole::setMessage( const QString& message, MessageType msgType )
{
mMessage = message;
mMsgType = msgType;
}

void QgsMessageOutputConsole::appendMessage( const QString& message )
Expand All @@ -59,14 +63,13 @@ void QgsMessageOutputConsole::appendMessage( const QString& message )

void QgsMessageOutputConsole::showMessage( bool )
{
// show title if provided
if ( !mTitle.isNull() )
if ( mMsgType == MessageHtml )
{
QgsDebugMsg( QString( "%1:" ).arg( mTitle ) );
mMessage.replace( "<br>", "\n" );
mMessage.replace( "&nbsp;", " " );
mMessage.replace( QRegExp("<\/?[^>]+>"), "" );
}

// show the message
QgsDebugMsg( mMessage );
QgsMessageLog::logMessage( mMessage, mTitle.isNull() ? QObject::tr( "Console" ) : mTitle );
emit destroyed();
delete this;
}
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsmessageoutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class CORE_EXPORT QgsMessageOutputConsole : public QObject, public QgsMessageOut
//! stores current title
QString mTitle;

MessageType mMsgType;
};

#endif
6 changes: 6 additions & 0 deletions src/gui/qgsmessagelogviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ QgsMessageLogViewer::QgsMessageLogViewer( QStatusBar *statusBar, QWidget *parent
mButton->setCheckable( true );
mButton->hide();
connect( mButton, SIGNAL( toggled( bool ) ), this, SLOT( buttonToggled( bool ) ) );
connect( mButton, SIGNAL( destroyed() ), this, SLOT( buttonDestroyed() ) );
statusBar->addPermanentWidget( mButton, 0 );
}

Expand Down Expand Up @@ -100,6 +101,11 @@ void QgsMessageLogViewer::buttonToggled( bool checked )
w->hide();
}

void QgsMessageLogViewer::buttonDestroyed()
{
mButton = 0;
}

void QgsMessageLogViewer::logMessage( QString message, QString tag, int level )
{
mButton->setToolTip( tr( "%1 message(s) logged." ).arg( mCount++ ) );
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsmessagelogviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class GUI_EXPORT QgsMessageLogViewer: public QDialog, private Ui::QgsMessageLogV
private slots:
void closeTab( int index );
void buttonToggled( bool checked );
void buttonDestroyed();
};

#endif
2 changes: 1 addition & 1 deletion src/plugins/grass/locations.gml
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
<gml:featureMember>
<gml:name>Europe</gml:name>
<gml:Envelope>
<gml:coordinates>-25.1,71.3 35,34.9</gml:coordinates>
<gml:coordinates>-25.1,34.9 35,71.3</gml:coordinates>
</gml:Envelope>
</gml:featureMember>
<gml:featureMember>
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/grass/qgsgrassnewmapset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
#include <QCloseEvent>
#include <QFileDialog>
#include <QMessageBox>
#include <QRegExp>
#include <QSettings>
#include <QTextStream>


extern "C"
{
#include <grass/gprojects.h>
Expand Down Expand Up @@ -134,10 +136,16 @@ QgsGrassNewMapset::QgsGrassNewMapset( QgisInterface *iface,
m = new QTreeWidgetItem( l, QStringList() << "Cimrman" << tr( "User's mapset" ) );
m->setExpanded( true );

// LOCATION
QRegExp rx;
rx.setPattern( "[A-Za-z0-9_.]+" );
mLocationLineEdit->setValidator( new QRegExpValidator( rx, mLocationLineEdit ) );

// CRS

// MAPSET
mMapsetsListView->clear();
mMapsetLineEdit->setValidator( new QRegExpValidator( rx, mMapsetLineEdit ) );

// FINISH

Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsprojectionselectorbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</font>
</property>
<property name="text">
<string>Recently used coordinate references systems</string>
<string>Recently used coordinate reference systems</string>
</property>
</widget>
</item>
Expand Down