summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/libkate/view/kateviewdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/view/kateviewdialog.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
index a85fb87..8e68262 100644
--- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
+++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
@@ -346,226 +346,226 @@ void SelectConfigTab::getData(KateView *view) {
if (opt[z]->isChecked()) configFlags |= flags[z]; // set flag if checked
}
view->setConfig(configFlags);
}
const int EditConfigTab::flags[] = {KateView::cfWordWrap, KateView::cfReplaceTabs, KateView::cfRemoveSpaces,
KateView::cfAutoBrackets, KateView::cfGroupUndo, KateView::cfShowTabs, KateView::cfSmartHome,
KateView::cfPageUDMovesCursor, KateView::cfWrapCursor};
EditConfigTab::EditConfigTab(QWidget *parent, KateView *view)
: QWidget(parent, 0L) {
QHBoxLayout *mainLayout;
QVBoxLayout *cbLayout, *leLayout;
int configFlags;
mainLayout = new QHBoxLayout(this, 0, KDialog::spacingHint() );
// checkboxes
cbLayout = new QVBoxLayout( mainLayout );
configFlags = view->config();
opt[0] = new QCheckBox(i18n("&Word wrap"), this);
cbLayout->addWidget(opt[0], 0, AlignLeft);
opt[0]->setChecked(view->doc()->wordWrap());
opt[1] = new QCheckBox(i18n("Replace &tabs with spaces"), this);
cbLayout->addWidget(opt[1], 0, AlignLeft);
opt[1]->setChecked(configFlags & flags[1]);
opt[2] = new QCheckBox(i18n("&Remove trailing spaces"), this);
cbLayout->addWidget(opt[2], 0, AlignLeft);
opt[2]->setChecked(configFlags & flags[2]);
opt[3] = new QCheckBox(i18n("&Auto brackets"), this);
cbLayout->addWidget(opt[3], 0, AlignLeft);
opt[3]->setChecked(configFlags & flags[3]);
opt[4] = new QCheckBox(i18n("Group &undos"), this);
cbLayout->addWidget(opt[4], 0, AlignLeft);
opt[4]->setChecked(configFlags & flags[4]);
opt[5] = new QCheckBox(i18n("&Show tabs"), this);
cbLayout->addWidget(opt[5], 0, AlignLeft);
opt[5]->setChecked(configFlags & flags[5]);
opt[6] = new QCheckBox(i18n("Smart &home"), this);
cbLayout->addWidget(opt[6], 0, AlignLeft);
opt[6]->setChecked(configFlags & flags[6]);
opt[7] = new QCheckBox(i18n("&Page up/down moves cursor"), this);
cbLayout->addWidget(opt[7], 0, AlignLeft);
opt[7]->setChecked(configFlags & flags[7]);
opt[8] = new QCheckBox(i18n("Wrap &cursor"), this);
cbLayout->addWidget(opt[8], 0, AlignLeft);
opt[8]->setChecked(configFlags & flags[8]);
cbLayout->addStretch();
// edit lines
leLayout = new QVBoxLayout();
mainLayout->addLayout(leLayout,10);
e1 = new QSpinBox(this);
e1->setMinValue(20);
e1->setMaxValue( 200);
e1->setValue((int)(view->doc()->wordWrapAt()));
#warning fixme e1->setLabel(i18n("Wrap Words At:"));
e2 = new QSpinBox(this);
e2->setMinValue(1);
e2->setMaxValue(16);
e2->setValue((int)view->tabWidth());
#warning fixme e2->setLabel(i18n("Tab/Indent Width:"));
e3 = new QSpinBox(this);
e3->setMinValue(5);
e3->setMaxValue( 30000);
#warning fixme e3->setLabel(i18n("Undo steps:"));
e3->setValue((int)view->undoSteps());
leLayout->addWidget(e1, 0, AlignLeft);
leLayout->addWidget(e2, 0, AlignLeft);
leLayout->addWidget(e3, 0, AlignLeft);
QVBox *box = new QVBox (this);
leLayout->addWidget (box, 0, AlignLeft);
new QLabel (i18n("Encoding:"), box);
encoding = new QComboBox(box);
#warning fixme
#if 0
encoding->insertStringList (KGlobal::charsets()->availableEncodingNames());
encoding->setCurrentItem (KGlobal::charsets()->availableEncodingNames().findIndex(view->doc()->encoding()));
#endif
leLayout->addStretch();
// What is this? help
QWhatsThis::add(opt[0], i18n("Word wrap is a feature that causes the editor to automatically start a new line of text and move (wrap) the cursor to the beginning of that new line. KateView will automatically start a new line of text when the current line reaches the length specified by the Wrap Words At: option.<p><b>NOTE:<b> Word Wrap will not change existing lines or wrap them for easy reading as in some applications."));
QWhatsThis::add(e1, i18n("If the Word Wrap option is selected this entry determines the length (in characters) at which the editor will automatically start a new line."));
QWhatsThis::add(opt[1], i18n("KateView will replace any tabs with the number of spaces indicated in the Tab Width: entry."));
QWhatsThis::add(e2, i18n("If the Replace Tabs By Spaces option is selected this entry determines the number of spaces with which the editor will automatically replace tabs."));
QWhatsThis::add(opt[2], i18n("KateView will automatically eliminate extra spaces at the ends of lines of text."));
QWhatsThis::add(opt[3], i18n("When the user types a left bracket ([,(, or {) KateView automatically enters the right bracket (}, ), or ]) to the right of the cursor."));
QWhatsThis::add(opt[4], i18n("Checking this will cause sequences of similar actions to be undone at once."));
QWhatsThis::add(opt[5], i18n("The editor will display a symbol to indicate the presence of a tab in the text."));
QWhatsThis::add(opt[6], i18n("Not yet implemented."));
QWhatsThis::add(opt[7], i18n("If this is selected, the insertion cursor will be moved to the first/last line when pressing the page up/down buttons.<p>If not selected, it will remain at it's relative position in the visible text."));
QWhatsThis::add(e3, i18n("Sets the number of undo/redo steps to record. More steps uses more memory."));
QWhatsThis::add(opt[8], i18n("When on, moving the insertion cursor using the <b>Left</b> and <b>Right</b> keys will go on to previous/next line at beginning/end of the line, similar to most editors.<p>When off, the insertion cursor cannot be moved left of the line start, but it can be moved off the line end, which can be very handy for programmers."));
}
void EditConfigTab::getData(KateView *view)
{
int configFlags, z;
configFlags = view->config();
for (z = 1; z < numFlags; z++) {
configFlags &= ~flags[z];
if (opt[z]->isChecked()) configFlags |= flags[z];
}
view->setConfig(configFlags);
view->setEncoding (encoding->currentText());
view->doc()->setWordWrapAt(e1->value());
view->doc()->setWordWrap (opt[0]->isChecked());
view->setTabWidth(e2->value());
view->setUndoSteps(e3->value());
}
ColorConfig::ColorConfig( QWidget *parent, char *name )
: QWidget( parent, name )
{
QGridLayout *glay = new QGridLayout( this, 6, 2, 0, KDialog::spacingHint());
glay->setColStretch(1,1);
glay->setRowStretch(5,1);
QLabel *label;
label = new QLabel( i18n("Background:"), this);
label->setAlignment( AlignRight|AlignVCenter );
m_back = new KColorButton( this );
glay->addWidget( label, 0, 0 );
glay->addWidget( m_back, 0, 1 );
label = new QLabel( i18n("Selected:"), this);
label->setAlignment( AlignRight|AlignVCenter );
m_selected = new KColorButton( this );
glay->addWidget( label, 2, 0 );
glay->addWidget( m_selected, 2, 1 );
// QWhatsThis help
QWhatsThis::add(m_back, i18n("Sets the background color of the editing area"));
QWhatsThis::add(m_selected, i18n("Sets the background color of the selection. To set the text color for selected text, use the &quot;<b>Configure Highlighting</b>&quot; dialog."));
}
ColorConfig::~ColorConfig()
{
}
void ColorConfig::setColors(QColor *colors)
{
m_back->setColor( colors[0] );
m_selected->setColor( colors[1] );
}
void ColorConfig::getColors(QColor *colors)
{
colors[0] = m_back->color();
colors[1] = m_selected->color();
}
FontConfig::FontConfig( QWidget *parent, char *name )
: QWidget( parent, name )
{
// sizemanagment
QGridLayout *grid = new QGridLayout( this, 1, 1 );
// QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" );
// QString styleStr = cfg. readEntry ( "FontStyle", "Regular" );
// int size = cfg. readNumEntry ( "FontSize", 10 );
// OFontSelector *m_fontselect;
m_fontselect = new Opie::OFontSelector ( false, this, "FontTab" );
// m_fontselect-> setSelectedFont ( familyStr, styleStr, size );
// QWhatsThis::add( m_fontselect,
// tr( "Select the desired name, style and size of the default font applications will use." ) );
- connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )),
- this, SLOT( slotFontSelected( const QFont & )));
+ connect( m_fontselect, SIGNAL( fontSelected(const QFont&)),
+ this, SLOT( slotFontSelected(const QFont&)));
grid->addWidget( m_fontselect, 0, 0);
// #if 0
// m_fontchooser = new KFontChooser ( this );
// m_fontchooser->enableColumn(KFontChooser::StyleList, false);
// grid->addWidget( m_fontchooser, 0, 0);
-// connect (m_fontchooser, SIGNAL (fontSelected( const QFont & )), this, SLOT (slotFontSelected( const QFont & )));
+// connect (m_fontchooser, SIGNAL (fontSelected(const QFont&)), this, SLOT (slotFontSelected(const QFont&)));
// #endif
}
FontConfig::~FontConfig()
{
}
void FontConfig::setFont ( const QFont &font )
{
//#if 0
m_fontselect->setFont (font);
myFont = font;
//#endif
}
void FontConfig::slotFontSelected( const QFont &font )
{
myFont = font;
}