Qt4: put and get message history

This commit is contained in:
Pasi Kallinen
2017-10-10 22:55:30 +03:00
parent 4dff3a707e
commit 2fcf1ad139
6 changed files with 53 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ NetHackQtMessageWindow::NetHackQtMessageWindow() :
list->setFocusPolicy(Qt::NoFocus);
::iflags.window_inited = 1;
map = 0;
currgetmsg = 0;
connect(qt_settings,SIGNAL(fontChanged()),this,SLOT(updateFont()));
updateFont();
}
@@ -80,6 +81,20 @@ void NetHackQtMessageWindow::Display(bool block)
}
}
const char * NetHackQtMessageWindow::GetStr(bool init)
{
if (init)
currgetmsg = 0;
QListWidgetItem *item = list->item(++currgetmsg);
if (item) {
QString str = item->text();
//raw_printf("getstr[%i]='%s'", currgetmsg, str.toLatin1().constData());
return str.toLatin1().constData();
}
return NULL;
}
void NetHackQtMessageWindow::PutStr(int attr, const QString& text)
{
#ifdef USER_SOUNDS