#include "rs_simulationcontrols.h"
#endif
-#include "qg_colorbox.h"
-#include "qg_filedialog.h"
-#include "qg_pentoolbar.h"
+#include "colorbox.h"
+#include "filedialog.h"
+#include "pentoolbar.h"
#include "recentfiles.h"
#include "cadtoolbar.h"
#include "cadtoolbarmain.h"
CreateQtActions(this);
RS_DEBUG->print("ApplicationWindow::ApplicationWindow: creating action handler");
- actionHandler = new QG_ActionHandler(this);
+ actionHandler = new ActionHandler(this);
RS_DEBUG->print("ApplicationWindow::ApplicationWindow: creating action handler: OK");
#ifdef RS_SCRIPTING
statusBar()->showMessage(tr("Running script '%1'").arg(name), 2000);
QStringList scriptList = RS_SYSTEM->getScriptList();
- scriptList.append(RS_SYSTEM->getHomeDir() + "/.qcad/" + name);
+ scriptList.append(RS_SYSTEM->getHomeDir() + "/.architektonas/" + name);
for (QStringList::Iterator it = scriptList.begin(); it!=scriptList.end(); ++it)
{
// zoomToolBar = new Q3ToolBar(this, "Zoom Operations");
zoomToolBar = addToolBar(tr("Zoom Operations"));
zoomToolBar->setObjectName("zoom");
- penToolBar = new QG_PenToolBar(this, "Pen Selection");
+ penToolBar = new PenToolBar(this, "Pen Selection");
penToolBar->setObjectName("pen");
connect(penToolBar, SIGNAL(penChanged(RS_Pen)), this, SLOT(slotPenChanged(RS_Pen)));
// dw = new QDockWidget(QDockWidget::InDock, this, "Layer");
dw = new QDockWidget(tr("Layer List"), this);
dw->setObjectName("layer");
- layerWidget = new QG_LayerWidget(actionHandler, dw, "Layer");
+ layerWidget = new LayerWidget(actionHandler, dw, "Layer");
layerWidget->setFocusPolicy(Qt::NoFocus);
connect(layerWidget, SIGNAL(escape()), this, SLOT(slotFocus()));
connect(this, SIGNAL(windowsChanged(bool)), layerWidget, SLOT(setEnabled(bool)));
// dw = new QDockWidget(QDockWidget::InDock, this, "Block");
dw = new QDockWidget(tr("Block List"), this);
dw->setObjectName("block");
- blockWidget = new QG_BlockWidget(actionHandler, dw, "Block");
+ blockWidget = new BlockWidget(actionHandler, dw, "Block");
blockWidget->setFocusPolicy(Qt::NoFocus);
connect(blockWidget, SIGNAL(escape()), this, SLOT(slotFocus()));
connect(this, SIGNAL(windowsChanged(bool)), blockWidget, SLOT(setEnabled(bool)));
// dw->setCaption(tr("Library Browser"));
//not sure how to fix this one
#warning "QMainWindow::addDockWidget: invalid 'area' argument"
- addDockWidget(Qt::NoDockWidgetArea, dw);
+// addDockWidget(Qt::NoDockWidgetArea, dw);
+//This works, but sux
+ addDockWidget(Qt::RightDockWidgetArea, dw);
libraryDockWindow = dw;
- libraryDockWindow->hide();
+// libraryDockWindow->hide();
RS_DEBUG->print(" command widget..");
// dw = new QDockWidget(QDockWidget::InDock, this, "Command");
//which means the subwindow is NOT being activated!!!
MDIWindow * m = getMDIWindow();
RS_DEBUG->print(/*RS_Debug::D_CRITICAL,*/ "ApplicationWindow::slotWindowActivated m=%08X", m);
+
if (m)
RS_DEBUG->print(/*RS_Debug::D_CRITICAL,*/ "ApplicationWindow::slotWindowActivated m->getDoc=%08X", m->getDocument());
slotPenChanged(penToolBar->getPen());
// update toggle button status:
- if (m->getGraphic() != NULL)
+ if (m->getGraphic())
{
emit(gridChanged(m->getGraphic()->isGridOn()));
emit(printPreviewChanged(m->getGraphicView()->isPrintPreview()));
RS_DEBUG->print(" adding listeners");
Drawing * graphic = w->getDocument()->getGraphic();
+#if 0
if (graphic != NULL)
{
// Link the graphic's layer list to the pen tool bar
// Link the block list to the block widget
graphic->addBlockListListener(blockWidget);
}
+#endif
// Link the dialog factory to the mouse widget:
QG_DIALOGFACTORY->setMouseWidget(mouseWidget);
RS_DEBUG->print("ApplicationWindow::slotFileOpen() 001");
RS2::FormatType type = RS2::FormatUnknown;
RS_DEBUG->print("ApplicationWindow::slotFileOpen() 002");
- QString fileName = QG_FileDialog::getOpenFileName(this, &type);
+ QString fileName = FileDialog::getOpenFileName(this, &type);
RS_DEBUG->print("ApplicationWindow::slotFileOpen() 003");
slotFileOpen(fileName, type);
RS_DEBUG->print("ApplicationWindow::slotFileOpen(): OK");
void ApplicationWindow::slotFileOpen(const QString & fileName, RS2::FormatType type)
{
RS_DEBUG->print("ApplicationWindow::slotFileOpen(..)");
-
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
if (!fileName.isEmpty())
RS_DEBUG->print("ApplicationWindow::slotFileOpen: creating new doc window");
// Create new document window:
MDIWindow * w = slotFileNew();
-// RS_APP->processEvents(1000);
-//Really, is this needed???
-// RS_APP->processEvents(QEventLoop::AllEvents, 1000);
-
RS_DEBUG->print("ApplicationWindow::slotFileOpen: linking layer list");
// link the layer widget to the new document:
layerWidget->setLayerList(w->getDocument()->getLayerList(), false);
// link the layer widget to the new document:
simulationControls->setGraphicView(w->getGraphicView());
#endif
-
RS_DEBUG->print("ApplicationWindow::slotFileOpen: open file");
-// RS_APP->processEvents(1000);
-//We no longer try to do Qt better than the Qt folks...
-// RS_APP->processEvents(QEventLoop::AllEvents, 1000);
-
- // open the file in the new view:
- if (w->slotFileOpen(fileName, type) == false)
+ // Open the file in the new view:
+ if (!w->slotFileOpen(fileName, type))
{
// error
QApplication::restoreOverrideCursor();
recentFiles->add(fileName);
RS_DEBUG->print("ApplicationWindow::slotFileOpen: update recent file menu: 2");
-// updateRecentFilesMenu();
recentFiles->UpdateGUI();
-
RS_DEBUG->print("ApplicationWindow::slotFileOpen: update recent file menu: OK");
-
RS_DEBUG->print("ApplicationWindow::slotFileOpen: set caption");
// update caption:
-// w->setCaption(fileName);
w->setWindowTitle(fileName);
RS_DEBUG->print("ApplicationWindow::slotFileOpen: set caption: OK");
-
RS_DEBUG->print("ApplicationWindow::slotFileOpen: update coordinate widget");
// update coordinate widget format:
RS_DIALOGFACTORY->updateCoordinateWidget(Vector(0.0, 0.0), Vector(0.0, 0.0), true);
RS_DEBUG->print("ApplicationWindow::slotFileOpen: update coordinate widget: OK");
-
+ // Update the layer and block widgets (document just loaded may have some)
+ layerWidget->update();
+ blockWidget->update();
// show output of filter (if any):
-// commandWidget->processStderr();
QString message = tr("Loaded document: ") + fileName;
commandWidget->appendHistory(message);
statusBar()->showMessage(message, 2000);
void ApplicationWindow::slotFileExport()
{
RS_DEBUG->print("ApplicationWindow::slotFileExport()");
-
statusBar()->showMessage(tr("Exporting drawing..."));
-
MDIWindow * w = getMDIWindow();
- QString fn;
- if (w != NULL)
+ if (w)
{
+ QString fn;
// read default settings:
settings.beginGroup("Paths");
QString defDir = settings.value("ExportImage", RS_SYSTEM->getHomeDir()).toString();
{
MDIWindow * w = getMDIWindow();
- if (w == NULL)
+ if (!w)
{
RS_DEBUG->print(RS_Debug::D_WARNING, "ApplicationWindow::slotFileExport: no window opened");
return false;
Drawing * graphic = w->getDocument()->getGraphic();
- if (graphic == NULL)
+ if (!graphic)
{
RS_DEBUG->print(RS_Debug::D_WARNING, "ApplicationWindow::slotFileExport: no graphic");
return false;
ret = true;
}
#else
-#warning "Need to port to Qt4... !!! FIX !!!"
+#warning "ApplicationWindow::slotFileExport(): Need to port to Qt4... !!! FIX !!!"
#endif
QApplication::restoreOverrideCursor();
MDIWindow * m = getMDIWindow();
- if (m != NULL)
+ if (m)
// m->close(true);
m->close();
// printer setup:
// if (printer->setup(this))
QPrintDialog dialog(printer, this);
+
if (dialog.exec())
{
//printer->setOutputToFile(true);
RS_DEBUG->print(" creating MDI window");
MDIWindow * parent = getMDIWindow();
- if (parent == NULL)
+ if (!parent)
{
RS_DEBUG->print(RS_Debug::D_WARNING, "ApplicationWindow::slotFilePrintPreview: no window opened");
return;
RS_DEBUG->print(" adding listeners");
Drawing * graphic = w->getDocument()->getGraphic();
- if (graphic != NULL)
+ if (graphic)
{
+#if 0
// Link the layer list to the pen tool bar
graphic->addLayerListListener(penToolBar);
// Link the layer list to the layer widget
graphic->addLayerListListener(layerWidget);
// Link the block list to the block widget
graphic->addBlockListListener(blockWidget);
+#endif
// Center by default:
graphic->centerToPage();
}
qApp->exit(0);
}
+#if 0
/**
* Forces termination of QCad (demo version).
*/
queryExit(true);
qApp->exit(0);
}
+#endif
/**
* Shows / hides the grid.
QString modulesString;
- if (modules.empty() == false)
+ if (!modules.empty())
modulesString = modules.join(", ");
else
modulesString = tr("None");
tr("Version: %1").arg("1.0.0") + "<br>" +
tr("Date: %1").arg(__DATE__) + "<br>" +
QString("© 2010 Underground Software,<br>James Hammons") +
+ "<br>" +
+ QString("Portions © 2001-2003 RibbonSoft") +
"<br>"
#ifdef QC_ABOUT_ADD_COMPANY
+ QString("<br>") + QC_ABOUT_ADD_COMPANY
/**
* @return Pointer to action handler. Implementation from QG_MainWindowInterface.
*/
-/*virtual*/ QG_ActionHandler * ApplicationWindow::getActionHandler()
+/*virtual*/ ActionHandler * ApplicationWindow::getActionHandler()
{
return actionHandler;
}