Changed: Added some more UI tweaks - most of the UI design is now done.

This commit is contained in:
sfb 2011-06-01 18:41:01 -05:00
parent 7e4c83206a
commit 09ce0e8161
13 changed files with 222 additions and 54 deletions

View file

@ -14,21 +14,21 @@ SET(OVQT_PLUG_MISSION_COMPILER_HDR mission_compiler_plugin.h
SET(OVQT_PLUG_MISSION_COMPILER_UIS mission_compiler_main_window.ui)
#SET(OVQT_PLUG_ZONE_PAINTER_RCS zone_painter.qrc)
SET(OVQT_PLUG_MISSION_COMPILER_RCS mission_compiler.qrc)
SET(QT_USE_QTGUI TRUE)
QT4_WRAP_CPP(OVQT_PLUG_MISSION_COMPILER_MOC_SRC ${OVQT_PLUG_MISSION_COMPILER_HDR})
#QT4_ADD_RESOURCES( OVQT_PLUG_ZONE_PAINTER_RC_SRCS ${OVQT_PLUG_ZONE_PAINTER_RCS})
QT4_ADD_RESOURCES( OVQT_PLUG_MISSION_COMPILER_RC_SRCS ${OVQT_PLUG_MISSION_COMPILER_RCS})
QT4_WRAP_UI(OVQT_PLUG_MISSION_COMPILER_UI_HDRS ${OVQT_PLUG_MISSION_COMPILER_UIS})
SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_MISSION_COMPILER_UIS})
SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_MISSION_COMPILER_UIS} ${OVQT_PLUG_MISSION_COMPILER_RCS})
SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS})
SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} )
SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_PLUG_MISSION_COMPILER_RC_SRCS})
SOURCE_GROUP("Mission Compiler Plugin" FILES ${SRC})
SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC})
ADD_LIBRARY(ovqt_plugin_mission_compiler MODULE ${SRC} ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS})
ADD_LIBRARY(ovqt_plugin_mission_compiler MODULE ${SRC} ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_PLUG_MISSION_COMPILER_RC_SRCS} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS})
TARGET_LINK_LIBRARIES(ovqt_plugin_mission_compiler ovqt_plugin_core nelmisc nelligo ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY})

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -0,0 +1,11 @@
<RCC>
<qresource prefix="buttons">
<file>images/arrow-left-2.png</file>
<file>images/arrow-left-double-2.png</file>
<file>images/arrow-right-2.png</file>
<file>images/arrow-right-double-2.png</file>
<file>images/document-export-4.png</file>
<file>images/news-subscribe-2.png</file>
<file>images/run-build-2.png</file>
</qresource>
</RCC>

View file

