summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rwxr-xr-xcore/apps/embeddedkonsole/embeddedkonsole.pro28
-rw-r--r--core/apps/embeddedkonsole/konsole.cpp68
-rw-r--r--core/apps/embeddedkonsole/konsole.h8
3 files changed, 85 insertions, 19 deletions
diff --git a/core/apps/embeddedkonsole/embeddedkonsole.pro b/core/apps/embeddedkonsole/embeddedkonsole.pro
index de0cfa1..6b7af27 100755
--- a/core/apps/embeddedkonsole/embeddedkonsole.pro
+++ b/core/apps/embeddedkonsole/embeddedkonsole.pro
@@ -33,3 +33,3 @@ INCLUDEPATH += $(OPIEDIR)/include
33DEPENDPATH += $(OPIEDIR)/include 33DEPENDPATH += $(OPIEDIR)/include
34LIBS += -lqpe 34LIBS += -lqpe -lopie
35REQUIRES = embeddedkonsole 35REQUIRES = embeddedkonsole
@@ -37,14 +37,14 @@ REQUIRES = embeddedkonsole
37TRANSLATIONS = ../../../i18n/de/embeddedkonsole.ts \ 37TRANSLATIONS = ../../../i18n/de/embeddedkonsole.ts \
38 ../../../i18n/en/embeddedkonsole.ts \ 38 ../../../i18n/en/embeddedkonsole.ts \
39 ../../../i18n/es/embeddedkonsole.ts \ 39 ../../../i18n/es/embeddedkonsole.ts \
40 ../../../i18n/fr/embeddedkonsole.ts \ 40 ../../../i18n/fr/embeddedkonsole.ts \
41 ../../../i18n/hu/embeddedkonsole.ts \ 41 ../../../i18n/hu/embeddedkonsole.ts \
42 ../../../i18n/ja/embeddedkonsole.ts \ 42 ../../../i18n/ja/embeddedkonsole.ts \
43 ../../../i18n/ko/embeddedkonsole.ts \ 43 ../../../i18n/ko/embeddedkonsole.ts \
44 ../../../i18n/no/embeddedkonsole.ts \ 44 ../../../i18n/no/embeddedkonsole.ts \
45 ../../../i18n/pl/embeddedkonsole.ts \ 45 ../../../i18n/pl/embeddedkonsole.ts \
46 ../../../i18n/pt/embeddedkonsole.ts \ 46 ../../../i18n/pt/embeddedkonsole.ts \
47 ../../../i18n/pt_BR/embeddedkonsole.ts \ 47 ../../../i18n/pt_BR/embeddedkonsole.ts \
48 ../../../i18n/sl/embeddedkonsole.ts \ 48 ../../../i18n/sl/embeddedkonsole.ts \
49 ../../../i18n/zh_CN/embeddedkonsole.ts \ 49 ../../../i18n/zh_CN/embeddedkonsole.ts \
50 ../../../i18n/zh_TW/embeddedkonsole.ts 50 ../../../i18n/zh_TW/embeddedkonsole.ts
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp
index b0d28fc..8b1e066 100644
--- a/core/apps/embeddedkonsole/konsole.cpp
+++ b/core/apps/embeddedkonsole/konsole.cpp
@@ -56,2 +56,4 @@
56 56
57#include <opie/colorpopupmenu.h>
58
57class EKNumTabBar : public QTabBar { 59class EKNumTabBar : public QTabBar {
@@ -208,2 +210,4 @@ void Konsole::init(const char* _pgm, QStrList & _args)
208 startUp=0; 210 startUp=0;
211 fromMenu = FALSE;
212
209 setCaption( tr("Terminal") ); 213 setCaption( tr("Terminal") );
@@ -290,2 +294,3 @@ void Konsole::init(const char* _pgm, QStrList & _args)
290 colorMenu->insertItem(tr( "Amber on Black")); 294 colorMenu->insertItem(tr( "Amber on Black"));
295 colorMenu->insertItem(tr( "Custom"));
291 configMenu->insertItem(tr( "Colors") ,colorMenu); 296 configMenu->insertItem(tr( "Colors") ,colorMenu);
@@ -294,3 +299,3 @@ void Konsole::init(const char* _pgm, QStrList & _args)
294 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); 299 connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) ));
295 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuSelected(int) )); 300 connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) ));
296 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); 301 connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int)));
@@ -616,2 +621,7 @@ void Konsole::switchSession(QWidget* w) {
616 621
622void Konsole::colorMenuIsSelected(int iD) {
623 fromMenu = TRUE;
624 colorMenuSelected(iD);
625}
626
617/// ------------------------------- some new stuff by L.J. Potter 627/// ------------------------------- some new stuff by L.J. Potter
@@ -624,4 +634,4 @@ void Konsole::colorMenuSelected(int iD)
624 cfg.setGroup("Colors"); 634 cfg.setGroup("Colors");
625 QColor foreground; 635// QColor foreground;
626 QColor background; 636// QColor background;
627 colorMenu->setItemChecked(lastSelectedMenu,FALSE); 637 colorMenu->setItemChecked(lastSelectedMenu,FALSE);
@@ -636,3 +646,3 @@ void Konsole::colorMenuSelected(int iD)
636 m_table[i].transparent=1; 646 m_table[i].transparent=1;
637 cfg.writeEntry("Schema","98"); 647 cfg.writeEntry("Schema","9");
638 colorMenu->setItemChecked(-9,TRUE); 648 colorMenu->setItemChecked(-9,TRUE);
@@ -714,2 +724,18 @@ void Konsole::colorMenuSelected(int iD)
714 } 724 }
725 if(iD==-19) {// Custom
726 qDebug("do custom");
727 if(fromMenu) {
728 ColorPopupMenu* penColorPopupMenu = new ColorPopupMenu(Qt::black, this, "foreground color");
729 connect(penColorPopupMenu, SIGNAL(colorSelected(const QColor&)), this,
730 SLOT(changeForegroundColor(const QColor&)));
731 penColorPopupMenu->exec();
732 }
733 cfg.writeEntry("Schema","19");
734 if(!fromMenu) {
735 foreground.setNamedColor(cfg.readEntry("foreground",""));
736 background.setNamedColor(cfg.readEntry("background",""));
737 }
738 fromMenu=FALSE;
739 colorMenu->setItemChecked(-19,TRUE);
740 }
715 741
@@ -729,2 +755,3 @@ void Konsole::colorMenuSelected(int iD)
729 update(); 755 update();
756
730} 757}
@@ -887 +914,34 @@ void Konsole::parseCommandLine() {
887} 914}
915
916void Konsole::changeForegroundColor(const QColor &color) {
917 Config cfg("Konsole");
918 cfg.setGroup("Colors");
919 int r, g, b;
920 color.rgb(&r,&g,&b);
921 foreground.setRgb(r,g,b);
922// QString colors;
923// colors.sprintf("%d,%d,%d"color.red,color.green,color.blue);
924 cfg.writeEntry("foreground",color.name());
925 cfg.write();
926
927qDebug("do other dialog");
928 ColorPopupMenu* penColorPopupMenu2 = new ColorPopupMenu(Qt::black, this,"background color");
929 connect(penColorPopupMenu2, SIGNAL(colorSelected(const QColor&)), this,
930 SLOT(changeBackgroundColor(const QColor&)));
931 penColorPopupMenu2->exec();
932
933}
934
935void Konsole::changeBackgroundColor(const QColor &color) {
936
937 qDebug("Change background");
938 Config cfg("Konsole");
939 cfg.setGroup("Colors");
940 int r, g, b;
941 color.rgb(&r,&g,&b);
942 background.setRgb(r,g,b);
943// QString colors;
944// colors.sprintf("%d,%d,%d"color.red,color.green,color.blue);
945 cfg.writeEntry("background",color.name());
946 cfg.write();
947}
diff --git a/core/apps/embeddedkonsole/konsole.h b/core/apps/embeddedkonsole/konsole.h
index 40edaec..0bf3fb3 100644
--- a/core/apps/embeddedkonsole/konsole.h
+++ b/core/apps/embeddedkonsole/konsole.h
@@ -34,2 +34,3 @@
34#include <qcombobox.h> 34#include <qcombobox.h>
35#include <qcolor.h>
35 36
@@ -64,2 +65,3 @@ private slots:
64 void colorMenuSelected(int); 65 void colorMenuSelected(int);
66 void colorMenuIsSelected(int);
65 void enterCommand(int); 67 void enterCommand(int);
@@ -78,2 +80,4 @@ private slots:
78 void parseCommandLine(); 80 void parseCommandLine();
81 void changeForegroundColor(const QColor &);
82 void changeBackgroundColor(const QColor &);
79private: 83private:
@@ -87,3 +91,5 @@ private:
87 QStringList commands; 91 QStringList commands;
88 92 QLabel * msgLabel;
93 QColor foreground, background;
94bool fromMenu;
89private: 95private: