Browse Source

Removed old QtWidget UI

Michael Lemaire 4 years ago
parent
commit
0585bc4b6f
100 changed files with 3 additions and 10513 deletions
  1. 2 5
      Makefile
  2. 1 1
      dist/paysages3d.sh
  3. 0 24
      src/interface/desktop/DesktopScenery.cpp
  4. 0 17
      src/interface/desktop/DesktopScenery.h
  5. 0 6
      src/interface/desktop/WidgetCanvas.cpp
  6. 0 29
      src/interface/desktop/WidgetCanvas.h
  7. 0 77
      src/interface/desktop/WidgetPreviewCanvas.cpp
  8. 0 50
      src/interface/desktop/WidgetPreviewCanvas.h
  9. 0 532
      src/interface/desktop/baseform.cpp
  10. 0 106
      src/interface/desktop/baseform.h
  11. 0 145
      src/interface/desktop/baseformlayer.cpp
  12. 0 43
      src/interface/desktop/baseformlayer.h
  13. 0 93
      src/interface/desktop/baseinput.cpp
  14. 0 49
      src/interface/desktop/baseinput.h
  15. 0 294
      src/interface/desktop/common/freeformhelper.cpp
  16. 0 81
      src/interface/desktop/common/freeformhelper.h
  17. 0 158
      src/interface/desktop/common/freelayerhelper.cpp
  18. 0 47
      src/interface/desktop/common/freelayerhelper.h
  19. 0 286
      src/interface/desktop/common/mainwindow.cpp
  20. 0 65
      src/interface/desktop/common/mainwindow.h
  21. 0 585
      src/interface/desktop/common/mainwindow.ui
  22. 0 18
      src/interface/desktop/common/widgetglobalformbuttons.cpp
  23. 0 27
      src/interface/desktop/common/widgetglobalformbuttons.h
  24. 0 85
      src/interface/desktop/common/widgetglobalformbuttons.ui
  25. 0 67
      src/interface/desktop/common/widgetsliderdecimal.cpp
  26. 0 29
      src/interface/desktop/common/widgetsliderdecimal.h
  27. 0 154
      src/interface/desktop/desktop.pro
  28. 0 21
      src/interface/desktop/desktop_global.h
  29. 0 104
      src/interface/desktop/dialogcurve.cpp
  30. 0 39
      src/interface/desktop/dialogcurve.h
  31. 0 86
      src/interface/desktop/dialogexplorer.cpp
  32. 0 27
      src/interface/desktop/dialogexplorer.h
  33. 0 76
      src/interface/desktop/dialoglayers.cpp
  34. 0 37
      src/interface/desktop/dialoglayers.h
  35. 0 352
      src/interface/desktop/dialognoise.cpp
  36. 0 52
      src/interface/desktop/dialognoise.h
  37. 0 189
      src/interface/desktop/dialogrender.cpp
  38. 0 56
      src/interface/desktop/dialogrender.h
  39. 0 82
      src/interface/desktop/formatmosphere.cpp
  40. 0 32
      src/interface/desktop/formatmosphere.h
  41. 0 81
      src/interface/desktop/formclouds.cpp
  42. 0 36
      src/interface/desktop/formclouds.h
  43. 0 140
      src/interface/desktop/formrender.cpp
  44. 0 40
      src/interface/desktop/formrender.h
  45. 0 88
      src/interface/desktop/formwater.cpp
  46. 0 33
      src/interface/desktop/formwater.h
  47. 0 59
      src/interface/desktop/inputboolean.cpp
  48. 0 25
      src/interface/desktop/inputboolean.h
  49. 0 52
      src/interface/desktop/inputcamera.cpp
  50. 0 30
      src/interface/desktop/inputcamera.h
  51. 0 54
      src/interface/desktop/inputcolor.cpp
  52. 0 27
      src/interface/desktop/inputcolor.h
  53. 0 94
      src/interface/desktop/inputcurve.cpp
  54. 0 34
      src/interface/desktop/inputcurve.h
  55. 0 76
      src/interface/desktop/inputdouble.cpp
  56. 0 32
      src/interface/desktop/inputdouble.h
  57. 0 32
      src/interface/desktop/inputenum.cpp
  58. 0 23
      src/interface/desktop/inputenum.h
  59. 0 29
      src/interface/desktop/inputint.cpp
  60. 0 25
      src/interface/desktop/inputint.h
  61. 0 33
      src/interface/desktop/inputlayers.cpp
  62. 0 25
      src/interface/desktop/inputlayers.h
  63. 0 47
      src/interface/desktop/inputmaterial.cpp
  64. 0 26
      src/interface/desktop/inputmaterial.h
  65. 0 82
      src/interface/desktop/inputnoise.cpp
  66. 0 30
      src/interface/desktop/inputnoise.h
  67. 0 79
      src/interface/desktop/lighting/DialogMaterialEditor.cpp
  68. 0 45
      src/interface/desktop/lighting/DialogMaterialEditor.h
  69. 0 416
      src/interface/desktop/lighting/DialogMaterialEditor.ui
  70. 0 24
      src/interface/desktop/lighting/SmallPreviewColor.cpp
  71. 0 21
      src/interface/desktop/lighting/SmallPreviewColor.h
  72. 0 27
      src/interface/desktop/lighting/SmallPreviewHues.cpp
  73. 0 16
      src/interface/desktop/lighting/SmallPreviewHues.h
  74. 0 118
      src/interface/desktop/previewmaterial.cpp
  75. 0 37
      src/interface/desktop/previewmaterial.h
  76. 0 33
      src/interface/desktop/terrain/dialogbaseterrainnoise.cpp
  77. 0 35
      src/interface/desktop/terrain/dialogbaseterrainnoise.h
  78. 0 43
      src/interface/desktop/terrain/dialogbaseterrainnoise.ui
  79. 0 126
      src/interface/desktop/terrain/dialogterrainpainting.cpp
  80. 0 41
      src/interface/desktop/terrain/dialogterrainpainting.h
  81. 0 993
      src/interface/desktop/terrain/dialogterrainpainting.ui
  82. 0 135
      src/interface/desktop/terrain/mainterrainform.cpp
  83. 0 44
      src/interface/desktop/terrain/mainterrainform.h
  84. 0 538
      src/interface/desktop/terrain/mainterrainform.ui
  85. 0 151
      src/interface/desktop/terrain/paintingbrush.cpp
  86. 0 48
      src/interface/desktop/terrain/paintingbrush.h
  87. 0 573
      src/interface/desktop/terrain/widgetheightmap.cpp
  88. 0 91
      src/interface/desktop/terrain/widgetheightmap.h
  89. 0 44
      src/interface/desktop/terrain/widgetterrainbasenoisepreview.cpp
  90. 0 24
      src/interface/desktop/terrain/widgetterrainbasenoisepreview.h
  91. 0 22
      src/interface/desktop/textures/DialogTexturesLayer.cpp
  92. 0 28
      src/interface/desktop/textures/DialogTexturesLayer.h
  93. 0 294
      src/interface/desktop/textures/DialogTexturesLayer.ui
  94. 0 160
      src/interface/desktop/textures/maintexturesform.cpp
  95. 0 48
      src/interface/desktop/textures/maintexturesform.h
  96. 0 451
      src/interface/desktop/textures/maintexturesform.ui
  97. 0 47
      src/interface/desktop/tools.cpp
  98. 0 43
      src/interface/desktop/tools.h
  99. 0 239
      src/interface/desktop/widgetcurveeditor.cpp
  100. 0 0
      src/interface/desktop/widgetcurveeditor.h

+ 2 - 5
Makefile

@@ -48,9 +48,6 @@ run:build
 run_cli:build
 	LD_LIBRARY_PATH=$(LIBRARY_PATH) ${RUNNER} ${BUILDPATH}/interface/commandline/paysages-cli $(ARGS)
 
-run_legacy:build
-	LD_LIBRARY_PATH=$(LIBRARY_PATH) ${RUNNER} ${BUILDPATH}/interface/desktop/paysages-gui $(ARGS)
-
 profile:build
 	LD_LIBRARY_PATH=${LIBRARY_PATH} perf record -g ${BUILDPATH}/interface/modeler/quickapp/paysages-modeler $(ARGS)
 	perf report -g
@@ -70,8 +67,8 @@ package:build
 	cp $(BUILDPATH)/render/software/libpaysages_render_software.so* paysages3d-linux/lib/
 	cp $(BUILDPATH)/render/preview/libpaysages_render_preview.so* paysages3d-linux/lib/
 	cp $(BUILDPATH)/render/opengl/libpaysages_render_opengl.so* paysages3d-linux/lib/
-	cp $(BUILDPATH)/interface/desktop/paysages-gui paysages3d-linux/lib/
-	chmod +x paysages3d-linux/lib/paysages-gui
+	cp $(BUILDPATH)/interface/modeler/quickapp/paysages-modeler paysages3d-linux/lib/
+	chmod +x paysages3d-linux/lib/paysages-modeler
 	cp -r data paysages3d-linux/
 	cp dist/paysages3d.sh paysages3d-linux/
 	chmod +x paysages3d-linux/paysages3d.sh

+ 1 - 1
dist/paysages3d.sh

@@ -5,6 +5,6 @@ export LD_LIBRARY_PATH=${SCRIPT_PATH}/lib:"${LD_LIBRARY_PATH}"
 cd ${SCRIPT_PATH}
 COLLECT_NEEDED=$(ldd lib/paysages-gui | grep -c 'not found')
 [ $COLLECT_NEEDED -gt 0 ] && export LD_LIBRARY_PATH=${SCRIPT_PATH}/lib/collected:"${LD_LIBRARY_PATH}"
-${SCRIPT_PATH}/lib/paysages-gui
+${SCRIPT_PATH}/lib/paysages-modeler
 cd - > /dev/null
 

+ 0 - 24
src/interface/desktop/DesktopScenery.cpp

@@ -1,24 +0,0 @@
-#include "DesktopScenery.h"
-
-#include "common/mainwindow.h"
-
-static DesktopScenery _main_scenery;
-
-void DesktopScenery::save(PackStream *stream) const
-{
-    Scenery::save(stream);
-
-    MainWindow::instance()->guiSave(stream);
-}
-
-void DesktopScenery::load(PackStream *stream)
-{
-    Scenery::load(stream);
-
-    MainWindow::instance()->guiLoad(stream);
-}
-
-DesktopScenery* DesktopScenery::getCurrent()
-{
-    return &_main_scenery;
-}

+ 0 - 17
src/interface/desktop/DesktopScenery.h

@@ -1,17 +0,0 @@
-#ifndef DESKTOPSCENERY_H
-#define DESKTOPSCENERY_H
-
-#include "desktop_global.h"
-
-#include "Scenery.h"
-
-class DesktopScenery: public Scenery
-{
-public:
-    virtual void save(PackStream* stream) const override;
-    virtual void load(PackStream* stream) override;
-
-    static DesktopScenery* getCurrent();
-};
-
-#endif // DESKTOPSCENERY_H

