|
|
@ -23,7 +23,7 @@
|
|
|
|
#include <tqtoolbutton.h>
|
|
|
|
#include <tqtoolbutton.h>
|
|
|
|
#include <tqspinbox.h>
|
|
|
|
#include <tqspinbox.h>
|
|
|
|
#include <tqdatetime.h>
|
|
|
|
#include <tqdatetime.h>
|
|
|
|
#include <tqlayout.h>
|
|
|
|
#include <layout.h>
|
|
|
|
#include <tqwhatsthis.h>
|
|
|
|
#include <tqwhatsthis.h>
|
|
|
|
#include <tqstring.h>
|
|
|
|
#include <tqstring.h>
|
|
|
|
#include <tqlabel.h>
|
|
|
|
#include <tqlabel.h>
|
|
|
@ -132,17 +132,17 @@ KnowitPreferences::KnowitPreferences()
|
|
|
|
: KDialogBase(IconList, i18n("KnowIt Preferences"), Ok|Cancel, Ok)
|
|
|
|
: KDialogBase(IconList, i18n("KnowIt Preferences"), Ok|Cancel, Ok)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQFrame* page;
|
|
|
|
TQFrame* page;
|
|
|
|
TQVBoxLayout* tqlayout;
|
|
|
|
TQVBoxLayout* layout;
|
|
|
|
|
|
|
|
|
|
|
|
/* first page: General */
|
|
|
|
/* first page: General */
|
|
|
|
page = addPage(i18n("General"), i18n("General options"),
|
|
|
|
page = addPage(i18n("General"), i18n("General options"),
|
|
|
|
KGlobal::iconLoader()->loadIcon(TQString("configure"), KIcon::Toolbar, KIcon::SizeMedium));
|
|
|
|
KGlobal::iconLoader()->loadIcon(TQString("configure"), KIcon::Toolbar, KIcon::SizeMedium));
|
|
|
|
tqlayout = new TQVBoxLayout(page, 0, spacingHint());
|
|
|
|
layout = new TQVBoxLayout(page, 0, spacingHint());
|
|
|
|
tqlayout->addWidget(docked = new TQCheckBox(i18n("&Dock in System tray"), page, "Dock"));
|
|
|
|
layout->addWidget(docked = new TQCheckBox(i18n("&Dock in System tray"), page, "Dock"));
|
|
|
|
tqlayout->addWidget(reopen = new TQCheckBox(i18n("Open &last file on startup"), page, "Reopen"));
|
|
|
|
layout->addWidget(reopen = new TQCheckBox(i18n("Open &last file on startup"), page, "Reopen"));
|
|
|
|
|
|
|
|
|
|
|
|
TQHBox* autosaveBox = new TQHBox(page);
|
|
|
|
TQHBox* autosaveBox = new TQHBox(page);
|
|
|
|
tqlayout->addWidget(autosaveBox);
|
|
|
|
layout->addWidget(autosaveBox);
|
|
|
|
new TQLabel(i18n("Autosave:"), autosaveBox);
|
|
|
|
new TQLabel(i18n("Autosave:"), autosaveBox);
|
|
|
|
autosave = new TQSpinBox(0, 120, 5, autosaveBox, "Autosave");
|
|
|
|
autosave = new TQSpinBox(0, 120, 5, autosaveBox, "Autosave");
|
|
|
|
autosave->setPrefix(i18n("every "));
|
|
|
|
autosave->setPrefix(i18n("every "));
|
|
|
@ -151,32 +151,32 @@ KnowitPreferences::KnowitPreferences()
|
|
|
|
TQWhatsThis::add(autosave, i18n("Current file will be automatically saved "
|
|
|
|
TQWhatsThis::add(autosave, i18n("Current file will be automatically saved "
|
|
|
|
"after the specified interval. Set to <i>never</i> to disable autosave."));
|
|
|
|
"after the specified interval. Set to <i>never</i> to disable autosave."));
|
|
|
|
|
|
|
|
|
|
|
|
tqlayout->addWidget(unconditionalSave = new TQCheckBox(i18n("Automatically save file on e&xit"),
|
|
|
|
layout->addWidget(unconditionalSave = new TQCheckBox(i18n("Automatically save file on e&xit"),
|
|
|
|
page, "UnconditionalSave"));
|
|
|
|
page, "UnconditionalSave"));
|
|
|
|
TQWhatsThis::add(unconditionalSave, i18n("Current file will be automatically saved "
|
|
|
|
TQWhatsThis::add(unconditionalSave, i18n("Current file will be automatically saved "
|
|
|
|
"on exit without confirmation."));
|
|
|
|
"on exit without confirmation."));
|
|
|
|
tqlayout->addWidget(backup = new TQCheckBox(i18n("Create &backups"),
|
|
|
|
layout->addWidget(backup = new TQCheckBox(i18n("Create &backups"),
|
|
|
|
page, "Backup"));
|
|
|
|
page, "Backup"));
|
|
|
|
TQWhatsThis::add(backup, i18n("Create backup of current document before it is saved."));
|
|
|
|
TQWhatsThis::add(backup, i18n("Create backup of current document before it is saved."));
|
|
|
|
tqlayout->addWidget(multipleInstances = new TQCheckBox(i18n("Allow &multiple instances of KnowIt"),
|
|
|
|
layout->addWidget(multipleInstances = new TQCheckBox(i18n("Allow &multiple instances of KnowIt"),
|
|
|
|
page, "Instances"));
|
|
|
|
page, "Instances"));
|
|
|
|
TQWhatsThis::add(multipleInstances, i18n("If this option is disabled, only one "
|
|
|
|
TQWhatsThis::add(multipleInstances, i18n("If this option is disabled, only one "
|
|
|
|
"instance of KnowIt will be allowed. If there is another instance already running, "
|
|
|
|
"instance of KnowIt will be allowed. If there is another instance already running, "
|
|
|
|
"it will be automatically activated instead of running new one."));
|
|
|
|
"it will be automatically activated instead of running new one."));
|
|
|
|
tqlayout->addStretch(1);
|
|
|
|
layout->addStretch(1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* second page: Interface */
|
|
|
|
/* second page: Interface */
|
|
|
|
page = addPage(i18n("Interface"), i18n("Interface options"),
|
|
|
|
page = addPage(i18n("Interface"), i18n("Interface options"),
|
|
|
|
KGlobal::iconLoader()->loadIcon(TQString("misc"), KIcon::Toolbar, KIcon::SizeMedium));
|
|
|
|
KGlobal::iconLoader()->loadIcon(TQString("misc"), KIcon::Toolbar, KIcon::SizeMedium));
|
|
|
|
tqlayout = new TQVBoxLayout(page, 0, spacingHint());
|
|
|
|
layout = new TQVBoxLayout(page, 0, spacingHint());
|
|
|
|
tqlayout->addWidget(horizontalSplit = new TQCheckBox(i18n("Split window &horizontally"), page, "Split"));
|
|
|
|
layout->addWidget(horizontalSplit = new TQCheckBox(i18n("Split window &horizontally"), page, "Split"));
|
|
|
|
TQWhatsThis::add(horizontalSplit, i18n("If this option is set, notes tree will "
|
|
|
|
TQWhatsThis::add(horizontalSplit, i18n("If this option is set, notes tree will "
|
|
|
|
"be displayed on the left and the editor on the right (this is default).<br>"
|
|
|
|
"be displayed on the left and the editor on the right (this is default).<br>"
|
|
|
|
"Otherwise notes tree will be displayed at the top and the editor at the bottom."));
|
|
|
|
"Otherwise notes tree will be displayed at the top and the editor at the bottom."));
|
|
|
|
|
|
|
|
|
|
|
|
TQHBox* defaultNameBox = new TQHBox(page);
|
|
|
|
TQHBox* defaultNameBox = new TQHBox(page);
|
|
|
|
tqlayout->addWidget(defaultNameBox);
|
|
|
|
layout->addWidget(defaultNameBox);
|
|
|
|
new TQLabel(i18n("Default note name:"), defaultNameBox);
|
|
|
|
new TQLabel(i18n("Default note name:"), defaultNameBox);
|
|
|
|
defaultName = new KLineEdit(defaultNameBox, "DefaultName");
|
|
|
|
defaultName = new KLineEdit(defaultNameBox, "DefaultName");
|
|
|
|
TQWhatsThis::add(defaultName, i18n("Default name for new notes. It would be "
|
|
|
|
TQWhatsThis::add(defaultName, i18n("Default name for new notes. It would be "
|
|
|
@ -184,7 +184,7 @@ KnowitPreferences::KnowitPreferences()
|
|
|
|
"consider setting default name to none."));
|
|
|
|
"consider setting default name to none."));
|
|
|
|
|
|
|
|
|
|
|
|
TQHBox* linkBox = new TQHBox(page);
|
|
|
|
TQHBox* linkBox = new TQHBox(page);
|
|
|
|
tqlayout->addWidget(linkBox);
|
|
|
|
layout->addWidget(linkBox);
|
|
|
|
new TQLabel(i18n("Link format:"), linkBox);
|
|
|
|
new TQLabel(i18n("Link format:"), linkBox);
|
|
|
|
linkFormat = new KComboBox(linkBox, "LinkFormat");
|
|
|
|
linkFormat = new KComboBox(linkBox, "LinkFormat");
|
|
|
|
linkFormat->insertItem(i18n("Description (link)"));
|
|
|
|
linkFormat->insertItem(i18n("Description (link)"));
|
|
|
@ -193,31 +193,31 @@ KnowitPreferences::KnowitPreferences()
|
|
|
|
linkFormat->insertItem(i18n("Description only"));
|
|
|
|
linkFormat->insertItem(i18n("Description only"));
|
|
|
|
|
|
|
|
|
|
|
|
TQHBox* alternateBox = new TQHBox(page);
|
|
|
|
TQHBox* alternateBox = new TQHBox(page);
|
|
|
|
tqlayout->addWidget(alternateBox);
|
|
|
|
layout->addWidget(alternateBox);
|
|
|
|
alternateTree = new TQCheckBox(i18n("Alternate colors in tree"), alternateBox, "Alternate");
|
|
|
|
alternateTree = new TQCheckBox(i18n("Alternate colors in tree"), alternateBox, "Alternate");
|
|
|
|
alternateColor = new KColorButton(TQColor("White"), alternateBox, "AlternateColor");
|
|
|
|
alternateColor = new KColorButton(TQColor("White"), alternateBox, "AlternateColor");
|
|
|
|
|
|
|
|
|
|
|
|
tqlayout->addWidget(autoCollapse = new TQCheckBox(i18n("Automatically collapse other notes"), page, "AutoCollapse"));
|
|
|
|
layout->addWidget(autoCollapse = new TQCheckBox(i18n("Automatically collapse other notes"), page, "AutoCollapse"));
|
|
|
|
TQWhatsThis::add(autoCollapse, i18n("If this option is set, only current subtree "
|
|
|
|
TQWhatsThis::add(autoCollapse, i18n("If this option is set, only current subtree "
|
|
|
|
"will be visible, other notes will be automatically collapsed."));
|
|
|
|
"will be visible, other notes will be automatically collapsed."));
|
|
|
|
tqlayout->addStretch(1);
|
|
|
|
layout->addStretch(1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* third page: Editor */
|
|
|
|
/* third page: Editor */
|
|
|
|
page = addPage(i18n("Editor"), i18n("Editor options"),
|
|
|
|
page = addPage(i18n("Editor"), i18n("Editor options"),
|
|
|
|
KGlobal::iconLoader()->loadIcon(TQString("edit"), KIcon::Toolbar, KIcon::SizeMedium));
|
|
|
|
KGlobal::iconLoader()->loadIcon(TQString("edit"), KIcon::Toolbar, KIcon::SizeMedium));
|
|
|
|
tqlayout = new TQVBoxLayout(page, 0, spacingHint());
|
|
|
|
layout = new TQVBoxLayout(page, 0, spacingHint());
|
|
|
|
tqlayout->addWidget(wordwrap = new TQCheckBox(i18n("Use &word wrap"),
|
|
|
|
layout->addWidget(wordwrap = new TQCheckBox(i18n("Use &word wrap"),
|
|
|
|
page, "WordWrap"));
|
|
|
|
page, "WordWrap"));
|
|
|
|
tqlayout->addWidget(enterBreakLine = new TQCheckBox(i18n("'Enter' ends current line, not paragraph"),
|
|
|
|
layout->addWidget(enterBreakLine = new TQCheckBox(i18n("'Enter' ends current line, not paragraph"),
|
|
|
|
page, "EnterLineBreak"));
|
|
|
|
page, "EnterLineBreak"));
|
|
|
|
tqlayout->addWidget(tabfocus = new TQCheckBox(i18n("'Tab' in editor changes focus"),
|
|
|
|
layout->addWidget(tabfocus = new TQCheckBox(i18n("'Tab' in editor changes focus"),
|
|
|
|
page, "TabFocus"));
|
|
|
|
page, "TabFocus"));
|
|
|
|
#if TDE_VERSION_MAJOR == 3 && TDE_VERSION_MINOR < 1
|
|
|
|
#if TDE_VERSION_MAJOR == 3 && TDE_VERSION_MINOR < 1
|
|
|
|
tabfocus->hide();
|
|
|
|
tabfocus->hide();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
TQHBox* colorBox = new TQHBox(page);
|
|
|
|
TQHBox* colorBox = new TQHBox(page);
|
|
|
|
tqlayout->addWidget(colorBox);
|
|
|
|
layout->addWidget(colorBox);
|
|
|
|
customColors = new TQCheckBox(i18n("Use &custom colors"), colorBox, "CustomColors");
|
|
|
|
customColors = new TQCheckBox(i18n("Use &custom colors"), colorBox, "CustomColors");
|
|
|
|
editColors = new KDualColorButton(colorBox);
|
|
|
|
editColors = new KDualColorButton(colorBox);
|
|
|
|
|
|
|
|
|
|
|
@ -226,7 +226,7 @@ KnowitPreferences::KnowitPreferences()
|
|
|
|
KFontChooser::getFontList(fontList, false);
|
|
|
|
KFontChooser::getFontList(fontList, false);
|
|
|
|
|
|
|
|
|
|
|
|
TQHBox* fontBox = new TQHBox(page);
|
|
|
|
TQHBox* fontBox = new TQHBox(page);
|
|
|
|
tqlayout->addWidget(fontBox);
|
|
|
|
layout->addWidget(fontBox);
|
|
|
|
customFont = new TQCheckBox(i18n("Use custom font:"), fontBox, "customFont");
|
|
|
|
customFont = new TQCheckBox(i18n("Use custom font:"), fontBox, "customFont");
|
|
|
|
fontFamily = new KComboBox(true, fontBox);
|
|
|
|
fontFamily = new KComboBox(true, fontBox);
|
|
|
|
fontFamily->insertStringList(fontList);
|
|
|
|
fontFamily->insertStringList(fontList);
|
|
|
@ -235,13 +235,13 @@ KnowitPreferences::KnowitPreferences()
|
|
|
|
fontSize->insertItem(TQString(TQString().setNum(fontSizes[i])),i);
|
|
|
|
fontSize->insertItem(TQString(TQString().setNum(fontSizes[i])),i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tqlayout->addStretch(1);
|
|
|
|
layout->addStretch(1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* fourth page: Templates */
|
|
|
|
/* fourth page: Templates */
|
|
|
|
page = addPage(i18n("Templates"), i18n("Templates configuration"),
|
|
|
|
page = addPage(i18n("Templates"), i18n("Templates configuration"),
|
|
|
|
KGlobal::iconLoader()->loadIcon(TQString("wizard"), KIcon::Toolbar, KIcon::SizeMedium));
|
|
|
|
KGlobal::iconLoader()->loadIcon(TQString("wizard"), KIcon::Toolbar, KIcon::SizeMedium));
|
|
|
|
tqlayout = new TQVBoxLayout(page, 0, spacingHint());
|
|
|
|
layout = new TQVBoxLayout(page, 0, spacingHint());
|
|
|
|
TQWhatsThis::add(page, i18n("<html>\n"
|
|
|
|
TQWhatsThis::add(page, i18n("<html>\n"
|
|
|
|
"<p>These expressions may be used: </p>\n"
|
|
|
|
"<p>These expressions may be used: </p>\n"
|
|
|
|
"<table>\n"
|
|
|
|
"<table>\n"
|
|
|
@ -266,13 +266,13 @@ KnowitPreferences::KnowitPreferences()
|
|
|
|
"</table></html>"));
|
|
|
|
"</table></html>"));
|
|
|
|
|
|
|
|
|
|
|
|
TQHBox* topBox = new TQHBox(page);
|
|
|
|
TQHBox* topBox = new TQHBox(page);
|
|
|
|
tqlayout->addWidget(topBox);
|
|
|
|
layout->addWidget(topBox);
|
|
|
|
TQLabel * label1 = new TQLabel(i18n("Date Format: "), topBox);
|
|
|
|
TQLabel * label1 = new TQLabel(i18n("Date Format: "), topBox);
|
|
|
|
label1->setFixedSize(label1->tqsizeHint());
|
|
|
|
label1->setFixedSize(label1->sizeHint());
|
|
|
|
insertDatePreview = new TQLabel("", topBox);
|
|
|
|
insertDatePreview = new TQLabel("", topBox);
|
|
|
|
|
|
|
|
|
|
|
|
TQHBox *tmpBox = new TQHBox(page);
|
|
|
|
TQHBox *tmpBox = new TQHBox(page);
|
|
|
|
tqlayout->addWidget(tmpBox);
|
|
|
|
layout->addWidget(tmpBox);
|
|
|
|
insertDateColorButton = new KColorButton(TQColor("Blue"), tmpBox, "InsertDateColorButton");
|
|
|
|
insertDateColorButton = new KColorButton(TQColor("Blue"), tmpBox, "InsertDateColorButton");
|
|
|
|
insertDateFormatEdit = new KLineEdit(tmpBox, "InsertDateFormatEdit");
|
|
|
|
insertDateFormatEdit = new KLineEdit(tmpBox, "InsertDateFormatEdit");
|
|
|
|
insertDateItalicButton = new TQToolButton(tmpBox,"InsertDateItalicButton");
|
|
|
|
insertDateItalicButton = new TQToolButton(tmpBox,"InsertDateItalicButton");
|
|
|
@ -284,9 +284,9 @@ KnowitPreferences::KnowitPreferences()
|
|
|
|
insertDateUnderlineButton = new TQToolButton(tmpBox, "InsertDateUnderlineButton");
|
|
|
|
insertDateUnderlineButton = new TQToolButton(tmpBox, "InsertDateUnderlineButton");
|
|
|
|
insertDateUnderlineButton->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("text_under", KIcon::Toolbar)));
|
|
|
|
insertDateUnderlineButton->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("text_under", KIcon::Toolbar)));
|
|
|
|
insertDateUnderlineButton->setToggleButton(true);
|
|
|
|
insertDateUnderlineButton->setToggleButton(true);
|
|
|
|
insertDateColorButton->setFixedSize(insertDateBoldButton->tqsizeHint());
|
|
|
|
insertDateColorButton->setFixedSize(insertDateBoldButton->sizeHint());
|
|
|
|
insertDateFormatEdit->setMinimumWidth(6*insertDateBoldButton->tqsizeHint().width());
|
|
|
|
insertDateFormatEdit->setMinimumWidth(6*insertDateBoldButton->sizeHint().width());
|
|
|
|
tqlayout->addStretch(1);
|
|
|
|
layout->addStretch(1);
|
|
|
|
|
|
|
|
|
|
|
|
setIconListAllVisible(true);
|
|
|
|
setIconListAllVisible(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -379,7 +379,7 @@ void KnowitPreferences::slotUpdateDatePreview()
|
|
|
|
if(insertDateItalicButton->isOn()) str +="<i>";
|
|
|
|
if(insertDateItalicButton->isOn()) str +="<i>";
|
|
|
|
if(insertDateUnderlineButton->isOn()) str += "<u>";
|
|
|
|
if(insertDateUnderlineButton->isOn()) str += "<u>";
|
|
|
|
str += "<font COLOR=\""+insertDateColorButton->color().name()+"\">";
|
|
|
|
str += "<font COLOR=\""+insertDateColorButton->color().name()+"\">";
|
|
|
|
str += TQString("%1").tqarg(TQDateTime::tqcurrentDateTime().toString(insertDateFormatEdit->text()));
|
|
|
|
str += TQString("%1").arg(TQDateTime::currentDateTime().toString(insertDateFormatEdit->text()));
|
|
|
|
str += "</font>";
|
|
|
|
str += "</font>";
|
|
|
|
if(insertDateUnderlineButton->isOn()) str += "</u>";
|
|
|
|
if(insertDateUnderlineButton->isOn()) str += "</u>";
|
|
|
|
if(insertDateItalicButton->isOn()) str +="</i>";
|
|
|
|
if(insertDateItalicButton->isOn()) str +="</i>";
|
|
|
|