From fbaeaa72f63f22bf0b53d634f6809cbdfbb46c9f Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sat, 20 Jul 2024 08:39:32 +0000 Subject: New upstream version 2.7.0~rc6+dfsg --- widgets/displaytext.cpp | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'widgets/displaytext.cpp') diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index b952d934..b3575102 100755 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -213,27 +213,11 @@ void DisplayText::insertText(QString const& text, QColor bg, QColor fg void DisplayText::extend_vertical_scrollbar (int min, int max) { - static int mod_last; - static int height; if (high_volume_ && m_config && m_config->decodes_from_top ()) { - auto m = modified_vertical_scrollbar_max_; - if (m != mod_last) { height = m - mod_last;mod_last = m; } - //auto vp_margins2 = viewportMargins (); - if (height == 0 && m > viewport()->height()) height = abs( - viewport()->height()); - //LOG_INFO ("scrollbar min=" << min << " max=" << max << " mod=" << modified_vertical_scrollbar_max_ << " height=" << viewport()->height() << " top=" << vp_margins2.top() << " bottom=" << vp_margins2.bottom()) << " height=" << height << " mod_last=" << mod_last; - if (max > 60000) - { - QString tmp = toPlainText(); - while (tmp != NULL && tmp.length() > 100 && max > 50000) - { - tmp.remove(0, tmp.indexOf("\n")+1); - max -= height; - } - setPlainText(tmp); - } if (max && max != modified_vertical_scrollbar_max_) { + setViewportMargins (0,4,0,0); // ensure first line is readable auto vp_margins = viewportMargins (); // add enough to vertical scroll bar range to allow last // decode to just scroll of the top of the view port @@ -246,6 +230,10 @@ void DisplayText::extend_vertical_scrollbar (int min, int max) void DisplayText::new_period () { + if (m_config->decodes_from_top ()) { + document ()->setMaximumBlockCount (4800); + document ()->setMaximumBlockCount (5000); + } extend_vertical_scrollbar (verticalScrollBar ()->minimum (), verticalScrollBar ()->maximum ()); if (high_volume_ && m_config && m_config->decodes_from_top () && !vertical_scroll_connection_) { @@ -518,11 +506,11 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 txFreq, - bool bFastMode, double TRperiod) + bool bFastMode, double TRperiod,bool bSuperfox) { QString t1=" @ "; if(modeTx=="FT4") t1=" + "; - if(modeTx=="FT8") t1=" ~ "; + if(modeTx.contains("FT8")) t1=" ~ "; if(modeTx=="JT4") t1=" $ "; if(modeTx=="Q65") t1=" : "; if(modeTx=="JT65") t1=" # "; @@ -546,7 +534,18 @@ void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 tx QColor fg; highlight_types types {Highlight::Tx}; set_colours (m_config, &bg, &fg, types); - insertText (t, bg, fg); + if(bSuperfox and t.contains(";")) { + int i0=t.indexOf(";"); + int i1=t.indexOf("<"); + int i2=t.indexOf(">"); + QString foxcall=t.mid(i1+1,i2-i1-1); + t2=t.left(i0) + " " + foxcall; + QString t3=t.left(24) + t.mid(i0+2,-1).remove("<").remove(">"); + insertText (t2, bg, fg); + insertText (t3, bg, fg); + } else { + insertText (t, bg, fg); + } } void DisplayText::displayQSY(QString text) -- cgit v1.2.3