feat: Show app path in app tunneling screen
This commit is contained in:
parent
979ab42c5a
commit
c948681624
3 changed files with 12 additions and 5 deletions
|
|
@ -26,9 +26,12 @@ QVariant AppSplitTunnelingModel::data(const QModelIndex &index, int role) const
|
|||
return QVariant();
|
||||
|
||||
switch (role) {
|
||||
case AppPathRole: {
|
||||
case AppNameRole: {
|
||||
return m_apps.at(index.row()).appName;
|
||||
}
|
||||
case AppPathRole: {
|
||||
return m_apps.at(index.row()).appPath;
|
||||
}
|
||||
default: {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -89,6 +92,7 @@ void AppSplitTunnelingModel::toggleSplitTunneling(bool enabled)
|
|||
QHash<int, QByteArray> AppSplitTunnelingModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roles;
|
||||
roles[AppNameRole] = "appName";
|
||||
roles[AppPathRole] = "appPath";
|
||||
return roles;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ class AppSplitTunnelingModel: public QAbstractListModel
|
|||
|
||||
public:
|
||||
enum Roles {
|
||||
AppPathRole = Qt::UserRole + 1,
|
||||
AppNameRole = Qt::UserRole + 1,
|
||||
AppPathRole,
|
||||
PackageAppNameRole,
|
||||
PackageAppIconRole
|
||||
};
|
||||
|
|
|
|||
|
|
@ -168,11 +168,12 @@ PageType {
|
|||
id: proxyAppSplitTunnelingModel
|
||||
sourceModel: AppSplitTunnelingModel
|
||||
filters: RegExpFilter {
|
||||
roleName: "appPath"
|
||||
roleName: "appName"
|
||||
pattern: ".*" + searchField.textField.text + ".*"
|
||||
caseSensitivity: Qt.CaseInsensitive
|
||||
}
|
||||
sorters: [
|
||||
RoleSorter { roleName: "appName"; sortOrder: Qt.AscendingOrder },
|
||||
RoleSorter { roleName: "appPath"; sortOrder: Qt.AscendingOrder }
|
||||
]
|
||||
}
|
||||
|
|
@ -194,12 +195,13 @@ PageType {
|
|||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: appPath
|
||||
text: appName
|
||||
descriptionText: appPath
|
||||
rightImageSource: "qrc:/images/controls/trash.svg"
|
||||
rightImageColor: AmneziaStyle.color.paleGray
|
||||
|
||||
clickedFunction: function() {
|
||||
var headerText = qsTr("Remove ") + appPath + "?"
|
||||
var headerText = qsTr("Remove ") + appName + "?"
|
||||
var yesButtonText = qsTr("Continue")
|
||||
var noButtonText = qsTr("Cancel")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue