SipeMainOptionsWidget::SipeMainOptionsWidget(ParameterEditModel *model, QWidget *parent)
 : AbstractAccountParametersWidget(model, parent)
{
    // Set up the UI.
    m_ui = new Ui::SipeMainOptionsWidget;
    m_ui->setupUi(this);

    handleParameter(QLatin1String("account"),  QVariant::String, m_ui->accountLineEdit,  m_ui->accountLabel);
    handleParameter(QLatin1String("password"), QVariant::String, m_ui->passwordLineEdit, m_ui->passwordLabel);
}
SkypeAdvancedSettingsWidget::SkypeAdvancedSettingsWidget(ParameterEditModel *model, QWidget *parent)
 : AbstractAccountParametersWidget(model, parent)
{
    // Set up the UI.
    m_ui = new Ui::SkypeAdvancedSettingsWidget;
    m_ui->setupUi(this);

    //server
    handleParameter(QLatin1String("skypeout-online"),  QVariant::Bool, m_ui->skypeOutCheckBox, 0);
    handleParameter(QLatin1String("skype-sync"),       QVariant::Bool, m_ui->syncCheckBox, 0);
    handleParameter(QLatin1String("check-for-updates"),QVariant::Bool, m_ui->updatesCheckBox, 0);
    handleParameter(QLatin1String("reject-all-auths"), QVariant::Bool, m_ui->authRequestsCheckBox, 0);
    handleParameter(QLatin1String("skype-autostart"),  QVariant::Bool, m_ui->autostartCheckBox, 0);
}
MainOptionsWidget::MainOptionsWidget(
        ParameterEditModel *model,
        QWidget *parent)
         : AbstractAccountParametersWidget(model, parent)
{
    // Set up the UI.
    m_ui = new Ui::MainOptionsWidget;
    m_ui->setupUi(this);

    handleParameter(QLatin1String("account"), QVariant::String, m_ui->accountLineEdit, m_ui->accountLabel);
    handleParameter(QLatin1String("server"), QVariant::String, m_ui->serverLineEdit, m_ui->serverLabel);
    handleParameter(QLatin1String("fullname"), QVariant::String, m_ui->fullnameLineEdit, m_ui->fullnameLabel);
    QTimer::singleShot(0, m_ui->accountLineEdit, SLOT(setFocus()));
}
Beispiel #4
0
int handlePost(int conn, struct ReqInfo  *reqinfo){
	char buffer[MAX_REQ_LINE] = {0};
    fd_set fds;
    struct timeval tv;
	int rval;
	
	tv.tv_sec  = 1;
    tv.tv_usec = 0;
	
	for (;;){
		FD_ZERO(&fds);
		FD_SET (conn, &fds);
	
		rval = select(conn + 1, &fds, NULL, NULL, &tv);
		if ( rval < 0 ) {
			syslog(LOG_NOTICE,"Error calling select() in get_request()");
		}
		else if ( rval == 0 ) {
			break;
		}
		else {
			Readline(conn, buffer, MAX_REQ_LINE - 1);
			Trim(buffer);
			handleParameter(buffer);
		}
	}
	restart = 1;
}
Beispiel #5
0
void FunctionWidget::showParameterForm(void)
{
	QObject *obj_sender=sender();
	ObjectTableWidget *table=nullptr;
	Parameter aux_param;
	int lin_idx;
	ParameterWidget parameter_wgt(this);

	if(obj_sender==parameters_tab || obj_sender==return_tab)
	{
		table=dynamic_cast<ObjectTableWidget *>(obj_sender);

		parameter_wgt.param_in_chk->setEnabled(obj_sender==parameters_tab);
		parameter_wgt.param_out_chk->setEnabled(obj_sender==parameters_tab);
		parameter_wgt.param_variadic_chk->setEnabled(obj_sender==parameters_tab);
		parameter_wgt.default_value_edt->setEnabled(obj_sender==parameters_tab);

		lin_idx=table->getSelectedRow();

		if(lin_idx >= 0 && !table->getCellText(lin_idx, 0).isEmpty())
			aux_param=getParameter(table, lin_idx);

		parameter_wgt.setAttributes(aux_param, model);
		parameter_wgt.show();

		aux_param=parameter_wgt.getParameter();
		handleParameter(aux_param, parameter_wgt.result());
	}
}
SipeMainOptionsWidget::SipeMainOptionsWidget(ParameterEditModel *model, QWidget *parent)
 : AbstractAccountParametersWidget(model, parent)
{
    // Set up the UI.
    m_ui = new Ui::SipeMainOptionsWidget;
    m_ui->setupUi(this);

    handleParameter(QLatin1String("account"),  QVariant::String, m_ui->accountLineEdit,  m_ui->accountLabel);
    handleParameter(QLatin1String("password"), QVariant::String, m_ui->passwordLineEdit, m_ui->passwordLabel);

    // telepathy-sipe require login, but it just equals account in many cases, so
    // let login will be optional (empty) in kcm when it equals to account
    Tp::ProtocolParameter loginParameter = parameterModel()->parameter(QLatin1String("login"));
    Tp::ProtocolParameter accountParameter = parameterModel()->parameter(QLatin1String("account"));
    QString login = parameterModel()->indexForParameter(loginParameter).data().toString();
    QString account = parameterModel()->indexForParameter(accountParameter).data().toString();
    if (account==login) {
        QModelIndex index = parameterModel()->indexForParameter(loginParameter);
        QString empty(QLatin1String(""));
        parameterModel()->setData(index, empty, Qt::EditRole);
    }
}
Beispiel #7
0
   void Walker::walkParameter(libember::glow::GlowParameter const* glow)
   {
      m_path.push_back(glow->number());

      handleParameter(glow, pathToOid());

      auto children = glow->children();

      if(children != nullptr)
         walkElements(children->begin(), children->end());

      m_path.pop_back();
   }
