Implemented settings dialog and functionality for automatic location update setting
authorKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Mon, 26 Apr 2010 13:01:56 +0000 (16:01 +0300)
committerKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Mon, 26 Apr 2010 13:01:56 +0000 (16:01 +0300)
Reviewed by: Marko Niemelä

src/src.pro
src/ui/mainwindow.cpp
src/ui/mainwindow.h
src/ui/updatelocation/texteditautoresizer.cpp
src/ui/updatelocation/texteditautoresizer.h
src/ui/updatelocation/updatelocationdialog.cpp
src/ui/updatelocation/updatelocationdialog.h

index 97140ac..a8dd472 100644 (file)
@@ -23,7 +23,8 @@ SOURCES += main.cpp \
     ui/infotab.cpp \
     ui/updatelocation/updatelocationdialog.cpp \
     ui/updatelocation/texteditautoresizer.cpp \
-    user/user.cpp
+    user/user.cpp \
+    ui/settingsdialog.cpp
 HEADERS += ui/mainwindow.h \
     ui/mapviewscreen.h \
     ui/listviewscreen.h \
@@ -43,7 +44,8 @@ HEADERS += ui/mainwindow.h \
     facebookservice/facebookcredentials.h \
     facebookservice/facebookauthentication.h \
     facebookservice/facebookcommon.h \
-    user/user.h
+    user/user.h \
+    ui/settingsdialog.h
 QT += network \
     webkit
 
@@ -53,13 +55,11 @@ QT += network \
     message(OpenGL built in)
     message(Make sure you have OpenGL development headers installed)
     message(install headers with: sudo apt-get install libgl-dev libglu-dev)
-
     message(QJson built in)
     message(Make sure you have QJson development headers installed)
     message(install headers with: sudo apt-get install libqjson-dev)
 }
-
-maemo5 {
+maemo5 { 
     message(QJson built in)
     message(Make sure you have QJson development headers installed)
     message(add: deb http://repository.maemo.org/extras-devel fremantle free non-free)
index fe270bc..1560569 100644 (file)
@@ -24,6 +24,7 @@
 #include "mainwindow.h"
 #include "listviewscreen.h"
 #include "mapviewscreen.h"
+#include "settingsdialog.h"
 #include "facebookservice/facebookauthentication.h"
 #include "situareservice/situareservice.h"
 
@@ -52,6 +53,7 @@ MainWindow::~MainWindow()
     qDebug() << __PRETTY_FUNCTION__;
     delete m_toListViewAct;
     delete m_toMapViewAct;
+    delete m_toSettingsAct;
     delete m_situareViews;
 }
 
@@ -64,9 +66,13 @@ void MainWindow::createMenus()
     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"));
 }
 
@@ -111,6 +117,13 @@ void MainWindow::switchView(int nextIndex)
     }
 }
 
+void MainWindow::openSettingsDialog()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+    SettingsDialog *dialog = new SettingsDialog(this);
+    dialog->show();
+}
+
 void MainWindow::loginScreenClosed()
 {
     qDebug() << __PRETTY_FUNCTION__ << m_loggedIn;
index aa55970..bd79de8 100644 (file)
@@ -62,6 +62,11 @@ public:
 
 public slots:
     /**
+    * @brief Public slot, which open settings dialog
+    */
+     void openSettingsDialog();
+
+    /**
     * @brief Public slot, which initiates toListViewAct action to switch view
     */
     void toListView();
@@ -112,6 +117,7 @@ private:
     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
 
 };
index dabf73a..8852d71 100755 (executable)
@@ -37,6 +37,7 @@ TextEditAutoResizer::TextEditAutoResizer(QWidget *parent)
 
 void TextEditAutoResizer::textEditChanged()
 {
+    qDebug() << __PRETTY_FUNCTION__;
     QTextDocument *document = m_textEdit ? m_textEdit->document() : m_plainTextEdit->document();
     QRect cursor = m_textEdit ? m_textEdit->cursorRect() : m_plainTextEdit->cursorRect();
 
index 64c4af6..47d9dd2 100755 (executable)
@@ -45,6 +45,9 @@ public:
     */
     TextEditAutoResizer(QWidget *parent = 0);
 
+/*******************************************************************************
+ * MEMBER FUNCTIONS AND SLOTS
+ ******************************************************************************/
 private slots:
     /**
     * @brief Private slot which indicate when textEdit has been changed
@@ -52,7 +55,9 @@ private slots:
     * @fn textEditChanged
     */
     void textEditChanged();
-
+/*******************************************************************************
+ * DATA MEMBERS
+ ******************************************************************************/
 private:
     QFrame *m_edit; ///< Pointer to Frame
     QPlainTextEdit *m_plainTextEdit; ///< Pointer to PlainTextEdit
index 930b754..e29f926 100755 (executable)
@@ -26,6 +26,7 @@
 UpdateLocationDialog::UpdateLocationDialog(QWidget *parent)
     : QDialog(parent)
 {
+    qDebug() << __PRETTY_FUNCTION__;
     setWindowTitle(tr("Update Location"));
 
     QScrollArea *scrollArea = new QScrollArea(this);
@@ -34,7 +35,8 @@ UpdateLocationDialog::UpdateLocationDialog(QWidget *parent)
 
     QTextEdit *m_textEdit = new QTextEdit;
     QLineEdit *m_lineEdit = new QLineEdit;
-    QCheckBox *m_checkBox = new QCheckBox(tr("Publish in Fabebook"));
+    QCheckBox *m_checkBox = new QCheckBox(tr("Publish in Facebook"));
+    m_checkBox->setChecked(true);
 
     QPushButton *m_okButton = new QPushButton(tr("Send"));
     QDialogButtonBox *m_buttonBox = new QDialogButtonBox(Qt::Vertical);
index 998b86f..c46592b 100755 (executable)
@@ -34,9 +34,9 @@ class QDialogButtonBox;
 class QGroupBox;
 class QLabel;
 class QLineEdit;
-class QTextEdit;
 class QPushButton;
 class QScrollArea;
+class QTextEdit;
 
 /**
 * @brief Update Location UI
@@ -55,8 +55,14 @@ public:
     */
     UpdateLocationDialog(QWidget *parent = 0);
 
+/*******************************************************************************
+ * MEMBER FUNCTIONS AND SLOTS
+ ******************************************************************************/
 private slots:
 
+/*******************************************************************************
+ * DATA MEMBERS
+ ******************************************************************************/
 private:
     QDialogButtonBox *m_buttonBox; ///< Pointer to DialogButtonBox
     QCheckBox *m_checkBox; ///< Pointer to CheckBox