//*******************************************************************
// Create a meaningful subject line for the notification
//*******************************************************************
static int mysqlstats_notify_mail_subject(trx *t, FILE *fp, char *servername)
{
  fprintf(fp, "Subject: %s: %s %s (was %s)\n", servername,
                 t->probe->module_name, /* t->def->dispname, */
                 color2string(t->res->color),
                 color2string(t->res->prevhistcolor));
}
void qtvplugin_geomarker::on_toolButton_QTV_selColorPen_clicked()
{
	QString str = ui->lineEdit_QTV_PenColor->text();

	QColor col = QColorDialog::getColor(string2color(str),this,tr("Select Color"),QColorDialog::ShowAlphaChannel|QColorDialog::DontUseNativeDialog);
	if (col.isValid())
		ui->lineEdit_QTV_PenColor->setText(color2string(col));
}
Exemple #3
0
bool ColorProperty::setValue(QColor val)
{
    if (val == mValue)
        return false;

    mValue = val;
	mStore.writeValue(color2string(val));
    emit valueWasSet();
    emit changed();
    return true;
}
Exemple #4
0
/** Make sure one given option exists witin root.
 * If not present, fill inn the input defaults.
 */
ColorPropertyPtr ColorProperty::initialize(const QString& uid, QString name, QString help, QColor value,
    QDomNode root)
{
    ColorPropertyPtr retval(new ColorProperty());
    retval->mUid = uid;
    retval->mName = name.isEmpty() ? uid : name;
    retval->mHelp = help;
    retval->mStore = XmlOptionItem(uid, root.toElement());
	retval->mValue = string2color(retval->mStore.readValue(color2string(value)));
    return retval;
}
void qtvplugin_geomarker::style_load()
{
	QSettings settings(ini_file(),QSettings::IniFormat);

	int spinBox_QTV_point_width = settings.value("default_style/spinBox_QTV_point_width",8).toInt();
	ui->spinBox_QTV_point_width->setValue(spinBox_QTV_point_width);

	int spinBox_QTV_point_height = settings.value("default_style/spinBox_QTV_point_height",8).toInt();
	ui->spinBox_QTV_point_height->setValue(spinBox_QTV_point_height);

	QString lineEdit_QTV_PenColor = settings.value("default_style/lineEdit_QTV_PenColor",color2string(QColor(0,0,0,128))).toString();
	ui->lineEdit_QTV_PenColor->setText(lineEdit_QTV_PenColor);

	QString lineEdit_QTV_FillColor = settings.value("default_style/lineEdit_QTV_FillColor",color2string(QColor(255,255,255,128))).toString();
	ui->lineEdit_QTV_FillColor->setText(lineEdit_QTV_FillColor);

	QString lineEdit_QTV_TextColor = settings.value("default_style/lineEdit_QTV_TextColor",color2string(QColor(0,0,0))).toString();
	ui->lineEdit_QTV_TextColor->setText(lineEdit_QTV_TextColor);

	int radioButton_QTV_PointRect =  settings.value("default_style/radioButton_QTV_PointRect",0).toInt();
	switch (radioButton_QTV_PointRect)
	{
	case 0:
		ui->radioButton_QTV_PointRect->setChecked(true);
		break;
	case 1:
		ui->radioButton_QTV_PointRound->setChecked(true);
		break;
	default:
		ui->radioButton_QTV_PointRect->setChecked(true);
		break;
	}

	int spinBox_QTV_penWidth = settings.value("default_style/spinBox_QTV_penWidth",3).toInt();
	ui->spinBox_QTV_penWidth->setValue(spinBox_QTV_penWidth);

	int comboBox_QTV_linePad = settings.value("default_style/comboBox_QTV_linePad",1).toInt();
	ui->comboBox_QTV_linePad->setCurrentIndex(comboBox_QTV_linePad);

	int comboBox_QTV_fillPad = settings.value("default_style/comboBox_QTV_fillPad",1).toInt();
	ui->comboBox_QTV_fillPad->setCurrentIndex(comboBox_QTV_fillPad);


	int spinBox_QTV_fontSize = settings.value("default_style/spinBox_QTV_fontSize",9).toInt();
	ui->spinBox_QTV_fontSize->setValue(spinBox_QTV_fontSize);

	int spinBox_QTV_textWeight = settings.value("default_style/spinBox_QTV_textWeight",16).toInt();
	ui->spinBox_QTV_textWeight->setValue(spinBox_QTV_textWeight);

	QString lineEdit_QTV_icon_scale = settings.value("default_style/lineEdit_QTV_icon_scale","1.0").toString();
	ui->lineEdit_QTV_icon_scale->setText(lineEdit_QTV_icon_scale);

	QString lineEdit_QTV_icon_rotate = settings.value("default_style/lineEdit_QTV_icon_rotate","1.0").toString();
	ui->lineEdit_QTV_icon_rotate->setText(lineEdit_QTV_icon_rotate);

	int checkBox_QTV_multiline = settings.value("default_style/checkBox_QTV_multiline",0).toInt();
	ui->checkBox_QTV_multiline->setChecked(checkBox_QTV_multiline?true:false);

	int checkBox_QTV_icon_smooth = settings.value("default_style/checkBox_QTV_icon_smooth",0).toInt();
	ui->checkBox_QTV_icon_smooth->setChecked(checkBox_QTV_icon_smooth?true:false);

	QString comboBox_QTV_icons = settings.value("default_style/comboBox_QTV_icons","default").toString();
	if (m_map_icons.contains(comboBox_QTV_icons))
		ui->comboBox_QTV_icons->setCurrentText(comboBox_QTV_icons);
	//update current style
	m_default_style.n_point_width = ui->spinBox_QTV_point_width->value();
	m_default_style.n_point_height = ui->spinBox_QTV_point_height->value();
	m_default_style.n_point_rect = radioButton_QTV_PointRect;
	m_default_style.pen.setColor(string2color(ui->lineEdit_QTV_PenColor->text()));
	m_default_style.pen.setWidth(ui->spinBox_QTV_penWidth->value());
	m_default_style.pen.setStyle(static_cast<Qt::PenStyle>(ui->comboBox_QTV_linePad->currentIndex()));
	m_default_style.brush.setColor(string2color(ui->lineEdit_QTV_FillColor->text()));
	m_default_style.brush.setStyle(static_cast<Qt::BrushStyle>(ui->comboBox_QTV_fillPad->currentIndex()));
	m_default_style.text_color = string2color(ui->lineEdit_QTV_TextColor->text());
	m_default_style.font.setWeight(ui->spinBox_QTV_textWeight->value());
	m_default_style.font.setPointSize(ui->spinBox_QTV_fontSize->value());
	m_default_style.scale = ui->lineEdit_QTV_icon_scale->text().toFloat();
	m_default_style.rotate = ui->lineEdit_QTV_icon_rotate->text().toFloat();
	m_default_style.multiline = ui->checkBox_QTV_multiline->isChecked()?-1:0;
	m_default_style.smooth = ui->checkBox_QTV_icon_smooth->isChecked()?-1:0;
	m_default_style.icon_name = ui->comboBox_QTV_icons->currentText();
}
void qtvplugin_geomarker::ini_load()
{
	QSettings settings(ini_file(),QSettings::IniFormat);
	int radioButton_QTV_tool_point =  settings.value("ui/radioButton_QTV_tool_point",0).toInt();
	switch (radioButton_QTV_tool_point)
	{
	case 0:
		ui->radioButton_QTV_tool_point->setChecked(true);
		break;
	case 1:
		ui->radioButton_QTV_tool_line->setChecked(true);
		break;
	case 2:
		ui->radioButton_QTV_tool_polygon->setChecked(true);
		break;
	case 3:
		ui->radioButton_QTV_tool_icons->setChecked(true);
		break;
	default:
		ui->radioButton_QTV_tool_point->setChecked(true);
		break;
	}
	QString lineEdit_QTV_currentID = settings.value("ui/lineEdit_QTV_currentID","PT0").toString();
	ui->lineEdit_QTV_currentID->setText(lineEdit_QTV_currentID);

	QString lineEdit_QTV_point_lat = settings.value("ui/lineEdit_QTV_point_lat","0").toString();
	ui->lineEdit_QTV_point_lat->setText(lineEdit_QTV_point_lat);
	QString lineEdit_QTV_point_lon = settings.value("ui/lineEdit_QTV_point_lon","0").toString();
	ui->lineEdit_QTV_point_lon->setText(lineEdit_QTV_point_lon);
	int spinBox_QTV_point_width = settings.value("ui/spinBox_QTV_point_width",8).toInt();
	ui->spinBox_QTV_point_width->setValue(spinBox_QTV_point_width);
	int spinBox_QTV_point_height = settings.value("ui/spinBox_QTV_point_height",8).toInt();
	ui->spinBox_QTV_point_height->setValue(spinBox_QTV_point_height);
	QString lineEdit_QTV_PenColor = settings.value("ui/lineEdit_QTV_PenColor",color2string(QColor(0,0,0,128))).toString();
	ui->lineEdit_QTV_PenColor->setText(lineEdit_QTV_PenColor);
	QString lineEdit_QTV_FillColor = settings.value("ui/lineEdit_QTV_FillColor",color2string(QColor(255,255,255,128))).toString();
	ui->lineEdit_QTV_FillColor->setText(lineEdit_QTV_FillColor);
	QString lineEdit_QTV_TextColor = settings.value("ui/lineEdit_QTV_TextColor",color2string(QColor(0,0,0))).toString();
	ui->lineEdit_QTV_TextColor->setText(lineEdit_QTV_TextColor);
	int radioButton_QTV_PointRect =  settings.value("ui/radioButton_QTV_PointRect",0).toInt();
	switch (radioButton_QTV_PointRect)
	{
	case 0:
		ui->radioButton_QTV_PointRect->setChecked(true);
		break;
	case 1:
		ui->radioButton_QTV_PointRound->setChecked(true);
		break;
	default:
		ui->radioButton_QTV_PointRect->setChecked(true);
		break;
	}

	QString lineEdit_QTV_prop_name = settings.value("ui/lineEdit_QTV_prop_name","LABEL").toString();
	ui->lineEdit_QTV_prop_name->setText(lineEdit_QTV_prop_name);
	QString lineEdit_QTV_prop_string = settings.value("ui/lineEdit_QTV_prop_string","please input label here").toString();
	ui->lineEdit_QTV_prop_string->setText(lineEdit_QTV_prop_string);
	QString lineEdit_QTV_lineLat1 = settings.value("ui/lineEdit_QTV_lineLat1","0").toString();
	ui->lineEdit_QTV_lineLat1->setText(lineEdit_QTV_lineLat1);
	QString lineEdit_QTV_lineLat2 = settings.value("ui/lineEdit_QTV_lineLat2","0").toString();
	ui->lineEdit_QTV_lineLat2->setText(lineEdit_QTV_lineLat2);
	QString lineEdit_QTV_lineLon1 = settings.value("ui/lineEdit_QTV_lineLon1","0").toString();
	ui->lineEdit_QTV_lineLon1->setText(lineEdit_QTV_lineLon1);
	QString lineEdit_QTV_lineLon2 = settings.value("ui/lineEdit_QTV_lineLon2","0").toString();
	ui->lineEdit_QTV_lineLon2->setText(lineEdit_QTV_lineLon2);
	int spinBox_QTV_penWidth = settings.value("ui/spinBox_QTV_penWidth",3).toInt();
	ui->spinBox_QTV_penWidth->setValue(spinBox_QTV_penWidth);
	int comboBox_QTV_linePad = settings.value("ui/comboBox_QTV_linePad",1).toInt();
	ui->comboBox_QTV_linePad->setCurrentIndex(comboBox_QTV_linePad);
	int comboBox_QTV_fillPad = settings.value("ui/comboBox_QTV_fillPad",1).toInt();
	ui->comboBox_QTV_fillPad->setCurrentIndex(comboBox_QTV_fillPad);

	QString plainTextEdit_QTV_corners = settings.value("ui/plainTextEdit_QTV_corners","0").toString();
	ui->plainTextEdit_QTV_corners->setPlainText(plainTextEdit_QTV_corners);

	int spinBox_QTV_fontSize = settings.value("ui/spinBox_QTV_fontSize",9).toInt();
	ui->spinBox_QTV_fontSize->setValue(spinBox_QTV_fontSize);

	int spinBox_QTV_textWeight = settings.value("ui/spinBox_QTV_textWeight",16).toInt();
	ui->spinBox_QTV_textWeight->setValue(spinBox_QTV_textWeight);

	QString lineEdit_QTV_icon_lat = settings.value("ui/lineEdit_QTV_icon_lat","0").toString();
	ui->lineEdit_QTV_icon_lat->setText(lineEdit_QTV_icon_lat);
	QString lineEdit_QTV_icon_lon = settings.value("ui/lineEdit_QTV_icon_lon","0").toString();
	ui->lineEdit_QTV_icon_lon->setText(lineEdit_QTV_icon_lon);
	QString lineEdit_QTV_icon_scale = settings.value("ui/lineEdit_QTV_icon_scale","1.0").toString();
	ui->lineEdit_QTV_icon_scale->setText(lineEdit_QTV_icon_scale);
	QString lineEdit_QTV_icon_rotate = settings.value("ui/lineEdit_QTV_icon_rotate","1.0").toString();
	ui->lineEdit_QTV_icon_rotate->setText(lineEdit_QTV_icon_rotate);

	int checkBox_QTV_multiline = settings.value("ui/checkBox_QTV_multiline",0).toInt();
	ui->checkBox_QTV_multiline->setChecked(checkBox_QTV_multiline?true:false);

	int checkBox_QTV_acceptHoverEvent = settings.value("ui/checkBox_QTV_acceptHoverEvent",0).toInt();
	ui->checkBox_QTV_acceptHoverEvent->setChecked(checkBox_QTV_acceptHoverEvent?true:false);
}