SunshineAdvancedOptionsWidget::SunshineAdvancedOptionsWidget(ParameterEditModel* model, QWidget* parent)
    : AbstractAccountParametersWidget(model, parent)
{
    // Set up the UI.
    m_ui = new Ui::SunshineAdvancedOptionsWidget;
    m_ui->setupUi(this);

    handleParameter(QLatin1String("use-specified-server"), QVariant::Bool,
                    m_ui->serverGroupBox,
                    0);
    handleParameter(QLatin1String("server"), QVariant::String,
                    m_ui->serverLineEdit,
                    m_ui->serverLabel);
    handleParameter(QLatin1String("port"), QVariant::UInt,
                    m_ui->portSpinBox,
                    m_ui->portLabel);
    handleParameter(QLatin1String("use-ssl"), QVariant::Bool,
                    m_ui->sslCheckBox,
                    m_ui->sslLabel);
    handleParameter(QLatin1String("export-contacts"), QVariant::Bool,
                    m_ui->exportContactsCheckBox,
                    m_ui->exportContactsLabel);
}
SipeAdvancedOptionsWidget::SipeAdvancedOptionsWidget(ParameterEditModel *model, QWidget *parent)
 : AbstractAccountParametersWidget(model, parent)
{
    // Set up the UI.
    m_ui = new Ui::SipeAdvancedOptionsWidget;
    m_ui->setupUi(this);

    //server
    handleParameter(QLatin1String("login"), QVariant::String, m_ui->loginLineEdit, m_ui->loginLabel);
    handleParameter(QLatin1String("server"), QVariant::String, m_ui->serverLineEdit, m_ui->serverLabel);
    handleParameter(QLatin1String("port"),   QVariant::UInt, m_ui->portSpinBox, m_ui->portLabel);
    handleParameter(QLatin1String("transport"), QVariant::String, m_ui->transportComboBox, m_ui->transportLabel);
    handleParameter(QLatin1String("useragent"), QVariant::String, m_ui->useragentLineEdit, m_ui->useragentLabel);
    handleParameter(QLatin1String("authentication"), QVariant::String, m_ui->authenticationComboBox, m_ui->authenticationLabel);
    handleParameter(QLatin1String("single-sign-on"), QVariant::Bool, m_ui->singlesignonCheckBox, 0);
    handleParameter(QLatin1String("don't-publish-calendar"), QVariant::Bool, m_ui->dontpublishcalendarCheckBox, 0);
}
Beispiel #10
0
   void Walker::walkQualifiedParameter(libember::glow::GlowQualifiedParameter const* glow)
   {
      auto glowPath = glow->path();
      m_path.clear();
      m_path.insert(m_path.end(), glowPath.begin(), glowPath.end());

      handleParameter(glow, glowPath);

      auto children = glow->children();

      if(children != nullptr)
         walkElements(children->begin(), children->end());

      m_path.clear();
   }
