bool SimApp::listViewPreferred(const QSimCommand& cmd) { if (!cmd.softKeysPreferred()) return true; // reserve one key for back button if ((QSoftMenuBar::keys().count() - 1) >= cmd.menuItems().count()) return false; else return true; }
void SimApp::cmdMenu(const QSimCommand &cmd) { if (!simToolkitAvailable) { // First time that we have seen the toolkit menu, so this // SIM obviously has a SIM toolkit application on it. simToolkitAvailable = true; mainMenuTitle = cmd.title(); updateValueSpace(); } // Create QSimIconReader if the menu contains them. QList<QSimMenuItem> items = cmd.menuItems(); QList<QSimMenuItem>::ConstIterator it; bool needIcon = false; for (it = items.begin(); it != items.end(); ++it) { if ( (int)(*it).iconId() ) { needIcon = true; if ( !iconReader ) createIconReader(); else break; } } // Create the menu widgetry. SimMenu *menu; if ( needIcon ) menu = new SimMenu(cmd, iconReader, stack); else menu = new SimMenu(cmd, stack); // main menu send QSimEnvelope,sub menu sends QSimTerminalResponse if (cmd.type() == QSimCommand::SetupMenu) { connect(menu, SIGNAL(sendEnvelope(QSimEnvelope)), this, SLOT(sendEnvelope(QSimEnvelope)) ); } else { connect(menu, SIGNAL(sendResponse(QSimTerminalResponse)), this, SLOT(sendResponse(QSimTerminalResponse)) ); } setView(menu); }
void SimApp::softKeysMenu(const QSimCommand& cmd) { // Request icons from the SIM if the menu contains them. QList<QSimMenuItem> items = cmd.menuItems(); QList<QSimMenuItem>::ConstIterator it; for (it = items.begin(); it != items.end(); ++it) { int iconId = (int)((*it).iconId()); if ( iconId > 0 ) createIconReader(); } // Create the menu widgetry. SoftKeysMenu *menu = new SoftKeysMenu(cmd, iconReader, stack); // main menu send QSimEnvelope,sub menu sends QSimTerminalResponse if (cmd.type() == QSimCommand::SetupMenu) { connect(menu, SIGNAL(sendEnvelope(QSimEnvelope)), this, SLOT(sendEnvelope(QSimEnvelope)) ); } else { connect(menu, SIGNAL(sendResponse(QSimTerminalResponse)), this, SLOT(sendResponse(QSimTerminalResponse)) ); } setView(menu); }