File indexing completed on 2024-12-01 04:37:05
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "servererrorinfohistory/servererrorinfomessagehistorydialog.h" 0008 #include "servererrorinfohistorymanager.h" 0009 #include "testservererrorinfomessagehistorywidget.h" 0010 #include <QApplication> 0011 #include <QCommandLineParser> 0012 int main(int argc, char **argv) 0013 { 0014 QApplication app(argc, argv); 0015 QCommandLineParser parser; 0016 parser.addVersionOption(); 0017 parser.addHelpOption(); 0018 parser.process(app); 0019 auto w = new ServerErrorInfoMessageHistoryDialog(); 0020 w->resize(800, 600); 0021 w->show(); 0022 0023 auto configServerInfo = new TestServerErrorInfoMessageHistoryWidget(); 0024 configServerInfo->resize(600, 300); 0025 configServerInfo->show(); 0026 0027 QStringList lst; 0028 for (int i = 0; i < 10; ++i) { 0029 ServerErrorInfo info; 0030 const QString accountName = QStringLiteral("account %1").arg(QString::number(i)); 0031 info.setAccountName(accountName); 0032 const QString str = QStringLiteral("Message: %1").arg(QString::number(i)); 0033 info.setMessage(str); 0034 ServerErrorInfoHistoryManager::self()->addServerErrorInfo(info); 0035 lst << accountName; 0036 } 0037 w->addServerList(lst); 0038 return app.exec(); 0039 }