fun:_ZN7QDialog4execEv
fun:_ZN19QApplicationPrivate25maemo5ShowApplicationMenuEv
}
+{
+ Another_X11_Transwrite
+ Memcheck:Param
+ write(buf)
+ fun:__write_nocancel
+ fun:_X11TransWrite
+ obj:/targets/FREMANTLE_X86/usr/lib/libX11.so.6.2.0
+ fun:_XReply
+ fun:XGetWindowProperty
+ fun:XGetWMHints
+ fun:_ZN14QWidgetPrivate17setWindowIcon_sysEb
+ fun:_ZN7QWidget6createEmbb
+ fun:_ZN14QWidgetPrivate11createWinIdEm
+ fun:_ZNK7QWidget5winIdEv
+ obj:/targets/FREMANTLE_X86/opt/lib/libQtGui.so.4.6.2
+ obj:/targets/FREMANTLE_X86/opt/lib/libQtGui.so.4.6.2
+}
+{
+ Another_X11_Transwrite
+ Memcheck:Param
+ write(buf)
+ obj:/targets/FREMANTLE_X86/lib/libpthread-2.5.so
+ fun:_X11TransWrite
+ obj:/targets/FREMANTLE_X86/usr/lib/libX11.so.6.2.0
+ fun:_XFlush
+ fun:_XEventsQueued
+ fun:XEventsQueued
+ obj:/targets/FREMANTLE_X86/opt/lib/libQtGui.so.4.6.2
+ fun:g_main_context_dispatch
+ obj:/targets/FREMANTLE_X86/usr/lib/libglib-2.0.so.0.2000.3
+ fun:g_main_context_iteration
+ fun:_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE
+ obj:/targets/FREMANTLE_X86/opt/lib/libQtGui.so.4.6.2
+}
+
{
qDebug() << __PRETTY_FUNCTION__;
- createViews();
- setCentralWidget(m_situareViews);
+ m_mapViewScreen = new MapViewScreen(this);
+ setCentralWidget(m_mapViewScreen);
createMenus();
- setWindowTitle(tr("List view"));
- this->hide();
+ setWindowTitle(tr("Situare"));
+ hide();
m_locationDialog = new UpdateLocationDialog(this);
- connect(m_listViewScreen,SIGNAL(launchUpdateDialog()),
- this,SLOT(openLocationUpdateDialog()));
connect(this, SIGNAL(reverseGeoReady(QString)),
m_locationDialog, SLOT(setAddress(QString)));
connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
m_mapViewScreen, SLOT(friendsLocationsReady(QList<User*>&)));
- connect(this, SIGNAL(userLocationReady(User*)),
- m_listViewScreen, SLOT(userDataReceived(User*)));
- connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
- m_listViewScreen, SLOT(friendInfoReceived(QList<User*>&)));
- connect(m_listViewScreen, SIGNAL(updateFriendsData()),
- this, SIGNAL(refreshUserData()));
-
connect(this, SIGNAL(friendsLocationsReady(QList<User*>&)),
m_mapViewScreen, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)));
- this->toggleProgressIndicator(true);
-}
-
-MainWindow::~MainWindow()
-{
- qDebug() << __PRETTY_FUNCTION__;
- delete m_toListViewAct;
- delete m_toMapViewAct;
- delete m_toSettingsAct;
- delete m_situareViews;
+ toggleProgressIndicator(true);
}
void MainWindow::toggleProgressIndicator(bool value)
void MainWindow::createMenus()
{
qDebug() << __PRETTY_FUNCTION__;
- m_toListViewAct = new QAction(tr("List"), this);
- m_toListViewAct->setObjectName(tr("List"));
- connect(m_toListViewAct, SIGNAL(triggered()), this, SLOT(toListView()));
- m_toMapViewAct = new QAction(tr("Map"), this);
- m_toMapViewAct->setObjectName(tr("Map"));
- connect(m_toMapViewAct, SIGNAL(triggered()), this, SLOT(toMapView()));
m_toSettingsAct = new QAction(tr("Settings"), this);
m_toSettingsAct->setObjectName(tr("Settings"));
connect(m_toSettingsAct, SIGNAL(triggered()), this, SLOT(openSettingsDialog()));
- m_viewMenu = menuBar()->addMenu(tr("View"));
- m_viewMenu->addAction(m_toListViewAct);
- m_viewMenu->addAction(m_toMapViewAct);
- m_viewMenu->addAction(m_toSettingsAct);
- m_viewMenu->setObjectName(tr("View Menu"));
-}
-
-void MainWindow::createViews()
-{
- qDebug() << __PRETTY_FUNCTION__;
- m_listViewScreen = new ListViewScreen(this);
- m_mapViewScreen = new MapViewScreen(this);
-
- m_situareViews = new QStackedWidget;
- m_situareViews->addWidget(m_listViewScreen);
- m_situareViews->addWidget(m_mapViewScreen);
-}
-
-void MainWindow::toListView()
-{
- qDebug() << __PRETTY_FUNCTION__;
- switchView(0);
-}
+ m_viewMenu = menuBar()->addMenu(tr("Main"));
-void MainWindow::toMapView()
-{
- qDebug() << __PRETTY_FUNCTION__;
- switchView(1);
-}
-
-void MainWindow::switchView(int nextIndex)
-{
- qDebug() << __PRETTY_FUNCTION__ << ":" << nextIndex;
- if (nextIndex < 0 || nextIndex > 1) {
- qDebug() << "Illegal parameter value in MainWindow::switchView";
- return;
- }
- m_situareViews->setCurrentIndex(nextIndex);
- switch (m_situareViews->currentIndex()) {
- case 0:
- setWindowTitle(tr("List view"));
- break;
- case 1:
- setWindowTitle(tr("Map view"));
- break;
- default:
- qDebug() << "Illegal switch value in MainWindow::switchView";
- break;
- }
+ m_viewMenu->addAction(m_toSettingsAct);
+ m_viewMenu->setObjectName(tr("Menu"));
}
void MainWindow::openLocationUpdateDialog()
#include "facebookservice/facebookauthentication.h"
#include "situareservice/situareservice.h"
#include <QNetworkAccessManager>
-#include "listviewscreen.h"
#include "mapviewscreen.h"
#include "updatelocation/updatelocationdialog.h"
#include "ui/mainwindow.h"
class QLabel;
-class QStackedWidget;
/**
* @brief Main Window Class
*/
MainWindow(QWidget *parent = 0);
- /**
- * @brief Destructor
- */
- ~MainWindow();
-
/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
void openSettingsDialog();
/**
- * @brief Public slot, which initiates toListViewAct action to switch view
- */
- void toListView();
-
- /**
- * @brief Public slot, which initiates toMapViewAct action to switch view
- */
- void toMapView();
-
- /**
* @brief Toggle progress indicator.
*
* @param state true if progress indicator should be shown, false otherwise
*/
void createMenus();
- /**
- * @brief Private method to create List and Map views as a stacked widget
- */
- void createViews();
-
- /**
- * @brief Method used to switch active view.
- *
- * @param nextIndex 0 for listview, 1 for mapview
- */
- void switchView(int);
-
private slots:
/**
* @brief Private slot, which starts UpdateLocationDialog
* DATA MEMBERS
******************************************************************************/
private:
- ListViewScreen *m_listViewScreen; ///< Instance of the list view
UpdateLocationDialog *m_locationDialog; ///< Message dialog
MapViewScreen *m_mapViewScreen; ///< Instance of the map view
- QStackedWidget *m_situareViews; ///< Stacked widget that hold both view widgets
- QAction *m_toListViewAct; ///< Action to trigger switch to list view
- QAction *m_toMapViewAct; ///< Action to trigger switch to map view
QAction *m_toSettingsAct; ///< Action to trigger switch to settings dialog
QMenu *m_viewMenu; ///< Object that hold the view menu items
};