]> Shamusworld >> Repos - architektonas/blobdiff - src/mainapp/applicationwindow.cpp
Refactoring: Moved RS_GraphicView to GraphicView.
[architektonas] / src / mainapp / applicationwindow.cpp
index e91576fcfeb078a2e4a75823032e8651a75bb338..326854eee048c1c6526466da40e94d79f0150ecf 100644 (file)
@@ -48,6 +48,7 @@
 #include "qg_colorbox.h"
 #include "qg_filedialog.h"
 #include "qg_pentoolbar.h"
+#include "recentfiles.h"
 #include "cadtoolbar.h"
 #include "cadtoolbarmain.h"
 #include "coordinatewidget.h"
@@ -251,7 +252,7 @@ void ApplicationWindow::slotInsertBlock(const QString & name)
 
        statusBar()->showMessage(tr("Inserting block '%1'").arg(name), 2000);
 
-       RS_GraphicView * graphicView = getGraphicView();
+       GraphicView * graphicView = getGraphicView();
        RS_Document * document = getDocument();
 
        if (graphicView != NULL && document != NULL)
@@ -1262,7 +1263,7 @@ void ApplicationWindow::initMenuBar()
 //             menuBar()->insertItem(tr("De&bugging"), testMenu);
                menuBar()->addMenu(testMenu);
 
-       recentFiles = new QG_RecentFiles(this, fileMenu);
+       recentFiles = new RecentFiles(this, fileMenu);
 }
 
 /**
@@ -1544,43 +1545,12 @@ void ApplicationWindow::initView()
        }
 }*/
 
-#warning "!!! ApplicationWindow::updateRecentFilesMenu() is DEPRECATED !!!"
-/**
- * Updates the recent file list in the file menu.
- */
-void ApplicationWindow::updateRecentFilesMenu()
-{
-       RS_DEBUG->print("ApplicationWindow::updateRecentFilesMenu()");
-       RS_DEBUG->print("Updating recent file menu...");
-
-#if 0
-       for(int i=0; i<recentFiles->getNumber(); ++i)
-       {
-               QString label = QString("&%1 %2").arg(i + 1).arg(recentFiles->get(i));
-
-               if (fileMenu->findItem(i))
-               {
-                       RS_DEBUG->print("Changeing item %d", i);
-                       fileMenu->changeItem(i, label);
-               }
-               else if (i < int(recentFiles->count()))
-               {
-                       RS_DEBUG->print("Adding item %d", i);
-                       fileMenu->insertItem(label, this, SLOT(slotFileOpenRecent(int)), 0, i);
-               }
-       }
-#else
-//#warning "!!! Need to fix ApplicationWindow::updateRecentFilesMenu() !!!"
-       recentFiles->UpdateGUI();
-#endif
-}
-
 /**
  * Goes back to the previous menu or one step in the current action.
  */
 void ApplicationWindow::slotBack()
 {
-       RS_GraphicView * graphicView = getGraphicView();
+       GraphicView * graphicView = getGraphicView();
 
        if (graphicView != NULL)
                graphicView->back();
@@ -1602,7 +1572,7 @@ void ApplicationWindow::slotEnter()
                        cadToolBar->forceNext();
                else
                {
-                       RS_GraphicView * graphicView = getGraphicView();
+                       GraphicView * graphicView = getGraphicView();
 
                        if (graphicView != NULL)
                                graphicView->enter();
@@ -3508,7 +3478,7 @@ void ApplicationWindow::slotTestInsertBlock()
                ins->update();
                graphic->addEntity(ins);
 
-               RS_GraphicView * v = getGraphicView();
+               GraphicView * v = getGraphicView();
 
                if (v != NULL)
                        v->redraw();
@@ -3650,7 +3620,7 @@ void ApplicationWindow::slotTestInsertEllipse()
                                }
                */
 
-               RS_GraphicView * v = getGraphicView();
+               GraphicView * v = getGraphicView();
 
                if (v != NULL)
                        v->redraw();
@@ -3752,7 +3722,7 @@ void ApplicationWindow::slotTestInsertText()
                                                RS2::SolidLine));
                graphic->addEntity(s);
 
-               RS_GraphicView* v = getGraphicView();
+               GraphicView* v = getGraphicView();
                if (v!=NULL) {
                        v->redraw();
                }
@@ -3902,7 +3872,7 @@ void ApplicationWindow::slotTestMath01()
         //                   Vector(6.0,cos(x_0)-sin(x_0)*(6.0-x_0))));
 
 
-        RS_GraphicView* v = getGraphicView();
+        GraphicView* v = getGraphicView();
         if (v!=NULL) {
             v->redraw();
         }
@@ -4011,7 +3981,7 @@ void ApplicationWindow::keyPressEvent(QKeyEvent * e)
                QMainWindow::keyPressEvent(e);
 
                // forward to actions:
-               RS_GraphicView * graphicView = getGraphicView();
+               GraphicView * graphicView = getGraphicView();
 
                if (graphicView != NULL)
                        graphicView->keyPressEvent(e);
@@ -4101,7 +4071,7 @@ void ApplicationWindow::keyReleaseEvent(QKeyEvent * e)
                QMainWindow::keyReleaseEvent(e);
 
                // forward to actions:
-               RS_GraphicView * graphicView = getGraphicView();
+               GraphicView * graphicView = getGraphicView();
 
                if (graphicView != NULL)
                        graphicView->keyReleaseEvent(e);
@@ -4155,7 +4125,7 @@ MDIWindow * ApplicationWindow::getMDIWindow()
  * @return Pointer to the graphic view of the currently active document
  * window or NULL if no window is available.
  */
-/*virtual*/ RS_GraphicView * ApplicationWindow::getGraphicView()
+/*virtual*/ GraphicView * ApplicationWindow::getGraphicView()
 {
        MDIWindow * m = getMDIWindow();