mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-19 05:36:13 +00:00
Allow editing of the comment section, and save comments when saving.
This commit is contained in:
parent
5392096bb5
commit
c8c28a8d90
9 changed files with 38 additions and 3 deletions
|
@ -82,6 +82,8 @@ bool GeorgesDFNDialog::load( const QString &fileName )
|
||||||
|
|
||||||
m_fileName = fileName;
|
m_fileName = fileName;
|
||||||
|
|
||||||
|
connect(m_ui.commentsEdit, SIGNAL(textChanged()), this, SLOT(onCommentsEdited()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,6 +93,7 @@ void GeorgesDFNDialog::write()
|
||||||
setWindowTitle( windowTitle().remove( "*" ) );
|
setWindowTitle( windowTitle().remove( "*" ) );
|
||||||
|
|
||||||
m_pvt->dfn->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData();
|
m_pvt->dfn->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData();
|
||||||
|
m_pvt->dfn->Header.Comments = m_ui.commentsEdit->toPlainText().toUtf8().constData();
|
||||||
|
|
||||||
NLMISC::COFile file;
|
NLMISC::COFile file;
|
||||||
if( !file.open( m_fileName.toUtf8().constData(), false, true, false ) )
|
if( !file.open( m_fileName.toUtf8().constData(), false, true, false ) )
|
||||||
|
@ -178,6 +181,11 @@ void GeorgesDFNDialog::onValueChanged( const QString &key, const QString &value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeorgesDFNDialog::onCommentsEdited()
|
||||||
|
{
|
||||||
|
onModified();
|
||||||
|
}
|
||||||
|
|
||||||
void GeorgesDFNDialog::loadDfn()
|
void GeorgesDFNDialog::loadDfn()
|
||||||
{
|
{
|
||||||
m_pvt->ctrl->setDFN( m_pvt->dfn );
|
m_pvt->ctrl->setDFN( m_pvt->dfn );
|
||||||
|
|
|
@ -44,6 +44,7 @@ private Q_SLOTS:
|
||||||
void onCurrentRowChanged( int row );
|
void onCurrentRowChanged( int row );
|
||||||
|
|
||||||
void onValueChanged( const QString& key, const QString &value );
|
void onValueChanged( const QString& key, const QString &value );
|
||||||
|
void onCommentsEdited();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void loadDfn();
|
void loadDfn();
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QPlainTextEdit" name="commentsEdit">
|
<widget class="QPlainTextEdit" name="commentsEdit">
|
||||||
<property name="textInteractionFlags">
|
<property name="textInteractionFlags">
|
||||||
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
<set>Qt::TextEditorInteraction</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -323,6 +323,8 @@ namespace GeorgesQt
|
||||||
QFileInfo info( fileName );
|
QFileInfo info( fileName );
|
||||||
setWindowTitle( info.fileName() );
|
setWindowTitle( info.fileName() );
|
||||||
|
|
||||||
|
connect(m_ui.commentEdit, SIGNAL(textChanged()), this, SLOT(onCommentsEdited()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,6 +332,7 @@ namespace GeorgesQt
|
||||||
{
|
{
|
||||||
NLGEORGES::CForm *form = static_cast< NLGEORGES::CForm* >( m_form );
|
NLGEORGES::CForm *form = static_cast< NLGEORGES::CForm* >( m_form );
|
||||||
form->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData();
|
form->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData();
|
||||||
|
form->Header.Comments = m_ui.commentEdit->toPlainText().toUtf8().constData();
|
||||||
|
|
||||||
NLMISC::COFile file;
|
NLMISC::COFile file;
|
||||||
std::string s = m_fileName.toUtf8().constData();
|
std::string s = m_fileName.toUtf8().constData();
|
||||||
|
@ -591,6 +594,11 @@ namespace GeorgesQt
|
||||||
m_browserCtrl->clicked( idx );
|
m_browserCtrl->clicked( idx );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CGeorgesTreeViewDialog::onCommentsEdited()
|
||||||
|
{
|
||||||
|
modifiedFile();
|
||||||
|
}
|
||||||
|
|
||||||
void CGeorgesTreeViewDialog::closeEvent(QCloseEvent *event)
|
void CGeorgesTreeViewDialog::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
Q_EMIT closing();
|
Q_EMIT closing();
|
||||||
|
|
|
@ -103,6 +103,7 @@ namespace GeorgesQt
|
||||||
void onValueChanged( const QString &key, const QString &value );
|
void onValueChanged( const QString &key, const QString &value );
|
||||||
void onVStructChanged( const QString &name );
|
void onVStructChanged( const QString &name );
|
||||||
void onRenameArrayEntry();
|
void onRenameArrayEntry();
|
||||||
|
void onCommentsEdited();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void log( const QString &msg );
|
void log( const QString &msg );
|
||||||
|
|
|
@ -112,7 +112,11 @@
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QPlainTextEdit" name="logEdit"/>
|
<widget class="QPlainTextEdit" name="logEdit">
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
@ -82,6 +82,8 @@ bool GeorgesTypDialog::load( const QString &fileName )
|
||||||
QFileInfo info( fileName );
|
QFileInfo info( fileName );
|
||||||
setWindowTitle( info.fileName() );
|
setWindowTitle( info.fileName() );
|
||||||
|
|
||||||
|
connect( m_ui.commentEdit, SIGNAL( textChanged() ), this, SLOT( onCommentsEdited() ) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,6 +98,7 @@ void GeorgesTypDialog::write()
|
||||||
xml.init( &file );
|
xml.init( &file );
|
||||||
|
|
||||||
m_pvt->typ->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData();
|
m_pvt->typ->Header.Log = m_ui.logEdit->toPlainText().toUtf8().constData();
|
||||||
|
m_pvt->typ->Header.Comments = m_ui.commentEdit->toPlainText().toUtf8().constData();
|
||||||
m_pvt->typ->write( xml.getDocument() );
|
m_pvt->typ->write( xml.getDocument() );
|
||||||
|
|
||||||
xml.flush();
|
xml.flush();
|
||||||
|
@ -227,6 +230,11 @@ void GeorgesTypDialog::onModified( const QString &k, const QString &v )
|
||||||
onModified();
|
onModified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeorgesTypDialog::onCommentsEdited()
|
||||||
|
{
|
||||||
|
onModified();
|
||||||
|
}
|
||||||
|
|
||||||
void GeorgesTypDialog::setupConnections()
|
void GeorgesTypDialog::setupConnections()
|
||||||
{
|
{
|
||||||
connect( m_ui.addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) );
|
connect( m_ui.addButton, SIGNAL( clicked( bool ) ), this, SLOT( onAddClicked() ) );
|
||||||
|
|
|
@ -45,6 +45,7 @@ private Q_SLOTS:
|
||||||
void onItemChanged( QTreeWidgetItem *item, int column );
|
void onItemChanged( QTreeWidgetItem *item, int column );
|
||||||
void onModified();
|
void onModified();
|
||||||
void onModified( const QString &k, const QString &v );
|
void onModified( const QString &k, const QString &v );
|
||||||
|
void onCommentsEdited();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupConnections();
|
void setupConnections();
|
||||||
|
|
|
@ -118,7 +118,11 @@
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout" name="gridLayout_5">
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QPlainTextEdit" name="logEdit"/>
|
<widget class="QPlainTextEdit" name="logEdit">
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
Loading…
Reference in a new issue