From f97320e620bcf500e19e6a68bed198edbceef6fd Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Wed, 30 Jun 2010 19:46:35 +0200 Subject: [PATCH] add QHaveSex new frontend --- scripts/qhavesex | 25 +++++ weboob/frontends/qhavesex/Makefile | 5 + weboob/frontends/qhavesex/__init__.py | 1 + weboob/frontends/qhavesex/main_window.py | 39 +++++++ weboob/frontends/qhavesex/qhavesex.py | 34 ++++++ weboob/frontends/qhavesex/ui/Makefile | 13 +++ weboob/frontends/qhavesex/ui/__init__.py | 0 weboob/frontends/qhavesex/ui/main_window.ui | 112 ++++++++++++++++++++ 8 files changed, 229 insertions(+) create mode 100755 scripts/qhavesex create mode 100644 weboob/frontends/qhavesex/Makefile create mode 100644 weboob/frontends/qhavesex/__init__.py create mode 100644 weboob/frontends/qhavesex/main_window.py create mode 100644 weboob/frontends/qhavesex/qhavesex.py create mode 100644 weboob/frontends/qhavesex/ui/Makefile create mode 100644 weboob/frontends/qhavesex/ui/__init__.py create mode 100644 weboob/frontends/qhavesex/ui/main_window.ui diff --git a/scripts/qhavesex b/scripts/qhavesex new file mode 100755 index 0000000000..3cadf607b6 --- /dev/null +++ b/scripts/qhavesex @@ -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.qhavesex import QHaveSex + + +if __name__ == '__main__': + QHaveSex.run() diff --git a/weboob/frontends/qhavesex/Makefile b/weboob/frontends/qhavesex/Makefile new file mode 100644 index 0000000000..04c08812be --- /dev/null +++ b/weboob/frontends/qhavesex/Makefile @@ -0,0 +1,5 @@ +all: + $(MAKE) -C ui + +clean: + $(MAKE) -C ui clean diff --git a/weboob/frontends/qhavesex/__init__.py b/weboob/frontends/qhavesex/__init__.py new file mode 100644 index 0000000000..e55140d2be --- /dev/null +++ b/weboob/frontends/qhavesex/__init__.py @@ -0,0 +1 @@ +from .qhavesex import QHaveSex diff --git a/weboob/frontends/qhavesex/main_window.py b/weboob/frontends/qhavesex/main_window.py new file mode 100644 index 0000000000..fdf212b32f --- /dev/null +++ b/weboob/frontends/qhavesex/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.dating import ICapDating + +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, (ICapDating,), self) + bckndcfg.show() diff --git a/weboob/frontends/qhavesex/qhavesex.py b/weboob/frontends/qhavesex/qhavesex.py new file mode 100644 index 0000000000..ea965cf466 --- /dev/null +++ b/weboob/frontends/qhavesex/qhavesex.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.dating import ICapDating +from weboob.tools.application import QtApplication + +from .main_window import MainWindow + +class QHaveSex(QtApplication): + APPNAME = 'qhavesex' + VERSION = '1.0' + COPYRIGHT = 'Copyright(C) 2010 Romain Bignon' + + def main(self, argv): + self.load_backends(ICapDating) + + self.main_window = MainWindow(self.config, self.weboob) + self.main_window.show() + return self.weboob.loop() diff --git a/weboob/frontends/qhavesex/ui/Makefile b/weboob/frontends/qhavesex/ui/Makefile new file mode 100644 index 0000000000..f0db5154cf --- /dev/null +++ b/weboob/frontends/qhavesex/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/qhavesex/ui/__init__.py b/weboob/frontends/qhavesex/ui/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/weboob/frontends/qhavesex/ui/main_window.ui b/weboob/frontends/qhavesex/ui/main_window.ui new file mode 100644 index 0000000000..5029e8bbe9 --- /dev/null +++ b/weboob/frontends/qhavesex/ui/main_window.ui @@ -0,0 +1,112 @@ + + + MainWindow + + + + 0 + 0 + 763 + 580 + + + + QHaveSex + + + + + + + 0 + + + + Status + + + + + Messages + + + + + Contacts + + + + + Calendar + + + + + + + + + + 0 + 0 + 763 + 24 + + + + + File + + + + + + + + + + + toolBar + + + TopToolBarArea + + + false + + + + + + Modules + + + + + Quit + + + Quit + + + + + + + actionQuit + triggered() + MainWindow + close() + + + -1 + -1 + + + 381 + 289 + + + + + -- GitLab