summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-gutenbrowser/editTitle.cpp
blob: 100370c7abda4ebbfa581bf44aa872a8694d8db5 (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
/****************************************************************************
** Created: Thu Jan 24 08:47:37 2002
    copyright            : (C) 2000 -2004 by llornkcor
    email                : ljp@llornkcor.com
****************************************************************************/
#include "editTitle.h"

#include <qlineedit.h>
#include <qpushbutton.h>

Edit_Title::Edit_Title( QWidget* parent,  const char* name, bool modal, WFlags fl)
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
  setName( "Edit_Title" );
    resize( 240, 110 ); 
    setMaximumSize( QSize( 240, 110 ) );
    setCaption( tr( "Edit Title" ) );

    LineEdit1 = new QLineEdit( this, "LineEdit1" );
    LineEdit1->setGeometry( QRect( 5, 22, 230, 22 ) );
    newTitle=name;
    LineEdit1->setText(newTitle);
    
    PushButton_Cancel = new QPushButton( this, "PushButton_Cancel" );
    PushButton_Cancel->setGeometry( QRect( 180, 80, 50, 20 ) ); 
    PushButton_Cancel->setText( tr( "Cancel" ) );

    PushButton_Apply = new QPushButton( this, "PushButton_Apply" );
    PushButton_Apply->setGeometry( QRect( 120, 80, 50, 20 ) );
    
    PushButton_Apply->setText( tr( "Apply" ) );

    // signals and slots connections
    connect( PushButton_Cancel, SIGNAL( released() ),this, SLOT( onCancel() ) );
    connect( PushButton_Apply, SIGNAL( released() ), this, SLOT( onApply() ) );
}

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

void Edit_Title::onCancel() {
    reject();
}

void Edit_Title::onApply() {
  newTitle= LineEdit1->text();
  accept();
}