File indexing completed on 2024-05-12 16:43:52
0001 /* 0002 SPDX-FileCopyrightText: 2009 Alvaro Soliverez <asoliverez@gmail.com> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 // ---------------------------------------------------------------------------- 0007 // Project Includes 0008 0009 #include "kwelcomepage.h" 0010 0011 // ---------------------------------------------------------------------------- 0012 // QT Includes 0013 0014 #include <QString> 0015 #include <QStringList> 0016 #include <QUrl> 0017 #include <QStandardPaths> 0018 #include <QApplication> 0019 0020 // ---------------------------------------------------------------------------- 0021 // KDE Includes 0022 0023 #include <KLocalizedString> 0024 0025 KWelcomePage::KWelcomePage() 0026 { 0027 } 0028 0029 KWelcomePage::~KWelcomePage() 0030 { 0031 } 0032 0033 bool KWelcomePage::isGroupHeader(const QString& item) 0034 { 0035 return item.startsWith(QLatin1Char('*')); 0036 } 0037 0038 bool KWelcomePage::isGroupItem(const QString& item) 0039 { 0040 return item.startsWith(QLatin1Char('-')); 0041 } 0042 0043 0044 const QString KWelcomePage::welcomePage() 0045 { 0046 QString header; 0047 QString footer; 0048 QString body; 0049 0050 //header 0051 header = QString("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"); 0052 header = QString("<html>"); 0053 header += QString("<head>"); 0054 header += QString("<title>" + i18n("Home Page") + "</title>"); 0055 header += QString("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">"); 0056 0057 const QString welcomeFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/welcome.css"); 0058 header += QString("<link href=\"%1\" rel=\"stylesheet\" type=\"text/css\">").arg(QUrl::fromLocalFile(welcomeFilename).url()); 0059 header += QString("</head>"); 0060 0061 //body of the page 0062 body = QString("<body>"); 0063 //"background_image", if enabled, displays an image in the background of this page. 0064 //If you wish to use a background, un-comment the following line 0065 const QString backgroundFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/background.png"); 0066 body += QString("<img id=\"background_image\" src=\"%1\" height=\"100%\">").arg(QUrl::fromLocalFile(backgroundFilename).url()); 0067 const QString logoFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/trans_logo.png"); 0068 body += QString("<img id=\"KMyMoneyLogo\" src=\"%1\">").arg(QUrl::fromLocalFile(logoFilename).url()); 0069 body += QString("<h3 id=\"title\">" + i18n("Welcome to KMyMoney") + "</h3>"); 0070 body += QString("<h4 id=\"subtitle\">" + i18n("The free, easy to use, personal finance manager by KDE") + "</h4>"); 0071 const QString backArrowFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/backarrow.png"); 0072 body += QString("<div id=\"returnLink\"><a href=\"/home\"><img src=\"%1\">").arg(QUrl::fromLocalFile(backArrowFilename).url()); 0073 body += QString(i18n("Go to My Financial Summary")); 0074 body += QString("</a></div>"); 0075 body += QString("<div id=\"topleft\">"); 0076 0077 //topright 0078 body += QString("<div id=\"topright\"></div>"); 0079 body += QString("<div id=\"rightborder\">"); 0080 body += QString("<table style=\"width: 100%;\">"); 0081 body += QString("<tbody>"); 0082 body += QString("<tr>"); 0083 body += QString("<td></td>"); 0084 body += QString("<td style=\"height: 150px;\">"); 0085 body += QString("<div id=\"welcomeMenu\">"); 0086 body += QString("<h4>" + i18n("Start with one of the following activities...") + "</h4>"); 0087 0088 //Welcome menu 0089 body += QString("<ul>"); 0090 const QString newFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/filenew.png"); 0091 body += QString("<li><img src=\"%1\">").arg(QUrl::fromLocalFile(newFilename).url()); 0092 body += QString("<a href=\"/action?id=file_new\">" + i18n("Get started and setup accounts") + "</a></li>"); 0093 const QString dataFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/kmymoneydata.png"); 0094 body += QString("<li><img src=\"%1\">").arg(QUrl::fromLocalFile(dataFilename).url()); 0095 body += QString("<a href=\"/action?id=file_open\">" + i18n("Open an existing data file") + "</a></li>"); 0096 const QString manualFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/manual.png"); 0097 body += QString("<li><img src=\"%1\">").arg(QUrl::fromLocalFile(manualFilename).url()); 0098 body += QString("<a href=\"/action?id=help_contents\">" + i18n("Learn how to use KMyMoney") + "</a></li>"); 0099 const QString konquerorFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/konqueror.png"); 0100 body += QString("<li><img src=\"%1\">").arg(QUrl::fromLocalFile(konquerorFilename).url()); 0101 body += QString("<a href=\"https://kmymoney.org\">" + i18n("Visit our website") + "</a></li>"); 0102 const QString aboutFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/about_kde.png"); 0103 body += QString("<li><img src=\"%1\">").arg(QUrl::fromLocalFile(aboutFilename).url()); 0104 body += QString("<a href=\"https://forum.kde.org/viewforum.php?f=69\">" + i18n("Get help from our community") + "</a></li>"); 0105 const QString messageFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/messagebox_info.png"); 0106 body += QString("<li><img src=\"%1\">").arg(QUrl::fromLocalFile(messageFilename).url()); 0107 body += QString("<a href=\"/welcome?mode=whatsnew\">" + i18n("See what's new in this version") + "</a></li>"); 0108 body += QString("</ul>"); 0109 0110 body += QString("</div>"); 0111 body += QString("</td>"); 0112 body += QString("<td></td>"); 0113 body += QString("</tr>"); 0114 body += QString("</tbody>"); 0115 body += QString("</table>"); 0116 //right border 0117 body += QString("</div>"); 0118 body += QString("<div id=\"bottomleft\">"); 0119 0120 //bottom right 0121 body += QString("<div id=\"bottomright\"></div>"); 0122 //bottom left 0123 body += QString("</div>"); 0124 //top left 0125 body += QString("</div>"); 0126 body += QString("</body>"); 0127 0128 //footer 0129 footer = "</html>"; 0130 0131 return header + body + footer; 0132 } 0133 0134 const QString KWelcomePage::whatsNewPage() 0135 { 0136 QString header; 0137 QString footer; 0138 QString body; 0139 0140 header = QString("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"); 0141 header += QString("<html>"); 0142 header += QString("<head>"); 0143 header += QString("<title>" + i18n("What's new in this version") + "</title>"); 0144 0145 const QString welcomeFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/welcome.css"); 0146 header += QString("<link href=\"%1\" rel=\"stylesheet\" type=\"text/css\">").arg(QUrl::fromLocalFile(welcomeFilename).url()); 0147 header += QString("</head>"); 0148 0149 //body of the page 0150 body = QString("<body>"); 0151 //"background_image", if enabled, displays an image in the background of this page. 0152 //If you wish to use a background, un-comment the following line 0153 const QString backgroundFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/background.png"); 0154 body += QString("<img id=\"background_image\" src=\"%1\" height=\"100%\">").arg(QUrl::fromLocalFile(backgroundFilename).url()); 0155 const QString logoFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/trans_logo.png"); 0156 body += QString("<img id=\"KMyMoneyLogo\" src=\"%1\">").arg(QUrl::fromLocalFile(logoFilename).url()); 0157 body += QString("<h3 id=\"title\">" + i18n("What's new in KMyMoney %1", QApplication::applicationVersion()) + "</h3>"); 0158 const QString backArrowFilename = QStandardPaths::locate(QStandardPaths::DataLocation, "html/images/backarrow.png"); 0159 body += QString("<div id=\"returnLink\"><img src=\"%1\">").arg(QUrl::fromLocalFile(backArrowFilename).url()); 0160 body += QString("<a href=\"/welcome\">" + i18n("Return to the Welcome page") + "</a></div>"); 0161 0162 body += QString("<div id=\"topleft\">"); 0163 0164 body += QString("<div id=\"topright\"></div>"); 0165 body += QString("<div id=\"rightborder\"><table><tr><td>"); 0166 //This is where the content should be put to show up inside the decorative frame 0167 //Begin content 0168 0169 body += QString("<p>" + i18n("We are pleased to announce a major step forward for what has been described as \"the BEST personal finance manager for FREE users\".") + "</p>"); 0170 body += QString("<h4>" + i18n("What's new in this version:") + "</h4>"); 0171 0172 QStringList featuresList = KWelcomePage::featuresList(); 0173 0174 bool inGroup = false; 0175 QStringList::ConstIterator feature_it; 0176 for (feature_it = featuresList.constBegin(); feature_it != featuresList.constEnd(); ++feature_it) { 0177 if (isGroupHeader(*feature_it)) { 0178 if (inGroup) { 0179 body += QString("</ul>"); 0180 } 0181 body += QString("<b>"); 0182 body += (*feature_it).midRef(2); 0183 body += QString("</b><br/>"); 0184 body += QString("<ul>"); 0185 inGroup = true; 0186 0187 } else if(isGroupItem(*feature_it)) { 0188 body += QString("<li>"); 0189 body += (*feature_it).midRef(2); 0190 body += QString("</li>"); 0191 } else { 0192 body += *feature_it; 0193 } 0194 } 0195 if (inGroup) { 0196 body += QString("</ul>"); 0197 } 0198 0199 body += QString("<p>" + i18n("Let us know what you think. We hope that you enjoy using the application.") + "</p>"); 0200 body += QString("<p>" + i18n("Please let us know about any abnormal behavior in the program by selecting <a href=\"/action?id=help_report_bug\">\"Report bug...\"</a> from the help menu or by sending an e-mail to the developers mailing list.")); 0201 body += QString("<font color=\"blue\"><a href=\"mailto:kmymoney-devel@kde.org\">kmymoney-devel@kde.org</a></font></p>"); 0202 body += QString("<p><div align=\"right\">"); 0203 body += QString(i18n("The KMyMoney Development Team")); 0204 body += QString("</div></p>"); 0205 0206 //End content 0207 body += QString("</td></tr></table>"); 0208 body += QString("</div>"); 0209 body += QString("<div id=\"bottomleft\"><div id=\"bottomright\"></div>"); 0210 body += QString("</div>"); 0211 body += QString("</div>"); 0212 body += QString("<div style=\"margin-bottom: 65px\"></div>"); 0213 body += QString("</body>"); 0214 0215 //footer 0216 footer += QString("</html>"); 0217 0218 return header + body + footer; 0219 } 0220 0221 const QStringList KWelcomePage::featuresList() 0222 { 0223 QStringList featuresList; 0224 0225 featuresList.append(i18n("* General changes")); 0226 featuresList.append(i18n("- Port to KDE frameworks and Qt5")); 0227 0228 featuresList.append(i18n("* User Interface changes")); 0229 featuresList.append(i18n("- Show more tooltips why features are not available")); 0230 featuresList.append(i18n("- Improved compatibility with dark color schemes")); 0231 featuresList.append(i18n("- Fast switching of main views via Ctrl + number key")); 0232 featuresList.append(i18n("- Improved keyboard navigation")); 0233 featuresList.append(i18n("- View columns are user selectable")); 0234 featuresList.append(i18n("- Use QWebEngine in favor of KHTML when available")); 0235 0236 featuresList.append(i18n("* Im-/Exporter")); 0237 featuresList.append(i18n("- Added support for Woob")); 0238 featuresList.append(i18n("- Improved CSV importer")); 0239 featuresList.append(i18n("- Added CSV exporter")); 0240 featuresList.append(i18n("- Improved payee matching when importing transactions")); 0241 0242 featuresList.append(i18n("* Online services")); 0243 featuresList.append(i18n("- Updated list of application versions for OFX direct import")); 0244 featuresList.append(i18n("- Get rid of Yahoo as price source")); 0245 featuresList.append(i18n("- Supporting OFX client uid required by some banks")); 0246 featuresList.append(i18n("- Support price download by ISIN")); 0247 0248 return featuresList; 0249 } 0250