+ 0 - 6
src/interface/desktop/WidgetCanvas.cpp

@@ -1,6 +0,0 @@
-#include "WidgetCanvas.h"
-
-WidgetCanvas::WidgetCanvas(QWidget *parent) :
-    QWidget(parent)
-{
-}

+ 0 - 29
src/interface/desktop/WidgetCanvas.h

@@ -1,29 +0,0 @@
-#ifndef WIDGETCANVAS_H
-#define WIDGETCANVAS_H
-
-#include "desktop_global.h"
-
-#include <QWidget>
-
-namespace paysages {
-namespace desktop {
-
-/*!
- * \brief Widget to display the full content of a Canvas.
- */
-class WidgetCanvas : public QWidget
-{
-    Q_OBJECT
-public:
-    explicit WidgetCanvas(QWidget *parent = 0);
-
-signals:
-
-public slots:
-
-};
-
-}
-}
-
-#endif // WIDGETCANVAS_H

+ 0 - 77
src/interface/desktop/WidgetPreviewCanvas.cpp

@@ -1,77 +0,0 @@
-#include "WidgetPreviewCanvas.h"
-
-#include "tools.h"
-#include "Canvas.h"
-#include "CanvasPreview.h"
-
-#include <QPainter>
-
-WidgetPreviewCanvas::WidgetPreviewCanvas(QWidget *parent) :
-    QWidget(parent), canvas(NULL)
-{
-    pixbuf = new QImage();
-
-    startTimer(500);
-}
-
-WidgetPreviewCanvas::~WidgetPreviewCanvas()
-{
-    delete pixbuf;
-}
-
-void WidgetPreviewCanvas::setCanvas(const Canvas *canvas)
-{
-    if (not this->canvas)
-    {
-        this->canvas = canvas;
-        canvas->getPreview()->initLive(this);
-    }
-}
-
-void WidgetPreviewCanvas::setToneMapping(const ColorProfile &profile)
-{
-    if (canvas)
-    {
-        canvas->getPreview()->setToneMapping(profile);
-        canvas->getPreview()->updateLive(this);
-        update();
-    }
-}
-
-void WidgetPreviewCanvas::paintEvent(QPaintEvent *)
-{
-    QPainter painter(this);
-    painter.drawImage(0, 0, *pixbuf);
-}
-
-void WidgetPreviewCanvas::canvasResized(int width, int height)
-{
-    if (QSize(width, height) != this->size())
-    {
-        setMaximumSize(width, height);
-        setMinimumSize(width, height);
-        resize(width, height);
-
-        delete pixbuf;
-        pixbuf = new QImage(width, height, QImage::Format_ARGB32);
-    }
-}
-
-void WidgetPreviewCanvas::canvasCleared(const Color &col)
-{
-    pixbuf->fill(colorToQColor(col));
-}
-
-void WidgetPreviewCanvas::canvasPainted(int x, int y, const Color &col)
-{
-    pixbuf->setPixel(x, pixbuf->height() - 1 - y, colorToQColor(col).rgb());
-}
-
-void WidgetPreviewCanvas::timerEvent(QTimerEvent *)
-{
-    if (canvas)
-    {
-        canvas->getPreview()->updateLive(this);
-        update();
-    }
-}

+ 0 - 50
src/interface/desktop/WidgetPreviewCanvas.h

@@ -1,50 +0,0 @@
-#ifndef WIDGETPREVIEWCANVAS_H
-#define WIDGETPREVIEWCANVAS_H
-
-#include "desktop_global.h"
-
-#include <QWidget>
-#include "CanvasLiveClient.h"
-
-namespace paysages {
-namespace desktop {
-
-/**
- * Widget to display a live-updated preview of a Canvas software rendering.
- */
-class WidgetPreviewCanvas : public QWidget, public CanvasLiveClient
-{
-    Q_OBJECT
-public:
-    explicit WidgetPreviewCanvas(QWidget *parent = 0);
-    virtual ~WidgetPreviewCanvas();
-
-    /**
-     * Set the canvas to watch and display, null to stop watching.
-     *
-     * This function must be called from the graphics thread.
-     */
-    void setCanvas(const Canvas *canvas);
-
-    /**
-     * Set the tone mapping to apply to pixel colors.
-     */
-    void setToneMapping(const ColorProfile &profile);
-
-    virtual void paintEvent(QPaintEvent* event);
-
-protected:
-    virtual void canvasResized(int width, int height);
-    virtual void canvasCleared(const Color &col);
-    virtual void canvasPainted(int x, int y, const Color &col);
-    virtual void timerEvent(QTimerEvent *event);
-
-private:
-    QImage* pixbuf;
-    const Canvas *canvas;
-};
-
-}
-}
-
-#endif // WIDGETPREVIEWCANVAS_H

+ 0 - 532
src/interface/desktop/baseform.cpp

