Switch to unified view

a/src/python/samples/recollgui/qrecoll.py b/src/python/samples/recollgui/qrecoll.py
...
...
11
    hasextract = False
11
    hasextract = False
12
12
13
import rclmain
13
import rclmain
14
from getopt import getopt
14
from getopt import getopt
15
15
16
from PyQt4 import QtCore, QtGui
16
from PyQt5 import QtCore
17
from PyQt4.QtCore import pyqtSlot
17
from PyQt5.QtCore import pyqtSlot
18
from PyQt5.QtGui import QKeySequence
19
from PyQt5.QtWidgets import *
18
20
19
####################
21
####################
20
# Highlighting methods. Just for showing the groups usage, we add the
22
# Highlighting methods. Just for showing the groups usage, we add the
21
# original string for the match to the highlighted text. I don't think
23
# original string for the match to the highlighted text. I don't think
22
# you'd want to do this in a real app, but maybe some kind of tooltip?
24
# you'd want to do this in a real app, but maybe some kind of tooltip?
...
...
144
        self.endInsertRows()
146
        self.endInsertRows()
145
147
146
148
147
###
149
###
148
#  UI interaction code
150
#  UI interaction code
149
class RclGui_Main(QtGui.QMainWindow):
151
class RclGui_Main(QMainWindow):
150
    def __init__(self, db, parent=None):
152
    def __init__(self, db, parent=None):
151
        QtGui.QWidget.__init__(self, parent)
153
        QMainWindow.__init__(self, parent)
152
        self.ui = rclmain.Ui_MainWindow()
154
        self.ui = rclmain.Ui_MainWindow()
153
        self.ui.setupUi(self)
155
        self.ui.setupUi(self)
154
        self.db = db
156
        self.db = db
155
        self.qmodel = RecollQuery()
157
        self.qmodel = RecollQuery()
156
        scq = QtGui.QShortcut(QtGui.QKeySequence("Ctrl+Q"), self);
158
        scq = QShortcut(QKeySequence("Ctrl+Q"), self);
157
        self.connect(scq, QtCore.SIGNAL("activated()"), self.onexit)
159
        scq.activated.connect(self.onexit)
158
        header = self.ui.resTable.horizontalHeader();
160
        header = self.ui.resTable.horizontalHeader();
159
    header.setSortIndicatorShown(True);
161
    header.setSortIndicatorShown(True);
160
    header.setSortIndicator(-1, QtCore.Qt.AscendingOrder);
162
    header.setSortIndicator(-1, QtCore.Qt.AscendingOrder);
161
        self.ui.resTable.setSortingEnabled(True)
163
        self.ui.resTable.setSortingEnabled(True)
162
        self.currentindex = -1
164
        self.currentindex = -1
...
...
211
        print "on_savePB_clicked(self)"
213
        print "on_savePB_clicked(self)"
212
        doc = self.currentdoc
214
        doc = self.currentdoc
213
        ipath = doc.ipath
215
        ipath = doc.ipath
214
        if not ipath:
216
        if not ipath:
215
            return
217
            return
216
        fn = QtGui.QFileDialog.getSaveFileName(self)
218
        fn = QFileDialog.getSaveFileName(self)
217
        if fn:
219
        if fn:
218
            docitems = doc.items()
220
            docitems = doc.items()
219
            fn = extractofile(doc, str(fn.toLocal8Bit()))
221
            fn = extractofile(doc, str(fn.toLocal8Bit()))
220
            print "Saved as", fn
222
            print "Saved as", fn
221
        else:
223
        else:
...
...
234
    sys.exit(1)
236
    sys.exit(1)
235
237
236
238
237
def main(args):
239
def main(args):
238
240
239
    app = QtGui.QApplication(args)
241
    app = QApplication(args)
240
242
241
    confdir=""
243
    confdir=""
242
    extra_dbs = []
244
    extra_dbs = []
243
    # Snippet params
245
    # Snippet params
244
    maxchars = 300
246
    maxchars = 300