diff --git a/code/nel/include/nel/gui/widget_addition_watcher.h b/code/nel/include/nel/gui/widget_addition_watcher.h index f4371ed5b..a2717e398 100644 --- a/code/nel/include/nel/gui/widget_addition_watcher.h +++ b/code/nel/include/nel/gui/widget_addition_watcher.h @@ -1,32 +1,32 @@ -// Ryzom - MMORPG Framework -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -#ifndef WIDGET_ADD_WATCHER -#define WIDGET_ADD_WATCHER - -#include - -namespace NLGUI -{ - class IWidgetAdditionWatcher - { - public: - virtual void widgetAdded( const std::string &name ) = 0; - }; -} - -#endif - +// Ryzom - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef WIDGET_ADD_WATCHER +#define WIDGET_ADD_WATCHER + +#include + +namespace NLGUI +{ + class IWidgetAdditionWatcher + { + public: + virtual void widgetAdded( const std::string &name ) = 0; + }; +} + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.cpp index 3f32586b6..98604bcb1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.cpp @@ -1,77 +1,77 @@ -#include "add_widget_widget.h" -#include "widget_info_tree.h" -#include -#include -#include - -namespace GUIEditor -{ - - AddWidgetWidget::AddWidgetWidget( QWidget *parent ) : - QWidget( parent ) - { - setupUi( this ); - setupConnections(); - } - - AddWidgetWidget::~AddWidgetWidget() - { - } - - void AddWidgetWidget::setCurrentGroup( const QString &g ) - { - groupEdit->setText( g ); - } - - void AddWidgetWidget::setupWidgetInfo( const CWidgetInfoTree *tree ) - { - std::vector< std::string > names; - tree->getNames( names, false ); - - widgetCB->clear(); - - std::sort( names.begin(), names.end() ); - - std::vector< std::string >::const_iterator itr = names.begin(); - while( itr != names.end() ) - { - widgetCB->addItem( QString( itr->c_str() ) ); - ++itr; - } - - } - - void AddWidgetWidget::setupConnections() - { - connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( close() ) ); - connect( addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); - } - - void AddWidgetWidget::onAddClicked() - { - if( groupEdit->text().isEmpty() ) - { - QMessageBox::warning( NULL, - tr( "WARNING" ), - tr( "You need to be adding the new widget into a group!" ), - QMessageBox::Ok ); - - return; - } - - if( nameEdit->text().isEmpty() ) - { - QMessageBox::warning( NULL, - tr( "WARNING" ), - tr( "You need to specify a name for your new widget!" ), - QMessageBox::Ok ); - - return; - } - - close(); - - Q_EMIT adding( groupEdit->text(), widgetCB->currentText(), nameEdit->text() ); - } -} - +#include "add_widget_widget.h" +#include "widget_info_tree.h" +#include +#include +#include + +namespace GUIEditor +{ + + AddWidgetWidget::AddWidgetWidget( QWidget *parent ) : + QWidget( parent ) + { + setupUi( this ); + setupConnections(); + } + + AddWidgetWidget::~AddWidgetWidget() + { + } + + void AddWidgetWidget::setCurrentGroup( const QString &g ) + { + groupEdit->setText( g ); + } + + void AddWidgetWidget::setupWidgetInfo( const CWidgetInfoTree *tree ) + { + std::vector< std::string > names; + tree->getNames( names, false ); + + widgetCB->clear(); + + std::sort( names.begin(), names.end() ); + + std::vector< std::string >::const_iterator itr = names.begin(); + while( itr != names.end() ) + { + widgetCB->addItem( QString( itr->c_str() ) ); + ++itr; + } + + } + + void AddWidgetWidget::setupConnections() + { + connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( close() ) ); + connect( addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) ); + } + + void AddWidgetWidget::onAddClicked() + { + if( groupEdit->text().isEmpty() ) + { + QMessageBox::warning( NULL, + tr( "WARNING" ), + tr( "You need to be adding the new widget into a group!" ), + QMessageBox::Ok ); + + return; + } + + if( nameEdit->text().isEmpty() ) + { + QMessageBox::warning( NULL, + tr( "WARNING" ), + tr( "You need to specify a name for your new widget!" ), + QMessageBox::Ok ); + + return; + } + + close(); + + Q_EMIT adding( groupEdit->text(), widgetCB->currentText(), nameEdit->text() ); + } +} + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.h index 8f9f6a0be..0bf807f3b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/add_widget_widget.h @@ -1,32 +1,32 @@ -#ifndef ADD_WIDGET_WIDGET_H -#define ADD_WIDGET_WIDGET_H - -#include "ui_add_widget_widget.h" - -namespace GUIEditor -{ - class CWidgetInfoTree; - - class AddWidgetWidget : public QWidget, public Ui::AddWidgetWidget - { - Q_OBJECT - public: - AddWidgetWidget( QWidget *parent = NULL ); - ~AddWidgetWidget(); - - void setCurrentGroup( const QString &g ); - void setupWidgetInfo( const CWidgetInfoTree *tree ); - - private: - void setupConnections(); - - private Q_SLOTS: - void onAddClicked(); - - Q_SIGNALS: - void adding( const QString &parentGroup, const QString &widgetType, const QString &name ); - }; - -} - -#endif +#ifndef ADD_WIDGET_WIDGET_H +#define ADD_WIDGET_WIDGET_H + +#include "ui_add_widget_widget.h" + +namespace GUIEditor +{ + class CWidgetInfoTree; + + class AddWidgetWidget : public QWidget, public Ui::AddWidgetWidget + { + Q_OBJECT + public: + AddWidgetWidget( QWidget *parent = NULL ); + ~AddWidgetWidget(); + + void setCurrentGroup( const QString &g ); + void setupWidgetInfo( const CWidgetInfoTree *tree ); + + private: + void setupConnections(); + + private Q_SLOTS: + void onAddClicked(); + + Q_SIGNALS: + void adding( const QString &parentGroup, const QString &widgetType, const QString &name ); + }; + +} + +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.h index ffeedd7f1..5c19a03c2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/editor_message_processor.h @@ -1,46 +1,46 @@ -// Object Viewer Qt GUI Editor plugin -// Copyright (C) 2010 Winch Gate Property Limited -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -#include - -namespace GUIEditor -{ - class CWidgetInfoTree; - - /// Processes the GUI Editor's editor messages like delete, new, etc... - class CEditorMessageProcessor : public QObject - { - Q_OBJECT - public: - CEditorMessageProcessor( QObject *parent = NULL ) : - QObject( parent ) - { - tree = NULL; - } - - ~CEditorMessageProcessor(){} - - void setTree( CWidgetInfoTree *tree ){ this->tree = tree; } - - public Q_SLOTS: - void onDelete(); - void onAdd( const QString &parentGroup, const QString &widgetType, const QString &name ); - - private: - CWidgetInfoTree *tree; - }; -} - +// Object Viewer Qt GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include + +namespace GUIEditor +{ + class CWidgetInfoTree; + + /// Processes the GUI Editor's editor messages like delete, new, etc... + class CEditorMessageProcessor : public QObject + { + Q_OBJECT + public: + CEditorMessageProcessor( QObject *parent = NULL ) : + QObject( parent ) + { + tree = NULL; + } + + ~CEditorMessageProcessor(){} + + void setTree( CWidgetInfoTree *tree ){ this->tree = tree; } + + public Q_SLOTS: + void onDelete(); + void onAdd( const QString &parentGroup, const QString &widgetType, const QString &name ); + + private: + CWidgetInfoTree *tree; + }; +} +