@@ -1,532 +0,0 @@
-#include "baseform.h"
-
-#include "inputdouble.h"
-#include "inputint.h"
-#include "inputboolean.h"
-#include "inputcolor.h"
-#include "inputnoise.h"
-#include "inputcurve.h"
-#include "inputmaterial.h"
-#include "inputenum.h"
-#include "inputlayers.h"
-#include "BasePreview.h"
-
-#include <QVBoxLayout>
-#include <QHBoxLayout>
-#include <QLabel>
-#include <QVariant>
-#include <QInputDialog>
-#include <QComboBox>
-#include <QPushButton>
-
-BaseForm::BaseForm(QWidget* parent, bool auto_apply, bool with_layers) : QWidget(parent)
-{
-    QWidget* control;
-    QWidget* layers;
-    QLabel* label;
-
-    this->_auto_apply = auto_apply;
-    this->_with_layers = with_layers;
-
-    setLayout(new QHBoxLayout());
-
-    control = new QWidget(this);
-    control->setLayout(new QVBoxLayout());
-    control->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-    layout()->addWidget(control);
-
-    _layer_count = 0;
-
-    if (with_layers)
-    {
-        layers = new QWidget(this);
-        layers->setLayout(new QHBoxLayout());
-        layers->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
-
-        label = new QLabel(tr("Layers : "), layers);
-        label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-        layers->layout()->addWidget(label);
-
-        _layer_list = new QComboBox(layers);
-        layers->layout()->addWidget(_layer_list);
-        QObject::connect(_layer_list, SIGNAL(currentIndexChanged(int)), this, SLOT(layerListChanged()));
-
-        _layer_new = new QPushButton(QIcon(getDataPath("images/layer_add.png")), "", layers);
-        _layer_new->setToolTip(tr("Add layer"));
-        _layer_new->setMaximumSize(30, 30);
-        layers->layout()->addWidget(_layer_new);
-        QObject::connect(_layer_new, SIGNAL(clicked()), this, SLOT(layerAddClicked()));
-
-        _layer_del = new QPushButton(QIcon(getDataPath("images/layer_del.png")), "", layers);
-        _layer_del->setToolTip(tr("Delete layer"));
-        _layer_del->setMaximumSize(30, 30);
-        layers->layout()->addWidget(_layer_del);
-        QObject::connect(_layer_del, SIGNAL(clicked()), this, SLOT(layerDelClicked()));
-
-        _layer_rename = new QPushButton(QIcon(getDataPath("images/layer_rename.png")), "", layers);
-        _layer_rename->setToolTip(tr("Rename layer"));
-        _layer_rename->setMaximumSize(30, 30);
-        layers->layout()->addWidget(_layer_rename);
-        QObject::connect(_layer_rename, SIGNAL(clicked()), this, SLOT(layerRenameClicked()));
-
-        _layer_up = new QPushButton(QIcon(getDataPath("images/layer_up.png")), "", layers);
-        _layer_up->setToolTip(tr("Move layer upward"));
-        _layer_up->setMaximumSize(30, 30);
-        layers->layout()->addWidget(_layer_up);
-        QObject::connect(_layer_up, SIGNAL(clicked()), this, SLOT(layerUpClicked()));
-
-        _layer_down = new QPushButton(QIcon(getDataPath("images/layer_down.png")), "", layers);
-        _layer_down->setToolTip(tr("Move layer downward"));
-        _layer_down->setMaximumSize(30, 30);
-        layers->layout()->addWidget(_layer_down);
-        QObject::connect(_layer_down, SIGNAL(clicked()), this, SLOT(layerDownClicked()));
-
-        control->layout()->addWidget(layers);
-        control->layout()->setAlignment(_buttons, Qt::AlignTop);
-    }
-
-    _previews = new QWidget(this);
-    _previews->setLayout(new QVBoxLayout());
-    _previews->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-    layout()->addWidget(_previews);
-    layout()->setAlignment(_previews, Qt::AlignTop);
-
-    _form = new QWidget(this);
-    _form->setLayout(new QHBoxLayout());
-    control->layout()->addWidget(_form);
-    control->layout()->setAlignment(_form, Qt::AlignTop);
-
-    _form_labels = new QWidget(_form);
-    _form_labels->setLayout(new QVBoxLayout());
-    _form->layout()->addWidget(_form_labels);
-
-    _form_previews = new QWidget(_form);
-    _form_previews->setLayout(new QVBoxLayout());
-    _form->layout()->addWidget(_form_previews);
-
-    _form_controls = new QWidget(_form);
-    _form_controls->setLayout(new QVBoxLayout());
-    _form->layout()->addWidget(_form_controls);
-
-    _buttons = new QWidget(this);
-    _buttons->setLayout(new QHBoxLayout());
-    control->layout()->addWidget(_buttons);
-    control->layout()->setAlignment(_buttons, Qt::AlignBottom);
-
-    _button_revert = addButton(tr("Revert"));
-    _button_revert->setIcon(QIcon(getDataPath("images/cancel.png")));
-    _button_revert->setEnabled(false);
-    connect(_button_revert, SIGNAL(clicked()), this, SLOT(revertConfig()));
-    _button_apply = addButton(tr("Apply"));
-    _button_apply->setIcon(QIcon(getDataPath("images/apply.png")));
-    _button_apply->setEnabled(false);
-    connect(_button_apply, SIGNAL(clicked()), this, SLOT(applyConfig()));
-    _button_preset = addButton(tr("Load preset"));
-    _button_preset->setIcon(QIcon(getDataPath("images/auto.png")));
-    _button_preset->hide();
-    connect(_button_preset, SIGNAL(clicked()), this, SLOT(presetChoiceClicked()));
-
-    _auto_update_previews = true;
-
-    if (auto_apply)
-    {
-        hideButtons();
-    }
-}
-
-void BaseForm::hideButtons()
-{
-    _button_apply->hide();
-    _button_revert->hide();
-}
-
-void BaseForm::savePack(PackStream* stream)
-{
-    // Save previews status
-    for (int i = 0; i < _previews_list.size(); i++)
-    {
-        _previews_list[i]->savePack(stream);
-    }
-}
-
-void BaseForm::loadPack(PackStream* stream)
-{
-    // Load previews status
-    for (int i = 0; i < _previews_list.size(); i++)
-    {
-        _previews_list[i]->loadPack(stream);
-    }
-}
-
-void BaseForm::configChangeEvent()
-{
-    if (_auto_apply)
-    {
-        applyConfig();
-    }
-    else
-    {
-        _button_apply->setEnabled(true);
-        _button_revert->setEnabled(true);
-    }
-
-    for (int i = 0; i < _inputs_list.size(); i++)
-    {
-        if (_with_layers && _layer_list->count() == 0)
-        {
-            _inputs_list[i]->checkVisibility(false);
-        }
-        else
-        {
-            _inputs_list[i]->checkVisibility(true);
-        }
-    }
-
-    if (_auto_update_previews)
-    {
-        updatePreviews();
-    }
-}
-
-void BaseForm::autoPresetSelected(int)
-{
-    for (int i = 0; i < _inputs_list.size(); i++)
-    {
-        _inputs_list[i]->revert();
-    }
-    updatePreviews();
-    configChangeEvent();
-}
-
-void BaseForm::revertConfig()
-{
-    for (int i = 0; i < _inputs_list.size(); i++)
-    {
-        _inputs_list[i]->revert();
-    }
-
-    if (_with_layers)
-    {
-        rebuildLayerList();
-        if (_layer_list->currentIndex() < 0 && _layer_list->count() > 0)
-        {
-            _layer_list->setCurrentIndex(0);
-        }
-    }
-
-    for (int i = 0; i < _inputs_list.size(); i++)
-    {
-        if (_with_layers && _layer_list->count() == 0)
-        {
-            _inputs_list[i]->checkVisibility(false);
-        }
-        else
-        {
-            _inputs_list[i]->checkVisibility(true);
-        }
-    }
-
-    updatePreviews();
-    //configChangeEvent();
-
-    _button_apply->setEnabled(false);
-    _button_revert->setEnabled(false);
-}
-
-void BaseForm::applyConfig()
-{
-    _button_apply->setEnabled(false);
-    _button_revert->setEnabled(false);
-
-    emit(configApplied());
-}
-
-void BaseForm::rebuildLayerList()
-{
-    if (_with_layers)
-    {
-        int selected = _layer_list->currentIndex();
-        _layer_list->clear();
-
-        _layer_names = getLayers();
-        _layer_count = _layer_names.count();
-
-        for (int i = 0; i < _layer_count; i++)
-        {
-            _layer_list->addItem(QString(tr("Layer %1 - %2")).arg(i + 1).arg(_layer_names[i]));
-        }
-        if (selected >= 0)
-        {
-            if (selected >= _layer_count)
-            {
-                _layer_list->setCurrentIndex(_layer_count - 1);
-            }
-            else
-            {
-                _layer_list->setCurrentIndex(selected);
-            }
-        }
-    }
-}
-
-void BaseForm::layerAddClicked()
-{
-    layerAddedEvent();
-
-    rebuildLayerList();
-    _layer_list->setCurrentIndex(_layer_list->count() - 1);
-
-    _button_apply->setEnabled(true);
-    _button_revert->setEnabled(true);
-}
-
-void BaseForm::layerDelClicked()
-{
-    if (_layer_list->currentIndex() >= 0)
-    {
-        layerDeletedEvent(_layer_list->currentIndex());
-
-        rebuildLayerList();
-
-        _button_apply->setEnabled(true);
-        _button_revert->setEnabled(true);
-    }
-}
-
-void BaseForm::layerUpClicked()
-{
-    if (_layer_list->currentIndex() < _layer_count - 1)
-    {
-        layerMovedEvent(_layer_list->currentIndex(), _layer_list->currentIndex() + 1);
-
-        rebuildLayerList();
-
-        _layer_list->setCurrentIndex(_layer_list->currentIndex() + 1);
-
-        _button_apply->setEnabled(true);
-        _button_revert->setEnabled(true);
-    }
-}
-
-void BaseForm::layerDownClicked()
-{
-    if (_layer_list->currentIndex() > 0)
-    {
-        layerMovedEvent(_layer_list->currentIndex(), _layer_list->currentIndex() - 1);
-
-        rebuildLayerList();
-
-        _layer_list->setCurrentIndex(_layer_list->currentIndex() - 1);
-
-        _button_apply->setEnabled(true);
-        _button_revert->setEnabled(true);
-    }
-}
-
-void BaseForm::layerRenameClicked()
-{
-    int layer = _layer_list->currentIndex();
-    if (layer >= 0)
-    {
-        QString new_name = QInputDialog::getText(this, tr("Rename layer"), tr("New name: "), QLineEdit::Normal, _layer_names[layer]);
-        if (not new_name.isEmpty())
-        {
-            layerRenamedEvent(layer, new_name);
-
-            _button_apply->setEnabled(true);
-            _button_revert->setEnabled(true);
-        }
-    }
-}
-
-void BaseForm::layerListChanged()
-{
-    bool changed = _button_apply->isEnabled();
-
-    layerSelectedEvent(_layer_list->currentIndex());
-
-    _button_apply->setEnabled(changed);
-    _button_revert->setEnabled(changed);
-}
-
-void BaseForm::presetChoiceClicked()
-{
-    bool ok;
-    QString item = QInputDialog::getItem(this, tr("Choose a preset"), tr("Preset settings : "), _preset_list, 0, false, &ok);
-
-    if (ok && !item.isEmpty())
-    {
-        int preset = _preset_list.indexOf(item);
-        if (preset >= 0)
-        {
-            autoPresetSelected(preset);
-        }
-    }
-}
-
-void BaseForm::addPreview(BasePreview* preview, QString label)
-{
-    QLabel* label_widget;
-
-    label_widget = new QLabel(label, _previews);
-    label_widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
-
-    _previews->layout()->addWidget(label_widget);
-    _previews->layout()->addWidget(preview);
-
-    preview->setMinimumSize(256, 256);
-    preview->setMaximumSize(256, 256);
-    preview->resize(256, 256);
-
-    _previews_list.append(preview);
-}
-
-QPushButton* BaseForm::addButton(QString label)
-{
-    QPushButton* button = new QPushButton(label);
-    _buttons->layout()->addWidget(button);
-    return button;
-}
-
-void BaseForm::addAutoPreset(QString label)
-{
-    _preset_list.append(label);
-    _button_preset->show();
-}
-
-BaseInput* BaseForm::addInput(BaseInput* input)
-{
-    int row_height = 30;
-
-    _form_labels->layout()->addWidget(input->label());
-    _form_previews->layout()->addWidget(input->preview());
-    _form_controls->layout()->addWidget(input->control());
-
-    input->label()->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
-    input->label()->setMinimumSize(150, row_height);
-    input->label()->setMaximumSize(250, row_height);
-
-    input->preview()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-    input->preview()->setMinimumSize(100, row_height);
-    input->preview()->setMaximumSize(250, row_height);
-
-    input->control()->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
-    input->control()->setMinimumSize(280, row_height);
-    input->control()->setMaximumSize(700, row_height);
-
-    connect(input, SIGNAL(valueChanged()), this, SLOT(configChangeEvent()));
-
-    _inputs_list.append(input);
-    input->revert();
-
-    return input;
-}
-
-BaseInput* BaseForm::addInputInt(QString label, int* value, int min, int max, int small_step, int large_step)
-{
-    return addInput(new InputInt(_form, label, value, min, max, small_step, large_step));
-}
-
-BaseInput* BaseForm::addInputDouble(QString label, double* value, double min, double max, double small_step, double large_step)
-{
-    return addInput(new InputDouble(_form, label, value, min, max, small_step, large_step));
-}
-
-BaseInput* BaseForm::addInputBoolean(QString label, int* value)
-{
-    return addInput(new InputBoolean(_form, label, value));
-}
-
-BaseInput* BaseForm::addInputColor(QString label, Color* value)
-{
-    return addInput(new InputColor(_form, label, value));
-}
-
-BaseInput* BaseForm::addInputNoise(QString label, NoiseGenerator* value)
-{
-    return addInput(new InputNoise(_form, label, value));
-}
-
-BaseInput* BaseForm::addInputCurve(QString label, Curve* value, double xmin, double xmax, double ymin, double ymax, QString xlabel, QString ylabel)
-{
-    return addInput(new InputCurve(_form, label, value, xmin, xmax, ymin, ymax, xlabel, ylabel));
-}
-
-BaseInput* BaseForm::addInputMaterial(QString label, SurfaceMaterial* material)
-{
-    return addInput(new InputMaterial(_form, label, material));
-}
-
-BaseInput* BaseForm::addInputEnum(QString label, int* value, const QStringList& values)
-{
-    return addInput(new InputEnum(_form, label, value, values));
-}
-
-void BaseForm::updatePreviews()
-{
-    for (int i = 0; i < _previews_list.size(); i++)
-    {
-        _previews_list[i]->redraw();
-    }
-}
-
-void BaseForm::disablePreviewsUpdate()
-{
-    _auto_update_previews = false;
-}
-
-int BaseForm::currentLayer()
-{
-    if (_with_layers)
-    {
-        return _layer_list->currentIndex();
-    }
-    else
-    {
-        return -1;
-    }
-}
-
-QStringList BaseForm::getLayers()
-{
-    return QStringList();
-}
-
-void BaseForm::layerAddedEvent()
-{
-    rebuildLayerList();
-}
-
-void BaseForm::layerDeletedEvent(int)
-{
-    rebuildLayerList();
-}
-
-void BaseForm::layerMovedEvent(int, int)
-{
-    rebuildLayerList();
-}
-
-void BaseForm::layerRenamedEvent(int, QString)
-{
-    rebuildLayerList();
-}
-
-void BaseForm::layerSelectedEvent(int layer)
-{
-    for (int i = 0; i < _inputs_list.size(); i++)
-    {
-        _inputs_list[i]->revert();
-        _inputs_list[i]->checkVisibility(layer >= 0);
-    }
-
-    for (int i = 0; i < _previews_list.size(); i++)
-    {
-        _previews_list[i]->redraw();
-    }
-
-    _layer_del->setEnabled(layer >= 0);
-    _layer_rename->setEnabled(layer >= 0);
-    _layer_down->setEnabled(layer > 0);
-    _layer_up->setEnabled(layer >= 0 and layer < _layer_count - 1);
-}

+ 0 - 106
src/interface/desktop/baseform.h

