From b6cbd074b237a996fdfea6b1859926c1c2155db8 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Wed, 30 Jun 2010 20:01:08 +0200 Subject: [PATCH] new frontend QBoobMsg --- scripts/qboobmsg | 25 ++++++ weboob/frontends/qboobmsg/Makefile | 5 ++ weboob/frontends/qboobmsg/__init__.py | 1 + weboob/frontends/qboobmsg/main_window.py | 39 ++++++++++ weboob/frontends/qboobmsg/qboobmsg.py | 34 +++++++++ weboob/frontends/qboobmsg/ui/Makefile | 13 ++++ weboob/frontends/qboobmsg/ui/__init__.py | 0 weboob/frontends/qboobmsg/ui/main_window.ui | 84 +++++++++++++++++++++ 8 files changed, 201 insertions(+) create mode 100755 scripts/qboobmsg create mode 100644 weboob/frontends/qboobmsg/Makefile create mode 100644 weboob/frontends/qboobmsg/__init__.py create mode 100644 weboob/frontends/qboobmsg/main_window.py create mode 100644 weboob/frontends/qboobmsg/qboobmsg.py create mode 100644 weboob/frontends/qboobmsg/ui/Makefile create mode 100644 weboob/frontends/qboobmsg/ui/__init__.py create mode 100644 weboob/frontends/qboobmsg/ui/main_window.ui diff --git a/scripts/qboobmsg b/scripts/qboobmsg new file mode 100755 index 00000000..9cc2e88b --- /dev/null +++ b/scripts/qboobmsg @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# vim: ft=python et softtabstop=4 cinoptions=4 shiftwidth=4 ts=4 ai + +# Copyright(C) 2010 Romain Bignon +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +from weboob.frontends.qboobmsg import QBoobMsg + + +if __name__ == '__main__': + QBoobMsg.run() diff --git a/weboob/frontends/qboobmsg/Makefile b/weboob/frontends/qboobmsg/Makefile new file mode 100644 index 00000000..04c08812 --- /dev/null +++ b/weboob/frontends/qboobmsg/Makefile @@ -0,0 +1,5 @@ +all: + $(MAKE) -C ui + +clean: + $(MAKE) -C ui clean diff --git a/weboob/frontends/qboobmsg/__init__.py b/weboob/frontends/qboobmsg/__init__.py new file mode 100644 index 00000000..3db51dd0 --- /dev/null +++ b/weboob/frontends/qboobmsg/__init__.py @@ -0,0 +1 @@ +from .qboobmsg import QBoobMsg diff --git a/weboob/frontends/qboobmsg/main_window.py b/weboob/frontends/qboobmsg/main_window.py new file mode 100644 index 00000000..215ad866 --- /dev/null +++ b/weboob/frontends/qboobmsg/main_window.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- + +# Copyright(C) 2010 Romain Bignon +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +from PyQt4.QtCore import SIGNAL + +from weboob.tools.application.qt import QtMainWindow +from weboob.tools.application.qt.backendcfg import BackendCfg +from weboob.capabilities.messages import ICapMessages + +from .ui.main_window_ui import Ui_MainWindow + +class MainWindow(QtMainWindow): + def __init__(self, config, weboob, parent=None): + QtMainWindow.__init__(self, parent) + self.ui = Ui_MainWindow() + self.ui.setupUi(self) + + self.config = config + self.weboob = weboob + + self.connect(self.ui.actionModules, SIGNAL("triggered()"), self.modulesConfig) + + def modulesConfig(self): + bckndcfg = BackendCfg(self.weboob, (ICapMessages,), self) + bckndcfg.show() diff --git a/weboob/frontends/qboobmsg/qboobmsg.py b/weboob/frontends/qboobmsg/qboobmsg.py new file mode 100644 index 00000000..f68432ea --- /dev/null +++ b/weboob/frontends/qboobmsg/qboobmsg.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +# Copyright(C) 2010 Romain Bignon +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +from weboob.capabilities.messages import ICapMessages +from weboob.tools.application import QtApplication + +from .main_window import MainWindow + +class QBoobMsg(QtApplication): + APPNAME = 'qboobmsg' + VERSION = '1.0' + COPYRIGHT = 'Copyright(C) 2010 Romain Bignon' + + def main(self, argv): + self.load_backends(ICapMessages) + + self.main_window = MainWindow(self.config, self.weboob) + self.main_window.show() + return self.weboob.loop() diff --git a/weboob/frontends/qboobmsg/ui/Makefile b/weboob/frontends/qboobmsg/ui/Makefile new file mode 100644 index 00000000..f0db5154 --- /dev/null +++ b/weboob/frontends/qboobmsg/ui/Makefile @@ -0,0 +1,13 @@ +UI_FILES = $(wildcard *.ui) +UI_PY_FILES = $(UI_FILES:%.ui=%_ui.py) +PYUIC = pyuic4 + +all: $(UI_PY_FILES) + +%_ui.py: %.ui + $(PYUIC) -o $@ $^ + +clean: + rm -f *.pyc + rm -f $(UI_PY_FILES) + diff --git a/weboob/frontends/qboobmsg/ui/__init__.py b/weboob/frontends/qboobmsg/ui/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/weboob/frontends/qboobmsg/ui/main_window.ui b/weboob/frontends/qboobmsg/ui/main_window.ui new file mode 100644 index 00000000..d7d7374c --- /dev/null +++ b/weboob/frontends/qboobmsg/ui/main_window.ui @@ -0,0 +1,84 @@ + + + MainWindow + + + + 0 + 0 + 763 + 580 + + + + QBoobMsg + + + + + + + + 0 + 0 + 763 + 24 + + + + + File + + + + + + + + + + + toolBar + + + TopToolBarArea + + + false + + + + + + Modules + + + + + Quit + + + Quit + + + + + + + actionQuit + triggered() + MainWindow + close() + + + -1 + -1 + + + 381 + 289 + + + + +