summaryrefslogtreecommitdiff
path: root/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index c6cd1b8..515b1af 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -57,7 +57,7 @@ MainWindow::setupUi()
m_properties = new TableProperties(this, this);
- m_view = new DatabaseModelView(this);
+ m_view = new DiagramView(this);
m_splitter = new QSplitter(Qt::Vertical, this);
setCentralWidget(m_splitter);
@@ -206,7 +206,7 @@ MainWindow::open()
{
QString fileName = QFileDialog::getOpenFileName(this, QString(), QString(), "Database Model (*.dmf)");
if (!fileName.isNull()) {
- DatabaseModel *model = new DatabaseModel(this);
+ DiagramDocument *model = new DiagramDocument(this);
model->load(fileName);
newModel(model);
}
@@ -269,10 +269,10 @@ MainWindow::exportPNG()
}
void
-MainWindow::newModel(DatabaseModel *newModel)
+MainWindow::newModel(DiagramDocument *newModel)
{
if (!newModel)
- newModel = new DatabaseModel(this);
+ newModel = new DiagramDocument(this);
m_view->setScene(newModel);
if (m_model) {
@@ -285,8 +285,8 @@ MainWindow::newModel(DatabaseModel *newModel)
m_undoGroup->setActiveStack(m_model->undoStack());
connect(m_model,
- SIGNAL(modeChanged(DatabaseModel::Mode)),
- SLOT(updateMode(DatabaseModel::Mode)));
+ SIGNAL(modeChanged(DiagramDocument::Mode)),
+ SLOT(updateMode(DiagramDocument::Mode)));
connect(m_model, SIGNAL(selectionChanged()), SLOT(updateSelection()));
}
@@ -298,29 +298,29 @@ MainWindow::updateSelection()
}
void
-MainWindow::updateMode(DatabaseModel::Mode mode)
+MainWindow::updateMode(DiagramDocument::Mode mode)
{
- m_actionSwitchMode[0]->setChecked(mode == DatabaseModel::Select);
- m_actionSwitchMode[1]->setChecked(mode == DatabaseModel::AddTable);
- m_actionSwitchMode[2]->setChecked(mode == DatabaseModel::AddRelation);
+ m_actionSwitchMode[0]->setChecked(mode == DiagramDocument::Select);
+ m_actionSwitchMode[1]->setChecked(mode == DiagramDocument::AddTable);
+ m_actionSwitchMode[2]->setChecked(mode == DiagramDocument::AddRelation);
}
void
MainWindow::switchModeSelect()
{
- m_model->setMode(DatabaseModel::Select);
+ m_model->setMode(DiagramDocument::Select);
}
void
MainWindow::switchModeAddTable()
{
- m_model->setMode(DatabaseModel::AddTable);
+ m_model->setMode(DiagramDocument::AddTable);
}
void
MainWindow::switchModeAddRelation()
{
- m_model->setMode(DatabaseModel::AddRelation);
+ m_model->setMode(DiagramDocument::AddRelation);
}
QUndoStack *