mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 13:45:43 +01:00
[Summary]: Dialog logic restriction. Provided correct behaviour when user opens some dialogs and then calls File->Close (on mac). All earlier opened dialogs will be closed and just SessionDialog will be shown.
This commit is contained in:
parent
7105edf356
commit
77ebb8371d
7 changed files with 74 additions and 1 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "i18n.h"
|
||||
#include "about_dialog.h"
|
||||
#include "license_dialog.h"
|
||||
#include "public_editor.h"
|
||||
|
||||
using namespace Gtk;
|
||||
using namespace Gdk;
|
||||
|
|
@ -88,6 +89,7 @@ About::on_esc_pressed ()
|
|||
void
|
||||
About::about_button_pressed (WavesButton*)
|
||||
{
|
||||
MainMenuDisabled m;
|
||||
LicenseDialog license_dialog;
|
||||
license_dialog.set_position (WIN_POS_CENTER);
|
||||
license_dialog.run ();
|
||||
|
|
|
|||
|
|
@ -3713,8 +3713,13 @@ ARDOUR_UI::add_route (Gtk::Window* float_window)
|
|||
|
||||
_add_tracks_dialog->setup(_add_tracks_dialog->max_tracks_count () - existing_tracks_count);
|
||||
_add_tracks_dialog->set_position (WIN_POS_CENTER);
|
||||
int r = _add_tracks_dialog->run();
|
||||
|
||||
|
||||
// disable Main menu
|
||||
MainMenuDisabled m; // HOT FIX. (REWORK IT)
|
||||
|
||||
int r = _add_tracks_dialog->run();
|
||||
|
||||
switch (r) {
|
||||
case WavesDialog::RESPONSE_DEFAULT:
|
||||
break;
|
||||
|
|
@ -4915,4 +4920,32 @@ void
|
|||
ARDOUR_UI::hide_application ()
|
||||
{
|
||||
Application::instance ()-> hide ();
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::on_editor_hiding ()
|
||||
{
|
||||
// here we should close
|
||||
// all opening graphical elements
|
||||
|
||||
tracks_control_panel->deiconify ();
|
||||
tracks_control_panel->hide ();
|
||||
|
||||
key_editor->deiconify ();
|
||||
key_editor->hide ();
|
||||
|
||||
big_clock_window->deiconify ();
|
||||
big_clock_window->hide ();
|
||||
|
||||
session_lock_dialog->deiconify ();// HOT FIX. (REWORK IT)
|
||||
session_lock_dialog->hide ();// HOT FIX. (REWORK IT)
|
||||
|
||||
about->deiconify ();
|
||||
about->hide ();
|
||||
|
||||
track_color_dialog->deiconify ();
|
||||
track_color_dialog->hide ();
|
||||
|
||||
marker_inspector_dialog->deiconify ();
|
||||
marker_inspector_dialog->hide ();
|
||||
}
|
||||
|
|
@ -163,6 +163,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
void show_about ();
|
||||
void hide_about ();
|
||||
void open_media_folder ();
|
||||
|
||||
void on_editor_hiding ();
|
||||
|
||||
void load_from_application_api (const std::string& path);
|
||||
void finish();
|
||||
|
|
|
|||
|
|
@ -521,6 +521,7 @@ Editor::Editor ()
|
|||
|
||||
_summary = new EditorSummary (this);
|
||||
|
||||
this->signal_hide().connect ( sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::on_editor_hiding));
|
||||
selection->TimeChanged.connect (sigc::mem_fun(*this, &Editor::time_selection_changed));
|
||||
selection->TracksChanged.connect (sigc::mem_fun(*this, &Editor::track_selection_changed));
|
||||
|
||||
|
|
@ -3336,6 +3337,9 @@ Editor::duplicate_range (bool with_dialog)
|
|||
return;
|
||||
}
|
||||
|
||||
// disable Main menu
|
||||
MainMenuDisabled m; // HOT FIX. (REWORK IT)
|
||||
|
||||
if (with_dialog) {
|
||||
|
||||
WavesNumericEditDialog dialog("");
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "ardour/source_factory.h"
|
||||
#include "ardour/types.h"
|
||||
|
||||
#include "actions.h"
|
||||
#include "audio_region_view.h"
|
||||
#include "audio_time_axis.h"
|
||||
#include "editor.h"
|
||||
|
|
@ -63,6 +64,9 @@ using namespace Gtk;
|
|||
void
|
||||
Editor::export_audio ()
|
||||
{
|
||||
// disable Main menu
|
||||
MainMenuDisabled m; // HOT FIX. (REWORK IT)
|
||||
|
||||
if (Config->get_output_auto_connect() & AutoConnectPhysical) {
|
||||
WavesMessageDialog read_only_session_dialog ("",
|
||||
"Not available in Multi Out mode.\nPlease switch to Stereo Out mode.",
|
||||
|
|
@ -79,6 +83,9 @@ Editor::export_audio ()
|
|||
void
|
||||
Editor::stem_export ()
|
||||
{
|
||||
// disable Main menu
|
||||
MainMenuDisabled m; // HOT FIX. (REWORK IT)
|
||||
|
||||
WavesStemExportDialog dialog (*this);
|
||||
dialog.set_session (_session);
|
||||
dialog.run();
|
||||
|
|
@ -124,6 +131,9 @@ Editor::export_region ()
|
|||
boost::shared_ptr<AudioRegion> audio_region = boost::dynamic_pointer_cast<AudioRegion>(r);
|
||||
boost::shared_ptr<MidiRegion> midi_region = boost::dynamic_pointer_cast<MidiRegion>(r);
|
||||
|
||||
// disable Main menu
|
||||
MainMenuDisabled m; // HOT FIX. (REWORK IT)
|
||||
|
||||
if (audio_region) {
|
||||
|
||||
RouteTimeAxisView & rtv (dynamic_cast<RouteTimeAxisView &> (selection->regions.front()->get_time_axis_view()));
|
||||
|
|
|
|||
|
|
@ -2568,6 +2568,9 @@ Editor::rename_region ()
|
|||
WavesEditDialog waves_edit_dialog ("", "Rename region");
|
||||
waves_edit_dialog.set_entry_text (rs.front()->region()->name());
|
||||
|
||||
// disable Main menu
|
||||
MainMenuDisabled m; // HOT FIX. (REWORK IT)
|
||||
|
||||
int const ret = waves_edit_dialog.run ();
|
||||
|
||||
if (ret != WavesDialog::RESPONSE_DEFAULT) {
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
#include "canvas/fwd.h"
|
||||
#include "gtkmm2ext/visibility_tracker.h"
|
||||
|
||||
#include "actions.h"
|
||||
#include "editing.h"
|
||||
#include "selection.h"
|
||||
|
||||
|
|
@ -440,4 +441,22 @@ class DisplaySuspender {
|
|||
}
|
||||
};
|
||||
|
||||
class MainMenuDisabled {
|
||||
public:
|
||||
MainMenuDisabled() {
|
||||
#ifdef __APPLE__
|
||||
/* The global menu bar continues to be accessible to applications
|
||||
with modal dialogs on mac, which means that we need to desensitize
|
||||
all items in the menu bar.
|
||||
*/
|
||||
ActionManager::disable_all_actions (); // HOT FIX. (REWORK IT)
|
||||
#endif
|
||||
}
|
||||
~MainMenuDisabled () {
|
||||
#ifdef __APPLE__
|
||||
ActionManager::pop_action_state (); // HOT FIX. (REWORK IT)
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
#endif // __gtk_ardour_public_editor_h__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue