Logo Search packages:      
Sourcecode: kalcul version File versions  Download package

Kalcul::Kalcul (  ) 

Default Constructor

Definition at line 50 of file kalcul.cpp.

    : KMainWindow( 0, "Kalcul" ),
      m_view(new KalculView(this)),
      m_printer(0),
      exerciseDialog(new ExerciseDialog(this)),
      levelEditor(new LevelEditor(this))
{
    // accept dnd
    setAcceptDrops(true);

    // tell the KMainWindow that this is indeed the main widget
    setCentralWidget(m_view);
    
    // and a status bar
    statusBar()->show();

    // then, setup our actions
    setupActions();
    
    // apply the saved mainwindow settings, if any, and ask the mainwindow
    // to automatically save settings if changed: window size, toolbar
    // position, icon size, etc.
    setAutoSaveSettings();

    // allow the view to change the statusbar and caption
    connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)),
            this,   SLOT(changeStatusbar(const QString&)));
    connect(m_view, SIGNAL(signalChangeCaption(const QString&)),
            this,   SLOT(changeCaption(const QString&)));
    changeStatusbar( i18n("User: %1").arg(Settings::nameLine() ));

    //TODO: can this be done with less connects?
    connect(exerciseDialog, SIGNAL(signalPracticeAddition()), this, SLOT(practiceAddition()));
    connect(exerciseDialog, SIGNAL(signalPracticeSubtraction()), this, SLOT(practiceSubtraction()));
    connect(exerciseDialog, SIGNAL(signalPracticeMultiplication()), this, SLOT(practiceMultiplication()));
    connect(exerciseDialog, SIGNAL(signalPracticeDivision()), this, SLOT(practiceDivision()));

    connect(exerciseDialog, SIGNAL(setLevel(const QString&)), m_view, SLOT(setLevel(const QString&)));
}


Generated by  Doxygen 1.6.0   Back to index