createserverdialogapi.cpp
1 //------------------------------------------------------------------------------
2 // createserverdialogapi.cpp
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301, USA.
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2014 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #include "createserverdialogapi.h"
24 
25 #include "gui/createserverdialog.h"
26 #include <QPointer>
27 #include <cassert>
28 
29 DClass<CreateServerDialogApi>
30 {
31 public:
32  QPointer<CreateServerDialog> dialog;
33 };
34 
35 DPointered(CreateServerDialogApi)
36 
38 {
39  d->dialog = new CreateServerDialog(parent);
40 }
41 
42 CreateServerDialogApi::~CreateServerDialogApi()
43 {
44  if (d->dialog)
45  {
46  delete d->dialog;
47  }
48 }
49 
51 {
53  return api;
54 }
55 
57 {
58  return d->dialog;
59 }
60 
61 bool CreateServerDialogApi::fillInCommandLineArguments(QString &executable, QStringList &args)
62 {
63  assert(d->dialog);
64  return d->dialog->commandLineArguments(executable, args);
65 }
66 
68 {
69  assert(d->dialog);
70  d->dialog->makeRemoteGameSetupDialog(plugin);
71 }
72 
73 void CreateServerDialogApi::setIwadByName(const QString &iwad)
74 {
75  assert(d->dialog);
76  d->dialog->setIwadByName(iwad);
77 }
bool fillInCommandLineArguments(QString &executable, QStringList &args)
When QDialog is closed with 'accepted' state, this method will build appropriate command line...
static CreateServerDialogApi * createNew(QWidget *parent)
Constructs a new CreateServerDialog that is deleted when the API object is deleted.
Plugin proxy for CreateServerDialog.
void makeRemoteGameSetup(const EnginePlugin *plugin)
Configures the dialog box for a setup of a remote game.
Dialog window allowing user to host a game.
QDialog * dialog() const
Accesses underlying CreateServerDialog as a QDialog.
void setIwadByName(const QString &iwad)
Attempt to chose default IWAD by name.