Skip to content

Commit

Permalink
KLog 2.0 Stop war
Browse files Browse the repository at this point in the history
  • Loading branch information
ea4k committed Feb 25, 2022
1 parent 994aa42 commit 008d7fa
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 1 deletion.
Empty file added FUPhnM.json
Empty file.
59 changes: 59 additions & 0 deletions macOSDeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash
# Script to deploy the macOS package
# Must be executed in the build directory of KLog
#***************************************************************************
#
# macOSDeploy.sh
# -------------------
# begin : jan 2021
# copyright : (C) 2021 by Jaime Robles
# email : [email protected]
# ***************************************************************************
#/*****************************************************************************
# * This file is part of KLog. *
# * *
# * KLog is free software: you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation, either version 3 of the License, or *
# * (at your option) any later version. *
# * *
# * KLog is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU General Public License for more details. *
# * *
# * You should have received a copy of the GNU General Public License *
# * along with KLog. If not, see <https://www.gnu.org/licenses/>. *
# * *
# *****************************************************************************/
if [ $# -ne 1 ]; then
echo "You must include the version of KLog you want to deploy as a single parameter"
echo ""
echo "example: deployOSX.sh 0.9.2 "
echo ""
echo ""
exit 1
fi
export CXXFLAGS=-std=c++11
KLOG_VERSION="$1"
KLOG_SOURCES="../src"
QTDIRi=$HOME"/Qt/5.15.2/clang_64"
rm -Rf KLog.app
rm -Rf build
/usr/bin/make clean
"$QTDIRi"/bin/qmake src.pro -spec macx-clang CONFIG+=x86_64
/usr/bin/make
mv build/target/klog.app KLog.app
mkdir -p KLog.app/Contents/PlugIns/sqldrivers
cp "$QTDIRi"/plugins/sqldrivers/libqsqlite.dylib KLog.app/Contents/PlugIns/sqldrivers
mkdir -p KLog.app/Contents/MacOS/translations
$QTDIRi/bin/lupdate src.pro
$QTDIRi/bin/lrelease src.pro
cp "$KLOG_SOURCES"/translations/*.qm KLog.app/Contents/MacOS/translations/
cp /usr/local/lib/libhamlib.4.dylib KLog.app/Contents/MacOS/
chmod +w KLog.app/Contents/MacOS/libhamlib.4.dylib
install_name_tool -id @executable_path/libhamlib.4.dylib KLog.app/Contents/MacOS/libhamlib.4.dylib
install_name_tool -change /usr/local/lib/libhamlib.4.dylib @executable_path/libhamlib.4.dylib KLog.app/Contents/MacOS/klog
"$QTDIRi"/bin/macdeployqt KLog.app/ -dmg
mv KLog.dmg KLog-"$KLOG_VERSION".dmg
echo "You can find the dmg file in this folder... enjoy KLog!"
5 changes: 5 additions & 0 deletions src/Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Feb 2022 - 2.0
- Stop the Ukranian war release.
This KLog release is showing my request to stop the war in Ukraine.
No other feature of bugfix will be done in this release.

Feb 2022 - 1.9
- New feature: Map showing locators. (Closes #168)
- Bugfix: Mark QSL to be sent is not shown if QSL is sent on right click menu in the search widget. (Closes #387).
Expand Down
43 changes: 43 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,48 @@
#include "database.h"
#include "mainwindow.h"

void MainWindow::showNotWar()
{
int callDXCC = world->getQRZARRLId(mainQRZ);
//int callDXCC = world->getQRZARRLId(stationCallsign);
int EURusId = 54; // ADIF code Eu Russia
int ASRusId = 15; // ADIF code As Russia
int KaRusId = 126; // Kaliningrad
int UkrId = 288; // UKraine

QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
msgBox.setWindowTitle(tr("KLog - Stop the war in Ukraine!"));
QString aux;
aux.clear();
#if defined(Q_OS_OSX)
aux = tr("KLog - Stop the war in Ukraine!\n\n");
#endif

qDebug() << "DXCC: " << QString::number(callDXCC);
if ((callDXCC == EURusId) || (callDXCC == ASRusId) || (callDXCC == KaRusId))
{
//qDebug() << "RUSSIA";
aux = aux + QString(tr("You are using a Russian call (%1).\n\nYou can probably help to stop the Russian war, people are dying.\n\nPlease call your leaders to stop the war.")).arg(mainQRZ);
}
else if (callDXCC == UkrId)
{
//qDebug() << "UKRAINE";
aux = aux + tr("You are using an Ukranian call.\n\nPlease take care and protect yourself and your family. \n\nThe KLog developers wish you the best of luck in this very difficult moment.");
}
else
{
//qDebug() << "Other";
aux = aux + tr("People are dying in the war of Russia against Ukraine.\n\nYou can help to stop the Russian war against Ukraine.\n\nPlease show your disagreement to your leaders, or in your social network to stop the war.");
}

msgBox.setText(aux);
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();

}

MainWindow::MainWindow(const QString &_klogDir, const QString &tversion)
{
//qDebug() << Q_FUNC_INFO << ": " << _klogDir << " Ver: " << tversion << QTime::currentTime().toString("hh:mm:ss") << QT_ENDL;
Expand Down Expand Up @@ -484,6 +526,7 @@ void MainWindow::init()
mainQSOEntryWidget->setUpAndRunning(upAndRunning);
//qDebug() << Q_FUNC_INFO << " - 130";
startServices();
showNotWar();

//qDebug() << "MainWindow::init: END" << (QTime::currentTime()).toString("HH:mm:ss") << QT_ENDL;
}
Expand Down
1 change: 1 addition & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ private slots:

private:
//void setWidgetsOrder();
void showNotWar();
void startServices();
void backupCurrentQSO();
void restoreCurrentQSO(const bool restoreConfig);
Expand Down
2 changes: 1 addition & 1 deletion src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CONFIG -=depend_includepath
#CONFIG += release
TEMPLATE = app

VERSION = 1.9
VERSION = 2.0

DEFINES += APP_VERSION=\\\"$$VERSION\\\"

Expand Down

0 comments on commit 008d7fa

Please sign in to comment.