From 583873818e41d832f1227b095cbe1f671c2614ec Mon Sep 17 00:00:00 2001 From: sfb Date: Wed, 20 Jul 2011 15:39:23 -0500 Subject: [PATCH] Update: Fixed a specific crash when only one server was checked and configured. Added mission publication. --- .../mission_compiler_main_window.cpp | 68 ++++++++++++++++--- .../mission_compiler_main_window.h | 1 + 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index 56cc791c7..bb4e783a7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -245,17 +245,63 @@ void MissionCompilerMainWindow::compileMission(bool publish) nbMission += mc.getMissionsCount(); // publish files to selected servers - //if (publish) - //for (uint i=0 ; isettings(); + settings->beginGroup(MISSION_COMPILER_SECTION); - // compileLog += toString("\r\nPublishing to %s ...\r\n", ServerName[i].c_str()); - // for (uint j=0 ; jvalue(SETTING_LOCAL_TEXT_PATH).toString(); + settings->endGroup(); + QStringList checkedServers; + for(int i = 0; ipublishServersList->count(); i++) + { + + // Retrieve each checked server. + QListWidgetItem *item = ui->publishServersList->item(i); + if(item->checkState() == Qt::Checked) + checkedServers << item->text(); + } + + Q_FOREACH(QString checkedServer, checkedServers) + { + m_compileLog.append("Processing publication configuration for '"+checkedServer+"'\n"); + QStringList items = settings->value(SETTING_SERVERS_TABLE_ITEMS).toStringList(); + int column = 0; + int row = 0; + QString servName; + QString primPath; + QString textPath; + Q_FOREACH(QString var, items) + { + // Check to see if we're starting a new row. + if(column > 2) + { + column = 0; + row++; + } + if(column == 0) + servName = var; + else if(column == 1) + textPath = var; + else if(column == 2) + { + primPath = var; + + m_compileLog.append("Publishing to "+servName+" ...\n"); + for (uint j=0 ; j items = ui->publishServersList->findItems(server, Qt::MatchExactly); + if(items.size() != 1) + continue; items.at(0)->setCheckState(Qt::Checked); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h index 1451b2613..1dffea313 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h @@ -59,6 +59,7 @@ private: void moveSelectedItem(const QModelIndex &index, QStringListModel *from, QStringListModel *to); void applyCheckboxes(const QStringList &servers); + QMenu *_toolModeMenu; QUndoStack *m_undoStack; QStringListModel *m_allPrimitivesModel;