Commit 548a779b authored by Martin Kacej's avatar Martin Kacej

Unavailable connections viewing working

parent 3a904b2c
......@@ -37,11 +37,12 @@ MobileProxyModel::~MobileProxyModel()
}
void MobileProxyModel::setShowSavedMode(bool mode){
_showSavedMode = mode;
m_showSavedMode = mode;
emit showSavedModeChanged(mode);
}
bool MobileProxyModel::showSavedMode() const{
return _showSavedMode;
return m_showSavedMode;
}
bool MobileProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
......
......@@ -29,18 +29,20 @@ class Q_DECL_EXPORT MobileProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
Q_PROPERTY(QAbstractItemModel * sourceModel READ sourceModel WRITE setSourceModel)
Q_PROPERTY(bool showSavedMode READ showSavedMode WRITE setShowSavedMode)//NOTIFY showSavedModeChanged)
Q_PROPERTY(bool showSavedMode READ showSavedMode WRITE setShowSavedMode NOTIFY showSavedModeChanged)
public:
explicit MobileProxyModel(QObject* parent = 0);
virtual ~MobileProxyModel();
void setShowSavedMode(bool mode);
bool showSavedMode() const;
signals:
void showSavedModeChanged(bool mode);
protected:
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const Q_DECL_OVERRIDE;
bool lessThan(const QModelIndex& left, const QModelIndex& right) const Q_DECL_OVERRIDE;
private:
bool _showSavedMode;
bool m_showSavedMode;
};
#endif // PLASMA_NM_MOBILE_PROXY_MODEL_H
......@@ -42,7 +42,7 @@ Kirigami.ScrollablePage {
currentIndex: -1
boundsBehavior: Flickable.StopAtBounds
header: Controls.Label {
text: "Available networks"
text: (mobileProxyModel.showSavedMode) ? i18n("Saved networks") : i18n("Available networks")
}
model: mobileProxyModel
delegate: RowItemDelegate {}
......@@ -52,7 +52,7 @@ Kirigami.ScrollablePage {
Kirigami.Action {
iconName: "edit"
text:"Add custom connection"
text: i18n("Add custom connection")
onTriggered: {
applicationWindow().pageStack.push(connectionEditorDialogComponent)
}
......@@ -71,7 +71,9 @@ Kirigami.ScrollablePage {
checkable: true
checked: false
onTriggered: {
mobileProxyModel.showSavedMode = checked
mobileProxyModel.showSavedMode = !mobileProxyModel.showSavedMode
mobileProxyModel.clear()
handler.requestScan
}
}
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment