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