void ShortcutsConfig::apply() { mouse_cfg->apply(); saveMenu(MenuMain); saveMenu(MenuGroup); saveMenu(MenuContact); saveMenu(MenuStatus); m_plugin->releaseKeys(); m_plugin->applyKeys(); }
int main(void) { int c; do { c = showMenu(); switch (c) { case 1: createMenu(); break; case 2: saveMenu(); break; case 3: withdrawMenu(); break; case 4: queryMenu(); break; case 0: tipMenu("welcome come back\n"); break; default: tipMenu("invalid input choice!\n"); break; } } while (0 != c); return 0; }
void AdminAppearance::menus_edit(Context *c, const QString &id) { c->setStash(QStringLiteral("editing"), true); CMS::Menu *menu = engine->menu(id.toHtmlEscaped()); if (!menu) { qWarning() << "menu not found" << id; c->response()->redirect(c->uriFor(CActionFor(QStringLiteral("menus")))); return; } qWarning() << "params" << c->req()->method(); if (c->req()->isPost()) { if (saveMenu(c, menu, c->req()->bodyParams(), true)) { c->response()->redirect(c->uriFor(CActionFor(QStringLiteral("menus")))); return; } else { c->stash({ {QStringLiteral("error_msg"), tr("Could not save menu")} }); } } c->stash({ {QStringLiteral("template"), QStringLiteral("appearance/menus_new.html")}, {QStringLiteral("menu"), QVariant::fromValue(menu)}, {QStringLiteral("no_wrapper"), true}, }); }
void AdminAppearance::menus_new(Context *c) { if (c->req()->isPost()) { ParamsMultiMap params = c->req()->bodyParams(); QString id = QUuid::createUuid().toString().remove(QLatin1Char('{')).remove(QLatin1Char('}')); CMS::Menu *menu = new CMS::Menu(id, c); if (saveMenu(c, menu, params, false)) { c->response()->redirect(c->uriFor(CActionFor(QStringLiteral("menus")))); return; } c->stash({ {QStringLiteral("error_msg"), tr("Could not save menu")} }); } else { c->setStash(QStringLiteral("no_wrapper"), true); } c->setStash(QStringLiteral("template"), QStringLiteral("appearance/menus_new.html")); }