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: 5821ff076d70
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: 974a9c6df460
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on May 18, 2020

  1. Protocol analyzer and history window are now derived from Gtk::Dialog…

    … instead of Gtk::Window
    azonenberg committed May 18, 2020
    Copy the full SHA
    974a9c6 View commit details
Showing with 30 additions and 32 deletions.
  1. +16 −17 glscopeclient/HistoryWindow.cpp
  2. +9 −10 glscopeclient/HistoryWindow.h
  3. +4 −4 glscopeclient/ProtocolAnalyzerWindow.cpp
  4. +1 −1 glscopeclient/ProtocolAnalyzerWindow.h
33 changes: 16 additions & 17 deletions glscopeclient/HistoryWindow.cpp
Original file line number Diff line number Diff line change
@@ -52,13 +52,13 @@ HistoryColumns::HistoryColumns()
// Construction / destruction

HistoryWindow::HistoryWindow(OscilloscopeWindow* parent, Oscilloscope* scope)
: m_parent(parent)
: Gtk::Dialog(string("History: ") + scope->m_nickname, *parent)
, m_parent(parent)
, m_scope(scope)
, m_updating(false)
{
set_title(string("History: ") + m_scope->m_nickname);
set_transient_for(*parent);
set_skip_taskbar_hint();
set_type_hint(Gdk::WINDOW_TYPE_HINT_TOOLBAR);

set_default_size(320, 800);

@@ -72,20 +72,19 @@ HistoryWindow::HistoryWindow(OscilloscopeWindow* parent, Oscilloscope* scope)
m_tree.append_column("Time", m_columns.m_timestamp);

//Set up the widgets
add(m_vbox);
m_vbox.pack_start(m_hbox, Gtk::PACK_SHRINK);
m_hbox.pack_start(m_maxLabel, Gtk::PACK_SHRINK);
m_maxLabel.set_label("Max waveforms");
m_hbox.pack_start(m_maxBox, Gtk::PACK_EXPAND_WIDGET);
SetMaxWaveforms(10);
m_vbox.pack_start(m_scroller, Gtk::PACK_EXPAND_WIDGET);
m_scroller.add(m_tree);
m_scroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
m_tree.get_selection()->set_mode(Gtk::SELECTION_BROWSE);
m_vbox.pack_start(m_status, Gtk::PACK_SHRINK);
m_status.pack_end(m_memoryLabel, Gtk::PACK_SHRINK);
m_memoryLabel.set_text("");
m_vbox.show_all();
get_vbox()->pack_start(m_hbox, Gtk::PACK_SHRINK);
m_hbox.pack_start(m_maxLabel, Gtk::PACK_SHRINK);
m_maxLabel.set_label("Max waveforms");
m_hbox.pack_start(m_maxBox, Gtk::PACK_EXPAND_WIDGET);
SetMaxWaveforms(10);
get_vbox()->pack_start(m_scroller, Gtk::PACK_EXPAND_WIDGET);
m_scroller.add(m_tree);
m_scroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
m_tree.get_selection()->set_mode(Gtk::SELECTION_BROWSE);
get_vbox()->pack_start(m_status, Gtk::PACK_SHRINK);
m_status.pack_end(m_memoryLabel, Gtk::PACK_SHRINK);
m_memoryLabel.set_text("");
show_all();

//not shown by default
hide();
19 changes: 9 additions & 10 deletions glscopeclient/HistoryWindow.h
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ class HistoryColumns : public Gtk::TreeModel::ColumnRecord
/**
@brief Window containing a protocol analyzer
*/
class HistoryWindow : public Gtk::Window
class HistoryWindow : public Gtk::Dialog
{
public:
HistoryWindow(OscilloscopeWindow* parent, Oscilloscope* scope);
@@ -72,15 +72,14 @@ class HistoryWindow : public Gtk::Window
virtual bool on_delete_event(GdkEventAny* ignored);
virtual void OnSelectionChanged();

Gtk::VBox m_vbox;
Gtk::HBox m_hbox;
Gtk::Label m_maxLabel;
Gtk::Entry m_maxBox;
Gtk::ScrolledWindow m_scroller;
Gtk::TreeView m_tree;
Glib::RefPtr<Gtk::TreeStore> m_model;
Gtk::HBox m_status;
Gtk::Label m_memoryLabel;
Gtk::HBox m_hbox;
Gtk::Label m_maxLabel;
Gtk::Entry m_maxBox;
Gtk::ScrolledWindow m_scroller;
Gtk::TreeView m_tree;
Glib::RefPtr<Gtk::TreeStore> m_model;
Gtk::HBox m_status;
Gtk::Label m_memoryLabel;
HistoryColumns m_columns;

OscilloscopeWindow* m_parent;
8 changes: 4 additions & 4 deletions glscopeclient/ProtocolAnalyzerWindow.cpp
Original file line number Diff line number Diff line change
@@ -67,15 +67,15 @@ ProtocolAnalyzerWindow::ProtocolAnalyzerWindow(
OscilloscopeWindow* parent,
PacketDecoder* decoder,
WaveformArea* area)
: m_parent(parent)
: Gtk::Dialog(title, *parent)
, m_parent(parent)
, m_decoder(decoder)
, m_area(area)
, m_columns(decoder)
, m_updating(false)
{
set_title(title);
set_transient_for(*parent);
set_skip_taskbar_hint();
set_type_hint(Gdk::WINDOW_TYPE_HINT_TOOLBAR);

m_decoder->AddRef();

@@ -101,7 +101,7 @@ ProtocolAnalyzerWindow::ProtocolAnalyzerWindow(
sigc::mem_fun(*this, &ProtocolAnalyzerWindow::OnSelectionChanged));

//Set up the widgets
add(m_scroller);
get_vbox()->pack_start(m_scroller, Gtk::PACK_EXPAND_WIDGET);
m_scroller.add(m_tree);
m_tree.get_selection()->set_mode(Gtk::SELECTION_BROWSE);
m_scroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
2 changes: 1 addition & 1 deletion glscopeclient/ProtocolAnalyzerWindow.h
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ class ProtocolAnalyzerColumns : public Gtk::TreeModel::ColumnRecord
/**
@brief Window containing a protocol analyzer
*/
class ProtocolAnalyzerWindow : public Gtk::Window
class ProtocolAnalyzerWindow : public Gtk::Dialog
{
public:
ProtocolAnalyzerWindow(std::string title, OscilloscopeWindow* parent, PacketDecoder* decoder, WaveformArea* area);