Merged and resolved conflict
authorKaj Wallin <kaj.wallin@ixonos.com>
Mon, 19 Apr 2010 12:55:48 +0000 (15:55 +0300)
committerKaj Wallin <kaj.wallin@ixonos.com>
Mon, 19 Apr 2010 12:55:48 +0000 (15:55 +0300)
Merge branch 'lampehe' into wallika-own

Conflicts:
src/src.pro

1  2 
src/main.cpp
src/src.pro
src/ui/mainwindow.cpp
src/ui/mainwindow.h

diff --cc src/main.cpp
@@@ -26,7 -26,6 +26,6 @@@ int main(int argc, char *argv[]
  {
      QApplication a(argc, argv);
      MainWindow w;
--    w.show();
 -    return a.exec();
 +    int appRet = a.exec();
 +    return appRet;
  }
diff --cc src/src.pro
@@@ -28,8 -30,12 +32,14 @@@ HEADERS += ui/mainwindow.h 
      common.h \
      ui/pixmap.h \
      ui/infotab.h \
 +    ui/updatelocation/updatelocationdialog.h \
-     ui/updatelocation/texteditautoresizer.h
++    ui/updatelocation/texteditautoresizer.h \
+     situareservice/situareservice.h \
+     situareservice/situarecommon.h \
+     cookiehandler/cookiehandler.h \
+     facebookservice/facebookcredentials.h \
+     facebookservice/facebookauthentication.h \
+     facebookservice/facebookcommon.h
  QT += network \
      webkit
  
  #include "mainwindow.h"
  #include "listviewscreen.h"
  #include "mapviewscreen.h"
- //#include "facebookservice/facebookauthentication.h"
++#include "facebookservice/facebookauthentication.h"
++#include "situareservice/situareservice.h"
  
  MainWindow::MainWindow(QWidget *parent)
      : QMainWindow(parent)
  {
      qDebug() << __PRETTY_FUNCTION__;
 +    m_loggedIn = false;
      createViews();
 -    setCentralWidget(situareViews);
 +    setCentralWidget(m_situareViews);
      createMenus();
 -    setWindowTitle(tr("View"));
 +    setWindowTitle(tr("List view"));
-     this->show();
++    this->hide();
 +
- /*
 +    FBAuth = new FacebookAuthentication(this);
 +    FBAuth->show();
 +    FBAuth->start();
 +
++    m_networkManager = new QNetworkAccessManager;
++    m_situareService = new SituareService(this,m_networkManager);
++
 +    connect(FBAuth, SIGNAL(credentialsReady()), this, SLOT(loginOK()));
 +    connect(FBAuth, SIGNAL(userExit()), this, SLOT(loginScreenClosed()));
- */
- /*
-     connect(this,SIGNAL(testLoginClosed()), this, SLOT(loginScreenClosed()));
- */
  }
  
  MainWindow::~MainWindow()
  void MainWindow::createMenus()
  {
      qDebug() << __PRETTY_FUNCTION__;
 -    toListViewAct = new QAction(tr("List"), this);
 -    connect(toListViewAct, SIGNAL(triggered()), this, SLOT(toListView()));
 -    toMapViewAct = new QAction(tr("Map"), this);
 -    connect(toMapViewAct, SIGNAL(triggered()), this, SLOT(toMapView()));
 -    viewMenu = menuBar()->addMenu(tr("View"));
 -    viewMenu->addAction(toListViewAct);
 -    viewMenu->addAction(toMapViewAct);
 +    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_viewMenu = menuBar()->addMenu(tr("View"));
 +    m_viewMenu->addAction(m_toListViewAct);
 +    m_viewMenu->addAction(m_toMapViewAct);
 +    m_viewMenu->setObjectName(tr("View Menu"));
  }
  
  void MainWindow::createViews()
@@@ -115,21 -96,7 +113,21 @@@ void MainWindow::switchView(int nextInd
      }
  }
  
 -int MainWindow::getViewIndex()
 +void MainWindow::loginScreenClosed()
 +{
 +    qDebug() << __PRETTY_FUNCTION__ << m_loggedIn;
 +    if (m_loggedIn) {
-         //this->show();
++        this->show();
 +        return;
 +    }
 +    else {
 +        this->close();
 +    }
 +}
 +
 +void MainWindow::loginOK()
  {
 -    return situareViews->currentIndex();
 +    qDebug() << __PRETTY_FUNCTION__ << m_loggedIn;
 +    m_loggedIn = true;
-     //FBAuth->close();
++    FBAuth->close();
  }
