PlainTextInfoPage::PlainTextInfoPage(ZLOptionsDialog &dialog, const std::string &fileName, const ZLResourceKey &key, bool showContentsEntry) : myFormat(fileName) {
	if (!myFormat.initialized()) {
		PlainTextFormatDetector detector;
		shared_ptr<ZLInputStream> stream = ZLFile(fileName).inputStream();
		if (stream) {
			detector.detect(*stream, myFormat);
		}
	}

	ZLDialogContent &tab = dialog.createTab(key);

	BreakTypeOptionEntry *breakEntry = new BreakTypeOptionEntry(*this, myFormat.BreakTypeOption);
	myIgnoredIndentEntry = new ZLSimpleSpinOptionEntry(myFormat.IgnoredIndentOption, 1);
	tab.addOption(ZLResourceKey("breakType"), breakEntry);
	tab.addOption(ZLResourceKey("ignoreIndent"), myIgnoredIndentEntry);
	breakEntry->onValueSelected(breakEntry->initialIndex());

	if (showContentsEntry) {
		CreateContentsTableOptionEntry *contentsTableEntry = new CreateContentsTableOptionEntry(*this, myFormat.CreateContentsTableOption);
		myEmptyLinesBeforeNewSectionEntry = new ZLSimpleSpinOptionEntry(myFormat.EmptyLinesBeforeNewSectionOption, 1);
		tab.addOption(ZLResourceKey("buildTOC"), contentsTableEntry);
		tab.addOption(ZLResourceKey("emptyLines"), myEmptyLinesBeforeNewSectionEntry);
		contentsTableEntry->onStateChanged(contentsTableEntry->initialState());
	}
}
void ZLGtkApplicationWindow::buildTabs(ZLOptionsDialog &dialog) {
	ZLDialogContent &tab = dialog.createTab(ZLResourceKey("Maemo"));
	tab.addOption(
		ZLResourceKey("keyActionOnRelease"),
		KeyActionOnReleaseNotOnPressOption
	);
	tab.addOption(
		ZLResourceKey("minStylusPressure"),
		new ZLSimpleSpinOptionEntry(myViewWidget->MinPressureOption, 1)
	);
	tab.addOption(
		ZLResourceKey("maxStylusPressure"),
		new ZLSimpleSpinOptionEntry(myViewWidget->MaxPressureOption, 1)
	);
}