author | cniehaus <cniehaus> | 2002-09-17 16:56:50 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-09-17 16:56:50 (UTC) |
commit | 01b2fc89a105bf5b56bc1aa467343d14589dadd2 (patch) (side-by-side diff) | |
tree | 98cd116c8d1c8f91b5569da633225f1a5ed43b46 /noncore/apps | |
parent | d8a05881b58a51ee2bd3b6198cf0d0c0b3f3b56c (diff) | |
download | opie-01b2fc89a105bf5b56bc1aa467343d14589dadd2.zip opie-01b2fc89a105bf5b56bc1aa467343d14589dadd2.tar.gz opie-01b2fc89a105bf5b56bc1aa467343d14589dadd2.tar.bz2 |
Wow, Oxygen starts to become usable. The 2 added files are without any content
sofar, will start that tomorrow or so.
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.cpp | 27 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.h | 2 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxygen.cpp | 9 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxygen.pro | 2 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 16 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.h | 29 |
6 files changed, 82 insertions, 3 deletions
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp index c8492e5..7256777 100644 --- a/noncore/apps/oxygen/datawidgetui.cpp +++ b/noncore/apps/oxygen/datawidgetui.cpp @@ -4,36 +4,46 @@ * 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 "datawidgetui.h" #include <qstring.h> #include <qcombobox.h> #include <qlayout.h> +#include <qtable.h> +#include <qhbox.h> +#include <qlabel.h> dataWidgetUI::dataWidgetUI() : QDialog() { this->setCaption("Chemical Data"); QVBoxLayout *vbox = new QVBoxLayout( this ); dataCombo = new QComboBox( this ); - DataTable = new OxydataTable( 7,2, this ); + DataTable = new OxydataTable( 8,2, this ); DataTable->setShowGrid( false ); + DataTable->setHScrollBarMode(QScrollView::AlwaysOff); + + QHBox *hbox = new QHBox( this ); + left = new QLabel( hbox ); + middle = new QLabel( hbox ); + right = new QLabel( hbox ); vbox->addWidget( dataCombo ); + vbox->addWidget( hbox ); vbox->addWidget( DataTable ); DataTable->show(); dataCombo->show(); connect ( dataCombo, SIGNAL( activated(int) ), this, SLOT( slotShowData(int) ) ); Config test( "/home/opie/Settings/oxygendata", Config::File ); //read in all names of the 118 elements for ( int i = 1 ; i < 119 ; i++ ) { test.setGroup( QString::number( i ) ); @@ -50,36 +60,49 @@ void dataWidgetUI::createTableLayout(){ DataTable->horizontalHeader()->hide(); DataTable->verticalHeader()->hide(); DataTable->setTopMargin( 0 ); DataTable->setLeftMargin( 0 ); DataTable->setText( 0,0,"Weight:" ); DataTable->setText( 1,0,"Block" ); DataTable->setText( 2,0,"Group" ); DataTable->setText( 3,0,"Electronegativity" ); DataTable->setText( 4,0,"Atomic radius" ); DataTable->setText( 5,0,"Ionizationenergie" ); DataTable->setText( 6,0,"Density" ); - DataTable->setText( 7,0,"Boilingpoint" ); + DataTable->setText( 7,0, tr( "Boilingpoint" ) ); + DataTable->setText( 8,0, tr( "Meltingpoint" ) ); } void dataWidgetUI::slotShowData(int number){ Config test( "/home/opie/Settings/oxygendata", Config::File ); test.setGroup( QString::number( number+1 )); + + left->setText( test.readEntry( "Symbol" ) ); + middle->setText( test.readEntry( "Name" ) ); + right->setText( QString::number( number+1 ) ); + + QFont bf; + bf.setBold( true ); + bf.setPointSize( bf.pointSize()+2 ); + middle->setFont( bf ); + QString weight = test.readEntry( "Weight" ); DataTable->setText( 0,1,weight ); QString block = test.readEntry( "Block" ); DataTable->setText( 1,1,block ); QString grp = test.readEntry( "Group" ); DataTable->setText( 2,1,grp ); QString en = test.readEntry( "EN" ); DataTable->setText( 3,1,en ); QString ar = test.readEntry( "AR" ); DataTable->setText( 4,1,ar ) ; QString ion = test.readEntry( "IE" ); DataTable->setText( 5,1,ion ); QString dens = test.readEntry( "Density" ); DataTable->setText( 6,1,dens ); QString bp = test.readEntry( "BP" ); DataTable->setText( 7,1,bp ); + QString mp = test.readEntry( "MP" ); + DataTable->setText( 7,1,mp ); } diff --git a/noncore/apps/oxygen/datawidgetui.h b/noncore/apps/oxygen/datawidgetui.h index 9427adf..64599a7 100644 --- a/noncore/apps/oxygen/datawidgetui.h +++ b/noncore/apps/oxygen/datawidgetui.h @@ -3,28 +3,30 @@ * * * 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 "dataTable.h" #include <qdialog.h> class QTable; class QComboBox; +class QLabel; class dataWidgetUI : public QDialog { Q_OBJECT public: dataWidgetUI(); private: void createTableLayout(); OxydataTable *DataTable; QComboBox *dataCombo; + QLabel *left, *middle, *right; private slots: void slotShowData(int); }; diff --git a/noncore/apps/oxygen/oxygen.cpp b/noncore/apps/oxygen/oxygen.cpp index a9c2276..2574841 100644 --- a/noncore/apps/oxygen/oxygen.cpp +++ b/noncore/apps/oxygen/oxygen.cpp @@ -6,24 +6,25 @@ * ( at your option ) any later version. * * * **************************************************************************/ #include "oxygen.h" #include <qlabel.h> #include <qapplication.h> #include <qpushbutton.h> #include <qvbox.h> #include "calcdlg.h" #include "calcdlgui.h" #include "datawidgetui.h" +#include "psewidget.h" Oxygen::Oxygen() : QMainWindow() { this->setCaption( "Oxygen" ); vbox = new QVBox( this ); QPushButton *setButton = new QPushButton( "Settings", vbox ); connect ( setButton, SIGNAL( clicked() ), this, SLOT( slotSettings() ) ); QPushButton *dataButton = new QPushButton( "Data", vbox ); connect ( dataButton, SIGNAL( clicked() ), this, SLOT( slotData() ) ); QPushButton *calcButton = new QPushButton( "Calculations", vbox ); connect ( calcButton, SIGNAL( clicked() ), this, SLOT( slotCalculations() ) ); @@ -39,18 +40,24 @@ void Oxygen::close() QApplication::exit(); } //SLOTS void Oxygen::slotCalculations(){ calcDlgUI *CalcDlgUI = new calcDlgUI(); CalcDlgUI->show(); }; void Oxygen::slotData(){ dataWidgetUI *DataWidgetUI = new dataWidgetUI(); + DataWidgetUI->showMaximized(); DataWidgetUI->show(); }; void Oxygen::slotSettings(){ }; -void Oxygen::slotPSE(){ }; + +void Oxygen::slotPSE(){ + PSEWidget *pse = new PSEWidget(); + pse->showMaximized(); + pse->show(); +}; diff --git a/noncore/apps/oxygen/oxygen.pro b/noncore/apps/oxygen/oxygen.pro index 1bbeb94..c447330 100644 --- a/noncore/apps/oxygen/oxygen.pro +++ b/noncore/apps/oxygen/oxygen.pro @@ -1,24 +1,26 @@ TEMPLATE = app CONFIG = qt warn_on release HEADERS = oxygen.h \ kmolcalc.h \ kmolelements.h \ calcdlgui.h \ dataTable.h \ + psewidget.h \ datawidgetui.h SOURCES = main.cpp \ oxygen.cpp \ kmolcalc.cpp \ calcdlgui.cpp \ kmolelements.cpp \ dataTable.cpp \ + psewidget.cpp \ datawidgetui.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe INTERFACES = calcdlg.ui TARGET = oxygen DESTDIR = $(OPIEDIR)/bin TRANSLATIONS = ../../../i18n/de/oxygen.ts diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp new file mode 100644 index 0000000..66450be --- a/dev/null +++ b/noncore/apps/oxygen/psewidget.cpp @@ -0,0 +1,16 @@ +/*************************************************************************** + * * + * 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 "psewidget.h" + +PSEWidget::PSEWidget() : QWidget() +{ +} diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h new file mode 100644 index 0000000..ebdec94 --- a/dev/null +++ b/noncore/apps/oxygen/psewidget.h @@ -0,0 +1,29 @@ + +/*************************************************************************** + * * + * 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. * + * * + **************************************************************************/ +#ifndef _PSEWIDGET_H +#define _PSEWIDGET_H + +#include <qwidget.h> + +class QTable; +class QComboBox; +class QLabel; + + +class PSEWidget : public QWidget +{ + Q_OBJECT + + public: + PSEWidget(); + +}; + +#endif |