Mercurial > bellaciao
comparison bellaciao.cpp @ 0:22b44846b04b
Initial commit
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 06 Aug 2011 15:37:02 +0200 |
parents | |
children | fee291c8d42a |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:22b44846b04b |
---|---|
1 /* | |
2 Bellaciao: a Salut à Toi frontend | |
3 Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org) | |
4 | |
5 This program is free software: you can redistribute it and/or modify | |
6 it under the terms of the GNU Affero General Public License as published by | |
7 the Free Software Foundation, either version 3 of the License, or | |
8 (at your option) any later version. | |
9 | |
10 This program is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 GNU Affero General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Affero General Public License | |
16 along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 */ | |
18 | |
19 #include "bellaciao.h" | |
20 #include "parameters.h" | |
21 | |
22 Bellaciao::Bellaciao() | |
23 :QMainWindow(0) | |
24 { | |
25 m_bridge = Bridge::getBridge(); | |
26 | |
27 //Ui | |
28 setupUi(this); | |
29 m_contactList = new ContactList(this); | |
30 | |
31 //Signals & Slots | |
32 connect(actionParameters, SIGNAL(triggered()), this, SLOT(showParameters())); | |
33 | |
34 | |
35 addDockWidget(Qt::LeftDockWidgetArea, m_contactList); | |
36 | |
37 | |
38 setWindowTitle("Bellaciao"); | |
39 QList<MenuT> menus = m_bridge->getMenus(); | |
40 foreach(const MenuT &menu, menus) | |
41 qDebug() << menu.name; | |
42 StringDict waiting=m_bridge->getWaitingSub("jabberfr"); | |
43 | |
44 QList<ContactT> contacts = m_bridge->getContacts("jabberfr"); | |
45 | |
46 foreach(const ContactT &contact, contacts) | |
47 m_contactList->addContact(contact.jid); | |
48 //qDebug() << contact.jid << contact.attributes << contact.groups; | |
49 | |
50 | |
51 } | |
52 | |
53 void Bellaciao::disconnect() | |
54 { | |
55 if ( QMessageBox::question ( | |
56 this, | |
57 tr("Disconnect?"), | |
58 tr("Do you really want to disconnect ?"), | |
59 QMessageBox::Yes | QMessageBox::No, | |
60 QMessageBox::No | |
61 ) == QMessageBox::Yes | |
62 ) | |
63 { | |
64 m_bridge->disconnect("jabberfr"); | |
65 } | |
66 } | |
67 | |
68 void Bellaciao::showParameters() | |
69 { | |
70 qDebug("Show parameters"); | |
71 ParametersWin *params = new ParametersWin(); | |
72 params->show(); | |
73 } | |
74 | |
75 void Bellaciao::on_actionToggle_fullscreen_triggered() | |
76 { | |
77 if (isFullScreen()) | |
78 showNormal(); | |
79 else | |
80 showFullScreen(); | |
81 qDebug("on_actionToggle_fullscreen_triggered"); | |
82 } |