Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

main_window.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. from PyQt5.QtWidgets import QMainWindow, QMessageBox, QAction
  2. from PyQt5.QtGui import QIcon
  3. from .central_widget import CentralWidget
  4. from view.python_core.get_internal_files import get_internal_icons
  5. import pkg_resources
  6. class VIEWMainWindow(QMainWindow):
  7. def __init__(self):
  8. super().__init__()
  9. self.initUI()
  10. def initUI(self):
  11. exit_icon = get_internal_icons("twotone-exit_to_app-24px.svg")
  12. exitAction = QAction(QIcon(exit_icon), 'Exit', self)
  13. exitAction.setShortcut('Ctrl+Q')
  14. exitAction.setStatusTip('Exit application')
  15. exitAction.triggered.connect(self.close)
  16. version_icon = get_internal_icons("twotone-loyalty-24px.svg")
  17. show_version_action = QAction(QIcon(version_icon), "Show Version", self)
  18. show_version_action.setStatusTip("Show Version")
  19. show_version_action.triggered.connect(self.show_version)
  20. self.statusBar().showMessage("Welcome! Load a YML file to begin.")
  21. menubar = self.menuBar()
  22. fileMenu = menubar.addMenu('&File')
  23. fileMenu.addAction(exitAction)
  24. fileMenu.addAction(show_version_action)
  25. centralWidget = CentralWidget(self)
  26. self.setCentralWidget(centralWidget)
  27. self.setWindowTitle('VIEW')
  28. # self.setGeometry(QDesktopWidget().availableGeometry())
  29. # self.setWindowIcon(QIcon('web.png'))
  30. def show_version(self):
  31. view_version = pkg_resources.get_distribution("view").version
  32. QMessageBox.information(self, "Version", view_version)
  33. def closeEvent(self, event):
  34. msg = "Are you sure to quit?"
  35. reply = QMessageBox.question(self, 'Message',
  36. msg, QMessageBox.Yes |
  37. QMessageBox.No, QMessageBox.No)
  38. if reply == QMessageBox.Yes:
  39. event.accept()
  40. else:
  41. event.ignore()