-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d941a37
commit 7f80ab9
Showing
96 changed files
with
4,818 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import tkinter as tk | ||
from tkinter import font | ||
from PIL import Image, ImageOps, ImageTk | ||
import ttkbootstrap as ttk | ||
import webbrowser | ||
from resourcepath import resource_path, resource_path2 | ||
|
||
from metadata import __version__ | ||
from metadata import __AppName__ | ||
|
||
class DisplayAboutMe(ttk.Toplevel): | ||
def __init__(self, parent): | ||
ttk.Toplevel.__init__(self, parent) | ||
|
||
self.transient(parent) | ||
self.result = None | ||
self.grab_set() | ||
w = 480 | ||
h = 450 | ||
sw = self.winfo_screenwidth() | ||
sh = self.winfo_screenheight() | ||
x = (sw - w) / 2 | ||
y = (sh - h) / 2 | ||
self.geometry('{0}x{1}+{2}+{3}'.format(w, h, int(x), int(y))) | ||
self.resizable(width=False, height=False) | ||
self.title('About') | ||
self.about_ico = resource_path(relative_path='images/unt.ico') | ||
self.wm_iconbitmap(self.about_ico) | ||
|
||
# Load and resize the image | ||
self.image = Image.open(resource_path2(relative_path='images/Anno.png')) | ||
self.size = (150, 150) # Adjust the size as needed | ||
self.thumb = ImageOps.fit(self.image, self.size) | ||
self.photo = ImageTk.PhotoImage(self.thumb) | ||
|
||
# Center the image | ||
logo_frame = tk.Frame(self) | ||
logo_frame.pack(side=tk.TOP, pady=30) | ||
logo_label = tk.Label(logo_frame, image=self.photo) | ||
logo_label.pack() | ||
|
||
f1 = tk.Frame(self) | ||
f1.pack() | ||
f2 = tk.Frame(self) | ||
f2.pack(pady=10) | ||
f3 = tk.Frame(f2) | ||
f3.pack() | ||
|
||
def call_link(event): # Modified to accept the event argument | ||
webbrowser.open_new_tab('https://annor-gyimah.github.io/') | ||
|
||
tk.Label(f1, text=__AppName__ + ' ' + str(__version__)).pack() | ||
tk.Label(f1, text='Copyright (C) 2023 Annorion').pack() | ||
tk.Label(f1, text='All rights reserved').pack() | ||
|
||
f = font.Font(size=10, slant='italic', underline=True) | ||
label1 = tk.Label(f3, text='Annorion', font=f, cursor='hand2') | ||
label1['foreground'] = 'blue' | ||
label1.pack(side=tk.LEFT) | ||
label1.bind('<Button-1>', call_link) | ||
label2 = tk.Label(self, text="Imagine and Build", font=f) | ||
label2.pack() | ||
ttk.Button(self, text='OK', command=self.destroy).pack(pady=10) | ||
|
||
if __name__ == "__main__": | ||
root = tk.Tk() | ||
app = DisplayAboutMe(root) | ||
root.mainloop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import tkinter as tk | ||
from tkinter import scrolledtext | ||
import ttkbootstrap as ttk | ||
from ttkbootstrap.scrolled import ScrolledText | ||
from resourcepath import resource_path, resource_path2 | ||
import json | ||
from metadata import __AppName__ | ||
from metadata import __version__ | ||
|
||
class ChangelogWindow(ttk.Toplevel): | ||
def __init__(self, parent): | ||
ttk.Toplevel.__init__(self, parent) | ||
|
||
self.transient(parent) | ||
self.result = None | ||
self.grab_set() | ||
w = 695 | ||
h = 398 | ||
|
||
sw = self.winfo_screenwidth() | ||
sh = self.winfo_screenheight() | ||
x = (sw - w) / 2 | ||
y = (sh - h) / 2 | ||
self.geometry('{0}x{1}+{2}+{3}'.format(w, h, int(x), int(y))) | ||
self.title('ChangeLogs') | ||
self.icon = resource_path('images/unt.ico') | ||
self.iconbitmap(self.icon) | ||
#self.bind("<Configure>", self.on_resize) | ||
|
||
changelog_text = f""" | ||
Version {__version__}: | ||
New GUI created with the beautiful ttkbootstrap framework, featuring: | ||
- Sending one file at a time using the main 'Send' button. | ||
- Drag-and-drop functionality for easy file selection (one file at a time). | ||
- Support for saved profiles of senders and receivers, streamlining file transfer | ||
without the need to type the receiver's IP address each time. | ||
- Capability to receive files from a sender with remarkable speed. | ||
- Inclusion of a progress bar to visualize the file transfer progress. | ||
- Ability to link your phone and PC effortlessly by scanning the QR code. | ||
- Simple process for downloading YouTube videos with just a few clicks. | ||
- Support for both light and dark modes. | ||
- Multilingual support for a user-friendly experience. | ||
""" | ||
|
||
self.sc = ttk.Text(self,bg="#f8f8f8",wrap='word',spacing1=2) | ||
self.sc.insert(ttk.END, changelog_text) | ||
self.sc.config(state=ttk.DISABLED) | ||
|
||
# # Add a vertical scrollbar | ||
scrollbar = ttk.Scrollbar(self, bootstyle='danger', command=self.sc.yview) | ||
scrollbar.pack(side=tk.RIGHT, fill=tk.Y) | ||
self.sc.config(yscrollcommand=scrollbar.set) | ||
self.sc.pack(expand=True, fill=ttk.BOTH) | ||
|
||
# tree_scroll = ttk.Scrollbar(self, orient="vertical", command=self.sc.yview) | ||
# self.sc.configure(yscrollcommand=tree_scroll.set) | ||
# tree_scroll.pack(side=tk.RIGHT, fill=tk.Y) | ||
|
||
|
||
# self.sc = ScrolledText(self,autohide=True, bootstyle='danger', wrap='word',spacing1=2) | ||
# self.sc.insert(ttk.END, changelog_text) | ||
# #self.sc.config(state=ttk.DISABLED) | ||
# self.sc.pack(expand=True, fill=ttk.BOTH) | ||
# def on_resize(self,event): | ||
# width = self.winfo_width() | ||
# height = self.winfo_height() | ||
# print(f"Window size for how to is {width} x {height}") | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"profile_image": "C:\\Users\\DELL\\Desktop\\code_base\\convetransfer_1280_720\\images/default.png", "stats": {"Name": "James", "Age": 30, "Location": "City"}, "Mode": "darkly", "Tips": "OFF"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
import sqlite3 | ||
import os | ||
def Database(): | ||
global conn, cursor | ||
#global db | ||
#db = 'file_transfer.db' | ||
|
||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
cursor.execute(''' CREATE TABLE IF NOT EXISTS member ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
sent TEXT, | ||
date TEXT, | ||
size TEXT, | ||
received TEXT, | ||
sent_location TEXT, | ||
received_location TEXT | ||
) | ||
''') | ||
conn.commit() | ||
conn.close() | ||
|
||
|
||
def insert_sent_file(filename, datetime, size, sent_location): | ||
|
||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
cursor.execute(''' | ||
INSERT INTO member (sent,date,size,received,sent_location) | ||
VALUES (?, ?, ?, ?, ?) | ||
''', (filename, datetime,size, "", sent_location)) | ||
conn.commit() | ||
conn.close() | ||
|
||
|
||
def insert_received_file(filename, datetime, size, received_location): | ||
|
||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
cursor.execute(''' | ||
INSERT INTO member (sent,date,size,received,received_location) | ||
VALUES (?, ?, ?, ?, ?) | ||
''', ("", datetime, size, filename, received_location)) | ||
conn.commit() | ||
conn.close() | ||
|
||
|
||
def get_transferred_files(): | ||
|
||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
cursor.execute('SELECT * FROM member') | ||
fetch = cursor.fetchall() | ||
conn.commit() | ||
conn.close() | ||
|
||
return fetch | ||
|
||
def get_files(): | ||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
cursor.execute('SELECT sent, date, size, received, sent_location, received_location FROM member') | ||
fetch = cursor.fetchall() | ||
conn.commit() | ||
conn.close() | ||
return fetch | ||
|
||
|
||
|
||
def delete_item(filename, datetime, size): | ||
try: | ||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
cursor.execute("DELETE FROM member WHERE sent=? AND date=? AND size=? AND received=?", (filename, datetime, size, "")) | ||
#cursor.execute("DELETE FROM member WHERE sent=? AND date=? AND size=? AND received=?", ("", datetime, size, filename)) | ||
conn.commit() | ||
conn.close() | ||
return True | ||
except sqlite3.Error as e: | ||
print("Error deleting item from the database:", str(e)) | ||
conn.rollback() | ||
return False | ||
|
||
|
||
def delete_item_rec(filename, datetime, size): | ||
try: | ||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
cursor.execute("DELETE FROM member WHERE sent=? AND date=? AND size=? AND received=?", ("", datetime, size, filename)) | ||
#cursor.execute("DELETE FROM member WHERE sent=? AND date=? AND size=? AND received=?", ("", datetime, size, filename)) | ||
conn.commit() | ||
conn.close() | ||
return True | ||
except sqlite3.Error as e: | ||
print("Error deleting item from the database:", str(e)) | ||
conn.rollback() | ||
return False | ||
|
||
|
||
def get_sent_received_counts(): | ||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
|
||
cursor.execute("SELECT COUNT(*) FROM member WHERE sent != ''") | ||
sent_count = cursor.fetchone()[0] | ||
|
||
cursor.execute("SELECT COUNT(*) FROM member WHERE received != ''") | ||
received_count = cursor.fetchone()[0] | ||
|
||
conn.close() | ||
|
||
return sent_count, received_count | ||
|
||
def get_sent_counts(): | ||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
|
||
cursor.execute("SELECT COUNT(*) FROM member WHERE sent != ''") | ||
sent_count = cursor.fetchone()[0] | ||
|
||
|
||
conn.close() | ||
|
||
return sent_count | ||
|
||
|
||
def get_received_counts(): | ||
conn = sqlite3.connect('file_transfer.db') | ||
cursor = conn.cursor() | ||
|
||
cursor.execute("SELECT COUNT(*) FROM member WHERE received != ''") | ||
received_count = cursor.fetchone()[0] | ||
|
||
conn.close() | ||
|
||
return received_count |
Oops, something went wrong.