Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix password #1033

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pydm/widgets/pushbutton.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from qtpy.QtWidgets import QPushButton, QMessageBox, QInputDialog, QLineEdit
from qtpy.QtCore import Slot, Property
from qtpy import QtDesigner
from .base import PyDMWritableWidget

import logging
Expand Down Expand Up @@ -127,6 +128,11 @@ def password(self, value):
# new one, and only updates if the new password is different
self.protectedPassword = sha.hexdigest()

# Make sure designer knows it should save the protectedPassword field
formWindow = QtDesigner.QDesignerFormWindowInterface.findFormWindow(self)
if formWindow:
formWindow.cursor().setProperty("protectedPassword", self.protectedPassword)

@Property(str)
def protectedPassword(self):
"""
Expand Down
6 changes: 6 additions & 0 deletions pydm/widgets/related_display_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from qtpy.QtWidgets import QPushButton, QMenu, QAction, QMessageBox, QInputDialog, QLineEdit, QWidget
from qtpy.QtGui import QCursor, QIcon, QMouseEvent
from qtpy.QtCore import Slot, Property, Qt, QSize, QPoint
from qtpy import QtDesigner
from .base import PyDMWidget, only_if_channel_set
from ..utilities import IconFont, find_file, is_pydm_app
from ..utilities.macro import parse_macro_string
Expand Down Expand Up @@ -318,6 +319,11 @@ def password(self, value: str) -> None:
# new one, and only updates if the new password is different
self.protectedPassword = sha.hexdigest()

# Make sure designer knows it should save the protectedPassword field
formWindow = QtDesigner.QDesignerFormWindowInterface.findFormWindow(self)
if formWindow:
formWindow.cursor().setProperty("protectedPassword", self.protectedPassword)

@Property(str)
def protectedPassword(self) -> str:
"""
Expand Down
6 changes: 6 additions & 0 deletions pydm/widgets/shell_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from qtpy.QtWidgets import QPushButton, QMenu, QMessageBox, QInputDialog, QLineEdit, QWidget
from qtpy.QtGui import QCursor, QIcon, QMouseEvent
from qtpy.QtCore import Property, QSize, Qt, QTimer
from qtpy import QtDesigner
from .base import PyDMWidget, only_if_channel_set
from ..utilities import IconFont
from typing import Optional, Union, List
Expand Down Expand Up @@ -379,6 +380,11 @@ def password(self, value: str) -> None:
# new one, and only updates if the new password is different
self.protectedPassword = sha.hexdigest()

# Make sure designer knows it should save the protectedPassword field
formWindow = QtDesigner.QDesignerFormWindowInterface.findFormWindow(self)
if formWindow:
formWindow.cursor().setProperty("protectedPassword", self.protectedPassword)

@Property(str)
def protectedPassword(self) -> str:
"""
Expand Down
Loading