Added facilities for viewing the loaded actions.
--HG-- branch : gsoc2014-dfighterhg/feature/cdb-packed
parent
0d9022226c
commit
085c1b41b9
@ -0,0 +1,31 @@
|
||||
#include "action_list.h"
|
||||
#include "nel/gui/action_handler.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
ActionList::ActionList( QDialog *parent ) :
|
||||
QDialog( parent )
|
||||
{
|
||||
setupUi( this );
|
||||
}
|
||||
|
||||
ActionList::~ActionList()
|
||||
{
|
||||
}
|
||||
|
||||
void ActionList::load()
|
||||
{
|
||||
actionList->clear();
|
||||
|
||||
NLGUI::CAHManager *am = NLGUI::CAHManager::getInstance();
|
||||
std::vector< std::string > handlers;
|
||||
am->getActionHandlers( handlers );
|
||||
|
||||
std::vector< std::string >::const_iterator itr = handlers.begin();
|
||||
while( itr != handlers.end() )
|
||||
{
|
||||
actionList->addItem( itr->c_str() );
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
#ifndef ACTION_LIST_H
|
||||
#define ACTION_LIST_H
|
||||
|
||||
|
||||
#include "ui_action_list.h"
|
||||
|
||||
|
||||
class ActionList : public QDialog, public Ui::ActionListDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ActionList( QDialog *parent = NULL );
|
||||
~ActionList();
|
||||
void load();
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ActionListDialog</class>
|
||||
<widget class="QDialog" name="ActionListDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>359</width>
|
||||
<height>258</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Action List</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QListWidget" name="actionList"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>131</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="okButton">
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="cancelButton">
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>okButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>ActionListDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>278</x>
|
||||
<y>253</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>96</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>cancelButton</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>ActionListDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>369</x>
|
||||
<y>253</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>179</x>
|
||||
<y>282</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
Loading…
Reference in New Issue