Commit a0fa36f8 authored by Tomas Mecir's avatar Tomas Mecir

More porting and getting it all to compile

parent 267c9d39
......@@ -130,4 +130,3 @@ void cButton::objectDisabled ()
((cButtonList *) list())->updateButtons();
}
#include "cbutton.moc"
......@@ -157,4 +157,3 @@ void cButtonEditor::getDataFromGUI (cListObjectData *data)
data->strValues["script-release"] = d->scriptrel->text();
}
#include "cbuttoneditor.moc"
......@@ -32,9 +32,9 @@ class cButtonEditor : public cListEditor {
cButtonEditor (QWidget *parent);
~cButtonEditor ();
virtual void createGUI(QWidget *parent);
virtual void fillGUI (const cListObjectData &data);
virtual void getDataFromGUI (cListObjectData *data);
virtual void createGUI(QWidget *parent) override;
virtual void fillGUI (const cListObjectData &data) override;
virtual void getDataFromGUI (cListObjectData *data) override;
protected:
struct Private;
Private *d;
......
......@@ -41,16 +41,16 @@ public:
~cButtonList ();
static cList *newList () { return new cButtonList; };
virtual cListObject *newObject ();
virtual QString objName () { return "Button"; }
virtual cListEditor *editor (QWidget *parent);
virtual cListObject *newObject () override;
virtual QString objName () override { return "Button"; }
virtual cListEditor *editor (QWidget *parent) override;
void updateButtons ();
private:
bool loaded;
friend class cButton;
virtual void listLoaded ();
virtual void listLoaded () override;
};
#endif //CBUTTONLIST_H
......@@ -24,8 +24,10 @@
#include <klocale.h>
#include <kapplication.h>
#include <kstandarddirs.h>
#include <qdatetime.h>
#include <qtimer.h>
#include <QDateTime>
#include <QPushButton>
#include <QTimer>
#include "kmuddy.h"
#include "ccmdprocessor.h"
......@@ -838,4 +840,3 @@ void cConnection::save ()
d->windowlist->save();
}
#include "cconnection.moc"
......@@ -54,11 +54,10 @@ public:
void sendCommands ();
int sentCommands ();
virtual void eventNothingHandler (QString event, int session);
virtual void eventStringHandler (QString event, int session,
QString &par1, const QString &);
virtual QString actionStringHandler (QString action, int session, QString &par1, const QString &);
virtual QString actionNothingHandler (QString action, int session);
virtual void eventNothingHandler (QString event, int session) override;
virtual void eventStringHandler (QString event, int session, QString &par1, const QString &) override;
virtual QString actionStringHandler (QString action, int session, QString &par1, const QString &) override;
virtual QString actionNothingHandler (QString action, int session) override;
public slots:
void showConnPrefsDialog ();
......
......@@ -62,4 +62,3 @@ void cGaugeBar::removeGauge (cGauge *g)
update ();
}
#include "cgaugebar.moc"
......@@ -129,5 +129,3 @@ QSize cGaugeBarItemPrivate::sizeHint () const {
return QSize (102, 16);
}
#include "cgaugebaritem.moc"
......@@ -125,4 +125,3 @@ void cGaugeEditor::getDataFromGUI (cListObjectData *data)
data->intValues["color"] = c.red() * 256 * 256 + c.green() * 256 + c.blue();
}
#include "cgaugeeditor.moc"
......@@ -32,9 +32,9 @@ class cGaugeEditor : public cListEditor {
cGaugeEditor (QWidget *parent);
~cGaugeEditor ();
virtual void createGUI(QWidget *parent);
virtual void fillGUI (const cListObjectData &data);
virtual void getDataFromGUI (cListObjectData *data);
virtual void createGUI(QWidget *parent) override;
virtual void fillGUI (const cListObjectData &data) override;
virtual void getDataFromGUI (cListObjectData *data) override;
protected:
struct Private;
Private *d;
......
......@@ -42,9 +42,9 @@ public:
~cGaugeList ();
static cList *newList () { return new cGaugeList; };
virtual cListObject *newObject ();
virtual QString objName () { return "Gauge"; }
virtual cListEditor *editor (QWidget *parent);
virtual cListObject *newObject () override;
virtual QString objName () override { return "Gauge"; }
virtual cListEditor *editor (QWidget *parent) override;
/** a gauge request, adds a new gauge, if there is no gauge already using the
same base variable */
......@@ -60,7 +60,7 @@ public:
Private *d;
friend class cGauge;
virtual void listLoaded ();
virtual void listLoaded () override;
void addGauge (cGauge *g);
void removeGauge (cGauge *g);
......
......@@ -26,21 +26,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "ccmdqueue.h"
#include "ccmdqueues.h"
#include <kglobalsettings.h>
#include <QKeyEvent>
#include <QFontDatabase>
//maximum number of lines ...
#define MAXLINES 10
cMultiInputLine::cMultiInputLine (int sess, QWidget *parent)
: Q3TextEdit(parent), cActionBase ("multiinputline", sess)
: QTextEdit(parent), cActionBase ("multiinputline", sess)
{
setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed);
setTextFormat (Qt::PlainText);
setWordWrap (Q3TextEdit::WidgetWidth);
setWrapPolicy (Q3TextEdit::AtWordOrDocumentBoundary);
setWrapMode (QTextOption::WrapAtWordBoundaryOrAnywhere);
//height: 2 lines
setLinesHeight (2);
......@@ -65,7 +64,7 @@ void cMultiInputLine::eventNothingHandler (QString event, int session)
if (event == "global-settings-changed") {
cGlobalSettings *gs = cGlobalSettings::self();
setFont (gs->getFont ("input-font"));
setMyFont (gs->getFont ("input-font"));
keepText (gs->getBool ("keep-text"));
selectKeptText (gs->getBool ("keep-text") ? gs->getBool ("select-kept") : false);
swapEnters (gs->getBool ("swap-enters"));
......@@ -87,16 +86,16 @@ void cMultiInputLine::initialize ()
setPalette (p);
//scroll-bars
setHScrollBarMode (Q3ScrollView::AlwaysOff);
setVScrollBarMode (Q3ScrollView::AlwaysOn);
setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOn);
//change font
setFont (KGlobalSettings::fixedFont ()); //default system fixed font
setMyFont (QFontDatabase::systemFont (QFontDatabase::FixedFont)); //default system fixed font
}
void cMultiInputLine::setFont (const QFont &font)
void cMultiInputLine::setMyFont (const QFont &font)
{
Q3TextEdit::setFont (font);
setCurrentFont (font);
setLinesHeight (_lines);
}
......@@ -165,10 +164,9 @@ void cMultiInputLine::keyPressEvent (QKeyEvent *e)
sendCommands ();
else
//standard behaviour otherwise
Q3TextEdit::keyPressEvent (e);
QTextEdit::keyPressEvent (e);
}
else
Q3TextEdit::keyPressEvent (e);
QTextEdit::keyPressEvent (e);
}
#include "cmultiinputline.moc"
......@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CMULTIINPUTLINE_H
#define CMULTIINPUTLINE_H
#include <q3textedit.h>
#include <QTextEdit>
#include "cactionbase.h"
......@@ -32,7 +32,7 @@ The multi-line input line. It can hold several lines, and can automatically expa
@author Tomas Mecir
*/
class cMultiInputLine : public Q3TextEdit, public cActionBase
class cMultiInputLine : public QTextEdit, public cActionBase
{
Q_OBJECT
public:
......@@ -54,7 +54,7 @@ public:
void setLinesHeight (int lines);
/** set the new font */
virtual void setFont (const QFont &font);
void setMyFont (const QFont &font);
signals:
void commandEntered (const QString &command);
......@@ -62,10 +62,10 @@ signals:
protected slots:
void updateHeight ();
protected:
virtual void eventNothingHandler (QString event, int session);
virtual void eventNothingHandler (QString event, int session) override;
void sendCommands ();
virtual void keyPressEvent (QKeyEvent *e);
virtual void keyPressEvent (QKeyEvent *e) override;
int _lines;
......
......@@ -91,4 +91,3 @@ void cMultiLineInput::setFont (QFont font)
if (multiline) multiline->setFont (font);
}
#include "cmultilineinput.moc"
......@@ -47,7 +47,7 @@ protected slots:
protected:
cMultiLineInput ();
void init ();
virtual void eventNothingHandler (QString event, int session);
virtual void eventNothingHandler (QString event, int session) override;
dlgMultiLine *multiline;
static cMultiLineInput *_self;
......
......@@ -93,5 +93,3 @@ void cMXPConsole::addWarning (int sess, const QString &text)
#endif //HAVE_MXP
}
#include "cmxpconsole.moc"
......@@ -390,4 +390,3 @@ void cMXPManager::reset ()
#endif //HAVE_MXP
}
#include "cmxpmanager.moc"
......@@ -51,9 +51,9 @@ public:
~cMXPManager ();
#ifdef HAVE_MXP
virtual void eventNothingHandler (QString event, int session);
virtual QString actionIntHandler (QString action, int session, int par1, int par2 = 0);
virtual QString actionNothingHandler (QString action, int session);
virtual void eventNothingHandler (QString event, int session) override;
virtual QString actionIntHandler (QString action, int session, int par1, int par2 = 0) override;
virtual QString actionNothingHandler (QString action, int session) override;
bool isMXPActive () { return mxpactive; };
void setMXPActive (bool active);
......
......@@ -59,5 +59,3 @@ cVariableList *cScriptAPI::varList ()
return dynamic_cast<cVariableList *>(am->object ("variables", sess()));
}
#include "cscriptapi.moc"
......@@ -49,7 +49,8 @@
#include <kpushbutton.h>
#include <kstatusbar.h>
#include <qtooltip.h>
#include <QPushButton>
#include <QToolTip>
cSession::cSession (int sess, QWidget *parent) :
KVBox (parent), cActionBase ("session", sess)
......@@ -81,8 +82,8 @@ cSession::cSession (int sess, QWidget *parent) :
_multiinputline->hide ();
_multiinputline->setToolTip (i18n ("Ctrl+Enter adds new line, unless changed in settings"));
KPushButton *switchlinebutton = new KPushButton (promptinput);
switchlinebutton->setIcon (KIcon ("format-justify-center"));
QPushButton *switchlinebutton = new QPushButton (promptinput);
switchlinebutton->setIcon (QIcon::fromTheme ("format-justify-center"));
switchlinebutton->setToolTip (i18n ("Switches between standard and multi-line input line."));
//the button should take as few space as possible
......@@ -208,4 +209,3 @@ void cSession::switchInputLines ()
}
}
#include "csession.moc"
......@@ -66,10 +66,9 @@ public:
void setAuxInput (bool val);
virtual QString actionNothingHandler (QString action, int session);
virtual void eventNothingHandler (QString event, int session);
virtual void eventStringHandler (QString event, int session,
QString &par1, const QString &par2);
virtual QString actionNothingHandler (QString action, int session) override;
virtual void eventNothingHandler (QString event, int session) override;
virtual void eventStringHandler (QString event, int session, QString &par1, const QString &par2) override;
protected slots:
/** switch between standard input and multi-line input */
void switchInputLines ();
......
......@@ -69,7 +69,7 @@ private:
/** constructor */
cSessionManager ();
void eventNothingHandler (QString event, int session);
void eventNothingHandler (QString event, int session) override;
enum ProfileIcon {
IconOk, IconNo, IconFlag
......
......@@ -29,13 +29,13 @@ class cShortcut : public cListObject {
public:
virtual ~cShortcut ();
virtual void attribChanged (const QString &name);
virtual void attribChanged (const QString &name) override;
virtual void updateVisibleName();
virtual void updateVisibleName() override;
#define SHORTCUT_MATCH 1
virtual cList::TraverseAction traverse (int traversalType);
virtual cList::TraverseAction traverse (int traversalType) override;
static QString keyToString (int _key, int _state);
private:
......
......@@ -158,4 +158,3 @@ void cShortcutEditor::grabKey ()
d->cmd->setFocus ();
}
#include "cshortcuteditor.moc"
......@@ -32,9 +32,9 @@ class cShortcutEditor : public cListEditor {
cShortcutEditor (QWidget *parent);
~cShortcutEditor ();
virtual void createGUI(QWidget *parent);
virtual void fillGUI (const cListObjectData &data);
virtual void getDataFromGUI (cListObjectData *data);
virtual void createGUI(QWidget *parent) override;
virtual void fillGUI (const cListObjectData &data) override;
virtual void getDataFromGUI (cListObjectData *data) override;
protected slots:
void grabKey ();
protected:
......
......@@ -32,9 +32,9 @@ public:
~cShortcutList ();
static cList *newList () { return new cShortcutList; };
virtual cListObject *newObject ();
virtual QString objName () { return "Macro key"; }
virtual cListEditor *editor (QWidget *parent);
virtual cListObject *newObject () override;
virtual QString objName () override { return "Macro key"; }
virtual cListEditor *editor (QWidget *parent) override;
/** this key was pressed - send a command if needed, returns true if
some shortcut matched the key */
......
......@@ -114,4 +114,3 @@ void cStatusVarEditor::getDataFromGUI (cListObjectData *data)
data->boolValues["percentage"] = d->chkpercent->isChecked();
}
#include "cstatusvareditor.moc"
......@@ -32,9 +32,9 @@ class cStatusVarEditor : public cListEditor {
cStatusVarEditor (QWidget *parent);
~cStatusVarEditor ();
virtual void createGUI(QWidget *parent);
virtual void fillGUI (const cListObjectData &data);
virtual void getDataFromGUI (cListObjectData *data);
virtual void createGUI(QWidget *parent) override;
virtual void fillGUI (const cListObjectData &data) override;
virtual void getDataFromGUI (cListObjectData *data) override;
protected:
struct Private;
Private *d;
......
......@@ -39,9 +39,9 @@ class cStatusVarList : public cList
~cStatusVarList ();
static cList *newList () { return new cStatusVarList; };
virtual cListObject *newObject ();
virtual QString objName () { return "Status variable"; }
virtual cListEditor *editor (QWidget *parent);
virtual cListObject *newObject () override;
virtual QString objName () override { return "Status variable"; }
virtual cListEditor *editor (QWidget *parent) override;
void variableChanged (const QString &varname);
private:
......@@ -49,7 +49,7 @@ class cStatusVarList : public cList
Private *d;
friend class cStatusVar;
virtual void listLoaded ();
virtual void listLoaded () override;
QString variableName () const;
......
......@@ -1104,4 +1104,3 @@ void cTelnet::setNegotiateOnStartup (bool startupneg)
d->_startupneg = startupneg;
}
#include "ctelnet.moc"
......@@ -25,6 +25,7 @@
#include <config-mxp.h>
#include "cactionbase.h"
#include <QObject>
struct cTelnetPrivate;
......@@ -222,8 +223,8 @@ protected slots:
void socketRead ();
void socketClosed ();
protected:
virtual void eventIntHandler (QString event, int session, int par1, int par2);
virtual void eventNothingHandler (QString event, int session);
virtual void eventIntHandler (QString event, int session, int par1, int par2) override;
virtual void eventNothingHandler (QString event, int session) override;
void reset ();
void setupSocketHandlers ();
......
......@@ -461,4 +461,3 @@ void cTextProcessor::timeout ()
receivedGA ();
}
#include "ctextprocessor.moc"
......@@ -57,9 +57,8 @@ public:
void setOutputWindow(QString winname) { wname = winname; };
virtual void eventStringHandler (QString event, int session, QString &par1,
const QString &);
virtual void eventNothingHandler (QString event, int session);
virtual void eventStringHandler (QString event, int session, QString &par1, const QString &) override;
virtual void eventNothingHandler (QString event, int session) override;
public slots:
// processing of various received items...
......
......@@ -37,12 +37,12 @@ protected:
friend class cTimerList;
cTimer (cList *list);
virtual void setEnabled (bool en = true);
virtual void setEnabled (bool en = true) override;
/** React on an attribute change by adjusting the visible name. */
virtual void attribChanged (const QString &name);
virtual void attribChanged (const QString &name) override;
virtual void updateVisibleName();
virtual void updateVisibleName() override;
#define TIMER_RESET 1
#define TIMER_TICK 2
......
......@@ -164,4 +164,3 @@ void cTimerEditor::getDataFromGUI (cListObjectData *data)
data->strValues["script"] = d->script->text();
}
#include "ctimereditor.moc"
......@@ -32,9 +32,9 @@ class cTimerEditor : public cListEditor {
cTimerEditor (QWidget *parent);
~cTimerEditor ();
virtual void createGUI(QWidget *parent);
virtual void fillGUI (const cListObjectData &data);
virtual void getDataFromGUI (cListObjectData *data);
virtual void createGUI(QWidget *parent) override;
virtual void fillGUI (const cListObjectData &data) override;
virtual void getDataFromGUI (cListObjectData *data) override;
protected:
struct Private;
Private *d;
......
......@@ -92,4 +92,3 @@ int cTimerList::tickCount ()
return d->tickCount;
}
#include "ctimerlist.moc"
......@@ -33,11 +33,11 @@ public:
~cTimerList ();
static cList *newList () { return new cTimerList; };
virtual cListObject *newObject ();
virtual QString objName () { return "Timer"; }
virtual cListEditor *editor (QWidget *parent);
virtual cListObject *newObject () override;
virtual QString objName () override { return "Timer"; }
virtual cListEditor *editor (QWidget *parent) override;
virtual void setEnabled (bool en = true);
virtual void setEnabled (bool en = true) override;
protected slots:
void timeout ();
protected:
......
This diff is collapsed.
......@@ -19,9 +19,8 @@
#ifndef CTRANSCRIPT_H
#define CTRANSCRIPT_H
#include <stdio.h>
#include <qobject.h>
#include <QObject>
#include <QFile>
#include "cactionbase.h"
......@@ -63,8 +62,8 @@ protected slots:
void applyTranscript ();
void doDumpBuffer ();
protected:
virtual void eventNothingHandler (QString event, int session);
virtual void eventChunkHandler (QString event, int session, cTextChunk *chunk);
virtual void eventNothingHandler (QString event, int session) override;
virtual void eventChunkHandler (QString event, int session, cTextChunk *chunk) override;
void startTranscript ();
......@@ -74,7 +73,7 @@ protected:
bool running, advrunning, rotatedaily;
bool overwrite, includedump;
bool includetimestamp;
FILE *file, *advfile;
QFile file, advfile;
QString fname, advfname, fileformat;
QTimer *transtimer;
......
......@@ -944,4 +944,3 @@ void cTriggerEditor::getDataFromGUI (cListObjectData *data)
}
#include "ctriggereditor.moc"
......@@ -31,9 +31,9 @@ class cTriggerEditor : public cListEditor {
cTriggerEditor (QWidget *parent);
~cTriggerEditor ();
virtual void createGUI(QWidget *parent);
virtual void fillGUI (const cListObjectData &data);
virtual void getDataFromGUI (cListObjectData *data);
virtual void createGUI(QWidget *parent) override;
virtual void fillGUI (const cListObjectData &data) override;
virtual void getDataFromGUI (cListObjectData *data) override;
protected slots:
void updateEditButton (const QString &comboText);
void editRegExp ();
......
......@@ -40,9 +40,9 @@ public:
~cTriggerList ();
static cList *newList () { return new cTriggerList; };
virtual cListObject *newObject ();
virtual QString objName () { return "Trigger"; }
virtual cListEditor *editor (QWidget *parent);
virtual cListObject *newObject () override;
virtual QString objName () override { return "Trigger"; }
virtual cListEditor *editor (QWidget *parent) override;
/** Sends these commands via cCmdProcessor. */
virtual void processCommands (const QStringList &commands);
......
......@@ -72,7 +72,7 @@ public:
protected:
void load ();
virtual void eventNothingHandler (QString event, int session);
virtual void eventNothingHandler (QString event, int session) override;
std::map<QString, dlgOutputWindow *> windows;
QStringList toerase;
......
......@@ -24,12 +24,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "cmudlist.h"
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QLabel>
#include <QSortFilterProxyModel>
#include <QSplitter>
#include <QTextDocument>
#include <QTreeView>
#include <klineedit.h>
#include <klocale.h>
#include <ktextbrowser.h>
......@@ -53,7 +55,6 @@ dlgMudList::dlgMudList (QWidget *parent) : QDialog (parent)
// initialize the dialog
setWindowTitle (i18n ("MUD Listing"));
setButtons (KDialog::Ok | KDialog::Cancel);
//create main dialog's widget
QVBoxLayout *mainLayout = new QVBoxLayout (this);
......@@ -75,9 +76,14 @@ dlgMudList::dlgMudList (QWidget *parent) : QDialog (parent)
QLabel *source = new QLabel ("The list is provided courtesy of <a href=\"http://www.mudconnector.com/\">The MUD Connector</a>.<br/>If you are unsure which game to pick, you may also want to check out <a href=\"http://www.topmudsites.com\">www.topmudsites.com</a>.", this);
source->setOpenExternalLinks (true);
source->setWordWrap (true);
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
connect (buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect (buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
mainLayout->addWidget (page);
mainLayout->addWidget (source);
mainLayout->addWidget (buttons);
d->view->setRootIsDecorated (false);
d->view->setItemsExpandable (false);
......
......@@ -29,16 +29,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "clistmanager.h"
#include "clistviewer.h"
#include <kaction.h>
#include <kactioncollection.h>
#include <klocale.h>
#include <ktoolbar.h>
#include <kdebug.h>
#include <QComboBox>
#include <QDialogButtonBox>
#include <QSplitter>
#include <QStackedWidget>
#include <QStandardItemModel>
#include <QVBoxLayout>
struct dlgObjects::Private
{
......@@ -51,7 +52,7 @@ struct dlgObjects::Private
QString currentList;
int currentSession;
KAction *aUp, *aDown, *aLeft, *aRight;
QAction *aUp, *aDown, *aLeft, *aRight;
};
dlgObjects::dlgObjects (QWidget *parent)
......@@ -61,12 +62,10 @@ dlgObjects::dlgObjects (QWidget *parent)