@ -25,6 +25,7 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) :
m_undoStack = new QUndoStack(this);
// Populate the "all" primitives box.
QStringList list;
std::vector<std::string> paths;
NLMISC::CPath::getFileList("primitive", paths);
@ -32,9 +33,31 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) :
while( itr != paths.end() )
{
const char *path2 = (*itr).c_str();
ui->allPrimitivesList->insertItem(0,path2);
list << path2;
++itr;
}
m_regexpFilter = new QRegExp();
m_regexpFilter->setPatternSyntax(QRegExp::FixedString);
m_regexpFilter->setCaseSensitivity(Qt::CaseInsensitive);
m_allPrimitivesModel = new QStringListModel(list, this);
m_filteredProxyModel = new QSortFilterProxyModel(this);
m_filteredProxyModel->setSourceModel(m_allPrimitivesModel);
m_filteredProxyModel->setDynamicSortFilter(true);
m_filteredProxyModel->setFilterRegExp(*m_regexpFilter);
ui->allPrimitivesList->setModel(m_filteredProxyModel);
m_selectedPrimitivesModel = new QStringListModel(this);
ui->selectedPrimitivesList->setModel(m_selectedPrimitivesModel);
connect(ui->filterEdit, SIGNAL(textEdited(const QString&)), this, SLOT(handleFilterChanged(const QString&)));
}
void MissionCompilerMainWindow::handleFilterChanged(const QString &text)
{
m_regexpFilter->setPattern(text);
m_filteredProxyModel->setFilterRegExp(*m_regexpFilter);
}
void MissionCompilerMainWindow::loadConfig() {

View file

@ -7,6 +7,8 @@
#include <QAction>
#include <QtGui/QUndoStack>
#include <QStringListModel>
#include <QSortFilterProxyModel>
#include <QRegExp>
namespace Ui {
class MissionCompilerMainWindow;
@ -24,6 +26,8 @@ public:
void saveConfig();
QUndoStack *getUndoStack() { return m_undoStack; }
public Q_SLOTS:
void handleFilterChanged(const QString &text);
private:
Ui::MissionCompilerMainWindow *ui;
@ -31,6 +35,9 @@ private:
QMenu *_toolModeMenu;
QUndoStack *m_undoStack;
QStringListModel *m_allPrimitivesModel;
QStringListModel *m_selectedPrimitivesModel;
QSortFilterProxyModel *m_filteredProxyModel;
QRegExp *m_regexpFilter;
};
#endif // MISSION_COMPILER_MAIN_WINDOW_H

View file

@ -15,7 +15,7 @@
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<item row="0" column="0">
<widget class="QToolBox" name="toolBox">
<property name="currentIndex">
<number>0</number>
@ -26,17 +26,14 @@
<x>0</x>
<y>0</y>
<width>776</width>
<height>398</height>
<height>426</height>
</rect>
</property>
<attribute name="label">
<string>Mission Compiler Options</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QListWidget" name="allPrimitivesList"/>
</item>
<item row="0" column="2">
<item row="3" column="4">
<layout class="QVBoxLayout" name="addRemoveLayout">
<item>
<spacer name="verticalSpacer_3">
@ -53,15 +50,29 @@
</item>
<item>
<widget class="QPushButton" name="addSelectedButton">
<property name="toolTip">
<string>Add Selected</string>
</property>
<property name="text">
<string>&gt;&gt;</string>
<string/>
</property>
<property name="icon">
<iconset resource="mission_compiler.qrc">
<normaloff>:/buttons/images/arrow-right-2.png</normaloff>:/buttons/images/arrow-right-2.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="addAllButton">
<property name="toolTip">
<string>Add All</string>
</property>
<property name="text">
<string>ALL &gt;&gt;</string>
<string/>
</property>
<property name="icon">
<iconset resource="mission_compiler.qrc">
<normaloff>:/buttons/images/arrow-right-double-2.png</normaloff>:/buttons/images/arrow-right-double-2.png</iconset>
</property>
</widget>
</item>
@ -80,15 +91,29 @@
</item>
<item>
<widget class="QPushButton" name="removeAllButton">
<property name="toolTip">
<string>Remove All</string>
</property>
<property name="text">
<string>&lt;&lt; ALL</string>
<string/>
</property>
<property name="icon">
<iconset resource="mission_compiler.qrc">
<normaloff>:/buttons/images/arrow-left-double-2.png</normaloff>:/buttons/images/arrow-left-double-2.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeSelectedButton">
<property name="toolTip">
<string>Remove Selected</string>
</property>
<property name="text">
<string>&lt;&lt;</string>
<string/>
</property>
<property name="icon">
<iconset resource="mission_compiler.qrc">
<normaloff>:/buttons/images/arrow-left-2.png</normaloff>:/buttons/images/arrow-left-2.png</iconset>
</property>
</widget>
</item>
@ -107,8 +132,87 @@
</item>
</layout>
</item>
<item row="3" column="3">
<widget class="QListView" name="allPrimitivesList">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
<property name="defaultDropAction">
<enum>Qt::MoveAction</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
<item row="3" column="5">
<widget class="QListView" name="selectedPrimitivesList">
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
<property name="defaultDropAction">
<enum>Qt::MoveAction</enum>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QListWidget" name="selectedPrimitivesList"/>
<widget class="QLabel" name="allPrimitivesLabel">
<property name="text">
<string>All Primitives</string>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QLabel" name="selectedPrimitivesLabel">
<property name="text">
<string>Selected Primitives</string>
</property>
</widget>
</item>
<item row="1" column="3">
<layout class="QHBoxLayout" name="filterLayout">
<item>
<widget class="QLabel" name="filterLabel">
<property name="text">
<string>Filter</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="filterEdit">
<property name="placeholderText">
<string>type filter here</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
@ -128,7 +232,7 @@
<x>0</x>
<y>0</y>
<width>776</width>
<height>398</height>
<height>426</height>
</rect>
</property>
<attribute name="label">
@ -146,36 +250,6 @@
</widget>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="actionsGroupBox">
<property name="title">
<string>Actions</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="validateButton">
<property name="text">
<string>Validate</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="compileButton">
<property name="text">
<string>Compile</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="compilePublishButton">
<property name="text">
<string>Compile and Publish</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
@ -189,7 +263,59 @@
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="actionValidate"/>
<addaction name="actionCompile"/>
<addaction name="actionPublish"/>
</widget>
<action name="actionCompile">
<property name="icon">
<iconset resource="mission_compiler.qrc">
<normaloff>:/buttons/images/run-build-2.png</normaloff>:/buttons/images/run-build-2.png</iconset>
</property>
<property name="text">
<string>Compile</string>
</property>
<property name="toolTip">
<string>Compile</string>
</property>
</action>
<action name="actionValidate">
<property name="icon">
<iconset resource="mission_compiler.qrc">
<normaloff>:/buttons/images/news-subscribe-2.png</normaloff>:/buttons/images/news-subscribe-2.png</iconset>
</property>
<property name="text">
<string>Validate</string>
</property>
<property name="toolTip">
<string>Validate</string>
</property>
</action>
<action name="actionPublish">
<property name="icon">
<iconset resource="mission_compiler.qrc">
<normaloff>:/buttons/images/document-export-4.png</normaloff>:/buttons/images/document-export-4.png</iconset>
</property>
<property name="text">
<string>Publish</string>
</property>
<property name="toolTip">
<string>Compile and Publish</string>
</property>
</action>
</widget>
<resources/>
<resources>
<include location="mission_compiler.qrc"/>
</resources>
<connections/>
</ui>

View file

@ -6,7 +6,8 @@
#include "../../extension_system/iplugin_spec.h"
// NeL includes
#include "nel/misc/debug.h"
#include <nel/misc/debug.h>
#include <nel/misc/path.h>
// Qt includes
#include <QtCore/QObject>
@ -58,12 +59,12 @@ void MissionCompilerPlugin::extensionsInitialized()
//zoneMenu->addAction(exampleAction2);
// Initialize Ligo.
settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
QString ligoConfigFile = settings->value(Core::Constants::DATA_PATH_SECTION).toString();
settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
//settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
//QString ligoConfigFile = settings->value(Core::Constants::DATA_PATH_SECTION).toString();
//settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
NLLIGO::Register();
LigoConfig.readPrimitiveClass(ligoConfigFile.toAscii().data(), false);
LigoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false);
NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig;
}