mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-23 07:06:23 +01:00
[Summary] Reworking general message dialogs
This commit is contained in:
parent
53391399c4
commit
11167a6ae9
12 changed files with 131 additions and 553 deletions
|
|
@ -98,7 +98,6 @@ typedef uint64_t microseconds_t;
|
|||
|
||||
#include "about_dialog.h"
|
||||
#include "read_only_session_dialog.h"
|
||||
#include "sample_rate_mismatch_dialog.h"
|
||||
#include "actions.h"
|
||||
#include "add_tracks_dialog.h"
|
||||
#include "ambiguous_file_dialog.h"
|
||||
|
|
@ -144,7 +143,7 @@ typedef uint64_t microseconds_t;
|
|||
#include "i18n.h"
|
||||
|
||||
#include "open_file_dialog_proxy.h"
|
||||
#include "ok_dialog.h"
|
||||
#include "waves_message_dialog.h"
|
||||
#include "crash_recovery_dialog.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
|
|
@ -2946,10 +2945,10 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
|
|||
|
||||
catch (...) {
|
||||
|
||||
OkDialog ok_dialog ("Loading Error", string_compose(_("Session \"%1 (snapshot %2)\"\ndid not load successfully"), path, snap_name));
|
||||
ok_dialog.set_position (Gtk::WIN_POS_CENTER);
|
||||
pop_back_splash (ok_dialog);
|
||||
ok_dialog.run ();
|
||||
WavesMessageDialog message_dialog ("Loading Error", string_compose(_("Session \"%1 (snapshot %2)\"\ndid not load successfully"), path, snap_name));
|
||||
message_dialog.set_position (Gtk::WIN_POS_CENTER);
|
||||
pop_back_splash (message_dialog);
|
||||
message_dialog.run ();
|
||||
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -3991,9 +3990,21 @@ ARDOUR_UI::session_dialog (std::string msg)
|
|||
int
|
||||
ARDOUR_UI::pending_state_dialog ()
|
||||
{
|
||||
CrashRecoveryDialog crash_recovery_dialog;
|
||||
WavesMessageDialog message_dialog ("crash_recovery_dialog.xml",
|
||||
_("Crash Recovery"),
|
||||
string_compose (_(
|
||||
"This session appears to have been in the\n\
|
||||
middle of recording when %1 or\n\
|
||||
the computer was shutdown.\n\
|
||||
\n\
|
||||
%1 can recover any captured audio for\n\
|
||||
you, or it can ignore it. Please decide\n\
|
||||
what you would like to do.\n"), PROGRAM_NAME),
|
||||
WavesMessageDialog::BUTTON_ACCEPT |
|
||||
WavesMessageDialog::BUTTON_NO);
|
||||
|
||||
switch (crash_recovery_dialog.run ()) {
|
||||
switch (message_dialog.run ()) {
|
||||
case WavesDialog::RESPONSE_DEFAULT:
|
||||
case RESPONSE_ACCEPT:
|
||||
return 1;
|
||||
default:
|
||||
|
|
@ -4005,16 +4016,22 @@ int
|
|||
ARDOUR_UI::sr_mismatch_dialog (framecnt_t desired, framecnt_t actual)
|
||||
{
|
||||
|
||||
SampleRateMismatchDialog srm_dialog(desired, PROGRAM_NAME, actual);
|
||||
WavesMessageDialog message_dialog (_("Sample Rate Mismatch"),
|
||||
string_compose (_("\
|
||||
This session was created with a sample rate of %1 Hz, but\n\
|
||||
%2 is currently running at %3 Hz. If you load this session,\n\
|
||||
device will be switched to the session sample rate value. \n\
|
||||
If an attemp to switch the device is unsuccessful\n\
|
||||
audio may be played at the wrong sample rate.\n"),
|
||||
desired,
|
||||
PROGRAM_NAME,
|
||||
actual),
|
||||
WavesMessageDialog::BUTTON_ACCEPT|WavesMessageDialog::BUTTON_CANCEL);
|
||||
message_dialog.set_position (WIN_POS_CENTER);
|
||||
|
||||
switch ( srm_dialog.run () ) {
|
||||
case RESPONSE_ACCEPT:
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
int result = message_dialog.run ();
|
||||
|
||||
return (result == Gtk::RESPONSE_ACCEPT || result == WavesDialog::RESPONSE_DEFAULT) ? 0 : 1;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
|||
|
|
@ -1,142 +0,0 @@
|
|||
/*
|
||||
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 "i18n.h"
|
||||
#include "ok_dialog.h"
|
||||
#include <vector>
|
||||
|
||||
using namespace Gtk;
|
||||
using namespace Gdk;
|
||||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
using namespace Pango;
|
||||
|
||||
namespace {
|
||||
const size_t button_left_padding = 10;
|
||||
const size_t button_bottom_padding = 15;
|
||||
const size_t font_size = 12;
|
||||
const size_t label_top_padding = 10;
|
||||
|
||||
size_t count_lines(const std::string& str)
|
||||
{
|
||||
std::string::const_iterator beg = str.begin();
|
||||
std::string::const_iterator end = str.end();
|
||||
std::string::size_type count = 0;
|
||||
std::string delimeter = "\n";
|
||||
|
||||
while ((beg + (delimeter.size() - 1)) != end)
|
||||
{
|
||||
std::string tmp(beg, beg + delimeter.size());
|
||||
if (tmp == delimeter)
|
||||
{
|
||||
++count;
|
||||
}
|
||||
++beg;
|
||||
}
|
||||
return count+1;
|
||||
}
|
||||
|
||||
int calculate_window_height (size_t current_window_height, size_t button_height, size_t font_size, size_t current_lines_number)
|
||||
{
|
||||
int label_max_height = (current_window_height - label_top_padding - button_height - button_bottom_padding);
|
||||
int max_lines_number = label_max_height / font_size;
|
||||
|
||||
if ( current_lines_number > max_lines_number )
|
||||
{
|
||||
return current_window_height + (current_lines_number - max_lines_number + 1) * font_size;
|
||||
} else
|
||||
return current_window_height;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
OkDialog::OkDialog (std::string window_title, std::string info_lines)
|
||||
: WavesDialog ( _("ok_dialog.xml"), true, false )
|
||||
, _ok_button ( get_waves_button ("ok_button") )
|
||||
, _info_label ( get_label("info_label") )
|
||||
, _layout ( get_layout("layout") )
|
||||
{
|
||||
set_modal (true);
|
||||
set_resizable (false);
|
||||
this->set_keep_above (true);
|
||||
|
||||
_info_label.set_text( info_lines );
|
||||
this->set_title(window_title);
|
||||
|
||||
// Recalculate window height if needed
|
||||
std::size_t new_window_height = 0;
|
||||
|
||||
size_t current_window_height;
|
||||
this->realize();
|
||||
current_window_height = this->get_allocation().get_height();
|
||||
size_t button_height = _ok_button.get_allocation().get_height();
|
||||
|
||||
new_window_height = calculate_window_height( current_window_height, button_height, font_size, count_lines(info_lines) );
|
||||
// end recalculating
|
||||
|
||||
// Resize window height
|
||||
if ( new_window_height > current_window_height ) {
|
||||
|
||||
this->realize(); // must be for correct work of get_width,height functions
|
||||
|
||||
guint layout_width, layout_height;
|
||||
layout_width = _layout.get_allocation().get_width();
|
||||
_layout.set_size_request (layout_width, new_window_height);
|
||||
|
||||
guint button_width, button_height;
|
||||
button_width = _ok_button.get_allocation().get_width();
|
||||
button_height = _ok_button.get_allocation().get_height();
|
||||
|
||||
_info_label.set_size_request( layout_width, new_window_height - button_height - button_bottom_padding);
|
||||
|
||||
_layout.put( _ok_button, layout_width - button_width - button_left_padding, new_window_height - button_height - button_bottom_padding);
|
||||
}
|
||||
|
||||
_ok_button.signal_clicked.connect (sigc::mem_fun (*this, &OkDialog::ok_button_pressed));
|
||||
show_all ();
|
||||
}
|
||||
|
||||
void
|
||||
OkDialog::on_esc_pressed ()
|
||||
{
|
||||
hide ();
|
||||
response (Gtk::RESPONSE_OK);
|
||||
}
|
||||
|
||||
void
|
||||
OkDialog::on_enter_pressed ()
|
||||
{
|
||||
hide ();
|
||||
response (Gtk::RESPONSE_OK);
|
||||
}
|
||||
|
||||
void
|
||||
OkDialog::ok_button_pressed (WavesButton*)
|
||||
{
|
||||
hide ();
|
||||
response (Gtk::RESPONSE_OK);
|
||||
}
|
||||
|
||||
OkDialog::~OkDialog ()
|
||||
{
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
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 __ok_dialog_h__
|
||||
#define __ok_dialog_h__
|
||||
|
||||
#include "waves_dialog.h"
|
||||
#include "ardour_button.h"
|
||||
|
||||
class OkDialog : public WavesDialog
|
||||
{
|
||||
public:
|
||||
OkDialog(std::string window_title, std::string info_lines);
|
||||
~OkDialog();
|
||||
|
||||
protected:
|
||||
void on_esc_pressed ();
|
||||
void on_enter_pressed ();
|
||||
|
||||
private:
|
||||
void ok_button_pressed (WavesButton*);
|
||||
WavesButton& _ok_button;
|
||||
|
||||
Gtk::Label& _info_label;
|
||||
Gtk::Layout& _layout;
|
||||
};
|
||||
|
||||
#endif /* __ok_dialog_h__ */
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
/*
|
||||
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 "sample_rate_mismatch_dialog.h"
|
||||
#include "utils.h"
|
||||
#include <string.h>
|
||||
#include "i18n.h"
|
||||
|
||||
using namespace Gtk;
|
||||
using namespace Gdk;
|
||||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
|
||||
SampleRateMismatchDialog::SampleRateMismatchDialog (ARDOUR::framecnt_t desired, std::string program_name, ARDOUR::framecnt_t actual)
|
||||
: WavesDialog (_("sample_rate_mismatch_dialog.xml"), true, false)
|
||||
, _cancel_button ( get_waves_button ("cancel_button") )
|
||||
, _accept_button ( get_waves_button ("accept_button") )
|
||||
, _info_label ( get_label("info_label") )
|
||||
{
|
||||
set_modal (true);
|
||||
set_resizable (false);
|
||||
|
||||
_cancel_button.signal_clicked.connect (sigc::mem_fun (*this, &SampleRateMismatchDialog::cancel_button_pressed));
|
||||
_accept_button.signal_clicked.connect (sigc::mem_fun (*this, &SampleRateMismatchDialog::accept_button_pressed));
|
||||
|
||||
_info_label.set_text (string_compose ( _("This session was created with a sample rate of %1 Hz, but\n%2 is currently running at %3 Hz. If you load this session,\ndevice will be switched to the session sample rate value.\nIf an attemp to switch the device is unsuccessful\naudio may be played at the wrong sample rate."), desired, program_name, actual) );
|
||||
|
||||
show_all ();
|
||||
}
|
||||
|
||||
void
|
||||
SampleRateMismatchDialog::on_esc_pressed ()
|
||||
{
|
||||
hide ();
|
||||
response (Gtk::RESPONSE_CANCEL);
|
||||
}
|
||||
|
||||
void
|
||||
SampleRateMismatchDialog::on_enter_pressed ()
|
||||
{
|
||||
hide ();
|
||||
response (Gtk::RESPONSE_ACCEPT);
|
||||
}
|
||||
|
||||
void
|
||||
SampleRateMismatchDialog::cancel_button_pressed (WavesButton*)
|
||||
{
|
||||
hide ();
|
||||
response (Gtk::RESPONSE_CANCEL);
|
||||
}
|
||||
|
||||
void
|
||||
SampleRateMismatchDialog::accept_button_pressed (WavesButton*)
|
||||
{
|
||||
hide ();
|
||||
response (Gtk::RESPONSE_ACCEPT);
|
||||
}
|
||||
|
||||
SampleRateMismatchDialog::~SampleRateMismatchDialog ()
|
||||
{
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
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 __sample_rate_mismatch_dialog_h__
|
||||
#define __sample_rate_mismatch_dialog_h__
|
||||
|
||||
#include "waves_dialog.h"
|
||||
#include "ardour_button.h"
|
||||
#include <string.h>
|
||||
#include "utils.h"
|
||||
|
||||
class SampleRateMismatchDialog : public WavesDialog
|
||||
{
|
||||
public:
|
||||
SampleRateMismatchDialog(ARDOUR::framecnt_t desired, std::string program_name, ARDOUR::framecnt_t actual);
|
||||
~SampleRateMismatchDialog();
|
||||
|
||||
protected:
|
||||
void on_esc_pressed ();
|
||||
void on_enter_pressed ();
|
||||
|
||||
private:
|
||||
void cancel_button_pressed (WavesButton*);
|
||||
void accept_button_pressed (WavesButton*);
|
||||
|
||||
WavesButton& _cancel_button;
|
||||
WavesButton& _accept_button;
|
||||
Gtk::Label& _info_label;
|
||||
};
|
||||
|
||||
#endif /* __sample_rate_mismatch_dialog_h__ */
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include "open_file_dialog_proxy.h"
|
||||
#include "yes_no_dialog.h"
|
||||
#include "ok_dialog.h"
|
||||
#include "waves_message_dialog.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
using namespace Gtk;
|
||||
|
|
@ -588,8 +588,8 @@ TracksControlPanel::populate_engine_dropdown()
|
|||
EngineStateController::instance()->available_backends(backends);
|
||||
|
||||
if (backends.empty()) {
|
||||
OkDialog ok_dialog ("", string_compose (_("No audio/MIDI backends detected. %1 cannot run\n(This is a build/packaging/system error.\nIt should never happen.)"), PROGRAM_NAME));
|
||||
ok_dialog.run ();
|
||||
WavesMessageDialog message_dialog ("", string_compose (_("No audio/MIDI backends detected. %1 cannot run\n(This is a build/packaging/system error.\nIt should never happen.)"), PROGRAM_NAME));
|
||||
message_dialog.run ();
|
||||
throw failed_constructor ();
|
||||
}
|
||||
for (std::vector<const AudioBackendInfo*>::const_iterator b = backends.begin(); b != backends.end(); ++b) {
|
||||
|
|
@ -1148,8 +1148,11 @@ TracksControlPanel::on_device_dropdown_item_clicked (WavesDropdown*, int)
|
|||
|
||||
std::string message = _("Would you like to switch to ") + device_name + "?";
|
||||
|
||||
this->set_keep_above (false);
|
||||
YesNoDialog yes_no_dialog ("", message);
|
||||
set_keep_above (false);
|
||||
WavesMessageDialog yes_no_dialog ("",
|
||||
message,
|
||||
WavesMessageDialog::BUTTON_YES |
|
||||
WavesMessageDialog::BUTTON_NO);
|
||||
|
||||
yes_no_dialog.set_position (Gtk::WIN_POS_MOUSE);
|
||||
|
||||
|
|
@ -1159,11 +1162,14 @@ TracksControlPanel::on_device_dropdown_item_clicked (WavesDropdown*, int)
|
|||
PBD::Unwinder<uint32_t> protect_ignore_changes (_ignore_changes, _ignore_changes + 1);
|
||||
|
||||
_device_dropdown.set_text (EngineStateController::instance()->get_current_device_name());
|
||||
this->set_keep_above (true);
|
||||
set_keep_above (true);
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
this->set_keep_above (true);
|
||||
set_keep_above (true);
|
||||
device_changed ();
|
||||
}
|
||||
|
||||
|
|
@ -1405,13 +1411,11 @@ TracksControlPanel::on_a_settings_tab_button_clicked (WavesButton* clicked_butto
|
|||
void
|
||||
TracksControlPanel::on_device_error ()
|
||||
{
|
||||
std::string message = _("Device cannot operate properly. Switched to None device.");
|
||||
WavesMessageDialog message_dialog ("", _("Device cannot operate properly. Switched to None device."));
|
||||
|
||||
OkDialog ok_dialog ("", message);
|
||||
|
||||
ok_dialog.set_position (Gtk::WIN_POS_MOUSE);
|
||||
ok_dialog.set_keep_above (true);
|
||||
ok_dialog.run ();
|
||||
message_dialog.set_position (Gtk::WIN_POS_MOUSE);
|
||||
message_dialog.set_keep_above (true);
|
||||
message_dialog.run ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1628,12 +1632,12 @@ TracksControlPanel::on_device_list_update (bool current_device_disconnected)
|
|||
if (current_device_disconnected) {
|
||||
std::string message = _("Audio device has been removed");
|
||||
|
||||
this->set_keep_above (false);
|
||||
OkDialog ok_dialog ("", message);
|
||||
set_keep_above (false);
|
||||
WavesMessageDialog message_dialog ("", message);
|
||||
|
||||
ok_dialog.set_position (Gtk::WIN_POS_MOUSE);
|
||||
ok_dialog.run();
|
||||
this->set_keep_above (true);
|
||||
message_dialog.set_position (Gtk::WIN_POS_MOUSE);
|
||||
message_dialog.run();
|
||||
set_keep_above (true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,58 +1,65 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Dialog title=""
|
||||
resizeable="False"
|
||||
winfont ="Arial Bold 12"
|
||||
macfont ="Helvetica Bold 12"
|
||||
fgnormal="#6D6E72">
|
||||
|
||||
<style name="generic_control"
|
||||
winfont ="Arial Bold 12"
|
||||
macfont ="Helvetica Bold 12"
|
||||
fgnormal="#6D6E72"
|
||||
horzalignment="center"
|
||||
justify="center"/>
|
||||
|
||||
<Layout id="layout"
|
||||
width="350"
|
||||
height="140"
|
||||
bgnormal="#EDECE8">
|
||||
<VBox x="0"
|
||||
y="10"
|
||||
width="350">
|
||||
<Label id="info_label"
|
||||
height="90"
|
||||
style="generic_control"
|
||||
text=""/>
|
||||
</VBox>
|
||||
|
||||
<Button id="ignore_button"
|
||||
style="generic_control"
|
||||
text="Ignore crash data"
|
||||
fgnormal="#6D6E72"
|
||||
bgnormal="#CACAC5"
|
||||
fgactive="#EDECE8"
|
||||
bgactive="#6D6E72"
|
||||
borderwidth="0 0 0 0"
|
||||
bordercolor="#6D6E72"
|
||||
width="120"
|
||||
height="22"
|
||||
x="90"
|
||||
y="108"/>
|
||||
|
||||
<Button id="recover_button"
|
||||
style="generic_control"
|
||||
text="Recover from crash"
|
||||
fgnormal="#6D6E72"
|
||||
bgnormal="#CACAC5"
|
||||
fgactive="#EDECE8"
|
||||
bgactive="#6D6E72"
|
||||
borderwidth="0 0 0 0"
|
||||
bordercolor="#6D6E72"
|
||||
width="120"
|
||||
height="22"
|
||||
x="220"
|
||||
y="108"/>
|
||||
|
||||
</Layout>
|
||||
|
||||
</Dialog>
|
||||
<Dialog title="Tracks Live" resizeable="False">
|
||||
<style name="generic_control"
|
||||
winfont ="Arial Bold 12"
|
||||
macfont ="Helvetica Bold 12"
|
||||
fgnormal="#BFBFBF"
|
||||
bgnormal="#6C6C6C"
|
||||
fgactive="#BFBFBF"
|
||||
bgactive="#454545"
|
||||
fghover="#CCCCCC"
|
||||
bghover="#898989"/>
|
||||
|
||||
<style name="generic_button"
|
||||
winfont ="Arial Bold 12"
|
||||
macfont ="Helvetica Bold 12"
|
||||
fgnormal="#6D6E72"
|
||||
bgnormal="#CACAC5"
|
||||
fgactive="#EDECE8"
|
||||
bgactive="#6D6E72"
|
||||
visible="false"
|
||||
noshowall="true"
|
||||
width="80"
|
||||
height="21"/>
|
||||
|
||||
<EventBox bgnormal="#EDECE8">
|
||||
<VBox borderwidth="10"
|
||||
spacing="10">
|
||||
<Label id="message_label"
|
||||
style="generic_control"
|
||||
fgnormal="#6D6E72"
|
||||
horzalignment="center"
|
||||
justify="center"/>
|
||||
<HBox spacing="10">
|
||||
<Button id="ok_button"
|
||||
style="generic_button"
|
||||
box.pack="end"
|
||||
text="ok"/>
|
||||
<Button id="close_button"
|
||||
style="generic_button"
|
||||
box.pack="end"
|
||||
text="Close"/>
|
||||
<Button id="accept_button"
|
||||
style="generic_button"
|
||||
box.pack="end"
|
||||
width="160"
|
||||
height="21"
|
||||
text="Recover from crash"/>
|
||||
<Button id="yes_button"
|
||||
style="generic_button"
|
||||
box.pack="end"
|
||||
text="Yes"/>
|
||||
<Button id="no_button"
|
||||
style="generic_button"
|
||||
box.pack="end"
|
||||
width="160"
|
||||
height="21"
|
||||
text="Ignore crash data"/>
|
||||
<Button id="cancel_button"
|
||||
style="generic_button"
|
||||
box.pack="end"
|
||||
text="Cancel"/>
|
||||
</HBox>
|
||||
</VBox>
|
||||
</EventBox>
|
||||
</Dialog>
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Dialog title=""
|
||||
resizeable="False"
|
||||
winfont ="Arial Bold 12"
|
||||
macfont ="Helvetica Bold 12"
|
||||
fgnormal="#6D6E72">
|
||||
|
||||
<style name="generic_control"
|
||||
winfont ="Arial Bold 12"
|
||||
macfont ="Helvetica Bold 12"
|
||||
fgnormal="#6D6E72"
|
||||
horzalignment="center"
|
||||
justify="center"/>
|
||||
|
||||
<Layout id="layout"
|
||||
width="350"
|
||||
height="120"
|
||||
bgnormal="#EDECE8">
|
||||
<VBox x="0"
|
||||
y="0"
|
||||
width="350">
|
||||
<Label id="info_label"
|
||||
style="generic_control"
|
||||
vertalignment="center"
|
||||
text=""
|
||||
height="90"/>
|
||||
</VBox>
|
||||
|
||||
<Button id="ok_button"
|
||||
style="generic_control"
|
||||
text="Ok"
|
||||
fgnormal="#6D6E72"
|
||||
bgnormal="#CACAC5"
|
||||
fgactive="#EDECE8"
|
||||
bgactive="#6D6E72"
|
||||
borderwidth="0 0 0 0"
|
||||
bordercolor="#6D6E72"
|
||||
width="80"
|
||||
height="22"
|
||||
x="260"
|
||||
y="88"/>
|
||||
|
||||
</Layout>
|
||||
|
||||
</Dialog>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Dialog title="Sample rate mismatch" resizeable="False">
|
||||
|
||||
<style name="generic_control"
|
||||
winfont ="Arial Bold 12"
|
||||
macfont ="Helvetica Bold 12"
|
||||
fgnormal="#BFBFBF"
|
||||
bgnormal="#6C6C6C"
|
||||
fgactive="#BFBFBF"
|
||||
bgactive="#454545"
|
||||
fghover="#CCCCCC"
|
||||
bghover="#898989"/>
|
||||
|
||||
<EventBox bgnormal="#EDECE8">
|
||||
<VBox width="450"
|
||||
borderwidth="10"
|
||||
spacing="10">
|
||||
<Label id="info_label"
|
||||
style="generic_control"
|
||||
fgnormal="#6D6E72"
|
||||
horzalignment="center"
|
||||
justify="center"/>
|
||||
<HBox spacing="10">
|
||||
<Button id="accept_button"
|
||||
style="generic_control"
|
||||
box.pack="end"
|
||||
text="Accept"
|
||||
fgnormal="#6D6E72"
|
||||
bgnormal="#CACAC5"
|
||||
fgactive="#EDECE8"
|
||||
bgactive="#6D6E72"
|
||||
borderwidth="0 0 0 0"
|
||||
bordercolor="#6D6E72"
|
||||
width="80"
|
||||
height="22"
|
||||
x="330"
|
||||
y="110"/>
|
||||
<Button id="cancel_button"
|
||||
style="generic_control"
|
||||
box.pack="end"
|
||||
text="Cancel"
|
||||
fgnormal="#6D6E72"
|
||||
bgnormal="#CACAC5"
|
||||
fgactive="#EDECE8"
|
||||
bgactive="#6D6E72"
|
||||
borderwidth="0 0 0 0"
|
||||
bordercolor="#6D6E72"
|
||||
width="80"
|
||||
height="22"
|
||||
x="240"
|
||||
y="110"/>
|
||||
</HBox>
|
||||
</VBox>
|
||||
</EventBox>
|
||||
|
||||
</Dialog>
|
||||
|
|
@ -42,7 +42,7 @@ using namespace PBD;
|
|||
using namespace ARDOUR;
|
||||
using namespace ARDOUR_UI_UTILS;
|
||||
|
||||
WavesDialog::WavesDialog (std::string layout_script_file, bool modal, bool use_seperator)
|
||||
WavesDialog::WavesDialog (const std::string& layout_script_file, bool modal, bool use_seperator)
|
||||
: Gtk::Dialog ("", modal, use_seperator)
|
||||
, WavesUI (layout_script_file, *get_vbox())
|
||||
, _proxy (0)
|
||||
|
|
@ -107,53 +107,17 @@ WavesDialog::~WavesDialog ()
|
|||
WM::Manager::instance().remove (_proxy);
|
||||
}
|
||||
|
||||
void
|
||||
WavesDialog::on_esc_pressed ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
WavesDialog::on_enter_pressed ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
WavesDialog::on_key_press_event (GdkEventKey* ev)
|
||||
{
|
||||
switch (ev->keyval)
|
||||
{
|
||||
case GDK_Return:
|
||||
on_enter_pressed ();
|
||||
break;
|
||||
case GDK_Escape:
|
||||
on_esc_pressed ();
|
||||
break;
|
||||
response (WavesDialog::RESPONSE_DEFAULT);
|
||||
return true;
|
||||
}
|
||||
|
||||
return relay_key_press (ev, this);
|
||||
}
|
||||
|
||||
bool
|
||||
WavesDialog::on_enter_notify_event (GdkEventCrossing *ev)
|
||||
{
|
||||
Keyboard::the_keyboard().enter_window (ev, this);
|
||||
return Dialog::on_enter_notify_event (ev);
|
||||
}
|
||||
|
||||
bool
|
||||
WavesDialog::on_leave_notify_event (GdkEventCrossing *ev)
|
||||
{
|
||||
Keyboard::the_keyboard().leave_window (ev, this);
|
||||
return Dialog::on_leave_notify_event (ev);
|
||||
}
|
||||
|
||||
void
|
||||
WavesDialog::on_unmap ()
|
||||
{
|
||||
Keyboard::the_keyboard().leave_window (0, this);
|
||||
Dialog::on_unmap ();
|
||||
return Gtk::Dialog::on_key_press_event (ev);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -45,19 +45,18 @@ class WavesDialog : public Gtk::Dialog, public ARDOUR::SessionHandlePtr, public
|
|||
{
|
||||
public:
|
||||
|
||||
WavesDialog (std::string layout_script, bool modal = false, bool use_separator = false);
|
||||
~WavesDialog();
|
||||
WavesDialog (const std::string& layout_script_file, bool modal = false, bool use_separator = false);
|
||||
virtual ~WavesDialog();
|
||||
|
||||
bool on_enter_notify_event (GdkEventCrossing*);
|
||||
bool on_leave_notify_event (GdkEventCrossing*);
|
||||
bool on_delete_event (GdkEventAny*);
|
||||
bool on_key_press_event (GdkEventKey*);
|
||||
void on_unmap ();
|
||||
void on_show ();
|
||||
enum {
|
||||
// We need one smaller then smallest Gtk::RESPONSE_*
|
||||
RESPONSE_DEFAULT = -1000
|
||||
};
|
||||
|
||||
protected:
|
||||
virtual void on_esc_pressed ();
|
||||
virtual void on_enter_pressed ();
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ path_prefix = 'gtk2_ardour/'
|
|||
|
||||
gtk2_ardour_sources = [
|
||||
'mixer_bridge_view.cc',
|
||||
'waves_message_dialog.cc',
|
||||
'waves_dropdown.cc',
|
||||
'waves_zoom_control.cc',
|
||||
'waves_ui.cc',
|
||||
|
|
@ -118,7 +119,6 @@ gtk2_ardour_sources = [
|
|||
'fft_graph.cc',
|
||||
'fft_result.cc',
|
||||
'floating_text_entry.cc',
|
||||
'sample_rate_mismatch_dialog.cc',
|
||||
'sfdb_freesound_mootcher.cc',
|
||||
'gain_meter.cc',
|
||||
'generic_pluginui.cc',
|
||||
|
|
@ -177,7 +177,6 @@ gtk2_ardour_sources = [
|
|||
'note_player.cc',
|
||||
'nsm.cc',
|
||||
'nsmclient.cc',
|
||||
'ok_dialog.cc',
|
||||
'option_editor.cc',
|
||||
'opts.cc',
|
||||
'panner2d.cc',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue