feat(desktop/profile): add link in advanced settings so log directory can be opened directly

Closes #3509.
This commit is contained in:
Michael Bradley, Jr 2021-09-14 11:17:35 -05:00 committed by Iuri Matias
parent 2e9c5047bb
commit 6625ae38be
2 changed files with 27 additions and 4 deletions

View File

@ -15,6 +15,7 @@ import status/notifications/[os_notifications]
import ../../app_service/[main]
import qrcode/qrcode
import ../utils/image_utils
import ../../constants
logScope:
topics = "profile-view"
@ -92,7 +93,7 @@ QtObject:
proc changeLocale*(self: ProfileView, locale: string) {.slot.} =
self.changeLanguage(locale)
proc nodeVersion*(self: ProfileView): string {.slot.} =
self.status.getNodeVersion()
@ -170,7 +171,7 @@ QtObject:
QtProperty[QVariant] mnemonic:
read = getMnemonic
proc getNetwork*(self: ProfileView): QVariant {.slot.} =
proc getNetwork*(self: ProfileView): QVariant {.slot.} =
newQVariant(self.network)
QtProperty[QVariant] network:
@ -217,12 +218,15 @@ QtObject:
self.profile.setSendUserStatus(sendUserStatus)
self.status.saveSetting(Setting.SendUserStatus, sendUserStatus)
proc showOSNotification*(self: ProfileView, title: string, message: string,
proc showOSNotification*(self: ProfileView, title: string, message: string,
notificationType: int, useOSNotifications: bool) {.slot.} =
let details = OsNotificationDetails(
notificationType: notificationType.OsNotificationType
)
self.appService.osNotificationService.showNotification(title, message,
self.appService.osNotificationService.showNotification(title, message,
details, useOSNotifications)
proc logDir*(self: ProfileView): string {.slot.} =
url_fromLocalFile(constants.LOGDIR)

View File

@ -49,6 +49,25 @@ ScrollView {
}
}
StyledText {
//% "Application Logs"
text: qsTr("Application Logs")
font.pixelSize: 15
font.underline: mouseArea.containsMouse
color: Style.current.blue
topPadding: 23
MouseArea {
id: mouseArea
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
onClicked: {
Qt.openUrlExternally(profileModel.logDir())
}
}
}
Item {
id: spacer1
height: Style.current.bigPadding