X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fapplicationwindow.cpp;h=ef42ca24a6acc9fc2c00089965f7855ff5e13852;hb=f97fcdd0f5c95d15cc8f03a818ed8e90e76e8f5a;hp=77767f0610ae2a32b9d2df941a48f1db2e97f5b1;hpb=f3110724be7ad4d4e8c6b97d350ff8af7fbf3799;p=architektonas diff --git a/src/applicationwindow.cpp b/src/applicationwindow.cpp index 77767f0..ef42ca2 100644 --- a/src/applicationwindow.cpp +++ b/src/applicationwindow.cpp @@ -29,9 +29,11 @@ #include "applicationwindow.h" #include "about.h" +#include "blockwidget.h" #include "drawingview.h" #include "fileio.h" #include "generaltab.h" +#include "layerwidget.h" #include "painter.h" #include "settingsdialog.h" @@ -53,20 +55,23 @@ ApplicationWindow::ApplicationWindow(): settings("Underground Software", "Archit CreateMenus(); CreateToolbars(); + // Create Dock widgets + QDockWidget * dock1 = new QDockWidget(tr("Layers"), this); + LayerWidget * lw = new LayerWidget; + dock1->setWidget(lw); + addDockWidget(Qt::RightDockWidgetArea, dock1); + QDockWidget * dock2 = new QDockWidget(tr("Blocks"), this); +// BlockWidget * bw = new BlockWidget; +// dock2->setWidget(bw); + addDockWidget(Qt::RightDockWidgetArea, dock2); + // Create status bar zoomIndicator = new QLabel("Grid: 12.0\" Zoom: 12.5%"); statusBar()->addPermanentWidget(zoomIndicator); statusBar()->showMessage(tr("Ready")); ReadSettings(); - -// connect(textEdit->document(), SIGNAL(contentsChanged()), -// this, SLOT(documentWasModified())); - -// setCurrentFile(""); setUnifiedTitleAndToolBarOnMac(true); - -// ((TTEdit *)qApp)->charWnd->show();//eh? Object::SetFont(new QFont("Verdana", 15, QFont::Bold)); } @@ -398,8 +403,10 @@ void ApplicationWindow::Settings(void) // void ApplicationWindow::HandleGrouping(void) { + int itemsSelected = drawing->document.ItemsSelected(); + // If nothing selected, do nothing - if (drawing->document.ItemsSelected() == 0) + if (itemsSelected == 0) { statusBar()->showMessage(tr("No objects selected to make a group from.")); return; @@ -407,7 +414,7 @@ void ApplicationWindow::HandleGrouping(void) // If it's a group that's selected, ungroup it and leave the objects in a // selected state - if (drawing->document.ItemsSelected() == 1) + if (itemsSelected == 1) { Object * object = drawing->document.SelectedItem(0); @@ -431,16 +438,18 @@ else ((Container *)object)->SelectAll(); ((Container *)object)->MoveContentsTo(&(drawing->document)); drawing->document.Delete(object); + statusBar()->showMessage(tr("Objects ungrouped.")); } // Otherwise, if it's a group of 2 or more objects (which can be groups too) // group them and select the group - else if (drawing->document.ItemsSelected() > 1) + else if (itemsSelected > 1) { Container * container = new Container(Vector(), &(drawing->document)); drawing->document.MoveSelectedContentsTo(container); drawing->document.Add(container); container->DeselectAll(); container->state = OSSelected; + statusBar()->showMessage(QString(tr("Grouped %1 objects.")).arg(itemsSelected)); } drawing->update(); @@ -453,7 +462,7 @@ void ApplicationWindow::CreateActions(void) QIcon(":/res/quit.png"), QKeySequence(tr("Ctrl+q"))); connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); - snapToGridAct = CreateAction(tr("Snap To &Grid"), tr("Snap To Grid"), tr("Snaps mouse cursor to the visible grid when moving/creating objects."), QIcon(":/res/generic-tool.png"), QKeySequence(tr("S")), true); + snapToGridAct = CreateAction(tr("Snap To &Grid"), tr("Snap To Grid"), tr("Snaps mouse cursor to the visible grid when moving/creating objects."), QIcon(":/res/snap-to-grid-tool.png"), QKeySequence(tr("S")), true); connect(snapToGridAct, SIGNAL(triggered()), this, SLOT(SnapToGridTool())); fixAngleAct = CreateAction(tr("Fix &Angle"), tr("Fix Angle"), tr("Fixes the angle of an object."), @@ -511,7 +520,7 @@ void ApplicationWindow::CreateActions(void) settingsAct = CreateAction(tr("&Settings"), tr("Settings"), tr("Change certain defaults for Architektonas."), QIcon(":/res/generic-tool.png"), QKeySequence()); connect(settingsAct, SIGNAL(triggered()), this, SLOT(Settings())); - groupAct = CreateAction(tr("&Group"), tr("Group"), tr("Group/ungroup selected objects."), QIcon(":/res/generic-tool.png"), QKeySequence("g")); + groupAct = CreateAction(tr("&Group"), tr("Group"), tr("Group/ungroup selected objects."), QIcon(":/res/group-tool.png"), QKeySequence("g")); connect(groupAct, SIGNAL(triggered()), this, SLOT(HandleGrouping())); //Hm. I think we'll have to have separate logic to do the "Radio Group Toolbar" thing...