35 #include "radioapplication.h" |
35 #include "radioapplication.h" |
36 #include "radiologger.h" |
36 #include "radiologger.h" |
37 #include "radio_global.h" |
37 #include "radio_global.h" |
38 #include "radioenginewrapper_win32_p.h" |
38 #include "radioenginewrapper_win32_p.h" |
39 |
39 |
40 const int KWindowWidth = 360; |
40 const int WINDOW_WIDTH = 360; |
41 const int KWindowHeight = 640; |
41 const int WINDOW_HEIGHT = 640; |
42 const int KToolbarHeight = 140; |
42 const int TOOLBAR_HEIGHT = 120; |
|
43 const int WINDOW_EXTRA_WIDTH = 5; |
43 |
44 |
44 const QString KBtnDisconnectHeadset = "Disconnect Headset"; |
45 const QString KBtnDisconnectHeadset = "Disconnect Headset"; |
45 const QString KBtnConnectHeadset = "Connect Headset"; |
46 const QString KBtnConnectHeadset = "Connect Headset"; |
46 |
47 |
47 const QString KBtnGoOffline = "Go Offline"; |
48 const QString KBtnGoOffline = "Go Offline"; |
85 mSongIndex( 0 ) |
86 mSongIndex( 0 ) |
86 { |
87 { |
87 mThemeBox->setEditable( false ); |
88 mThemeBox->setEditable( false ); |
88 initThemes(); |
89 initThemes(); |
89 |
90 |
90 connectAndTest( mOrientationButton, SIGNAL(clicked()), this, SLOT(changeOrientation()) ); |
91 Radio::connect( mOrientationButton, SIGNAL(clicked()), this, SLOT(changeOrientation()) ); |
91 connectAndTest( mVolUpButton, SIGNAL(clicked()), this, SLOT(volumeUp()) ); |
92 Radio::connect( mVolUpButton, SIGNAL(clicked()), this, SLOT(volumeUp()) ); |
92 connectAndTest( mVolDownButton, SIGNAL(clicked()), this, SLOT(volumeDown()) ); |
93 Radio::connect( mVolDownButton, SIGNAL(clicked()), this, SLOT(volumeDown()) ); |
93 connectAndTest( mHeadsetButton, SIGNAL(clicked()), this, SLOT(toggleHeadsetStatus()) ); |
94 Radio::connect( mHeadsetButton, SIGNAL(clicked()), this, SLOT(toggleHeadsetStatus()) ); |
94 connectAndTest( mAddSongButton, SIGNAL(clicked()), this, SLOT(addSong()) ); |
95 Radio::connect( mAddSongButton, SIGNAL(clicked()), this, SLOT(addSong()) ); |
95 connectAndTest( mClearSongButton, SIGNAL(clicked()), this, SLOT(clearSong()) ); |
96 Radio::connect( mClearSongButton, SIGNAL(clicked()), this, SLOT(clearSong()) ); |
96 connectAndTest( mOfflineButton, SIGNAL(clicked()), this, SLOT(toggleOffline()) ); |
97 Radio::connect( mOfflineButton, SIGNAL(clicked()), this, SLOT(toggleOffline()) ); |
97 connectAndTest( mThemeBox, SIGNAL(activated(QString)), this, SLOT(changeTheme(QString)) ); |
98 Radio::connect( mThemeBox, SIGNAL(activated(QString)), this, SLOT(changeTheme(QString)) ); |
98 |
99 |
99 QTimer::singleShot( 0, this, SLOT(updateWindowSize()) ); |
100 QTimer::singleShot( 0, this, SLOT(updateWindowSize()) ); |
100 } |
101 } |
101 |
102 |
102 /*! |
103 /*! |
221 * Private slot |
222 * Private slot |
222 */ |
223 */ |
223 void Win32Window::updateWindowSize() |
224 void Win32Window::updateWindowSize() |
224 { |
225 { |
225 if ( mOrientation == Qt::Horizontal ) { |
226 if ( mOrientation == Qt::Horizontal ) { |
226 resize( KWindowHeight, KWindowWidth + KToolbarHeight ); |
227 resize( WINDOW_HEIGHT + WINDOW_EXTRA_WIDTH, WINDOW_WIDTH + TOOLBAR_HEIGHT ); |
227 } else { |
228 } else { |
228 resize( KWindowWidth, KWindowHeight + KToolbarHeight ); |
229 resize( WINDOW_WIDTH + WINDOW_EXTRA_WIDTH, WINDOW_HEIGHT + TOOLBAR_HEIGHT ); |
229 } |
230 } |
230 } |
231 } |
231 |
232 |
232 /*! |
233 /*! |
233 * Private slot |
234 * Private slot |
265 /*! |
266 /*! |
266 * Private slot |
267 * Private slot |
267 */ |
268 */ |
268 void Win32Window::changeTheme( const QString& theme ) |
269 void Win32Window::changeTheme( const QString& theme ) |
269 { |
270 { |
|
271 LOG_FORMAT( "Changing to theme %s", GETSTRING( theme ) ); |
270 QLocalSocket socket; |
272 QLocalSocket socket; |
271 socket.connectToServer( "hbthemeserver" ); |
273 socket.connectToServer( "hbthemeserver" ); |
272 if ( socket.waitForConnected( 3000 ) ) { |
274 if ( socket.waitForConnected( 3000 ) ) { |
273 QByteArray outputByteArray; |
275 QByteArray outputByteArray; |
274 QDataStream outputDataStream( &outputByteArray, QIODevice::WriteOnly ); |
276 QDataStream outputDataStream( &outputByteArray, QIODevice::WriteOnly ); |