Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

/home/vlg/develop/gwavmerger/src/MergeDialog_ui.cpp

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //------------------------------------------------------------------------------
00003 //                              MergeDialog_ui.cpp
00004 //------------------------------------------------------------------------------
00005 // $Id: MergeDialog_ui.cpp,v 1.4 2003/02/07 05:15:10 vlg Exp $
00006 //------------------------------------------------------------------------------
00007 //  Copyright (c) 2001,2002 by Vladislav Grinchenko
00008 //
00009 //  This program is free software; you can redistribute it and/or
00010 //  modify it under the terms of the GNU General Public License
00011 //  as published by the Free Software Foundation; either version
00012 //  2 of the License, or (at your option) any later version.
00013 //------------------------------------------------------------------------------
00014 
00015 #include <vector>
00016 using std::vector;
00017 
00018 #include <gtkmm/buttonbox.h>
00019 #include <gtkmm/label.h>
00020 #include <gtkmm/box.h>
00021 #include <gtkmm/separator.h>
00022 #include <gtkmm/dialog.h>
00023 #include <gtkmm/stock.h>
00024 
00025 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #endif
00028 
00029 #include "MergeDialog.h"
00030 
00031 using namespace ASSA;
00032 
00033 
00034 MergeDialog_ui::MergeDialog_ui ()
00035     : Gtk::Dialog("Merge Files"),
00036       m_file_name_label (0), 
00037       m_file_progress (0),
00038       m_total_label (0), 
00039       m_total_progress (0),
00040       m_make_cd (0),
00041       m_first_cd_track (0)
00042 {  
00043     trace("MergeDialog_ui::MergeDialog_ui");
00044 
00045 
00046     Gtk::Button* merge_b  = add_button(Gtk::Stock::EXECUTE, 0);
00047     Gtk::Button* cancel_b = add_button(Gtk::Stock::CANCEL, 1);
00048 
00049     /* vbox that holds everything */
00050     Gtk::VBox *vbox2 = manage (new class Gtk::VBox(false, 3));
00051     Gtk::HSeparator* separator = manage (new Gtk::HSeparator);
00052    
00053     /* File report progress label */
00054     Gtk::HBox *hbox2 = manage (new class Gtk::HBox(false, 1));
00055     Gtk::Label *FileLabel = manage (new class Gtk::Label("Processing file : "));
00056     m_file_name_label = manage (new class Gtk::Label(""));
00057 
00058     FileLabel->set_alignment(0.5, 0.5);
00059     FileLabel->set_padding(0, 0);
00060     FileLabel->set_justify(Gtk::JUSTIFY_LEFT);
00061 
00062     m_file_name_label->set_alignment(0.5, 0.5);
00063     m_file_name_label->set_padding(0, 0);
00064     m_file_name_label->set_justify(Gtk::JUSTIFY_LEFT);
00065 
00066     hbox2->pack_start(*FileLabel, false, false, 1);
00067     hbox2->pack_start(*m_file_name_label, false, false, 0);
00068 
00069     FileLabel->show ();
00070     m_file_name_label->show ();
00071 
00072     vbox2->pack_start(*hbox2);
00073     hbox2->show ();
00074 
00077     m_file_progress = manage (new class Gtk::ProgressBar());
00078     vbox2->pack_start(*m_file_progress, false, false, 4);
00079     m_file_progress->show ();
00080 
00083     Gtk::HBox *hbox3 = manage (new class Gtk::HBox(false, 1));
00084     Gtk::Label *TotalLabel;
00085     TotalLabel = manage (new class Gtk::Label("Files processed : "));
00086     m_total_label = manage (new class Gtk::Label(""));
00087 
00088     TotalLabel->set_alignment(0.5, 0.5);
00089     TotalLabel->set_padding(0, 0);
00090     TotalLabel->set_justify(Gtk::JUSTIFY_LEFT);
00091 
00092     m_total_label->set_alignment(0.5, 0.5);
00093     m_total_label->set_padding(0, 0);
00094     m_total_label->set_justify(Gtk::JUSTIFY_LEFT);
00095 
00096     hbox3->pack_start(*TotalLabel, false, false, 1);
00097     hbox3->pack_start(*m_total_label, false, false, 0);
00098 
00099     TotalLabel->show ();
00100     m_total_label->show ();
00101 
00102     vbox2->pack_start(*hbox3);
00103     hbox3->show ();
00104 
00107     m_total_progress = manage (new class Gtk::ProgressBar());
00108 
00109     vbox2->pack_start(*m_total_progress, false, false, 6);
00110     m_total_progress->show ();
00111 
00114     Gtk::HBox* hbox5 = manage (new class Gtk::HBox (false, 1));
00115     Gtk::Label* l5 = manage (new Gtk::Label ("Lay down CD tracks:"));
00116     l5->set_alignment (0.5,0.5);
00117 
00118     m_make_cd = manage (new Gtk::CheckButton);
00119     m_make_cd->set_active (false);
00120 
00121     hbox5->pack_start (*l5, false, false, 0);
00122     hbox5->pack_end (*m_make_cd, false, true, 0);
00123 
00124     l5->show ();
00125     m_make_cd->show();
00126 
00127     vbox2->pack_start(*separator, false, false, 3);
00128     vbox2->pack_start(*hbox5, false, false, 4);
00129 
00130     hbox5->show ();
00131 
00134     Gtk::HBox* hbox4 = manage (new class Gtk::HBox (false, 1));
00135     Gtk::Label* l4 = manage (new Gtk::Label ("CD tracks start at:"));
00136     l4->set_alignment (0.5,0.5);
00137 
00138     m_first_cd_track = manage (new Gtk::Entry());
00139 
00140     m_first_cd_track->set_size_request (32,-1);
00141     m_first_cd_track->set_editable (true);
00142     m_first_cd_track->set_text ("1");
00143 
00144     hbox4->pack_start (*l4, false, false, 0);
00145     hbox4->pack_end (*m_first_cd_track, false, true, 0);
00146 
00147     l4->show ();
00148     m_first_cd_track->show ();
00149 
00150     vbox2->pack_start(*hbox4, false, false, 4);
00151     hbox4->show ();
00152 
00153     separator = manage (new Gtk::HSeparator);
00154     vbox2->pack_start(*separator, false, false, 3);
00155 
00158     // merge_b->set_flags(GTK_CAN_FOCUS);
00159     // cancel_b->set_flags(GTK_CAN_FOCUS);
00160 
00161     set_border_width (10);
00162     get_vbox()->set_size_request(400, -1);
00163     get_vbox()->set_spacing(12);
00164     get_vbox()->pack_start(*vbox2);
00165     set_title("Merge Files");
00166     set_modal(true);
00167 
00173     // set_policy(false, false, true);
00174    
00175     Gtk::HButtonBox *dialog_action_area2 = get_action_area ();
00176     dialog_action_area2->set_spacing(8);
00177 
00181     merge_b->signal_clicked ().connect(
00182             SigC::slot(*(static_cast<class MergeDialog*>(this)), 
00183                        &MergeDialog::on_ok_button_clicked));
00184 
00185     cancel_b->signal_clicked ().connect(
00186             SigC::slot(*(static_cast<class MergeDialog*>(this)), 
00187                        &MergeDialog::on_cancel_button_clicked));
00188 
00189     vbox2->show();
00190 }
00191 
00192 

Generated on Tue Feb 11 23:05:19 2003 for gwavmerger by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002