mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
refs #452 details textbox for logs
* details can be displayed en detail * feature can be switched on/off via context menu * signals in view to select message
This commit is contained in:
committed by
Mathew Sutcliffe
parent
6ca0d480d3
commit
25471730e3
@@ -13,17 +13,20 @@
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackGui;
|
||||
using namespace BlackGui::Views;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
{
|
||||
|
||||
CLogComponent::CLogComponent(QWidget *parent) :
|
||||
QFrame(parent), ui(new Ui::CLogComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->ui->tvp_StatusMessages->setAutoResizeFrequency(3);
|
||||
connect(this->ui->tvp_StatusMessages, &CStatusMessageView::messageSelected,
|
||||
this->ui->form_StatusMessage, &CStatusMessageForm::setValue);
|
||||
this->ui->tvp_StatusMessages->setCustomMenu(new CLogMenu(this));
|
||||
}
|
||||
|
||||
CLogComponent::~CLogComponent()
|
||||
@@ -45,5 +48,17 @@ namespace BlackGui
|
||||
if (statusMessage.isEmpty()) return;
|
||||
this->ui->tvp_StatusMessages->insert(statusMessage);
|
||||
}
|
||||
|
||||
void CLogComponent::CLogMenu::customMenu(QMenu &menu) const
|
||||
{
|
||||
CLogComponent *logComp = qobject_cast<CLogComponent *>(this->parent());
|
||||
Q_ASSERT_X(logComp, Q_FUNC_INFO, "Missing parent");
|
||||
|
||||
bool v = logComp->ui->form_StatusMessage->isVisible();
|
||||
QString formString(v ? "Hide details" : "Show details");
|
||||
QAction *a = menu.addAction(BlackMisc::CIcons::databaseTable16(), formString, logComp->ui->form_StatusMessage, SLOT(toggleVisibility()));
|
||||
a->setCheckable(true);
|
||||
a->setChecked(v);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user