-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add network configuration error handling
Add network configuration error handling Log: Task: https://pms.uniontech.com/task-view-361719.html
- Loading branch information
Showing
23 changed files
with
1,585 additions
and
675 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
import QtQuick 2.15 | ||
import QtQuick.Layouts 1.15 | ||
import Qt.labs.platform 1.1 | ||
|
||
import org.deepin.dtk 1.0 as D | ||
|
||
RowLayout { | ||
id: root | ||
property var dataItem | ||
property var nameFilters: [qsTr("All files (*)")] | ||
property alias placeholderText: edit.placeholderText | ||
property alias text: edit.text | ||
property bool initialized: false | ||
signal textUpdated | ||
|
||
Component { | ||
id: fileDialog | ||
FileDialog { | ||
visible: false | ||
nameFilters: root.nameFilters | ||
onAccepted: { | ||
edit.text = currentFile.toString().replace("file://", "") | ||
dataItem.editClicked() | ||
this.destroy(10) | ||
} | ||
onRejected: this.destroy(10) | ||
} | ||
} | ||
D.LineEdit { | ||
id: edit | ||
onTextChanged: { | ||
if (!initialized) { | ||
return | ||
} | ||
if (showAlert) { | ||
dataItem.errorKey = "" | ||
} | ||
root.textUpdated() | ||
dataItem.editClicked() | ||
} | ||
showAlert: dataItem.errorKey === dccObj.name | ||
alertDuration: 2000 | ||
onShowAlertChanged: { | ||
if (showAlert) { | ||
dccObj.trigger() | ||
forceActiveFocus() | ||
} | ||
} | ||
Component.onCompleted: initialized = true | ||
} | ||
NetButton { | ||
text: "..." | ||
onClicked: { | ||
fileDialog.createObject(this).open() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
import QtQuick 2.15 | ||
|
||
import org.deepin.dtk 1.0 as D | ||
|
||
D.PasswordEdit { | ||
property var dataItem | ||
property bool newInput: false | ||
property bool initialized: false | ||
signal textUpdated | ||
|
||
placeholderText: qsTr("Required") | ||
echoButtonVisible: newInput | ||
showAlert: dataItem.errorKey === dccObj.name | ||
onTextChanged: { | ||
if (!initialized) { | ||
return | ||
} | ||
if (showAlert) { | ||
dataItem.errorKey = "" | ||
} | ||
if (text.length === 0) { | ||
newInput = true | ||
} | ||
textUpdated() | ||
dataItem.editClicked() | ||
} | ||
alertDuration: 2000 | ||
onShowAlertChanged: { | ||
if (showAlert) { | ||
dccObj.trigger() | ||
forceActiveFocus() | ||
} | ||
} | ||
Component.onCompleted: { | ||
newInput = text.length === 0 | ||
initialized = true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.