window.cpp 15.7 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1
#include "window.h"
2

Pierre Kraemer's avatar
Pierre Kraemer committed
3 4
#include <QVBoxLayout>
#include <QSplitter>
5 6 7
#include <QMessageBox>
#include <QDockWidget>
#include <QPluginLoader>
8
#include <QFile>
9
#include <QFileInfo>
10
#include <QDir>
11 12 13
#include <QKeyEvent>
#include <QMouseEvent>
#include <QWheelEvent>
14

Pierre Kraemer's avatar
Pierre Kraemer committed
15 16
#include "plugin.h"
#include "view.h"
17
#include "texture.h"
18 19
#include "camera.h"
#include "mapHandler.h"
20

Pierre Kraemer's avatar
Pierre Kraemer committed
21 22 23 24 25 26 27 28 29
#include "dialogs/camerasDialog.h"
#include "dialogs/pluginsDialog.h"
#include "dialogs/mapsDialog.h"

namespace CGoGN
{

namespace SCHNApps
{
Pierre Kraemer's avatar
Pierre Kraemer committed
30

31
Window::Window(const QString& appPath, PythonQtObjectPtr& pythonContext, PythonQtScriptingConsole& pythonConsole) :
Pierre Kraemer's avatar
Pierre Kraemer committed
32
	QMainWindow(),
Pierre Kraemer's avatar
Pierre Kraemer committed
33 34
	m_appPath(appPath),
	m_pythonContext(pythonContext),
35
	m_pythonConsole(pythonConsole),
36
	m_firstView(NULL),
37
	m_currentView(NULL)
38
{
Pierre Kraemer's avatar
Pierre Kraemer committed
39 40 41
	m_camerasDialog = new CamerasDialog(this);
	m_pluginsDialog = new PluginsDialog(this);
	m_mapsDialog = new MapsDialog(this);
42

43
	this->setupUi(this);
44

45 46 47
	m_dock = new QDockWidget(tr("Plugins' Tabs"), this);
	m_dock->setAllowedAreas(Qt::RightDockWidgetArea);
	m_dock->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable);
48
	addDockWidget(Qt::RightDockWidgetArea, m_dock);
Pierre Kraemer's avatar
Pierre Kraemer committed
49
	m_dock->setVisible(false);
50 51 52

	m_dockTabWidget = new QTabWidget(m_dock);
	m_dockTabWidget->setObjectName("DockTabWidget");
53
	m_dockTabWidget->setLayoutDirection(Qt::LeftToRight);
54 55 56
	m_dockTabWidget->setTabPosition(QTabWidget::East);
	m_dock->setWidget(m_dockTabWidget);

57 58
	connect(actionShowHideDock, SIGNAL(triggered()), this, SLOT(cb_showHideDock()));

59 60 61 62 63 64 65 66 67
	m_pythonDock = new QDockWidget(tr("Python"), this);
	m_pythonDock->setAllowedAreas(Qt::BottomDockWidgetArea);
	m_dock->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable);
	addDockWidget(Qt::BottomDockWidgetArea, m_pythonDock);
	m_pythonDock->setVisible(false);
	m_pythonDock->setWidget(&m_pythonConsole);

	connect(actionShowHidePythonDock, SIGNAL(triggered()), this, SLOT(cb_showHidePythonDock()));

Pierre Kraemer's avatar
Pierre Kraemer committed
68 69 70 71 72
	m_centralLayout = new QVBoxLayout(centralwidget);

	m_rootSplitter = new QSplitter(centralwidget);
	b_rootSplitterInitialized = false;
	m_centralLayout->addWidget(m_rootSplitter);
73

74 75
	// add first view
	m_firstView = addView();
76
	setCurrentView(m_firstView);
Pierre Kraemer's avatar
Pierre Kraemer committed
77
	m_rootSplitter->addWidget(m_firstView);
78

79 80
	glewInit();

Pierre Kraemer's avatar
Pierre Kraemer committed
81
	// connect the basic actions
82 83
	connect(actionAboutSCHNApps, SIGNAL(triggered()), this, SLOT(cb_aboutSCHNApps()));
	connect(actionAboutCGoGN, SIGNAL(triggered()), this, SLOT(cb_aboutCGoGN()));
84

Pierre Kraemer's avatar
Pierre Kraemer committed
85
	connect(actionManageCameras, SIGNAL(triggered()), this, SLOT(cb_manageCameras()));
86
	connect(actionManagePlugins, SIGNAL(triggered()), this, SLOT(cb_managePlugins()));
87
	connect(actionManageMaps, SIGNAL(triggered()), this, SLOT(cb_manageMaps()));
88

89
	registerPluginsDirectory(m_appPath + QString("/../lib"));
Pierre Kraemer's avatar
Pierre Kraemer committed
90 91
}

