[rkward-cvs] SF.net SVN: rkward: [2204] branches/KDE4_port/rkward/dataeditor

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Nov 12 16:05:39 UTC 2007


Revision: 2204
          http://rkward.svn.sourceforge.net/rkward/?rev=2204&view=rev
Author:   tfry
Date:     2007-11-12 08:05:39 -0800 (Mon, 12 Nov 2007)

Log Message:
-----------
dataeditor cleanups

Modified Paths:
--------------
    branches/KDE4_port/rkward/dataeditor/CMakeLists.txt
    branches/KDE4_port/rkward/dataeditor/editformatdialog.cpp
    branches/KDE4_port/rkward/dataeditor/editformatdialog.h
    branches/KDE4_port/rkward/dataeditor/editlabelsdialog.cpp
    branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp
    branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.cpp
    branches/KDE4_port/rkward/dataeditor/twintable.cpp
    branches/KDE4_port/rkward/dataeditor/twintable.h
    branches/KDE4_port/rkward/dataeditor/twintablemember.cpp
    branches/KDE4_port/rkward/dataeditor/twintablemember.h

Removed Paths:
-------------
    branches/KDE4_port/rkward/dataeditor/rkdrag.cpp
    branches/KDE4_port/rkward/dataeditor/rkdrag.h
    branches/KDE4_port/rkward/dataeditor/twintabledatamember.cpp
    branches/KDE4_port/rkward/dataeditor/twintabledatamember.h
    branches/KDE4_port/rkward/dataeditor/twintablemetamember.cpp
    branches/KDE4_port/rkward/dataeditor/twintablemetamember.h

