ui/listitemdelegate.cpp \
ui/friendlistitemdelegate.cpp \
ui/searchdialog.cpp \
- ui/paneltab.cpp \
- ui/tabbedpanel.cpp \
+ ui/panelbase.cpp \
ui/panelbar.cpp \
ui/panelcontent.cpp \
- ui/panelbase.cpp \
+ ui/paneltab.cpp \
+ ui/paneltabbar.cpp \
+ ui/tabbedpanel.cpp \
user/user.cpp
HEADERS += application.h \
common.h \
+ coordinates/geocoordinate.h \
+ coordinates/scenecoordinate.h \
engine/engine.h \
+ engine/mce.h \
error.h \
facebookservice/facebookauthentication.h \
facebookservice/facebookcommon.h \
map/mapcommon.h \
map/mapengine.h \
map/mapfetcher.h \
+ map/maprouteitem.h \
map/mapscene.h \
map/mapscroller.h \
map/maptile.h \
map/maptilerequest.h \
map/mapview.h \
+ map/osm.h \
map/ownlocationitem.h \
network/networkaccessmanager.h \
network/networkcookiejar.h \
network/networkhandler.h \
network/networkreply.h \
+ routing/geocodingservice.h \
+ routing/location.h \
+ routing/route.h \
+ routing/routesegment.h \
+ routing/routingcommon.h \
+ routing/routingservice.h \
situareservice/imagefetcher.h \
situareservice/situarecommon.h \
situareservice/situareservice.h \
ui/updatelocation/updatelocationdialog.h \
ui/avatarimage.h \
ui/friendlistitem.h \
+ ui/friendlistitemdelegate.h \
ui/friendlistpanel.h \
+ ui/fullscreenbutton.h \
ui/imagebutton.h \
+ ui/indicatorbutton.h \
+ ui/indicatorbuttonpanel.h \
ui/logindialog.h \
ui/mainwindow.h \
ui/mapscale.h \
- ui/panelcommon.h \
ui/settingsdialog.h \
ui/userinfo.h \
ui/userinfopanel.h \
ui/zoombutton.h \
ui/zoombuttonpanel.h \
- user/user.h \
- ui/fullscreenbutton.h \
- engine/mce.h \
- ui/indicatorbutton.h \
- ui/indicatorbuttonpanel.h \
- routing/geocodingservice.h \
- routing/routingservice.h \
- routing/routingcommon.h \
- routing/routesegment.h \
- routing/route.h \
- routing/location.h \
- map/maprouteitem.h \
- map/osm.h \
- coordinates/scenecoordinate.h \
- coordinates/geocoordinate.h \
+ ui/listcommon.h \
ui/listview.h \
ui/listitem.h \
ui/listitemdelegate.h \
- ui/friendlistitemdelegate.h \
- ui/listcommon.h \
ui/searchdialog.h \
- ui/paneltab.h \
- ui/tabbedpanel.h \
+ ui/panelbase.h \
ui/panelbar.h \
ui/panelcontent.h \
- ui/panelbase.h
+ ui/panelcommon.h \
+ ui/paneltab.h \
+ ui/paneltabbar.h \
+ ui/tabbedpanel.h \
+ user/user.h
QT += network \
webkit
m_friendListHeaderWidget->show();
m_friendListView->filter(userIDs);
+
+ emit showPanelRequested(this);
}
private slots:
/**
- * @brief Slot to clear friend list filter.
+ * @brief Slot to clear friend list filter
*/
void clearFriendListFilter();
/**
- * @brief Slot to show friends in list.
+ * @brief Slot to show friends in list
*
- * Shows only friends that are on userIDs list.
+ * Shows only friends that are on userIDs list
* @param userIDs list of user ID's
*/
void showFriendsInList(const QList<QString> &userIDs);
******************************************************************************/
signals:
/**
- * @brief Signal for friend finding.
+ * @brief Signal for friend finding
*
* @param coordinates Target coordinate
*/
void findFriend(const GeoCoordinate &coordinates);
+ /**
+ * @brief Signal for requesting a panel to be opened
+ *
+ * @param widget Pointer to the widget that emitted the signal
+ */
+ void showPanelRequested(QWidget *widget);
+
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
this, SIGNAL(autoCenteringTriggered(bool)));
}
+IndicatorButtonPanel::~IndicatorButtonPanel()
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ delete m_normalColor;
+}
+
void IndicatorButtonPanel::forceMouseRelease()
{
qDebug() << __PRETTY_FUNCTION__;
*/
IndicatorButtonPanel(QWidget *parent = 0);
+ /**
+ * @brief Desctructor
+ * Destroys m_normalColor
+ */
+ ~IndicatorButtonPanel();
+
/*******************************************************************************
* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
******************************************************************************/
connect(m_mapView, SIGNAL(viewResized(QSize)),
m_tabbedPanel, SLOT(resizePanel(QSize)));
+
+ connect(m_friendsListPanel, SIGNAL(showPanelRequested(QWidget*)),
+ m_tabbedPanel, SLOT(showPanel(QWidget*)));
}
void MainWindow::buildUserInfoPanel()
#include "panelcommon.h"
-///< @todo requires clean-up, there is some commented code
-
PanelBar::PanelBar(QWidget *parent)
: QWidget(parent)
{
m_barTile.load(":/res/images/sliding_bar_tile.png");
m_menuDropShadowTile.load(":/res/images/menu_bar_drop_shadow.png");
-
+ ///< @todo magic
m_barRect.setRect(0, 0, PANEL_BAR_WIDTH, PANEL_HEIGHT);
-// m_sliderRegion = QRegion(m_buttonRect).united(QRegion(m_topRect).united(QRegion(m_bottomRect)));
-// setMask(m_sliderRegion);
-
this->resize(PANEL_BAR_WIDTH, PANEL_HEIGHT);
}
-void PanelBar::paintEvent(QPaintEvent *)
+void PanelBar::paintEvent(QPaintEvent *event)
{
qDebug() << __PRETTY_FUNCTION__;
+ Q_UNUSED(event);
+
QPainter painter(this);
painter.drawTiledPixmap(m_barRect, m_barTile);
///< @todo magic
m_barRect.setRect(0, 0, PANEL_BAR_WIDTH, size.height());
-// m_sliderRegion = QRegion(m_buttonRect).united(QRegion(m_topRect).united(QRegion(m_bottomRect)));
-// setMask(m_sliderRegion);
-
this->resize(PANEL_BAR_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
}
#include <QWidget>
-///< @todo Comment does not tell what this class is actually for (=draws the vertical line between panel contents and tab buttons)
/**
- * @brief Generic class for panel bars
+ * @brief Class for for drawing a vertical line between panel content and tab bar
*
* @author Kaj Wallin - kaj.wallin (at) ixonos.com
* @author Pekka Nissinen - pekka.nissinen@ixonos.com
* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
******************************************************************************/
protected:
- ///< @todo parameter name missing (also in .cpp)
/**
* @brief Draws the bar
*
- * @param * QPaintEvent unused
+ * @param event Paint event
*/
- void paintEvent(QPaintEvent *);
+ void paintEvent(QPaintEvent *event);
/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
setAutoFillBackground(true);
}
-void PanelBase::paintEvent(QPaintEvent *)
+void PanelBase::paintEvent(QPaintEvent *event)
{
qDebug() << __PRETTY_FUNCTION__;
+ Q_UNUSED(event);
+
QPainter painter(this);
QRect shadowRect = QRect(0, 0, this->rect().width(), m_menuDropShadowTile.height());
* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
******************************************************************************/
protected:
- ///< @todo parameter name (also in .cpp)
/**
* @brief Draws the panel content base
*
- * @param * QPaintEvent unused
+ * @param event Paint event
*/
- void paintEvent(QPaintEvent *);
+ void paintEvent(QPaintEvent *event);
/*******************************************************************************
* DATA MEMBERS
{
qDebug() << __PRETTY_FUNCTION__;
- this->resize(PANEL_WIDTH, PANEL_HEIGHT);
+ resize(PANEL_WIDTH, PANEL_HEIGHT);
m_panelVBox = new QVBoxLayout(this);
m_panelVBox->setMargin(0);
{
qDebug() << __PRETTY_FUNCTION__;
- this->resize(PANEL_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
+ resize(PANEL_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
m_panelBase->resize(this->size());
}
#include "paneltab.h"
-///< @todo TAB_WIDTH not global? move into paintEvent()
-const int TAB_WIDTH = 66;
const int TAB_WIDTH_ACTIVE = 74;
const int TAB_HEIGHT = 66;
{
qDebug() << __PRETTY_FUNCTION__;
- ///< @todo magic, use enum, check also .h todo comment, fix everywhere
- m_tabPixmaps[0].load(":/res/images/tab_inactive.png");
- m_tabPixmaps[1].load(":/res/images/tab_inactive2.png");
- m_tabPixmaps[2].load(":/res/images/tab_active.png");
+ m_tabActiveImage.load(":/res/images/tab_active.png");
+ m_tabInactiveImage.load(":/res/images/tab_inactive.png");
+ m_tabInactiveImage2.load(":/res/images/tab_inactive2.png");
setCheckable(true);
{
qDebug() << __PRETTY_FUNCTION__;
- ///< @todo mouse button is not checked, add check here or remove from mousePressEvent
+ if (event->button() == Qt::LeftButton) {
+ if(this->rect().contains(event->pos())) {
+ click();
- if(this->rect().contains(event->pos())) {
- click();
+ if(isChecked())
+ setChecked(false);
+ else
+ setChecked(true);
+ }
- if(isChecked())
- setChecked(false);
- else
- setChecked(true);
+ setDown(false);
+ m_tabSelected = false;
}
-
- setDown(false);
- m_tabSelected = false;
}
-void PanelTab::paintEvent(QPaintEvent *)
+void PanelTab::paintEvent(QPaintEvent *event)
{
qDebug() << __PRETTY_FUNCTION__;
+ Q_UNUSED(event);
+
+ const int TAB_WIDTH = 66;
+
QPainter painter(this);
if(isChecked()) {
m_tabRect.setRect(0, 0, TAB_WIDTH_ACTIVE, TAB_HEIGHT);
- painter.drawPixmap(m_tabRect, m_tabPixmaps[2]);
+ painter.drawPixmap(m_tabRect, m_tabActiveImage);
} else {
m_tabRect.setRect(TAB_WIDTH_ACTIVE - TAB_WIDTH, 0, TAB_WIDTH, TAB_HEIGHT);
- painter.drawPixmap(m_tabRect, m_tabPixmaps[0]);
+ painter.drawPixmap(m_tabRect, m_tabInactiveImage);
}
if(isDown())
else
icon().paint(&painter, m_tabRect, Qt::AlignCenter, QIcon::Disabled);
}
-
-///< @todo setActive() method is not used
-void PanelTab::setActive(bool state)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- if(state)
- setChecked(true);
- else
- setChecked(false);
-}
*/
void mouseReleaseEvent(QMouseEvent *event);
-///< @todo parameter name missing (also in .cpp)
/**
* @brief Draws the tab button
*
- * @param * QPaintEvent unused
+ * @param event Paint event
*/
- void paintEvent(QPaintEvent *);
-
-/*******************************************************************************
- * MEMBER FUNCTIONS AND SLOTS
- ******************************************************************************/
-public:
- /**
- * @brief This slot is used to change tab button state
- */
- void setActive(bool state);
+ void paintEvent(QPaintEvent *event);
/*******************************************************************************
* DATA MEMBERS
bool m_tabActive; ///< Boolean used to track whether the tab button is active or not
bool m_tabSelected; ///< Boolean used to track whether the tab button is selected or not
- ///< @todo magic, replace with enum?
- QPixmap m_tabPixmaps[3]; ///< Pixmap table for tab button images
+ QPixmap m_tabActiveImage; ///< Pixmap for active tab button
+ QPixmap m_tabInactiveImage; ///< Pixmap for inactive tab button
+ QPixmap m_tabInactiveImage2; ///< Pixmap for inactive tab button below active tab button
- QRect m_tabRect; ///< Rect for the tab button
+ QRect m_tabRect; ///< Rect for the tab button
};
#endif // PANELTAB_H
PanelTabBar::PanelTabBar(QWidget *parent)
: QWidget(parent),
- m_activeTab(-1)
+ m_activeTab(-1) ///< @todo magic
{
qDebug() << __PRETTY_FUNCTION__;
{
qDebug() << __PRETTY_FUNCTION__;
- return insertTab(-1, icon);
+ const int APPEND_INDEX = -1;
+
+ return insertTab(APPEND_INDEX, icon);
}
void PanelTabBar::deselectTabs()
m_tabButtonGroup->addButton(new PanelTab(this), index);
m_tabButtonGroup->button(index)->setIcon(icon);
- // [BEGIN]: Purkkaa (to be removed ASAP!!!)
+ ///< @todo [BEGIN]: Purkkaa (to be removed ASAP!!!)
if(index > 0)
verticalStartPoint += 65 * index;
}
}
+void PanelTabBar::selectTab(int index)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ if (!m_tabButtonGroup->button(index)->isChecked())
+ m_tabButtonGroup->button(index)->click();
+}
+
void PanelTabBar::setCurrentIndex(int index)
{
qDebug() << __PRETTY_FUNCTION__;
if(m_activeTab == index) {
+ ///< @todo magic
m_activeTab = -1;
emit tabCloseRequested(index);
} else {
void deselectTabs();
/**
+ * @brief This slot selects a tab at given index
+ */
+ void selectTab(int index);
+
+private slots:
+ /**
* @brief Sets the tab at current index active
*
* @param index Index of the tab
{
qDebug() << __PRETTY_FUNCTION__;
- ///< @todo Do not use this, REMOVE ALL OCCURENCES IN ALL FILES!
- this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH, PANEL_HEIGHT);
- this->move(PANEL_CLOSED_X, PANEL_TOP_PADDING);
+ resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH, PANEL_HEIGHT);
+ move(PANEL_CLOSED_X, PANEL_TOP_PADDING);
// --- TABS ---
m_panelWidgetStack = new QStackedWidget(this);
m_panelTabBar = new PanelTabBar(this);
connect(m_panelTabBar, SIGNAL(currentChanged(int)),
- this, SLOT(showTab(int)));
+ this, SLOT(setCurrentIndex(int)));
connect(m_panelTabBar, SIGNAL(tabCloseRequested(int)),
this, SLOT(closePanel()));
{
qDebug() << __PRETTY_FUNCTION__;
- ///< @todo magic
- return insertTab(-1, widget, icon);
+
+ const int APPEND_INDEX = -1;
+
+ return insertTab(APPEND_INDEX, widget, icon);
}
-int TabbedPanel::insertTab(int index, QWidget *widget, const QIcon& icon)
+void TabbedPanel::closePanel()
{
qDebug() << __PRETTY_FUNCTION__;
- ///< @todo callers responsibility to call with right parameters
- if(!widget)
- return -1;
+ if(m_isOpen)
+ emit toggleState();
+}
+
+int TabbedPanel::insertTab(int index, QWidget *widget, const QIcon& icon)
+{
+ qDebug() << __PRETTY_FUNCTION__;
index = m_panelWidgetStack->insertWidget(index, widget);
m_panelTabBar->insertTab(index, icon);
}
}
-///< @todo sort alphabetically (other methods too)
-void TabbedPanel::closePanel()
+void TabbedPanel::resizePanel(const QSize &size)
{
qDebug() << __PRETTY_FUNCTION__;
- if(m_isOpen)
- emit toggleState();
-}
+ resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH,
+ size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
-void TabbedPanel::openPanel()
-{
- qDebug() << __PRETTY_FUNCTION__;
+ if (!m_isOpen)
+ move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
+ else
+ move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH, PANEL_TOP_PADDING);
+
+ m_panelBar->resizeBar(size);
+
+ m_panelContent->resizePanelContent(size);
+
+ QPoint closedPosition(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
+ m_panelStateClosed->assignProperty(this, "pos", closedPosition);
+
+ QPoint openedPosition(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH,
+ PANEL_TOP_PADDING);
+ m_panelStateOpened->assignProperty(this, "pos", openedPosition);
- if(!m_isOpen)
- emit toggleState();
}
-void TabbedPanel::showTab(int index)
+void TabbedPanel::showPanel(QWidget *widget)
{
qDebug() << __PRETTY_FUNCTION__;
-///< @todo if ((first) && (second)) {
- if (index < m_panelWidgetStack->count() && index >= 0) {
- m_panelWidgetStack->setCurrentIndex(index);
- openPanel();
- emit currentChanged(index);
- }
+ m_panelTabBar->selectTab(m_panelWidgetStack->indexOf(widget));
}
-void TabbedPanel::resizePanel(const QSize &size)
+void TabbedPanel::setCurrentIndex(int index)
{
qDebug() << __PRETTY_FUNCTION__;
- this->resize(PANEL_BAR_TABBED_WIDTH + PANEL_WIDTH,
- size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
-
- if (!m_isOpen) {
- this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
- } else {
- this->move(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH,
- PANEL_TOP_PADDING);
- }
-
- m_panelBar->resizeBar(size);
+ if ((index < m_panelWidgetStack->count()) && (index >= 0)) {
+ m_panelWidgetStack->setCurrentIndex(index);
- m_panelContent->resizePanelContent(size);
+ if(!m_isOpen)
+ emit toggleState();
- ///< @todo alignment
- m_panelStateClosed->assignProperty(this, "pos",
- QPoint(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING));
- m_panelStateOpened->assignProperty(this, "pos",
- QPoint(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH,
- PANEL_TOP_PADDING));
+ emit currentChanged(index);
+ }
}
void TabbedPanel::stateChanged()
*/
int addTab(QWidget *widget, const QIcon& icon);
- ///< @todo define "out of range"
/**
* @brief Inserts a tab to the panel
*
public slots:
/**
- * @brief Public slot that will close the panel unless already closed
+ * @brief Slot that closes the panel
*/
void closePanel();
/**
- * @brief Public slot that will open the panel unless already open
+ * @brief Slot that shows the tab (and opens it if closed) with the desired widget
+ *
+ * @param widget Widget
*/
- void openPanel();
+ void showPanel(QWidget *widget);
/**
* @brief Slot to redraw the panel after window resize event
*/
void resizePanel(const QSize &size);
+private slots:
/**
- * @brief Shows the tab at given index active
+ * @brief Sets the panel at current index active
*
- * @param index Index of the tab
+ * @param index Index of the panel
*/
- void showTab(int index);
+ void setCurrentIndex(int index);
-private slots:
/**
* @brief Internal slot used to track statemachine state
*/
-///< @todo Pekka missing from authors?
/*
Situare - A location system for Facebook
Copyright (C) 2010 Ixonos Plc. Authors:
Kaj Wallin - kaj.wallin@ixonos.com
+ Pekka Nissinen - pekka.nissinen@ixonos.com
Situare is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License