92 93 94 95
Window::~Window()
{
}

Pierre Kraemer's avatar
Pierre Kraemer committed
96 97 98 99
/*********************************************************
 * MANAGE DOCK
 *********************************************************/

100
void Window::addTabInDock(QWidget* tabWidget, const QString& tabText, bool enable)
Pierre Kraemer's avatar
Pierre Kraemer committed
101
{
102
	if(tabWidget)
103
	{
104 105
		int currentTab = m_dockTabWidget->currentIndex();

106
		int idx = m_dockTabWidget->addTab(tabWidget, tabText);
Pierre Kraemer's avatar
Pierre Kraemer committed
107
		m_dock->setVisible(true);
108
		m_dockTabWidget->setTabEnabled(idx, enable);
109 110 111

		if(currentTab != -1)
			m_dockTabWidget->setCurrentIndex(currentTab);
112
	}
Pierre Kraemer's avatar
Pierre Kraemer committed
113 114 115 116
}

void Window::removeTabInDock(QWidget *tabWidget)
{
117
	if(tabWidget)
Pierre Kraemer's avatar
Pierre Kraemer committed
118 119 120
		m_dockTabWidget->removeTab(m_dockTabWidget->indexOf(tabWidget));
}

121 122
void Window::enablePluginTabWidgets(Plugin* plugin)
{
123 124
	int currentTab = m_dockTabWidget->currentIndex();

125 126
	const QList<QWidget*> tabWidgets = plugin->getTabWidgets();
	foreach(QWidget* w, tabWidgets)
127 128 129
		m_dockTabWidget->setTabEnabled(m_dockTabWidget->indexOf(w), true);

	m_dockTabWidget->setCurrentIndex(currentTab);
130 131 132 133
}

void Window::disablePluginTabWidgets(Plugin* plugin)
{
134 135
	int currentTab = m_dockTabWidget->currentIndex();

136 137
	const QList<QWidget*> tabWidgets = plugin->getTabWidgets();
	foreach(QWidget* w, tabWidgets)
138 139 140
		m_dockTabWidget->setTabEnabled(m_dockTabWidget->indexOf(w), false);

	m_dockTabWidget->setCurrentIndex(currentTab);
141 142
}

Pierre Kraemer's avatar
Pierre Kraemer committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
/*********************************************************
 * MANAGE MENU ACTIONS
 *********************************************************/

bool Window::addMenuAction(const QString& menuPath, QAction* action)
{
	// if menu path = empty string: set error + failure
	if (menuPath.isEmpty())
		return false;

	if (!action)
		return false;

	// extracting all the substring separated by ';'
	QStringList stepNames = menuPath.split(";");
	stepNames.removeAll("");
	unsigned int nbStep = stepNames.count();

	// if only one substring: error + failure
	// No action directly in the menu bar
	if (nbStep < 1)
		return false;

	unsigned int i = 0;
167
	QMenu* lastMenu = NULL;
Pierre Kraemer's avatar
Pierre Kraemer committed
168 169 170
	foreach(QString step, stepNames)
	{
		++i;
171
		if (i < nbStep) // if not last substring (= menu)
Pierre Kraemer's avatar
Pierre Kraemer committed
172
		{
173 174 175 176 177 178
			// try to find an existing submenu with step name
			bool found = false;
			QList<QAction*> actions;
			if(i == 1) actions = menubar->actions();
			else actions = lastMenu->actions();
			foreach(QAction* action, actions)
Pierre Kraemer's avatar
Pierre Kraemer committed
179
			{
180 181
				QMenu* submenu = action->menu();
				if (submenu && submenu->title() == step)
Pierre Kraemer's avatar
Pierre Kraemer committed
182
				{
183 184 185
					lastMenu = submenu;
					found = true;
					break;
Pierre Kraemer's avatar
Pierre Kraemer committed
186 187
				}
			}
188
			if (!found)
Pierre Kraemer's avatar
Pierre Kraemer committed
189
			{
190
				QMenu* newMenu;
191 192 193 194 195 196 197 198 199 200
				if(i == 1)
				{
					newMenu = menubar->addMenu(step);
					newMenu->setParent(menubar);
				}
				else
				{
					newMenu = lastMenu->addMenu(step);
					newMenu->setParent(lastMenu);
				}
201
				lastMenu = newMenu;
Pierre Kraemer's avatar
Pierre Kraemer committed
202 203
			}
		}
204
		else // if last substring (= action name)
Pierre Kraemer's avatar
Pierre Kraemer committed
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
		{
			lastMenu->addAction(action);
			action->setText(step);
			action->setParent(lastMenu);
		}
	}

	return true;
}

