Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #116

Merged
merged 29 commits into from
Jul 16, 2024
Merged

Merge #116

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
634c28d
Fix app icon
Nighty3098 Jun 15, 2024
cdebab3
Merge pull request #106 from DXS-GROUP/InDev
Nighty3098 Jun 15, 2024
a52641d
Fixed project window
Nighty3098 Jun 15, 2024
8621dd5
Fixed TableWidget. Fixed project window
Nighty3098 Jun 15, 2024
5104455
Merge pull request #107 from DXS-GROUP/InDev
Nighty3098 Jun 15, 2024
2311540
Update README.md
Nighty3098 Jun 17, 2024
a3d0f46
Update projectsFunc.cpp
Nighty3098 Jun 17, 2024
fb7db63
Update README.md
Nighty3098 Jun 17, 2024
58f8336
Update README.md
Nighty3098 Jun 17, 2024
7164520
Merge pull request #108 from DXS-GROUP/InDev
Nighty3098 Jun 17, 2024
b7953b1
Added security.md
Nighty3098 Jun 18, 2024
7fc4446
Merge pull request #109 from DXS-GROUP/InDev
Nighty3098 Jun 18, 2024
d045dc3
Update SECURITY.md
Nighty3098 Jun 18, 2024
b6d646b
Edited
Nighty3098 Jul 5, 2024
d49806c
Merge pull request #110 from DXS-GROUP/InDev
Nighty3098 Jul 5, 2024
d2b241e
Update project links
Nighty3098 Jul 5, 2024
a51f17d
Merge pull request #111 from DXS-GROUP/InDev
Nighty3098 Jul 5, 2024
8a2b5f3
Fixed the icon in the check for updates window. Changed control butto…
Nighty3098 Jul 6, 2024
f9aa3a5
Merge pull request #112 from DXS-GROUP/InDev
Nighty3098 Jul 6, 2024
74fcec5
Edited app version
Nighty3098 Jul 6, 2024
4d50807
Merge pull request #113 from DXS-GROUP/InDev
Nighty3098 Jul 6, 2024
4898d62
Update logo.png
Nighty3098 Jul 8, 2024
bb51162
Update settingswindow.cpp
Nighty3098 Jul 8, 2024
f67f094
Update functional.cpp
Nighty3098 Jul 8, 2024
ec30306
Update README.md
Nighty3098 Jul 14, 2024
e557289
Fix
Nighty3098 Jul 14, 2024
8580c58
Merge pull request #114 from DXS-GROUP/InDev
Nighty3098 Jul 14, 2024
9a45803
Fixed project window size
Nighty3098 Jul 15, 2024
09ab2ea
Merge pull request #115 from DXS-GROUP/InDev
Nighty3098 Jul 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
"cfenv": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp"
"valarray": "cpp",
"locale": "cpp"
}
}
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<div align="center">
<a href="./LICENSE.md"><img class="badge" src="https://img.shields.io/github/license/Nighty3098/CodeKeeper?style=for-the-badge&color=a6e0b8&logoColor=ffffff&labelColor=1c1c29" style="border-radius: 5px;"/></a><br>
<img src="https://img.shields.io/github/created-at/Nighty3098/CodeKeeper?style=for-the-badge&color=7dc4e4&logoColor=D9E0EE&labelColor=1c1c29" style="border-radius: 5px;">
<img src="https://img.shields.io/github/release-date/Nighty3098/CodeKeeper?style=for-the-badge&color=e0ea9d&logoColor=D9E0EE&labelColor=171b22" style="border-radius: 5px;" />
<img class="badge" src="https://img.shields.io/github/last-commit/Nighty3098/CodeKeeper?style=for-the-badge&color=7dc4e4&logoColor=D9E0EE&labelColor=1c1c29" style="border-radius: 5px;"/>
<img class="badge" src="https://img.shields.io/github/issues-pr/Nighty3098/CodeKeeper?style=for-the-badge&color=ef9f9c&logoColor=85e185&labelColor=1c1c29" style="border-radius: 5px;" />
<img class="badge" src="https://img.shields.io/github/repo-size/Nighty3098/CodeKeeper?style=for-the-badge&color=ea9de7&logoColor=D9E0EE&labelColor=171b22" style="border-radius: 5px;"/>
Expand All @@ -21,17 +20,26 @@
<img src="https://img.shields.io/github/languages/count/Nighty3098/CodeKeeper?style=for-the-badge&color=ea9de7&logoColor=D9E0EE&labelColor=171b22" style="border-radius: 5px;"/>
<img class="badge" src="https://img.shields.io/github/stars/Nighty3098/CodeKeeper?style=for-the-badge&color=eed49f&logoColor=D9E0EE&labelColor=1c1c29" style="border-radius: 5px;"/>
<img class="badge" src="https://img.shields.io/github/forks/Nighty3098/CodeKeeper?style=for-the-badge&color=9dc3ea&logoColor=D9E0EE&labelColor=1c1c29" style="border-radius: 5px;"/>
<br><br><hr><br><br>
<br><br><br>
<img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_cpp.png?raw=true" height="50px" />
<img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_c.png?raw=true" height="50px" />
<img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_qt.png?raw=true" height="50px" />
<img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_sqlite.png?raw=true" height="50px" />
<img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_git.png?raw=true" height="50px" />
<img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_api.png?raw=true" height="50px" />
<br><br><hr><br><br>
<a href="https://discord.gg/tnHSEc2cZv"><img src="https://invidget.switchblade.xyz/r8jWX8ugDd" style="border-radius: 15px;"/></a><br>
<img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_codekeeper.png?raw=true" height="50px" />
<br><br>
<h3>Developers:</h3>
<p align="center">
<a href = "https://github.com/iinsertNameHere/catnap/graphs/contributors">
<img src = "https://contrib.rocks/image?repo=Nighty3098/CodeKeeper">
</a>
</p>
<br><br>
<h3>If you have found bugs in our product or have suggestions, please write about them:</h3>
<a href="https://t.me/DXS_TechSupport_bot"><img src="https://github.com/Nighty3098/Nighty3098/blob/main/TechSupport.png?raw=true" width="65%" /></a>
<br><br><br>
<img src="https://repobeats.axiom.co/api/embed/84bb3c292d2256a4d52ec4cdfca3da36b9e981cb.svg" />
<img src="https://repobeats.axiom.co/api/embed/0d75989e77c487901abc8abe41e46589905ee8af.svg" />
</div>

