Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1.     def createVideoButton(self):
  2.         def toggled(state):
  3.             if state:
  4.                 filename, type = QtWidgets.QFileDialog.getSaveFileName(self, "Save Video", str(pathlib.Path.home()), "Video (*.avi)")
  5.                 if filename == "":
  6.                     b.setChecked(False)
  7.                     return
  8.  
  9.                 if not filename.endswith(".avi"):
  10.                     filename += ".avi"
  11.  
  12.                 self.startVideo(filename)
  13.             else:
  14.                 print(self.__dict__)
  15.                 if self.video:
  16.                     self.stopVideo()
  17.  
  18.         b = QtWidgets.QPushButton("Video")
  19.         b.setCheckable(True)
  20.  
  21.         if self.config[VIDEO] is not None and isinstance(self, TabRealTime):
  22.             b.setChecked(True)
  23.             self.startVideo(self.config[VIDEO])
  24.  
  25.         b.toggled.connect(toggled)
  26.         return b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement