X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmainapp%2Fmdiwindow.cpp;h=d20e4e7055659bc165e3aae64771ce3970725291;hb=e1d1cacbb43055988d0d9db632fdf05c0bea9543;hp=1bac26e838ce5b48c90c2eabc144cdd583df6b2b;hpb=3239ef39dcee08fa6e8cd68cdf2727fc68cc7a8c;p=architektonas diff --git a/src/mainapp/mdiwindow.cpp b/src/mainapp/mdiwindow.cpp index 1bac26e..d20e4e7 100644 --- a/src/mainapp/mdiwindow.cpp +++ b/src/mainapp/mdiwindow.cpp @@ -32,7 +32,7 @@ int MDIWindow::idCounter = 0; * document shall be created for this window. * @param parent Parent widget. Usually a workspace. */ -MDIWindow::MDIWindow(RS_Document * doc, QWidget * parent, const char * name/*= NULL*/, +MDIWindow::MDIWindow(Document * doc, QWidget * parent, const char * name/*= NULL*/, Qt::WindowFlags wflags/*= Qt::WDestructiveClose*/): QMdiSubWindow(parent, Qt::SubWindow), owner(false), forceClosing(false) #warning "!!! wflags is ignored !!!" @@ -90,12 +90,12 @@ MDIWindow::~MDIWindow() */ void MDIWindow::addChildWindow(MDIWindow * w) { - RS_DEBUG->print("RS_MDIWindow::addChildWindow()"); + DEBUG->print("RS_MDIWindow::addChildWindow()"); childWindows.append(w); w->setParentWindow(this); - RS_DEBUG->print("children: %d", childWindows.count()); + DEBUG->print("children: %d", childWindows.count()); } /** @@ -105,13 +105,13 @@ void MDIWindow::addChildWindow(MDIWindow * w) */ void MDIWindow::removeChildWindow(MDIWindow * w) { - RS_DEBUG->print("RS_MDIWindow::removeChildWindow()"); + DEBUG->print("RS_MDIWindow::removeChildWindow()"); // bool suc = childWindows.remove(w); bool suc = childWindows.removeOne(w); - RS_DEBUG->print("successfully removed child window: %d", (int)suc); + DEBUG->print("successfully removed child window: %d", (int)suc); - RS_DEBUG->print("children: %d", childWindows.count()); + DEBUG->print("children: %d", childWindows.count()); } /** @@ -147,11 +147,11 @@ bool MDIWindow::closeMDI(bool force, bool ask) // since it's still available in the parent drawing after closing. if (isBlock) { - RS_DEBUG->print(" closing block"); + DEBUG->print(" closing block"); // tell parent window we're not here anymore. if (parentWindow) { - RS_DEBUG->print(" notifying parent about closing this window"); + DEBUG->print(" notifying parent about closing this window"); parentWindow->removeChildWindow(this); } @@ -161,7 +161,7 @@ bool MDIWindow::closeMDI(bool force, bool ask) // This is a graphic document. ask user for closing. else if (!ask || slotFileClose(force)) { - RS_DEBUG->print(" closing graphic"); + DEBUG->print(" closing graphic"); // close all child windows: bool done; @@ -190,14 +190,14 @@ bool MDIWindow::closeMDI(bool force, bool ask) */ void MDIWindow::closeEvent(QCloseEvent * ce) { - RS_DEBUG->print("MDIWindow::closeEvent begin"); + DEBUG->print("MDIWindow::closeEvent begin"); if (closeMDI(false, !forceClosing)) ce->accept(); else ce->ignore(); - RS_DEBUG->print("MDIWindow::closeEvent end"); + DEBUG->print("MDIWindow::closeEvent end"); } /** @@ -207,9 +207,9 @@ void MDIWindow::closeEvent(QCloseEvent * ce) * @param container Entity container to be used as document or NULL * if a new document should be created. */ -void MDIWindow::initDoc(RS_Document * doc) +void MDIWindow::initDoc(Document * doc) { - RS_DEBUG->print("MDIWindow::initDoc()"); + DEBUG->print("MDIWindow::initDoc()"); if (!doc) { @@ -229,7 +229,7 @@ void MDIWindow::initDoc(RS_Document * doc) */ void MDIWindow::initView() { - RS_DEBUG->print("MDIWindow::initView()"); + DEBUG->print("MDIWindow::initView()"); // graphicView = new QC_GraphicView(document, this); graphicView = new QG_GraphicView(document, this); @@ -241,14 +241,14 @@ void MDIWindow::initView() * Called when the current pen (color, style, width) has changed. * Sets the active pen for the document in this MDI window. */ -void MDIWindow::slotPenChanged(RS_Pen pen) +void MDIWindow::slotPenChanged(Pen pen) { - RS_DEBUG->print("MDIWindow::slotPenChanged() begin"); + DEBUG->print("MDIWindow::slotPenChanged() begin"); if (document) document->setActivePen(pen); - RS_DEBUG->print("MDIWindow::slotPenChanged() end"); + DEBUG->print("MDIWindow::slotPenChanged() end"); } /** @@ -256,7 +256,7 @@ void MDIWindow::slotPenChanged(RS_Pen pen) */ void MDIWindow::slotFileNew() { - RS_DEBUG->print("MDIWindow::slotFileNew begin"); + DEBUG->print("MDIWindow::slotFileNew begin"); if (document && graphicView) { @@ -264,7 +264,7 @@ void MDIWindow::slotFileNew() graphicView->redraw(); } - RS_DEBUG->print("MDIWindow::slotFileNew end"); + DEBUG->print("MDIWindow::slotFileNew end"); } /** @@ -272,7 +272,7 @@ void MDIWindow::slotFileNew() */ bool MDIWindow::slotFileOpen(const QString & fileName, RS2::FormatType type) { - RS_DEBUG->print("MDIWindow::slotFileOpen"); + DEBUG->print("MDIWindow::slotFileOpen"); bool ret = false; if (document != NULL && !fileName.isEmpty()) @@ -285,22 +285,22 @@ bool MDIWindow::slotFileOpen(const QString & fileName, RS2::FormatType type) //QString message=tr("Loaded document: ")+fileName; //statusBar()->message(message, 2000); - RS_DEBUG->print("MDIWindow::slotFileOpen: autoZoom"); + DEBUG->print("MDIWindow::slotFileOpen: autoZoom"); graphicView->zoomAuto(false); - RS_DEBUG->print("MDIWindow::slotFileOpen: autoZoom: OK"); + DEBUG->print("MDIWindow::slotFileOpen: autoZoom: OK"); } else { - RS_DEBUG->print("MDIWindow::slotFileOpen: failed"); + DEBUG->print("MDIWindow::slotFileOpen: failed"); } } else { - RS_DEBUG->print("MDIWindow::slotFileOpen: cancelled"); + DEBUG->print("MDIWindow::slotFileOpen: cancelled"); //statusBar()->message(tr("Opening aborted"), 2000); } - RS_DEBUG->print("MDIWindow::slotFileOpen: OK"); + DEBUG->print("MDIWindow::slotFileOpen: OK"); return ret; } @@ -314,7 +314,7 @@ bool MDIWindow::slotFileOpen(const QString & fileName, RS2::FormatType type) */ bool MDIWindow::slotFileSave(bool & cancelled) { - RS_DEBUG->print("MDIWindow::slotFileSave()"); + DEBUG->print("MDIWindow::slotFileSave()"); bool ret = false; cancelled = false; @@ -343,7 +343,7 @@ bool MDIWindow::slotFileSave(bool & cancelled) */ bool MDIWindow::slotFileSaveAs(bool & cancelled) { - RS_DEBUG->print("MDIWindow::slotFileSaveAs"); + DEBUG->print("MDIWindow::slotFileSaveAs"); bool ret = false; cancelled = false; RS2::FormatType t = RS2::FormatDXF; @@ -373,7 +373,7 @@ bool MDIWindow::slotFileSaveAs(bool & cancelled) */ bool MDIWindow::slotFileClose(bool force) { - RS_DEBUG->print("MDIWindow::slotFileClose()"); + DEBUG->print("MDIWindow::slotFileClose()"); bool succ = true; int exit = 0; @@ -437,7 +437,7 @@ bool MDIWindow::slotFileClose(bool force) void MDIWindow::slotFilePrint() { - RS_DEBUG->print("MDIWindow::slotFilePrint"); + DEBUG->print("MDIWindow::slotFilePrint"); //statusBar()->message(tr("Printing...")); QPrinter printer; @@ -467,7 +467,7 @@ QG_GraphicView * MDIWindow::getGraphicView() } /** @return Pointer to document */ -RS_Document * MDIWindow::getDocument() +Document * MDIWindow::getDocument() { return document; } @@ -479,7 +479,7 @@ Drawing * MDIWindow::getGraphic() } /** @return Pointer to current event handler */ -RS_EventHandler * MDIWindow::getEventHandler() +EventHandler * MDIWindow::getEventHandler() { if (graphicView) return graphicView->getEventHandler(); @@ -492,7 +492,7 @@ RS_EventHandler * MDIWindow::getEventHandler() */ void MDIWindow::setParentWindow(MDIWindow * p) { - RS_DEBUG->print("setParentWindow"); + DEBUG->print("setParentWindow"); parentWindow = p; }