11 Commits

Author SHA1 Message Date
3fd0147158 implemented status bar covering #8 2025-04-27 00:33:10 +02:00
aec7770e74 added statusbar with stringvar 2025-04-27 00:24:30 +02:00
d16aefe20f refactoring 2025-04-27 00:21:12 +02:00
307057a387 0.6a release 2025-04-26 23:41:57 +02:00
4917e5e9bd added version number to compile script 2025-04-26 23:40:20 +02:00
3f6b22abc8 added version number to compile script 2025-04-26 23:40:13 +02:00
6785a8f46d icon png version 2025-04-26 23:09:21 +02:00
dd51921784 Merge branch 'detached' with bugfix #5 2025-04-26 22:55:21 +02:00
15dc182a37 bugfix #5 final and tested 2025-04-26 22:47:03 +02:00
057e0a02de #5 new fix 2025-04-26 13:27:45 +02:00
6c8ce7b208 bugfix #5 2025-04-26 13:03:15 +02:00
5 changed files with 48 additions and 9 deletions

View File

@@ -3,6 +3,16 @@ if [ $VIRTUAL_ENV=="" ]
then then
source venv/bin/activate source venv/bin/activate
fi fi
version=$(cat version.txt)
echo "current version set to: $version"
new_version=""
read -r -p "Enter new version or empty to keep the current: " new_version
if [ "$new_version" != "" ]
then
echo "$new_version" | tee version.txt
fi
sed -i "s/VERSION = '[0-9]\.[0-9]\w'/VERSION = '$(cat version.txt)'/g" src/brovski-adress-etiketten-verwaltung.py
sed -i "s/Version: [0-9]\.[0-9]\w/Version: $(cat version.txt)/g" deb-package/brovski-adressetiketten/DEBIAN/control
pyinstaller --clean --onefile src/brovski-adress-etiketten-verwaltung.py pyinstaller --clean --onefile src/brovski-adress-etiketten-verwaltung.py
cp dist/brovski-adress-etiketten-verwaltung deb-package/brovski-adressetiketten/usr/local/bin/brovski-adressetiketten cp dist/brovski-adress-etiketten-verwaltung deb-package/brovski-adressetiketten/usr/local/bin/brovski-adressetiketten

View File

@@ -1,5 +1,5 @@
Package: brovski-adressetiketten Package: brovski-adressetiketten
Version: 0.4a Version: 0.6a
Maintainer: Ovski Maintainer: Ovski
Architecture: all Architecture: all
Description: manage csv files for glables address labels Description: manage csv files for glables address labels

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

View File

