summaryrefslogtreecommitdiff
path: root/noncore/apps/oxygen
Side-by-side diff
Diffstat (limited to 'noncore/apps/oxygen') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/calcdlgui.cpp1
-rw-r--r--noncore/apps/oxygen/dataTable.cpp3
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp5
-rw-r--r--noncore/apps/oxygen/kmolcalc.cpp3
-rw-r--r--noncore/apps/oxygen/oxyframe.cpp2
-rw-r--r--noncore/apps/oxygen/oxygen.cpp2
-rw-r--r--noncore/apps/oxygen/psewidget.cpp2
7 files changed, 0 insertions, 18 deletions
diff --git a/noncore/apps/oxygen/calcdlgui.cpp b/noncore/apps/oxygen/calcdlgui.cpp
index f8dfde5..2bb8337 100644
--- a/noncore/apps/oxygen/calcdlgui.cpp
+++ b/noncore/apps/oxygen/calcdlgui.cpp
@@ -1,41 +1,40 @@
/***************************************************************************
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 "oxygen.h"
#include "calcdlgui.h"
#include "kmolcalc.h"
#include <qlineedit.h>
#include <qmultilineedit.h>
#include <qpushbutton.h>
calcDlgUI::calcDlgUI() : CalcDlg()
{
kmolcalc = new KMolCalc;
connect( calculate, SIGNAL( clicked() ), this, SLOT( calc() ) );
connect( clear_fields, SIGNAL( clicked() ), this, SLOT( clear() ) );
result->setReadOnly( true );
}
void calcDlgUI::calc()
{
QString compound( formula->text() );
if ( compound.isEmpty() ) {
clear();
return;
}
QString errors( kmolcalc->readFormula( compound ) );
QString mw, ea;
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp
index e3906be..48e2b20 100644
--- a/noncore/apps/oxygen/dataTable.cpp
+++ b/noncore/apps/oxygen/dataTable.cpp
@@ -1,52 +1,49 @@
/***************************************************************************
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 <qpe/config.h>
#include "dataTable.h"
-#include <qwidget.h>
#include <qhbox.h>
#include <qlabel.h>
-#include <qfont.h>
#include <qlayout.h>
#include <qpe/qpeapplication.h>
-#include <qstringlist.h>
OxydataWidget::OxydataWidget(QWidget *parent, const char *name, const QStringList &list ) : QWidget( parent,name ), names( list )
{
QGridLayout *qgrid = new QGridLayout( this, 2,1 );
QHBox *hbox = new QHBox( this );
left = new QLabel( hbox );
middle = new QLabel( hbox );
right = new QLabel( hbox );
right->setAlignment( AlignRight );
middle->setAlignment( AlignHCenter );
QFont bf;
bf.setBold( true );
bf.setPointSize( bf.pointSize()+2 );
middle->setFont( bf );
DataTable = new OxydataTable( 9,2, this );
setTable();
qgrid->addWidget( hbox,0,0 );
qgrid->addWidget( DataTable,1,0 );
}
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index e1d6e41..dcb80e5 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -1,51 +1,46 @@
/***************************************************************************
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(const QStringList &list) : QWidget()
{
names = list;
this->setCaption( tr( "Chemical Data" ));
QGridLayout *qgrid = new QGridLayout( this, 2,1 );
dataCombo = new QComboBox( this );
//read in all names of the 118 elements
int i = 0;
for ( QStringList::ConstIterator it = names.begin() ; it != names.end() ; ++it,i++)
{
dataCombo->insertItem( QString::number( i+1 )+" - "+*it );
}
OxydataWidget *oxyDW = new OxydataWidget(this, "OxydataWidget_oxyDW", names);
connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) );
oxyDW->setElement( 0 );
oxyDW->setLayout();
qgrid->addWidget( dataCombo, 0,0);
qgrid->addWidget( oxyDW , 1,0 );
}
diff --git a/noncore/apps/oxygen/kmolcalc.cpp b/noncore/apps/oxygen/kmolcalc.cpp
index 7a47942..b9f5209 100644
--- a/noncore/apps/oxygen/kmolcalc.cpp
+++ b/noncore/apps/oxygen/kmolcalc.cpp
@@ -1,41 +1,38 @@
/*
* kmolcalc.cpp
*
* Copyright (C) 2000,2001 Tomislav Gountchev <tomi@idiom.com>
* Copyright (C) 2002 Carsten Niehaus <cniehaus@handhelds.org>
*/
/**
* KMOLCALC is the calculation engine. It knows about a hashtable of user defined atomic
* weights and group definitions ELSTABLE, and the currently processed formula, stored
* as a list of elements and their coefficients, ELEMENTS.
*/
#include "kmolcalc.h"
-#include <qdict.h>
-#include <qdir.h>
-#include <qfile.h>
#include <qpe/qpeapplication.h>
/**
* Construct a new calculator object.
*/
KMolCalc::KMolCalc() {
elements = new ElementList;
elstable = NULL;
readElstable();
}
KMolCalc::~KMolCalc() {
delete elements;
}
void KMolCalc::readElstable() {
weight = -1; // not calculated yet
if (elstable) delete elstable;
elstable = new QDict<SubUnit> (197, TRUE);
elstable->setAutoDelete(TRUE);
mwfile = QPEApplication::qpeDir() +"share/oxygen/kmolweights";
QFile f(mwfile);
if (f.exists()) readMwfile(f);
diff --git a/noncore/apps/oxygen/oxyframe.cpp b/noncore/apps/oxygen/oxyframe.cpp
index 5a4dbbe..8cc520e 100644
--- a/noncore/apps/oxygen/oxyframe.cpp
+++ b/noncore/apps/oxygen/oxyframe.cpp
@@ -1,41 +1,39 @@
/***************************************************************************
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 "oxygen.h"
-#include <qpe/config.h>
#include "oxyframe.h"
OxyFrame::OxyFrame(QWidget *parent, const char *name, QString symbol )
: QLabel(parent,name)
{
N = name;
this->setFrameStyle( QFrame::Box );
this->setLineWidth( 0 );
this->setMidLineWidth( 1 );
this->setFrameShadow( QFrame::Sunken );
setMinimumSize(6,6);
setScaledContents( true );
QFont font;
font.setWeight(QFont::Light);
font.setPixelSize(3);
setFont( font );
setText( symbol );
}
void OxyFrame::mousePressEvent ( QMouseEvent* /*e*/ ){
emit num( N );
};
diff --git a/noncore/apps/oxygen/oxygen.cpp b/noncore/apps/oxygen/oxygen.cpp
index 5bdc2aa..5ea97bf 100644
--- a/noncore/apps/oxygen/oxygen.cpp
+++ b/noncore/apps/oxygen/oxygen.cpp
@@ -1,46 +1,44 @@
/***************************************************************************
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 "oxygen.h"
-#include <qapplication.h>
#include <qtabwidget.h>
-#include "calcdlg.h"
#include "calcdlgui.h"
#include "datawidgetui.h"
#include "psewidget.h"
Oxygen::Oxygen( QWidget *parent, const char *name, WFlags f) : QMainWindow( parent, name, f )
{
loadNames();
calcDlgUI *CalcDlgUI = new calcDlgUI();
PSEWidget *pse = new PSEWidget(names);
dataWidgetUI *DataWidgetUI = new dataWidgetUI(names);
setCaption( tr( "Oxygen" ) );
QTabWidget *tabw = new QTabWidget( this , "qtab" );
tabw->addTab( pse, tr( "PSE" ));
tabw->addTab( DataWidgetUI , tr( "Data" ) );
tabw->addTab( CalcDlgUI, tr( "Calculations" ) );
setCentralWidget( tabw );
}
void Oxygen::loadNames()
{
names.clear();
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp
index be5185b..7f7ae0c 100644
--- a/noncore/apps/oxygen/psewidget.cpp
+++ b/noncore/apps/oxygen/psewidget.cpp
@@ -1,48 +1,46 @@
/***************************************************************************
application: : Oxygen
begin : September 2002
copyright : ( C ) 2002, 2003 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 <qpe/config.h>
#include <qlayout.h>
#include <qpe/qpeapplication.h>
-#include <qlist.h>
#include "dataTable.h"
#include "psewidget.h"
-#include "oxyframe.h"
PSEWidget::PSEWidget(const QStringList &list) : QWidget()
{
this->setCaption( tr( "Periodic System" ) );
lastElement=1;
names = list;
QVBoxLayout *vlay = new QVBoxLayout( this );
QGridLayout *grid = new QGridLayout( 18,10 );
int h=0, v=0;
Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
for( int n = 0 ; n < 109 ; n++ )
{
configobj.setGroup( QString::number( n+1 ));
position( n+1,h,v );
PSEframe.append( new OxyFrame( this , QString::number(n), configobj.readEntry( "Symbol" ) ) );
grid->addWidget( PSEframe.current() , v/40+1 , h/40 );
PSEframe.current()->setMinimumHeight( 11 );
PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) );