-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Xinyu Li edited this page Dec 12, 2025
·
1 revision
- Responsibility: Manages all external network communications.
- Threading: Uses a daemon thread to fetch API data so the GUI never freezes ("ANR" prevention).
- Timeout: Sets a strict 10s timeout for API requests with automatic error handling.
The application uses a custom configured ttk.Style theme to ensure visual consistency:
-
Colors: Apple-style system colors (
#007AFFfor actions,#F2F2F7for backgrounds). - Ticket Layout: The result area simulates a printed receipt for better readability.
The pricing strategy is defined in calculate_all():
We use AUD as the base anchor.
Cross Rate = (1 / Source_Rate_to_AUD) * Target_Rate_to_AUD
A default safety margin is applied to all foreign imports:
-
CONFIG["DEFAULT_MARGIN"] = 0.15(15% Markup)
-
Member Price: Reflects the "True" converted cost plus margin.
-
Bonus: If
Recommendationis checked, an extra 10% OFF is applied.
-
Bonus: If
- Standard Price: Uses a competitive benchmark algorithm anchored to CNY cross-rates (adjusted by factor 0.3) to prevent market underpricing.
- Offline Mode: If the socket connection fails (timeout > 3s), the app enters "Offline Mode" and alerts the user via the Status Bar.
-
Input Validation: The
_validate_numbercallback ensures only valid float numbers can be entered into price fields.