Add SettingsDialog. Add files to dynamic translation between en_GB and pl_PL. Add resources.qrc. Add scripts to generate update translation files and resource file. Add project file magicpodcast.pro. Fixes and refactoring. Update pylama configuration. Add docs directory. Pylama fixes.

This commit is contained in:
Jarosław Wieczorek 2021-01-04 20:04:48 +01:00
parent 3a2fcd3e24
commit 649eb0eee0
17 changed files with 111517 additions and 39 deletions

2
generate_linguist_update.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
pipenv run python -m PyQt5.pylupdate_main 'magicpodcast.pro'

2
generate_pyrcc_update.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
pipenv run python -m PyQt5.pyrcc_main resources.qrc -o resources_rc.py

9
magicpodcast.pro Normal file
View File

@ -0,0 +1,9 @@
# magicpodcast.pro
SOURCES += src/python/ui/mainwindow_ui.py
src/python/ui/settings_dialog_ui.py \
src/python/ui/preview_dialog_ui.py
TRANSLATIONS += src/gui/dicts/magicpodcast.pl.ts \
src/gui/dicts/magicpodcast.en.ts
RESOURCES += resources.qrc

View File

@ -1,7 +1,7 @@
[pylama] [pylama]
linters = pep8,pyflakes linters = pep8,pyflakes
format = pylint format = pylint
skip = *_ui.py skip = *_ui.py,*/.env/*,node_modules/*,resources_rc.py
#ignore = E201,E202,E231,E701 #ignore = E201,E202,E231,E701

22
resources.qrc Normal file
View File

@ -0,0 +1,22 @@
<RCC>
<qresource prefix="left">
<file>src/gui/images/left.png</file>
</qresource>
<qresource prefix="right">
<file>src/gui/images/right.png</file>
</qresource>
<qresource prefix="none">
<file>src/gui/images/none.png</file>
</qresource>
<qresource prefix="both">
<file>src/gui/images/both.png</file>
</qresource>
<qresource prefix="language">
<file>src/gui/dicts/magicpodcast.en.qm</file>
<file>src/gui/dicts/magicpodcast.pl.qm</file>
</qresource>
</RCC>

110697
resources_rc.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,164 @@
<!DOCTYPE QPH>
<QPH language="en_GB" sourcelanguage="pl_PL">
<phrase>
<source>Plik audio 1 rozmówcy</source>
<target>Audio file 1 speaker</target>
<definition>speaker_audio_first</definition>
</phrase>
<phrase>
<source>Imię 1 rozmówcy</source>
<target>Name of 1 speaker</target>
<definition>speaker_name_first</definition>
</phrase>
<phrase>
<source>Dodaj audio 1</source>
<target>Add audio 1</target>
<definition>add_audio_first</definition>
</phrase>
<phrase>
<source>Plik audio 2 rozmówcy</source>
<target>Audio file 2 speaker</target>
<definition>speaker_audio_second</definition>
</phrase>
<phrase>
<source>Dodaj audio 2</source>
<target>Add audio 2</target>
<definition>add_audio_second</definition>
</phrase>
<phrase>
<source> Imię 2 rozmówcy</source>
<target> Name of 2 speaker</target>
<definition>speaker_name_second</definition>
</phrase>
<phrase>
<source>Zaznacz jeśli kanały rozmówców są połączone w jednym nagraniu</source>
<target>Mark if the speaker channels are connected in one recording</target>
<definition>mark_connected_channels</definition>
</phrase>
<phrase>
<source>Podgląd - rozmówcy aktywni</source>
<target>Preview - active speakers</target>
<definition>preview_active_speakers</definition>
</phrase>
<phrase>
<source>Rozmówcy - aktywni</source>
<target>Speakers - active</target>
<definition>active_speakers</definition>
</phrase>
<phrase>
<source>Podgląd - rozmówcy nieaktywni</source>
<target>Preview - speakers inactive</target>
<definition>preview_inactive_speakers</definition>
</phrase>
<phrase>
<source>Rozmówcy - nieaktywni</source>
<target>Speakers - inactive</target>
<definition>inactive_speakers</definition>
</phrase>
<phrase>
<source>Podgląd - 1 rozmówca aktywny</source>
<target>Preview - 1 speaker active</target>
<definition>preview_active_first_speaker</definition>
</phrase>
<phrase>
<source>Pierwszy rozmówca - aktywny</source>
<target>First speaker - active</target>
<definition>active_first_speaker</definition>
</phrase>
<phrase>
<source>Podgląd - 2 rozmówca aktywny</source>
<target>Preview - 2 speaker active</target>
<definition>preview_active_second_speaker</definition>
</phrase>
<phrase>
<source>Drugi rozmówca - aktywny</source>
<target>Second speaker - active</target>
<definition>active_second_speaker</definition>
</phrase>
<phrase>
<source>Poziom wykrywania głosu</source>
<target>Voice detection level</target>
<definition>voice_detection_level</definition>
</phrase>
<phrase>
<source>Podgląd podcastu</source>
<target>Preview a podcast</target>
<definition>podcast_preview</definition>
</phrase>
<phrase>
<source>Projekt</source>
<target>Project</target>
<definition>project</definition>
</phrase>
<phrase>
<source>Nowy projekt</source>
<target>New project</target>
<definition>new_project</definition>
</phrase>
<phrase>
<source>Kliknij, aby utwórzyć nowy projekt</source>
<target>Click to create a new project</target>
<definition>create_new_project</definition>
</phrase>
<phrase>
<source>Otwórz projekt</source>
<target>Open a project</target>
<definition>open_project</definition>
</phrase>
<phrase>
<source>Kliknij, aby otworzyć istniejący projekt</source>
<target>Click to open an existing project</target>
<definition>tooltip_open_project
</definition>
</phrase>
<phrase>
<source>Zapisz projekt</source>
<target>Save the project</target>
<definition>save_project</definition>
</phrase>
<phrase>
<source>Kliknij, aby zapisać aktualny projekt</source>
<target>Click to save the current project</target>
<definition>tooltip_save_project</definition>
</phrase>
<phrase>
<source>Zapisz projekt jako</source>
<target>Save the project as</target>
<definition>save_project_as</definition>
</phrase>
<phrase>
<source>Kliknij, aby zapisać projekt jako</source>
<target>Click to save the project as</target>
<definition>tooltip_save_project_as</definition>
</phrase>
<phrase>
<source>Zamknij program</source>
<target>Close the program</target>
<definition>close_program</definition>
</phrase>
<phrase>
<source>Kliknij, aby zakończyć działanie programu</source>
<target>Click to end the program</target>
<definition>tooltip_close_program</definition>
</phrase>
<phrase>
<source>Ustawienia</source>
<target>Settings</target>
<definition>settings</definition>
</phrase>
<phrase>
<source>Kliknij, aby przejść do ustawień programu</source>
<target>Click to go to program settings</target>
<definition>tooltip_settings</definition>
</phrase>
<phrase>
<source>O programie MagicPodcast</source>
<target>About the MagicPodcast program</target>
<definition>about_program</definition>
</phrase>
<phrase>
<source>Kliknij, aby wyświetlić informacje dotyczące programu MagicPodcast</source>
<target>Click to view MagicPodcast information</target>
<definition>tooltip_about_program</definition>
</phrase>
</QPH>

Binary file not shown.

View File

@ -0,0 +1,211 @@
<!DOCTYPE TS>
<TS version="2.1" language="pl_PL" sourcelanguage="en_GB">
<context>
<name>MainWindow</name>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="294"/>
<source>MagicPodcast</source>
<translation>MagicPodcast</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="295"/>
<source>Audio file 1 speaker</source>
<translation>Plik audio 1 rozmówcy</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="296"/>
<source>Name of 1 speaker</source>
<translation>Imię 1 rozmówcy</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="297"/>
<source>Add audio 1</source>
<translation>Dodaj audio 1</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="298"/>
<source>Audio file 2 speaker</source>
<translation>Plik audio 2 rozmówcy</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="299"/>
<source>Name of 2 speaker</source>
<translation>Imię 2 rozmówcy</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="300"/>
<source>Add audio 2</source>
<translation>Dodaj audio 2</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="301"/>
<source>Mark if the speaker channels are connected in one recording</source>
<translation>Zaznacz jeśli kanały rozmówców &#xa0;połączone w jednym nagraniu</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="302"/>
<source>Preview - active speakers</source>
<translation>Podgląd - rozmówcy aktywni</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="303"/>
<source>Speakers - active</source>
<translation>Rozmówcy - aktywni</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="304"/>
<source>Preview - speakers inactive</source>
<translation>Podgląd - rozmówcy nieaktywni</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="305"/>
<source>Speakers - inactive</source>
<translation>Rozmówcy - nieaktywni</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="306"/>
<source>Preview - 1 speaker active</source>
<translation>Podgląd - 1 rozmówca aktywny</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="307"/>
<source>First speaker - active</source>
<translation>Pierwszy rozmówca - aktywny</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="308"/>
<source>Preview - 2 speaker active</source>
<translation>Podgląd - 2 rozmówca aktywny</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="309"/>
<source>Second speaker - active</source>
<translation>Drugi rozmówca - aktywny</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="310"/>
<source>Voice detection level:</source>
<translation>Poziom wykrywania głosu:</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="311"/>
<source>Preview</source>
<translation>Podgląd</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="312"/>
<source>Generate a podcast</source>
<translation>Wygeneruj podcast</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="313"/>
<source>Project</source>
<translation>Projekt</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="314"/>
<source>New project</source>
<translation>Nowy projekt</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="315"/>
<source>Click to create a new project</source>
<translation>Kliknij, aby utwórzyć nowy projekt</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="316"/>
<source>Ctrl+N</source>
<translation>Ctrl+N</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="317"/>
<source>Open a project</source>
<translation>Otwórz projekt</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="318"/>
<source>Click to open an existing project</source>
<translation>Kliknij, aby otworzyć istniejący projekt</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="319"/>
<source>Ctrl+O</source>
<translation>Ctrl+O</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="320"/>
<source>Save the project</source>
<translation>Zapisz projekt</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="321"/>
<source>Click to save the current project</source>
<translation>Kliknij, aby zapisać aktualny projekt</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="322"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="323"/>
<source>Save the project as</source>
<translation>Zapisz projekt jako</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="324"/>
<source>Click to save the project as</source>
<translation>Kliknij, aby zapisać projekt jako</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="325"/>
<source>Ctrl+Shift+S</source>
<translation>Ctrl+Shift+S</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="326"/>
<source>Close the program</source>
<translation>Zamknij program</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="327"/>
<source>Click to end the program</source>
<translation>Kliknij, aby zakończyć działanie programu</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="328"/>
<source>Ctrl+W</source>
<translation>Ctrl+W</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="329"/>
<source>Settings</source>
<translation>Ustawienia</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="330"/>
<source>Click to go to program settings</source>
<translation>Kliknij, aby przejść do ustawień programu</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="331"/>
<source>Ctrl+U</source>
<translation>Ctrl+U</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="332"/>
<source>About the MagicPodcast program</source>
<translation>O programie MagicPodcast</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="333"/>
<source>Click to view MagicPodcast information</source>
<translation>Kliknij, aby wyświetlić informacje dotyczące programu MagicPodcast</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="334"/>
<source>Ctrl+I</source>
<translation>Ctrl+I</translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@ -0,0 +1,212 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_GB" sourcelanguage="pl_PL">
<context>
<name>MainWindow</name>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="294"/>
<source>MagicPodcast</source>
<translation>MagicPodcast</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="295"/>
<source>Plik audio 1 rozmówcy</source>
<translation>Audio file 1 speaker</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="296"/>
<source>Imię 1 rozmówcy</source>
<translation>Name of 1 speaker</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="297"/>
<source>Dodaj audio 1</source>
<translation>Add audio 1</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="298"/>
<source>Plik audio 2 rozmówcy</source>
<translation>Audio file 2 speaker</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="299"/>
<source>Imię 2 rozmówcy</source>
<translation>Name of 2 speaker</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="300"/>
<source>Dodaj audio 2</source>
<translation>Add audio 2</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="301"/>
<source>Zaznacz jeśli kanały rozmówców &#xa0;połączone w jednym nagraniu</source>
<translation>Mark if the speaker channels are connected in one recording</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="302"/>
<source>Podgląd - rozmówcy aktywni</source>
<translation>Preview - active speakers</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="303"/>
<source>Rozmówcy - aktywni</source>
<translation>Speakers - active</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="304"/>
<source>Podgląd - rozmówcy nieaktywni</source>
<translation>Preview - speakers inactive</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="305"/>
<source>Rozmówcy - nieaktywni</source>
<translation>Speakers - inactive</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="306"/>
<source>Podgląd - 1 rozmówca aktywny</source>
<translation>Preview - 1 speaker active</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="307"/>
<source>Pierwszy rozmówca - aktywny</source>
<translation>First speaker - active</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="308"/>
<source>Podgląd - 2 rozmówca aktywny</source>
<translation>Preview - 2 speaker active</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="309"/>
<source>Drugi rozmówca - aktywny</source>
<translation>Second speaker - active</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="310"/>
<source>Poziom wykrywania głosu:</source>
<translation>Voice detection level:</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="311"/>
<source>Podgląd</source>
<translation>Preview</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="312"/>
<source>Wygeneruj podcast</source>
<translation>Generate a podcast</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="313"/>
<source>Projekt</source>
<translation>Project</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="314"/>
<source>Nowy projekt</source>
<translation>New project</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="315"/>
<source>Kliknij, aby utwórzyć nowy projekt</source>
<translation>Click to create a new project</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="316"/>
<source>Ctrl+N</source>
<translation>Ctrl+N</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="317"/>
<source>Otwórz projekt</source>
<translation>Open a project</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="318"/>
<source>Kliknij, aby otworzyć istniejący projekt</source>
<translation>Click to open an existing project</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="319"/>
<source>Ctrl+O</source>
<translation>Ctrl+O</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="320"/>
<source>Zapisz projekt</source>
<translation>Save the project</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="321"/>
<source>Kliknij, aby zapisać aktualny projekt</source>
<translation>Click to save the current project</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="322"/>
<source>Ctrl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="323"/>
<source>Zapisz projekt jako</source>
<translation>Save the project as</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="324"/>
<source>Kliknij, aby zapisać projekt jako</source>
<translation>Click to save the project as</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="325"/>
<source>Ctrl+Shift+S</source>
<translation>Ctrl+Shift+S</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="326"/>
<source>Zamknij program</source>
<translation>Close the program</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="327"/>
<source>Kliknij, aby zakończyć działanie programu</source>
<translation>Click to end the program</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="328"/>
<source>Ctrl+W</source>
<translation>Ctrl+W</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="329"/>
<source>Ustawienia</source>
<translation>Settings</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="330"/>
<source>Kliknij, aby przejść do ustawień programu</source>
<translation>Click to go to program settings</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="331"/>
<source>Ctrl+U</source>
<translation>Ctrl+U</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="332"/>
<source>O programie MagicPodcast</source>
<translation>About the MagicPodcast program</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="333"/>
<source>Kliknij, aby wyświetlić informacje dotyczące programu MagicPodcast</source>
<translation>Click to view MagicPodcast information</translation>
</message>
<message>
<location filename="../../python/ui/mainwindow_ui.py" line="334"/>
<source>Ctrl+I</source>
<translation>Ctrl+I</translation>
</message>
</context>
</TS>

135
src/gui/dicts/phrases.txt Normal file
View File

@ -0,0 +1,135 @@
Plik audio 1 rozmówcy
Audio file 1 speaker
speaker_audio_one
Imię 1 rozmówcy
Name of 1 speaker
speaker_name_one
Dodaj audio 1
Add audio 1
add_audio_one
Plik audio 2 rozmówcy
Audio file 2 speaker
speaker_audio_second
Imię 2 rozmówcy
Name of 2 speaker
speaker_name_second
Dodaj audio 2
Add audio 2
add_audio_second
Zaznacz jeśli kanały rozmówców są połączone w jednym nagraniu
Mark if the speaker channels are connected in one recording
mark_connected_channels
Podgląd - rozmówcy aktywni
Preview - active speakers
preview_active_speakers
Rozmówcy - aktywni
Speakers - active
active_speakers
Podgląd - rozmówcy nieaktywni
Preview - speakers inactive
preview_inactive_speakers
Rozmówcy - nieaktywni
Speakers - inactive
inactive_speakers
Podgląd - 1 rozmówca aktywny
Preview - 1 speaker active
preview_active_first_speaker
Pierwszy rozmówca - aktywny
First speaker - active
active_first_speaker
Podgląd - 2 rozmówca aktywny
Preview - 2 speaker active
preview_active_second_speaker
Drugi rozmówca - aktywny
Second speaker - active
active_second_speaker
Poziom wykrywania głosu
Voice detection level
voice_detection_level
Podgląd podcastu
Preview a podcast
podcast_preview
Wygeneruj podcast
Generate a podcast
podcast_generate
Projekt
Project
project
Nowy projekt
New project
new_project
Kliknij, aby utwórzyć nowy projekt
Click to create a new project
create_new_project
Otwórz projekt
Open a project
open_project
Kliknij, aby otworzyć istniejący projekt
Click to open an existing project
tooltip_open_project
Zapisz projekt
Save the project
save_project
Kliknij, aby zapisać aktualny projekt
Click to save the current project
tooltip_save_project
Zapisz projekt jako
Save the project as
save_project_as
Kliknij, aby zapisać projekt jako
Click to save the project as
tooltip_save_project_as
Zamknij program
Close the program
close_program
Kliknij, aby zakończyć działanie programu
Click to end the program
tooltip_close_program
Ustawienia
Settings
settings
Kliknij, aby przejść do ustawień programu
Click to go to program settings
tooltip_settings
O programie MagicPodcast
About the MagicPodcast program
about_program
Kliknij, aby wyświetlić informacje dotyczące programu MagicPodcast
Click to view MagicPodcast information
tooltip_about_program

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>v_layout_settings</class> <class>SettingsDialog</class>
<widget class="QDialog" name="v_layout_settings"> <widget class="QDialog" name="SettingsDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -65,7 +65,7 @@
<connection> <connection>
<sender>button_box</sender> <sender>button_box</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>v_layout_settings</receiver> <receiver>SettingsDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@ -81,7 +81,7 @@
<connection> <connection>
<sender>button_box</sender> <sender>button_box</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>v_layout_settings</receiver> <receiver>SettingsDialog</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View File

@ -1,20 +1,24 @@
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QMainWindow, QLabel,\
QFileDialog, QDialog, QDialogButtonBox, QVBoxLayout, QCheckBox
from PyQt5.QtCore import Qt
from src.python.ui.mainwindow_ui import Ui_MainWindow
import tempfile
import subprocess
import os import os
import shutil import shutil
import subprocess
import tempfile
from PyQt5.QtCore import Qt, QLocale, QLibraryInfo, QTranslator
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QMainWindow, QLabel, QFileDialog, QDialog, QDialogButtonBox, QVBoxLayout, QApplication
from src.python.classes.settings_dialog import SettingsDialog
from src.python.ui.mainwindow_ui import Ui_MainWindow
class MainWindow(QMainWindow, Ui_MainWindow): class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None): def __init__(self, parent=None):
super(MainWindow, self).__init__(parent=parent) super(MainWindow, self).__init__(parent=parent)
self.translator = QTranslator()
self.translator.load("qt_" + QLocale.system().name(), QLibraryInfo.location(QLibraryInfo.TranslationsPath))
print("qt_" + QLocale.system().name(), QLibraryInfo.location(QLibraryInfo.TranslationsPath))
app = QApplication.instance()
app.installTranslator(self.translator)
self.setupUi(self) self.setupUi(self)
self.setup_logic() self.setup_logic()
self.setup_detail() self.setup_detail()
self.aresample = 8000 self.aresample = 8000
self.test_data() self.test_data()
@ -33,6 +37,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.button_generate.clicked.connect(self.generate_video_podcast) self.button_generate.clicked.connect(self.generate_video_podcast)
self.check_box_connected_channels.setChecked(True) self.check_box_connected_channels.setChecked(True)
self.action_settings.triggered.connect(self.open_setting_dialog)
def setup_detail(self): def setup_detail(self):
self.line_edit_name_1.setDisabled(True) self.line_edit_name_1.setDisabled(True)
@ -40,7 +45,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def create_custom_dialog(self, title: str, msg: str): def create_custom_dialog(self, title: str, msg: str):
dialog = QDialog() dialog = QDialog()
dialog.setWindowTitle(title)
label = QLabel() label = QLabel()
label.setText(msg) label.setText(msg)
label.setObjectName('message_box') label.setObjectName('message_box')
@ -55,7 +59,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def test_data(self): def test_data(self):
self.line_edit_audio_1.setText('./src/sounds/oba_kanały.mp3') self.line_edit_audio_1.setText('./src/sounds/oba_kanały.mp3')
pixmap1 = QPixmap('./src/gui/images/both.png') pixmap1 = QPixmap('./src/gui/images/both.png')
scaled_pixmap1 = pixmap1.scaled(pixmap1.size(), Qt.KeepAspectRatio) scaled_pixmap1 = pixmap1.scaled(pixmap1.size(), Qt.KeepAspectRatio)
self.preview_label_avatar_1.setPixmap(scaled_pixmap1) self.preview_label_avatar_1.setPixmap(scaled_pixmap1)
@ -76,6 +79,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.preview_label_avatar_4.setPixmap(scaled_pixmap4) self.preview_label_avatar_4.setPixmap(scaled_pixmap4)
self.preview_label_avatar_4.setProperty('path', './src/gui/images/right.png') self.preview_label_avatar_4.setProperty('path', './src/gui/images/right.png')
def open_setting_dialog(self):
settings = SettingsDialog()
settings.exec()
language = settings.language
print(language)
def open_image_import(self, image_number: int): def open_image_import(self, image_number: int):
dialog = QFileDialog() dialog = QFileDialog()
dialog.setOption(dialog.DontUseNativeDialog, True) dialog.setOption(dialog.DontUseNativeDialog, True)
@ -83,13 +92,15 @@ class MainWindow(QMainWindow, Ui_MainWindow):
file_formats = "All Files (*);;JPG (*.jpg);;PNG (*.png)" file_formats = "All Files (*);;JPG (*.jpg);;PNG (*.png)"
file, _ = dialog.getOpenFileName(self, "QFileDialog.getOpenFileName()", "", file_formats, options=dialog.options()) file, _ = dialog.getOpenFileName(self, "QFileDialog.getOpenFileName()", "", file_formats, options=dialog.options())
if not file: if not file:
title = 'Ostrzeżenie'
msg = "[!] Nie wybrano żadnego pliku." msg = "[!] Nie wybrano żadnego pliku."
dialog = self.create_custom_dialog(title='Ostrzeżenie', msg=msg) dialog = self.create_custom_dialog(title=title, msg=msg)
dialog.exec_() dialog.exec_()
if file and not file.lower().endswith('.jpg') and not file.lower().endswith('.png'): if file and not file.lower().endswith('.jpg') and not file.lower().endswith('.png'):
title = 'Błąd'
msg = F"[!] Plik {file} nie jest plikiem jpg/png." msg = F"[!] Plik {file} nie jest plikiem jpg/png."
dialog = self.create_custom_dialog(title='Błąd', msg=msg) dialog = self.create_custom_dialog(title=title, msg=msg)
dialog.exec_() dialog.exec_()
else: else:

View File

@ -0,0 +1,13 @@
from PyQt5.QtWidgets import QDialog
from src.python.ui.settings_dialog_ui import Ui_SettingsDialog
class SettingsDialog(QDialog, Ui_SettingsDialog):
def __init__(self, parent=None):
super(SettingsDialog, self).__init__(parent=parent)
self.setupUi(self)
self.language = self.combo_box_language.currentText()
self.combo_box_language.currentTextChanged.connect(self.change_language)
def change_language(self):
print(F"[*] Zmiana języka na: {self.combo_box_language.currentText()}")

View File

@ -11,49 +11,49 @@
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_v_layout_settings(object): class Ui_SettingsDialog(object):
def setupUi(self, v_layout_settings): def setupUi(self, SettingsDialog):
v_layout_settings.setObjectName("v_layout_settings") SettingsDialog.setObjectName("SettingsDialog")
v_layout_settings.resize(400, 100) SettingsDialog.resize(400, 100)
v_layout_settings.setMaximumSize(QtCore.QSize(400, 100)) SettingsDialog.setMaximumSize(QtCore.QSize(400, 100))
self.verticalLayout = QtWidgets.QVBoxLayout(v_layout_settings) self.verticalLayout = QtWidgets.QVBoxLayout(SettingsDialog)
self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setObjectName("verticalLayout")
self.h_layout_language = QtWidgets.QHBoxLayout() self.h_layout_language = QtWidgets.QHBoxLayout()
self.h_layout_language.setObjectName("h_layout_language") self.h_layout_language.setObjectName("h_layout_language")
self.label_language = QtWidgets.QLabel(v_layout_settings) self.label_language = QtWidgets.QLabel(SettingsDialog)
self.label_language.setAlignment(QtCore.Qt.AlignCenter) self.label_language.setAlignment(QtCore.Qt.AlignCenter)
self.label_language.setObjectName("label_language") self.label_language.setObjectName("label_language")
self.h_layout_language.addWidget(self.label_language) self.h_layout_language.addWidget(self.label_language)
self.combo_box_language = QtWidgets.QComboBox(v_layout_settings) self.combo_box_language = QtWidgets.QComboBox(SettingsDialog)
self.combo_box_language.setObjectName("combo_box_language") self.combo_box_language.setObjectName("combo_box_language")
self.combo_box_language.addItem("") self.combo_box_language.addItem("")
self.combo_box_language.addItem("") self.combo_box_language.addItem("")
self.h_layout_language.addWidget(self.combo_box_language) self.h_layout_language.addWidget(self.combo_box_language)
self.verticalLayout.addLayout(self.h_layout_language) self.verticalLayout.addLayout(self.h_layout_language)
self.button_box = QtWidgets.QDialogButtonBox(v_layout_settings) self.button_box = QtWidgets.QDialogButtonBox(SettingsDialog)
self.button_box.setOrientation(QtCore.Qt.Horizontal) self.button_box.setOrientation(QtCore.Qt.Horizontal)
self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.button_box.setObjectName("button_box") self.button_box.setObjectName("button_box")
self.verticalLayout.addWidget(self.button_box) self.verticalLayout.addWidget(self.button_box)
self.retranslateUi(v_layout_settings) self.retranslateUi(SettingsDialog)
self.button_box.accepted.connect(v_layout_settings.accept) self.button_box.accepted.connect(SettingsDialog.accept)
self.button_box.rejected.connect(v_layout_settings.reject) self.button_box.rejected.connect(SettingsDialog.reject)
QtCore.QMetaObject.connectSlotsByName(v_layout_settings) QtCore.QMetaObject.connectSlotsByName(SettingsDialog)
def retranslateUi(self, v_layout_settings): def retranslateUi(self, SettingsDialog):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
v_layout_settings.setWindowTitle(_translate("v_layout_settings", "Ustawienia")) SettingsDialog.setWindowTitle(_translate("SettingsDialog", "Ustawienia"))
self.label_language.setText(_translate("v_layout_settings", "Język programu:")) self.label_language.setText(_translate("SettingsDialog", "Język programu:"))
self.combo_box_language.setItemText(0, _translate("v_layout_settings", "Angielski/English")) self.combo_box_language.setItemText(0, _translate("SettingsDialog", "Angielski/English"))
self.combo_box_language.setItemText(1, _translate("v_layout_settings", "Polski/Polish")) self.combo_box_language.setItemText(1, _translate("SettingsDialog", "Polski/Polish"))
if __name__ == "__main__": if __name__ == "__main__":
import sys import sys
app = QtWidgets.QApplication(sys.argv) app = QtWidgets.QApplication(sys.argv)
v_layout_settings = QtWidgets.QDialog() SettingsDialog = QtWidgets.QDialog()
ui = Ui_v_layout_settings() ui = Ui_SettingsDialog()
ui.setupUi(v_layout_settings) ui.setupUi(SettingsDialog)
v_layout_settings.show() SettingsDialog.show()
sys.exit(app.exec_()) sys.exit(app.exec_())