summaryrefslogtreecommitdiffstats
path: root/libk9copy/progress.cpp
blob: f7111fd4549afd3c8893bd6ae3992384d47159d5 (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
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './progress.ui'
**
** Created: dim. oct. 26 08:55:59 2008
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "progress.h"

#include <tqvariant.h>
#include <tqlabel.h>
#include <kpushbutton.h>
#include <kprogress.h>
#include <layout.h>
#include <tqtooltip.h>
#include <tqwhatsthis.h>
#include "kpushbutton.h"
#include "kprogress.h"

/*
 *  Constructs a Progress as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
Progress::Progress( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "Progress" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setMinimumSize( TQSize( 0, 0 ) );
    setCursor( TQCursor( 3 ) );
    setMouseTracking( FALSE );
    ProgressLayout = new TQGridLayout( this, 1, 1, 11, 6, "ProgressLayout"); 

    lblTitle = new TQLabel( this, "lblTitle" );
    lblTitle->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, lblTitle->sizePolicy().hasHeightForWidth() ) );
    TQFont lblTitle_font(  lblTitle->font() );
    lblTitle_font.setBold( TRUE );
    lblTitle->setFont( lblTitle_font ); 
    lblTitle->setCursor( TQCursor( 3 ) );

    ProgressLayout->addMultiCellWidget( lblTitle, 0, 0, 0, 2 );

    bCancel = new KPushButton( this, "bCancel" );
    bCancel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, bCancel->sizePolicy().hasHeightForWidth() ) );
    bCancel->setCursor( TQCursor( 0 ) );
    bCancel->setProperty( "stdItem", 26 );

    ProgressLayout->addWidget( bCancel, 6, 2 );
    spacer1 = new TQSpacerItem( 161, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    ProgressLayout->addMultiCell( spacer1, 6, 6, 0, 1 );

    ProgressBar = new KProgress( this, "ProgressBar" );
    ProgressBar->setCursor( TQCursor( 3 ) );

    ProgressLayout->addMultiCellWidget( ProgressBar, 4, 4, 0, 2 );
    spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Fixed );
    ProgressLayout->addItem( spacer2, 5, 1 );

    image = new TQLabel( this, "image" );
    image->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 0, image->sizePolicy().hasHeightForWidth() ) );
    image->setMinimumSize( TQSize( 0, 250 ) );
    image->setPaletteBackgroundColor( TQColor( 0, 0, 0 ) );
    image->setFrameShape( TQLabel::NoFrame );
    image->setFrameShadow( TQLabel::Plain );
    image->setAlignment( int( TQLabel::AlignCenter ) );

    ProgressLayout->addMultiCellWidget( image, 1, 1, 0, 2 );

    textLabel1 = new TQLabel( this, "textLabel1" );
    textLabel1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, textLabel1->sizePolicy().hasHeightForWidth() ) );
    textLabel1->setCursor( TQCursor( 3 ) );

    ProgressLayout->addWidget( textLabel1, 2, 0 );

    lblElapsed = new TQLabel( this, "lblElapsed" );
    lblElapsed->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, lblElapsed->sizePolicy().hasHeightForWidth() ) );
    lblElapsed->setCursor( TQCursor( 3 ) );

    ProgressLayout->addMultiCellWidget( lblElapsed, 2, 2, 1, 2 );

    LabelText = new TQLabel( this, "LabelText" );
    LabelText->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, LabelText->sizePolicy().hasHeightForWidth() ) );
    TQFont LabelText_font(  LabelText->font() );
    LabelText_font.setItalic( TRUE );
    LabelText->setFont( LabelText_font ); 
    LabelText->setCursor( TQCursor( 3 ) );
    LabelText->setAlignment( int( TQLabel::AlignVCenter ) );

    ProgressLayout->addMultiCellWidget( LabelText, 3, 3, 0, 2 );
    languageChange();
    resize( TQSize(473, 467).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( bCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( bCancelClick() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void Progress::languageChange()
{
    setCaption( tr2i18n( "k9Copy" ) );
    lblTitle->setText( TQString() );
    textLabel1->setText( tr2i18n( "Elapsed Time" ) );
    lblElapsed->setText( TQString() );
    LabelText->setText( TQString() );
}

void Progress::bCancelClick()
{
    qWarning( "Progress::bCancelClick(): Not implemented yet" );
}

#include "progress.moc"