<file>res/images/zoom_in.png</file>
<file>res/images/zoom_out.png</file>
<file>res/images/location_search.png</file>
+ <file>res/images/list_item_context_button_bar_left.png</file>
+ <file>res/images/list_item_context_button_bar_right.png</file>
+ <file>res/images/list_item_context_button_bar_tile.png</file>
+ <file>res/images/search_history.png</file>
+ <file>res/images/clear_btn_d.png</file>
+ <file>res/images/clear_btn_s.png</file>
+ <file>res/images/clear_btn.png</file>
+ <file>res/images/contact_btn.png</file>
+ <file>res/images/contact_btn_d.png</file>
+ <file>res/images/contact_btn_s.png</file>
</qresource>
</RCC>
ui/panelcontextbuttonbar.cpp \
ui/paneltab.cpp \
ui/paneltabbar.cpp \
- ui/tabbedpanel.cpp \
ui/routingpanel.cpp \
ui/routewaypointlistitem.cpp \
- ui/routewaypointlistview.cpp \
- user/user.cpp \
- ui/locationsearchpanel.cpp \
+ ui/routewaypointlistview.cpp \
+ ui/searchdialog.cpp \
+ ui/searchhistorylistitem.cpp \
+ ui/searchhistorylistview.cpp \
+ ui/settingsdialog.cpp \
+ ui/tabbedpanel.cpp \
ui/textmodifier.cpp \
+ ui/userinfo.cpp \
+ ui/userinfopanel.cpp \
+ ui/zoombutton.cpp \
+ ui/zoombuttonpanel.cpp \
- user/user.cpp
++ user/user.cpp \
+ ui/listitemcontextbuttonbar.cpp
HEADERS += application.h \
common.h \
coordinates/geocoordinate.h \
ui/routingpanel.h \
ui/routewaypointlistitem.h \
ui/routewaypointlistview.h \
- user/user.h \
- ui/locationsearchpanel.h \
+ ui/searchdialog.h \
+ ui/searchhistorylistitem.h \
+ ui/searchhistorylistview.h \
+ ui/settingsdialog.h \
+ ui/tabbedpanel.h \
ui/textmodifier.h \
+ ui/userinfo.h \
+ ui/userinfopanel.h \
+ ui/zoombutton.h \
+ ui/zoombuttonpanel.h \
- user/user.h
++ user/user.h \
+ ui/listitemcontextbuttonbar.h
QT += network \
webkit
DEFINES += QT_NO_DEBUG_OUTPUT
connect(m_clearGroupFilteringButton, SIGNAL(clicked()),
this, SLOT(clearFiltering()));
- m_contextButtonLayout->addWidget(m_routeButton);
- m_contextButtonLayout->addWidget(m_showContactButton);
- m_contextButtonLayout->addWidget(m_clearGroupFilteringButton);
+ m_itemButtonsLayout->addWidget(m_routeButton);
++ m_itemButtonsLayout->addWidget(m_showContactButton);
+ m_genericButtonsLayout->addWidget(m_clearGroupFilteringButton);
}
void FriendListPanel::anyPanelClosed()
clearFiltering();
m_friendListView->clearItemSelection();
- setRouteButtonDisabled();
}
+ void FriendListPanel::requestSelectedFriendContactDialog()
+ {
+ qDebug() << __PRETTY_FUNCTION__;
+
+ FriendListItem *item = dynamic_cast<FriendListItem *>(m_friendListView->selectedItem());
+
+ if (item) {
+ QString facebookId = item->facebookId();
+ if (!facebookId.isEmpty())
+ emit requestContactDialog(facebookId);
+ }
+ }
+
void FriendListPanel::routeToSelectedFriend()
{
qDebug() << __PRETTY_FUNCTION__;
connect(searchLocationButton, SIGNAL(clicked()),
this, SIGNAL(requestSearchLocation()));
+ m_clearLocationListButton = new ImageButton(":/res/images/clear_btn.png",
+ ":/res/images/clear_btn_s.png",
+ ":/res/images/clear_btn_d.png", this);
+ m_clearLocationListButton->setDisabled(true);
+
+ connect(m_clearLocationListButton, SIGNAL(clicked()),
+ this, SLOT(showSearchHistoryListView()));
+
- m_contextButtonLayout->addWidget(m_routeButton);
- m_contextButtonLayout->addWidget(searchLocationButton);
- m_contextButtonLayout->addWidget(m_clearLocationListButton);
+ m_itemButtonsLayout->addWidget(m_routeButton);
+ m_genericButtonsLayout->addWidget(searchLocationButton);
++ m_genericButtonsLayout->addWidget(m_clearLocationListButton);
+
+ readSettings();
+ showSearchHistoryListView();
+ }
+
+ LocationSearchPanel::~LocationSearchPanel()
+ {
+ qDebug() << __PRETTY_FUNCTION__;
+
+ QSettings settings(DIRECTORY_NAME, FILE_NAME);
+ QList<QVariant> searchHistories;
+
+ for (int i = 0; i < m_searchHistoryListView->count(); ++i) {
+ SearchHistoryListItem *item = dynamic_cast<SearchHistoryListItem*>(
+ m_searchHistoryListView->listItemAt(i));
+
+ if (item) {
+ QList<QString> searchHistory;
+ searchHistory.append(item->title());
+ searchHistory.append(item->dateTime().toString());
+ searchHistories.append(QVariant(searchHistory));
+ }
+ }
+
+ settings.setValue(SETTINGS_SEARCH_HISTORY, searchHistories);
+ }
+
+ void LocationSearchPanel::prependSearchHistory(QString searchString, QDateTime dateTime)
+ {
+ qDebug() << __PRETTY_FUNCTION__;
+
+ const int SEARCH_HISTORY_LIMIT = 10;
+ static int counter = 0;
+
+ if (m_searchHistoryListView->count() >= SEARCH_HISTORY_LIMIT)
+ m_searchHistoryListView->removeLastItem();
+
+ SearchHistoryListItem *item = new SearchHistoryListItem();
+ item->setSearchHistoryData(searchString, dateTime);
+ m_searchHistoryListView->prependListItem(QString::number(counter++), item);
}
void LocationSearchPanel::clearListsSelections()
qDebug() << __PRETTY_FUNCTION__;
m_locationListView->clearItemSelection();
+ m_searchHistoryListView->clearItemSelection();
-
- setRouteButtonDisabled();
}
void LocationSearchPanel::hideEvent(QHideEvent *event)
m_resultsLabel->setText(tr("Search results: %1").arg(count));
}
+
-void LocationSearchPanel::setRouteButtonDisabled()
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- m_routeButton->setDisabled(m_locationListView->selectedItems().isEmpty());
-}
-
+ void LocationSearchPanel::showLocationListView(int locationItemsCount)
+ {
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_searchHistoryListView->clearItemSelection();
+ m_searchHistoryListView->hide();
+ setHeaderText(locationItemsCount);
+ m_clearLocationListButton->setEnabled(true);
+ m_locationListView->show();
+ }
+
+ void LocationSearchPanel::showSearchHistoryListView()
+ {
+ qDebug() << __PRETTY_FUNCTION__;
+
+ m_locationListView->clearList();
+ m_locationListView->hide();
+ m_resultsLabel->setText(tr("Search history:"));
+ m_clearLocationListButton->setDisabled(true);
+ m_searchHistoryListView->show();
+ }