SkypeMainOptionsWidget::SkypeMainOptionsWidget(ParameterEditModel *model, QWidget *parent)
 : AbstractAccountParametersWidget(model, parent)
{
    // Set up the UI.
    m_ui = new Ui::SkypeMainOptionsWidget;
    m_ui->setupUi(this);

    handleParameter(QLatin1String("account"), QVariant::String, m_ui->accountLineEdit, m_ui->accountLabel);

#ifdef Q_WS_X11
    // get autocomplete choices for the accountname
    // Skype stores data for each account that has been used in $HOME/.Skype/<accountname>/
    QDir skypeConfigDir(QDir::home().filePath(QLatin1String(".Skype")));

    skypeConfigDir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
    QFileInfoList folderList = skypeConfigDir.entryInfoList();

    KCompletion *completion = new KCompletion;
    Q_FOREACH (const QFileInfo &info, folderList) {
        completion->addItem(info.fileName());
    }
Beispiel #12
0
bool handleInputParameters(int  argc, const char **args) {

    std::vector<ParamAndValue> argVec;
    if(!parseInput(argc, args, argVec)) {
        printf("handleInputParameters(): Error parsing input\n");
        return false;
    }


    for(int i = 0; i < (int)argVec.size(); ++i) {

        if(!handleParameter(argVec[i])) {

            printf("-%s %s not defined\n", argVec[i].name.c_str(), argVec[i].value.c_str());
            return false;

        }

    }


    return true;

}
RakiaAdvancedOptionsWidget::RakiaAdvancedOptionsWidget(ParameterEditModel* model, QWidget* parent)
    : AbstractAccountParametersWidget(model, parent)
{
    // Set up the UI.
    m_ui = new Ui::RakiaAdvancedOptionsWidget;
    m_ui->setupUi(this);

    handleParameter(QLatin1String("auth-user"),  QVariant::String,
                    m_ui->authUserLineEdit,
                    m_ui->authUserLabel);
    handleParameter(QLatin1String("registrar"),  QVariant::String,
                    m_ui->registrarLineEdit,
                    m_ui->registrarLabel);

    handleParameter(QLatin1String("proxy-host"), QVariant::String,
                    m_ui->proxyLineEdit,
                    m_ui->proxyLabel);
    handleParameter(QLatin1String("port"),       QVariant::UInt,
                    m_ui->portSpinBox,
                    m_ui->portLabel);
    handleParameter(QLatin1String("transport"),  QVariant::String,
                    m_ui->transportComboBox,
                    m_ui->transportLabel);

    handleParameter(QLatin1String("stun-server"),        QVariant::String,
                    m_ui->stunServerLineEdit,
                    m_ui->stunServerLabel);
    handleParameter(QLatin1String("stun-port"),          QVariant::UInt,
                    m_ui->stunPortSpinBox,
                    m_ui->stunPortLabel);

    handleParameter(QLatin1String("loose-routing"),      QVariant::Bool,
                    m_ui->looseRoutingCheckBox,
                    m_ui->looseRoutingLabel);
    handleParameter(QLatin1String("discover-binding"),   QVariant::Bool,
                    m_ui->discoverBindingCheckBox,
                    m_ui->discoverBindingLabel);

    handleParameter(QLatin1String("keepalive-mechanism"), QVariant::String,
                    m_ui->keepaliveMechanismComboBox,
                    m_ui->keepaliveMechanismLabel);
    handleParameter(QLatin1String("keepalive-interval"), QVariant::UInt,
                    m_ui->keepaliveIntervalNumInput,
                    m_ui->keepaliveIntervalLabel);

    // update combo box for transport parameter
    m_ui->transportComboBox->setCurrentItem(parameterModel()->data(
            parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("transport"))),
            ParameterEditModel::ValueRole).toString());

    // update combo box for keepalive-mechanism parameter
    m_ui->keepaliveMechanismComboBox->setCurrentItem(parameterModel()->data(
            parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("keepalive-mechanism"))),
            ParameterEditModel::ValueRole).toString());

    kDebug() << parameterModel()->data(
                 parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("discover-stun"))),
                 ParameterEditModel::ValueRole);

    // enable/disable the stunGroupBox if discover-stun is false/true
    m_ui->stunGroupBox->setChecked(
        !parameterModel()->data(
            parameterModel()->indexForParameter(parameterModel()->parameter(QLatin1String("discover-stun"))),
            ParameterEditModel::ValueRole).toBool()
    );

    // enable/disable keepalive-interval depending on keepalive-mechanism
    connect(m_ui->keepaliveMechanismComboBox,
            SIGNAL(currentIndexChanged(int)),
            SLOT(updateKeepalive(int))
           );

    // enable/disable keepalive-interval depending on current keepalive-mechanism
    updateKeepalive(m_ui->keepaliveMechanismComboBox->currentIndex());
}