[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi/plugins/tables
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2006-10-30 16:55:53
Message-ID: 1162227353.658842.16574.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 600452 by staniek:

missing merge


 M  +2 -1      kexitabledesignercommands.h  
 M  +3 -1      kexitabledesignerview.h  
 M  +8 -0      kexitabledesignerview_p.cpp  
 M  +4 -0      kexitabledesignerview_p.h  
 M  +53 -7     kexitablepart.cpp  
 M  +11 -5     kexitablepart.h  


--- trunk/koffice/kexi/plugins/tables/kexitabledesignercommands.h #600451:600452
@@ -29,9 +29,10 @@
 
 #include <kcommand.h>
 #include <kexidb/alter.h>
-#include <kexialtertabledialog.h>
 #include <koproperty/set.h>
 
+#include "kexitabledesignerview.h"
+
 class QWidget;
 class QRect;
 class QPoint;
--- trunk/koffice/kexi/plugins/tables/kexitabledesignerview.h #600451:600452
@@ -190,7 +190,7 @@
 		 or 0 if current row is empty. */
 		virtual KoProperty::Set *propertySet();
 
-		void removeCurrentPropertySet();
+//		void removeCurrentPropertySet();
 
 		/*! Reimplemented from KexiViewBase, because tables creation is more complex. 
 		 No table schema altering is required, so just buildSchema() is used to create a \
new schema. @@ -242,6 +242,8 @@
 		 it will be copied into the new set. Used by insertField(). */
 		void insertFieldInternal(int row, KoProperty::Set* set,	const QString& caption, \
bool addCommand);  
+		//! Reimplemented to pass the information also to the "Lookup" tab
+		virtual void propertySetSwitched();
 
 	private:
 		KexiTableDesignerViewPrivate *d;
--- trunk/koffice/kexi/plugins/tables/kexitabledesignerview_p.cpp #600451:600452
@@ -107,6 +107,14 @@
 {
 	historyActionCollection = new KActionCollection((QWidget*)0,"");
 	history = new CommandHistory(historyActionCollection, true);
+
+	internalPropertyNames.insert("subType",(char*)1);
+	internalPropertyNames.insert("uid",(char*)1);
+	internalPropertyNames.insert("newrow",(char*)1);
+	internalPropertyNames.insert("rowSource",(char*)1);
+	internalPropertyNames.insert("rowSourceType",(char*)1);
+	internalPropertyNames.insert("boundColumn",(char*)1);
+	internalPropertyNames.insert("visibleColumn",(char*)1);
 }
 
 KexiTableDesignerViewPrivate::~KexiTableDesignerViewPrivate() {
--- trunk/koffice/kexi/plugins/tables/kexitabledesignerview_p.h #600451:600452
@@ -176,6 +176,10 @@
 
 		KActionCollection* historyActionCollection;
 		CommandHistory* history;
+
+		//! A cache used in KexiTableDesignerView::buildField() to quickly identify 
+		//! properties internal to the designer
+		Q3AsciiDict<char> internalPropertyNames;
 };
 
 #endif
--- trunk/koffice/kexi/plugins/tables/kexitablepart.cpp #600451:600452
@@ -24,6 +24,8 @@
 #include <kdebug.h>
 #include <kgenericfactory.h>
 #include <kmessagebox.h>
+#include <ktabwidget.h>
+#include <kiconloader.h>
 
 #include "keximainwindow.h"
 #include "kexiproject.h"
@@ -32,22 +34,34 @@
 #include "widget/tableview/kexidatatableview.h"
 #include "kexitabledesignerview.h"
 #include "kexitabledesigner_dataview.h"
+#include "kexilookupcolumnpage.h"
 
 #include <kexidb/connection.h>
 #include <kexidb/cursor.h>
 #include <kexidialogbase.h>
-//Added by qt3to4:
-#include <Q3CString>
-#include <Q3PtrList>
 
+//! @internal
+class KexiTablePart::Private
+{
+	public:
+		Private()
+		{
+		}
+		~Private()
+		{
+			delete static_cast<KexiLookupColumnPage*>(lookupColumnPage);
+		}
+		QGuardedPtr<KexiLookupColumnPage> lookupColumnPage;
+};
 
 KexiTablePart::KexiTablePart(QObject *parent, const char *name, const QStringList \
&l)  : KexiPart::Part(parent, name, l)
+ , d(new Private())
 {
 	// REGISTERED ID:
 	m_registeredPartID = (int)KexiPart::TableObjectType;
 
-	kDebug() << "KexiTablePart::KexiTablePart()" << endl;
+	kdDebug() << "KexiTablePart::KexiTablePart()" << endl;
 	m_names["instanceName"] 
 		= i18n("Translate this word using only lowercase alphanumeric characters (a..z, \
0..9). "  "Use '_' character instead of spaces. First character should be a..z \
character. " @@ -60,6 +74,7 @@
 
 KexiTablePart::~KexiTablePart()
 {
+	delete d;
 }
 
 void KexiTablePart::initPartActions()
@@ -92,7 +107,7 @@
 	KexiTablePart::TempData *temp = \
static_cast<KexiTablePart::TempData*>(dialog->tempData());  if (!temp->table) {
 		temp->table = win->project()->dbConnection()->tableSchema(item.name());
-		kDebug() << "KexiTablePart::execute(): schema is " << temp->table << endl;
+		kdDebug() << "KexiTablePart::execute(): schema is " << temp->table << endl;
 	}
 
 	if (viewMode == Kexi::DesignViewMode) {
@@ -188,7 +203,7 @@
 }
 
 QString
-KexiTablePart::i18nMessage(const Q3CString& englishMessage, KexiDialogBase* dlg) \
const +KexiTablePart::i18nMessage(const QCString& englishMessage, KexiDialogBase* \
dlg) const  {
 	if (englishMessage=="Design of object \"%1\" has been modified.")
 		return i18n("Design of table \"%1\" has been modified.");
@@ -203,6 +218,37 @@
 	return englishMessage;
 }
 
+void KexiTablePart::setupCustomPropertyPanelTabs(KTabWidget *tab, KexiMainWindow* \
mainWin) +{
+	if (!d->lookupColumnPage) {
+		d->lookupColumnPage = new KexiLookupColumnPage(0);
+		connect(d->lookupColumnPage, SIGNAL(jumpToObjectRequested(const QCString&, const \
QCString&)), +			mainWin, SLOT(highlightObject(const QCString&, const QCString&)));
+
+//! @todo add "Table" tab
+
+	/*
+		connect(d->dataSourcePage, SIGNAL(formDataSourceChanged(const QCString&, const \
QCString&)), +			KFormDesigner::FormManager::self(), SLOT(setFormDataSource(const \
QCString&, const QCString&))); +		connect(d->dataSourcePage, \
SIGNAL(dataSourceFieldOrExpressionChanged(const QString&, const QString&, \
KexiDB::Field::Type)), +			KFormDesigner::FormManager::self(), \
SLOT(setDataSourceFieldOrExpression(const QString&, const QString&, \
KexiDB::Field::Type))); +		connect(d->dataSourcePage, SIGNAL(insertAutoFields(const \
QString&, const QString&, const QStringList&)), \
+			KFormDesigner::FormManager::self(), SLOT(insertAutoFields(const QString&, const \
QString&, const QStringList&)));*/ +	}
+
+	KexiProject *prj = mainWin->project();
+	d->lookupColumnPage->setProject(prj);
+
+//! @todo add lookup field icon
+	tab->addTab( d->lookupColumnPage, SmallIconSet("combo"), "");
+	tab->setTabToolTip( d->lookupColumnPage, i18n("Lookup column"));
+}
+
+KexiLookupColumnPage* KexiTablePart::lookupColumnPage() const
+{
+	return d->lookupColumnPage;
+}
+
 //----------------
 
 #if 0
@@ -218,7 +264,7 @@
 KexiDB::FieldList *
 KexiTableDataSource::fields(KexiProject *project, const KexiPart::Item &it)
 {
-	kDebug() << "KexiTableDataSource::fields(): " << it.name() << endl;
+	kdDebug() << "KexiTableDataSource::fields(): " << it.name() << endl;
 	return project->dbConnection()->tableSchema(it.name());
 }
 
--- trunk/koffice/kexi/plugins/tables/kexitablepart.h #600451:600452
@@ -28,11 +28,9 @@
 //#include <kexipartdatasource.h>
 #include <kexipartitem.h>
 #include <kexidb/fieldlist.h>
-//Added by qt3to4:
-#include <Q3CString>
 
 class KexiMainWin;
-//class KexiTableDataSource;
+class KexiLookupColumnPage;
 
 class KexiTablePart : public KexiPart::Part
 {
@@ -63,9 +61,11 @@
 			QWidget *parent, KexiDB::Connection& conn, 
 			KexiDB::TableSchema& table, const QString& msg);
 
-		virtual QString i18nMessage(const Q3CString& englishMessage, 
+		virtual QString i18nMessage(const QCString& englishMessage, 
 			KexiDialogBase* dlg) const;
 
+		KexiLookupColumnPage* lookupColumnPage() const;
+
 	protected:
 		virtual KexiDialogTempData* createTempData(KexiDialogBase* dialog);
 
@@ -75,7 +75,13 @@
 		virtual void initPartActions();
 		virtual void initInstanceActions();
 
-	virtual KexiDB::SchemaData* loadSchemaData(KexiDialogBase *dlg, const \
KexiDB::SchemaData& sdata, int viewMode); +		virtual void \
setupCustomPropertyPanelTabs(KTabWidget *tab, KexiMainWindow* mainWin); +
+		virtual KexiDB::SchemaData* loadSchemaData(KexiDialogBase *dlg, const \
KexiDB::SchemaData& sdata, int viewMode); +
+	private:
+		class Private;
+		Private* d;
 };
 
 #if 0


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic