mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +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
@@ -107,14 +107,19 @@ namespace BlackGui
|
||||
if (pb) { pb->setChecked(true); }
|
||||
}
|
||||
|
||||
Q_UNUSED(dockedIndexes);
|
||||
Q_UNUSED(dockedIndexes)
|
||||
}
|
||||
|
||||
void CMainKeypadAreaComponent::focusInEntryField()
|
||||
{
|
||||
ui->lep_CommandLineInput->setFocus();
|
||||
}
|
||||
|
||||
void CMainKeypadAreaComponent::buttonSelected()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
QPushButton *senderButton = static_cast<QPushButton *>(QObject::sender());
|
||||
Q_ASSERT_X(senderButton, Q_FUNC_INFO, "No sender button");
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
if (!senderButton) { return; }
|
||||
const CMainInfoAreaComponent::InfoArea infoArea = buttonToMainInfoArea(senderButton);
|
||||
if (infoArea != CMainInfoAreaComponent::InfoAreaNone)
|
||||
@@ -157,7 +162,7 @@ namespace BlackGui
|
||||
|
||||
void CMainKeypadAreaComponent::connectionStatusChanged(const CConnectionStatus &from, const CConnectionStatus &to)
|
||||
{
|
||||
Q_UNUSED(from);
|
||||
Q_UNUSED(from)
|
||||
|
||||
// Connected button
|
||||
if (to.isConnected())
|
||||
|
||||
@@ -46,6 +46,9 @@ namespace BlackGui
|
||||
//! Main info area changed
|
||||
void onMainInfoAreaChanged(int currentTabIndex, QList<int> dockedIndexes, QList<int> floatingIndexes);
|
||||
|
||||
//! Focus in entry fields
|
||||
void focusInEntryField();
|
||||
|
||||
signals:
|
||||
//! Button to select main info area has been pressed
|
||||
//! \sa CMainInfoAreaComponent
|
||||
|
||||
@@ -795,6 +795,8 @@ namespace BlackGui
|
||||
|
||||
// force display
|
||||
if (!m_usedAsOverlayWidget) { this->displayMyself(); }
|
||||
|
||||
emit this->textMessageTabSelected();
|
||||
}
|
||||
|
||||
void CTextMessageComponent::showCorrespondingTabForFrequency(const CFrequency &frequency)
|
||||
@@ -822,12 +824,14 @@ namespace BlackGui
|
||||
// set via widget, as ALL can be removed
|
||||
switch (tab)
|
||||
{
|
||||
case TextMessagesAll : ui->tw_TextMessages->setCurrentWidget(ui->tb_TextMessagesAll); break;
|
||||
case TextMessagesAll : ui->tw_TextMessages->setCurrentWidget(ui->tb_TextMessagesAll); break;
|
||||
case TextMessagesCom1: ui->tw_TextMessages->setCurrentWidget(ui->tb_TextMessagesCOM1); break;
|
||||
case TextMessagesCom2: ui->tw_TextMessages->setCurrentWidget(ui->tb_TextMessagesCOM2); break;
|
||||
case TextMessagesUnicom: ui->tw_TextMessages->setCurrentWidget(ui->tb_TextMessagesUnicom); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
emit this->textMessageTabSelected();
|
||||
}
|
||||
|
||||
void CTextMessageComponent::setAtcButtonsRowsColumns(int rows, int cols, bool setMaxElements)
|
||||
|
||||
@@ -118,6 +118,9 @@ namespace BlackGui
|
||||
//! Command line was entered
|
||||
void commandEntered(const QString &commandLine, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
//! Text message tab selected
|
||||
void textMessageTabSelected();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CTextMessageComponent> ui;
|
||||
BlackMisc::CIdentifier m_identifier { "TextMessageComponent", this };
|
||||
|
||||
Reference in New Issue
Block a user