Skip to content

Commit

Permalink
Release improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
pietr26 committed Feb 25, 2023
1 parent 04cd771 commit f776db1
Show file tree
Hide file tree
Showing 12 changed files with 380 additions and 286 deletions.
3 changes: 2 additions & 1 deletion OTBackend/OTGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ class OTInformation
{
public:
inline static const QString name = "OMSI-Tools";
inline static const OTBuildOptions::buildOptions build = OTBuildOptions::Dev;
inline static const OTBuildOptions::buildOptions build = OTBuildOptions::Lite;
inline static const QString sourceCodeLength = "18 000";

class versions
{
public:
inline static const QList<QPair<QString, unsigned int>> allVersions = {
QPair<QString, unsigned int>("1.1.0-lite", 33),
QPair<QString, unsigned int>("1.1.0-beta", 32),
QPair<QString, unsigned int>("1.1.0-dev", 31),
QPair<QString, unsigned int>("1.0.0-lite", 30),
Expand Down
3 changes: 0 additions & 3 deletions OTBackend/OTOmsiFileHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,9 @@ class OTOMSIFileHandler
in.setEncoding(QStringConverter::System);
QString line;
unsigned int profileCounter = 0;
int lineCount = 0;

while (!in.atEnd())
{
lineCount++;
qDebug().noquote() << "Line" << lineCount;
line = in.readLine();

// texure check:
Expand Down
2 changes: 1 addition & 1 deletion OTModules/OTGeneric/wsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ wSettings::wSettings(QWidget *parent, QString openDirect) :

qDebug() << "Set up UI...";
ui->setupUi(this);
adjustSize();
resize(misc.sizeWindow(0.3, 0.4));
qDebug() << "UI set";

setWindowTitle(OTInformation::name + " - " + tr("settings"));
Expand Down
10 changes: 7 additions & 3 deletions OTModules/OTGeneric/wstart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ wStart::wStart(QWidget *parent)
fadeInOutText *facts = new fadeInOutText(OTStrings::getFunFacts());
ui->vlaFacts->addWidget(facts);

ui->dwgMessages->setWindowTitle(tr("News"));
loadMessages();
ui->dwgMessages->setVisible(set.read(objectName(), "messagesVisible").toBool());

Expand Down Expand Up @@ -80,9 +81,11 @@ wStart::~wStart()
void wStart::loadMessages()
{
QStringList messages = QString(nc.post(OTLinks::inAppMessages)).split("\n");
qDebug() << messages;
ui->dwgMessages->setWindowTitle(tr("News"));

if (nc.lastSuccess == -2)
if (nc.lastSuccess == -1)
ui->dwgMessages->setWindowTitle(tr("News - no internet connection"));
else if (nc.lastSuccess == -2)
{
OTInAppMessage messageData;
messageData.ID = "-1";
Expand Down Expand Up @@ -283,7 +286,7 @@ void wStart::on_actionReleaseNotes_triggered()
/// Opens the manual, currenty only in german
void wStart::on_actionManual_triggered()
{
QDesktopServices::openUrl(QUrl("file:///" + QApplication::applicationDirPath() + "/_docs/OMSI-Tools Lite - Handbuch DE.pdf"));
QDesktopServices::openUrl(QUrl("file:///" + QApplication::applicationDirPath() + "/_docs/OMSI-Tools - Handbuch DE.pdf"));
}

/// Opens style test
Expand Down Expand Up @@ -344,6 +347,7 @@ void wStart::on_actionShowHideMessageDock_triggered()
ui->dwgMessages->setVisible(!ui->dwgMessages->isVisible());
set.write(objectName(), "messagesVisible", ui->dwgMessages->isVisible());
adjustSize();
move(misc.centerPosition(this));
}

void wStart::on_dwgMessages_dockLocationChanged(const Qt::DockWidgetArea &area)
Expand Down
2 changes: 1 addition & 1 deletion OTModules/OTGeneric/wstart.ui
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
<set>Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>News</string>
<string notr="true">dwgMessages</string>
</property>
<attribute name="dockWidgetArea">
<number>2</number>
Expand Down
6 changes: 3 additions & 3 deletions OTModules/wContentSearch/wsuggestfiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ void wSuggestFiles::on_btnSend_clicked()
{
qInfo() << nc.post(OTLinks::csReportLink,
QList<QPair<QString, QString>> {
QPair<QString, QString>("link", ui->pteReport->toPlainText()),
QPair<QString, QString>("links", ui->pteReport->toPlainText()),
QPair<QString, QString>("notes", ui->pteNotes->toPlainText()),
});

if (nc.lastSuccess == 1)
{
QMessageBox::information(this, tr("Suggestion sent"), tr("The suggestion has been sent. Thank you!"));
QMessageBox::information(this, tr("Report sent"), tr("The report has been sent. Thank you!"));
close();
}
else
QMessageBox::critical(this, tr("Cannot send suggestion"), tr("The suggestion could not be sent. Please try again later."));
QMessageBox::critical(this, tr("Cannot send report"), tr("The report could not be sent. Please try again later."));
}
else
{
Expand Down
Binary file modified data/db/contentSearch.db
Binary file not shown.
Loading

0 comments on commit f776db1

Please sign in to comment.