// table item
if (to_row != static_cast<quint32>(table->rowCount()))
{
+ disconnect(table, SIGNAL(cellChanged(qint32, qint32)),
+ this, SLOT(slotTableChange(qint32)));
+
table->setRowCount(to_row);
for (quint32 row = 0; row < to_row; ++row)
{
it6->setBackground(Grey);
}
- disconnect(table, SIGNAL(cellChanged(qint32, qint32)),
- this, SLOT(slotTableChange(qint32)));
-
table->setItem(row, 0, it0);
table->setItem(row, 1, it1);
table->setItem(row, 2, it2);
table->setItem(row, 4, it4);
table->setItem(row, 5, it5);
table->setItem(row, 6, it6);
-
- connect(table, SIGNAL(cellChanged(qint32, qint32)),
- this, SLOT(slotTableChange(qint32)));
}
+ connect(table, SIGNAL(cellChanged(qint32, qint32)),
+ this, SLOT(slotTableChange(qint32)));
}
else
{
connect(table, SIGNAL(cellChanged(qint32, qint32)),
this, SLOT(slotTableChange(qint32)));
+
+ setMode(Mode::Edited);
}
void MainWindow::slotTableReplace(NCFile& entry, quint32 row)
setMode(Mode::Edited);
}
-void MainWindow::slotTableIgnored()
+void MainWindow::slotEntryReplace(NCFile& entry, quint32 row)
+{
+ _vfs->fileReplace(entry, row);
+}
+
+void MainWindow::slotEntryIgnore()
{
_ui->wid_stack->setCurrentIndex(0);
setMode(Mode::Edited);
// image viewer connections
connect(_img, SIGNAL(sigImageUpdate(NCFile&, quint32)),
- this, SLOT(slotTableReplace(NCFile&, quint32)));
+ this, SLOT(slotEntryReplace(NCFile&, quint32)));
connect(_img, SIGNAL(sigImageIgnored()),
- this, SLOT(slotTableIgnored()));
+ this, SLOT(slotEntryIgnore()));
// text viewer connections
connect(_txt, SIGNAL(sigTextUpdate(NCFile&, quint32)),
- this, SLOT(slotTableReplace(NCFile&, quint32)));
+ this, SLOT(slotEntryReplace(NCFile&, quint32)));
connect(_txt, SIGNAL(sigTextIgnored()),
- this, SLOT(slotTableIgnored()));
+ this, SLOT(slotEntryIgnore()));
// dat viewer connections
connect(_dat, SIGNAL(sigDatUpdate(NCFile&, quint32)),
- this, SLOT(slotTableReplace(NCFile&, quint32)));
+ this, SLOT(slotEntryReplace(NCFile&, quint32)));
connect(_dat, SIGNAL(sigDatIgnored()),
- this, SLOT(slotTableIgnored()));
+ this, SLOT(slotEntryIgnore()));
// object viewer connections
connect(_obj, SIGNAL(sigObjectUpdate(NCFile&, quint32)),
- this, SLOT(slotTableReplace(NCFile&, quint32)));
+ this, SLOT(slotEntryReplace(NCFile&, quint32)));
connect(_obj, SIGNAL(sigObjectIgnored()),
- this, SLOT(slotTableIgnored()));
+ this, SLOT(slotEntryIgnore()));
// context menus for the QTableWidget
ctx_sep1->setSeparator(true);
void slotTableAdd(NCFile& entry, quint32 row);
void slotTableReplace(NCFile& entry, quint32 row);
void slotTableRemove(quint32 row);
- void slotTableIgnored();
+
+ void slotEntryReplace(NCFile& entry, quint32 row);
+ void slotEntryIgnore();
protected:
// protected stuff
// --- constructors and deconstructors ---
TextWindow::TextWindow(QWidget *parent)
-: QMainWindow(parent), _ui(new Ui::TextWindow), _def(new DefSyntax(this)), _fx(new FxSyntax(this)),
- _ini(new IniSyntax(this)), _num(0)
+: QMainWindow(parent), _ui(new Ui::TextWindow), _syn(0), _num(0)
{
_ui->setupUi(this);
TextWindow::~TextWindow()
{
- delete _ini;
- delete _fx;
- delete _def;
+ delete _syn;
delete _ui;
}
void TextWindow::slotTextSave()
{
- _entry.setOData(_ui->ed_text->toPlainText().toLocal8Bit());
- _entry.setOSize(_ui->ed_text->toPlainText().toLocal8Bit().size());
+ _entry.setOData(_ui->ed_text->toPlainText().toLatin1());
+ _entry.setOSize(_ui->ed_text->toPlainText().toLatin1().size());
_entry.setCSize(_entry.cData().size());
_entry.setName(_ui->ed_name->text());
_entry.setNameLength(_entry.name().size() + 1);
_entry.setHSize(_entry.headerSize() + _entry.nameLength());
emit sigTextUpdate(_entry, _num);
+
+ setMode(Mode::Fresh);
}
void TextWindow::slotTextDiscard()
_ui->ed_text->clear();
emit sigTextIgnored();
+
+ setMode(Mode::Fresh);
+}
+
+void TextWindow::slotEditDelete()
+{
+ _ui->ed_text->textCursor().removeSelectedText();
}
void TextWindow::slotTextView(NCFile& entry, quint32 row)
{
_entry = entry;
_num = row;
- _def->setDocument(0);
+
_ui->ed_text->setPlainText(entry.oData());
_ui->ed_name->setText(entry.name());
_ui->ed_lines->setText(QString::number(_ui->ed_text->document()->lineCount()));
_ui->ed_size->setText(QString::number(_ui->ed_text->toPlainText().size()));
+ delete _syn;
+
if (entry.name().contains(".def", Qt::CaseInsensitive))
- _def->setDocument(_ui->ed_text->document());
+ _syn = new DefSyntax(_ui->ed_text->document());
if (entry.name().contains(".fx", Qt::CaseInsensitive))
- _fx->setDocument(_ui->ed_text->document());
+ _syn = new FxSyntax(_ui->ed_text->document());
if (entry.name().contains(".ini", Qt::CaseInsensitive))
- _ini->setDocument(_ui->ed_text->document());
+ _syn = new IniSyntax(_ui->ed_text->document());
+}
+
+void TextWindow::slotTextChanged()
+{
+ setMode(Mode::Edited);
}
// --- protected methods ---
void TextWindow::setupActions()
{
+ QAction *ctx_sep1 = new QAction(this);
+ QAction *ctx_sep2 = new QAction(this);
+
+ // file stuff
connect(_ui->act_text_save, SIGNAL(triggered()),
this, SLOT(slotTextSave()));
connect(_ui->act_text_cancel, SIGNAL(triggered()),
this, SLOT(slotTextDiscard()));
+
+ // edit stuff
+ connect(_ui->act_edit_undo, SIGNAL(triggered()),
+ _ui->ed_text, SLOT(undo()));
+ connect(_ui->act_edit_redo, SIGNAL(triggered()),
+ _ui->ed_text, SLOT(redo()));
+ connect(_ui->act_edit_cut, SIGNAL(triggered()),
+ _ui->ed_text, SLOT(cut()));
+ connect(_ui->act_edit_copy, SIGNAL(triggered()),
+ _ui->ed_text, SLOT(copy()));
+ connect(_ui->act_edit_insert, SIGNAL(triggered()),
+ _ui->ed_text, SLOT(paste()));
+ connect(_ui->act_edit_delete, SIGNAL(triggered()),
+ this, SLOT(slotEditDelete()));
+ connect(_ui->act_edit_selall, SIGNAL(triggered()),
+ _ui->ed_text, SLOT(selectAll()));
+
+ // recognize changes
+ connect(_ui->ed_text, SIGNAL(textChanged()),
+ this, SLOT(slotTextChanged()));
+
+ // context menu
+ ctx_sep1->setSeparator(true);
+ ctx_sep2->setSeparator(true);
+
+ _ui->ed_text->addAction(_ui->act_edit_undo);
+ _ui->ed_text->addAction(_ui->act_edit_redo);
+ _ui->ed_text->addAction(ctx_sep1);
+ _ui->ed_text->addAction(_ui->act_edit_cut);
+ _ui->ed_text->addAction(_ui->act_edit_copy);
+ _ui->ed_text->addAction(_ui->act_edit_insert);
+ _ui->ed_text->addAction(_ui->act_edit_delete);
+ _ui->ed_text->addAction(_ui->act_edit_selall);
+ _ui->ed_text->addAction(ctx_sep2);
+ _ui->ed_text->addAction(_ui->act_text_save);
+ _ui->ed_text->addAction(_ui->act_text_cancel);
}
{
class TextWindow;
}
-class DefSyntax;
-class FxSyntax;
-class IniSyntax;
+class QSyntaxHighlighter;
class TextWindow : public QMainWindow {
Q_OBJECT
void slotTextSave();
void slotTextDiscard();
+ void slotEditDelete();
+
void slotTextView(NCFile& entry, quint32 row);
+ void slotTextChanged();
protected:
virtual void changeEvent(QEvent *event);
private:
Ui::TextWindow *_ui;
- DefSyntax *_def;
- FxSyntax *_fx;
- IniSyntax *_ini;
+ QSyntaxHighlighter *_syn;
NCFile _entry;
quint32 _num;
};
</property>
<item>
<widget class="QTextEdit" name="ed_text">
+ <property name="contextMenuPolicy">
+ <enum>Qt::ActionsContextMenu</enum>
+ </property>
<property name="documentTitle">
<string notr="true"/>
</property>
- <property name="readOnly">
- <bool>true</bool>
- </property>
<property name="html">
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
<height>22</height>
</rect>
</property>
- <widget class="QMenu" name="menuMM_TEXT">
+ <widget class="QMenu" name="mm_text">
<property name="title">
<string>MM-TEXT</string>
</property>
<addaction name="separator"/>
<addaction name="act_text_cancel"/>
</widget>
- <addaction name="menuMM_TEXT"/>
+ <widget class="QMenu" name="mm_edit">
+ <property name="title">
+ <string>MM-EDIT</string>
+ </property>
+ <addaction name="act_edit_undo"/>
+ <addaction name="act_edit_redo"/>
+ <addaction name="separator"/>
+ <addaction name="act_edit_cut"/>
+ <addaction name="act_edit_copy"/>
+ <addaction name="act_edit_insert"/>
+ <addaction name="act_edit_delete"/>
+ <addaction name="act_edit_selall"/>
+ </widget>
+ <addaction name="mm_text"/>
+ <addaction name="mm_edit"/>
</widget>
<action name="act_text_save">
<property name="text">
<string>ME-TEXT-CANCEL</string>
</property>
</action>
+ <action name="act_edit_undo">
+ <property name="text">
+ <string>ME-EDIT-UNDO</string>
+ </property>
+ </action>
+ <action name="act_edit_redo">
+ <property name="text">
+ <string>ME-EDIT-REDO</string>
+ </property>
+ </action>
+ <action name="act_edit_cut">
+ <property name="text">
+ <string>ME-EDIT-CUT</string>
+ </property>
+ </action>
+ <action name="act_edit_copy">
+ <property name="text">
+ <string>ME-EDIT-COPY</string>
+ </property>
+ </action>
+ <action name="act_edit_insert">
+ <property name="text">
+ <string>ME-EDIT-INSERT</string>
+ </property>
+ </action>
+ <action name="act_edit_delete">
+ <property name="text">
+ <string>ME-EDIT-DELETE</string>
+ </property>
+ </action>
+ <action name="act_edit_selall">
+ <property name="text">
+ <string>ME-EDIT-SELALL</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>
<message>
<location filename="DatWindow.ui" line="41"/>
<source>ME-DAT-SAVE</source>
- <translation>Save dat changes</translation>
+ <translation>Save changes</translation>
</message>
<message>
<location filename="DatWindow.ui" line="46"/>
<source>ME-DAT-CANCEL</source>
- <translation>Discard dat changes</translation>
+ <translation>Discard changes</translation>
</message>
</context>
<context>
<message>
<location filename="MainWindow.ui" line="242"/>
<source>ME-FILE-IMAGE</source>
- <translation>View image ...</translation>
+ <translation>View image file ...</translation>
</message>
<message>
<location filename="MainWindow.ui" line="247"/>
<source>ME-FILE-TEXT</source>
- <translation>View text ...</translation>
+ <translation>Edit text file ...</translation>
</message>
<message>
<location filename="MainWindow.ui" line="252"/>
<source>ME-FILE-DAT</source>
- <translation>View dat ...</translation>
+ <translation>View dat file ...</translation>
</message>
<message>
<location filename="MainWindow.ui" line="257"/>
<source>ME-FILE-OBJECT</source>
- <translation>View 3D object ...</translation>
+ <translation>View 3d object ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="155"/>
- <location filename="MainWindow.cxx" line="166"/>
+ <location filename="MainWindow.cxx" line="156"/>
+ <location filename="MainWindow.cxx" line="167"/>
<source>DIA-OPEN-FILE</source>
<translation>Open files ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="119"/>
- <location filename="MainWindow.cxx" line="139"/>
+ <location filename="MainWindow.cxx" line="120"/>
+ <location filename="MainWindow.cxx" line="140"/>
<source>FLT-FILE-VFS</source>
<oldsource>DIA-SAVE-FILE</oldsource>
<translation>Neocron VFS file (*.vfs *.pak)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="119"/>
+ <location filename="MainWindow.cxx" line="120"/>
<source>DIA-OPEN-VFS</source>
<translation>Open virtual filesystem ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="139"/>
+ <location filename="MainWindow.cxx" line="140"/>
<source>DIA-SAVE-VFS</source>
<translation>Save virtual filesystem ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="155"/>
- <location filename="MainWindow.cxx" line="166"/>
+ <location filename="MainWindow.cxx" line="156"/>
+ <location filename="MainWindow.cxx" line="167"/>
<source>FLT-FILE-ANY</source>
<translation>File (*.*)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="184"/>
+ <location filename="MainWindow.cxx" line="185"/>
<source>DIA-SAVE-PLAIN</source>
<translation>Save file ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="184"/>
+ <location filename="MainWindow.cxx" line="185"/>
<source>FLT-FILE-PLAIN</source>
<translation>File (*.*)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="192"/>
+ <location filename="MainWindow.cxx" line="193"/>
<source>DIA-SAVE-PAK</source>
<translation>Save PAK file ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="192"/>
+ <location filename="MainWindow.cxx" line="193"/>
<source>FLT-FILE-PAK</source>
<translation>Neocron PAK file (*.pak)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="200"/>
+ <location filename="MainWindow.cxx" line="201"/>
<source>DIA-SAVE-ZLIB</source>
<translation>Save ZLIB file ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="200"/>
+ <location filename="MainWindow.cxx" line="201"/>
<source>FLT-FILE-ZLIB</source>
<translation>ZLIB file (*.z)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="312"/>
+ <location filename="MainWindow.cxx" line="313"/>
<source>MSG-UPD-FILE</source>
<translation>Virtual filesystem</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="312"/>
+ <location filename="MainWindow.cxx" line="313"/>
<source>MSG-UPD-WITH</source>
<translation>with</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="313"/>
+ <location filename="MainWindow.cxx" line="314"/>
<source>MSG-UPD-ENTRIES</source>
<translation>entries</translation>
</message>
<message>
<location filename="ObjectWindow.ui" line="68"/>
<source>ME-OBJECT-SAVE</source>
- <translation>Save 3D object changes</translation>
+ <translation>Save changes</translation>
</message>
<message>
<location filename="ObjectWindow.ui" line="73"/>
<source>ME-OBJECT-CANCEL</source>
- <translation>Discard 3D object changes</translation>
+ <translation>Discard changes</translation>
</message>
</context>
<context>
<translation>QTinNS Editor - Text Viewer</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="75"/>
+ <location filename="TextWindow.ui" line="72"/>
<source>LAB-TEXT-NAME</source>
<translation>Text name:</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="105"/>
+ <location filename="TextWindow.ui" line="102"/>
<source>LAB-TEXT-LINES</source>
<translation>Lines:</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="135"/>
+ <location filename="TextWindow.ui" line="132"/>
<source>LAB-TEXT-SIZE</source>
<translation>Size:</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="165"/>
+ <location filename="TextWindow.ui" line="162"/>
<source>MM-TEXT</source>
<translation>Text</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="175"/>
+ <location filename="TextWindow.ui" line="170"/>
+ <source>MM-EDIT</source>
+ <translation>Edit</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="186"/>
<source>ME-TEXT-SAVE</source>
- <translation>Save text</translation>
+ <translation>Save changes</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="180"/>
+ <location filename="TextWindow.ui" line="191"/>
<source>ME-TEXT-CANCEL</source>
- <translation>Discard text</translation>
+ <translation>Discard changes</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="196"/>
+ <source>ME-EDIT-UNDO</source>
+ <translation>Undo</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="201"/>
+ <source>ME-EDIT-REDO</source>
+ <translation>Redo</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="206"/>
+ <source>ME-EDIT-CUT</source>
+ <translation>Cut</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="211"/>
+ <source>ME-EDIT-COPY</source>
+ <translation>Copy</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="216"/>
+ <source>ME-EDIT-INSERT</source>
+ <translation>Insert</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="221"/>
+ <source>ME-EDIT-DELETE</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="226"/>
+ <source>ME-EDIT-SELALL</source>
+ <translation>Select all</translation>
</message>
</context>
</TS>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="155"/>
- <location filename="MainWindow.cxx" line="166"/>
+ <location filename="MainWindow.cxx" line="156"/>
+ <location filename="MainWindow.cxx" line="167"/>
<source>DIA-OPEN-FILE</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="119"/>
- <location filename="MainWindow.cxx" line="139"/>
+ <location filename="MainWindow.cxx" line="120"/>
+ <location filename="MainWindow.cxx" line="140"/>
<source>FLT-FILE-VFS</source>
<oldsource>DIA-SAVE-FILE</oldsource>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="119"/>
+ <location filename="MainWindow.cxx" line="120"/>
<source>DIA-OPEN-VFS</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="139"/>
+ <location filename="MainWindow.cxx" line="140"/>
<source>DIA-SAVE-VFS</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="155"/>
- <location filename="MainWindow.cxx" line="166"/>
+ <location filename="MainWindow.cxx" line="156"/>
+ <location filename="MainWindow.cxx" line="167"/>
<source>FLT-FILE-ANY</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="184"/>
+ <location filename="MainWindow.cxx" line="185"/>
<source>DIA-SAVE-PLAIN</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="184"/>
+ <location filename="MainWindow.cxx" line="185"/>
<source>FLT-FILE-PLAIN</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="192"/>
+ <location filename="MainWindow.cxx" line="193"/>
<source>DIA-SAVE-PAK</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="192"/>
+ <location filename="MainWindow.cxx" line="193"/>
<source>FLT-FILE-PAK</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="200"/>
+ <location filename="MainWindow.cxx" line="201"/>
<source>DIA-SAVE-ZLIB</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="200"/>
+ <location filename="MainWindow.cxx" line="201"/>
<source>FLT-FILE-ZLIB</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="312"/>
+ <location filename="MainWindow.cxx" line="313"/>
<source>MSG-UPD-FILE</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="312"/>
+ <location filename="MainWindow.cxx" line="313"/>
<source>MSG-UPD-WITH</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="313"/>
+ <location filename="MainWindow.cxx" line="314"/>
<source>MSG-UPD-ENTRIES</source>
<translation type="unfinished"></translation>
</message>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="TextWindow.ui" line="75"/>
+ <location filename="TextWindow.ui" line="72"/>
<source>LAB-TEXT-NAME</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="TextWindow.ui" line="105"/>
+ <location filename="TextWindow.ui" line="102"/>
<source>LAB-TEXT-LINES</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="TextWindow.ui" line="135"/>
+ <location filename="TextWindow.ui" line="132"/>
<source>LAB-TEXT-SIZE</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="TextWindow.ui" line="165"/>
+ <location filename="TextWindow.ui" line="162"/>
<source>MM-TEXT</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="TextWindow.ui" line="175"/>
+ <location filename="TextWindow.ui" line="170"/>
+ <source>MM-EDIT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="186"/>
<source>ME-TEXT-SAVE</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="TextWindow.ui" line="180"/>
+ <location filename="TextWindow.ui" line="191"/>
<source>ME-TEXT-CANCEL</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <location filename="TextWindow.ui" line="196"/>
+ <source>ME-EDIT-UNDO</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="201"/>
+ <source>ME-EDIT-REDO</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="206"/>
+ <source>ME-EDIT-CUT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="211"/>
+ <source>ME-EDIT-COPY</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="216"/>
+ <source>ME-EDIT-INSERT</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="221"/>
+ <source>ME-EDIT-DELETE</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="226"/>
+ <source>ME-EDIT-SELALL</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
</TS>
<message>
<location filename="DatWindow.ui" line="41"/>
<source>ME-DAT-SAVE</source>
- <translation>Speichere Dat Änderungen</translation>
+ <translation>Speichere Änderungen</translation>
</message>
<message>
<location filename="DatWindow.ui" line="46"/>
<source>ME-DAT-CANCEL</source>
- <translation>Verwerfe Dat Änderungen</translation>
+ <translation>Verwerfe Änderungen</translation>
</message>
</context>
<context>
<message>
<location filename="MainWindow.ui" line="242"/>
<source>ME-FILE-IMAGE</source>
- <translation>Bild anzeigen ...</translation>
+ <translation>Bilddatei anzeigen ...</translation>
</message>
<message>
<location filename="MainWindow.ui" line="247"/>
<source>ME-FILE-TEXT</source>
- <translation>Text anzeigen ...</translation>
+ <translation>Textdatei bearbeiten ...</translation>
</message>
<message>
<location filename="MainWindow.ui" line="252"/>
<source>ME-FILE-DAT</source>
- <translation>Dat anzeigen ...</translation>
+ <translation>Datdatei anzeigen ...</translation>
</message>
<message>
<location filename="MainWindow.ui" line="257"/>
<translation>3D Objekt anzeigen ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="155"/>
- <location filename="MainWindow.cxx" line="166"/>
+ <location filename="MainWindow.cxx" line="156"/>
+ <location filename="MainWindow.cxx" line="167"/>
<source>DIA-OPEN-FILE</source>
<translation>Datei öffnen ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="119"/>
- <location filename="MainWindow.cxx" line="139"/>
+ <location filename="MainWindow.cxx" line="120"/>
+ <location filename="MainWindow.cxx" line="140"/>
<source>FLT-FILE-VFS</source>
<oldsource>DIA-SAVE-FILE</oldsource>
<translation>Neocron VFS Datei (*.vfs *.pak)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="119"/>
+ <location filename="MainWindow.cxx" line="120"/>
<source>DIA-OPEN-VFS</source>
<translation>Virtuelles Dateisystem öffnen ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="139"/>
+ <location filename="MainWindow.cxx" line="140"/>
<source>DIA-SAVE-VFS</source>
<translation>Virtuelles Dateisystem speichern ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="155"/>
- <location filename="MainWindow.cxx" line="166"/>
+ <location filename="MainWindow.cxx" line="156"/>
+ <location filename="MainWindow.cxx" line="167"/>
<source>FLT-FILE-ANY</source>
<translation>Datei (*.*)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="184"/>
+ <location filename="MainWindow.cxx" line="185"/>
<source>DIA-SAVE-PLAIN</source>
<translation>Datei speichern ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="184"/>
+ <location filename="MainWindow.cxx" line="185"/>
<source>FLT-FILE-PLAIN</source>
<translation>Datei (*.*)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="192"/>
+ <location filename="MainWindow.cxx" line="193"/>
<source>DIA-SAVE-PAK</source>
<translation>PAK Datei speichern ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="192"/>
+ <location filename="MainWindow.cxx" line="193"/>
<source>FLT-FILE-PAK</source>
<translation>Neocron PAK Datei (*.pak)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="200"/>
+ <location filename="MainWindow.cxx" line="201"/>
<source>DIA-SAVE-ZLIB</source>
<translation>ZLIB Datei speichern ...</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="200"/>
+ <location filename="MainWindow.cxx" line="201"/>
<source>FLT-FILE-ZLIB</source>
<translation>ZLIB Datei (*.z)</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="312"/>
+ <location filename="MainWindow.cxx" line="313"/>
<source>MSG-UPD-FILE</source>
<translation>Virtuelles Dateisystem</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="312"/>
+ <location filename="MainWindow.cxx" line="313"/>
<source>MSG-UPD-WITH</source>
<translation>mit</translation>
</message>
<message>
- <location filename="MainWindow.cxx" line="313"/>
+ <location filename="MainWindow.cxx" line="314"/>
<source>MSG-UPD-ENTRIES</source>
<translation>Einträgen</translation>
</message>
<message>
<location filename="ObjectWindow.ui" line="68"/>
<source>ME-OBJECT-SAVE</source>
- <translation>Speichere 3D Objekt Änderungen</translation>
+ <translation>Speichere Änderungen</translation>
</message>
<message>
<location filename="ObjectWindow.ui" line="73"/>
<source>ME-OBJECT-CANCEL</source>
- <translation>Verwerfe 3D Objekt Änderungen</translation>
+ <translation>Verwerfe Änderungen</translation>
</message>
</context>
<context>
<translation>QTinNS Editor - Text Viewer</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="75"/>
+ <location filename="TextWindow.ui" line="72"/>
<source>LAB-TEXT-NAME</source>
<translation>Textdateiname:</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="105"/>
+ <location filename="TextWindow.ui" line="102"/>
<source>LAB-TEXT-LINES</source>
<translation>Zeilen:</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="135"/>
+ <location filename="TextWindow.ui" line="132"/>
<source>LAB-TEXT-SIZE</source>
<translation>Größe:</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="165"/>
+ <location filename="TextWindow.ui" line="162"/>
<source>MM-TEXT</source>
<translation>Text</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="175"/>
+ <location filename="TextWindow.ui" line="170"/>
+ <source>MM-EDIT</source>
+ <translation>Bearbeiten</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="186"/>
<source>ME-TEXT-SAVE</source>
<translation>Speichere Änderungen</translation>
</message>
<message>
- <location filename="TextWindow.ui" line="180"/>
+ <location filename="TextWindow.ui" line="191"/>
<source>ME-TEXT-CANCEL</source>
- <translatorcomment>Verwerfe Änderungen</translatorcomment>
- <translation>Text verwerfern</translation>
+ <translation>Verwerfe Änderungen</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="196"/>
+ <source>ME-EDIT-UNDO</source>
+ <translation>Rückgängig</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="201"/>
+ <source>ME-EDIT-REDO</source>
+ <translation>Wiederherstellen</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="206"/>
+ <source>ME-EDIT-CUT</source>
+ <translation>Ausschneiden</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="211"/>
+ <source>ME-EDIT-COPY</source>
+ <translation>Kopieren</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="216"/>
+ <source>ME-EDIT-INSERT</source>
+ <translation>Einfügen</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="221"/>
+ <source>ME-EDIT-DELETE</source>
+ <translation>Löschen</translation>
+ </message>
+ <message>
+ <location filename="TextWindow.ui" line="226"/>
+ <source>ME-EDIT-SELALL</source>
+ <translation>Alles markieren</translation>
</message>
</context>
</TS>
glVertexPointer(3, GL_FLOAT, 0, _vertices.constData());
glEnableClientState(GL_VERTEX_ARRAY);
- for (quint32 i = 0; i < _vertices.count(); ++i)
+ for (qint32 i = 0; i < _vertices.count(); ++i)
glDrawArrays(GL_TRIANGLE_FAN, i * 4, 4);
}
}
_last_pos = event->pos();
}
-void GLWidget::mouseReleaseEvent(QMouseEvent *event)
+void GLWidget::mouseReleaseEvent(QMouseEvent * /*event*/)
{
emit sigClicked();
}
-#include <QDataStream>
#include "filesystem/NCFile.hxx"
/*
void NCFile::setOData(const QByteArray& data)
{
- _cdata = qCompress(data, 9).mid(sizeof (quint32));
+ _cdata = qCompress(data, 9).mid(sizeof (_csize));
}
QByteArray NCFile::oData() const
{
- QByteArray size;
- QDataStream stream(&size, QIODevice::WriteOnly);
+ // this is the only way it works, qCompress/qDecompress is broken!
+ QByteArray data(sizeof (_osize) + _cdata.size(), '\0');
- stream << _csize;
+ data.replace(sizeof (_osize),_csize, _cdata);
- return qUncompress(size + _cdata);
+ return qUncompress(data);
}
// --- status methods ---
void NCFilesystem::recalc(QVector<NCFile>& files)
{
- quint32 base_offset = 0;
+ quint32 base_offset = sizeof (id.VFS) + sizeof (quint32);
quint32 csize_offset = 0;
for (auto& f : files)
ofile.close();
- emit sigFileStatus(0, _files.count() - 1, ColType::None);
+ emit sigFileStatus(0, _files.count(), ColType::None);
return _files.count();
}