diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 5c20ca4..7b057cc 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -20,24 +20,7 @@ - - - - - - - - - - - - - - - - - - + @@ -382,20 +402,23 @@ + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -524,13 +465,6 @@ - - - - - - - @@ -546,13 +480,6 @@ - - - - - - - @@ -590,13 +517,6 @@ - - - - - - - @@ -609,19 +529,191 @@ - + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JDE/Interfaces/__pycache__/desktop.cpython-35.pyc b/JDE/Interfaces/__pycache__/desktop.cpython-35.pyc deleted file mode 100644 index 7c92002..0000000 Binary files a/JDE/Interfaces/__pycache__/desktop.cpython-35.pyc and /dev/null differ diff --git a/JDE/Interfaces/__pycache__/login.cpython-35.pyc b/JDE/Interfaces/__pycache__/login.cpython-35.pyc deleted file mode 100644 index b74ade3..0000000 Binary files a/JDE/Interfaces/__pycache__/login.cpython-35.pyc and /dev/null differ diff --git a/JDE/Interfaces/__pycache__/start.cpython-35.pyc b/JDE/Interfaces/__pycache__/start.cpython-35.pyc deleted file mode 100644 index d26bf34..0000000 Binary files a/JDE/Interfaces/__pycache__/start.cpython-35.pyc and /dev/null differ diff --git a/JDE/Interfaces/desktop.py b/JDE/Interfaces/desktop.py index 0f394b1..e7a614b 100644 --- a/JDE/Interfaces/desktop.py +++ b/JDE/Interfaces/desktop.py @@ -2,6 +2,8 @@ import logging import os import time import webbrowser +import PIL.Image +import PIL.ImageTk from tkinter import * from JDE.Interfaces import start @@ -63,6 +65,16 @@ class desktop: self.notifcationBar.place_configure(x=int(self.cWidth) - 500, y=int(self.cHeight) - 55, height=55, width=500) + if config["resizeBackground"]: + try: + self.canvas.delete("background") + backgroundResized = self.image.resize((self.cWidth, self.cHeight), PIL.Image.ANTIALIAS) + backgroundResizedImage = PIL.ImageTk.PhotoImage(backgroundResized) + self.canvas.backgroundImage = backgroundResizedImage + self.canvas.create_image(0, 0, image=backgroundResizedImage, anchor=NW, tag="background") + except Exception as e: + desktopLog.error(str(e)) + self.windowX = self.window.winfo_x() self.windowY = (self.window.winfo_y() + self.window.winfo_height()) @@ -245,8 +257,11 @@ class desktop: def createBackground(self): try: desktopLog.debug("Running "+desktop.createBackground.__name__) - self.background_image = PhotoImage(file=self.background) - self.canvas.create_image(0, 0, image=self.background_image, anchor=NW) + self.image = PIL.Image.open(self.background) + self.background_image = PIL.ImageTk.PhotoImage(self.image) + self.canvas.background_image = self.background_image + self.canvas.create_image(0, 0, image=self.background_image, anchor=NW, tag="background") + self.canvas.configure(relief=FLAT, highlightthickness=0) except Exception as e: desktopLog.error(str(e)) diff --git a/JDE/Interfaces/login.py b/JDE/Interfaces/login.py index 60a7ef4..c98140b 100644 --- a/JDE/Interfaces/login.py +++ b/JDE/Interfaces/login.py @@ -1,8 +1,18 @@ import logging +import PIL.Image +import PIL.ImageTk from tkinter import * loginLog = logging.getLogger(__name__) +loginLog.debug("Atempting to read settings file") +try: + config = {} + exec(open("JDE/Settings/settings.conf").read(), config) + loginLog.debug("System settings Detected!") +except Exception as e: + loginLog.error(str(e)) + class login: def reposition(self, event): @@ -10,6 +20,16 @@ class login: self.frame.place_configure(x=int(self.window.winfo_width() / 3), y=self.window.winfo_height() / 3, width=int(int(self.window.winfo_width()) / 3), height=int(int(self.window.winfo_height()) / 3)) + if config["resizeBackground"]: + try: + self.canvas.delete("Background") + background_image_resized = self.bg_image.resize((self.window.winfo_width(), self.window.winfo_height()), + PIL.Image.ANTIALIAS) + background_image = PIL.ImageTk.PhotoImage(background_image_resized) + self.canvas.backgroundImage = background_image + self.canvas.create_image(0, 0, image=background_image, anchor=NW, tag="Background") + except Exception as e: + loginLog.error(str(e)) def callback(self, event): loginLog.debug("Running callback") @@ -80,8 +100,11 @@ class login: def createBackground(self): loginLog.debug("Running createBackground") try: - self.background_image = PhotoImage(file=self.bg) - self.canvas.create_image(0, 0, image=self.background_image, anchor=NW) + self.bg_image = PIL.Image.open(self.bg, "r") + self.background_image = PIL.ImageTk.PhotoImage(self.bg_image) + self.canvas.bgImage = self.background_image + self.canvas.create_image(0, 0, image=self.background_image, anchor=NW, tag="Background") + self.canvas.configure(highlightthickness=0, relief=FLAT) self.canvas.pack(expand=YES, fill=BOTH) except Exception as e: loginLog.error(str(e)) diff --git a/JDE/JDE.py b/JDE/JDE.py index a831936..ed2f8e1 100644 --- a/JDE/JDE.py +++ b/JDE/JDE.py @@ -2,6 +2,7 @@ __author__ = "Jordonbc" import logging import time import os +import sys if not os.path.exists("JDE/Logs"): os.mkdir("JDE/Logs") @@ -12,6 +13,8 @@ logging.basicConfig(filename='JDE/Logs/' + str(time.strftime('%d-%m-%Y-%H-%M%p') jdeLog = logging.getLogger(__name__) +jdeLog.info("Python version: "+str(sys.version_info[0])+"."+str(sys.version_info[1])+"."+str(sys.version_info[2])) + jdeLog.info("Importing tkinter") try: from tkinter import * diff --git a/JDE/Settings/settings.conf b/JDE/Settings/settings.conf index 91789b7..dc94d28 100644 --- a/JDE/Settings/settings.conf +++ b/JDE/Settings/settings.conf @@ -1,10 +1,28 @@ -width = "1024" -height = "600" -userDirs = "Users/" -background = "JDE/Images/background.png" -colour = "#a0fd44" -startPic = "JDE/Images/start.png" -fullStart = "0" -contextMenuColour = "#a0fd44" +# --== JDE SETTINGS ==-- -version = "1.3.1 ALPHA" \ No newline at end of file +width = "1280" # Sets the width of JDE -- Outdated ( not used ) +height = "800" # Sets the height of JDE -- Outdated ( not used ) +userDirs = "Users/" # Sets the user directory +background = "JDE/Images/background.png" # Path to background image +colour = "#a0fd44" # Background colour of the taskbar +startPic = "JDE/Images/start.png" # sets the start menu picture ( not used ) +contextMenuColour = "#a0fd44" # Sets the colour of the context menu + +resizeBackground = False # Resizes the background but can be VERY slow! + + +#░░░░▄▄▄▄▀▀▀▀▀▀▀▀▄▄▄▄▄▄ +#░░░░█░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░▀▀▄ +#░░░█░░░▒▒▒▒▒▒░░░░░░░░▒▒▒░░█ +#░░█░░░░░░▄██▀▄▄░░░░░▄▄▄░░░█ +#░▀▒▄▄▄▒░█▀▀▀▀▄▄█░░░██▄▄█░░░█ +#█▒█▒▄░▀▄▄▄▀░░░░░░░░█░░░▒▒▒▒▒█ +#█▒█░█▀▄▄░░░░░█▀░░░░▀▄░░▄▀▀▀▄▒█ +#░█▀▄░█▄░█▀▄▄░▀░▀▀░▄▄▀░░░░█░░█ +#░░█░░▀▄▀█▄▄░█▀▀▀▄▄▄▄▀▀█▀██░█ +#░░░█░░██░░▀█▄▄▄█▄▄█▄████░█ +#░░░░█░░░▀▀▄░█░░░█░███████░█ +#░░░░░▀▄░░░▀▀▄▄▄█▄█▄█▄█▄▀░░█ +#░░░░░░░▀▄▄░▒▒▒▒░░░░░░░░░░█ +#░░░░░░░░░░▀▀▄▄░▒▒▒▒▒▒▒▒▒▒░█ +#░░░░░░░░░░░░░░▀▄▄▄▄▄░░░░░█ \ No newline at end of file diff --git a/JDE/__pycache__/JDE.cpython-35.pyc b/JDE/__pycache__/JDE.cpython-35.pyc deleted file mode 100644 index fa5a987..0000000 Binary files a/JDE/__pycache__/JDE.cpython-35.pyc and /dev/null differ diff --git a/Programs/__pycache__/imageViewer.cpython-35.pyc b/Programs/__pycache__/imageViewer.cpython-35.pyc deleted file mode 100644 index dea63f2..0000000 Binary files a/Programs/__pycache__/imageViewer.cpython-35.pyc and /dev/null differ diff --git a/Programs/__pycache__/info.cpython-35.pyc b/Programs/__pycache__/info.cpython-35.pyc deleted file mode 100644 index bd74381..0000000 Binary files a/Programs/__pycache__/info.cpython-35.pyc and /dev/null differ diff --git a/Programs/__pycache__/jpad.cpython-35.pyc b/Programs/__pycache__/jpad.cpython-35.pyc deleted file mode 100644 index e71ac1c..0000000 Binary files a/Programs/__pycache__/jpad.cpython-35.pyc and /dev/null differ diff --git a/Programs/__pycache__/minesweeper.cpython-35.pyc b/Programs/__pycache__/minesweeper.cpython-35.pyc deleted file mode 100644 index 354f521..0000000 Binary files a/Programs/__pycache__/minesweeper.cpython-35.pyc and /dev/null differ diff --git a/Programs/__pycache__/terminal.cpython-35.pyc b/Programs/__pycache__/terminal.cpython-35.pyc deleted file mode 100644 index b41c841..0000000 Binary files a/Programs/__pycache__/terminal.cpython-35.pyc and /dev/null differ diff --git a/Programs/webEdit/__pycache__/htmlEdit.cpython-35.pyc b/Programs/webEdit/__pycache__/htmlEdit.cpython-35.pyc deleted file mode 100644 index eb72293..0000000 Binary files a/Programs/webEdit/__pycache__/htmlEdit.cpython-35.pyc and /dev/null differ