~ubuntu-branches/ubuntu/lucid/kaptain/lucid

« back to all changes in this revision

Viewing changes to captain/kaptainwizard.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Bradley Bell
  • Date: 2001-11-30 11:25:19 UTC
  • Revision ID: james.westby@ubuntu.com-20011130112519-uw4jutplvr0h2mgx
Tags: upstream-0.6
Import upstream version 0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          kaptainwizard.cpp  -  description
 
3
                             -------------------
 
4
    begin                : Wed Sep 13 2000
 
5
    copyright            : (C) 2000 by Ter�k Zsolt
 
6
    email                : tz124@hszk.bme.hu
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
 
 
18
#include "kgrammar.h"
 
19
#include "kplace.h"
 
20
#include "krule.h"
 
21
#include "kaptainwizard.h"
 
22
 
 
23
#include <qlayout.h>
 
24
 
 
25
 
 
26
extern KGrammar * gr;
 
27
 
 
28
KaptainWizard::KaptainWizard(KRule * start, QWidget *parent, const char *name)
 
29
  : QWizard(parent, name, true)
 
30
{
 
31
  QWidget * myPage=0;
 
32
  QBoxLayout * myLayout;
 
33
  KRule * myRule;
 
34
  KPlace * myPlace;
 
35
 
 
36
  setCaption(start->getTitle());
 
37
 
 
38
  QValueList<int> pages=start->children();
 
39
  QValueListIterator<int> it;
 
40
  for (it=pages.begin(); it!=pages.end(); ++it)
 
41
  {
 
42
    myPage=new QWidget(this);
 
43
    myLayout=new QVBoxLayout(myPage, BORDER, SPACING);
 
44
    myRule=gr->getRule(*it);
 
45
    if (myRule)
 
46
    {
 
47
      myPlace=
 
48
        new KPlace(myRule, false, false,  false, false, false, myPage, myLayout, this, this, true, false);
 
49
      addPage(myPage, myRule->getTitle());
 
50
      setHelpEnabled (myPage, false);
 
51
      setFinishEnabled (myPage, false);
 
52
    }
 
53
  }
 
54
  if (myPage)
 
55
    setFinishEnabled ( myPage, true );
 
56
}
 
57
 
 
58
KaptainWizard::~KaptainWizard()
 
59
{
 
60
}