Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 323499db307f
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a6866d906196
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jun 18, 2020

  1. Filter names now automatically update when changing arguments if the …

    …default autogenerated name wasn't changed manually
    azonenberg committed Jun 18, 2020
    Copy the full SHA
    a6866d9 View commit details
Showing with 10 additions and 4 deletions.
  1. +10 −4 glscopeclient/ProtocolDecoderDialog.cpp
14 changes: 10 additions & 4 deletions glscopeclient/ProtocolDecoderDialog.cpp
Original file line number Diff line number Diff line change
@@ -36,6 +36,8 @@
#include "OscilloscopeWindow.h"
#include "ProtocolDecoderDialog.h"

using namespace std;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Construction / destruction

@@ -149,6 +151,10 @@ ProtocolDecoderDialog::~ProtocolDecoderDialog()

void ProtocolDecoderDialog::ConfigureDecoder()
{
//See if we're using the default name
string old_name = m_decoder->m_displayname;
bool default_name = (m_decoder->GetHwname() == old_name);

for(size_t i=0; i<m_rows.size(); i++)
{
auto chname = m_rows[i]->m_chans.get_active_text();
@@ -163,12 +169,12 @@ void ProtocolDecoderDialog::ConfigureDecoder()

m_decoder->m_displaycolor = m_channelColorButton.get_color().to_string();

//Set the name of the decoder based on the input channels etc
//TODO: do this any time we change an input or configure stuff
//(we should have a "default name" flag)
//Set the name of the decoder based on the input channels etc.
//If the user specified a new name, use that.
//But if they left the old autogenerated name, update appropriately.
m_decoder->SetDefaultName();
auto dname = m_channelDisplayNameEntry.get_text();
if(dname != "")
if( (dname != "") && (!default_name || (old_name != dname)) )
m_decoder->m_displayname = dname;
}