Mercurial > bellaciao
view bellaciao.cpp @ 3:2195295a2058
added basic INSTALL instructions
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 08 Aug 2011 10:59:34 +0200 |
parents | fee291c8d42a |
children | 220e5619bf87 |
line wrap: on
line source
/* Bellaciao: a Salut à Toi frontend Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "bellaciao.h" #include "settings.h" Bellaciao::Bellaciao() :QMainWindow(0) { m_bridge = Bridge::getBridge(); //Ui setupUi(this); const QString & media_dir = m_bridge->getConfig("", "media_dir"); setWindowIcon(QIcon(media_dir+"/icons/apps/32/sat.png")); m_contactList = new ContactList(this); //Signals & Slots connect(actionSettings, SIGNAL(triggered()), this, SLOT(showSettings())); connect(actionQuit, SIGNAL(triggered()), this, SLOT(quit())); addDockWidget(Qt::LeftDockWidgetArea, m_contactList); setWindowTitle("Bellaciao"); QList<MenuT> menus = m_bridge->getMenus(); foreach(const MenuT &menu, menus) qDebug() << menu.name; QList<ContactT> contacts = m_bridge->getContacts("jabberfr"); foreach(const ContactT &contact, contacts) m_contactList->addContact(contact.jid); //qDebug() << contact.jid << contact.attributes << contact.groups; } void Bellaciao::quit() { if ( QMessageBox::question ( this, tr("Quit?"), tr("Do you really want to quit ?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) == QMessageBox::Yes ) { qApp->quit(); } } void Bellaciao::showSettings() { qDebug("Show settings"); Settings::getDialog()->show(); Settings::getDialog()->raise(); } void Bellaciao::on_actionToggle_fullscreen_triggered() { if (isFullScreen()) showNormal(); else showFullScreen(); qDebug("on_actionToggle_fullscreen_triggered"); }