void Window::removeMenuAction(QAction *action)
{
	if(action)
	{
		action->setEnabled(false);
		// parent of the action
		// which is an instance of QMenu if the action was created
		// using the addMenuActionMethod()
		QObject* parent = action->parent();
		delete action;

226
		while(parent != NULL)
Pierre Kraemer's avatar
Pierre Kraemer committed
227
		{
228 229
			QMenu* parentMenu = dynamic_cast<QMenu*>(parent);
			if(parentMenu && parentMenu->actions().empty())
Pierre Kraemer's avatar
Pierre Kraemer committed
230 231
			{
				parent = parent->parent();
232
				delete parentMenu;
Pierre Kraemer's avatar
Pierre Kraemer committed
233
			}
234 235
			else
				parent = NULL;
Pierre Kraemer's avatar
Pierre Kraemer committed
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
		}
	}
}

/*********************************************************
 * MANAGE TOOLBAR ACTIONS
 *********************************************************/

bool Window::addToolbarAction(QAction* action)
{
	if (action)
	{
		toolBar->addAction(action);
		return true;
	}
	return false;
}

void Window::removeToolbarAction(QAction* action)
{
	if (action)
		toolBar->removeAction(action);
}

/*********************************************************
261
 * MANAGE CAMERAS
Pierre Kraemer's avatar
Pierre Kraemer committed
262 263
 *********************************************************/

264
Camera* Window::addCamera(const QString& name)
Pierre Kraemer's avatar
Pierre Kraemer committed
265
{
266
	if (h_cameras.contains(name))
267 268
		return NULL;

269 270
	Camera* camera = new Camera(name, this);
	h_cameras.insert(name, camera);
Pierre Kraemer's avatar
Pierre Kraemer committed
271

272
	emit(cameraAdded(camera));
Pierre Kraemer's avatar
Pierre Kraemer committed
273

274 275
	return camera;
}
Pierre Kraemer's avatar
Pierre Kraemer committed
276

277 278 279
Camera* Window::addCamera()
{
	return addCamera(QString("camera_") + QString::number(Camera::cameraCount));
Pierre Kraemer's avatar
Pierre Kraemer committed
280 281
}

282
void Window::removeCamera(const QString& name)
Pierre Kraemer's avatar
Pierre Kraemer committed
283
{
284
	if (h_cameras.contains(name))
Pierre Kraemer's avatar
Pierre Kraemer committed
285
	{
286 287
		Camera* camera = h_cameras[name];
		h_cameras.remove(name);
Pierre Kraemer's avatar
Pierre Kraemer committed
288

289
		emit(cameraRemoved(camera));
Pierre Kraemer's avatar
Pierre Kraemer committed
290

291
		delete camera;
292 293
	}
}
Pierre Kraemer's avatar
Pierre Kraemer committed
294

295
Camera* Window::getCamera(const QString& name) const
Pierre Kraemer's avatar
Pierre Kraemer committed
296
{
297 298
	if (h_cameras.contains(name))
		return h_cameras[name];
Pierre Kraemer's avatar
Pierre Kraemer committed
299 300 301 302
	else
		return NULL;
}

303 304 305
/*********************************************************
 * MANAGE VIEWS
 *********************************************************/
Pierre Kraemer's avatar
Pierre Kraemer committed
306

