00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "katedialogs.h"
00026 #include "katedialogs.moc"
00027
00028 #include "kateautoindent.h"
00029 #include "katebuffer.h"
00030 #include "kateconfig.h"
00031 #include "katedocument.h"
00032 #include "katefactory.h"
00033 #include "kateschema.h"
00034 #include "katesyntaxdocument.h"
00035 #include "kateview.h"
00036
00037
00038 #include <ktexteditor/configinterfaceextension.h>
00039 #include <ktexteditor/plugin.h>
00040
00041 #include <kio/job.h>
00042 #include <kio/jobclasses.h>
00043 #include <kio/netaccess.h>
00044
00045 #include <kaccel.h>
00046 #include <kapplication.h>
00047 #include <kbuttonbox.h>
00048 #include <kcharsets.h>
00049 #include <kcolorbutton.h>
00050 #include <kcolorcombo.h>
00051 #include <kcolordialog.h>
00052 #include <kcombobox.h>
00053 #include <kconfig.h>
00054 #include <kdebug.h>
00055 #include <kfontdialog.h>
00056 #include <kglobal.h>
00057 #include <kglobalsettings.h>
00058 #include <kiconloader.h>
00059 #include <kkeybutton.h>
00060 #include <kkeydialog.h>
00061 #include <klineedit.h>
00062 #include <klistview.h>
00063 #include <klocale.h>
00064 #include <kmessagebox.h>
00065 #include <kmimetypechooser.h>
00066 #include <knuminput.h>
00067 #include <kparts/componentfactory.h>
00068 #include <kpopupmenu.h>
00069 #include <kprocess.h>
00070 #include <kprocio.h>
00071 #include <kregexpeditorinterface.h>
00072 #include <krun.h>
00073 #include <kseparator.h>
00074 #include <kstandarddirs.h>
00075 #include <ktempfile.h>
00076
00077 #include <qbuttongroup.h>
00078 #include <qcheckbox.h>
00079 #include <qcombobox.h>
00080 #include <qdialog.h>
00081 #include <qdom.h>
00082 #include <qfile.h>
00083 #include <qgrid.h>
00084 #include <qgroupbox.h>
00085 #include <qhbox.h>
00086 #include <qheader.h>
00087 #include <qhgroupbox.h>
00088 #include <qlabel.h>
00089 #include <qlayout.h>
00090 #include <qlineedit.h>
00091 #include <qlistbox.h>
00092 #include <qlistview.h>
00093 #include <qmap.h>
00094 #include <qobjectlist.h>
00095 #include <qpainter.h>
00096 #include <qpointarray.h>
00097 #include <qptrcollection.h>
00098 #include <qpushbutton.h>
00099 #include <qradiobutton.h>
00100 #include <qslider.h>
00101 #include <qspinbox.h>
00102 #include <qstringlist.h>
00103 #include <qtabwidget.h>
00104 #include <qtextcodec.h>
00105 #include <qtoolbutton.h>
00106 #include <qvbox.h>
00107 #include <qvgroupbox.h>
00108 #include <qwhatsthis.h>
00109 #include <qwidgetstack.h>
00110
00111
00112 #define HLDOWNLOADPATH "http://kate.kde.org/syntax/"
00113
00114
00115
00116
00117 KateConfigPage::KateConfigPage ( QWidget *parent, const char *name )
00118 : Kate::ConfigPage (parent, name)
00119 , m_changed (false)
00120 {
00121 connect (this, SIGNAL(changed()), this, SLOT(somethingHasChanged ()));
00122 }
00123
00124 KateConfigPage::~KateConfigPage ()
00125 {
00126 }
00127
00128 void KateConfigPage::somethingHasChanged ()
00129 {
00130 m_changed = true;
00131 kdDebug (13000) << "TEST: something changed on the config page: " << this << endl;
00132 }
00133
00134
00135
00136 const int KateIndentConfigTab::flags[] = {
00137 KateDocument::cfSpaceIndent,
00138 KateDocument::cfKeepIndentProfile,
00139 KateDocument::cfKeepExtraSpaces,
00140 KateDocument::cfTabIndents,
00141 KateDocument::cfBackspaceIndents,
00142 KateDocumentConfig::cfDoxygenAutoTyping,
00143 KateDocumentConfig::cfMixedIndent
00144 };
00145
00146 KateIndentConfigTab::KateIndentConfigTab(QWidget *parent)
00147 : KateConfigPage(parent)
00148 {
00149 QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
00150 int configFlags = KateDocumentConfig::global()->configFlags();
00151
00152 QVGroupBox *gbAuto = new QVGroupBox(i18n("Automatic Indentation"), this);
00153
00154 QHBox *indentLayout = new QHBox(gbAuto);
00155 indentLayout->setSpacing(KDialog::spacingHint());
00156 QLabel *indentLabel = new QLabel(i18n("&Indentation mode:"), indentLayout);
00157 m_indentMode = new KComboBox (indentLayout);
00158 m_indentMode->insertStringList (KateAutoIndent::listModes());
00159 indentLabel->setBuddy(m_indentMode);
00160 m_configPage = new QPushButton(SmallIconSet("configure"), i18n("Configure..."), indentLayout);
00161
00162 opt[5] = new QCheckBox(i18n("Insert leading Doxygen \"*\" when typing"), gbAuto);
00163
00164 QVGroupBox *gbSpaces = new QVGroupBox(i18n("Indentation with Spaces"), this);
00165 QVBox *spaceLayout = new QVBox(gbSpaces);
00166 opt[0] = new QCheckBox(i18n("Use &spaces instead of tabs to indent"), spaceLayout );
00167 opt[6] = new QCheckBox(i18n("Emacs style mixed mode"), spaceLayout);
00168
00169 indentationWidth = new KIntNumInput(KateDocumentConfig::global()->indentationWidth(), spaceLayout);
00170 indentationWidth->setRange(1, 16, 1, false);
00171 indentationWidth->setLabel(i18n("Number of spaces:"), AlignVCenter);
00172
00173 opt[1] = new QCheckBox(i18n("Keep indent &profile"), this);
00174 opt[2] = new QCheckBox(i18n("&Keep extra spaces"), this);
00175
00176 QVGroupBox *keys = new QVGroupBox(i18n("Keys to Use"), this);
00177 opt[3] = new QCheckBox(i18n("&Tab key indents"), keys);
00178 opt[4] = new QCheckBox(i18n("&Backspace key indents"), keys);
00179
00180 QRadioButton *rb1, *rb2, *rb3;
00181 m_tabs = new QButtonGroup( 1, Qt::Horizontal, i18n("Tab Key Mode if Nothing Selected"), this );
00182 m_tabs->setRadioButtonExclusive( true );
00183 m_tabs->insert( rb1=new QRadioButton( i18n("Insert indent &characters"), m_tabs ), 0 );
00184 m_tabs->insert( rb2=new QRadioButton( i18n("I&nsert tab character"), m_tabs ), 1 );
00185 m_tabs->insert( rb3=new QRadioButton( i18n("Indent current &line"), m_tabs ), 2 );
00186
00187 opt[0]->setChecked(configFlags & flags[0]);
00188 opt[1]->setChecked(configFlags & flags[1]);
00189 opt[2]->setChecked(configFlags & flags[2]);
00190 opt[3]->setChecked(configFlags & flags[3]);
00191 opt[4]->setChecked(configFlags & flags[4]);
00192 opt[5]->setChecked(configFlags & flags[5]);
00193 opt[6]->setChecked(configFlags & flags[6]);
00194
00195 layout->addWidget(gbAuto);
00196 layout->addWidget(gbSpaces);
00197 layout->addWidget(opt[1]);
00198 layout->addWidget(opt[2]);
00199 layout->addWidget(keys);
00200 layout->addWidget(m_tabs, 0);
00201
00202 layout->addStretch();
00203
00204
00205 QWhatsThis::add(opt[0], i18n(
00206 "Check this if you want to indent with spaces rather than tabs."));
00207 QWhatsThis::add(opt[2], i18n(
00208 "Indentations of more than the selected number of spaces will not be "
00209 "shortened."));
00210 QWhatsThis::add(opt[3], i18n(
00211 "This allows the <b>Tab</b> key to be used to increase the indentation "
00212 "level."));
00213 QWhatsThis::add(opt[4], i18n(
00214 "This allows the <b>Backspace</b> key to be used to decrease the "
00215 "indentation level."));
00216 QWhatsThis::add(opt[5], i18n(
00217 "Automatically inserts a leading \"*\" while typing within a Doxygen "
00218 "style comment."));
00219 QWhatsThis::add( opt[6], i18n(
00220 "Use a mix of tab and space characters for indentation.") );
00221 QWhatsThis::add(indentationWidth, i18n("The number of spaces to indent with."));
00222
00223 QWhatsThis::add(m_configPage, i18n(
00224 "If this button is enabled, additional indenter specific options are "
00225 "available and can be configured in an extra dialog.") );
00226
00227 reload ();
00228
00229
00230
00231
00232
00233 connect(m_indentMode, SIGNAL(activated(int)), this, SLOT(slotChanged()));
00234 connect(m_indentMode, SIGNAL(activated(int)), this, SLOT(indenterSelected(int)));
00235
00236 connect( opt[0], SIGNAL(toggled(bool)), this, SLOT(somethingToggled()));
00237
00238 connect( opt[0], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00239 connect( opt[1], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00240 connect( opt[2], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00241 connect( opt[3], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00242 connect( opt[4], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00243 connect( opt[5], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00244 connect( opt[6], SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00245
00246 connect(indentationWidth, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
00247
00248 connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00249 connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00250 connect(rb3, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00251
00252 connect(m_configPage, SIGNAL(clicked()), this, SLOT(configPage()));
00253 }
00254
00255 void KateIndentConfigTab::somethingToggled() {
00256 indentationWidth->setEnabled(opt[0]->isChecked());
00257 opt[6]->setEnabled(opt[0]->isChecked());
00258 }
00259
00260 void KateIndentConfigTab::indenterSelected (int index)
00261 {
00262 if (index == KateDocumentConfig::imCStyle || index == KateDocumentConfig::imCSAndS)
00263 opt[5]->setEnabled(true);
00264 else
00265 opt[5]->setEnabled(false);
00266
00267 m_configPage->setEnabled( KateAutoIndent::hasConfigPage(index) );
00268 }
00269
00270 void KateIndentConfigTab::configPage()
00271 {
00272 uint index = m_indentMode->currentItem();
00273 if ( KateAutoIndent::hasConfigPage(index) )
00274 {
00275 KDialogBase dlg(this, "indenter_config_dialog", true, i18n("Configure Indenter"),
00276 KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Cancel, true);
00277
00278 QVBox *box = new QVBox(&dlg);
00279 box->setSpacing( KDialog::spacingHint() );
00280 dlg.setMainWidget(box);
00281 new QLabel("<qt><b>" + KateAutoIndent::modeDescription(index) + "</b></qt>", box);
00282 new KSeparator(KSeparator::HLine, box);
00283
00284 IndenterConfigPage* page = KateAutoIndent::configPage(box, index);
00285
00286 if (!page) return;
00287 box->setStretchFactor(page, 1);
00288
00289 connect( &dlg, SIGNAL(okClicked()), page, SLOT(apply()) );
00290
00291 dlg.resize(400, 300);
00292 dlg.exec();
00293 }
00294 }
00295
00296 void KateIndentConfigTab::apply ()
00297 {
00298
00299 if (!changed())
00300 return;
00301 m_changed = false;
00302
00303 KateDocumentConfig::global()->configStart ();
00304
00305 int configFlags, z;
00306
00307 configFlags = KateDocumentConfig::global()->configFlags();
00308 for (z = 0; z < numFlags; z++) {
00309 configFlags &= ~flags[z];
00310 if (opt[z]->isChecked()) configFlags |= flags[z];
00311 }
00312
00313 KateDocumentConfig::global()->setConfigFlags(configFlags);
00314 KateDocumentConfig::global()->setIndentationWidth(indentationWidth->value());
00315
00316 KateDocumentConfig::global()->setIndentationMode(m_indentMode->currentItem());
00317
00318 KateDocumentConfig::global()->setConfigFlags (KateDocumentConfig::cfTabIndentsMode, 2 == m_tabs->id (m_tabs->selected()));
00319 KateDocumentConfig::global()->setConfigFlags (KateDocumentConfig::cfTabInsertsTab, 1 == m_tabs->id (m_tabs->selected()));
00320
00321 KateDocumentConfig::global()->configEnd ();
00322 }
00323
00324 void KateIndentConfigTab::reload ()
00325 {
00326 if (KateDocumentConfig::global()->configFlags() & KateDocumentConfig::cfTabIndentsMode)
00327 m_tabs->setButton (2);
00328 else if (KateDocumentConfig::global()->configFlags() & KateDocumentConfig::cfTabInsertsTab)
00329 m_tabs->setButton (1);
00330 else
00331 m_tabs->setButton (0);
00332
00333 m_indentMode->setCurrentItem (KateDocumentConfig::global()->indentationMode());
00334
00335 somethingToggled ();
00336 indenterSelected (m_indentMode->currentItem());
00337 }
00338
00339
00340
00341 const int KateSelectConfigTab::flags[] = {};
00342
00343 KateSelectConfigTab::KateSelectConfigTab(QWidget *parent)
00344 : KateConfigPage(parent)
00345 {
00346 int configFlags = KateDocumentConfig::global()->configFlags();
00347
00348 QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
00349
00350 QVGroupBox *gbCursor = new QVGroupBox(i18n("Text Cursor Movement"), this);
00351
00352 opt[0] = new QCheckBox(i18n("Smart ho&me"), gbCursor);
00353 opt[0]->setChecked(configFlags & KateDocumentConfig::cfSmartHome);
00354 connect(opt[0], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00355
00356 opt[1] = new QCheckBox(i18n("Wrap c&ursor"), gbCursor);
00357 opt[1]->setChecked(configFlags & KateDocumentConfig::cfWrapCursor);
00358 connect(opt[1], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00359
00360 e6 = new QCheckBox(i18n("&PageUp/PageDown moves cursor"), gbCursor);
00361 e6->setChecked(KateDocumentConfig::global()->pageUpDownMovesCursor());
00362 connect(e6, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00363
00364 e4 = new KIntNumInput(KateViewConfig::global()->autoCenterLines(), gbCursor);
00365 e4->setRange(0, 1000000, 1, false);
00366 e4->setLabel(i18n("Autocenter cursor (lines):"), AlignVCenter);
00367 connect(e4, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
00368
00369 layout->addWidget(gbCursor);
00370
00371 QRadioButton *rb1, *rb2;
00372
00373 m_tabs = new QButtonGroup( 1, Qt::Horizontal, i18n("Selection Mode"), this );
00374 layout->add (m_tabs);
00375
00376 m_tabs->setRadioButtonExclusive( true );
00377 m_tabs->insert( rb1=new QRadioButton( i18n("&Normal"), m_tabs ), 0 );
00378 m_tabs->insert( rb2=new QRadioButton( i18n("&Persistent"), m_tabs ), 1 );
00379
00380 layout->addStretch();
00381
00382 QWhatsThis::add(rb1, i18n(
00383 "Selections will be overwritten by typed text and will be lost on "
00384 "cursor movement."));
00385 QWhatsThis::add(rb2, i18n(
00386 "Selections will stay even after cursor movement and typing."));
00387
00388 QWhatsThis::add(e4, i18n(
00389 "Sets the number of lines to maintain visible above and below the "
00390 "cursor when possible."));
00391
00392 QWhatsThis::add(opt[0], i18n(
00393 "When selected, pressing the home key will cause the cursor to skip "
00394 "whitespace and go to the start of a line's text."));
00395
00396 QWhatsThis::add(opt[1], i18n(
00397 "When on, moving the insertion cursor using the <b>Left</b> and "
00398 "<b>Right</b> keys will go on to previous/next line at beginning/end of "
00399 "the line, similar to most editors.<p>When off, the insertion cursor "
00400 "cannot be moved left of the line start, but it can be moved off the "
00401 "line end, which can be very handy for programmers."));
00402
00403 QWhatsThis::add(e6, i18n("Selects whether the PageUp and PageDown keys should alter the vertical position of the cursor relative to the top of the view."));
00404
00405
00406 reload ();
00407
00408
00409
00410
00411
00412 connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00413 connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00414 }
00415
00416 void KateSelectConfigTab::apply ()
00417 {
00418
00419 if (!changed())
00420 return;
00421 m_changed = false;
00422
00423 KateViewConfig::global()->configStart ();
00424 KateDocumentConfig::global()->configStart ();
00425
00426 int configFlags = KateDocumentConfig::global()->configFlags();
00427
00428 configFlags &= ~KateDocumentConfig::cfSmartHome;
00429 configFlags &= ~KateDocumentConfig::cfWrapCursor;
00430
00431 if (opt[0]->isChecked()) configFlags |= KateDocumentConfig::cfSmartHome;
00432 if (opt[1]->isChecked()) configFlags |= KateDocumentConfig::cfWrapCursor;
00433
00434 KateDocumentConfig::global()->setConfigFlags(configFlags);
00435
00436 KateViewConfig::global()->setAutoCenterLines(QMAX(0, e4->value()));
00437 KateDocumentConfig::global()->setPageUpDownMovesCursor(e6->isChecked());
00438
00439 KateViewConfig::global()->setPersistentSelection (m_tabs->id (m_tabs->selected()) == 1);
00440
00441 KateDocumentConfig::global()->configEnd ();
00442 KateViewConfig::global()->configEnd ();
00443 }
00444
00445 void KateSelectConfigTab::reload ()
00446 {
00447 if (KateViewConfig::global()->persistentSelection())
00448 m_tabs->setButton (1);
00449 else
00450 m_tabs->setButton (0);
00451 }
00452
00453
00454
00455 const int KateEditConfigTab::flags[] = {KateDocument::cfWordWrap,
00456 KateDocument::cfAutoBrackets, KateDocument::cfShowTabs,
00457 KateDocumentConfig::cfReplaceTabsDyn, KateDocumentConfig::cfRemoveTrailingDyn};
00458
00459 KateEditConfigTab::KateEditConfigTab(QWidget *parent)
00460 : KateConfigPage(parent)
00461 {
00462 QVBoxLayout *mainLayout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
00463 int configFlags = KateDocumentConfig::global()->configFlags();
00464
00465 QVGroupBox *gbWhiteSpace = new QVGroupBox(i18n("Tabulators"), this);
00466
00467 opt[3] = new QCheckBox( i18n("&Insert spaces instead of tabulators"), gbWhiteSpace );
00468 opt[3]->setChecked( configFlags & KateDocumentConfig::cfReplaceTabsDyn );
00469 connect( opt[3], SIGNAL(toggled(bool)), this, SLOT(slotChanged()) );
00470
00471 opt[2] = new QCheckBox(i18n("&Show tabulators"), gbWhiteSpace);
00472 opt[2]->setChecked(configFlags & flags[2]);
00473 connect(opt[2], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00474
00475 e2 = new KIntNumInput(KateDocumentConfig::global()->tabWidth(), gbWhiteSpace);
00476 e2->setRange(1, 16, 1, false);
00477 e2->setLabel(i18n("Tab width:"), AlignVCenter);
00478 connect(e2, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
00479
00480 mainLayout->addWidget(gbWhiteSpace);
00481
00482 QVGroupBox *gbWordWrap = new QVGroupBox(i18n("Static Word Wrap"), this);
00483
00484 opt[0] = new QCheckBox(i18n("Enable static &word wrap"), gbWordWrap);
00485 opt[0]->setChecked(KateDocumentConfig::global()->wordWrap());
00486 connect(opt[0], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00487
00488 m_wwmarker = new QCheckBox( i18n("&Show static word wrap marker (if applicable)"), gbWordWrap );
00489 m_wwmarker->setChecked( KateRendererConfig::global()->wordWrapMarker() );
00490 connect(m_wwmarker, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00491
00492 e1 = new KIntNumInput(KateDocumentConfig::global()->wordWrapAt(), gbWordWrap);
00493 e1->setRange(20, 200, 1, false);
00494 e1->setLabel(i18n("Wrap words at:"), AlignVCenter);
00495 connect(e1, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
00496
00497 mainLayout->addWidget(gbWordWrap);
00498
00499 opt[4] = new QCheckBox( i18n("Remove &trailing spaces"), this );
00500 mainLayout->addWidget( opt[4] );
00501 opt[4]->setChecked( configFlags & KateDocumentConfig::cfRemoveTrailingDyn );
00502 connect( opt[4], SIGNAL(toggled(bool)), this, SLOT(slotChanged()) );
00503
00504 opt[1] = new QCheckBox(i18n("Auto &brackets"), this);
00505 mainLayout->addWidget(opt[1]);
00506 opt[1]->setChecked(configFlags & flags[1]);
00507 connect(opt[1], SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00508
00509 e3 = new KIntNumInput(e2, KateDocumentConfig::global()->undoSteps(), this);
00510 e3->setRange(0, 1000000, 1, false);
00511 e3->setSpecialValueText( i18n("Unlimited") );
00512 e3->setLabel(i18n("Maximum undo steps:"), AlignVCenter);
00513 mainLayout->addWidget(e3);
00514 connect(e3, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
00515
00516 QHBoxLayout *e5Layout = new QHBoxLayout(mainLayout);
00517 QLabel *e5Label = new QLabel(i18n("Smart search t&ext from:"), this);
00518 e5Layout->addWidget(e5Label);
00519 e5 = new KComboBox (this);
00520 e5->insertItem( i18n("Nowhere") );
00521 e5->insertItem( i18n("Selection Only") );
00522 e5->insertItem( i18n("Selection, then Current Word") );
00523 e5->insertItem( i18n("Current Word Only") );
00524 e5->insertItem( i18n("Current Word, then Selection") );
00525 e5->setCurrentItem(KateViewConfig::global()->textToSearchMode());
00526 e5Layout->addWidget(e5);
00527 e5Label->setBuddy(e5);
00528 connect(e5, SIGNAL(activated(int)), this, SLOT(slotChanged()));
00529
00530 mainLayout->addStretch();
00531
00532
00533 QWhatsThis::add(opt[0], i18n(
00534 "Automatically start a new line of text when the current line exceeds "
00535 "the length specified by the <b>Wrap words at:</b> option."
00536 "<p>This option does not wrap existing lines of text - use the <b>Apply "
00537 "Static Word Wrap</b> option in the <b>Tools</b> menu for that purpose."
00538 "<p>If you want lines to be <i>visually wrapped</i> instead, according "
00539 "to the width of the view, enable <b>Dynamic Word Wrap</b> in the "
00540 "<b>View Defaults</b> config page."));
00541 QWhatsThis::add(e1, i18n(
00542 "If the Word Wrap option is selected this entry determines the length "
00543 "(in characters) at which the editor will automatically start a new line."));
00544 QWhatsThis::add(opt[1], i18n(
00545 "When the user types a left bracket ([,(, or {) KateView automatically "
00546 "enters the right bracket (}, ), or ]) to the right of the cursor."));
00547 QWhatsThis::add(opt[2], i18n(
00548 "The editor will display a symbol to indicate the presence of a tab in "
00549 "the text."));
00550
00551 QWhatsThis::add(e3, i18n(
00552 "Sets the number of undo/redo steps to record. More steps uses more memory."));
00553
00554 QString gstfwt = i18n(
00555 "This determines where KateView will get the search text from "
00556 "(this will be automatically entered into the Find Text dialog): "
00557 "<br>"
00558 "<ul>"
00559 "<li><b>Nowhere:</b> Don't guess the search text."
00560 "</li>"
00561 "<li><b>Selection Only:</b> Use the current text selection, "
00562 "if available."
00563 "</li>"
00564 "<li><b>Selection, then Current Word:</b> Use the current "
00565 "selection if available, otherwise use the current word."
00566 "</li>"
00567 "<li><b>Current Word Only:</b> Use the word that the cursor "
00568 "is currently resting on, if available."
00569 "</li>"
00570 "<li><b>Current Word, then Selection:</b> Use the current "
00571 "word if available, otherwise use the current selection."
00572 "</li>"
00573 "</ul>"
00574 "Note that, in all the above modes, if a search string has "
00575 "not been or cannot be determined, then the Find Text Dialog "
00576 "will fall back to the last search text.");
00577 QWhatsThis::add(e5Label, gstfwt);
00578 QWhatsThis::add(e5, gstfwt);
00579 QWhatsThis::add( opt[3], i18n(
00580 "If this is enabled, the editor will calculate the number of spaces up to "
00581 "the next tab position as defined by the tab width, and insert that number "
00582 "of spaces instead of a TAB character." ) );
00583 QWhatsThis::add( opt[4], i18n(
00584 "If this is enabled, the editor will remove any trailing whitespace on "
00585 "lines when they are left by the insertion cursor.") );
00586 QWhatsThis::add( m_wwmarker, i18n(
00587 "<p>If this option is checked, a vertical line will be drawn at the word "
00588 "wrap column as defined in the <strong>Editing</strong> properties."
00589 "<p>Note that the word wrap marker is only drawn if you use a fixed "
00590 "pitch font." ));
00591 }
00592
00593 void KateEditConfigTab::apply ()
00594 {
00595
00596 if (!changed())
00597 return;
00598 m_changed = false;
00599
00600 KateViewConfig::global()->configStart ();
00601 KateDocumentConfig::global()->configStart ();
00602
00603 int configFlags, z;
00604
00605 configFlags = KateDocumentConfig::global()->configFlags();
00606 for (z = 1; z < numFlags; z++) {
00607 configFlags &= ~flags[z];
00608 if (opt[z]->isChecked()) configFlags |= flags[z];
00609 }
00610 KateDocumentConfig::global()->setConfigFlags(configFlags);
00611
00612 KateDocumentConfig::global()->setWordWrapAt(e1->value());
00613 KateDocumentConfig::global()->setWordWrap (opt[0]->isChecked());
00614 KateDocumentConfig::global()->setTabWidth(e2->value());
00615
00616 if (e3->value() <= 0)
00617 KateDocumentConfig::global()->setUndoSteps(0);
00618 else
00619 KateDocumentConfig::global()->setUndoSteps(e3->value());
00620
00621 KateViewConfig::global()->setTextToSearchMode(e5->currentItem());
00622
00623 KateRendererConfig::global()->setWordWrapMarker (m_wwmarker->isChecked());
00624
00625 KateDocumentConfig::global()->configEnd ();
00626 KateViewConfig::global()->configEnd ();
00627 }
00628
00629 void KateEditConfigTab::reload ()
00630 {
00631 }
00632
00633
00634
00635 KateViewDefaultsConfig::KateViewDefaultsConfig(QWidget *parent)
00636 :KateConfigPage(parent)
00637 {
00638 QRadioButton *rb1;
00639 QRadioButton *rb2;
00640
00641 QVBoxLayout *blay=new QVBoxLayout(this,0,KDialog::spacingHint());
00642
00643 QVGroupBox *gbWordWrap = new QVGroupBox(i18n("Word Wrap"), this);
00644
00645 m_dynwrap=new QCheckBox(i18n("&Dynamic word wrap"),gbWordWrap);
00646
00647 QHBox *m_dynwrapIndicatorsLay = new QHBox (gbWordWrap);
00648 m_dynwrapIndicatorsLabel = new QLabel( i18n("Dynamic word wrap indicators (if applicable):"), m_dynwrapIndicatorsLay );
00649 m_dynwrapIndicatorsCombo = new KComboBox( m_dynwrapIndicatorsLay );
00650 m_dynwrapIndicatorsCombo->insertItem( i18n("Off") );
00651 m_dynwrapIndicatorsCombo->insertItem( i18n("Follow Line Numbers") );
00652 m_dynwrapIndicatorsCombo->insertItem( i18n("Always On") );
00653 m_dynwrapIndicatorsLabel->setBuddy(m_dynwrapIndicatorsCombo);
00654
00655 m_dynwrapAlignLevel = new KIntNumInput(gbWordWrap);
00656 m_dynwrapAlignLevel->setLabel(i18n("Vertically align dynamically wrapped lines to indentation depth:"));
00657 m_dynwrapAlignLevel->setRange(0, 80, 10);
00658
00659 m_dynwrapAlignLevel->setSuffix(i18n("% of View Width"));
00660 m_dynwrapAlignLevel->setSpecialValueText(i18n("Disabled"));
00661
00662 blay->addWidget(gbWordWrap);
00663
00664 QVGroupBox *gbFold = new QVGroupBox(i18n("Code Folding"), this);
00665
00666 m_folding=new QCheckBox(i18n("Show &folding markers (if available)"), gbFold );
00667 m_collapseTopLevel = new QCheckBox( i18n("Collapse toplevel folding nodes"), gbFold );
00668 m_collapseTopLevel->hide ();
00669
00670 blay->addWidget(gbFold);
00671
00672 QVGroupBox *gbBar = new QVGroupBox(i18n("Borders"), this);
00673
00674 m_icons=new QCheckBox(i18n("Show &icon border"),gbBar);
00675 m_line=new QCheckBox(i18n("Show &line numbers"),gbBar);
00676 m_scrollBarMarks=new QCheckBox(i18n("Show &scrollbar marks"),gbBar);
00677
00678 blay->addWidget(gbBar);
00679
00680 m_bmSort = new QButtonGroup( 1, Qt::Horizontal, i18n("Sort Bookmarks Menu"), this );
00681 m_bmSort->setRadioButtonExclusive( true );
00682 m_bmSort->insert( rb1=new QRadioButton( i18n("By &position"), m_bmSort ), 0 );
00683 m_bmSort->insert( rb2=new QRadioButton( i18n("By c&reation"), m_bmSort ), 1 );
00684
00685 blay->addWidget(m_bmSort, 0 );
00686
00687 m_showIndentLines = new QCheckBox(i18n("Show indentation lines"), this);
00688 m_showIndentLines->setChecked(KateRendererConfig::global()->showIndentationLines());
00689 blay->addWidget(m_showIndentLines);
00690
00691 blay->addStretch(1000);
00692
00693 QWhatsThis::add(m_dynwrap,i18n(
00694 "If this option is checked, the text lines will be wrapped at the view "
00695 "border on the screen."));
00696 QString wtstr = i18n("Choose when the Dynamic Word Wrap Indicators should be displayed");
00697 QWhatsThis::add(m_dynwrapIndicatorsLabel, wtstr);
00698 QWhatsThis::add(m_dynwrapIndicatorsCombo, wtstr);
00699
00700 QWhatsThis::add(m_dynwrapAlignLevel, i18n(
00701 "<p>Enables the start of dynamically wrapped lines to be aligned "
00702 "vertically to the indentation level of the first line. This can help "
00703 "to make code and markup more readable.</p><p>Additionally, this allows "
00704 "you to set a maximum width of the screen, as a percentage, after which "
00705 "dynamically wrapped lines will no longer be vertically aligned. For "
00706 "example, at 50%, lines whose indentation levels are deeper than 50% of "
00707 "the width of the screen will not have vertical alignment applied to "
00708 "subsequent wrapped lines.</p>"));
00709 QWhatsThis::add(m_line,i18n(
00710 "If this option is checked, every new view will display line numbers "
00711 "on the left hand side."));
00712 QWhatsThis::add(m_icons,i18n(
00713 "If this option is checked, every new view will display an icon border "
00714 "on the left hand side.<br><br>The icon border shows bookmark signs, "
00715 "for instance."));
00716 QWhatsThis::add(m_scrollBarMarks,i18n(
00717 "If this option is checked, every new view will show marks on the "
00718 "vertical scrollbar.<br><br>These marks will, for instance, show "
00719 "bookmarks."));
00720 QWhatsThis::add(m_folding,i18n(
00721 "If this option is checked, every new view will display marks for code "
00722 "folding, if code folding is available."));
00723 QWhatsThis::add(m_bmSort,i18n(
00724 "Choose how the bookmarks should be ordered in the <b>Bookmarks</b> menu."));
00725 QWhatsThis::add(rb1,i18n(
00726 "The bookmarks will be ordered by the line numbers they are placed at."));
00727 QWhatsThis::add(rb2,i18n(
00728 "Each new bookmark will be added to the bottom, independently from "
00729 "where it is placed in the document."));
00730 QWhatsThis::add(m_showIndentLines, i18n(
00731 "If this is enabled, the editor will display vertical lines to help "
00732 "identify indent lines.") );
00733
00734 reload();
00735
00736
00737
00738
00739
00740 connect(m_dynwrap, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00741 connect(m_dynwrapIndicatorsCombo, SIGNAL(activated(int)), this, SLOT(slotChanged()));
00742 connect(m_dynwrapAlignLevel, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
00743 connect(m_icons, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00744 connect(m_scrollBarMarks, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00745 connect(m_line, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00746 connect(m_folding, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00747 connect(m_collapseTopLevel, SIGNAL(toggled(bool)), this, SLOT(slotChanged()) );
00748 connect(rb1, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00749 connect(rb2, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00750 connect(m_showIndentLines, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00751 }
00752
00753 KateViewDefaultsConfig::~KateViewDefaultsConfig()
00754 {
00755 }
00756
00757 void KateViewDefaultsConfig::apply ()
00758 {
00759
00760 if (!changed())
00761 return;
00762 m_changed = false;
00763
00764 KateViewConfig::global()->configStart ();
00765 KateRendererConfig::global()->configStart ();
00766
00767 KateViewConfig::global()->setDynWordWrap (m_dynwrap->isChecked());
00768 KateViewConfig::global()->setDynWordWrapIndicators (m_dynwrapIndicatorsCombo->currentItem ());
00769 KateViewConfig::global()->setDynWordWrapAlignIndent(m_dynwrapAlignLevel->value());
00770 KateViewConfig::global()->setLineNumbers (m_line->isChecked());
00771 KateViewConfig::global()->setIconBar (m_icons->isChecked());
00772 KateViewConfig::global()->setScrollBarMarks (m_scrollBarMarks->isChecked());
00773 KateViewConfig::global()->setFoldingBar (m_folding->isChecked());
00774 KateViewConfig::global()->setBookmarkSort (m_bmSort->id (m_bmSort->selected()));
00775
00776 KateRendererConfig::global()->setShowIndentationLines(m_showIndentLines->isChecked());
00777
00778 KateRendererConfig::global()->configEnd ();
00779 KateViewConfig::global()->configEnd ();
00780 }
00781
00782 void KateViewDefaultsConfig::reload ()
00783 {
00784 m_dynwrap->setChecked(KateViewConfig::global()->dynWordWrap());
00785 m_dynwrapIndicatorsCombo->setCurrentItem( KateViewConfig::global()->dynWordWrapIndicators() );
00786 m_dynwrapAlignLevel->setValue(KateViewConfig::global()->dynWordWrapAlignIndent());
00787 m_line->setChecked(KateViewConfig::global()->lineNumbers());
00788 m_icons->setChecked(KateViewConfig::global()->iconBar());
00789 m_scrollBarMarks->setChecked(KateViewConfig::global()->scrollBarMarks());
00790 m_folding->setChecked(KateViewConfig::global()->foldingBar());
00791 m_bmSort->setButton( KateViewConfig::global()->bookmarkSort() );
00792 m_showIndentLines->setChecked(KateRendererConfig::global()->showIndentationLines());
00793 }
00794
00795 void KateViewDefaultsConfig::reset () {;}
00796
00797 void KateViewDefaultsConfig::defaults (){;}
00798
00799
00800
00801
00802 KateEditKeyConfiguration::KateEditKeyConfiguration( QWidget* parent, KateDocument* doc )
00803 : KateConfigPage( parent )
00804 {
00805 m_doc = doc;
00806 m_ready = false;
00807 }
00808
00809 void KateEditKeyConfiguration::showEvent ( QShowEvent * )
00810 {
00811 if (!m_ready)
00812 {
00813 (new QVBoxLayout(this))->setAutoAdd(true);
00814 KateView* view = (KateView*)m_doc->views().at(0);
00815 m_ac = view->editActionCollection();
00816 m_keyChooser = new KKeyChooser( m_ac, this, false );
00817 connect( m_keyChooser, SIGNAL( keyChange() ), this, SLOT( slotChanged() ) );
00818 m_keyChooser->show ();
00819
00820 m_ready = true;
00821 }
00822
00823 QWidget::show ();
00824 }
00825
00826 void KateEditKeyConfiguration::apply()
00827 {
00828 if ( ! changed() )
00829 return;
00830 m_changed = false;
00831
00832 if (m_ready)
00833 {
00834 m_keyChooser->commitChanges();
00835 m_ac->writeShortcutSettings( "Katepart Shortcuts" );
00836 }
00837 }
00838
00839
00840
00841 KateSaveConfigTab::KateSaveConfigTab( QWidget *parent )
00842 : KateConfigPage( parent )
00843 {
00844 int configFlags = KateDocumentConfig::global()->configFlags();
00845 QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
00846
00847 QVGroupBox *gbEnc = new QVGroupBox(i18n("File Format"), this);
00848 layout->addWidget( gbEnc );
00849
00850 QHBox *e5Layout = new QHBox(gbEnc);
00851 QLabel *e5Label = new QLabel(i18n("&Encoding:"), e5Layout);
00852 m_encoding = new KComboBox (e5Layout);
00853 e5Label->setBuddy(m_encoding);
00854
00855 e5Layout = new QHBox(gbEnc);
00856 e5Label = new QLabel(i18n("End &of line:"), e5Layout);
00857 m_eol = new KComboBox (e5Layout);
00858 e5Label->setBuddy(m_eol);
00859
00860 allowEolDetection = new QCheckBox(i18n("&Automatic end of line detection"), gbEnc);
00861
00862 m_eol->insertItem (i18n("UNIX"));
00863 m_eol->insertItem (i18n("DOS/Windows"));
00864 m_eol->insertItem (i18n("Macintosh"));
00865
00866 QVGroupBox *gbMem = new QVGroupBox(i18n("Memory Usage"), this);
00867 layout->addWidget( gbMem );
00868
00869 e5Layout = new QHBox(gbMem);
00870 e5Layout->setSpacing (32);
00871 blockCountLabel = new QLabel(i18n("Maximum loaded &blocks per file:"), e5Layout);
00872 blockCount = new QSpinBox (4, 512, 4, e5Layout);
00873
00874 blockCount->setValue (KateBuffer::maxLoadedBlocks());
00875 blockCountLabel->setBuddy(blockCount);
00876
00877 QVGroupBox *gbWhiteSpace = new QVGroupBox(i18n("Automatic Cleanups on Load/Save"), this);
00878 layout->addWidget( gbWhiteSpace );
00879
00880 removeSpaces = new QCheckBox(i18n("Re&move trailing spaces"), gbWhiteSpace);
00881 removeSpaces->setChecked(configFlags & KateDocument::cfRemoveSpaces);
00882
00883 QVGroupBox *dirConfigBox = new QVGroupBox(i18n("Folder Config File"), this);
00884 layout->addWidget( dirConfigBox );
00885
00886 dirSearchDepth = new KIntNumInput(KateDocumentConfig::global()->searchDirConfigDepth(), dirConfigBox);
00887 dirSearchDepth->setRange(-1, 64, 1, false);
00888 dirSearchDepth->setSpecialValueText( i18n("Do not use config file") );
00889 dirSearchDepth->setLabel(i18n("Se&arch depth for config file:"), AlignVCenter);
00890
00891 QGroupBox *gb = new QGroupBox( 1, Qt::Horizontal, i18n("Backup on Save"), this );
00892 layout->addWidget( gb );
00893 cbLocalFiles = new QCheckBox( i18n("&Local files"), gb );
00894 cbRemoteFiles = new QCheckBox( i18n("&Remote files"), gb );
00895
00896 QHBox *hbBuPrefix = new QHBox( gb );
00897 QLabel *lBuPrefix = new QLabel( i18n("&Prefix:"), hbBuPrefix );
00898 leBuPrefix = new QLineEdit( hbBuPrefix );
00899 lBuPrefix->setBuddy( leBuPrefix );
00900
00901 QHBox *hbBuSuffix = new QHBox( gb );
00902 QLabel *lBuSuffix = new QLabel( i18n("&Suffix:"), hbBuSuffix );
00903 leBuSuffix = new QLineEdit( hbBuSuffix );
00904 lBuSuffix->setBuddy( leBuSuffix );
00905
00906 layout->addStretch();
00907
00908 QWhatsThis::add(removeSpaces, i18n(
00909 "The editor will automatically eliminate extra spaces at the ends of "
00910 "lines of text while loading/saving the file."));
00911 QWhatsThis::add( gb, i18n(
00912 "<p>Backing up on save will cause Kate to copy the disk file to "
00913 "'<prefix><filename><suffix>' before saving changes."
00914 "<p>The suffix defaults to <strong>~</strong> and prefix is empty by default" ) );
00915 QWhatsThis::add( allowEolDetection, i18n(
00916 "Check this if you want the editor to autodetect the end of line type."
00917 "The first found end of line type will be used for the whole file.") );
00918 QWhatsThis::add( cbLocalFiles, i18n(
00919 "Check this if you want backups of local files when saving") );
00920 QWhatsThis::add( cbRemoteFiles, i18n(
00921 "Check this if you want backups of remote files when saving") );
00922 QWhatsThis::add( leBuPrefix, i18n(
00923 "Enter the prefix to prepend to the backup file names" ) );
00924 QWhatsThis::add( leBuSuffix, i18n(
00925 "Enter the suffix to add to the backup file names" ) );
00926 QWhatsThis::add(dirSearchDepth, i18n(
00927 "The editor will search the given number of folder levels upwards for .kateconfig file"
00928 " and load the settings line from it." ));
00929 QWhatsThis::add(blockCount, i18n(
00930 "The editor will load given number of blocks (of around 2048 lines) of text into memory;"
00931 " if the filesize is bigger than this the other blocks are swapped "
00932 " to disk and loaded transparently as-needed.<br>"
00933 " This can cause little delays while navigating in the document; a larger block count"
00934 " increases the editing speed at the cost of memory. <br>For normal usage, just choose the highest possible"
00935 " block count: limit it only if you have problems with the memory usage."));
00936
00937 reload();
00938
00939
00940
00941
00942
00943 connect(m_encoding, SIGNAL(activated(int)), this, SLOT(slotChanged()));
00944 connect(m_eol, SIGNAL(activated(int)), this, SLOT(slotChanged()));
00945 connect( allowEolDetection, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00946 connect(blockCount, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
00947 connect(removeSpaces, SIGNAL(toggled(bool)), this, SLOT(slotChanged()));
00948 connect( cbLocalFiles, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00949 connect( cbRemoteFiles, SIGNAL( toggled(bool) ), this, SLOT( slotChanged() ) );
00950 connect(dirSearchDepth, SIGNAL(valueChanged(int)), this, SLOT(slotChanged()));
00951 connect( leBuPrefix, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
00952 connect( leBuSuffix, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
00953 }
00954
00955 void KateSaveConfigTab::apply()
00956 {
00957
00958 if (!changed())
00959 return;
00960 m_changed = false;
00961
00962 KateBuffer::setMaxLoadedBlocks (blockCount->value());
00963
00964 KateDocumentConfig::global()->configStart ();
00965
00966 if ( leBuSuffix->text().isEmpty() && leBuPrefix->text().isEmpty() ) {
00967 KMessageBox::information(
00968 this,
00969 i18n("You did not provide a backup suffix or prefix. Using default suffix: '~'"),
00970 i18n("No Backup Suffix or Prefix")
00971 );
00972 leBuSuffix->setText( "~" );
00973 }
00974
00975 uint f( 0 );
00976 if ( cbLocalFiles->isChecked() )
00977 f |= KateDocumentConfig::LocalFiles;
00978 if ( cbRemoteFiles->isChecked() )
00979 f |= KateDocumentConfig::RemoteFiles;
00980
00981 KateDocumentConfig::global()->setBackupFlags(f);
00982 KateDocumentConfig::global()->setBackupPrefix(leBuPrefix->text());
00983 KateDocumentConfig::global()->setBackupSuffix(leBuSuffix->text());
00984
00985 KateDocumentConfig::global()->setSearchDirConfigDepth(dirSearchDepth->value());
00986
00987 int configFlags = KateDocumentConfig::global()->configFlags();
00988
00989 configFlags &= ~KateDocument::cfRemoveSpaces;
00990 if (removeSpaces->isChecked()) configFlags |= KateDocument::cfRemoveSpaces;
00991
00992 KateDocumentConfig::global()->setConfigFlags(configFlags);
00993
00994 KateDocumentConfig::global()->setEncoding((m_encoding->currentItem() == 0) ? "" : KGlobal::charsets()->encodingForName(m_encoding->currentText()));
00995
00996 KateDocumentConfig::global()->setEol(m_eol->currentItem());
00997 KateDocumentConfig::global()->setAllowEolDetection(allowEolDetection->isChecked());
00998
00999 KateDocumentConfig::global()->configEnd ();
01000 }
01001
01002 void KateSaveConfigTab::reload()
01003 {
01004
01005 m_encoding->clear ();
01006 m_encoding->insertItem (i18n("KDE Default"));
01007 m_encoding->setCurrentItem(0);
01008 QStringList encodings (KGlobal::charsets()->descriptiveEncodingNames());
01009 int insert = 1;
01010 for (uint i=0; i < encodings.count(); i++)
01011 {
01012 bool found = false;
01013 QTextCodec *codecForEnc = KGlobal::charsets()->codecForName(KGlobal::charsets()->encodingForName(encodings[i]), found);
01014
01015 if (found)
01016 {
01017 m_encoding->insertItem (encodings[i]);
01018
01019 if ( codecForEnc->name() == KateDocumentConfig::global()->encoding() )
01020 {
01021 m_encoding->setCurrentItem(insert);
01022 }
01023
01024 insert++;
01025 }
01026 }
01027
01028
01029 m_eol->setCurrentItem(KateDocumentConfig::global()->eol());
01030 allowEolDetection->setChecked(KateDocumentConfig::global()->allowEolDetection());
01031
01032 dirSearchDepth->setValue(KateDocumentConfig::global()->searchDirConfigDepth());
01033
01034
01035 uint f ( KateDocumentConfig::global()->backupFlags() );
01036 cbLocalFiles->setChecked( f & KateDocumentConfig::LocalFiles );
01037 cbRemoteFiles->setChecked( f & KateDocumentConfig::RemoteFiles );
01038 leBuPrefix->setText( KateDocumentConfig::global()->backupPrefix() );
01039 leBuSuffix->setText( KateDocumentConfig::global()->backupSuffix() );
01040 }
01041
01042 void KateSaveConfigTab::reset()
01043 {
01044 }
01045
01046 void KateSaveConfigTab::defaults()
01047 {
01048 cbLocalFiles->setChecked( true );
01049 cbRemoteFiles->setChecked( false );
01050 leBuPrefix->setText( "" );
01051 leBuSuffix->setText( "~" );
01052 }
01053
01054
01055
01056
01057 class KatePartPluginListItem : public QCheckListItem
01058 {
01059 public:
01060 KatePartPluginListItem(bool checked, uint i, const QString &name, QListView *parent);
01061 uint pluginIndex () const { return index; }
01062
01063 protected:
01064 void stateChange(bool);
01065
01066 private:
01067 uint index;
01068 bool silentStateChange;
01069 };
01070
01071 KatePartPluginListItem::KatePartPluginListItem(bool checked, uint i, const QString &name, QListView *parent)
01072 : QCheckListItem(parent, name, CheckBox)
01073 , index(i)
01074 , silentStateChange(false)
01075 {
01076 silentStateChange = true;
01077 setOn(checked);
01078 silentStateChange = false;
01079 }
01080
01081 void KatePartPluginListItem::stateChange(bool b)
01082 {
01083 if(!silentStateChange)
01084 static_cast<KatePartPluginListView *>(listView())->stateChanged(this, b);
01085 }
01086
01087
01088
01089 KatePartPluginListView::KatePartPluginListView(QWidget *parent, const char *name)
01090 : KListView(parent, name)
01091 {
01092 }
01093
01094 void KatePartPluginListView::stateChanged(KatePartPluginListItem *item, bool b)
01095 {
01096 emit stateChange(item, b);
01097 }
01098
01099
01100
01101 KatePartPluginConfigPage::KatePartPluginConfigPage (QWidget *parent) : KateConfigPage (parent, "")
01102 {
01103
01104 QGridLayout *grid = new QGridLayout( this, 1, 1 );
01105 grid->setSpacing( KDialogBase::spacingHint() );
01106
01107 listView = new KatePartPluginListView(this);
01108 listView->addColumn(i18n("Name"));
01109 listView->addColumn(i18n("Comment"));
01110
01111 grid->addWidget( listView, 0, 0);
01112
01113 for (uint i=0; i<KateFactory::self()->plugins().count(); i++)
01114 {
01115 KatePartPluginListItem *item = new KatePartPluginListItem(KateDocumentConfig::global()->plugin(i), i, (KateFactory::self()->plugins())[i]->name(), listView);
01116 item->setText(0, (KateFactory::self()->plugins())[i]->name());
01117 item->setText(1, (KateFactory::self()->plugins())[i]->comment());
01118
01119 m_items.append (item);
01120 }
01121
01122
01123
01124 btnConfigure = new QPushButton( i18n("Configure..."), this );
01125 btnConfigure->setEnabled( false );
01126 grid->addWidget( btnConfigure, 1, 0, Qt::AlignRight );
01127 connect( btnConfigure, SIGNAL(clicked()), this, SLOT(slotConfigure()) );
01128
01129 connect( listView, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotCurrentChanged(QListViewItem*)) );
01130 connect( listView, SIGNAL(stateChange(KatePartPluginListItem *, bool)),
01131 this, SLOT(slotStateChanged(KatePartPluginListItem *, bool)));
01132 connect(listView, SIGNAL(stateChange(KatePartPluginListItem *, bool)), this, SLOT(slotChanged()));
01133 }
01134
01135 KatePartPluginConfigPage::~KatePartPluginConfigPage ()
01136 {
01137 }
01138
01139 void KatePartPluginConfigPage::apply ()
01140 {
01141
01142 if (!changed())
01143 return;
01144 m_changed = false;
01145
01146 KateDocumentConfig::global()->configStart ();
01147
01148 for (uint i=0; i < m_items.count(); i++)
01149 KateDocumentConfig::global()->setPlugin (m_items.at(i)->pluginIndex(), m_items.at(i)->isOn());
01150
01151 KateDocumentConfig::global()->configEnd ();
01152 }
01153
01154 void KatePartPluginConfigPage::slotStateChanged( KatePartPluginListItem *item, bool b )
01155 {
01156 if ( b )
01157 slotCurrentChanged( (QListViewItem*)item );
01158 }
01159
01160 void KatePartPluginConfigPage::slotCurrentChanged( QListViewItem* i )
01161 {
01162 KatePartPluginListItem *item = static_cast<KatePartPluginListItem *>(i);
01163 if ( ! item ) return;
01164
01165 bool b = false;
01166 if ( item->isOn() )
01167 {
01168
01169
01170 KTextEditor::Plugin *plugin = KTextEditor::createPlugin(QFile::encodeName((KateFactory::self()->plugins())[item->pluginIndex()]->library()));
01171 if ( plugin ) {
01172 KTextEditor::ConfigInterfaceExtension *cie = KTextEditor::configInterfaceExtension( plugin );
01173 b = ( cie && cie->configPages() );
01174 }
01175
01176 }
01177 btnConfigure->setEnabled( b );
01178 }
01179
01180 void KatePartPluginConfigPage::slotConfigure()
01181 {
01182 KatePartPluginListItem *item = static_cast<KatePartPluginListItem*>(listView->currentItem());
01183 KTextEditor::Plugin *plugin =
01184 KTextEditor::createPlugin(QFile::encodeName((KateFactory::self()->plugins())[item->pluginIndex()]->library()));
01185
01186 if ( ! plugin ) return;
01187
01188 KTextEditor::ConfigInterfaceExtension *cife =
01189 KTextEditor::configInterfaceExtension( plugin );
01190
01191 if ( ! cife )
01192 return;
01193
01194 if ( ! cife->configPages() )
01195 return;
01196
01197
01198 KDialogBase::DialogType dt =
01199 cife->configPages() > 1 ?
01200 KDialogBase::IconList :
01201 KDialogBase::Plain;
01202
01203 QString name = (KateFactory::self()->plugins())[item->pluginIndex()]->name();
01204 KDialogBase *kd = new KDialogBase ( dt,
01205 i18n("Configure %1").arg( name ),
01206 KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help,
01207 KDialogBase::Ok,
01208 this );
01209
01210 QPtrList<KTextEditor::ConfigPage> editorPages;
01211
01212 for (uint i = 0; i < cife->configPages (); i++)
01213 {
01214 QWidget *page;
01215 if ( dt == KDialogBase::IconList )
01216 {
01217 QStringList path;
01218 path.clear();
01219 path << cife->configPageName( i );
01220 page = kd->addVBoxPage( path, cife->configPageFullName (i),
01221 cife->configPagePixmap(i, KIcon::SizeMedium) );
01222 }
01223 else
01224 {
01225 page = kd->plainPage();
01226 QVBoxLayout *_l = new QVBoxLayout( page );
01227 _l->setAutoAdd( true );
01228 }
01229
01230 editorPages.append( cife->configPage( i, page ) );
01231 }
01232
01233 if (kd->exec())
01234 {
01235
01236 for( uint i=0; i<editorPages.count(); i++ )
01237 {
01238 editorPages.at( i )->apply();
01239 }
01240 }
01241
01242 delete kd;
01243 }
01244
01245
01246
01247 KateHlConfigPage::KateHlConfigPage (QWidget *parent)
01248 : KateConfigPage (parent, "")
01249 , hlData (0)
01250 {
01251 QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() );
01252
01253
01254 QHBox *hbHl = new QHBox( this );
01255 layout->add (hbHl);
01256
01257 hbHl->setSpacing( KDialog::spacingHint() );
01258 QLabel *lHl = new QLabel( i18n("H&ighlight:"), hbHl );
01259 hlCombo = new QComboBox( false, hbHl );
01260 lHl->setBuddy( hlCombo );
01261 connect( hlCombo, SIGNAL(activated(int)),
01262 this, SLOT(hlChanged(int)) );
01263
01264 for( int i = 0; i < KateHlManager::self()->highlights(); i++) {
01265 if (KateHlManager::self()->hlSection(i).length() > 0)
01266 hlCombo->insertItem(KateHlManager::self()->hlSection(i) + QString ("/") + KateHlManager::self()->hlNameTranslated(i));
01267 else
01268 hlCombo->insertItem(KateHlManager::self()->hlNameTranslated(i));
01269 }
01270 hlCombo->setCurrentItem(0);
01271
01272 QGroupBox *gbInfo = new QGroupBox( 1, Qt::Horizontal, i18n("Information"), this );
01273 layout->add (gbInfo);
01274
01275
01276 QHBox *hb1 = new QHBox( gbInfo);
01277 new QLabel( i18n("Author:"), hb1 );
01278 author = new QLabel (hb1);
01279 author->setTextFormat (Qt::RichText);
01280
01281
01282 QHBox *hb2 = new QHBox( gbInfo);
01283 new QLabel( i18n("License:"), hb2 );
01284 license = new QLabel (hb2);
01285
01286 QGroupBox *gbProps = new QGroupBox( 1, Qt::Horizontal, i18n("Properties"), this );
01287 layout->add (gbProps);
01288
01289
01290 QHBox *hbFE = new QHBox( gbProps);
01291 QLabel *lFileExts = new QLabel( i18n("File e&xtensions:"), hbFE );
01292 wildcards = new QLineEdit( hbFE );
01293 lFileExts->setBuddy( wildcards );
01294
01295 QHBox *hbMT = new QHBox( gbProps );
01296 QLabel *lMimeTypes = new QLabel( i18n("MIME &types:"), hbMT);
01297 mimetypes = new QLineEdit( hbMT );
01298 lMimeTypes->setBuddy( mimetypes );
01299
01300 QHBox *hbMT2 = new QHBox( gbProps );
01301 QLabel *lprio = new QLabel( i18n("Prio&rity:"), hbMT2);
01302 priority = new KIntNumInput( hbMT2 );
01303
01304 lprio->setBuddy( priority );
01305
01306 QToolButton *btnMTW = new QToolButton(hbMT);
01307 btnMTW->setIconSet(QIconSet(SmallIcon("wizard")));
01308 connect(btnMTW, SIGNAL(clicked()), this, SLOT(showMTDlg()));
01309
01310
01311 QHBox *hbBtns = new QHBox( this );
01312 layout->add (hbBtns);
01313
01314 ((QBoxLayout*)hbBtns->layout())->addStretch(1);
01315 hbBtns->setSpacing( KDialog::spacingHint() );
01316 QPushButton *btnDl = new QPushButton(i18n("Do&wnload..."), hbBtns);
01317 connect( btnDl, SIGNAL(clicked()), this, SLOT(hlDownload()) );
01318
01319 hlCombo->setCurrentItem( 0 );
01320 hlChanged(0);
01321
01322 QWhatsThis::add( hlCombo, i18n(
01323 "Choose a <em>Syntax Highlight mode</em> from this list to view its "
01324 "properties below.") );
01325 QWhatsThis::add( wildcards, i18n(
01326 "The list of file extensions used to determine which files to highlight "
01327 "using the current syntax highlight mode.") );
01328 QWhatsThis::add( mimetypes, i18n(
01329 "The list of Mime Types used to determine which files to highlight "
01330 "using the current highlight mode.<p>Click the wizard button on the "
01331 "left of the entry field to display the MimeType selection dialog.") );
01332 QWhatsThis::add( btnMTW, i18n(
01333 "Display a dialog with a list of all available mime types to choose from."
01334 "<p>The <strong>File Extensions</strong> entry will automatically be "
01335 "edited as well.") );
01336 QWhatsThis::add( btnDl, i18n(
01337 "Click this button to download new or updated syntax highlight "
01338 "descriptions from the Kate website.") );
01339
01340 layout->addStretch ();
01341
01342 connect( wildcards, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
01343 connect( mimetypes, SIGNAL( textChanged ( const QString & ) ), this, SLOT( slotChanged() ) );
01344 connect( priority, SIGNAL( valueChanged ( int ) ), this, SLOT( slotChanged() ) );
01345 }
01346
01347 KateHlConfigPage::~KateHlConfigPage ()
01348 {
01349 }
01350
01351 void KateHlConfigPage::apply ()
01352 {
01353
01354 if (!changed())
01355 return;
01356 m_changed = false;
01357
01358 writeback();
01359
01360 for ( QIntDictIterator<KateHlData> it( hlDataDict ); it.current(); ++it )
01361 KateHlManager::self()->getHl( it.currentKey() )->setData( it.current() );
01362
01363 KateHlManager::self()->getKConfig()->sync ();
01364 }
01365
01366 void KateHlConfigPage::reload ()
01367 {
01368 }
01369
01370 void KateHlConfigPage::hlChanged(int z)
01371 {
01372 writeback();
01373
01374 KateHighlighting *hl = KateHlManager::self()->getHl( z );
01375
01376 if (!hl)
01377 {
01378 hlData = 0;
01379 return;
01380 }
01381
01382 if ( !hlDataDict.find( z ) )
01383 hlDataDict.insert( z, hl->getData() );
01384
01385 hlData = hlDataDict.find( z );
01386 wildcards->setText(hlData->wildcards);
01387 mimetypes->setText(hlData->mimetypes);
01388 priority->setValue(hlData->priority);
01389
01390
01391 QStringList l= QStringList::split (QRegExp("[,;]"), hl->author());
01392 author->setText (l.join ("<br>"));
01393
01394 license->setText (hl->license());
01395 }
01396
01397 void KateHlConfigPage::writeback()
01398 {
01399 if (hlData)
01400 {
01401 hlData->wildcards = wildcards->text();
01402 hlData->mimetypes = mimetypes->text();
01403 hlData->priority = priority->value();
01404 }
01405 }
01406
01407 void KateHlConfigPage::hlDownload()
01408 {
01409 KateHlDownloadDialog diag(this,"hlDownload",true);
01410 diag.exec();
01411 }
01412
01413 void KateHlConfigPage::showMTDlg()
01414 {
01415 QString text = i18n("Select the MimeTypes you want highlighted using the '%1' syntax highlight rules.\nPlease note that this will automatically edit the associated file extensions as well.").arg( hlCombo->currentText() );
01416 QStringList list = QStringList::split( QRegExp("\\s*;\\s*"), mimetypes->text() );
01417 KMimeTypeChooserDialog *d = new KMimeTypeChooserDialog( i18n("Select Mime Types"), text, list, "text", this );
01418
01419 if ( d->exec() == KDialogBase::Accepted ) {
01420
01421
01422 wildcards->setText(d->chooser()->patterns().join(";"));
01423 mimetypes->setText(d->chooser()->mimeTypes().join(";"));
01424 }
01425 }
01426
01427
01428
01429 KateHlDownloadDialog::KateHlDownloadDialog(QWidget *parent, const char *name, bool modal)
01430 :KDialogBase(KDialogBase::Swallow, i18n("Highlight Download"), User1|Close, User1, parent, name, modal, true, i18n("&Install"))
01431 {
01432 QVBox* vbox = new QVBox(this);
01433 setMainWidget(vbox);
01434 vbox->setSpacing(spacingHint());
01435 new QLabel(i18n("Select the syntax highlighting files you want to update:"), vbox);
01436 list = new QListView(vbox);
01437 list->addColumn("");
01438 list->addColumn(i18n("Name"));
01439 list->addColumn(i18n("Installed"));
01440 list->addColumn(i18n("Latest"));
01441 list->setSelectionMode(QListView::Multi);
01442 list->setAllColumnsShowFocus(true);
01443
01444 new QLabel(i18n("<b>Note:</b> New versions are selected automatically."), vbox);
01445 actionButton (User1)->setIconSet(SmallIconSet("ok"));
01446
01447 transferJob = KIO::get(
01448 KURL(QString(HLDOWNLOADPATH)
01449 + QString("update-")
01450 + QString(KATEPART_VERSION)
01451 + QString(".xml")), true, true );
01452 connect(transferJob, SIGNAL(data(KIO::Job *, const QByteArray &)),
01453 this, SLOT(listDataReceived(KIO::Job *, const QByteArray &)));
01454
01455 resize(450, 400);
01456 }
01457
01458 KateHlDownloadDialog::~KateHlDownloadDialog(){}
01459
01460 void KateHlDownloadDialog::listDataReceived(KIO::Job *, const QByteArray &data)
01461 {
01462 if (!transferJob || transferJob->isErrorPage())
01463 {
01464 actionButton(User1)->setEnabled(false);
01465 return;
01466 }
01467
01468 listData+=QString(data);
01469 kdDebug(13000)<<QString("CurrentListData: ")<<listData<<endl<<endl;
01470 kdDebug(13000)<<QString("Data length: %1").arg(data.size())<<endl;
01471 kdDebug(13000)<<QString("listData length: %1").arg(listData.length())<<endl;
01472 if (data.size()==0)
01473 {
01474 if (listData.length()>0)
01475 {
01476 QString installedVersion;
01477 KateHlManager *hlm=KateHlManager::self();
01478 QDomDocument doc;
01479 doc.setContent(listData);
01480 QDomElement DocElem=doc.documentElement();
01481 QDomNode n=DocElem.firstChild();
01482 KateHighlighting *hl = 0;
01483
01484 if (n.isNull()) kdDebug(13000)<<"There is no usable childnode"<<endl;
01485 while (!n.isNull())
01486 {
01487 installedVersion=" --";
01488
01489 QDomElement e=n.toElement();
01490 if (!e.isNull())
01491 kdDebug(13000)<<QString("NAME: ")<<e.tagName()<<QString(" - ")<<e.attribute("name")<<endl;
01492 n=n.nextSibling();
01493
01494 QString Name=e.attribute("name");
01495
01496 for (int i=0;i<hlm->highlights();i++)
01497 {
01498 hl=hlm->getHl(i);
01499 if (hl && hl->name()==Name)
01500 {
01501 installedVersion=" "+hl->version();
01502 break;
01503 }
01504 else hl = 0;
01505 }
01506
01507
01508 QListViewItem* entry = new QListViewItem(
01509 list, "", e.attribute("name"), installedVersion,
01510 e.attribute("version"),e.attribute("url"));
01511 if (!hl || hl->version() < e.attribute("version"))
01512 {
01513 entry->setSelected(true);
01514 entry->setPixmap(0, SmallIcon(("knewstuff")));
01515 }
01516 }
01517 }
01518 }
01519 }
01520
01521 void KateHlDownloadDialog::slotUser1()
01522 {
01523 QString destdir=KGlobal::dirs()->saveLocation("data","katepart/syntax/");
01524 for (QListViewItem *it=list->firstChild();it;it=it->nextSibling())
01525 {
01526 if (list->isSelected(it))
01527 {
01528 KURL src(it->text(4));
01529 QString filename=src.fileName(false);
01530 QString dest = destdir+filename;
01531
01532 KIO::NetAccess::download(src,dest, this);
01533 }
01534 }
01535
01536
01537 KateSyntaxDocument doc (true);
01538 }
01539
01540
01541
01542 KateGotoLineDialog::KateGotoLineDialog(QWidget *parent, int line, int max)
01543 : KDialogBase(parent, 0L, true, i18n("Go to Line"), Ok | Cancel, Ok) {
01544
01545 QWidget *page = new QWidget(this);
01546 setMainWidget(page);
01547
01548 QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
01549 e1 = new KIntNumInput(line, page);
01550 e1->setRange(1, max);
01551 e1->setEditFocus(true);
01552
01553 QLabel *label = new QLabel( e1,i18n("&Go to line:"), page );
01554 topLayout->addWidget(label);
01555 topLayout->addWidget(e1);
01556 topLayout->addSpacing(spacingHint());
01557 topLayout->addStretch(10);
01558 e1->setFocus();
01559 }
01560
01561 int KateGotoLineDialog::getLine() {
01562 return e1->value();
01563 }
01564
01565
01566
01567 KateModOnHdPrompt::KateModOnHdPrompt( KateDocument *doc,
01568 int modtype,
01569 const QString &reason,
01570 QWidget *parent )
01571 : KDialogBase( parent, "", true, "", Ok|Apply|Cancel|User1 ),
01572 m_doc( doc ),
01573 m_modtype ( modtype ),
01574 m_tmpfile( 0 )
01575 {
01576 QString title, btnOK, whatisok;
01577 if ( modtype == 3 )
01578 {
01579 title = i18n("File Was Deleted on Disk");
01580 btnOK = i18n("&Save File As...");
01581 whatisok = i18n("Lets you select a location and save the file again.");
01582 } else {
01583 title = i18n("File Changed on Disk");
01584 btnOK = i18n("&Reload File");
01585 whatisok = i18n("Reload the file from disk. If you have unsaved changes, "
01586 "they will be lost.");
01587 }
01588
01589 setButtonText( Ok, btnOK);
01590 setButtonText( Apply, i18n("&Ignore") );
01591
01592 setButtonWhatsThis( Ok, whatisok );
01593 setButtonWhatsThis( Apply, i18n("Ignore the changes. You will not be prompted again.") );
01594 setButtonWhatsThis( Cancel, i18n("Do nothing. Next time you focus the file, "
01595 "or try to save it or close it, you will be prompted again.") );
01596
01597 enableButtonSeparator( true );
01598 setCaption( title );
01599
01600 QFrame *w = makeMainWidget();
01601 QVBoxLayout *lo = new QVBoxLayout( w );
01602 QHBoxLayout *lo1 = new QHBoxLayout( lo );
01603 QLabel *icon = new QLabel( w );
01604 icon->setPixmap( DesktopIcon("messagebox_warning" ) );
01605 lo1->addWidget( icon );
01606 lo1->addWidget( new QLabel( reason + "\n\n" + i18n("What do you want to do?"), w ) );
01607
01608
01609 if ( modtype != 3 )
01610 {
01611 QHBoxLayout *lo2 = new QHBoxLayout( lo );
01612 QPushButton *btnDiff = new QPushButton( i18n("&View Difference"), w );
01613 lo2->addStretch( 1 );
01614 lo2->addWidget( btnDiff );
01615 connect( btnDiff, SIGNAL(clicked()), this, SLOT(slotDiff()) );
01616 QWhatsThis::add( btnDiff, i18n(
01617 "Calculates the difference between the editor contents and the disk "
01618 "file using diff(1) and opens the diff file with the default application "
01619 "for that.") );
01620
01621 setButtonText( User1, i18n("Overwrite") );
01622 setButtonWhatsThis( User1, i18n("Overwrite the disk file with the editor content.") );
01623 }
01624 else
01625 showButton( User1, false );
01626 }
01627
01628 KateModOnHdPrompt::~KateModOnHdPrompt()
01629 {
01630 }
01631
01632 void KateModOnHdPrompt::slotDiff()
01633 {
01634
01635 KProcIO *p = new KProcIO();
01636 p->setComm( KProcess::All );
01637 *p << "diff" << "-ub" << "-" << m_doc->url().path();
01638 connect( p, SIGNAL(processExited(KProcess*)), this, SLOT(slotPDone(KProcess*)) );
01639 connect( p, SIGNAL(readReady(KProcIO*)), this, SLOT(slotPRead(KProcIO*)) );
01640
01641 setCursor( WaitCursor );
01642
01643 p->start( KProcess::NotifyOnExit, true );
01644
01645 uint lastln = m_doc->numLines();
01646 for ( uint l = 0; l < lastln; l++ )
01647 p->writeStdin( m_doc->textLine( l ), l < lastln );
01648
01649 p->closeWhenDone();
01650 }
01651
01652 void KateModOnHdPrompt::slotPRead( KProcIO *p)
01653 {
01654
01655 if ( ! m_tmpfile )
01656 m_tmpfile = new KTempFile();
01657
01658 QString stmp;
01659 while ( p->readln( stmp, false ) > -1 )
01660 *m_tmpfile->textStream() << stmp << endl;
01661
01662 p->ackRead();
01663 }
01664
01665 void KateModOnHdPrompt::slotPDone( KProcess *p )
01666 {
01667 setCursor( ArrowCursor );
01668 m_tmpfile->close();
01669
01670 if ( ! p->normalExit() )
01671 {
01672 KMessageBox::sorry( this,
01673 i18n("The diff command failed. Please make sure that "
01674 "diff(1) is installed and in your PATH."),
01675 i18n("Error Creating Diff") );
01676 return;
01677 }
01678
01679 KRun::runURL( m_tmpfile->name(), "text/x-diff", true );
01680 delete m_tmpfile;
01681 m_tmpfile = 0;
01682 }
01683
01684 void KateModOnHdPrompt::slotApply()
01685 {
01686 if ( KMessageBox::warningContinueCancel(
01687 this,
01688 i18n("Ignoring means that you will not be warned again (unless "
01689 "the disk file changes once more): if you save the document, you "
01690 "will overwrite the file on disk; if you do not save then the disk file "
01691 "(if present) is what you have."),
01692 i18n("You Are on Your Own"),
01693 KStdGuiItem::cont(),
01694 "kate_ignore_modonhd" ) != KMessageBox::Continue )
01695 return;
01696
01697 done(Ignore);
01698 }
01699
01700 void KateModOnHdPrompt::slotOk()
01701 {
01702 done( m_modtype == 3 ? Save : Reload );
01703 }
01704
01705 void KateModOnHdPrompt::slotUser1()
01706 {
01707 done( Overwrite );
01708 }
01709
01710
01711
01712