Skip to content

Commit

Permalink
Linux Build Ok!
Browse files Browse the repository at this point in the history
  • Loading branch information
eusouanderson committed Jan 4, 2025
1 parent f7e1323 commit 2f25cba
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 106 deletions.
41 changes: 10 additions & 31 deletions reload/reload.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
import os
import sys
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
from PySide6.QtCore import Signal, QObject, QCoreApplication
# reload.py
from PySide6.QtWidgets import QApplication
from src.core.main import MyWindow

def reload_application():
app = QApplication([])

class ReloadSignal(QObject):
reload_signal = Signal()
window = MyWindow()
window.show()

def __init__(self):
super().__init__()
app.exec()

def reload_app(self):
# Fecha a aplicação e reinicia
print("Reiniciando a aplicação...")
QCoreApplication.quit()
os.execv(sys.executable, ["python"] + sys.argv)


# Classe de monitoramento de arquivos
class ReloadHandler(FileSystemEventHandler):
def __init__(self, reload_signal):
self.reload_signal = reload_signal

def on_modified(self, event):
if event.src_path.endswith(".py"):
print("Mudança detectada! Recarregando...")
self.reload_signal.reload_signal.emit()


# Função para configurar o monitoramento
def setup_reload_signal():
reload_signal = ReloadSignal()
return reload_signal
if __name__ == "__main__":
reload_application()
Binary file added src/assets/font/JetBrainsMono.ttf
Binary file not shown.
69 changes: 0 additions & 69 deletions src/core/exchange_rate.py

This file was deleted.

14 changes: 8 additions & 6 deletions src/core/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import sys
from PySide6.QtCore import Qt
from PySide6.QtGui import QFont, QIcon
from os import environ, path
from PySide6.QtGui import QShortcut, QKeySequence, QTextCursor
from PySide6.QtCore import Qt
from PySide6.QtGui import QShortcut, QKeySequence, QTextCursor, QFontDatabase, QFont, QIcon
from PyPDF2 import PdfReader
from docx import Document
import os
Expand Down Expand Up @@ -42,14 +42,16 @@ def __init__(self):
)
else:
icon_path = path.join(
path.dirname(__file__), "assets", "images", "icons", "orange.ico"
path.dirname(__file__),"..", "assets", "images", "icons", "orange.ico"
)
font_path = path.join(path.dirname(__file__),"..", "assets", "font", "JetBrainsMono.ttf")
font_id = QFontDatabase.addApplicationFont(font_path)
font_family = QFontDatabase.applicationFontFamilies(font_id)

self.setWindowIcon(QIcon(icon_path))
self.setWindowTitle("Orange Editor")
self.setGeometry(100, 100, 800, 600)

self.font = QFont("Consolas", 10)
self.font = QFont(font_family, 10)
self.setFont(self.font)

self.init_ui()
Expand Down

0 comments on commit 2f25cba

Please sign in to comment.