Commit bc1fb9d0 authored by Robert Knight's avatar Robert Knight

* Consistant naming for private fields in TerminalDisplay class.

* KConfig -> KConfigGroup porting
* KKeyDialog -> KShortcutsDialog
* Adapt to KFontDialog changes


svn path=/branches/work/konsole-split-view/; revision=650337
parent d0afc223
......@@ -98,7 +98,7 @@ KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(const QString& nam
QFile source(_paths[name]); // TODO get correct path here
source.open(QIODevice::ReadOnly);
KeyboardTranslatorReader reader(device);
KeyboardTranslatorReader reader(&source);
while ( reader.hasNextEntry() )
translator->addEntry(reader.nextEntry());
......@@ -142,10 +142,6 @@ QList<QString> KeyboardTranslatorManager::availableTranslators() const
return _translators.keys();
}
char* KeyboardTranslator::Entry::_textBuffer = 0;
int KeyboardTranslator::Entry::_textBufferUsedLength = 0;
int KeyboardTranslator::Entry::_textBufferSize = 0;
KeyboardTranslator::Entry::Entry( int keyCode,
Qt::KeyboardModifier modifiers,
State flags,
......
......@@ -217,18 +217,18 @@ class KeyboardTranslatorReader
{
public:
/** Constructs a new reader which parses the given @p source */
KeyboardTranslatorReader( QIODevice* source );
KeyboardTranslatorReader( QIODevice* source ) {};
/** Returns true if there is another entry in the source stream */
bool hasNextEntry();
bool hasNextEntry() { return false; };
/** Returns the next entry found in the source stream */
KeyboardTranslator::Entry nextEntry();
KeyboardTranslator::Entry nextEntry() { return KeyboardTranslator::Entry(Qt::Key_unknown,Qt::NoModifier,KeyboardTranslator::NoState,"",KeyboardTranslator::NoCommand); };
/**
* Returns true if an error occurred whilst parsing the input or
* false if no error occurred.
*/
bool parseError();
bool parseError() { return false; };
};
/**
......@@ -283,7 +283,7 @@ inline KeyboardTranslator::Command KeyboardTranslator::Entry::command() const
{
return _command;
}
inline char* KeyboardTranslator::Entry::text() const
inline const char* KeyboardTranslator::Entry::text() const
{
return _text;
}
......
......@@ -24,7 +24,7 @@
#include <KAction>
#include <KActionCollection>
#include <KActionMenu>
#include <KKeyDialog>
#include <KShortcutsDialog>
#include <KLocale>
#include <KMenu>
#include <KMenuBar>
......@@ -140,7 +140,7 @@ void MainWindow::newWindow()
void MainWindow::showShortcutsDialog()
{
KKeyDialog::configure( actionCollection() );
KShortcutsDialog::configure( actionCollection() );
}
void MainWindow::sessionSelected(const QString& key)
......
......@@ -429,8 +429,8 @@ void Session::updateTerminalSize()
TerminalDisplay* view = viewIter.next();
if ( view->isHidden() == false )
{
minLines = (minLines == -1) ? view->Lines() : qMin( minLines , view->Lines() );
minColumns = (minColumns == -1) ? view->Columns() : qMin( minColumns , view->Columns() );
minLines = (minLines == -1) ? view->lines() : qMin( minLines , view->lines() );
minColumns = (minColumns == -1) ? view->columns() : qMin( minColumns , view->columns() );
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -457,7 +457,7 @@ TerminalDisplay* ViewManager::createTerminalDisplay()
display->setCutToBeginningOfLine(true);
display->setTerminalSizeStartup(false);
display->setSize(80,40);
display->setScrollbarLocation(TerminalDisplay::SCROLLBAR_RIGHT);
display->setScrollBarLocation(TerminalDisplay::SCROLLBAR_RIGHT);
return display;
}
......
......@@ -61,7 +61,6 @@
#include "KeyTrans.h"
#include "schema.h"
#include "Session.h"
#include "TerminalDisplay.h"
extern "C"
{
......@@ -595,7 +594,22 @@ void konsolePart::readProperties()
b_histEnabled = cg.readEntry("historyenabled", true);
n_bell = qMin(cg.readEntry("bellmode",uint(TerminalDisplay::BELLSYSTEM)),3u);
n_keytab=cg.readEntry("keytab",0); // act. the keytab for this session
n_scroll = qMin(cg.readEntry("scrollbar",uint(TerminalDisplay::SCROLLBAR_RIGHT)),2u);
// TODO Find a more elegant way to read the scroll-bar enum value from the configuration
switch ( qMin(cg.readEntry("scrollbar",uint(TerminalDisplay::SCROLLBAR_RIGHT)),2u) )
{
case TerminalDisplay::SCROLLBAR_NONE:
n_scroll = TerminalDisplay::SCROLLBAR_NONE;
break;
case TerminalDisplay::SCROLLBAR_LEFT:
n_scroll = TerminalDisplay::SCROLLBAR_LEFT;
break;
case TerminalDisplay::SCROLLBAR_RIGHT:
n_scroll = TerminalDisplay::SCROLLBAR_RIGHT;
break;
}
m_histSize = cg.readEntry("history",DEFAULT_HISTORY_SIZE);
s_word_seps= cg.readEntry("wordseps",":@-./_~");
......@@ -627,7 +641,9 @@ void konsolePart::readProperties()
te->setBlinkingCursor(cg.readEntry("BlinkingCursor", false));
te->setFrameStyle( b_framevis?(QFrame::WinPanel|QFrame::Sunken):QFrame::NoFrame );
te->setLineSpacing( cg.readEntry( "LineSpacing", 0 ) );
te->setScrollbarLocation(n_scroll);
te->setScrollBarLocation( n_scroll );
te->setWordCharacters(s_word_seps);
if ( !b_useKonsoleSettings )
......@@ -636,7 +652,7 @@ void konsolePart::readProperties()
config = new KConfig("konsolerc");
}
cg = config->group("Desktop Entry");
te->setTerminalSizeHint( config->readEntry("TerminalSizeHint", true) );
te->setTerminalSizeHint( cg.readEntry("TerminalSizeHint", true) );
delete config;
}
......@@ -659,7 +675,7 @@ void konsolePart::saveProperties()
cg.writeEntry("has frame",b_framevis);
cg.writeEntry("LineSpacing", te->lineSpacing());
cg.writeEntry("schema",s_kconfigSchema);
cg.writeEntry("scrollbar",n_scroll);
cg.writeEntry("scrollbar",(int)n_scroll);
cg.writeEntry("wordseps",s_word_seps);
cg.writeEntry("encoding",n_encoding);
cg.writeEntry("use_konsole_settings",m_useKonsoleSettings->isChecked());
......@@ -688,15 +704,15 @@ void konsolePart::slotToggleFrame()
void konsolePart::slotSelectScrollbar()
{
if ( ! se ) return;
n_scroll = selectScrollbar->currentItem();
te->setScrollbarLocation(n_scroll);
n_scroll = (TerminalDisplay::ScrollBarLocation)selectScrollbar->currentItem();
te->setScrollBarLocation(n_scroll);
}
void konsolePart::slotSelectFont() {
if ( !se ) return;
QFont font = te->getVTFont();
if ( KFontDialog::getFont( font, true ) != QDialog::Accepted )
if ( KFontDialog::getFont( font, KFontChooser::FixedFontsOnly ) != QDialog::Accepted )
return;
te->setVTFont(font);
......@@ -828,7 +844,7 @@ void konsolePart::pixmap_menu_activated(int item)
pmPath = "";
item = 1;
QPalette palette;
palette.setColor(te->backgroundRole(), te->getDefaultBackColor());
palette.setColor(te->backgroundRole(), te->defaultBackColor());
te->setPalette(palette);
return;
}
......@@ -845,7 +861,7 @@ void konsolePart::pixmap_menu_activated(int item)
break;
case 3: // center
{ QPixmap bgPixmap( te->size() );
bgPixmap.fill(te->getDefaultBackColor());
bgPixmap.fill(te->defaultBackColor());
bitBlt( &bgPixmap, ( te->size().width() - pm.width() ) / 2,
( te->size().height() - pm.height() ) / 2,
&pm, 0, 0,
......
......@@ -33,6 +33,7 @@
// Konsole
#include "schema.h"
#include "Session.h"
#include "TerminalDisplay.h"
class KComponentData;
class QPushButton;
......@@ -184,7 +185,7 @@ Q_SIGNALS:
int n_bell;
int n_keytab;
int n_render;
int n_scroll;
TerminalDisplay::ScrollBarLocation n_scroll;
unsigned m_histSize;
bool m_runningShell;
bool m_streamEnabled;
......
......@@ -176,17 +176,17 @@ ColorSchema::ColorSchema(KConfig& c)
{
clearSchema();
c.setGroup("SchemaGeneral");
KConfigGroup cg = c.group("SchemaGeneral");
m_title = c.readEntry("Title",i18n("[no title]"));
m_imagePath = c.readEntry("ImagePath");
m_alignment = c.readEntry("ImageAlignment", int(1));
m_useTransparency = c.readEntry("UseTransparency", false);
m_title = cg.readEntry("Title",i18n("[no title]"));
m_imagePath = cg.readEntry("ImagePath");
m_alignment = cg.readEntry("ImageAlignment", int(1));
m_useTransparency = cg.readEntry("UseTransparency", false);
m_tr_r = c.readEntry("TransparentR", int(0));
m_tr_g = c.readEntry("TransparentG", int(0));
m_tr_b = c.readEntry("TransparentB", int(0));
m_tr_x = c.readEntry("TransparentX", double(0.0));
m_tr_r = cg.readEntry("TransparentR", int(0));
m_tr_g = cg.readEntry("TransparentG", int(0));
m_tr_b = cg.readEntry("TransparentB", int(0));
m_tr_x = cg.readEntry("TransparentX", double(0.0));
for (int i=0; i < TABLE_COLORS; i++)
{
......@@ -281,16 +281,16 @@ void ColorSchema::writeConfig(const QString& path) const
KConfig c( path, KConfig::NoGlobals );
c.setGroup("SchemaGeneral");
c.writeEntry("Title",m_title);
c.writeEntry("ImagePath",m_imagePath);
c.writeEntry("ImageAlignment",m_alignment);
c.writeEntry("UseTransparency",m_useTransparency);
KConfigGroup cg = c.group("SchemaGeneral");
cg.writeEntry("Title",m_title);
cg.writeEntry("ImagePath",m_imagePath);
cg.writeEntry("ImageAlignment",m_alignment);
cg.writeEntry("UseTransparency",m_useTransparency);
c.writeEntry("TransparentR",m_tr_r);
c.writeEntry("TransparentG",m_tr_g);
c.writeEntry("TransparentB",m_tr_b);
c.writeEntry("TransparentX",m_tr_x);
cg.writeEntry("TransparentR",m_tr_r);
cg.writeEntry("TransparentG",m_tr_g);
cg.writeEntry("TransparentB",m_tr_b);
cg.writeEntry("TransparentX",m_tr_x);
for (int i=0; i < TABLE_COLORS; i++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment