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: ceeefa05afd8
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: f257ffbe6b21
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Jul 29, 2020

  1. Copy the full SHA
    f257ffb View commit details
Showing with 9 additions and 9 deletions.
  1. +1 −1 lib
  2. +5 −6 src/glscopeclient/ProtocolDecoderDialog.cpp
  3. +3 −2 src/glscopeclient/ProtocolDecoderDialog.h
2 changes: 1 addition & 1 deletion lib
Submodule lib updated from 6d7ad4 to e8c8c0
11 changes: 5 additions & 6 deletions src/glscopeclient/ProtocolDecoderDialog.cpp
Original file line number Diff line number Diff line change
@@ -66,8 +66,9 @@ ParameterRowString::~ParameterRowString()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ParameterRowFilename

ParameterRowFilename::ParameterRowFilename(ProtocolDecoderDialog* parent)
ParameterRowFilename::ParameterRowFilename(ProtocolDecoderDialog* parent, ProtocolDecoderParameter& param)
: ParameterRowString(parent)
, m_param(param)
{
m_button.set_label("...");
m_button.signal_clicked().connect(sigc::mem_fun(*this, &ParameterRowFilename::OnBrowser));
@@ -82,11 +83,9 @@ void ParameterRowFilename::OnBrowser()
Gtk::FileChooserDialog dlg(*m_parent, "Open", Gtk::FILE_CHOOSER_ACTION_OPEN);
dlg.set_filename(m_entry.get_text());

//TODO: get filter from parameter somehow

auto filter = Gtk::FileFilter::create();
filter->add_pattern("*.s2p");
filter->set_name("Touchstone S-parameter files (*.s2p)");
filter->add_pattern(m_param.m_fileFilterMask);
filter->set_name(m_param.m_fileFilterName);
dlg.add_filter(filter);
dlg.add_button("Open", Gtk::RESPONSE_OK);
dlg.add_button("Cancel", Gtk::RESPONSE_CANCEL);
@@ -191,7 +190,7 @@ ProtocolDecoderDialog::ProtocolDecoderDialog(
{
case ProtocolDecoderParameter::TYPE_FILENAME:
{
auto row = new ParameterRowFilename(this);
auto row = new ParameterRowFilename(this, it->second);
m_grid.attach_next_to(row->m_label, *last_label, Gtk::POS_BOTTOM, 1, 1);
m_grid.attach_next_to(row->m_entry, row->m_label, Gtk::POS_RIGHT, 1, 1);
m_grid.attach_next_to(row->m_button, row->m_entry, Gtk::POS_RIGHT, 1, 1);
5 changes: 3 additions & 2 deletions src/glscopeclient/ProtocolDecoderDialog.h
Original file line number Diff line number Diff line change
@@ -67,18 +67,19 @@ class ParameterRowString : public ParameterRowBase
ParameterRowString(ProtocolDecoderDialog* parent);
virtual ~ParameterRowString();

Gtk::Entry m_entry;
Gtk::Entry m_entry;
};

class ParameterRowFilename : public ParameterRowString
{
public:
ParameterRowFilename(ProtocolDecoderDialog* parent);
ParameterRowFilename(ProtocolDecoderDialog* parent, ProtocolDecoderParameter& param);
virtual ~ParameterRowFilename();

void OnBrowser();

Gtk::Button m_button;
ProtocolDecoderParameter& m_param;
};

/**