├── README.md ├── xaboutwidget.pri ├── xaboutwidget.cmake ├── LICENSE ├── xaboutwidget.h ├── xaboutwidget.cpp └── xaboutwidget.ui /README.md: -------------------------------------------------------------------------------- 1 | # XAboutWidget 2 | -------------------------------------------------------------------------------- /xaboutwidget.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH += $$PWD 2 | DEPENDPATH += $$PWD 3 | 4 | SOURCES += \ 5 | $$PWD/xaboutwidget.cpp 6 | 7 | HEADERS += \ 8 | $$PWD/xaboutwidget.h 9 | 10 | FORMS += \ 11 | $$PWD/xaboutwidget.ui 12 | 13 | !contains(XCONFIG, xshortcuts) { 14 | XCONFIG += xshortcuts 15 | include($$PWD/../XShortcuts/xshortcuts.pri) 16 | } 17 | 18 | DISTFILES += \ 19 | $$PWD/LICENSE \ 20 | $$PWD/README.md \ 21 | $$PWD/xaboutwidget.cmake 22 | -------------------------------------------------------------------------------- /xaboutwidget.cmake: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_CURRENT_LIST_DIR}) 2 | 3 | if (NOT DEFINED XSHORTCUTS_SOURCES) 4 | include(${CMAKE_CURRENT_LIST_DIR}/../XShortcuts/xshortcuts.cmake) 5 | set(XABOUTWIDGET_SOURCES ${XABOUTWIDGET_SOURCES} ${XSHORTCUTS_SOURCES}) 6 | endif() 7 | 8 | set(XABOUTWIDGET_SOURCES 9 | ${XABOUTWIDGET_SOURCES} 10 | ${CMAKE_CURRENT_LIST_DIR}/xaboutwidget.cpp 11 | ${CMAKE_CURRENT_LIST_DIR}/xaboutwidget.h 12 | ${CMAKE_CURRENT_LIST_DIR}/xaboutwidget.ui 13 | ) 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2025 hors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /xaboutwidget.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2022-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #ifndef XABOUTWIDGET_H 22 | #define XABOUTWIDGET_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #if (QT_VERSION_MAJOR > 4) 29 | #include 30 | #include 31 | #endif 32 | #include 33 | #include 34 | #include 35 | #include "xshortcutswidget.h" 36 | #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) 37 | #include 38 | #elif (QT_VERSION_MAJOR >= 6) 39 | #include 40 | #endif 41 | #ifdef QT_NETWORK_LIB 42 | #include 43 | #include 44 | #endif 45 | // TODO XGitHub API for check versions 46 | 47 | namespace Ui { 48 | class XAboutWidget; 49 | } 50 | 51 | class XAboutWidget : public XShortcutsWidget { 52 | Q_OBJECT 53 | 54 | public: 55 | struct DATA { 56 | QString sInfo; 57 | QString sUpdatesLink; 58 | QString sServerVersionLink; 59 | QString sLibraries; 60 | QString sLogoPath; 61 | QString sThanksLink; 62 | }; 63 | 64 | explicit XAboutWidget(QWidget *pParent = nullptr); 65 | ~XAboutWidget(); 66 | virtual void adjustView(); 67 | virtual void reloadData(bool bSaveSelection); 68 | 69 | void setData(const DATA &data); 70 | 71 | private slots: 72 | void on_pushButtonCheckUpdates_clicked(); 73 | void on_labelInfo_linkActivated(const QString &sLink); 74 | void on_pushButtonFollowGitHub_clicked(); 75 | void on_pushButtonFollowX_clicked(); 76 | void on_pushButtonFollowYouTube_clicked(); 77 | void on_pushButtonThanks_clicked(); 78 | void on_pushButtonTelegram_clicked(); 79 | void on_pushButtonDiscord_clicked(); 80 | 81 | protected: 82 | virtual void registerShortcuts(bool bState); 83 | 84 | private: 85 | Ui::XAboutWidget *ui; 86 | DATA m_data; 87 | }; 88 | 89 | #endif // XABOUTWIDGET_H 90 | -------------------------------------------------------------------------------- /xaboutwidget.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2022-2025 hors 2 | * 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * 10 | * The above copyright notice and this permission notice shall be included in all 11 | * copies or substantial portions of the Software. 12 | * 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | * SOFTWARE. 20 | */ 21 | #include "xaboutwidget.h" 22 | 23 | #include "ui_xaboutwidget.h" 24 | 25 | XAboutWidget::XAboutWidget(QWidget *pParent) : XShortcutsWidget(pParent), ui(new Ui::XAboutWidget) 26 | { 27 | ui->setupUi(this); 28 | ui->pushButtonCheckUpdates->setVisible(!XOptions::isNative()); 29 | 30 | m_data = {}; 31 | 32 | ui->labelDate->setText(__DATE__); 33 | ui->tabWidgetAbout->setCurrentIndex(0); 34 | } 35 | 36 | XAboutWidget::~XAboutWidget() 37 | { 38 | delete ui; 39 | } 40 | 41 | void XAboutWidget::adjustView() 42 | { 43 | } 44 | 45 | void XAboutWidget::reloadData(bool bSaveSelection) 46 | { 47 | Q_UNUSED(bSaveSelection) 48 | } 49 | 50 | void XAboutWidget::setData(const DATA &data) 51 | { 52 | m_data = data; 53 | 54 | ui->labelInfo->setText(data.sInfo); 55 | ui->labelLibraries->setText(data.sLibraries); 56 | 57 | QPixmap pixMap = QPixmap(data.sLogoPath); 58 | 59 | pixMap = pixMap.scaledToHeight(height()); 60 | 61 | ui->labelLogo->setPixmap(pixMap); 62 | } 63 | 64 | void XAboutWidget::on_pushButtonCheckUpdates_clicked() 65 | { 66 | // TODO GitHub API for checking version 67 | #ifdef QT_NETWORK_LIB 68 | if (m_data.sServerVersionLink != "") { 69 | QNetworkAccessManager manager(this); 70 | QNetworkRequest request(QUrl(m_data.sServerVersionLink)); 71 | QNetworkReply *pReply = manager.get(request); 72 | QEventLoop loop; 73 | QObject::connect(pReply, SIGNAL(finished()), &loop, SLOT(quit())); 74 | loop.exec(); 75 | 76 | if (pReply->error() == QNetworkReply::NoError) { 77 | if (pReply->bytesAvailable()) { 78 | QByteArray baData = pReply->readAll(); 79 | QString sVersion = QString(baData.data()); 80 | 81 | if (QCoreApplication::applicationVersion().toDouble() < sVersion.toDouble()) { 82 | if (QMessageBox::information(this, tr("Update information"), 83 | QString("%1\r\n\r\n%2\r\n\r\n%3").arg(tr("New version available"), sVersion, tr("Go to download page?")), 84 | QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { 85 | QDesktopServices::openUrl(QUrl(m_data.sUpdatesLink)); 86 | } 87 | } else { 88 | QMessageBox::information(this, tr("Update information"), tr("No update available")); 89 | } 90 | } 91 | } else { 92 | QMessageBox::critical(this, tr("Network error"), pReply->errorString()); 93 | } 94 | } else { 95 | QDesktopServices::openUrl(QUrl(m_data.sUpdatesLink)); 96 | } 97 | #else 98 | QDesktopServices::openUrl(QUrl(m_data.sUpdatesLink)); 99 | #endif 100 | } 101 | 102 | void XAboutWidget::on_labelInfo_linkActivated(const QString &sLink) 103 | { 104 | if (sLink.startsWith("http", Qt::CaseInsensitive)) { 105 | QDesktopServices::openUrl(sLink); 106 | } else { 107 | QApplication::clipboard()->setText(sLink); 108 | 109 | QMessageBox::information(this, tr("Information"), tr("The value copied to clipboard")); 110 | } 111 | } 112 | 113 | void XAboutWidget::on_pushButtonFollowGitHub_clicked() 114 | { 115 | QDesktopServices::openUrl(QUrl(QString("https://github.com/horsicq"))); 116 | } 117 | 118 | void XAboutWidget::on_pushButtonFollowX_clicked() 119 | { 120 | QDesktopServices::openUrl(QUrl(QString("https://x.com/horsicq"))); 121 | } 122 | 123 | void XAboutWidget::on_pushButtonFollowYouTube_clicked() 124 | { 125 | QDesktopServices::openUrl(QUrl(QString("https://www.youtube.com/@funreverseengineering"))); 126 | } 127 | 128 | void XAboutWidget::on_pushButtonThanks_clicked() 129 | { 130 | QDesktopServices::openUrl(QUrl(m_data.sThanksLink)); 131 | } 132 | 133 | void XAboutWidget::on_pushButtonTelegram_clicked() 134 | { 135 | QDesktopServices::openUrl(QUrl(QString("https://www.t.me/horsicq"))); 136 | } 137 | 138 | void XAboutWidget::on_pushButtonDiscord_clicked() 139 | { 140 | // Currently only possible over the Website to open the Discord profile. Not Desktop-App compatible! 141 | // User have to signed into Discord on the Website! 142 | QDesktopServices::openUrl(QUrl(QString("https://discord.com/users/641741884095725569"))); 143 | } 144 | 145 | void XAboutWidget::registerShortcuts(bool bState) 146 | { 147 | Q_UNUSED(bState) 148 | } 149 | -------------------------------------------------------------------------------- /xaboutwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | XAboutWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 590 10 | 342 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 0 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 0 35 | 36 | 37 | 38 | 39 | 40 | 41 | Qt::AlignCenter 42 | 43 | 44 | 45 | 46 | 47 | 48 | 0 49 | 50 | 51 | 52 | Info 53 | 54 | 55 | 56 | 9 57 | 58 | 59 | 9 60 | 61 | 62 | 9 63 | 64 | 65 | 9 66 | 67 | 68 | 69 | 70 | Follow me 71 | 72 | 73 | 74 | 2 75 | 76 | 77 | 2 78 | 79 | 80 | 2 81 | 82 | 83 | 2 84 | 85 | 86 | 87 | 88 | GitHub 89 | 90 | 91 | 92 | 93 | 94 | 95 | X 96 | 97 | 98 | 99 | 100 | 101 | 102 | YouTube 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 0 114 | 0 115 | 116 | 117 | 118 | 119 | 120 | 121 | false 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | Thanks 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 0 139 | 0 140 | 141 | 142 | 143 | 144 | 145 | 146 | Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 147 | 148 | 149 | 150 | 151 | 152 | 153 | Check for updates 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | Libraries 164 | 165 | 166 | 167 | 0 168 | 169 | 170 | 0 171 | 172 | 173 | 0 174 | 175 | 176 | 0 177 | 178 | 179 | 180 | 181 | 182 | 0 183 | 0 184 | 185 | 186 | 187 | 188 | 189 | 190 | true 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | Social Media 199 | 200 | 201 | 202 | 9 203 | 204 | 205 | 9 206 | 207 | 208 | 9 209 | 210 | 211 | 9 212 | 213 | 214 | 215 | 216 | Social Media 217 | 218 | 219 | 220 | 2 221 | 222 | 223 | 2 224 | 225 | 226 | 2 227 | 228 | 229 | 2 230 | 231 | 232 | 233 | 234 | Telegram 235 | 236 | 237 | 238 | 239 | 240 | 241 | Discord 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 0 253 | 0 254 | 255 | 256 | 257 | 258 | 259 | 260 | true 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | --------------------------------------------------------------------------------