307
View* Window::addView(const QString& name)
308
{
309 310
	if (h_views.contains(name))
		return NULL;
311

312 313
	View* view = NULL;
	if(m_firstView == NULL)
Pierre Kraemer's avatar
Pierre Kraemer committed
314
		view = new View(name, this);
315
	else
Pierre Kraemer's avatar
Pierre Kraemer committed
316
		view = new View(name, this, m_firstView);
317
	h_views.insert(name, view);
Pierre Kraemer's avatar
Pierre Kraemer committed
318

319 320
	emit(viewAdded(view));

321
	return view;
322 323
}

324 325 326 327 328
View* Window::addView()
{
	return addView(QString("view_") + QString::number(View::viewCount));
}

329
void Window::removeView(const QString& name)
330
{
331
	if (h_views.contains(name))
332
	{
Pierre Kraemer's avatar
Pierre Kraemer committed
333 334 335
		if(h_views.count() > 1)
		{
			View* view = h_views[name];
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
			if(view == m_firstView)
			{
				ViewHash::const_iterator i = h_views.constBegin();
				while (i != h_views.constEnd())
				{
					if(i.value() != view)
					{
						m_firstView = i.value();
						i = h_views.constEnd();
					}
					else
						++i;
				}
			}
//			if(view == m_currentView)
			setCurrentView(m_firstView);
Pierre Kraemer's avatar
Pierre Kraemer committed
352
			h_views.remove(name);
353 354 355

			emit(viewRemoved(view));

Pierre Kraemer's avatar
Pierre Kraemer committed
356 357
			delete view;
		}
358 359 360
	}
}

361
View* Window::getView(const QString& name) const
362
{
363 364
	if (h_views.contains(name))
		return h_views[name];
365
	else
366
		return NULL;
367 368
}

369 370
void Window::setCurrentView(View* view)
{
371 372 373 374 375 376 377 378
	if(m_currentView)
	{
		const QList<Plugin*>& oldPlugins = m_currentView->getLinkedPlugins();
		foreach(Plugin* p, oldPlugins)
			disablePluginTabWidgets(p);

		disconnect(m_currentView, SIGNAL(pluginLinked(Plugin*)), this, SLOT(enablePluginTabWidgets(Plugin*)));
	}
379 380 381 382 383 384 385 386

	View* oldCurrent = m_currentView;
	m_currentView = view;

	const QList<Plugin*>& newPlugins = m_currentView->getLinkedPlugins();
	foreach(Plugin* p, newPlugins)
		enablePluginTabWidgets(p);

387 388 389 390 391 392
	connect(m_currentView, SIGNAL(pluginLinked(Plugin*)), this, SLOT(enablePluginTabWidgets(Plugin*)));

	emit(currentViewChanged(m_currentView));

	if(oldCurrent)
		oldCurrent->updateGL();
393 394 395
	m_currentView->updateGL();
}

Pierre Kraemer's avatar
Pierre Kraemer committed
396
void Window::splitView(const QString& name, Qt::Orientation orientation)
397
{
Pierre Kraemer's avatar
Pierre Kraemer committed
398
	View* newView = addView();
399

Pierre Kraemer's avatar
Pierre Kraemer committed
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
	View* view = h_views[name];
	QSplitter* parent = (QSplitter*)(view->parentWidget());
	if(parent == m_rootSplitter && !b_rootSplitterInitialized)
	{
		m_rootSplitter->setOrientation(orientation);
		b_rootSplitterInitialized = true;
	}
	if(parent->orientation() == orientation)
		parent->insertWidget(parent->indexOf(view)+1, newView);
	else
	{
		int idx = parent->indexOf(view);
		view->setParent(NULL);
		QSplitter* spl = new QSplitter(orientation);
		spl->addWidget(view);
		spl->addWidget(newView);
		parent->insertWidget(idx, spl);
417 418 419
	}
}

420
/*********************************************************
421
 * MANAGE PLUGINS
422 423
 *********************************************************/

424
void Window::registerPluginsDirectory(const QString& path)
425
{
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447
	QDir directory(path);
	if(directory.exists())
	{
		QStringList filters;
		filters << "lib*.so";
		filters << "lib*.dylib";
		filters << "*.dll";

		QStringList pluginFiles = directory.entryList(filters, QDir::Files);

		foreach(QString pluginFile, pluginFiles)
		{
			QFileInfo pfi(pluginFile);
			QString pluginName = pfi.baseName().remove(0, 3);
			QString pluginFilePath = directory.absoluteFilePath(pluginFile);

			m_availablePlugins[pluginName] = pluginFilePath;
		}

		m_pluginsDialog->refreshPluginsList();
	}
}
448

