Subversion Repositories public

Rev

Rev 50 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 50 Rev 52
Line 1... Line 1...
1
/***************************************************************************
1
/***************************************************************************
2
 *   Copyright (C) 2007 by Andreas Theofilu   *
2
 *   Copyright (C) 2007 by Andreas Theofilu                                *
3
 *   andreas@TheoSys.at   *
3
 *   andreas@TheoSys.at                                                    *
4
 *                                                                         *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation; either version 2 of the License, or     *
7
 *   the Free Software Foundation version 3 of the License.                *
8
 *   (at your option) any later version.                                   *
-
 
9
 *                                                                         *
8
 *                                                                         *
10
 *   This program is distributed in the hope that it will be useful,       *
9
 *   This program is distributed in the hope that it will be useful,       *
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
 *   GNU General Public License for more details.                          *
12
 *   GNU General Public License for more details.                          *
Line 27... Line 26...
27
#include <qstring.h>
26
#include <qstring.h>
28
#include <qfile.h>
27
#include <qfile.h>
29
#include <qdir.h>
28
#include <qdir.h>
30
#include <qlistview.h>
29
#include <qlistview.h>
31
 
30
 
32
#include <iostream.h>
31
//#include <iostream.h>
33
 
32
 
34
#include "ziaendwidget.h"
33
#include "ziaendwidget.h"
35
#include "tilgplan.h"
34
#include "tilgplan.h"
36
#include "helper.h"
35
#include "helper.h"
37
 
36
 
Line 52... Line 51...
52
	kListView_Table->setColumnAlignment(2, Qt::AlignRight);
51
	kListView_Table->setColumnAlignment(2, Qt::AlignRight);
53
	kListView_Table->setColumnWidth(3, 60);
52
	kListView_Table->setColumnWidth(3, 60);
54
	kListView_Table->setColumnAlignment(3, Qt::AlignCenter);
53
	kListView_Table->setColumnAlignment(3, Qt::AlignCenter);
55
	kListView_Table->setColumnWidth(4, 60);
54
	kListView_Table->setColumnWidth(4, 60);
56
	kListView_Table->setColumnAlignment(4, Qt::AlignCenter);
55
	kListView_Table->setColumnAlignment(4, Qt::AlignCenter);
-
 
56
	kListView_Table->setSortColumn(0);
57
 
57
 
58
	hdir.append("/.zinsaend.dat");
58
	hdir.append("/.zinsaend.dat");
59
	zaf.setName(hdir);
59
	zaf.setName(hdir);
60
 
60
 
61
	if (zaf.open(IO_ReadOnly) != FALSE)
61
	if (zaf.open(IO_ReadOnly) != FALSE)
Line 69... Line 69...
69
	      sprintf (prz, "%.3f", Zi.Zins);
69
	      sprintf (prz, "%.3f", Zi.Zins);
70
	      sprintf (rate, "%.2f", Zi.NewRate);
70
	      sprintf (rate, "%.2f", Zi.NewRate);
71
	      rv[0] = (Zi.FixRate) ? 'F' : 'N';
71
	      rv[0] = (Zi.FixRate) ? 'F' : 'N';
72
	      ber[0] = (Zi.Rate) ? 'B' : 'N';
72
	      ber[0] = (Zi.Rate) ? 'B' : 'N';
73
	      rv[1] = ber[1] = 0;
73
	      rv[1] = ber[1] = 0;
74
cout << datum << ", " << prz << ", " << rate << ", " << rv << ", " << ber << endl;
-
 
-
 
74
 
75
	      QListViewItem *element = new QListViewItem(kListView_Table, i18n(datum), i18n(prz), i18n(rate), i18n(rv), i18n(ber));
75
	      QListViewItem *element = new QListViewItem(kListView_Table, QString(datum), QString(prz), QString(rate), QString(rv), QString(ber));
76
	      kListView_Table->insertItem(element);
76
	      kListView_Table->insertItem(element);
77
 	   }
77
 	   }
78
 
78
 
79
	   zaf.close();
79
	   zaf.close();
80
	}
80
	}
Line 140... Line 140...
140
	{
140
	{
141
	   item = kListView_Table->itemAtIndex(i);
141
	   item = kListView_Table->itemAtIndex(i);
142
	   Zi.Datum = get_date ((char *)item->text(0).ascii());
142
	   Zi.Datum = get_date ((char *)item->text(0).ascii());
143
	   Zi.Zins = item->text(1).toDouble();
143
	   Zi.Zins = item->text(1).toDouble();
144
	   Zi.NewRate = item->text(2).toDouble();
144
	   Zi.NewRate = item->text(2).toDouble();
145
	   Zi.Rate = (!strcmp(item->text(3).ascii(), "N")) ? 0 : 1;
145
	   Zi.FixRate = (!strcmp(item->text(3).ascii(), "N")) ? 0 : 1;
146
	   Zi.FixRate = (!strcmp(item->text(4).ascii(), "N")) ? 0 : 1;
146
	   Zi.Rate = (!strcmp(item->text(4).ascii(), "N")) ? 0 : 1;
147
 
147
 
148
	   write (fd, &Zi, sizeof(ZIAEND));
148
	   write (fd, &Zi, sizeof(ZIAEND));
149
	}
149
	}
150
 
150
 
151
	zaf.close ();
151
	zaf.close ();