summaryrefslogtreecommitdiffstats
path: root/k9author/newTitle.cpp
blob: e8856f25a6d57759b6f43c5c19da19cf3364c44a (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#include <tdelocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './newTitle.ui'
**
** Created: dim. oct. 26 08:56:29 2008
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "newTitle.h"

#include <tqvariant.h>
#include <tqpushbutton.h>
#include <tqbuttongroup.h>
#include <knuminput.h>
#include <ktimewidget.h>
#include <tqradiobutton.h>
#include <kpushbutton.h>
#include <tqlabel.h>
#include <kurlrequester.h>
#include <tqlayout.h>
#include <tqtooltip.h>
#include <tqwhatsthis.h>
#include "knuminput.h"
#include "ktimewidget.h"
#include "kpushbutton.h"
#include "kurlrequester.h"
#include "klineedit.h"

/*
 *  Constructs a newTitle as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
newTitle::newTitle( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "newTitle" );
    newTitleLayout = new TQGridLayout( this, 1, 1, 11, 6, "newTitleLayout"); 

    buttonGroup1 = new TQButtonGroup( this, "buttonGroup1" );
    buttonGroup1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, buttonGroup1->sizePolicy().hasHeightForWidth() ) );
    buttonGroup1->setColumnLayout(0, Qt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 11 );
    buttonGroup1Layout = new TQGridLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    nbChapters = new KIntNumInput( buttonGroup1, "nbChapters" );
    nbChapters->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, nbChapters->sizePolicy().hasHeightForWidth() ) );
    nbChapters->setMinValue( 1 );
    nbChapters->setMaxValue( 99 );

    buttonGroup1Layout->addWidget( nbChapters, 0, 1 );

    twLength = new KTimeWidget( buttonGroup1, "twLength" );
    twLength->setEnabled( FALSE );
    twLength->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, twLength->sizePolicy().hasHeightForWidth() ) );

    buttonGroup1Layout->addWidget( twLength, 1, 1 );

    rbNumber = new TQRadioButton( buttonGroup1, "rbNumber" );
    rbNumber->setChecked( TRUE );

    buttonGroup1Layout->addWidget( rbNumber, 0, 0 );

    rbLength = new TQRadioButton( buttonGroup1, "rbLength" );

    buttonGroup1Layout->addWidget( rbLength, 1, 0 );
    spacer1 = new TQSpacerItem( 131, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    buttonGroup1Layout->addMultiCell( spacer1, 0, 1, 2, 2 );

    newTitleLayout->addMultiCellWidget( buttonGroup1, 1, 1, 0, 1 );
    spacer3 = new TQSpacerItem( 21, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    newTitleLayout->addItem( spacer3, 3, 0 );
    spacer4 = new TQSpacerItem( 16, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    newTitleLayout->addItem( spacer4, 1, 2 );

    bAdd = new KPushButton( this, "bAdd" );
    bAdd->setEnabled( FALSE );
    bAdd->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, bAdd->sizePolicy().hasHeightForWidth() ) );
    bAdd->setProperty( "stdItem", 27 );

    newTitleLayout->addWidget( bAdd, 2, 1 );
    spacer2 = new TQSpacerItem( 470, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    newTitleLayout->addItem( spacer2, 2, 0 );

    layout1 = new TQHBoxLayout( 0, 0, 6, "layout1"); 

    textLabel1 = new TQLabel( this, "textLabel1" );
    textLabel1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
    layout1->addWidget( textLabel1 );

    urFile = new KURLRequester( this, "urFile" );
    urFile->setMode( 25 );
    layout1->addWidget( urFile );

    lTotalTime = new TQLabel( this, "lTotalTime" );
    lTotalTime->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, lTotalTime->sizePolicy().hasHeightForWidth() ) );
    layout1->addWidget( lTotalTime );

    newTitleLayout->addMultiCellLayout( layout1, 0, 0, 0, 1 );
    languageChange();
    resize( TQSize(605, 171).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( urFile, TQT_SIGNAL( urlSelected(const TQString&) ), this, TQT_SLOT( fileSelected(const TQString&) ) );
    connect( rbNumber, TQT_SIGNAL( clicked() ), this, TQT_SLOT( rbNumberClicked() ) );
    connect( rbLength, TQT_SIGNAL( clicked() ), this, TQT_SLOT( rbLengthClicked() ) );
    connect( bAdd, TQT_SIGNAL( clicked() ), this, TQT_SLOT( bAddClicked() ) );
}

/*
 *  Destroys the object and frees any allocated resources
 */
newTitle::~newTitle()
{
    // no need to delete child widgets, TQt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void newTitle::languageChange()
{
    setCaption( tr2i18n( "Add title" ) );
    buttonGroup1->setTitle( TQString() );
    rbNumber->setText( tr2i18n( "number of chapters" ) );
    rbLength->setText( tr2i18n( "chapter length" ) );
    bAdd->setText( tr2i18n( "Add" ) );
    bAdd->setAccel( TQKeySequence( TQString() ) );
    textLabel1->setText( tr2i18n( "Video file" ) );
    lTotalTime->setText( tr2i18n( "--:--:--" ) );
}

void newTitle::fileSelected(const TQString&)
{
    tqWarning( "newTitle::fileSelected(const TQString&): Not implemented yet" );
}

void newTitle::rbNumberClicked()
{
    tqWarning( "newTitle::rbNumberClicked(): Not implemented yet" );
}

void newTitle::rbLengthClicked()
{
    tqWarning( "newTitle::rbLengthClicked(): Not implemented yet" );
}

void newTitle::bAddClicked()
{
    tqWarning( "newTitle::bAddClicked(): Not implemented yet" );
}

#include "newTitle.moc"