Esempio n. 1
0
Prefs_ShortWords::Prefs_ShortWords(QWidget* parent)
	: Prefs_Pane(parent)
{
	setupUi(this);
	languageChange();

	// defaults
	if (QFile::exists(RC_PATH_USR))
	{
		messageLabel->setText( tr("User settings"));
		loadCfgFile(RC_PATH_USR);
	}
	else
	{
		messageLabel->setText( tr("System wide configuration"));
		resetButton->setEnabled(false);
		loadCfgFile(RC_PATH);
	}
	saveButton->setEnabled(false);
	new SWSyntaxHighlighter(cfgEdit);

	// signals
	connect(saveButton, SIGNAL(clicked()), this, SLOT(saveButton_pressed()));
	connect(resetButton, SIGNAL(clicked()), this, SLOT(resetButton_pressed()));
	connect(cfgEdit, SIGNAL(textChanged()), this, SLOT(cfgEdit_changed()));
}
Esempio n. 2
0
void Prefs_ShortWords::resetButton_pressed()
{
	loadCfgFile(RC_PATH);
	QDir d;
	d.remove(RC_PATH_USR);
	saveButton->setEnabled(false);
	resetButton->setEnabled(false);
	messageLabel->setText( tr("System wide configuration reloaded"));
}
Esempio n. 3
0
void XCursorThemeData::parseIndexFile () {
  QMultiMap<QString, QString> cfg = loadCfgFile(mPath+"/index.theme", true);
  if (cfg.contains("icon theme/name")) mTitle = cfg.values("icon theme/name").at(0).trimmed();
  if (cfg.contains("icon theme/comment")) mDescription = cfg.values("icon theme/comment").at(0).trimmed();
  if (cfg.contains("icon theme/example")) mSample = cfg.values("icon theme/example").at(0).trimmed();
  if (cfg.contains("icon theme/hidden")) {
      QString hiddenValue = cfg.values("icon theme/hidden").at(0).toLower();
      mHidden = hiddenValue=="false" ? false : true;
  }
  if (cfg.contains("icon theme/inherits")) {
    QStringList i = cfg.values("icon theme/inherits"), res;
    for (int f = i.size()-1; f >= 0; f--) res << i.at(f).trimmed();
  }
  if (mDescription.startsWith("- Converted by")) mDescription.remove(0, 2);
}
form_UserRegistration::form_UserRegistration(QStringList filialList, QString ip) {
    form_UserReg.setupUi(this);
    QIcon icon;
    icon.addFile(QString::fromUtf8("images/reguser.png"), QSize(), QIcon::Normal, QIcon::Off);
    this->setWindowIcon(icon);
    
    form_UserReg.pbSendToServer->setEnabled(true);
    
    irbis64 = new engine(APM_REGUSER, "f10", "f10");
            
    isOVD = true;
    
    
/*  запрос пароля
 *  если сохранен в таблице - то автовход
 * 
 *  form_Login.myIP = ip;
    form_Login.setModal(true);
    QStringList account = form_Login.bd.checkAccountAvailable(ip);
    if (account.count() == 0)
        form_Login.show();
    else
    {
        irbis64->login = account.at(0).toStdString();
        irbis64->pass = account.at(1).toStdString();
    }
*/  
    
    maxWorkAge = 55;
    dt = new datetime();
    form_UserReg.leBirthYear_21->setText(QString::number(dt->year().toInt() - 8));

    form_UserReg.cbFilial->addItems(filialList);
    filialName = form_UserReg.cbFilial->currentText();
    
    // начальная обработка года рождения
    slotOnBirthYearChange("");
    
    form_UserReg.leBirthYear_21->connect(form_UserReg.leBirthYear_21, SIGNAL(textChanged(QString)), this, SLOT(slotOnBirthYearChange(QString)));
//    form_UserReg.leFam_10->connect(form_UserReg.leFam_10, SIGNAL(textChanged(QString)), this, SLOT(slotOnFamChange(QString)));
    
    connect(form_UserReg.leFam_10, SIGNAL(textEdited(QString)), this, SLOT(slotCheckUserExists(QString)));
    connect(form_UserReg.leName_11, SIGNAL(textEdited(QString)), this, SLOT(slotCheckUserExists(QString)));
    connect(form_UserReg.leSurname_12, SIGNAL(textEdited(QString)), this, SLOT(slotCheckUserExists(QString)));
    connect(form_UserReg.leBirthYear_21, SIGNAL(textEdited(QString)), this, SLOT(slotCheckUserExists(QString)));

    form_UserReg.cbAddressRegistration->connect(form_UserReg.cbAddressRegistration, SIGNAL(clicked()), this, SLOT(slotOnAdditionalAddress()));
    
    form_UserReg.pbSendToServer->connect(form_UserReg.pbSendToServer, SIGNAL(clicked()), this, SLOT(slotRegUser()));
    form_UserReg.pbClearForm->connect(form_UserReg.pbClearForm, SIGNAL(clicked()), this, SLOT(slotClearForm()));
    
    QList< QLineEdit* > list;
    list = form_UserReg.gbNewUserReg->findChildren<QLineEdit *>();
    for (int i = 0; i < list.size(); i++)
    {
        connect(list.at(i), SIGNAL(returnPressed()), this, SLOT(slotKeyPressed()));
    }
    
    loadConfFile();
    loadCfgFile();
    
    connect(form_UserReg.cbStreet_13, SIGNAL(editTextChanged(QString)), this, SLOT(slotStreetChanged(QString)));
    slotStreetChanged(form_UserReg.cbStreet_13->currentText());
    
    connect(form_UserReg.cbStreet_14, SIGNAL(editTextChanged(QString)), this, SLOT(slotStreetChanged(QString)));
    connect(form_UserReg.leSerial_14, SIGNAL(textEdited(QString)), this, SLOT(slotSetOVD_OUFMS_Year(QString)));
}