Skip to content

Commit

Permalink
Merge pull request #1033 from nstelter-slac/fix_password
Browse files Browse the repository at this point in the history
Fix password
  • Loading branch information
YektaY authored Sep 26, 2023
2 parents 15ad347 + a1033f2 commit cab9336
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
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

0 comments on commit cab9336

Please sign in to comment.