LUMIERA.clone/gui/src/dialogs/render.cpp

102 lines
3.2 KiB
C++
Raw Normal View History

2008-04-09 00:21:05 +02:00
/*
render.cpp - Definition of the main workspace window object
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
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.
* *****************************************************/
2008-04-09 00:21:05 +02:00
#include "../gtk-lumiera.hpp"
#include "render.hpp"
2008-04-09 00:21:05 +02:00
using namespace Gtk;
namespace lumiera {
namespace gui {
namespace dialogs {
2008-04-09 00:21:05 +02:00
Render::Render(Window &parent) :
Dialog(_("Render"), parent, true),
outputFileLabel(_("Output File:")),
browseButtonImage(StockID(Stock::INDEX), ICON_SIZE_BUTTON),
2008-04-17 19:06:00 +02:00
outputFileBrowseButton(_("_Browse...")),
containerFormatLabel(_("Container Format:")),
2008-04-17 19:06:00 +02:00
renderButtonImage(StockID(Stock::OK), ICON_SIZE_BUTTON),
2008-04-16 23:59:46 +02:00
audioFrame(_("Audio")),
videoFrame(_("Video"))
{
VBox *v_box = get_vbox();
g_assert(v_box != NULL);
// The Output File Row
outputFileHBox.pack_start(outputFileLabel, PACK_SHRINK);
outputFileHBox.pack_start(outputFilePathEntry);
2008-04-17 19:06:00 +02:00
outputFileBrowseButton.set_image(browseButtonImage);
outputFileBrowseButton.signal_clicked().connect(
sigc::mem_fun(*this, &Render::on_button_browse));
outputFileHBox.pack_start(outputFileBrowseButton, PACK_SHRINK);
outputFileHBox.set_spacing(4);
v_box->pack_start(outputFileHBox, PACK_SHRINK);
2008-04-17 19:06:00 +02:00
// The Container Format Row
containerFormatHBox.pack_start(containerFormatLabel, PACK_SHRINK);
containerFormatHBox.pack_start(containerFormat);
containerFormatHBox.set_spacing(4);
v_box->pack_start(containerFormatHBox, PACK_SHRINK);
2008-04-16 23:59:46 +02:00
v_box->pack_start(audioFrame);
v_box->pack_start(videoFrame);
// Configure the dialog
v_box->set_spacing(4);
set_border_width(5);
set_resizable(false);
2008-04-17 19:06:00 +02:00
// Configure the Cancel and Render buttons
add_button(Stock::CANCEL, RESPONSE_CANCEL);
2008-04-17 19:06:00 +02:00
Button *render_button = add_button(Stock::OK, RESPONSE_OK);
render_button->set_label(_("_Render"));
render_button->set_image(renderButtonImage);
render_button->set_flags(Gtk::CAN_DEFAULT);
render_button->grab_default();
2008-04-10 16:36:21 +02:00
2008-04-17 19:06:00 +02:00
show_all_children();
}
2008-04-17 19:06:00 +02:00
void Render::on_button_browse()
{
2008-04-17 19:06:00 +02:00
FileChooserDialog dialog(*this, _("Select a File Name for Rendering"),
FILE_CHOOSER_ACTION_SAVE);
// Add response buttons the the dialog:
dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
dialog.add_button(/*Gtk::Stock::SAVE*/"Save", Gtk::RESPONSE_OK);
int result = dialog.run();
g_message("%d", result);
if(result == RESPONSE_OK)
g_message("RESPONSE_OK");
}
} // namespace dialogs
} // namespace gui
} // namespace lumiera