Skip to content

Commit

Permalink
שיפור תצוגת אנדרואיד, שיפור יצוא ויבוא רשימת זמרים
Browse files Browse the repository at this point in the history
  • Loading branch information
NHLOCAL committed Aug 26, 2024
1 parent 5088b97 commit 008b77d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/core/add_singer_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def cancel_clicked(e):
dialog.open = False
page.update()

cell_width = page.window.width * 0.3 if ANDROID_MODE else 150
cell_width = None if ANDROID_MODE else 150

# יצירת הטבלה
table = ft.DataTable(
Expand Down
22 changes: 11 additions & 11 deletions src/core/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import flet as ft
import csv
from shutil import copy

# קבצי התוכנה
from singles_sorter_v4 import MusicSorter, __VERSION__
Expand Down Expand Up @@ -304,6 +305,7 @@ def import_csv_result(e: ft.FilePickerResultEvent):
# שמירת נתונים לקובץ CSV קיים
with open("app/personal-singer-list.csv", "a", newline="", encoding="utf-8") as file:
writer = csv.writer(file)
writer.writerow([])
writer.writerows(data)

# הצגת הודעת הצלחה
Expand Down Expand Up @@ -336,18 +338,16 @@ def export_csv_result(e: ft.FilePickerResultEvent):
"""
if e.path:
try:
# קריאת נתונים מקובץ CSV קיים
with open("app/personal-singer-list.csv", "r", encoding="utf-8") as file:
reader = csv.reader(file)
data = list(reader)
# העתקת קובץ CSV קיים לקובץ חדש
src_path = "app/personal-singer-list.csv"
dest_path = e.path

# שמירת נתונים לקובץ CSV חדש
if not e.path.endswith(".csv"):
e.path += ".csv"
# לוודא שנתיב היעד כולל סיומת .csv
if not dest_path.endswith(".csv"):
dest_path += ".csv"

with open(e.path, "w", newline="", encoding="utf-8") as file:
writer = csv.writer(file)
writer.writerows(data)
# העתקת הקובץ
copy(src_path, dest_path)

# הצגת הודעת הצלחה
snack_bar = show_snackbar(f"הנתונים יוצאו בהצלחה לקובץ {e.path}", ft.colors.GREEN, mseconds=4000)
Expand Down Expand Up @@ -416,7 +416,7 @@ def toggle_content(e):
),

content=ft.Container( # הוספת Container לשליטה ברוחב
width=page.window.width if ANDROID_MODE else page.window.width * 0.7, # קביעת רוחב קבוע
width=None if ANDROID_MODE else page.window.width * 0.7, # קביעת רוחב קבוע
#height=page.window.width if ANDROID_MODE else page.window.width * 0.7
content=ft.Column(
[
Expand Down

0 comments on commit 008b77d

Please sign in to comment.