Ejemplo n.º 1
0
class smsGUI(QtGui.QMainWindow):
    def __init__(self, smsdb, abookdb=None, abimgdb=None):
        QtGui.QMainWindow.__init__(self)

        self.chat_session_list = []
        self.address_book_list = []

        if smsdb == None:
            self.smsdb = None
        else:
            self.smsdb = smsdb
        if abookdb == "" or abookdb is None:
            self.abookdb = None
        else:
            self.abookdb = abookdb
        if abimgdb == "" or abimgdb is None:
            self.abimgdb = None
        else:
            self.abimgdb = abimgdb

        self.ui = Ui_frmSMS()
        self.ui.setupUi(self)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        QtCore.QObject.connect(self.ui.tableViewChats, QtCore.SIGNAL("itemSelectionChanged()"), self.onTreeClick)
        QtCore.QObject.connect(self.ui.actionReport, QtCore.SIGNAL("triggered(bool)"), self.printReport)
        QtCore.QObject.connect(self.ui.actionExtract, QtCore.SIGNAL("triggered(bool)"), self.extractApp)

        if self.abookdb is not None:
            self.address_book_list = get_addressbook(self.abookdb, self.abimgdb)

        msgstore = sqlite3.connect(self.smsdb)
        msgstore.row_factory = sqlite3.Row
        c1 = msgstore.cursor()

        self.chat_session_list = getChatSessions(c1, self.address_book_list)
        self.chat_session_list = getChatMessages(c1, self.chat_session_list)
        chatsmodel = ChatsTableModel(self.chat_session_list)
        self.ui.tableViewChats.setModel(chatsmodel)
        self.ui.tableViewChats.setSortingEnabled(True)

    def onTreeClick(self):
        index = self.ui.tableViewChats.currentIndex()
        row = index.row()
        msgmodel = MessagesTableModel(self.chat_session_list[row].msg_list)
        self.ui.tableViewMessages.setModel(msgmodel)

    def extractApp(self):
        pass

    def printReport(self):

        path = expanduser("~")
        outdir = QtGui.QFileDialog.getExistingDirectory(self, "Open Directory", path,
                                                            QtGui.QFileDialog.ShowDirsOnly | QtGui.QFileDialog.DontResolveSymlinks);

        if (outdir == None) or (len(outdir) == 0):
            return None

        outfile = outdir + "/SMS-Report"
        printHTMLReport(outfile, self.chat_session_list)
Ejemplo n.º 2
0
    def __init__(self, smsdb, abookdb=None, abimgdb=None):
        QtGui.QMainWindow.__init__(self)

        self.chat_session_list = []
        self.address_book_list = []

        if smsdb == None:
            self.smsdb = None
        else:
            self.smsdb = smsdb
        if abookdb == "" or abookdb is None:
            self.abookdb = None
        else:
            self.abookdb = abookdb
        if abimgdb == "" or abimgdb is None:
            self.abimgdb = None
        else:
            self.abimgdb = abimgdb

        self.ui = Ui_frmSMS()
        self.ui.setupUi(self)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        QtCore.QObject.connect(self.ui.tableViewChats,
                               QtCore.SIGNAL("itemSelectionChanged()"),
                               self.onTreeClick)
        QtCore.QObject.connect(self.ui.actionReport,
                               QtCore.SIGNAL("triggered(bool)"),
                               self.printReport)
        QtCore.QObject.connect(self.ui.actionExtract,
                               QtCore.SIGNAL("triggered(bool)"),
                               self.extractApp)

        if self.abookdb is not None:
            self.address_book_list = get_addressbook(self.abookdb,
                                                     self.abimgdb)

        msgstore = sqlite3.connect(self.smsdb)
        msgstore.row_factory = sqlite3.Row
        c1 = msgstore.cursor()

        self.chat_session_list = getChatSessions(c1, self.address_book_list)
        self.chat_session_list = getChatMessages(c1, self.chat_session_list)
        chatsmodel = ChatsTableModel(self.chat_session_list)
        self.ui.tableViewChats.setModel(chatsmodel)
        self.ui.tableViewChats.setSortingEnabled(True)
