mirror of
https://github.com/KDE/konsole.git
synced 2026-05-19 12:09:25 -04:00
Remove leading white spaces in blank lines to make them really empty
This commit is contained in:
@@ -219,7 +219,7 @@ void Application::processTabsFromFileArgs(KCmdLineArgs* args, MainWindow* window
|
||||
<< tabsFileName.toLocal8Bit().data();
|
||||
quit();
|
||||
}
|
||||
|
||||
|
||||
unsigned int sessions = 0;
|
||||
while (!tabsFile.atEnd()) {
|
||||
QString lineString(tabsFile.readLine());
|
||||
@@ -277,7 +277,7 @@ void Application::createTabFromArgs(KCmdLineArgs* args, MainWindow* window, cons
|
||||
if(!newProfile->isEmpty()) {
|
||||
window->setDefaultProfile(newProfile);
|
||||
}
|
||||
|
||||
|
||||
// Create the new session
|
||||
Session* session = createSession(window->defaultProfile(), QString(), window->viewManager());
|
||||
session->setTabTitleFormat(Session::LocalTabTitle, title);
|
||||
@@ -289,13 +289,13 @@ void Application::createTabFromArgs(KCmdLineArgs* args, MainWindow* window, cons
|
||||
if (!window->testAttribute(Qt::WA_Resized)) {
|
||||
window->resize(window->sizeHint());
|
||||
}
|
||||
|
||||
|
||||
// Reset the profile to default. Otherwise, the next manually
|
||||
// created tab would have the command above!
|
||||
newProfile = Profile::Ptr(new Profile(defaultProfile));
|
||||
newProfile->setHidden(true);
|
||||
window->setDefaultProfile(newProfile);
|
||||
|
||||
|
||||
}
|
||||
|
||||
MainWindow* Application::processWindowArgs(KCmdLineArgs* args)
|
||||
@@ -312,7 +312,7 @@ MainWindow* Application::processWindowArgs(KCmdLineArgs* args)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( window == 0 )
|
||||
{
|
||||
window = newMainWindow();
|
||||
@@ -364,7 +364,7 @@ void Application::processProfileChangeArgs(KCmdLineArgs* args,MainWindow* window
|
||||
foreach( const QString &value , args->getOptionList("p") )
|
||||
{
|
||||
ProfileCommandParser parser;
|
||||
|
||||
|
||||
QHashIterator<Profile::Property,QVariant> iter(parser.parse(value));
|
||||
while ( iter.hasNext() )
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ Q_OBJECT
|
||||
public:
|
||||
/** Constructs a new Konsole application. */
|
||||
Application();
|
||||
|
||||
|
||||
virtual ~Application();
|
||||
|
||||
/** Creates a new main window and opens a default terminal session */
|
||||
|
||||
@@ -117,7 +117,7 @@ const Block* BlockArray::at(size_t i)
|
||||
//kDebug() << "BlockArray::at() i > index\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// if (index - i >= length) {
|
||||
// kDebug() << "BlockArray::at() index - i >= length\n";
|
||||
// return 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file was part of the KDE libraries
|
||||
|
||||
|
||||
Copyright 2002 Carsten Pfeiffer <pfeiffer@kde.org>
|
||||
Copyright 2007-2008 Robert Knight <robertknight@gmail.com>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* This file was part of the KDE libraries
|
||||
|
||||
|
||||
Copyright 2002 Carsten Pfeiffer <pfeiffer@kde.org>
|
||||
Copyright 2007-2008 Robert Knight <robertknight@gmail.com>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Konsole, KDE's terminal.
|
||||
|
||||
|
||||
Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
|
||||
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
* or not the character has the RE_BOLD rendition flag.
|
||||
*/
|
||||
ColorEntry::FontWeight fontWeight(const ColorEntry* base) const;
|
||||
|
||||
|
||||
/**
|
||||
* returns true if the format (color, rendition flag) of the compared characters is equal
|
||||
*/
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
* renditions or colors.
|
||||
*/
|
||||
friend bool operator != (const Character& a, const Character& b);
|
||||
|
||||
|
||||
inline bool isLineChar() const
|
||||
{
|
||||
if ( rendition & RE_EXTENDED_CHAR )
|
||||
@@ -144,12 +144,12 @@ public:
|
||||
|
||||
return isSupportedLineChar(character);
|
||||
}
|
||||
|
||||
|
||||
inline bool isSpace() const
|
||||
{
|
||||
return (rendition & RE_EXTENDED_CHAR) ? false : QChar(character).isSpace();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
inline bool operator == (const Character& a, const Character& b)
|
||||
@@ -179,7 +179,7 @@ inline bool Character::equalsFormat(const Character& other) const
|
||||
backgroundColor == other.backgroundColor &&
|
||||
foregroundColor == other.foregroundColor &&
|
||||
rendition == other.rendition;
|
||||
}
|
||||
}
|
||||
|
||||
inline ColorEntry::FontWeight Character::fontWeight(const ColorEntry* base) const
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Konsole, KDE's terminal.
|
||||
|
||||
|
||||
Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
|
||||
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
* with the transparent and bold flags set to false.
|
||||
*/
|
||||
ColorEntry() : transparent(false), fontWeight(UseCurrentFormat) {}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the color, transparency and boldness of this color to those of @p rhs.
|
||||
*/
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
{
|
||||
return _colorSpace != COLOR_SPACE_UNDEFINED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set this color as an intensive system color.
|
||||
*
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
* it is ignored.
|
||||
*/
|
||||
QColor color(const ColorEntry* palette) const;
|
||||
|
||||
|
||||
/**
|
||||
* Compares two colors and returns true if they represent the same color value and
|
||||
* use the same color space.
|
||||
@@ -261,7 +261,7 @@ inline const QColor color256(quint8 u, const ColorEntry* base)
|
||||
if (u < 216) return QColor(((u/36)%6) ? (40*((u/36)%6)+55) : 0,
|
||||
((u/ 6)%6) ? (40*((u/ 6)%6)+55) : 0,
|
||||
((u/ 1)%6) ? (40*((u/ 1)%6)+55) : 0); u -= 216;
|
||||
|
||||
|
||||
// 232..255: gray, leaving out black and white
|
||||
int gray = u*10+8; return QColor(gray,gray,gray);
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ void ColorScheme::setColorTableEntry(int index , const ColorEntry& entry)
|
||||
for (int i=0;i<TABLE_COLORS;i++)
|
||||
_table[i] = defaultTable[i];
|
||||
}
|
||||
|
||||
|
||||
_table[index] = entry;
|
||||
}
|
||||
ColorEntry ColorScheme::colorEntry(int index , uint randomSeed) const
|
||||
@@ -185,14 +185,14 @@ ColorEntry ColorScheme::colorEntry(int index , uint randomSeed) const
|
||||
!_randomTable[index].isNull() )
|
||||
{
|
||||
const RandomizationRange& range = _randomTable[index];
|
||||
|
||||
|
||||
|
||||
int hueDifference = range.hue ? (qrand() % range.hue) - range.hue/2 : 0;
|
||||
int saturationDifference = range.saturation ? (qrand() % range.saturation) - range.saturation/2 : 0;
|
||||
int valueDifference = range.value ? (qrand() % range.value) - range.value/2 : 0;
|
||||
|
||||
QColor& color = entry.color;
|
||||
|
||||
|
||||
int newHue = qAbs( (color.hue() + hueDifference) % MAX_HUE );
|
||||
int newValue = qMin( qAbs(color.value() + valueDifference) , 255 );
|
||||
int newSaturation = qMin( qAbs(color.saturation() + saturationDifference) , 255 );
|
||||
@@ -288,7 +288,7 @@ void ColorScheme::write(KConfig& config) const
|
||||
configGroup.writeEntry("Description",_description);
|
||||
configGroup.writeEntry("Opacity",_opacity);
|
||||
configGroup.writeEntry("Wallpaper", _wallpaper->path());
|
||||
|
||||
|
||||
for (int i=0 ; i < TABLE_COLORS ; i++)
|
||||
{
|
||||
RandomizationRange random = _randomTable != 0 ? _randomTable[i] : RandomizationRange();
|
||||
@@ -311,7 +311,7 @@ QString ColorScheme::translatedColorNameForIndex(int index)
|
||||
void ColorScheme::readColorEntry(KConfig& config , int index)
|
||||
{
|
||||
KConfigGroup configGroup(&config,colorNameForIndex(index));
|
||||
|
||||
|
||||
ColorEntry entry;
|
||||
|
||||
entry.color = configGroup.readEntry("Color",QColor());
|
||||
@@ -520,7 +520,7 @@ bool KDE3ColorSchemeReader::readColorLine(const QString& line,ColorScheme* schem
|
||||
return false;
|
||||
if (list.first() != "color")
|
||||
return false;
|
||||
|
||||
|
||||
int index = list[1].toInt();
|
||||
int red = list[2].toInt();
|
||||
int green = list[3].toInt();
|
||||
@@ -579,7 +579,7 @@ void ColorSchemeManager::loadAllColorSchemes()
|
||||
int failed = 0;
|
||||
|
||||
QList<QString> nativeColorSchemes = listColorSchemes();
|
||||
|
||||
|
||||
QListIterator<QString> nativeIter(nativeColorSchemes);
|
||||
while ( nativeIter.hasNext() )
|
||||
{
|
||||
@@ -630,7 +630,7 @@ bool ColorSchemeManager::loadKDE3ColorScheme(const QString& filePath)
|
||||
delete scheme;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QFileInfo info(filePath);
|
||||
|
||||
if ( !_colorSchemes.contains(info.baseName()) )
|
||||
@@ -660,7 +660,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath)
|
||||
return false;
|
||||
|
||||
QFileInfo info(filePath);
|
||||
|
||||
|
||||
KConfig config(filePath , KConfig::NoGlobals);
|
||||
ColorScheme* scheme = new ColorScheme();
|
||||
scheme->setName(info.baseName());
|
||||
@@ -681,7 +681,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath)
|
||||
{
|
||||
kDebug() << "color scheme with name" << scheme->name() << "has already been" <<
|
||||
"found, ignoring.";
|
||||
|
||||
|
||||
delete scheme;
|
||||
}
|
||||
|
||||
@@ -692,7 +692,7 @@ QList<QString> ColorSchemeManager::listKDE3ColorSchemes()
|
||||
return KGlobal::dirs()->findAllResources("data",
|
||||
"konsole/*.schema",
|
||||
KStandardDirs::NoDuplicates);
|
||||
|
||||
|
||||
}
|
||||
QList<QString> ColorSchemeManager::listColorSchemes()
|
||||
{
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
* palette to be randomized. The seed is used to pick the random color.
|
||||
*/
|
||||
void getColorTable(ColorEntry* table, uint randomSeed = 0) const;
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a single color entry from the table.
|
||||
*
|
||||
@@ -304,7 +304,7 @@ public:
|
||||
* Returns the default color scheme for Konsole
|
||||
*/
|
||||
const ColorScheme* defaultColorScheme() const;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the color scheme with the given name or 0 if no
|
||||
* scheme with that name exists. If @p name is empty, the
|
||||
|
||||
@@ -118,7 +118,7 @@ void ColorSchemeEditor::editColorItem( QTableWidgetItem* item )
|
||||
ColorEntry entry( _colors->colorEntry(item->row()) );
|
||||
entry.color = color;
|
||||
_colors->setColorTableEntry( item->row(), entry );
|
||||
|
||||
|
||||
emit colorsChanged( _colors );
|
||||
|
||||
}
|
||||
@@ -154,7 +154,7 @@ void ColorSchemeEditor::setDescription(const QString& text)
|
||||
void ColorSchemeEditor::setTransparencyPercentLabel(int percent)
|
||||
{
|
||||
_ui->transparencyPercentLabel->setText( QString("%1%").arg(percent) );
|
||||
|
||||
|
||||
qreal opacity = ( 100.0 - percent ) / 100.0;
|
||||
_colors->setOpacity(opacity);
|
||||
}
|
||||
@@ -172,7 +172,7 @@ void ColorSchemeEditor::setup(const ColorScheme* scheme)
|
||||
|
||||
// setup transparency slider
|
||||
const int transparencyPercent = qRound( (1-_colors->opacity())*100 );
|
||||
|
||||
|
||||
_ui->transparencySlider->setValue(transparencyPercent);
|
||||
setTransparencyPercentLabel(transparencyPercent);
|
||||
|
||||
|
||||
@@ -85,4 +85,4 @@ private:
|
||||
|
||||
}
|
||||
|
||||
#endif // COLORSCHEMEEDITOR_H
|
||||
#endif // COLORSCHEMEEDITOR_H
|
||||
|
||||
@@ -131,7 +131,7 @@ void CheckableSessionModel::setCheckColumn(int column)
|
||||
Qt::ItemFlags CheckableSessionModel::flags(const QModelIndex& index) const
|
||||
{
|
||||
Session* session = (Session*)index.internalPointer();
|
||||
|
||||
|
||||
if (_fixedSessions.contains(session))
|
||||
return SessionListModel::flags(index) & ~Qt::ItemIsEnabled;
|
||||
else
|
||||
|
||||
@@ -216,7 +216,7 @@ void EditProfileDialog::preparePage(int page)
|
||||
Q_ASSERT( info );
|
||||
|
||||
QWidget* pageWidget = _ui->tabWidget->widget(page);
|
||||
|
||||
|
||||
if ( _pageNeedsUpdate[page] )
|
||||
{
|
||||
if ( pageWidget == _ui->generalTab )
|
||||
@@ -501,13 +501,13 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr info)
|
||||
{
|
||||
ColorSchemeViewDelegate* delegate = new ColorSchemeViewDelegate(this);
|
||||
_ui->colorSchemeList->setItemDelegate(delegate);
|
||||
|
||||
|
||||
_colorSchemeAnimationTimeLine = new QTimeLine( 500 , this );
|
||||
delegate->setEntryTimeLine(_colorSchemeAnimationTimeLine);
|
||||
|
||||
|
||||
connect( _colorSchemeAnimationTimeLine , SIGNAL(valueChanged(qreal)) , this ,
|
||||
SLOT(colorSchemeAnimationUpdate()) );
|
||||
|
||||
|
||||
_ui->transparencyWarningWidget->setVisible(false);
|
||||
|
||||
_ui->editColorSchemeButton->setEnabled(false);
|
||||
@@ -515,7 +515,7 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr info)
|
||||
|
||||
// setup color list
|
||||
updateColorSchemeList(true);
|
||||
|
||||
|
||||
_ui->colorSchemeList->setMouseTracking(true);
|
||||
_ui->colorSchemeList->installEventFilter(this);
|
||||
_ui->colorSchemeList->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
|
||||
@@ -525,7 +525,7 @@ void EditProfileDialog::setupAppearancePage(const Profile::Ptr info)
|
||||
, this , SLOT(colorSchemeSelected()) );
|
||||
connect( _ui->colorSchemeList , SIGNAL(entered(QModelIndex)) , this ,
|
||||
SLOT(previewColorScheme(QModelIndex)) );
|
||||
|
||||
|
||||
updateColorSchemeButtons();
|
||||
|
||||
connect( _ui->editColorSchemeButton , SIGNAL(clicked()) , this ,
|
||||
@@ -593,7 +593,7 @@ void EditProfileDialog::updateColorSchemeList(bool selectCurrentScheme)
|
||||
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(_ui->colorSchemeList->model());
|
||||
|
||||
Q_ASSERT(model);
|
||||
|
||||
|
||||
model->clear();
|
||||
|
||||
QList<const ColorScheme*> schemeList = ColorSchemeManager::instance()->allColorSchemes();
|
||||
@@ -607,7 +607,7 @@ void EditProfileDialog::updateColorSchemeList(bool selectCurrentScheme)
|
||||
QStandardItem* item = new QStandardItem(colors->description());
|
||||
item->setData( QVariant::fromValue(colors) , Qt::UserRole + 1);
|
||||
item->setFlags( item->flags() );
|
||||
|
||||
|
||||
if ( currentScheme == colors )
|
||||
selectedItem = item;
|
||||
|
||||
@@ -636,7 +636,7 @@ void EditProfileDialog::updateKeyBindingsList(bool selectCurrentTranslator)
|
||||
|
||||
KeyboardTranslatorManager* keyManager = KeyboardTranslatorManager::instance();
|
||||
const KeyboardTranslator* currentTranslator = keyManager->findTranslator(name);
|
||||
|
||||
|
||||
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(_ui->keyBindingList->model());
|
||||
|
||||
Q_ASSERT(model);
|
||||
@@ -664,7 +664,7 @@ void EditProfileDialog::updateKeyBindingsList(bool selectCurrentTranslator)
|
||||
}
|
||||
|
||||
model->sort(0);
|
||||
|
||||
|
||||
if ( selectCurrentTranslator && selectedItem )
|
||||
{
|
||||
_ui->keyBindingList->selectionModel()->setCurrentIndex( selectedItem->index() ,
|
||||
@@ -710,10 +710,10 @@ void EditProfileDialog::unpreviewAll()
|
||||
void EditProfileDialog::unpreview(int property)
|
||||
{
|
||||
_delayedPreviewProperties.remove(property);
|
||||
|
||||
|
||||
if (!_previewedProperties.contains(property))
|
||||
return;
|
||||
|
||||
|
||||
QHash<Profile::Property,QVariant> map;
|
||||
map.insert((Profile::Property)property,_previewedProperties[property]);
|
||||
SessionManager::instance()->changeProfile(_profile,map,false);
|
||||
@@ -777,7 +777,7 @@ void EditProfileDialog::removeColorScheme()
|
||||
if ( !selected.isEmpty() )
|
||||
{
|
||||
const QString& name = selected.first().data(Qt::UserRole+1).value<const ColorScheme*>()->name();
|
||||
|
||||
|
||||
if (ColorSchemeManager::instance()->deleteColorScheme(name))
|
||||
_ui->colorSchemeList->model()->removeRow(selected.first().row());
|
||||
}
|
||||
@@ -808,7 +808,7 @@ void EditProfileDialog::showColorSchemeEditor(bool isNewScheme)
|
||||
|
||||
if ( isNewScheme )
|
||||
editor->setDescription(i18n("New Color Scheme"));
|
||||
|
||||
|
||||
if ( dialog->exec() == QDialog::Accepted )
|
||||
{
|
||||
ColorScheme* newScheme = new ColorScheme(*editor->colorScheme());
|
||||
@@ -818,7 +818,7 @@ void EditProfileDialog::showColorSchemeEditor(bool isNewScheme)
|
||||
newScheme->setName(newScheme->description());
|
||||
|
||||
ColorSchemeManager::instance()->addColorScheme( newScheme );
|
||||
|
||||
|
||||
updateColorSchemeList(true);
|
||||
|
||||
preview(Profile::ColorScheme,newScheme->name());
|
||||
@@ -842,7 +842,7 @@ void EditProfileDialog::colorSchemeSelected()
|
||||
const ColorScheme* colors = model->data(selected.first(),Qt::UserRole+1).value<const ColorScheme*>();
|
||||
|
||||
//kDebug() << "Setting temp profile color to" << colors->name();
|
||||
|
||||
|
||||
updateTempProfileProperty(Profile::ColorScheme,colors->name());
|
||||
previewColorScheme(selected.first());
|
||||
|
||||
@@ -1002,7 +1002,7 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
|
||||
|
||||
KeyBindingEditor* editor = new KeyBindingEditor;
|
||||
dialog->setMainWidget(editor);
|
||||
|
||||
|
||||
if ( translator )
|
||||
editor->setup(translator);
|
||||
|
||||
@@ -1019,7 +1019,7 @@ void EditProfileDialog::showKeyBindingEditor(bool isNewTranslator)
|
||||
KeyboardTranslatorManager::instance()->addTranslator( newTranslator );
|
||||
|
||||
updateKeyBindingsList();
|
||||
|
||||
|
||||
const QString& currentTranslator = lookupProfile()
|
||||
->property<QString>(Profile::KeyBindings);
|
||||
|
||||
@@ -1055,7 +1055,7 @@ void EditProfileDialog::setupRadio( RadioOption* possibilities , int actual )
|
||||
possibilities->button->setChecked(true);
|
||||
else
|
||||
possibilities->button->setChecked(false);
|
||||
|
||||
|
||||
connect( possibilities->button , SIGNAL(clicked()) , this , possibilities->slot );
|
||||
|
||||
++possibilities;
|
||||
@@ -1066,7 +1066,7 @@ void EditProfileDialog::setupScrollingPage(const Profile::Ptr profile)
|
||||
{
|
||||
// setup scrollbar radio
|
||||
int scrollBarPosition = profile->property<int>(Profile::ScrollBarPosition);
|
||||
|
||||
|
||||
RadioOption positions[] = { {_ui->scrollBarHiddenButton,Profile::ScrollBarHidden,SLOT(hideScrollBar())},
|
||||
{_ui->scrollBarLeftButton,Profile::ScrollBarLeft,SLOT(showScrollBarLeft())},
|
||||
{_ui->scrollBarRightButton,Profile::ScrollBarRight,SLOT(showScrollBarRight())},
|
||||
@@ -1074,16 +1074,16 @@ void EditProfileDialog::setupScrollingPage(const Profile::Ptr profile)
|
||||
};
|
||||
|
||||
setupRadio( positions , scrollBarPosition );
|
||||
|
||||
|
||||
// setup scrollback type radio
|
||||
int scrollBackType = profile->property<int>(Profile::HistoryMode);
|
||||
|
||||
|
||||
RadioOption types[] = { {_ui->disableScrollbackButton,Profile::DisableHistory,SLOT(noScrollBack())},
|
||||
{_ui->fixedScrollbackButton,Profile::FixedSizeHistory,SLOT(fixedScrollBack())},
|
||||
{_ui->unlimitedScrollbackButton,Profile::UnlimitedHistory,SLOT(unlimitedScrollBack())},
|
||||
{0,0,0} };
|
||||
setupRadio( types , scrollBackType );
|
||||
|
||||
|
||||
// setup scrollback line count spinner
|
||||
int historySize = profile->property<int>(Profile::HistorySize);
|
||||
_ui->scrollBackLinesSpinner->setValue( historySize );
|
||||
@@ -1245,7 +1245,7 @@ void EditProfileDialog::fontSelected(const QFont& font)
|
||||
setFontSliderValue(font);
|
||||
|
||||
_ui->fontPreviewLabel->setFont(previewFont);
|
||||
|
||||
|
||||
preview(Profile::Font,font);
|
||||
updateTempProfileProperty(Profile::Font,font);
|
||||
|
||||
@@ -1253,7 +1253,7 @@ void EditProfileDialog::fontSelected(const QFont& font)
|
||||
void EditProfileDialog::showFontDialog()
|
||||
{
|
||||
QFont currentFont = _ui->fontPreviewLabel->font();
|
||||
|
||||
|
||||
KFontDialog* dialog = new KFontDialog(this, KFontChooser::FixedFontsOnly);
|
||||
dialog->setFont(currentFont, true);
|
||||
|
||||
@@ -1333,11 +1333,11 @@ void ColorSchemeViewDelegate::paint(QPainter* painter, const QStyleOptionViewIte
|
||||
// a darker version at the outer edge
|
||||
QColor color = scheme->backgroundColor();
|
||||
QRectF backgroundRect = QRectF(option.rect).adjusted(1.5,1.5,-1.5,-1.5);
|
||||
|
||||
|
||||
QRadialGradient backgroundGradient(backgroundRect.center() , backgroundRect.width() / 2);
|
||||
backgroundGradient.setColorAt( 0 , color.lighter(105) );
|
||||
backgroundGradient.setColorAt( 1 , color.darker(115) );
|
||||
|
||||
|
||||
const int backgroundRectXRoundness = 4;
|
||||
const int backgroundRectYRoundness = 30;
|
||||
|
||||
@@ -1388,7 +1388,7 @@ void ColorSchemeViewDelegate::paint(QPainter* painter, const QStyleOptionViewIte
|
||||
|
||||
painter->setBrush( QBrush(Qt::NoBrush) );
|
||||
QPen pen;
|
||||
|
||||
|
||||
QColor highlightColor = option.palette.highlight().color();
|
||||
|
||||
if ( isSelected )
|
||||
@@ -1399,7 +1399,7 @@ void ColorSchemeViewDelegate::paint(QPainter* painter, const QStyleOptionViewIte
|
||||
pen.setBrush(highlightColor);
|
||||
pen.setWidth(selectedBorderWidth);
|
||||
pen.setJoinStyle(Qt::MiterJoin);
|
||||
|
||||
|
||||
painter->setPen(pen);
|
||||
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ private slots:
|
||||
void noScrollBack();
|
||||
void fixedScrollBack();
|
||||
void unlimitedScrollBack();
|
||||
|
||||
|
||||
void scrollBackLinesChanged(int);
|
||||
|
||||
void hideScrollBar();
|
||||
@@ -249,7 +249,7 @@ private:
|
||||
// after an update by a call to ensurePageLoaded()
|
||||
QVector<bool> _pageNeedsUpdate;
|
||||
QHash<int,QVariant> _previewedProperties;
|
||||
|
||||
|
||||
QTimeLine* _colorSchemeAnimationTimeLine;
|
||||
|
||||
QHash<int,QVariant> _delayedPreviewProperties;
|
||||
|
||||
@@ -277,7 +277,7 @@ void Emulation::receiveData(const char* text, int length)
|
||||
/*void Emulation::onRcvBlock(const char *s, int len)
|
||||
{
|
||||
emit notifySessionState(NOTIFYACTIVITY);
|
||||
|
||||
|
||||
bufferedUpdate();
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
@@ -452,7 +452,7 @@ ushort ExtendedCharTable::createExtendedChar(const ushort* unicodePoints , ushor
|
||||
// if hash is already used by another, different sequence of unicode character
|
||||
// points then try next hash
|
||||
hash++;
|
||||
|
||||
|
||||
if (hash == initialHash)
|
||||
{
|
||||
if (!triedCleaningSolution)
|
||||
@@ -467,10 +467,10 @@ ushort ExtendedCharTable::createExtendedChar(const ushort* unicodePoints , ushor
|
||||
foreach(const TerminalDisplay* td, s->views())
|
||||
{
|
||||
usedExtendedChars += td->screenWindow()->screen()->usedExtendedChars();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
QHash<ushort,ushort*>::iterator it = extendedCharTable.begin();
|
||||
QHash<ushort,ushort*>::iterator itEnd = extendedCharTable.end();
|
||||
while (it != itEnd)
|
||||
@@ -494,14 +494,14 @@ ushort ExtendedCharTable::createExtendedChar(const ushort* unicodePoints , ushor
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// add the new sequence to the table and
|
||||
// return that index
|
||||
ushort* buffer = new ushort[length+1];
|
||||
buffer[0] = length;
|
||||
for ( int i = 0 ; i < length ; i++ )
|
||||
buffer[i+1] = unicodePoints[i];
|
||||
|
||||
|
||||
extendedCharTable.insert(hash,buffer);
|
||||
|
||||
return hash;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Konsole, an X terminal.
|
||||
|
||||
|
||||
Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
|
||||
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
|
||||
|
||||
@@ -123,7 +123,7 @@ class KONSOLEPRIVATE_EXPORT Emulation : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
|
||||
/** Constructs a new terminal emulation */
|
||||
Emulation();
|
||||
~Emulation();
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
* @param endLine Index of last line to copy
|
||||
*/
|
||||
virtual void writeToStream(TerminalCharacterDecoder* decoder,int startLine,int endLine);
|
||||
|
||||
|
||||
/** Returns the codec used to decode incoming characters. See setCodec() */
|
||||
const QTextCodec* codec() const { return _codec; }
|
||||
/** Sets the codec used to decode incoming characters. */
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
*/
|
||||
bool utf8() const
|
||||
{ Q_ASSERT(_codec); return _codec->mibEnum() == 106; }
|
||||
|
||||
|
||||
|
||||
/** Returns the special character used for erasing character. */
|
||||
virtual char eraseChar() const;
|
||||
@@ -220,7 +220,7 @@ public slots:
|
||||
|
||||
/** Change the size of the emulation's image */
|
||||
virtual void setImageSize(int lines, int columns);
|
||||
|
||||
|
||||
/**
|
||||
* Interprets a sequence of characters and sends the result to the terminal.
|
||||
* This is equivalent to calling sendKeyEvent() for each character in @p text in succession.
|
||||
@@ -232,13 +232,13 @@ public slots:
|
||||
* the resulting character stream.
|
||||
*/
|
||||
virtual void sendKeyEvent(QKeyEvent*);
|
||||
|
||||
|
||||
/**
|
||||
* Converts information about a mouse event into an xterm-compatible escape
|
||||
* sequence and emits the character sequence via sendData()
|
||||
*/
|
||||
virtual void sendMouseEvent(int buttons, int column, int line, int eventType);
|
||||
|
||||
|
||||
/**
|
||||
* Sends a string of characters to the foreground terminal process.
|
||||
*
|
||||
@@ -411,17 +411,17 @@ signals:
|
||||
* screen is in use.
|
||||
*/
|
||||
void primaryScreenInUse(bool use);
|
||||
|
||||
|
||||
/**
|
||||
* Emitted when the text selection is changed
|
||||
*/
|
||||
void selectedText(const QString & text);
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
virtual void setMode(int mode) = 0;
|
||||
virtual void resetMode(int mode) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Processes an incoming character. See receiveData()
|
||||
* @p ch A unicode character code.
|
||||
@@ -446,7 +446,7 @@ protected:
|
||||
|
||||
|
||||
QList<ScreenWindow*> _windows;
|
||||
|
||||
|
||||
Screen* _currentScreen; // pointer to the screen which is currently active,
|
||||
// this is one of the elements in the screen[] array
|
||||
|
||||
@@ -454,8 +454,8 @@ protected:
|
||||
// scrollbars are enabled in this mode )
|
||||
// 1 = alternate ( used by vi , emacs etc.
|
||||
// scrollbars are not enabled in this mode )
|
||||
|
||||
|
||||
|
||||
|
||||
//decodes an incoming C-style character stream into a unicode QString using
|
||||
//the current text codec. (this allows for rendering of non-ASCII characters in text files etc.)
|
||||
const QTextCodec* _codec;
|
||||
@@ -472,7 +472,7 @@ protected slots:
|
||||
|
||||
// used to emit the primaryScreenInUse(bool) signal
|
||||
void checkScreenInUse();
|
||||
|
||||
|
||||
// used to emit the selectedText(QString) signal
|
||||
void checkSelectedText();
|
||||
|
||||
@@ -489,7 +489,7 @@ private:
|
||||
QTimer _bulkTimer1;
|
||||
QTimer _bulkTimer2;
|
||||
bool _imageSizeInitialized;
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ using namespace Konsole;
|
||||
FilterChain::~FilterChain()
|
||||
{
|
||||
QMutableListIterator<Filter*> iter(*this);
|
||||
|
||||
|
||||
while ( iter.hasNext() )
|
||||
{
|
||||
Filter* filter = iter.next();
|
||||
@@ -139,7 +139,7 @@ void TerminalImageFilterChain::setImage(const Character* const image , int lines
|
||||
|
||||
PlainTextDecoder decoder;
|
||||
decoder.setTrailingWhitespace(false);
|
||||
|
||||
|
||||
// setup new shared buffers for the filters to process on
|
||||
QString* newBuffer = new QString();
|
||||
QList<int>* newLinePositions = new QList<int>();
|
||||
@@ -225,7 +225,7 @@ void Filter::getLineColumn(int position , int& startLine , int& startColumn)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*void Filter::addLine(const QString& text)
|
||||
{
|
||||
@@ -265,12 +265,12 @@ Filter::HotSpot* Filter::hotSpotAt(int line , int column) const
|
||||
while (spotIter.hasNext())
|
||||
{
|
||||
HotSpot* spot = spotIter.next();
|
||||
|
||||
|
||||
if ( spot->startLine() == line && spot->startColumn() > column )
|
||||
continue;
|
||||
if ( spot->endLine() == line && spot->endColumn() < column )
|
||||
continue;
|
||||
|
||||
|
||||
return spot;
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ QString UrlFilter::HotSpot::tooltip() const
|
||||
UrlFilter::HotSpot::UrlType UrlFilter::HotSpot::urlType() const
|
||||
{
|
||||
QString url = capturedTexts().first();
|
||||
|
||||
|
||||
if ( FullUrlRegExp.exactMatch(url) )
|
||||
return StandardUrl;
|
||||
else if ( EmailAddressRegExp.exactMatch(url) )
|
||||
@@ -466,7 +466,7 @@ void UrlFilter::HotSpot::activate(QObject* object)
|
||||
{
|
||||
url.prepend("mailto:");
|
||||
}
|
||||
|
||||
|
||||
new KRun(url,QApplication::activeWindow());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
int _endLine;
|
||||
int _endColumn;
|
||||
Type _type;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/** Constructs a new filter. */
|
||||
@@ -177,7 +177,7 @@ protected:
|
||||
private:
|
||||
QMultiHash<int,HotSpot*> _hotspots;
|
||||
QList<HotSpot*> _hotspotList;
|
||||
|
||||
|
||||
const QList<int>* _linePositions;
|
||||
const QString* _buffer;
|
||||
};
|
||||
@@ -286,7 +286,7 @@ protected:
|
||||
virtual RegExpFilter::HotSpot* newHotSpot(int,int,int,int);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
static const QRegExp FullUrlRegExp;
|
||||
static const QRegExp EmailAddressRegExp;
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ void HistoryFile::add(const unsigned char* bytes, int len)
|
||||
{
|
||||
if ( _fileMap )
|
||||
unmap();
|
||||
|
||||
|
||||
_readWriteBalance++;
|
||||
|
||||
int rc = 0;
|
||||
@@ -196,7 +196,7 @@ HistoryScrollFile::HistoryScrollFile(const QString &logFileName)
|
||||
HistoryScrollFile::~HistoryScrollFile()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int HistoryScrollFile::getLines()
|
||||
{
|
||||
return index.len() / sizeof(int);
|
||||
@@ -222,10 +222,10 @@ int HistoryScrollFile::startOfLine(int lineno)
|
||||
if (lineno <= 0) return 0;
|
||||
if (lineno <= getLines())
|
||||
{
|
||||
|
||||
|
||||
if (!index.isMapped())
|
||||
index.map();
|
||||
|
||||
|
||||
int res;
|
||||
index.get((unsigned char*)&res,sizeof(int),(lineno-1)*sizeof(int));
|
||||
return res;
|
||||
@@ -319,7 +319,7 @@ int HistoryScrollBuffer::getLineLen(int lineNumber)
|
||||
bool HistoryScrollBuffer::isWrappedLine(int lineNumber)
|
||||
{
|
||||
Q_ASSERT( lineNumber >= 0 && lineNumber < _maxLineCount );
|
||||
|
||||
|
||||
if (lineNumber < _usedLines)
|
||||
{
|
||||
//kDebug() << "Line" << lineNumber << "wrapped is" << _wrappedLine[bufferIndex(lineNumber)];
|
||||
@@ -340,7 +340,7 @@ void HistoryScrollBuffer::getCells(int lineNumber, int startColumn, int count, C
|
||||
memset(buffer, 0, count * sizeof(Character));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const HistoryLine& line = _historyBuffer[bufferIndex(lineNumber)];
|
||||
|
||||
//kDebug() << "startCol " << startColumn;
|
||||
@@ -348,7 +348,7 @@ void HistoryScrollBuffer::getCells(int lineNumber, int startColumn, int count, C
|
||||
//kDebug() << "count " << count;
|
||||
|
||||
Q_ASSERT( startColumn <= line.size() - count );
|
||||
|
||||
|
||||
memcpy(buffer, line.constData() + startColumn , count * sizeof(Character));
|
||||
}
|
||||
|
||||
@@ -356,12 +356,12 @@ void HistoryScrollBuffer::setMaxNbLines(unsigned int lineCount)
|
||||
{
|
||||
HistoryLine* oldBuffer = _historyBuffer;
|
||||
HistoryLine* newBuffer = new HistoryLine[lineCount];
|
||||
|
||||
|
||||
for ( int i = 0 ; i < qMin(_usedLines,(int)lineCount) ; i++ )
|
||||
{
|
||||
newBuffer[i] = oldBuffer[bufferIndex(i)];
|
||||
}
|
||||
|
||||
|
||||
_usedLines = qMin(_usedLines,(int)lineCount);
|
||||
_maxLineCount = lineCount;
|
||||
_head = ( _usedLines == _maxLineCount ) ? 0 : _usedLines-1;
|
||||
@@ -484,7 +484,7 @@ void HistoryScrollBlockArray::getCells(int lineno, int colno,
|
||||
void HistoryScrollBlockArray::addCells(const Character a[], int count)
|
||||
{
|
||||
Block *b = m_blockArray.lastBlock();
|
||||
|
||||
|
||||
if (!b) return;
|
||||
|
||||
// put cells in block's data
|
||||
@@ -549,7 +549,7 @@ void* CompactHistoryBlockList::allocate(size_t size)
|
||||
void CompactHistoryBlockList::deallocate(void* ptr)
|
||||
{
|
||||
Q_ASSERT( !list.isEmpty());
|
||||
|
||||
|
||||
int i=0;
|
||||
CompactHistoryBlock *block = list.at(i);
|
||||
while ( i<list.size() && !block->contains(ptr) )
|
||||
@@ -559,7 +559,7 @@ void CompactHistoryBlockList::deallocate(void* ptr)
|
||||
}
|
||||
|
||||
Q_ASSERT( i<list.size() );
|
||||
|
||||
|
||||
block->deallocate();
|
||||
|
||||
if (!block->isInUse())
|
||||
@@ -586,11 +586,11 @@ CompactHistoryLine::CompactHistoryLine ( const TextLine& line, CompactHistoryBlo
|
||||
formatLength(0)
|
||||
{
|
||||
length=line.size();
|
||||
|
||||
|
||||
if (line.size() > 0) {
|
||||
formatLength=1;
|
||||
int k=1;
|
||||
|
||||
|
||||
// count number of different formats in this text line
|
||||
Character c = line[0];
|
||||
while ( k<length )
|
||||
@@ -602,21 +602,21 @@ CompactHistoryLine::CompactHistoryLine ( const TextLine& line, CompactHistoryBlo
|
||||
}
|
||||
k++;
|
||||
}
|
||||
|
||||
|
||||
//kDebug() << "number of different formats in string: " << formatLength;
|
||||
formatArray = (CharacterFormat*) blockList.allocate(sizeof(CharacterFormat)*formatLength);
|
||||
Q_ASSERT (formatArray!=NULL);
|
||||
text = (quint16*) blockList.allocate(sizeof(quint16)*line.size());
|
||||
Q_ASSERT (text!=NULL);
|
||||
|
||||
|
||||
length=line.size();
|
||||
wrapped=false;
|
||||
|
||||
|
||||
// record formats and their positions in the format array
|
||||
c=line[0];
|
||||
formatArray[0].setFormat ( c );
|
||||
formatArray[0].startPos=0; // there's always at least 1 format (for the entire line, unless a change happens)
|
||||
|
||||
|
||||
k=1; // look for possible format changes
|
||||
int j=1;
|
||||
while ( k<length && j<formatLength )
|
||||
@@ -631,7 +631,7 @@ CompactHistoryLine::CompactHistoryLine ( const TextLine& line, CompactHistoryBlo
|
||||
}
|
||||
k++;
|
||||
}
|
||||
|
||||
|
||||
// copy character values
|
||||
for ( int i=0; i<line.size(); i++ )
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ private:
|
||||
|
||||
//pointer to start of mmap'ed file data, or 0 if the file is not mmap'ed
|
||||
char* _fileMap;
|
||||
|
||||
|
||||
//incremented whenver 'add' is called and decremented whenever
|
||||
//'get' is called.
|
||||
//this is used to detect when a large number of lines are being read and processed from the history
|
||||
@@ -181,7 +181,7 @@ private:
|
||||
int _maxLineCount;
|
||||
int _usedLines;
|
||||
int _head;
|
||||
|
||||
|
||||
//QVector<histline*> m_histBuffer;
|
||||
//QBitArray m_wrappedLine;
|
||||
//unsigned int m_maxNbLines;
|
||||
@@ -282,7 +282,7 @@ public:
|
||||
class CompactHistoryBlock
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
CompactHistoryBlock(){
|
||||
blockLength = 4096*64; // 256kb
|
||||
head = (quint8*) mmap(0, blockLength, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
|
||||
@@ -291,12 +291,12 @@ public:
|
||||
tail = blockStart = head;
|
||||
allocCount=0;
|
||||
}
|
||||
|
||||
|
||||
virtual ~CompactHistoryBlock(){
|
||||
//free(blockStart);
|
||||
munmap(blockStart, blockLength);
|
||||
}
|
||||
|
||||
|
||||
virtual unsigned int remaining(){ return blockStart+blockLength-tail;}
|
||||
virtual unsigned length() { return blockLength; }
|
||||
virtual void* allocate(size_t length);
|
||||
@@ -372,7 +372,7 @@ private:
|
||||
bool hasDifferentColors(const TextLine& line) const;
|
||||
HistoryArray lines;
|
||||
CompactHistoryBlockList blockList;
|
||||
|
||||
|
||||
unsigned int _maxLineCount;
|
||||
};
|
||||
|
||||
@@ -422,7 +422,7 @@ class HistoryTypeBlockArray : public HistoryType
|
||||
{
|
||||
public:
|
||||
HistoryTypeBlockArray(size_t size);
|
||||
|
||||
|
||||
virtual bool isEnabled() const;
|
||||
virtual int maximumLineCount() const;
|
||||
|
||||
@@ -454,10 +454,10 @@ class HistoryTypeBuffer : public HistoryType
|
||||
|
||||
public:
|
||||
HistoryTypeBuffer(unsigned int nbLines);
|
||||
|
||||
|
||||
virtual bool isEnabled() const;
|
||||
virtual int maximumLineCount() const;
|
||||
|
||||
|
||||
virtual HistoryScroll* scroll(HistoryScroll *) const;
|
||||
|
||||
protected:
|
||||
@@ -469,7 +469,7 @@ class CompactHistoryType : public HistoryType
|
||||
{
|
||||
public:
|
||||
CompactHistoryType(unsigned int size);
|
||||
|
||||
|
||||
virtual bool isEnabled() const;
|
||||
virtual int maximumLineCount() const;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ IncrementalSearchBar::IncrementalSearchBar(QWidget* parent)
|
||||
,_highlightMatches(0)
|
||||
{
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
|
||||
|
||||
QToolButton* close = new QToolButton(this);
|
||||
close->setObjectName( QLatin1String("close-button" ));
|
||||
close->setToolTip( i18n("Close the search bar") );
|
||||
@@ -160,7 +160,7 @@ bool IncrementalSearchBar::eventFilter(QObject* watched , QEvent* event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return QWidget::eventFilter(watched,event);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ KeyBindingEditor::KeyBindingEditor(QWidget* parent)
|
||||
|
||||
connect( _ui->removeEntryButton , SIGNAL(clicked()) , this , SLOT(removeSelectedEntry()) );
|
||||
connect( _ui->addEntryButton , SIGNAL(clicked()) , this , SLOT(addNewEntry()) );
|
||||
|
||||
|
||||
// test area
|
||||
_ui->testAreaInputEdit->installEventFilter(this);
|
||||
}
|
||||
@@ -74,7 +74,7 @@ void KeyBindingEditor::removeSelectedEntry()
|
||||
{
|
||||
QList<QTableWidgetItem*> selectedList = _ui->keyBindingTable->selectedItems();
|
||||
QList<QTableWidgetItem*> uniqueList;
|
||||
|
||||
|
||||
//Filter unique items
|
||||
QListIterator<QTableWidgetItem*> iter( selectedList );
|
||||
while ( iter.hasNext() )
|
||||
@@ -95,9 +95,9 @@ void KeyBindingEditor::removeSelectedEntry()
|
||||
|
||||
KeyboardTranslator::Entry existing = item->data(Qt::UserRole).
|
||||
value<KeyboardTranslator::Entry>();
|
||||
|
||||
|
||||
_translator->removeEntry(existing);
|
||||
|
||||
|
||||
_ui->keyBindingTable->removeRow( item->row() );
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ bool KeyBindingEditor::eventFilter( QObject* watched , QEvent* event )
|
||||
void KeyBindingEditor::setDescription(const QString& newDescription)
|
||||
{
|
||||
_ui->descriptionEdit->setText(newDescription);
|
||||
|
||||
|
||||
if ( _translator )
|
||||
_translator->setDescription(newDescription);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
void setupKeyBindingTable(const KeyboardTranslator* translator);
|
||||
|
||||
Ui::KeyBindingEditor* _ui;
|
||||
|
||||
|
||||
// translator to which modifications are made as the user makes
|
||||
// changes in the UI.
|
||||
// this is initialized as a copy of the translator specified
|
||||
|
||||
@@ -73,7 +73,7 @@ void KeyboardTranslatorManager::findTranslators()
|
||||
QString translatorPath = listIter.next();
|
||||
|
||||
QString name = QFileInfo(translatorPath).baseName();
|
||||
|
||||
|
||||
if ( !_translators.contains(name) )
|
||||
_translators.insert(name,0);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ bool KeyboardTranslatorManager::saveTranslator(const KeyboardTranslator* transla
|
||||
{
|
||||
KeyboardTranslatorWriter writer(&destination);
|
||||
writer.writeHeader(translator->description());
|
||||
|
||||
|
||||
QListIterator<KeyboardTranslator::Entry> iter(translator->entries());
|
||||
while ( iter.hasNext() )
|
||||
writer.writeEntry(iter.next());
|
||||
@@ -516,7 +516,7 @@ QList<KeyboardTranslatorReader::Token> KeyboardTranslatorReader::tokenize(const
|
||||
text.remove(commentPos,text.length());
|
||||
|
||||
text = text.simplified();
|
||||
|
||||
|
||||
// title line: keyboard "title"
|
||||
static QRegExp title("keyboard\\s+\"(.*)\"");
|
||||
// key line: key KeySequence : "output"
|
||||
@@ -533,7 +533,7 @@ QList<KeyboardTranslatorReader::Token> KeyboardTranslatorReader::tokenize(const
|
||||
{
|
||||
Token titleToken = { Token::TitleKeyword , QString() };
|
||||
Token textToken = { Token::TitleText , title.capturedTexts()[1] };
|
||||
|
||||
|
||||
list << titleToken << textToken;
|
||||
}
|
||||
else if ( key.exactMatch(text) )
|
||||
@@ -621,7 +621,7 @@ bool KeyboardTranslator::Entry::matches(int keyCode ,
|
||||
if ( wantAnyModifier != anyModifiersSet )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
QByteArray KeyboardTranslator::Entry::escapedText(bool expandWildCards,Qt::KeyboardModifiers modifiers) const
|
||||
|
||||
@@ -245,7 +245,7 @@ public:
|
||||
States flags ) const;
|
||||
|
||||
bool operator==(const Entry& rhs) const;
|
||||
|
||||
|
||||
private:
|
||||
void insertModifier( QString& item , int modifier ) const;
|
||||
void insertState( QString& item , int state ) const;
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
|
||||
/** Constructs a new keyboard translator with the given @p name */
|
||||
KeyboardTranslator(const QString& name);
|
||||
|
||||
|
||||
//KeyboardTranslator(const KeyboardTranslator& other);
|
||||
|
||||
/** Returns the name of this keyboard translator */
|
||||
@@ -498,7 +498,7 @@ public:
|
||||
|
||||
private:
|
||||
static const QByteArray defaultTranslatorText;
|
||||
|
||||
|
||||
void findTranslators(); // locate the available translators
|
||||
KeyboardTranslator* loadTranslator(const QString& name); // loads the translator
|
||||
// with the given name
|
||||
@@ -506,7 +506,7 @@ private:
|
||||
|
||||
bool saveTranslator(const KeyboardTranslator* translator);
|
||||
QString findTranslatorPath(const QString& name);
|
||||
|
||||
|
||||
QHash<QString,KeyboardTranslator*> _translators; // maps translator-name -> KeyboardTranslator
|
||||
// instance
|
||||
bool _haveLoadedAll;
|
||||
@@ -549,7 +549,7 @@ inline int oneOrZero(int value)
|
||||
inline QByteArray KeyboardTranslator::Entry::text(bool expandWildCards,Qt::KeyboardModifiers modifiers) const
|
||||
{
|
||||
QByteArray expandedText = _text;
|
||||
|
||||
|
||||
if (expandWildCards)
|
||||
{
|
||||
int modifierValue = 1;
|
||||
|
||||
@@ -80,7 +80,7 @@ ManageProfilesDialog::ManageProfilesDialog(QWidget* parent)
|
||||
// resize the session table to the full width of the table
|
||||
_ui->sessionTable->horizontalHeader()->setHighlightSections(false);
|
||||
_ui->sessionTable->resizeColumnsToContents();
|
||||
|
||||
|
||||
// allow a larger width for the shortcut column to account for the
|
||||
// increased with needed by the shortcut editor compared with just
|
||||
// displaying the text of the shortcut
|
||||
@@ -227,7 +227,7 @@ void ManageProfilesDialog::addItems(const Profile::Ptr profile)
|
||||
void ManageProfilesDialog::populateTable()
|
||||
{
|
||||
Q_ASSERT(!_ui->sessionTable->model());
|
||||
|
||||
|
||||
_ui->sessionTable->setModel(_sessionModel);
|
||||
|
||||
_sessionModel->clear();
|
||||
@@ -352,11 +352,11 @@ void ManageProfilesDialog::moveDownSelected()
|
||||
void ManageProfilesDialog::createProfile()
|
||||
{
|
||||
EditProfileDialog dialog(this);
|
||||
|
||||
|
||||
// setup a temporary profile which is a clone of the selected profile
|
||||
// or the default if no profile is selected
|
||||
Profile::Ptr sourceProfile;
|
||||
|
||||
|
||||
Profile::Ptr selectedProfile = currentProfile();
|
||||
if ( !selectedProfile )
|
||||
sourceProfile = SessionManager::instance()->defaultProfile();
|
||||
@@ -464,7 +464,7 @@ void StyledBackgroundPainter::drawBackground(QPainter* painter, const QStyleOpti
|
||||
const QWidget* widget = v3option ? v3option->widget : 0;
|
||||
|
||||
QStyle* style = widget ? widget->style() : QApplication::style();
|
||||
|
||||
|
||||
style->drawPrimitive(QStyle::PE_PanelItemViewItem,&option,painter,widget);
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ void ShortcutItemDelegate::setModelData(QWidget* editor, QAbstractItemModel* mod
|
||||
const QModelIndex& index) const
|
||||
{
|
||||
_itemsBeingEdited.remove(index);
|
||||
|
||||
|
||||
if (!_modifiedEditors.contains(editor))
|
||||
return;
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ QString ProcessInfo::format(const QString& input) const
|
||||
output.replace("%D", tempDir);
|
||||
}
|
||||
output.replace("%d",formatShortDir(dir));
|
||||
|
||||
|
||||
// remove any remaining %[LETTER] sequences
|
||||
// output.replace(QRegExp("%\\w"), QString());
|
||||
|
||||
@@ -997,7 +997,7 @@ SSHProcessInfo::SSHProcessInfo(const ProcessInfo& process)
|
||||
|
||||
// SSH options
|
||||
// these are taken from the SSH manual ( accessed via 'man ssh' )
|
||||
|
||||
|
||||
// options which take no arguments
|
||||
static const QString noArgumentOptions("1246AaCfgkMNnqsTtVvXxY");
|
||||
// options which take one argument
|
||||
@@ -1062,7 +1062,7 @@ SSHProcessInfo::SSHProcessInfo(const ProcessInfo& process)
|
||||
// check to see if only a hostname is specified, or whether
|
||||
// both a username and host are specified ( in which case they
|
||||
// are separated by an '@' character: username@host )
|
||||
|
||||
|
||||
int separatorPosition = args[i].indexOf('@');
|
||||
if ( separatorPosition != -1 )
|
||||
{
|
||||
@@ -1087,7 +1087,7 @@ SSHProcessInfo::SSHProcessInfo(const ProcessInfo& process)
|
||||
else
|
||||
{
|
||||
kWarning() << "Could not read arguments";
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1111,13 +1111,13 @@ QString SSHProcessInfo::command() const
|
||||
QString SSHProcessInfo::format(const QString& input) const
|
||||
{
|
||||
QString output(input);
|
||||
|
||||
|
||||
// test whether host is an ip address
|
||||
// in which case 'short host' and 'full host'
|
||||
// markers in the input string are replaced with
|
||||
// the full address
|
||||
bool isIpAddress = false;
|
||||
|
||||
|
||||
struct in_addr address;
|
||||
if ( inet_aton(_host.toLocal8Bit().constData(),&address) != 0 )
|
||||
isIpAddress = true;
|
||||
@@ -1131,7 +1131,7 @@ QString SSHProcessInfo::format(const QString& input) const
|
||||
output.replace("%h",_host);
|
||||
else
|
||||
output.replace("%h",_host.left(_host.indexOf('.')));
|
||||
|
||||
|
||||
output.replace("%H",_host);
|
||||
output.replace("%c",_command);
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
* @param ok Set to true if the parent process id
|
||||
*/
|
||||
int parentPid(bool* ok) const;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the id of the current foreground process
|
||||
*
|
||||
@@ -121,19 +121,19 @@ public:
|
||||
* @param ok Set to true if the foreground process id was read successfully or false otherwise
|
||||
*/
|
||||
int foregroundPid(bool* ok) const;
|
||||
|
||||
|
||||
/* Returns the user id of the process */
|
||||
int userId(bool* ok) const;
|
||||
|
||||
/** Returns the user's name of the process */
|
||||
QString userName() const;
|
||||
|
||||
|
||||
/** Returns the user's home directory of the process */
|
||||
QString userHomeDir() const;
|
||||
|
||||
/** Returns the name of the current process */
|
||||
QString name(bool* ok) const;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the command-line arguments which the process
|
||||
* was started with.
|
||||
|
||||
@@ -92,22 +92,22 @@ const Profile::PropertyInfo Profile::DefaultPropertyNames[] =
|
||||
, { ColorScheme , "colors" , 0 , QVariant::String }
|
||||
, { AntiAliasFonts, "AntiAliasFonts" , APPEARANCE_GROUP , QVariant::Bool }
|
||||
, { BoldIntense, "BoldIntense", APPEARANCE_GROUP, QVariant::Bool }
|
||||
|
||||
|
||||
// Keyboard
|
||||
, { KeyBindings , "KeyBindings" , KEYBOARD_GROUP , QVariant::String }
|
||||
|
||||
|
||||
// Scrolling
|
||||
, { HistoryMode , "HistoryMode" , SCROLLING_GROUP , QVariant::Int }
|
||||
, { HistorySize , "HistorySize" , SCROLLING_GROUP , QVariant::Int }
|
||||
, { ScrollBarPosition , "ScrollBarPosition" , SCROLLING_GROUP , QVariant::Int }
|
||||
|
||||
|
||||
// Terminal Features
|
||||
, { BlinkingTextEnabled , "BlinkingTextEnabled" , TERMINAL_GROUP , QVariant::Bool }
|
||||
, { FlowControlEnabled , "FlowControlEnabled" , TERMINAL_GROUP , QVariant::Bool }
|
||||
, { AllowProgramsToResizeWindow , "AllowProgramsToResizeWindow" , TERMINAL_GROUP , QVariant::Bool }
|
||||
, { BidiRenderingEnabled , "BidiRenderingEnabled" , TERMINAL_GROUP , QVariant::Bool }
|
||||
, { BlinkingCursorEnabled , "BlinkingCursorEnabled" , TERMINAL_GROUP , QVariant::Bool }
|
||||
|
||||
|
||||
// Cursor
|
||||
, { UseCustomCursorColor , "UseCustomCursorColor" , CURSOR_GROUP , QVariant::Bool}
|
||||
, { CursorShape , "CursorShape" , CURSOR_GROUP , QVariant::Int}
|
||||
@@ -176,13 +176,13 @@ FallbackProfile::FallbackProfile()
|
||||
setProperty(HistoryMode,FixedSizeHistory);
|
||||
setProperty(HistorySize,1000);
|
||||
setProperty(ScrollBarPosition,ScrollBarRight);
|
||||
|
||||
|
||||
setProperty(FlowControlEnabled,true);
|
||||
setProperty(AllowProgramsToResizeWindow,true);
|
||||
setProperty(BlinkingTextEnabled,true);
|
||||
setProperty(UnderlineLinksEnabled,true);
|
||||
setProperty(TripleClickMode,SelectWholeLine);
|
||||
|
||||
|
||||
setProperty(BlinkingCursorEnabled,false);
|
||||
setProperty(BidiRenderingEnabled,false);
|
||||
setProperty(CursorShape,BlockCursor);
|
||||
@@ -318,7 +318,7 @@ void KDE4ProfileWriter::writeProperties(KConfig& config,
|
||||
{
|
||||
const char* groupName = 0;
|
||||
KConfigGroup group;
|
||||
|
||||
|
||||
while (properties->name != 0)
|
||||
{
|
||||
if (properties->group != 0)
|
||||
@@ -379,7 +379,7 @@ void KDE4ProfileReader::readProperties(const KConfig& config, Profile::Ptr profi
|
||||
group = config.group(properties->group);
|
||||
groupName = properties->group;
|
||||
}
|
||||
|
||||
|
||||
QString name(properties->name);
|
||||
|
||||
if (group.hasKey(name))
|
||||
@@ -387,7 +387,7 @@ void KDE4ProfileReader::readProperties(const KConfig& config, Profile::Ptr profi
|
||||
group.readEntry(name,QVariant(properties->type)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
properties++;
|
||||
}
|
||||
}
|
||||
@@ -443,7 +443,7 @@ bool KDE3ProfileReader::readProfile(const QString& path , Profile::Ptr profile ,
|
||||
{
|
||||
const QString& fullCommand = config->readEntry("Exec");
|
||||
ShellCommand shellCommand(fullCommand);
|
||||
|
||||
|
||||
profile->setProperty(Profile::Command,shellCommand.command());
|
||||
profile->setProperty(Profile::Arguments,shellCommand.arguments());
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ public:
|
||||
*/
|
||||
template <class T>
|
||||
T property(Property property) const;
|
||||
|
||||
|
||||
/** Sets the value of the specified @p property to @p value. */
|
||||
virtual void setProperty(Property property,const QVariant& value);
|
||||
/** Returns true if the specified property has been set in this Profile instance. */
|
||||
@@ -372,7 +372,7 @@ public:
|
||||
|
||||
/** Convenience method for property<QString>(Profile::Name) */
|
||||
QString name() const { return property<QString>(Profile::Name); }
|
||||
|
||||
|
||||
/** Convenience method for property<QString>(Profile::Directory) */
|
||||
QString defaultWorkingDirectory() const
|
||||
{ return property<QString>(Profile::Directory); }
|
||||
@@ -434,7 +434,7 @@ private:
|
||||
|
||||
static QHash<QString,PropertyInfo> _propertyInfoByName;
|
||||
static QHash<Property,PropertyInfo> _infoByProperty;
|
||||
|
||||
|
||||
// Describes a property. Each property has a name and group
|
||||
// which is used when saving/loading the profile.
|
||||
struct PropertyInfo
|
||||
|
||||
@@ -149,7 +149,7 @@ void Pty::addEnvironmentVariables(const QStringList& environment)
|
||||
|
||||
// split on the first '=' character
|
||||
int pos = pair.indexOf('=');
|
||||
|
||||
|
||||
if ( pos >= 0 )
|
||||
{
|
||||
QString variable = pair.left(pos);
|
||||
@@ -217,7 +217,7 @@ int Pty::start(const QString& program,
|
||||
|
||||
if (_eraseChar != 0)
|
||||
ttmode.c_cc[VERASE] = _eraseChar;
|
||||
|
||||
|
||||
if (!pty()->tcSetAttr(&ttmode))
|
||||
kWarning() << "Unable to set terminal attributes.";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Konsole, KDE's terminal emulator.
|
||||
|
||||
|
||||
Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
|
||||
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
|
||||
|
||||
|
||||
50
src/Screen.h
50
src/Screen.h
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
// VT100/2 Operations
|
||||
// Cursor Movement
|
||||
|
||||
|
||||
/**
|
||||
* Move the cursor up by @p n lines. The cursor will stop at the
|
||||
* top margin.
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
* of the screen.
|
||||
*/
|
||||
void setDefaultMargins();
|
||||
|
||||
|
||||
/**
|
||||
* Moves the cursor down one line, if the MODE_NewLine mode
|
||||
* flag is enabled then the cursor is returned to the leftmost
|
||||
@@ -154,7 +154,7 @@ public:
|
||||
* region is scrolled down by one line instead.
|
||||
*/
|
||||
void reverseIndex();
|
||||
|
||||
|
||||
/**
|
||||
* Scroll the scrolling region of the screen up by @p n lines.
|
||||
* The scrolling region is initially the whole screen, but can be changed
|
||||
@@ -181,9 +181,9 @@ public:
|
||||
void tab(int n = 1);
|
||||
/** Moves the cursor @p n tab-stops to the left. */
|
||||
void backtab(int n);
|
||||
|
||||
|
||||
// Editing
|
||||
|
||||
|
||||
/**
|
||||
* Erase @p n characters beginning from the current cursor position.
|
||||
* This is equivalent to over-writing @p n characters starting with the current
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
void clearTabStops();
|
||||
/** Sets or removes a tab stop at the cursor's current column. */
|
||||
void changeTabStop(bool set);
|
||||
|
||||
|
||||
/** Resets (clears) the specified screen @p mode. */
|
||||
void resetMode(int mode);
|
||||
/** Sets (enables) the specified screen @p mode. */
|
||||
@@ -232,7 +232,7 @@ public:
|
||||
void restoreMode(int mode);
|
||||
/** Returns whether the specified screen @p mode is enabled or not .*/
|
||||
bool getMode(int mode) const;
|
||||
|
||||
|
||||
/**
|
||||
* Saves the current position and appearance (text color and style) of the cursor.
|
||||
* It can be restored by calling restoreCursor()
|
||||
@@ -240,7 +240,7 @@ public:
|
||||
void saveCursor();
|
||||
/** Restores the position and appearance of the cursor. See saveCursor() */
|
||||
void restoreCursor();
|
||||
|
||||
|
||||
/** Clear the whole screen, moving the current screen contents into the history first. */
|
||||
void clearEntireScreen();
|
||||
/**
|
||||
@@ -259,10 +259,10 @@ public:
|
||||
void clearToEndOfLine();
|
||||
/** Clears from the current cursor position to the beginning of the line. */
|
||||
void clearToBeginOfLine();
|
||||
|
||||
|
||||
/** Fills the entire screen with the letter 'E' */
|
||||
void helpAlign();
|
||||
|
||||
|
||||
/**
|
||||
* Enables the given @p rendition flag. Rendition flags control the appearance
|
||||
* of characters on the screen.
|
||||
@@ -277,7 +277,7 @@ public:
|
||||
* @see Character::rendition
|
||||
*/
|
||||
void resetRendition(int rendition);
|
||||
|
||||
|
||||
/**
|
||||
* Sets the cursor's foreground color.
|
||||
* @param space The color space used by the @p color argument
|
||||
@@ -301,12 +301,12 @@ public:
|
||||
* character's rendition flags back to the default settings.
|
||||
*/
|
||||
void setDefaultRendition();
|
||||
|
||||
|
||||
/** Returns the column which the cursor is positioned at. */
|
||||
int getCursorX() const;
|
||||
/** Returns the line which the cursor is positioned on. */
|
||||
int getCursorY() const;
|
||||
|
||||
|
||||
/** Clear the entire screen and move the cursor to the home position.
|
||||
* Equivalent to calling clearEntireScreen() followed by home().
|
||||
*/
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
* otherwise they are unaltered.
|
||||
*/
|
||||
void reset(bool clearScreen = true);
|
||||
|
||||
|
||||
/**
|
||||
* Displays a new character at the current cursor position.
|
||||
*
|
||||
@@ -359,7 +359,7 @@ public:
|
||||
* cleared.
|
||||
*/
|
||||
void resizeImage(int new_lines, int new_columns);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the current screen image.
|
||||
* The result is an array of Characters of size [getLines()][getColumns()] which
|
||||
@@ -379,7 +379,7 @@ public:
|
||||
* other attributes control the size of characters in the line.
|
||||
*/
|
||||
QVector<LineProperty> getLineProperties( int startLine , int endLine ) const;
|
||||
|
||||
|
||||
|
||||
/** Return the number of lines. */
|
||||
int getLines() const
|
||||
@@ -411,7 +411,7 @@ public:
|
||||
* @param blockSelectionMode True if the selection is in column mode.
|
||||
*/
|
||||
void setSelectionStart(const int column, const int line, const bool blockSelectionMode);
|
||||
|
||||
|
||||
/**
|
||||
* Sets the end of the current selection.
|
||||
*
|
||||
@@ -419,13 +419,13 @@ public:
|
||||
* @param line The line index of the last character in the selection.
|
||||
*/
|
||||
void setSelectionEnd(const int column, const int line);
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the start of the selection or the cursor position if there
|
||||
* is no selection.
|
||||
*/
|
||||
void getSelectionStart(int& column , int& line) const;
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the end of the selection or the cursor position if there
|
||||
* is no selection.
|
||||
@@ -447,7 +447,7 @@ public:
|
||||
* be inserted into the returned text at the end of each terminal line.
|
||||
*/
|
||||
QString selectedText(bool preserveLineBreaks) const;
|
||||
|
||||
|
||||
/**
|
||||
* Copies part of the output to a stream.
|
||||
*
|
||||
@@ -556,7 +556,7 @@ public:
|
||||
{
|
||||
return _currentTerminalDisplay;
|
||||
}
|
||||
|
||||
|
||||
QSet<ushort> usedExtendedChars() const
|
||||
{
|
||||
QSet<ushort> result;
|
||||
@@ -595,7 +595,7 @@ private:
|
||||
TerminalCharacterDecoder* decoder,
|
||||
bool appendNewLine,
|
||||
bool preserveLineBreaks) const;
|
||||
|
||||
|
||||
//fills a section of the screen image with the character 'c'
|
||||
//the parameters are specified as offsets from the start of the screen image.
|
||||
//the loc(x,y) macro can be used to generate these values from a column,line pair.
|
||||
@@ -648,10 +648,10 @@ private:
|
||||
int _droppedLines;
|
||||
|
||||
QVarLengthArray<LineProperty,64> lineProperties;
|
||||
|
||||
|
||||
// history buffer ---------------
|
||||
HistoryScroll* history;
|
||||
|
||||
|
||||
// cursor location
|
||||
int cuX;
|
||||
int cuY;
|
||||
@@ -697,7 +697,7 @@ private:
|
||||
CharacterColor background;
|
||||
};
|
||||
SavedState savedState;
|
||||
|
||||
|
||||
// last position where we added a character
|
||||
int lastPos;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ Character* ScreenWindow::getImage()
|
||||
|
||||
if (!_bufferNeedsUpdate)
|
||||
return _windowBuffer;
|
||||
|
||||
|
||||
_screen->getImage(_windowBuffer,size,
|
||||
currentLine(),endWindowLine());
|
||||
|
||||
@@ -108,7 +108,7 @@ int ScreenWindow::endWindowLine() const
|
||||
QVector<LineProperty> ScreenWindow::getLineProperties()
|
||||
{
|
||||
QVector<LineProperty> result = _screen->getLineProperties(currentLine(),endWindowLine());
|
||||
|
||||
|
||||
if (result.count() != windowLines())
|
||||
result.resize(windowLines());
|
||||
|
||||
@@ -133,7 +133,7 @@ void ScreenWindow::getSelectionEnd( int& column , int& line )
|
||||
void ScreenWindow::setSelectionStart( int column , int line , bool columnMode )
|
||||
{
|
||||
_screen->setSelectionStart( column , qMin(line + currentLine(),endWindowLine()) , columnMode);
|
||||
|
||||
|
||||
_bufferNeedsUpdate = true;
|
||||
emit selectionChanged();
|
||||
}
|
||||
@@ -197,7 +197,7 @@ int ScreenWindow::columnCount() const
|
||||
QPoint ScreenWindow::cursorPosition() const
|
||||
{
|
||||
QPoint position;
|
||||
|
||||
|
||||
position.setX( _screen->getCursorX() );
|
||||
position.setY( _screen->getCursorY() );
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ public:
|
||||
int windowLines() const;
|
||||
/** Returns the number of columns in the window */
|
||||
int windowColumns() const;
|
||||
|
||||
|
||||
/** Returns the total number of lines in the screen */
|
||||
int lineCount() const;
|
||||
/** Returns the total number of columns in the screen */
|
||||
|
||||
@@ -748,7 +748,7 @@ void Session::refresh()
|
||||
bool Session::kill(int signal)
|
||||
{
|
||||
int result = ::kill(_shellProcess->pid(),signal);
|
||||
|
||||
|
||||
if ( result == 0 )
|
||||
{
|
||||
if ( _shellProcess->waitForFinished(1000) )
|
||||
@@ -1024,7 +1024,7 @@ QString Session::getDynamicTitle()
|
||||
KUrl Session::getUrl()
|
||||
{
|
||||
QString path;
|
||||
|
||||
|
||||
updateSessionProcessInfo();
|
||||
if (_sessionProcessInfo->isValid())
|
||||
{
|
||||
@@ -1489,7 +1489,7 @@ void SessionGroup::forwardData(const char* data, int size)
|
||||
// again call forwardData() in group A, and so on.
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
_inForwardData = true;
|
||||
QListIterator<Session*> iter(_sessions.keys());
|
||||
while(iter.hasNext()) {
|
||||
|
||||
@@ -324,7 +324,7 @@ bool SessionController::eventFilter(QObject* watched , QEvent* event)
|
||||
// second, connect the newly focused view to listen for the session's bell signal
|
||||
connect( _session , SIGNAL(bellRequest(QString)) ,
|
||||
_view , SLOT(bell(QString)) );
|
||||
|
||||
|
||||
if(_copyToAllTabsAction->isChecked()) {
|
||||
// A session with "Copy To All Tabs" has come into focus:
|
||||
// Ensure that newly created sessions are included in _copyToGroup!
|
||||
@@ -613,7 +613,7 @@ bool SessionController::confirmClose() const
|
||||
if (_session->isForegroundProcessActive())
|
||||
{
|
||||
QString title = _session->foregroundProcessName();
|
||||
|
||||
|
||||
// hard coded for now. In future make it possible for the user to specify which programs
|
||||
// are ignored when considering whether to display a confirmation
|
||||
QStringList ignoreList;
|
||||
@@ -756,7 +756,7 @@ void SessionController::copyInputToAllTabs()
|
||||
for(QSet<Session*>::iterator iterator = group.begin();
|
||||
iterator != group.end(); ++iterator) {
|
||||
Session* session = *iterator;
|
||||
|
||||
|
||||
// First, ensure that the session is removed
|
||||
// (necessary to avoid duplicates on addSession()!)
|
||||
_copyToGroup->removeSession(session);
|
||||
@@ -768,7 +768,7 @@ void SessionController::copyInputToAllTabs()
|
||||
}
|
||||
_copyToGroup->setMasterStatus(_session, true);
|
||||
_copyToGroup->setMasterMode(SessionGroup::CopyInputToAll);
|
||||
|
||||
|
||||
snapshot();
|
||||
_copyToAllTabsAction->setChecked(true);
|
||||
_copyToSelectedAction->setChecked(false);
|
||||
@@ -787,10 +787,10 @@ void SessionController::copyInputToSelectedTabs()
|
||||
|
||||
CopyInputDialog* dialog = new CopyInputDialog(_view);
|
||||
dialog->setMasterSession(_session);
|
||||
|
||||
|
||||
QSet<Session*> currentGroup = QSet<Session*>::fromList(_copyToGroup->sessions());
|
||||
currentGroup.remove(_session);
|
||||
|
||||
|
||||
dialog->setChosenSessions(currentGroup);
|
||||
|
||||
QPointer<Session> guard(_session);
|
||||
@@ -802,7 +802,7 @@ void SessionController::copyInputToSelectedTabs()
|
||||
{
|
||||
QSet<Session*> newGroup = dialog->chosenSessions();
|
||||
newGroup.remove(_session);
|
||||
|
||||
|
||||
QSet<Session*> completeGroup = newGroup | currentGroup;
|
||||
foreach(Session* session, completeGroup)
|
||||
{
|
||||
@@ -833,7 +833,7 @@ void SessionController::copyInputToNone()
|
||||
for(QSet<Session*>::iterator iterator = group.begin();
|
||||
iterator != group.end(); ++iterator) {
|
||||
Session* session = *iterator;
|
||||
|
||||
|
||||
if(session != _session) {
|
||||
_copyToGroup->removeSession(*iterator);
|
||||
}
|
||||
@@ -841,7 +841,7 @@ void SessionController::copyInputToNone()
|
||||
delete _copyToGroup;
|
||||
_copyToGroup = NULL;
|
||||
snapshot();
|
||||
|
||||
|
||||
_copyToAllTabsAction->setChecked(false);
|
||||
_copyToSelectedAction->setChecked(false);
|
||||
_copyToNoneAction->setChecked(true);
|
||||
@@ -888,7 +888,7 @@ void SessionController::searchHistory(bool showSearchBar)
|
||||
removeSearchFilter();
|
||||
|
||||
listenForScreenWindowUpdates();
|
||||
|
||||
|
||||
_searchFilter = new RegExpFilter();
|
||||
_view->filterChain()->addFilter(_searchFilter);
|
||||
connect( _searchBar , SIGNAL(searchChanged(QString)) , this ,
|
||||
|
||||
@@ -88,19 +88,19 @@ typedef QPointer<Session> SessionPtr;
|
||||
class KONSOLEPRIVATE_EXPORT SessionController : public ViewProperties , public KXMLGUIClient
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructs a new SessionController which operates on @p session and @p view.
|
||||
*/
|
||||
SessionController(Session* session , TerminalDisplay* view, QObject* parent);
|
||||
~SessionController();
|
||||
|
||||
|
||||
/** Returns the session associated with this controller */
|
||||
QPointer<Session> session() { return _session; }
|
||||
/** Returns the view associated with this controller */
|
||||
QPointer<TerminalDisplay> view() { return _view; }
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if the controller is valid.
|
||||
* A valid controller is one which has a non-null session() and view().
|
||||
@@ -233,7 +233,7 @@ private slots:
|
||||
// display area
|
||||
|
||||
void updateSearchFilter();
|
||||
|
||||
|
||||
void zmodemDownload();
|
||||
void zmodemUpload();
|
||||
|
||||
@@ -254,11 +254,11 @@ private:
|
||||
|
||||
private:
|
||||
void updateSessionIcon();
|
||||
|
||||
|
||||
QPointer<Session> _session;
|
||||
QPointer<TerminalDisplay> _view;
|
||||
SessionGroup* _copyToGroup;
|
||||
|
||||
|
||||
ProfileList* _profileList;
|
||||
|
||||
KIcon _sessionIcon;
|
||||
@@ -271,12 +271,12 @@ private:
|
||||
KAction* _copyToAllTabsAction;
|
||||
KAction* _copyToSelectedAction;
|
||||
KAction* _copyToNoneAction;
|
||||
|
||||
|
||||
KAction* _searchToggleAction;
|
||||
KAction* _findNextAction;
|
||||
KAction* _findPreviousAction;
|
||||
|
||||
|
||||
|
||||
|
||||
bool _urlFilterUpdateRequired;
|
||||
|
||||
QPointer<IncrementalSearchBar> _searchBar;
|
||||
@@ -361,7 +361,7 @@ private:
|
||||
class SaveHistoryTask : public SessionTask
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
/** Constructs a new task to save session output to URLs */
|
||||
SaveHistoryTask(QObject* parent = 0);
|
||||
@@ -387,7 +387,7 @@ private:
|
||||
SessionPtr session; // the session associated with a history save job
|
||||
int lastLineFetched; // the last line processed in the previous data request
|
||||
// set this to -1 at the start of the save job
|
||||
|
||||
|
||||
TerminalCharacterDecoder* decoder; // decoder used to convert terminal characters
|
||||
// into output
|
||||
|
||||
@@ -440,7 +440,7 @@ public:
|
||||
void setRegExp(const QRegExp& regExp);
|
||||
/** Returns the regular expression which is searched for when execute() is called */
|
||||
QRegExp regExp() const;
|
||||
|
||||
|
||||
/** Specifies the direction to search in when execute() is called. */
|
||||
void setSearchDirection( SearchDirection direction );
|
||||
/** Returns the current search direction. See setSearchDirection(). */
|
||||
@@ -460,7 +460,7 @@ public:
|
||||
|
||||
private:
|
||||
typedef QPointer<ScreenWindow> ScreenWindowPtr;
|
||||
|
||||
|
||||
void executeOnScreenWindow( SessionPtr session , ScreenWindowPtr window );
|
||||
void highlightResult( ScreenWindowPtr window , int position);
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ void SessionManager::loadAllProfiles()
|
||||
return;
|
||||
|
||||
QStringList profiles = availableProfilePaths();
|
||||
|
||||
|
||||
QListIterator<QString> iter(profiles);
|
||||
while (iter.hasNext())
|
||||
loadProfile(iter.next());
|
||||
@@ -329,10 +329,10 @@ void SessionManager::updateSession(Session* session)
|
||||
Session* SessionManager::createSession(Profile::Ptr profile)
|
||||
{
|
||||
Session* session = 0;
|
||||
|
||||
|
||||
if (!profile)
|
||||
profile = defaultProfile();
|
||||
|
||||
|
||||
if (!_profiles.contains(profile))
|
||||
addProfile(profile);
|
||||
|
||||
@@ -433,7 +433,7 @@ void SessionManager::changeProfile(Profile::Ptr profile,
|
||||
changeProfile(profile,propertyMap,persistent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// apply the changes to existing sessions
|
||||
applyProfile(profile,true);
|
||||
|
||||
@@ -555,7 +555,7 @@ void SessionManager::addProfile(Profile::Ptr type)
|
||||
{
|
||||
if ( _profiles.isEmpty() )
|
||||
_defaultProfile = type;
|
||||
|
||||
|
||||
_profiles.insert(type);
|
||||
|
||||
emit profileAdded(type);
|
||||
@@ -607,7 +607,7 @@ void SessionManager::setDefaultProfile(Profile::Ptr profile)
|
||||
_defaultProfile = profile;
|
||||
|
||||
QString path = profile->path();
|
||||
|
||||
|
||||
if ( path.isEmpty() )
|
||||
path = KDE4ProfileWriter().getPath(profile);
|
||||
|
||||
@@ -822,7 +822,7 @@ QKeySequence SessionManager::shortcut(Profile::Ptr profile) const
|
||||
|| iter.value().profilePath == profile->path() )
|
||||
return iter.key();
|
||||
}
|
||||
|
||||
|
||||
return QKeySequence();
|
||||
}
|
||||
|
||||
@@ -906,7 +906,7 @@ void SessionListModel::setSessions(const QList<Session*>& sessions)
|
||||
QVariant SessionListModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
Q_ASSERT(index.isValid());
|
||||
|
||||
|
||||
int row = index.row();
|
||||
int column = index.column();
|
||||
|
||||
@@ -968,7 +968,7 @@ void SessionListModel::sessionFinished()
|
||||
{
|
||||
Session* session = qobject_cast<Session*>(sender());
|
||||
int row = _sessions.indexOf(session);
|
||||
|
||||
|
||||
if (row != -1)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(),row,row);
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
*/
|
||||
SessionManager();
|
||||
void setMenuOrder();
|
||||
|
||||
|
||||
/**
|
||||
* Destroys the SessionManager. All running sessions should be closed
|
||||
* (via closeAll()) before the SessionManager is destroyed.
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
*/
|
||||
QStringList availableProfilePaths() const;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Loads a profile from the specified path and registers
|
||||
* it with the SessionManager.
|
||||
@@ -305,8 +305,8 @@ private slots:
|
||||
void sessionProfileCommandReceived(const QString& text);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
// loads the mappings between shortcut key sequences and
|
||||
// profile paths
|
||||
void loadShortcuts();
|
||||
|
||||
@@ -37,7 +37,7 @@ ShellCommand::ShellCommand(const QString& fullCommand)
|
||||
ShellCommand::ShellCommand(const QString& command , const QStringList& arguments)
|
||||
{
|
||||
_arguments = arguments;
|
||||
|
||||
|
||||
if ( !_arguments.isEmpty() )
|
||||
_arguments[0] == command;
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ public:
|
||||
|
||||
signals:
|
||||
void dynamicElementSelected(const QString&);
|
||||
|
||||
|
||||
private slots:
|
||||
void fireElementSelected(QAction*);
|
||||
|
||||
private:
|
||||
Session::TabTitleContext _context;
|
||||
|
||||
|
||||
struct Element
|
||||
{
|
||||
QString element;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
This file is part of Konsole, an X terminal.
|
||||
|
||||
|
||||
Copyright 2006-2008 by Robert Knight <robertknight@gmail.com>
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -84,7 +84,7 @@ void PlainTextDecoder::decodeLine(const Character* const characters, int count,
|
||||
//(since QTextStream always deals with QStrings internally anyway)
|
||||
QString plainText;
|
||||
plainText.reserve(count);
|
||||
|
||||
|
||||
int outputCount = count;
|
||||
|
||||
// if inclusion of trailing whitespace is disabled then find the end of the
|
||||
@@ -99,7 +99,7 @@ void PlainTextDecoder::decodeLine(const Character* const characters, int count,
|
||||
outputCount--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int i=0;i<outputCount;)
|
||||
{
|
||||
if (characters[i].rendition & RE_EXTENDED_CHAR)
|
||||
@@ -128,7 +128,7 @@ HTMLDecoder::HTMLDecoder() :
|
||||
,_innerSpanOpen(false)
|
||||
,_lastRendition(DEFAULT_RENDITION)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
void HTMLDecoder::begin(QTextStream* output)
|
||||
@@ -166,7 +166,7 @@ void HTMLDecoder::decodeLine(const Character* const characters, int count, LineP
|
||||
QString text;
|
||||
|
||||
int spaceCount = 0;
|
||||
|
||||
|
||||
for (int i=0;i<count;i++)
|
||||
{
|
||||
//check if appearance of character is different from previous char
|
||||
@@ -180,7 +180,7 @@ void HTMLDecoder::decodeLine(const Character* const characters, int count, LineP
|
||||
_lastRendition = characters[i].rendition;
|
||||
_lastForeColor = characters[i].foregroundColor;
|
||||
_lastBackColor = characters[i].backgroundColor;
|
||||
|
||||
|
||||
//build up style string
|
||||
QString style;
|
||||
|
||||
@@ -190,13 +190,13 @@ void HTMLDecoder::decodeLine(const Character* const characters, int count, LineP
|
||||
useBold = _lastRendition & RE_BOLD;
|
||||
else
|
||||
useBold = weight == ColorEntry::Bold;
|
||||
|
||||
|
||||
if (useBold)
|
||||
style.append("font-weight:bold;");
|
||||
|
||||
if ( _lastRendition & RE_UNDERLINE )
|
||||
style.append("font-decoration:underline;");
|
||||
|
||||
|
||||
//colours - a colour table must have been defined first
|
||||
if ( _colorTable )
|
||||
{
|
||||
@@ -207,7 +207,7 @@ void HTMLDecoder::decodeLine(const Character* const characters, int count, LineP
|
||||
style.append( QString("background-color:%1;").arg(_lastBackColor.color(_colorTable).name() ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//open the span with the current style
|
||||
openSpan(text,style);
|
||||
_innerSpanOpen = true;
|
||||
@@ -218,7 +218,7 @@ void HTMLDecoder::decodeLine(const Character* const characters, int count, LineP
|
||||
spaceCount++;
|
||||
else
|
||||
spaceCount = 0;
|
||||
|
||||
|
||||
|
||||
//output current character
|
||||
if (spaceCount < 2)
|
||||
@@ -248,7 +248,7 @@ void HTMLDecoder::decodeLine(const Character* const characters, int count, LineP
|
||||
{
|
||||
text.append(" "); //HTML truncates multiple spaces, so use a space marker instead
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//close any remaining open inner spans
|
||||
@@ -257,7 +257,7 @@ void HTMLDecoder::decodeLine(const Character* const characters, int count, LineP
|
||||
|
||||
//start new line
|
||||
text.append("<br>");
|
||||
|
||||
|
||||
*_output << text;
|
||||
}
|
||||
void HTMLDecoder::openSpan(QString& text , const QString& style)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
This file is part of Konsole, an X terminal.
|
||||
|
||||
|
||||
Copyright 2006-2008 by Robert Knight <robertknight@gmail.com>
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
int count,
|
||||
LineProperty properties);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
QTextStream* _output;
|
||||
bool _includeTrailingWhitespace;
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
* output
|
||||
*/
|
||||
void setColorTable( const ColorEntry* table );
|
||||
|
||||
|
||||
virtual void decodeLine(const Character* const characters,
|
||||
int count,
|
||||
LineProperty properties);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
This file is part of Konsole, a terminal emulator for KDE.
|
||||
|
||||
|
||||
Copyright 2006-2008 by Robert Knight <robertknight@gmail.com>
|
||||
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -233,7 +233,7 @@ void TerminalDisplay::setVTFont(const QFont& f)
|
||||
// depending on the user's font configuration, this may not be respected
|
||||
if (!_antialiasText)
|
||||
font.setStyleStrategy( QFont::NoAntialias );
|
||||
|
||||
|
||||
// experimental optimization. Konsole assumes that the terminal is using a
|
||||
// mono-spaced font, in which case kerning information should have an effect.
|
||||
// Disabling kerning saves some computation when rendering text.
|
||||
@@ -731,7 +731,7 @@ void TerminalDisplay::drawTextFragment(QPainter& painter ,
|
||||
// setup painter
|
||||
const QColor foregroundColor = style->foregroundColor.color(_colorTable);
|
||||
const QColor backgroundColor = style->backgroundColor.color(_colorTable);
|
||||
|
||||
|
||||
// draw background if different from the display's background color
|
||||
if ( backgroundColor != palette().background().color() )
|
||||
drawBackground(painter,rect,backgroundColor,
|
||||
@@ -828,12 +828,12 @@ void TerminalDisplay::scrollImage(int lines , const QRect& screenWindowRegion)
|
||||
// check that the memory areas that we are going to move are valid
|
||||
Q_ASSERT( (char*)lastCharPos + bytesToMove <
|
||||
(char*)(_image + (this->_lines * this->_columns)) );
|
||||
|
||||
|
||||
Q_ASSERT( (lines*this->_columns) < _imageSize );
|
||||
|
||||
//scroll internal image down
|
||||
memmove( firstCharPos , lastCharPos , bytesToMove );
|
||||
|
||||
|
||||
//set region of display to scroll
|
||||
scrollRect.setTop(top);
|
||||
}
|
||||
@@ -845,7 +845,7 @@ void TerminalDisplay::scrollImage(int lines , const QRect& screenWindowRegion)
|
||||
|
||||
//scroll internal image up
|
||||
memmove( lastCharPos , firstCharPos , bytesToMove );
|
||||
|
||||
|
||||
//set region of the display to scroll
|
||||
scrollRect.setTop(top + abs(lines) * _fontHeight);
|
||||
}
|
||||
@@ -971,12 +971,12 @@ void TerminalDisplay::updateImage()
|
||||
const Character* const newLine = &newimg[y*columns];
|
||||
|
||||
bool updateLine = false;
|
||||
|
||||
|
||||
// The dirty mask indicates which characters need repainting. We also
|
||||
// mark surrounding neighbours dirty, in case the character exceeds
|
||||
// its cell boundaries
|
||||
memset(dirtyMask, 0, columnsToUpdate+2);
|
||||
|
||||
|
||||
for( x = 0 ; x < columnsToUpdate ; ++x)
|
||||
{
|
||||
if ( newLine[x] != currentLine[x] )
|
||||
@@ -989,7 +989,7 @@ void TerminalDisplay::updateImage()
|
||||
for (x = 0; x < columnsToUpdate; ++x)
|
||||
{
|
||||
_hasTextBlinker |= (newLine[x].rendition & RE_BLINK);
|
||||
|
||||
|
||||
// Start drawing if this character or the next one differs.
|
||||
// We also take the next one into account to handle the situation
|
||||
// where characters exceed their cell width.
|
||||
@@ -1032,7 +1032,7 @@ void TerminalDisplay::updateImage()
|
||||
_fixedFont = saveFixedFont;
|
||||
x += len - 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//both the top and bottom halves of double height _lines must always be redrawn
|
||||
@@ -1073,7 +1073,7 @@ void TerminalDisplay::updateImage()
|
||||
_fontHeight * (_usedLines-linesToUpdate) );
|
||||
}
|
||||
_usedLines = linesToUpdate;
|
||||
|
||||
|
||||
if ( columnsToUpdate < _usedColumns )
|
||||
{
|
||||
dirtyRegion |= QRect( _leftMargin+tLx+columnsToUpdate*_fontWidth ,
|
||||
@@ -1135,7 +1135,7 @@ void TerminalDisplay::setBlinkingCursorEnabled(bool blink)
|
||||
|
||||
if (blink && !_blinkCursorTimer->isActive())
|
||||
_blinkCursorTimer->start(QApplication::cursorFlashTime() / 2);
|
||||
|
||||
|
||||
if (!blink && _blinkCursorTimer->isActive())
|
||||
{
|
||||
_blinkCursorTimer->stop();
|
||||
@@ -1152,7 +1152,7 @@ void TerminalDisplay::setBlinkingTextEnabled(bool blink)
|
||||
|
||||
if (blink && !_blinkTextTimer->isActive())
|
||||
_blinkTextTimer->start(TEXT_BLINK_DELAY);
|
||||
|
||||
|
||||
if (!blink && _blinkTextTimer->isActive())
|
||||
{
|
||||
_blinkTextTimer->stop();
|
||||
@@ -1275,7 +1275,7 @@ void TerminalDisplay::paintFilters(QPainter& painter)
|
||||
// ignore whitespace at the end of the lines
|
||||
while ( _image[loc(endColumn,line)].isSpace() && endColumn > 0 )
|
||||
endColumn--;
|
||||
|
||||
|
||||
// increment here because the column which we want to set 'endColumn' to
|
||||
// is the first whitespace character at the end of the line
|
||||
endColumn++;
|
||||
@@ -1303,7 +1303,7 @@ void TerminalDisplay::paintFilters(QPainter& painter)
|
||||
if ( _underlineLinks && spot->type() == Filter::HotSpot::Link )
|
||||
{
|
||||
QFontMetrics metrics(font());
|
||||
|
||||
|
||||
// find the baseline (which is the invisible line that the characters in the font sit on,
|
||||
// with some having tails dangling below)
|
||||
int baseline = r.bottom() - metrics.descent();
|
||||
@@ -1388,7 +1388,7 @@ void TerminalDisplay::drawContents(QPainter &paint, const QRect &rect)
|
||||
const CharacterColor currentForeground = _image[loc(x,y)].foregroundColor;
|
||||
const CharacterColor currentBackground = _image[loc(x,y)].backgroundColor;
|
||||
const quint8 currentRendition = _image[loc(x,y)].rendition;
|
||||
|
||||
|
||||
while (x+len <= rlx &&
|
||||
_image[loc(x+len,y)].foregroundColor == currentForeground &&
|
||||
_image[loc(x+len,y)].backgroundColor == currentBackground &&
|
||||
@@ -1424,7 +1424,7 @@ void TerminalDisplay::drawContents(QPainter &paint, const QRect &rect)
|
||||
disstrU[p++] = c; //fontMap(c);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (doubleWidth) // assert((_image[loc(x+len,y)+1].character == 0)), see above if condition
|
||||
len++; // Skip trailing part of multi-column character
|
||||
len++;
|
||||
@@ -1456,7 +1456,7 @@ void TerminalDisplay::drawContents(QPainter &paint, const QRect &rect)
|
||||
|
||||
//calculate the area in which the text will be drawn
|
||||
QRect textArea = QRect( _leftMargin+tLx+_fontWidth*x , _topMargin+tLy+_fontHeight*y , _fontWidth*len , _fontHeight);
|
||||
|
||||
|
||||
//move the calculated area to take account of scaling applied to the painter.
|
||||
//the position of the area from the origin (0,0) is scaled
|
||||
//by the opposite of whatever
|
||||
@@ -1464,7 +1464,7 @@ void TerminalDisplay::drawContents(QPainter &paint, const QRect &rect)
|
||||
//painting does actually start from textArea.topLeft()
|
||||
//(instead of textArea.topLeft() * painter-scale)
|
||||
textArea.moveTopLeft( textScale.inverted().map(textArea.topLeft()) );
|
||||
|
||||
|
||||
//paint text fragment
|
||||
drawTextFragment( paint,
|
||||
textArea,
|
||||
@@ -1472,9 +1472,9 @@ void TerminalDisplay::drawContents(QPainter &paint, const QRect &rect)
|
||||
&_image[loc(x,y)] ); //,
|
||||
//0,
|
||||
//!_isPrinting );
|
||||
|
||||
|
||||
_fixedFont = save__fixedFont;
|
||||
|
||||
|
||||
//reset back to single-width, single-height _lines
|
||||
paint.setWorldMatrix(textScale.inverted(), true);
|
||||
|
||||
@@ -1488,7 +1488,7 @@ void TerminalDisplay::drawContents(QPainter &paint, const QRect &rect)
|
||||
if (_lineProperties[y] & LINE_DOUBLEHEIGHT)
|
||||
y++;
|
||||
}
|
||||
|
||||
|
||||
x += len - 1;
|
||||
}
|
||||
}
|
||||
@@ -1782,7 +1782,7 @@ void TerminalDisplay::mousePressEvent(QMouseEvent* ev)
|
||||
}
|
||||
|
||||
if ( !contentsRect().contains(ev->pos()) ) return;
|
||||
|
||||
|
||||
if ( !_screenWindow ) return;
|
||||
|
||||
int charLine;
|
||||
@@ -1828,7 +1828,7 @@ void TerminalDisplay::mousePressEvent(QMouseEvent* ev)
|
||||
pos.ry() += _scrollBar->value();
|
||||
_iPntSel = _pntSel = pos;
|
||||
_actSel = 1; // left mouse button pressed but nothing selected yet.
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1919,7 +1919,7 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev)
|
||||
// set hotspot area to an invalid rectangle
|
||||
_mouseOverHotspotArea = QRegion();
|
||||
}
|
||||
|
||||
|
||||
// for auto-hiding the cursor, we need mouseTracking
|
||||
if (ev->buttons() == Qt::NoButton ) return;
|
||||
|
||||
@@ -1936,15 +1936,15 @@ void TerminalDisplay::mouseMoveEvent(QMouseEvent* ev)
|
||||
if (ev->buttons() & Qt::RightButton)
|
||||
button = 2;
|
||||
|
||||
|
||||
|
||||
emit mouseSignal( button,
|
||||
charColumn + 1,
|
||||
charLine + 1 +_scrollBar->value() -_scrollBar->maximum(),
|
||||
1 );
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (_dragInfo.state == diPending)
|
||||
{
|
||||
// we had a mouse down, but haven't confirmed a drag yet
|
||||
@@ -2002,7 +2002,7 @@ void TerminalDisplay::extendSelection( const QPoint& position )
|
||||
|
||||
// Adjust position within text area bounds.
|
||||
QPoint oldpos = pos;
|
||||
|
||||
|
||||
pos.setX( qBound(textBounds.left(),pos.x(),textBounds.right()) );
|
||||
pos.setY( qBound(textBounds.top(),pos.y(),textBounds.bottom()) );
|
||||
|
||||
@@ -2220,8 +2220,8 @@ void TerminalDisplay::mouseReleaseEvent(QMouseEvent* ev)
|
||||
}
|
||||
_dragInfo.state = diNone;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ( !_mouseMarks &&
|
||||
((ev->button() == Qt::RightButton && !(ev->modifiers() & Qt::ShiftModifier))
|
||||
|| ev->button() == Qt::MidButton) )
|
||||
@@ -2345,9 +2345,9 @@ void TerminalDisplay::mouseDoubleClickEvent(QMouseEvent* ev)
|
||||
|
||||
|
||||
_actSel = 2; // within selection
|
||||
|
||||
|
||||
_screenWindow->setSelectionEnd( endSel.x() , endSel.y() );
|
||||
|
||||
|
||||
setXSelection( _screenWindow->selectedText(_preserveLineBreaks) );
|
||||
}
|
||||
|
||||
@@ -2409,11 +2409,11 @@ void TerminalDisplay::wheelEvent( QWheelEvent* ev )
|
||||
else
|
||||
{
|
||||
// terminal program wants notification of mouse activity
|
||||
|
||||
|
||||
int charLine;
|
||||
int charColumn;
|
||||
getCharacterPosition( ev->pos() , charLine , charColumn );
|
||||
|
||||
|
||||
emit mouseSignal( ev->delta() > 0 ? 4 : 5,
|
||||
charColumn + 1,
|
||||
charLine + 1 +_scrollBar->value() -_scrollBar->maximum() ,
|
||||
@@ -2444,13 +2444,13 @@ void TerminalDisplay::mouseTripleClickEvent(QMouseEvent* ev)
|
||||
|
||||
while (_iPntSel.y()>0 && (_lineProperties[_iPntSel.y()-1] & LINE_WRAPPED) )
|
||||
_iPntSel.ry()--;
|
||||
|
||||
|
||||
if (_tripleClickMode == SelectForwardsFromCursor) {
|
||||
// find word boundary start
|
||||
int i = loc(_iPntSel.x(),_iPntSel.y());
|
||||
const QChar selClass = charClass(_image[i]);
|
||||
int x = _iPntSel.x();
|
||||
|
||||
|
||||
while ( ((x>0) ||
|
||||
(_iPntSel.y()>0 && (_lineProperties[_iPntSel.y()-1] & LINE_WRAPPED) )
|
||||
)
|
||||
@@ -2476,7 +2476,7 @@ void TerminalDisplay::mouseTripleClickEvent(QMouseEvent* ev)
|
||||
|
||||
while (_iPntSel.y()<_lines-1 && (_lineProperties[_iPntSel.y()] & LINE_WRAPPED) )
|
||||
_iPntSel.ry()++;
|
||||
|
||||
|
||||
_screenWindow->setSelectionEnd( _columns - 1 , _iPntSel.y() );
|
||||
|
||||
setXSelection(_screenWindow->selectedText(_preserveLineBreaks));
|
||||
@@ -2564,7 +2564,7 @@ void TerminalDisplay::doPaste(bool useXselection,bool appendReturn)
|
||||
text.replace('\n', '\r');
|
||||
QKeyEvent e(QEvent::KeyPress, 0, Qt::NoModifier, text);
|
||||
emit keyPressedSignal(&e); // expose as a big fat keypress event
|
||||
|
||||
|
||||
_screenWindow->clearSelection();
|
||||
}
|
||||
}
|
||||
@@ -2692,7 +2692,7 @@ void TerminalDisplay::drawInputMethodPreeditString(QPainter& painter , const QRe
|
||||
void TerminalDisplay::setFlowControlWarningEnabled( bool enable )
|
||||
{
|
||||
_flowControlWarningEnabled = enable;
|
||||
|
||||
|
||||
// if the dialog is currently visible and the flow control warning has
|
||||
// been disabled then hide the dialog
|
||||
if (!enable)
|
||||
@@ -2817,7 +2817,7 @@ void TerminalDisplay::bell(const QString& message)
|
||||
{
|
||||
_allowBell = false;
|
||||
QTimer::singleShot(500,this,SLOT(enableBell()));
|
||||
|
||||
|
||||
if (_bellMode==SystemBeepBell)
|
||||
{
|
||||
KNotification::beep();
|
||||
@@ -2887,11 +2887,11 @@ void TerminalDisplay::dropEvent(QDropEvent* event)
|
||||
urlText = url.path();
|
||||
else
|
||||
urlText = url.url();
|
||||
|
||||
|
||||
// in future it may be useful to be able to insert file names with drag-and-drop
|
||||
// without quoting them (this only affects paths with spaces in)
|
||||
urlText = KShell::quoteArg(urlText);
|
||||
|
||||
|
||||
dropText += urlText;
|
||||
|
||||
// Each filename(including the last) should be followed by one space.
|
||||
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
void setTripleClickMode(TripleClickMode mode) { _tripleClickMode = mode; }
|
||||
/** See setTripleClickSelectionMode() */
|
||||
TripleClickMode tripleClickMode() const { return _tripleClickMode; }
|
||||
|
||||
|
||||
/**
|
||||
* Specifies whether links and email addresses should be underlined when
|
||||
* hovered by the mouse. Defaults to true.
|
||||
@@ -380,7 +380,7 @@ public:
|
||||
* Returns true if characters with intense colors are rendered in bold.
|
||||
*/
|
||||
bool getBoldIntense() const { return _boldIntense; }
|
||||
|
||||
|
||||
/**
|
||||
* Sets whether or not the current height and width of the
|
||||
* terminal in lines and columns is displayed whilst the widget
|
||||
@@ -489,7 +489,7 @@ public slots:
|
||||
* or false otherwise.
|
||||
*/
|
||||
void setUsesMouse(bool usesMouse);
|
||||
|
||||
|
||||
/** See setUsesMouse() */
|
||||
bool usesMouse() const;
|
||||
|
||||
@@ -610,7 +610,7 @@ protected slots:
|
||||
void scrollBarPositionChanged(int value);
|
||||
void blinkTextEvent();
|
||||
void blinkCursorEvent();
|
||||
|
||||
|
||||
//Renables bell noises and visuals. Used to disable further bells for a short period of time
|
||||
//after emitting the first in a sequence of bell events.
|
||||
void enableBell();
|
||||
@@ -679,7 +679,7 @@ private:
|
||||
void propagateSize();
|
||||
void updateImageSize();
|
||||
void makeImage();
|
||||
|
||||
|
||||
void paintFilters(QPainter& painter);
|
||||
|
||||
// returns a region covering all of the areas of the widget which contain
|
||||
@@ -715,7 +715,7 @@ private:
|
||||
|
||||
int _lines; // the number of lines that can be displayed in the widget
|
||||
int _columns; // the number of columns that can be displayed in the widget
|
||||
|
||||
|
||||
int _usedLines; // the number of lines that are actually being used, this will be less
|
||||
// than 'lines' if the character image provided with setImage() is smaller
|
||||
// than the maximum image size which can be displayed
|
||||
@@ -723,7 +723,7 @@ private:
|
||||
int _usedColumns; // the number of columns that are actually being used, this will be less
|
||||
// than 'columns' if the character image provided with setImage() is smaller
|
||||
// than the maximum image size which can be displayed
|
||||
|
||||
|
||||
int _contentHeight;
|
||||
int _contentWidth;
|
||||
Character* _image; // [lines][columns]
|
||||
@@ -779,13 +779,13 @@ private:
|
||||
//widgets related to the warning message that appears when the user presses Ctrl+S to suspend
|
||||
//terminal output - informing them what has happened and how to resume output
|
||||
QLabel* _outputSuspendedLabel;
|
||||
|
||||
|
||||
uint _lineSpacing;
|
||||
|
||||
bool _colorsInverted; // true during visual bell
|
||||
|
||||
QSize _size;
|
||||
|
||||
|
||||
QRgb _blendColor;
|
||||
|
||||
ColorSchemeWallpaper::Ptr _wallpaper;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of the Konsole Terminal.
|
||||
|
||||
|
||||
Copyright 2006-2008 Robert Knight <robertknight@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -169,7 +169,7 @@ void ViewContainer::viewDestroyed(QObject* object)
|
||||
// constructors to get around the problem, but this is a hack and needs
|
||||
// to be fixed.
|
||||
removeViewWidget(widget);
|
||||
|
||||
|
||||
emit viewRemoved(widget);
|
||||
|
||||
if (_views.count() == 0)
|
||||
@@ -183,7 +183,7 @@ void ViewContainer::removeView(QWidget* view)
|
||||
disconnect( view , SIGNAL(destroyed(QObject*)) , this , SLOT(viewDestroyed(QObject*)) );
|
||||
|
||||
removeViewWidget(view);
|
||||
|
||||
|
||||
emit viewRemoved(view);
|
||||
|
||||
if (_views.count() == 0)
|
||||
@@ -399,7 +399,7 @@ void ViewContainerTabBar::dropEvent(QDropEvent* event)
|
||||
int droppedId = ViewProperties::decodeMimeData(event->mimeData());
|
||||
bool result = false;
|
||||
emit _container->moveViewRequest(index,droppedId,result);
|
||||
|
||||
|
||||
if (result)
|
||||
event->accept();
|
||||
else
|
||||
@@ -716,10 +716,10 @@ void TabbedViewContainer::moveViewWidget( int fromIndex , int toIndex )
|
||||
{
|
||||
QString text = _tabBar->tabText(fromIndex);
|
||||
QIcon icon = _tabBar->tabIcon(fromIndex);
|
||||
|
||||
|
||||
// FIXME - This will lose properties of the tab other than
|
||||
// their text and icon when moving them
|
||||
|
||||
|
||||
_tabBar->removeTab(fromIndex);
|
||||
_tabBar->insertTab(toIndex,icon,text);
|
||||
|
||||
@@ -800,10 +800,10 @@ void TabbedViewContainer::setTabActivity(int index , bool activity)
|
||||
const QPalette& palette = _tabBar->palette();
|
||||
KColorScheme colorScheme(palette.currentColorGroup());
|
||||
const QColor colorSchemeActive = colorScheme.foreground(KColorScheme::ActiveText).color();
|
||||
|
||||
|
||||
const QColor normalColor = palette.text().color();
|
||||
const QColor activityColor = KColorUtils::mix(normalColor,colorSchemeActive);
|
||||
|
||||
|
||||
QColor color = activity ? activityColor : QColor();
|
||||
|
||||
if ( color != _tabBar->tabTextColor(index) )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of the Konsole Terminal.
|
||||
|
||||
|
||||
Copyright 2006-2008 Robert Knight <robertknight@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -64,7 +64,7 @@ namespace Konsole
|
||||
class ViewContainer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
* the view container's navigation widget.
|
||||
*/
|
||||
NavigationDisplayMode navigationDisplayMode() const;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the position of the navigation widget with
|
||||
* respect to the main content area.
|
||||
@@ -170,16 +170,16 @@ public:
|
||||
|
||||
/** Adds a new view to the container widget */
|
||||
void addView(QWidget* view , ViewProperties* navigationItem, int index = -1);
|
||||
|
||||
|
||||
/** Removes a view from the container */
|
||||
void removeView(QWidget* view);
|
||||
|
||||
/** Returns the ViewProperties instance associated with a particular view in the container */
|
||||
ViewProperties* viewProperties( QWidget* view );
|
||||
|
||||
|
||||
/** Returns a list of the contained views */
|
||||
const QList<QWidget*> views();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the view which currently has the focus or 0 if none
|
||||
* of the child views have the focus.
|
||||
@@ -303,7 +303,7 @@ protected:
|
||||
* from the container widget.
|
||||
*/
|
||||
virtual void removeViewWidget(QWidget* view) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Called when the navigation display mode changes.
|
||||
* See setNavigationDisplayMode
|
||||
@@ -438,7 +438,7 @@ private slots:
|
||||
void currentTabChanged(int index);
|
||||
void closeCurrentTab();
|
||||
void wheelScrolled(int delta);
|
||||
|
||||
|
||||
void tabDoubleClicked(int index);
|
||||
void openTabContextMenu(int index, const QPoint& point);
|
||||
void tabContextMenuCloseTab();
|
||||
|
||||
@@ -344,7 +344,7 @@ void ViewManager::detachView(ViewContainer* container, QWidget* widgetView)
|
||||
return;
|
||||
|
||||
emit viewDetached(_sessionMap[viewToDetach]);
|
||||
|
||||
|
||||
_sessionMap.remove(viewToDetach);
|
||||
|
||||
// remove the view from this window
|
||||
|
||||
@@ -324,7 +324,7 @@ private slots:
|
||||
void detachView(ViewContainer* container, QWidget* view);
|
||||
|
||||
void closeTabFromContainer(ViewContainer *container, QWidget *view);
|
||||
|
||||
|
||||
private:
|
||||
void createView(Session* session, ViewContainer* container, int index);
|
||||
const ColorScheme* colorSchemeForProfile(const Profile::Ptr profile) const;
|
||||
@@ -333,12 +333,12 @@ private:
|
||||
void focusActiveView();
|
||||
void registerView(TerminalDisplay* view);
|
||||
void unregisterView(TerminalDisplay* view);
|
||||
|
||||
|
||||
// takes a view from a view container owned by a different manager and places it in
|
||||
// newContainer owned by this manager
|
||||
void takeView(ViewManager* otherManager , ViewContainer* otherContainer, ViewContainer* newContainer, TerminalDisplay* view);
|
||||
void splitView(Qt::Orientation orientation);
|
||||
|
||||
|
||||
// creates a new container which can hold terminal displays
|
||||
// 'profile' specifies the profile to use to get initial
|
||||
// settings (eg. navigation position) for the container
|
||||
@@ -350,7 +350,7 @@ private:
|
||||
// the 'session' is used so that the terminal display's random seed
|
||||
// can be set to something which depends uniquely on that session
|
||||
TerminalDisplay* createTerminalDisplay(Session* session = 0);
|
||||
|
||||
|
||||
// creates a new controller for a session/display pair which provides the menu
|
||||
// actions associated with that view, and exposes basic information
|
||||
// about the session ( such as title and associated icon ) to the display.
|
||||
@@ -361,7 +361,7 @@ private:
|
||||
private:
|
||||
QPointer<ViewSplitter> _viewSplitter;
|
||||
QPointer<SessionController> _pluggedController;
|
||||
|
||||
|
||||
QHash<TerminalDisplay*,Session*> _sessionMap;
|
||||
|
||||
KActionCollection* _actionCollection;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of the Konsole Terminal.
|
||||
|
||||
|
||||
Copyright 2006-2008 Robert Knight <robertknight@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -74,7 +74,7 @@ void ViewSplitter::adjustContainerSize(ViewContainer* container , int percentage
|
||||
ViewSplitter* ViewSplitter::activeSplitter()
|
||||
{
|
||||
QWidget* widget = focusWidget() ? focusWidget() : this;
|
||||
|
||||
|
||||
ViewSplitter* splitter = 0;
|
||||
|
||||
while ( !splitter && widget )
|
||||
@@ -140,7 +140,7 @@ void ViewSplitter::addContainer( ViewContainer* container ,
|
||||
Qt::Orientation containerOrientation )
|
||||
{
|
||||
ViewSplitter* splitter = activeSplitter();
|
||||
|
||||
|
||||
if ( splitter->count() < 2 ||
|
||||
containerOrientation == splitter->orientation() ||
|
||||
!_recursiveSplitting )
|
||||
@@ -150,7 +150,7 @@ void ViewSplitter::addContainer( ViewContainer* container ,
|
||||
|
||||
if ( splitter->orientation() != containerOrientation )
|
||||
splitter->setOrientation( containerOrientation );
|
||||
|
||||
|
||||
splitter->updateSizes();
|
||||
}
|
||||
else
|
||||
@@ -160,12 +160,12 @@ void ViewSplitter::addContainer( ViewContainer* container ,
|
||||
|
||||
ViewContainer* oldContainer = splitter->activeContainer();
|
||||
int oldContainerIndex = splitter->indexOf(oldContainer->containerWidget());
|
||||
|
||||
|
||||
splitter->unregisterContainer(oldContainer);
|
||||
|
||||
|
||||
newSplitter->registerContainer(oldContainer);
|
||||
newSplitter->registerContainer(container);
|
||||
|
||||
|
||||
newSplitter->addWidget(oldContainer->containerWidget());
|
||||
newSplitter->addWidget(container->containerWidget());
|
||||
newSplitter->setOrientation(containerOrientation);
|
||||
@@ -180,7 +180,7 @@ void ViewSplitter::addContainer( ViewContainer* container ,
|
||||
void ViewSplitter::containerEmpty(ViewContainer* /*object*/)
|
||||
{
|
||||
QListIterator<ViewContainer*> containerIter(_containers);
|
||||
|
||||
|
||||
int children = 0;
|
||||
while (containerIter.hasNext())
|
||||
{
|
||||
@@ -194,7 +194,7 @@ void ViewSplitter::containerEmpty(ViewContainer* /*object*/)
|
||||
void ViewSplitter::containerDestroyed(ViewContainer* object)
|
||||
{
|
||||
Q_ASSERT( _containers.contains(object) );
|
||||
|
||||
|
||||
_containers.removeAll(object);
|
||||
|
||||
if ( count() == 0 )
|
||||
@@ -238,7 +238,7 @@ void ViewSplitter::activatePreviousContainer()
|
||||
void ViewSplitter::setActiveContainer(ViewContainer* container)
|
||||
{
|
||||
QWidget* activeView = container->activeView();
|
||||
|
||||
|
||||
if ( activeView )
|
||||
activeView->setFocus( Qt::OtherFocusReason );
|
||||
}
|
||||
@@ -248,14 +248,14 @@ ViewContainer* ViewSplitter::activeContainer() const
|
||||
if ( QWidget* focusW = focusWidget() )
|
||||
{
|
||||
ViewContainer* focusContainer = 0;
|
||||
|
||||
|
||||
while ( focusW != 0 )
|
||||
{
|
||||
QListIterator<ViewContainer*> containerIter(_containers);
|
||||
while (containerIter.hasNext())
|
||||
{
|
||||
ViewContainer* nextContainer = containerIter.next();
|
||||
|
||||
|
||||
if (nextContainer->containerWidget() == focusW)
|
||||
{
|
||||
focusContainer = nextContainer;
|
||||
@@ -268,7 +268,7 @@ ViewContainer* ViewSplitter::activeContainer() const
|
||||
if ( focusContainer )
|
||||
return focusContainer;
|
||||
}
|
||||
|
||||
|
||||
QList<ViewSplitter*> splitters = findChildren<ViewSplitter*>();
|
||||
|
||||
if (splitters.count() > 0)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of the Konsole Terminal.
|
||||
|
||||
|
||||
Copyright 2006-2008 Robert Knight <robertknight@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
/** Returns the child ViewSplitter widget which currently has the focus */
|
||||
ViewSplitter* activeSplitter() ;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the container which currently has the focus or 0 if none
|
||||
* of the immediate child containers have the focus. This does not
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
* Returns a list of the containers held by this splitter
|
||||
*/
|
||||
QList<ViewContainer*> containers() const {return _containers;}
|
||||
|
||||
|
||||
/**
|
||||
* Gives the focus to the active view in the next container
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Konsole, an X terminal.
|
||||
|
||||
|
||||
Copyright 2007-2008 by Robert Knight <robert.knight@gmail.com>
|
||||
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
|
||||
|
||||
@@ -117,7 +117,7 @@ void Vt102Emulation::reset()
|
||||
setCodec(currentCodec);
|
||||
else
|
||||
setCodec(LocaleCodec);
|
||||
|
||||
|
||||
bufferedUpdate();
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ void Vt102Emulation::initTokenizer()
|
||||
- P is the length of the token scanned so far.
|
||||
- L (often P-1) is the position on which contents we base a decision.
|
||||
- C is a character or a group of characters (taken from 'charClass').
|
||||
|
||||
|
||||
- 'cc' is the current character
|
||||
- 's' is a pointer to the start of the token buffer
|
||||
- 'p' is the current position within the token buffer
|
||||
@@ -424,12 +424,12 @@ void Vt102Emulation::processWindowAttributeChange()
|
||||
reportDecodingError();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QString newValue;
|
||||
newValue.reserve(tokenBufferPos-i-2);
|
||||
for (int j = 0; j < tokenBufferPos-i-2; j++)
|
||||
newValue[j] = tokenBuffer[i+1+j];
|
||||
|
||||
|
||||
_pendingTitleUpdates[attributeToChange] = newValue;
|
||||
_titleUpdateTimer->start(20);
|
||||
}
|
||||
@@ -741,14 +741,14 @@ void Vt102Emulation::processToken(int token, int p, int q)
|
||||
// SET_BTN_EVENT_MOUSE 1002
|
||||
// SET_ANY_EVENT_MOUSE 1003
|
||||
//
|
||||
|
||||
|
||||
//Note about mouse modes:
|
||||
//There are four mouse modes which xterm-compatible terminals can support - 1000,1001,1002,1003
|
||||
//Konsole currently supports mode 1000 (basic mouse press and release) and mode 1002 (dragging the mouse).
|
||||
//TODO: Implementation of mouse modes 1001 (something called hilight tracking) and
|
||||
//1003 (a slight variation on dragging the mouse)
|
||||
//
|
||||
|
||||
|
||||
case TY_CSI_PR('h', 1000) : setMode (MODE_Mouse1000); break; //XTERM
|
||||
case TY_CSI_PR('l', 1000) : resetMode (MODE_Mouse1000); break; //XTERM
|
||||
case TY_CSI_PR('s', 1000) : saveMode (MODE_Mouse1000); break; //XTERM
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of Konsole, an X terminal.
|
||||
|
||||
|
||||
Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
|
||||
Copyright 1997,1998 by Lars Doelle <lars.doelle@on-line.de>
|
||||
|
||||
@@ -81,25 +81,25 @@ public:
|
||||
/** Constructs a new emulation */
|
||||
Vt102Emulation();
|
||||
~Vt102Emulation();
|
||||
|
||||
|
||||
// reimplemented from Emulation
|
||||
virtual void clearEntireScreen();
|
||||
virtual void reset();
|
||||
virtual char eraseChar() const;
|
||||
|
||||
|
||||
public slots:
|
||||
// reimplemented from Emulation
|
||||
virtual void sendString(const char*,int length = -1);
|
||||
virtual void sendText(const QString& text);
|
||||
virtual void sendKeyEvent(QKeyEvent*);
|
||||
virtual void sendMouseEvent(int buttons, int column, int line, int eventType);
|
||||
|
||||
|
||||
protected:
|
||||
// reimplemented from Emulation
|
||||
virtual void setMode(int mode);
|
||||
virtual void resetMode(int mode);
|
||||
virtual void receiveChar(int cc);
|
||||
|
||||
|
||||
private slots:
|
||||
//causes changeTitle() to be emitted for each (int,QString) pair in pendingTitleUpdates
|
||||
//used to buffer multiple title updates
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Originally comes from NumLockX http://dforce.sh.charactervut.characterz/~seli/en/numlockx
|
||||
|
||||
NumLockX
|
||||
|
||||
|
||||
Copyright 2000-2001 Lubos Lunak <l.lunak@kde.org>
|
||||
Copyright 2001 Oswald Buddenhagen <ossi@kde.org>
|
||||
|
||||
@@ -50,7 +50,7 @@ int xkb_init()
|
||||
&& XkbQueryExtension( QX11Info::display(), &xkb_opcode, &xkb_event, &xkb_error,
|
||||
&xkb_lmaj, &xkb_lmin );
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
// This method doesn't work in all cases. The atom "ScrollLock" doesn't seem
|
||||
// to exist on all XFree versions (at least it's not here with my 3.3.6) - DF
|
||||
@@ -115,7 +115,7 @@ unsigned int xkb_scrolllock_mask()
|
||||
|
||||
|
||||
unsigned int scrolllock_mask = 0;
|
||||
|
||||
|
||||
int xkb_set_on()
|
||||
{
|
||||
if (!scrolllock_mask)
|
||||
@@ -129,7 +129,7 @@ int xkb_set_on()
|
||||
XkbLockModifiers ( QX11Info::display(), XkbUseCoreKbd, scrolllock_mask, scrolllock_mask);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int xkb_set_off()
|
||||
{
|
||||
if (!scrolllock_mask)
|
||||
|
||||
@@ -79,7 +79,7 @@ extern "C" int KDE_EXPORT kdemain(int argc,char** argv)
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
Application app;
|
||||
|
||||
// make sure the d&d popup menu provided by libkonq get translated.
|
||||
|
||||
@@ -95,7 +95,7 @@ void DBusTest::cleanupTestCase()
|
||||
|
||||
// Need to take care of when user has CloseAllTabs=False otherwise
|
||||
// they will get a popup dialog when we try to close this.
|
||||
|
||||
|
||||
QDBusInterface iface(_interfaceName,
|
||||
QLatin1String("/konsole/MainWindow_1"),
|
||||
QLatin1String("com.trolltech.Qt.QWidget"));
|
||||
|
||||
@@ -66,12 +66,12 @@ void PartTest::testFd()
|
||||
bool result = QMetaObject::invokeMethod(terminalPart,"openTeletype",
|
||||
Qt::DirectConnection,Q_ARG(int,fd));
|
||||
QVERIFY(result);
|
||||
|
||||
|
||||
// suspend the KPtyDevice so that the embedded terminal gets a chance to
|
||||
// read from the pty. Otherwise the KPtyDevice will simply read everything
|
||||
// as soon as it becomes available and the terminal will not display any output
|
||||
ptyProcess.pty()->setSuspended(true);
|
||||
|
||||
|
||||
KDialog* dialog = new KDialog();
|
||||
dialog->setButtons(0);
|
||||
QVBoxLayout* layout = new QVBoxLayout(dialog->mainWidget());
|
||||
@@ -95,7 +95,7 @@ void PartTest::testShortcutOverride()
|
||||
// When the key presses are sent automatically, the shortcut is triggered but
|
||||
// Konsole::TerminalDisplay::event() is not called and the overrideShortcut() signal is
|
||||
// not emitted by the part.
|
||||
|
||||
|
||||
// Create a main window with a menu and a test
|
||||
// action with a shortcut set to Ctrl+S, which is also used by the terminal
|
||||
KMainWindow* mainWindow = new KMainWindow();
|
||||
@@ -166,7 +166,7 @@ KParts::Part* PartTest::createPart()
|
||||
Q_ASSERT(factory);
|
||||
|
||||
KParts::Part* terminalPart = factory->create<KParts::Part>(this);
|
||||
|
||||
|
||||
return terminalPart;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ void ProfileTest::testProfile()
|
||||
QCOMPARE(child->property<QVariant>(Profile::Name),QVariant());
|
||||
QCOMPARE(parent->property<QString>(Profile::Path),QString("FakePath"));
|
||||
QCOMPARE(child->property<QVariant>(Profile::Path),QVariant());
|
||||
|
||||
|
||||
// read inheritable properties
|
||||
QVERIFY(parent->property<bool>(Profile::AntiAliasFonts) == false);
|
||||
QVERIFY(child->property<bool>(Profile::AntiAliasFonts) == false);
|
||||
@@ -80,7 +80,7 @@ void ProfileTest::testClone()
|
||||
Profile::Ptr source(new Profile(parent));
|
||||
source->setProperty(Profile::AntiAliasFonts,false);
|
||||
source->setProperty(Profile::HistorySize,4567);
|
||||
|
||||
|
||||
source->setProperty(Profile::Name,"SourceProfile");
|
||||
source->setProperty(Profile::Path,"SourcePath");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user