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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sun Oct 14 20:37:04 UTC 2007


Revision: 2063
          http://rkward.svn.sourceforge.net/rkward/?rev=2063&view=rev
Author:   tfry
Date:     2007-10-14 13:37:03 -0700 (Sun, 14 Oct 2007)

Log Message:
-----------
subdir dataeditor compiles

Modified Paths:
--------------
    branches/KDE4_port/TODO_KDE4
    branches/KDE4_port/rkward/dataeditor/editlabelsdialog.cpp
    branches/KDE4_port/rkward/dataeditor/editlabelsdialog.h
    branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.cpp
    branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.h
    branches/KDE4_port/rkward/dataeditor/twintable.cpp
    branches/KDE4_port/rkward/dataeditor/twintablemember.cpp

Modified: branches/KDE4_port/TODO_KDE4
===================================================================
--- branches/KDE4_port/TODO_KDE4	2007-10-14 20:18:55 UTC (rev 2062)
+++ branches/KDE4_port/TODO_KDE4	2007-10-14 20:37:03 UTC (rev 2063)
@@ -63,3 +63,7 @@
 	- direct page activation?
 	- check wether settings seem to be saved / loaded correctly
 	- are the defaults ok?
+
+data editor:
+	- definitely needs better porting
+	- does cell painting work ok?

Modified: branches/KDE4_port/rkward/dataeditor/editlabelsdialog.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/editlabelsdialog.cpp	2007-10-14 20:18:55 UTC (rev 2062)
+++ branches/KDE4_port/rkward/dataeditor/editlabelsdialog.cpp	2007-10-14 20:37:03 UTC (rev 2063)
@@ -17,8 +17,10 @@
 #include "editlabelsdialog.h"
 
 #include <klocale.h>
-#include <kdialogbase.h>
+#include <kdialog.h>
 #include <kaction.h>
+#include <kactioncollection.h>
+#include <kvbox.h>
 
 #include <qapplication.h>
 #include <qclipboard.h>
@@ -56,9 +58,9 @@
 	setMinimumWidth (80);
 
 	KActionCollection *ac = new KActionCollection (this);
