Main Window Class. More...
#include <mainwindow.h>
Public Slots | |
void | buildInformationBox (const QString &message, bool modal=false) |
Builds information box with message. | |
void | loginFailed () |
Slot for failed login. | |
void | loginUsingCookies () |
Slot to intercept signal when login with cookies is requested. | |
void | openSettingsDialog () |
Public slot, which open settings dialog. | |
void | setCrosshairVisibility (bool visible) |
Set own location crosshair visibility. | |
void | setUsername (const QString &username) |
Sets username to member variable for login dialog. | |
void | showContactDialog (const QString &guid) |
Shows contact dialog. | |
void | startLoginProcess () |
Public slot to intercept signal when old cerdentials are invalid or credentials doesn't exist yet. | |
void | toggleProgressIndicator (bool state) |
Toggle progress indicator. | |
void | updateItemVisibility () |
Shows / hides Situare related UI items. | |
Signals | |
void | autoCenteringTriggered (bool enabled) |
Automatic centering setting changed by user. | |
void | cancelLoginProcess () |
Signal that indicates when user has cancelled login process. | |
void | centerToCoordinates (const GeoCoordinate &coordinates) |
Signal for centering to coordinates. | |
void | centerToSceneCoordinates (const SceneCoordinate &coordinate) |
View should be centered to new location. | |
void | clearRoute () |
Emitted when route is cleared. | |
void | directionIndicatorValuesUpdate (qreal direction, qreal distance, bool draw) |
Signal when direction and distance from current map center point to current GPS location is changed. | |
void | enableAutomaticLocationUpdate (bool enabled, int updateIntervalMsecs=0) |
Signal for enabling automatic location update. | |
void | error (const int context, const int error) |
Signals error. | |
void | fetchUsernameFromSettings () |
Signal for requesting username from settings. | |
void | friendImageReady (User *user) |
Signals when friend's profile image is ready. | |
void | gpsTriggered (bool enabled) |
GPS setting changed. | |
void | friendsLocationsReady (QList< User * > &friendsList) |
Signal for friend location ready. | |
void | locationDataParsed (const QList< Location > &result) |
Emited when location request is parsed and is ready for further processing. | |
void | locationItemClicked (const QList< QString > &userIDs) |
Signal is emitted when location item is clicked on map. | |
void | locationItemClicked (const GeoCoordinate &swBound, const GeoCoordinate &neBound) |
Signal is emitted when location item is clicked in list. | |
void | loginActionPressed () |
Signals when Login/Logout action is pressed. | |
void | mapViewResized (const QSize &size) |
MapView has been resized. | |
void | mapViewScrolled (const SceneCoordinate &coordinate) |
Forwarding signal from MapView to MapEngine. | |
void | maxZoomLevelReached () |
Forwarding signal from MapEngine to MapView. | |
void | minZoomLevelReached () |
Forwarding signal from MapEngine to MapView. | |
void | newMapResolution (qreal scale) |
Forwarding signal from MapEngine to MapScale. | |
void | refreshUserData () |
Signal for refreshing user data. | |
void | requestContactDialog (const QString &facebookId) |
Requests contact dialog. | |
void | requestReverseGeo () |
Signal for requesting reverseGeo from SituareEngine. | |
void | reverseGeoReady (const QString &address) |
Signals, when address data is ready. | |
void | routeParsed (Route &route) |
Emited when route is parsed and is ready for further processing. | |
void | routeTo (const GeoCoordinate &coordinates) |
Signal for routing to geo coordinates. | |
void | routeToCursor () |
Request routing to current cursor position. | |
void | saveUsername (const QString &username) |
Signal to save username to settings. | |
void | searchForLocation (QString location) |
Signal for location search. | |
void | searchHistoryItemClicked (const QString &searchString) |
Signal is emitted when search history item is clicked. | |
void | statusUpdate (const QString &status, const bool &publish) |
Signal for requestLocationUpdate from SituareEngine. | |
void | updateCredentials (const QUrl &url) |
Signals when webview's urlChanged signal is emitted. | |
void | clearUpdateLocationDialogData () |
Signals when updateLocationDialog's data must be cleared. | |
void | draggingModeTriggered () |
Dragging mode triggered. | |
void | viewZoomFinished () |
MapView has finished zooming. | |
void | userLocationReady (User *user) |
Signal for use location ready. | |
void | zoomIn () |
Map zoom in request. | |
void | zoomLevelChanged (int zoomLevel) |
Forwarding signal from MapEngine to MapView. | |
void | zoomOut () |
Map zoom out request. | |
Public Member Functions | |
MainWindow (QWidget *parent=0) | |
Constructor. | |
~MainWindow () | |
Destructor. | |
void | clearCookieJar () |
Clears cookie jar. | |
void | loggedIn (bool logged) |
bool | loginState () |
Gets the login state (logged in/logged out). | |
void | readAutomaticLocationUpdateSettings () |
Reads automatic location update settings. | |
void | setGPSButtonEnabled (bool enabled) |
Enable / disable GPS button. | |
void | setIndicatorButtonEnabled (bool enabled) |
Enable / disable direction indicator button. | |
void | setMapViewScene (QGraphicsScene *scene) |
Set scene for MapView. | |
void | showEnableAutomaticUpdateLocationDialog (const QString &text) |
const QString | username () |
Gets the username from member variable for saving purposes. | |
Private Slots | |
void | automaticUpdateDialogFinished (int result) |
Slot for automatic update dialog finished. | |
void | dialogFinished (int status) |
Slot to intercept signal when dialog/information note is processed. | |
void | drawFullScreenButton (const QSize &size) |
Slot for drawing the fullscreen toggle button. | |
void | drawMapScale (const QSize &size) |
Slot for drawing the map distance scale. | |
void | drawOsmLicense (const QSize &size) |
Slot for drawing the Open Street Map license text. | |
void | errorDialogFinished (int status) |
Slot to intercept signal when error dialog/information note is processed. | |
void | gpsTimeout () |
Slot for gps timeout. | |
void | loadCookies () |
Slot to load cookies from settings. | |
void | loadDone (bool done) |
Slot to intercept signal when webview has finished loading webpage. | |
void | mapCenterHorizontalShiftingChanged (int shifting) |
Called when map center point horizontal shifting is changed. | |
void | moveCrosshair () |
Move the crosshair. | |
void | saveCookies () |
Slot to save cookies to settings. | |
void | settingsDialogAccepted () |
Slot for settings dialog accepted. | |
void | startLocationSearch () |
Start location search (open search dialog). | |
void | toggleFullScreen () |
Toggle between fullscreen and normal window mode. | |
void | webViewRequestFinished (QNetworkReply *reply) |
Slot to intercept signal from webview's networkaccessmanager. | |
Private Member Functions | |
void | keyPressEvent (QKeyEvent *event) |
HW increase and decrease key presses are grabbed and used for zooming the map. | |
void | buildCrosshair () |
Build manual location setting cross hair and connect slots. | |
void | buildFriendListPanel () |
Build friend list panel and connect slots. | |
void | buildFullScreenButton () |
Build fullscreen toggle button and connect slots. | |
void | buildIndicatorButtonPanel () |
Build direction indicator button panel and connect signals. | |
void | buildLocationSearchPanel () |
Build location search panel and connect signals. | |
void | buildMap () |
Build map and connect slots. | |
void | buildMapScale () |
Build map scale and connect slots. | |
void | buildOsmLicense () |
Build OSM license and connect slots. | |
void | buildPanels () |
Build application panels. | |
void | buildRoutingPanel () |
Build routing panel and connect slots. | |
void | buildUserInfoPanel () |
Build user info panel and connect slots. | |
void | buildWebView () |
Build webview and connect slots. | |
void | buildZoomButtonPanel () |
Build zoom button panel and connect slots. | |
void | createMenus () |
Private method to create the Menu items. | |
void | grabZoomKeys (bool grab) |
Grab or release HW increase and decrease buttons. | |
void | queueDialog (QDialog *dialog) |
Queues dialog/information box. | |
void | showErrorInformationBox () |
Shows queued error information box. | |
void | showInformationBox () |
Shows queued information box. | |
Private Attributes | |
bool | m_errorShown |
Indicates if error dialog/note is shown. | |
bool | m_loggedIn |
Indicates login state. | |
bool | m_refresh |
Indicates when webpage is refreshed. | |
int | m_mapCenterHorizontalShifting |
Amount of map center point horizontal shifting. | |
int | m_progressIndicatorCount |
Indicates the number of progress indicator calls. | |
QAction * | m_gpsToggleAct |
Action to trigger gps toggle. | |
QAction * | m_loginAct |
Action to Login/Logout. | |
QAction * | m_toSettingsAct |
Action to trigger switch to settings dialog. | |
QLabel * | m_crosshair |
Label for center point crosshair. | |
QLabel * | m_osmLicense |
Label for Open Street Map license. | |
QList< int > | m_situareTabsIndexes |
List of Situare tab indexes. | |
QList< QDialog * > | m_error_queue |
QList type error dialog queue. | |
QList< QDialog * > | m_queue |
QList type dialog queue. | |
QMenu * | m_viewMenu |
Object that hold the view menu items. | |
QMessageBox * | m_automaticUpdateLocationDialog |
Automatic update location dialog. | |
QString | m_email |
Placeholder for email. | |
QString | m_password |
Placeholder for password. | |
QWebView * | m_webView |
Shows facebook login page. | |
FriendListPanel * | m_friendsListPanel |
Instance of friends list panel. | |
FullScreenButton * | m_fullScreenButton |
Instance of the fullscreen toggle button. | |
IndicatorButtonPanel * | m_indicatorButtonPanel |
Instance of direction indicator button. | |
LocationSearchPanel * | m_locationSearchPanel |
Location search panel. | |
MapScale * | m_mapScale |
Instance of the map scale. | |
MapView * | m_mapView |
Instance of the map view. | |
NetworkCookieJar * | m_cookieJar |
Placeholder for QNetworkCookies. | |
RoutingPanel * | m_routingPanel |
Instance of routing panel. | |
TabbedPanel * | m_tabbedPanel |
Widget for tabbed panels. | |
UserInfoPanel * | m_userInfoPanel |
Instance of the user information panel. | |
ZoomButtonPanel * | m_zoomButtonPanel |
Instance of zoom button panel. |
Main Window Class.
MainWindow::MainWindow | ( | QWidget * | parent = 0 |
) |
void MainWindow::autoCenteringTriggered | ( | bool | enabled | ) | [signal] |
Automatic centering setting changed by user.
enabled | True if automatic centering is enabled, otherwise false |
void MainWindow::automaticUpdateDialogFinished | ( | int | result | ) | [private, slot] |
Slot for automatic update dialog finished.
void MainWindow::buildInformationBox | ( | const QString & | message, | |
bool | modal = false | |||
) | [slot] |
Builds information box with message.
message | Information message | |
modal | Modal = true, non-modal false |
void MainWindow::centerToCoordinates | ( | const GeoCoordinate & | coordinates | ) | [signal] |
Signal for centering to coordinates.
coordinates | geo coordinates to center to. |
void MainWindow::centerToSceneCoordinates | ( | const SceneCoordinate & | coordinate | ) | [signal] |
View should be centered to new location.
coordinate | Scene coordinates of the new center point |
void MainWindow::dialogFinished | ( | int | status | ) | [private, slot] |
Slot to intercept signal when dialog/information note is processed.
status | Status of the dialog |
void MainWindow::directionIndicatorValuesUpdate | ( | qreal | direction, | |
qreal | distance, | |||
bool | draw | |||
) | [signal] |
Signal when direction and distance from current map center point to current GPS location is changed.
direction | Direction in degrees | |
distance | Distance in meters | |
draw | Should the indicator triangle be drawn or not |
void MainWindow::drawFullScreenButton | ( | const QSize & | size | ) | [private, slot] |
Slot for drawing the fullscreen toggle button.
size | Size of the screen |
void MainWindow::drawMapScale | ( | const QSize & | size | ) | [private, slot] |
Slot for drawing the map distance scale.
size | Size of the screen |
void MainWindow::drawOsmLicense | ( | const QSize & | size | ) | [private, slot] |
Slot for drawing the Open Street Map license text.
size | Size of the screen |
void MainWindow::enableAutomaticLocationUpdate | ( | bool | enabled, | |
int | updateIntervalMsecs = 0 | |||
) | [signal] |
Signal for enabling automatic location update.
enabled | true if enabled, false otherwise | |
updateIntervalMsecs | update interval in milliseconds |
void MainWindow::error | ( | const int | context, | |
const int | error | |||
) | [signal] |
Signals error.
context | error context | |
error | error code |
void MainWindow::errorDialogFinished | ( | int | status | ) | [private, slot] |
Slot to intercept signal when error dialog/information note is processed.
status | Status of the dialog |
void MainWindow::friendImageReady | ( | User * | user | ) | [signal] |
Signals when friend's profile image is ready.
user | Friend |
void MainWindow::friendsLocationsReady | ( | QList< User * > & | friendsList | ) | [signal] |
Signal for friend location ready.
friendsList |
void MainWindow::gpsTimeout | ( | ) | [private, slot] |
Slot for gps timeout.
Called when request timeout occurs.
void MainWindow::gpsTriggered | ( | bool | enabled | ) | [signal] |
GPS setting changed.
enabled | True if GPS is enabled, otherwise false |
void MainWindow::grabZoomKeys | ( | bool | grab | ) | [private] |
Grab or release HW increase and decrease buttons.
grab | Use true for grabbing and false for releasing the keys |
void MainWindow::loadDone | ( | bool | done | ) | [private, slot] |
Slot to intercept signal when webview has finished loading webpage.
done | Status of the loading |
void MainWindow::locationDataParsed | ( | const QList< Location > & | result | ) | [signal] |
Emited when location request is parsed and is ready for further processing.
result | List of Location items |
void MainWindow::locationItemClicked | ( | const GeoCoordinate & | swBound, | |
const GeoCoordinate & | neBound | |||
) | [signal] |
Signal is emitted when location item is clicked in list.
swBound | south-west bound in GeoCoorinate | |
neBound | north-east bound in GeoCoordinate |
void MainWindow::locationItemClicked | ( | const QList< QString > & | userIDs | ) | [signal] |
Signal is emitted when location item is clicked on map.
userIDs | list of friends user IDs in the group |
void MainWindow::loggedIn | ( | bool | logged | ) |
logged |
bool MainWindow::loginState | ( | ) |
Gets the login state (logged in/logged out).
void MainWindow::mapCenterHorizontalShiftingChanged | ( | int | shifting | ) | [private, slot] |
Called when map center point horizontal shifting is changed.
shifting | New shifting value |
void MainWindow::mapViewResized | ( | const QSize & | size | ) | [signal] |
MapView has been resized.
size | view size |
void MainWindow::mapViewScrolled | ( | const SceneCoordinate & | coordinate | ) | [signal] |
void MainWindow::queueDialog | ( | QDialog * | dialog | ) | [private] |
Queues dialog/information box.
dialog | Dialog to be added into queue |
void MainWindow::requestContactDialog | ( | const QString & | facebookId | ) | [signal] |
Requests contact dialog.
facebookId | contact's facebookId |
void MainWindow::reverseGeoReady | ( | const QString & | address | ) | [signal] |
Signals, when address data is ready.
address | Street address |
void MainWindow::routeParsed | ( | Route & | route | ) | [signal] |
Emited when route is parsed and is ready for further processing.
route | Route item containing parsed route details |
void MainWindow::routeTo | ( | const GeoCoordinate & | coordinates | ) | [signal] |
Signal for routing to geo coordinates.
coordinates | destination geo coordinates |
void MainWindow::saveUsername | ( | const QString & | username | ) | [signal] |
Signal to save username to settings.
username | Username |
void MainWindow::searchForLocation | ( | QString | location | ) | [signal] |
Signal for location search.
location | QString location |
void MainWindow::searchHistoryItemClicked | ( | const QString & | searchString | ) | [signal] |
Signal is emitted when search history item is clicked.
searchString | search string used |
void MainWindow::setCrosshairVisibility | ( | bool | visible | ) | [slot] |
Set own location crosshair visibility.
visible |
void MainWindow::setGPSButtonEnabled | ( | bool | enabled | ) |
Enable / disable GPS button.
Does set visibilities for manual location cursor and auto centering menu button.
enabled | true if enabled, false otherwise |
void MainWindow::setIndicatorButtonEnabled | ( | bool | enabled | ) |
Enable / disable direction indicator button.
enabled | true if shoud be enabled, false otherwise |
void MainWindow::setMapViewScene | ( | QGraphicsScene * | scene | ) |
Set scene for MapView.
scene | Scene to be set |
void MainWindow::setUsername | ( | const QString & | username | ) | [slot] |
Sets username to member variable for login dialog.
username | Username to be set |
void MainWindow::showContactDialog | ( | const QString & | guid | ) | [slot] |
Shows contact dialog.
Shows contact dialog with contact's information.
guid | globally unique ID of a contact |
void MainWindow::showEnableAutomaticUpdateLocationDialog | ( | const QString & | text | ) |
Shows dialog with enable automatic location update question.
text | text to show in dialog |
void MainWindow::statusUpdate | ( | const QString & | status, | |
const bool & | publish | |||
) | [signal] |
Signal for requestLocationUpdate from SituareEngine.
status | Status message | |
publish | Publish on Facebook |
void MainWindow::toggleProgressIndicator | ( | bool | state | ) | [slot] |
Toggle progress indicator.
state | true if progress indicator should be shown, false otherwise |
void MainWindow::updateCredentials | ( | const QUrl & | url | ) | [signal] |
Signals when webview's urlChanged signal is emitted.
url | New url |
void MainWindow::userLocationReady | ( | User * | user | ) | [signal] |
Signal for use location ready.
user | User object |
const QString MainWindow::username | ( | ) |
Gets the username from member variable for saving purposes.
void MainWindow::webViewRequestFinished | ( | QNetworkReply * | reply | ) | [private, slot] |
Slot to intercept signal from webview's networkaccessmanager.
reply | Network reply (contains errors) |