diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4a5810d..2946b7e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -78,6 +78,7 @@ + @@ -100,5 +101,6 @@ + \ No newline at end of file diff --git a/changelog-UC.txt b/changelog-UC.txt index 6a5fc21..5246ea5 100644 --- a/changelog-UC.txt +++ b/changelog-UC.txt @@ -16,3 +16,6 @@ 4.0 Alpha (Build 19346.2) - Stworzenie okna ustawień programu + +4.0 Alpha (Build 19349) +- Ukończenie okna ustawień diff --git a/components/__pycache__/dialog.cpython-38.pyc b/components/__pycache__/dialog.cpython-38.pyc index 057de7d..7ef5676 100644 Binary files a/components/__pycache__/dialog.cpython-38.pyc and b/components/__pycache__/dialog.cpython-38.pyc differ diff --git a/components/__pycache__/load_config.cpython-38.pyc b/components/__pycache__/load_config.cpython-38.pyc index d0e2ef0..64f87e9 100644 Binary files a/components/__pycache__/load_config.cpython-38.pyc and b/components/__pycache__/load_config.cpython-38.pyc differ diff --git a/components/dialog.py b/components/dialog.py index 4caaa24..e022e84 100644 --- a/components/dialog.py +++ b/components/dialog.py @@ -1,6 +1,6 @@ """ # GeneratorCSV -# Wersja 4.0: UC 2 +# Wersja 4.0 Experimental # by Mateusz Skoczek # luty 2019 - grudzień 2019 # dla ZSP Sobolew diff --git a/components/load_config.py b/components/load_config.py index 1653dec..f8cca29 100644 --- a/components/load_config.py +++ b/components/load_config.py @@ -1,6 +1,6 @@ """ # GeneratorCSV -# Wersja 4.0: UC 2 +# Wersja 4.0 Experimental # by Mateusz Skoczek # luty 2019 - grudzień 2019 # dla ZSP Sobolew @@ -25,6 +25,8 @@ E002x00 = ["Bład pliku konfiguracyjnego ('config.cfg').\nNiepoprawna ilość wi E002x01 = ["Bład pliku konfiguracyjnego ('config.cfg').\nNiepoprawne dane w wierszu 1\nPrzywróć plik. (E002x01)", True] E002x02 = ["Bład pliku konfiguracyjnego ('config.cfg').\nNiepoprawne dane w wierszu 2\nPrzywróć plik. (E002x02)", True] +I001 = ["Pomyślnie zapisano!\nDla niektórych zmian może być wymagane ponowne uruchomienie programu", False] + @@ -112,4 +114,5 @@ def edit(settings): SettingsToSave.append('Kodowanie wyjsciowe: ' + str(settings[1])) with open('.\config.cfg', 'w') as cfg: for x in SettingsToSave: - cfg.write(x) \ No newline at end of file + cfg.write(x) + MDdlg.Inf(I001) \ No newline at end of file diff --git a/components/main.py b/components/main.py index 2b9b8e5..19ae784 100644 --- a/components/main.py +++ b/components/main.py @@ -1,6 +1,6 @@ """ # GeneratorCSV -# Wersja 4.0: UC 2 +# Wersja 4.0 Experimental # by Mateusz Skoczek # luty 2019 - grudzień 2019 # dla ZSP Sobolew @@ -17,7 +17,7 @@ # -------------------------------------------- # Informacje o programie # -------------------------------------------- # Nazwa = 'GeneratorCSV' -Wersja = '4.0: UC 2' +Wersja = '4.0 Experimental' @@ -64,6 +64,7 @@ except ModuleNotFoundError: # Biblioteki zewnętrzne interfejsu graficznego from tkinter import filedialog as TKfld +from tkinter import ttk as TKttk import tkinter as TK @@ -126,25 +127,59 @@ def settings(): Ramka1.config(text = ' Motyw programu ') Ramka1.config(bg = B_tlo, fg = B_text) Ramka1.config(borderwidth = B_framewielkosc) - Ramka1.grid(row = 1) + Ramka1.grid(row = 1, pady = 5) + + Motyw_var = TK.StringVar() + if int(MDlcg.read()[0]) == 1: + Motyw_var.set('Ciemny') + Motyw_index = 1 + else: + Motyw_var.set('Jasny') + Motyw_index = 0 + + Motyw_list = TKttk.Combobox(Ramka1) + Motyw_list.config(textvariable = Motyw_var, state = 'readonly') + Motyw_list.config(width = 43) + Motyw_list.grid(row = 0, pady = 5, padx = 5) + Motyw_list['values'] = ('Jasny', 'Ciemny') + Motyw_list.current(Motyw_index) - # Radiobutton (motyw) - RB_var = TK.StringVar() - RB_var.set(MDlcg.read()[0]) + # Frame2 - Kodowanie + Ramka2 = TK.LabelFrame(SettingsWindow) + Ramka2.config(text = ' Kodowanie wyjściowe ') + Ramka2.config(bg = B_tlo, fg = B_text) + Ramka2.config(borderwidth = B_framewielkosc) + Ramka2.grid(row = 2, pady = 5) - RB_ciemny = TK.Radiobutton(Ramka1) - RB_ciemny.config(text = 'Ciemny') - RB_ciemny.config(variable = RB_var, value = '1') - RB_ciemny.config(bg = B_tlo, fg = B_text) + Code_var = TK.StringVar() + Code_var.set(MDlcg.read()[1]) - RB_jasny = TK.Radiobutton(Ramka1) - RB_jasny.config(text = 'Jasny') - RB_jasny.config(variable = RB_var, value = '0') - RB_jasny.config(bg = B_tlo, fg = B_text) + Code_list = TKttk.Combobox(Ramka2) + Code_list.config(textvariable = Code_var, state = 'readonly') + Code_list.config(width = 43) + Code_list.grid(row = 0, pady = 5, padx = 5) + Code_list['values'] = ('utf-8') + Code_list.set(MDlcg.read()[1]) - RB_ciemny.grid(row = 0, column = 0, padx = 40) - RB_jasny.grid(row = 0, column = 1, padx = 40) + + # Przycisk ZAPISZ + def zapis(): + X1 = Motyw_list.get() + if X1 == 'Jasny': + X1 = '0' + else: + X1 = '1' + X2 = Code_list.get() + ToSave = [X1, X2] + MDlcg.edit(ToSave) + SettingsWindow.destroy() + PrzyciskZAPISZ = TK.Button(SettingsWindow) + PrzyciskZAPISZ.config(text = 'ZAPISZ') + PrzyciskZAPISZ.config(command = zapis) + PrzyciskZAPISZ.config(width = 40) + PrzyciskZAPISZ.config(bg = B_przycisktlo, fg = B_przycisktext, relief = 'flat', activebackground = B_przycisktlo) + PrzyciskZAPISZ.grid(row = 3, pady = 8) SettingsWindow.mainloop() diff --git a/generator.py b/generator.py index e810ba3..911865e 100644 --- a/generator.py +++ b/generator.py @@ -1,6 +1,6 @@ """ # GeneratorCSV -# Wersja 4.0: UC 2 +# Wersja 4.0 Experimental # by Mateusz Skoczek # luty 2019 - grudzień 2019 # dla ZSP Sobolew