summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/konsole.cpp
Side-by-side diff
Diffstat (limited to 'core/apps/embeddedkonsole/konsole.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp68
1 files changed, 40 insertions, 28 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index 5a68c81..ebff05e 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -368,12 +368,16 @@ void Konsole::init(const char* _pgm, QStrList & _args)
// scrollMenu->insertSeparator(4);
// scrollMenu->insertItem(tr( "Horizontal" ));
configMenu->insertItem(tr( "ScrollBar" ),scrollMenu);
configMenu->insertItem(tr( "Wrap" ));
+ int jut = configMenu->insertItem(tr( "Use Beep" ));
+ cfg.setGroup("Menubar");
+ configMenu->setItemChecked(jut, cfg.readBoolEntry("useBeep",0));
+
//scrollMenuSelected(-29);
// cfg.setGroup("ScrollBar");
// if(cfg.readBoolEntry("HorzScroll",0)) {
// if(cfg.readNumEntry("Position",2) == 0)
// te->setScrollbarLocation(1);
@@ -784,52 +788,61 @@ void Konsole::colorMenuSelected(int iD)
update();
}
void Konsole::configMenuSelected(int iD)
{
-// QString temp;
-// qDebug( temp.sprintf("configmenu %d",iD));
+// QString temp;
+// qDebug( temp.sprintf("configmenu %d",iD));
TEWidget* te = getTe();
Config cfg("Konsole");
cfg.setGroup("Menubar");
- if( iD == -4) {
- cfg.setGroup("Tabs");
- QString tmp=cfg.readEntry("Position","Bottom");
-
- if(tmp=="Top") {
- tab->setTabPosition(QTabWidget::Bottom);
- configMenu->changeItem( iD,"Tabs on Top");
- cfg.writeEntry("Position","Bottom");
- } else {
- tab->setTabPosition(QTabWidget::Top);
- configMenu->changeItem( iD,"Tabs on Bottom");
- cfg.writeEntry("Position","Top");
- }
- }
- int i;
+ int i,j;
#ifdef QWS_QT_OPIE
-i=-29;
+ i=-29;j=-30;
#else
-i=-28;
+ i=-28;j=-29;
#endif
- if( iD == i) {
- cfg.setGroup("ScrollBar");
+ if(iD == -4) {
+ cfg.setGroup("Tabs");
+ QString tmp=cfg.readEntry("Position","Bottom");
+
+ if(tmp=="Top") {
+ tab->setTabPosition(QTabWidget::Bottom);
+ configMenu->changeItem( iD,"Tabs on Top");
+ cfg.writeEntry("Position","Bottom");
+ } else {
+ tab->setTabPosition(QTabWidget::Top);
+ configMenu->changeItem( iD,"Tabs on Bottom");
+ cfg.writeEntry("Position","Top");
+ }
+ }
+ if(iD == i) {
+ 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);
}
te->setScrollbarLocation( cfg.readNumEntry("Position",2));
- }
+ }
+ if(iD == j) {
+ cfg.setGroup("Menubar");
+ bool b=cfg.readBoolEntry("useBeep",0);
+ b=!b;
+ cfg.writeEntry("useBeep", b );
+ cfg.write();
+ configMenu->setItemChecked(j,b);
+ te->useBeep=b;
+ }
}
void Konsole::changeCommand(const QString &text, int c)
{
Config cfg("Konsole");
cfg.setGroup("Commands");
@@ -978,15 +991,15 @@ void Konsole::parseCommandLine() {
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);
-// QString colors;
-// colors.sprintf("%d,%d,%d"color.red,color.green,color.blue);
+
cfg.writeEntry("foreground",color.name());
+ qDebug("foreground "+color.name());
cfg.write();
qDebug("do other dialog");
#ifdef QWS_QT_OPIE
ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color");
@@ -1001,15 +1014,14 @@ void Konsole::changeBackgroundColor(const QColor &color) {
qDebug("Change background");
Config cfg("Konsole");
cfg.setGroup("Colors");
int r, g, b;
color.rgb(&r,&g,&b);
background.setRgb(r,g,b);
-// QString colors;
-// colors.sprintf("%d,%d,%d"color.red,color.green,color.blue);
cfg.writeEntry("background",color.name());
+ qDebug("background "+color.name());
cfg.write();
}
void Konsole::doWrap() {
int i;
#ifdef QWS_QT_OPIE
@@ -1022,11 +1034,11 @@ i=-28;
cfg.setGroup("ScrollBar");
TEWidget* te = getTe();
if( !cfg.readBoolEntry("HorzScroll",0)) {
te->setWrapAt(0);
configMenu->setItemChecked( i,TRUE);
} else {
- te->setWrapAt(90);
-// te->setWrapAt(120);
+// te->setWrapAt(90);
+ te->setWrapAt(120);
configMenu->setItemChecked( i,FALSE);
}
}