Commit d637c499 authored by Emmanuel Lepage's avatar Emmanuel Lepage

Close SFLPhone at the right place, it still respawn, I don't know why

parent a6386982
......@@ -5,7 +5,7 @@
#include "lib/Item.h"
#include "lib/Account.h"
#include "AccountItemWidget.h"
#include "widgets/AccountItemWidget.h"
#include "lib/sflphone_const.h"
class AccountView : public Account, public Item<AccountItemWidget> {
......
......@@ -25,7 +25,7 @@ SET( sflphone_client_kde_SRCS
widgets/SFLPhoneTray.cpp
main.cpp
AccountWizard.cpp
AccountItemWidget.cpp
widgets/AccountItemWidget.cpp
widgets/CallTreeItem.cpp
widgets/HistoryTreeItem.cpp
ActionSetAccountFirst.cpp
......
......@@ -161,19 +161,19 @@ void SFLPhone::setupActions()
qDebug() << "setupActions";
//ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
action_accept = new KAction(this);
action_refuse = new KAction(this);
action_hold = new KAction(this);
action_accept = new KAction(this);
action_refuse = new KAction(this);
action_hold = new KAction(this);
action_transfer = new KAction(this);
action_record = new KAction(this);
action_mailBox = new KAction(this);
action_record = new KAction(this);
action_mailBox = new KAction(this);
action_accept->setShortcut(Qt::CTRL + Qt::Key_A);
action_refuse->setShortcut(Qt::CTRL + Qt::Key_D);
action_hold->setShortcut(Qt::CTRL + Qt::Key_H);
action_transfer->setShortcut(Qt::CTRL + Qt::Key_T);
action_record->setShortcut(Qt::CTRL + Qt::Key_R);
action_mailBox->setShortcut(Qt::CTRL + Qt::Key_M);
action_accept->setShortcut ( Qt::CTRL + Qt::Key_A );
action_refuse->setShortcut ( Qt::CTRL + Qt::Key_D );
action_hold->setShortcut ( Qt::CTRL + Qt::Key_H );
action_transfer->setShortcut ( Qt::CTRL + Qt::Key_T );
action_record->setShortcut ( Qt::CTRL + Qt::Key_R );
action_mailBox->setShortcut ( Qt::CTRL + Qt::Key_M );
action_screen = new QActionGroup(this);
action_screen->setExclusive(true);
......@@ -197,33 +197,32 @@ void SFLPhone::setupActions()
action_displayDialpad->setChecked(/*configurationManager.getDialpad()*/true);
action_accountCreationWizard = new KAction(i18n("Account creation wizard"), this);
connect(action_accept, SIGNAL(triggered()), m_pView, SLOT(accept()));
connect(action_refuse, SIGNAL(triggered()), m_pView, SLOT(refuse()));
connect(action_hold, SIGNAL(triggered()), m_pView, SLOT(hold()));
connect(action_transfer, SIGNAL(triggered()), m_pView, SLOT(transfer()));
connect(action_record, SIGNAL(triggered()), m_pView, SLOT(record()));
connect(action_screen, SIGNAL(triggered(QAction *)), this , SLOT(updateScreen(QAction *)));
connect(action_mailBox, SIGNAL(triggered()), m_pView, SLOT(mailBox()));
connect(action_displayVolumeControls, SIGNAL(toggled(bool)), m_pView, SLOT(displayVolumeControls(bool)));
connect(action_displayDialpad, SIGNAL(toggled(bool)), m_pView, SLOT(displayDialpad(bool)));
connect(action_accountCreationWizard, SIGNAL(triggered()), m_pView, SLOT(accountCreationWizard()));
connect(action_accept, SIGNAL(triggered()), m_pView , SLOT(accept() ));
connect(action_refuse, SIGNAL(triggered()), m_pView , SLOT(refuse() ));
connect(action_hold, SIGNAL(triggered()), m_pView , SLOT(hold() ));
connect(action_transfer, SIGNAL(triggered()), m_pView , SLOT(transfer() ));
connect(action_record, SIGNAL(triggered()), m_pView , SLOT(record() ));
connect(action_screen, SIGNAL(triggered(QAction *)), this , SLOT(updateScreen(QAction *) ));
connect(action_mailBox, SIGNAL(triggered()), m_pView , SLOT(mailBox() ));
connect(action_displayVolumeControls, SIGNAL(toggled(bool)), m_pView , SLOT(displayVolumeControls(bool) ));
connect(action_displayDialpad, SIGNAL(toggled(bool)), m_pView , SLOT(displayDialpad(bool) ));
connect(action_accountCreationWizard, SIGNAL(triggered()), m_pView , SLOT(accountCreationWizard() ));
action_screen->addAction(action_main);
actionCollection()->addAction("action_accept", action_accept);
actionCollection()->addAction("action_refuse", action_refuse);
actionCollection()->addAction("action_hold", action_hold);
actionCollection()->addAction("action_transfer", action_transfer);
actionCollection()->addAction("action_record", action_record);
actionCollection()->addAction("action_main", action_main);
actionCollection()->addAction("action_mailBox", action_mailBox);
actionCollection()->addAction("action_close", action_close);
actionCollection()->addAction("action_quit", action_quit);
actionCollection()->addAction("action_displayVolumeControls", action_displayVolumeControls);
actionCollection()->addAction("action_displayDialpad", action_displayDialpad);
actionCollection()->addAction("action_configureSflPhone", action_configureSflPhone);
actionCollection()->addAction("action_accountCreationWizard", action_accountCreationWizard);
actionCollection()->addAction("action_accept" , action_accept );
actionCollection()->addAction("action_refuse" , action_refuse );
actionCollection()->addAction("action_hold" , action_hold );
actionCollection()->addAction("action_transfer" , action_transfer );
actionCollection()->addAction("action_record" , action_record );
actionCollection()->addAction("action_main" , action_main );
actionCollection()->addAction("action_mailBox" , action_mailBox );
actionCollection()->addAction("action_close" , action_close );
actionCollection()->addAction("action_quit" , action_quit );
actionCollection()->addAction("action_displayVolumeControls" , action_displayVolumeControls );
actionCollection()->addAction("action_displayDialpad" , action_displayDialpad );
actionCollection()->addAction("action_configureSflPhone" , action_configureSflPhone );
actionCollection()->addAction("action_accountCreationWizard" , action_accountCreationWizard );
QString rcFilePath = QString(DATA_INSTALL_DIR) + "/sflphone-client-kde/sflphone-client-kdeui.rc";
......@@ -261,14 +260,13 @@ bool SFLPhone::queryClose()
void SFLPhone::quitButton()
{
InstanceInterface & instance = InstanceInterfaceSingleton::getInstance();
//qDebug() << "quitButton : " << m_pView->callTree->count() << " calls open.";
//if(m_pView->callTree->count() > 0 && instance.getRegistrationCount() <= 1) {
//qDebug() << "Attempting to quit when still having some calls open.";
//}
m_pView->saveState();
instance.Unregister(getpid());
qApp->quit();
}
......@@ -294,34 +292,34 @@ void SFLPhone::on_m_pView_windowTitleChangeAsked(const QString & message)
void SFLPhone::on_m_pView_enabledActionsChangeAsked(const bool * enabledActions)
{
qDebug() << "on_m_pView_enabledActionsChangeAsked";
action_accept->setVisible(enabledActions[SFLPhone::Accept]);
action_refuse->setVisible(enabledActions[SFLPhone::Refuse]);
action_hold->setVisible(enabledActions[SFLPhone::Hold]);
action_transfer->setVisible(enabledActions[SFLPhone::Transfer]);
action_record->setVisible(enabledActions[SFLPhone::Record]);
action_mailBox->setVisible(enabledActions[SFLPhone::Mailbox]);
action_accept->setVisible ( enabledActions[SFLPhone::Accept ]);
action_refuse->setVisible ( enabledActions[SFLPhone::Refuse ]);
action_hold->setVisible ( enabledActions[SFLPhone::Hold ]);
action_transfer->setVisible ( enabledActions[SFLPhone::Transfer ]);
action_record->setVisible ( enabledActions[SFLPhone::Record ]);
action_mailBox->setVisible ( enabledActions[SFLPhone::Mailbox ]);
}
void SFLPhone::on_m_pView_actionIconsChangeAsked(const QString * actionIcons)
{
qDebug() << "on_m_pView_actionIconsChangeAsked";
action_accept->setIcon(QIcon(actionIcons[SFLPhone::Accept]));
action_refuse->setIcon(QIcon(actionIcons[SFLPhone::Refuse]));
action_hold->setIcon(QIcon(actionIcons[SFLPhone::Hold]));
action_transfer->setIcon(QIcon(actionIcons[SFLPhone::Transfer]));
action_record->setIcon(QIcon(actionIcons[SFLPhone::Record]));
action_mailBox->setIcon(QIcon(actionIcons[SFLPhone::Mailbox]));
action_accept->setIcon ( QIcon(actionIcons[SFLPhone::Accept ]));
action_refuse->setIcon ( QIcon(actionIcons[SFLPhone::Refuse ]));
action_hold->setIcon ( QIcon(actionIcons[SFLPhone::Hold ]));
action_transfer->setIcon ( QIcon(actionIcons[SFLPhone::Transfer ]));
action_record->setIcon ( QIcon(actionIcons[SFLPhone::Record ]));
action_mailBox->setIcon ( QIcon(actionIcons[SFLPhone::Mailbox ]));
}
void SFLPhone::on_m_pView_actionTextsChangeAsked(const QString * actionTexts)
{
qDebug() << "on_m_pView_actionTextsChangeAsked";
action_accept->setText(actionTexts[SFLPhone::Accept]);
action_refuse->setText(actionTexts[SFLPhone::Refuse]);
action_hold->setText(actionTexts[SFLPhone::Hold]);
action_transfer->setText(actionTexts[SFLPhone::Transfer]);
action_record->setText(actionTexts[SFLPhone::Record]);
action_mailBox->setText(actionTexts[SFLPhone::Mailbox]);
action_accept->setText ( actionTexts[SFLPhone::Accept ]);
action_refuse->setText ( actionTexts[SFLPhone::Refuse ]);
action_hold->setText ( actionTexts[SFLPhone::Hold ]);
action_transfer->setText ( actionTexts[SFLPhone::Transfer ]);
action_record->setText ( actionTexts[SFLPhone::Record ]);
action_mailBox->setText ( actionTexts[SFLPhone::Mailbox ]);
}
......@@ -351,12 +349,12 @@ void SFLPhone::on_m_pView_screenChanged(int screen)
QList<QAction*> SFLPhone::getCallActions()
{
QList<QAction*> callActions = QList<QAction *>();
callActions.insert((int) Accept, action_accept);
callActions.insert((int) Refuse, action_refuse);
callActions.insert((int) Hold, action_hold);
callActions.insert((int)Transfer, action_transfer);
callActions.insert((int) Record, action_record);
callActions.insert((int) Mailbox, action_mailBox);
callActions.insert((int) Accept , action_accept );
callActions.insert((int) Refuse , action_refuse );
callActions.insert((int) Hold , action_hold );
callActions.insert((int) Transfer , action_transfer );
callActions.insert((int) Record , action_record );
callActions.insert((int) Mailbox , action_mailBox );
return callActions;
}
......
......@@ -81,8 +81,6 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
this, SLOT(on1_changingConference(const QString &, const QString &)));
connect(&callManager, SIGNAL(conferenceRemoved(const QString &)),
this, SLOT(on1_conferenceRemoved(const QString &)));
connect(&callManager, SIGNAL(incomingMessage(const QString &, const QString &)),
this, SLOT(on1_incomingMessage(const QString &, const QString &)));
connect(&callManager, SIGNAL(voiceMailNotify(const QString &, int)),
this, SLOT(on1_voiceMailNotify(const QString &, int)));
......@@ -91,9 +89,6 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
connect(&configurationManager, SIGNAL(accountsChanged()),
CallView::getAccountList(), SLOT(updateAccounts()));
connect(&configurationManager, SIGNAL(audioManagerChanged()),
this, SLOT(on1_audioManagerChanged()));
//END Port to Call Model
//connect(configDialog, SIGNAL(changesApplied()),
......@@ -103,15 +98,6 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
this, SLOT(updateStatusMessage()));
connect(CallView::getAccountList(), SIGNAL(accountListUpdated()),
this, SLOT(updateWindowCallState()));
connect(callTreeModel->getWidget(), SIGNAL(itemChanged()), //currentItemChanged
this, SLOT(on_callTree_currentItemChanged()));
connect(callTreeModel->getWidget(), SIGNAL(itemChanged()), //ITem changed
this, SLOT(on_callTree_itemChanged()));
connect(callTreeModel->getWidget(), SIGNAL(doubleClicked(const QModelIndex &)),
this, SLOT(on_callTree_itemDoubleClicked(const QModelIndex&)));
}
......@@ -592,21 +578,21 @@ void SFLPhoneView::on_toolButton_sndVol_clicked(bool checked)
updateVolumeButton();
}
void SFLPhoneView::on_callTree_currentItemChanged()
{
qDebug() << "on_callTree_currentItemChanged";
updateWindowCallState();
}
// void SFLPhoneView::on_callTree_currentItemChanged()
// {
// qDebug() << "on_callTree_currentItemChanged";
// updateWindowCallState();
// }
void SFLPhoneView::on_callTree_itemChanged()
{
qDebug() << "on_callTree_itemChanged";
}
// void SFLPhoneView::on_callTree_itemChanged()
// {
// qDebug() << "on_callTree_itemChanged";
// }
void SFLPhoneView::on_callTree_itemDoubleClicked(QTreeWidgetItem* call, int column)
{
Q_UNUSED(call)
Q_UNUSED(column)
//void SFLPhoneView::on_callTree_itemDoubleClicked(QTreeWidgetItem* call, int column)
//{
//Q_UNUSED(call)
//Q_UNUSED(column)
//TODO port
//TODO remove once the last regression is sorted out.
// qDebug() << "on_callTree_itemDoubleClicked";
......@@ -621,7 +607,7 @@ Q_UNUSED(column)
// default:
// qDebug() << "Double clicked an item with no action on double click.";
// }
}
//}
void SFLPhoneView::contextMenuEvent(QContextMenuEvent *event)
{
......@@ -832,11 +818,6 @@ void SFLPhoneView::on1_conferenceRemoved(const QString &confId) {
callTreeModel->conferenceRemovedSignal(confId);
}
void SFLPhoneView::on1_incomingMessage(const QString &accountID, const QString &message)
{
qDebug() << "Signal : Incoming Message for account " << accountID << " ! \nMessage : " << message;
}
void SFLPhoneView::on1_voiceMailNotify(const QString &accountID, int count)
{
qDebug() << "Signal : VoiceMail Notify ! " << count << " new voice mails for account " << accountID;
......@@ -851,12 +832,12 @@ void SFLPhoneView::on1_volumeChanged(const QString & /*device*/, double value)
updateVolumeBar();
}
void SFLPhoneView::on1_audioManagerChanged()
{
qDebug() << "Signal : Audio Manager Changed !";
updateVolumeControls();
}
// void SFLPhoneView::on1_audioManagerChanged()
// {
// qDebug() << "Signal : Audio Manager Changed !";
//
// updateVolumeControls();
// }
void SFLPhoneView::changeScreen(int screen)
{
......
......@@ -249,17 +249,17 @@ public slots:
void on_toolButton_recVol_clicked(bool checked);
void on_toolButton_sndVol_clicked(bool checked);
void on_callTree_currentItemChanged();
void on_callTree_itemChanged();
void on_callTree_itemDoubleClicked(QTreeWidgetItem* item, int column);
//void on_callTree_currentItemChanged();
//void on_callTree_itemChanged();
//void on_callTree_itemDoubleClicked(QTreeWidgetItem* item, int column);
void on1_callStateChanged(const QString &callID, const QString &state);
void on1_error(MapStringString details);
void on1_incomingCall(const QString &accountID, const QString &callID/*, const QString &from*/);
void on1_incomingMessage(const QString &accountID, const QString &message);
//void on1_incomingMessage(const QString &accountID, const QString &message);
void on1_voiceMailNotify(const QString &accountID, int count);
void on1_volumeChanged(const QString &device, double value);
void on1_audioManagerChanged();
//void on1_audioManagerChanged();
void on1_incomingConference(const QString &confID);
void on1_changingConference(const QString &confID, const QString &state);
void on1_conferenceRemoved(const QString &confId);
......
......@@ -7,6 +7,7 @@
#include <KNotification>
#include <KSystemTrayIcon>
#include <KMainWindow>
#include "lib/instance_interface_singleton.h"
#include "SFLPhone.h"
......@@ -22,6 +23,7 @@ SFLPhoneApplication::SFLPhoneApplication()
// Start remaining initialisation
initializePaths();
initializeMainWindow();
connect(this,SIGNAL(aboutToQuit()),this,SLOT(quit2()));
}
......@@ -100,5 +102,11 @@ void SFLPhoneApplication::initializePaths()
}
}
Q_NOREPLY void SFLPhoneApplication::quit2()
{
disableSessionManagement();
InstanceInterface& instance = InstanceInterfaceSingleton::getInstance();
Q_NOREPLY instance.Unregister(getpid());
}
#include "SFLPhoneapplication.moc"
......@@ -3,7 +3,7 @@
#include <KApplication>
#include <QDBusAbstractAdaptor>
class SFLPhone;
......@@ -29,6 +29,9 @@ class SFLPhoneApplication : public KApplication
private:
// Reference to the sflphone window
SFLPhone *sflphoneWindow_;
private slots:
Q_NOREPLY void quit2();
};
#endif // SFLPHONEAPPLICATION_H
......@@ -67,12 +67,11 @@ template<typename CallWidget, typename Index> bool CallModel<CallWidget,Index>::
//Fill the history list
//@warning This solution wont scale to multiple call or history model implementation. Some static addCall + foreach for each call would be needed if this case ever become unavoidable
template<typename CallWidget, typename Index> bool CallModel<CallWidget,Index>::initHistory()
{qDebug() << "\n\n\n\nInit history";
if (!historyInit) {qDebug() << "In if";
{
if (!historyInit) {
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
QStringList historyMap = configurationManager.getHistory().value();
qDebug() << historyMap.size();
foreach (QString historyCallId, historyMap) {qDebug() << "Here";
foreach (QString historyCallId, historyMap) {
QStringList param = historyCallId.split("|");
if (param.count() <= 10) {
//If this ever change, look at the gnome client
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment