]> Shamusworld >> Repos - architektonas/blobdiff - src/mainapp/mdiwindow.cpp
Removed more QC_ madness...
[architektonas] / src / mainapp / mdiwindow.cpp
similarity index 79%
rename from src/mainapp/qc_mdiwindow.cpp
rename to src/mainapp/mdiwindow.cpp
index fa3c12f95d2210b0e62e4729cae5fa5dbb87da9a..d4f4e1aeddfe6ebfe1419c250dcdc64a6ed34bde 100644 (file)
@@ -1,4 +1,4 @@
-// qc_mdiwindow.cpp
+// mdiwindow.cpp
 //
 // Part of the Architektonas Project
 // Originally part of QCad Community Edition by Andrew Mustun
@@ -12,7 +12,7 @@
 // JLH  05/17/2010  Added this text. :-)
 //
 
-#include "qc_mdiwindow.h"
+#include "mdiwindow.h"
 
 #include "drawing.h"
 #include "rs_eventhandler.h"
@@ -20,7 +20,7 @@
 #include "qg_filedialog.h"
 
 // Class variable
-int QC_MDIWindow::idCounter = 0;
+int MDIWindow::idCounter = 0;
 
 /**
  * Constructor.
@@ -29,9 +29,8 @@ int QC_MDIWindow::idCounter = 0;
  *   document shall be created for this window.
  * @param parent Parent widget. Usually a workspace.
  */
