Пример #1
0
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8/////////9/////////A
Wt::WWidget * WelcomeScreen::makeRegistrationTab()
{
    Wt::WContainerWidget *cont = new Wt::WContainerWidget();
    rg_txt_ = new Wt::WText("Hier koennen Sie ihr neues Flugbuch eroeffnen.", cont);
    cont->addWidget(new Wt::WBreak());
    cont->addWidget(new Wt::WBreak());


    Wt::WTable *layout = new Wt::WTable(cont);

    Wt::WLabel *usernameLabel = new Wt::WLabel("Benutzername: ", layout->elementAt(0, 0));
    layout->elementAt(0, 0)->resize(Wt::WLength(14, Wt::WLength::FontEx), Wt::WLength());
    rg_username_ = new Wt::WLineEdit(layout->elementAt(0, 1));
    usernameLabel->setBuddy(rg_username_);

    Wt::WLabel *passwordLabel = new Wt::WLabel("Passwort: ", layout->elementAt(1, 0));
    rg_password_ = new Wt::WLineEdit(layout->elementAt(1, 1));
    rg_password_->setEchoMode(Wt::WLineEdit::Password);
    passwordLabel->setBuddy(rg_password_);

    Wt::WLabel *passwordLabel2 = new Wt::WLabel("wiederholen: ", layout->elementAt(2, 0));
    rg_password2_ = new Wt::WLineEdit(layout->elementAt(2, 1));
    rg_password2_->setEchoMode(Wt::WLineEdit::Password);
    rg_password2_->enterPressed().connect(SLOT(this, WelcomeScreen::doRegister));
    passwordLabel2->setBuddy(rg_password2_);

    Wt::WLabel *stdflareas = new Wt::WLabel("Standardfluggebiete importieren: ", layout->elementAt(3, 0));
    rg_useStdLoc_ = new Wt::WCheckBox(layout->elementAt(3, 1));
    stdflareas->setBuddy(rg_useStdLoc_);

    Wt::WPushButton *LoginButton = new Wt::WPushButton("Registrieren", layout->elementAt(4, 1));
    LoginButton->clicked().connect(SLOT( this, WelcomeScreen::doRegister));

    return cont;
}
Пример #2
0
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8/////////9/////////A
Wt::WWidget * WelcomeScreen::makeNormalLoginTab()
{
    Wt::WContainerWidget *cont = new Wt::WContainerWidget();
    nl_txt_ = new Wt::WText("Hier koennen Sie ihr bestehendes Flugbuch aufrufen.", cont);
    cont->addWidget(new Wt::WBreak());
    cont->addWidget(new Wt::WBreak());

    Wt::WTable *layout = new Wt::WTable(cont);
    Wt::WLabel *usernameLabel = new Wt::WLabel("Benutzername: ", layout->elementAt(0, 0));
    layout->elementAt(0, 0)->resize(Wt::WLength(14, Wt::WLength::FontEx), Wt::WLength());
    nl_username_ = new Wt::WLineEdit(layout->elementAt(0, 1));
    usernameLabel->setBuddy(nl_username_);

    Wt::WLabel *passwordLabel = new Wt::WLabel("Password: "******"Login", layout->elementAt(2, 1));
    LoginButton->clicked().connect(SLOT( this, WelcomeScreen::doLogin));

    return cont;
}
      VideoPanel::VideoPanel(std::map<std::string, std::string>& p) : _parameter(p), Wt::Ext::Panel() {
        //        setLayout(new Wt::WFitLayout());
        Wt::WBorderLayout*l = new Wt::WBorderLayout();
        setLayout(l);
        std::set<std::string> avail_codecs;
        if (_parameter.count("available_codecs") > 0) {
          LOGDEBUG("Available codes" << _parameter["available_codecs"]);
          org::esb::util::StringTokenizer st(_parameter["available_codecs"], ",");
          while (st.hasMoreTokens()) {
            std::string codec_id = st.nextToken();
            avail_codecs.insert(codec_id);
            LOGDEBUG("avalable codec list" << codec_id);
          }
        }
        /*
         * Combobox for the Codec Selector
         */
        KeyValueModel * codec_model = new KeyValueModel();
        codec_model->addModelData("novideo", "No Video");
        codec_model->addModelData("copy", "Stream Copy");

        AVCodec *codec = NULL;
        int a = 0;
        while ((codec = av_codec_next(codec))) {
          if (codec->encode && codec->type == AVMEDIA_TYPE_VIDEO) {
            if (avail_codecs.count(codec->name) > 0) {
              codec_model->addModelData(codec->name, codec->long_name);
            } else {
              if (avail_codecs.size() == 0)
                codec_model->addModelData(codec->name, codec->long_name);
            }
          }
        }
        codec_model->sort(1);

        _codec = new ComboBox();

        _codec->setModel(codec_model);
        _codec->setModelColumn(1);
        _codec->setSelectedEntry(_parameter["codec_id"]);
        _codec->setTextSize(50);
        _codec->resize(300, Wt::WLength());


        _codec->activated().connect(SLOT(this, VideoPanel::codecSelected));


        main_panel = new Wt::Ext::Panel();
        Wt::WFitLayout * fit = new Wt::WFitLayout();
        main_panel->setLayout(fit);
        //main_panel->setBorder(false);

        l->addWidget(main_panel, Wt::WBorderLayout::Center);

        Wt::Ext::Panel * top_panel = new Wt::Ext::Panel();
        top_panel->resize(Wt::WLength(), 40);
        top_panel->setLayout(new Wt::WFitLayout());
        top_panel->setBorder(false);
        //        top_panel->layout()->addWidget(_codec);

        Wt::WContainerWidget *top = new Wt::WContainerWidget();
        top_panel->layout()->addWidget(top);
        Wt::WGridLayout * grid = new Wt::WGridLayout();
        top->setLayout(grid);
        top->resize(Wt::WLength(), 40);

        l->addWidget(top_panel, Wt::WBorderLayout::North);
        Wt::WLabel * label = new Wt::WLabel("Codec:");
        label->setBuddy(_codec);

        grid->addWidget(label, 0, 0);
        grid->addWidget(_codec, 0, 1);
        grid->addWidget(new Wt::WText(""), 0, 2);
        grid->setColumnStretch(1, 1);




        setCodecGui(_parameter["codec_id"]);
        //l->addWidget(builder,Wt::WBorderLayout::Center);
        //        return;
      }
