about_dialog.py 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. """
  2. About Dialog
  3. Displays information about the DuDONG application, including:
  4. - Project description
  5. - Version information
  6. - Development team
  7. - Partners and acknowledgments
  8. - Partner logos
  9. """
  10. from PyQt5.QtWidgets import (QDialog, QVBoxLayout, QHBoxLayout, QLabel,
  11. QPushButton, QScrollArea, QWidget)
  12. from PyQt5.QtCore import Qt
  13. from PyQt5.QtGui import QFont, QPixmap
  14. from resources.styles import STANDARD_BUTTON_STYLE
  15. from utils.config import PROJECT_ROOT
  16. class AboutDialog(QDialog):
  17. """
  18. About dialog window showing project information.
  19. Displays:
  20. - Application name and version
  21. - Project description
  22. - Development team information
  23. - Partner organizations
  24. - Acknowledgments
  25. """
  26. def __init__(self, parent=None):
  27. """
  28. Initialize the about dialog.
  29. Args:
  30. parent: Parent widget
  31. """
  32. super().__init__(parent)
  33. self.setWindowTitle("About DuDONG")
  34. self.setMinimumSize(600, 700)
  35. self.setMaximumSize(700, 800)
  36. self.init_ui()
  37. def init_ui(self):
  38. """Initialize the UI components."""
  39. layout = QVBoxLayout()
  40. # Create scroll area for content
  41. scroll = QScrollArea()
  42. scroll.setWidgetResizable(True)
  43. scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
  44. # Content widget
  45. content_widget = QWidget()
  46. content_layout = QVBoxLayout(content_widget)
  47. content_layout.setSpacing(12)
  48. # DuDONG Logo (moved to top, larger size)
  49. logo_label = QLabel()
  50. logo_path = PROJECT_ROOT / "assets" / "logos" / "dudong_logo.png"
  51. try:
  52. if logo_path.exists():
  53. pixmap = QPixmap(str(logo_path))
  54. if not pixmap.isNull():
  55. scaled_pixmap = pixmap.scaledToHeight(300, Qt.SmoothTransformation)
  56. logo_label.setPixmap(scaled_pixmap)
  57. logo_label.setAlignment(Qt.AlignCenter)
  58. content_layout.addWidget(logo_label)
  59. except Exception as e:
  60. print(f"Warning: Could not load DuDONG logo: {e}")
  61. # Application Title
  62. title = QLabel("DuDONG")
  63. title.setFont(QFont("Arial", 24, QFont.Bold))
  64. title.setAlignment(Qt.AlignCenter)
  65. title.setStyleSheet("color: #2c3e50; margin: 8px;")
  66. content_layout.addWidget(title)
  67. # Subtitle
  68. subtitle = QLabel("Durian Desktop-Oriented Non-Invasive Grading System")
  69. subtitle.setFont(QFont("Arial", 12))
  70. subtitle.setAlignment(Qt.AlignCenter)
  71. subtitle.setStyleSheet("color: #7f8c8d; margin-bottom: 10px;")
  72. subtitle.setWordWrap(True)
  73. content_layout.addWidget(subtitle)
  74. # Version
  75. version = QLabel("Version 2.1.0")
  76. version.setFont(QFont("Arial", 10))
  77. version.setAlignment(Qt.AlignCenter)
  78. version.setStyleSheet("color: #95a5a6; margin-bottom: 20px;")
  79. content_layout.addWidget(version)
  80. # Description
  81. description = QLabel(
  82. "DuDONG is a robust desktop application developed by the AIDurian project "
  83. "using Python, designed for advanced assessment of durian ripeness and quality. "
  84. "Utilizing advanced AI models and multiple sensor inputs, the software delivers "
  85. "precise predictions of durian fruit ripeness, quality assessment, and maturity classification. "
  86. "The application supports both audio analysis and multispectral imaging for comprehensive "
  87. "durian evaluation. Through multi-model analysis including defect detection, shape assessment, "
  88. "and locule counting, DuDONG provides detailed insights into durian quality characteristics. "
  89. "All analysis results are persisted in a comprehensive database for historical tracking "
  90. "and performance monitoring."
  91. )
  92. description.setWordWrap(True)
  93. description.setFont(QFont("Arial", 10))
  94. description.setStyleSheet("color: #2c3e50; padding: 10px; line-height: 1.5;")
  95. content_layout.addWidget(description)
  96. # Features Section
  97. features_title = QLabel("Key Features")
  98. features_title.setFont(QFont("Arial", 14, QFont.Bold))
  99. features_title.setStyleSheet("color: #2c3e50; margin-top: 20px;")
  100. content_layout.addWidget(features_title)
  101. features_text = QLabel(
  102. "• Durian Ripeness Classification (Audio Analysis & Multispectral Imaging)\n"
  103. "• Quality Assessment (Defect Detection, Shape Analysis)\n"
  104. "• Locule Counting with Segmentation\n"
  105. "• Maturity Classification (Multispectral Analysis)\n"
  106. "• Real-time Processing with GPU Acceleration\n"
  107. "• Comprehensive Multi-Model Analysis Reports\n"
  108. "• Manual Input Mode (Multi-Source File Processing)\n"
  109. "• Database Persistence (Analysis History Tracking)"
  110. )
  111. features_text.setWordWrap(True)
  112. features_text.setFont(QFont("Arial", 10))
  113. features_text.setStyleSheet("color: #2c3e50; padding: 10px;")
  114. content_layout.addWidget(features_text)
  115. # Development Team
  116. team_title = QLabel("Development Team")
  117. team_title.setFont(QFont("Arial", 14, QFont.Bold))
  118. team_title.setStyleSheet("color: #2c3e50; margin-top: 20px;")
  119. content_layout.addWidget(team_title)
  120. team_text = QLabel(
  121. "Developed by researchers at the Department of Math, Physics, and Computer Science "
  122. "in UP Mindanao, specifically, the AIDurian Project, under the Department of "
  123. "Science and Technology's (DOST) i-CRADLE program.\n\n"
  124. "The project aims to bridge the gap between manual practices of durian farming "
  125. "and introduce it to the various technological advancements available today."
  126. )
  127. team_text.setWordWrap(True)
  128. team_text.setFont(QFont("Arial", 10))
  129. team_text.setStyleSheet("color: #2c3e50; padding: 10px;")
  130. content_layout.addWidget(team_text)
  131. # Institutions
  132. institutions_title = QLabel("Supported By")
  133. institutions_title.setFont(QFont("Arial", 14, QFont.Bold))
  134. institutions_title.setStyleSheet("color: #2c3e50; margin-top: 20px;")
  135. content_layout.addWidget(institutions_title)
  136. institutions_text = QLabel(
  137. "• University of the Philippines Mindanao\n"
  138. "• Department of Science and Technology (DOST)\n"
  139. "• DOST-PCAARRD i-CRADLE Program"
  140. )
  141. institutions_text.setWordWrap(True)
  142. institutions_text.setFont(QFont("Arial", 10))
  143. institutions_text.setStyleSheet("color: #2c3e50; padding: 10px;")
  144. content_layout.addWidget(institutions_text)
  145. # Institution logos
  146. inst_logos_layout = QHBoxLayout()
  147. inst_logos_layout.setSpacing(15)
  148. inst_logos_layout.setContentsMargins(10, 10, 10, 10)
  149. institution_data = [
  150. ("UPMin.png", "UP Mindanao"),
  151. ("dost.png", "DOST"),
  152. ("DOST-PCAARRD.png", "DOST-PCAARRD"),
  153. ]
  154. for image_file, inst_name in institution_data:
  155. image_path = PROJECT_ROOT / "assets" / "logos" / image_file
  156. inst_logo_container = QVBoxLayout()
  157. inst_logo_label = QLabel()
  158. try:
  159. if image_path.exists():
  160. pixmap = QPixmap(str(image_path))
  161. if not pixmap.isNull():
  162. # Scale to 50px height, maintain aspect ratio
  163. scaled_pixmap = pixmap.scaledToHeight(50, Qt.SmoothTransformation)
  164. inst_logo_label.setPixmap(scaled_pixmap)
  165. inst_logo_label.setAlignment(Qt.AlignCenter)
  166. else:
  167. inst_logo_label.setText(inst_name)
  168. inst_logo_label.setFont(QFont("Arial", 8))
  169. inst_logo_label.setAlignment(Qt.AlignCenter)
  170. inst_logo_label.setStyleSheet("color: #95a5a6; padding: 5px;")
  171. else:
  172. inst_logo_label.setText(inst_name)
  173. inst_logo_label.setFont(QFont("Arial", 8))
  174. inst_logo_label.setAlignment(Qt.AlignCenter)
  175. inst_logo_label.setStyleSheet("color: #95a5a6; padding: 5px;")
  176. except Exception as e:
  177. print(f"Warning: Could not load institution logo {image_file}: {e}")
  178. inst_logo_label.setText(inst_name)
  179. inst_logo_label.setFont(QFont("Arial", 8))
  180. inst_logo_label.setAlignment(Qt.AlignCenter)
  181. inst_logo_label.setStyleSheet("color: #95a5a6; padding: 5px;")
  182. inst_logo_container.addWidget(inst_logo_label)
  183. inst_logos_layout.addLayout(inst_logo_container)
  184. content_layout.addLayout(inst_logos_layout)
  185. # Partners
  186. partners_title = QLabel("Industry Partners")
  187. partners_title.setFont(QFont("Arial", 14, QFont.Bold))
  188. partners_title.setStyleSheet("color: #2c3e50; margin-top: 20px;")
  189. content_layout.addWidget(partners_title)
  190. partners_text = QLabel(
  191. "Special thanks to AIDurian's partners:\n"
  192. "• Belviz Farms\n"
  193. "• D'Farmers Market\n"
  194. "• EngSeng Food Products\n"
  195. "• Rosario's Delicacies\n"
  196. "• VJT Enterprises"
  197. )
  198. partners_text.setWordWrap(True)
  199. partners_text.setFont(QFont("Arial", 10))
  200. partners_text.setStyleSheet("color: #2c3e50; padding: 10px;")
  201. content_layout.addWidget(partners_text)
  202. # Partner logos
  203. logos_layout = QHBoxLayout()
  204. logos_layout.setSpacing(15)
  205. logos_layout.setContentsMargins(10, 10, 10, 10)
  206. partner_data = [
  207. ("Belviz-logo-1.png", "Belviz Farms"),
  208. ("logo_final.png", "D'Farmers Market"),
  209. ("eng-seng.png", "EngSeng Food Products"),
  210. ("Rosario-Background-Removed.png", "Rosario's Delicacies"),
  211. ("VJT-Enterprise.jpeg", "VJT Enterprises"),
  212. ]
  213. for image_file, partner_name in partner_data:
  214. image_path = PROJECT_ROOT / "assets" / "logos" / image_file
  215. logo_container = QVBoxLayout()
  216. logo_label = QLabel()
  217. try:
  218. if image_path.exists():
  219. pixmap = QPixmap(str(image_path))
  220. if not pixmap.isNull():
  221. # Scale to 50px height, maintain aspect ratio
  222. scaled_pixmap = pixmap.scaledToHeight(50, Qt.SmoothTransformation)
  223. logo_label.setPixmap(scaled_pixmap)
  224. logo_label.setAlignment(Qt.AlignCenter)
  225. else:
  226. logo_label.setText(partner_name)
  227. logo_label.setFont(QFont("Arial", 8))
  228. logo_label.setAlignment(Qt.AlignCenter)
  229. logo_label.setStyleSheet("color: #95a5a6; padding: 5px;")
  230. else:
  231. logo_label.setText(partner_name)
  232. logo_label.setFont(QFont("Arial", 8))
  233. logo_label.setAlignment(Qt.AlignCenter)
  234. logo_label.setStyleSheet("color: #95a5a6; padding: 5px;")
  235. except Exception as e:
  236. print(f"Warning: Could not load partner logo {image_file}: {e}")
  237. logo_label.setText(partner_name)
  238. logo_label.setFont(QFont("Arial", 8))
  239. logo_label.setAlignment(Qt.AlignCenter)
  240. logo_label.setStyleSheet("color: #95a5a6; padding: 5px;")
  241. logo_container.addWidget(logo_label)
  242. logos_layout.addLayout(logo_container)
  243. content_layout.addLayout(logos_layout)
  244. # Copyright
  245. copyright_text = QLabel("© 2024 AIDurian Project. All rights reserved.")
  246. copyright_text.setAlignment(Qt.AlignCenter)
  247. copyright_text.setFont(QFont("Arial", 9))
  248. copyright_text.setStyleSheet("color: #95a5a6; margin-top: 30px;")
  249. content_layout.addWidget(copyright_text)
  250. # Add stretch to push content to top
  251. content_layout.addStretch()
  252. # Set content widget to scroll area
  253. scroll.setWidget(content_widget)
  254. layout.addWidget(scroll)
  255. # Close button
  256. close_btn = QPushButton("Close")
  257. close_btn.setStyleSheet(STANDARD_BUTTON_STYLE)
  258. close_btn.clicked.connect(self.accept)
  259. layout.addWidget(close_btn, alignment=Qt.AlignRight)
  260. self.setLayout(layout)