3
#########################################################################
5
# Apathy - A telepathy based communications client for mobile platforms #
6
# Copyright (C) 2009 Michael Sheldon <mike@mikeasoft.com> #
7
# Copyright 2012 Kai Huuhko <kai@kaihuuhko.com> #
9
# This program is free software: you can redistribute it and/or modify #
10
# it under the terms of the GNU General Public License as published by #
11
# the Free Software Foundation, either version 3 of the License, or #
12
# (at your option) any later version. #
14
# This program is distributed in the hope that it will be useful, #
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
17
# GNU General Public License for more details. #
19
# You should have received a copy of the GNU General Public License #
20
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
22
#########################################################################
24
import os.path, gettext
26
from Accounts import Accounts
27
from Contacts import Contacts
30
import ecore, dbus, e_dbus
31
import elementary as e
33
from gi.repository import GObject
34
GObject.threads_init()
35
from gi.repository import TelepathyGLib as Tp
36
#Tp.debug_set_flags("all")
38
class Apathy(e.Window):
39
def __init__(self, log):
40
e.Window.__init__(self, "apathy", e.ELM_WIN_BASIC)
42
self.title_set("Apathy")
43
self.callback_delete_request_add(self.quit)
45
bg = e.Background(self)
46
bg.size_hint_weight_set(1.0, 1.0)
47
self.resize_object_add(bg)
50
self.flip = flip = e.Flip(self)
51
self.contacts = contacts = Contacts(self)
52
self.accounts = accounts = Accounts(self)
53
flip.content_front_set(contacts)
54
flip.content_back_set(accounts)
55
flip.size_hint_weight_set(1.0, 1.0)
56
flip.size_hint_align_set(-1.0, -1.0)
57
self.resize_object_add(flip)
63
def quit(self, *args):
64
log.info("Apathy is exiting")
67
if __name__ == "__main__":
68
if not os.path.exists(USER_PATH):
69
os.mkdir(USER_PATH, 0700)
70
if not os.path.exists(IMAGE_PATH):
71
os.mkdir(IMAGE_PATH, 0777)
73
gettext.install("apathy", "/usr/share/locale", unicode=1)
76
dbus_mainloop = e_dbus.DBusEcoreMainLoop()
77
dbus.set_default_main_loop(dbus_mainloop)
81
ecore.main_loop_glib_integrate()