author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 09:49:03 +0300 | |
changeset 41 | 3a6b55c6390c |
parent 33 | 11b6825f0862 |
child 48 | e14766a36cdc |
permissions | -rw-r--r-- |
24 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <QTimer> |
|
20 |
#include <HbDeviceMessageBox> |
|
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
21 |
#include <xqsettingsmanager.h> |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
22 |
#include <xqsettingskey.h> |
33
11b6825f0862
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
23 |
#include <xqserviceutil.h> |
11b6825f0862
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
24 |
#include <HbSplashScreen> |
24 | 25 |
|
26 |
// User includes |
|
27 |
#include "radioapplication.h" |
|
28 |
#include "radiowindow.h" |
|
29 |
#include "radiouiengine.h" |
|
30 |
#include "radio_global.h" |
|
31 |
#include "radiologger.h" |
|
32 |
||
33 |
#ifdef BUILD_WIN32 |
|
34 |
# include "testwindow_win32.h" |
|
35 |
# define CREATE_WIN32_TEST_WINDOW \ |
|
36 |
mWin32Window.reset( new Win32Window() ); \ |
|
37 |
mMainWindow->setParent( mWin32Window.data() ); \ |
|
38 |
mWin32Window->addHbWindow( mMainWindow.data() ); \ |
|
39 |
mWin32Window->show(); |
|
40 |
# define INIT_WIN32_TEST_WINDOW \ |
|
41 |
mWin32Window->init(); |
|
42 |
#else |
|
43 |
# define CREATE_WIN32_TEST_WINDOW |
|
44 |
# define INIT_WIN32_TEST_WINDOW |
|
45 |
#endif // BUILD_WIN32 |
|
46 |
||
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
47 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
48 |
static XQSettingsKey gConnectionKey( XQSettingsKey::TargetCentralRepository, CENREP_CORE_APPLICATION_UIS, ID_NETWORK_CONNECTION_ALLOWED ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
49 |
|
24 | 50 |
/*! |
51 |
* Constructor |
|
52 |
*/ |
|
53 |
RadioApplication::RadioApplication( int &argc, char *argv[] ) : |
|
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
54 |
HbApplication( argc, argv, Hb::NoSplash ), |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
55 |
mSettingsManager( new XQSettingsManager( this ) ) |
24 | 56 |
{ |
57 |
// Initializes the radio engine utils if UI logs are entered into the engine log |
|
58 |
INIT_COMBINED_LOGGER |
|
59 |
||
60 |
LOG_TIMESTAMP( "Start radio" ); |
|
61 |
setApplicationName( hbTrId( "txt_rad_title_fm_radio" ) ); |
|
62 |
||
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
63 |
if ( XQServiceUtil::isService() ) { |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
64 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
65 |
// Radio was started as a highway service from homescreen widget. |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
66 |
// Widget has already done the offline mode check so we can start without checking |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
67 |
init(); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
68 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
69 |
} else { |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
70 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
71 |
if ( isInOfflineMode() ) { |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
72 |
askOfflineModePermission( hbTrId( "txt_rad_info_activate_radio_in_offline_mode" ) ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
73 |
} else { |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
74 |
init(); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
75 |
} |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
76 |
|
33
11b6825f0862
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
32
diff
changeset
|
77 |
} |
24 | 78 |
} |
79 |
||
80 |
/*! |
|
81 |
* |
|
82 |
*/ |
|
83 |
RadioApplication::~RadioApplication() |
|
84 |
{ |
|
85 |
// Destructor needs to be defined. See explanation from RadioEngineWrapperPrivate destructor. |
|
86 |
// Releases the radio engine utils if it was initialized in the beginning |
|
87 |
RELEASE_COMBINED_LOGGER |
|
88 |
} |
|
89 |
||
90 |
/*! |
|
32
189d20c34778
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
91 |
* Private slot |
24 | 92 |
* |
93 |
*/ |
|
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
94 |
void RadioApplication::checkOfflineMode() |
24 | 95 |
{ |
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
96 |
if ( isInOfflineMode() ) { |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
97 |
askOfflineModePermission( hbTrId( "txt_rad_info_continue_using_the_radio_in_offline" ) ); |
24 | 98 |
} |
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
99 |
} |
24 | 100 |
|
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
101 |
/*! |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
102 |
* Private slot |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
103 |
* |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
104 |
*/ |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
105 |
void RadioApplication::handleOfflineQueryAnswer() |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
106 |
{ |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
107 |
HbDeviceMessageBox* box = static_cast<HbDeviceMessageBox*>( sender() ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
108 |
box->deleteLater(); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
109 |
if ( box->isAcceptAction( box->triggeredAction() ) ) { |
24 | 110 |
|
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
111 |
// If main window has not been created yet it means the offline question was asked during startup |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
112 |
// so we must continue with the startup sequence. If the main window was already created it means |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
113 |
// the question was asked when the radio was already running and the offline mode was activated. |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
114 |
// In that case there is no need to do anything since the user wants to continue listening to radio. |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
115 |
if ( !mMainWindow ) { |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
116 |
init(); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
117 |
} |
24 | 118 |
|
119 |
} else { |
|
120 |
quit(); |
|
121 |
} |
|
122 |
} |
|
41
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
123 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
124 |
/*! |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
125 |
* |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
126 |
*/ |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
127 |
void RadioApplication::init() |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
128 |
{ |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
129 |
// Try to optimize startup time by launching the radio server process as soon as possible. |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
130 |
// This way the server and UI are being initialized at the same time and the startup is faster. |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
131 |
// RadioUiEngine::launchRadioServer(); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
132 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
133 |
// Splash screen needs to be shown when not started by homescreen widget |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
134 |
if ( !XQServiceUtil::isService() ) { |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
135 |
HbSplashScreen::setAppId( "fmradio" ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
136 |
HbSplashScreen::start(); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
137 |
} |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
138 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
139 |
Radio::connect( mSettingsManager, SIGNAL(valueChanged(XQSettingsKey,QVariant)), |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
140 |
this, SLOT(checkOfflineMode()) ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
141 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
142 |
bool monitoringStarted = mSettingsManager->startMonitoring( gConnectionKey ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
143 |
LOG_ASSERT( monitoringStarted, LOG( "Failed to start monitoring Offline mode!" ) ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
144 |
Q_UNUSED( monitoringStarted ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
145 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
146 |
mMainWindow.reset( new RadioWindow() ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
147 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
148 |
CREATE_WIN32_TEST_WINDOW |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
149 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
150 |
INIT_WIN32_TEST_WINDOW |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
151 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
152 |
// Construct the real views |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
153 |
mMainWindow->init(); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
154 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
155 |
mMainWindow->show(); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
156 |
} |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
157 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
158 |
/*! |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
159 |
* |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
160 |
*/ |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
161 |
bool RadioApplication::isInOfflineMode() const |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
162 |
{ |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
163 |
const QVariant connectionAllowed = mSettingsManager->readItemValue( gConnectionKey ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
164 |
if ( connectionAllowed.canConvert( QVariant::Int ) && connectionAllowed.toInt() == NetworkNotAllowed ) { |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
165 |
return true; |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
166 |
} |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
167 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
168 |
return false; |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
169 |
} |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
170 |
|
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
171 |
/*! |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
172 |
* |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
173 |
*/ |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
174 |
void RadioApplication::askOfflineModePermission( const QString& question ) |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
175 |
{ |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
176 |
HbDeviceMessageBox* box = new HbDeviceMessageBox( question, HbMessageBox::MessageTypeQuestion, this ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
177 |
box->setStandardButtons( HbMessageBox::Yes | HbMessageBox::No ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
178 |
box->setTimeout( HbPopup::NoTimeout ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
179 |
box->setDismissPolicy( HbPopup::NoDismiss ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
180 |
Radio::connect( box, SIGNAL(aboutToClose()), |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
181 |
this, SLOT(handleOfflineQueryAnswer()) ); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
182 |
box->show(); |
3a6b55c6390c
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
183 |
} |