moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / modes / textlabelwizard.cc
blob35bad8d8515eb62f59d0d312b1106a7f4c03f8ba
1 // Copyright (C) 2002 Dominique Devriese <devriese@kde.org>
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16 // 02111-1307, USA.
18 #include "textlabelwizard.h"
19 #include "textlabelwizard.moc"
21 #include "label.h"
22 #include "linkslabel.h"
24 #include <qtextedit.h>
25 #include <kapplication.h>
27 #include <qlayout.h>
29 TextLabelWizard::TextLabelWizard( QWidget* parent, TextLabelModeBase* mode )
30 : TextLabelWizardBase( parent, "TextLabelWizard", false ), mmode( mode )
32 connect( labelTextInput, SIGNAL( textChanged() ),
33 SLOT( textChanged() ) );
34 connect( myCustomWidget1, SIGNAL( linkClicked( int ) ),
35 SLOT( linkClicked( int ) ) );
36 connect( this, SIGNAL( helpClicked() ),
37 this, SLOT( slotHelpClicked() ) );
38 labelTextInput->setFocus();
41 TextLabelWizard::~TextLabelWizard()
45 void TextLabelWizard::back()
47 if ( currentPage() == select_arguments_page )
49 mmode->enterTextPageEntered();
51 TextLabelWizardBase::back();
54 void TextLabelWizard::next()
56 if ( currentPage() == enter_text_page )
58 mmode->selectArgumentsPageEntered();
60 TextLabelWizardBase::next();
63 void TextLabelWizard::reject()
65 TextLabelWizardBase::reject();
66 mmode->cancelPressed();
69 void TextLabelWizard::accept()
71 mmode->finishPressed();
74 void TextLabelWizard::textChanged()
76 mmode->labelTextChanged();
79 void TextLabelWizard::linkClicked( int which )
81 mmode->linkClicked( which );
84 void TextLabelWizard::relayoutArgsPage()
86 select_arguments_pageLayout->activate();
87 repaint();
90 void TextLabelWizard::slotHelpClicked()
92 kapp->invokeHelp( QString::fromLatin1( "text-labels" ),
93 QString::fromLatin1( "kig" ) );