Lumiera  0.pre.03
»edit your freedom«
render.cpp
Go to the documentation of this file.
1 /*
2  Render - dialog to define render output
3 
4  Copyright (C) Lumiera.org
5  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
33 #include "stage/gtk-base.hpp"
34 
35 #include "stage/dialog/render.hpp"
36 #include "stage/dialog/dialog.hpp"
37 #include "include/logging.h"
38 
39 
40 using namespace Gtk;
41 
42 namespace stage {
43 namespace dialog {
44 
45  Render::Render (Window& parent)
46  : Dialog(_("Render"), parent, true)
47  , outputFileLabel_(_("Output File:"))
48  , browseButtonImage_(StockID(Stock::INDEX), ICON_SIZE_BUTTON)
49  , outputFileBrowseButton_(_("_Browse..."))
50  , containerFormatLabel_(_("Container Format:"))
51  , renderButtonImage_(StockID(Stock::OK), ICON_SIZE_BUTTON)
52  , audioFrame_(_("Audio"))
53  , videoFrame_(_("Video"))
54  {
55  Box* v_box = get_vbox();
56  REQUIRE (v_box != NULL);
57 
58  // The Output File Row
59  outputFileHBox_.pack_start (outputFileLabel_, PACK_SHRINK);
60  outputFileHBox_.pack_start (outputFilePathEntry_);
61 
62  outputFileBrowseButton_.set_image (browseButtonImage_);
63  outputFileBrowseButton_.signal_clicked().connect(
64  sigc::mem_fun(*this, &Render::on_button_browse));
65 
66  outputFileHBox_.pack_start (outputFileBrowseButton_, PACK_SHRINK);
67  outputFileHBox_.set_spacing(4);
68  v_box->pack_start (outputFileHBox_, PACK_SHRINK);
69 
70  // The Container Format Row
71  containerFormatHBox_.pack_start (containerFormatLabel_, PACK_SHRINK);
72  containerFormatHBox_.pack_start (containerFormat_);
73  containerFormatHBox_.set_spacing(4);
74  v_box->pack_start (containerFormatHBox_, PACK_SHRINK);
75 
76  v_box->pack_start (audioFrame_);
77  v_box->pack_start (videoFrame_);
78 
79  // Configure the dialog
80  v_box->set_spacing (BoxSpacing);
81  set_border_width (BorderPadding);
82  set_resizable (false);
83 
84  // Configure the Cancel and Render buttons
85  add_button (Stock::CANCEL, RESPONSE_CANCEL);
86 
87  Button* render_button = add_button (Stock::OK, RESPONSE_OK);
88  render_button->set_label (_("_Render"));
89  render_button->set_image (renderButtonImage_);
90  //render_button->set_flags(Gtk::CAN_DEFAULT);
91  render_button->grab_default();
92 
93  show_all_children();
94  }
95 
96  void
97  Render::on_button_browse()
98  {
99  FileChooserDialog dialog (*this,
100  _("Select a File Name for Rendering"),
101  FILE_CHOOSER_ACTION_SAVE);
102 
103  // Add response buttons the the dialog:
104  dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
105  dialog.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_OK);
106 
107  int result = dialog.run();
108  INFO (stage, "%d", result);
109  if (result == RESPONSE_OK)
110  INFO(stage, "%s", "RESPONSE_OK");
111  }
112 
113 
114 }} // namespace stage::dialog
static const int BorderPadding
The space in pixels to pad the border of Lumiera dialog boxes.
Definition: dialog.hpp:38
This header is for including and configuring NoBug.
Dialog to set up a renter process and define output name and format.
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:46
static const int BoxSpacing
The spacing for VBoxes and HBoxes in Lumiera dialogs.
Definition: dialog.hpp:43
Global constants and definitions for dialogs.
A set of basic GTK includes for the UI.