Пример #4
0
ComputerView::ComputerView(Wt::WApplication *app, const Wt::WString &computerName,
bool writeAccess, Wt::WContainerWidget *parent) :
	Wt::WContainerWidget(parent),
	app(app), _computerName(computerName), _img_led(NULL)
{
	Wt::WBoxLayout *layout = new Wt::WBoxLayout(Wt::WBoxLayout::TopToBottom, this);

	Wt::WText *_title = new Wt::WText(computerName);
	_title->setStyleClass("ComputerName");
	app->styleSheet().addRule(".ComputerName", "font-size: 36px; text-transform: capitalize;");
	layout->addWidget(_title, 0, Wt::AlignCenter);

	/* create the buttons and connect them to their slots */
	_btn_atx_force_off = new Wt::WPushButton("Force off");
	_btn_atx_force_on = new Wt::WPushButton("Force on");
	_btn_atx_reset = new Wt::WPushButton("Reset");
	_btn_pw_switch_press = new Wt::WPushButton("Press");
	_btn_pw_switch_force_off = new Wt::WPushButton("Force off");

	_btn_atx_force_off->setEnabled(writeAccess);
	_btn_atx_force_on->setEnabled(writeAccess);
	_btn_atx_reset->setEnabled(writeAccess);
	_btn_pw_switch_press->setEnabled(writeAccess);
	_btn_pw_switch_force_off->setEnabled(writeAccess);

	_btn_atx_force_off->clicked().connect(this, &ComputerView::btn_atx_force_off_clicked);
	_btn_atx_force_on->clicked().connect(this, &ComputerView::btn_atx_force_on_clicked);
	_btn_atx_reset->clicked().connect(this, &ComputerView::btn_atx_reset_clicked);
	_btn_pw_switch_press->clicked().connect(this, &ComputerView::btn_pw_switch_press_clicked);
	_btn_pw_switch_force_off->clicked().connect(this, &ComputerView::btn_pw_switch_force_off_clicked);

	/* preload all the images */
	_ico_led_on_file.reset(getImg("green_light.png"));
	_ico_led_off_file.reset(getImg("off_light.png"));
	_ico_ping_file.reset(getImg("ping.png"));
	_ico_atx_pwr_file.reset(getImg("atx_power.png"));
	_ico_pwr_switch_file.reset(getImg("power-button.png"));

	/* create the LED */
	_img_led = new Wt::WImage();
	_img_led->setHeight(Wt::WLength(16));
	setPowerLedStatus(false);

	Wt::WGridLayout *grid = new Wt::WGridLayout();
	grid->addWidget(_img_led, 0, 0, Wt::AlignCenter);
	grid->addWidget(new Wt::WText("Power Led state"), 0, 1);
	grid->addWidget(new Wt::WLabel(""), 0, 5);

	grid->addWidget(new Wt::WImage(_ico_ping_file.get()), 1, 0, Wt::AlignCenter);
	grid->addWidget(new Wt::WText("Ping"), 1, 1);
	_ping_txt = new Wt::WText("N/A");
	grid->addWidget(_ping_txt, 1, 2, 0, 0, Wt::AlignCenter);

	grid->addWidget(new Wt::WImage(_ico_atx_pwr_file.get()), 2, 0, Wt::AlignCenter);
	grid->addWidget(new Wt::WText("ATX power"), 2, 1);
	grid->addWidget(_btn_atx_force_off, 2, 2);
	grid->addWidget(_btn_atx_force_on, 2, 3);
	grid->addWidget(_btn_atx_reset, 2, 4);

	grid->addWidget(new Wt::WImage(_ico_pwr_switch_file.get()), 3, 0, Wt::AlignCenter);
	grid->addWidget(new Wt::WText("Power switch"), 3, 1);
	grid->addWidget(_btn_pw_switch_press, 3, 2);
	grid->addWidget(_btn_pw_switch_force_off, 3, 3);

	grid->setColumnStretch(5, 1);

	layout->addLayout(grid);

	layout->addSpacing(10);

	Wt::WLabel *label = new Wt::WLabel("Logs:");
	layout->addWidget(label);

	_logs_edit = new Wt::WTextArea("");
	_logs_edit->setHeight(150);
	_logs_edit->setMaximumSize(Wt::WLength::Auto, 150);
	label->setBuddy(_logs_edit);
	layout->addWidget(_logs_edit);

	layout->addSpacing(10);
}