Exemplo n.º 1
0
bool mainwid::readFromFile(QString& path){
	XmlParser xf;
	if(xf.open(config_file_path) == false){
		return false;
	}
	xf.loadXmlData();
	path = xf.getAlarmFile();
	return true;
}
Exemplo n.º 2
0
configDialog::configDialog(QWidget* parent):
    QDialog(parent)
{
    audioFileEdit = new QLineEdit();audioFileEdit->setReadOnly(true);
	
	notificationCheck = new QCheckBox("Notification");
	connect(notificationCheck,SIGNAL(stateChanged(int)),this,SLOT(notificationCheckChanged(int)));
	
		/*xml read*/	
	XmlParser xf;
	xf.open(config_file_path);
	xf.loadXmlData();
	audioFileEdit->setText(xf.getAlarmFile());

	if(xf.getCheckbox(QString::fromStdString("notification")) == true){
		notificationCheck->setChecked(true);
	}else{
		notificationCheck->setChecked(false);
	}
		/*--------*/

    QString a = QCoreApplication::applicationFilePath();
    audioFileEditLabel = new QLabel(tr("audio file"));
    audioFileEditCallPathDialogButton = new QPushButton(tr("Choice"));

    connect(audioFileEditCallPathDialogButton,SIGNAL(clicked()),this,SLOT(audioFileEditCallPathDialogButton_is_Pushed()));



    QHBoxLayout *audioFileEditLayout = new QHBoxLayout();
    audioFileEditLayout->addWidget(audioFileEditLabel);
    audioFileEditLayout->addWidget(audioFileEdit);
    audioFileEditLayout->addWidget(audioFileEditCallPathDialogButton);

	QVBoxLayout *checkboxes = new QVBoxLayout();
	checkboxes->addWidget(notificationCheck);

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->addLayout(audioFileEditLayout);
	mainLayout->addSpacing(12);
	mainLayout->addLayout(checkboxes);

    setLayout(mainLayout);
};