summaryrefslogtreecommitdiff
path: root/noncore/apps/oxygen/datawidgetui.cpp
blob: 99c4fd7d89cf9366a4519e0fee435ae69b6c8571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/***************************************************************************
   application:             : Oxygen

   begin                    : September 2002
   copyright                : ( C ) 2002 by Carsten Niehaus
   email                    : cniehaus@handhelds.org
 **************************************************************************/

/***************************************************************************
 *                                                                         *
 * This program is free software; you can redistribute it and/or modify    *
 * it under the terms of the GNU General Public License as published by    *
 * the Free Software Foundation; either version 2 of the License, or       *
 * ( at your option ) any later version.                                   *
 *                                                                         *
 **************************************************************************/

#include "datawidgetui.h"
#include "dataTable.h"

#include <qpe/config.h>
#include <qstring.h>
#include <qcombobox.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qlabel.h>
#include <qpe/qpeapplication.h>

dataWidgetUI::dataWidgetUI() : QWidget()
{
    this->setCaption( tr( "Chemical Data" ));
    QGridLayout *qgrid = new QGridLayout( this, 2,1 );
    
    dataCombo = new QComboBox( this );
    
    //read in all names of the 118 elements
    Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
    for ( int i = 1 ; i < 119 ; i++ )
    {
        configobj.setGroup( QString::number( i ) );
        QString foo = configobj.readEntry( "Name" );
        dataCombo->insertItem( QString::number( i )+" - "+foo );
    }
    
    OxydataWidget *oxyDW = new OxydataWidget(this);
    connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) );
    oxyDW->setElement( 0 );
    oxyDW->setLayout();

    qgrid->addWidget(  dataCombo, 0,0);
    qgrid->addWidget(  oxyDW , 1,0 );
}