Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index 8207f23..80c8223 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp @@ -24,16 +24,17 @@ #include <stdlib.h> #include <sys/types.h> #include <pwd.h> #include <unistd.h> #ifdef QT_QWS_OPIE #include <opie2/ocolorpopupmenu.h> +#include <opie2/odebug.h> using namespace Opie; #endif #include <qpe/resource.h> #include <qmenubar.h> #include <qtabbar.h> #include <qpe/config.h> @@ -199,30 +200,30 @@ static const char *commonCmds[] = */ "exit", NULL }; static void konsoleInit(const char** shell) { - if(setuid(getuid()) !=0) qDebug("setuid failed"); - if(setgid(getgid()) != 0) qDebug("setgid failed"); // drop privileges + if(setuid(getuid()) !=0) odebug << "setuid failed" << oendl; + if(setgid(getgid()) != 0) odebug << "setgid failed" << oendl; // drop privileges // QPEApplication::grabKeyboard(); // for CTRL and ALT - qDebug("keyboard grabbed"); + odebug << "keyboard grabbed" << oendl; #ifdef FAKE_CTRL_AND_ALT - qDebug("Fake Ctrl and Alt defined"); + odebug << "Fake Ctrl and Alt defined" << oendl; QPEApplication::grabKeyboard(); // for CTRL and ALT #endif *shell = getenv("SHELL"); - qWarning("SHell initially is %s", *shell ); + owarn << "SHell initially is " << *shell << "" << oendl; if (shell == NULL || *shell == '\0') { struct passwd *ent = 0; uid_t me = getuid(); *shell = "/bin/sh"; while ( (ent = getpwent()) != 0 ) { if (ent->pw_uid == me) { @@ -230,17 +231,17 @@ static void konsoleInit(const char** shell) { *shell = ent->pw_shell; break; } } endpwent(); } if( putenv((char*)"COLORTERM=") !=0) - qDebug("putenv failed"); // to trigger mc's color detection + odebug << "putenv failed" << oendl; // to trigger mc's color detection } Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) : QMainWindow(parent, name, fl) { QStrList tmp; const char* shell; @@ -276,17 +277,17 @@ class HistoryList : public QList<HistoryItem> if (c1 < c2) return(-1); return(0); } }; void Konsole::initCommandList() { - // qDebug("Konsole::initCommandList"); + // odebug << "Konsole::initCommandList" << oendl; 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"; @@ -508,17 +509,17 @@ void Konsole::init(const char* _pgm, QStrList & _args) menuToolBar = new QToolBar( this ); menuToolBar->setHorizontalStretchable( TRUE ); QMenuBar *menuBar = new QMenuBar( menuToolBar ); setFont(cfont); configMenu = new QPopupMenu( this); - colorMenu = new QPopupMenu( this); + colorMenu = new QPopupMenu( this); scrollMenu = new QPopupMenu( this); editCommandListMenu = new QPopupMenu( this); configMenu->insertItem(tr("Command List"), editCommandListMenu); bool listHidden; cfg.setGroup("Menubar"); if( cfg.readEntry("Hidden","FALSE") == "TRUE") @@ -1062,17 +1063,17 @@ QSize Konsole::calcSize(int columns, int lines) /** sets application window to a size based on columns X lines of the te guest widget. Call with (0,0) for setting default size. */ void Konsole::setColLin(int columns, int lines) { - qDebug("konsole::setColLin:: Columns %d", columns); + odebug << "konsole::setColLin:: Columns " << columns << "" << oendl; if ((columns==0) || (lines==0)) { if (defaultSize.isEmpty()) // not in config file : set default value { defaultSize = calcSize(80,24); // notifySize(24,80); // set menu items (strange arg order !) } @@ -1110,17 +1111,17 @@ void Konsole::setFont(int fontno) n_font = fontno; } */ // --| color selection |------------------------------------------------------- void Konsole::changeColumns(int /*columns*/) { //FIXME this seems to cause silliness when reset command is executed - // qDebug("change columns"); + // odebug << "change columns" << oendl; // TEWidget* te = getTe(); // if (te != 0) { // setColLin(columns,te->Lines()); // te->update(); // } } //FIXME: If a child dies during session swap, @@ -1408,17 +1409,17 @@ void Konsole::colorMenuIsSelected(int 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)); + // odebug << temp.sprintf("colormenu " << iD) << "" << oendl; TEWidget* te = getTe(); Config cfg( "Konsole" ); cfg.setGroup("Colors"); ColorEntry m_table[TABLE_COLORS]; const ColorEntry * defaultCt=te->getdefaultColorTable(); @@ -1524,17 +1525,17 @@ void Konsole::colorMenuSelected(int iD) background.setRgb(0x00,0x00,0x00); foreground.setRgb(255,215,105); colorMenu->setItemChecked(cm_ab,TRUE); } #ifdef QT_QWS_OPIE if(iD==-19) { // Custom - qDebug("do custom"); + odebug << "do custom" << oendl; if(fromMenu) { Opie::OColorPopupMenu* penColorPopupMenu = new Opie::OColorPopupMenu(Qt::black, this, "foreground color"); connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, SLOT(changeForegroundColor(const QColor&))); penColorPopupMenu->exec(); } if(!fromMenu) @@ -1629,17 +1630,17 @@ void Konsole::tabMenuSelected(int id) tabMenu->setItemChecked(id, true); tabPos = id; } void Konsole::configMenuSelected(int iD) { // QString temp; - // qDebug( temp.sprintf("configmenu %d",iD)); + // odebug << temp.sprintf("configmenu " << iD) << "" << oendl; TEWidget* te = getTe(); Config cfg( "Konsole" ); cfg.setGroup("Menubar"); if(iD == cm_wrap) { cfg.setGroup("ScrollBar"); bool b=cfg.readBoolEntry("HorzScroll",0); @@ -1699,17 +1700,17 @@ void Konsole::setColor(int sess) 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); + // odebug << "scrollbar menu " << index << "" << oendl; TEWidget* te = getTe(); Config cfg( "Konsole" ); cfg.setGroup("ScrollBar"); if(index == sm_none) { te->setScrollbarLocation(0); @@ -1743,17 +1744,17 @@ void Konsole::scrollMenuSelected(int index) // } // te->setScrollbarLocation( cfg.readNumEntry("Position",2)); // } // break; void Konsole::editCommandListMenuSelected(int iD) { // QString temp; - // qDebug( temp.sprintf("edit command list %d",iD)); + // odebug << temp.sprintf("edit command list " << iD) << "" << oendl; // FIXME: more cleanup needed here TEWidget* te = getTe(); Config cfg( "Konsole" ); cfg.setGroup("Menubar"); if( iD == ec_cmdlist) @@ -1784,17 +1785,17 @@ void Konsole::editCommandListMenuSelected(int iD) configMenu->setItemChecked(ec_edit,FALSE); commonCombo->setEditable( FALSE ); } } } if( iD == ec_quick) { cfg.setGroup("Commands"); - // qDebug("enableCommandEdit"); + // odebug << "enableCommandEdit" << oendl; if( !configMenu->isItemChecked(iD) ) { commonCombo->setEditable( TRUE ); configMenu->setItemChecked(iD,TRUE); commonCombo->setCurrentItem(0); cfg.writeEntry("EditEnabled","TRUE"); } else @@ -1872,40 +1873,40 @@ void Konsole::changeForegroundColor(const QColor &color) { 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()); + odebug << "foreground "+color.name() << oendl; cfg.write(); - qDebug("do other dialog"); + odebug << "do other dialog" << oendl; #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"); + odebug << "Change background" << oendl; 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()); + odebug << "background "+color.name() << oendl; cfg.write(); } void Konsole::doWrap() { Config cfg( "Konsole" ); cfg.setGroup("ScrollBar"); TEWidget* te = getTe(); |