summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/konsole.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp31
1 files changed, 16 insertions, 15 deletions
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
@@ -19,8 +19,9 @@
19/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ 19/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
20/* */ 20/* */
21/* -------------------------------------------------------------------------- */ 21/* -------------------------------------------------------------------------- */
22// enhancements added by L.J. Potter <ljp@llornkcor.com> 22// enhancements added by L.J. Potter <ljp@llornkcor.com>
23// enhancements added by Phillip Kuhn
23//#define QT_QWS_OPIE 24//#define QT_QWS_OPIE
24 25
25#include <stdlib.h> 26#include <stdlib.h>
26 27
@@ -260,9 +261,9 @@ class HistoryList : public QList<HistoryItem>
260 261
261void Konsole::initCommandList() 262void Konsole::initCommandList()
262{ 263{
263 // qDebug("Konsole::initCommandList"); 264 // qDebug("Konsole::initCommandList");
264 Config cfg("Qkonsole"); 265 Config cfg( "Konsole" );
265 cfg.setGroup("Commands"); 266 cfg.setGroup("Commands");
266 // commonCombo->setInsertionPolicy(QComboBox::AtCurrent); 267 // commonCombo->setInsertionPolicy(QComboBox::AtCurrent);
267 commonCombo->clear(); 268 commonCombo->clear();
268 269
@@ -370,9 +371,9 @@ void Konsole::init(const char* _pgm, QStrList & _args)
370 371
371 setCaption( "Qkonsole" ); 372 setCaption( "Qkonsole" );
372 setIcon( Resource::loadPixmap( "qkonsole/qkonsole" ) ); 373 setIcon( Resource::loadPixmap( "qkonsole/qkonsole" ) );
373 374
374 Config cfg("Qkonsole"); 375 Config cfg( "Konsole" );
375 cfg.setGroup("Font"); 376 cfg.setGroup("Font");
376 QString tmp; 377 QString tmp;
377 378
378 // initialize the list of allowed fonts /////////////////////////////////// 379 // initialize the list of allowed fonts ///////////////////////////////////
@@ -783,9 +784,9 @@ Konsole::historyDialog()
783 784
784 QLabel *l = new QLabel ( tr( "History Lines:" ), d ); 785 QLabel *l = new QLabel ( tr( "History Lines:" ), d );
785 lay-> addWidget ( l ); 786 lay-> addWidget ( l );
786 787
787 Config cfg("Qkonsole"); 788 Config cfg( "Konsole" );
788 cfg.setGroup("History"); 789 cfg.setGroup("History");
789 int hist = cfg.readNumEntry("history_lines",300); 790 int hist = cfg.readNumEntry("history_lines",300);
790 int avg_line = cfg.readNumEntry("avg_line_length",60); 791 int avg_line = cfg.readNumEntry("avg_line_length",60);
791 792
@@ -926,9 +927,9 @@ void Konsole::setFont(int f)
926 { 927 {
927 fontList->setItemChecked(i, fonts.at(i)->getFamilyNum() == familyNum 928 fontList->setItemChecked(i, fonts.at(i)->getFamilyNum() == familyNum
928 && fonts.at(i)->getSize() == size); 929 && fonts.at(i)->getSize() == size);
929 } 930 }
930 Config cfg("Qkonsole"); 931 Config cfg( "Konsole" );
931 cfg.setGroup("Font"); 932 cfg.setGroup("Font");
932 QString ss = "Session"+ QString::number(tab->currentPageIndex()+1); 933 QString ss = "Session"+ QString::number(tab->currentPageIndex()+1);
933 if (tab->currentPageIndex() == 0) 934 if (tab->currentPageIndex() == 0)
934 { 935 {
@@ -1171,9 +1172,9 @@ void Konsole::newSession()
1171{ 1172{
1172 if(nsessions < 15) 1173 if(nsessions < 15)
1173 { // seems to be something weird about 16 tabs on the Zaurus.... memory? 1174 { // seems to be something weird about 16 tabs on the Zaurus.... memory?
1174 TEWidget* te = new TEWidget(tab); 1175 TEWidget* te = new TEWidget(tab);
1175 Config cfg("Qkonsole"); 1176 Config cfg( "Konsole" );
1176 cfg.setGroup("Menubar"); 1177 cfg.setGroup("Menubar");
1177 1178
1178 // FIXME use more defaults from config file 1179 // FIXME use more defaults from config file
1179 te->useBeep=cfg.readBoolEntry("useBeep",0); 1180 te->useBeep=cfg.readBoolEntry("useBeep",0);
@@ -1410,9 +1411,9 @@ void Konsole::colorMenuSelected(int iD)
1410 // QString temp; 1411 // QString temp;
1411 // qDebug( temp.sprintf("colormenu %d", iD)); 1412 // qDebug( temp.sprintf("colormenu %d", iD));
1412 1413
1413 TEWidget* te = getTe(); 1414 TEWidget* te = getTe();
1414 Config cfg("Qkonsole"); 1415 Config cfg( "Konsole" );
1415 cfg.setGroup("Colors"); 1416 cfg.setGroup("Colors");
1416 1417
1417 ColorEntry m_table[TABLE_COLORS]; 1418 ColorEntry m_table[TABLE_COLORS];
1418 const ColorEntry * defaultCt=te->getdefaultColorTable(); 1419 const ColorEntry * defaultCt=te->getdefaultColorTable();
@@ -1594,9 +1595,9 @@ void Konsole::setColors(QColor foreground, QColor background)
1594} 1595}
1595 1596
1596void Konsole::tabMenuSelected(int id) 1597void Konsole::tabMenuSelected(int id)
1597{ 1598{
1598 Config cfg("Qkonsole"); 1599 Config cfg( "Konsole" );
1599 cfg.setGroup("Tabs"); 1600 cfg.setGroup("Tabs");
1600 tabMenu->setItemChecked(tabPos, false); 1601 tabMenu->setItemChecked(tabPos, false);
1601 if (id == tm_bottom) 1602 if (id == tm_bottom)
1602 { 1603 {
@@ -1631,9 +1632,9 @@ void Konsole::configMenuSelected(int iD)
1631 // QString temp; 1632 // QString temp;
1632 // qDebug( temp.sprintf("configmenu %d",iD)); 1633 // qDebug( temp.sprintf("configmenu %d",iD));
1633 1634
1634 TEWidget* te = getTe(); 1635 TEWidget* te = getTe();
1635 Config cfg("Qkonsole"); 1636 Config cfg( "Konsole" );
1636 cfg.setGroup("Menubar"); 1637 cfg.setGroup("Menubar");
1637 if(iD == cm_wrap) 1638 if(iD == cm_wrap)
1638 { 1639 {
1639 cfg.setGroup("ScrollBar"); 1640 cfg.setGroup("ScrollBar");
@@ -1665,9 +1666,9 @@ void Konsole::configMenuSelected(int iD)
1665} 1666}
1666 1667
1667void Konsole::changeCommand(const QString &text, int c) 1668void Konsole::changeCommand(const QString &text, int c)
1668{ 1669{
1669 Config cfg("Qkonsole"); 1670 Config cfg( "Konsole" );
1670 cfg.setGroup("Commands"); 1671 cfg.setGroup("Commands");
1671 if(commonCmds[c] != text) 1672 if(commonCmds[c] != text)
1672 { 1673 {
1673 cfg.writeEntry(QString::number(c),text); 1674 cfg.writeEntry(QString::number(c),text);
@@ -1677,9 +1678,9 @@ void Konsole::changeCommand(const QString &text, int c)
1677} 1678}
1678 1679
1679void Konsole::setColor(int sess) 1680void Konsole::setColor(int sess)
1680{ 1681{
1681 Config cfg("Qkonsole"); 1682 Config cfg( "Konsole" );
1682 cfg.setGroup("Colors"); 1683 cfg.setGroup("Colors");
1683 QColor foreground, background; 1684 QColor foreground, background;
1684 QString ss = QString("Session") + QString::number(sess); 1685 QString ss = QString("Session") + QString::number(sess);
1685 foreground.setRgb(cfg.readNumEntry("foregroundRed"+ss, 1686 foreground.setRgb(cfg.readNumEntry("foregroundRed"+ss,
@@ -1701,9 +1702,9 @@ void Konsole::scrollMenuSelected(int index)
1701{ 1702{
1702 // qDebug( "scrollbar menu %d",index); 1703 // qDebug( "scrollbar menu %d",index);
1703 1704
1704 TEWidget* te = getTe(); 1705 TEWidget* te = getTe();
1705 Config cfg("Qkonsole"); 1706 Config cfg( "Konsole" );
1706 cfg.setGroup("ScrollBar"); 1707 cfg.setGroup("ScrollBar");
1707 1708
1708 if(index == sm_none) 1709 if(index == sm_none)
1709 { 1710 {
@@ -1748,9 +1749,9 @@ void Konsole::editCommandListMenuSelected(int iD)
1748 // FIXME: more cleanup needed here 1749 // FIXME: more cleanup needed here
1749 1750
1750 1751
1751 TEWidget* te = getTe(); 1752 TEWidget* te = getTe();
1752 Config cfg("Qkonsole"); 1753 Config cfg( "Konsole" );
1753 cfg.setGroup("Menubar"); 1754 cfg.setGroup("Menubar");
1754 if( iD == ec_cmdlist) 1755 if( iD == ec_cmdlist)
1755 { 1756 {
1756 if(!secondToolBar->isHidden()) 1757 if(!secondToolBar->isHidden())
@@ -1864,9 +1865,9 @@ void Konsole::parseCommandLine()
1864} 1865}
1865 1866
1866void Konsole::changeForegroundColor(const QColor &color) 1867void Konsole::changeForegroundColor(const QColor &color)
1867{ 1868{
1868 Config cfg("Qkonsole"); 1869 Config cfg( "Konsole" );
1869 cfg.setGroup("Colors"); 1870 cfg.setGroup("Colors");
1870 int r, g, b; 1871 int r, g, b;
1871 color.rgb(&r,&g,&b); 1872 color.rgb(&r,&g,&b);
1872 foreground.setRgb(r,g,b); 1873 foreground.setRgb(r,g,b);
@@ -1888,9 +1889,9 @@ void Konsole::changeForegroundColor(const QColor &color)
1888void Konsole::changeBackgroundColor(const QColor &color) 1889void Konsole::changeBackgroundColor(const QColor &color)
1889{ 1890{
1890 1891
1891 qDebug("Change background"); 1892 qDebug("Change background");
1892 Config cfg("Qkonsole"); 1893 Config cfg( "Konsole" );
1893 cfg.setGroup("Colors"); 1894 cfg.setGroup("Colors");
1894 int r, g, b; 1895 int r, g, b;
1895 color.rgb(&r,&g,&b); 1896 color.rgb(&r,&g,&b);
1896 background.setRgb(r,g,b); 1897 background.setRgb(r,g,b);
@@ -1900,9 +1901,9 @@ void Konsole::changeBackgroundColor(const QColor &color)
1900} 1901}
1901 1902
1902void Konsole::doWrap() 1903void Konsole::doWrap()
1903{ 1904{
1904 Config cfg("Qkonsole"); 1905 Config cfg( "Konsole" );
1905 cfg.setGroup("ScrollBar"); 1906 cfg.setGroup("ScrollBar");
1906 TEWidget* te = getTe(); 1907 TEWidget* te = getTe();
1907 if( !cfg.readBoolEntry("HorzScroll",0)) 1908 if( !cfg.readBoolEntry("HorzScroll",0))
1908 { 1909 {