Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into qt6-category
Browse files Browse the repository at this point in the history
  • Loading branch information
Silarn committed Sep 5, 2023
2 parents f850654 + 5bb4a2a commit bbd7341
Show file tree
Hide file tree
Showing 313 changed files with 36,260 additions and 36,245 deletions.
41 changes: 41 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# We'll use defaults from the LLVM style, but with 4 columns indentation.
BasedOnStyle: LLVM
IndentWidth: 2
---
Language: Cpp
DeriveLineEnding: false
UseCRLF: true
DerivePointerAlignment: false
PointerAlignment: Left
AlignConsecutiveAssignments: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AlwaysBreakTemplateDeclarations: Yes
AccessModifierOffset: -2
AlignTrailingComments: true
SpacesBeforeTrailingComments: 2
NamespaceIndentation: Inner
MaxEmptyLinesToKeep: 1
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: true
ColumnLimit: 88
ForEachMacros: ['Q_FOREACH', 'foreach']
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
d13f6bb870cdda71257f665367be8ef9fca86255
86bb01ba9eac879d3685c439ac9da0028bc4bc80
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.cpp text eol=crlf
*.h text eol=crlf
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build ModOrganizer 2

on:
push:
branches: master
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
runs-on: windows-2022
steps:
- name: Build ModOrganizer 2
uses: ModOrganizer2/build-with-mob-action@master
with:
qt-modules: qtpositioning qtwebchannel qtwebengine qtwebsockets
mo2-third-parties:
7z zlib fmt gtest libbsarch libloot openssl libffi bzip2 python lz4 spdlog
boost boost-di sip pyqt pybind11 ss licenses explorerpp usvfs
mo2-dependencies: cmake_common uibase githubpp bsatk esptk archive lootcli game_gamebryo
17 changes: 17 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lint ModOrganizer 2

on:
push:
pull_request:
types: [opened, synchronize, reopened]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format
uses: jidicula/[email protected]
with:
clang-format-version: "15"
check-path: "."
252 changes: 126 additions & 126 deletions src/aboutdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,126 +1,126 @@
/*
Copyright (C) 2014 Sebastian Herbord. All rights reserved.
This file is part of Mod Organizer.
Mod Organizer 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.
Mod Organizer 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 Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/


#include "aboutdialog.h"
#include "ui_aboutdialog.h"
#include "shared/util.h"
#include <utility.h>

#include <QApplication>
#include <QLabel>
#include <QListWidget>
#include <QListWidgetItem>
#include <QTextBrowser>
#include <QVariant>
#include <Qt>
#include <QFontDatabase>

AboutDialog::AboutDialog(const QString &version, QWidget *parent)
: QDialog(parent)
, ui(new Ui::AboutDialog)
{
ui->setupUi(this);

m_LicenseFiles[LICENSE_LGPL3] = "LGPL-v3.0.txt";
m_LicenseFiles[LICENSE_LGPL21] = "GNU-LGPL-v2.1.txt";
m_LicenseFiles[LICENSE_GPL3] = "GPL-v3.0.txt";
m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt";
m_LicenseFiles[LICENSE_BOOST] = "boost.txt";
m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt";
m_LicenseFiles[LICENSE_CCBY3] = "BY-SA-v3.0.txt";
m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt";
m_LicenseFiles[LICENSE_PYTHON] = "python.txt";
m_LicenseFiles[LICENSE_SSL] = "openssl.txt";
m_LicenseFiles[LICENSE_CPPTOML] = "cpptoml.txt";
m_LicenseFiles[LICENSE_UDIS] = "udis86.txt";
m_LicenseFiles[LICENSE_SPDLOG] = "spdlog.txt";
m_LicenseFiles[LICENSE_FMT] = "fmt.txt";
m_LicenseFiles[LICENSE_SIP] = "sip.txt";
m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt";
m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt";
m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt";
m_LicenseFiles[LICENSE_VDF] = "ValveFileVDF.txt";

addLicense("Qt", LICENSE_LGPL3);
addLicense("Qt Json", LICENSE_GPL3);
addLicense("Boost Library", LICENSE_BOOST);
addLicense("7-zip", LICENSE_7ZIP);
addLicense("ZLib", LICENSE_NONE);
addLicense("Tango Icon Theme", LICENSE_NONE);
addLicense("RRZE Icon Set", LICENSE_CCBY3);
addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", LICENSE_CCBY3);
addLicense("Castle Core", LICENSE_CASTLE);
addLicense("ANTLR", LICENSE_ANTLR);
addLicense("LOOT", LICENSE_GPL3);
addLicense("Python", LICENSE_PYTHON);
addLicense("OpenSSL", LICENSE_SSL);
addLicense("cpptoml", LICENSE_CPPTOML);
addLicense("Udis86", LICENSE_UDIS);
addLicense("spdlog", LICENSE_SPDLOG);
addLicense("{fmt}", LICENSE_FMT);
addLicense("SIP", LICENSE_SIP);
addLicense("DXTex Headers", LICENSE_DXTEX);
addLicense("Valve File VDF Reader", LICENSE_VDF);

ui->nameLabel->setText(QString("<span style=\"font-size:12pt; font-weight:600;\">%1 %2</span>").arg(ui->nameLabel->text()).arg(version));
#if defined(HGID)
ui->revisionLabel->setText(ui->revisionLabel->text() + " " + HGID);
#elif defined(GITID)
ui->revisionLabel->setText(ui->revisionLabel->text() + " " + GITID);
#else
ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown");
#endif


ui->usvfsLabel->setText(ui->usvfsLabel->text() + " " + MOShared::getUsvfsVersionString());
ui->licenseText->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
}


AboutDialog::~AboutDialog()
{
delete ui;
}


void AboutDialog::addLicense(const QString &name, Licenses license)
{
QListWidgetItem *item = new QListWidgetItem(name);
item->setData(Qt::UserRole, license);
ui->creditsList->addItem(item);
}


void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem*)
{
auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt());
if (iter != m_LicenseFiles.end()) {
QString filePath = qApp->applicationDirPath() + "/licenses/" + iter->second;
QString text = MOBase::readFileText(filePath);
ui->licenseText->setText(text);
} else {
ui->licenseText->setText(tr("No license"));
}
}

void AboutDialog::on_sourceText_linkActivated(const QString &link)
{
MOBase::shell::Open(QUrl(link));
}
/*
Copyright (C) 2014 Sebastian Herbord. All rights reserved.
This file is part of Mod Organizer.
Mod Organizer 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.
Mod Organizer 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 Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
*/

