27 #include "../../common/progress/ProgressManager.h"
28 #include "../../common/progress/TaskProgress.h"
29 #include "../../common/SystemApplicationSettings.h"
30 #include "../../common/STLUtils.h"
31 #include "../../common/Translator.h"
32 #include "../../common/UserApplicationSettings.h"
33 #include "../../maptools/Utils.h"
34 #include "../../srs/Config.h"
35 #include "../widgets/canvas/EyeBirdMapDisplayWidget.h"
36 #include "../widgets/canvas/MultiThreadMapDisplay.h"
37 #include "../widgets/canvas/ZoomInMapDisplayWidget.h"
38 #include "../widgets/charts/ChartLayerDialog.h"
39 #include "../widgets/charts/HistogramDialog.h"
40 #include "../widgets/charts/ScatterDialog.h"
41 #include "../widgets/datasource/core/DataSourceType.h"
42 #include "../widgets/datasource/core/DataSourceTypeManager.h"
43 #include "../widgets/datasource/selector/DataSourceExplorerDialog.h"
44 #include "../widgets/datasource/selector/DataSourceSelectorDialog.h"
45 #include "../widgets/exchanger/DataExchangerWizard.h"
46 #include "../widgets/exchanger/DirectExchangerDialog.h"
47 #include "../widgets/externalTable/DataPropertiesDialog.h"
48 #include "../widgets/help/HelpManager.h"
49 #include "../widgets/layer/explorer/ColorMapItem.h"
50 #include "../widgets/layer/explorer/ChartItem.h"
51 #include "../widgets/layer/explorer/GroupingItem.h"
52 #include "../widgets/layer/explorer/LayerExplorer.h"
53 #include "../widgets/layer/explorer/LayerTreeView.h"
54 #include "../widgets/layer/explorer/AbstractTreeItem.h"
55 #include "../widgets/layer/explorer/FolderLayerItem.h"
56 #include "../widgets/layer/info/LayerPropertiesInfoWidget.h"
57 #include "../widgets/layer/selector/AbstractLayerSelector.h"
58 #include "../widgets/plugin/manager/PluginManagerDialog.h"
59 #include "../widgets/progress/ProgressViewerBar.h"
60 #include "../widgets/progress/ProgressViewerDialog.h"
61 #include "../widgets/progress/ProgressViewerWidget.h"
62 #include "../widgets/query/QueryLayerBuilderWizard.h"
63 #include "../widgets/query/QueryDialog.h"
64 #include "../widgets/se/GroupingDialog.h"
65 #include "../widgets/se/StyleDockWidget.h"
66 #include "../widgets/tools/Info.h"
67 #include "../widgets/tools/Measure.h"
68 #include "../widgets/tools/Pan.h"
69 #include "../widgets/tools/Selection.h"
70 #include "../widgets/tools/ZoomArea.h"
71 #include "../widgets/tools/ZoomClick.h"
72 #include "../widgets/srs/SRSManagerDialog.h"
94 #include <QtCore/QDir>
95 #include <QtGui/QActionGroup>
96 #include <QtGui/QApplication>
97 #include <QtGui/QCloseEvent>
98 #include <QtGui/QDockWidget>
99 #include <QtGui/QFileDialog>
100 #include <QtGui/QInputDialog>
101 #include <QtGui/QMenu>
102 #include <QtGui/QMenuBar>
103 #include <QtGui/QMessageBox>
104 #include <QtGui/QStatusBar>
105 #include <QtGui/QToolBar>
106 #include <QtGui/QToolButton>
114 #include <boost/filesystem.hpp>
115 #include <boost/format.hpp>
116 #include <boost/uuid/random_generator.hpp>
117 #include <boost/uuid/uuid_io.hpp>
122 std::vector<te::qt::af::DataSetTableDockWidget*>::const_iterator it;
124 for(it=docs.begin(); it!=docs.end(); ++it)
125 if((*it)->getLayer() == layer)
133 std::vector<te::qt::af::DataSetTableDockWidget*>::iterator it;
135 for(it=tables.begin(); it!=tables.end(); ++it)
142 : QMainWindow(parent, 0),
143 m_mapCursorSize(QSize(20, 20)),
148 m_progressDockWidget(0),
149 m_zoomInDisplaysDockWidget(0),
150 m_eyeBirdDisplaysDockWidget(0),
155 if (objectName().isEmpty())
156 setObjectName(
"BaseApplicationForm");
159 setMinimumSize(QSize(640, 480));
198 delete m_styleExplorer;
200 delete m_progressDockWidget;
201 delete m_zoomInDisplaysDockWidget;
202 delete m_eyeBirdDisplaysDockWidget;
204 while(!m_tableDocks.empty())
205 delete *m_tableDocks.begin();
214 throw Exception(
"Not implemented yet!");
225 catch(
const std::exception& e)
227 QString msgErr(tr(
"Could not initialize the application: %1"));
229 msgErr = msgErr.arg(e.what());
248 catch(
const std::exception& e)
250 QString msgErr(tr(
"Error loading plugins: %1"));
252 msgErr = msgErr.arg(e.what());
266 openProject(recentProject);
270 QString msgErr(tr(
"Error loading the project: %1!"));
272 msgErr = msgErr.arg(ex.
what());
281 onSelectionToggled(
true);
282 m_mapSelection->setChecked(
true);
284 m_viewDataTable->setChecked(
false);
285 m_viewDataTable->setEnabled(
false);
302 m_project->setProjectAsChanged(
true);
309 QMainWindow::addToolBar(Qt::TopToolBarArea, e->
m_toolbar);
316 QString text =
"(" + QString::number(e->
m_x,
'f', 5) +
" , " + QString::number(e->
m_y,
'f', 5) +
")";
317 m_coordinateLineEdit->setText(text);
325 std::pair<int, std::string> srid = e->
m_srid;
329 QString sridText(srid.second.c_str());
330 sridText +=
":" + QString::number(srid.first);
331 m_mapSRIDLineEdit->setText(sridText);
335 m_mapSRIDLineEdit->setText(
"Unknown SRS");
336 m_coordinateLineEdit->setText(
"Coordinates");
353 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedLayerItems();
355 if(selectedLayerItems.size() == 1 && selectedLayerItems.front()->getItemType() ==
"FOLDER_LAYER_ITEM")
356 parentLayer = selectedLayerItems.front()->getLayer();
363 if(!dsTypeSett.isNull() && !dsTypeSett.isEmpty())
364 dselector->setDataSourceToUse(dsTypeSett);
366 int retval = dselector->exec();
368 if(retval == QDialog::Rejected)
371 std::list<te::da::DataSourceInfoPtr> selectedDatasources = dselector->getSelecteds();
373 if(selectedDatasources.empty())
378 const std::string& dsTypeId = selectedDatasources.front()->getType();
384 if(lselectorw.get() == 0)
385 throw Exception((boost::format(
TR_QT_AF(
"No layer selector widget found for this type of data source: %1%!")) % dsTypeId).str());
390 throw Exception(
TR_QT_AF(
"Wrong type of object for layer selection!"));
392 lselector->
set(selectedDatasources);
394 std::list<te::map::AbstractLayerPtr> layers = lselector->
getLayers();
399 throw Exception(
TR_QT_AF(
"Error: there is no opened project!"));
401 std::list<te::map::AbstractLayerPtr>::const_iterator it = layers.begin();
402 std::list<te::map::AbstractLayerPtr>::const_iterator itend = layers.end();
406 if((m_explorer != 0) && (m_explorer->getExplorer() != 0))
419 catch(
const std::exception& e)
425 QMessageBox::warning(
this,
427 tr(
"Unknown error while trying to add a layer from a dataset!"));
436 throw Exception(
TR_QT_AF(
"Error: there is no opened project!"));
441 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedLayerItems();
443 if(selectedLayerItems.size() == 1 && selectedLayerItems.front()->getItemType() ==
"FOLDER_LAYER_ITEM")
444 parentLayer = selectedLayerItems.front()->getLayer();
450 qlb->setLayerList(layers);
452 int retval = qlb->exec();
454 if(retval == QDialog::Rejected)
459 if((m_explorer != 0) && (m_explorer->getExplorer() != 0))
468 catch(
const std::exception& e)
474 QMessageBox::warning(
this,
476 tr(
"Unknown error while trying to add a layer from a queried dataset!"));
485 throw Exception(
TR_QT_AF(
"Error: there is no opened project!"));
490 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedLayerItems();
492 if(selectedLayerItems.size() == 1 && selectedLayerItems.front()->getItemType() ==
"FOLDER_LAYER_ITEM")
493 parentLayer = selectedLayerItems.front()->getLayer();
496 int res = dlg.exec();
497 if (res == QDialog::Accepted)
499 if((m_explorer != 0) && (m_explorer->getExplorer() != 0))
509 catch(
const std::exception& e)
515 QMessageBox::warning(
this,
517 tr(
"Unknown error while trying to add a layer from a queried dataset!"));
523 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedLayerItems();
525 if(selectedLayerItems.empty())
527 QString msg = tr(
"Select at least one layer to be removed!");
528 QMessageBox::warning(
this, tr(
"Remove Layer"), msg);
534 QString questionTitle;
536 if(selectedLayerItems.size() == 1)
538 msg = tr(
"Do you really want to remove the selected layer?");
539 questionTitle = tr(
"Remove Layer");
543 msg = tr(
"Do you really want to remove the selected layers?");
544 questionTitle = tr(
"Remove Layers");
547 int reply = QMessageBox::question(
this, questionTitle, msg, QMessageBox::No, QMessageBox::Yes);
549 if(reply == QMessageBox::No)
552 std::list<te::qt::widgets::AbstractTreeItem*>::const_iterator it;
553 for(it = selectedLayerItems.begin(); it != selectedLayerItems.end(); ++it)
562 std::list<te::qt::widgets::AbstractTreeItem*> selectedItems = m_explorer->getExplorer()->getSelectedItems();
564 std::list<te::qt::widgets::AbstractTreeItem*>::const_iterator it;
565 for(it = selectedItems.begin(); it != selectedItems.end(); ++it)
574 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedLayerItems();
576 if(selectedLayerItems.empty() ||
577 (selectedLayerItems.size() == 1 && !selectedLayerItems.front()->getLayer()) ||
578 selectedLayerItems.size() > 1)
580 QString msg = tr(
"Select only one layer to be renamed!");
581 QMessageBox::warning(
this, tr(
"Rename Layer"), msg);
588 tr(
"Rename Layer:"), QLineEdit::Normal,
589 tr(
"Enter the new layer name"), &ok);
602 layer->setTitle(text.toStdString());
615 catch(
const std::exception& e)
623 QString projFile = proj->data().toString();
625 openProject(projFile);
632 onSaveProjectAsTriggered();
637 QString file = QFileDialog::getOpenFileName(
this, tr(
"Open project file"), qApp->applicationDirPath(), tr(
"XML File (*.xml *.XML)"));
648 QString msg = tr(
"Fail to open project.");
657 std::string fName = m_project->getFileName();
661 QString fileName = QFileDialog::getSaveFileName(
this, tr(
"Save Project File"), qApp->applicationDirPath(), tr(
"XML Files (*.xml *.XML)"));
663 if(!fileName.isEmpty())
665 fName = fileName.toStdString();
666 m_project->setFileName(fName);
677 m_project->setProjectAsChanged(
false);
691 QString fileName = QFileDialog::getSaveFileName(
this, tr(
"Save Project File"), qApp->applicationDirPath(), tr(
"XML Files (*.xml *.XML)"));
693 if(fileName.isEmpty())
696 std::string fName = fileName.toStdString();
698 m_project->setFileName(fName);
702 m_project->setProjectAsChanged(
false);
708 QString projectTile(tr(
" - Project: %1 - %2"));
709 std::string name = boost::filesystem::basename(m_project->getFileName()) + boost::filesystem::extension(m_project->getFileName());
722 catch(
const std::exception& e)
735 catch(
const std::exception& e)
752 catch(
const std::exception& e)
764 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedSingleLayerItems();
766 if(selectedLayerItems.empty())
769 tr(
"Select a single layer in the layer explorer!"));
776 std::list<te::map::AbstractLayerPtr> layers;
777 layers.push_back(selectedLayer);
783 catch(
const std::exception& e)
800 if(editor.exec() == QDialog::Accepted)
802 QString projectTile(tr(
" - Project: %1 - %2"));
803 std::string fName = boost::filesystem::basename(m_project->getFileName()) + boost::filesystem::extension(m_project->getFileName());
813 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedLayerItems();
815 if(selectedLayerItems.size() == 1 && selectedLayerItems.front()->getItemType() ==
"FOLDER_LAYER_ITEM")
816 parentLayer = selectedLayerItems.front()->getLayer();
821 tr(
"Folder layer name:"), QLineEdit::Normal,
822 tr(
"Enter folder layer name"), &ok);
833 static boost::uuids::basic_random_generator<boost::mt19937> gen;
834 boost::uuids::uuid u = gen();
835 std::string
id = boost::uuids::to_string(u);
838 folderLayer->setTitle(text.toStdString());
839 folderLayer->setId(
id);
850 std::list<te::qt::widgets::AbstractTreeItem*> layers = m_explorer->getExplorer()->getSelectedItems();
859 QDockWidget* doc =
new QDockWidget(
this, Qt::Dialog);
863 doc->setWidget(info);
864 doc->setWindowTitle(info->windowTitle());
865 doc->setAttribute(Qt::WA_DeleteOnClose,
true);
872 std::list<te::map::AbstractLayerPtr> layers = m_explorer->getExplorer()->getSelectedSingleLayers();
880 std::list<te::map::AbstractLayerPtr>::iterator it = layers.begin();
882 while(it != layers.end())
885 layer->clearSelected();
896 std::list<te::qt::widgets::AbstractTreeItem*> layers = m_explorer->getExplorer()->getSelectedItems();
904 srsDialog.setWindowTitle(tr(
"Choose the SRS"));
906 if(srsDialog.exec() == QDialog::Rejected)
913 lay->setSRID(srid.first);
918 std::list<te::qt::widgets::AbstractTreeItem*> layers = m_explorer->getExplorer()->getSelectedItems();
928 if (lay->getSchema()->hasRaster())
938 addDockWidget(Qt::BottomDockWidgetArea, doc);
942 if(!m_tableDocks.empty())
943 tabifyDockWidget(m_tableDocks[m_tableDocks.size()-1], doc);
945 m_tableDocks.push_back(doc);
953 m_viewDataTable->setChecked(
true);
955 m_viewDataTable->setEnabled(
true);
962 std::list<te::map::AbstractLayerPtr> selectedLayers = m_explorer->getExplorer()->getSelectedSingleLayers();
964 if(selectedLayers.empty())
967 tr(
"Select a layer in the layer explorer!"));
981 int res = dlg.exec();
982 if (res == QDialog::Accepted)
986 doc->setWindowTitle(
"Histogram");
987 doc->setWindowIcon(QIcon::fromTheme(
"chart-bar"));
991 addDockWidget(Qt::RightDockWidgetArea, doc, Qt::Horizontal);
995 catch(
const std::exception& e)
1005 std::list<te::map::AbstractLayerPtr> selectedLayers = m_explorer->getExplorer()->getSelectedSingleLayers();
1007 if(selectedLayers.empty())
1010 tr(
"Select a layer in the layer explorer!"));
1023 int res = dlg.exec();
1024 if (res == QDialog::Accepted)
1029 doc->setWindowTitle(
"Scatter");
1030 doc->setWindowIcon(QIcon::fromTheme(
"chart-scatter"));
1032 doc->
setLayer(selectedLayer.get());
1034 addDockWidget(Qt::RightDockWidgetArea, doc, Qt::Horizontal);
1038 catch(
const std::exception& e)
1048 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedSingleLayerItems();
1050 if(selectedLayerItems.empty())
1053 tr(
"Select a single layer in the layer explorer!"));
1075 m_explorer->getExplorer()->remove(chartItem);
1079 m_explorer->getExplorer()->collapse(selectedLayerItem);
1081 if(dlg.exec() == QDialog::Accepted)
1084 m_explorer->getExplorer()->expand(selectedLayerItem);
1088 m_explorer->getExplorer()->expand(chartItem);
1090 m_display->getDisplay()->refresh();
1097 catch(
const std::exception& e)
1107 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedSingleLayerItems();
1109 if(selectedLayerItems.empty())
1112 tr(
"Select a single layer in the layer explorer!"));
1127 m_explorer->getExplorer()->remove(groupingItem);
1133 m_explorer->getExplorer()->remove(cmi);
1137 m_explorer->getExplorer()->collapse(selectedLayerItem);
1139 if(dlg.exec() == QDialog::Accepted)
1142 m_explorer->getExplorer()->expand(selectedLayerItem);
1146 m_explorer->getExplorer()->expand(groupingItem);
1150 m_explorer->getExplorer()->expand(cmi);
1152 m_display->getDisplay()->refresh();
1159 catch(
const std::exception& e)
1168 srsDialog.setWindowTitle(tr(
"Choose the SRS"));
1170 if(srsDialog.exec() == QDialog::Rejected)
1178 m_display->getDisplay()->setSRID(srid.first);
1183 std::pair<int, std::string> srid = std::make_pair(
TE_UNKNOWN_SRS,
"");
1202 std::list<te::map::AbstractLayerPtr> selectedLayers = m_explorer->getExplorer()->getSelectedSingleLayers();
1204 if(selectedLayers.empty())
1207 tr(
"Select a layer in the layer explorer!"));
1227 TR_QT_AF(
"The spatial reference system of the map display and the layer are not compatible!"));
1231 if(display->
getSRID() != selectedLayer->getSRID())
1236 catch(
const std::exception& e)
1244 std::list<te::map::AbstractLayerPtr> layers = m_explorer->getExplorer()->getSelectedSingleLayers();
1247 QString msg = tr(
"Select at least a layer to accomplish this operation!");
1256 QString msg = tr(
"Select object(s) in the selected layer(s) to accomplish this operation!");
1261 m_display->getDisplay()->setExtent(finalEnv,
true);
1266 std::list<te::map::AbstractLayerPtr> layers = m_explorer->getExplorer()->getSelectedSingleLayers();
1281 double halfWidth = displayExtent.
getWidth() * 0.5;
1282 double halfHeight = displayExtent.
getHeight() * 0.5;
1286 newExtent.
m_llx = centerOfSelectedExtent.x - halfWidth;
1287 newExtent.
m_lly = centerOfSelectedExtent.y - halfHeight;
1289 newExtent.
m_urx = centerOfSelectedExtent.x + halfWidth;
1290 newExtent.
m_ury = centerOfSelectedExtent.y + halfHeight;
1298 dlg->setAttribute(Qt::WA_DeleteOnClose,
true);
1301 dlg->
setList(m_project->getTopLayers());
1303 std::list<te::qt::widgets::AbstractTreeItem*> selectedLayerItems = m_explorer->getExplorer()->getSelectedSingleLayerItems();
1305 if(!selectedLayerItems.empty())
1327 QCursor zoomAreaCursor(QIcon::fromTheme(
"zoom-in").pixmap(m_mapCursorSize));
1330 m_display->setCurrentTool(zoomArea);
1341 QCursor zoomOutCursor(QIcon::fromTheme(
"zoom-out").pixmap(m_mapCursorSize));
1344 m_display->setCurrentTool(zoomOut);
1352 m_display->previousExtent();
1357 m_display->nextExtent();
1366 m_display->setCurrentTool(pan);
1374 if(!m_project && m_project->getTopLayers().empty())
1387 QPixmap pxmap = QIcon::fromTheme(
"pointer-info").pixmap(m_mapCursorSize);
1388 QCursor infoCursor(pxmap, 0, 0);
1391 m_display->setCurrentTool(info);
1393 connect(m_explorer->getExplorer(), SIGNAL(selectedLayersChanged(
const std::list<te::map::AbstractLayerPtr>&)), info, SLOT(setLayers(
const std::list<te::map::AbstractLayerPtr>&)));
1400 std::list<te::map::AbstractLayerPtr>::iterator it = layers.begin();
1402 while(it != layers.end())
1405 layer->clearSelected();
1420 m_display->setCurrentTool(selection);
1422 connect(m_explorer->getExplorer(), SIGNAL(selectedLayersChanged(
const std::list<te::map::AbstractLayerPtr>&)), selection, SLOT(setLayers(
const std::list<te::map::AbstractLayerPtr>&)));
1435 m_display->setCurrentTool(distance);
1444 m_display->setCurrentTool(area);
1453 m_display->setCurrentTool(angle);
1463 m_progressDockWidget->setVisible(
true);
1468 std::vector<DataSetTableDockWidget*>::iterator it;
1470 for(it=m_tableDocks.begin(); it!=m_tableDocks.end(); ++it)
1474 if(it != m_tableDocks.end())
1475 m_tableDocks.erase(it);
1477 if(m_tableDocks.empty())
1479 m_viewDataTable->setChecked(
false);
1480 m_viewDataTable->setEnabled(
false);
1488 checked ? showFullScreen() : showMaximized();
1493 assert(layer.get());
1501 assert(layer.get());
1510 m_viewLayerExplorer->blockSignals(
true);
1511 m_viewLayerExplorer->setChecked(visible);
1512 m_viewLayerExplorer->blockSignals(
false);
1517 m_viewMapDisplay->blockSignals(
true);
1518 m_viewMapDisplay->setChecked(visible);
1519 m_viewMapDisplay->blockSignals(
false);
1524 if(m_tableDocks.empty())
1527 for(std::size_t i = 0; i < m_tableDocks.size(); ++i)
1530 m_tableDocks[i]->show();
1532 m_tableDocks[i]->hide();
1535 m_viewDataTable->setChecked(visible);
1540 m_viewStyleExplorer->blockSignals(
true);
1541 m_viewStyleExplorer->setChecked(visible);
1542 m_viewStyleExplorer->blockSignals(
false);
1553 if(!dsTypeSett.isNull() && !dsTypeSett.isEmpty())
1554 dExplorer->setDataSourceToUse(dsTypeSett);
1557 int retval = dExplorer->exec();
1559 if(retval == QDialog::Rejected)
1562 std::list<te::da::DataSourceInfoPtr> selectedDatasources = dExplorer->getSelecteds();
1564 if(selectedDatasources.empty())
1569 const std::string& dsTypeId = selectedDatasources.front()->getType();
1573 catch(
const std::exception& e)
1579 QMessageBox::warning(
this,
1581 tr(
"DataSetExplorer Error!"));
1591 if(!boost::filesystem::exists(projectFileName.toStdString()))
1603 m_project = nproject;
1607 QString projectTile(tr(
" - Project: %1 - %2"));
1608 std::string fName = boost::filesystem::basename(m_project->getFileName()) + boost::filesystem::extension(m_project->getFileName());
1623 QString msg(tr(
"Fail to open project: %1"));
1625 msg = msg.arg(projectFileName);
1627 throw Exception(
TR_QT_AF(msg.toStdString()));
1633 if(m_project != 0 && m_project->hasChanged())
1635 QString msg(
"The current project has unsaved changes. Do you want to save them?");
1638 if(btn == QMessageBox::Yes)
1639 onSaveProjectTriggered();
1658 m_project->setTitle(
"New Project");
1660 m_project->setAuthor(author.toStdString());
1662 QString projectTile(tr(
" - Project: %1 - %2"));
1663 std::string fName = boost::filesystem::basename(m_project->getFileName()) + boost::filesystem::extension(m_project->getFileName());
1668 m_project->setProjectAsChanged(
false);
1683 initSlotsConnections();
1688 QAction* act =
new QAction(
this);
1689 act->setSeparator(
true);
1692 lexplorer->setObjectName(
"LayerExplorerDockWidget");
1694 treeView->setAnimated(
true);
1704 QAction* noItemSelectedSep =
new QAction(
this);
1705 noItemSelectedSep->setSeparator(
true);
1713 treeView->
add(m_projectAddLayerMenu->menuAction(),
"",
"FOLDER_LAYER_ITEM");
1715 QAction* folderSep1 =
new QAction(
this);
1716 folderSep1->setSeparator(
true);
1717 treeView->
add(folderSep1,
"",
"FOLDER_LAYER_ITEM");
1719 treeView->
add(m_projectAddFolderLayer,
"",
"FOLDER_LAYER_ITEM");
1721 QAction* folderSep2 =
new QAction(
this);
1722 folderSep2->setSeparator(
true);
1723 treeView->
add(folderSep2,
"",
"FOLDER_LAYER_ITEM");
1725 treeView->
add(m_projectRemoveLayer,
"",
"FOLDER_LAYER_ITEM");
1726 treeView->
add(m_projectRenameLayer,
"",
"FOLDER_LAYER_ITEM");
1729 treeView->
add(m_layerObjectGrouping);
1730 treeView->
add(m_toolsDataExchangerDirectPopUp);
1731 treeView->
add(m_layerChartsHistogram);
1732 treeView->
add(m_layerChart);
1733 treeView->
add(m_queryLayer);
1734 treeView->
add(m_layerChartsScatter);
1736 QAction* actionChartSep =
new QAction(
this);
1737 actionChartSep->setSeparator(
true);
1738 treeView->
add(actionChartSep);
1740 treeView->
add(m_layerShowTable);
1741 treeView->
add(m_viewStyleExplorer);
1743 QAction* actionStyleSep =
new QAction(
this);
1744 actionStyleSep->setSeparator(
true);
1745 treeView->
add(actionStyleSep);
1747 treeView->
add(m_layerRemoveObjectSelection);
1748 treeView->
add(m_projectRemoveLayer);
1749 treeView->
add(m_projectRenameLayer);
1751 QAction* actionRemoveSep =
new QAction(
this);
1752 actionRemoveSep->setSeparator(
true);
1753 treeView->
add(actionRemoveSep);
1755 treeView->
add(m_layerFitOnMapDisplay);
1756 treeView->
add(m_layerFitSelectedOnMapDisplay);
1757 treeView->
add(m_layerPanToSelectedOnMapDisplay);
1759 QAction* actionFitSep =
new QAction(
this);
1760 actionFitSep->setSeparator(
true);
1761 treeView->
add(actionFitSep);
1763 treeView->
add(m_layerSRS);
1765 QAction* actionSRSSep =
new QAction(
this);
1766 actionSRSSep->setSeparator(
true);
1767 treeView->
add(actionSRSSep);
1769 treeView->
add(m_layerProperties);
1772 treeView->
add(m_layerRemoveItem,
"",
"ITEM_OF_LAYER");
1775 treeView->
add(m_layerObjectGrouping,
"",
"RASTER_LAYER_ITEM");
1776 treeView->
add(m_layerChartsHistogram,
"",
"RASTER_LAYER_ITEM");
1778 QAction* rasterSep1 =
new QAction(
this);
1779 rasterSep1->setSeparator(
true);
1780 treeView->
add(rasterSep1,
"",
"RASTER_LAYER_ITEM");
1782 treeView->
add(m_viewStyleExplorer,
"",
"RASTER_LAYER_ITEM");
1784 QAction* rasterSep2 =
new QAction(
this);
1785 rasterSep2->setSeparator(
true);
1786 treeView->
add(rasterSep2,
"",
"RASTER_LAYER_ITEM");
1788 treeView->
add(m_projectRemoveLayer,
"",
"RASTER_LAYER_ITEM");
1789 treeView->
add(m_projectRenameLayer,
"",
"RASTER_LAYER_ITEM");
1791 QAction* rasterSep3 =
new QAction(
this);
1792 rasterSep3->setSeparator(
true);
1793 treeView->
add(rasterSep3,
"",
"RASTER_LAYER_ITEM");
1795 treeView->
add(m_layerFitOnMapDisplay,
"",
"RASTER_LAYER_ITEM");
1797 QAction* rasterSep4 =
new QAction(
this);
1798 rasterSep4->setSeparator(
true);
1799 treeView->
add(rasterSep4,
"",
"RASTER_LAYER_ITEM");
1801 treeView->
add(m_layerSRS,
"",
"RASTER_LAYER_ITEM");
1803 QAction* rasterSep5 =
new QAction(
this);
1804 rasterSep5->setSeparator(
true);
1805 treeView->
add(rasterSep5,
"",
"RASTER_LAYER_ITEM");
1807 treeView->
add(m_layerProperties,
"",
"RASTER_LAYER_ITEM");
1817 QAction* multipleSelectedSep =
new QAction(
this);
1818 multipleSelectedSep->setSeparator(
true);
1825 QMainWindow::addDockWidget(Qt::LeftDockWidgetArea, lexplorer);
1827 connect(m_viewLayerExplorer, SIGNAL(toggled(
bool)), lexplorer, SLOT(setVisible(
bool)));
1828 m_viewLayerExplorer->setChecked(
true);
1829 connect(lexplorer, SIGNAL(visibilityChanged(
bool)),
this, SLOT(onLayerExplorerVisibilityChanged(
bool)));
1838 connect(m_display, SIGNAL(hasPreviousExtent(
bool)), m_mapPreviousExtent, SLOT(setEnabled(
bool)));
1839 connect(m_display, SIGNAL(hasNextExtent(
bool)), m_mapNextExtent, SLOT(setEnabled(
bool)));
1844 stylelDock->setObjectName(
"StyleDockWidget");
1845 QMainWindow::addDockWidget(Qt::RightDockWidgetArea, stylelDock);
1846 stylelDock->connect(m_viewStyleExplorer, SIGNAL(toggled(
bool)), SLOT(setVisible(
bool)));
1847 m_viewStyleExplorer->setChecked(
false);
1848 stylelDock->setVisible(
false);
1849 connect(stylelDock, SIGNAL(visibilityChanged(
bool)),
this, SLOT(onStyleExplorerVisibilityChanged(
bool)));
1850 connect(stylelDock, SIGNAL(repaintMapDisplay()),
this, SLOT(onDrawTriggered()));
1869 QDockWidget* doc =
new QDockWidget(tr(
"Map Display"),
this);
1870 doc->setWidget(map);
1871 QMainWindow::setCentralWidget(doc);
1872 doc->connect(m_viewMapDisplay, SIGNAL(toggled(
bool)), SLOT(setVisible(
bool)));
1873 m_viewMapDisplay->setChecked(
true);
1874 connect(doc, SIGNAL(visibilityChanged(
bool)),
this, SLOT(onDisplayVisibilityChanged(
bool)));
1877 connect(m_viewDataTable, SIGNAL(toggled(
bool)),
this, SLOT(onDisplayDataTableChanged(
bool)));
1889 pvb->setFixedWidth(220);
1895 m_statusbar->addPermanentWidget(pvb);
1897 connect(pvb, SIGNAL(clicked()),
this, SLOT(showProgressDockWidget()));
1899 m_progressDockWidget =
new QDockWidget(
this);
1900 m_progressDockWidget->setObjectName(
"ProgressDockWidget");
1901 m_progressDockWidget->setWidget(pvw);
1902 m_progressDockWidget->setMinimumHeight(300);
1903 m_progressDockWidget->setAllowedAreas(Qt::RightDockWidgetArea);
1904 m_progressDockWidget->setWindowTitle(tr(
"Tasks Progress"));
1905 addDockWidget(Qt::RightDockWidgetArea, m_progressDockWidget);
1906 m_progressDockWidget->setVisible(
false);
1919 const QString& text,
const QString& tooltip,
1920 bool iconVisibleInMenu,
bool isCheckable,
1921 bool enabled, QObject* parent)
1923 act =
new QAction (parent);
1926 act->setIcon(QIcon::fromTheme(icon));
1928 act->setObjectName(name);
1930 act->setIconVisibleInMenu(iconVisibleInMenu);
1931 act->setCheckable(isCheckable);
1932 act->setEnabled(enabled);
1934 #ifndef QT_NO_TOOLTIP
1935 act->setToolTip(tooltip);
1942 initAction(m_viewLayerExplorer,
"view-layer-explorer",
"View.Layer Explorer", tr(
"&Layer Explorer"), tr(
"Show or hide the layer explorer"),
true,
true,
true, m_menubar);
1943 initAction(m_viewMapDisplay,
"view-map-display",
"View.Map Display", tr(
"&Map Display"), tr(
"Show or hide the map display"),
true,
true,
true, m_menubar);
1944 initAction(m_viewDataTable,
"view-data-table",
"View.Data Table", tr(
"&Data Table"), tr(
"Show or hide the data table"),
true,
true,
true, m_menubar);
1945 initAction(m_viewStyleExplorer,
"raster-visual",
"View.Style Explorer", tr(
"&Style Explorer"), tr(
"Show or hide the style explorer"),
true,
true,
true, m_menubar);
1946 initAction(m_viewFullScreen,
"view-fullscreen",
"View.Full Screen", tr(
"F&ull Screen"), tr(
""),
true,
true,
true, m_menubar);
1952 initAction(m_toolsCustomize,
"preferences-system",
"Tools.Customize", tr(
"&Customize..."), tr(
"Customize the system preferences"),
true,
false,
true, m_menubar);
1953 initAction(m_toolsDataExchanger,
"datasource-exchanger",
"Tools.Exchanger.All to All", tr(
"&Advanced..."), tr(
"Exchange data sets between data sources"),
true,
false,
true, m_menubar);
1954 initAction(m_toolsDataExchangerDirect,
"data-exchange-direct-icon",
"Tools.Exchanger.Direct", tr(
"&Layer..."), tr(
"Exchange data sets from layers"),
true,
false,
true, m_menubar);
1955 initAction(m_toolsDataExchangerDirectPopUp,
"data-exchange-direct-icon",
"Tools.Exchanger.Direct", tr(
"&Exchange..."), tr(
"Exchange data sets from layers"),
true,
false,
true, m_menubar);
1956 initAction(m_toolsDataSourceExplorer,
"datasource-explorer",
"Tools.Data Source Explorer", tr(
"&Data Source Explorer..."), tr(
"Show or hide the data source explorer"),
1957 true,
false,
true, m_menubar);
1971 initAction(m_pluginsManager,
"plugin",
"Plugins.Management", tr(
"&Manage Plugins..."), tr(
"Manage the application plugins"),
true,
false,
true, m_menubar);
1974 initAction(m_helpContents,
"help-browser",
"Help.View Help", tr(
"&View Help..."), tr(
"Shows help dialog"),
true,
false,
true, m_menubar);
1976 initAction(m_helpAbout,
"help-about-browser",
"Help.About", tr(
"&About..."), tr(
""),
true,
false,
false, m_menubar);
1979 initAction(m_projectAddLayerDataset,
"datasource",
"Project.Add Layer.All Sources", tr(
"&From Data Source..."), tr(
"Add a new layer from all available data sources"),
true,
false,
true, m_menubar);
1980 initAction(m_projectAddFolderLayer,
"folderlayer-new",
"Project.New Folder Layer", tr(
"Add &Folder Layer..."), tr(
"Add a new folder layer"),
true,
false,
true, m_menubar);
1981 initAction(m_projectAddLayerQueryDataSet,
"view-filter",
"Project.Add Layer.Query Dataset", tr(
"&Query Dataset..."), tr(
"Add a new layer from a queried dataset"),
true,
false,
true, m_menubar);
1982 initAction(m_projectAddLayerTabularDataSet,
"view-data-table",
"Project.Add Layer.Tabular File", tr(
"&Tabular File..."), tr(
"Add a new layer from a Tabular file"),
true,
false,
true, m_menubar);
1983 initAction(m_projectRemoveLayer,
"layer-remove",
"Project.Remove Layer", tr(
"&Remove Layer(s)"), tr(
"Remove layer(s) from the project"),
true,
false,
true,
this);
1984 initAction(m_projectRenameLayer,
"layer-rename",
"Project.Rename Layer", tr(
"Rename Layer..."), tr(
"Rename layer"),
true,
false,
true,
this);
1985 initAction(m_projectProperties,
"document-info",
"Project.Properties", tr(
"&Properties..."), tr(
"Show the project properties"),
true,
false,
true, m_menubar);
1989 initAction(m_layerRemoveObjectSelection,
"pointer-remove-selection",
"Layer.Remove Selection", tr(
"&Remove Selection"), tr(
""),
true,
false,
true, m_menubar);
1990 initAction(m_layerRemoveItem,
"item-remove",
"Layer.Remove Item", tr(
"&Remove Item"), tr(
""),
true,
false,
true, m_menubar);
1991 initAction(m_layerObjectGrouping,
"grouping",
"Layer.ObjectGrouping", tr(
"&Classification..."), tr(
""),
true,
false,
true, m_menubar);
1992 initAction(m_layerProperties,
"layer-info",
"Layer.Properties", tr(
"&Properties..."), tr(
""),
true,
false,
true, m_menubar);
1993 initAction(m_layerSRS,
"layer-srs",
"Layer.SRS", tr(
"&Inform SRS..."), tr(
""),
true,
false,
true, m_menubar);
1994 initAction(m_layerShowTable,
"view-data-table",
"Layer.Show Table", tr(
"S&how Table"), tr(
""),
true,
false,
true, m_menubar);
1995 initAction(m_layerChartsHistogram,
"chart-bar",
"Layer.Charts.Histogram", tr(
"&Histogram..."), tr(
""),
true,
false,
true, m_menubar);
1996 initAction(m_layerChartsScatter,
"chart-scatter",
"Layer.Charts.Scatter", tr(
"&Scatter..."), tr(
""),
true,
false,
true, m_menubar);
1997 initAction(m_layerChart,
"chart-pie",
"Layer.Charts.Chart", tr(
"&Pie/Bar Chart..."), tr(
""),
true,
false,
true, m_menubar);
1998 initAction(m_layerFitOnMapDisplay,
"layer-fit",
"Layer.Fit Layer on the Map Display", tr(
"Fit Layer"), tr(
"Fit the current layer on the Map Display"),
true,
false,
true, m_menubar);
1999 initAction(m_layerFitSelectedOnMapDisplay,
"zoom-selected-extent",
"Layer.Fit Selected Objects on the Map Display", tr(
"Fit Selected Objects"), tr(
"Fit the selected objects on the Map Display"),
true,
false,
true, m_menubar);
2000 initAction(m_layerPanToSelectedOnMapDisplay,
"pan-selected",
"Layer.Pan to Selected Objects on Map Display", tr(
"Pan to Selected Objects"), tr(
"Pan to the selected objects on the Map Display"),
true,
false,
true, m_menubar);
2001 initAction(m_queryLayer,
"view-filter",
"Layer.Query", tr(
"Query..."), tr(
""),
true,
false,
true, m_menubar);
2004 initAction(m_fileNewProject,
"document-new",
"File.New Project", tr(
"&New Project..."), tr(
""),
true,
false,
true, m_menubar);
2005 initAction(m_fileSaveProject,
"document-save",
"File.Save Project", tr(
"&Save Project"), tr(
""),
true,
false,
true, m_menubar);
2006 initAction(m_fileSaveProjectAs,
"document-save-as",
"File.Save Project As", tr(
"Save Project &As..."), tr(
""),
true,
false,
false, m_menubar);
2007 initAction(m_fileOpenProject,
"document-open",
"File.Open Project", tr(
"&Open Project..."), tr(
""),
true,
false,
true, m_menubar);
2008 initAction(m_fileExit,
"system-log-out",
"File.Exit", tr(
"E&xit"), tr(
""),
true,
false,
true, m_menubar);
2009 initAction(m_filePrintPreview,
"document-print-preview",
"File.Print Preview", tr(
"Print Pre&view..."), tr(
""),
true,
false,
false, m_menubar);
2010 initAction(m_filePrint,
"document-print",
"File.Print", tr(
"&Print..."), tr(
""),
true,
false,
false, m_menubar);
2013 initAction(m_mapSRID,
"srs",
"Map.SRID", tr(
"&SRS..."), tr(
"Config the Map SRS"),
true,
false,
true, m_menubar);
2014 initAction(m_mapUnknownSRID,
"srs-unknown",
"Map.UnknownSRID", tr(
"&Set Unknown SRS"), tr(
"Set the Map SRS to unknown"),
true,
false,
true, m_menubar);
2015 initAction(m_mapDraw,
"map-draw",
"Map.Draw", tr(
"&Draw"), tr(
"Draw the visible layers"),
true,
false,
true, m_menubar);
2016 initAction(m_mapZoomIn,
"zoom-in",
"Map.Zoom In", tr(
"Zoom &In"), tr(
""),
true,
true,
true, m_menubar);
2017 initAction(m_mapZoomOut,
"zoom-out",
"Map.Zoom Out", tr(
"Zoom &Out"), tr(
""),
true,
true,
true, m_menubar);
2018 initAction(m_mapPan,
"pan",
"Map.Pan", tr(
"&Pan"), tr(
""),
true,
true,
true, m_menubar);
2019 initAction(m_mapZoomExtent,
"zoom-extent",
"Map.Zoom Extent", tr(
"Zoom &Extent"), tr(
""),
true,
false,
true, m_menubar);
2020 initAction(m_mapPreviousExtent,
"edit-undo",
"Map.Previous Extent", tr(
"&Previous Extent"), tr(
""),
true,
false,
false, m_menubar);
2021 initAction(m_mapNextExtent,
"edit-redo",
"Map.Next Extent", tr(
"&Next Extent"), tr(
""),
true,
false,
false, m_menubar);
2022 initAction(m_mapInfo,
"pointer-info",
"Map.Info", tr(
"&Info"), tr(
""),
true,
true,
true, m_menubar);
2023 initAction(m_mapRemoveSelection,
"pointer-remove-selection",
"Map.Remove Selection", tr(
"&Remove Selection"), tr(
""),
true,
false,
true, m_menubar);
2024 initAction(m_mapSelection,
"pointer-selection",
"Map.Selection", tr(
"&Selection"), tr(
""),
true,
true,
true, m_menubar);
2025 initAction(m_mapMeasureDistance,
"distance-measure",
"Map.Measure Distance", tr(
"Measure &Distance"), tr(
""),
true,
true,
true, m_menubar);
2026 initAction(m_mapMeasureArea,
"area-measure",
"Map.Measure Area", tr(
"Measure &Area"), tr(
""),
true,
true,
true, m_menubar);
2027 initAction(m_mapMeasureAngle,
"angle-measure",
"Map.Measure Angle", tr(
"Measure &Angle"), tr(
""),
true,
true,
true, m_menubar);
2028 initAction(m_mapStopDrawing,
"map-draw-cancel",
"Map.Stop Drawing", tr(
"&Stop Drawing"), tr(
"Stop all drawing tasks"),
true,
false,
true, m_menubar);
2031 QActionGroup* mapToolsGroup =
new QActionGroup(
this);
2032 mapToolsGroup->addAction(m_mapZoomIn);
2033 mapToolsGroup->addAction(m_mapZoomOut);
2034 mapToolsGroup->addAction(m_mapPan);
2035 mapToolsGroup->addAction(m_mapMeasureDistance);
2036 mapToolsGroup->addAction(m_mapMeasureArea);
2037 mapToolsGroup->addAction(m_mapMeasureAngle);
2038 mapToolsGroup->addAction(m_mapInfo);
2039 mapToolsGroup->addAction(m_mapSelection);
2040 mapToolsGroup->addAction(m_mapRemoveSelection);
2046 m_menubar->setObjectName(QString::fromUtf8(
"menubar"));
2047 m_menubar->setGeometry(QRect(0, 0, 640, 21));
2050 m_fileMenu->setObjectName(
"File");
2051 m_fileMenu->setTitle(tr(
"&File"));
2053 m_recentProjectsMenu->setObjectName(
"File.Recent Projects");
2054 m_recentProjectsMenu->setTitle(tr(
"&Recent Projects"));
2056 m_fileMenu->addAction(m_fileNewProject);
2057 m_fileMenu->addAction(m_fileOpenProject);
2058 m_fileMenu->addAction(m_fileSaveProject);
2059 m_fileMenu->addAction(m_fileSaveProjectAs);
2060 m_fileMenu->addSeparator();
2061 m_fileMenu->addAction(m_recentProjectsMenu->menuAction());
2062 m_fileMenu->addSeparator();
2063 m_fileMenu->addAction(m_filePrintPreview);
2064 m_fileMenu->addAction(m_filePrint);
2065 m_fileMenu->addSeparator();
2066 m_fileMenu->addAction(m_fileExit);
2089 m_viewMenu->setObjectName(
"View");
2090 m_viewMenu->setTitle(tr(
"&View"));
2092 m_viewToolBarsMenu->setObjectName(
"View.Toolbars");
2093 m_viewToolBarsMenu->setTitle(tr(
"&Toolbars"));
2096 m_viewMenu->addAction(m_viewDataTable);
2097 m_viewMenu->addAction(m_viewLayerExplorer);
2098 m_viewMenu->addAction(m_viewMapDisplay);
2099 m_viewMenu->addAction(m_viewStyleExplorer);
2101 m_viewMenu->addSeparator();
2102 m_viewMenu->addAction(m_viewFullScreen);
2103 m_viewMenu->addSeparator();
2104 m_viewMenu->addMenu(m_viewToolBarsMenu);
2108 m_projectMenu->setObjectName(
"Project");
2109 m_projectMenu->setTitle(tr(
"&Project"));
2111 m_projectMenu->addAction(m_projectAddLayerMenu->menuAction());
2112 m_projectAddLayerMenu->setObjectName(
"Project.Add Layer");
2113 m_projectAddLayerMenu->setTitle(tr(
"&Add Layer"));
2114 m_projectAddLayerMenu->setIcon(QIcon::fromTheme(
"layer-add"));
2115 m_projectAddLayerMenu->addAction(m_projectAddLayerTabularDataSet);
2116 m_projectAddLayerMenu->addAction(m_projectAddLayerDataset);
2117 m_projectAddLayerMenu->addSeparator();
2118 m_projectAddLayerMenu->addAction(m_projectAddLayerQueryDataSet);
2119 m_projectAddLayerMenu->addSeparator();
2120 m_projectMenu->addAction(m_projectAddFolderLayer);
2121 m_projectMenu->addSeparator();
2122 m_projectMenu->addAction(m_projectRemoveLayer);
2123 m_projectMenu->addAction(m_projectRenameLayer);
2124 m_projectMenu->addSeparator();
2125 m_projectMenu->addAction(m_projectProperties);
2127 m_layerMenu->setObjectName(
"Layer");
2128 m_layerMenu->setTitle(tr(
"&Layer"));
2130 m_layerMenu->addAction(m_layerObjectGrouping);
2131 m_layerMenu->addAction(m_layerChartsHistogram);
2132 m_layerMenu->addAction(m_layerChart);
2133 m_layerMenu->addAction(m_queryLayer);
2134 m_layerMenu->addAction(m_layerChartsScatter);
2135 m_layerMenu->addSeparator();
2136 m_layerMenu->addAction(m_layerFitOnMapDisplay);
2137 m_layerMenu->addAction(m_layerFitSelectedOnMapDisplay);
2138 m_layerMenu->addAction(m_layerPanToSelectedOnMapDisplay);
2139 m_layerMenu->addSeparator();
2140 m_layerMenu->addAction(m_layerShowTable);
2141 m_layerMenu->addAction(m_viewStyleExplorer);
2142 m_layerMenu->addSeparator();
2143 m_layerMenu->addAction(m_layerRemoveObjectSelection);
2144 m_layerMenu->addSeparator();
2145 m_layerMenu->addAction(m_layerSRS);
2146 m_layerMenu->addSeparator();
2147 m_layerMenu->addAction(m_layerProperties);
2156 m_mapMenu->setObjectName(
"Map");
2157 m_mapMenu->setTitle(tr(
"&Map"));
2159 m_mapMenu->addAction(m_mapDraw);
2160 m_mapMenu->addAction(m_mapStopDrawing);
2161 m_mapMenu->addSeparator();
2162 m_mapMenu->addAction(m_mapInfo);
2163 m_mapMenu->addAction(m_mapRemoveSelection);
2164 m_mapMenu->addAction(m_mapSelection);
2165 m_mapMenu->addSeparator();
2166 m_mapMenu->addAction(m_mapPan);
2167 m_mapMenu->addAction(m_mapZoomExtent);
2168 m_mapMenu->addAction(m_mapZoomIn);
2169 m_mapMenu->addAction(m_mapZoomOut);
2170 m_mapMenu->addSeparator();
2171 m_mapMenu->addAction(m_mapNextExtent);
2172 m_mapMenu->addAction(m_mapPreviousExtent);
2173 m_mapMenu->addSeparator();
2174 m_mapMenu->addAction(m_mapMeasureAngle);
2175 m_mapMenu->addAction(m_mapMeasureArea);
2176 m_mapMenu->addAction(m_mapMeasureDistance);
2177 m_mapMenu->addSeparator();
2178 m_mapMenu->addAction(m_mapSRID);
2179 m_mapMenu->addAction(m_mapUnknownSRID);
2184 m_toolsMenu->setObjectName(
"Tools");
2185 m_toolsMenu->setTitle(tr(
"&Tools"));
2189 m_toolsExchangerMenu->setObjectName(
"Tools.Exchanger");
2190 m_toolsExchangerMenu->setTitle(tr(
"&Data Exchanger"));
2191 m_toolsExchangerMenu->setIcon(QIcon::fromTheme(
"datasource-exchanger"));
2192 m_toolsExchangerMenu->addAction(m_toolsDataExchangerDirect);
2193 m_toolsExchangerMenu->addAction(m_toolsDataExchanger);
2195 m_toolsMenu->addAction(m_toolsDataSourceExplorer);
2196 m_toolsMenu->addSeparator();
2197 m_toolsMenu->addAction(m_toolsCustomize);
2200 m_pluginsMenu->setObjectName(
"Plugins");
2201 m_pluginsMenu->setTitle(tr(
"Pl&ugins"));
2203 m_pluginsMenu->addAction(m_pluginsManager);
2206 m_helpMenu->setObjectName(
"Help");
2207 m_helpMenu->setTitle(tr(
"&Help"));
2209 m_helpMenu->addAction(m_helpContents);
2213 setMenuBar(m_menubar);
2222 m_statusbar =
new QStatusBar(
this);
2223 m_statusbar->setObjectName(
"StatusBar");
2224 setStatusBar(m_statusbar);
2227 std::vector<QToolBar*>::iterator it;
2229 for(it=bars.begin(); it!=bars.end(); ++it)
2231 QToolBar* bar = *it;
2232 addToolBar(Qt::TopToolBarArea, bar);
2233 m_viewToolBarsMenu->addAction(bar->toggleViewAction());
2285 QToolButton* mapUnknownSRIDToolButton =
new QToolButton(m_statusbar);
2286 mapUnknownSRIDToolButton->setDefaultAction(m_mapUnknownSRID);
2287 m_statusbar->addPermanentWidget(mapUnknownSRIDToolButton);
2290 QToolButton* mapSRIDToolButton =
new QToolButton(m_statusbar);
2291 mapSRIDToolButton->setDefaultAction(m_mapSRID);
2292 m_statusbar->addPermanentWidget(mapSRIDToolButton);
2295 m_mapSRIDLineEdit =
new QLineEdit(m_statusbar);
2296 m_mapSRIDLineEdit->setFixedWidth(120);
2297 m_mapSRIDLineEdit->setAlignment(Qt::AlignHCenter);
2298 m_mapSRIDLineEdit->setEnabled(
false);
2300 int srid = m_display->getDisplay()->getSRID();
2301 srid !=
TE_UNKNOWN_SRS ? m_mapSRIDLineEdit->setText(
"EPSG:" + QString::number(srid)) : m_mapSRIDLineEdit->setText(tr(
"Unknown SRS"));
2302 m_statusbar->addPermanentWidget(m_mapSRIDLineEdit);
2305 m_coordinateLineEdit =
new QLineEdit(m_statusbar);
2306 m_coordinateLineEdit->setFixedWidth(220);
2307 m_coordinateLineEdit->setAlignment(Qt::AlignHCenter);
2308 m_coordinateLineEdit->setReadOnly(
true);
2309 m_coordinateLineEdit->setFocusPolicy(Qt::NoFocus);
2310 m_coordinateLineEdit->setText(tr(
"Coordinates"));
2311 m_statusbar->addPermanentWidget(m_coordinateLineEdit);
2314 QToolButton* stopDrawToolButton =
new QToolButton(m_statusbar);
2315 stopDrawToolButton->setDefaultAction(m_mapStopDrawing);
2316 m_statusbar->addPermanentWidget(stopDrawToolButton);
2321 connect(m_fileExit, SIGNAL(triggered()), SLOT(close()));
2322 connect(m_projectAddLayerDataset, SIGNAL(triggered()), SLOT(onAddDataSetLayerTriggered()));
2323 connect(m_projectAddLayerQueryDataSet, SIGNAL(triggered()), SLOT(onAddQueryLayerTriggered()));
2324 connect(m_projectAddLayerTabularDataSet, SIGNAL(triggered()), SLOT(onAddTabularLayerTriggered()));
2325 connect(m_projectRemoveLayer, SIGNAL(triggered()), SLOT(onRemoveLayerTriggered()));
2326 connect(m_projectRenameLayer, SIGNAL(triggered()), SLOT(onRenameLayerTriggered()));
2327 connect(m_projectProperties, SIGNAL(triggered()), SLOT(onProjectPropertiesTriggered()));
2328 connect(m_pluginsManager, SIGNAL(triggered()), SLOT(onPluginsManagerTriggered()));
2329 connect(m_recentProjectsMenu, SIGNAL(triggered(QAction*)), SLOT(onRecentProjectsTriggered(QAction*)));
2330 connect(m_fileNewProject, SIGNAL(triggered()), SLOT(onNewProjectTriggered()));
2331 connect(m_fileOpenProject, SIGNAL(triggered()), SLOT(onOpenProjectTriggered()));
2332 connect(m_fileSaveProject, SIGNAL(triggered()), SLOT(onSaveProjectTriggered()));
2333 connect(m_fileSaveProjectAs, SIGNAL(triggered()), SLOT(onSaveProjectAsTriggered()));
2334 connect(m_toolsCustomize, SIGNAL(triggered()), SLOT(onToolsCustomizeTriggered()));
2335 connect(m_toolsDataExchanger, SIGNAL(triggered()), SLOT(onToolsDataExchangerTriggered()));
2336 connect(m_toolsDataExchangerDirect, SIGNAL(triggered()), SLOT(onToolsDataExchangerDirectTriggered()));
2337 connect(m_toolsDataExchangerDirectPopUp, SIGNAL(triggered()), SLOT(onToolsDataExchangerDirectPopUpTriggered()));
2338 connect(m_helpContents, SIGNAL(triggered()), SLOT(onHelpTriggered()));
2339 connect(m_layerChartsHistogram, SIGNAL(triggered()), SLOT(onLayerHistogramTriggered()));
2340 connect(m_layerChartsScatter, SIGNAL(triggered()), SLOT(onLayerScatterTriggered()));
2341 connect(m_layerChart, SIGNAL(triggered()), SLOT(onLayerChartTriggered()));
2342 connect(m_projectAddFolderLayer, SIGNAL(triggered()), SLOT(onAddFolderLayerTriggered()));
2343 connect(m_layerProperties, SIGNAL(triggered()), SLOT(onLayerPropertiesTriggered()));
2344 connect(m_layerRemoveObjectSelection, SIGNAL(triggered()), SLOT(onLayerRemoveSelectionTriggered()));
2345 connect(m_layerRemoveItem, SIGNAL(triggered()), SLOT(onLayerRemoveItemTriggered()));
2346 connect(m_layerSRS, SIGNAL(triggered()), SLOT(onLayerSRSTriggered()));
2347 connect(m_layerObjectGrouping, SIGNAL(triggered()), SLOT(onLayerGroupingTriggered()));
2348 connect(m_mapSRID, SIGNAL(triggered()), SLOT(onMapSRIDTriggered()));
2349 connect(m_mapUnknownSRID, SIGNAL(triggered()), SLOT(onMapSetUnknwonSRIDTriggered()));
2350 connect(m_mapDraw, SIGNAL(triggered()), SLOT(onDrawTriggered()));
2351 connect(m_layerFitOnMapDisplay, SIGNAL(triggered()), SLOT(onLayerFitOnMapDisplayTriggered()));
2352 connect(m_layerFitSelectedOnMapDisplay, SIGNAL(triggered()), SLOT(onLayerFitSelectedOnMapDisplayTriggered()));
2353 connect(m_layerPanToSelectedOnMapDisplay, SIGNAL(triggered()), SLOT(onLayerPanToSelectedOnMapDisplayTriggered()));
2354 connect(m_queryLayer, SIGNAL(triggered()), SLOT(onQueryLayerTriggered()));
2355 connect(m_mapZoomIn, SIGNAL(toggled(
bool)), SLOT(onZoomInToggled(
bool)));
2356 connect(m_mapZoomOut, SIGNAL(toggled(
bool)), SLOT(onZoomOutToggled(
bool)));
2357 connect(m_mapPreviousExtent, SIGNAL(triggered()), SLOT(onPreviousExtentTriggered()));
2358 connect(m_mapNextExtent, SIGNAL(triggered()), SLOT(onNextExtentTriggered()));
2359 connect(m_mapPan, SIGNAL(toggled(
bool)), SLOT(onPanToggled(
bool)));
2360 connect(m_mapZoomExtent, SIGNAL(triggered()), SLOT(onZoomExtentTriggered()));
2361 connect(m_mapInfo, SIGNAL(toggled(
bool)), SLOT(onInfoToggled(
bool)));
2362 connect(m_mapRemoveSelection, SIGNAL(triggered()), SLOT(onMapRemoveSelectionTriggered()));
2363 connect(m_mapSelection, SIGNAL(toggled(
bool)), SLOT(onSelectionToggled(
bool)));
2364 connect(m_mapMeasureDistance, SIGNAL(toggled(
bool)), SLOT(onMeasureDistanceToggled(
bool)));
2365 connect(m_mapMeasureArea, SIGNAL(toggled(
bool)), SLOT(onMeasureAreaToggled(
bool)));
2366 connect(m_mapMeasureAngle, SIGNAL(toggled(
bool)), SLOT(onMeasureAngleToggled(
bool)));
2367 connect(m_mapStopDrawing, SIGNAL(triggered()), SLOT(onStopDrawTriggered()));
2368 connect(m_layerShowTable, SIGNAL(triggered()), SLOT(onLayerShowTableTriggered()));
2369 connect(m_viewFullScreen, SIGNAL(toggled(
bool)), SLOT(onFullScreenToggled(
bool)));
2370 connect(m_toolsDataSourceExplorer, SIGNAL(triggered()), SLOT(onDataSourceExplorerTriggered()));
virtual void initializePlugins()
Load the plugin list and initialize the plugins enabled by the user.
A class that defines the interface of a qt bar progress viewer.
te::qt::af::ApplicationController * m_controller
Contains the list of the project events.
void onDataSourceExplorerTriggered()
void registerMenu(QMenu *mnu)
Register the mnu.
void onLayerTableClose(te::qt::af::DataSetTableDockWidget *wid)
QMenu * m_toolsExchangerMenu
void onZoomExtentTriggered()
virtual te::map::AbstractLayerPtr getLayer() const =0
virtual void resetState()
A connector of the te::qt::widgets::MapDisplay class to the Application Framework.
virtual std::list< te::map::AbstractLayerPtr > getLayers()=0
bool isValid() const
It tells if the rectangle is valid or not.
virtual void makeDialog()
This class implements a concrete tool to geographic zoom operation using the mouse click...
double m_y
The y coordinate value.
A dialog for selecting a data source.
A dialog used to customize a Scatter parameters and generate it's ChartDisplayWidget.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
virtual void setResizePolicy(const ResizePolicy &policy)
Sets the resize policy to this map display.
void onMeasureAngleToggled(bool checked)
BaseApplication(QWidget *parent=0)
virtual void initAction(QAction *&act, const QString &icon, const QString &name, const QString &text, const QString &tooltip, bool iconVisibleInMenu, bool isCheckable, bool enabled, QObject *parent)
virtual void initActions()
A singleton for holding he application splash screen.
void onToolsDataExchangerDirectPopUpTriggered()
void CloseAllTables(std::vector< te::qt::af::DataSetTableDockWidget * > &tables)
A Dialog used to customize a Histogram parameters and generate it's ChartDisplayWidget.
void onLayerScatterTriggered()
void onSaveProjectAsTriggered()
An exception class for the TerraLib Application Framework.
void setLayer(te::map::AbstractLayer *layer)
Sets the layer to be showed on view. This DOES NOT takes the ownership of layer.
double getWidth() const
It returns the envelope width.
void onZoomInToggled(bool checked)
void onLayerSRSTriggered()
void onToolsDataExchangerDirectTriggered()
void registerMenuBar(QMenuBar *bar)
Register the bar.
This is the base class for layers.
A dialog for edition of te::qt::af::Project informations.
std::list< te::map::AbstractLayerPtr > getAllLayers()
It gets all the layers (single and folder layers) of the project.
void onMeasureAreaToggled(bool checked)
void onLayerHistogramTriggered()
void add(QAction *action, const std::string &menu="", const std::string &itemType="", ContextMenuSelectionType menuSelectionType=te::qt::widgets::LayerTreeView::UNIQUE_ITEM_SELECTED)
It adds the action to a specified menu of a given item type when a context menu is displayed...
A connector for the te::qt::widgets::StyleDockWidget class to the Application Framework.
Utility functions for MapTools module.
This file defines a class for a Query Dialog Dialog.
void onAddFolderLayerTriggered()
te::qt::af::DataSetTableDockWidget * GetLayerDock(const te::map::AbstractLayer *layer, const std::vector< te::qt::af::DataSetTableDockWidget * > &docs)
A base class for the suppported types of data source.
void setList(std::list< te::map::AbstractLayerPtr > &layerList)
This method is used to set the list of layers.
void onLayerGroupingTriggered()
void onPanToggled(bool checked)
QWidget * m_centralwidget
It indicates that a new project was created.
virtual void checkProjectSave()
This event signals that the srid of the map display changed.
virtual void setExtent(te::gm::Envelope &e, bool doRefresh=true)
It sets the world visible area and refreshes the contents in the map display.
void setCurrentLayer(te::map::AbstractLayerPtr layer)
void onAddDataSetLayerTriggered()
void onLayerExplorerVisibilityChanged(bool visible)
The base API for controllers of TerraLib applications.
QMenu * m_recentProjectsMenu
void setProject(Project *proj)
Sets the project to be inspected.
void onFullScreenToggled(bool checked)
void onAddTabularLayerTriggered()
double m_x
The x coordinate value.
TEQTAFEXPORT QString UnsavedStar(const QString windowTitle, bool isUnsaved)
Unsaved star.
A layer that can be used as a container for other kind of layers.
void onSelectionToggled(bool checked)
void onLayerFitOnMapDisplayTriggered()
This class implements a concrete tool to geographic pan operation.
void onZoomOutToggled(bool checked)
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
The base API for TerraLib applications.
virtual const char * what() const
It outputs the exception message.
static ApplicationController & getInstance()
It gives access to the controller singleton.
void registerToolBar(const QString &id, QToolBar *bar)
Register the toolbar in the list of the known toolbars.
virtual void closeEvent(QCloseEvent *e)
virtual void initSlotsConnections()
virtual void newProject()
double getHeight() const
It returns the envelope height.
QMenu * m_viewToolBarsMenu
void setSelectionColor(QColor selColor)
color used to hgihlight selected objects on this display.
It indicates that the project has unsaved changes.
void onRemoveLayerTriggered()
An utility struct for representing 2D coordinates.
A dock widget for table view objects.
void onLayerShowTableTriggered()
void onHighlightLayerObjects(const te::map::AbstractLayerPtr &layer, te::da::DataSet *dataset, const QColor &color)
TEQTAFEXPORT Project * ReadProject(const std::string &uri)
Reads and return a te::qt::af::Project from the file.
Contains a list of the map display events.
QToolBar * m_toolbar
Pointer to the new QToolBar.
LayerTreeView * getTreeView() const
TEQTAFEXPORT void SaveDataSourcesFile()
Saves data sources file.
virtual ~BaseApplication()
This event indicates that the objects of the given layer must be highlighted.
void onProjectPropertiesTriggered()
void onMeasureDistanceToggled(bool checked)
A dialog used to build a SRSManagerDialog element.
A dock widget for ChartDisplayWidget objects.
A connector for the te::qt::widgets::LayerExplorer class to the Application Framework.
void setChart(te::map::Chart *chart)
Update the interface with the chart properties.
This class implements a concrete tool to geographic zoom in operation using a boundary rectangle...
std::pair< int, std::string > m_srid
This class models the concept of a project for the TerraLib Application Framework.
void onMapSRIDTriggered()
virtual int getSRID() const
It return the Spatial Reference System used by the Map Display.
This event signals that a new layer was created.
TEQTAFEXPORT void SaveState(QMainWindow *mainWindow)
void onMapSetUnknwonSRIDTriggered()
void removeListener(QObject *obj)
Remove the obj from the list of event listeners.
double m_lly
Lower left corner y-coordinate.
A dialog for selecting a data source.
void onNextExtentTriggered()
void onDisplayVisibilityChanged(bool visible)
This class implements a concrete tool to get informations about a specified feature using pointing op...
void onPluginsManagerTriggered()
void setLayer(te::map::AbstractLayerPtr layer)
virtual void initStatusBar()
TEQTAFEXPORT void RestoreState(QMainWindow *mainWindow)
A QMainWindow to be used as the basis for TerraLib applications.
double m_ury
Upper right corner y-coordinate.
TEQTAFEXPORT void SaveLastDatasourceOnSettings(const QString &dsType)
virtual void openProject(const QString &projectFileName)
A singleton for managing the application plugins.
void onStyleExplorerVisibilityChanged(bool visible)
virtual void setExtent(te::gm::Envelope &e, bool doRefresh=true)
It sets the world visible area and refreshes the contents in the map display.
void onPreviousExtentTriggered()
void onNewProjectTriggered()
A tree view for the layers of an application.
void onRenameLayerTriggered()
void onRecentProjectsTriggered(QAction *proj)
QString getMostRecentProject() const
Returns the most recent project.
virtual void set(const std::list< te::da::DataSourceInfoPtr > &datasources)=0
A dock widget for DataSetTableView objects.
void setLayers(std::list< te::map::AbstractLayerPtr > layers)
Set the layer that can be used.
TEMAPEXPORT te::gm::Envelope GetSelectedExtent(const std::list< te::map::AbstractLayerPtr > layers, int srid, bool onlyVisibles)
It calculates the extent of selected objects of the given layers in the given SRID.
This class implements a concrete tool to select layer features using an extent.
Contains a list of the layer events.
const std::pair< int, std::string > & getSelectedSRS() const
Returns the selected SRS in the window.
double m_urx
Upper right corner x-coordinate.
void onAddQueryLayerTriggered()
virtual void setConfigFile(const std::string &configFileName)
Tells wich configuration file to be used by the controller during its initialization.
A widget to control the display of a set of layers.
virtual void setMsgBoxParentWidget(QWidget *w)
Tells the widget to be used as the parent of messages showned in a QMessageBox.
void set(te::qt::af::Project *prj)
Set the current project.
te::map::DataSetAdapterLayerPtr getDataSetAdapterLayer()
Returns a new DataSetAdapterLayer.
void onMapRemoveSelectionTriggered()
This class implements a concrete tool to measure operation (distance, area, and angle).
void onLayerRemoveItemTriggered()
This event signals that a new toolbar was added.
void onLayerPanToSelectedOnMapDisplayTriggered()
virtual void initialize()
Initializes the application framework.
Coord2D getCenter() const
It returns the rectangle's center coordinate.
A widget designed to explore the layers of an application.
void onSaveProjectTriggered()
void transform(int oldsrid, int newsrid)
It will transform the coordinates of the Envelope from the old SRS to the new one.
void onApplicationTriggered(te::qt::af::evt::Event *evt)
The class that represents an item in a LayerTreeModel.
void onLayerRemoveSelectionTriggered()
A connector for the te::qt::widgets::StyleDockWidget class to the Application Framework.
This event signals that a item belonging to a layer will be removed from the layer explorer...
virtual void finalize()
Finalize the application framework.
A class that models the description of a dataset.
void setLayer(te::map::AbstractLayerPtr layer)
Set a layer.
A multi thread Qt4 widget to control the display of a set of layers.
void onToolsCustomizeTriggered()
te::qt::widgets::ChartDisplayWidget * getDisplayWidget()
Returns a pointer to the generated ChartDisplayWidget.
A dialog used to build a grouping.
A dock widget used control the geographic data style using SE elements and a property browser to show...
TEQTAFEXPORT bool GetOpenLastProjectFromSettings()
TEQTAFEXPORT void Save(const Project &project, const std::string &uri)
Saves the informations of the project in the uri file.
void onLayerChartTriggered()
void addListener(QObject *obj)
Insert an application item that will listen to framework events.
virtual QWidget * getWidget(int widgetType, QWidget *parent=0, Qt::WindowFlags f=0) const =0
virtual void initializeProjectMenus()
Initializes the menus for the most recent open projects.
double m_llx
Lower left corner x-coordinate.
An abstract class for layer selection widgets.
void onOpenProjectTriggered()
A base class for application events.
This class represents the informations needed to build map charts.
virtual void initToolbars()
This event signals that a layer is to be removed from the layer explorer.
This class controls how a set of layers are displayed.
void setLayer(te::map::AbstractLayer *layer)
Sets the layer to be showed on view. This DOES NOT takes the ownership of layer.
A connector of the te::qt::widgets::MapDisplay class to the Application Framework.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
QMenu * m_projectAddLayerMenu
#define TR_QT_AF(message)
It marks a string in order to get translated. This is a special mark used in the DataAccess module of...
This event indicates that the selected objects of the layer were changed.
void onLayerPropertiesTriggered()
static DataSourceTypeManager & getInstance()
It returns a reference to the singleton instance.
virtual const te::gm::Envelope & getExtent() const
It returns the world extent showned by the MapDisplay.
A connector for the te::qt::widgets::LayerExplorer class to the Application Framework.
void onLayerSelectedObjectsChanged(const te::map::AbstractLayerPtr &layer)
void onInfoToggled(bool checked)
This class models the concept of a project for the TerraLib Application Framework.
An Envelope defines a 2D rectangular region.
TEQTAFEXPORT QString GetLastDatasourceFromSettings()
void updateRecentProjects(const QString &prjFile, const QString &prjTitle)
Update the list of recent projects. This is commonly used when there's a new most recent project...
A for customization of the application components.
void showProgressDockWidget()
A dialog used to build a chart.
A dock widget for chart display objects.
void onLayerFitSelectedOnMapDisplayTriggered()
A dialog used to configure the properties of a new textual file based layer.
void onStopDrawTriggered()
A dataset is the unit of information manipulated by the data access module of TerraLib.
void onDisplayDataTableChanged(bool visible)
void broadcast(te::qt::af::evt::Event *evt)
Send events in broadcast for all registered components.
te::qt::widgets::ChartDisplayWidget * getDisplayWidget()
Returns a pointer to the generated ChartDisplayWidget.
Contains the list of the application events.
TEQTAFEXPORT std::vector< QToolBar * > ReadToolBarsFromSettings(QWidget *barsParent=0)
Returns a vector of tool bars registered in the QSettings.
te::qt::af::Project * getProject()
Get the current project.
TEQTAFEXPORT void GetProjectInformationsFromSettings(QString &defaultAuthor, int &maxSaved)
void onQueryLayerTriggered()
A class that defines the interface of a qt widget to group a set of ProgressWidgetItem.
Signals a mouse moved over the current display.
void onToolsDataExchangerTriggered()