summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/view/kateview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/libkate/view/kateview.cpp b/noncore/apps/tinykate/libkate/view/kateview.cpp
index c5673a5..b9ebb1a 100644
--- a/noncore/apps/tinykate/libkate/view/kateview.cpp
+++ b/noncore/apps/tinykate/libkate/view/kateview.cpp
@@ -2249,193 +2249,194 @@ void KateView::readSessionConfig(KateConfig *config)
cursor.y = config->readNumEntry("CursorY");
myViewInternal->updateCursor(cursor);
myIconBorder = config->readBoolEntry("IconBorder on");
setIconBorder(myIconBorder);
}
void KateView::writeSessionConfig(KateConfig *config)
{
config->writeEntry("XPos",myViewInternal->xPos);
config->writeEntry("YPos",myViewInternal->yPos);
config->writeEntry("CursorX",myViewInternal->cursor.x);
config->writeEntry("CursorY",myViewInternal->cursor.y);
config->writeEntry("IconBorder on", myIconBorder);
}
void KateView::configDialog()
{
#warning fixme
#if 1
KDialogBase *kd = new KDialogBase(KDialogBase::IconList,
i18n("Configure Editor"),
KDialogBase::Ok | KDialogBase::Cancel |
KDialogBase::Help ,
KDialogBase::Ok, this, "tabdialog");
// color options
QFrame *page=kd->addPage(i18n("Colors"));
(new QVBoxLayout(page))->setAutoAdd(true);
ColorConfig *colorConfig = new ColorConfig(page);
QColor* colors = getColors();
colorConfig->setColors(colors);
page = kd->addPage(i18n("Fonts"));
(new QVBoxLayout(page))->setAutoAdd(true);
FontConfig *fontConfig = new FontConfig(page);
fontConfig->setFont (myDoc->getFont());
// indent options
page=kd->addPage(i18n("Indent"));
(new QVBoxLayout(page))->setAutoAdd(true);
IndentConfigTab *indentConfig = new IndentConfigTab(page, this);
// select options
page=kd->addPage(i18n("Select"));
(new QVBoxLayout(page))->setAutoAdd(true);
SelectConfigTab *selectConfig = new SelectConfigTab(page, this);
// edit options
page=kd->addPage(i18n("Edit"));
(new QVBoxLayout(page))->setAutoAdd(true);
EditConfigTab *editConfig = new EditConfigTab(page, this);
HighlightDialogPage *hlPage;
HlManager *hlManager;
HlDataList hlDataList;
ItemStyleList defaultStyleList;
hlManager = HlManager::self();
defaultStyleList.setAutoDelete(true);
hlManager->getDefaults(defaultStyleList);
hlDataList.setAutoDelete(true);
//this gets the data from the KateConfig object
hlManager->getHlDataList(hlDataList);
page=kd->addPage(i18n("Highlighting"));
(new QVBoxLayout(page))->setAutoAdd(true);
hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, page);
if ( QPEApplication::execDialog( kd )) {
// color options
colorConfig->getColors(colors);
myDoc->setFont (fontConfig->getFont());
applyColors();
// indent options
indentConfig->getData(this);
// select options
selectConfig->getData(this);
// edit options
editConfig->getData(this);
// spell checker
hlManager->setHlDataList(hlDataList);
hlManager->setDefaults(defaultStyleList);
hlPage->saveData();
}
-// delete kd;
+ qApp->processEvents();
+ delete kd;
#endif
}
int KateView::getHl() {
return myDoc->highlightNum();
}
void KateView::setDontChangeHlOnSave()
{
myDoc->setDontChangeHlOnSave();
}
void KateView::setHl(int n) {
myDoc->setHighlight(n);
myDoc->setDontChangeHlOnSave();
myDoc->updateViews();
}
int KateView::getEol() {
return myDoc->eolMode;
}
void KateView::setEol(int eol) {
if (isReadOnly())
return;
myDoc->eolMode = eol;
myDoc->setModified(true);
}
void KateView::paintEvent(QPaintEvent *e) {
int x, y;
QRect updateR = e->rect(); // update rectangle
// debug("Update rect = ( %i, %i, %i, %i )",
// updateR.x(),updateR.y(), updateR.width(), updateR.height() );
int ux1 = updateR.x();
int uy1 = updateR.y();
int ux2 = ux1 + updateR.width();
int uy2 = uy1 + updateR.height();
QPainter paint;
paint.begin(this);
QColorGroup g = colorGroup();
x = width();
y = height();
paint.setPen(g.dark());
if (uy1 <= 0) paint.drawLine(0,0,x-2,0);
if (ux1 <= 0) paint.drawLine(0,1,0,y-2);
paint.setPen(black);
if (uy1 <= 1) paint.drawLine(1,1,x-3,1);
if (ux1 <= 1) paint.drawLine(1,2,1,y-3);
paint.setPen(g.midlight());
if (uy2 >= y-1) paint.drawLine(1,y-2,x-3,y-2);
if (ux2 >= x-1) paint.drawLine(x-2,1,x-2,y-2);
paint.setPen(g.light());
if (uy2 >= y) paint.drawLine(0,y-1,x-2,y-1);
if (ux2 >= x) paint.drawLine(x-1,0,x-1,y-1);
x -= 2 + 16;
y -= 2 + 16;
if (ux2 > x && uy2 > y) {
paint.fillRect(x,y,16,16,g.background());
}
paint.end();
}
void KateView::resizeEvent(QResizeEvent *) {
// debug("Resize %d, %d",e->size().width(),e->size().height());
//myViewInternal->resize(width() -20, height() -20);
myViewInternal->tagAll();
myViewInternal->updateView(0/*ufNoScroll*/);
}
// Applies a new pattern to the search context.
void SConfig::setPattern(QString &newPattern) {
bool regExp = (flags & KateView::sfRegularExpression);
m_pattern = newPattern;
if (regExp) {
m_regExp.setCaseSensitive(flags & KateView::sfCaseSensitive);
m_regExp.setPattern(m_pattern);
}
}