-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from CM0use/2.0.0
GenPassword v.2.0.0
- Loading branch information
Showing
86 changed files
with
1,867 additions
and
2,703 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Installer> | ||
<Name>GenPassword</Name> | ||
<Version>1.0.0</Version> | ||
<Version>2.0.0</Version> | ||
<Title>GenPassword Installer</Title> | ||
<Publisher>CM0use</Publisher> | ||
<ProductUrl>https://github.com/CM0use/GenPassword</ProductUrl> | ||
<InstallerWindowIcon>appIcon.png</InstallerWindowIcon> | ||
<StartMenuDir>GenPassword</StartMenuDir> | ||
<TargetDir>@HomeDir@/GenPassword</TargetDir> | ||
<ProductImages> | ||
<ProductImage> | ||
<Image>appIcon.png</Image> | ||
<Url>https://github.com/CM0use/GenPassword</Url> | ||
</ProductImage> | ||
</ProductImages> | ||
</Installer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,5 @@ | ||
/** | ||
** This file is part of the GenPassword project. | ||
** Copyright 2023 CM0use [email protected] | ||
** URL: https://github.com/CM0use/GenPassword | ||
** | ||
** This program is free software: you can redistribute it and/or modify | ||
** it under the terms of the GNU General Public License as published by | ||
** the Free Software Foundation, either version 3 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** This program is distributed in the hope that it will be useful, | ||
** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
** GNU General Public License for more details. | ||
** | ||
** You should have received a copy of the GNU General Public License | ||
** along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
**/ | ||
// GenPassword | ||
// Copyright (c) 2023 CM0use | ||
|
||
function Component() | ||
{ | ||
|
@@ -44,8 +28,8 @@ Component.prototype.createOperations = function() | |
"iconPath=@TargetDir@/GenPassword.exe"); | ||
} else if (installer.value("os") === "x11") { | ||
component.addOperation("InstallIcons", "@TargetDir@/icons"); | ||
var app_desktop = "Version=1.0.0\nName=GenPassword\nComment=A random and customizable password generator\nComment[zh_CN]=随机和可定制的密码生成器\nComment[hi]=एक यादृच्छिक और अनुकूलन योग्य पासवर्ड जनरेटर\nComment[es]=Un generador de contraseñas aleatorio y personalizable\nComment[pt_BR]=Um gerador de senhas aleatórias e personalizáveis\nExec=@TargetDir@/GenPassword\nTerminal=false\nType=Application\nIcon=GenPasswordIcon\nCategories=Utility;Security", | ||
uninstall_desktop = "Version=1.0.0\nName=Uninstall\nExec=@TargetDir@/maintenancetool\nTerminal=false\nKeyword=GenPassword\nType=Application\nIcon=GenPasswordIcon\nCategories=Utility;Security"; | ||
var app_desktop = "Version=2.0.0\nName=GenPassword\nComment=A random and customizable password generator\nComment[es]=Un generador de contraseñas aleatorio y personalizable\nExec=@TargetDir@/GenPassword\nTerminal=false\nType=Application\nIcon=GenPasswordIcon\nCategories=Utility;Security", | ||
uninstall_desktop = "Version=2.0.0\nName=Uninstall\nExec=@TargetDir@/maintenancetool\nTerminal=false\nKeyword=GenPassword\nType=Application\nIcon=GenPasswordIcon\nCategories=Utility;Security"; | ||
|
||
component.addOperation("CreateDesktopEntry", | ||
"GenPassword.desktop", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,34 @@ | ||
# | ||
# ** This file is part of the GenPassword project. | ||
# ** Copyright 2023 CM0use [email protected] | ||
# ** URL: https://github.com/CM0use/GenPassword | ||
# ** | ||
# ** This program is free software: you can redistribute it and/or modify | ||
# ** it under the terms of the GNU General Public License as published by | ||
# ** the Free Software Foundation, either version 3 of the License, or | ||
# ** (at your option) any later version. | ||
# ** | ||
# ** This program is distributed in the hope that it will be useful, | ||
# ** but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# ** GNU General Public License for more details. | ||
# ** | ||
# ** You should have received a copy of the GNU General Public License | ||
# ** along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
QT += core gui | ||
|
||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | ||
|
||
CONFIG += c++20 | ||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 | ||
CONFIG += c++17 | ||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 | ||
VERSION = 2.0.0 | ||
QMAKE_TARGET_PRODUCT = GenPassword | ||
QMAKE_TARGET_DESCRIPTION = "A free generator password" | ||
QMAKE_TARGET_COPYRIGHT = CM0use | ||
|
||
win32: RC_ICONS = icons/appIcon.ico | ||
|
||
SOURCES += \ | ||
framelesswindow.cpp \ | ||
main.cpp \ | ||
passwordgeneratorapp.cpp | ||
passwordgenerator.cpp \ | ||
switchbutton.cpp \ | ||
window.cpp | ||
|
||
HEADERS += \ | ||
passwordgeneratorapp.h | ||
framelesswindow.h \ | ||
icons.h \ | ||
passwordgenerator.h \ | ||
switchbutton.h \ | ||
window.h | ||
|
||
# Default rules for deployment. | ||
qnx: target.path = /tmp/$${TARGET}/bin | ||
else: unix:!android: target.path = /opt/$${TARGET}/bin | ||
!isEmpty(target.path): INSTALLS += target | ||
|
||
win32: RC_ICONS = icon/appIcon.ico | ||
macx: ICON = icon/appIcon.icns | ||
|
||
RESOURCES += \ | ||
i18n.qrc \ | ||
icons.qrc \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// GenPassword | ||
// Copyright (c) 2023 CM0use | ||
|
||
#include "framelesswindow.h" | ||
|
||
#include <QStyle> | ||
#include <QHoverEvent> | ||
#include <QWindow> | ||
|
||
FramelessWindow::FramelessWindow(QWidget *const parent) | ||
: QMainWindow{ parent, Qt::FramelessWindowHint }, | ||
m_titleBar{ nullptr } | ||
{ } | ||
|
||
bool FramelessWindow::event(QEvent *const event) | ||
{ | ||
if (windowFlags() & Qt::FramelessWindowHint) { | ||
static Qt::Edges edges{ Qt::Edges() }; | ||
const int margin{ style()->pixelMetric(QStyle::PM_LayoutTopMargin) }; | ||
switch (event->type()) { | ||
case QEvent::MouseButtonPress: | ||
updateCursor(edges); | ||
if ((m_titleBar != nullptr) && m_titleBar->underMouse()) | ||
windowHandle()->startSystemMove(); | ||
else if (edges) | ||
windowHandle()->startSystemResize(edges); | ||
break; | ||
case QEvent::MouseButtonRelease: | ||
edges = Qt::Edges(); | ||
updateCursor(edges); | ||
setFocus(); | ||
break; | ||
case QEvent::HoverMove: { | ||
edges = Qt::Edges(); | ||
QPoint p{ static_cast<QHoverEvent *>(event)->position().toPoint() }; | ||
|
||
if (p.x() < margin) | ||
edges |= Qt::LeftEdge; | ||
if (p.x() > (width() - margin)) | ||
edges |= Qt::RightEdge; | ||
if (p.y() < margin) | ||
edges |= Qt::TopEdge; | ||
if (p.y() > (height() - margin)) | ||
edges |= Qt::BottomEdge; | ||
updateCursor(edges); | ||
break; | ||
} | ||
default: | ||
break; | ||
} | ||
} | ||
return QMainWindow::event(event); | ||
} | ||
|
||
void FramelessWindow::setTitleBar(QWidget *const widget) | ||
{ | ||
m_titleBar = widget; | ||
} | ||
|
||
QWidget* FramelessWindow::getTitleBar() const | ||
{ | ||
return m_titleBar; | ||
} | ||
|
||
void FramelessWindow::updateCursor(const Qt::Edges &edges) | ||
{ | ||
switch (edges) { | ||
case 0: | ||
setCursor(Qt::ArrowCursor); | ||
break; | ||
case Qt::LeftEdge: | ||
case Qt::RightEdge: | ||
setCursor(Qt::SizeHorCursor); | ||
break; | ||
case Qt::TopEdge: | ||
case Qt::BottomEdge: | ||
setCursor(Qt::SizeVerCursor); | ||
break; | ||
case Qt::LeftEdge | Qt::TopEdge: | ||
case Qt::RightEdge | Qt::BottomEdge: | ||
setCursor(Qt::SizeFDiagCursor); | ||
break; | ||
case Qt::RightEdge | Qt::TopEdge: | ||
case Qt::LeftEdge | Qt::BottomEdge: | ||
setCursor(Qt::SizeBDiagCursor); | ||
break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// GenPassword | ||
// Copyright (c) 2023 CM0use | ||
|
||
#ifndef FRAMELESSWINDOW_H | ||
#define FRAMELESSWINDOW_H | ||
|
||
#include <QMainWindow> | ||
|
||
class FramelessWindow: public QMainWindow | ||
{ | ||
public: | ||
explicit FramelessWindow(QWidget *const parent = nullptr); | ||
virtual ~FramelessWindow() = default; | ||
|
||
protected: | ||
virtual bool event(QEvent *const event) override; | ||
|
||
void setTitleBar(QWidget *const widget); | ||
QWidget* getTitleBar() const; | ||
|
||
private: | ||
void updateCursor(const Qt::Edges &edges); | ||
QWidget *m_titleBar; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/i18n"> | ||
<file>languages/en.qm</file> | ||
<file>languages/es.qm</file> | ||
<file>languages/hi.qm</file> | ||
<file>languages/pt-BR.qm</file> | ||
<file>languages/zh-CN.qm</file> | ||
<qresource prefix="/"> | ||
<file>i18n/es.qm</file> | ||
</qresource> | ||
</RCC> |
Binary file not shown.
Oops, something went wrong.