@@@ -27,7 -27,6 +27,9 @@@
  #include <QtGui/QMainWindow>
  #include <QWidget>
  #include <QDebug>
- //#include "facebookservice/facebookauthentication.h"
++#include "facebookservice/facebookauthentication.h"
++#include "situareservice/situareservice.h"
++#include <QNetworkAccessManager>
  
  class QLabel;
  class QStackedWidget;
@@@ -42,39 -41,50 +44,39 @@@ class MainWindow : public QMainWindo
      Q_OBJECT
  
  public:
 -    MainWindow(QWidget *parent = 0);
 -    ~MainWindow();
 -
      /**
 -    * @brief Public method to get current index of the view. Used for Unit testing
 +    * @brief Constructor
      *
 -    * @fn getViewIndex
 +    * @param parent Parent
      */
 -    int getViewIndex();
 +    MainWindow(QWidget *parent = 0);
  
 -private:
      /**
 -    * @brief Private method to create List and Map views as a stacked widget
 -    *
 -    * @fn createViews
 +    * @brief Destructor
      */
 -    void createViews();
 +    ~MainWindow();
 +
 +public slots:
      /**
 -    * @brief Widget Stack object for the List and Map Views
 -    *
 -    * @var situareViews
 +    * @brief Public slot, which initiates toListViewAct action to switch view
      */
 -    QStackedWidget *situareViews;
 +    void toListView();
  
      /**
 -    * @brief Private method to create the Menu items
 -    *
 -    * @fn createMenus
 +    * @brief Public slot, which initiates toMapViewAct action to switch view
      */
 -    void createMenus();
 -    QMenu *viewMenu;
 +    void toMapView();
  
 +private:
      /**
-     * @brief Private method to create the Menu items
 -    * @brief Action item for changing view to List View
 -    *
 -    * @var toListViewAct
++    * @brief Private method to create the Menu items    w.show();
      */
 -    QAction *toListViewAct;
 +    void createMenus();
 +
      /**
 -    * @brief Action item for changing view to Map View
 -    *
 -    * @var toMapViewAct
 +    * @brief Private method to create List and Map views as a stacked widget
      */
 -    QAction *toMapViewAct;
 +    void createViews();
  
      /**
      * @brief Method used to switch active view.
      */
      void switchView(int);
  
 -public slots:
 +private:
++    FacebookAuthentication *FBAuth;
++    QNetworkAccessManager *m_networkManager;
++    SituareService *m_situareService;
 +    bool m_loggedIn; ///< Boolean value to indicate whether login has been successfull or not
 +    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
 +    QMenu *m_viewMenu; ///< Object that hold the view menu items
 +
-     QAction *m_openUpdateDialog; ///< DUMMY item used to launch location update dialog
 +private slots:
      /**
 -    * @brief Public slot, which initiates toListViewAct action to switch view
 -    *
 -    * @fn toListView
 +    * @brief Slot to change value of m_loggedIn to true
      */
 -    void toListView();
 +    void loginOK();
 +
      /**
 -    * @brief Public slot, which initiates toMapViewAct action to switch view
 -    *
 -    * @fn toMapView
 +    * @brief Slot to check login status and exits if necessary
      */
 -    void toMapView();
 +    void loginScreenClosed();
-     /**
-     * @brief DUMMY slot to open update location dialog
-     */
-     void openUpdateDialog();
  };
  
  #endif // MAINWINDOW_H