diff --git a/kde/src/AccountView.h b/kde/src/AccountView.h index 1228e56b831d37cb85975fa8ab22d2a0f766aba4..f13bf523bed64b2282368cac8a7bf97ee771465c 100644 --- a/kde/src/AccountView.h +++ b/kde/src/AccountView.h @@ -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> { diff --git a/kde/src/CMakeLists.txt b/kde/src/CMakeLists.txt index 1fe5b49aa721fb0036754bcd4ebf676def043c95..9c22f65f5f59358a3a64a572f385d1783bc3d466 100755 --- a/kde/src/CMakeLists.txt +++ b/kde/src/CMakeLists.txt @@ -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 diff --git a/kde/src/SFLPhone.cpp b/kde/src/SFLPhone.cpp index a8da9f520daf8bca32ff8f931d9b802a5a7d9ec4..5ea5c4f66c8f6f84ad1df1923e440487ede65542 100755 --- a/kde/src/SFLPhone.cpp +++ b/kde/src/SFLPhone.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; } diff --git a/kde/src/SFLPhoneView.cpp b/kde/src/SFLPhoneView.cpp index 61a2b1f0e1c175c51c12f8f160141e1c2ea48f4b..b90591eff61659c66313f718014b6fe07ceea2f4 100755 --- a/kde/src/SFLPhoneView.cpp +++ b/kde/src/SFLPhoneView.cpp @@ -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) { diff --git a/kde/src/SFLPhoneView.h b/kde/src/SFLPhoneView.h index 80036b9d23d085cf958b069154ddae71ac2c57f1..799111193cdf6e913d95f7d75b2471a8b80db169 100755 --- a/kde/src/SFLPhoneView.h +++ b/kde/src/SFLPhoneView.h @@ -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); diff --git a/kde/src/SFLPhoneapplication.cpp b/kde/src/SFLPhoneapplication.cpp index aa53f6767c5c1110d6485d2bc0cbadda1dbb2e72..a7d5215c75c3b7230cb32f6876100928675e754a 100755 --- a/kde/src/SFLPhoneapplication.cpp +++ b/kde/src/SFLPhoneapplication.cpp @@ -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" diff --git a/kde/src/SFLPhoneapplication.h b/kde/src/SFLPhoneapplication.h index a9663809d42c02f169c71ffb3bcea2a128cb8968..b1a43ce05c85a8c1b2cdb069e5b432bd980ee6b6 100755 --- a/kde/src/SFLPhoneapplication.h +++ b/kde/src/SFLPhoneapplication.h @@ -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 diff --git a/kde/src/lib/CallModel.hpp b/kde/src/lib/CallModel.hpp index c00046d9854908789f1f8a82e6e8fad1b96ad09e..a04ec7407a0b3218c448a6b67aba8cebd7b2972b 100644 --- a/kde/src/lib/CallModel.hpp +++ b/kde/src/lib/CallModel.hpp @@ -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 diff --git a/kde/src/AccountItemWidget.cpp b/kde/src/widgets/AccountItemWidget.cpp similarity index 100% rename from kde/src/AccountItemWidget.cpp rename to kde/src/widgets/AccountItemWidget.cpp diff --git a/kde/src/AccountItemWidget.h b/kde/src/widgets/AccountItemWidget.h similarity index 100% rename from kde/src/AccountItemWidget.h rename to kde/src/widgets/AccountItemWidget.h