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

Kalzium::Kalzium (  )

Default Constructor

Definition at line 81 of file kalzium.cpp.

References GlossaryDialog::addGlossary(), KalziumElementProperty::instance(), KalziumDataObject::instance(), openInformationDialog(), PeriodicTableView::pseScene(), Glossary::setBackgroundPicture(), Glossary::setName(), KalziumDataObject::setSearch(), setupActions(), and setupSidebars().

                 : KXmlGuiWindow( 0 )
{
    setObjectName( "KalziumMainWindow" );

    // adding the libkdeedu catalog
    KGlobal::locale()->insertCatalog( "libkdeedu" );

    // reading the elements from file
    KalziumDataObject::instance();

    Search *newsearch = new Search();
    KalziumDataObject::instance()->setSearch( newsearch );

    m_infoDialog = 0;
    m_toolboxCurrent = 0;
    m_exportDialog = 0;

    // Main pse-Table Tablewidget
    QWidget *pseTempWidget = new QWidget(this);
    QVBoxLayout *layout = new QVBoxLayout( pseTempWidget );
    layout->setMargin( 0 );
    layout->setSpacing( 2 );

    SearchWidget *searchWidget = new SearchWidget( pseTempWidget );
    searchWidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum));

    // Creating the periodic table
    m_periodicTable = new PeriodicTableView( pseTempWidget );

    // Connecting the search to the periodic table
    connect( newsearch, SIGNAL( searchChanged() ),
             KalziumElementProperty::instance(), SIGNAL( propertyChanged() ) );
    connect( newsearch, SIGNAL( searchReset() ),
             KalziumElementProperty::instance(), SIGNAL( propertyChanged() ) );

    layout->addWidget( searchWidget );
    layout->addWidget( m_periodicTable );

    setCentralWidget(pseTempWidget);

    connect(m_periodicTable->pseScene(), SIGNAL(elementChanged(int)), this, SLOT(openInformationDialog(int)));
    connect(m_periodicTable->pseScene(), SIGNAL(elementHovered(int)), this, SLOT(elementHover(int)));
    connect(this, SIGNAL(numerationChanged(int)),  m_periodicTable, SIGNAL(numerationChange(int)));

    // layouting
    setupSidebars();
    setupActions();

    // creating the glossary dialog and loading the glossaries we have
    m_glossarydlg = new GlossaryDialog( this );
    m_glossarydlg->setObjectName( QLatin1String( "glossary" ) );
    QString dir = KGlobal::dirs()->findResourceDir( "data", "kalzium/data/" );
    QString picturepath = dir + "kalzium/data/bg.jpg";
    KUrl u = KUrl::fromPath( dir + "kalzium/data/knowledge.xml" );
    Glossary *g = new Glossary( u );
    g->setName( i18n( "Knowledge" ) );
    g->setBackgroundPicture( picturepath );
    m_glossarydlg->addGlossary( g, true );
    u = KUrl::fromPath( dir + "kalzium/data/tools.xml" );
    g = new Glossary( u, dir + "kalzium/data/toolpics/" );
    g->setName( i18n( "Tools" ) );
    g->setBackgroundPicture( picturepath );
    m_glossarydlg->addGlossary( g, true );

    setupStatusBar();
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index