# Path: eclectusqt/forms/VocabularyPageUI.py
# class MyQListView(QtGui.QListView):
# class Ui_Form(object):
#     def keyPressEvent(self, event):
#     def setupUi(self, Form):
#     def retranslateUi(self, Form):
# 
# Path: eclectusqt/util.py
# def getIcon(fileName):
# def getData(fileName):
# def getLocalData(fileName):
# def getDataPaths():
# def readConfigString(config, option, default=None):
# def _readConfig(config, option, default, conversionFunc):
# def readConfigInt(config, option, default=None):
#     def __init__(self, parent):
#     def javaScriptConsoleMessage(self, message, lineNumber, sourceID):
#     def javaScriptAlert(self, frame, msg):
# class HandyWebpage(QWebPage):


import re
import locale
import codecs
import os
import sys
import functools
from datetime import date
from PyQt4.QtCore import Qt, SIGNAL, QVariant, QModelIndex, QAbstractListModel
from PyQt4.QtGui import QWidget, QAction, QAbstractItemView, QShortcut, QMenu
from PyKDE4.kdeui import KIcon, KMenu, KStandardAction, KMessageBox
from PyKDE4.kdecore import i18n, KUrl
from PyKDE4.kio import KFileDialog
from eclectusqt.forms import VocabularyPageUI
from eclectusqt import util
        modelIndex = self.vocabularyListView.currentIndex()

        contextMenu = KMenu(self)
        contextMenu.addAction(self._editAction)
        contextMenu.addAction(self._selectAllAction)
        contextMenu.addAction(self._removeAction)

        if modelIndex.isValid():
            entry = self.vocabularyModel.getVocabularyEntry(modelIndex)
            if 'Headword' in entry:
                contextMenu.addSeparator()
                lookupAction = QAction(i18n('Lookup %1',
                    entry['Headword'].replace("&", "&&")), contextMenu)
                self.connect(lookupAction, SIGNAL("triggered(bool)"),
                    lambda: self.emit(SIGNAL('inputReceived(const QString &)'),
                        entry['Headword']))
                contextMenu.addAction(lookupAction)

        contextMenu.popup(self.vocabularyListView.mapToGlobal(pos))

    def slotDoubleClickOnEntry(self, modelIndex):
        entry = self.vocabularyModel.getVocabularyEntry(modelIndex)
        if 'Headword' in entry:
            self.emit(SIGNAL('inputReceived(const QString &)'),
                        entry['Headword'])

    def writeSettings(self):
        if self.pluginConfig:
            if self.vocabularyChanged:
                csv = CSVExporter(pluginConfig=self.pluginConfig)

# Path: eclectusqt/forms/VocabularyPageUI.py
# class MyQListView(QtGui.QListView):
# class Ui_Form(object):
#     def keyPressEvent(self, event):
#     def setupUi(self, Form):
#     def retranslateUi(self, Form):
# 
# Path: eclectusqt/util.py
# def getIcon(fileName):
# def getData(fileName):
# def getLocalData(fileName):
# def getDataPaths():
# def readConfigString(config, option, default=None):
# def _readConfig(config, option, default, conversionFunc):
# def readConfigInt(config, option, default=None):
#     def __init__(self, parent):
#     def javaScriptConsoleMessage(self, message, lineNumber, sourceID):
#     def javaScriptAlert(self, frame, msg):
# class HandyWebpage(QWebPage):


# Path: eclectusqt/vocabularypage.py
import re
import locale
import codecs
import os
import sys
import functools
from datetime import date
from PyQt4.QtCore import Qt, SIGNAL, QVariant, QModelIndex, QAbstractListModel
from PyQt4.QtGui import QWidget, QAction, QAbstractItemView, QShortcut, QMenu
from PyKDE4.kdeui import KIcon, KMenu, KStandardAction, KMessageBox
from PyKDE4.kdecore import i18n, KUrl
from PyKDE4.kio import KFileDialog
from eclectusqt.forms import VocabularyPageUI
from eclectusqt import util

        modelIndex = self.vocabularyListView.currentIndex()

        contextMenu = KMenu(self)
        contextMenu.addAction(self._editAction)
        contextMenu.addAction(self._selectAllAction)
        contextMenu.addAction(self._removeAction)

        if modelIndex.isValid():
            entry = self.vocabularyModel.getVocabularyEntry(modelIndex)
            if 'Headword' in entry:
                contextMenu.addSeparator()
                lookupAction = QAction(i18n('Lookup %1',
                    entry['Headword'].replace("&", "&&")), contextMenu)
                self.connect(lookupAction, SIGNAL("triggered(bool)"),
                    lambda: self.emit(SIGNAL('inputReceived(const QString &)'),
                        entry['Headword']))
                contextMenu.addAction(lookupAction)

        contextMenu.popup(self.vocabularyListView.mapToGlobal(pos))

    def slotDoubleClickOnEntry(self, modelIndex):
        entry = self.vocabularyModel.getVocabularyEntry(modelIndex)
        if 'Headword' in entry:
            self.emit(SIGNAL('inputReceived(const QString &)'),
                        entry['Headword'])

    def writeSettings(self):
        if self.pluginConfig:
            if self.vocabularyChanged:
                csv = CSVExporter(pluginConfig=self.pluginConfig)

                fileName = util.getLocalData('eclectus.csv')