Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 92 lines (72 sloc) 2.797 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
from signal import signal, SIGINT, SIG_DFL
from os.path import dirname, realpath

from PyQt4.Qt import QApplication, pyqtSignal

from inc.main import Window
from inc.database import Databaser
from inc.preference import Preferencer
from inc.accounts import Accounter
from inc.update import Updater
from inc.icons import Iconer
from inc.filters import Filterer
from inc.thread import Threader
from inc.reader import Reader
from inc.notification import Notifier

signal(SIGINT, SIG_DFL)


print """TODO:
- using models for treeview and filterlist
#- better treeview update (only insert new posts) (timer triggered?)
- do smth with twitter lists (dont know what this is .. but .. i will do science on it!)
- logins
- show conversations for replied posts (posts with reply==None but in a reply by an other post)
- interner favoriten speicher um posts als später lesen zu markieren
- pages for posts
- grouping filters and let the user switch between them
(for exmaple important posters filter group)
"""



class Blain(QApplication):

    logStatus = pyqtSignal(str)
    killThread = pyqtSignal(str)
    addMessage = pyqtSignal(dict)
    updateUser = pyqtSignal(str, str, str)
    updateGroup = pyqtSignal(str, str, str)
    updateGroups = pyqtSignal(str, str, bool)
    updateFriends = pyqtSignal(str, str, bool)

    def __init__(self):
        print "loading ..."
        QApplication.__init__(self, sys.argv)

        self.cwd = dirname(realpath(__file__))
        self.window = Window(self)
        self.db = Databaser(self)
        self.preferences = Preferencer(self)
        self.filters = Filterer(self)
        self.icons = Iconer(self)
        self.accounts = Accounter(self)
        self.updates = Updater(self)
        self.threads = Threader(self)
        self.reader = Reader(self)
        self.notifier = Notifier(self)

        controllers = [self.window, self.db, self.preferences,
                       self.filters, self.accounts, self.updates,
                       self.icons, self.threads, self.reader,
                       self.notifier]

        for controller in controllers:
            controller.setup()
        # need to be seperated
        for controller in controllers:
            controller.connect()


    def updateMessageView(self, maxcount = 0):
        self.window.updateMessageView(maxcount)


    def run(self):
        win = self.window.ui
        win.show()
        win.update()
        win.repaint()
        self.updateMessageView(42)
        win.statusBar.showMessage("Ready ...", 3000)
        print "done."
        sys.exit(self.exec_())


if __name__ == "__main__":
    Blain().run()
Something went wrong with that request. Please try again.