Changed: Fixed the 'QMetaObject' linking error and commented out most of the old code to be replaced.

This commit is contained in:
sfb 2011-06-11 08:48:16 -05:00
parent e8dd943258
commit ef1e4131f8
3 changed files with 69 additions and 63 deletions

View file

@ -10,7 +10,8 @@ SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.
${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h)
SET(OVQT_PLUG_MISSION_COMPILER_HDR mission_compiler_plugin.h SET(OVQT_PLUG_MISSION_COMPILER_HDR mission_compiler_plugin.h
mission_compiler_main_window.h) mission_compiler_main_window.h
mission_compiler_settings_page.h)
SET(OVQT_PLUG_MISSION_COMPILER_UIS mission_compiler_main_window.ui server_entry_dialog.ui mission_compiler_settings_page.ui) SET(OVQT_PLUG_MISSION_COMPILER_UIS mission_compiler_main_window.ui server_entry_dialog.ui mission_compiler_settings_page.ui)

View file

@ -20,6 +20,8 @@
#include "../core/core_constants.h" #include "../core/core_constants.h"
#include "../core/icore.h" #include "../core/icore.h"
#include "ui_server_entry_dialog.h"
// NeL includes // NeL includes
#include <nel/misc/path.h> #include <nel/misc/path.h>
@ -27,6 +29,7 @@
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
#include <QtGui/QTreeWidgetItem>
namespace Plugin namespace Plugin
{ {
@ -79,7 +82,7 @@ QWidget *MissionCompilerSettingsPage::createPage(QWidget *parent)
connect(m_ui.removeToolButton, SIGNAL(clicked()), this, SLOT(delPath())); connect(m_ui.removeToolButton, SIGNAL(clicked()), this, SLOT(delPath()));
connect(m_ui.upToolButton, SIGNAL(clicked()), this, SLOT(upPath())); connect(m_ui.upToolButton, SIGNAL(clicked()), this, SLOT(upPath()));
connect(m_ui.downToolButton, SIGNAL(clicked()), this, SLOT(downPath())); connect(m_ui.downToolButton, SIGNAL(clicked()), this, SLOT(downPath()));
connect(m_ui.resetToolButton, SIGNAL(clicked()), m_ui.serversTreeWidget, SLOT(clear())); //connect(m_ui.resetToolButton, SIGNAL(clicked()), m_ui.serversTreeWidget, SLOT(clear()));
return m_page; return m_page;
} }
@ -119,94 +122,96 @@ void MissionCompilerSettingsPage::applySearchPaths()
void MissionCompilerSettingsPage::addPath() void MissionCompilerSettingsPage::addPath()
{ {
QString newPath = QFileDialog::getExistingDirectory(m_page, "", lastDir); Ui::ServerEntryDialog serverEntryDialog;
if (!newPath.isEmpty())
{
QTreeWidgetItem *newItem = new QTreeWidgetItem;
newItem->setText(newPath);
newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
m_ui.serversTreeWidget->addItem(newItem);
lastDir = newPath;
}
checkEnabledButton(); //QString newPath = QFileDialog::getExistingDirectory(m_page, "", lastDir);
//if (!newPath.isEmpty())
//{
// QTreeWidgetItem *newItem = new QTreeWidgetItem;
// newItem->setText(newPath);
// newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
// m_ui.serversTreeWidget->addItem(newItem);
// lastDir = newPath;
//}
//checkEnabledButton();
} }
void MissionCompilerSettingsPage::delPath() void MissionCompilerSettingsPage::delPath()
{ {
QTreeWidgetItem *removeItem = m_ui.serversTreeWidget->takeItem(m_ui.serversTreeWidget->currentRow()); //QTreeWidgetItem *removeItem = m_ui.serversTreeWidget->takeItem(m_ui.serversTreeWidget->currentRow());
if (!removeItem) //if (!removeItem)
delete removeItem; // delete removeItem;
checkEnabledButton(); //checkEnabledButton();
} }
void MissionCompilerSettingsPage::upPath() void MissionCompilerSettingsPage::upPath()
{ {
int currentRow = m_ui.serversTreeWidget->currentRow(); //int currentRow = m_ui.serversTreeWidget->currentRow();
if (!(currentRow == 0)) //if (!(currentRow == 0))
{ //{
QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); // QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow);
m_ui.serversListWidget->insertItem(--currentRow, item); // m_ui.serversListWidget->insertItem(--currentRow, item);
m_ui.serversListWidget->setCurrentRow(currentRow); // m_ui.serversListWidget->setCurrentRow(currentRow);
} //}
} }
void MissionCompilerSettingsPage::downPath() void MissionCompilerSettingsPage::downPath()
{ {
int currentRow = m_ui.serversListWidget->currentRow(); //int currentRow = m_ui.serversListWidget->currentRow();
if (!(currentRow == m_ui.serversListWidget->count()-1)) //if (!(currentRow == m_ui.serversListWidget->count()-1))
{ //{
QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); // QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow);
m_ui.serversTreeWidget->insertItem(++currentRow, item); // m_ui.serversTreeWidget->insertItem(++currentRow, item);
m_ui.serversTreeWidget->setCurrentRow(currentRow); // m_ui.serversTreeWidget->setCurrentRow(currentRow);
} //}
} }
void MissionCompilerSettingsPage::readSettings() void MissionCompilerSettingsPage::readSettings()
{ {
QStringList paths; //QStringList paths;
QSettings *settings = Core::ICore::instance()->settings(); //QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::DATA_PATH_SECTION); //settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
if (m_recurse) //if (m_recurse)
paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); // paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList();
else //else
paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); // paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList();
settings->endGroup(); //settings->endGroup();
Q_FOREACH(QString path, paths) //Q_FOREACH(QString path, paths)
{ //{
QListWidgetItem *newItem = new QListWidgetItem; // QListWidgetItem *newItem = new QListWidgetItem;
newItem->setText(path); // newItem->setText(path);
newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); // newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
m_ui.serversTreeWidget->addItem(newItem); // m_ui.serversTreeWidget->addItem(newItem);
} //}
} }
void MissionCompilerSettingsPage::writeSettings() void MissionCompilerSettingsPage::writeSettings()
{ {
QStringList paths; //QStringList paths;
for (int i = 0; i < m_ui.serversTreeWidget->count(); ++i) //for (int i = 0; i < m_ui.serversTreeWidget->count(); ++i)
paths << m_ui.serversTreeWidget->item(i)->text(); // paths << m_ui.serversTreeWidget->item(i)->text();
QSettings *settings = Core::ICore::instance()->settings(); //QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup(Core::Constants::DATA_PATH_SECTION); //settings->beginGroup(Core::Constants::DATA_PATH_SECTION);
if (m_recurse) //if (m_recurse)
settings->setValue(Core::Constants::RECURSIVE_SEARCH_PATHS, paths); // settings->setValue(Core::Constants::RECURSIVE_SEARCH_PATHS, paths);
else //else
settings->setValue(Core::Constants::SEARCH_PATHS, paths); // settings->setValue(Core::Constants::SEARCH_PATHS, paths);
settings->endGroup(); //settings->endGroup();
settings->sync(); //settings->sync();
} }
void MissionCompilerSettingsPage::checkEnabledButton() void MissionCompilerSettingsPage::checkEnabledButton()
{ {
bool bEnabled = true; //bool bEnabled = true;
if (m_ui.serversTreeWidget->count() == 0) //if (m_ui.serversTreeWidget->count() == 0)
bEnabled = false; // bEnabled = false;
m_ui.removeToolButton->setEnabled(bEnabled); //m_ui.removeToolButton->setEnabled(bEnabled);
m_ui.upToolButton->setEnabled(bEnabled); //m_ui.upToolButton->setEnabled(bEnabled);
m_ui.downToolButton->setEnabled(bEnabled); //m_ui.downToolButton->setEnabled(bEnabled);
} }
} /* namespace Plugin */ } /* namespace Plugin */

View file

@ -183,7 +183,7 @@
</layout> </layout>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<spacer name="horizontalSpacer"> <spacer name="publishHorizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>