Changed: Implementing server list in settings page. Added dialog for editing/adding entries. Can add, remove and edit entries. Still need to implement read/write settings and provide a method to connect the table to the publishing options table.
--HG-- branch : branch-mission-compiler-qthg/feature/gsoc2012-fabien
parent
c41a312a86
commit
c83fd1832b
@ -0,0 +1,89 @@
|
||||
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// Project includes
|
||||
#include "server_entry_dialog.h"
|
||||
|
||||
#include "ui_server_entry_dialog.h"
|
||||
|
||||
// NeL includes
|
||||
|
||||
// Qt includes
|
||||
#include <QFileDialog>
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
|
||||
ServerEntryDialog::ServerEntryDialog(QWidget *parent)
|
||||
: QDialog(parent),
|
||||
m_ui(new Ui::ServerEntryDialog)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
connect(m_ui->serverTextPathButton, SIGNAL(clicked()), this, SLOT(lookupTextPath()));
|
||||
connect(m_ui->serverPrimPathButton, SIGNAL(clicked()), this, SLOT(lookupPrimPath()));
|
||||
}
|
||||
|
||||
ServerEntryDialog::~ServerEntryDialog()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
QString ServerEntryDialog::getServerName()
|
||||
{
|
||||
return m_ui->serverNameEdit->text();
|
||||
}
|
||||
|
||||
QString ServerEntryDialog::getTextPath()
|
||||
{
|
||||
return m_ui->serverTextPathEdit->text();
|
||||
}
|
||||
|
||||
QString ServerEntryDialog::getPrimPath()
|
||||
{
|
||||
return m_ui->serverPrimPathEdit->text();
|
||||
}
|
||||
|
||||
void ServerEntryDialog::setServerName(QString name)
|
||||
{
|
||||
m_ui->serverNameEdit->setText(name);
|
||||
}
|
||||
|
||||
void ServerEntryDialog::setTextPath(QString path)
|
||||
{
|
||||
m_ui->serverTextPathEdit->setText(path);
|
||||
}
|
||||
|
||||
void ServerEntryDialog::setPrimPath(QString path)
|
||||
{
|
||||
m_ui->serverPrimPathEdit->setText(path);
|
||||
}
|
||||
|
||||
void ServerEntryDialog::lookupTextPath()
|
||||
{
|
||||
QString curPath = m_ui->serverTextPathEdit->text();
|
||||
QString path = QFileDialog::getExistingDirectory(this, "", curPath);
|
||||
m_ui->serverTextPathEdit->setText(path);
|
||||
}
|
||||
|
||||
void ServerEntryDialog::lookupPrimPath()
|
||||
{
|
||||
QString curPath = m_ui->serverPrimPathEdit->text();
|
||||
QString path = QFileDialog::getExistingDirectory(this, "", curPath);
|
||||
m_ui->serverPrimPathEdit->setText(path);
|
||||
}
|
||||
} /* namespace Plugin */
|
@ -0,0 +1,59 @@
|
||||
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||||
// Copyright (C) 2010 Winch Gate Property Limited
|
||||
// Copyright (C) 2011 Dzmitry Kamiahin <dnk-88@tut.by>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#ifndef SERVER_ENTRY_DIALOG_H
|
||||
#define SERVER_ENTRY_DIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class ServerEntryDialog;
|
||||
}
|
||||
|
||||
namespace Plugin
|
||||
{
|
||||
/**
|
||||
@class ServerEntryDialog
|
||||
*/
|
||||
class ServerEntryDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ServerEntryDialog(QWidget *parent = 0);
|
||||
~ServerEntryDialog();
|
||||
|
||||
QString getServerName();
|
||||
QString getTextPath();
|
||||
QString getPrimPath();
|
||||
|
||||
void setServerName(QString name);
|
||||
void setTextPath(QString path);
|
||||
void setPrimPath(QString path);
|
||||
|
||||
public Q_SLOTS:
|
||||
void lookupTextPath();
|
||||
void lookupPrimPath();
|
||||
|
||||
private:
|
||||
Ui::ServerEntryDialog *m_ui;
|
||||
};
|
||||
|
||||
} // namespace Plugin
|
||||
|
||||
#endif // SERVER_ENTRY_DIALOG_H
|
Loading…
Reference in New Issue