Qt4: put and get message history
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user