-rw-r--r-- | core/apps/embeddedkonsole/TEHistory.cpp | 2 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEScreen.cpp | 2 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 4 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/commandeditdialog.cpp | 2 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 31 |
5 files changed, 21 insertions, 20 deletions
diff --git a/core/apps/embeddedkonsole/TEHistory.cpp b/core/apps/embeddedkonsole/TEHistory.cpp index 504cd13..2417af1 100644 --- a/core/apps/embeddedkonsole/TEHistory.cpp +++ b/core/apps/embeddedkonsole/TEHistory.cpp @@ -77,33 +77,33 @@ void HistoryScroll::setSize(int lines, int cells) m_max_lines = m_max_cells = 0; if (lines > 0 && cells > 0) { m_max_lines = lines; m_lines = new int[m_max_lines]; m_lines[0] = 0; m_max_cells = cells; m_cells = new ca[m_max_cells]; } m_first_line = 0; m_num_lines = 0; m_last_cell = 0; m_start_line = 0; } void HistoryScroll::setScroll(bool on) { - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("History"); // printf("setScroll(%d)\n", on); if (on) { int lines = cfg.readNumEntry("history_lines",300); int avg_line = cfg.readNumEntry("avg_line_length",60); int cells = lines * avg_line; setSize(lines,cells); } else { setSize(0,0); } } bool HistoryScroll::hasScroll() { return (m_max_lines > 0); } diff --git a/core/apps/embeddedkonsole/TEScreen.cpp b/core/apps/embeddedkonsole/TEScreen.cpp index 4ebc28e..3dbcec2 100644 --- a/core/apps/embeddedkonsole/TEScreen.cpp +++ b/core/apps/embeddedkonsole/TEScreen.cpp @@ -549,33 +549,33 @@ ca* TEScreen::getCookedImage() { int i,n = lines*columns; for (i = 0; i < n; i++) reverseRendition(&merged[i]); // for reverse display } if (getMode(MODE_Cursor) && (cuY+(hist.getLines()-histCursor) < lines)) // cursor visible reverseRendition(&merged[loc(cuX,cuY+(hist.getLines()-histCursor))]); return merged; } /*! */ void TEScreen::reset() { - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("ScrollBar"); if( !cfg.readBoolEntry("HorzScroll",0) ) setMode(MODE_Wrap ); saveMode(MODE_Wrap ); // wrap at end of margin resetMode(MODE_Origin); saveMode(MODE_Origin); // position refere to [1,1] resetMode(MODE_Insert); saveMode(MODE_Insert); // overstroke setMode(MODE_Cursor); // cursor visible resetMode(MODE_Screen); // screen not inverse resetMode(MODE_NewLine); tmargin=0; bmargin=lines-1; setDefaultRendition(); saveCursor(); diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index 98c3cdf..2e3e0f5 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp @@ -293,33 +293,33 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) cb = QApplication::clipboard(); QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), this, SLOT(onClearSelection()) ); #endif scrollbar = new QScrollBar(this); scrollbar->setCursor( arrowCursor ); connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); hScrollbar = new QScrollBar(this); hScrollbar->setCursor( arrowCursor ); hScrollbar->setOrientation(QScrollBar::Horizontal); // hScrollbar->setMaximumHeight(16); connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int))); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("ScrollBar"); switch( cfg.readNumEntry("Position",2)){ case 0: scrollLoc = SCRNONE; break; case 1: scrollLoc = SCRLEFT; break; case 2: scrollLoc = SCRRIGHT; break; }; useHorzScroll=cfg.readBoolEntry("HorzScroll",0); blinkT = new QTimer(this); @@ -1214,33 +1214,33 @@ void TEWidget::clearImage() for (int x = 0; x < columns; x++) { image[loc(x,y)].c = 0xff; //' '; image[loc(x,y)].f = 0xff; //DEFAULT_FORE_COLOR; image[loc(x,y)].b = 0xff; //DEFAULT_BACK_COLOR; image[loc(x,y)].r = 0xff; //DEFAULT_RENDITION; } } // Create Image /////////////////////////////////////////////////////// void TEWidget::calcGeometry() { int showhscrollbar = 1; int hwidth = 0; int dcolumns; - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("ScrollBar"); useHorzScroll=cfg.readBoolEntry("HorzScroll",0); if(vcolumns == 0) showhscrollbar = 0; if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width(); scrollbar->resize(QApplication::style().scrollBarExtent().width(), contentsRect().height() - hwidth); switch(scrollLoc) { case SCRNONE : columns = ( contentsRect().width() - 2 * rimX ) / font_w; dcolumns = columns; if(vcolumns) columns = vcolumns; blX = (contentsRect().width() - (columns*font_w) ) / 2; if(showhscrollbar) diff --git a/core/apps/embeddedkonsole/commandeditdialog.cpp b/core/apps/embeddedkonsole/commandeditdialog.cpp index 03cba87..b23db18 100644 --- a/core/apps/embeddedkonsole/commandeditdialog.cpp +++ b/core/apps/embeddedkonsole/commandeditdialog.cpp @@ -89,33 +89,33 @@ CommandEditDialog::CommandEditDialog(QWidget *parent, const char* name, WFlags f ToolButton5->setTextLabel("down"); ToolButton5->setPixmap(Resource::loadPixmap("down")); ToolButton5->setAutoRaise(TRUE); ToolButton5->setFocusPolicy(QWidget::NoFocus); connect(ToolButton5,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedDown())); QListViewItem *current = m_SuggestedCommandList->selectedItem(); if ( current ) item->moveItem( current ); m_SuggestedCommandList->setSelected( item, TRUE ); m_SuggestedCommandList->ensureItemVisible( m_SuggestedCommandList->selectedItem() ); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Commands"); if (cfg.readEntry("Commands Set","FALSE") == "TRUE") { for (int i = 0; i < 100; i++) { QString tmp; tmp = cfg.readEntry( QString::number(i),""); if (!tmp.isEmpty()) m_PlayListSelection->addStringToSelection(tmp); } } else { m_PlayListSelection->addStringToSelection("ls "); m_PlayListSelection->addStringToSelection("cardctl eject"); m_PlayListSelection->addStringToSelection("cat "); m_PlayListSelection->addStringToSelection("cd "); m_PlayListSelection->addStringToSelection("chmod "); m_PlayListSelection->addStringToSelection("cp "); diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 46c0203..3289a04 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp @@ -7,32 +7,33 @@ /* */ /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ /* */ /* This file is part of Konsole, an X terminal. */ /* */ /* The material contained in here more or less directly orginates from */ /* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ /* */ /* ---------------------------------------------------------------------- */ /* */ /* Ported Konsole to Qt/Embedded */ /* */ /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ /* */ /* -------------------------------------------------------------------------- */ // enhancements added by L.J. Potter <ljp@llornkcor.com> +// enhancements added by Phillip Kuhn //#define QT_QWS_OPIE #include <stdlib.h> #ifdef QT_QWS_OPIE #include <opie2/ocolorpopupmenu.h> #endif #include <qpe/resource.h> #include <qdir.h> #include <qevent.h> #include <qdragobject.h> #include <qobjectlist.h> #include <qtoolbutton.h> #include <qtoolbar.h> @@ -248,33 +249,33 @@ class HistoryList : public QList<HistoryItem> { virtual int compareItems( QCollection::Item item1, QCollection::Item item2) { int c1 = ((HistoryItem*)item1)->count; int c2 = ((HistoryItem*)item2)->count; if (c1 > c2) return(1); if (c1 < c2) return(-1); return(0); } }; void Konsole::initCommandList() { // qDebug("Konsole::initCommandList"); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Commands"); // commonCombo->setInsertionPolicy(QComboBox::AtCurrent); commonCombo->clear(); if (cfg.readEntry("ShellHistory","TRUE") == "TRUE") { QString histfilename = QString(getenv("HOME")) + "/.bash_history"; histfilename = cfg.readEntry("ShellHistoryPath",histfilename); QFile histfile(histfilename); // note: compiler barfed on: // QFile histfile(QString(getenv("HOME")) + "/.bash_history"); if (histfile.open( IO_ReadOnly )) { QString line; uint i; HistoryList items; @@ -358,33 +359,33 @@ void Konsole::init(const char* _pgm, QStrList & _args) } #endif signal(SIGSTOP, sig_handler); signal(SIGCONT, sig_handler); signal(SIGTSTP, sig_handler); b_scroll = TRUE; // histon; n_keytab = 0; n_render = 0; startUp=0; fromMenu = FALSE; fullscreen = false; setCaption( "Qkonsole" ); setIcon( Resource::loadPixmap( "qkonsole/qkonsole" ) ); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Font"); QString tmp; // initialize the list of allowed fonts /////////////////////////////////// QString cfgFontName = cfg.readEntry("FontName","Lcfont"); int cfgFontSize = cfg.readNumEntry("FontSize",18); cfont = -1; // this code causes repeated access to all the font files // which does slow down startup QFontDatabase fontDB; QStringList familyNames; familyNames = fontDB.families( FALSE ); QString s; @@ -771,33 +772,33 @@ Konsole::~Konsole() { doneSession(getTe(), 0); } } void Konsole::historyDialog() { QDialog *d = new QDialog ( this, "histdlg", true ); // d-> setCaption ( tr( "History" )); QBoxLayout *lay = new QVBoxLayout ( d, 4, 4 ); QLabel *l = new QLabel ( tr( "History Lines:" ), d ); lay-> addWidget ( l ); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("History"); int hist = cfg.readNumEntry("history_lines",300); int avg_line = cfg.readNumEntry("avg_line_length",60); QSpinBox *spin = new QSpinBox ( 1, 100000, 20, d ); spin-> setValue ( hist ); spin-> setWrapping ( true ); spin-> setButtonSymbols ( QSpinBox::PlusMinus ); lay-> addWidget ( spin ); if ( d-> exec ( ) == QDialog::Accepted ) { cfg.writeEntry("history_lines", spin->value()); cfg.writeEntry("avg_line_length", avg_line); if (getTe() != NULL) { @@ -914,33 +915,33 @@ void Konsole::setFont(int f) } cfont = f; int familyNum = font->getFamilyNum(); int size = font->getSize(); printf("familyNum = %d size = %d count=%d\n", familyNum, size, fontList->count()); for(int i = 0; i < (int)fontList->count(); i++) { fontList->setItemChecked(i + 1000, i == familyNum); } for(int i = 0; i < (int)fonts.count(); i++) { fontList->setItemChecked(i, fonts.at(i)->getFamilyNum() == familyNum && fonts.at(i)->getSize() == size); } - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Font"); QString ss = "Session"+ QString::number(tab->currentPageIndex()+1); if (tab->currentPageIndex() == 0) { cfg.writeEntry("FontName", fonts.at(cfont)->getFamily()); cfg.writeEntry("FontSize", fonts.at(cfont)->getSize()); } cfg.writeEntry("FontName"+ss, fonts.at(cfont)->getFamily()); cfg.writeEntry("FontSize"+ss, fonts.at(cfont)->getSize()); } } #if 0 void Konsole::fontChanged(int f) { VTFont* font = fonts.at(f); @@ -1159,33 +1160,33 @@ void Konsole::doneSession(TEWidget* te, int ) } void Konsole::changeTitle(TEWidget* te, QString newTitle ) { if (te == getTe()) { setCaption(newTitle + " - QKonsole"); } } void Konsole::newSession() { if(nsessions < 15) { // seems to be something weird about 16 tabs on the Zaurus.... memory? TEWidget* te = new TEWidget(tab); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Menubar"); // FIXME use more defaults from config file te->useBeep=cfg.readBoolEntry("useBeep",0); // te->setBackgroundMode(PaletteBase); //we want transparent!! cfg.setGroup("Font"); QString sn = "Session" + QString::number(nsessions+1); printf("read font session %s\n", sn.latin1()); QString fontName = cfg.readEntry("FontName"+sn, cfg.readEntry("FontName", fonts.at(cfont)->getFamily())); int fontSize = cfg.readNumEntry("FontSize"+sn, cfg.readNumEntry("FontSize", fonts.at(cfont)->getSize())); @@ -1398,33 +1399,33 @@ void Konsole::fullscreenTimeout() void Konsole::colorMenuIsSelected(int iD) { fromMenu = TRUE; colorMenuSelected(iD); } /// ------------------------------- some new stuff by L.J. Potter void Konsole::colorMenuSelected(int iD) { // this is NOT pretty, elegant or anything else besides functional // QString temp; // qDebug( temp.sprintf("colormenu %d", iD)); TEWidget* te = getTe(); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Colors"); ColorEntry m_table[TABLE_COLORS]; const ColorEntry * defaultCt=te->getdefaultColorTable(); int i; // te->color_menu_item = iD; colorMenu->setItemChecked(cm_ab,FALSE); colorMenu->setItemChecked(cm_bb,FALSE); colorMenu->setItemChecked(cm_wc,FALSE); colorMenu->setItemChecked(cm_cw,FALSE); colorMenu->setItemChecked(cm_mb,FALSE); colorMenu->setItemChecked(cm_bm,FALSE); colorMenu->setItemChecked(cm_gy,FALSE); @@ -1582,33 +1583,33 @@ void Konsole::setColors(QColor foreground, QColor background) { m_table[i].color = foreground; } else if(i==1 || i == 11) { m_table[i].color = background; m_table[i].transparent=0; } else m_table[i].color = defaultCt[i].color; } te->setColorTable(m_table); } void Konsole::tabMenuSelected(int id) { - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Tabs"); tabMenu->setItemChecked(tabPos, false); if (id == tm_bottom) { printf("set bottom tab\n"); tab->getTabBar()->show(); tab->setTabPosition(QTabWidget::Bottom); tab->getTabBar()->show(); cfg.writeEntry("Position","Bottom"); } else if (id == tm_top) { printf("set top tab\n"); tab->getTabBar()->show(); tab->setTabPosition(QTabWidget::Bottom); tab->setTabPosition(QTabWidget::Top); @@ -1619,33 +1620,33 @@ void Konsole::tabMenuSelected(int id) { tab->getTabBar()->hide(); tab->setMargin(tab->margin()); cfg.writeEntry("Position","Hidden"); } tabMenu->setItemChecked(id, true); tabPos = id; } void Konsole::configMenuSelected(int iD) { // QString temp; // qDebug( temp.sprintf("configmenu %d",iD)); TEWidget* te = getTe(); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Menubar"); if(iD == cm_wrap) { cfg.setGroup("ScrollBar"); bool b=cfg.readBoolEntry("HorzScroll",0); b=!b; cfg.writeEntry("HorzScroll", b ); cfg.write(); doWrap(); if(cfg.readNumEntry("Position",2) == 0) { te->setScrollbarLocation(1); } else { te->setScrollbarLocation(0); @@ -1653,69 +1654,69 @@ void Konsole::configMenuSelected(int iD) te->setScrollbarLocation( cfg.readNumEntry("Position",2)); } if(iD == cm_beep) { cfg.setGroup("Menubar"); bool b=cfg.readBoolEntry("useBeep",0); b=!b; cfg.writeEntry("useBeep", b ); cfg.write(); configMenu->setItemChecked(cm_beep,b); te->useBeep=b; } } void Konsole::changeCommand(const QString &text, int c) { - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Commands"); if(commonCmds[c] != text) { cfg.writeEntry(QString::number(c),text); commonCombo->clearEdit(); commonCombo->setCurrentItem(c); } } void Konsole::setColor(int sess) { - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Colors"); QColor foreground, background; QString ss = QString("Session") + QString::number(sess); foreground.setRgb(cfg.readNumEntry("foregroundRed"+ss, cfg.readNumEntry("foregroundRed",0xff)), cfg.readNumEntry("foregroundGreen"+ss, cfg.readNumEntry("foregroundGreen",0xff)), cfg.readNumEntry("foregroundBlue"+ss, cfg.readNumEntry("foregroundBlue",0xff))); background.setRgb(cfg.readNumEntry("backgroundRed"+ss, cfg.readNumEntry("backgroundRed",0)), cfg.readNumEntry("backgroundGreen"+ss, cfg.readNumEntry("backgroundGreen",0)), cfg.readNumEntry("backgroundBlue"+ss, cfg.readNumEntry("backgroundBlue",0))); setColors(foreground, background); } void Konsole::scrollMenuSelected(int index) { // qDebug( "scrollbar menu %d",index); TEWidget* te = getTe(); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("ScrollBar"); if(index == sm_none) { te->setScrollbarLocation(0); cfg.writeEntry("Position",0); } else if(index == sm_left) { te->setScrollbarLocation(1); cfg.writeEntry("Position",1); } else if(index == sm_right) { te->setScrollbarLocation(2); cfg.writeEntry("Position",2); @@ -1736,33 +1737,33 @@ void Konsole::scrollMenuSelected(int index) // te->setScrollbarLocation(0); // te->setWrapAt(120); // } // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); // } // break; void Konsole::editCommandListMenuSelected(int iD) { // QString temp; // qDebug( temp.sprintf("edit command list %d",iD)); // FIXME: more cleanup needed here TEWidget* te = getTe(); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Menubar"); if( iD == ec_cmdlist) { if(!secondToolBar->isHidden()) { secondToolBar->hide(); configMenu->changeItem( iD,tr( "Show Command List" )); cfg.writeEntry("Hidden","TRUE"); configMenu->setItemEnabled(ec_edit ,FALSE); configMenu->setItemEnabled(ec_quick ,FALSE); } else { secondToolBar->show(); configMenu->changeItem( iD,tr( "Hide Command List" )); cfg.writeEntry("Hidden","FALSE"); @@ -1852,67 +1853,67 @@ void Konsole::parseCommandLine() { i++; for ( int j=i;j< qApp->argc();j++) { cmd+=QString(qApp->argv()[j])+" "; } cmd.stripWhiteSpace(); system(cmd.latin1()); exit(0);//close(); } // end -e switch } startUp++; } void Konsole::changeForegroundColor(const QColor &color) { - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Colors"); int r, g, b; color.rgb(&r,&g,&b); foreground.setRgb(r,g,b); cfg.writeEntry("foreground",color.name()); qDebug("foreground "+color.name()); cfg.write(); qDebug("do other dialog"); #ifdef QT_QWS_OPIE Opie::OColorPopupMenu* penColorPopupMenu2 = new Opie::OColorPopupMenu(Qt::black, this,"background color"); connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeBackgroundColor(const QColor&))); penColorPopupMenu2->exec(); #endif } void Konsole::changeBackgroundColor(const QColor &color) { qDebug("Change background"); - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("Colors"); int r, g, b; color.rgb(&r,&g,&b); background.setRgb(r,g,b); cfg.writeEntry("background",color.name()); qDebug("background "+color.name()); cfg.write(); } void Konsole::doWrap() { - Config cfg("Qkonsole"); + Config cfg( "Konsole" ); cfg.setGroup("ScrollBar"); TEWidget* te = getTe(); if( !cfg.readBoolEntry("HorzScroll",0)) { te->setWrapAt(0); configMenu->setItemChecked( cm_wrap,TRUE); } else { // te->setWrapAt(90); te->setWrapAt(120); configMenu->setItemChecked( cm_wrap,FALSE); } } |