Skip to content

Commit

Permalink
updated architecture of desktop app (enums, split of file with multip…
Browse files Browse the repository at this point in the history
…le classes to multiple files, ..)
  • Loading branch information
HardMax71 committed Aug 29, 2024
1 parent 63b1e24 commit c2f0815
Show file tree
Hide file tree
Showing 53 changed files with 538 additions and 831 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ across mobile, web, and desktop environments.
| Advanced Reporting | - | - ||
| Inventory Planning | - | - ||
| 3D Warehouse Visualization | - | - ||
| Batch Processing | - | - ||
| Barcode and Label Design | - | - ||
| Advanced Search and Filter | - |||
| System Diagnostics | - | - ||
Expand Down
2 changes: 0 additions & 2 deletions desktop_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ This is the desktop application component of the NexusWare Warehouse Management
- Advanced Reporting
- Inventory Planning
- 3D Warehouse Visualization
- Batch Processing
- Barcode and Label Design
- Advanced Search and Filter
- Data Analysis Tools
- System Diagnostics
- Simulation and Modeling
- Training Mode
- Customization Tools

Expand Down
Empty file added desktop_app/__init__.py
Empty file.
18 changes: 7 additions & 11 deletions desktop_app/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
from PySide6.QtWidgets import QApplication, QMessageBox
from requests import HTTPError

from desktop_app.src.ui.components.error_dialog import global_exception_handler
from public_api.api import APIClient
from public_api.api import UsersAPI
from services.authentication import AuthenticationService
from services.offline_manager import OfflineManager
from services.update_manager import UpdateManager
from desktop_app.src.ui.components import IconPath
from public_api.api import APIClient, UsersAPI
from services import OfflineManager, UpdateManager
from ui.components.dialogs.error_dialog import global_exception_handler
from ui.main_window import MainWindow
from ui.views.auth import LoginDialog
from utils.config_manager import ConfigManager
from utils.logger import setup_logger
from utils import ConfigManager, setup_logger


class AppContext:
Expand All @@ -24,7 +21,6 @@ def __init__(self):
self.api_client = APIClient(base_url=self.config_manager.get("api_base_url",
"http://127.0.0.1:8000/api/v1"))
self.users_api = UsersAPI(self.api_client)
self.auth_service = AuthenticationService(self.users_api)
self.offline_manager = OfflineManager("offline_data.db")
self.update_manager = UpdateManager(self.config_manager)

Expand All @@ -41,7 +37,7 @@ def initialize_app(self):
QDir.addSearchPath("translations", self.config_manager.get("translations_path",
"resources/translations"))

app_icon = QIcon("icons:app_icon.png")
app_icon = QIcon(IconPath.APP_ICON)
app.setWindowIcon(app_icon)
self.apply_appearance_settings(app)

Expand Down Expand Up @@ -100,7 +96,7 @@ def main():
if app_context.config_manager.get("auto_update", True) and app_context.update_manager.check_for_updates():
app_context.update_manager.perform_update()

login_dialog = LoginDialog(app_context.auth_service)
login_dialog = LoginDialog(app_context.users_api)
if login_dialog.exec() != LoginDialog.Accepted:
sys.exit(0)

Expand Down
2 changes: 1 addition & 1 deletion desktop_app/src/services/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .authentication import AuthenticationService
from .reports_mgmt import ReportExporter
from .offline_manager import OfflineManager
from .update_manager import UpdateManager
33 changes: 0 additions & 33 deletions desktop_app/src/services/authentication.py

This file was deleted.

6 changes: 1 addition & 5 deletions desktop_app/src/ui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from desktop_app.src.ui.views.notifications.notification_center import NotificationCenter
from .audit_log_view import AuditLogView
from .barcode_designer import BarcodeDesignerWidget
from .batch_processor import BatchProcessorWidget
from .dashboard import DashboardWidget
from .main_window import MainWindow
from .notification_center import NotificationCenter
from .offline_mode import OfflineModeWidget
from .report_generator import ReportGeneratorWidget
from .search_filter import AdvancedSearchDialog
from .settings.system_diagnostics import SystemDiagnosticsWidget
from .training_mode import TrainingModeManager
from .views.auth import LoginDialog
from .views.customers import CustomerDialog, CustomerDetailsDialog, CustomerView
from .views.inventory.inventory_planning import InventoryPlanningWidget
Expand All @@ -32,11 +30,9 @@
"CustomerView",
"ShipmentView",
"ReportGeneratorWidget",
"BatchProcessorWidget",
"BarcodeDesignerWidget",
"SystemDiagnosticsWidget",
"AdvancedSearchDialog",
"TrainingModeManager",
"OfflineModeWidget",
"UserManagementWidget",
"AuditLogView",
Expand Down
2 changes: 1 addition & 1 deletion desktop_app/src/ui/audit_log_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from PySide6.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QTableWidget, QTableWidgetItem, QDateEdit, QLabel

from desktop_app.src.ui.components import StyledButton
from desktop_app.src.ui.icon_path_enum import IconPath
from desktop_app.src.ui.components.icon_path import IconPath
from public_api.api import APIClient, AuditAPI


Expand Down
2 changes: 1 addition & 1 deletion desktop_app/src/ui/barcode_designer.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from barcode.writer import ImageWriter

from desktop_app.src.ui.components import StyledButton, StyledLabel
from desktop_app.src.ui.icon_path_enum import IconPath
from desktop_app.src.ui.components.icon_path import IconPath


class BarcodeDesignerWidget(QWidget):
Expand Down
75 changes: 0 additions & 75 deletions desktop_app/src/ui/batch_processor.py

This file was deleted.

22 changes: 8 additions & 14 deletions desktop_app/src/ui/components/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from .custom_widgets import (
from .dialogs import (
AboutDialog,
UserManualDialog,
)
from .dialogs.error_dialog import DetailedErrorDialog, global_exception_handler
from .icon_path import IconPath
from .widgets import (
StyledButton,
StyledLineEdit,
StyledComboBox,
Expand All @@ -9,14 +15,6 @@
CardWidget,
ToggleSwitch
)
from .dialogs import (
ConfirmDialog,
InputDialog,
ProgressDialog,
MessageBox,
FileDialog
)
from .error_dialog import DetailedErrorDialog, global_exception_handler

__all__ = [
"StyledButton",
Expand All @@ -28,10 +26,6 @@
"LoadingSpinner",
"CardWidget",
"ToggleSwitch",
"ConfirmDialog",
"InputDialog",
"ProgressDialog",
"MessageBox",
"FileDialog",
"DetailedErrorDialog",
"IconPath",
]
Loading

0 comments on commit c2f0815

Please sign in to comment.