-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
393 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[Settings] | ||
language = 0 | ||
version = 2.1.1 | ||
version = 2.1.2 | ||
never_show = 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import configparser | ||
from PySide6.QtWidgets import QApplication, QSplashScreen | ||
from PySide6.QtGui import QPixmap | ||
from PySide6.QtCore import QCoreApplication, QDir, QTranslator, QLocale | ||
from src.mainwindow import MainWindow # Import MainWindow from src | ||
|
||
if __name__ == "__main__": | ||
app = QApplication([]) | ||
|
||
config = configparser.ConfigParser() | ||
|
||
try: | ||
# Try to read the config.ini file | ||
config.read('config.ini') | ||
|
||
# Check if 'Settings' section and 'Language' option exist | ||
if 'Settings' in config and 'Language' in config['Settings']: | ||
if config['Settings']['Language'] == '1': | ||
# Create and install the translator | ||
translator = QTranslator() | ||
if translator.load("translations/MUSE.zh_CN.qm"): | ||
app.installTranslator(translator) | ||
else: | ||
print("Warning: The configuration file is missing the 'Settings' section or 'Language' option. Using default settings.") | ||
|
||
except FileNotFoundError: | ||
print("Warning: config.ini file does not exist. Using default settings.") | ||
# Use default settings | ||
config['Settings'] = {'Language': '0'} # default language is '0' | ||
|
||
except Exception as e: | ||
print(f"An error occurred: {e}") | ||
|
||
# Show splash screen | ||
splash_pix = QPixmap(":/png/loading.png") | ||
splash = QSplashScreen(splash_pix) | ||
splash.show() | ||
|
||
# Create and show main window | ||
window = MainWindow(config) | ||
|
||
splash.finish(window) | ||
window.show() | ||
|
||
# Run the application | ||
app.exec() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1 @@ | ||
2024-10-24 14:44:50,850 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 14:44:53,865 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 14:46:50,517 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 14:46:55,778 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 15:12:33,751 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 15:12:36,567 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 15:14:12,465 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 15:14:33,851 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 15:14:35,681 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 15:16:24,032 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 15:44:20,178 - ERROR - Error while setting language to English: 'MainWindow' object has no attribute 'config' | ||
2024-10-24 16:22:35,303 - ERROR - Error while setting language to English: 'Settings' | ||
2024-10-24 16:22:38,388 - ERROR - Error while setting language to English: 'Settings' | ||
2024-10-24 16:22:42,977 - ERROR - Error while setting language to English: 'Settings' | ||
2024-10-24 16:23:47,661 - ERROR - Error while setting language to English: 'Settings' | ||
2024-10-26 23:03:34,321 - ERROR - Failed to open the file: Guide_ENG.pdf | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>Welcome</class> | ||
<widget class="QDialog" name="Welcome"> | ||
<property name="enabled"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>711</width> | ||
<height>191</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Welcome - Version Info</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_2"> | ||
<item> | ||
<widget class="QFrame" name="frame"> | ||
<property name="frameShape"> | ||
<enum>QFrame::Shape::StyledPanel</enum> | ||
</property> | ||
<property name="frameShadow"> | ||
<enum>QFrame::Shadow::Raised</enum> | ||
</property> | ||
<layout class="QGridLayout" name="gridLayout_2"> | ||
<item row="1" column="0"> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="lineWidth"> | ||
<number>1</number> | ||
</property> | ||
<property name="text"> | ||
<string>Welcome to MUSE Software - Version 1.0</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer_3"> | ||
<property name="orientation"> | ||
<enum>Qt::Orientation::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_2"> | ||
<property name="text"> | ||
<string>To open the User Guide, go to Help > User Guide.</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_3"> | ||
<property name="text"> | ||
<string>For the Chinese version, please set the Language to Simplified Chinese in Preferences then open the User Guide again.</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_5"> | ||
<property name="text"> | ||
<string>Note: Test data can be found in the installation directory.</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item row="2" column="0"> | ||
<spacer name="verticalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Orientation::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item row="1" column="1"> | ||
<spacer name="horizontalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Orientation::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item row="0" column="0"> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Orientation::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
</layout> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QFrame" name="frame_2"> | ||
<property name="frameShape"> | ||
<enum>QFrame::Shape::NoFrame</enum> | ||
</property> | ||
<property name="frameShadow"> | ||
<enum>QFrame::Shadow::Raised</enum> | ||
</property> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<property name="topMargin"> | ||
<number>0</number> | ||
</property> | ||
<property name="bottomMargin"> | ||
<number>0</number> | ||
</property> | ||
<item> | ||
<widget class="QCheckBox" name="checkBox"> | ||
<property name="text"> | ||
<string>Do not show this message again</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer_3"> | ||
<property name="orientation"> | ||
<enum>Qt::Orientation::Horizontal</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pushButton"> | ||
<property name="text"> | ||
<string>Got it</string> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
Oops, something went wrong.