From 3f7ebe2f161b0d18f55d547b530f5a999488e03f Mon Sep 17 00:00:00 2001 From: Janos Kovacs Date: Mon, 28 Jun 2010 14:08:00 +0300 Subject: merging with the swp.plcy-357-harmattan branch --- resourceqt-client/client.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'resourceqt-client/client.cpp') diff --git a/resourceqt-client/client.cpp b/resourceqt-client/client.cpp index 46fd8c9..5f1875b 100644 --- a/resourceqt-client/client.cpp +++ b/resourceqt-client/client.cpp @@ -52,6 +52,7 @@ uint32_t Client::parseResourceList(QString resourceListStr) { RES_SCALE_BUTTON , "ScaleButton" }, { RES_SNAP_BUTTON , "SnapButton" }, { RES_LENS_COVER , "LensCover" }, + { RES_HEADSET_BUTTONS, "HeadsetButtons" }, { 0 , NULL } }; @@ -96,7 +97,7 @@ void Client::updateSet(uint32_t list, uint32_t optional, bool remove) uint32_t resources[] = { RES_AUDIO_PLAYBACK, RES_VIDEO_PLAYBACK, RES_AUDIO_RECORDING, RES_VIDEO_RECORDING, RES_VIBRA, RES_LEDS, RES_BACKLIGHT, RES_SYSTEM_BUTTON, RES_LOCK_BUTTON, - RES_SCALE_BUTTON, RES_SNAP_BUTTON, RES_LENS_COVER, 0 + RES_SCALE_BUTTON, RES_SNAP_BUTTON, RES_LENS_COVER, RES_HEADSET_BUTTONS, 0 }; int pos = 0; @@ -174,6 +175,9 @@ bool Client::initialize(uint32_t all, uint32_t optional, bool alwaysReply, bool } connect(resourceSet, SIGNAL(resourcesReleased()), this, SLOT(resourceReleasedHandler())); + connect(resourceSet, SIGNAL(resourcesBecameAvailable(const QList &)), + this, SLOT(resourcesBecameAvailableHandler(const QList &))); + showPrompt(); return true; @@ -220,6 +224,9 @@ Resource* Client::allocateResource(ResourceType resource, bool optional) case LensCoverType: retValue = new LensCoverResource(); break; + case HeadsetButtonsType: + retValue = new HeadsetButtonsResource(); + break; case NumberOfTypes: return NULL; } @@ -261,6 +268,8 @@ ResourceType Client::getResourceType(uint32_t resource) return SnapButtonType; case RES_LENS_COVER: return LensCoverType; + case RES_HEADSET_BUTTONS: + return HeadsetButtonsType; } return NumberOfTypes; @@ -271,7 +280,7 @@ void Client::showResources(const QList resList) const char* resTypes[] = { "AudioPlayback", "VideoPlayback", "AudioRecorder", "VideoRecorder", "Vibra", "Leds", "Backlight", "SystemButton", "LockButton", "ScaleButton", "SnapButton", - "LensCover" + "LensCover", "HeadsetButtons" }; for (int i = 0; i < resList.count(); i++) { @@ -284,7 +293,7 @@ void Client::showResources(const QList resList) const char* resTypes[] = { "AudioPlayback", "VideoPlayback", "AudioRecorder", "VideoRecorder", "Vibra", "Leds", "Backlight", "SystemButton", "LockButton", "ScaleButton", "SnapButton", - "LensCover" + "LensCover", "HeadsetButtons" }; for (int i = 0; i < resList.count(); i++) { @@ -343,6 +352,14 @@ void Client::resourceReleasedHandler() showPrompt(); } +void Client::resourcesBecameAvailableHandler(const QList &availableResources) +{ + printf("\nManager advice: These resources are available:\n"); + printf("Resource set:\n"); + showResources(availableResources); + showPrompt(); +} + void Client::timerEvent(QTimerEvent*) { bool quitFlag = false; @@ -530,3 +547,4 @@ void Client::timerEvent(QTimerEvent*) } } } + -- cgit v1.2.3