@@ -1,106 +0,0 @@
-#ifndef _PAYSAGES_QT_BASEFORM_H_
-#define _PAYSAGES_QT_BASEFORM_H_
-
-#include "desktop_global.h"
-
-#include <QWidget>
-#include <QStringList>
-
-class QPushButton;
-class QComboBox;
-class ColorGradation;
-
-namespace paysages {
-namespace desktop {
-
-class BaseForm : public QWidget
-{
-    Q_OBJECT
-
-public:
-    BaseForm(QWidget* parent, bool auto_apply = false, bool with_layers = false);
-    void hideButtons();
-    virtual void savePack(PackStream* stream);
-    virtual void loadPack(PackStream* stream);
-
-signals:
-    void configApplied();
-
-public slots:
-    virtual void revertConfig();
-    virtual void applyConfig();
-
-protected slots:
-    virtual void configChangeEvent();
-    virtual void autoPresetSelected(int preset);
-
-private slots:
-    void rebuildLayerList();
-    void layerAddClicked();
-    void layerDelClicked();
-    void layerUpClicked();
-    void layerDownClicked();
-    void layerRenameClicked();
-    void layerListChanged();
-    void presetChoiceClicked();
-
-protected:
-    void addPreview(BasePreview* preview, QString label);
-    QPushButton* addButton(QString label);
-    void addAutoPreset(QString label);
-    BaseInput* addInput(BaseInput* input);
-    BaseInput* addInputInt(QString label, int* value, int min, int max, int small_step, int large_step);
-    BaseInput* addInputDouble(QString label, double* value, double min, double max, double small_step, double large_step);
-    BaseInput* addInputBoolean(QString label, int* value);
-    BaseInput* addInputColor(QString label, Color* value);
-    BaseInput* addInputNoise(QString label, NoiseGenerator* value);
-    BaseInput* addInputCurve(QString label, Curve* value, double xmin, double xmax, double ymin, double ymax, QString xlabel, QString ylabel);
-    BaseInput* addInputMaterial(QString label, SurfaceMaterial* material);
-    BaseInput* addInputEnum(QString label, int* value, const QStringList& values);
-
-    void updatePreviews();
-    void disablePreviewsUpdate();
-
-    int currentLayer();
-    virtual QStringList getLayers();
-
-    virtual void layerAddedEvent();
-    virtual void layerDeletedEvent(int layer);
-    virtual void layerMovedEvent(int layer, int new_position);
-    virtual void layerRenamedEvent(int layer, QString new_name);
-    virtual void layerSelectedEvent(int layer);
-
-private:
-    bool _auto_apply;
-    QWidget* _form;
-    QWidget* _form_labels;
-    QWidget* _form_previews;
-    QWidget* _form_controls;
-    QWidget* _buttons;
-    QPushButton* _button_apply;
-    QPushButton* _button_revert;
-    QPushButton* _button_preset;
-
-    QWidget* _previews;
-    QVector<BasePreview*> _previews_list;
-    bool _auto_update_previews;
-
-    QVector<BaseInput*> _inputs_list;
-
-    QStringList _preset_list;
-
-    bool _with_layers;
-    QComboBox* _layer_list;
-    int _layer_count;
-    QStringList _layer_names;
-    QPushButton* _layer_new;
-    QPushButton* _layer_del;
-    QPushButton* _layer_up;
-    QPushButton* _layer_down;
-    QPushButton* _layer_rename;
-};
-
-}
-}
-
-#endif

+ 0 - 145
src/interface/desktop/baseformlayer.cpp

@@ -1,145 +0,0 @@
-#include "baseformlayer.h"
-
-#include <QInputDialog>
-#include "Layers.h"
-
-BaseFormLayer::BaseFormLayer(QWidget* parent, Layers* layers) : BaseForm(parent, false, true)
-{
-    _layers_original = NULL;
-    _layers_modified = NULL;
-    if (layers)
-    {
-        _layers_original = layers;
-        _layers_modified = _layers_original->newCopy();
-    }
-}
-
-BaseFormLayer::~BaseFormLayer()
-{
-    if (_layers_modified)
-    {
-        delete _layers_modified;
-    }
-}
-
-void BaseFormLayer::revertConfig()
-{
-    if (_layers_original && _layers_modified)
-    {
-        _layers_original->copy(_layers_modified);
-        layerSelectedEvent(currentLayer());
-    }
-
-    BaseForm::revertConfig();
-}
-
-void BaseFormLayer::applyConfig()
-{
-    if (_layers_original && _layers_modified)
-    {
-        _layers_modified->copy(_layers_original);
-    }
-
-    BaseForm::applyConfig();
-}
-
-void BaseFormLayer::setLayers(Layers* layers)
-{
-    _layers_original = layers;
-    if (_layers_modified)
-    {
-        delete _layers_modified;
-    }
-    _layers_modified = _layers_original->newCopy();
-    revertConfig();
-}
-
-void BaseFormLayer::afterLayerAdded(void*)
-{
-}
-
-void BaseFormLayer::configChangeEvent()
-{
-    if (_layers_modified)
-    {
-        layerWriteCurrentTo(_layers_modified->getLayer(currentLayer()));
-        _layers_modified->validate();
-    }
-
-    BaseForm::configChangeEvent();
-}
-
-QStringList BaseFormLayer::getLayers()
-{
-    QStringList result;
-
-    if (_layers_modified)
-    {
-        for (int i = 0; i < _layers_modified->count(); i++)
-        {
-            result << QString::fromStdString(_layers_modified->getLayer(i)->getName());
-        }
-    }
-
-    return result;
-}
-
-void BaseFormLayer::layerAddedEvent()
-{
-    if (_layers_modified)
-    {
-        QString layer_name = QInputDialog::getText(this, tr("Create layer"), tr("Layer name :"), QLineEdit::Normal, tr("Unnamed layer"));
-        if (not layer_name.isEmpty())
-        {
-            int layer = _layers_modified->addLayer();
-            if (layer >= 0)
-            {
-                _layers_modified->getLayer(layer)->setName(layer_name.toStdString());
-
-                BaseForm::layerAddedEvent();
-
-                afterLayerAdded(_layers_modified->getLayer(layer));
-            }
-        }
-    }
-}
-
-void BaseFormLayer::layerDeletedEvent(int layer)
-{
-    if (_layers_modified)
-    {
-        _layers_modified->removeLayer(layer);
-    }
-
-    BaseForm::layerDeletedEvent(layer);
-}
-
-void BaseFormLayer::layerMovedEvent(int layer, int new_position)
-{
-    if (_layers_modified)
-    {
-        _layers_modified->moveLayer(layer, new_position);
-    }
-
-    BaseForm::layerMovedEvent(layer, new_position);
-}
-
-void BaseFormLayer::layerRenamedEvent(int layer, QString new_name)
-{
-    if (_layers_modified)
-    {
-        _layers_modified->getLayer(layer)->setName(new_name.toStdString());
-    }
-
-    BaseForm::layerRenamedEvent(layer, new_name);
-}
-
-void BaseFormLayer::layerSelectedEvent(int layer)
-{
-    if (_layers_modified && layer >= 0)
-    {
-        layerReadCurrentFrom(_layers_modified->getLayer(layer));
-    }
-
-    BaseForm::layerSelectedEvent(layer);
-}

+ 0 - 43
src/interface/desktop/baseformlayer.h

@@ -1,43 +0,0 @@
-#ifndef _PAYSAGES_QT_BASEFORMLAYER_H_
-#define _PAYSAGES_QT_BASEFORMLAYER_H_
-
-/* Base form, with automatic layer control */
-
-#include "baseform.h"
-#include "Layers.h"
-
-class BaseFormLayer:public BaseForm
-{
-    Q_OBJECT
-
-public:
-    BaseFormLayer(QWidget* parent, Layers* layers=NULL);
-    ~BaseFormLayer();
-
-public slots:
-    virtual void revertConfig();
-    virtual void applyConfig();
-
-protected:
-    void setLayers(Layers* layers);
-    virtual void layerReadCurrentFrom(void* layer_definition) = 0;
-    virtual void layerWriteCurrentTo(void* layer_definition) = 0;
-    virtual void afterLayerAdded(void* layer_definition);
-
-private:
-    virtual QStringList getLayers();
-    virtual void layerAddedEvent();
-    virtual void layerDeletedEvent(int layer);
-    virtual void layerMovedEvent(int layer, int new_position);
-    virtual void layerRenamedEvent(int layer, QString new_name);
-    virtual void layerSelectedEvent(int layer);
-
-protected slots:
-    virtual void configChangeEvent();
-
-private:
-    Layers* _layers_original;
-    Layers* _layers_modified;
-};
-
-#endif

+ 0 - 93
src/interface/desktop/baseinput.cpp

@@ -1,93 +0,0 @@
-#include "baseinput.h"
-
-#include <QWidget>
-#include <QLabel>
-
-BaseInput::BaseInput(QWidget* form, QString label):
-    QObject(form)
-{
-    _label = new QLabel(label);
-    
-    _label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-    _label->setWordWrap(true);
-    
-    _visibility_value = NULL;
-    _enabled_value = NULL;
-    
-    _visible = true;
-    _enabled = true;
-}
-
-void BaseInput::setVisibilityCondition(int* value, int condition)
-{
-    _visibility_value = value;
-    _visibility_condition = condition;
-}
-
-void BaseInput::setEnabledCondition(int* value, int condition)
-{
-    _enabled_value = value;
-    _enabled_condition = condition;
-}
-
-void BaseInput::updatePreview()
-{
-}
-
-void BaseInput::applyValue()
-{
-    updatePreview();
-    emit(valueChanged());
-}
-
-void BaseInput::revert()
-{
-    updatePreview();
-}
-
-void BaseInput::checkVisibility(bool enabled)
-{
-    if (!_visibility_value || *_visibility_value == _visibility_condition)
-    {
-        if (not _visible)
-        {
-            _visible = true;
-            
-            _label->show();
-            _preview->show();
-            _control->show();
-        }
-    }
-    else
-    {
-        if (_visible)
-        {
-            _visible = false;
-            
-            _label->hide();
-            _preview->hide();
-            _control->hide();
-        }
-    }
-    
-    if (enabled && (!_enabled_value || *_enabled_value == _enabled_condition))
-    {
-        if (not _enabled)
-        {
-            _enabled = true;
-            
-            _preview->setEnabled(true);
-            _control->setEnabled(true);
-        }
-    }
-    else
-    {
-        if (_enabled)
-        {
-            _enabled = false;
-            
-            _preview->setEnabled(false);
-            _control->setEnabled(false);
-        }
-    }
-}

+ 0 - 49
src/interface/desktop/baseinput.h

@@ -1,49 +0,0 @@
-#ifndef _PAYSAGES_QT_BASEINPUT_H_
-#define _PAYSAGES_QT_BASEINPUT_H_
-
-#include "desktop_global.h"
-
-#include <QObject>
-class QWidget;
-class QLabel;
-
-namespace paysages {
-namespace desktop {
-
-class BaseInput:public QObject
-{
-    Q_OBJECT
-
-public:
-    BaseInput(QWidget* form, QString label);
-    inline QLabel* label() {return _label;}
-    inline QWidget* preview() {return _preview;}
-    inline QWidget* control() {return _control;}
-    void setVisibilityCondition(int* value, int condition);
-    void setEnabledCondition(int* value, int condition);
-
-public slots:
-    virtual void updatePreview();
-    virtual void revert();
-    virtual void applyValue();
-    void checkVisibility(bool enabled);
-
-signals:
-    void valueChanged();
-
-protected:
-    QLabel* _label;
-    QWidget* _preview;
-    QWidget* _control;
-    int* _visibility_value;
-    int _visibility_condition;
-    int* _enabled_value;
-    int _enabled_condition;
-    bool _visible;
-    bool _enabled;
-};
-
-}
-}
-
-#endif