<br><br>
Expand Down Expand Up @@ -179,7 +187,7 @@
<br>

<div align="center">
<br><br><br>
<br><br>
<img src="https://wakatime.com/badge/user/018e8f78-65a7-4aa8-8c67-51796499853b/project/018e8f7e-5c5a-471e-ba73-04384fbc3cda.svg?&style=for-the-badge&color=f5a7a0&logoColor=FFFFFF&labelColor=1c1c29" style="border-radius: 5px;"/>
<br><br><br>
</div>
18 changes: 18 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div align="center">
<h1>Security Policy</h1>
<h3>Supported Versions</h3>
<h3>Only Latest Version is Supported</h3>
<br>
Reporting a Vulnerability:<br>
I. Add Title<br>
II. Add Description<br>
III. Add Screen<br>
<br>
<h1>Contacts</h1>
<a href="https://t.me/Night3098" target="blank"><img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_telegram.png?raw=true" width="50px" /></a>
<a href="https://discord.gg/#9707" target="blank"><img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_discord.png?raw=true" width="50px" /></a>
<a href="https://www.reddit.com/user/Night3098" target="blank"><img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_reddit.png?raw=true" width="50px" /></a>
<a href="mailto:night3098games@gmail.com" target="blank"><img src="https://github.com/Nighty3098/DevIcons/blob/main/badges/badges_gmail.png?raw=true" width="50px" /></a>
<br><br>
<h3>Thanks <3</h3>
</div>
1 change: 0 additions & 1 deletion src/CodeKeeper/keeperFunc/functional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ void MainWindow::fOpenAccountWindow()

