mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 01:35:45 +08:00
[UI] Focus in text message entry field if a text message tab is requested
* requested by AF * added signals/slots * foucs functions
This commit is contained in:
committed by
Mat Sutcliffe
parent
03afc8968a
commit
1deeaf39e8
@@ -16,6 +16,7 @@
|
||||
#include "blackgui/components/logindialog.h"
|
||||
#include "blackgui/components/modelbrowserdialog.h"
|
||||
#include "blackgui/components/settingscomponent.h"
|
||||
#include "blackgui/components/textmessagecomponent.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackgui/overlaymessagesframe.h"
|
||||
@@ -442,6 +443,25 @@ void SwiftGuiStd::onRequestedConsoleMessage(const QString &logMsg, bool clear)
|
||||
log->appendPlainTextToConsole(logMsg);
|
||||
}
|
||||
|
||||
void SwiftGuiStd::focusInMainEntryField()
|
||||
{
|
||||
ui->comp_MainKeypadArea->focusInEntryField();
|
||||
}
|
||||
|
||||
void SwiftGuiStd::focusInTextMessageEntryField()
|
||||
{
|
||||
if (!ui->comp_MainInfoArea->getTextMessageComponent()) { return; }
|
||||
if (ui->comp_MainInfoArea->getTextMessageComponent()->isParentDockWidgetFloating())
|
||||
{
|
||||
ui->comp_MainInfoArea->getTextMessageComponent()->activateWindow();
|
||||
ui->comp_MainInfoArea->getTextMessageComponent()->focusTextEntry();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->focusInMainEntryField();
|
||||
}
|
||||
}
|
||||
|
||||
void SwiftGuiStd::showMinimized()
|
||||
{
|
||||
this->showMinimizedModeChecked();
|
||||
|
||||
@@ -281,6 +281,12 @@ private:
|
||||
//! UI Console message has been recevied
|
||||
void onRequestedConsoleMessage(const QString &logMsg, bool clear);
|
||||
|
||||
//! Focus in main entry window
|
||||
void focusInMainEntryField();
|
||||
|
||||
//! Focus in the text message entry field
|
||||
void focusInTextMessageEntryField();
|
||||
|
||||
//! Show window minimized
|
||||
void showMinimized();
|
||||
|
||||
|
||||
@@ -208,10 +208,13 @@ void SwiftGuiStd::initGuiSignals()
|
||||
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::connectPressed, this, &SwiftGuiStd::loginRequested);
|
||||
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::changedOpacity, this, &SwiftGuiStd::onChangedWindowOpacity);
|
||||
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::identPressed, ui->comp_MainInfoArea->getCockpitComponent(), &CCockpitComponent::setSelectedTransponderModeStateIdent);
|
||||
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::textEntered, ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::handleGlobalCommandLineText);
|
||||
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::textEntered, ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::handleGlobalCommandLineText);
|
||||
connect(ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::audioPressed, ui->comp_MainInfoArea, &CMainInfoAreaComponent::selectAudioTab);
|
||||
connect(ui->comp_MainInfoArea, &CMainInfoAreaComponent::changedInfoAreaStatus, ui->comp_MainKeypadArea, &CMainKeypadAreaComponent::onMainInfoAreaChanged);
|
||||
|
||||
// text component
|
||||
connect(ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::textMessageTabSelected, this, &SwiftGuiStd::focusInTextMessageEntryField, Qt::QueuedConnection);
|
||||
|
||||
// audio
|
||||
connect(ui->comp_MainInfoArea->getAtcStationComponent(), &CAtcStationComponent::requestAudioWidget, ui->comp_MainInfoArea, &CMainInfoAreaComponent::selectAudioTab);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user