summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp43
1 files changed, 34 insertions, 9 deletions
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index 16db0ea..06bee33 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -18,8 +18,9 @@
/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
/* */
/* -------------------------------------------------------------------------- */
// enhancements added by L.J. Potter <ljp@llornkcor.com>
+#define QWS_QT_OPIE
#include <qpe/resource.h>
#include <qdir.h>
@@ -53,9 +54,11 @@
#include "konsole.h"
#include "keytrans.h"
#include "commandeditdialog.h"
+#ifdef QWS_QT_OPIE
#include <opie/colorpopupmenu.h>
+#endif
class EKNumTabBar : public QTabBar {
public:
void numberTabs()
@@ -291,9 +294,13 @@ void Konsole::init(const char* _pgm, QStrList & _args)
colorMenu->insertItem(tr( "Cyan on White"));
colorMenu->insertItem(tr( "White on Cyan"));
colorMenu->insertItem(tr( "Blue on Black"));
colorMenu->insertItem(tr( "Amber on Black"));
+
+#ifdef QWS_QT_OPIE
colorMenu->insertItem(tr( "Custom"));
+#endif
+
configMenu->insertItem(tr( "Colors") ,colorMenu);
connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) ));
connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) ));
@@ -741,9 +748,11 @@ void Konsole::colorMenuSelected(int iD)
foreground.setRgb(255,215,0);
cfg.writeEntry("Schema","18");
colorMenu->setItemChecked(-18,TRUE);
}
- if(iD==-19) {// Custom
+#ifdef QWS_QT_OPIE
+ if(iD==-19) {
+// Custom
qDebug("do custom");
if(fromMenu) {
ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color");
connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this,
@@ -757,9 +766,9 @@ void Konsole::colorMenuSelected(int iD)
}
fromMenu=FALSE;
colorMenu->setItemChecked(-19,TRUE);
}
-
+#endif
for (i = 0; i < TABLE_COLORS; i++) {
if(i==0 || i == 10) {
m_table[i].color = foreground;
}
@@ -777,10 +786,10 @@ void Konsole::colorMenuSelected(int iD)
}
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) {
@@ -796,9 +805,16 @@ void Konsole::configMenuSelected(int iD)
configMenu->changeItem( iD,"Tabs on Bottom");
cfg.writeEntry("Position","Top");
}
}
- if( iD == -29) {
+ int i;
+#ifdef QWS_QT_OPIE
+i=-29;
+#else
+i=-28;
+#endif
+
+ if( iD == i) {
cfg.setGroup("ScrollBar");
bool b=cfg.readBoolEntry("HorzScroll",0);
b=!b;
cfg.writeEntry("HorzScroll", b );
@@ -970,13 +986,15 @@ void Konsole::changeForegroundColor(const QColor &color) {
cfg.writeEntry("foreground",color.name());
cfg.write();
qDebug("do other dialog");
+#ifdef QWS_QT_OPIE
+
ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(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) {
@@ -992,16 +1010,23 @@ void Konsole::changeBackgroundColor(const QColor &color) {
cfg.write();
}
void Konsole::doWrap() {
- Config cfg("Konsole");
+int i;
+#ifdef QWS_QT_OPIE
+i=-29;
+#else
+i=-28;
+#endif
+
+ Config cfg("Konsole");
cfg.setGroup("ScrollBar");
TEWidget* te = getTe();
if( !cfg.readBoolEntry("HorzScroll",0)) {
te->setWrapAt(0);
- configMenu->setItemChecked(-29,FALSE);
+ configMenu->setItemChecked( i,FALSE);
} else {
te->setWrapAt(90);
// te->setWrapAt(120);
- configMenu->setItemChecked(-29,TRUE);
+ configMenu->setItemChecked( i,TRUE);
}
}