+ 0 - 294
src/interface/desktop/common/freeformhelper.cpp

@@ -1,294 +0,0 @@
-#include "freeformhelper.h"
-
-#include <cmath>
-#include <QDialog>
-#include <QVariant>
-#include <QResizeEvent>
-#include <QSlider>
-#include <QPushButton>
-#include <QWidget>
-#include <QInputDialog>
-#include <QLabel>
-#include "mainwindow.h"
-#include "dialogrender.h"
-#include "dialogexplorer.h"
-#include "RenderConfig.h"
-#include "DesktopScenery.h"
-#include "BasePreview.h"
-#include "SoftwareCanvasRenderer.h"
-#include "CameraDefinition.h"
-#include "tools.h"
-
-Q_DECLARE_METATYPE(double*)
-
-FreeFormHelper::FreeFormHelper(QWidget* form_widget)
-    :QObject()
-{
-    _form_widget = form_widget;
-    _data_changed = false;
-
-    _button_apply = NULL;
-    _button_revert = NULL;
-    _button_presets = NULL;
-}
-
-FreeFormHelper::~FreeFormHelper()
-{
-}
-
-bool FreeFormHelper::eventFilter(QObject* object, QEvent* event)
-{
-    if (event->type() == QEvent::Resize && object == _form_widget)
-    {
-        QSize form_size = ((QResizeEvent*) event)->size();
-        QSize preview_size;
-
-        if (form_size.width() > 1400 && form_size.height() > 900)
-        {
-            preview_size = QSize(320, 320);
-        }
-        else if (form_size.width() < 1100 || form_size.height() < 750)
-        {
-            preview_size = QSize(200, 200);
-        }
-        else
-        {
-            preview_size = QSize(260, 260);
-        }
-
-        for (int i = 0; i < _previews.size(); i++)
-        {
-            if (_previews[i]->size() != preview_size)
-            {
-                _previews[i]->setMinimumSize(preview_size);
-                _previews[i]->setMaximumSize(preview_size);
-                _previews[i]->resize(preview_size);
-            }
-        }
-    }
-    return false;
-}
-
-void FreeFormHelper::startManaging()
-{
-    _form_widget->installEventFilter(this);
-    connect(MainWindow::instance(), SIGNAL(refreshed()), this, SLOT(processGlobalRefresh()));
-
-    connect(this, SIGNAL(needLocalRefreshing()), _form_widget, SLOT(refreshFromLocalData()));
-    connect(this, SIGNAL(needGlobalRefreshing()), _form_widget, SLOT(refreshFromFellowData()));
-    connect(this, SIGNAL(needReverting()), _form_widget, SLOT(updateLocalDataFromScenery()));
-    connect(this, SIGNAL(needCommitting()), _form_widget, SLOT(commitLocalDataToScenery()));
-    connect(this, SIGNAL(needAlterRenderer(SoftwareRenderer*)), _form_widget, SLOT(alterRenderer(SoftwareRenderer*)));
-
-    processGlobalRefresh();
-}
-
-void FreeFormHelper::addPreview(BasePreview* preview, Base2dPreviewRenderer* renderer)
-{
-    _previews.append(preview);
-    preview->setRenderer(renderer);
-}
-
-void FreeFormHelper::addDoubleInputSlider(WidgetSliderDecimal* slider, double* value, double min, double max, double small_step, double large_step)
-{
-    _inputs_decimal.append(slider);
-
-    slider->setDecimalRange(min, max, small_step, large_step);
-    slider->setDecimalValue(*value);
-
-    slider->setProperty("data_pointer", QVariant::fromValue<double*>(value));
-
-    connect(slider, SIGNAL(decimalValueChanged(double)), this, SLOT(processDecimalChange(double)));
-}
-
-void FreeFormHelper::setApplyButton(QPushButton* button)
-{
-    _button_apply = button;
-    button->setEnabled(_data_changed);
-
-    connect(button, SIGNAL(clicked()), this, SLOT(processApplyClicked()));
-}
-
-void FreeFormHelper::setRevertButton(QPushButton* button)
-{
-    _button_revert = button;
-    button->setEnabled(_data_changed);
-
-    connect(button, SIGNAL(clicked()), this, SLOT(processRevertClicked()));
-}
-
-void FreeFormHelper::setExploreButton(QPushButton* button)
-{
-    _button_explore = button;
-
-    button->setToolTip(tr("Explore the scenery in 3D, with current changes applied"));
-
-    connect(button, SIGNAL(clicked()), this, SLOT(processExploreClicked()));
-}
-
-void FreeFormHelper::setRenderButton(QPushButton* button)
-{
-    _button_render = button;
-
-    button->setToolTip(tr("Quick render preview, with current changes applied"));
-
-    connect(button, SIGNAL(clicked()), this, SLOT(processRenderClicked()));
-}
-
-void FreeFormHelper::setLabelText(QLabel* label, QString text)
-{
-    label->setText(text);
-}
-
-void FreeFormHelper::addPreset(const QString& name)
-{
-    _presets << name;
-}
-
-void FreeFormHelper::setPresetButton(QPushButton* button)
-{
-    _button_presets = button;
-    connect(button, SIGNAL(clicked()), this, SLOT(processPresetClicked()));
-}
-
-void FreeFormHelper::openDialog(QDialog* dialog)
-{
-    if (dialog->exec())
-    {
-        processDataChange();
-    }
-}
-
-void FreeFormHelper::gotoMainTab(int position)
-{
-    MainWindow::instance()->openTab(position);
-}
-
-void FreeFormHelper::processDataChange()
-{
-    _data_changed = true;
-    if (_button_apply)
-    {
-        _button_apply->setEnabled(true);
-    }
-    if (_button_revert)
-    {
-        _button_revert->setEnabled(true);
-    }
-
-    for (int i = 0; i < _previews.size(); i++)
-    {
-        _previews[i]->redraw();
-    }
-
-    emit needLocalRefreshing();
-}
-
-void FreeFormHelper::processGlobalRefresh()
-{
-    emit needGlobalRefreshing();
-
-    processRevertClicked();
-}
-
-void FreeFormHelper::processRevertClicked()
-{
-    emit needReverting();
-
-    for (int i = 0; i < _previews.size(); i++)
-    {
-        _previews[i]->redraw();
-    }
-
-    for (int i = 0; i < _inputs_decimal.size(); i++)
-    {
-        WidgetSliderDecimal* slider = _inputs_decimal.at(i);
-        double* pointer = slider->property("data_pointer").value<double*>();
-
-        if (pointer)
-        {
-            slider->setDecimalValue(*pointer);
-        }
-    }
-
-    _data_changed = false;
-    if (_button_apply)
-    {
-        _button_apply->setEnabled(false);
-    }
-    if (_button_revert)
-    {
-        _button_revert->setEnabled(false);
-    }
-
-    emit needLocalRefreshing();
-}
-
-void FreeFormHelper::processApplyClicked()
-{
-    emit needCommitting();
-
-    MainWindow::instance()->refreshAll();
-}
-
-void FreeFormHelper::processExploreClicked()
-{
-    SoftwareRenderer renderer(DesktopScenery::getCurrent());
-
-    emit needAlterRenderer(&renderer);
-
-    CameraDefinition camera;
-    DesktopScenery::getCurrent()->getCamera(&camera);
-
-    DialogExplorer* dialog = new DialogExplorer(_form_widget, &camera, false, renderer.getScenery());
-    dialog->exec();
-    delete dialog;
-}
-
-void FreeFormHelper::processRenderClicked()
-{
-    RenderConfig params(400, 300, 1, 3);
-
-    SoftwareCanvasRenderer renderer;
-    renderer.setConfig(params);
-    renderer.setScenery(DesktopScenery::getCurrent());
-
-    emit needAlterRenderer(&renderer);
-
-    DialogRender dialog(_form_widget, &renderer);
-    dialog.startRender();
-}
-
-void FreeFormHelper::processDecimalChange(double value)
-{
-    QObject* signal_sender = sender();
-
-    if (signal_sender && signal_sender->inherits("WidgetSliderDecimal"))
-    {
-        WidgetSliderDecimal* slider = (WidgetSliderDecimal*)signal_sender;
-        double* pointer = slider->property("data_pointer").value<double*>();
-
-        if (pointer)
-        {
-            *pointer = value;
-        }
-
-        processDataChange();
-    }
-}
-
-void FreeFormHelper::processPresetClicked()
-{
-    bool ok;
-    QString item = QInputDialog::getItem(_form_widget, tr("Choose a preset"), tr("Preset settings : "), _presets, 0, false, &ok);
-
-    if (ok && !item.isEmpty())
-    {
-        int preset = _presets.indexOf(item);
-        if (preset >= 0)
-        {
-            emit presetSelected(preset);
-            processDataChange();
-        }
-    }
-}

+ 0 - 81
src/interface/desktop/common/freeformhelper.h

@@ -1,81 +0,0 @@
-#ifndef FREEFORMHELPER_H
-#define FREEFORMHELPER_H
-
-#include "desktop_global.h"
-
-#include <QVector>
-#include <QStringList>
-
-#include "widgetsliderdecimal.h"
-
-class QSlider;
-class QPushButton;
-class QLabel;
-
-class FreeFormHelper:public QObject
-{
-    Q_OBJECT
-
-public:
-    FreeFormHelper(QWidget* form_widget);
-    ~FreeFormHelper();
-
-    void startManaging();
-
-    void addPreview(BasePreview* preview, Base2dPreviewRenderer* renderer);
-    void addDoubleInputSlider(WidgetSliderDecimal* slider, double* value, double min=0.0, double max=1.0, double small_step=0.0, double large_step=0.0);
-    void setApplyButton(QPushButton* button);
-    void setRevertButton(QPushButton* button);
-    void setExploreButton(QPushButton* button);
-    void setRenderButton(QPushButton* button);
-    void setLabelText(QLabel* label, QString text);
-
-    void setPresetButton(QPushButton* button);
-    void addPreset(const QString& name);
-
-    void openDialog(QDialog* dialog);
-    void gotoMainTab(int position);
-
-signals:
-    void revertClicked();
-    void applyClicked();
-
-    void presetSelected(int position);
-
-    void needLocalRefreshing();
-    void needGlobalRefreshing();
-    void needReverting();
-    void needCommitting();
-    void needAlterRenderer(SoftwareRenderer* renderer);
-
-public slots:
-    void processDataChange();
-    void processGlobalRefresh();
-    void processRevertClicked();
-    void processApplyClicked();
-    void processExploreClicked();
-    void processRenderClicked();
-    void processDecimalChange(double value);
-    void processPresetClicked();
-
-protected:
-    bool eventFilter(QObject* object, QEvent* event);
-
-private:
-    QWidget* _form_widget;
-
-    bool _data_changed;
-
-    QPushButton* _button_presets;
-    QStringList _presets;
-
-    QVector<BasePreview*> _previews;
-    QVector<WidgetSliderDecimal*> _inputs_decimal;
-
-    QPushButton* _button_apply;
-    QPushButton* _button_revert;
-    QPushButton* _button_explore;
-    QPushButton* _button_render;
-};
-
-#endif

