Exemple #1
0
/**
 * Constructor. Sets up the wizard and loads the wizard pages.
 * Each wizard page has its own class.
 * @param doc   the UML document
 */
ClassWizard::ClassWizard(UMLDoc* doc)
    : QWizard( (QWidget*)doc->parent())
{
    m_doc = doc;
    //create a unique class to start with
    UMLObject * pTemp = 0;
    QString name = i18n("new_class");
    QString newName = name;
    QString num;
    int i = 0;
    m_pClass = new UMLClassifier( newName );
    do {
        m_pClass->setName( newName );
        pTemp = m_doc->findUMLObject( newName );
        num.setNum( ++i);
        newName = name;
        newName.append("_").append( num );
    } while( pTemp );

    setWizardStyle(QWizard::ModernStyle);
    setPixmap(QWizard::LogoPixmap, Icon_Utils::UserIcon(Icon_Utils::it_Code_Gen_Wizard));
    setWindowTitle(i18n("Class Wizard"));
    setOption(QWizard::NoBackButtonOnStartPage, true);
    setOption(QWizard::HaveHelpButton, true);
    connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));

    addPage(createGeneralPage());
    addPage(createAttributesPage());
    addPage(createOperationsPage());
}
Preferences::Preferences(QWidget *w) : Q3TabDialog(w, "Preferences", FALSE, Qt::WDestructiveClose)
{
  helpFile = "preferences.html";

  setCaption(tr("Edit Prefs"));

  loadSettings();
  createGeneralPage();
  createColorPage();
  createFontPage();
  createMTPage(); // main tool bar
  createCTPage(); // chart tool bar
  createETPage(); // extra tool bar

  setApplyButton(tr("&Apply"));
  connect(this, SIGNAL(applyButtonPressed()), this, SLOT(slotSave()));

  setCancelButton(tr("&Ok"));
  //connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(exitDialog()));

  setOkButton(QString::null);

  setHelpButton();
  QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(slotHelp()));
  resize(sz);

}