1 /*
2 * Hydrogen
3 * Copyright(c) 2002-2008 by Alex >Comix< Cominu [comix@users.sourceforge.net]
4 *
5 * http://www.hydrogen-music.org
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
23 #include "SongPropertiesDialog.h"
24 #include "Skin.h"
25 #include <hydrogen/basics/song.h>
26 #include <hydrogen/hydrogen.h>
27
28 #include <QPixmap>
29
30 using namespace H2Core;
31
SongPropertiesDialog(QWidget * parent)32 SongPropertiesDialog::SongPropertiesDialog(QWidget* parent)
33 : QDialog(parent)
34 {
35 setupUi( this );
36
37 setMaximumSize( width(), height() );
38 setMinimumSize( width(), height() );
39
40 setWindowTitle( tr( "Song properties" ) );
41
42 Song *pSong = Hydrogen::get_instance()->getSong();
43 songNameTxt->setText( pSong->__name );
44
45 authorTxt->setText( pSong->__author );
46 notesTxt->append( pSong->get_notes() );
47 licenseTxt->setText( pSong->get_license() );
48 }
49
50
51
~SongPropertiesDialog()52 SongPropertiesDialog::~SongPropertiesDialog()
53 {
54 }
55
56
on_cancelBtn_clicked()57 void SongPropertiesDialog::on_cancelBtn_clicked()
58 {
59 reject();
60 }
61
on_okBtn_clicked()62 void SongPropertiesDialog::on_okBtn_clicked()
63 {
64 Song *pSong = Hydrogen::get_instance()->getSong();
65
66 pSong->__name = songNameTxt->text();
67 pSong->__author = authorTxt->text();
68 pSong->set_notes( notesTxt->toPlainText() );
69 pSong->set_license( licenseTxt->text() );
70
71 accept();
72 }
73