kexi

kexirelationmaindlg.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2004 Lucijan Busch <lucijan@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "kexirelationmaindlg.h"
21
22#include <tdelocale.h>
23#include <kdebug.h>
24#include <kiconloader.h>
25
26#include <tqlayout.h>
27
28#include <kexidb/connection.h>
29
30#include "keximainwindow.h"
31#include "kexiproject.h"
32#include "kexirelationwidget.h"
33#include "kexirelationview.h"
34
35KexiRelationMainDlg::KexiRelationMainDlg(KexiMainWindow *mainWin, TQWidget *parent, const char *name)
36 : KexiViewBase(mainWin, parent, name)
37{
38 kdDebug() << "KexiRelationMainDlg()" << endl;
39// setIcon(SmallIcon("relation"));
40 m_defaultIconName = "relation";
41 setCaption( i18n("Relationships") );
42// setDocID( win->generatePrivateDocID() );
43
44 m_rel = new KexiRelationWidget(mainWin, this);
45 //the view can receive some our actions
46 addActionProxyChild( m_rel );
47// addActionProxyChild( m_view->relationView() );
48
49 TQVBoxLayout *g = new TQVBoxLayout(this);
50 g->addWidget(m_rel);
51
52 //show all tables
53 KexiDB::Connection *conn = mainWin->project()->dbConnection();
54 TQStringList tables = conn->tableNames();
55 for (TQStringList::ConstIterator it = tables.constBegin(); it!=tables.constEnd(); ++it) {
56 m_rel->addTable( *it );
57 }
58}
59
60KexiRelationMainDlg::~KexiRelationMainDlg()
61{
62}
63
64TQSize KexiRelationMainDlg::sizeHint() const
65{
66 return TQSize(600,300);
67}
68
69TQWidget*
70KexiRelationMainDlg::mainWidget()
71{
72 return m_rel;
73}
74
75TQString KexiRelationMainDlg::itemIcon()
76{
77 return "relation";
78}
79
80#include "kexirelationmaindlg.moc"
81
Provides database connection, allowing queries and data modification.
Definition connection.h:62
TQStringList tableNames(bool also_system_tables=false)
Kexi's main window interface This interface is implemented by KexiMainWindowImpl class.
virtual KexiProject * project()=0
Project data of currently opened project or NULL if no project here yet.
KexiDB::Connection * dbConnection() const
Base class for single view embeddable of in KexiDialogBase.