-QC_MDIWindow::QC_MDIWindow(RS_Document * doc, QWidget * parent, const char * name/*= NULL*/,
+MDIWindow::MDIWindow(RS_Document * doc, QWidget * parent, const char * name/*= NULL*/,
        Qt::WindowFlags wflags/*= Qt::WDestructiveClose*/):
-//     Q3MainWindow(parent, name, wflags)
        QMdiSubWindow(parent, Qt::SubWindow)
 #warning "!!! wflags is ignored !!!"
 {
@@ -66,7 +65,7 @@ QC_MDIWindow::QC_MDIWindow(RS_Document * doc, QWidget * parent, const char * nam
  *
  * Deletes the document associated with this window.
  */
-QC_MDIWindow::~QC_MDIWindow()
+MDIWindow::~MDIWindow()
 {
        if (document->getLayerList() != NULL)
                document->getLayerList()->removeListener(graphicView);
@@ -85,7 +84,7 @@ QC_MDIWindow::~QC_MDIWindow()
  * depend on this one. This can be another view or a view for
  * a particular block.
  */
-void QC_MDIWindow::addChildWindow(QC_MDIWindow * w)
+void MDIWindow::addChildWindow(MDIWindow * w)
 {
     RS_DEBUG->print("RS_MDIWindow::addChildWindow()");
 
@@ -100,7 +99,7 @@ void QC_MDIWindow::addChildWindow(QC_MDIWindow * w)
  *
  * @see addChildWindow
  */
-void QC_MDIWindow::removeChildWindow(QC_MDIWindow * w)
+void MDIWindow::removeChildWindow(MDIWindow * w)
 {
     RS_DEBUG->print("RS_MDIWindow::removeChildWindow()");
 
@@ -114,7 +113,7 @@ void QC_MDIWindow::removeChildWindow(QC_MDIWindow * w)
 /**
  * @return pointer to the print preview of this drawing or NULL.
  */
-QC_MDIWindow * QC_MDIWindow::getPrintPreview()
+MDIWindow * MDIWindow::getPrintPreview()
 {
     for(uint i=0; i<childWindows.count(); ++i)
        {
@@ -131,7 +130,7 @@ QC_MDIWindow * QC_MDIWindow::getPrintPreview()
  * @param force Disable cancel button (demo versions)
  * @param ask Ask user before closing.
  */
-bool QC_MDIWindow::closeMDI(bool force, bool ask)
+bool MDIWindow::closeMDI(bool force, bool ask)
 {
        // should never happen:
        if (document == NULL)
@@ -177,7 +176,7 @@ bool QC_MDIWindow::closeMDI(bool force, bool ask)
 #else
                while (!childWindows.isEmpty())
                {
-                       QC_MDIWindow * child = childWindows.takeFirst();
+                       MDIWindow * child = childWindows.takeFirst();
 
                        if (child)
                                child->close();
@@ -199,16 +198,16 @@ bool QC_MDIWindow::closeMDI(bool force, bool ask)
 /**
  * Called by Qt when the user closes this MDI window.
  */
-void QC_MDIWindow::closeEvent(QCloseEvent * ce)
+void MDIWindow::closeEvent(QCloseEvent * ce)
 {
-    RS_DEBUG->print("QC_MDIWindow::closeEvent begin");
+    RS_DEBUG->print("MDIWindow::closeEvent begin");
 
     if (closeMDI(false, !forceClosing))
         ce->accept();
     else
         ce->ignore();
 
-    RS_DEBUG->print("QC_MDIWindow::closeEvent end");
+    RS_DEBUG->print("MDIWindow::closeEvent end");
 }
 
 /**
@@ -218,9 +217,9 @@ void QC_MDIWindow::closeEvent(QCloseEvent * ce)
  * @param container Entity container to be used as document or NULL
  * if a new document should be created.
  */
-void QC_MDIWindow::initDoc(RS_Document * doc)
+void MDIWindow::initDoc(RS_Document * doc)
 {
-       RS_DEBUG->print("QC_MDIWindow::initDoc()");
+       RS_DEBUG->print("MDIWindow::initDoc()");
 
        if (doc == NULL)
        {
@@ -238,9 +237,9 @@ void QC_MDIWindow::initDoc(RS_Document * doc)
 /**
  * Init the view.
  */
-void QC_MDIWindow::initView()
+void MDIWindow::initView()
 {
-       RS_DEBUG->print("QC_MDIWindow::initView()");
+       RS_DEBUG->print("MDIWindow::initView()");
 
        graphicView = new QC_GraphicView(document, this);
 //     setCentralWidget(graphicView);
@@ -252,22 +251,22 @@ void QC_MDIWindow::initView()
  * Called when the current pen (color, style, width) has changed.
  * Sets the active pen for the document in this MDI window.
  */
-void QC_MDIWindow::slotPenChanged(RS_Pen pen)
+void MDIWindow::slotPenChanged(RS_Pen pen)
 {
-       RS_DEBUG->print("QC_MDIWindow::slotPenChanged() begin");
+       RS_DEBUG->print("MDIWindow::slotPenChanged() begin");
 
        if (document != NULL)
                document->setActivePen(pen);
 
-       RS_DEBUG->print("QC_MDIWindow::slotPenChanged() end");
+       RS_DEBUG->print("MDIWindow::slotPenChanged() end");
 }
 
 /**
  * Creates a new empty document in this MDI window.
  */
-void QC_MDIWindow::slotFileNew()
+void MDIWindow::slotFileNew()
 {
-       RS_DEBUG->print("QC_MDIWindow::slotFileNew begin");
+       RS_DEBUG->print("MDIWindow::slotFileNew begin");
 
        if (document != NULL && graphicView != NULL)
        {
@@ -275,15 +274,15 @@ void QC_MDIWindow::slotFileNew()
                graphicView->redraw();
        }
 
-       RS_DEBUG->print("QC_MDIWindow::slotFileNew end");
+       RS_DEBUG->print("MDIWindow::slotFileNew end");
 }
 
 /**
  * Opens the given file in this MDI window.
  */
-bool QC_MDIWindow::slotFileOpen(const QString & fileName, RS2::FormatType type)
+bool MDIWindow::slotFileOpen(const QString & fileName, RS2::FormatType type)
 {
-       RS_DEBUG->print("QC_MDIWindow::slotFileOpen");
+       RS_DEBUG->print("MDIWindow::slotFileOpen");
        bool ret = false;
 
        if (document != NULL && !fileName.isEmpty())
@@ -300,22 +299,22 @@ bool QC_MDIWindow::slotFileOpen(const QString & fileName, RS2::FormatType type)
                        //QString message=tr("Loaded document: ")+fileName;
                        //statusBar()->message(message, 2000);
 
-                       RS_DEBUG->print("QC_MDIWindow::slotFileOpen: autoZoom");
+                       RS_DEBUG->print("MDIWindow::slotFileOpen: autoZoom");
                        graphicView->zoomAuto(false);
-                       RS_DEBUG->print("QC_MDIWindow::slotFileOpen: autoZoom: OK");
+                       RS_DEBUG->print("MDIWindow::slotFileOpen: autoZoom: OK");
                }
                else
                {
-                       RS_DEBUG->print("QC_MDIWindow::slotFileOpen: failed");
+                       RS_DEBUG->print("MDIWindow::slotFileOpen: failed");
                }
        }
        else
        {
-               RS_DEBUG->print("QC_MDIWindow::slotFileOpen: cancelled");
+               RS_DEBUG->print("MDIWindow::slotFileOpen: cancelled");
                //statusBar()->message(tr("Opening aborted"), 2000);
        }
 
-       RS_DEBUG->print("QC_MDIWindow::slotFileOpen: OK");
+       RS_DEBUG->print("MDIWindow::slotFileOpen: OK");
 
        return ret;
 }
@@ -327,9 +326,9 @@ bool QC_MDIWindow::slotFileOpen(const QString & fileName, RS2::FormatType type)
  *         false if the file could not be saved or the document
  *         is invalid.
  */
-bool QC_MDIWindow::slotFileSave(bool & cancelled)
+bool MDIWindow::slotFileSave(bool & cancelled)
 {
-       RS_DEBUG->print("QC_MDIWindow::slotFileSave()");
+       RS_DEBUG->print("MDIWindow::slotFileSave()");
        bool ret = false;
        cancelled = false;
 
@@ -356,9 +355,9 @@ bool QC_MDIWindow::slotFileSave(bool & cancelled)
  *         false if the file could not be saved or the document
  *         is invalid.
  */
-bool QC_MDIWindow::slotFileSaveAs(bool & cancelled)
+bool MDIWindow::slotFileSaveAs(bool & cancelled)
 {
-       RS_DEBUG->print("QC_MDIWindow::slotFileSaveAs");
+       RS_DEBUG->print("MDIWindow::slotFileSaveAs");
        bool ret = false;
        cancelled = false;
        RS2::FormatType t = RS2::FormatDXF;
@@ -386,9 +385,9 @@ bool QC_MDIWindow::slotFileSaveAs(bool & cancelled)
  *
  * @param force Force closing by disabling the cancel button (for demo versions).
  */
-bool QC_MDIWindow::slotFileClose(bool force)
+bool MDIWindow::slotFileClose(bool force)
 {
-       RS_DEBUG->print("QC_MDIWindow::slotFileClose()");
+       RS_DEBUG->print("MDIWindow::slotFileClose()");
 
        bool succ = true;
        int exit = 0;
@@ -450,9 +449,9 @@ bool QC_MDIWindow::slotFileClose(bool force)
        return succ;
 }
 
-void QC_MDIWindow::slotFilePrint()
+void MDIWindow::slotFilePrint()
 {
-       RS_DEBUG->print("QC_MDIWindow::slotFilePrint");
+       RS_DEBUG->print("MDIWindow::slotFilePrint");
 
        //statusBar()->message(tr("Printing..."));
        QPrinter printer;
@@ -475,25 +474,25 @@ void QC_MDIWindow::slotFilePrint()
 }
 
 /** @return Pointer to graphic view */
-QC_GraphicView * QC_MDIWindow::getGraphicView()
+QC_GraphicView * MDIWindow::getGraphicView()
 {
        return graphicView;
 }
 
 /** @return Pointer to document */
-RS_Document * QC_MDIWindow::getDocument()
+RS_Document * MDIWindow::getDocument()
 {
        return document;
 }
 
 /** @return Pointer to graphic or NULL */
-Drawing * QC_MDIWindow::getGraphic()
+Drawing * MDIWindow::getGraphic()
 {
        return document->getGraphic();
 }
 
 /** @return Pointer to current event handler */
-RS_EventHandler * QC_MDIWindow::getEventHandler()
+RS_EventHandler * MDIWindow::getEventHandler()
 {
        if (graphicView != NULL)
                return graphicView->getEventHandler();
@@ -504,7 +503,7 @@ RS_EventHandler * QC_MDIWindow::getEventHandler()
 /**
  * Sets the parent window that will be notified if this
  */
-void QC_MDIWindow::setParentWindow(QC_MDIWindow * p)
+void MDIWindow::setParentWindow(MDIWindow * p)
 {
        RS_DEBUG->print("setParentWindow");
        parentWindow = p;
@@ -513,12 +512,12 @@ void QC_MDIWindow::setParentWindow(QC_MDIWindow * p)
 /**
  * @return The MDI window id.
  */
-int QC_MDIWindow::getId()
+int MDIWindow::getId()
 {
        return id;
 }
 
-void QC_MDIWindow::setForceClosing(bool on)
+void MDIWindow::setForceClosing(bool on)
 {
        forceClosing = on;
 }
@@ -526,9 +525,9 @@ void QC_MDIWindow::setForceClosing(bool on)
 /**
  * Streams some info about an MDI window to stdout.
  */
-std::ostream & operator<<(std::ostream & os, QC_MDIWindow & w)
+std::ostream & operator<<(std::ostream & os, MDIWindow & w)
 {
-       os << "QC_MDIWindow[" << w.getId() << "]:\n";
+       os << "MDIWindow[" << w.getId() << "]:\n";
 
        if (w.parentWindow!=NULL)
                os << "  parentWindow: " << w.parentWindow->getId() << "\n";