diff options
| author | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-02-11 02:37:39 -0600 |
|---|---|---|
| committer | SulfurNitride <SulfurNitride@users.noreply.github.com> | 2026-02-11 02:37:39 -0600 |
| commit | 7ee008e150bc5bcf76082d726f719ee0fdfda982 (patch) | |
| tree | 27fb39be241fdb5ac2734c574de678977d1856d0 /libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff | |
Fluorine Manager: full Linux port of Mod Organizer 2
Complete native Linux port with FUSE-based virtual filesystem,
Proton/umu-run integration, and Flatpak packaging.
Key features:
- FUSE VFS replacing Windows USVFS (in-process + standalone helper for Flatpak)
- Proton/GE-Proton/umu-run launcher with env var forwarding
- Flatpak support (sandbox-aware VFS, NXM handler, umu-run)
- Wine prefix management UI
- Case-insensitive path resolution for Linux filesystems
- QSettings-safe INI handling (avoids Bethesda INI corruption)
- Portable instance support with auto-generated launcher scripts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff')
5 files changed, 312 insertions, 0 deletions
diff --git a/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/LICENSE b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/LICENSE new file mode 100644 index 0000000..e2874c2 --- /dev/null +++ b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) unknown thibdev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.cpp b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.cpp new file mode 100644 index 0000000..d686c58 --- /dev/null +++ b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.cpp @@ -0,0 +1,165 @@ +#include "checkboxwordwrap.h" + +#include <QStyle> +#include <QStyleOptionButton> + +CheckBoxWordWrap::CheckBoxWordWrap(QWidget *parent) + : QCheckBox (parent) + , m_hMainLayout(new QHBoxLayout(this)) + , m_label(new ClickableLabel(this)) +{ + init(); +} + +CheckBoxWordWrap::CheckBoxWordWrap(const QString &text, QWidget *parent) + : QCheckBox (parent) + , m_hMainLayout(new QHBoxLayout(this)) + , m_label(new ClickableLabel(text, this)) +{ + init(); +} + +CheckBoxWordWrap::~CheckBoxWordWrap() +{ + delete m_label; + delete m_hMainLayout; +} + +bool CheckBoxWordWrap::isWordWrap() const +{ + return m_label->wordWrap(); +} + +void CheckBoxWordWrap::setWordWrap(bool wordwrap) +{ + m_label->setWordWrap(wordwrap); +} + +QString CheckBoxWordWrap::text() const +{ + return m_label->text(); +} + +void CheckBoxWordWrap::setText(const QString &text) +{ + m_label->setText(text); +} + +QSize CheckBoxWordWrap::sizeHint() const +{ + QFontMetrics fm(m_label->font()); + QRect r = m_label->rect(); + r.setLeft(r.left()+m_label->indent()+separation); + QRect bRect = fm.boundingRect(r, int(Qt::AlignLeft | Qt::AlignVCenter | Qt::TextWordWrap), m_label->text()); + QSize ret = QSize(QWidget::sizeHint().width(), bRect.height()); + return ret; +} + +void CheckBoxWordWrap::labelIsClicked() +{ + setChecked(!isChecked()); +} + +void CheckBoxWordWrap::resizeEvent(QResizeEvent *event) +{ + QWidget::resizeEvent(event); + updateGeometry(); +} + +void CheckBoxWordWrap::init() +{ + setLayout(m_hMainLayout); + QStyleOptionButton opt; + initStyleOption(&opt); + int indicatorW = style()->pixelMetric(QStyle::PixelMetric::PM_IndicatorWidth, &opt, this); + // Useless in our case, we only need the indicator width + //int indicatorH = style()->pixelMetric(QStyle::PixelMetric::PM_IndicatorHeight, &opt, this); + m_hMainLayout->setContentsMargins(0, 0, 0, 0); + m_hMainLayout->addWidget(m_label); + m_label->setIndent(indicatorW+separation); + m_label->setWordWrap(true); + + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + connect(m_label, SIGNAL(clicked()), this, SLOT(labelIsClicked())); +} + + +RadioButtonWordWrap::RadioButtonWordWrap(QWidget* parent) + : QRadioButton(parent) + , m_hMainLayout(new QHBoxLayout(this)) + , m_label(new ClickableLabel(this)) +{ + init(); +} + +RadioButtonWordWrap::RadioButtonWordWrap(const QString& text, QWidget* parent) + : QRadioButton(parent) + , m_hMainLayout(new QHBoxLayout(this)) + , m_label(new ClickableLabel(text, this)) +{ + init(); +} + +RadioButtonWordWrap::~RadioButtonWordWrap() +{ + delete m_label; + delete m_hMainLayout; +} + +bool RadioButtonWordWrap::isWordWrap() const +{ + return m_label->wordWrap(); +} + +void RadioButtonWordWrap::setWordWrap(bool wordwrap) +{ + m_label->setWordWrap(wordwrap); +} + +QString RadioButtonWordWrap::text() const +{ + return m_label->text(); +} + +void RadioButtonWordWrap::setText(const QString& text) +{ + m_label->setText(text); +} + +QSize RadioButtonWordWrap::sizeHint() const +{ + QFontMetrics fm(m_label->font()); + QRect r = m_label->rect(); + r.setLeft(r.left() + m_label->indent() + separation); + QRect bRect = fm.boundingRect(r, int(Qt::AlignLeft | Qt::AlignVCenter | Qt::TextWordWrap), m_label->text()); + QSize ret = QSize(QWidget::sizeHint().width(), bRect.height()); + return ret; +} + +void RadioButtonWordWrap::labelIsClicked() +{ + setChecked(!isChecked()); +} + +void RadioButtonWordWrap::resizeEvent(QResizeEvent* event) +{ + QWidget::resizeEvent(event); + updateGeometry(); +} + +void RadioButtonWordWrap::init() +{ + setLayout(m_hMainLayout); + QStyleOptionButton opt; + initStyleOption(&opt); + int indicatorW = style()->pixelMetric(QStyle::PixelMetric::PM_IndicatorWidth, &opt, this); + // Useless in our case, we only need the indicator width + //int indicatorH = style()->pixelMetric(QStyle::PixelMetric::PM_IndicatorHeight, &opt, this); + m_hMainLayout->setContentsMargins(0, 0, 0, 0); + m_hMainLayout->addWidget(m_label); + m_label->setIndent(indicatorW + separation); + m_label->setWordWrap(true); + + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); + connect(m_label, SIGNAL(clicked()), this, SLOT(labelIsClicked())); +} diff --git a/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.h b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.h new file mode 100644 index 0000000..dc4d30c --- /dev/null +++ b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/checkboxwordwrap.h @@ -0,0 +1,75 @@ +#ifndef CHECKBOXWORDWRAP_H +#define CHECKBOXWORDWRAP_H + +#include <QCheckBox> +#include <QHBoxLayout> +#include <QRadioButton> + +#include "clickablelabel.h" + +/** + * @author thibdev + */ +class CheckBoxWordWrap : public QCheckBox +{ + Q_OBJECT + + Q_PROPERTY(bool wordwrap READ isWordWrap WRITE setWordWrap) + Q_PROPERTY(QString text READ text WRITE setText) + +public: + CheckBoxWordWrap(QWidget *parent = Q_NULLPTR); + CheckBoxWordWrap(const QString &text, QWidget *parent = Q_NULLPTR); + ~CheckBoxWordWrap(); + bool isWordWrap() const; + void setWordWrap(bool wordwrap); + QString text() const; + void setText(const QString &text); + QSize sizeHint() const override; + +private slots: + void labelIsClicked(); + +protected: + void resizeEvent(QResizeEvent *event) override; + +private: + void init(); + const int separation = 5; + QHBoxLayout *m_hMainLayout; + ClickableLabel *m_label; + +}; + +class RadioButtonWordWrap : public QRadioButton +{ + Q_OBJECT + + Q_PROPERTY(bool wordwrap READ isWordWrap WRITE setWordWrap) + Q_PROPERTY(QString text READ text WRITE setText) + +public: + RadioButtonWordWrap(QWidget* parent = Q_NULLPTR); + RadioButtonWordWrap(const QString& text, QWidget* parent = Q_NULLPTR); + ~RadioButtonWordWrap(); + bool isWordWrap() const; + void setWordWrap(bool wordwrap); + QString text() const; + void setText(const QString& text); + QSize sizeHint() const override; + +private slots: + void labelIsClicked(); + +protected: + void resizeEvent(QResizeEvent* event) override; + +private: + void init(); + const int separation = 5; + QHBoxLayout* m_hMainLayout; + ClickableLabel* m_label; + +}; + +#endif diff --git a/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/clickablelabel.cpp b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/clickablelabel.cpp new file mode 100644 index 0000000..6f8d47f --- /dev/null +++ b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/clickablelabel.cpp @@ -0,0 +1,24 @@ +#include "clickablelabel.h" + +ClickableLabel::ClickableLabel(QWidget *parent, Qt::WindowFlags f) + : QLabel(parent, f) +{ + +} + +ClickableLabel::ClickableLabel(const QString &text, QWidget *parent, Qt::WindowFlags f) + : QLabel(text, parent, f) +{ + +} + +ClickableLabel::~ClickableLabel() +{ + +} + +void ClickableLabel::mouseReleaseEvent(QMouseEvent *event) +{ + Q_UNUSED(event); + emit clicked(); +} diff --git a/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/clickablelabel.h b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/clickablelabel.h new file mode 100644 index 0000000..c3ee22b --- /dev/null +++ b/libs/installer_omod/src/oldstuff/MIT-licencedCodeToDoStuff/clickablelabel.h @@ -0,0 +1,27 @@ +#ifndef CLICKABLELABEL_H +#define CLICKABLELABEL_H + +#include <QLabel> +#include <QMouseEvent> + +/** + * @brief The ClickableLabel class + * https://wiki.qt.io/Clickable_QLabel + */ +class ClickableLabel : public QLabel +{ + Q_OBJECT +public: + explicit ClickableLabel(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); + explicit ClickableLabel(const QString &text, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); + ~ClickableLabel() override; + +signals: + void clicked(); + +protected: + void mouseReleaseEvent(QMouseEvent *event) override; + +}; + +#endif // CLICKABLELABEL_H |
