From 12bc74714db13a28d11dacc955e02631e9eb3d60 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Fri, 31 Oct 2014 12:43:32 +0200 Subject: [PATCH] [Summary] About dialog rework [Reviewed] GZharun --- gtk2_ardour/{about.cc => about_dialog.cc} | 42 +- gtk2_ardour/about_dialog.h | 43 + gtk2_ardour/ardour_ui.cc | 2 +- gtk2_ardour/ardour_ui.h | 2 +- gtk2_ardour/license_dialog.cc | 49 + gtk2_ardour/{about.h => license_dialog.h} | 20 +- .../macosx/tracks.xcodeproj/project.pbxproj | 26 +- gtk2_ardour/ui/about_dialog.xml | 27 + gtk2_ardour/ui/license_dialog.xml | 1585 +++++++++++++++++ gtk2_ardour/wscript | 3 +- 10 files changed, 1758 insertions(+), 41 deletions(-) rename gtk2_ardour/{about.cc => about_dialog.cc} (69%) create mode 100644 gtk2_ardour/about_dialog.h create mode 100644 gtk2_ardour/license_dialog.cc rename gtk2_ardour/{about.h => license_dialog.h} (72%) create mode 100644 gtk2_ardour/ui/about_dialog.xml create mode 100644 gtk2_ardour/ui/license_dialog.xml diff --git a/gtk2_ardour/about.cc b/gtk2_ardour/about_dialog.cc similarity index 69% rename from gtk2_ardour/about.cc rename to gtk2_ardour/about_dialog.cc index 2ae37a7fe9..ba9d621d8c 100644 --- a/gtk2_ardour/about.cc +++ b/gtk2_ardour/about_dialog.cc @@ -21,7 +21,8 @@ #include "ardour/filesystem_paths.h" #include "i18n.h" -#include "about.h" +#include "about_dialog.h" +#include "license_dialog.h" using namespace Gtk; using namespace Gdk; @@ -30,42 +31,41 @@ using namespace ARDOUR; using namespace PBD; About::About () - : ArdourDialog (_("About Tracks")) + : WavesDialog (_("about_dialog.xml"), true, false) + , _image_home ( get_v_box("image_home") ) + , _about_button ( get_waves_button ("about_button") ) { set_modal (true); set_resizable (false); - - get_vbox()->set_spacing (0); - + string image_path; - + if (find_file (ardour_data_search_path(), "splash.png", image_path)) { Gtk::Image* image; if ((image = manage (new Gtk::Image (image_path))) != 0) { - get_vbox()->pack_start (*image, false, false); + _image_home.pack_start (*image, false, false); } - } + } + + _about_button.signal_clicked.connect (sigc::mem_fun (*this, &About::about_button_pressed)); - add_button("CLOSE", RESPONSE_OK); - set_default_response(RESPONSE_OK); show_all (); } -void -About::on_response (int response_id) -{ - ArdourDialog::on_response (response_id); - switch (response_id) { - case RESPONSE_OK: - hide (); - break; - } -} -bool About::close_button_pressed (GdkEventButton*) +void +About::on_esc_pressed () { hide(); } +void +About::about_button_pressed (WavesButton*) +{ + LicenseDialog license_dialog; + license_dialog.set_position (WIN_POS_CENTER); + license_dialog.run (); +} + About::~About () { } diff --git a/gtk2_ardour/about_dialog.h b/gtk2_ardour/about_dialog.h new file mode 100644 index 0000000000..c55b05bf2e --- /dev/null +++ b/gtk2_ardour/about_dialog.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2014 Waves Audio Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __about_dialog_h__ +#define __about_dialog_h__ + +#include "waves_dialog.h" +#include "ardour_button.h" + +class About : public WavesDialog +{ +public: + About(); + ~About(); + +protected: + void on_esc_pressed (); + +private: + void close_button_pressed (WavesButton*); + void about_button_pressed (WavesButton*); + + Gtk::VBox& _image_home; + WavesButton& _about_button; +}; + +#endif /* __about_dialog_h__ */ diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 5af40eff1a..f08aa23d40 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -96,7 +96,7 @@ typedef uint64_t microseconds_t; -#include "about.h" +#include "about_dialog.h" #include "actions.h" #include "add_tracks_dialog.h" #include "ambiguous_file_dialog.h" diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index f4f388e866..d1af28e322 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -67,7 +67,7 @@ #include "video_timeline.h" -#include "about.h" +#include "about_dialog.h" #include "ardour_button.h" #include "ardour_dialog.h" #include "ardour_window.h" diff --git a/gtk2_ardour/license_dialog.cc b/gtk2_ardour/license_dialog.cc new file mode 100644 index 0000000000..cf78d13a08 --- /dev/null +++ b/gtk2_ardour/license_dialog.cc @@ -0,0 +1,49 @@ +/* + Copyright (C) 2014 Waves Audio Ltd. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "pbd/file_utils.h" +#include "ardour/filesystem_paths.h" + +#include "i18n.h" +#include "license_dialog.h" + +using namespace Gtk; +using namespace Gdk; +using namespace std; +using namespace ARDOUR; +using namespace PBD; + +LicenseDialog::LicenseDialog () + : WavesDialog (_("license_dialog.xml"), true, false) +{ + set_modal (true); + set_resizable (false); + + show_all (); +} + +void +LicenseDialog::on_esc_pressed () +{ + hide(); +} + +LicenseDialog::~LicenseDialog () +{ +} diff --git a/gtk2_ardour/about.h b/gtk2_ardour/license_dialog.h similarity index 72% rename from gtk2_ardour/about.h rename to gtk2_ardour/license_dialog.h index a3d91e0d38..b3e107ef02 100644 --- a/gtk2_ardour/about.h +++ b/gtk2_ardour/license_dialog.h @@ -17,21 +17,19 @@ */ -#ifndef __ardour_gtk_about_h__ -#define __ardour_gtk_about_h__ +#ifndef __license_dialog_h__ +#define __license_dialog_h__ -#include "ardour_dialog.h" -#include "ardour_button.h" +#include "waves_dialog.h" -class About : public ArdourDialog +class LicenseDialog : public WavesDialog { public: - About(); - ~About(); + LicenseDialog(); + ~LicenseDialog(); -private: - bool close_button_pressed (GdkEventButton*); - void on_response (int); +protected: + void on_esc_pressed (); }; -#endif /* __ardour_gtk_about_h__ */ +#endif /* __license_dialog_h__ */ diff --git a/gtk2_ardour/macosx/tracks.xcodeproj/project.pbxproj b/gtk2_ardour/macosx/tracks.xcodeproj/project.pbxproj index 4cf5f387e0..a7e6135895 100644 --- a/gtk2_ardour/macosx/tracks.xcodeproj/project.pbxproj +++ b/gtk2_ardour/macosx/tracks.xcodeproj/project.pbxproj @@ -269,6 +269,10 @@ 43279460194F0062003C9FEA /* tracks_preferences.xml in Resources */ = {isa = PBXBuildFile; fileRef = 43279430194F0062003C9FEA /* tracks_preferences.xml */; }; 4327947F194F009E003C9FEA /* tracks.menus.in in Resources */ = {isa = PBXBuildFile; fileRef = 43279475194F009E003C9FEA /* tracks.menus.in */; }; 43B351ED194F04E00038C140 /* step_editing.bindings in Resources */ = {isa = PBXBuildFile; fileRef = 43B351C0194F04E00038C140 /* step_editing.bindings */; }; + 954DCFBD1A0239DA00B7160E /* about_dialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = 954DCFBC1A0239DA00B7160E /* about_dialog.cc */; }; + 954DCFC11A023AAB00B7160E /* about_dialog.xml in Resources */ = {isa = PBXBuildFile; fileRef = 954DCFBF1A023AAB00B7160E /* about_dialog.xml */; }; + 954DCFC21A023AAB00B7160E /* license_dialog.xml in Resources */ = {isa = PBXBuildFile; fileRef = 954DCFC01A023AAB00B7160E /* license_dialog.xml */; }; + 95A134DE1A0239080008E3D6 /* license_dialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = 95A134DD1A0239080008E3D6 /* license_dialog.cc */; }; CE1A907A199A37AE00ECA62B /* add_tracks_dialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE1A9079199A37AE00ECA62B /* add_tracks_dialog.cc */; }; CE1C6DCE19879F04006BDB03 /* compact_meter_bridge.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE1C6DCC19879F04006BDB03 /* compact_meter_bridge.cc */; }; CE1C6DCF19879F04006BDB03 /* compact_meter_strip.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE1C6DCD19879F04006BDB03 /* compact_meter_strip.cc */; }; @@ -281,7 +285,6 @@ CE294C6419CAD4E300D12768 /* meter_strip_gain_meter.xml in Resources */ = {isa = PBXBuildFile; fileRef = CE294C5C19CAD4E300D12768 /* meter_strip_gain_meter.xml */; }; CE294C6519CAD4E300D12768 /* mixer_bridge_view.xml in Resources */ = {isa = PBXBuildFile; fileRef = CE294C5D19CAD4E300D12768 /* mixer_bridge_view.xml */; }; CE294C6619CAD4E300D12768 /* time_info_box.xml in Resources */ = {isa = PBXBuildFile; fileRef = CE294C5E19CAD4E300D12768 /* time_info_box.xml */; }; - CE294C7419CAD54500D12768 /* about.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE294C6A19CAD54500D12768 /* about.cc */; }; CE294C7519CAD54500D12768 /* marker_io_dialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE294C6B19CAD54500D12768 /* marker_io_dialog.cc */; }; CE294C7619CAD54500D12768 /* mixer_bridge_view.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE294C6C19CAD54500D12768 /* mixer_bridge_view.cc */; }; CE294C7719CAD54500D12768 /* open_file_dialog_nix.cc in Sources */ = {isa = PBXBuildFile; fileRef = CE294C6D19CAD54500D12768 /* open_file_dialog_nix.cc */; }; @@ -859,7 +862,6 @@ 43279475194F009E003C9FEA /* tracks.menus.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = tracks.menus.in; path = ../tracks.menus.in; sourceTree = SOURCE_ROOT; }; 4397595019CADAFC00740098 /* canvas.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = canvas.xcodeproj; path = ../../libs/canvas/macosx/canvas/canvas.xcodeproj; sourceTree = ""; }; 4397599619CB06AC00740098 /* gtkmm2ext.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = gtkmm2ext.xcodeproj; path = ../../libs/gtkmm2ext/macosx/gtkmm2ext/gtkmm2ext.xcodeproj; sourceTree = ""; }; - 43B350F0194F04E00038C140 /* about.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = about.h; path = ../about.h; sourceTree = SOURCE_ROOT; }; 43B350F1194F04E00038C140 /* actions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = actions.h; path = ../actions.h; sourceTree = SOURCE_ROOT; }; 43B350F2194F04E00038C140 /* add_route_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = add_route_dialog.h; path = ../add_route_dialog.h; sourceTree = SOURCE_ROOT; }; 43B350F3194F04E00038C140 /* add_video_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = add_video_dialog.h; path = ../add_video_dialog.h; sourceTree = SOURCE_ROOT; }; @@ -1113,6 +1115,12 @@ 43B351EE194F12FB0038C140 /* waves_audiobackend.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = waves_audiobackend.xcodeproj; path = ../../libs/backends/wavesaudio/macosx/waves_audiobackend.xcodeproj; sourceTree = ""; }; 43B351F4194F130C0038C140 /* libardour.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libardour.xcodeproj; path = ../../libs/ardour/macosx/libardour.xcodeproj; sourceTree = ""; }; 43B351FA194F131D0038C140 /* pbd.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = pbd.xcodeproj; path = ../../libs/pbd/macosx/pbd.xcodeproj; sourceTree = ""; }; + 954DCFBC1A0239DA00B7160E /* about_dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = about_dialog.cc; path = ../about_dialog.cc; sourceTree = ""; }; + 954DCFBE1A0239EC00B7160E /* about_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = about_dialog.h; path = ../about_dialog.h; sourceTree = ""; }; + 954DCFBF1A023AAB00B7160E /* about_dialog.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = about_dialog.xml; sourceTree = ""; }; + 954DCFC01A023AAB00B7160E /* license_dialog.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = license_dialog.xml; sourceTree = ""; }; + 95A134DD1A0239080008E3D6 /* license_dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = license_dialog.cc; path = ../license_dialog.cc; sourceTree = ""; }; + 95A134DF1A02391F0008E3D6 /* license_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = license_dialog.h; path = ../license_dialog.h; sourceTree = ""; }; CE1A9079199A37AE00ECA62B /* add_tracks_dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = add_tracks_dialog.cc; path = ../add_tracks_dialog.cc; sourceTree = ""; }; CE1A907E199A37BF00ECA62B /* add_tracks_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = add_tracks_dialog.h; path = ../add_tracks_dialog.h; sourceTree = ""; }; CE1C6DCC19879F04006BDB03 /* compact_meter_bridge.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = compact_meter_bridge.cc; path = ../compact_meter_bridge.cc; sourceTree = ""; }; @@ -1129,7 +1137,6 @@ CE294C5C19CAD4E300D12768 /* meter_strip_gain_meter.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = meter_strip_gain_meter.xml; sourceTree = ""; }; CE294C5D19CAD4E300D12768 /* mixer_bridge_view.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = mixer_bridge_view.xml; sourceTree = ""; }; CE294C5E19CAD4E300D12768 /* time_info_box.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = time_info_box.xml; sourceTree = ""; }; - CE294C6A19CAD54500D12768 /* about.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = about.cc; path = ../about.cc; sourceTree = ""; }; CE294C6B19CAD54500D12768 /* marker_io_dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = marker_io_dialog.cc; path = ../marker_io_dialog.cc; sourceTree = ""; }; CE294C6C19CAD54500D12768 /* mixer_bridge_view.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = mixer_bridge_view.cc; path = ../mixer_bridge_view.cc; sourceTree = ""; }; CE294C6D19CAD54500D12768 /* open_file_dialog_nix.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = open_file_dialog_nix.cc; path = ../open_file_dialog_nix.cc; sourceTree = ""; }; @@ -1200,7 +1207,8 @@ 43279040194EFF38003C9FEA /* source */ = { isa = PBXGroup; children = ( - CE294C6A19CAD54500D12768 /* about.cc */, + 954DCFBC1A0239DA00B7160E /* about_dialog.cc */, + 95A134DD1A0239080008E3D6 /* license_dialog.cc */, CE294C6B19CAD54500D12768 /* marker_io_dialog.cc */, CE294C6C19CAD54500D12768 /* mixer_bridge_view.cc */, CE294C6D19CAD54500D12768 /* open_file_dialog_nix.cc */, @@ -1802,6 +1810,8 @@ 43279429194F0062003C9FEA /* ui */ = { isa = PBXGroup; children = ( + 954DCFBF1A023AAB00B7160E /* about_dialog.xml */, + 954DCFC01A023AAB00B7160E /* license_dialog.xml */, CE294C5719CAD4E300D12768 /* add_tracks_dialog.xml */, CE294C5819CAD4E300D12768 /* compact_meter_bridge.xml */, CE294C5919CAD4E300D12768 /* compact_meter_strip.xml */, @@ -1844,6 +1854,8 @@ 43279480194F00CB003C9FEA /* headers */ = { isa = PBXGroup; children = ( + 954DCFBE1A0239EC00B7160E /* about_dialog.h */, + 95A134DF1A02391F0008E3D6 /* license_dialog.h */, CE294C7E19CAD58500D12768 /* ardour_dropdown.h */, CE294C7F19CAD58500D12768 /* marker_io_dialog.h */, CE294C8019CAD58500D12768 /* mixer_bridge_view.h */, @@ -1860,7 +1872,6 @@ CEAFC777195445D90016ACF0 /* visibility.h */, 43B351D4194F04E00038C140 /* tracks_control_panel.h */, 43B351D5194F04E00038C140 /* tracks_control_panel.logic.h */, - 43B350F0194F04E00038C140 /* about.h */, 43B350F1194F04E00038C140 /* actions.h */, 43B350F2194F04E00038C140 /* add_route_dialog.h */, 43B350F3194F04E00038C140 /* add_video_dialog.h */, @@ -2322,6 +2333,7 @@ 43279376194F003A003C9FEA /* media_button.png in Resources */, 43279377194F003A003C9FEA /* media_button_active.png in Resources */, 43279378194F003A003C9FEA /* media_button_prelight.png in Resources */, + 954DCFC21A023AAB00B7160E /* license_dialog.xml in Resources */, 43279379194F003A003C9FEA /* meter_bridge_on.png in Resources */, 4327937A194F003A003C9FEA /* meter_bridge_on_active.png in Resources */, 4327937B194F003A003C9FEA /* meter_bridge_on_prelight.png in Resources */, @@ -2390,6 +2402,7 @@ 432793BA194F003A003C9FEA /* soloed-by-others.png in Resources */, 432793BB194F003A003C9FEA /* step-editing.png in Resources */, 432793BC194F003A003C9FEA /* strip_width.png in Resources */, + 954DCFC11A023AAB00B7160E /* about_dialog.xml in Resources */, 432793BD194F003A003C9FEA /* systemlock.png in Resources */, 432793BE194F003A003C9FEA /* tav_exp.png in Resources */, 432793BF194F003A003C9FEA /* tav_shrink.png in Resources */, @@ -2542,9 +2555,10 @@ CEB0A9F219583F96006D269A /* session_close_dialog.cc in Sources */, CE1C6DCE19879F04006BDB03 /* compact_meter_bridge.cc in Sources */, CE1C6DCF19879F04006BDB03 /* compact_meter_strip.cc in Sources */, + 95A134DE1A0239080008E3D6 /* license_dialog.cc in Sources */, CE1C6DE01987A924006BDB03 /* master_bus_ui.cc in Sources */, + 954DCFBD1A0239DA00B7160E /* about_dialog.cc in Sources */, CE1A907A199A37AE00ECA62B /* add_tracks_dialog.cc in Sources */, - CE294C7419CAD54500D12768 /* about.cc in Sources */, CE294C7519CAD54500D12768 /* marker_io_dialog.cc in Sources */, CE294C7619CAD54500D12768 /* mixer_bridge_view.cc in Sources */, CE294C7719CAD54500D12768 /* open_file_dialog_nix.cc in Sources */, diff --git a/gtk2_ardour/ui/about_dialog.xml b/gtk2_ardour/ui/about_dialog.xml new file mode 100644 index 0000000000..2dd65ef66c --- /dev/null +++ b/gtk2_ardour/ui/about_dialog.xml @@ -0,0 +1,27 @@ + + + + + + + + \ No newline at end of file diff --git a/gtk2_ardour/ui/license_dialog.xml b/gtk2_ardour/ui/license_dialog.xml new file mode 100644 index 0000000000..646f14a513 --- /dev/null +++ b/gtk2_ardour/ui/license_dialog.xml @@ -0,0 +1,1585 @@ + + +