Skip to content

Commit

Permalink
Merge pull request #275 from slarosa/master
Browse files Browse the repository at this point in the history
fix mouse event in python console, 
update italian translation
  • Loading branch information
brushtyler committed Oct 7, 2012
2 parents 52de721 + 42672c1 commit ce5c2e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
8 changes: 4 additions & 4 deletions i18n/qgis_it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6461,23 +6461,23 @@ Cambiare questa situazione prima, perché il plugin OSM non quale layer è la de
<message>
<source>Are you sure you want to completely
delete the command history ?</source>
<translation type="obsolete">Sei sicuro di voler concellare completamente
<translation>Sei sicuro di voler concellare completamente
la cronologia dei comandi ?</translation>
</message>
<message>
<source>## History saved successfully ##</source>
<translation type="obsolete">## Storia comandi salvata con successo ##</translation>
<translation>## Storia comandi salvata con successo ##</translation>
</message>
<message>
<source>## History cleared successfully ##</source>
<translation type="obsolete">## Storia comandi cancellata con successo ##</translation>
<translation>## Storia comandi cancellata con successo ##</translation>
</message>
<message>
<source>## To access Quantum GIS environment from this console
## use qgis.utils.iface object (instance of QgisInterface class). Read help for more info.

</source>
<translation type="obsolete">## Per accedere all&apos;ambiente Quantum GIS da questa console
<translation>## Per accedere all&apos;ambiente Quantum GIS da questa console
## usa l&apos;oggetto qgis.utils.iface (istanza della classe QgisInterface). Consulta l&apos;aiuto per ottenere più informazioni.

</translation>
Expand Down
18 changes: 12 additions & 6 deletions python/console_sci.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,14 +435,20 @@ def keyPressEvent(self, e):
def mousePressEvent(self, e):
"""
Re-implemented to handle the mouse press event.
event: the mouse press event (QMouseEvent)
e: the mouse press event (QMouseEvent)
"""
if e.button() == Qt.MidButton:
self.setFocus()
self.paste()
e.accept()
linenr, index = self.getCurLine()
## Prevents paste text if cursor is not in edition zone
if not self.is_cursor_on_last_line() or index < 4:
self.move_cursor_to_end()
else:
QsciScintilla.mousePressEvent(self, e)
if e.button() == Qt.MidButton:
stringSel = unicode(QApplication.clipboard().text(QClipboard.Selection))
self.insertFromDropPaste(stringSel)
self.setFocus()
e.accept()
else:
QsciScintilla.mousePressEvent(self, e)

def paste(self):
"""Reimplement QScintilla method"""
Expand Down

0 comments on commit ce5c2e6

Please sign in to comment.