summaryrefslogtreecommitdiff
path: root/src/items/database/databaserelationshipproperties.cpp
blob: cb3866d09fba1f6c3a65f5f81a79f962f28776fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (C) 2008  Lukas Lalinsky
//
// 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.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#include <QCheckBox>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include "databaserelationshipproperties.h"

class DatabaseRelationshipProperties::PrivateData
{
public:
	PrivateData()
		{}
	
	QWidget *nameEdit;
	QCheckBox *generateNameCheckBox;
};

DatabaseRelationshipProperties::DatabaseRelationshipProperties(QWidget *parent)
	: DiagramItemProperties(parent), d(new PrivateData)
{
	addPage(tr("&Relationship"), createRelationshipPage());
}

QWidget *
DatabaseRelationshipProperties::createRelationshipPage()
{
	QWidget *page = new QWidget(this);
	QGridLayout *layout = new QGridLayout(page);

	d->nameEdit = new QLineEdit(page);
	layout->addWidget(new QLabel(tr("Name:"), page), 0, 0);
	layout->addWidget(d->nameEdit, 0, 1);
	d->generateNameCheckBox = new QCheckBox(tr("Generated"), page);
	connect(d->generateNameCheckBox, SIGNAL(toggled(bool)), d->nameEdit, SLOT(setDisabled(bool)));
	d->generateNameCheckBox->setChecked(true);
	layout->addWidget(d->generateNameCheckBox, 0, 2);
	layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 1, 0, 1, 3);

	return page;
}

void
DatabaseRelationshipProperties::switchCurrentItem(DiagramItem *oldItem, DiagramItem *newItem)
{
}