mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-11 01:40:13 +00:00
New context menu options: mark / unmark translated.
This commit is contained in:
parent
dff11950f5
commit
afb1f84feb
2 changed files with 38 additions and 1 deletions
|
@ -290,12 +290,18 @@ void UXTEditor::contextMenuEvent( QContextMenuEvent *e )
|
||||||
QMenu *menu = new QMenu( this );
|
QMenu *menu = new QMenu( this );
|
||||||
QAction *insertAction = new QAction( "Insert row", menu );
|
QAction *insertAction = new QAction( "Insert row", menu );
|
||||||
QAction *deleteAction = new QAction( "Delete row", menu );
|
QAction *deleteAction = new QAction( "Delete row", menu );
|
||||||
|
QAction *markAction = new QAction( "Mark translated", menu );
|
||||||
|
QAction *unmarkAction = new QAction( "Mark not-translated", menu );
|
||||||
|
|
||||||
connect( insertAction, SIGNAL( triggered( bool ) ), this, SLOT( insertRow() ) );
|
connect( insertAction, SIGNAL( triggered( bool ) ), this, SLOT( insertRow() ) );
|
||||||
connect( deleteAction, SIGNAL( triggered( bool ) ), this, SLOT( deleteRow() ) );
|
connect( deleteAction, SIGNAL( triggered( bool ) ), this, SLOT( deleteRow() ) );
|
||||||
|
connect( markAction, SIGNAL( triggered( bool ) ), this, SLOT( markTranslated() ) );
|
||||||
|
connect( unmarkAction, SIGNAL( triggered( bool ) ), this, SLOT( markUntranslated() ) );
|
||||||
|
|
||||||
menu->addAction( insertAction );
|
menu->addAction( insertAction );
|
||||||
menu->addAction( deleteAction );
|
menu->addAction( deleteAction );
|
||||||
|
menu->addAction( markAction );
|
||||||
|
menu->addAction( unmarkAction );
|
||||||
menu->exec( e->globalPos() );
|
menu->exec( e->globalPos() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,6 +319,35 @@ void UXTEditor::onCellChanged( int row, int column )
|
||||||
setWindowModified( true );
|
setWindowModified( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UXTEditor::markTranslated()
|
||||||
|
{
|
||||||
|
int r = d_ptr->t->currentRow();
|
||||||
|
if( r < 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
STRING_MANAGER::TStringInfo &info = d_ptr->infos[ r ];
|
||||||
|
if( !info.Text2.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
info.Text2 = info.Text;
|
||||||
|
|
||||||
|
setWindowModified( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
void UXTEditor::markUntranslated()
|
||||||
|
{
|
||||||
|
int r = d_ptr->t->currentRow();
|
||||||
|
if( r < 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
STRING_MANAGER::TStringInfo &info = d_ptr->infos[ r ];
|
||||||
|
|
||||||
|
info.Text2.clear();
|
||||||
|
info.HashValue = 0;
|
||||||
|
|
||||||
|
setWindowModified( true );
|
||||||
|
}
|
||||||
|
|
||||||
void UXTEditor::setHeaderText( const QString &id, const QString &text )
|
void UXTEditor::setHeaderText( const QString &id, const QString &text )
|
||||||
{
|
{
|
||||||
QTableWidgetItem *h1 = new QTableWidgetItem( id );
|
QTableWidgetItem *h1 = new QTableWidgetItem( id );
|
||||||
|
|
|
@ -47,6 +47,8 @@ protected:
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void onCellChanged( int row, int column );
|
void onCellChanged( int row, int column );
|
||||||
|
void markTranslated();
|
||||||
|
void markUntranslated();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setHeaderText( const QString &id, const QString &text );
|
void setHeaderText( const QString &id, const QString &text );
|
||||||
|
|
Loading…
Reference in a new issue