@@ -18,7 +18,8 @@ class Application:
y_offset = 200 y_offset = 200
width = 1050 width = 1050
height = 700 height = 700
title = "Brovski Adress-Etiketten Verwaltung" VERSION = '0.6a'
title = f"Brovski Adress-Etiketten Verwaltung {VERSION}"
self.root = tk.Tk(className="BrovskiAdressEtiketten") self.root = tk.Tk(className="BrovskiAdressEtiketten")
self.root.title(title) self.root.title(title)
@@ -41,6 +42,11 @@ class Application:
self.json_file = os.path.join(self.json_path, self.json_file_name) self.json_file = os.path.join(self.json_path, self.json_file_name)
self.csv_file = os.path.join(self.csv_path, self.csv_file_name) self.csv_file = os.path.join(self.csv_path, self.csv_file_name)
# status bar content
self.statusbar = tk.StringVar()
self.length_address_list = None
self.length_address_list_active = None
# leave application if settings are bad # leave application if settings are bad
if not self.config_good: if not self.config_good:
show_error(message_title="Fehler Konfiguration", show_error(message_title="Fehler Konfiguration",
@@ -49,8 +55,15 @@ class Application:
) )
sys.exit() sys.exit()
# frames
top_frame = tk.Frame(self.root) top_frame = tk.Frame(self.root)
top_frame.pack(side=tk.TOP, fill=tk.X) top_frame.pack(side=tk.TOP, fill=tk.X)
data_frame = tk.Frame(self.root, bg="teal")
data_frame.pack(side=tk.TOP, fill=tk.BOTH, expand=True)
bottom_frame = tk.Frame(self.root)
bottom_frame.pack(side=tk.BOTTOM, fill=tk.X)
# top buttons
button_width = 8 button_width = 8
tk.Button(top_frame, text="Insert", command=self.insert_record, width=button_width).pack(side=tk.LEFT) tk.Button(top_frame, text="Insert", command=self.insert_record, width=button_width).pack(side=tk.LEFT)
tk.Button(top_frame, text="Delete", command=self.delete_record, width=button_width).pack(side=tk.LEFT) tk.Button(top_frame, text="Delete", command=self.delete_record, width=button_width).pack(side=tk.LEFT)
@@ -59,9 +72,7 @@ class Application:
tk.Button(top_frame, text="Quit", command=self.on_close, width=button_width).pack(side=tk.RIGHT) tk.Button(top_frame, text="Quit", command=self.on_close, width=button_width).pack(side=tk.RIGHT)
tk.Button(top_frame, text="Settings", command=self.show_settings, width=button_width).pack(side=tk.RIGHT) tk.Button(top_frame, text="Settings", command=self.show_settings, width=button_width).pack(side=tk.RIGHT)
data_frame = tk.Frame(self.root, bg="teal") # table content
data_frame.pack(side=tk.TOP, fill=tk.BOTH, expand=True)
scrollbar = ttk.Scrollbar(data_frame, orient=tk.VERTICAL) scrollbar = ttk.Scrollbar(data_frame, orient=tk.VERTICAL)
self.table = ttk.Treeview(data_frame, yscrollcommand=scrollbar.set, columns=("0", "1", "2", "3", "4"), self.table = ttk.Treeview(data_frame, yscrollcommand=scrollbar.set, columns=("0", "1", "2", "3", "4"),
show="headings") show="headings")
@@ -79,6 +90,9 @@ class Application:
self.table.bind("<Return>", self.mouse_click_double) self.table.bind("<Return>", self.mouse_click_double)
self.table.bind("<Double-1>", self.mouse_click_double) self.table.bind("<Double-1>", self.mouse_click_double)
# bottom status bar
tk.Label(bottom_frame, textvariable=self.statusbar).pack(side=tk.LEFT)
self._load_json_file() self._load_json_file()
self.root.mainloop() self.root.mainloop()
@@ -243,10 +257,10 @@ class Application:
for address in self.address_list: for address in self.address_list:
if address[0] != "x": if address[0] != "x":
continue continue
del address[0] if address[1] == "":
if address[0] == "": writer.writerow(address[2:])
del address[0] else:
writer.writerow(address) writer.writerow(address[1:])
except FileNotFoundError: except FileNotFoundError:
show_error(message_title="Unexpected error", show_error(message_title="Unexpected error",
message=f"Could not write file {self.csv_file}", message=f"Could not write file {self.csv_file}",
@@ -257,6 +271,7 @@ class Application:
self.delete_all_table_items() self.delete_all_table_items()
for index, item in enumerate(self.address_list): for index, item in enumerate(self.address_list):
self.table.insert('', 'end', iid=index, values=item) self.table.insert('', 'end', iid=index, values=item)
self.update_status_bar()
def export_table_to_address_list(self): def export_table_to_address_list(self):
self.address_list.clear() self.address_list.clear()
@@ -264,6 +279,7 @@ class Application:
self.address_list.append([]) self.address_list.append([])
for value in self.table.item(child)['values']: for value in self.table.item(child)['values']:
self.address_list[-1].append(value) self.address_list[-1].append(value)
self.update_status_bar()
def delete_all_table_items(self): def delete_all_table_items(self):
for item in self.table.get_children(): for item in self.table.get_children():
@@ -282,6 +298,18 @@ class Application:
window.wait_visibility() window.wait_visibility()
window.grab_set() window.grab_set()
def update_status_bar(self):
self._count_address_records()
self.statusbar.set(f"Adressen: {self.length_address_list} | Aktive Adressen: {self.length_address_list_active}")
def _count_address_records(self):
self.length_address_list = len(self.address_list)
count = 0
for address in self.address_list:
if address[0] == "x":
count += 1
self.length_address_list_active = count

1
version.txt Normal file
View File

@@ -0,0 +1 @@
0.6a