Skip to content

Commit

Permalink
Update project's files structure
Browse files Browse the repository at this point in the history
Signed-off-by: selfkilla666 <[email protected]>
  • Loading branch information
selfkilla666 committed Aug 10, 2024
1 parent af9ed7e commit 5b5c57a
Show file tree
Hide file tree
Showing 33 changed files with 371 additions and 59 deletions.
10 changes: 10 additions & 0 deletions .idea/crasher.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

149 changes: 149 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crasher/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from __future__ import annotations

from crasher.widgets.application import QCrasherApplication
from crasher.core.widgets.application import QCrasherApplication

import sys
import argparse
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Any, Optional
from pathlib import Path

from crasher.utils.validate import are_keys_present, add_missing_values
from crasher.core.utils.validate import are_keys_present, add_missing_values

import os.path
import toml
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added crasher/core/services/cli.py
Empty file.
Empty file.
Empty file.
File renamed without changes.
Empty file added crasher/core/utils/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QIcon

from crasher.widgets.window import QCrasherWindow
from crasher.classes.settings import QCrasherApplicationSettings
from crasher.utils.path import get_user_local_directory
from crasher.core.widgets.window import QCrasherWindow
from crasher.core.classes.settings import QCrasherApplicationSettings
from crasher.core.utils.path import get_user_local_directory

import loguru
import platform
Expand All @@ -25,11 +25,12 @@

class QCrasherApplication(QApplication):
""" Custom PySide6.QApplication implementation for Crasher """

APPLICATION_NAME: str = "Crasher"
APPLICATION_VERSION: str = "1.0.0b"
APPLICATION_ORG_NAME: str = "Witch Software"
APPLICATION_ORG_DOMAIN: str = "witch-software.com"

class Metadata:
APPLICATION_NAME: str = "Crasher"
APPLICATION_VERSION: str = "1.0.0b"
APPLICATION_ORG_NAME: str = "Witch Software"
APPLICATION_ORG_DOMAIN: str = "witch-software.com"

run_arguments: Namespace
logger: loguru.Logger
Expand Down Expand Up @@ -84,10 +85,10 @@ def initialize_application_information(self) -> None:
self.aboutToQuit.connect(self.on_close_event)

# Set application metadata
self.setApplicationName(self.APPLICATION_NAME)
self.setApplicationVersion(self.APPLICATION_VERSION)
self.setOrganizationName(self.APPLICATION_ORG_NAME)
self.setOrganizationDomain(self.APPLICATION_ORG_DOMAIN)
self.setApplicationName(self.Metadata.APPLICATION_NAME)
self.setApplicationVersion(self.Metadata.APPLICATION_VERSION)
self.setOrganizationName(self.Metadata.APPLICATION_ORG_NAME)
self.setOrganizationDomain(self.Metadata.APPLICATION_ORG_DOMAIN)

# Set application icon
icon = QIcon(str(Path("./static/app_icon.png")))
Expand Down Expand Up @@ -125,7 +126,7 @@ def log_debug_info(self, argv: list[str]):
if self.debug:
self.logger.debug("Application running in debug mode.")

self.logger.debug(f"Application version: {self.APPLICATION_VERSION}")
self.logger.debug(f"Application version: {self.Metadata.APPLICATION_VERSION}")

# Debug data about user system
self.logger.debug(f"Platform: {platform.system()} {platform.release()} ({platform.architecture()[0]})")
Expand Down
16 changes: 8 additions & 8 deletions crasher/widgets/menubar.py → crasher/core/widgets/menubar.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ def initialize_ui(self) -> None:
self.fileMenu: QMenu = self.addMenu("&File")
self.editMenu: QMenu = self.addMenu("&Edit")
self.imageMenu: QMenu = self.addMenu("&Image")
self.layersMenu: QMenu = self.addMenu("&Layers")
self.adjustmentsMenu: QMenu = self.addMenu("&Adjustments")
self.effectsMenu: QMenu = self.addMenu("Effect&s")
# self.layersMenu: QMenu = self.addMenu("&Layers")
# self.adjustmentsMenu: QMenu = self.addMenu("&Adjustments")
# self.effectsMenu: QMenu = self.addMenu("Effect&s")
self.viewMenu: QMenu = self.addMenu("&View")
self.helpMenu: QMenu = self.addMenu("&Help")

self.initialize_file_menu(self.fileMenu)
self.initialize_edit_menu(self.editMenu)
self.initialize_image_menu(self.imageMenu)
self.initialize_layers_menu(self.layersMenu)
self.initialize_adjustments_menu(self.adjustmentsMenu)
self.initialize_effects_menu(self.effectsMenu)
# self.initialize_layers_menu(self.layersMenu)
# self.initialize_adjustments_menu(self.adjustmentsMenu)
# self.initialize_effects_menu(self.effectsMenu)
self.initialize_view_menu(self.viewMenu)
self.initialize_help_menu(self.helpMenu)

Expand All @@ -99,9 +99,9 @@ def connect_signals_to_actions(self) -> None:

def initialize_file_menu(self, menu: QMenu) -> None:

self.newAction: QAction = QAction(text="New...", parent=self.parent())
self.newAction: QAction = QAction(text="New", parent=self.parent())
self.openAction: QAction = QAction(text="Open...", parent=self.parent())
self.saveAction: QAction = QAction(text="Save", parent=self.parent())
self.saveAction: QAction = QAction(text="Save...", parent=self.parent())
self.saveAsAction: QAction = QAction(text="Save as...", parent=self.parent())
self.settingsAction: QAction = QAction(text="Settings", parent=self.parent())
self.exitAction: QAction = QAction(text="Exit", parent=self.parent())
Expand Down
File renamed without changes.
Empty file.
12 changes: 9 additions & 3 deletions crasher/widgets/window.py → crasher/core/widgets/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
from PySide6.QtCore import Slot as qtSlot
from PySide6.QtWidgets import QMainWindow

from crasher.widgets.statusbar import QCrasherStatusBar
from crasher.widgets.menubar import QCrasherMenuBar
from crasher.core.widgets.statusbar import QCrasherStatusBar
from crasher.core.widgets.menubar import QCrasherMenuBar

import loguru

if TYPE_CHECKING:
from crasher.widgets.application import QCrasherApplication
from crasher.core.widgets.application import QCrasherApplication


class QCrasherWindow(QMainWindow):
Expand Down Expand Up @@ -44,14 +44,20 @@ def initialize_ui(self) -> None:
self.setWindowTitle(self.application.applicationName())
self.setWindowIcon(self.application.windowIcon())

self.logger.success("Window info successfully initialized!")

# Initialize statusbar
self.status_bar = QCrasherStatusBar(self, logger=self.logger)
self.setStatusBar(self.status_bar)

self.logger.success("Application statusbar successfully initialized!")

# Initialize menubar
self.menu_bar = QCrasherMenuBar(self, connect_signals=True)
self.setMenuBar(self.menu_bar)

self.logger.success("Application menubar successfully initialized!")

self.translate_ui()

def translate_ui(self) -> None:
Expand Down
Empty file.
Loading

0 comments on commit 5b5c57a

Please sign in to comment.