|
|
@ -18,20 +18,49 @@
|
|
|
|
#include "link_editor.h"
|
|
|
|
#include "link_editor.h"
|
|
|
|
#include "nel/gui/interface_group.h"
|
|
|
|
#include "nel/gui/interface_group.h"
|
|
|
|
#include "nel/gui/widget_manager.h"
|
|
|
|
#include "nel/gui/widget_manager.h"
|
|
|
|
|
|
|
|
#include "expression_editor.h"
|
|
|
|
|
|
|
|
#include <QMenu>
|
|
|
|
|
|
|
|
|
|
|
|
namespace GUIEditor
|
|
|
|
namespace GUIEditor
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
class LinkEditorPvt
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LinkEditorPvt()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ee = new ExpressionEditor();
|
|
|
|
|
|
|
|
ee->load();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
~LinkEditorPvt()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
delete ee;
|
|
|
|
|
|
|
|
ee = NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExpressionEditor *ee;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LinkEditor::LinkEditor( QWidget *parent ) :
|
|
|
|
LinkEditor::LinkEditor( QWidget *parent ) :
|
|
|
|
QWidget( parent )
|
|
|
|
QWidget( parent )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
setupUi( this );
|
|
|
|
setupUi( this );
|
|
|
|
setup();
|
|
|
|
setup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_pvt = new LinkEditorPvt();
|
|
|
|
|
|
|
|
|
|
|
|
connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOKButtonClicked() ) );
|
|
|
|
connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( onOKButtonClicked() ) );
|
|
|
|
connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( hide() ) );
|
|
|
|
connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( hide() ) );
|
|
|
|
|
|
|
|
connect( expressionEdit, SIGNAL( customContextMenuRequested( const QPoint& ) ), this, SLOT( onTextEditContextMenu( const QPoint& ) ) );
|
|
|
|
|
|
|
|
connect( m_pvt->ee, SIGNAL( closing() ), this, SLOT( onEEClosing() ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LinkEditor::~LinkEditor()
|
|
|
|
LinkEditor::~LinkEditor()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
delete m_pvt;
|
|
|
|
|
|
|
|
m_pvt = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LinkEditor::setup()
|
|
|
|
void LinkEditor::setup()
|
|
|
@ -89,4 +118,23 @@ namespace GUIEditor
|
|
|
|
|
|
|
|
|
|
|
|
hide();
|
|
|
|
hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LinkEditor::onTextEditContextMenu( const QPoint &pos )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
QMenu *menu = expressionEdit->createStandardContextMenu();
|
|
|
|
|
|
|
|
QAction *a = menu->addAction( "Expression Editor" );
|
|
|
|
|
|
|
|
connect( a, SIGNAL( triggered() ), this, SLOT( onEE() ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
menu->exec( mapToGlobal( pos ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LinkEditor::onEE()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_pvt->ee->show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LinkEditor::onEEClosing()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
expressionEdit->setPlainText( m_pvt->ee->result() );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|