Changed: #1206 Update example plugin.
This commit is contained in:
parent
b97a78ce0b
commit
46aa4700fe
3 changed files with 214 additions and 0 deletions
|
@ -0,0 +1,67 @@
|
||||||
|
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||||
|
// Copyright (C) 2010 Winch Gate Property Limited
|
||||||
|
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#include "example_settings_page.h"
|
||||||
|
|
||||||
|
// Qt includes
|
||||||
|
#include <QtGui/QWidget>
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
|
||||||
|
namespace Plugin
|
||||||
|
{
|
||||||
|
|
||||||
|
CExampleSettingsPage::CExampleSettingsPage(QObject *parent)
|
||||||
|
: IOptionsPage(parent),
|
||||||
|
_currentPage(NULL)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CExampleSettingsPage::id() const
|
||||||
|
{
|
||||||
|
return QLatin1String("ExamplePage");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CExampleSettingsPage::trName() const
|
||||||
|
{
|
||||||
|
return tr("Example page");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CExampleSettingsPage::category() const
|
||||||
|
{
|
||||||
|
return QLatin1String("General");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString CExampleSettingsPage::trCategory() const
|
||||||
|
{
|
||||||
|
return tr("General");
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget *CExampleSettingsPage::createPage(QWidget *parent)
|
||||||
|
{
|
||||||
|
_currentPage = new QWidget(parent);
|
||||||
|
_ui.setupUi(_currentPage);
|
||||||
|
return _currentPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CExampleSettingsPage::apply()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
} /* namespace Plugin */
|
|
@ -0,0 +1,58 @@
|
||||||
|
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||||
|
// Copyright (C) 2010 Winch Gate Property Limited
|
||||||
|
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||||
|
//
|
||||||
|
// 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef EXAMPLE_SETTINGS_PAGE_H
|
||||||
|
#define EXAMPLE_SETTINGS_PAGE_H
|
||||||
|
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
|
#include "../core/ioptions_page.h"
|
||||||
|
|
||||||
|
#include "ui_example_settings_page.h"
|
||||||
|
|
||||||
|
class QWidget;
|
||||||
|
|
||||||
|
namespace Plugin
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
@class CExampleSettingsPage
|
||||||
|
*/
|
||||||
|
class CExampleSettingsPage : public Core::IOptionsPage
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
CExampleSettingsPage(QObject *parent = 0);
|
||||||
|
virtual ~CExampleSettingsPage() {}
|
||||||
|
|
||||||
|
virtual QString id() const;
|
||||||
|
virtual QString trName() const;
|
||||||
|
virtual QString category() const;
|
||||||
|
virtual QString trCategory() const;
|
||||||
|
virtual QWidget *createPage(QWidget *parent);
|
||||||
|
|
||||||
|
virtual void apply();
|
||||||
|
virtual void finish() {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
QWidget *_currentPage;
|
||||||
|
Ui::CExampleSettingsPage _ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Plugin
|
||||||
|
|
||||||
|
#endif // EXAMPLE_SETTINGS_H
|
|
@ -0,0 +1,89 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>CExampleSettingsPage</class>
|
||||||
|
<widget class="QWidget" name="CExampleSettingsPage">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>458</width>
|
||||||
|
<height>479</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0" colspan="2">
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>GroupBox</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>PushButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1" rowspan="5">
|
||||||
|
<widget class="QListView" name="listView"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QPushButton" name="pushButton_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>PushButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>RadioButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QRadioButton" name="radioButton_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>RadioButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QCheckBox" name="checkBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>CheckBox</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<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 row="1" column="0">
|
||||||
|
<widget class="QComboBox" name="comboBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QSpinBox" name="spinBox"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="../../object_viewer_qt.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Reference in a new issue