Ejemplo n.º 3
0
    def __init__(self, smsdb, abookdb=None, abimgdb=None):
        QtGui.QMainWindow.__init__(self)

        self.chat_session_list = []
        self.address_book_list = []

        if smsdb == None:
            self.smsdb = None
        else:
            self.smsdb = smsdb
        if abookdb == "" or abookdb is None:
            self.abookdb = None
        else:
            self.abookdb = abookdb
        if abimgdb == "" or abimgdb is None:
            self.abimgdb = None
        else:
            self.abimgdb = abimgdb

        self.ui = Ui_frmSMS()
        self.ui.setupUi(self)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        QtCore.QObject.connect(self.ui.tableViewChats, QtCore.SIGNAL("itemSelectionChanged()"), self.onTreeClick)
        QtCore.QObject.connect(self.ui.actionReport, QtCore.SIGNAL("triggered(bool)"), self.printReport)
        QtCore.QObject.connect(self.ui.actionExtract, QtCore.SIGNAL("triggered(bool)"), self.extractApp)

        if self.abookdb is not None:
            self.address_book_list = get_addressbook(self.abookdb, self.abimgdb)

        msgstore = sqlite3.connect(self.smsdb)
        msgstore.row_factory = sqlite3.Row
        c1 = msgstore.cursor()

        self.chat_session_list = getChatSessions(c1, self.address_book_list)
        self.chat_session_list = getChatMessages(c1, self.chat_session_list)
        chatsmodel = ChatsTableModel(self.chat_session_list)
        self.ui.tableViewChats.setModel(chatsmodel)
        self.ui.tableViewChats.setSortingEnabled(True)
Ejemplo n.º 4
0
class smsGUI(QtGui.QMainWindow):
    def __init__(self, smsdb, abookdb=None, abimgdb=None):
        QtGui.QMainWindow.__init__(self)

        self.chat_session_list = []
        self.address_book_list = []

        if smsdb == None:
            self.smsdb = None
        else:
            self.smsdb = smsdb
        if abookdb == "" or abookdb is None:
            self.abookdb = None
        else:
            self.abookdb = abookdb
        if abimgdb == "" or abimgdb is None:
            self.abimgdb = None
        else:
            self.abimgdb = abimgdb

        self.ui = Ui_frmSMS()
        self.ui.setupUi(self)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        QtCore.QObject.connect(self.ui.tableViewChats,
                               QtCore.SIGNAL("itemSelectionChanged()"),
                               self.onTreeClick)
        QtCore.QObject.connect(self.ui.actionReport,
                               QtCore.SIGNAL("triggered(bool)"),
                               self.printReport)
        QtCore.QObject.connect(self.ui.actionExtract,
                               QtCore.SIGNAL("triggered(bool)"),
                               self.extractApp)

        if self.abookdb is not None:
            self.address_book_list = get_addressbook(self.abookdb,
                                                     self.abimgdb)

        msgstore = sqlite3.connect(self.smsdb)
        msgstore.row_factory = sqlite3.Row
        c1 = msgstore.cursor()

        self.chat_session_list = getChatSessions(c1, self.address_book_list)
        self.chat_session_list = getChatMessages(c1, self.chat_session_list)
        chatsmodel = ChatsTableModel(self.chat_session_list)
        self.ui.tableViewChats.setModel(chatsmodel)
        self.ui.tableViewChats.setSortingEnabled(True)

    def onTreeClick(self):
        index = self.ui.tableViewChats.currentIndex()
        row = index.row()
        msgmodel = MessagesTableModel(self.chat_session_list[row].msg_list)
        self.ui.tableViewMessages.setModel(msgmodel)

    def extractApp(self):
        pass

    def printReport(self):

        path = expanduser("~")
        outdir = QtGui.QFileDialog.getExistingDirectory(
            self, "Open Directory", path, QtGui.QFileDialog.ShowDirsOnly
            | QtGui.QFileDialog.DontResolveSymlinks)

        if (outdir == None) or (len(outdir) == 0):
            return None

        outfile = outdir + "/SMS-Report"
        printHTMLReport(outfile, self.chat_session_list)