From 9789ff84f2322d588c0e33ec42bf021ae32ee4be Mon Sep 17 00:00:00 2001 From: Nick Mainsbridge Date: Tue, 8 Jan 2008 16:16:22 +0000 Subject: [PATCH] prettify and change button order for pending state dialog, use an icon for the NSD git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2844 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui.cc | 20 +++++++++++++------- gtk2_ardour/new_session_dialog.cc | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index d25e65030e..5343aa08d3 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2957,7 +2957,9 @@ ARDOUR_UI::disk_speed_dialog_gone (int ignored_response, MessageDialog* msg) int ARDOUR_UI::pending_state_dialog () { - ArdourDialog dialog ("pending state dialog"); + HBox* hbox = new HBox(); + Image* image = new Image (Stock::DIALOG_QUESTION, ICON_SIZE_DIALOG); + ArdourDialog dialog (_("Crash Recovery"), true); Label message (_("\ This session appears to have been in\n\ middle of recording when ardour or\n\ @@ -2966,14 +2968,18 @@ the computer was shutdown.\n\ Ardour can recover any captured audio for\n\ you, or it can ignore it. Please decide\n\ what you would like to do.\n")); - - dialog.get_vbox()->pack_start (message); - dialog.add_button (_("Recover from crash"), RESPONSE_ACCEPT); + image->set_alignment(ALIGN_CENTER, ALIGN_TOP); + hbox->pack_start (*image, PACK_EXPAND_WIDGET, 12); + hbox->pack_end (message, PACK_EXPAND_PADDING, 12); + dialog.get_vbox()->pack_start(*hbox, PACK_EXPAND_PADDING, 6); dialog.add_button (_("Ignore crash data"), RESPONSE_REJECT); - + dialog.add_button (_("Recover from crash"), RESPONSE_ACCEPT); + dialog.set_default_response (RESPONSE_ACCEPT); dialog.set_position (WIN_POS_CENTER); - dialog.show_all (); - + message.show(); + image->show(); + hbox->show(); + switch (dialog.run ()) { case RESPONSE_ACCEPT: return 1; diff --git a/gtk2_ardour/new_session_dialog.cc b/gtk2_ardour/new_session_dialog.cc index 0bdc52113f..8ea5cef9cc 100644 --- a/gtk2_ardour/new_session_dialog.cc +++ b/gtk2_ardour/new_session_dialog.cc @@ -38,6 +38,7 @@ using namespace Gtkmm2ext; #include "opts.h" +#include "utils.h" NewSessionDialog::NewSessionDialog() : ArdourDialog ("session control") @@ -346,6 +347,30 @@ NewSessionDialog::NewSessionDialog() get_vbox()->set_spacing(0); get_vbox()->pack_start(*m_notebook, Gtk::PACK_SHRINK, 0); + /* + icon setting is done again in the editor (for the whole app), + but its all chickens and eggs at this point. + */ + + list > window_icons; + Glib::RefPtr icon; + + if ((icon = ::get_icon ("ardour_icon_16px")) != 0) { + window_icons.push_back (icon); + } + if ((icon = ::get_icon ("ardour_icon_22px")) != 0) { + window_icons.push_back (icon); + } + if ((icon = ::get_icon ("ardour_icon_32px")) != 0) { + window_icons.push_back (icon); + } + if ((icon = ::get_icon ("ardour_icon_48px")) != 0) { + window_icons.push_back (icon); + } + if (!window_icons.empty()) { + set_icon_list (window_icons); + } + WindowTitle title(Glib::get_application_name()); title += _("Session Control"); set_title(title.get_string());