Modified: branches/KDE4_port/rkward/dataeditor/CMakeLists.txt
===================================================================
--- branches/KDE4_port/rkward/dataeditor/CMakeLists.txt	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/CMakeLists.txt	2007-11-12 16:05:39 UTC (rev 2204)
@@ -6,11 +6,8 @@
 SET(dataeditor_STAT_SRCS
    twintable.cpp
    twintablemember.cpp
-   rkdrag.cpp
    rkeditor.cpp
    rkeditordataframe.cpp
-   twintabledatamember.cpp
-   twintablemetamember.cpp
    celleditor.cpp
    editlabelsdialog.cpp
    editformatdialog.cpp

Modified: branches/KDE4_port/rkward/dataeditor/editformatdialog.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/editformatdialog.cpp	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/editformatdialog.cpp	2007-11-12 16:05:39 UTC (rev 2204)
@@ -16,7 +16,8 @@
  ***************************************************************************/
 #include "editformatdialog.h"
 
-#include <q3buttongroup.h>
+#include <QButtonGroup>
+#include <QGroupBox>
 #include <qradiobutton.h>
 #include <qspinbox.h>
 #include <qstringlist.h>
@@ -35,31 +36,33 @@
 
 	KVBox *vbox = new KVBox ();
 	setMainWidget (vbox);
-	
-	alignment_group = new Q3ButtonGroup (i18n ("Alignment"), vbox);
-	alignment_group->setColumnLayout (0, Qt::Vertical);
-	alignment_group->layout()->setSpacing (RKGlobals::spacingHint ());
-	alignment_group->layout()->setMargin (RKGlobals::marginHint ());
-	QVBoxLayout *group_layout = new QVBoxLayout (alignment_group->layout());
+
+	alignment_group = new QButtonGroup (this);
+	QGroupBox* alignment_box = new QGroupBox (i18n ("Alignment"), vbox);
+	QVBoxLayout* group_layout = new QVBoxLayout (alignment_box);
 	group_layout->setContentsMargins (0, 0, 0, 0);
-	group_layout->addWidget (new QRadioButton (i18n ("Default"), alignment_group));
-	group_layout->addWidget (new QRadioButton (i18n ("Left"), alignment_group));
-	group_layout->addWidget (new QRadioButton (i18n ("Right"), alignment_group));
-	alignment_group->setButton ((int) RKVariable::FormattingOptions::AlignDefault);
+	QRadioButton* button;
+	alignment_group->addButton (button = new QRadioButton (i18n ("Default"), alignment_box), (int) RKVariable::FormattingOptions::AlignDefault);
+	group_layout->addWidget (button);
+	alignment_group->addButton (button = new QRadioButton (i18n ("Left"), alignment_box), (int) RKVariable::FormattingOptions::AlignLeft);
+	group_layout->addWidget (button);
+	alignment_group->addButton (button = new QRadioButton (i18n ("Right"), alignment_box), (int) RKVariable::FormattingOptions::AlignRight);
+	group_layout->addWidget (button);
+	alignment_group->button ((int) RKVariable::FormattingOptions::AlignDefault)->setChecked (true);
 
-	precision_group = new Q3ButtonGroup (i18n ("Decimal Places"), vbox);
-	precision_group->setColumnLayout (0, Qt::Vertical);
-	precision_group->layout()->setSpacing (RKGlobals::spacingHint ());
-	precision_group->layout()->setMargin (RKGlobals::marginHint ());
-	group_layout = new QVBoxLayout (precision_group->layout());
-	group_layout->setContentsMargins (0, 0, 0, 0);
-	group_layout->addWidget (new QRadioButton (i18n ("Default setting"), precision_group));
-	group_layout->addWidget (new QRadioButton (i18n ("As required"), precision_group));
-	group_layout->addWidget (new QRadioButton (i18n ("Fixed precision:"), precision_group));
-	precision_field = new QSpinBox (0, 10, 1, precision_group);
+	precision_group = new QButtonGroup (this);
+	QGroupBox* precision_box = new QGroupBox (i18n ("Decimal Places"), vbox);
+	group_layout = new QVBoxLayout (precision_box);
+	precision_group->addButton (button = new QRadioButton (i18n ("Default setting"), precision_box), (int) RKVariable::FormattingOptions::PrecisionDefault);
+	group_layout->addWidget (button);
+	precision_group->addButton (button = new QRadioButton (i18n ("As required"), precision_box), (int) RKVariable::FormattingOptions::PrecisionRequired);
+	group_layout->addWidget (button);
+	precision_group->addButton (button = new QRadioButton (i18n ("Fixed precision:"), precision_box), (int) RKVariable::FormattingOptions::PrecisionFixed);
+	group_layout->addWidget (button);
+	precision_field = new QSpinBox (0, 10, 1, precision_box);
 	connect (precision_field, SIGNAL (valueChanged (int)), this, SLOT (precisionFieldChanged (int)));
 	group_layout->addWidget (precision_field);
-	precision_group->setButton ((int) RKVariable::FormattingOptions::PrecisionDefault);
+	precision_group->button ((int) RKVariable::FormattingOptions::PrecisionDefault)->setChecked (true);
 
 	setButtons (KDialog::Ok | KDialog::Cancel);
 }
@@ -75,17 +78,17 @@
 
 	EditFormatDialog::options = options;
 
