Skip to content

Commit

Permalink
Fixed multiple issues
Browse files Browse the repository at this point in the history
- Fixed icon reference
- Fixed tooltip shortcut display
- Added new compatible file types
- Created new app version
  • Loading branch information
WhenLifeHandsYouLemons committed Dec 8, 2023
1 parent 671312f commit d81796b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
20 changes: 16 additions & 4 deletions Encryptext.pyw
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
Imports
"""
import sys
from os.path import abspath, join
from tkinter import *
from tkinter import filedialog
from tkinter import messagebox
Expand All @@ -9,6 +11,14 @@ from tkinter.ttk import *
import webbrowser
from cryptography.fernet import Fernet

# Used for getting files when using one-file mode .exe format
def getTrueFilename(filename):
try:
base = sys._MEIPASS
except Exception:
base = abspath('.')
return join(base, filename)

"""
Window Settings
"""
Expand All @@ -20,7 +30,7 @@ root.title("Encryptext")
# Resize the window (manually resizable too)
root.geometry("800x500")
# Change the icon
root.iconbitmap("app_icon.ico")
root.iconbitmap(getTrueFilename("app_icon.ico"))

"""
Variables
Expand All @@ -42,6 +52,8 @@ supported_file_types = [("Encryptext Files", "*.etx"),
("Python Files", "*.py"),
("HTML Files", "*.html"),
("CSS Files", "*.css"),
("JavaScript Files", "*.js"),
("JSON Files", "*.json"),
("Markdown Files", "*.md"),
("All Files", "*.*")
]
Expand Down Expand Up @@ -549,10 +561,10 @@ editmenu.add_command(label="Edit Preferences")
# Format menu items
textfontmenu.add_command(label="Arial")

textsizemenu.add_command(label="Increase Font Size", accelerator="Ctrl+Shift+-", command=increase_font)
textsizemenu.add_command(label="Increase Font Size", accelerator="Ctrl+Shift++", command=increase_font)
root.bind_all("<Control-+>", increase_font)

textsizemenu.add_command(label="Decrease Font Size", accelerator="Ctrl+Shift++", command=decrease_font)
textsizemenu.add_command(label="Decrease Font Size", accelerator="Ctrl+Shift+-", command=decrease_font)
root.bind_all("<Control-_>", decrease_font)

formatmenu.add_command(label="Text Colour", accelerator="Alt+C", command=text_colour_change)
Expand All @@ -565,7 +577,7 @@ textstylemenu.add_command(label="Bold", accelerator= "Alt+B", command=bold_text_
root.bind_all("<Alt-b>", bold_text_style)

textstylemenu.add_command(label="Italic", accelerator= "Alt+I", command=italic_text_style)
root.bind_all("<Alt-i>", bold_text_style)
root.bind_all("<Alt-i>", italic_text_style)

helpmenu.add_command(label="About Encryptext", command=about_menu)

Expand Down
Binary file modified Encryptext.zip
Binary file not shown.
Binary file modified installer.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
print("Creating custom program...\n\n")

# Creates an executable file
os.system("pyinstaller --onefile --windowed --log-level ERROR --icon=app_icon.ico Encryptext-User.pyw")
# https://stackoverflow.com/a/72523249
# https://stackoverflow.com/a/13790741
os.system('pyinstaller --onefile --clean --windowed --log-level ERROR --icon="app_icon.ico" --add-data "app_icon.ico;." --name Encryptext Encryptext-User.pyw')
# Moves the exe out of the dist folder
os.system("move dist\\Encryptext-User.exe Encryptext-User.exe")
# Rename the exe to "Encryptext (User).exe"
os.system("ren Encryptext-User.exe \"Encryptext.exe\"")
os.system("move dist\\Encryptext.exe Encryptext.exe")

print("\n\nCreated program!")
print("Cleaning up...")
Expand All @@ -46,7 +46,7 @@
# Removes the "build" folder
os.system("rmdir /s /q build")
# Removes the "Encryptext-User.spec" file
os.system("del Encryptext-User.spec")
os.system("del Encryptext.spec")
# Remove the "Encryptext-User.pyw" file
os.system("del Encryptext-User.pyw")
# Remove the "Encryptext.pyw" file
Expand Down
2 changes: 1 addition & 1 deletion installer_creator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

# Creates an executable file
os.system("pyinstaller --onefile --log-level ERROR --icon=installer_icon.ico installer.py")
os.system('pyinstaller --onefile --log-level CRITICAL --icon="installer_icon.ico" installer.py')
# Moves the exe out of the dist folder
os.system("move dist\\installer.exe installer.exe")

Expand Down
1 change: 1 addition & 0 deletions normal_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a basic .txt file. There's nothing special about this file.
1 change: 1 addition & 0 deletions test.etx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gAAAAABk7xfD-k3MLFUSTk5kXwwopYQbt_Mvf9zx9sTRyGPzk8Z29zFZ8h74tXfAo7LhLF0Xvuy3_Voc3kszyqyHPx4MB72ZX_ecO9JLSjgPSMOUdBdgzMFJOzh1erLtQJiL0_Z0PBd2TMAzs5Yr5mCUZftFsdYnoeb_-tIJTYF5W7bqKcTVrhmasuDW2YkDP0q6uChGMr6GcRZcEfH4YqwoXyNDOkZHxQrC8wuJPDoUvb7Cf89mNNFHIEAv8JvslXeEG3SvsIBdZdTuXTpzFxc4ngCo7dvhfFwYx02NjXQ8RR_4NAY-HXLON0stMyRdNQ7Y2EpD-eQUwF77aBoOFm27y5ICb9vr3qdugtjaEq1YEk0fgExNM3CgjhyuRASHq4hHPP01qh9ubaqzgrFHp37TKeenyyQfIdLs18Ln67fvcEAGWjycHC3dEQy3EqxtsU8bW5ICbtD6VmldtQNsvoRKGyv91BvfUhQPy5ClCF9kz6TtL3mxwmbxXsXyTRM_COp7WEudA6klZbST1oYDcNJXo5beTTwYHWp5UvgPUqJ2WL1LDPw9AFAHCjO_u23TPrhe9I9xQWXej5Q9kK4gy_rUsJsmOaRhvxLVOXtXha2XMH2IXixPF6akSMI3lHSeh0V6wkR-jR0apPIu4KBn1WBDLyRseyCY9yBb032LXC-1WYH5YjumVhQoSZB8Oa1sRugbxoCP60YRJSqv7557NmtOcVH1OhH_6zz4fdkFDzxm08b3rJQTtUfi_-KxvO6iZ2Hz8SqEQq7w8iF_QD8t4Bk9dlP2wkj3fQNZN1bRuPNVLZjtKAkAGVCEaRz0Pp9vKqQLZIaamXTFsp5BJjRt6VEO2iQnxwwZlaCy56Ej5Mx12nYVDlHkFRvj5RBcakxDb12aju-ZqtsMh6RWAIS76C39b5uoJk2NFFDMK_hkjycMbxylT_my9Dbyab61sk3kdTVCUedOfx8SEhB1x1FVCWzoBRx_FQlY49CPH7XVtP0Ik16g8_9HnquoIM_i92Sc6cXA97y00duB9pyn2xgiIWn_U8WAG3l8EFTD8DhMZjBNv7UJqzv_bUK6qmUS657Y82gRuFEEXEtWh4RXdOYzBGhp_A2dW21_0ANQElVAf6vDOd3jRNfSOIYGhpvbI3mQYCwzo8R1hu70W3MSBM0aXn4fsjKnkvV1Cg==

0 comments on commit d81796b

Please sign in to comment.