Skip to content

Commit

Permalink
Merge pull request #116 from DXS-GROUP/main
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
Nighty3098 authored Jul 16, 2024
2 parents 608c4f5 + 09ab2ea commit 0e92d00
Show file tree
Hide file tree
Showing 16 changed files with 165 additions and 119 deletions.
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

0 comments on commit 0e92d00

Please sign in to comment.