void MainWindow::openSettingsWindow()
{

QThread *settingsWindowThread = new QThread;
QObject::connect(settingsWindowThread, &QThread::started, this, [this]() {
QRect geo = this->geometry();
Expand Down
11 changes: 6 additions & 5 deletions src/CodeKeeper/keeperFunc/getProjectInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ QString MainWindow::getRepositoryData(QString git_url, QTableWidget *table)
{
QString prefix = "https://github.com/";
QString repo = git_url.replace(prefix, "");
QString repoData; // Declare repoData as a non-const QString
QString repoData;

QString name, createdAt, openIssues, forks, lang, stars, repoSize, license, totalDownloads,
release, releaseDate, lastCommitS;
Expand All @@ -116,10 +116,10 @@ QString MainWindow::getRepositoryData(QString git_url, QTableWidget *table)
request.setRawHeader("Accept", "application/vnd.github.v3+json");

QNetworkReply *reply = manager->get(request);
QEventLoop loop; // Create a QEventLoop
QEventLoop loop;
QObject::connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);

loop.exec(); // Block until the lambda function has finished
loop.exec();

if (reply->error()) {
qWarning() << "Error:" << reply->errorString();
Expand All @@ -138,7 +138,6 @@ QString MainWindow::getRepositoryData(QString git_url, QTableWidget *table)

openIssues = QString::number(obj["open_issues"].toInt());

// repoData += " \n Watchers: " + QString::number(obj["watchers"].toInt()) + " ";
forks = QString::number(obj["forks"].toInt());
lang = obj["language"].toString();

Expand Down Expand Up @@ -238,7 +237,7 @@ QString MainWindow::getRepositoryData(QString git_url, QTableWidget *table)
QNetworkReply *releasesReply = manager->get(releasesRequest);
QObject::connect(releasesReply, &QNetworkReply::finished, &loop, &QEventLoop::quit);

loop.exec(); // Block until the lambda function has finished
loop.exec();

if (releasesReply->error()) {
qWarning() << "Error:" << releasesReply->errorString();
Expand Down Expand Up @@ -284,6 +283,7 @@ QString MainWindow::getRepositoryData(QString git_url, QTableWidget *table)
table->setItem(0, 0, new QTableWidgetItem("Repo"));
table->setItem(0, 1, new QTableWidgetItem(name));
table->item(0, 0)->setTextAlignment(Qt::AlignCenter);
table->item(0, 1)->setTextAlignment(Qt::AlignCenter);

QStringList dataList, textList;

Expand Down Expand Up @@ -356,6 +356,7 @@ QString MainWindow::getRepositoryData(QString git_url, QTableWidget *table)
QTableWidgetItem *item = table->item(row, col);
if (item) {
item->setFlags(item->flags() & ~Qt::ItemIsEditable);
item->setTextAlignment(Qt::AlignCenter);
}
}
}
Expand Down
93 changes: 53 additions & 40 deletions src/CodeKeeper/keeperFunc/projectsFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,49 @@ void MainWindow::openProject(QListWidget *listWidget, QListWidgetItem *item)
{
if (item) {
QDialog dialog(this);
dialog.setFixedSize(550, 550);
dialog.setWindowTitle(tr("Edit project"));
dialog.setFixedWidth(550);
dialog.setMinimumHeight(500);
dialog.setWindowTitle(tr("Project"));
dialog.setWindowFlags(windowFlags() | Qt::FramelessWindowHint);

QPushButton *saveDataBtn = new QPushButton();
saveDataBtn->setText("Save");
saveDataBtn->setStyleSheet("font-size: " + font_size + "pt;");
saveDataBtn->setFixedSize(100, 25);
saveDataBtn->setIcon(QPixmap(":/save.png"));
saveDataBtn->setIconSize(QSize(10, 10));
saveDataBtn->setFont(selectedFont);

QPushButton *cancelBtn = new QPushButton("");
cancelBtn->setFixedSize(15, 15);
cancelBtn->setStyleSheet("QPushButton {"
" border-color: rgba(0, 0, 0, 0);"
" background-color: rgba(0, 0, 0, 0);"
" background-image: url(':/red.png');"
" background-repeat: no-repeat;"
"}"
"QPushButton:hover {"
" border-color: rgba(0, 0, 0, 0);"
" background-image: url(':/redHovered.png');"
" background-repeat: no-repeat;"
" background-color: rgba(0, 0, 0, 0);"
"}");

QVBoxLayout *centralLayout = new QVBoxLayout(&dialog);

QHBoxLayout *controlButtons = new QHBoxLayout();

QSpacerItem *spacer = new QSpacerItem(100, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);

controlButtons->addWidget(cancelBtn);
controlButtons->addItem(spacer);
controlButtons->addWidget(saveDataBtn);

centralLayout->addLayout(controlButtons);

QTabWidget *tabs = new QTabWidget();
tabs->setMovable(true);
// tabs->setTabPosition(QTabWidget::South);
tabs->setTabPosition(QTabWidget::South);

QWidget *projectTab = new QWidget();
QGridLayout mainLayout(projectTab);
Expand Down Expand Up @@ -174,36 +208,23 @@ void MainWindow::openProject(QListWidget *listWidget, QListWidgetItem *item)

QTableWidget *git_stats = new QTableWidget();
git_stats->setFont(selectedFont);
git_stats->setStyleSheet(
"QTableWidget{ background-color: #0d1117; alternate-background-color: #171b22; "
"selection-background-color: #336fc9; show-decoration-selected: 1; font-size: "
+ font_size + "pt; border: 0px;}");
git_stats->setStyleSheet("QTableWidget{font-size:" + font_size + "pt;}");

git_stats->horizontalHeader()->setDefaultAlignment(Qt::AlignCenter);
git_stats->verticalHeader()->setDefaultAlignment(Qt::AlignCenter);
git_stats->setContentsMargins(0, 0, 0, 0);
git_stats->setAlternatingRowColors(true);

QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(git_stats);
layout->setAlignment(Qt::AlignCenter);
QHBoxLayout *statsLayout = new QHBoxLayout();

QPushButton *saveDataBtn = new QPushButton();
saveDataBtn->setText("Save");
saveDataBtn->setStyleSheet("font-size: " + font_size + "pt;");
saveDataBtn->setFixedSize(100, 25);
saveDataBtn->setIcon(QPixmap(":/save.png"));
saveDataBtn->setIconSize(QSize(10, 10));
saveDataBtn->setFont(selectedFont);
QSpacerItem *leftSpacer =
new QSpacerItem(0, 10, QSizePolicy::Expanding, QSizePolicy::Minimum);
QSpacerItem *rightSpacer =
new QSpacerItem(0, 10, QSizePolicy::Expanding, QSizePolicy::Minimum);

QPushButton *cancelBtn = new QPushButton();
cancelBtn->setText("Cancel");
cancelBtn->setStyleSheet("font-size: " + font_size + "pt;");
cancelBtn->setFixedSize(100, 25);
cancelBtn->setIcon(QPixmap(":/quit.png")
.scaled(font_size.toInt() + 3, font_size.toInt() + 3,
Qt::KeepAspectRatio, Qt::SmoothTransformation));
cancelBtn->setIconSize(QSize(10, 10));
cancelBtn->setFont(selectedFont);
// statsLayout->addItem(leftSpacer);
statsLayout->addWidget(git_stats);
// statsLayout->addItem(rightSpacer);

QPushButton *openButton = new QPushButton();
openButton->setText("Open");
Expand All @@ -222,21 +243,17 @@ void MainWindow::openProject(QListWidget *listWidget, QListWidgetItem *item)
loadDocumentations(dir, *documentation);
documentation->setCurrentText(projectData[2]);

mainLayout.addWidget(title, 0, 0, 1, 2);
mainLayout.addWidget(linkToGit, 1, 0, 1, 2);
mainLayout.addWidget(documentation, 2, 0);
mainLayout.addWidget(openButton, 2, 1);
mainLayout.addLayout(layout, 4, 0, 1, 2);
mainLayout.addWidget(saveDataBtn, 6, 0, 1, 2, Qt::AlignCenter);
mainLayout.addWidget(cancelBtn, 7, 0, 1, 2, Qt::AlignCenter);
mainLayout.addWidget(lastMod, 5, 0, 1, 2, Qt::AlignCenter);
mainLayout.addWidget(title, 2, 0, 1, 2);
mainLayout.addWidget(linkToGit, 3, 0, 1, 2);
mainLayout.addWidget(documentation, 4, 0);
mainLayout.addWidget(openButton, 4, 1);
mainLayout.addLayout(statsLayout, 5, 0, 5, 2);
mainLayout.addWidget(lastMod, 10, 0, 1, 2, Qt::AlignCenter);

QWidget *issuesTab = new QWidget();
QVBoxLayout issuesLayout(issuesTab);

QTextBrowser *issuesLabel = new QTextBrowser();
// issuesLabel->setWordWrap(true);
// issuesLabel->setTextFormat(Qt::RichText);
issuesLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
issuesLabel->setText("Issues");
issuesLabel->setOpenExternalLinks(true);
Expand Down Expand Up @@ -270,8 +287,6 @@ void MainWindow::openProject(QListWidget *listWidget, QListWidgetItem *item)

updateProjectData(&projectTitle, &projectLink, &projectDocumentation,
&projectCreatedTime, &PCreatedTime, &PGit);

dialog.close();
});

QObject::connect(cancelBtn, &QPushButton::clicked, [&]() { dialog.close(); });
Expand All @@ -287,8 +302,6 @@ void MainWindow::openProject(QListWidget *listWidget, QListWidgetItem *item)
QString projectLink = linkToGit->text();
QString repo = projectLink.replace(prefix, "");

// createGitBadges(repo, git_stats);

QThread *thread = new QThread;
QObject::connect(thread, &QThread::started, this,
[this, projectData, repo, git_stats, issuesLabel]() {
Expand Down
2 changes: 1 addition & 1 deletion src/CodeKeeper/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
appIcon = new QLabel();
appIcon->setAlignment(Qt::AlignCenter);
appIcon->setPixmap(
QPixmap(":/icon.png").scaled(300, 300, Qt::KeepAspectRatio, Qt::SmoothTransformation));
QPixmap(":/logo.png").scaled(300, 300, Qt::KeepAspectRatio, Qt::SmoothTransformation));

// settings btn
openSettingsBtn =
Expand Down
2 changes: 1 addition & 1 deletion src/CodeKeeper/settingsFunc/GitHubReleaseDownloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void downloadFileFromLatestRelease(const QString &owner, const QString &repo,

QNetworkAccessManager manager;
QNetworkRequest request;
request.setUrl(QUrl("https://api.github.com/repos/DXS-SQUAD/CodeKeeper/releases/latest"));
request.setUrl(QUrl("https://api.github.com/repos/DXS-GROUP/CodeKeeper/releases/latest"));
request.setHeader(QNetworkRequest::UserAgentHeader, "CodeKeeper");
request.setRawHeader("Authorization", ("Bearer " + git_token).toUtf8());
request.setRawHeader("X-GitHub-Api-Version", "2022-11-28");
Expand Down
Loading
Loading