diff --git a/src/gui/official/ConfigurationPanel.hpp b/src/gui/official/ConfigurationPanel.hpp new file mode 100644 index 0000000000000000000000000000000000000000..911a71215b9e9e1e373de6b1b7c4903c48d3d30f --- /dev/null +++ b/src/gui/official/ConfigurationPanel.hpp @@ -0,0 +1,29 @@ +/** + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author : Jean-Philippe Barrette-LaPierre + * <jean-philippe.barrette-lapierre@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __CONFIGURATION_PANEL_HPP__ +#define __CONFIGURATION_PANEL_HPP__ + +#include "utilspp/Singleton.hpp" +#include "ConfigurationPanelImpl.hpp" + +typedef utilspp::SingletonHolder< ConfigurationPanelImpl > ConfigurationPanel; + +#endif diff --git a/src/gui/official/ConfigurationPanelImpl.hpp b/src/gui/official/ConfigurationPanelImpl.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ea6ab975e7b9cc51c3de5c95844de6756a873274 --- /dev/null +++ b/src/gui/official/ConfigurationPanelImpl.hpp @@ -0,0 +1,42 @@ +/** + * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Author: Jean-Philippe Barrette-LaPierre + * <jean-philippe.barrette-lapierre@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __CONFIGURATION_PANEL_IMPL_HPP__ +#define __CONFIGURATION_PANEL_IMPL_HPP__ + +#include <qlayout.h> +#include <qdialog.h> + +class ConfigurationPanelImpl : public QDialog +{ + Q_OBJECT + +public: + ConfigurationPanelImpl(QWidget *parent = NULL); + +public slots: + void add(QString section, QString name, QString type, QString def, QString value); + +private: + QVBoxLayout *mLayout; +}; + + +#endif diff --git a/src/gui/official/PhoneLine.cpp b/src/gui/official/PhoneLine.cpp index 088f025d7166e9c4f04e9142d2d7d296e3ac07f3..83bc43c83f377906c7df247f5b420c27a4258e5a 100644 --- a/src/gui/official/PhoneLine.cpp +++ b/src/gui/official/PhoneLine.cpp @@ -171,7 +171,6 @@ PhoneLine::incomming(const Call &call) } else { mCall = new Call(call); - setLineStatus("Incomming..."); emit backgrounded(); } } diff --git a/src/gui/official/PhoneLineManagerImpl.cpp b/src/gui/official/PhoneLineManagerImpl.cpp index bdbe2b883446ee3634c74ff3b688cdf2464fac22..ea41a3f98900a118e1b62d70336bf1164813bda9 100644 --- a/src/gui/official/PhoneLineManagerImpl.cpp +++ b/src/gui/official/PhoneLineManagerImpl.cpp @@ -449,6 +449,14 @@ PhoneLineManagerImpl::mute() mSession->mute(); } +void +PhoneLineManagerImpl::setup() +{ + isInitialized(); + + mSession->configGetAll(); +} + void PhoneLineManagerImpl::unmute() { @@ -523,7 +531,7 @@ PhoneLineManagerImpl::addCall(Call call, if(selectedLine) { selectedLine->incomming(call); selectedLine->setPeer(peer); - selectedLine->setState(state); + selectedLine->setLineStatus(state); } else { DebugOutput::instance() << QObject::tr("PhoneLineManager: There's no available lines" diff --git a/src/gui/official/PhoneLineManagerImpl.hpp b/src/gui/official/PhoneLineManagerImpl.hpp index 9cbd9b8944bf95abf59332828d7d06ea6e43669d..efdf39cf5d77a1b7ae4203fed0ee665a1093d8e2 100644 --- a/src/gui/official/PhoneLineManagerImpl.hpp +++ b/src/gui/official/PhoneLineManagerImpl.hpp @@ -113,6 +113,8 @@ public slots: */ void unmute(); + void setup(); + /** * This function will hanp up the line number given * argument. Be aware that the first line is 1, not diff --git a/src/gui/official/SFLPhoneApp.cpp b/src/gui/official/SFLPhoneApp.cpp index 281cdcc7a9091bf460e2684a4d007200b45a8deb..657df3b18fd6fa47d56864ee124830b9a472906a 100644 --- a/src/gui/official/SFLPhoneApp.cpp +++ b/src/gui/official/SFLPhoneApp.cpp @@ -23,6 +23,7 @@ SFLPhoneApp::SFLPhoneApp(int argc, char **argv) Requester::instance().registerObject< Request >(QString("stoptone")); Requester::instance().registerObject< Request >(QString("playdtmf")); Requester::instance().registerObject< CallRequest >(QString("call")); + Requester::instance().registerObject< ConfigGetAllRequest >(QString("configgetall")); Requester::instance().registerObject< EventRequest >(QString("getevents")); Requester::instance().registerObject< CallStatusRequest >(QString("getcallstatus")); Requester::instance().registerObject< PermanentRequest >(QString("answer")); @@ -63,6 +64,8 @@ SFLPhoneApp::initConnections(SFLPhoneWindow *w) &PhoneLineManager::instance(), SLOT(call())); QObject::connect(w->mMute, SIGNAL(clicked(bool)), &PhoneLineManager::instance(), SLOT(mute(bool))); + QObject::connect(w->mSetup, SIGNAL(clicked()), + &PhoneLineManager::instance(), SLOT(setup())); QObject::connect(w->mHangup, SIGNAL(clicked()), &PhoneLineManager::instance(), SLOT(hangup())); QObject::connect(w->mHold, SIGNAL(clicked()), diff --git a/src/gui/official/SFLPhoneWindow.cpp b/src/gui/official/SFLPhoneWindow.cpp index 49efd30cfc0b2495cc19417bfbdfb6b97bbc5a4d..90e73d477b293bd6bf48e69217e46fb6f4eab931 100644 --- a/src/gui/official/SFLPhoneWindow.cpp +++ b/src/gui/official/SFLPhoneWindow.cpp @@ -37,7 +37,8 @@ #define CLOSE_PRESSED_IMAGE "close_on.png" #define MINIMIZE_RELEASED_IMAGE "minimize_off.png" #define MINIMIZE_PRESSED_IMAGE "minimize_on.png" - +#define SETUP_RELEASED_IMAGE "setup_off.png" +#define SETUP_PRESSED_IMAGE "setup_on.png" SFLPhoneWindow::SFLPhoneWindow() @@ -116,6 +117,12 @@ SFLPhoneWindow::initGUIButtons() mMute->move(225,94); mMute->setToggle(true); + mSetup = new JPushButton(QString(SETUP_RELEASED_IMAGE), + QString(SETUP_PRESSED_IMAGE), + mMain); + //mSetup->move(225,42); + mSetup->move(318,68); + mVolume = new VolumeControl(QString(VOLUME_IMAGE), mMain); mVolume->setOrientation(VolumeControl::Vertical); diff --git a/src/gui/official/SFLPhoneWindow.hpp b/src/gui/official/SFLPhoneWindow.hpp index 0165399a893e01bddd575ddb0f7699eb827908ee..6c2b02e7f111a97346007f9917156bc9ffc4dc62 100644 --- a/src/gui/official/SFLPhoneWindow.hpp +++ b/src/gui/official/SFLPhoneWindow.hpp @@ -62,6 +62,7 @@ private: JPushButton *mOk; JPushButton *mClear; JPushButton *mMute; + JPushButton *mSetup; VolumeControl *mVolume; VolumeControl *mMicVolume; diff --git a/src/gui/official/SFLRequest.cpp b/src/gui/official/SFLRequest.cpp index f90c4b5d6b5312efb47c654a44067f2f3840b2f4..989d11659c44f3b96d98464498ac6003eb1a9944 100644 --- a/src/gui/official/SFLRequest.cpp +++ b/src/gui/official/SFLRequest.cpp @@ -8,6 +8,7 @@ #include "CallManager.hpp" #include "CallStatus.hpp" #include "CallStatusFactory.hpp" +#include "ConfigurationPanel.hpp" #include "PhoneLine.hpp" #include "PhoneLineLocker.hpp" #include "PhoneLineManager.hpp" @@ -278,3 +279,51 @@ CallRequest::onSuccess(Account, DebugOutput::instance() << QObject::tr("CallRequest: Trying to retreive an unregistred call (%1)\n").arg(mCallId); } } + + + +ConfigGetAllRequest::ConfigGetAllRequest(const QString &sequenceId, + const QString &command, + const std::list< QString > &args) + : Request(sequenceId, command, args) +{} + + +void +ConfigGetAllRequest::onError(const QString &code, const QString &message) +{ + DebugOutput::instance() << QObject::tr("ConfigGetAllRequest error: (%1) %1\n") + .arg(code) + .arg(message); +} + +void +ConfigGetAllRequest::onEntry(const QString &code, const QString &message) +{ + DebugOutput::instance() << QObject::tr("ConfigGetAllRequest entry: (%1) %1\n") + .arg(code) + .arg(message); + std::list< QString > args = Request::parseArgs(message); + if(args.size() >= 5) { + QString section, variable, type, def, val; + section = *args.begin(); + args.pop_front(); + variable = *args.begin(); + args.pop_front(); + type = *args.begin(); + args.pop_front(); + def = *args.begin(); + args.pop_front(); + val = *args.begin(); + ConfigurationPanel::instance().add(section, variable, type, def, val); + } +} + +void +ConfigGetAllRequest::onSuccess(const QString &code, const QString &message) +{ + DebugOutput::instance() << QObject::tr("ConfigGetAllRequest success: (%1) %1\n") + .arg(code) + .arg(message); + ConfigurationPanel::instance().show(); +} diff --git a/src/gui/official/SFLRequest.hpp b/src/gui/official/SFLRequest.hpp index 3d7ff71eda1b3d8373263bb88d542fe5391f7c45..ffe291306e15e37f7442d77bccab6fc2f173555b 100644 --- a/src/gui/official/SFLRequest.hpp +++ b/src/gui/official/SFLRequest.hpp @@ -185,5 +185,20 @@ class TemporaryRequest : public CallRelatedRequest const QString &message); }; +class ConfigGetAllRequest : public Request +{ +public: + ConfigGetAllRequest(const QString &sequenceId, + const QString &command, + const std::list< QString > &args); + + + virtual ~ConfigGetAllRequest(){} + + + virtual void onError(const QString &code, const QString &message); + virtual void onEntry(const QString &code, const QString &message); + virtual void onSuccess(const QString &code, const QString &message); +}; #endif diff --git a/src/gui/official/Session.cpp b/src/gui/official/Session.cpp index 815baea42d27b4bba3b71f5123daad0272b97f48..b875fbcffd468e8d9853a7bfda86155c41d04d0a 100644 --- a/src/gui/official/Session.cpp +++ b/src/gui/official/Session.cpp @@ -68,6 +68,12 @@ Session::getEvents() const return Requester::instance().send(mId, "getevents", std::list< QString >()); } +QString +Session::configGetAll() const +{ + return Requester::instance().send(mId, "configgetall", std::list< QString >()); +} + QString Session::mute() const { diff --git a/src/gui/official/Session.hpp b/src/gui/official/Session.hpp index 7062f03bf9fe036c650d4f50ed6f40703cc6e3de..30483f6d57720a8b6a24dbb79b0480a8d8df8968 100644 --- a/src/gui/official/Session.hpp +++ b/src/gui/official/Session.hpp @@ -59,6 +59,8 @@ class Session */ QString mute() const; + QString configGetAll() const; + /** * This function will set the volume to * the given percentage diff --git a/src/gui/official/TransparentWidget.cpp b/src/gui/official/TransparentWidget.cpp index e6cb011098a971d72c3a50bae62db99008ec341c..5107f46ca85b6404092f2b5b3250f1f75b114dc0 100644 --- a/src/gui/official/TransparentWidget.cpp +++ b/src/gui/official/TransparentWidget.cpp @@ -103,7 +103,6 @@ TransparentWidget::transparize(const QString &image) QBitmap bm; if (img.hasAlphaBuffer()) { - DebugOutput::instance() << QObject::tr("Image has alpha buffer (%1)\n").arg(image); bm = img.createAlphaMask(); } else { diff --git a/src/gui/official/sflphone.pro b/src/gui/official/sflphone.pro index fa78c870d0d8594fe0affa30cfdc0bcac020a3c7..ea2db1cf385b6b669a90c843eb86c2abd9467e37 100644 --- a/src/gui/official/sflphone.pro +++ b/src/gui/official/sflphone.pro @@ -104,6 +104,8 @@ HEADERS += Account.hpp \ Call.hpp \ CallStatus.hpp \ CallStatusFactory.hpp \ + ConfigurationPanel.hpp \ + ConfigurationPanelImpl.hpp \ DebugOutput.hpp \ DebugOutputImpl.hpp \ Event.hpp \ @@ -140,6 +142,7 @@ SOURCES += Account.cpp \ Call.cpp \ CallManagerImpl.cpp \ CallStatus.cpp \ + ConfigurationPanelImpl.cpp \ DebugOutputImpl.cpp \ Event.cpp \ JPushButton.cpp \