summaryrefslogtreecommitdiffstats
path: root/src/projects/k3bdatavolumedescwidget.cpp
blob: be443a57c8073143aa7f89d9075a164051b051f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* 
 *
 * $Id: k3bdatavolumedescwidget.cpp 619556 2007-01-03 17:38:12Z trueg $
 * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
 *
 * This file is part of the K3b project.
 * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
 *
 * 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.
 * See the file "COPYING" for the exact licensing terms.
 */

#include "k3bdatavolumedescwidget.h"

#include "k3bisooptions.h"
#include <k3bvalidators.h>

#include <tqlineedit.h>
#include <tqspinbox.h>
#include <tqlabel.h>
#include <tqtoolbutton.h>


K3bDataVolumeDescWidget::K3bDataVolumeDescWidget( TQWidget* tqparent, const char* name )
  : base_K3bDataVolumeDescWidget( tqparent, name )
{
  // the maximal number of characters that can be inserted are set in the ui file!

  TQValidator* isoValidator = new K3bLatin1Validator( TQT_TQOBJECT(this) );

  m_editVolumeName->setValidator( isoValidator );
  m_editVolumeSetName->setValidator( isoValidator );
  m_editPublisher->setValidator( isoValidator );
  m_editPreparer->setValidator( isoValidator );
  m_editSystem->setValidator( isoValidator );
  m_editApplication->setValidator( isoValidator );

  connect( m_spinVolumeSetSize, TQT_SIGNAL(valueChanged(int)),
	   this, TQT_SLOT(slotVolumeSetSizeChanged(int)) );

  // for now we hide the volume set size stuff since it's not working anymore in mkisofs 2.01a34
  textLabel1->hide();
  textLabel2->hide();
  m_spinVolumeSetSize->hide();
  m_spinVolumeSetNumber->hide();

  // FIXME: show the buttons and allow the selection of a file from the project
  m_buttonFindAbstract->hide();
  m_buttonFindCopyright->hide();
  m_buttonFindBiblio->hide();
}


K3bDataVolumeDescWidget::~K3bDataVolumeDescWidget()
{
}


void K3bDataVolumeDescWidget::load( const K3bIsoOptions& o )
{
  m_editVolumeName->setText( o.volumeID() );
  m_editVolumeSetName->setText( o.volumeSetId() );
  m_spinVolumeSetSize->setValue( o.volumeSetSize() );
  m_spinVolumeSetNumber->setValue( o.volumeSetNumber() );
  m_editPublisher->setText( o.publisher() );
  m_editPreparer->setText( o.preparer() );
  m_editSystem->setText( o.systemId() );
  m_editApplication->setText( o.applicationID() );
}


void K3bDataVolumeDescWidget::save( K3bIsoOptions& o )
{
  o.setVolumeID( m_editVolumeName->text() );
  o.setVolumeSetId( m_editVolumeSetName->text() );
  o.setVolumeSetSize( 1/*m_spinVolumeSetSize->value() */);
  o.setVolumeSetNumber( 1/*m_spinVolumeSetNumber->value() */);
  o.setPublisher( m_editPublisher->text() );
  o.setPreparer( m_editPreparer->text() );
  o.setSystemId( m_editSystem->text() );
  o.setApplicationID( m_editApplication->text() );
}


void K3bDataVolumeDescWidget::slotVolumeSetSizeChanged( int i )
{
  m_spinVolumeSetNumber->setMaxValue( i );
}

#include "k3bdatavolumedescwidget.moc"