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)
5  2008, Joel Holdsworth <joel@airwebreathe.org.uk>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
24 #include "stage/gtk-base.hpp"
25 
26 #include "stage/dialog/render.hpp"
27 #include "stage/dialog/dialog.hpp"
28 #include "include/logging.h"
29 
30 
31 using namespace Gtk;
32 
33 namespace stage {
34 namespace dialog {
35 
36  Render::Render (Window& parent)
37  : Dialog(_("Render"), parent, true)
38  , outputFileLabel_(_("Output File:"))
39  , browseButtonImage_(StockID(Stock::INDEX), ICON_SIZE_BUTTON)
40  , outputFileBrowseButton_(_("_Browse..."))
41  , containerFormatLabel_(_("Container Format:"))
42  , renderButtonImage_(StockID(Stock::OK), ICON_SIZE_BUTTON)
43  , audioFrame_(_("Audio"))
44  , videoFrame_(_("Video"))
45  {
46  Box* v_box = get_vbox();
47  REQUIRE (v_box != NULL);
48 
49  // The Output File Row
50  outputFileHBox_.pack_start (outputFileLabel_, PACK_SHRINK);
51  outputFileHBox_.pack_start (outputFilePathEntry_);
52 
53  outputFileBrowseButton_.set_image (browseButtonImage_);
54  outputFileBrowseButton_.signal_clicked().connect(
55  sigc::mem_fun(*this, &Render::on_button_browse));
56 
57  outputFileHBox_.pack_start (outputFileBrowseButton_, PACK_SHRINK);
58  outputFileHBox_.set_spacing(4);
59  v_box->pack_start (outputFileHBox_, PACK_SHRINK);
60 
61  // The Container Format Row
62  containerFormatHBox_.pack_start (containerFormatLabel_, PACK_SHRINK);
63  containerFormatHBox_.pack_start (containerFormat_);
64  containerFormatHBox_.set_spacing(4);
65  v_box->pack_start (containerFormatHBox_, PACK_SHRINK);
66 
67  v_box->pack_start (audioFrame_);
68  v_box->pack_start (videoFrame_);
69 
70  // Configure the dialog
71  v_box->set_spacing (BoxSpacing);
72  set_border_width (BorderPadding);
73  set_resizable (false);
74 
75  // Configure the Cancel and Render buttons
76  add_button (Stock::CANCEL, RESPONSE_CANCEL);
77 
78  Button* render_button = add_button (Stock::OK, RESPONSE_OK);
79  render_button->set_label (_("_Render"));
80  render_button->set_image (renderButtonImage_);
81  //render_button->set_flags(Gtk::CAN_DEFAULT);
82  render_button->grab_default();
83 
84  show_all_children();
85  }
86 
87  void
88  Render::on_button_browse()
89  {
90  FileChooserDialog dialog (*this,
91  _("Select a File Name for Rendering"),
92  FILE_CHOOSER_ACTION_SAVE);
93 
94  // Add response buttons the the dialog:
95  dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
96  dialog.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_OK);
97 
98  int result = dialog.run();
99  INFO (stage, "%d", result);
100  if (result == RESPONSE_OK)
101  INFO(stage, "%s", "RESPONSE_OK");
102  }
103 
104 
105 }} // namespace stage::dialog
static const int BorderPadding
The space in pixels to pad the border of Lumiera dialog boxes.
Definition: dialog.hpp:29
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:37
static const int BoxSpacing
The spacing for VBoxes and HBoxes in Lumiera dialogs.
Definition: dialog.hpp:34
Global constants and definitions for dialogs.
A set of basic GTK includes for the UI.