+ 0 - 158
src/interface/desktop/common/freelayerhelper.cpp

@@ -1,158 +0,0 @@
-#include "freelayerhelper.h"
-
-#include <QTableWidget>
-#include <QPushButton>
-
-FreeLayerHelper::FreeLayerHelper(Layers* layers, bool reverse)
-{
-    _table = NULL;
-    _selected = -1;
-    _layers = layers;
-    _reverse = reverse;
-}
-
-FreeLayerHelper::~FreeLayerHelper()
-{
-}
-
-void FreeLayerHelper::refreshLayers()
-{
-    if (_table)
-    {
-        int selected = _selected;
-
-        emit tableUpdateNeeded();
-
-        int n = _layers->count();
-        if (n == 0)
-        {
-            _selected = -1;
-        }
-
-        if (selected < 0)
-        {
-            _table->clearSelection();
-            emit selectionChanged(-1);
-        }
-        else
-        {
-            if (selected >= n)
-            {
-                selected = n - 1;
-            }
-
-            _table->setCurrentCell(selected, 0);
-        }
-    }
-}
-
-void FreeLayerHelper::setLayerTable(QTableWidget* table)
-{
-    _table = table;
-
-    connect(table, SIGNAL(currentCellChanged(int, int, int, int)), this, SLOT(tableSelectionChanged(int, int)));
-
-    refreshLayers();
-}
-
-void FreeLayerHelper::setAddButton(QPushButton* button)
-{
-    connect(button, SIGNAL(clicked()), this, SLOT(addLayer()));
-}
-
-void FreeLayerHelper::setDelButton(QPushButton* button)
-{
-    connect(button, SIGNAL(clicked()), this, SLOT(deleteLayer()));
-}
-
-void FreeLayerHelper::setDownButton(QPushButton* button)
-{
-    if (_reverse)
-    {
-        connect(button, SIGNAL(clicked()), this, SLOT(moveLayerDown()));
-    }
-    else
-    {
-        connect(button, SIGNAL(clicked()), this, SLOT(moveLayerUp()));
-    }
-}
-
-void FreeLayerHelper::setUpButton(QPushButton* button)
-{
-    if (_reverse)
-    {
-        connect(button, SIGNAL(clicked()), this, SLOT(moveLayerUp()));
-    }
-    else
-    {
-        connect(button, SIGNAL(clicked()), this, SLOT(moveLayerDown()));
-    }
-}
-
-void FreeLayerHelper::setEditButton(QPushButton* button)
-{
-    connect(button, SIGNAL(clicked()), this, SLOT(startEditing()));
-}
-
-void FreeLayerHelper::addLayer()
-{
-    _selected = _layers->addLayer(NULL);
-    emit(layersChanged());
-    refreshLayers();
-}
-
-void FreeLayerHelper::deleteLayer()
-{
-    if (_selected >= 0)
-    {
-        _layers->removeLayer(_selected);
-        emit(layersChanged());
-        refreshLayers();
-    }
-}
-
-void FreeLayerHelper::moveLayerDown()
-{
-    if (_selected > 0)
-    {
-        _layers->moveLayer(_selected, _selected - 1);
-        _selected--;
-        emit(layersChanged());
-        refreshLayers();
-    }
-}
-
-void FreeLayerHelper::moveLayerUp()
-{
-    if (_selected >= 0 && _selected < _layers->count() - 1)
-    {
-        _layers->moveLayer(_selected, _selected + 1);
-        _selected++;
-        emit(layersChanged());
-        refreshLayers();
-    }
-}
-
-void FreeLayerHelper::startEditing()
-{
-    if (_selected >= 0 && _selected < _layers->count())
-    {
-        emit(editRequired(_selected));
-    }
-}
-
-void FreeLayerHelper::tableSelectionChanged(int row, int)
-{
-    int n = _layers->count();
-
-    if (n == 0 or row >= n)
-    {
-        _selected = -1;
-    }
-    else
-    {
-        _selected = _reverse ? n - 1 - row : row;
-    }
-
-    emit(selectionChanged(_selected));
-}

+ 0 - 47
src/interface/desktop/common/freelayerhelper.h

@@ -1,47 +0,0 @@
-#ifndef _EDITING_COMMON_FREELAYERHELPER_H_
-#define	_EDITING_COMMON_FREELAYERHELPER_H_
-
-#include <QObject>
-#include "Layers.h"
-
-class QTableWidget;
-class QPushButton;
-
-class FreeLayerHelper : public QObject {
-    Q_OBJECT
-
-public:
-    FreeLayerHelper(Layers* layers, bool reverse=false);
-    ~FreeLayerHelper();
-
-    void refreshLayers();
-    void setLayerTable(QTableWidget* table);
-    void setAddButton(QPushButton* button);
-    void setDelButton(QPushButton* button);
-    void setDownButton(QPushButton* button);
-    void setUpButton(QPushButton* button);
-    void setEditButton(QPushButton* button);
-
-signals:
-    void selectionChanged(int layer);
-    void layersChanged();
-    void tableUpdateNeeded();
-    void editRequired(int layer);
-
-public slots:
-    void addLayer();
-    void deleteLayer();
-    void moveLayerDown();
-    void moveLayerUp();
-    void startEditing();
-    void tableSelectionChanged(int row, int col);
-
-private:
-    QTableWidget* _table;
-    Layers* _layers;
-    int _selected;
-    bool _reverse;
-};
-
-#endif
-

+ 0 - 286
src/interface/desktop/common/mainwindow.cpp

