Skip to content

Commit ce2a877

Browse files
Updated to v1.10.3 to add import/export icons
1 parent e512f80 commit ce2a877

File tree

5 files changed

+55
-3
lines changed

5 files changed

+55
-3
lines changed

BlackHole

1.57 KB
Binary file not shown.

BlackHole.exe

846 Bytes
Binary file not shown.

BlackHole.py

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import datetime
12
import os
23
import shutil
34
import sys
@@ -6,6 +7,7 @@
67
import webbrowser
78
import customtkinter as ctk
89
import sqlite3
10+
import zipfile
911
from cryptography.fernet import Fernet
1012
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
1113
from cryptography.hazmat.backends import default_backend
@@ -384,7 +386,7 @@ def _post_close(h, lparam):
384386
FONT_ITALIC = os.path.join(SCRIPT_DIR, "Fonts", "Nunito-Italic.ttf")
385387
FONT_SEMIBOLD = os.path.join(SCRIPT_DIR, "Fonts", "Nunito-SemiBold.ttf")
386388
LICENSE_TEXT = os.path.join(SCRIPT_DIR, "LICENSE.txt")
387-
VERSION = "1.10.2"
389+
VERSION = "1.10.3"
388390
# Load all the font files for Tkinter (on Windows)
389391
if platform.system() == "Windows":
390392
fonts = [FONT_REGULAR, FONT_MEDIUM, FONT_BOLD, FONT_LIGHT, FONT_ITALIC, FONT_SEMIBOLD]
@@ -1669,6 +1671,7 @@ def show_settings_popup(self):
16691671
theme_combo.pack(padx=10, pady=(0,10))
16701672
theme_combo.configure(command=lambda val: self.toggle_theme(val))
16711673
ctk.CTkButton(frame, text="Show Sync Key", command = self.reshow_sync_key_display_popup, fg_color=ACCENT, text_color=BG, hover_color=ACCENT_DIM, width=120).pack(pady=10, padx=10)
1674+
ctk.CTkButton(frame, text="Import Icon Bundle", command=self.import_icon_bundle, fg_color=ACCENT, text_color=BG, hover_color=ACCENT_DIM, width=120).pack(pady=10, padx=10)
16721675
ctk.CTkButton(frame, text="About", command=self.show_about, fg_color=ACCENT, text_color=BG, hover_color=ACCENT_DIM, width=120).pack(pady=10, padx=10)
16731676
ctk.CTkButton(frame, text="Check for Updates", command=lambda: self.check_for_update(False), fg_color=ACCENT, text_color=BG, hover_color=ACCENT_DIM, width=120).pack(pady=10, padx=10)
16741677
ctk.CTkButton(frame, text="Reset", command=self.reset_app, fg_color="#ff4d4d", text_color=BG, hover_color="#ff0000", width=120).pack(pady=10, padx=10)
@@ -1755,6 +1758,31 @@ def toggle_startup(self, value):
17551758
messagebox.showerror("Error", f"Failed to update startup setting: {e}")
17561759
except Exception:
17571760
pass
1761+
def import_icon_bundle(self):
1762+
import_file = filedialog.askopenfilename(
1763+
title="Select .hawking File to Import",
1764+
filetypes=[("Hawking files", "*.hawking")]
1765+
)
1766+
if not import_file:
1767+
return
1768+
1769+
proceed = messagebox.askyesno(
1770+
"Warning",
1771+
"Importing this archive may overwrite existing icons in the stored icons directory. Do you want to proceed?"
1772+
)
1773+
if not proceed:
1774+
return
1775+
1776+
count = 0
1777+
with zipfile.ZipFile(import_file, "r") as archive:
1778+
for member in archive.namelist():
1779+
archive.extract(member, stored_icons_path)
1780+
count += 1
1781+
1782+
messagebox.showinfo(
1783+
"Imported",
1784+
f"Imported {count} icons from\n{import_file}"
1785+
)
17581786
def _change_sort(self, event=None):
17591787
val = self.sort_var.get()
17601788
if val == "Title A-Z":
@@ -2352,6 +2380,9 @@ def add_section(parent, name):
23522380
ctk.CTkButton(slide_btns, text=".pptx", command=self.export_pptx,
23532381
fg_color=ACCENT, text_color=BG, hover_color=ACCENT_DIM, width=120).pack(side="left", padx=5)
23542382
ctk.CTkButton(popup, text="Cancel", command=popup.destroy, fg_color="#3a3a3a", width=120).pack(pady=12)
2383+
icon_export = add_section(export_frame, "Icons")
2384+
ctk.CTkButton(icon_export, text="Export Icon Bundle", command=self.export_icons,
2385+
fg_color=ACCENT, text_color=BG, hover_color=ACCENT_DIM, width=180).pack(pady=5)
23552386
def fix_scrollable_frame(sf):
23562387
sf.update_idletasks()
23572388
sf._parent_canvas.configure(scrollregion=sf._parent_canvas.bbox("all"))
@@ -2647,6 +2678,27 @@ def export_pptx(self):
26472678
if path:
26482679
prs.save(path)
26492680
messagebox.showinfo("Exported", f"Exported to {path}")
2681+
def export_icons(self):
2682+
export_dir = filedialog.askdirectory(title="Select Export Directory for Icons")
2683+
if not export_dir:
2684+
return
2685+
2686+
timestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M")
2687+
archive_name = f"{timestamp}.hawking"
2688+
archive_path = os.path.join(export_dir, archive_name)
2689+
2690+
count = 0
2691+
with zipfile.ZipFile(archive_path, "w", zipfile.ZIP_DEFLATED) as archive:
2692+
for file in os.listdir(stored_icons_path):
2693+
src = os.path.join(stored_icons_path, file)
2694+
if os.path.isfile(src):
2695+
archive.write(src, arcname=file)
2696+
count += 1
2697+
2698+
messagebox.showinfo(
2699+
"Exported",
2700+
f"Exported {count} icons to\n{archive_path}"
2701+
)
26502702
def show_help(self):
26512703
help_url = "https://github.com/DirectedHunt42/BlackHole/wiki"
26522704
webbrowser.open_new(help_url)

Extras/BlackHole.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; Non-commercial use only
44

55
#define MyAppName "Black Hole"
6-
#define MyAppVersion "1.10.2"
6+
#define MyAppVersion "1.10.3"
77
#define MyAppPublisher "Nova Foundry"
88
#define MyAppURL "https://novafoundry.ca"
99
#define MyAppExeName "BlackHole.exe"

Extras/BlackHole.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<project>
22
<shortName>BlackHole</shortName>
33
<fullName>Black Hole Password Manager</fullName>
4-
<version>1.10.2</version>
4+
<version>1.10.3</version>
55
<readmeFile>C:/Users/jackp/Downloads/Linux/BlackHole/README.txt</readmeFile>
66
<licenseFile>C:/Users/jackp/Downloads/Linux/BlackHole/LICENSE.txt</licenseFile>
77
<logoImage>C:/Users/jackp/Downloads/Black Hole Installer.png</logoImage>

0 commit comments

Comments
 (0)