void MainWindow::updateImgInfo() { ImageStorage* imgstore = ImageStorage::getInstance(); std::pair<const std::string, Ui::SrcAndRes>* current = imgstore->getCurrent(); if (!imgstore->isEmpty()) { //std::pair<const std::string, Ui::SrcAndRes>* current = imgstore->getCurrent(); if (current != nullptr) { Ui::Image img = std::get<1>(current->second); QString imgname = QString::fromStdString(current->first); QString info = QString("Name: %1\nChannels: %2\nDepth: %3\nSize: %4 x %5\n" ).arg(imgname).arg(img.channels()).arg(img.depth()).arg(img.rows).arg(img.cols); QColor c("blue"); ui->imgInfo->setTextColor(c); ui->imgInfo->setText(info); } else { ui->imgInfo->setText(""); } } else { ui->imgInfo->setText(""); } QCoreApplication::processEvents(); }
QByteArray ServerListProcessor::render() const { UI::DefaultPageRenderer page; QMap<QString, QVariant> param; page.body()->addWidget(_notify); Translate::instance()->group("server"); // Content UI::Container* divBreadcrumb = new UI::Container(); { divBreadcrumb->setId("breadcrumb"); // Icon UI::Container* divIcon = new UI::Container(); { divIcon->addClass("icon users"); UI::Image* imgContent = new UI::Image("/img/icon_ftp.png", Translate::instance()->tr("icon")); imgContent->setAttribute("width", "60"); divIcon->addWidget(imgContent); } divBreadcrumb->addWidget(divIcon); Translate::instance()->group("breadcrumb"); // Breadcrumbs UI::Title* title = new UI::Title(); { UI::Breadcrumb* link = new UI::Breadcrumb(); link->addLink(Translate::instance()->tr("server_home"), Helper::gen_url("index")); link->addLink(Translate::instance()->tr("server_manage"), ""); title->addWidget(link); } divBreadcrumb->addWidget(title); } page.body()->addWidget(divBreadcrumb); Translate::instance()->group("server_manage"); page.setTitle("PuppetFTP - "+Translate::instance()->tr("title")); // Content UI::Container* divContent = new UI::Container(); { divContent->setId("server"); // Editing divContent->addWidget(_table->getContent()); // Clear UI::Container* divClear = new UI::Container(); divClear->setAttribute("style", "clear:both;visibility:hidden;"); divContent->addWidget(divClear); } page.body()->addWidget(divContent); return page.render(); }
QByteArray ServerListProcessor::render() const { UI::DefaultPageRenderer page; QMap<QString, QVariant> param; page.setTitle("PuppetFTP - Manage Your Server - List"); page.body()->addWidget(_notify); // Breadcrumbs UI::Title* title = new UI::Title(); { UI::Breadcrumb* link = new UI::Breadcrumb(); link->addLink("Manage your server", Helper::gen_url("index")); link->addLink("Server management", ""); title->addWidget(link); } page.body()->addWidget(title); // Content UI::Container* divContent = new UI::Container(); { divContent->setId("server"); // Icon UI::Container* divIcon = new UI::Container(); { divIcon->addClass("icon users"); UI::Image* imgContent = new UI::Image("/images/icon_ftp.png", "Manage Your Server"); imgContent->setAttribute("width", "60"); divIcon->addWidget(imgContent); } divContent->addWidget(divIcon); // Menu UI::Menu* menu = new UI::Menu(UI::Container::NAV); { menu->setAttribute("id", "menu"); menu->addMenu("menu", new UI::Link(Helper::gen_url("serverUserList", param), new UI::Text("User management"))); menu->addMenu("menu", new UI::Link(Helper::gen_url("serverList", param), new UI::Text("Server management"))); } divContent->addWidget(menu); // Editing divContent->addWidget(_table->getContent()); // Clear UI::Container* divClear = new UI::Container(); divClear->setAttribute("style", "clear:both;visibility:hidden;"); divContent->addWidget(divClear); } page.body()->addWidget(divContent); return page.render(); }
QByteArray IndexProcessor::render() const { UI::DefaultPageRenderer core; QMap<QString, QVariant> param; Translate::instance()->group("index"); core.setTitle("PuppetFTP - "+Translate::instance()->tr("title")); core.body()->addWidget(_notify); UI::Container* divClear = new UI::Container(); divClear->setAttribute("style", "clear:both;visibility:hidden;"); divClear->addWidget(new UI::Text(" ")); // Content // Menu 1 - Configure PuppetFTP UI::Container* section = new UI::Container(UI::Container::SECTION); { section->setId("home"); UI::Container* divIcon1 = new UI::Container(); { divIcon1->addClass("index"); UI::Image* img = new UI::Image("/img/icon_user.png", Translate::instance()->tr("manage_users")); img->setAttribute("width", "60"); divIcon1->addWidget(img); UI::Link* link = new UI::Link(Helper::gen_url("importExport", param), new UI::Text(Translate::instance()->tr("manage_users"))); divIcon1->addWidget(link); } section->addWidget(divIcon1); UI::Container* divIcon2 = new UI::Container(); { divIcon2->addClass("index"); UI::Image* img = new UI::Image("/img/icon_ftp.png", Translate::instance()->tr("manage_servers")); img->setAttribute("width", "60"); divIcon2->addWidget(img); UI::Link* link = new UI::Link(Helper::gen_url("serverList", param), new UI::Text(Translate::instance()->tr("manage_servers"))); divIcon2->addWidget(link); } section->addWidget(divIcon2); UI::Container* divIcon3 = new UI::Container(); { divIcon3->addClass("index"); UI::Image* img = new UI::Image("/img/icon_import.png", Translate::instance()->tr("manage_import_export")); img->setAttribute("width", "60"); divIcon3->addWidget(img); UI::Link* link = new UI::Link(Helper::gen_url("importExport", param), new UI::Text(Translate::instance()->tr("manage_import_export"))); divIcon3->addWidget(link); } section->addWidget(divIcon3); section->addWidget(divClear); } core.body()->addWidget(section); core.body()->addWidget(divClear); return core.render(); }