fun:_ZN12QApplicationD1Ev
fun:main
}
+{
+ 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:_XReply
+ fun:XGetWindowProperty
+ fun:XGetWMHints
+ fun:_ZN14QWidgetPrivate17setWindowIcon_sysEb
+ fun:_ZN7QWidget6createEmbb
+ fun:_ZN7QWidget10setVisibleEb
+ fun:_ZN7QDialog10setVisibleEb
+ fun:_ZN7QDialog4execEv
+ fun:_ZN19QApplicationPrivate25maemo5ShowApplicationMenuEv
+}
+
map/maptilerequest.cpp \
ui/friendlistpanel.cpp \
ui/userpanel.cpp \
- ui/panelsidebar.cpp
+ ui/panelsidebar.cpp \
+ ui/panelsliderbar.cpp
HEADERS += ui/mainwindow.h \
ui/mapviewscreen.h \
ui/listviewscreen.h \
ui/friendlistpanel.h \
ui/userpanel.h \
ui/panelcommon.h \
- ui/panelsidebar.h
+ ui/panelsidebar.h \
+ ui/panelsliderbar.h
QT += network \
webkit
DEFINES += QT_NO_DEBUG_OUTPUT
#include "friendlistview.h"
#include "friendlistitem.h"
#include "panelcommon.h"
+#include "panelsliderbar.h"
FriendListPanel::FriendListPanel(QWidget *parent)
: QWidget(parent)
{
qDebug() << __PRETTY_FUNCTION__;
m_friendsPanelVBox = new QVBoxLayout(this);
- this->setLayout(m_friendsPanelVBox);
- m_friendsPanelExpandButton = new QPushButton("Friends", this);
- m_friendsPanelVBox->addWidget(m_friendsPanelExpandButton);
+ setLayout(m_friendsPanelVBox);
- m_friendListView = new FriendListView(this);
- QScrollArea *friendListScroll = new QScrollArea(this);
- friendListScroll->setWidget(m_friendListView);
- friendListScroll->setWidgetResizable(true);
- friendListScroll->viewport()->setAutoFillBackground(false);
+// m_friendListView = new FriendListView(this);
+// QScrollArea *friendListScroll = new QScrollArea(this);
+// friendListScroll->setWidget(m_friendListView);
+// friendListScroll->setWidgetResizable(true);
+// friendListScroll->viewport()->setAutoFillBackground(false);
+// m_friendsPanelVBox->addWidget(friendListScroll);
- this->setAutoFillBackground(true);
+ setAutoFillBackground(true);
QPalette pal = palette();
pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
setPalette(pal);
- m_friendsPanelVBox->addWidget(friendListScroll);
+ m_friendsPanelSlidingBar = new PanelSliderBar(this, RIGHT);
+ m_friendsPanelSlidingBar->move(TOP_CORNER_X, PANEL_TOP_Y);
m_friendsPanelStateMachine = new QStateMachine(this);
m_friendsPanelStateClosed = new QState(m_friendsPanelStateMachine);
FRIENDPANEL_OPENED_X, PANEL_TOP_Y));
m_friendsPanelTransitionOpen = m_friendsPanelStateClosed->addTransition(
- this, SIGNAL(clicked()), m_friendsPanelStateOpened);
+ m_friendsPanelSlidingBar, SIGNAL(clicked()), m_friendsPanelStateOpened);
m_friendsPanelTransitionOpen->addAnimation(new QPropertyAnimation(this, "pos", this));
m_friendsPanelTransitionClose = m_friendsPanelStateOpened->addTransition(
- this, SIGNAL(clicked()), m_friendsPanelStateClosed);
+ m_friendsPanelSlidingBar, SIGNAL(clicked()), m_friendsPanelStateClosed);
m_friendsPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos", this));
m_friendsPanelStateMachine->start();
- this->setObjectName("FriendsPanel");
-
- m_friendsPanelSlidingBar = new QWidget(this);
- m_friendsPanelSlidingBar->setObjectName("FriendsPanelSlidingBar");
- m_friendsPanelSlidingBar->setStyleSheet(QString(
- "#FriendsPanelSlidingBar{background-image: url(:/res/images/sliding_bar_right.png)}"));
- m_friendsPanelSlidingBar->resize(SLIDINGBAR_WIDTH, SLIDINGBAR_HEIGHT);
- m_friendsPanelSlidingBar->move(0, PANEL_TOP_Y);
+ setObjectName("FriendsPanel");
}
-void FriendListPanel::friendInfoReceived(QList<User *> &friendList)
-{
- qDebug() << __PRETTY_FUNCTION__;
+//void FriendListPanel::friendInfoReceived(QList<User *> &friendList)
+//{
+// qDebug() << __PRETTY_FUNCTION__;
- m_friendListView->clear();
+// m_friendListView->clear();
- foreach (User *user, friendList) {
- FriendListItem *item = new FriendListItem(m_friendListView);
- item->setData(user);
- m_friendListView->addWidget(item);
- }
-}
+// foreach (User *user, friendList) {
+// FriendListItem *item = new FriendListItem(m_friendListView);
+// item->setData(user);
+// m_friendListView->addWidget(item);
+// }
+//}
void FriendListPanel::reDrawFriendsPanel(int width, int height)
{
qDebug() << __PRETTY_FUNCTION__;
- this->resize(FRIENDPANEL_WIDTH,height + MARGIN_CORRECTION);
- m_friendsPanelSlidingBar->resize(SLIDINGBAR_WIDTH, SLIDINGBAR_HEIGHT);
+ resize(FRIENDPANEL_WIDTH,height + MARGIN_CORRECTION);
m_friendsPanelStateClosed->assignProperty(this, "pos", QPoint(
- width-PANEL_PEEK_AMOUNT, PANEL_TOP_Y));
+ width - PANEL_PEEK_AMOUNT, PANEL_TOP_Y));
m_friendsPanelStateOpened->assignProperty(this, "pos", QPoint(
width - FRIENDPANEL_WIDTH + MARGIN_CORRECTION, PANEL_TOP_Y));
- this->move(width-PANEL_PEEK_AMOUNT, PANEL_TOP_Y);
-}
-
-void FriendListPanel::mouseReleaseEvent(QMouseEvent *)
-{
- qDebug() << __PRETTY_FUNCTION__;
- emit clicked();
-}
-
-void FriendListPanel::paintEvent(QPaintEvent *)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- QStyleOption option;
- option.init(this);
-
- QStylePainter painter(this);
- style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+ move(width - PANEL_PEEK_AMOUNT, PANEL_TOP_Y);
}
#include <QtGui>
-class FriendListView;
-class User;
+//class FriendListView;
+//class User;
+class PanelSliderBar;
/**
* @brief Class for sliding friends list panel
*/
FriendListPanel(QWidget *parent = 0);
-
-/*******************************************************************************
-* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
-******************************************************************************/
-protected:
- /**
- * @brief Draws stylesheet used in this class.
- *
- * @param * QPaintEvent unused
- */
- void paintEvent(QPaintEvent *);
-
- void mouseReleaseEvent(QMouseEvent *);
/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
public slots:
- /**
- * @brief Slot to refresh friends list
- *
- * @param friendList
- */
- void friendInfoReceived(QList<User *> &friendList);
+// /**
+// * @brief Slot to refresh friends list
+// *
+// * @param friendList
+// */
+// void friendInfoReceived(QList<User *> &friendList);
/**
* @brief Slot to redraw the panel after window resize event
*/
void reDrawFriendsPanel(int width, int height);
-
-
-signals:
- void clicked();
-
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
private:
- FriendListView *m_friendListView; ///< Friend list view
-
+// FriendListView *m_friendListView; ///< Friend list view
QVBoxLayout *m_friendsPanelVBox; ///< Vertical layout inside the panel
- QPushButton *m_friendsPanelExpandButton; ///< PushButton used to expand the panel
- QWidget *m_friendsPanelSlidingBar; ///< Widget for sidebar tab item
+ PanelSliderBar *m_friendsPanelSlidingBar; ///< Widget for sidebar tab item
QStateMachine *m_friendsPanelStateMachine; ///< State machine for sliding the panel
QState *m_friendsPanelStateClosed; ///< State of the closed panel
FriendListPanel *friendsListPanel = new FriendListPanel(this);
UserInfoPanel *userPanel = new UserInfoPanel(this);
- PanelSideBar *userPanelSidebar = new PanelSideBar(this, "left");
- PanelSideBar *friendsListPanelSidebar = new PanelSideBar(this, "right");
+ PanelSideBar *userPanelSidebar = new PanelSideBar(this, LEFT);
+ PanelSideBar *friendsListPanelSidebar = new PanelSideBar(this, RIGHT);
connect(mapView, SIGNAL(viewScrolled(QPoint)),
mapEngine, SLOT(setLocation(QPoint)));
connect(mapView, SIGNAL(viewResizedNewSize(int,int)),
friendsListPanelSidebar, SLOT(reDrawSidebar(int,int)));
-
- connect(this, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)),
- friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
+// connect(this, SIGNAL(SIG_friendsLocationsReady(QList<User*>&)),
+// friendsListPanel, SLOT(friendInfoReceived(QList<User*>&)));
QHBoxLayout *mapViewLayout = new QHBoxLayout;
#include <QtCore>
#include "map/mapcommon.h"
+
+enum Side{LEFT, RIGHT}; ///< Enumerator for panel sideness
+
const int PANEL_PEEK_AMOUNT = 25; ///< Amount of pixels shown when panel is closed
const int FRIENDPANEL_WIDTH = 420; ///< Width of the friends list panel
const int MARGIN_CORRECTION2 = 2; ///< Amount of correction to make panels touch the window borders
const int PANEL_TOP_Y = 0; ///< Y coordinate for top of both panels
+const int TOP_CORNER_X = 0; ///< X coordinate for top left corner
const int FRIENDPANEL_CLOSED_X =
DEFAULT_SCREEN_WIDTH-PANEL_PEEK_AMOUNT; ///< X location of the friend list panel when closed
DEFAULT_SCREEN_WIDTH-FRIENDPANEL_WIDTH; ///< X location of the friend list panel when opened
const int USERPANEL_CLOSED_X =
- 0 - USERPANEL_WIDTH + PANEL_PEEK_AMOUNT; ///< X location of the user panel when closed
+ 2 - USERPANEL_WIDTH + PANEL_PEEK_AMOUNT; ///< X location of the user panel when closed
const int USERPANEL_OPENED_X = 0; ///< X location of the user panel when opened
+
const int SIDEBAR_WIDTH = 23;
const int SIDEBAR_HEIGHT = 424;
#include "panelsidebar.h"
#include "panelcommon.h"
-PanelSideBar::PanelSideBar(QWidget *parent, QString side)
+PanelSideBar::PanelSideBar(QWidget *parent, Side side)
: QWidget(parent)
{
- if(side == "left") {
- this->setObjectName("SidePanelLeft");
- this->setStyleSheet(QString(
+ if (side == LEFT) {
+ setObjectName("SidePanelLeft");
+ setStyleSheet(QString(
"#SidePanelLeft{background-image: url(:/res/images/side_bar_left.png)}"));
- this->move(QPoint(USERPANEL_OPENED_X, PANEL_TOP_Y));
+ move(QPoint(USERPANEL_OPENED_X, PANEL_TOP_Y));
}
- else if(side == "right"){
- this->setObjectName("SidePanelRight");
- this->setStyleSheet(QString(
+ else if (side == RIGHT){
+ setObjectName("SidePanelRight");
+ setStyleSheet(QString(
"#SidePanelRight{background-image: url(:/res/images/side_bar_right.png)}"));
- this->move(QPoint(DEFAULT_SCREEN_WIDTH - SIDEBAR_WIDTH + MARGIN_CORRECTION2, PANEL_TOP_Y));
+ move(QPoint(DEFAULT_SCREEN_WIDTH - SIDEBAR_WIDTH + MARGIN_CORRECTION2, PANEL_TOP_Y));
}
else {
qFatal("Illegal PanelSideBar 2nd argument");
}
- this->resize(SIDEBAR_WIDTH, SIDEBAR_HEIGHT);
- this->setAttribute(Qt::WA_TransparentForMouseEvents, true);
+ resize(SIDEBAR_WIDTH, SIDEBAR_HEIGHT);
+ setAttribute(Qt::WA_TransparentForMouseEvents, true);
}
void PanelSideBar::paintEvent(QPaintEvent *)
{
Q_UNUSED(height);
qDebug() << __PRETTY_FUNCTION__;
- if(this->objectName() == "SidePanelRight") {
- this->move(width - SIDEBAR_WIDTH + MARGIN_CORRECTION2, PANEL_TOP_Y);
+ if (objectName() == "SidePanelRight") {
+ move(width - SIDEBAR_WIDTH + MARGIN_CORRECTION2, PANEL_TOP_Y);
}
}
#define PANELSIDEBAR_H
#include <QWidget>
+#include "panelcommon.h"
+/**
+* @brief Generic class for drawing sidebar anchors at the side of the screen
+*
+* @author Kaj Wallin - kaj.wallin (at) ixonos.com
+* @class PanelSideBar panelsidebar.h "ui/panelsidebar.h"
+*/
class PanelSideBar : public QWidget
{
Q_OBJECT
+
public:
- PanelSideBar(QWidget *parent, QString side);
+ /**
+ * @brief Constructor
+ *
+ * @param parent Parent
+ * @param side Qstring for the sidebar location. Accepts "left" and "right"
+ */
+ PanelSideBar(QWidget *parent, Side side);
/*******************************************************************************
* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
--- /dev/null
+ /*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Kaj Wallin - kaj.wallin@ixonos.com
+
+ Situare is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+ */
+
+#include <QtGui>
+#include "panelsliderbar.h"
+#include "panelcommon.h"
+
+PanelSliderBar::PanelSliderBar(QWidget *parent, Side side)
+ : QWidget(parent)
+{
+ if(side == LEFT) {
+ setObjectName("UserPanelSlidingBar");
+ setStyleSheet(QString(
+ "#UserPanelSlidingBar{background-image: url(:/res/images/sliding_bar_left.png)}"));
+ }
+ else if(side == RIGHT) {
+ setObjectName("FriendsPanelSlidingBar");
+ setStyleSheet(QString(
+ "#FriendsPanelSlidingBar{background-image: url(:/res/images/sliding_bar_right.png)}"));
+ }
+ else {
+ qFatal("Illegal PanelSliderBar 2nd argument");
+ }
+ resize(SLIDINGBAR_WIDTH, SLIDINGBAR_HEIGHT);
+}
+
+void PanelSliderBar::paintEvent(QPaintEvent *)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ QStyleOption option;
+ option.init(this);
+
+ QStylePainter painter(this);
+ style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+}
+
+void PanelSliderBar::mouseReleaseEvent(QMouseEvent *)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+ emit clicked();
+}
--- /dev/null
+ /*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Kaj Wallin - kaj.wallin@ixonos.com
+
+ Situare is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ version 2 as published by the Free Software Foundation.
+
+ Situare is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Situare; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA.
+ */
+
+
+#ifndef PANELSLIDERBAR_H
+#define PANELSLIDERBAR_H
+
+#include <QWidget>
+#include "panelcommon.h"
+
+/**
+* @brief Generic class from drawing sliding bar attached to panels
+*
+* @class PanelSliderBar panelsliderbar.h "ui/panelsliderbar.h"
+*/
+class PanelSliderBar : public QWidget
+{
+ Q_OBJECT;
+
+public:
+ /**
+ * @brief Constructor
+ *
+ * @param parent Parent
+ * @param side Qstring for the sliderbar location. Accepts "left" and "right"
+ */
+ PanelSliderBar(QWidget *parent, Side side);
+
+/*******************************************************************************
+* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+******************************************************************************/
+protected:
+ /**
+ * @brief Draws stylesheet used in this class.
+ *
+ * @param * QPaintEvent unused
+ */
+ void paintEvent(QPaintEvent *);
+
+ /**
+ * @brief Mouse release event used to expand/collapse the panel
+ *
+ * @param * Event
+ *
+ * @sa clicked
+ */
+ void mouseReleaseEvent(QMouseEvent *);
+
+
+ /*******************************************************************************
+ * SIGNALS
+ ******************************************************************************/
+signals:
+ /**
+ * @brief Signal that is emitted the slider bar is clicked
+ *
+ * @sa mouseReleaseEvent
+ */
+ void clicked();
+};
+#endif // PANELSLIDERBAR_H
#include "userpanel.h"
#include "panelcommon.h"
+#include "panelsliderbar.h"
UserInfoPanel::UserInfoPanel(QWidget *parent)
: QWidget(parent)
{
qDebug() << __PRETTY_FUNCTION__;
m_userPanelVBox = new QVBoxLayout(this);
- this->setLayout(m_userPanelVBox);
- m_userPanelExpandButton = new QPushButton("Personal", this);
- m_userPanelLabel = new QLabel("User information here",this);
- m_userPanelVBox->addWidget(m_userPanelExpandButton);
- m_userPanelVBox->addWidget(m_userPanelLabel);
+ setLayout(m_userPanelVBox);
- this->setAutoFillBackground(true);
+ setAutoFillBackground(true);
QPalette pal = palette();
pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
setPalette(pal);
+ PanelSliderBar *m_userPanelSlidingBar = new PanelSliderBar(this, LEFT);
+ m_userPanelSlidingBar->move(USERPANEL_WIDTH - SLIDINGBAR_WIDTH, PANEL_TOP_Y);
+
m_userPanelStateMachine = new QStateMachine(this);
m_userPanelStateClosed = new QState(m_userPanelStateMachine);
m_userPanelStateClosed->assignProperty(this, "pos", QPoint(
USERPANEL_OPENED_X, PANEL_TOP_Y));
m_userPanelTransitionOpen = m_userPanelStateClosed->addTransition(
- this, SIGNAL(clicked()), m_userPanelStateOpened);
+ m_userPanelSlidingBar, SIGNAL(clicked()), m_userPanelStateOpened);
m_userPanelTransitionOpen->addAnimation(new QPropertyAnimation(this, "pos", this));
m_userPanelTransitionClose = m_userPanelStateOpened->addTransition(
- this, SIGNAL(clicked()), m_userPanelStateClosed);
+ m_userPanelSlidingBar, SIGNAL(clicked()), m_userPanelStateClosed);
m_userPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos", this));
m_userPanelStateMachine->start();
- this->setObjectName("UserPanel");
-
- m_userPanelSlidingBar = new QWidget(this);
- m_userPanelSlidingBar->setObjectName("UserPanelSlidingBar");
- m_userPanelSlidingBar->setStyleSheet(QString(
- "#UserPanelSlidingBar{background-image: url(:/res/images/sliding_bar_left.png)}"));
- m_userPanelSlidingBar->resize(SIDEBAR_WIDTH + 1, SIDEBAR_HEIGHT);
- m_userPanelSlidingBar->move(USERPANEL_WIDTH - SIDEBAR_WIDTH + 1, PANEL_TOP_Y);
+ setObjectName("UserPanel");
}
void UserInfoPanel::reDrawUserPanel(int width, int height)
{
qDebug() << __PRETTY_FUNCTION__;
Q_UNUSED(width);
- this->resize(USERPANEL_WIDTH,height + MARGIN_CORRECTION);
-}
-
-void UserInfoPanel::mouseReleaseEvent(QMouseEvent *)
-{
- qDebug() << __PRETTY_FUNCTION__;
- emit clicked();
-}
-
-void UserInfoPanel::paintEvent(QPaintEvent *)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- QStyleOption option;
- option.init(this);
-
- QStylePainter painter(this);
- style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this);
+ resize(USERPANEL_WIDTH,height + MARGIN_CORRECTION);
}
#ifndef USERPANEL_H
#define USERPANEL_H
+
#include <QtGui>
+class PanelSliderBar;
+
/**
* @brief Class for sliding user information panel
*
UserInfoPanel(QWidget *parent = 0);
/*******************************************************************************
- * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
- ******************************************************************************/
-protected:
- /**
- * @brief Draws stylesheet used in this class.
- *
- * @param * QPaintEvent unused
- */
- void paintEvent(QPaintEvent *);
-
- void mouseReleaseEvent(QMouseEvent *);
-
-/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
public slots:
*/
void reDrawUserPanel(int width, int height);
-
-signals:
- void clicked();
-
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
private:
QVBoxLayout *m_userPanelVBox; ///< Vertical layout inside the panel
- QPushButton *m_userPanelExpandButton; ///< PushButton used to expand the panel
- QLabel *m_userPanelLabel; ///< Dummy label inside the panel
- QWidget *m_userPanelSlidingBar; ///< Widget for sidebar tab item
+ PanelSliderBar *m_userPanelSlidingBar; ///< Widget for sidebar tab item
QStateMachine *m_userPanelStateMachine; ///< State machine for sliding the panel
QState *m_userPanelStateClosed; ///< State of the closed panel