This commit is contained in:
Ronan Abhamon 2016-11-23 14:49:06 +01:00
parent c8a7651b99
commit 5d575b4b75
9 changed files with 45 additions and 23 deletions

View file

@ -127,6 +127,7 @@
<file>ui/modules/Linphone/Presence/PresenceString.qml</file>
<file>ui/modules/Linphone/qmldir</file>
<file>ui/modules/Linphone/Select/SelectContact.qml</file>
<file>ui/modules/Linphone/SmartSearchBar.qml</file>
<file>ui/modules/Linphone/Styles/Account/AccountStatusStyle.qml</file>
<file>ui/modules/Linphone/Styles/ChatStyle.qml</file>
<file>ui/modules/Linphone/Styles/Contact/AvatarStyle.qml</file>

View file

@ -10,6 +10,7 @@
// ===================================================================
class ContactModel : public QObject {
friend class ContactsListModel;
friend class ContactsListProxyModel;
Q_OBJECT;

View file

@ -59,6 +59,7 @@ bool ContactsListModel::removeRows (int row, int count, const QModelIndex &paren
ContactModel *contact = m_list[row];
m_list.removeAt(row);
m_linphone_friends->removeFriend(contact->m_linphone_friend);
contact->deleteLater();
}

View file

@ -25,7 +25,6 @@ public:
bool removeRow (int row, const QModelIndex &parent = QModelIndex());
bool removeRows (int row, int count, const QModelIndex &parent = QModelIndex());
public slots:
// See: http://doc.qt.io/qt-5/qtqml-cppintegration-data.html#data-ownership
// The returned value must have a explicit parent or a QQmlEngine::CppOwnership.

View file

@ -0,0 +1 @@
#include "SmartSearchBarModel.hpp"

View file

@ -0,0 +1,9 @@
#ifndef SMART_SEARCH_BAR_MODEL_H_
#define SMART_SEARCH_BAR_MODEL_H_
class SmartSearchBarModel {
};
#endif

View file

@ -0,0 +1,25 @@
import Common 1.0
import Linphone 1.0
// ===================================================================
SearchBox {
id: searchBox
delegate: Contact {
contact: $contact
width: parent.width
actions: [
ActionButton {
icon: 'call'
onClicked: CallsWindow.show()
},
ActionButton {
icon: 'video_call'
onClicked: CallsWindow.show()
}
]
}
}

View file

@ -27,5 +27,8 @@ PresenceString 1.0 Presence/PresenceString.qml
# Select
SelectContact 1.0 Select/SelectContact.qml
# SmartSearchBar
SmartSearchBar 1.0 SmartSearchBar.qml
# Timeline
Timeline 1.0 Timeline.qml

View file

@ -28,7 +28,7 @@ ApplicationWindow {
visible: true
onActiveFocusItemChanged: activeFocusItem == null &&
searchBox.hideMenu()
smartSearchBar.hideMenu()
// -----------------------------------------------------------------
// Toolbar properties.
@ -82,32 +82,14 @@ ApplicationWindow {
}
}
SearchBox {
id: searchBox
SmartSearchBar {
id: smartSearchBar
Layout.fillWidth: true
entryHeight: MainWindowStyle.searchBox.entryHeight
maxMenuHeight: MainWindowStyle.searchBox.maxHeight
placeholderText: qsTr('mainSearchBarPlaceholder')
model: ContactsListProxyModel {}
delegate: Contact {
contact: $contact
width: parent.width
actions: [
ActionButton {
icon: 'call'
onClicked: CallsWindow.show()
},
ActionButton {
icon: 'video_call'
onClicked: CallsWindow.show()
}
]
}
placeholderText: qsTr('mainSearchBarPlaceholder')
}
}
}