summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/konsole.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp41
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
@@ -28,8 +28,9 @@
28#include <unistd.h> 28#include <unistd.h>
29 29
30#ifdef QT_QWS_OPIE 30#ifdef QT_QWS_OPIE
31#include <opie2/ocolorpopupmenu.h> 31#include <opie2/ocolorpopupmenu.h>
32#include <opie2/odebug.h>
32using namespace Opie; 33using namespace Opie;
33#endif 34#endif
34 35
35#include <qpe/resource.h> 36#include <qpe/resource.h>
@@ -203,22 +204,22 @@ static const char *commonCmds[] =
203 }; 204 };
204 205
205 206
206static void konsoleInit(const char** shell) { 207static void konsoleInit(const char** shell) {
207 if(setuid(getuid()) !=0) qDebug("setuid failed"); 208 if(setuid(getuid()) !=0) odebug << "setuid failed" << oendl;
208 if(setgid(getgid()) != 0) qDebug("setgid failed"); // drop privileges 209 if(setgid(getgid()) != 0) odebug << "setgid failed" << oendl; // drop privileges
209 210
210 211
211// QPEApplication::grabKeyboard(); // for CTRL and ALT 212// QPEApplication::grabKeyboard(); // for CTRL and ALT
212 213
213 qDebug("keyboard grabbed"); 214 odebug << "keyboard grabbed" << oendl;
214#ifdef FAKE_CTRL_AND_ALT 215#ifdef FAKE_CTRL_AND_ALT
215 qDebug("Fake Ctrl and Alt defined"); 216 odebug << "Fake Ctrl and Alt defined" << oendl;
216 QPEApplication::grabKeyboard(); // for CTRL and ALT 217 QPEApplication::grabKeyboard(); // for CTRL and ALT
217#endif 218#endif
218 219
219 *shell = getenv("SHELL"); 220 *shell = getenv("SHELL");
220 qWarning("SHell initially is %s", *shell ); 221 owarn << "SHell initially is " << *shell << "" << oendl;
221 222
222 if (shell == NULL || *shell == '\0') { 223 if (shell == NULL || *shell == '\0') {
223 struct passwd *ent = 0; 224 struct passwd *ent = 0;
224 uid_t me = getuid(); 225 uid_t me = getuid();
@@ -234,9 +235,9 @@ static void konsoleInit(const char** shell) {
234 endpwent(); 235 endpwent();
235 } 236 }
236 237
237 if( putenv((char*)"COLORTERM=") !=0) 238 if( putenv((char*)"COLORTERM=") !=0)
238 qDebug("putenv failed"); // to trigger mc's color detection 239 odebug << "putenv failed" << oendl; // to trigger mc's color detection
239} 240}
240 241
241 242
242Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) : 243Konsole::Konsole(QWidget* parent, const char* name, WFlags fl) :
@@ -280,9 +281,9 @@ class HistoryList : public QList<HistoryItem>
280}; 281};
281 282
282void Konsole::initCommandList() 283void Konsole::initCommandList()
283{ 284{
284 // qDebug("Konsole::initCommandList"); 285 // odebug << "Konsole::initCommandList" << oendl;
285 Config cfg( "Konsole" ); 286 Config cfg( "Konsole" );
286 cfg.setGroup("Commands"); 287 cfg.setGroup("Commands");
287 // commonCombo->setInsertionPolicy(QComboBox::AtCurrent); 288 // commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
288 commonCombo->clear(); 289 commonCombo->clear();
@@ -512,9 +513,9 @@ void Konsole::init(const char* _pgm, QStrList & _args)
512 513
513 setFont(cfont); 514 setFont(cfont);
514 515
515 configMenu = new QPopupMenu( this); 516 configMenu = new QPopupMenu( this);
516 colorMenu = new QPopupMenu( this); 517 colorMenu = new QPopupMenu( this);
517 scrollMenu = new QPopupMenu( this); 518 scrollMenu = new QPopupMenu( this);
518 editCommandListMenu = new QPopupMenu( this); 519 editCommandListMenu = new QPopupMenu( this);
519 520
520 configMenu->insertItem(tr("Command List"), editCommandListMenu); 521 configMenu->insertItem(tr("Command List"), editCommandListMenu);
@@ -1066,9 +1067,9 @@ QSize Konsole::calcSize(int columns, int lines)
1066*/ 1067*/
1067 1068
1068void Konsole::setColLin(int columns, int lines) 1069void Konsole::setColLin(int columns, int lines)
1069{ 1070{
1070 qDebug("konsole::setColLin:: Columns %d", columns); 1071 odebug << "konsole::setColLin:: Columns " << columns << "" << oendl;
1071 1072
1072 if ((columns==0) || (lines==0)) 1073 if ((columns==0) || (lines==0))
1073 { 1074 {
1074 if (defaultSize.isEmpty()) // not in config file : set default value 1075 if (defaultSize.isEmpty()) // not in config file : set default value
@@ -1114,9 +1115,9 @@ void Konsole::setFont(int fontno)
1114// --| color selection |------------------------------------------------------- 1115// --| color selection |-------------------------------------------------------
1115 1116
1116void Konsole::changeColumns(int /*columns*/) 1117void Konsole::changeColumns(int /*columns*/)
1117{ //FIXME this seems to cause silliness when reset command is executed 1118{ //FIXME this seems to cause silliness when reset command is executed
1118 // qDebug("change columns"); 1119 // odebug << "change columns" << oendl;
1119 // TEWidget* te = getTe(); 1120 // TEWidget* te = getTe();
1120 // if (te != 0) { 1121 // if (te != 0) {
1121 // setColLin(columns,te->Lines()); 1122 // setColLin(columns,te->Lines());
1122 // te->update(); 1123 // te->update();
@@ -1412,9 +1413,9 @@ void Konsole::colorMenuIsSelected(int iD)
1412void Konsole::colorMenuSelected(int iD) 1413void Konsole::colorMenuSelected(int iD)
1413{ 1414{
1414 // this is NOT pretty, elegant or anything else besides functional 1415 // this is NOT pretty, elegant or anything else besides functional
1415 // QString temp; 1416 // QString temp;
1416 // qDebug( temp.sprintf("colormenu %d", iD)); 1417 // odebug << temp.sprintf("colormenu " << iD) << "" << oendl;
1417 1418
1418 TEWidget* te = getTe(); 1419 TEWidget* te = getTe();
1419 Config cfg( "Konsole" ); 1420 Config cfg( "Konsole" );
1420 cfg.setGroup("Colors"); 1421 cfg.setGroup("Colors");
@@ -1528,9 +1529,9 @@ void Konsole::colorMenuSelected(int iD)
1528#ifdef QT_QWS_OPIE 1529#ifdef QT_QWS_OPIE
1529 if(iD==-19) 1530 if(iD==-19)
1530 { 1531 {
1531 // Custom 1532 // Custom
1532 qDebug("do custom"); 1533 odebug << "do custom" << oendl;
1533 if(fromMenu) 1534 if(fromMenu)
1534 { 1535 {
1535 Opie::OColorPopupMenu* penColorPopupMenu = new Opie::OColorPopupMenu(Qt::black, this, "foreground color"); 1536 Opie::OColorPopupMenu* penColorPopupMenu = new Opie::OColorPopupMenu(Qt::black, this, "foreground color");
1536 connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this, 1537 connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this,
@@ -1633,9 +1634,9 @@ void Konsole::tabMenuSelected(int id)
1633 1634
1634void Konsole::configMenuSelected(int iD) 1635void Konsole::configMenuSelected(int iD)
1635{ 1636{
1636 // QString temp; 1637 // QString temp;
1637 // qDebug( temp.sprintf("configmenu %d",iD)); 1638 // odebug << temp.sprintf("configmenu " << iD) << "" << oendl;
1638 1639
1639 TEWidget* te = getTe(); 1640 TEWidget* te = getTe();
1640 Config cfg( "Konsole" ); 1641 Config cfg( "Konsole" );
1641 cfg.setGroup("Menubar"); 1642 cfg.setGroup("Menubar");
@@ -1703,9 +1704,9 @@ void Konsole::setColor(int sess)
1703} 1704}
1704 1705
1705void Konsole::scrollMenuSelected(int index) 1706void Konsole::scrollMenuSelected(int index)
1706{ 1707{
1707 // qDebug( "scrollbar menu %d",index); 1708 // odebug << "scrollbar menu " << index << "" << oendl;
1708 1709
1709 TEWidget* te = getTe(); 1710 TEWidget* te = getTe();
1710 Config cfg( "Konsole" ); 1711 Config cfg( "Konsole" );
1711 cfg.setGroup("ScrollBar"); 1712 cfg.setGroup("ScrollBar");
@@ -1747,9 +1748,9 @@ void Konsole::scrollMenuSelected(int index)
1747 1748
1748void Konsole::editCommandListMenuSelected(int iD) 1749void Konsole::editCommandListMenuSelected(int iD)
1749{ 1750{
1750 // QString temp; 1751 // QString temp;
1751 // qDebug( temp.sprintf("edit command list %d",iD)); 1752 // odebug << temp.sprintf("edit command list " << iD) << "" << oendl;
1752 1753
1753 // FIXME: more cleanup needed here 1754 // FIXME: more cleanup needed here
1754 1755
1755 1756
@@ -1788,9 +1789,9 @@ void Konsole::editCommandListMenuSelected(int iD)
1788 } 1789 }
1789 if( iD == ec_quick) 1790 if( iD == ec_quick)
1790 { 1791 {
1791 cfg.setGroup("Commands"); 1792 cfg.setGroup("Commands");
1792 // qDebug("enableCommandEdit"); 1793 // odebug << "enableCommandEdit" << oendl;
1793 if( !configMenu->isItemChecked(iD) ) 1794 if( !configMenu->isItemChecked(iD) )
1794 { 1795 {
1795 commonCombo->setEditable( TRUE ); 1796 commonCombo->setEditable( TRUE );
1796 configMenu->setItemChecked(iD,TRUE); 1797 configMenu->setItemChecked(iD,TRUE);
@@ -1876,12 +1877,12 @@ void Konsole::changeForegroundColor(const QColor &color)
1876 color.rgb(&r,&g,&b); 1877 color.rgb(&r,&g,&b);
1877 foreground.setRgb(r,g,b); 1878 foreground.setRgb(r,g,b);
1878 1879
1879 cfg.writeEntry("foreground",color.name()); 1880 cfg.writeEntry("foreground",color.name());
1880 qDebug("foreground "+color.name()); 1881 odebug << "foreground "+color.name() << oendl;
1881 cfg.write(); 1882 cfg.write();
1882 1883
1883 qDebug("do other dialog"); 1884 odebug << "do other dialog" << oendl;
1884#ifdef QT_QWS_OPIE 1885#ifdef QT_QWS_OPIE
1885 1886
1886 Opie::OColorPopupMenu* penColorPopupMenu2 = new Opie::OColorPopupMenu(Qt::black, this,"background color"); 1887 Opie::OColorPopupMenu* penColorPopupMenu2 = new Opie::OColorPopupMenu(Qt::black, this,"background color");
1887 connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this, 1888 connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this,
@@ -1892,16 +1893,16 @@ void Konsole::changeForegroundColor(const QColor &color)
1892 1893
1893void Konsole::changeBackgroundColor(const QColor &color) 1894void Konsole::changeBackgroundColor(const QColor &color)
1894{ 1895{
1895 1896
1896 qDebug("Change background"); 1897 odebug << "Change background" << oendl;
1897 Config cfg( "Konsole" ); 1898 Config cfg( "Konsole" );
1898 cfg.setGroup("Colors"); 1899 cfg.setGroup("Colors");
1899 int r, g, b; 1900 int r, g, b;
1900 color.rgb(&r,&g,&b); 1901 color.rgb(&r,&g,&b);
1901 background.setRgb(r,g,b); 1902 background.setRgb(r,g,b);
1902 cfg.writeEntry("background",color.name()); 1903 cfg.writeEntry("background",color.name());
1903 qDebug("background "+color.name()); 1904 odebug << "background "+color.name() << oendl;
1904 cfg.write(); 1905 cfg.write();
1905} 1906}
1906 1907
1907void Konsole::doWrap() 1908void Konsole::doWrap()