This commit is contained in:
g8bpq 2023-06-21 08:25:00 +01:00
parent 54d80b9e90
commit 01f8df5cbe
7 changed files with 102 additions and 82 deletions

View File

@ -22,6 +22,8 @@ extern QColor outputText;
extern QColor EchoText;
extern QColor WarningText;
extern QColor newTabText;
extern QTabWidget *tabWidget;
extern QWidget * mythis;
@ -1039,7 +1041,9 @@ void on_AGW_C_frame(AGWUser * AGW, struct AGWHeader * Frame, byte * Msg)
else if (TermMode == Tabbed)
{
tabWidget->setTabText(i, CallFrom);
tabWidget->tabBar()->setTabTextColor(i, newTabText);
}
else if (TermMode == Single)
mythis->setWindowTitle(Title);

View File

@ -1,6 +1,6 @@
// Qt Version of BPQTermTCP
#define VersionString "0.0.0.63"
#define VersionString "0.0.0.66"
// .12 Save font weight
// .13 Display incomplete lines (ie without CR)
@ -69,7 +69,9 @@
// .61 Add VARA Init Script Feb 2023
// .62 Fix running AGW in single session mode Feb 2023
// .63 Fix handling split monitor frame (no fe in buffer) Apr 2023
// .64 Add Clear Screen command to context menu Apr 2023
// .65 Fixes for 63 port version of BPQ May 2023
// .66 Colour Tab of incoming calls June 2023
#define _CRT_SECURE_NO_WARNINGS
@ -150,6 +152,9 @@ QColor WarningText = qRgb(255, 0, 0);
QColor inputBackground = qRgb(255, 255, 0);
QColor inputText = qRgb(0, 0, 255);
QColor newTabText = qRgb(255, 0, 0); // Red
QColor oldTabText = qRgb(0, 0, 0); // Black
// There is something odd about this. It doesn't match BPQTERMTCP though it looks the same
@ -373,7 +378,7 @@ QAction *MonSup;
QAction *MonNodes;
QAction *MonUI;
QAction *MonColour;
QAction *MonPort[33];
QAction *MonPort[65];
QAction *actChatMode;
QAction *actAutoTeletext;
QAction *actBells;
@ -971,6 +976,17 @@ Ui_ListenSession * newWindow(QObject * parent, int Type, const char * Label)
}
if (Type == Mon)
{
// Monitor Only
Sess->monWindow->setContextMenuPolicy(Qt::CustomContextMenu);
mythis->connect(Sess->monWindow, SIGNAL(customContextMenuRequested(const QPoint&)),
parent, SLOT(showContextMenuMOnly(const QPoint &)));
}
if (Type == (Term | Mon))
{
// Combined Term and Mon. Add Custom Menu to set Mon/Term Split with Right Click
@ -1611,6 +1627,15 @@ void QtTermTCP::setSplit()
eventFilter(Parent, &event);
}
void QtTermTCP::ClearScreen()
{
QAction * sender = static_cast<QAction*>(QObject::sender());
QTextEdit * window = static_cast<QTextEdit*>(sender->parentWidget());
window->clear();
}
void QtTermTCP::showContextMenuMT(const QPoint &pt) // Term Window
{
// Monitor and Terminal (Term Half)
@ -1624,14 +1649,37 @@ void QtTermTCP::showContextMenuMT(const QPoint &pt) // Term Window
QAction * actSplit = new QAction("Set Monitor/Output Split", sender);
QAction * actVDMode = new QAction("Toggle Viewdata Mode", sender);
QAction * actClear = new QAction("Clear Screen Buffer", sender);
menu->addAction(actSplit);
menu->addAction(actVDMode);
menu->addAction(actClear);
splitY = pt.y() + termX;
connect(actSplit, SIGNAL(triggered()), this, SLOT(setSplit()));
connect(actVDMode, SIGNAL(triggered()), this, SLOT(setVDMode()));
connect(actClear, SIGNAL(triggered()), this, SLOT(ClearScreen()));
menu->exec(sender->mapToGlobal(pt));
delete menu;
}
void QtTermTCP::showContextMenuMOnly(const QPoint &pt)
{
// Monitor only
QTextEdit* sender = static_cast<QTextEdit*>(QObject::sender());
QMenu *menu = sender->createStandardContextMenu();
QString style = "QMenu {border-radius:15px; background-color: white;margin: 2px; border: 1px solid rgb(58, 80, 116); color: rgb(58, 80, 116);}QMenu::separator {height: 2px;background: rgb(58, 80, 116);margin-left: 10px;margin-right: 5px;}";
menu->setStyleSheet(style);
QAction * actClear = new QAction("Clear Screen Buffer", sender);
menu->addAction(actClear);
connect(actClear, SIGNAL(triggered()), this, SLOT(ClearScreen()));
menu->exec(sender->mapToGlobal(pt));
delete menu;
@ -1651,10 +1699,14 @@ void QtTermTCP::showContextMenuT(const QPoint &pt) // Term Window
QAction * actVDMode = new QAction("Toggle Viewdata Mode", sender);
QAction * actClear = new QAction("Clear Screen Buffer", sender);
menu->addAction(actVDMode);
menu->addAction(actClear);
connect(actVDMode, SIGNAL(triggered()), this, SLOT(setVDMode()));
connect(actClear, SIGNAL(triggered()), this, SLOT(ClearScreen()));
menu->exec(sender->mapToGlobal(pt));
delete menu;
}
@ -1694,12 +1746,15 @@ void QtTermTCP::showContextMenuM(const QPoint &pt) // Mon Window
menu->setStyleSheet(style);
QAction * actSplit = new QAction("Set Monitor/Output Split", sender);
QAction * actClear = new QAction("Clear Screen Buffer", sender);
menu->addAction(actSplit);
menu->addAction(actClear);
splitY = pt.y();
connect(actSplit, SIGNAL(triggered()), this, SLOT(setSplit()));
connect(actClear, SIGNAL(triggered()), this, SLOT(ClearScreen()));
menu->exec(sender->mapToGlobal(pt));
delete menu;
@ -1778,6 +1833,8 @@ void QtTermTCP::tabSelected(int Current)
ActiveSession = Sess;
tabWidget->tabBar()->setTabTextColor(tabWidget->currentIndex(), oldTabText);
if (Sess->clientSocket || Sess->AGWSession || Sess->KISSSession || Sess->KISSMode)
{
connectMenu->setEnabled(false);
@ -2220,15 +2277,14 @@ void QtTermTCP::menuChecked()
else
{
// look for port entry
for (int i = 0; i < MAXPORTS; i++)
for (int i = 0; i < MAXPORTS + 1; i++)
{
if (Act == MonPort[i])
{
unsigned long long mmask;
if (i == 0) // BBS Mon - use bit 32
mmask = 1ll << 32;
if (i == 0) // BBS Mon - use bit 63 (Port 64)
mmask = 1ll << 63;
else
mmask = 1ll << (i - 1);
@ -2647,6 +2703,19 @@ extern "C" void WritetoOutputWindowEx(Ui_ListenSession * Sess, unsigned char * B
myBeep();
}
// if tabbed and not active tab set tab label red
if (TermMode == Tabbed)
{
if (Sess->monWindow != termWindow) // Not if Monitor
{
if (ActiveSession != Sess)
{
tabWidget->tabBar()->setTabTextColor(Sess->Tab, newTabText);
}
}
}
LastWrite = NOW;
// Mustn't mess with original buffer
@ -3992,7 +4061,9 @@ void QtTermTCP::onNewConnection()
else if (TermMode == Tabbed)
{
tabWidget->setTabText(i, datas.data());
tabWidget->tabBar()->setTabTextColor(i, newTabText);
}
else if (TermMode == Single)
this->setWindowTitle(Title);
@ -4861,7 +4932,10 @@ void QtTermTCP::VARAreadyRead()
if (TermMode == MDI)
Sess->setWindowTitle(Title);
else if (TermMode == Tabbed)
{
tabWidget->setTabText(Sess->Tab, CallFrom);
tabWidget->tabBar()->setTabTextColor(Sess->Tab, newTabText);
}
else if (TermMode == Single)
mythis->setWindowTitle(Title);
@ -6139,6 +6213,7 @@ extern "C" Ui_ListenSession * ax25IncommingConnect(TAX25Port * AX25Sess)
else if (TermMode == Tabbed)
{
tabWidget->setTabText(i, AX25Sess->corrcall);
tabWidget->tabBar()->setTabTextColor(i, newTabText);
}
else if (TermMode == Single)
mythis->setWindowTitle(Title);
@ -6517,7 +6592,7 @@ void DecodeTeleText(Ui_ListenSession * Sess, char * page)
// interpret data, for now, line by line
while (c = *(ptr++))
while ((c = *(ptr++)))
{
char ch = c;

View File

@ -30,7 +30,7 @@
#include <QtSerialPort/QSerialPort>
#define MAXHOSTS 16
#define MAXPORTS 32
#define MAXPORTS 64
QT_BEGIN_NAMESPACE
class QComboBox;
@ -161,8 +161,10 @@ private slots:
void onTEselectionChanged();
void onLEselectionChanged();
void setSplit();
void ClearScreen();
void setVDMode();
void showContextMenuMT(const QPoint & pt);
void showContextMenuMOnly(const QPoint & pt);
void onNewConnection();
void onSocketStateChanged(QAbstractSocket::SocketState socketState);
void updateWindowMenu();

View File

@ -1,12 +1,12 @@
[General]
HostParams0=192.168.1.44|8011|g8bpq|password|5 1 1 0 1 0 0 1\r|Pogo4
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\xfc\0\0\0\x33\0\0\x4\b\0\0\x2\xea\0\0\0\xfc\0\0\0\x33\0\0\x4\b\0\0\x2\xea\0\0\0\0\0\0\0\0\x5\0\0\0\0\xfc\0\0\0\x33\0\0\x4\b\0\0\x2\xea)
HostParams0=nottm.g8bpq.net|8011|gm8bpq|password|5 1 1 0 1 0 0 1\r|Pogo4
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\xea\0\0\0\xaf\0\0\x3\xf6\0\0\x3h\0\0\0\xea\0\0\0\xaf\0\0\x3\xf6\0\0\x3h\0\0\0\0\0\0\0\0\a\x80\0\0\0\xea\0\0\0\xaf\0\0\x3\xf6\0\0\x3h)
HostParams1=192.168.1.63|8011|john|password||Pogo2
windowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x3\r\0\0\x2\x8a\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x3\0\0\0\x1\0\0\0\x16\0m\0\x61\0i\0n\0T\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
HostParams2=127.0.0.1|8011|john|password|1 1 1 0 1 0 0 1\r|
HostParams3=|0||||
HostParams4=|0||||
HostParams5=|0||||
windowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\x3\r\0\0\x2\x8c\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x3\0\0\0\x1\0\0\0\x16\0m\0\x61\0i\0n\0T\0o\0o\0l\0\x62\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
HostParams2=127.0.0.1|8011|gm8bpq|password|c000000100000000 1 1 0 1 0 0 1\r|
HostParams3=192.168.1.131|8011|john|password|1 1 1 0 1 0 0 1\r|Slack
HostParams4=127.0.0.1|8021|john|password|c000000100000006 1 1 0 1 0 0 1\r|LinBPQ
HostParams5=192.168.1.18|8011|john|password|c00000010000002e 1 1 0 1 0 0 1\r|
HostParams6=|0||||
HostParams7=|0||||
HostParams8=|0||||
@ -27,8 +27,8 @@ ConnectBeep=1
CurrentHost=0
YAPPPath=
listenPort=8015
listenEnable=0
listenCText=
listenEnable=1
listenCText=[PMS-2.3-C]\rHello>\r
convUTF8=0
PTT=None
PTTBAUD=0
@ -43,16 +43,16 @@ HamLibPort=4532
HamLibHost=127.0.0.1
FLRigPort=12345
FLRigHost=127.0.0.1
AGWEnable=1
AGWEnable=0
AGWMonEnable=1
AGWTermCall=GM8BPQ
AGWTermCall=G8BPQ
AGWBeaconDest=
AGWBeaconPath=
AGWBeaconInterval=0
AGWBeaconPorts=
AGWBeaconText=
AGWHost=127.0.0.1
AGWPort=8888
AGWPort=8001
AGWPaclen=80
AGWToCalls=G8BPQ-2, SWITCH,
KISSEnable=0

View File

@ -1,38 +0,0 @@
QT += core gui
QT += network
QT += widgets
TARGET = QtTermTCP
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += main.cpp\
QtTermTCP.cpp\
TermTCPCommon.cpp\
TabDialog.cpp
HEADERS += QtTermTCP.h\
TabDialog.h
FORMS += QtTermTCP.ui\
ListenPort.ui
RESOURCES += QtTermTCP.qrc
RC_ICONS = QtTermTCP.ico
QMAKE_LFLAGS += -no-pie

View File

@ -1,12 +0,0 @@
#define _MSC_EXTENSIONS
#define _INTEGRAL_MAX_BITS 64
#define _MSC_VER 1916
#define _MSC_FULL_VER 191627043
#define _MSC_BUILD 0
#define _WIN32
#define _M_IX86 600
#define _M_IX86_FP 2
#define _CPPRTTI
#define _DEBUG
#define _MT
#define _DLL

View File

@ -1,11 +0,0 @@
#define _MSC_EXTENSIONS
#define _INTEGRAL_MAX_BITS 64
#define _MSC_VER 1916
#define _MSC_FULL_VER 191627043
#define _MSC_BUILD 0
#define _WIN32
#define _M_IX86 600
#define _M_IX86_FP 2
#define _CPPRTTI
#define _MT
#define _DLL