Skip to content

Commit

Permalink
Merge pull request #23 from r-liner/develop (v2.2.0)
Browse files Browse the repository at this point in the history
v2.2.0
  • Loading branch information
liner-exe committed May 21, 2024
2 parents 17b67fb + 82cffae commit be6ccfe
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0
2.2.0
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PasswordGenerator-GUI (v2.1.0)
# PasswordGenerator-GUI (v2.2.0)
## ❓ About
**Password Generator** with graphical interface on *customtkinter*. <br>
It`s basicaly project i made for fun. And as well for **password generation** purposes. <br>
Expand All @@ -17,15 +17,15 @@ So you can *contribute* this, you can *request new features*.
<img src='./images/screenshot_win_v2-0-0_primary.png' width=642 height=376 alt='screenshot_win_v2-0-0_primary'>
<br><br>

**Windows 10 - Settings window (v2.0.0)** <br>
**Windows 10 - Settings window (v2.2.0)** <br>

<img src='./images/screenshot_win_v2-0-0_settings.png' width=451 height=419 alt='screenshot_win_v2-0-0_setting'>
<img src='./images/screenshot_win_v2-2-0_settings.png' width=451 height=419 alt='screenshot_win_v2-0-0_setting'>
<br><br>

## ⚙️ Compatibility
| **Operation System** | **Status** | **Version**|
| :---------: | :-----------: | :-----------: |
| **Windows** | 🟢 Compatible | v2.0.1 |
| **Windows** | 🟢 Compatible | v2.2.0 |
| **Linux** | 🟡 Not tested | x |
| **MacOS** | 🟡 Not tested | x |

Expand Down
Binary file added images/screenshot_win_v2-2-0_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 59 additions & 6 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,23 +255,31 @@ def open_settings(self):
amode_label = ctk.CTkLabel(customization, text=self.response.get("dropdown-theme-color"))
amode_label.grid(row=4, column=0)

theme_dark = self.response.get("theme-dark")
theme_white = self.response.get("theme-white")
theme_system = self.response.get("theme-system")

amode_dropdown = ctk.CTkComboBox(customization,
values=['dark', 'white', 'system'],
command=lambda value: setattr(self, 'theme_color', value),
values=[f'{theme_dark}', f'{theme_white}', f'{theme_system}'],
command=lambda value: self.switch_theme(value),
font=('ubuntu' if platform.system() == 'Linux' else 'Arial', 20))

amode_dropdown.set(self.theme_color)
amode_dropdown.set(self.theme_to_string(self.theme_color))
amode_dropdown.grid(row=5, column=0)

accent_label = ctk.CTkLabel(customization, text=self.response.get("dropdown-theme-accent"))
accent_label.grid(row=0, column=1, padx=50)

theme_accent_green = self.response.get("theme-accent-green")
theme_accent_blue = self.response.get("theme-accent-blue")
theme_accent_dark_blue = self.response.get("theme-accent-dark-blue")

accent_dropdown = ctk.CTkComboBox(customization,
values=['green', 'blue', 'dark-blue'],
command=lambda value: setattr(self, 'theme_accent', value),
values=[f'{theme_accent_green}', f'{theme_accent_blue}', f'{theme_accent_dark_blue}'],
command=lambda value: self.switch_accent(value),
font=('ubuntu' if platform.system() == 'Linux' else 'Arial', 20))

accent_dropdown.set(self.theme_accent)
accent_dropdown.set(self.accent_to_string(self.theme_accent))
accent_dropdown.grid(row=1, column=1, padx=50)

accent_label = ctk.CTkLabel(customization, text=self.response.get("dropdown-locale"))
Expand Down Expand Up @@ -307,6 +315,51 @@ def locale_to_string(locale):
}

return locales[locale]

def switch_theme(self, theme):
dark = self.response.get("theme-dark")
white = self.response.get("theme-white")
system = self.response.get("theme-system")

themes = {
f'{dark}': 'dark',
f'{white}': 'white',
f'{system}' :'system'
}

self.theme_color = themes[theme]

def theme_to_string(self, theme):
themes = {
'dark': f'{self.response.get("theme-dark")}',
'white': f'{self.response.get("theme-white")}',
'system': f'{self.response.get("theme-system")}'
}

return themes[theme]

def switch_accent(self, accent):
green = self.response.get("theme-accent-green")
blue = self.response.get("theme-accent-blue")
dark_blue = self.response.get("theme-accent-dark-blue")


accents = {
f'{green}': 'green',
f'{blue}': 'blue',
f'{dark_blue}': 'dark-blue'
}

self.theme_accent = accents[accent]

def accent_to_string(self, accent):
accents = {
'green': f'{self.response.get("theme-accent-green")}',
'blue': f'{self.response.get("theme-accent-blue")}',
'dark-blue': f'{self.response.get("theme-accent-dark-blue")}'
}

return accents[accent]

def save_settings(self):
config = configparser.ConfigParser()
Expand Down
64 changes: 35 additions & 29 deletions src/i18n/en-us.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
{
"LOCALE": "English",
"app-title": "Password Generator",
"password-length": "Password Length",
"button-generate": "GENERATE",
"button-clear": "CLEAR",
"button-copy": "COPY",
"button-settings": "SETTINGS",
"button-about": "ABOUT",
"switch-digits": "digits",
"switch-lowercase": "lowercase",
"switch-uppercase": "uppercase",
"switch-punctuation": "punctuation",
"title-settings": "Settings",
"dropdown-window-scaling": "Window scaling",
"dropdown-widget-scaling": "Widget scaling",
"dropdown-theme-color": "Theme color",
"dropdown-theme-accent": "Accent color",
"dropdown-locale": "Locale",
"button-save": "SAVE",
"button-close": "CLOSE",
"about-title": "About",
"about-label": "Developed by r-liner © 2023-2024",
"about-open-github": "Open developer GitHub",
"about-open-repository": "Open repository page",
"about-see-latest": "See latest version",
"error-title": "Error",
"error-message": "Character switches are not used.",
"save-title": "Settings saved",
"save-message": "Settings saved\n\nIf you want to apply changes\nyou need to restart the application."
"LOCALE": "English",
"app-title": "Password Generator",
"password-length": "Password Length",
"button-generate": "GENERATE",
"button-clear": "CLEAR",
"button-copy": "COPY",
"button-settings": "SETTINGS",
"button-about": "ABOUT",
"switch-digits": "digits",
"switch-lowercase": "lowercase",
"switch-uppercase": "uppercase",
"switch-punctuation": "punctuation",
"title-settings": "Settings",
"dropdown-window-scaling": "Window scaling",
"dropdown-widget-scaling": "Widget scaling",
"dropdown-theme-color": "Theme color",
"dropdown-theme-accent": "Accent color",
"theme-dark": "Dark",
"theme-white": "White",
"theme-system": "System",
"theme-accent-green": "Green",
"theme-accent-blue": "Blue",
"theme-accent-dark-blue": "Dark Blue",
"dropdown-locale": "Locale",
"button-save": "SAVE",
"button-close": "CLOSE",
"about-title": "About",
"about-label": "Developed by r-liner © 2023-2024",
"about-open-github": "Open developer GitHub",
"about-open-repository": "Open repository page",
"about-see-latest": "See latest version",
"error-title": "Error",
"error-message": "Character switches are not used.",
"save-title": "Settings saved",
"save-message": "Settings saved\n\nIf you want to apply changes\nyou need to restart the application."
}
64 changes: 35 additions & 29 deletions src/i18n/ru-ru.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
{
"LOCALE": "Русский",
"app-title": "Генератор паролей",
"password-length": "Длина пароля",
"button-generate": "СГЕНЕРИРОВАТЬ",
"button-clear": "ОЧИСТИТЬ",
"button-copy": "СКОПИРОВАТЬ",
"button-settings": "НАСТРОЙКИ",
"button-about": "О ПРИЛОЖЕНИИ",
"switch-digits": "цифры",
"switch-lowercase": "нижний регистр",
"switch-uppercase": "верхний регистр",
"switch-punctuation": "пунктуация",
"title-settings": "Настройки",
"dropdown-window-scaling": "Масштабирование окна",
"dropdown-widget-scaling": "Масштабирование виджетов",
"dropdown-theme-color": "Цвет темы",
"dropdown-theme-accent": "Цвет оттенка",
"dropdown-locale": "Язык",
"button-save": "СОХРАНИТЬ",
"button-close": "ЗАКРЫТЬ",
"about-title": "О приложении",
"about-label": "Разработано r-liner © 2023-2024",
"about-open-github": "Открыть GitHub разработчика",
"about-open-repository": "Открыть страницу репозитория",
"about-see-latest": "Посмотреть последнюю версию",
"error-title": "Ошибка",
"error-message": "Переключатели символов не использованы.",
"save-title": "Настройки сохранены",
"save-message": "Настройки сохранены\n\nЧтобы принять изменения\nвы должны\nперезагрузить приложение."
"LOCALE": "Русский",
"app-title": "Генератор паролей",
"password-length": "Длина пароля",
"button-generate": "СГЕНЕРИРОВАТЬ",
"button-clear": "ОЧИСТИТЬ",
"button-copy": "СКОПИРОВАТЬ",
"button-settings": "НАСТРОЙКИ",
"button-about": "О ПРИЛОЖЕНИИ",
"switch-digits": "цифры",
"switch-lowercase": "нижний регистр",
"switch-uppercase": "верхний регистр",
"switch-punctuation": "пунктуация",
"title-settings": "Настройки",
"dropdown-window-scaling": "Масштабирование окна",
"dropdown-widget-scaling": "Масштабирование виджетов",
"dropdown-theme-color": "Цвет темы",
"dropdown-theme-accent": "Цвет оттенка",
"theme-dark": "Тёмная",
"theme-white": "Светлая",
"theme-system": "Системная",
"theme-accent-green": "Зелёный",
"theme-accent-blue": "Синий",
"theme-accent-dark-blue": "Тёмно-синий",
"dropdown-locale": "Язык",
"button-save": "СОХРАНИТЬ",
"button-close": "ЗАКРЫТЬ",
"about-title": "О приложении",
"about-label": "Разработано r-liner © 2023-2024",
"about-open-github": "Открыть GitHub разработчика",
"about-open-repository": "Открыть страницу репозитория",
"about-see-latest": "Посмотреть последнюю версию",
"error-title": "Ошибка",
"error-message": "Переключатели символов не использованы.",
"save-title": "Настройки сохранены",
"save-message": "Настройки сохранены\n\nЧтобы принять изменения\nвы должны\nперезагрузить приложение."
}

0 comments on commit be6ccfe

Please sign in to comment.