Mercurial > bellaciao
diff bellaciao.cpp @ 2:fee291c8d42a
settings: profiles management first draft
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 08 Aug 2011 10:30:23 +0200 |
parents | 22b44846b04b |
children | 220e5619bf87 |
line wrap: on
line diff
--- a/bellaciao.cpp Sat Aug 06 15:38:00 2011 +0200 +++ b/bellaciao.cpp Mon Aug 08 10:30:23 2011 +0200 @@ -17,7 +17,7 @@ */ #include "bellaciao.h" -#include "parameters.h" +#include "settings.h" Bellaciao::Bellaciao() :QMainWindow(0) @@ -26,10 +26,14 @@ //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(actionParameters, SIGNAL(triggered()), this, SLOT(showParameters())); + connect(actionSettings, SIGNAL(triggered()), this, SLOT(showSettings())); + connect(actionQuit, SIGNAL(triggered()), this, SLOT(quit())); addDockWidget(Qt::LeftDockWidgetArea, m_contactList); @@ -39,7 +43,6 @@ QList<MenuT> menus = m_bridge->getMenus(); foreach(const MenuT &menu, menus) qDebug() << menu.name; - StringDict waiting=m_bridge->getWaitingSub("jabberfr"); QList<ContactT> contacts = m_bridge->getContacts("jabberfr"); @@ -50,26 +53,26 @@ } -void Bellaciao::disconnect() +void Bellaciao::quit() { if ( QMessageBox::question ( this, - tr("Disconnect?"), - tr("Do you really want to disconnect ?"), + tr("Quit?"), + tr("Do you really want to quit ?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) == QMessageBox::Yes ) { - m_bridge->disconnect("jabberfr"); + qApp->quit(); } } -void Bellaciao::showParameters() +void Bellaciao::showSettings() { - qDebug("Show parameters"); - ParametersWin *params = new ParametersWin(); - params->show(); + qDebug("Show settings"); + Settings::getDialog()->show(); + Settings::getDialog()->raise(); } void Bellaciao::on_actionToggle_fullscreen_triggered()