-	KStandardAction::cut (this, SLOT (cut ()), ac);
-	KStandardAction::copy (this, SLOT (copy ()), ac);
-	KStandardAction::paste (this, SLOT (paste ()), ac);
+	ac->addAction (KStandardAction::Cut, this, SLOT (cut ()));
+	ac->addAction (KStandardAction::Copy, this, SLOT (copy ()));
+	ac->addAction (KStandardAction::Paste, this, SLOT (paste ()));
 }
 
 LevelsTable::~LevelsTable () {
@@ -217,18 +219,18 @@
 
 
 
-EditLabelsDialog::EditLabelsDialog (QWidget *parent, RKVariable *var, int mode) : QDialog (parent) {
+EditLabelsDialog::EditLabelsDialog (QWidget *parent, RKVariable *var, int mode) : KDialog (parent) {
 	RK_TRACE (EDITOR);
 	RK_ASSERT (var);
 	RK_ASSERT (var->objectOpened ());
-	
+
 	EditLabelsDialog::var = var;
 	EditLabelsDialog::mode = mode;
 
-	Q3VBoxLayout *mainvbox = new Q3VBoxLayout (this, KDialog::marginHint (), KDialog::spacingHint ());
-	QLabel *label = new QLabel (i18n ("Levels can be assigned only to consecutive integers starting with 1 (the index column is read only). To remove levels at the end of the list, just set them to empty."), this);
+	KVBox *mainvbox = new KVBox ();
+	setMainWidget (mainvbox);
+	QLabel *label = new QLabel (i18n ("Levels can be assigned only to consecutive integers starting with 1 (the index column is read only). To remove levels at the end of the list, just set them to empty."), mainvbox);
 	label->setAlignment (Qt::AlignLeft | Qt::AlignVCenter | Qt::ExpandTabs | Qt::WordBreak);
-	mainvbox->addWidget (label);
 
 	Q3HBoxLayout *hbox = new Q3HBoxLayout (mainvbox, KDialog::spacingHint ());
 

Modified: branches/KDE4_port/rkward/dataeditor/editlabelsdialog.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/editlabelsdialog.h	2007-10-14 20:18:55 UTC (rev 2062)
+++ branches/KDE4_port/rkward/dataeditor/editlabelsdialog.h	2007-10-14 20:37:03 UTC (rev 2063)
@@ -17,7 +17,7 @@
 #ifndef EDITLABELSDIALOG_H
 #define EDITLABELSDIALOG_H
 
-#include <qdialog.h>
+#include <kdialog.h>
 //Added by qt3to4:
 #include <QResizeEvent>
 
@@ -68,7 +68,7 @@
 
 @author Thomas Friedrichsmeier
 */
-class EditLabelsDialog : public QDialog {
+class EditLabelsDialog : public KDialog {
 	Q_OBJECT
 public:
 /** constuctor., the variable to work on.

Modified: branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.cpp	2007-10-14 20:18:55 UTC (rev 2062)
+++ branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.cpp	2007-10-14 20:37:03 UTC (rev 2063)
@@ -19,8 +19,8 @@
 
 #include <qclipboard.h>
 
-#include <kinstance.h>
 #include <kaction.h>
+#include <kactioncollection.h>
 #include <klocale.h>
 
 #include "rkeditordataframe.h"
@@ -30,8 +30,7 @@
 
 RKEditorDataFramePart::RKEditorDataFramePart (QWidget *parent) : KParts::Part (parent) {
 	RK_TRACE (EDITOR);
-	KInstance* instance = new KInstance ("rkward");
-	setInstance (instance);
+	setComponentData (KGlobal::mainComponent ());
  
 	editor = new RKEditorDataFrame (parent, this);
 	setWidget (editor);
@@ -46,19 +45,22 @@
 }
 
 void RKEditorDataFramePart::initializeActions () {
-	editCut = KStandardAction::cut(this, SLOT(slotEditCut()), actionCollection(), "cut");
-	editCopy = KStandardAction::copy(this, SLOT(slotEditCopy()), actionCollection(), "copy");
-	editPaste = KStandardAction::paste(this, SLOT(slotEditPaste()), actionCollection(), "paste");
-	editPasteToTable = new KAction(i18n("Paste inside Table"), 0, 0, this, SLOT(slotEditPasteToTable()), actionCollection(), "paste_to_table");
-	editPasteToTable->setIcon("frame_spreadsheet");
-	editPasteToSelection = new KAction(i18n("Paste inside Selection"), 0, 0, this, SLOT(slotEditPasteToSelection()), actionCollection(), "paste_to_selection");
-	editPasteToSelection->setIcon("frame_edit");
+	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"));
 
-	editCut->setStatusText(i18n("Cuts the selected section and puts it to the clipboard"));
-	editCopy->setStatusText(i18n("Copies the selected section to the clipboard"));
-	editPaste->setStatusText(i18n("Pastes the clipboard contents to actual position"));
-	editPasteToTable->setStatusText(i18n("Pastes the clipboard contents to actual position, but not beyond the table's boundaries"));
-	editPasteToSelection->setStatusText(i18n("Pastes the clipboard contents to actual position, but not beyond the boundaries of the current selection"));
+	editPasteToSelection = actionCollection ()->addAction ("paste_to_selection", this, SLOT(slotEditPasteToSelection()));
+	editPasteToSelection->setText (i18n("Paste inside Selection"));
+	editPasteToSelection->setIcon (KIcon ("frame_edit"));
+
+	editCut->setStatusTip (i18n("Cuts the selected section and puts it to the clipboard"));
+	editCopy->setStatusTip (i18n("Copies the selected section to the clipboard"));
+	editPaste->setStatusTip (i18n("Pastes the clipboard contents to actual position"));
+	editPasteToTable->setStatusTip (i18n("Pastes the clipboard contents to actual position, but not beyond the table's boundaries"));
+	editPasteToSelection->setStatusTip (i18n("Pastes the clipboard contents to actual position, but not beyond the boundaries of the current selection"));
 }
 
 void RKEditorDataFramePart::slotEditCut () {

Modified: branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.h
===================================================================
--- branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.h	2007-10-14 20:18:55 UTC (rev 2062)
+++ branches/KDE4_port/rkward/dataeditor/rkeditordataframepart.h	2007-10-14 20:37:03 UTC (rev 2063)
@@ -47,11 +47,11 @@
 /** return a pointer to the underlying editor widget */
 	RKEditorDataFrame *getEditor () { return editor; };
 private:
-	KAction* editCut;
-	KAction* editCopy;
-	KAction* editPaste;
-	KAction* editPasteToSelection;
-	KAction* editPasteToTable;
+	QAction* editCut;
+	QAction* editCopy;
+	QAction* editPaste;
+	QAction* editPasteToSelection;
+	QAction* editPasteToTable;
 
 /** we could always use static_cast<RKEditorDataFrame*> (widget ()) instead of keeping this pointer. This saves some typing, though */
 	RKEditorDataFrame *editor;

Modified: branches/KDE4_port/rkward/dataeditor/twintable.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintable.cpp	2007-10-14 20:18:55 UTC (rev 2062)
+++ branches/KDE4_port/rkward/dataeditor/twintable.cpp	2007-10-14 20:37:03 UTC (rev 2063)
@@ -57,7 +57,7 @@
 	Q3GridLayout *grid_layout = new Q3GridLayout(this);
 	
 	QSplitter *splitter = new QSplitter(this);
-	splitter->setOrientation(QSplitter::Vertical);
+	splitter->setOrientation(Qt::Vertical);
 	
 	varview = new TwinTableMetaMember (splitter, this);
 	varview->setNumRows (5);
@@ -111,7 +111,7 @@
 	left_header_menu->insertItem (QString::null, this, SLOT (deleteRow ()), 0, HEADER_MENU_ID_DEL_ROW);
 	left_header_menu->insertItem (QString::null, this, SLOT (deleteRows ()), 0, HEADER_MENU_ID_DEL_ROWS);
 
-	setFocusPolicy (QWidget::StrongFocus);
+	setFocusPolicy (Qt::StrongFocus);
 }
 
 TwinTable::~TwinTable() {

Modified: branches/KDE4_port/rkward/dataeditor/twintablemember.cpp
===================================================================
--- branches/KDE4_port/rkward/dataeditor/twintablemember.cpp	2007-10-14 20:18:55 UTC (rev 2062)
+++ branches/KDE4_port/rkward/dataeditor/twintablemember.cpp	2007-10-14 20:37:03 UTC (rev 2063)
@@ -260,7 +260,7 @@
 
 	// draw grid
 	QPen pen (p->pen ());
-	int gridColor = style ().styleHint (QStyle::SH_Table_GridLineColor, this);
+	int gridColor = style ()->styleHint (QStyle::SH_Table_GridLineColor, 0, this);
 	if (gridColor != -1) {
 		const QPalette &pal = palette ();
 		if (cg != colorGroup () && cg != pal.disabled () && cg != pal.inactive ()) p->setPen (cg.mid ());


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