Often, the yn_function "choices" parameter is not set, so for a non-keyboard
GUI (compact mode is for handheld computers with a stylus), the windowport
has to parse the prompt to find out the posible input choices. I got the
parsing wrong.
QString enable;
if ( qt_compact_mode && !choices ) {
// expand choices from prompt
+ // ##### why isn't choices set properly???
const char* c=question;
while ( *c && *c != '[' )
c++;
ch.append(*c++);
char from=0;
while ( *c && *c != ']' && *c != ' ' ) {
- if ( *c == '-' )
+ if ( *c == '-' ) {
from = c[-1];
- else if ( from )
- for (char f=from; f<=*c; f++)
+ } else if ( from ) {
+ for (char f=from+1; f<=*c; f++)
ch.append(f);
- else
+ from = 0;
+ } else {
ch.append(*c);
+ from = 0;
+ }
c++;
}
if ( *c == ' ' ) {
int NetHackQtSavedGameSelector::choose()
{
+#if defined(QWS) // probably safe with Qt 3, too (where show!=exec in QDialog).
if ( qt_compact_mode )
showMaximized();
+#endif
return exec()-2;
}