Class for sliding friends list panel. More...
#include <friendlistpanel.h>
Public Slots | |
void | friendImageReady (User *user) |
Slot to update friend item's image. | |
void | friendInfoReceived (QList< User * > &friendList) |
Slot to refresh friends list. | |
Signals | |
void | findFriend (const GeoCoordinate &coordinates) |
Signal for friend finding. | |
void | requestContactDialog (const QString &facebookId) |
Requests contact dialog. | |
void | routeToFriend (const GeoCoordinate &coordinates) |
Signal for routing to friend. | |
Public Member Functions | |
FriendListPanel (QWidget *parent=0) | |
Default constructor. | |
Protected Member Functions | |
void | hideEvent (QHideEvent *event) |
Re-implemented from QWidget::hideEvent(). | |
void | showEvent (QShowEvent *event) |
Re-implemented from QWidget::showEvent(). | |
Private Slots | |
void | anyPanelClosed () |
Called when any of the panel tabs is closed. | |
void | anyPanelOpened () |
Called when any of the panel tabs is opened. | |
void | clearFiltering () |
Slot for clearing the filtering. | |
void | clearTextFiltering () |
Slot for clearing the text based filtering. | |
void | filterTextChanged (const QString &text) |
Updates the filtering when filtering text value is changed. | |
void | requestSelectedFriendContactDialog () |
Requests selected friend's contact dialog. | |
void | routeToSelectedFriend () |
Routes to selected friend. | |
void | setRouteButtonDisabled () |
Sets route button disabled. | |
void | showFriendsInList (const QList< QString > &userIDs) |
Slot to show friends in list. | |
void | topmostWindowChanged (bool mainWindowIsTopmost) |
Called when topmost window is changed. | |
Private Member Functions | |
void | setFilteringLayoutVisibility (bool visible) |
Set visibility for filtering text field and clearing button. | |
void | updateKeyboardGrabbing () |
Takes care of grabbing and releasing the keyboard when required. | |
Private Attributes | |
bool | m_mainWindowIsTopmost |
Is the MainWindow the topmost one. | |
bool | m_somePanelIsOpen |
Is any panel tab open. | |
QLabel * | m_headerLabel |
Show how many friends are selected. | |
QLineEdit * | m_filterField |
Text field for the filter text. | |
QPushButton * | m_clearTextFilteringButton |
Button for clearing the text filtering. | |
QWidget * | m_headerWidget |
Friend list header widget. | |
FriendListView * | m_friendListView |
Friend list view. | |
ImageButton * | m_clearGroupFilteringButton |
Button for clearing friend group filtering. | |
ImageButton * | m_showContactButton |
Button for showing contact dialog. | |
ImageButton * | m_routeButton |
Button for routing to selected friend. |
Class for sliding friends list panel.
FriendListPanel::FriendListPanel | ( | QWidget * | parent = 0 |
) |
Default constructor.
parent |
void FriendListPanel::anyPanelClosed | ( | ) | [private, slot] |
Called when any of the panel tabs is closed.
Does call clearFriendGroupFiltering().
Calls updateKeyboardGrabbing() for releasing the grabbing when FriendListPanel is closed, not changed to other panel. In this case the hideEvent() is not triggered.
void FriendListPanel::anyPanelOpened | ( | ) | [private, slot] |
Called when any of the panel tabs is opened.
Calls updateKeyboardGrabbing() for grabbing the keyboard when FriendListPanel is closed and is the last selected tab. In this case the showEvent() is not triggered.
void FriendListPanel::clearFiltering | ( | ) | [private, slot] |
Slot for clearing the filtering.
Clears friend group (or single friend) filtering and calls clearTextFiltering().
void FriendListPanel::clearTextFiltering | ( | ) | [private, slot] |
Slot for clearing the text based filtering.
Does clear only the text based filtering. Friend group based filtering is not affected.
void FriendListPanel::filterTextChanged | ( | const QString & | text | ) | [private, slot] |
Updates the filtering when filtering text value is changed.
Filtering UI elements are invoked when the text becomes not empty and hidden when text becomes empty.
Sets the new filtering text.
text | New text value |
void FriendListPanel::findFriend | ( | const GeoCoordinate & | coordinates | ) | [signal] |
Signal for friend finding.
coordinates | Target coordinate |
void FriendListPanel::friendImageReady | ( | User * | user | ) | [slot] |
Slot to update friend item's image.
user | Friend |
void FriendListPanel::friendInfoReceived | ( | QList< User * > & | friendList | ) | [slot] |
Slot to refresh friends list.
friendList |
void FriendListPanel::hideEvent | ( | QHideEvent * | event | ) | [protected] |
Re-implemented from QWidget::hideEvent().
Calls updateKeyboardGrabbing() and clearFriendGroupFiltering().
event |
void FriendListPanel::requestContactDialog | ( | const QString & | facebookId | ) | [signal] |
Requests contact dialog.
facebookId | contact's facebookId |
void FriendListPanel::routeToFriend | ( | const GeoCoordinate & | coordinates | ) | [signal] |
Signal for routing to friend.
coordinates | friend's geo coordinates |
void FriendListPanel::routeToSelectedFriend | ( | ) | [private, slot] |
Routes to selected friend.
Emits routeToFriend if friend is selected from list.
void FriendListPanel::setFilteringLayoutVisibility | ( | bool | visible | ) | [private] |
Set visibility for filtering text field and clearing button.
visible | True if items should be visible, false if not |
void FriendListPanel::setRouteButtonDisabled | ( | ) | [private, slot] |
Sets route button disabled.
Disabled if there isn't any list item selected.
void FriendListPanel::showEvent | ( | QShowEvent * | event | ) | [protected] |
void FriendListPanel::showFriendsInList | ( | const QList< QString > & | userIDs | ) | [private, slot] |
Slot to show friends in list.
Shows only friends that are on userIDs list
userIDs | list of user ID's |
void FriendListPanel::topmostWindowChanged | ( | bool | mainWindowIsTopmost | ) | [private, slot] |
Called when topmost window is changed.
Does set m_mainWindowIsTopmost and calls updateKeyboardGrabbing()
mainWindowIsTopmost | True if MainWindow is the topmost one |
void FriendListPanel::updateKeyboardGrabbing | ( | ) | [private] |
Takes care of grabbing and releasing the keyboard when required.
Keyboard is grabbed when MainWindow it the topmost window, panel tab is open and FriendListPanel is visible. Releasing is done if the MainWindow is not the topmost window or panel tab is not open or FriendListPanel is invisible.