diff --git a/src/gui/official/Event.cpp b/src/gui/official/Event.cpp index c3721cdcb4161a576b43702b0fe3f5875faf2b60..84ad65d6ba3a5c436d952063e86b7063b946065e 100644 --- a/src/gui/official/Event.cpp +++ b/src/gui/official/Event.cpp @@ -14,7 +14,7 @@ Event::Event(const QString &code, void Event::execute() { - _debug("Received: %s\n", toString().toStdString().c_str()); + _debug("Event: Received: %s\n", toString().toStdString().c_str()); } QString @@ -24,6 +24,7 @@ Event::toString() for(std::list< QString >::iterator pos = mArgs.begin(); pos != mArgs.end(); pos++) { + output += " "; output += *pos; } diff --git a/src/gui/official/EventFactory.hpp b/src/gui/official/EventFactory.hpp index 6ef8706990440eaa3b1315db2a790eef594205ad..97f584044f60738389810b1a3d2b53b914f0ddbc 100644 --- a/src/gui/official/EventFactory.hpp +++ b/src/gui/official/EventFactory.hpp @@ -66,6 +66,8 @@ template< typename Base > class EventFactoryImpl { public: + EventFactoryImpl(); + /** * Ask for a new object linked to the string. */ @@ -76,10 +78,14 @@ public: * Register the string to return a Actual type. */ template< typename Actual > - void registerEvent(const QString &code); + void registerEvent(const QString &code); + + template< typename Actual > + void registerDefaultEvent(); private: std::map< QString, EventCreatorBase< Base > * > mEventCreators; + EventCreatorBase< Base > *mDefaultCreator; }; #include "EventFactory.inl" diff --git a/src/gui/official/EventFactory.inl b/src/gui/official/EventFactory.inl index 42ec63821f0b4b6a1db7d50adabb28c6dd882246..90dc8a4ba7fbe9308c2c2ab6b1584b65e9085bad 100644 --- a/src/gui/official/EventFactory.inl +++ b/src/gui/official/EventFactory.inl @@ -40,6 +40,11 @@ EventCreator< Base, Actual >::clone() return new EventCreator< Base, Actual >(); } +template< typename Base > +EventFactoryImpl< Base >::EventFactoryImpl() + : mDefaultCreator(NULL) +{} + template< typename Base > Base * EventFactoryImpl< Base >::create(const QString &code, @@ -47,7 +52,14 @@ EventFactoryImpl< Base >::create(const QString &code, { typename std::map< QString, EventCreatorBase< Base > * >::iterator pos = mEventCreators.find(code); if(pos == mEventCreators.end()) { - _debug("The code %s has no creator registered.", code.toStdString().c_str()); + if(mDefaultCreator) { + return mDefaultCreator->create(code, args); + } + else{ + throw std::logic_error(QString("The code %s has no creator registered " + "and there's no default creator" + ).arg(code).toStdString().c_str()); + } } return pos->second->create(code, args); @@ -65,6 +77,18 @@ EventFactoryImpl< Base >::registerEvent(const QString &code) mEventCreators[code] = new EventCreator< Base, Actual >(); } +template< typename Base > +template< typename Actual > +void +EventFactoryImpl< Base >::registerDefaultEvent() +{ + if(mDefaultCreator) { + delete mDefaultCreator; + } + + mDefaultCreator = new EventCreator< Base, Actual >(); +} + #endif diff --git a/src/gui/official/PhoneLineManagerImpl.cpp b/src/gui/official/PhoneLineManagerImpl.cpp index f7189827a410c6cdb843184ea3e7616a9c6645ff..010adfdd4855ca5937786972a427266a84d33b23 100644 --- a/src/gui/official/PhoneLineManagerImpl.cpp +++ b/src/gui/official/PhoneLineManagerImpl.cpp @@ -17,6 +17,7 @@ PhoneLineManagerImpl::PhoneLineManagerImpl() , mCurrentLine(NULL) , mIsInitialized(false) { + EventFactory::instance().registerDefaultEvent< DefaultEvent >(); // TODO: 000 EventFactory::instance().registerEvent< CallRelatedEvent >("000"); EventFactory::instance().registerEvent< IncommingEvent >("001"); diff --git a/src/gui/official/PhoneLineManagerImpl.hpp b/src/gui/official/PhoneLineManagerImpl.hpp index 9b927b153c5956958cd8be7fa5d98921e2e0b490..e34073a281dfe01c08e4e76146ae33537cc836d7 100644 --- a/src/gui/official/PhoneLineManagerImpl.hpp +++ b/src/gui/official/PhoneLineManagerImpl.hpp @@ -94,21 +94,18 @@ public slots: void hangup(); /** - * This function will mute the current line if muting + * This function will mute the microphone if muting * is true, it will unmute otherwise. - * If there's no current line, it will do nothing. */ void mute(bool); /** - * This function will mute the current line - * If there's no current line, it will do nothing. + * This function will mute the microphone */ void mute(); /** - * This function will unmute the current line - * If there's no current line, it will do nothing. + * This function will unmute the microphone */ void unmute(); diff --git a/src/gui/official/RequesterImpl.cpp b/src/gui/official/RequesterImpl.cpp index 26e3744cbe992768ff5631ab043b3c3cb207f23e..08666010f8a5a8f5bee787c714002254d147774f 100644 --- a/src/gui/official/RequesterImpl.cpp +++ b/src/gui/official/RequesterImpl.cpp @@ -133,7 +133,7 @@ RequesterImpl::receiveAnswer(const QString &code, std::map< QString, Request * >::iterator pos; pos = mRequests.find(sequence); if(pos == mRequests.end()) { - std::cerr << "We received an answer with an unknown sequence" << std::endl; + _debug("Requester: We received an answer with an unknown sequence.\n"); return; } @@ -189,7 +189,8 @@ RequesterImpl::inputIsDown(const QString &sessionId) if(pos == mSessions.end()) { // we will not thow an exception, but this is // a logic error - _debug("SessionIO input for session %s is down, but we don't have that session.\n", + _debug("Requester: SessionIO input for session %s is down, " + "but we don't have that session.\n", sessionId.toStdString().c_str()); } } diff --git a/src/gui/official/SFLEvents.cpp b/src/gui/official/SFLEvents.cpp index 7710e02eb6c8043000c26fcfb9476fd47ab862e0..f2a3e24c8d0b938e3e9cd068310ac4b52bec1087 100644 --- a/src/gui/official/SFLEvents.cpp +++ b/src/gui/official/SFLEvents.cpp @@ -3,6 +3,19 @@ #include "PhoneLineManager.hpp" #include "SFLEvents.hpp" +DefaultEvent::DefaultEvent(const QString &code, + const std::list< QString > &args) + : Event(code, args) +{ +} + +void +DefaultEvent::execute() +{ + _debug("DefaultEvent: We don't handle: %s\n", toString().toStdString().c_str()); +} + + HangupEvent::HangupEvent(const QString &code, const std::list< QString > &args) : CallRelatedEvent(code, args) diff --git a/src/gui/official/SFLEvents.hpp b/src/gui/official/SFLEvents.hpp index 3042f83ab37ddfb0ee3138a7783d2c7033b50e42..0440810b6f2d86aec87f7bccf04443df8602d36e 100644 --- a/src/gui/official/SFLEvents.hpp +++ b/src/gui/official/SFLEvents.hpp @@ -23,6 +23,15 @@ #include "Event.hpp" +class DefaultEvent : public Event +{ +public: + DefaultEvent(const QString &code, + const std::list< QString > &args); + + virtual void execute(); +}; + class HangupEvent : public CallRelatedEvent { public: diff --git a/src/gui/official/SFLPhoneWindow.cpp b/src/gui/official/SFLPhoneWindow.cpp index b1e84f72faa29810e87898a09bfd718e8df2fddd..b0cf8aaa1c0fa20d0d3c2116b7a7a9592fda05b0 100644 --- a/src/gui/official/SFLPhoneWindow.cpp +++ b/src/gui/official/SFLPhoneWindow.cpp @@ -127,7 +127,7 @@ void SFLPhoneWindow::initWindowButtons() mMain); QObject::connect(mMinimizeButton, SIGNAL(clicked()), this, SLOT(lower())); - mMinimizeButton->move(354,5); + mMinimizeButton->move(353,5); } void diff --git a/src/gui/official/VolumeControl.hpp b/src/gui/official/VolumeControl.hpp index e26c86d9e51db2fbd7fedca6383aae550c94bca0..0ca082afc68e5ce9ef47b9873f2987635bf29179 100644 --- a/src/gui/official/VolumeControl.hpp +++ b/src/gui/official/VolumeControl.hpp @@ -1,6 +1,7 @@ /** * Copyright (C) 2004-2005 Savoir-Faire Linux inc. - * Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> + * 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 diff --git a/src/gui/official/images/close_off.png b/src/gui/official/images/close_off.png index 5d02e8bf5c76f86b5c449ac831cb7087da8ef80f..e962b31b1630f1cfababa9f153fd97d7ee56058f 100644 Binary files a/src/gui/official/images/close_off.png and b/src/gui/official/images/close_off.png differ diff --git a/src/gui/official/images/close_on.png b/src/gui/official/images/close_on.png index 356e01269920009f2a1a672765feb140028fef41..747c7fb09c461bef92cb4fdf9af9cc03fa7e9731 100644 Binary files a/src/gui/official/images/close_on.png and b/src/gui/official/images/close_on.png differ diff --git a/src/gui/official/images/main.png b/src/gui/official/images/main.png index f3de2e4f7b995e8e6fa13cdf3034e0225933c708..ddf434171b5f5b93f31616615a603bbb593b4475 100644 Binary files a/src/gui/official/images/main.png and b/src/gui/official/images/main.png differ diff --git a/src/gui/official/images/minimize_off.png b/src/gui/official/images/minimize_off.png index 29c69f08126b2e253008c33335aad15a2316ec28..ad531e82f19c89cce2944b8943571cffc4788067 100644 Binary files a/src/gui/official/images/minimize_off.png and b/src/gui/official/images/minimize_off.png differ diff --git a/src/gui/official/images/minimize_on.png b/src/gui/official/images/minimize_on.png index a494cf2ccc9edd191009613f2babdb3f74b68166..20bb4e175433a92bef6c12cac6ac849e574e4229 100644 Binary files a/src/gui/official/images/minimize_on.png and b/src/gui/official/images/minimize_on.png differ