Add "switch to textures" button on terrain page

This commit is contained in:
Michaël Lemaire 2013-06-20 22:21:09 +02:00
parent 62a956a65f
commit 2021817082
5 changed files with 24 additions and 5 deletions

View file

@ -1,12 +1,13 @@
#include "freeformhelper.h"
#include <cmath>
#include <QDialog>
#include <QVariant>
#include <QResizeEvent>
#include <QSlider>
#include <QPushButton>
#include <cmath>
#include <qt4/QtGui/qwidget.h>
#include <QWidget>
#include "mainwindow.h"
#include "dialogrender.h"
#include "dialogexplorer.h"
#include "rendering/scenery.h"
@ -194,6 +195,15 @@ void FreeFormHelper::openDialog(QDialog* dialog)
}
}
void FreeFormHelper::gotoMainTab(int position)
{
QWidget* window = _form_widget->window();
if (window->inherits("MainWindow"))
{
((MainWindow*)window)->openTab(position);
}
}
void FreeFormHelper::processDataChange()
{
_data_changed = true;

View file

@ -39,6 +39,7 @@ public:
void setLabelText(QString widget_name, QString text);
void openDialog(QDialog* dialog);
void gotoMainTab(int position);
signals:
void revertClicked();
@ -75,4 +76,4 @@ private:
QPushButton* _button_render;
};
#endif // FREEFORMHELPER_H
#endif

View file

@ -168,6 +168,11 @@ void MainWindow::refreshAll()
cameraDeleteDefinition(camera);
}
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)

View file

@ -15,7 +15,7 @@ class MainWindow;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
@ -28,6 +28,8 @@ public:
public slots:
void refreshAll();
void openTab(int position);
void fileNew();
void fileSave();
void fileLoad();

View file

@ -127,5 +127,6 @@ void MainTerrainForm::buttonPaintingPressed()
void MainTerrainForm::buttonTexturesPressed()
{
// TODO Switch to textures tab
// Switch to textures tab
_form_helper->gotoMainTab(1);
}