449 450
Plugin* Window::loadPlugin(const QString& pluginName)
{
451
	if (h_plugins.contains(pluginName))
452
		return NULL;
453

454
	if (m_availablePlugins.contains(pluginName))
455
	{
456
		QString pluginFilePath = m_availablePlugins[pluginName];
Pierre Kraemer's avatar
Pierre Kraemer committed
457

458
		QPluginLoader loader(pluginFilePath);
459

460 461
		// if the loader loads a plugin instance
		if (QObject* pluginObject = loader.instance())
462
		{
463 464 465 466 467 468 469 470 471 472 473 474
			Plugin* plugin = qobject_cast<Plugin*>(pluginObject);

			// set the plugin with correct parameters (name, filepath, window)
			plugin->setName(pluginName);
			plugin->setFilePath(pluginFilePath);
			plugin->setWindow(this);

			// then we call its enable() methods
			if (plugin->enable())
			{
				// if it succeeded we reference this plugin
				h_plugins.insert(pluginName, plugin);
475

476 477
				statusbar->showMessage(pluginName + QString(" successfully loaded."), 2000);
				emit(pluginLoaded(plugin));
478

479
				m_pythonContext.addObject(pluginName, plugin);
480

481 482 483 484 485 486 487 488
				// method success
				return plugin;
			}
			else
			{
				delete plugin;
				return NULL;
			}
489
		}
490
		// if loading fails
491 492
		else
		{
493
			std::cout << "loadPlugin: loader.instance() failed" << std::endl << loader.errorString().toUtf8().constData() << std::endl;
494 495 496 497
			return NULL;
		}
	}
	else
Pierre Kraemer's avatar
Pierre Kraemer committed
498
	{
499
		std::cout << "loadPlugin: plugin not found (" << pluginName.toUtf8().constData() << ")" << std::endl;
500
		return NULL;
Pierre Kraemer's avatar
Pierre Kraemer committed
501 502 503
	}
}

504
void Window::unloadPlugin(const QString& pluginName)
505
{
506 507 508 509 510 511 512 513
	if (h_plugins.contains(pluginName))
	{
		Plugin* plugin = h_plugins[pluginName];

		// calling its disable() method and dereferencing it
		plugin->disable();
		h_plugins.remove(pluginName);

514 515 516 517
		QPluginLoader loader(plugin->getFilePath());
		loader.unload();

		statusbar->showMessage(pluginName + QString(" successfully unloaded."), 2000);
518
		emit(pluginUnloaded(plugin));
519 520 521 522

		// delete plugin
		delete plugin;
	}
523 524
}

525
Plugin* Window::getPlugin(const QString& name) const
526
{
527 528 529 530
	if (h_plugins.contains(name))
		return h_plugins[name];
	else
		return NULL;
531 532
}

533 534 535
/*********************************************************
 * MANAGE MAPS
 *********************************************************/
536

Pierre Kraemer's avatar
Pierre Kraemer committed
537
MapHandlerGen* Window::addMap(const QString& name, unsigned int dim)
538
{
Pierre Kraemer's avatar
Pierre Kraemer committed
539 540 541
	if (h_maps.contains(name))
		return NULL;

542 543 544 545 546 547 548 549 550 551 552
	GenericMap* map = NULL;
	switch(dim)
	{
		case 2 :
			map = new PFP2::MAP();
			break;
		case 3 :
			map = new PFP3::MAP();
			break;
	}

Pierre Kraemer's avatar
Pierre Kraemer committed
553 554
	MapHandlerGen* mh = new MapHandlerGen(name, this, map);
	h_maps.insert(name, mh);
555

Pierre Kraemer's avatar
Pierre Kraemer committed
556
	emit(mapAdded(mh));
557

Pierre Kraemer's avatar
Pierre Kraemer committed
558
	return mh;
559 560
}

561
void Window::removeMap(const QString& name)
562
{
563
	if (h_maps.contains(name))
564
	{
565
		MapHandlerGen* map = h_maps[name];
566
		h_maps.remove(name);
567 568 569

		emit(mapRemoved(map));

570
		delete map;
571
	}
572 573
}

