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: 83a500dae677
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: 877bf7678423
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on Sep 30, 2020

  1. Initial about-box implementation for #175 using Gtk::AboutDialog as a…

    … modal.
    
    Note that the credits box doesn't yet work correctly, perhaps due to theming issues.
    tarunik committed Sep 30, 2020
    Copy the full SHA
    e72839b View commit details

Commits on Oct 1, 2020

  1. Copy the full SHA
    ae0c664 View commit details
  2. Merge pull request #205 from tarunik/about-box

    Implement about box (#175)
    azonenberg authored Oct 1, 2020
    Copy the full SHA
    877bf76 View commit details
Showing with 60 additions and 1 deletion.
  1. +53 −0 src/glscopeclient/OscilloscopeWindow.cpp
  2. +4 −0 src/glscopeclient/OscilloscopeWindow.h
  3. +3 −1 src/glscopeclient/styles/glscopeclient.css
53 changes: 53 additions & 0 deletions src/glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -253,6 +253,13 @@ void OscilloscopeWindow::CreateWidgets(bool nodigital)
m_windowMenu.append(m_windowAnalyzerMenuItem);
m_windowAnalyzerMenuItem.set_label("Analyzer");
m_windowAnalyzerMenuItem.set_submenu(m_windowAnalyzerMenu);
m_menu.append(m_helpMenuItem);
m_helpMenuItem.set_label("Help");
m_helpMenuItem.set_submenu(m_helpMenu);
m_helpMenu.append(m_aboutMenuItem);
m_aboutMenuItem.set_label("About...");
m_aboutMenuItem.signal_activate().connect(
sigc::mem_fun(*this, &OscilloscopeWindow::OnAboutDialog));

m_vbox.pack_start(m_toolbox, Gtk::PACK_SHRINK);
m_vbox.get_style_context()->add_class("toolbar");
@@ -2553,3 +2560,49 @@ void OscilloscopeWindow::OnShowAnalyzer(ProtocolAnalyzerWindow* window)
{
window->show();
}

void OscilloscopeWindow::OnAboutDialog()
{
Gtk::AboutDialog aboutDialog;

aboutDialog.set_logo_default();
aboutDialog.set_version("0.1"); // TODO: CMakeLists trickery for versioning?
aboutDialog.set_copyright("2012-present Andrew Zonenberg");
aboutDialog.set_license(
"Redistribution and use in source and binary forms, with or without modification, "
"are permitted provided that the following conditions are met:\n\n"
"* Redistributions of source code must retain the above copyright notice, this list "
"of conditions, and the following disclaimer.\n\n"
"* Redistributions in binary form must reproduce the above copyright notice, this list "
"of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n"
"* Neither the name of the author nor the names of any contributors may be used to "
"endorse or promote products derived from this software without specific prior written permission.\n\n"
"THIS SOFTWARE IS PROVIDED BY THE AUTHORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED "
"TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL "
"THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES "
"(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR "
"BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT "
"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE "
"POSSIBILITY OF SUCH DAMAGE. "
);
aboutDialog.set_wrap_license(true);

std::vector<Glib::ustring> contributors
{
"azonenberg",
"bvernoux",
"nshcat",
"9names",
"antikerneldev",
"tomverbeure",
"whitequark",
"x44203",
"miek",
"smunaut",
"four0four",
"noopwafel"
};
aboutDialog.add_credit_section("Contributors", contributors);

aboutDialog.run();
}
4 changes: 4 additions & 0 deletions src/glscopeclient/OscilloscopeWindow.h
Original file line number Diff line number Diff line change
@@ -137,6 +137,7 @@ class OscilloscopeWindow : public Gtk::Window
void OnHistory();
void OnAlphaChanged();
void OnRefreshConfig();
void OnAboutDialog();

void UpdateStatusBar();

@@ -171,6 +172,9 @@ class OscilloscopeWindow : public Gtk::Window
Gtk::Menu m_windowMenu;
Gtk::MenuItem m_windowAnalyzerMenuItem;
Gtk::Menu m_windowAnalyzerMenu;
Gtk::MenuItem m_helpMenuItem;
Gtk::Menu m_helpMenu;
Gtk::MenuItem m_aboutMenuItem;
Gtk::HBox m_toolbox;
Gtk::Toolbar m_toolbar;
Gtk::ToolButton m_btnStart;
4 changes: 3 additions & 1 deletion src/glscopeclient/styles/glscopeclient.css
Original file line number Diff line number Diff line change
@@ -24,7 +24,9 @@ toolbar,
notebook *,
dialog,
dialog.*,
actionbar
actionbar,
textview *,
grid
{
color: @glscopeclient_text_color;
background-color: @glscopeclient_bg_color;