@@ -1,286 +0,0 @@
-#include "mainwindow.h"
-#include "ui_mainwindow.h"
-
-#include <QApplication>
-#include <QMenuBar>
-#include <QMenu>
-#include <QIcon>
-#include <QFileDialog>
-#include <QFileInfo>
-#include <QTabWidget>
-#include <QTranslator>
-#include <QLocale>
-#include <QMessageBox>
-
-#include "BasePreview.h"
-#include "PreviewOsd.h"
-#include "PreviewOsdItem.h"
-#include "CameraDefinition.h"
-#include "formclouds.h"
-#include "formatmosphere.h"
-#include "formwater.h"
-#include "formrender.h"
-
-#include "terrain/mainterrainform.h"
-
-#include "dialogrender.h"
-#include "dialogexplorer.h"
-
-#include "DesktopScenery.h"
-#include "PackStream.h"
-#include "tools.h"
-
-MainWindow* MainWindow::_instance = NULL;
-
-int main(int argc, char** argv)
-{
-    MainWindow* window;
-    int result;
-
-    QApplication app(argc, argv);
-
-    QTranslator qtTranslator;
-    QTranslator myTranslator;
-
-    QString i18ndir = QString::fromStdString(DataFile::findDir("i18n"));
-    if (not i18ndir.isEmpty() and myTranslator.load("paysages_" + QLocale::system().name(), i18ndir))
-    {
-        app.installTranslator(&myTranslator);
-
-        qtTranslator.load("qt_" + QLocale::system().name());
-        app.installTranslator(&qtTranslator);
-    }
-    else
-    {
-        qtTranslator.load("qt_en");
-        app.installTranslator(&qtTranslator);
-    }
-
-    //splash->showMessage(app.tr("Preloading..."), Qt::AlignCenter, Qt::white);
-    app.processEvents();
-
-    BasePreview::initDrawers();
-
-    window = new MainWindow();
-    window->show();
-    //window->showMaximized();
-
-    result = app.exec();
-
-    BasePreview::stopDrawers();
-
-    delete window;
-
-    return result;
-}
-
-MainWindow::MainWindow() :
-    QMainWindow(),
-    ui(new Ui::MainWindow)
-{
-    _instance = this;
-    ui->setupUi(this);
-
-    BaseForm* form;
-
-    connect(ui->action_explore, SIGNAL(triggered()), this, SLOT(explore3D()));
-    connect(ui->action_quick_render, SIGNAL(triggered()), this, SLOT(quickPreview()));
-    connect(ui->action_final_render, SIGNAL(triggered()), this, SLOT(finalRender()));
-    connect(ui->action_last_render, SIGNAL(triggered()), this, SLOT(showLastRender()));
-    connect(ui->action_file_new, SIGNAL(triggered()), this, SLOT(fileNew()));
-    connect(ui->action_file_save, SIGNAL(triggered()), this, SLOT(fileSave()));
-    connect(ui->action_file_load, SIGNAL(triggered()), this, SLOT(fileLoad()));
-    connect(ui->action_about, SIGNAL(triggered()), this, SLOT(showAboutDialog()));
-
-    form = new FormWater(ui->tabs);
-    ui->tabs->addTab(form, QIcon(getDataPath("images/tab_water.png")), tr("Water"));
-    QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()), Qt::QueuedConnection);
-    _forms.append(form);
-
-    form = new FormAtmosphere(ui->tabs);
-    ui->tabs->addTab(form, QIcon(getDataPath("images/tab_atmosphere.png")), tr("Atmosphere"));
-    QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()), Qt::QueuedConnection);
-    _forms.append(form);
-
-    form = new FormClouds(ui->tabs);
-    ui->tabs->addTab(form, QIcon(getDataPath("images/tab_clouds.png")), tr("Clouds"));
-    QObject::connect(form, SIGNAL(configApplied()), this, SLOT(refreshAll()), Qt::QueuedConnection);
-    _forms.append(form);
-
-    _form_render = new FormRender(ui->tabs);
-    ui->tabs->addTab(_form_render, QIcon(getDataPath("images/tab_render.png")), tr("Render"));
-    _forms.append(_form_render);
-
-    ui->tabs->setCurrentIndex(0);
-
-    // TODO Decide this according to platform / screen size
-    ui->toolBar->hide();
-    ui->tool_panel->hide();
-    //ui->menuBar->hide();
-
-    // FIXME AutoPreset has already been called by paysagesInit but we need to redo it here because
-    //   the auto apply on FormRender overwrites the camera. Delete this when the render form is no longer a BaseForm.
-    DesktopScenery::getCurrent()->autoPreset(0);
-    refreshAll();
-}
-
-MainWindow::~MainWindow()
-{
-    delete ui;
-}
-
-bool MainWindow::event(QEvent* event)
-{
-    if (event->type() == QEvent::WindowActivate)
-    {
-        BasePreview::reviveAll();
-    }
-
-    return QMainWindow::event(event);
-}
-
-void MainWindow::refreshAll()
-{
-    logDebug("[MainWindow] Refreshing whole UI");
-
-    // Refresh all tabs
-    for (int i = 0; i < _forms.size(); i++)
-    {
-        _forms[i]->revertConfig();
-    }
-
-    // Refresh preview OSD
-    PreviewOsd* osd = PreviewOsd::getInstance(QString("geolocation"));
-    osd->clearItems();
-    PreviewOsdItem* item = osd->newItem(50, 50);
-    item->drawCamera(DesktopScenery::getCurrent()->getCamera());
-    item->setToolTip(QString(tr("Camera")));
-
-    emit refreshed();
-}
-
-void MainWindow::openTab(int position)
-{
-    ui->tabs->setCurrentIndex(position);
-}
-
-void MainWindow::fileNew()
-{
-    if (QMessageBox::question(this, tr("Paysages 3D - New scenery"), tr("Do you want to start a new scenery ? Any unsaved changes will be lost."), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
-    {
-        DesktopScenery::getCurrent()->autoPreset(0);
-        refreshAll();
-    }
-}
-
-void MainWindow::fileSave()
-{
-    QString filepath = QFileDialog::getSaveFileName(this, tr("Paysages 3D - Choose a file to save the scenery"), QString(), tr("Paysages 3D Scenery (*.p3d)"));
-    if (!filepath.isNull())
-    {
-        if (!filepath.toLower().endsWith(".p3d"))
-        {
-            filepath = filepath.append(".p3d");
-        }
-
-        Scenery::FileOperationResult result = DesktopScenery::getCurrent()->saveGlobal(filepath.toStdString());
-        switch (result)
-        {
-        case Scenery::FILE_OPERATION_OK:
-            break;
-        case Scenery::FILE_OPERATION_IOERROR:
-            QMessageBox::critical(this, tr("Paysages 3D - File saving error"), tr("Can't write specified file : %1").arg(filepath));
-            break;
-        default:
-            QMessageBox::critical(this, tr("Paysages 3D - File saving error"), tr("Unexpected error while saving file : %1").arg(filepath));
-        }
-    }
-}
-
-void MainWindow::fileLoad()
-{
-    if (QMessageBox::question(this, tr("Paysages 3D - Load scenery"), tr("Do you want to load a scenery from file ? Any unsaved changes will be lost."), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)
-    {
-        QString filepath = QFileDialog::getOpenFileName(this, tr("Paysages 3D - Choose a scenery file to load"), QString(), tr("Paysages 3D Scenery (*.p3d)"));
-        if (!filepath.isNull())
-        {
-            Scenery::FileOperationResult result = DesktopScenery::getCurrent()->loadGlobal(filepath.toStdString());
-            switch (result)
-            {
-            case Scenery::FILE_OPERATION_OK:
-                refreshAll();
-                break;
-            case Scenery::FILE_OPERATION_IOERROR:
-                QMessageBox::critical(this, tr("Paysages 3D - File loading error"), tr("Can't read specified file : %1").arg(filepath));
-                break;
-            case Scenery::FILE_OPERATION_APP_MISMATCH:
-                QMessageBox::critical(this, tr("Paysages 3D - File loading error"), tr("This file doesn't look like a Paysages 3D file : %1").arg(filepath));
-                break;
-            case Scenery::FILE_OPERATION_VERSION_MISMATCH:
-                QMessageBox::critical(this, tr("Paysages 3D - File loading error"), tr("This file was created with an incompatible Paysages 3D version : %1").arg(filepath));
-                break;
-            default:
-                QMessageBox::critical(this, tr("Paysages 3D - File loading error"), tr("Unexpected error while loading file : %1").arg(filepath));
-            }
-        }
-    }
-}
-
-void MainWindow::showAboutDialog()
-{
-    QMessageBox::about(this, tr("Paysages 3D"), tr("A 3D landscape editing and rendering software.\n\nAuthors :\nProgramming - Michael Lemaire\n\nCredits :\nQt - http://qt-project.org/\nDevIL - http://openil.sourceforge.net/\nGLib - http://www.gtk.org/\n"));
-}
-
-void MainWindow::quickPreview()
-{
-    _form_render->startQuickRender();
-}
-
-void MainWindow::finalRender()
-{
-    _form_render->startRender();
-}
-
-void MainWindow::showLastRender()
-{
-    _form_render->showRender();
-}
-
-void MainWindow::explore3D()
-{
-    CameraDefinition* camera = new CameraDefinition;
-    int result;
-
-    DesktopScenery::getCurrent()->getCamera(camera);
-
-    DialogExplorer* dialog = new DialogExplorer(this, camera, true);
-    result = dialog->exec();
-
-    delete dialog;
-
-    if (result == QDialog::Accepted)
-    {
-        DesktopScenery::getCurrent()->setCamera(camera);
-        refreshAll();
-    }
-
-    delete camera;
-}
-
-void MainWindow::guiSave(PackStream* stream)
-{
-    // Save all tabs status
-    for (int i = 0; i < _forms.size(); i++)
-    {
-        _forms[i]->savePack(stream);
-    }
-}
-
-void MainWindow::guiLoad(PackStream* stream)
-{
-    // Load all tabs status
-    for (int i = 0; i < _forms.size(); i++)
-    {
-        _forms[i]->loadPack(stream);
-    }
-}

+ 0 - 65
src/interface/desktop/common/mainwindow.h

@@ -1,65 +0,0 @@
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include "desktop_global.h"
-
-#include <QMainWindow>
-
-#include <QVector>
-class FormRender;
-
-namespace Ui {
-class MainWindow;
-}
-
-class MainWindow;
-
-class MainWindow : public QMainWindow
-{
-    Q_OBJECT
-
-public:
-    MainWindow();
-    ~MainWindow();
-
-    virtual bool event(QEvent* event);
-
-    void guiSave(PackStream* stream);
-    void guiLoad(PackStream* stream);
-
-    static inline MainWindow* instance()
-    {
-        return _instance;
-    }
-
-protected:
-
-public slots:
-    void refreshAll();
-
-    void openTab(int position);
-
-    void fileNew();
-    void fileSave();
-    void fileLoad();
-
-    void showAboutDialog();
-
-    void quickPreview();
-    void finalRender();
-    void showLastRender();
-
-    void explore3D();
-
-signals:
-    void refreshed();
-
-private:
-    static MainWindow* _instance;
-    Ui::MainWindow *ui;
-
-    QVector<BaseForm*> _forms;
-    FormRender* _form_render;
-};
-
-#endif // MAINWINDOW_H

+ 0 - 585
src/interface/desktop/common/mainwindow.ui

@@ -1,585 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>946</width>
-    <height>651</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Paysages 3D</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="../../../../data/ui_pictures.qrc">
-    <normaloff>:/logo/images/logo_32.png</normaloff>:/logo/images/logo_32.png</iconset>
-  </property>
-  <widget class="QWidget" name="centralwidget">
-   <layout class="QHBoxLayout" name="horizontalLayout">
-    <property name="leftMargin">
-     <number>0</number>
-    </property>
-    <property name="topMargin">
-     <number>0</number>
-    </property>
-    <property name="rightMargin">
-     <number>0</number>
-    </property>
-    <property name="bottomMargin">
-     <number>0</number>
-    </property>
-    <item>
-     <widget class="QWidget" name="tool_panel" native="true">
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <widget class="QLabel" name="label">
-         <property name="text">
-          <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:14pt; font-weight:600;&quot;&gt;Paysages 3D&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;img src=&quot;:/logo/images/logo_32.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-         </property>
-         <property name="textFormat">
-          <enum>Qt::RichText</enum>
-         </property>
-         <property name="alignment">
-          <set>Qt::AlignCenter</set>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_3">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_2">
-         <item>
-          <widget class="QRadioButton" name="radioButton_3">
-           <property name="text">
-            <string>Preview</string>
-           </property>
-           <property name="checked">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QRadioButton" name="radioButton_2">
-           <property name="text">
-            <string>3D</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QRadioButton" name="radioButton">
-           <property name="text">
-            <string>Top</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="QFrame" name="frame">
-         <property name="frameShape">
-          <enum>QFrame::Panel</enum>
-         </property>
-         <property name="frameShadow">
-          <enum>QFrame::Raised</enum>
-         </property>
-         <property name="lineWidth">
-          <number>3</number>
-         </property>
-         <layout class="QVBoxLayout" name="verticalLayout_2">
-          <property name="spacing">
-           <number>0</number>
-          </property>
-          <property name="sizeConstraint">
-           <enum>QLayout::SetMinimumSize</enum>
-          </property>
-          <property name="leftMargin">
-           <number>0</number>
-          </property>
-          <property name="topMargin">
-           <number>0</number>
-          </property>
-          <property name="rightMargin">
-           <number>0</number>
-          </property>
-          <property name="bottomMargin">
-           <number>0</number>
-          </property>
-          <item>
-           <widget class="QWidget" name="widget" native="true">
-            <property name="minimumSize">
-             <size>
-              <width>200</width>
-              <height>150</height>
-             </size>
-            </property>
-            <property name="maximumSize">
-             <size>
-              <width>400</width>
-              <height>300</height>
-             </size>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_4">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QGroupBox" name="groupBox_2">
-         <property name="title">
-          <string>Actions</string>
-         </property>
-         <layout class="QVBoxLayout" name="verticalLayout_3">
-          <item>
-           <widget class="QPushButton" name="button_explore">
-            <property name="text">
-             <string>Explore in 3D</string>
-            </property>
-            <property name="icon">
-             <iconset resource="../../../../data/ui_pictures.qrc">
-              <normaloff>:/buttons/logo/images/explore.png</normaloff>:/buttons/logo/images/explore.png</iconset>
-            </property>
-            <property name="shortcut">
-             <string>F2</string>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="button_render">
-            <property name="text">
-             <string>Render</string>
-            </property>
-            <property name="icon">
-             <iconset resource="../../../../data/ui_pictures.qrc">
-              <normaloff>:/buttons/logo/images/render.png</normaloff>:/buttons/logo/images/render.png</iconset>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_2">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QGroupBox" name="groupBox">
-         <property name="title">
-          <string>File</string>
-         </property>
-         <layout class="QVBoxLayout" name="verticalLayout_4">
-          <item>
-           <widget class="QPushButton" name="button_file_new">
-            <property name="text">
-             <string>New</string>
-            </property>
-            <property name="icon">
-             <iconset resource="../../../../data/ui_pictures.qrc">
-              <normaloff>:/buttons/logo/images/new.png</normaloff>:/buttons/logo/images/new.png</iconset>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="button_file_save">
-            <property name="text">
-             <string>Save</string>
-            </property>
-            <property name="icon">
-             <iconset resource="../../../../data/ui_pictures.qrc">
-              <normaloff>:/buttons/logo/images/save.png</normaloff>:/buttons/logo/images/save.png</iconset>
-            </property>
-           </widget>
-          </item>
-          <item>
-           <widget class="QPushButton" name="button_file_load">
-            <property name="text">
-             <string>Load</string>
-            </property>
-            <property name="icon">
-             <iconset resource="../../../../data/ui_pictures.qrc">
-              <normaloff>:/buttons/logo/images/load.png</normaloff>:/buttons/logo/images/load.png</iconset>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
-    </item>
-    <item>
-     <widget class="QTabWidget" name="tabs">
-      <property name="currentIndex">
-       <number>1</number>
-      </property>
-      <property name="iconSize">
-       <size>
-        <width>32</width>
-        <height>32</height>
-       </size>
-      </property>
-      <widget class="MainTerrainForm" name="tab_terrain">
-       <attribute name="icon">
-        <iconset resource="../../../../data/ui_pictures.qrc">
-         <normaloff>:/tabs/images/tab_terrain.png</normaloff>:/tabs/images/tab_terrain.png</iconset>
-       </attribute>
-       <attribute name="title">
-        <string>Lanscape shape</string>
-       </attribute>
-      </widget>
-      <widget class="MainTexturesForm" name="tab">
-       <attribute name="icon">
-        <iconset resource="../../../../data/ui_pictures.qrc">
-         <normaloff>:/tabs/images/tab_textures.png</normaloff>:/tabs/images/tab_textures.png</iconset>
-       </attribute>
-       <attribute name="title">
-        <string>Textures</string>
-       </attribute>
-      </widget>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QToolBar" name="toolBar">
-   <property name="windowTitle">
-    <string>toolBar</string>
-   </property>
-   <property name="movable">
-    <bool>false</bool>
-   </property>
-   <property name="allowedAreas">
-    <set>Qt::LeftToolBarArea</set>
-   </property>
-   <property name="iconSize">
-    <size>
-     <width>32</width>
-     <height>32</height>
-    </size>
-   </property>
-   <property name="toolButtonStyle">
-    <enum>Qt::ToolButtonTextUnderIcon</enum>
-   </property>
-   <property name="floatable">
-    <bool>false</bool>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>LeftToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="action_file_new"/>
-   <addaction name="action_file_save"/>
-   <addaction name="action_file_load"/>
-   <addaction name="separator"/>
-   <addaction name="action_explore"/>
-   <addaction name="action_quick_render"/>
-   <addaction name="action_final_render"/>
-   <addaction name="separator"/>
-   <addaction name="action_about"/>
-  </widget>
-  <widget class="QMenuBar" name="menuBar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>946</width>
-     <height>20</height>
-    </rect>
-   </property>
-   <widget class="QMenu" name="menuFile">
-    <property name="title">
-     <string>File</string>
-    </property>
-    <addaction name="action_file_new"/>
-    <addaction name="action_file_save"/>
-    <addaction name="action_file_load"/>
-   </widget>
-   <widget class="QMenu" name="menuActions">
-    <property name="title">
-     <string>Actions</string>
-    </property>
-    <addaction name="action_explore"/>
-    <addaction name="action_quick_render"/>
-    <addaction name="action_final_render"/>
-    <addaction name="action_last_render"/>
-   </widget>
-   <widget class="QMenu" name="menuHelp">
-    <property name="title">
-     <string>Help</string>
-    </property>
-    <addaction name="action_about"/>
-   </widget>
-   <addaction name="menuFile"/>
-   <addaction name="menuActions"/>
-   <addaction name="menuHelp"/>
-  </widget>
-  <action name="action_explore">
-   <property name="icon">
-    <iconset resource="../../../../data/ui_pictures.qrc">
-     <normaloff>:/buttons/logo/images/explore.png</normaloff>:/buttons/logo/images/explore.png</iconset>
-   </property>
-   <property name="text">
-    <string>Explore in 3D</string>
-   </property>
-   <property name="toolTip">
-    <string>Start exploring your scenery in real-time 3D</string>
-   </property>
-   <property name="shortcut">
-    <string>F2</string>
-   </property>
-  </action>
-  <action name="action_file_new">
-   <property name="icon">
-    <iconset resource="../../../../data/ui_pictures.qrc">
-     <normaloff>:/buttons/logo/images/new.png</normaloff>:/buttons/logo/images/new.png</iconset>
-   </property>
-   <property name="text">
-    <string>New scene</string>
-   </property>
-   <property name="toolTip">
-    <string>Create a virgin scene</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+N</string>
-   </property>
-  </action>
-  <action name="action_file_load">
-   <property name="icon">
-    <iconset resource="../../../../data/ui_pictures.qrc">
-     <normaloff>:/buttons/logo/images/load.png</normaloff>:/buttons/logo/images/load.png</iconset>
-   </property>
-   <property name="text">
-    <string>Load scene</string>
-   </property>
-   <property name="toolTip">
-    <string>Load a scenery from a file</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+O</string>
-   </property>
-  </action>
-  <action name="action_file_save">
-   <property name="icon">
-    <iconset resource="../../../../data/ui_pictures.qrc">
-     <normaloff>:/buttons/logo/images/save.png</normaloff>:/buttons/logo/images/save.png</iconset>
-   </property>
-   <property name="text">
-    <string>Save scene</string>
-   </property>
-   <property name="toolTip">
-    <string>Save a scenery to a file</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+S</string>
-   </property>
-  </action>
-  <action name="action_quick_render">
-   <property name="icon">
-    <iconset resource="../../../../data/ui_pictures.qrc">
-     <normaloff>:/buttons/logo/images/render.png</normaloff>:/buttons/logo/images/render.png</iconset>
-   </property>
-   <property name="text">
-    <string>Quick render</string>
-   </property>
-   <property name="toolTip">
-    <string>Start a quick render</string>
-   </property>
-   <property name="shortcut">
-    <string>F5</string>
-   </property>
-  </action>
-  <action name="action_final_render">
-   <property name="icon">
-    <iconset resource="../../../../data/ui_pictures.qrc">
-     <normaloff>:/buttons/logo/images/render.png</normaloff>:/buttons/logo/images/render.png</iconset>
-   </property>
-   <property name="text">
-    <string>Final render</string>
-   </property>
-   <property name="toolTip">
-    <string>Start the final rendering processs</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+F5</string>
-   </property>
-  </action>
-  <action name="action_about">
-   <property name="icon">
-    <iconset resource="../../../../data/ui_pictures.qrc">
-     <normaloff>:/buttons/logo/images/about.png</normaloff>:/buttons/logo/images/about.png</iconset>
-   </property>
-   <property name="text">
-    <string>About</string>
-   </property>
-   <property name="toolTip">
-    <string>Display information on this software</string>
-   </property>
-   <property name="shortcut">
-    <string>F1</string>
-   </property>
-  </action>
-  <action name="action_last_render">
-   <property name="icon">
-    <iconset resource="../../../../data/ui_pictures.qrc">
-     <normaloff>:/buttons/logo/images/render.png</normaloff>:/buttons/logo/images/render.png</iconset>
-   </property>
-   <property name="text">
-    <string>Show last render</string>
-   </property>
-   <property name="toolTip">
-    <string>Display the last render done</string>
-   </property>
-   <property name="shortcut">
-    <string>F6</string>
-   </property>
-  </action>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>MainTerrainForm</class>
-   <extends>QWidget</extends>
-   <header>terrain/mainterrainform.h</header>
-   <container>1</container>
-  </customwidget>
-  <customwidget>
-   <class>MainTexturesForm</class>
-   <extends>QWidget</extends>
-   <header>textures/maintexturesform.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources>
-  <include location="../../../../data/ui_pictures.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>button_explore</sender>
-   <signal>clicked()</signal>
-   <receiver>action_explore</receiver>
-   <slot>trigger()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>127</x>
-     <y>380</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>-1</x>
-     <y>-1</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>button_render</sender>
-   <signal>clicked()</signal>
-   <receiver>action_final_render</receiver>
-   <slot>trigger()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>213</x>
-     <y>425</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>-1</x>
-     <y>-1</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>button_file_new</sender>
-   <signal>clicked()</signal>
-   <receiver>action_file_new</receiver>
-   <slot>trigger()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>213</x>
-     <y>522</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>-1</x>
-     <y>-1</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>button_file_load</sender>
-   <signal>clicked()</signal>
-   <receiver>action_file_load</receiver>
-   <slot>trigger()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>213</x>
-     <y>588</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>-1</x>
-     <y>-1</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>button_file_save</sender>
-   <signal>clicked()</signal>
-   <receiver>action_file_save</receiver>
-   <slot>trigger()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>213</x>
-     <y>555</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>-1</x>
-     <y>-1</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>

+ 0 - 18
src/interface/desktop/common/widgetglobalformbuttons.cpp

@@ -1,18 +0,0 @@
-#include "widgetglobalformbuttons.h"
-#include "ui_widgetglobalformbuttons.h"
-
-WidgetGlobalFormButtons::WidgetGlobalFormButtons(QWidget *parent) :
-    QWidget(parent),
-    ui(new Ui::WidgetGlobalFormButtons)
-{
-    ui->setupUi(this);
-
-    connect(ui->button_ok, SIGNAL(clicked()), this, SIGNAL(okClicked()));
-    connect(ui->button_cancel, SIGNAL(clicked()), this, SIGNAL(cancelClicked()));
-    connect(ui->button_revert, SIGNAL(clicked()), this, SIGNAL(revertClicked()));
-}
-
-WidgetGlobalFormButtons::~WidgetGlobalFormButtons()
-{
-    delete ui;
-}

+ 0 - 27
src/interface/desktop/common/widgetglobalformbuttons.h

@@ -1,27 +0,0 @@
-#ifndef WIDGETGLOBALFORMBUTTONS_H
-#define WIDGETGLOBALFORMBUTTONS_H
-
-#include <QWidget>
-
-namespace Ui {
-class WidgetGlobalFormButtons;
-}
-
-class WidgetGlobalFormButtons : public QWidget
-{
-    Q_OBJECT
-    
-public:
-    explicit WidgetGlobalFormButtons(QWidget *parent = 0);
-    ~WidgetGlobalFormButtons();
-
-signals:
-    void okClicked();
-    void revertClicked();
-    void cancelClicked();
-    
-private:
-    Ui::WidgetGlobalFormButtons *ui;
-};
-
-#endif // WIDGETGLOBALFORMBUTTONS_H

+ 0 - 85
src/interface/desktop/common/widgetglobalformbuttons.ui

@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>WidgetGlobalFormButtons</class>
- <widget class="QWidget" name="WidgetGlobalFormButtons">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>560</width>
-    <height>43</height>
-   </rect>
-  </property>
-  <property name="maximumSize">
-   <size>
-    <width>16777215</width>
-    <height>50</height>
-   </size>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QHBoxLayout" name="horizontalLayout_2">
-   <item>
-    <widget class="QPushButton" name="button_cancel">
-     <property name="minimumSize">
-      <size>
-       <width>0</width>
-       <height>25</height>
-      </size>
-     </property>
-     <property name="text">