Beispiel #1
0
Settings::Settings(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Settings)
{
    ui->setupUi(this);
    winM = false;
    ui->cmbP1->setItemData(3, 0, Qt::UserRole - 1);
    ui->cmbP2->setItemData(3, 0, Qt::UserRole - 1);
    loadSnFile();
    QMap<qint8, QString> map;
    QFile file("data/config.cf");
    file.open(QIODevice::ReadOnly);
    QDataStream in(&file);
    in.setVersion(QDataStream::Qt_5_3);
    in >> map;
    ui->spnWidth->setValue(map[0].toInt());
    ui->spnHeight->setValue(map[1].toInt());
    ui->cmbP1->setCurrentIndex(map[2].toInt());
    ui->cmbPS1->setCurrentIndex(map[3].toInt());
    ui->cmbP2->setCurrentIndex(map[4].toInt());
    ui->cmbPS2->setCurrentIndex(map[5].toInt());
    ui->lineUrl->setText(map[6]);
    ui->cmbLan->setCurrentIndex(map[7].toInt());
    loadLang(map[7].toInt());
    file.close();
}
Beispiel #2
0
int main(int argc, char **argv)
{
	int c, f = 0, error = 0;
	extern char *optarg;
	extern int optind;
	char isoqlogconf[256];


	while (!error && (c = getopt(argc,argv,"f:hv")) != -1) {
        	switch (c) {
        	case 'v':
			puts(VERSION_STRING);
	        	exit(0);
	        	break;
		case 'h':
			puts("Usage: isoqlog [-f isoqlog.conf]");
			exit(0);
			break;
		case 'f':
			strncpy(isoqlogconf, optarg, 256);
			f = 1;
       			break;
		default:
			error = 1;
			puts("Usage: isoqlog [-f isoqlog.conf]");
			exit(-1);
			break;
       		} 
	}

	general.from_cnt = 0;
	general.to_cnt = 0;
	general.from_byte = 0;
	
	if (f == 0) 
		readconfig(CONFIGFILE); /* CONFIGFILE variable is defined in config.h */
	else 
		readconfig(isoqlogconf);
	loadLang(langfile);

	if (strcmp(logtype, "qmail-multilog") == 0) 
		openlogdir(logstore);
	else
	if (strcmp(logtype, "qmail-syslog") == 0)
		readQmailLogFile(logstore);
	else
	if (strcmp(logtype, "sendmail") == 0)
		readSendmailLogFile(logstore);
	else
	if (strcmp(logtype, "postfix") == 0)
		readSendmailLogFile(logstore);
	else
        if (strcmp(logtype, "exim") == 0)
		readEximLogFile(logstore);

	createHtml();
	return 0;
}
Beispiel #3
0
void TranslationManager::loadCurrentLang()
{
    delete translator;
    translator = loadLang(getLang(), "");
    translator = loadLang(getLang(), "help/", translator);
}