-	alignment_group->setButton ((int) options.alignment);
-	precision_group->setButton ((int) options.precision_mode);
+	alignment_group->button ((int) options.alignment)->setChecked (true);
+	precision_group->button ((int) options.precision_mode)->setChecked (true);
 	precision_field->setValue (options.precision);
 }
 
 void EditFormatDialog::accept () {
 	RK_TRACE (EDITOR);
 
-	options.alignment = (RKVariable::FormattingOptions::Alignment) alignment_group->selectedId ();
+	options.alignment = (RKVariable::FormattingOptions::Alignment) alignment_group->checkedId ();
 
-	options.precision_mode = (RKVariable::FormattingOptions::Precision) precision_group->selectedId ();
+	options.precision_mode = (RKVariable::FormattingOptions::Precision) precision_group->checkedId ();
 	if (options.precision_mode == RKVariable::FormattingOptions::PrecisionFixed) {
 		options.precision = precision_field->value ();
 	} else {
@@ -98,7 +101,7 @@
 void EditFormatDialog::precisionFieldChanged (int) {
 	RK_TRACE (EDITOR);
 
-	precision_group->setButton ((int) RKVariable::FormattingOptions::PrecisionFixed);
+	precision_group->button ((int) RKVariable::FormattingOptions::PrecisionFixed)->setChecked (true);
 }
 
 
@@ -117,6 +120,8 @@
 void EditFormatDialogProxy::initialize (const RKVariable::FormattingOptions& options, const QString& varname) {
 	RK_TRACE (EDITOR);
 
+	if (dialog) return;	// one dialog at a time, please!
+
 	EditFormatDialogProxy::options = options;
 	dialog = new EditFormatDialog (this);
 	dialog->initialize (options, varname);

Modified: branches/KDE4_port/rkward/dataeditor/editformatdialog.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/editformatdialog.h	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/editformatdialog.h	2007-11-12 16:05:39 UTC (rev 2204)
@@ -22,7 +22,7 @@
 #include "../core/rkvariable.h"
 #include "twintablemember.h"
 
-class Q3ButtonGroup;
+class QButtonGroup;
 class QSpinBox;
 
 /**
@@ -47,8 +47,8 @@
 /** initializes the GUI-options from the settings for the variable */
 	void initialize (const RKVariable::FormattingOptions& options, const QString& varname);
 private:
-	Q3ButtonGroup *alignment_group;
-	Q3ButtonGroup *precision_group;
+	QButtonGroup *alignment_group;
+	QButtonGroup *precision_group;
 	QSpinBox *precision_field;
 	RKVariable::FormattingOptions options;
 };

Modified: branches/KDE4_port/rkward/dataeditor/editlabelsdialog.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/editlabelsdialog.cpp	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/editlabelsdialog.cpp	2007-11-12 16:05:39 UTC (rev 2204)
@@ -254,6 +254,8 @@
 void EditLabelsDialogProxy::initialize (const RObject::ValueLabels& labels, const QString& varname) {
 	RK_TRACE (EDITOR);
 
+	if (dialog) return;	// one dialog at a time, please!
+
 	EditLabelsDialogProxy::labels = labels;		// we need to take a copy in case the dialog is rejected
 
 	dialog = new EditLabelsDialog (this, labels, varname);

Deleted: branches/KDE4_port/rkward/dataeditor/rkdrag.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/rkdrag.cpp	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/rkdrag.cpp	2007-11-12 16:05:39 UTC (rev 2204)
@@ -1,66 +0,0 @@
-/***************************************************************************
-                          rkdrag.cpp  -  description
-                             -------------------
-    begin                : Thu Oct 31 2002
-    copyright            : (C) 2002, 2006 by Thomas Friedrichsmeier
-    email                : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   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 "rkdrag.h"
-
-#include "twintablemember.h"
-
-#include "../debug.h"
-//Added by qt3to4:
-#include <Q3CString>
-
-RKDrag::RKDrag (TwinTableMember *drag_source) : Q3DragObject (drag_source){
-	RK_TRACE (EDITOR);
-
-	RK_ASSERT (drag_source);
-/*	if (drag_source) {
-		data = drag_source->encodeSelection ();
-	} */
-}
-
-RKDrag::~RKDrag () {
-	RK_TRACE (EDITOR);
-}
-
-const char* RKDrag::format (int i) const {
-	RK_TRACE (EDITOR);
-	if (i == 0) {
-		return "text/tab-separated-values";
-	}
-	if (i == 1) {
-		return "text/plain";
-	}
-	return 0;
-}
-
-QByteArray RKDrag::encodedData (const char * mimeType) const {
-	RK_TRACE (EDITOR);
-	QString request = mimeType;
-	if ((request == format (0)) || (request == format (1))) {
-		return data;
-	}
-
-	return Q3CString ();
-}
-
-bool RKDrag::provides (const char *mimeType) {
-	RK_TRACE (EDITOR);
-	if ((mimeType == format (0)) || (mimeType == format (1))) {
-		return true;
-	}
-	return false;
-}

Deleted: branches/KDE4_port/rkward/dataeditor/rkdrag.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/rkdrag.h	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/rkdrag.h	2007-11-12 16:05:39 UTC (rev 2204)
@@ -1,42 +0,0 @@
-/***************************************************************************
-                          rkdrag.h  -  description
-                             -------------------
-    begin                : Thu Oct 31 2002
-    copyright            : (C) 2002, 2006 by Thomas Friedrichsmeier
-    email                : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   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 RKDRAG_H
-#define RKDRAG_H
-
-#include <q3dragobject.h>
-//Added by qt3to4:
-#include <Q3CString>
-
-class TwinTableMember;
-
-#warning TODO remove. This class is obsolete
-/** A QDragObject that gets its data from a TwinTableMember. Used for all copy/paste/drag operations involving TwinTableMembers.
-  *@author Thomas Friedrichsmeier
-  */
-class RKDrag : public Q3DragObject  {
-public: 
-	RKDrag (TwinTableMember *drag_source=0);
-	~RKDrag ();
-	const char* format (int i=0) const;
-	QByteArray encodedData (const char * mimeType) const;
-	bool provides (const char *mimeType);
-private:
-	Q3CString data;
-};
-
-#endif

Modified: branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/rkeditordataframe.cpp	2007-11-12 16:05:39 UTC (rev 2204)
@@ -67,8 +67,7 @@
 
 	initTable (model, object);
 
-#warning is this needed? Or is it enough to close the chain?
-	waitForLoad ();
+	RKGlobals::rInterface ()->closeChain (open_chain);
 }
 
 void RKEditorDataFrame::commonInit () {
@@ -82,15 +81,11 @@
 
 void RKEditorDataFrame::enableEditing (bool on) {
 	if (on) {
-		connect (this, SIGNAL (deleteColumnRequest (int)), this, SLOT (columnDeletionRequested (int)));
-		connect (this, SIGNAL (addedColumn (int)), this, SLOT (columnAdded (int)));
 		metaview->setEnabled (true);
 		dataview->setEnabled (true);
 	} else {
 		metaview->setEnabled (false);
 		dataview->setEnabled (false);
-		disconnect (this, SIGNAL (deleteColumnRequest (int)), this, SLOT (columnDeletionRequested (int)));
-		disconnect (this, SIGNAL (addedColumn (int)), this, SLOT (columnAdded (int)));
 	}
 }
 

Modified: branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.cpp	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.cpp	2007-11-12 16:05:39 UTC (rev 2204)
@@ -47,6 +47,7 @@
 	editCut = actionCollection ()->addAction (KStandardAction::Cut, "cut", this, SLOT(slotEditCut()));
 	editCopy = actionCollection ()->addAction (KStandardAction::Copy, "copy", this, SLOT(slotEditCopy()));
 	editPaste = actionCollection ()->addAction (KStandardAction::Paste, "paste", this, SLOT(slotEditPaste()));
+
 	editPasteToTable = actionCollection ()->addAction ("paste_to_table", this, SLOT(slotEditPasteToTable()));
 	editPasteToTable->setText (i18n("Paste inside Table"));
 	editPasteToTable->setIcon (KIcon ("frame_spreadsheet"));

Modified: branches/KDE4_port/rkward/dataeditor/twintable.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintable.cpp	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/twintable.cpp	2007-11-12 16:05:39 UTC (rev 2204)
@@ -42,17 +42,15 @@
 	QSplitter *splitter = new QSplitter(this);
 	splitter->setOrientation(Qt::Vertical);
 
-	metaview = new TwinTableMember (splitter, this);
+	metaview = new TwinTableMember (splitter);
 	splitter->setResizeMode (metaview, QSplitter::KeepSize);
 	metaview->verticalHeader ()->setResizeMode (QHeaderView::Fixed);
 	metaview->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
 	
-	dataview = new TwinTableMember (splitter, this);
+	dataview = new TwinTableMember (splitter);
 	dataview->verticalHeader ()->setResizeMode (QHeaderView::Fixed);
 	dataview->horizontalHeader ()->hide ();
 
-#warning TODO set item delegates
-	
 	layout->addWidget (splitter);
 
 	// these are to keep the two tables in sync

Modified: branches/KDE4_port/rkward/dataeditor/twintable.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintable.h	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/twintable.h	2007-11-12 16:05:39 UTC (rev 2204)
@@ -59,9 +59,6 @@
 	void metaHeaderPressed (int section);
 	void metaHeaderEntered (int section);
 	void metaHeaderClicked (int section);
-/*
-	void headerClicked (int col);
-	void headerPressed (int col); */
 private:
 /** PopupMenu shown when top header is right-clicked */
 	QMenu *top_header_menu;

Deleted: branches/KDE4_port/rkward/dataeditor/twintabledatamember.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintabledatamember.cpp	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/twintabledatamember.cpp	2007-11-12 16:05:39 UTC (rev 2204)
@@ -1,156 +0,0 @@
-/***************************************************************************
-                          twintabledatamember  -  description
-                             -------------------
-    begin                : Mon Sep 13 2004
-    copyright            : (C) 2004, 2006 by Thomas Friedrichsmeier
-    email                : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   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 "twintabledatamember.h"
-
-#include "twintable.h"
-#include "../core/rkvariable.h"
-#include "celleditor.h"
-
-#include <qpainter.h>
-#include <qrect.h>
-#include <qpalette.h>
-#include <qstyle.h>
-
-#include "../debug.h"
-
-#warning TODO remove
-#if 0
-
-TwinTableDataMember::TwinTableDataMember (QWidget *parent, TwinTable *table) : TwinTableMember (parent, table, 1, 1) {
-}
-
-TwinTableDataMember::~TwinTableDataMember () {
-}
-
-void TwinTableDataMember::removeRow (int row) {
-	RK_TRACE (EDITOR);
-	Q3Table::removeRow (row);
-	for (int i=0; i < table->numTrueCols (); ++i) {
-		table->getColObject (i)->removeRow (row);
-	}
-	for (int i=row; i < numTrueRows (); ++i) {
-		for (int j=0; j < table->numTrueCols (); ++j) {
-			updateCell (i, j);
-		}
-	}
-}
-
-void TwinTableDataMember::insertRows (int row, int count) {
-	RK_TRACE (EDITOR);
-	for (int i=0; i < table->numTrueCols (); ++i) {
-		table->getColObject (i)->insertRows (row, count);
-	}
-	Q3Table::insertRows (row, count);
-}
-
-void TwinTableDataMember::setText (int row, int col, const QString &text) {
-	RK_TRACE (EDITOR);
-
-	RKVariable *var = table->getColObject (col);
-	if (var) {
-		var->setText (row, text);
-	}
-	// we may also be in a row that has no var (e.g. left header)
-}
-
-void TwinTableDataMember::paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg) {
-	// no trace for paint operations
-
-	RKVariable *var = table->getColObject (col);
-	RKVariable::Status cell_state = RKVariable::ValueInvalid;
-	if (var) cell_state = var->cellStatus (row);
-
-	QBrush *brush_override = 0;
-	QPen *pen_override = 0;
-	if (var) {
-		if (cell_state == RKVariable::ValueInvalid) {
-			brush_override = new QBrush (Qt::red);
-		} else if (cell_state == RKVariable::ValueUnknown) {
-			pen_override = new QPen (cg.light ());
-		}
-	}
-
-	QString text;
-	int align = 0;
-	if (var && (row < numTrueRows ())) {
-		text = var->getText (row, true);
-		align = var->getAlignment ();
-	}
-	paintCellInternal (p, row, col, cr, selected, cg, brush_override, pen_override, text, align);
-
-	delete pen_override;
-	delete brush_override;
-}
-
-QWidget *TwinTableDataMember::beginEdit (int row, int col, bool) {
-	RK_TRACE (EDITOR);
-	RK_ASSERT (!tted);
-	RKVariable *var = table->getColObject (col);
-	if (!var) {
-		RK_ASSERT (col >= numTrueCols ());
-		table->insertNewColumn (col+1);
-		var = table->getColObject (col);
-		if (!var) {
-			RK_ASSERT (false);
-			return 0;
-		}
-	}
-
-	if (row >= numTrueRows ()) {
-		table->insertNewRow ();
-	}
-
-	if (var->cellStatus (row) == RKVariable::ValueUnknown) return 0;
-
-	tted = new CellEditor (this, var->getText (row), 0, var->getValueLabels ());
-	//tted->installEventFilter (this);
-
-	QRect cr = cellGeometry (row, col);
-	tted->resize (cr.size ());
-	moveChild (tted, cr.x (), cr.y ());
-	tted->show ();
-	
-	tted->setActiveWindow ();
-	tted->setFocus ();
-	connect (tted, SIGNAL (lostFocus ()), this, SLOT (editorLostFocus ()));
-
-	updateCell (row, col);
-	return (tted);
-}
-
-QString TwinTableDataMember::text (int row, int col) const {
-	RK_TRACE (EDITOR);
-	// called very often. do not trace
-	RKVariable *var = table->getColObject (col);
-	if (!var) {
-		RK_ASSERT (false);
-		return QString ();
-	}
-	return var->getText (row);
-}
-
-QString TwinTableDataMember::rText (int row, int col) const {
-	RKVariable *var = table->getColObject (col);
-	if (!var) {
-		RK_ASSERT (false);
-		return QString ();
-	}
-	return var->getRText (row);
-}
-
-#include "twintabledatamember.moc"
-#endif
\ No newline at end of file

Deleted: branches/KDE4_port/rkward/dataeditor/twintabledatamember.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintabledatamember.h	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/twintabledatamember.h	2007-11-12 16:05:39 UTC (rev 2204)
@@ -1,53 +0,0 @@
-/***************************************************************************
-                          twintabledatamember  -  description
-                             -------------------
-    begin                : Mon Sep 13 2004
-    copyright            : (C) 2004 by Thomas Friedrichsmeier
-    email                : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   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 TWINTABLEDATAMEMBER_H
-#define TWINTABLEDATAMEMBER_H
-
-#include "twintablemember.h"
-#if 0
-/**
-The TwinTableMember responsible for storing the data (i.e. the bottom half of the TwinTable). See TwinTable and TwinTableMember.
-
- at author Thomas Friedrichsmeier
-*/
-class TwinTableDataMember : public TwinTableMember {
-Q_OBJECT
-public:
-	TwinTableDataMember (QWidget *parent, TwinTable *table);
-
-	~TwinTableDataMember ();
-	
-	// TODO: obsolete?
-	TwinTableMember *varTable () { return twin; };
-
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	void removeRow (int row);
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	void insertRows (int row, int count=1);
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	void setText (int row, int col, const QString &text);
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	void paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg);
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	QWidget *beginEdit (int row, int col, bool replace);
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	QString text (int row, int col) const;
-/** reimplemented form TwinTableDataMember to use information from RKVariable for proper treatment of values */
-	QString rText (int row, int col) const;
-};
-#endif
-#endif

Modified: branches/KDE4_port/rkward/dataeditor/twintablemember.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintablemember.cpp	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/twintablemember.cpp	2007-11-12 16:05:39 UTC (rev 2204)
@@ -30,12 +30,9 @@
 
 #include "../debug.h"
 
-TwinTableMember::TwinTableMember (QWidget *parent, TwinTable *table) : QTableView (parent){
+TwinTableMember::TwinTableMember (QWidget *parent) : QTableView (parent){
 	RK_TRACE (EDITOR);
 
-	twin = 0;
-#warning member "table" seems to be unused
-	TwinTableMember::table = table;
 	setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOn);
 	setSelectionMode (QAbstractItemView::ContiguousSelection);
 

Modified: branches/KDE4_port/rkward/dataeditor/twintablemember.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintablemember.h	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/twintablemember.h	2007-11-12 16:05:39 UTC (rev 2204)
@@ -76,8 +76,8 @@
 class TwinTableMember : public QTableView {
 	Q_OBJECT
 public: 
-	TwinTableMember (QWidget *parent, TwinTable *table);
-	~TwinTableMember();
+	TwinTableMember (QWidget *parent);
+	~TwinTableMember ();
 	TwinTableMember *getTwin () { return twin; };
 /** ends editing. Actually it's just a simple wrapper around QTable::endEdit () */
 	void stopEditing ();
@@ -98,7 +98,6 @@
 	void contextMenuRequest (int row, int col, const QPoint& pos);
 protected:
 	TwinTableMember *twin;
-	TwinTable *table;
 	bool updating_twin;
 
 /** reimplemented from QTableView to also adjust the twin */

Deleted: branches/KDE4_port/rkward/dataeditor/twintablemetamember.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintablemetamember.cpp	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/twintablemetamember.cpp	2007-11-12 16:05:39 UTC (rev 2204)
@@ -1,171 +0,0 @@
-/***************************************************************************
-                          twintablemetamember  -  description
-                             -------------------
-    begin                : Mon Sep 13 2004
-    copyright            : (C) 2004, 2006 by Thomas Friedrichsmeier
-    email                : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   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 "twintablemetamember.h"
-
-#include "../core/rkvariable.h"
-#include "../core/rcontainerobject.h"
-#include "../core/rkmodificationtracker.h"
-#include "twintable.h"
-#include "celleditor.h"
-#include "editlabelsdialog.h"
-#include "editformatdialog.h"
-#include "../rkglobals.h"
-
-#include <qpainter.h>
-#include <qrect.h>
-#include <qpalette.h>
-#include <qstyle.h>
-
-#include "../debug.h"
-
-#warning TODO remove
-#if 0
-TwinTableMetaMember::TwinTableMetaMember (QWidget *parent, TwinTable *table) : TwinTableMember (parent, table, 0, 1) {
-	type_values.insert (QString::number (RObject::DataNumeric), RObject::typeToText (RObject::DataNumeric));
-	type_values.insert (QString::number (RObject::DataFactor), RObject::typeToText (RObject::DataFactor));
-	type_values.insert (QString::number (RObject::DataCharacter), RObject::typeToText (RObject::DataCharacter));
-}
-
-TwinTableMetaMember::~TwinTableMetaMember () {
-}
-
-void TwinTableMetaMember::removeRow (int) {
-	RK_ASSERT (false);
-}
-
-void TwinTableMetaMember::insertRows (int, int) {
-	RK_ASSERT (false);
-}
-
-void TwinTableMetaMember::setText (int row, int col, const QString &text) {
-	RK_TRACE (EDITOR);
-	RKVariable *var = table->getColObject (col);
-	RK_ASSERT (var || (col < 0));
-	if (text == TwinTableMetaMember::text (row, col)) return;
-	if (row == NAME_ROW) {
-		RKGlobals::tracker ()->renameObject (var, var->getContainer ()->validizeName (text));
-	} else if (row == LABEL_ROW) {
-		var->setLabel (text, true);
-	} else if (row == TYPE_ROW) {
-		var->setVarType ((RObject::RDataType) text.toInt ());
-	} else if (row == FORMAT_ROW) {
-		return var->setFormattingOptionsString (text);
-	} else if (row == LEVELS_ROW) {
-		var->setValueLabelString (text);
-	}
-}
-
-void TwinTableMetaMember::paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg) {
-	// no trace for paint operations
-	RKVariable *var = table->getColObject (col);
-
-	QString text;
-	if (var && (row < numTrueRows ())) {
-		text = formattedText (row, col);
-	}
-	paintCellInternal (p, row, col, cr, selected, cg, 0, 0, text, 0);
-}
-
-QWidget *TwinTableMetaMember::beginEdit (int row, int col, bool) {
-	RK_TRACE (EDITOR);
-	RK_ASSERT (!tted);
-	RKVariable *var = table->getColObject (col);
-	if (!var) {
-		RK_ASSERT (col >= numTrueCols ());
-		table->insertNewColumn (col+1);
-		var = table->getColObject (col);
-		if (!var) {
-			RK_ASSERT (false);
-			return 0;
-		}
-	}
-
-	if (row == TYPE_ROW) {
-		tted = new CellEditor (this, text (row, col), 0, &type_values);
-	} else if (row == LEVELS_ROW) {
-		EditLabelsDialog *dialog = new EditLabelsDialog (0, var, 0);
-		dialog->exec ();
-		delete (dialog);
-		return 0;
-	} else if (row == FORMAT_ROW) {
-		EditFormatDialog *dialog = new EditFormatDialog (0, var, 0);
-		dialog->exec ();
-		delete (dialog);
-		return 0;
-	} else {
-		tted = new CellEditor (this, text (row, col), 0, 0);
-	}
-	//tted->installEventFilter (this);
-
-	QRect cr = cellGeometry (row, col);
-	tted->resize (cr.size ());
-	moveChild (tted, cr.x (), cr.y ());
-	tted->show ();
-	
-	tted->setActiveWindow ();
-	tted->setFocus ();
-	connect (tted, SIGNAL (lostFocus ()), this, SLOT (editorLostFocus ()));
-
-	updateCell (row, col);
-	return (tted);
-}
-
-QString TwinTableMetaMember::text (int row, int col) const {
-	RK_TRACE (EDITOR);
-	// called very often. do not trace
-	RKVariable *var = table->getColObject (col);
-	if (!var) {
-		RK_ASSERT (false);
-		return QString ();
-	}
-	if (row == NAME_ROW) {
-		return var->getShortName ();
-	} else if (row == LABEL_ROW) {
-		return var->getLabel ();
-	} else if (row == TYPE_ROW) {
-		return QString::number (var->getDataType ());
-	} else if (row == FORMAT_ROW) {
-		return var->getFormattingOptionsString ();
-	} else if (row == LEVELS_ROW) {
-		return var->getValueLabelString ();
-	}
-	return QString ();
-}
-
-QString TwinTableMetaMember::formattedText (int row, int col) const {
-	// called very often. do not trace
-	RKVariable *var = table->getColObject (col);
-	if (!var) {
-		RK_ASSERT (false);
-		return QString ();
-	}
-	if (row == NAME_ROW) {
-		return var->getShortName ();
-	} else if (row == LABEL_ROW) {
-		return var->getLabel ();
-	} else if (row == TYPE_ROW) {
-		return RObject::typeToText (var->getDataType ());
-	} else if (row == FORMAT_ROW) {
-		return var->getFormattingOptionsString ();
-	} else if (row == LEVELS_ROW) {
-		return var->getValueLabelString ();
-	}
-	return QString ();
-}
-
-#include "twintablemetamember.moc"
-#endif

Deleted: branches/KDE4_port/rkward/dataeditor/twintablemetamember.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintablemetamember.h	2007-11-12 01:11:41 UTC (rev 2203)
+++ branches/KDE4_port/rkward/dataeditor/twintablemetamember.h	2007-11-12 16:05:39 UTC (rev 2204)
@@ -1,57 +0,0 @@
-/***************************************************************************
-                          twintablemetamember  -  description
-                             -------------------
-    begin                : Mon Sep 13 2004
-    copyright            : (C) 2004 by Thomas Friedrichsmeier
-    email                : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   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 TWINTABLEMETAMEMBER_H
-#define TWINTABLEMETAMEMBER_H
-
-#include "twintablemember.h"
-
-#include "../core/robject.h"
-
-class QWidget;
-class TwinTable;
-#if 0
-/**
-The TwinTableMember responsible for storing the meta-information (i.e. the top half of the TwinTable). See TwinTable and TwinTableMember.
-
- at author Thomas Friedrichsmeier
-*/
-class TwinTableMetaMember : public TwinTableMember {
-Q_OBJECT
-public:
-	TwinTableMetaMember (QWidget *parent, TwinTable *table);
-
-	~TwinTableMetaMember ();
-
-/** reimplemented to raise an assert (should never be called) */
-	void removeRow (int row);
-/** reimplemented to raise an assert (should never be called) */
-	void insertRows (int row, int count=1);
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	void setText (int row, int col, const QString &text);
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	void paintCell (QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg);
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	QWidget *beginEdit (int row, int col, bool replace);
-/** reimplemented form QTable not to work on TableColumns instead of QTableItems */
-	QString text (int row, int col) const;
-	
-	QString formattedText (int row, int col) const;
-private:
-	RObject::ValueLabels type_values;
-};
-#endif
-#endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list