574
MapHandlerGen* Window::getMap(const QString& name) const
575 576 577
{
	if (h_maps.contains(name))
		return h_maps[name];
578 579 580 581
	else
		return NULL;
}

582 583 584 585 586 587 588 589
/*********************************************************
 * MANAGE LINKS
 *********************************************************/

void Window::linkViewAndPlugin(View* v, Plugin* p)
{
	v->linkPlugin(p);
	p->linkView(v);
590 591

	emit(viewAndPluginLinked(v, p));
592 593 594 595 596 597
}

void Window::unlinkViewAndPlugin(View* v, Plugin* p)
{
	v->unlinkPlugin(p);
	p->unlinkView(v);
598 599

	emit(viewAndPluginUnlinked(v, p));
600 601 602 603 604 605
}

void Window::linkViewAndMap(View* v, MapHandlerGen* m)
{
	v->linkMap(m);
	m->linkView(v);
606 607

	emit(viewAndMapLinked(v, m));
608 609 610 611 612 613
}

void Window::unlinkViewAndMap(View* v, MapHandlerGen* m)
{
	v->unlinkMap(m);
	m->unlinkView(v);
614 615

	emit(viewAndMapUnlinked(v, m));
616 617 618 619
}

void Window::linkViewAndCamera(View* v, Camera* c)
{
620 621 622
	Camera* current = v->getCurrentCamera();
	current->unlinkView(v);
	emit(viewAndCameraUnlinked(v, current));
623 624
	v->setCurrentCamera(c);
	c->linkView(v);
625

626
	emit(viewAndCameraLinked(v, c));
627 628
}

629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669
/*********************************************************
 * MANAGE TEXTURES
 *********************************************************/

Texture* Window::getTexture(const QString& image)
{
	if(h_textures.contains(image))
	{
		Texture* t = h_textures[image];
		t->ref++;
		return t;
	}
	else
	{
		Texture* t = NULL;
		QImage img(image);
		if(!img.isNull())
		{
			GLuint texID = m_firstView->bindTexture(img);
			t = new Texture(texID, img.size(), 1);
			h_textures.insert(image, t);
		}
		return t;
	}
}

void Window::releaseTexture(const QString& image)
{
	if(h_textures.contains(image))
	{
		Texture* t = h_textures[image];
		t->ref--;
		if(t->ref == 0)
		{
			m_firstView->deleteTexture(h_textures[image]->texID);
			h_textures.remove(image);
			delete t;
		}
	}
}

670 671 672 673 674 675 676 677 678 679 680


void Window::cb_aboutSCHNApps()
{
	QString str("SCHNApps:\nS... CGoGN Holder for Nice Applications\n"
	            "Web site: http://cgogn.unistra.fr \n"
	            "Contact information: cgogn@unistra.fr");
	QMessageBox::about(this, tr("About SCHNApps"), str);
}

void Window::cb_aboutCGoGN()
681 682 683 684 685 686 687 688
{
	QString str("CGoGN:\nCombinatorial and Geometric modeling\n"
	            "with Generic N-dimensional Maps\n"
	            "Web site: http://cgogn.unistra.fr \n"
	            "Contact information: cgogn@unistra.fr");
	QMessageBox::about(this, tr("About CGoGN"), str);
}

689 690 691 692 693
void Window::cb_showHideDock()
{
	m_dock->setVisible(m_dock->isHidden());
}

694 695 696 697 698
void Window::cb_showHidePythonDock()
{
	m_pythonDock->setVisible(m_pythonDock->isHidden());
}

699
void Window::cb_manageCameras()
700
{
Pierre Kraemer's avatar
Pierre Kraemer committed
701
	m_camerasDialog->show();
702 703
}

704
void Window::cb_managePlugins()
705
{
Pierre Kraemer's avatar
Pierre Kraemer committed
706
	m_pluginsDialog->show();
707 708
}

709
void Window::cb_manageMaps()
710
{
Pierre Kraemer's avatar
Pierre Kraemer committed
711
	m_mapsDialog->show();
712
}
Pierre Kraemer's avatar
Pierre Kraemer committed
713 714 715 716

} // namespace SCHNApps

} // namespace CGoGN