Skip to content

Commit fda4701

Browse files
committed
Add Password Generator Plugin
- Introduced a new plugin for generating passwords with customizable character sets and lengths. - Added UI components for password generation, including input fields for character sets and password length. - Implemented functionality to generate, save, reset, and copy passwords to the clipboard. - Integrated the new plugin into the main application window, allowing users to access it easily. - Updated versioning to reflect the addition of this new feature.
1 parent 1b0d72e commit fda4701

12 files changed

Lines changed: 985 additions & 10 deletions

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
project(TaskGuard VERSION 1.3.4 LANGUAGES CXX)
3+
project(TaskGuard VERSION 1.3.5 LANGUAGES CXX)
44

55
set(CMAKE_AUTOUIC ON)
66
set(CMAKE_AUTOMOC ON)
@@ -35,6 +35,7 @@ set(PROJECT_SOURCES
3535
src/string_encryption.h src/string_encryption.cpp
3636
src/updatechecker.h src/updatechecker.cpp src/updatechecker.ui
3737
src/plugin_keyghost.h src/plugin_keyghost.cpp src/plugin_keyghost.ui
38+
src/plugin_passgen.h src/plugin_passgen.cpp src/plugin_passgen.ui
3839
${TS_FILES}
3940
)
4041

img/plugin-passgen-dark.svg

Lines changed: 62 additions & 0 deletions
Loading

img/plugin-passgen.svg

Lines changed: 62 additions & 0 deletions
Loading

resources/application.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@
1414
<file>../img/settings.svg</file>
1515
<file>../img/plugin-keyghost.svg</file>
1616
<file>../img/plugin-keyghost-dark.svg</file>
17+
<file>../img/plugin-passgen.svg</file>
18+
<file>../img/plugin-passgen-dark.svg</file>
1719
</qresource>
1820
</RCC>

src/mainwindow.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ bool MainWindow::setup_MainWindow(bool password_state, QString password, bool hw
3333
settings_window = new SettingsWindow(this);
3434

3535
plugin_keyghost_window = new PluginKeyGhost(this);
36+
plugin_passgen_window = new PluginPassGen(this);
3637

3738
update_checker = new UpdateChecker(this);
3839
update_checker->check();
@@ -1564,6 +1565,11 @@ void MainWindow::on_plugin_keyghost_button_clicked()
15641565
plugin_keyghost_window->open_widget();
15651566
}
15661567

1568+
void MainWindow::on_plugin_passgen_button_clicked()
1569+
{
1570+
plugin_passgen_window->open_widget();
1571+
}
1572+
15671573
void MainWindow::keyPressEvent(QKeyEvent *event) {
15681574
if (event->key() == Qt::Key_Delete) { // task_list : KeyPressEvent
15691575

src/mainwindow.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#include "settingswindow.h"
6161
#include "updatechecker.h"
6262
#include "plugin_keyghost.h"
63+
#include "plugin_passgen.h"
6364

6465
QT_BEGIN_NAMESPACE
6566
namespace Ui { class MainWindow; }
@@ -156,6 +157,7 @@ class MainWindow : public QMainWindow
156157
UpdateChecker *update_checker;
157158

158159
PluginKeyGhost *plugin_keyghost_window;
160+
PluginPassGen *plugin_passgen_window;
159161

160162
public slots:
161163
void handle_notification_clicked();
@@ -180,6 +182,8 @@ private slots:
180182

181183
void on_plugin_keyghost_button_clicked();
182184

185+
void on_plugin_passgen_button_clicked();
186+
183187
private:
184188
Ui::MainWindow *ui;
185189

src/mainwindow.ui

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ QSplitter::handle:pressed {
3535
<height>0</height>
3636
</size>
3737
</property>
38-
<layout class="QHBoxLayout" name="horizontalLayout" stretch="4,6,10">
38+
<layout class="QHBoxLayout" name="horizontalLayout" stretch="4,6,0">
3939
<property name="spacing">
4040
<number>0</number>
4141
</property>
@@ -183,7 +183,6 @@ background: #636872;
183183
#group_list::item {
184184
color: white;
185185
padding: 4px;
186-
187186
padding-left: 0px;
188187
}
189188

@@ -223,10 +222,70 @@ background: #636872;
223222
</widget>
224223
</item>
225224
<item>
226-
<layout class="QVBoxLayout" name="verticalLayout_4">
225+
<layout class="QVBoxLayout" name="verticalLayout_5">
227226
<property name="spacing">
228227
<number>0</number>
229228
</property>
229+
<item>
230+
<layout class="QHBoxLayout" name="horizontalLayout_5">
231+
<item>
232+
<widget class="QPushButton" name="plugin_passgen_button">
233+
<property name="minimumSize">
234+
<size>
235+
<width>34</width>
236+
<height>34</height>
237+
</size>
238+
</property>
239+
<property name="maximumSize">
240+
<size>
241+
<width>34</width>
242+
<height>34</height>
243+
</size>
244+
</property>
245+
<property name="styleSheet">
246+
<string notr="true">QPushButton {
247+
border-radius: 16px;
248+
}
249+
QPushButton::hover {
250+
background: #181D27;
251+
}
252+
QPushButton::pressed {
253+
background: #636872;
254+
}</string>
255+
</property>
256+
<property name="text">
257+
<string/>
258+
</property>
259+
<property name="icon">
260+
<iconset resource="../resources/application.qrc">
261+
<normaloff>:/img/plugin-passgen.svg</normaloff>:/img/plugin-passgen.svg</iconset>
262+
</property>
263+
<property name="iconSize">
264+
<size>
265+
<width>22</width>
266+
<height>22</height>
267+
</size>
268+
</property>
269+
<property name="flat">
270+
<bool>true</bool>
271+
</property>
272+
</widget>
273+
</item>
274+
<item>
275+
<spacer name="horizontalSpacer_9">
276+
<property name="orientation">
277+
<enum>Qt::Orientation::Horizontal</enum>
278+
</property>
279+
<property name="sizeHint" stdset="0">
280+
<size>
281+
<width>40</width>
282+
<height>20</height>
283+
</size>
284+
</property>
285+
</spacer>
286+
</item>
287+
</layout>
288+
</item>
230289
<item>
231290
<layout class="QHBoxLayout" name="horizontalLayout_4">
232291
<item>
@@ -634,7 +693,7 @@ background: #DBDCDD;
634693
}
635694
#task_list::indicator:checked {
636695
border: 1px solid #333333;
637-
background-color: #2a2e36;
696+
background-color: #cccccc;
638697
}</string>
639698
</property>
640699
<property name="frameShape">

0 commit comments

Comments
 (0)