mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-23 09:28:45 +00:00
Changed: #1307 Making some little modifcations in code. Open now saves the last directory
This commit is contained in:
parent
3825c9f553
commit
367719529b
5 changed files with 134 additions and 225 deletions
|
@ -75,29 +75,6 @@ void CEditorPhrase::newUndoCommandAdded()
|
|||
current_stack->push(new CUndoPhraseNewCommand(text_edit));
|
||||
}
|
||||
|
||||
/* void CTextEdit::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
QString chars = event->text();
|
||||
int index = textCursor().position();
|
||||
|
||||
switch(event->key())
|
||||
{
|
||||
case Qt::Key_Backspace:
|
||||
if (index > 0)
|
||||
m_undoStack->push(new CUndoPhraseRemoveCommand(index--, 1, this));
|
||||
break;
|
||||
case Qt::Key_Delete:
|
||||
if (index < toPlainText().length())
|
||||
m_undoStack->push(new CUndoPhraseRemoveCommand(index, 1, this));
|
||||
break;
|
||||
default:
|
||||
if (!chars.isEmpty())
|
||||
m_undoStack->push(new CUndoPhraseInsertCommand(index, chars, this));
|
||||
break;
|
||||
}
|
||||
|
||||
} */
|
||||
|
||||
void CEditorPhrase::docContentsChanged()
|
||||
{
|
||||
setWindowModified(true);
|
||||
|
@ -110,13 +87,7 @@ void CEditorPhrase::activateWindow()
|
|||
|
||||
void CEditorPhrase::save()
|
||||
{
|
||||
QFile file(current_file);
|
||||
file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
QTextStream out(&file);
|
||||
out.setCodec("UTF-8");
|
||||
out.setGenerateByteOrderMark(true);
|
||||
out<<text_edit->toPlainText();
|
||||
setCurrentFile(current_file);
|
||||
saveAs(current_file);
|
||||
}
|
||||
|
||||
void CEditorPhrase::saveAs(QString filename)
|
||||
|
|
|
@ -34,8 +34,6 @@ using namespace std;
|
|||
|
||||
namespace TranslationManager {
|
||||
|
||||
|
||||
|
||||
void CEditorWorksheet::open(QString filename)
|
||||
{
|
||||
STRING_MANAGER::TWorksheet wk_file;
|
||||
|
@ -134,54 +132,7 @@ void CEditorWorksheet::activateWindow()
|
|||
|
||||
void CEditorWorksheet::save()
|
||||
{
|
||||
STRING_MANAGER::TWorksheet wk_file;
|
||||
loadExcelSheet(current_file.toStdString(), wk_file, true);
|
||||
uint rowIdx;
|
||||
uint colIdx = 0;
|
||||
bool hasHashValue = false;
|
||||
if(wk_file.getData(0, 0) == ucstring("*HASH_VALUE"))
|
||||
{
|
||||
hasHashValue = true;
|
||||
colIdx = 1;
|
||||
}
|
||||
for(int i = 0; i < table_editor->rowCount(); i++)
|
||||
{
|
||||
// maybe extra rows ?
|
||||
if((unsigned)table_editor->rowCount() > (wk_file.size() - 1))
|
||||
{
|
||||
rowIdx = wk_file.size();
|
||||
wk_file.resize(rowIdx + table_editor->rowCount() - wk_file.size() + 1);
|
||||
}
|
||||
for(int j = 0; j < table_editor->columnCount(); j++)
|
||||
{
|
||||
ucstring tvalue;
|
||||
ucstring colname;
|
||||
uint rowIdf;
|
||||
QString tvalueQt = table_editor->item(i, j)->text();
|
||||
tvalue.fromUtf8(std::string(tvalueQt.toUtf8()));
|
||||
colname = wk_file.getData(0, j + colIdx);
|
||||
|
||||
rowIdf = uint(i + 1);
|
||||
if(wk_file.findRow(j + colIdx, colname, rowIdf)) // search for the row
|
||||
{
|
||||
if(wk_file.getData(i + 1, j + colIdx) != tvalue) // verify the current value
|
||||
{
|
||||
wk_file.setData(i + 1, j + colIdx, tvalue); // change the value
|
||||
}
|
||||
} else {
|
||||
wk_file.setData(i + 1, j + colIdx, tvalue); // insert the value
|
||||
}
|
||||
}
|
||||
}
|
||||
if(hasHashValue)
|
||||
{
|
||||
// rewrite the hash codes
|
||||
makeHashCode(wk_file, true);
|
||||
}
|
||||
// write to file
|
||||
ucstring s = prepareExcelSheet(wk_file);
|
||||
NLMISC::CI18N::writeTextFile(current_file.toStdString(), s, false);
|
||||
setCurrentFile(current_file);
|
||||
saveAs(current_file);
|
||||
}
|
||||
|
||||
void CEditorWorksheet::saveAs(QString filename)
|
||||
|
@ -238,8 +189,8 @@ void CEditorWorksheet::deleteRow()
|
|||
{
|
||||
int selected_row = table_editor->currentRow();
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText("The row will be deleted.");
|
||||
msgBox.setInformativeText("Do you want to delete the selected row ?");
|
||||
msgBox.setText(tr("The row will be deleted."));
|
||||
msgBox.setInformativeText(tr("Do you want to delete the selected row ?"));
|
||||
msgBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
|
||||
msgBox.setDefaultButton(QMessageBox::No);
|
||||
int ret = msgBox.exec();
|
||||
|
@ -286,30 +237,15 @@ void CEditorWorksheet::extractBotNames(list<string> filters, string level_design
|
|||
|
||||
for (; it != last; ++it)
|
||||
{
|
||||
QList<QTableWidgetItem*> search_results = table_editor->findItems(tr(it->first.c_str()), Qt::MatchExactly);
|
||||
QList<QTableWidgetItem*> search_results = table_editor->findItems(QString(it->first.c_str()), Qt::MatchExactly);
|
||||
if(search_results.size() == 0)
|
||||
{
|
||||
const int currentRow = table_editor->rowCount();
|
||||
table_editor->setRowCount(currentRow + 1);
|
||||
QTableWidgetItem *bot_name_row = new QTableWidgetItem();
|
||||
bot_name_row->setText(tr(it->first.c_str()));
|
||||
bot_name_row->setBackgroundColor(QColor("#F75D59"));
|
||||
table_editor ->setItem(currentRow, 0, bot_name_row);
|
||||
QTableWidgetItem *translation_name_row = new QTableWidgetItem();
|
||||
translation_name_row->setBackgroundColor(QColor("#F75D59"));
|
||||
translation_name_row->setText(tr(it->first.c_str()));
|
||||
table_editor ->setItem(currentRow , 1, translation_name_row);
|
||||
QTableWidgetItem *sheet_name_row = new QTableWidgetItem();
|
||||
sheet_name_row->setText(tr(it->second.SheetName.c_str()));
|
||||
sheet_name_row->setBackgroundColor(QColor("#F75D59"));
|
||||
table_editor ->setItem(currentRow, 2, sheet_name_row);
|
||||
if(!modified) modified = true;
|
||||
CTableWidgetItemStore bot_name_row_s(bot_name_row, currentRow, 0);
|
||||
new_items.push_back(bot_name_row_s);
|
||||
CTableWidgetItemStore translation_name_row_s(translation_name_row, currentRow, 1);
|
||||
new_items.push_back(translation_name_row_s);
|
||||
CTableWidgetItemStore sheet_name_row_s(sheet_name_row, currentRow, 2);
|
||||
new_items.push_back(sheet_name_row_s);
|
||||
QList<QString> records;
|
||||
records.push_back(tr(it->first.c_str()));
|
||||
records.push_back(tr(it->first.c_str()));
|
||||
records.push_back(tr(it->second.SheetName.c_str()));
|
||||
insertTableRecords(records, new_items);
|
||||
if(!modified) modified = true;
|
||||
}
|
||||
}
|
||||
ebn.cleanSimpleNames();
|
||||
|
@ -321,30 +257,15 @@ void CEditorWorksheet::extractBotNames(list<string> filters, string level_design
|
|||
for (; it != last; ++it)
|
||||
{
|
||||
string gnName = "gn_" + ebn.cleanupName(*it);
|
||||
QList<QTableWidgetItem*> search_results = table_editor->findItems(tr((*it).c_str()), Qt::MatchExactly);
|
||||
QList<QTableWidgetItem*> search_results = table_editor->findItems(QString((*it).c_str()), Qt::MatchExactly);
|
||||
if(search_results.size() == 0)
|
||||
{
|
||||
const int currentRow = table_editor->rowCount();
|
||||
table_editor->setRowCount(currentRow + 1);
|
||||
QTableWidgetItem *bot_name_row = new QTableWidgetItem();
|
||||
bot_name_row->setText(tr((*it).c_str()));
|
||||
bot_name_row->setBackgroundColor(QColor("#F75D59"));
|
||||
table_editor ->setItem(currentRow, 0, bot_name_row);
|
||||
QTableWidgetItem *translation_name_row = new QTableWidgetItem();
|
||||
translation_name_row->setBackgroundColor(QColor("#F75D59"));
|
||||
translation_name_row->setText(tr(gnName.c_str()));
|
||||
table_editor ->setItem(currentRow , 1, translation_name_row);
|
||||
QTableWidgetItem *sheet_name_row = new QTableWidgetItem();
|
||||
sheet_name_row->setText(" ");
|
||||
sheet_name_row->setBackgroundColor(QColor("#F75D59"));
|
||||
table_editor ->setItem(currentRow, 2, sheet_name_row);
|
||||
QList<QString> records;
|
||||
records.push_back(tr((*it).c_str()));
|
||||
records.push_back(tr(gnName.c_str()));
|
||||
records.push_back(" ");
|
||||
insertTableRecords(records, new_items);
|
||||
if(!modified) modified = true;
|
||||
CTableWidgetItemStore bot_name_row_s(bot_name_row, currentRow, 0);
|
||||
new_items.push_back(bot_name_row_s);
|
||||
CTableWidgetItemStore translation_name_row_s(translation_name_row, currentRow, 1);
|
||||
new_items.push_back(translation_name_row_s);
|
||||
CTableWidgetItemStore sheet_name_row_s(sheet_name_row, currentRow, 2);
|
||||
new_items.push_back(sheet_name_row_s);
|
||||
}
|
||||
}
|
||||
ebn.cleanGenericNames();
|
||||
|
@ -399,8 +320,7 @@ void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordLis
|
|||
string keyName = allWords[i];
|
||||
QList<QTableWidgetItem*> search_results = table_editor->findItems(tr(keyName.c_str()), Qt::MatchExactly);
|
||||
if(search_results.size() == 0)
|
||||
{
|
||||
|
||||
{
|
||||
int knPos = 0, nPos = 0;
|
||||
if(workSheet.getData(0, 0) == ucstring("*HASH_VALUE"))
|
||||
{
|
||||
|
@ -409,25 +329,13 @@ void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordLis
|
|||
} else {
|
||||
knPos = keyColIndex;
|
||||
nPos = nameColIndex;
|
||||
}
|
||||
const int currentRow = table_editor->rowCount();
|
||||
table_editor->setRowCount(currentRow + 1);
|
||||
// keyName row
|
||||
QTableWidgetItem *key_name_row = new QTableWidgetItem();
|
||||
key_name_row->setText(tr(keyName.c_str()));
|
||||
key_name_row->setBackgroundColor(QColor("#F75D59"));
|
||||
table_editor ->setItem(currentRow, knPos, key_name_row);
|
||||
// nameColumn key
|
||||
QTableWidgetItem *name_row = new QTableWidgetItem();
|
||||
name_row->setText(QString("<GEN>") + tr(keyName.c_str()));
|
||||
name_row->setBackgroundColor(QColor("#F75D59"));
|
||||
table_editor ->setItem(currentRow, nPos, name_row);
|
||||
if(!modified) modified = true;
|
||||
CTableWidgetItemStore key_name_row_s(key_name_row, currentRow, knPos);
|
||||
new_items.push_back(key_name_row_s);
|
||||
CTableWidgetItemStore name_row_s(name_row, currentRow, nPos);
|
||||
new_items.push_back(name_row_s);
|
||||
}
|
||||
|
||||
QList<QString> records;
|
||||
records.push_back(tr(keyName.c_str()));
|
||||
records.push_back(QString("<GEN>") + tr(keyName.c_str()));
|
||||
insertTableRecords(records, new_items);
|
||||
if(!modified) modified = true;
|
||||
}
|
||||
}
|
||||
current_stack->push(new CUndoWorksheetExtraction(new_items, table_editor));
|
||||
|
@ -438,6 +346,23 @@ void CEditorWorksheet::extractWords(QString filename, QString columnId, IWordLis
|
|||
}
|
||||
}
|
||||
|
||||
void CEditorWorksheet::insertTableRecords(QList<QString> records, QList<CTableWidgetItemStore> new_items)
|
||||
{
|
||||
const int currentRow = table_editor->rowCount();
|
||||
table_editor->setRowCount(currentRow + 1);
|
||||
int n = 0;
|
||||
Q_FOREACH(QString record, records)
|
||||
{
|
||||
QTableWidgetItem *rec = new QTableWidgetItem();
|
||||
rec->setBackgroundColor(QColor("#F75D59"));
|
||||
table_editor ->setItem(currentRow, n, rec);
|
||||
CTableWidgetItemStore rec_s(rec, currentRow, n);
|
||||
new_items.push_back(rec_s);
|
||||
n++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool CEditorWorksheet::compareWorksheetFile(QString filename)
|
||||
{
|
||||
STRING_MANAGER::TWorksheet wk_file;
|
||||
|
@ -503,7 +428,7 @@ void CEditorWorksheet::mergeWorksheetFile(QString filename)
|
|||
}
|
||||
} else {
|
||||
QErrorMessage error;
|
||||
error.showMessage("This file is not a worksheet file.");
|
||||
error.showMessage(tr("This file is not a worksheet file."));
|
||||
error.exec();
|
||||
}
|
||||
}
|
||||
|
@ -513,8 +438,8 @@ void CEditorWorksheet::closeEvent(QCloseEvent *event)
|
|||
if(isWindowModified())
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText("The document has been modified.");
|
||||
msgBox.setInformativeText("Do you want to save your changes?");
|
||||
msgBox.setText(tr("The document has been modified."));
|
||||
msgBox.setInformativeText(tr("Do you want to save your changes?"));
|
||||
msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
||||
msgBox.setDefaultButton(QMessageBox::Save);
|
||||
int ret = msgBox.exec();
|
||||
|
|
|
@ -40,6 +40,18 @@
|
|||
|
||||
namespace TranslationManager {
|
||||
|
||||
struct CTableWidgetItemStore
|
||||
{
|
||||
public:
|
||||
CTableWidgetItemStore(QTableWidgetItem *item, int row, int column) :
|
||||
m_item(item),
|
||||
m_row(row),
|
||||
m_column(column) { }
|
||||
QTableWidgetItem *m_item;
|
||||
int m_row;
|
||||
int m_column;
|
||||
};
|
||||
|
||||
class CEditorWorksheet : public CEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -57,6 +69,7 @@ public:
|
|||
bool compareWorksheetFile(QString filename);
|
||||
void extractBotNames(list<string> filters, string level_design_path, NLLIGO::CLigoConfig ligoConfig);
|
||||
void extractWords(QString filename, QString columnId, IWordListBuilder &wordListBuilder);
|
||||
void insertTableRecords(QList<QString> records, QList<CTableWidgetItemStore> new_items);
|
||||
bool isBotNamesTable();
|
||||
bool isSheetTable(QString type);
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
@ -69,18 +82,6 @@ private Q_SLOTS:
|
|||
|
||||
};
|
||||
|
||||
struct CTableWidgetItemStore
|
||||
{
|
||||
public:
|
||||
CTableWidgetItemStore(QTableWidgetItem *item, int row, int column) :
|
||||
m_item(item),
|
||||
m_row(row),
|
||||
m_column(column) { }
|
||||
QTableWidgetItem *m_item;
|
||||
int m_row;
|
||||
int m_column;
|
||||
};
|
||||
|
||||
class CUndoWorksheetCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>388</width>
|
||||
<width>446</width>
|
||||
<height>560</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>371</width>
|
||||
<width>421</width>
|
||||
<height>541</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -29,9 +29,9 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>130</y>
|
||||
<width>351</width>
|
||||
<height>361</height>
|
||||
<y>110</y>
|
||||
<width>401</width>
|
||||
<height>381</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
|
@ -55,7 +55,7 @@
|
|||
<rect>
|
||||
<x>10</x>
|
||||
<y>40</y>
|
||||
<width>331</width>
|
||||
<width>381</width>
|
||||
<height>311</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -69,49 +69,9 @@
|
|||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>11</x>
|
||||
<y>29</y>
|
||||
<width>351</width>
|
||||
<height>101</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Ftp server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="url"/>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QPushButton" name="connectButton">
|
||||
<property name="text">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="cdToParrent">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="ftp_selection.qrc">
|
||||
<normaloff>:/translationManager/images/cdtoparent.png</normaloff>:/translationManager/images/cdtoparent.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<x>10</x>
|
||||
<y>500</y>
|
||||
<width>371</width>
|
||||
<width>401</width>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -132,6 +92,46 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>20</y>
|
||||
<width>411</width>
|
||||
<height>81</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Ftp server</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="url"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="cdToParrent">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="ftp_selection.qrc">
|
||||
<normaloff>:/translationManager/images/cdtoparent.png</normaloff>:/translationManager/images/cdtoparent.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QPushButton" name="connectButton">
|
||||
<property name="text">
|
||||
<string>Connect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources>
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QEvent>
|
||||
#include <QtGui/QCloseEvent>
|
||||
#include <QtGui/qfont.h>
|
||||
// Plugin includes
|
||||
#include "translation_manager_main_window.h"
|
||||
#include "translation_manager_constants.h"
|
||||
|
@ -70,7 +69,7 @@ CMainWindow::CMainWindow(QWidget *parent)
|
|||
void CMainWindow::createToolbar()
|
||||
{
|
||||
// File menu
|
||||
openAct = new QAction(QIcon(Core::Constants::ICON_OPEN), "&Open...", this);
|
||||
openAct = new QAction(QIcon(Core::Constants::ICON_OPEN), "&Open file(s)...", this);
|
||||
_ui.toolBar->addAction(openAct);
|
||||
connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
|
||||
saveAct = new QAction(QIcon(Core::Constants::ICON_SAVE), "&Save...", this);
|
||||
|
@ -147,11 +146,11 @@ void CMainWindow::updateToolbar(QMdiSubWindow *window)
|
|||
if(QString(window->widget()->metaObject()->className()) == "QTableWidget") // Sheet Editor
|
||||
{
|
||||
//setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
QAction *insertRowAct = new QAction("Insert new row", this);
|
||||
QAction *insertRowAct = new QAction(tr("Insert new row"), this);
|
||||
connect(insertRowAct, SIGNAL(triggered()), window, SLOT(insertRow()));
|
||||
//addAction(insertRowAct);
|
||||
windowMenu->addAction(insertRowAct);
|
||||
QAction *deleteRowAct = new QAction("Delete row", this);
|
||||
QAction *deleteRowAct = new QAction(tr("Delete row"), this);
|
||||
connect(deleteRowAct, SIGNAL(triggered()), window, SLOT(deleteRow()));
|
||||
//addAction(deleteRowAct);
|
||||
windowMenu->addAction(deleteRowAct);
|
||||
|
@ -202,7 +201,14 @@ void CMainWindow::updateWindowsList()
|
|||
|
||||
void CMainWindow::open()
|
||||
{
|
||||
QString file_name = QFileDialog::getOpenFileName(this);
|
||||
QSettings *settings = Core::ICore::instance()->settings();
|
||||
settings->beginGroup("translationmanager");
|
||||
QString lastOpenLocation = settings->value("lastOpenLocation").toString();
|
||||
QString file_name = QFileDialog::getOpenFileName(this, tr("Open translation file"), lastOpenLocation, tr("Translation files (*txt)"));
|
||||
QFileInfo* file_info = new QFileInfo(file_name);
|
||||
settings->setValue("lastOpenLocation", file_info->absolutePath());
|
||||
settings->endGroup();
|
||||
|
||||
if(!file_name.isEmpty())
|
||||
{
|
||||
CEditor *editor = getEditorByWindowFilePath(file_name);
|
||||
|
@ -303,14 +309,22 @@ void CMainWindow::initializeSettings(bool georges = false)
|
|||
|
||||
if(initialize_settings["ligo"] == false)
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// init ligo config
|
||||
string ligoPath = CPath::lookup("world_editor_classes.xml", true, true);
|
||||
ligoConfig.readPrimitiveClass(ligoPath.c_str(), false);
|
||||
NLLIGO::Register();
|
||||
NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &ligoConfig;
|
||||
initialize_settings["ligo"] = true;
|
||||
try
|
||||
{
|
||||
// Search path of file world_editor_classes.xml
|
||||
std::string ligoPath = NLMISC::CPath::lookup("world_editor_classes.xml");
|
||||
// Init LIGO
|
||||
ligoConfig.readPrimitiveClass(ligoPath.c_str(), true);
|
||||
NLLIGO::Register();
|
||||
NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &ligoConfig;
|
||||
initialize_settings["ligo"] = true;
|
||||
}
|
||||
catch (NLMISC::Exception &e)
|
||||
{
|
||||
nlerror("Can't found path to world_editor_classes.xml");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CMainWindow::extractWords(QString typeq)
|
||||
|
@ -510,7 +524,7 @@ bool CMainWindow::verifySettings()
|
|||
if(level_design_path.isNull() || primitives_path.isNull() || work_path.isNull())
|
||||
{
|
||||
QErrorMessage error_settings;
|
||||
error_settings.showMessage("Please write all the paths on the settings dialog.");
|
||||
error_settings.showMessage(tr("Please write all the paths on the settings dialog."));
|
||||
error_settings.exec();
|
||||
count_errors = true;
|
||||
}
|
||||
|
@ -574,11 +588,9 @@ bool CMainWindow::isWorksheetEditor(QString filename)
|
|||
{
|
||||
if(wk_file.ColCount > 1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CMainWindow::isPhraseEditor(QString filename)
|
||||
|
|
Loading…
Reference in a new issue