|
|
|
@ -138,9 +138,12 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent)
@@ -138,9 +138,12 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent)
|
|
|
|
|
curRow = 0; |
|
|
|
|
headWidget = new ChatFormHeader(); |
|
|
|
|
searchForm = new SearchForm(); |
|
|
|
|
dateInfo = new QLabel(this); |
|
|
|
|
chatWidget = new ChatLog(this); |
|
|
|
|
chatWidget->setBusyNotification(ChatMessage::createBusyNotification()); |
|
|
|
|
searchForm->hide(); |
|
|
|
|
dateInfo->setAlignment(Qt::AlignHCenter); |
|
|
|
|
dateInfo->setVisible(false); |
|
|
|
|
|
|
|
|
|
// settings
|
|
|
|
|
const Settings& s = Settings::getInstance(); |
|
|
|
@ -200,6 +203,7 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent)
@@ -200,6 +203,7 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent)
|
|
|
|
|
|
|
|
|
|
QVBoxLayout* contentLayout = new QVBoxLayout(contentWidget); |
|
|
|
|
contentLayout->addWidget(searchForm); |
|
|
|
|
contentLayout->addWidget(dateInfo); |
|
|
|
|
contentLayout->addWidget(chatWidget); |
|
|
|
|
contentLayout->addLayout(mainFootLayout); |
|
|
|
|
|
|
|
|
@ -229,6 +233,7 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent)
@@ -229,6 +233,7 @@ GenericChatForm::GenericChatForm(const Contact* contact, QWidget* parent)
|
|
|
|
|
|
|
|
|
|
connect(chatWidget, &ChatLog::customContextMenuRequested, this, |
|
|
|
|
&GenericChatForm::onChatContextMenuRequested); |
|
|
|
|
connect(chatWidget, &ChatLog::firstVisibleLineChanged, this, &GenericChatForm::updateShowDateInfo); |
|
|
|
|
|
|
|
|
|
connect(searchForm, &SearchForm::searchInBegin, this, &GenericChatForm::searchInBegin); |
|
|
|
|
connect(searchForm, &SearchForm::searchUp, this, &GenericChatForm::onSearchUp); |
|
|
|
@ -978,6 +983,19 @@ void GenericChatForm::onSearchTriggered()
@@ -978,6 +983,19 @@ void GenericChatForm::onSearchTriggered()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void GenericChatForm::updateShowDateInfo(const ChatLine::Ptr& line) |
|
|
|
|
{ |
|
|
|
|
const auto date = getDate(line); |
|
|
|
|
|
|
|
|
|
if (date.isValid() && date != QDate::currentDate()) { |
|
|
|
|
const auto dateText = QStringLiteral("<b>%1<\b>").arg(date.toString(Settings::getInstance().getDateFormat())); |
|
|
|
|
dateInfo->setText(dateText); |
|
|
|
|
dateInfo->setVisible(true); |
|
|
|
|
} else { |
|
|
|
|
dateInfo->setVisible(false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void GenericChatForm::onContinueSearch() |
|
|
|
|
{ |
|
|
|
|
const QString phrase = searchForm->getSearchPhrase(); |
|
|
|
|