~ubuntu-branches/ubuntu/jaunty/kde4libs/jaunty-updates

« back to all changes in this revision

Viewing changes to kate/view/kateview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Harald Sitter
  • Date: 2008-12-11 18:26:08 UTC
  • mfrom: (1.1.24 upstream)
  • Revision ID: james.westby@ubuntu.com-20081211182608-tsu6p8ncbw1gnqxt
Tags: 4:4.1.85-0ubuntu1
* New upstream release
* Patches:
  + Removed 15_kfreebsd_support.diff from patches/series (doesn't apply and
    has no use for Ubuntu)
  + Redid 20_use_dejavu_as_default_font.diff
  + Completely removed kubuntu_09_fix_application_menu.diff (applied upstream)
  + Refreshed kubuntu_54_use_xdg_menu_prefix.diff
  + Dropped plasma/widgets/toolbutton.cpp from kubuntu_qt_ftbfs.diff (applied
    upstream)
  + Global quilt refresh

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
#include <QtGui/QFont>
83
83
#include <QtCore/QFileInfo>
84
84
#include <QtGui/QStyle>
 
85
#include <QtGui/QComboBox>
85
86
#include <QtGui/QKeyEvent>
86
87
#include <QtGui/QLayout>
87
88
#include <QtGui/QClipboard>
465
466
                      " with all highlighting information into a HTML document."));
466
467
  connect(a, SIGNAL(triggered(bool)), SLOT(exportAsHTML()));
467
468
 
468
 
  m_selectAll = a= ac->addAction( KStandardAction::SelectAll, this, SLOT(selectAll()) );
 
469
  m_selectAll = a= ac->addAction( KStandardAction::SelectAll, this, SLOT(selectAllByAction()) );
469
470
  a->setWhatsThis(i18n("Select the entire text of the current document."));
470
471
 
471
472
  m_deSelect = a= ac->addAction( KStandardAction::Deselect, this, SLOT(clearSelection()) );
885
886
    connect(a, SIGNAL(triggered(bool)), SLOT(smartNewline()));
886
887
    m_editActions << a;
887
888
 
 
889
 
888
890
#if 0
889
891
#ifdef __GNUC__
890
892
#warning REMOVE THIS IN THE RELEASE
1273
1275
 
1274
1276
void KateView::showViModeBar()
1275
1277
{
1276
 
  if (!config()->viInputModeHideStatusBar()) {
 
1278
  if (viInputMode() && !config()->viInputModeHideStatusBar()) {
1277
1279
    m_viewBar->addPermanentBarWidget(viModeBar());
1278
1280
    updateViModeBarMode();
1279
1281
  }
1317
1319
{
1318
1320
  const bool INIT_HINT_AS_INCREMENTAL = false;
1319
1321
  KateSearchBar * const bar = searchBar(INIT_HINT_AS_INCREMENTAL);
 
1322
  if (bar->hasFocus())//make returning to main edit widget w/o loosing search info possible
 
1323
    return m_viewInternal->setFocus();
1320
1324
  bar->onMutateIncremental();
1321
1325
  m_viewBar->showBarWidget(bar);
1322
1326
  bar->setFocus();
1338
1342
{
1339
1343
  const bool INIT_HINT_AS_POWER = true;
1340
1344
  KateSearchBar * const bar = searchBar(INIT_HINT_AS_POWER);
 
1345
  if (bar->hasFocus())//make returning to main edit widget w/o loosing search info possible
 
1346
    return m_viewInternal->setFocus();
1341
1347
  bar->onMutatePower();
1342
1348
  m_viewBar->showBarWidget(bar);
1343
1349
  bar->setFocus();
1372
1378
  // if the user has selected text, insert the selection's range (start line to end line) in the
1373
1379
  // command line when opened
1374
1380
  if (selectionRange().start().line() != -1 && selectionRange().end().line() != -1) {
1375
 
    cmdLine()->setText(QString::number(selectionRange().start().line()+1)+","
 
1381
    cmdLine()->setText(QString::number(selectionRange().start().line()+1)+','
1376
1382
        +QString::number(selectionRange().end().line()+1));
1377
1383
  }
1378
1384
  m_viewBar->showBarWidget(cmdLine());
1686
1692
  return true;
1687
1693
}
1688
1694
 
 
1695
bool KateView::selectAllByAction() {
 
1696
    if (m_selectAll->shortcut()==QKeySequence(QKeySequence::SelectAll)) {
 
1697
      QLineEdit *le=qobject_cast<QLineEdit*>(QApplication::focusWidget());
 
1698
      if (le) {
 
1699
        le->selectAll();
 
1700
        return true;
 
1701
      } else {
 
1702
        QComboBox *cb=qobject_cast<QComboBox*>(QApplication::focusWidget());
 
1703
        if (cb) {
 
1704
          if (cb->isEditable()) {
 
1705
            le=cb->lineEdit();
 
1706
            if (le) {
 
1707
              le->selectAll();
 
1708
              return true;
 
1709
            }
 
1710
          }
 
1711
        }
 
1712
      }
 
1713
    }
 
1714
    return selectAll();
 
1715
}
 
1716
 
1689
1717
bool KateView::selectAll()
1690
1718
{
 
1719
 
1691
1720
  setBlockSelectionMode (false);
1692
1721
 
1693
1722
  return setSelection(KTextEditor::Range(KTextEditor::Cursor(), m_doc->documentEnd()));
2258
2287
 
2259
2288
void KateView::forceCompletion( )
2260
2289
{
2261
 
  completionWidget()->execute(false);
 
2290
  completionWidget()->execute();
2262
2291
}
2263
2292
 
2264
2293
void KateView::registerCompletionModel(KTextEditor::CodeCompletionModel* model)