13
0

replaced deprecated (and ugly) FileSelection with FileChooserDialog in export dialog. Also some button size trimming

git-svn-id: svn://localhost/trunk/ardour2@422 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Doug McLain 2006-03-28 10:52:46 +00:00
parent 34c9e917c5
commit 744acb7c16
3 changed files with 24 additions and 34 deletions

View File

@ -141,6 +141,8 @@ style "default_buttons_menus"
style "very_small_button" = "default_buttons_menus"
{
font_name = "sans 7"
xthickness = 0
ythickness = 0
}
style "small_button" = "default_buttons_menus"
@ -174,6 +176,8 @@ style "track_rec_enable_button" = "small_button"
style "mixer_rec_enable_button" = "track_rec_enable_button"
{
font_name = "sans 7"
xthickness = 0
ythickness = 0
}
style "solo_button" = "small_button"
@ -188,6 +192,8 @@ style "solo_button" = "small_button"
style "mixer_solo_button" = "solo_button"
{
font_name = "sans 7"
xthickness = 0
ythickness = 0
}
@ -202,6 +208,8 @@ style "mute_button" = "small_button"
style "mixer_mute_button" = "mute_button"
{
font_name = "sans 7"
xthickness = 0
ythickness = 0
}
style "track_loop_button" = "small_button"
@ -828,7 +836,7 @@ style "region_list_whole_file"
style "ardour_button" ="default_buttons_menus"
{
xthickness = 0
ythickness = 2
ythickness = 1
}
#---------------------------------------------------------------

View File

@ -125,7 +125,6 @@ ExportDialog::ExportDialog(PublicEditor& e)
set_name ("ExportWindow");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
file_selector = 0;
spec.running = false;
file_entry.set_name ("ExportFileNameEntry");
@ -350,7 +349,7 @@ ExportDialog::ExportDialog(PublicEditor& e)
ok_button->signal_clicked().connect (mem_fun(*this, &ExportDialog::do_export));
file_browse_button.set_name ("EditorGTKButton");
file_browse_button.signal_clicked().connect (mem_fun(*this, &ExportDialog::initiate_browse));
file_browse_button.signal_clicked().connect (mem_fun(*this, &ExportDialog::browse));
channel_count_combo.signal_changed().connect (mem_fun(*this, &ExportDialog::channels_chosen));
bitdepth_format_combo.signal_changed().connect (mem_fun(*this, &ExportDialog::bitdepth_chosen));
@ -361,9 +360,6 @@ ExportDialog::ExportDialog(PublicEditor& e)
ExportDialog::~ExportDialog()
{
if (file_selector) {
delete file_selector;
}
}
void
@ -940,10 +936,6 @@ ExportDialog::end_dialog ()
hide_all ();
if (file_selector) {
file_selector->hide_all ();
}
set_modal (false);
ok_button->set_sensitive(true);
}
@ -1311,31 +1303,23 @@ ExportDialog::window_closed (GdkEventAny *ignored)
}
void
ExportDialog::initiate_browse ()
ExportDialog::browse ()
{
if (file_selector == 0) {
file_selector = new FileSelection;
file_selector->set_modal (true);
FileChooserDialog dialog("Export to file", FILE_CHOOSER_ACTION_SAVE);
dialog.set_transient_for(*this);
dialog.set_filename (file_entry.get_text());
file_selector->get_cancel_button()->signal_clicked().connect (bind (mem_fun(*this, &ExportDialog::finish_browse), -1));
file_selector->get_ok_button()->signal_clicked().connect (bind (mem_fun(*this, &ExportDialog::finish_browse), 1));
}
file_selector->set_filename (file_entry.get_text());
file_selector->show_all ();
}
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
int result = dialog.run();
void
ExportDialog::finish_browse (int status)
{
if (file_selector) {
if (status > 0) {
string result = file_selector->get_filename();
if (result.length()) {
file_entry.set_text (result);
}
if (result == Gtk::RESPONSE_OK) {
string filename = dialog.get_filename();
if (filename.length()) {
file_entry.set_text (filename);
}
file_selector->hide_all();
}
}

View File

@ -154,7 +154,6 @@ class ExportDialog : public ArdourDialog
Glib::RefPtr<Gtk::ListStore> track_list;
Gtk::TreeView master_selector;
Glib::RefPtr<Gtk::ListStore> master_list;
Gtk::FileSelection *file_selector;
static void *_thread (void *arg);
// sets the export progress in the progress bar
@ -179,8 +178,7 @@ class ExportDialog : public ArdourDialog
void track_selector_button_click ();
void initiate_browse ();
void finish_browse (int status);
void browse ();
void set_state();
void save_state();