From: Kaj Wallin Date: Tue, 11 May 2010 08:03:05 +0000 (+0300) Subject: Removed list view from the Mainwindow X-Git-Tag: v0.4~39^2~1 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=4be20214972de23f74c67a6712b63551f440a3ac;p=situare Removed list view from the Mainwindow Reviewed by: --- diff --git a/situare.supp b/situare.supp index 0596c64..57057fa 100644 --- a/situare.supp +++ b/situare.supp @@ -623,4 +623,39 @@ 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 +} + diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 5456037..b4bfcdc 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -34,15 +34,13 @@ MainWindow::MainWindow(QWidget *parent) { 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))); @@ -54,26 +52,10 @@ MainWindow::MainWindow(QWidget *parent) connect(this, SIGNAL(friendsLocationsReady(QList&)), m_mapViewScreen, SLOT(friendsLocationsReady(QList&))); - connect(this, SIGNAL(userLocationReady(User*)), - m_listViewScreen, SLOT(userDataReceived(User*))); - connect(this, SIGNAL(friendsLocationsReady(QList&)), - m_listViewScreen, SLOT(friendInfoReceived(QList&))); - connect(m_listViewScreen, SIGNAL(updateFriendsData()), - this, SIGNAL(refreshUserData())); - connect(this, SIGNAL(friendsLocationsReady(QList&)), m_mapViewScreen, SIGNAL(SIG_friendsLocationsReady(QList&))); - 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) @@ -89,64 +71,13 @@ 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() diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h index 61565cb..d30921b 100644 --- a/src/ui/mainwindow.h +++ b/src/ui/mainwindow.h @@ -31,13 +31,11 @@ #include "facebookservice/facebookauthentication.h" #include "situareservice/situareservice.h" #include -#include "listviewscreen.h" #include "mapviewscreen.h" #include "updatelocation/updatelocationdialog.h" #include "ui/mainwindow.h" class QLabel; -class QStackedWidget; /** * @brief Main Window Class @@ -56,11 +54,6 @@ public: */ MainWindow(QWidget *parent = 0); - /** - * @brief Destructor - */ - ~MainWindow(); - /******************************************************************************* * MEMBER FUNCTIONS AND SLOTS ******************************************************************************/ @@ -71,16 +64,6 @@ public 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 @@ -93,18 +76,6 @@ private: */ 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 @@ -161,12 +132,8 @@ signals: * 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 };