diff options
author | Lukáš Lalinský <lalinsky@gmail.com> | 2008-12-06 21:33:46 +0100 |
---|---|---|
committer | Lukáš Lalinský <lalinsky@gmail.com> | 2008-12-06 21:33:46 +0100 |
commit | e3edf9516e8bfbbf076c02a1119a78e479638a4b (patch) | |
tree | d056e62d9d193b9486e19c61bb78a5a657eac12e /mainwindow.cpp | |
parent | 96167c7e44272d23f55735f276b14e64e30179fa (diff) | |
download | dbmodel-e3edf9516e8bfbbf076c02a1119a78e479638a4b.tar.xz |
Rename DatabaseModel and DatabaseModelView to DiagramXXX
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r-- | mainwindow.cpp | 26 |
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 * |