#include "aboutdialog.h"
#include "shared/util.h"
#include "ui_aboutdialog.h"
#include <utility.h>

#include <QApplication>
#include <QFontDatabase>
#include <QLabel>
#include <QListWidget>
#include <QListWidgetItem>
#include <QTextBrowser>
#include <QVariant>
#include <Qt>

AboutDialog::AboutDialog(const QString& version, QWidget* parent)
: QDialog(parent), ui(new Ui::AboutDialog)
{
ui->setupUi(this);

m_LicenseFiles[LICENSE_LGPL3] = "LGPL-v3.0.txt";
m_LicenseFiles[LICENSE_LGPL21] = "GNU-LGPL-v2.1.txt";
m_LicenseFiles[LICENSE_GPL3] = "GPL-v3.0.txt";
m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt";
m_LicenseFiles[LICENSE_BOOST] = "boost.txt";
m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt";
m_LicenseFiles[LICENSE_CCBY3] = "BY-SA-v3.0.txt";
m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt";
m_LicenseFiles[LICENSE_PYTHON] = "python.txt";
m_LicenseFiles[LICENSE_SSL] = "openssl.txt";
m_LicenseFiles[LICENSE_CPPTOML] = "cpptoml.txt";
m_LicenseFiles[LICENSE_UDIS] = "udis86.txt";
m_LicenseFiles[LICENSE_SPDLOG] = "spdlog.txt";
m_LicenseFiles[LICENSE_FMT] = "fmt.txt";
m_LicenseFiles[LICENSE_SIP] = "sip.txt";
m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt";
m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt";
m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt";
m_LicenseFiles[LICENSE_VDF] = "ValveFileVDF.txt";

addLicense("Qt", LICENSE_LGPL3);
addLicense("Qt Json", LICENSE_GPL3);
addLicense("Boost Library", LICENSE_BOOST);
addLicense("7-zip", LICENSE_7ZIP);
addLicense("ZLib", LICENSE_NONE);
addLicense("Tango Icon Theme", LICENSE_NONE);
addLicense("RRZE Icon Set", LICENSE_CCBY3);
addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net",
LICENSE_CCBY3);
addLicense("Castle Core", LICENSE_CASTLE);
addLicense("ANTLR", LICENSE_ANTLR);
addLicense("LOOT", LICENSE_GPL3);
addLicense("Python", LICENSE_PYTHON);
addLicense("OpenSSL", LICENSE_SSL);
addLicense("cpptoml", LICENSE_CPPTOML);
addLicense("Udis86", LICENSE_UDIS);
addLicense("spdlog", LICENSE_SPDLOG);
addLicense("{fmt}", LICENSE_FMT);
addLicense("SIP", LICENSE_SIP);
addLicense("DXTex Headers", LICENSE_DXTEX);
addLicense("Valve File VDF Reader", LICENSE_VDF);

ui->nameLabel->setText(
QString("<span style=\"font-size:12pt; font-weight:600;\">%1 %2</span>")
.arg(ui->nameLabel->text())
.arg(version));
#if defined(HGID)
ui->revisionLabel->setText(ui->revisionLabel->text() + " " + HGID);
#elif defined(GITID)
ui->revisionLabel->setText(ui->revisionLabel->text() + " " + GITID);
#else
ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown");
#endif

ui->usvfsLabel->setText(ui->usvfsLabel->text() + " " +
MOShared::getUsvfsVersionString());
ui->licenseText->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont));
}

AboutDialog::~AboutDialog()
{
delete ui;
}

void AboutDialog::addLicense(const QString& name, Licenses license)
{
QListWidgetItem* item = new QListWidgetItem(name);
item->setData(Qt::UserRole, license);
ui->creditsList->addItem(item);
}

void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem* current,
QListWidgetItem*)
{
auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt());
if (iter != m_LicenseFiles.end()) {
QString filePath = qApp->applicationDirPath() + "/licenses/" + iter->second;
QString text = MOBase::readFileText(filePath);
ui->licenseText->setText(text);
} else {
ui->licenseText->setText(tr("No license"));
}
}

void AboutDialog::on_sourceText_linkActivated(const QString& link)
{
MOBase::shell::Open(QUrl(link));
}
Loading

0 comments on commit bbd7341

Please sign in to comment.