author | drw <drw> | 2005-04-15 17:51:00 (UTC) |
---|---|---|
committer | drw <drw> | 2005-04-15 17:51:00 (UTC) |
commit | ba9d5ecee89aadb135a03c173878e315de784be3 (patch) (unidiff) | |
tree | 176d774bebfaa1d016a56fa8c00be79a2ea19fa5 | |
parent | 86b1feed1ab2e47a082d974e1fcc513c59a74469 (diff) | |
download | opie-ba9d5ecee89aadb135a03c173878e315de784be3.zip opie-ba9d5ecee89aadb135a03c173878e315de784be3.tar.gz opie-ba9d5ecee89aadb135a03c173878e315de784be3.tar.bz2 |
Resource -> OResource
-rw-r--r-- | core/apps/embeddedkonsole/commandeditdialog.cpp | 23 | ||||
-rw-r--r-- | core/apps/embeddedkonsole/konsole.cpp | 37 |
2 files changed, 39 insertions, 21 deletions
diff --git a/core/apps/embeddedkonsole/commandeditdialog.cpp b/core/apps/embeddedkonsole/commandeditdialog.cpp index 697bf72..1e08767 100644 --- a/core/apps/embeddedkonsole/commandeditdialog.cpp +++ b/core/apps/embeddedkonsole/commandeditdialog.cpp | |||
@@ -1,147 +1,156 @@ | |||
1 | //comandeditdialog.cpp | 1 | //comandeditdialog.cpp |
2 | 2 | ||
3 | #include "commandeditdialog.h" | 3 | #include "commandeditdialog.h" |
4 | #include "playlistselection.h" | 4 | #include "playlistselection.h" |
5 | |||
6 | #include <opie2/oresource.h> | ||
7 | |||
5 | #include <qpe/config.h> | 8 | #include <qpe/config.h> |
6 | #include <qpe/resource.h> | 9 | |
10 | #include <qapplication.h> | ||
7 | #include <qtoolbutton.h> | 11 | #include <qtoolbutton.h> |
8 | #include <qlineedit.h> | 12 | #include <qlineedit.h> |
9 | #include <qheader.h> | 13 | #include <qheader.h> |
10 | #include <qlabel.h> | 14 | #include <qlabel.h> |
11 | #include "smallcommandeditdialogbase.h" | 15 | #include "smallcommandeditdialogbase.h" |
12 | 16 | ||
13 | CommandEditDialog::CommandEditDialog(QWidget *parent, const char* name, WFlags fl ) | 17 | CommandEditDialog::CommandEditDialog(QWidget *parent, const char* name, WFlags fl ) |
14 | : CommandEditDialogBase(parent, name, TRUE, fl) | 18 | : CommandEditDialogBase(parent, name, TRUE, fl) |
15 | 19 | ||
16 | { | 20 | { |
17 | m_SuggestedCommandList->addColumn( tr("Command Selection") ); | 21 | m_SuggestedCommandList->addColumn( tr("Command Selection") ); |
18 | m_SuggestedCommandList->header()->hide(); | 22 | m_SuggestedCommandList->header()->hide(); |
19 | m_SuggestedCommandList->setSorting(-1,FALSE); | 23 | m_SuggestedCommandList->setSorting(-1,FALSE); |
20 | m_SuggestedCommandList->clearSelection(); | 24 | m_SuggestedCommandList->clearSelection(); |
21 | m_SuggestedCommandList->setSorting(0,TRUE); | 25 | m_SuggestedCommandList->setSorting(0,TRUE); |
22 | QListViewItem *item; | 26 | QListViewItem *item; |
23 | item = new QListViewItem( m_SuggestedCommandList,"export "); | 27 | item = new QListViewItem( m_SuggestedCommandList,"export "); |
24 | item = new QListViewItem( m_SuggestedCommandList,"ifconfig "); | 28 | item = new QListViewItem( m_SuggestedCommandList,"ifconfig "); |
25 | item = new QListViewItem( m_SuggestedCommandList,"ipkg "); | 29 | item = new QListViewItem( m_SuggestedCommandList,"ipkg "); |
26 | item = new QListViewItem( m_SuggestedCommandList,"gzip "); | 30 | item = new QListViewItem( m_SuggestedCommandList,"gzip "); |
27 | item = new QListViewItem( m_SuggestedCommandList,"gunzip "); | 31 | item = new QListViewItem( m_SuggestedCommandList,"gunzip "); |
28 | item = new QListViewItem( m_SuggestedCommandList,"chgrp "); | 32 | item = new QListViewItem( m_SuggestedCommandList,"chgrp "); |
29 | item = new QListViewItem( m_SuggestedCommandList,"chown "); | 33 | item = new QListViewItem( m_SuggestedCommandList,"chown "); |
30 | item = new QListViewItem( m_SuggestedCommandList,"date "); | 34 | item = new QListViewItem( m_SuggestedCommandList,"date "); |
31 | item = new QListViewItem( m_SuggestedCommandList,"dd "); | 35 | item = new QListViewItem( m_SuggestedCommandList,"dd "); |
32 | item = new QListViewItem( m_SuggestedCommandList,"dmesg "); | 36 | item = new QListViewItem( m_SuggestedCommandList,"dmesg "); |
33 | item = new QListViewItem( m_SuggestedCommandList,"fuser "); | 37 | item = new QListViewItem( m_SuggestedCommandList,"fuser "); |
34 | item = new QListViewItem( m_SuggestedCommandList,"hostname "); | 38 | item = new QListViewItem( m_SuggestedCommandList,"hostname "); |
35 | item = new QListViewItem( m_SuggestedCommandList,"kill "); | 39 | item = new QListViewItem( m_SuggestedCommandList,"kill "); |
36 | item = new QListViewItem( m_SuggestedCommandList,"killall "); | 40 | item = new QListViewItem( m_SuggestedCommandList,"killall "); |
37 | item = new QListViewItem( m_SuggestedCommandList,"ln "); | 41 | item = new QListViewItem( m_SuggestedCommandList,"ln "); |
38 | item = new QListViewItem( m_SuggestedCommandList,"ln -s "); | 42 | item = new QListViewItem( m_SuggestedCommandList,"ln -s "); |
39 | item = new QListViewItem( m_SuggestedCommandList,"lsmod"); | 43 | item = new QListViewItem( m_SuggestedCommandList,"lsmod"); |
40 | item = new QListViewItem( m_SuggestedCommandList,"depmod -a"); | 44 | item = new QListViewItem( m_SuggestedCommandList,"depmod -a"); |
41 | item = new QListViewItem( m_SuggestedCommandList,"modprobe "); | 45 | item = new QListViewItem( m_SuggestedCommandList,"modprobe "); |
42 | item = new QListViewItem( m_SuggestedCommandList,"mount "); | 46 | item = new QListViewItem( m_SuggestedCommandList,"mount "); |
43 | item = new QListViewItem( m_SuggestedCommandList,"more "); | 47 | item = new QListViewItem( m_SuggestedCommandList,"more "); |
44 | item = new QListViewItem( m_SuggestedCommandList,"sort "); | 48 | item = new QListViewItem( m_SuggestedCommandList,"sort "); |
45 | item = new QListViewItem( m_SuggestedCommandList,"touch "); | 49 | item = new QListViewItem( m_SuggestedCommandList,"touch "); |
46 | item = new QListViewItem( m_SuggestedCommandList,"umount "); | 50 | item = new QListViewItem( m_SuggestedCommandList,"umount "); |
47 | item = new QListViewItem( m_SuggestedCommandList,"mknod "); | 51 | item = new QListViewItem( m_SuggestedCommandList,"mknod "); |
48 | item = new QListViewItem( m_SuggestedCommandList,"netstat "); | 52 | item = new QListViewItem( m_SuggestedCommandList,"netstat "); |
49 | item = new QListViewItem( m_SuggestedCommandList,"route "); | 53 | item = new QListViewItem( m_SuggestedCommandList,"route "); |
50 | item = new QListViewItem( m_SuggestedCommandList,"cardctl eject "); | 54 | item = new QListViewItem( m_SuggestedCommandList,"cardctl eject "); |
51 | m_SuggestedCommandList->setSelected(m_SuggestedCommandList->firstChild(),TRUE); | 55 | m_SuggestedCommandList->setSelected(m_SuggestedCommandList->firstChild(),TRUE); |
52 | m_SuggestedCommandList->sort(); | 56 | m_SuggestedCommandList->sort(); |
53 | 57 | ||
54 | connect( m_SuggestedCommandList, SIGNAL( clicked(QListViewItem*) ), m_PlayListSelection, SLOT( addToSelection(QListViewItem*) ) ); | 58 | connect( m_SuggestedCommandList, SIGNAL( clicked(QListViewItem*) ), m_PlayListSelection, SLOT( addToSelection(QListViewItem*) ) ); |
55 | 59 | ||
56 | 60 | bool bigPixmaps = qApp->desktop()->size().width()>330; | |
57 | 61 | ||
58 | ToolButton1->setTextLabel("new"); | 62 | ToolButton1->setTextLabel("new"); |
59 | ToolButton1->setPixmap(Resource::loadPixmap("new")); | 63 | ToolButton1->setUsesBigPixmap( bigPixmaps ); |
64 | ToolButton1->setPixmap( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ) ); | ||
60 | ToolButton1->setAutoRaise(TRUE); | 65 | ToolButton1->setAutoRaise(TRUE); |
61 | ToolButton1->setFocusPolicy(QWidget::NoFocus); | 66 | ToolButton1->setFocusPolicy(QWidget::NoFocus); |
62 | connect(ToolButton1,SIGNAL(clicked()),this,SLOT(showAddDialog())); | 67 | connect(ToolButton1,SIGNAL(clicked()),this,SLOT(showAddDialog())); |
63 | 68 | ||
64 | ToolButton2->setTextLabel("edit"); | 69 | ToolButton2->setTextLabel("edit"); |
65 | ToolButton2->setPixmap(Resource::loadPixmap("edit")); | 70 | ToolButton2->setUsesBigPixmap( bigPixmaps ); |
71 | ToolButton2->setPixmap( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ) ); | ||
66 | ToolButton2->setAutoRaise(TRUE); | 72 | ToolButton2->setAutoRaise(TRUE); |
67 | ToolButton2->setFocusPolicy(QWidget::NoFocus); | 73 | ToolButton2->setFocusPolicy(QWidget::NoFocus); |
68 | connect(ToolButton2,SIGNAL(clicked()),this,SLOT(showEditDialog())); | 74 | connect(ToolButton2,SIGNAL(clicked()),this,SLOT(showEditDialog())); |
69 | 75 | ||
70 | ToolButton3->setTextLabel("delete"); | 76 | ToolButton3->setTextLabel("delete"); |
71 | ToolButton3->setPixmap(Resource::loadPixmap("editdelete")); | 77 | ToolButton3->setUsesBigPixmap( bigPixmaps ); |
78 | ToolButton3->setPixmap( Opie::Core::OResource::loadPixmap( "editdelete", Opie::Core::OResource::SmallIcon ) ); | ||
72 | ToolButton3->setAutoRaise(TRUE); | 79 | ToolButton3->setAutoRaise(TRUE); |
73 | ToolButton3->setFocusPolicy(QWidget::NoFocus); | 80 | ToolButton3->setFocusPolicy(QWidget::NoFocus); |
74 | connect(ToolButton3,SIGNAL(clicked()),m_PlayListSelection,SLOT(removeSelected())); | 81 | connect(ToolButton3,SIGNAL(clicked()),m_PlayListSelection,SLOT(removeSelected())); |
75 | 82 | ||
76 | ToolButton4->setTextLabel("up"); | 83 | ToolButton4->setTextLabel("up"); |
77 | ToolButton4->setPixmap(Resource::loadPixmap("up")); | 84 | ToolButton4->setUsesBigPixmap( bigPixmaps ); |
85 | ToolButton4->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ); | ||
78 | ToolButton4->setAutoRaise(TRUE); | 86 | ToolButton4->setAutoRaise(TRUE); |
79 | ToolButton4->setFocusPolicy(QWidget::NoFocus); | 87 | ToolButton4->setFocusPolicy(QWidget::NoFocus); |
80 | connect(ToolButton4,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedUp())); | 88 | connect(ToolButton4,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedUp())); |
81 | 89 | ||
82 | ToolButton5->setTextLabel("down"); | 90 | ToolButton5->setTextLabel("down"); |
83 | ToolButton5->setPixmap(Resource::loadPixmap("down")); | 91 | ToolButton5->setUsesBigPixmap( bigPixmaps ); |
92 | ToolButton5->setPixmap( Opie::Core::OResource::loadPixmap( "down", Opie::Core::OResource::SmallIcon ) ); | ||
84 | ToolButton5->setAutoRaise(TRUE); | 93 | ToolButton5->setAutoRaise(TRUE); |
85 | ToolButton5->setFocusPolicy(QWidget::NoFocus); | 94 | ToolButton5->setFocusPolicy(QWidget::NoFocus); |
86 | 95 | ||
87 | connect(ToolButton5,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedDown())); | 96 | connect(ToolButton5,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedDown())); |
88 | 97 | ||
89 | 98 | ||
90 | 99 | ||
91 | 100 | ||
92 | QListViewItem *current = m_SuggestedCommandList->selectedItem(); | 101 | QListViewItem *current = m_SuggestedCommandList->selectedItem(); |
93 | if ( current ) | 102 | if ( current ) |
94 | item->moveItem( current ); | 103 | item->moveItem( current ); |
95 | m_SuggestedCommandList->setSelected( item, TRUE ); | 104 | m_SuggestedCommandList->setSelected( item, TRUE ); |
96 | m_SuggestedCommandList->ensureItemVisible( m_SuggestedCommandList->selectedItem() ); | 105 | m_SuggestedCommandList->ensureItemVisible( m_SuggestedCommandList->selectedItem() ); |
97 | Config cfg( "Konsole" ); | 106 | Config cfg( "Konsole" ); |
98 | cfg.setGroup("Commands"); | 107 | cfg.setGroup("Commands"); |
99 | if (cfg.readEntry("Commands Set","FALSE") == "TRUE") { | 108 | if (cfg.readEntry("Commands Set","FALSE") == "TRUE") { |
100 | for (int i = 0; i < 100; i++) { | 109 | for (int i = 0; i < 100; i++) { |
101 | QString tmp; | 110 | QString tmp; |
102 | tmp = cfg.readEntry( QString::number(i),""); | 111 | tmp = cfg.readEntry( QString::number(i),""); |
103 | if (!tmp.isEmpty()) | 112 | if (!tmp.isEmpty()) |
104 | m_PlayListSelection->addStringToSelection(tmp); | 113 | m_PlayListSelection->addStringToSelection(tmp); |
105 | } | 114 | } |
106 | } else { | 115 | } else { |
107 | 116 | ||
108 | m_PlayListSelection->addStringToSelection("ls "); | 117 | m_PlayListSelection->addStringToSelection("ls "); |
109 | m_PlayListSelection->addStringToSelection("cardctl eject"); | 118 | m_PlayListSelection->addStringToSelection("cardctl eject"); |
110 | m_PlayListSelection->addStringToSelection("cat "); | 119 | m_PlayListSelection->addStringToSelection("cat "); |
111 | m_PlayListSelection->addStringToSelection("cd "); | 120 | m_PlayListSelection->addStringToSelection("cd "); |
112 | m_PlayListSelection->addStringToSelection("chmod "); | 121 | m_PlayListSelection->addStringToSelection("chmod "); |
113 | m_PlayListSelection->addStringToSelection("cp "); | 122 | m_PlayListSelection->addStringToSelection("cp "); |
114 | m_PlayListSelection->addStringToSelection("dc "); | 123 | m_PlayListSelection->addStringToSelection("dc "); |
115 | m_PlayListSelection->addStringToSelection("df "); | 124 | m_PlayListSelection->addStringToSelection("df "); |
116 | m_PlayListSelection->addStringToSelection("dmesg"); | 125 | m_PlayListSelection->addStringToSelection("dmesg"); |
117 | m_PlayListSelection->addStringToSelection("echo "); | 126 | m_PlayListSelection->addStringToSelection("echo "); |
118 | m_PlayListSelection->addStringToSelection("env"); | 127 | m_PlayListSelection->addStringToSelection("env"); |
119 | m_PlayListSelection->addStringToSelection("find "); | 128 | m_PlayListSelection->addStringToSelection("find "); |
120 | m_PlayListSelection->addStringToSelection("free"); | 129 | m_PlayListSelection->addStringToSelection("free"); |
121 | m_PlayListSelection->addStringToSelection("grep "); | 130 | m_PlayListSelection->addStringToSelection("grep "); |
122 | m_PlayListSelection->addStringToSelection("ifconfig "); | 131 | m_PlayListSelection->addStringToSelection("ifconfig "); |
123 | m_PlayListSelection->addStringToSelection("ipkg "); | 132 | m_PlayListSelection->addStringToSelection("ipkg "); |
124 | m_PlayListSelection->addStringToSelection("mkdir "); | 133 | m_PlayListSelection->addStringToSelection("mkdir "); |
125 | m_PlayListSelection->addStringToSelection("mv "); | 134 | m_PlayListSelection->addStringToSelection("mv "); |
126 | m_PlayListSelection->addStringToSelection("nc localhost 7776"); | 135 | m_PlayListSelection->addStringToSelection("nc localhost 7776"); |
127 | m_PlayListSelection->addStringToSelection("nc localhost 7777"); | 136 | m_PlayListSelection->addStringToSelection("nc localhost 7777"); |
128 | m_PlayListSelection->addStringToSelection("nslookup "); | 137 | m_PlayListSelection->addStringToSelection("nslookup "); |
129 | m_PlayListSelection->addStringToSelection("ping "); | 138 | m_PlayListSelection->addStringToSelection("ping "); |
130 | m_PlayListSelection->addStringToSelection("ps aux"); | 139 | m_PlayListSelection->addStringToSelection("ps aux"); |
131 | m_PlayListSelection->addStringToSelection("pwd "); | 140 | m_PlayListSelection->addStringToSelection("pwd "); |
132 | m_PlayListSelection->addStringToSelection("rm "); | 141 | m_PlayListSelection->addStringToSelection("rm "); |
133 | m_PlayListSelection->addStringToSelection("rmdir "); | 142 | m_PlayListSelection->addStringToSelection("rmdir "); |
134 | m_PlayListSelection->addStringToSelection("route "); | 143 | m_PlayListSelection->addStringToSelection("route "); |
135 | m_PlayListSelection->addStringToSelection("set "); | 144 | m_PlayListSelection->addStringToSelection("set "); |
136 | m_PlayListSelection->addStringToSelection("traceroute"); | 145 | m_PlayListSelection->addStringToSelection("traceroute"); |
137 | 146 | ||
138 | } | 147 | } |
139 | } | 148 | } |
140 | CommandEditDialog::~CommandEditDialog() | 149 | CommandEditDialog::~CommandEditDialog() |
141 | { | 150 | { |
142 | } | 151 | } |
143 | 152 | ||
144 | void CommandEditDialog::accept() | 153 | void CommandEditDialog::accept() |
145 | { | 154 | { |
146 | int i = 0; | 155 | int i = 0; |
147 | Config *cfg = new Config("Konsole"); | 156 | Config *cfg = new Config("Konsole"); |
diff --git a/core/apps/embeddedkonsole/konsole.cpp b/core/apps/embeddedkonsole/konsole.cpp index de00494..7f3ea65 100644 --- a/core/apps/embeddedkonsole/konsole.cpp +++ b/core/apps/embeddedkonsole/konsole.cpp | |||
@@ -1,101 +1,101 @@ | |||
1 | 1 | ||
2 | /* ---------------------------------------------------------------------- */ | 2 | /* ---------------------------------------------------------------------- */ |
3 | /* */ | 3 | /* */ |
4 | /* [main.C] Konsole */ | 4 | /* [main.C] Konsole */ |
5 | /* */ | 5 | /* */ |
6 | /* ---------------------------------------------------------------------- */ | 6 | /* ---------------------------------------------------------------------- */ |
7 | /* */ | 7 | /* */ |
8 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | 8 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ |
9 | /* */ | 9 | /* */ |
10 | /* This file is part of Konsole, an X terminal. */ | 10 | /* This file is part of Konsole, an X terminal. */ |
11 | /* */ | 11 | /* */ |
12 | /* The material contained in here more or less directly orginates from */ | 12 | /* The material contained in here more or less directly orginates from */ |
13 | /* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ | 13 | /* kvt, which is copyright (c) 1996 by Matthias Ettrich <ettrich@kde.org> */ |
14 | /* */ | 14 | /* */ |
15 | /* ---------------------------------------------------------------------- */ | 15 | /* ---------------------------------------------------------------------- */ |
16 | /* */ | 16 | /* */ |
17 | /* Ported Konsole to Qt/Embedded */ | 17 | /* Ported Konsole to Qt/Embedded */ |
18 | /* */ | 18 | /* */ |
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 | // enhancements added by Phillip Kuhn |
24 | 24 | ||
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | #include <sys/types.h> | 26 | #include <sys/types.h> |
27 | #include <pwd.h> | 27 | #include <pwd.h> |
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> | 32 | #include <opie2/odebug.h> |
33 | #include <opie2/oresource.h> | ||
34 | |||
33 | using namespace Opie; | 35 | using namespace Opie; |
34 | #endif | 36 | #endif |
35 | 37 | ||
36 | #include <qpe/resource.h> | ||
37 | |||
38 | #include <qmenubar.h> | 38 | #include <qmenubar.h> |
39 | #include <qtabbar.h> | 39 | #include <qtabbar.h> |
40 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
41 | #include <qfontdatabase.h> | 41 | #include <qfontdatabase.h> |
42 | #include <qfile.h> | 42 | #include <qfile.h> |
43 | #include <qspinbox.h> | 43 | #include <qspinbox.h> |
44 | #include <qlayout.h> | 44 | #include <qlayout.h> |
45 | 45 | ||
46 | #include <sys/wait.h> | 46 | #include <sys/wait.h> |
47 | #include <stdio.h> | 47 | #include <stdio.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | #include <assert.h> | 49 | #include <assert.h> |
50 | 50 | ||
51 | #include "konsole.h" | 51 | #include "konsole.h" |
52 | #include "commandeditdialog.h" | 52 | #include "commandeditdialog.h" |
53 | 53 | ||
54 | class EKNumTabBar : public QTabBar | 54 | class EKNumTabBar : public QTabBar |
55 | { | 55 | { |
56 | public: | 56 | public: |
57 | EKNumTabBar(QWidget *parent = 0, const char *name = 0) : | 57 | EKNumTabBar(QWidget *parent = 0, const char *name = 0) : |
58 | QTabBar(parent, name) | 58 | QTabBar(parent, name) |
59 | {} | 59 | {} |
60 | 60 | ||
61 | // QList<QTab> *getTabList() { return(tabList()); } | 61 | // QList<QTab> *getTabList() { return(tabList()); } |
62 | 62 | ||
63 | void numberTabs() | 63 | void numberTabs() |
64 | { | 64 | { |
65 | // Yes, it really is this messy. QTabWidget needs functions | 65 | // Yes, it really is this messy. QTabWidget needs functions |
66 | // that provide acces to tabs in a sequential way. | 66 | // that provide acces to tabs in a sequential way. |
67 | int m=INT_MIN; | 67 | int m=INT_MIN; |
68 | for (int i=0; i<count(); i++) | 68 | for (int i=0; i<count(); i++) |
69 | { | 69 | { |
70 | QTab* left=0; | 70 | QTab* left=0; |
71 | QListIterator<QTab> it(*tabList()); | 71 | QListIterator<QTab> it(*tabList()); |
72 | int x=INT_MAX; | 72 | int x=INT_MAX; |
73 | for( QTab* t; (t=it.current()); ++it ) | 73 | for( QTab* t; (t=it.current()); ++it ) |
74 | { | 74 | { |
75 | int tx = t->rect().x(); | 75 | int tx = t->rect().x(); |
76 | if ( tx<x && tx>m ) | 76 | if ( tx<x && tx>m ) |
77 | { | 77 | { |
78 | x = tx; | 78 | x = tx; |
79 | left = t; | 79 | left = t; |
80 | } | 80 | } |
81 | } | 81 | } |
82 | if ( left ) | 82 | if ( left ) |
83 | { | 83 | { |
84 | left->setText(QString::number(i+1)); | 84 | left->setText(QString::number(i+1)); |
85 | m = left->rect().x(); | 85 | m = left->rect().x(); |
86 | } | 86 | } |
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | virtual QSize sizeHint() const | 90 | virtual QSize sizeHint() const |
91 | { | 91 | { |
92 | if (isHidden()) | 92 | if (isHidden()) |
93 | { | 93 | { |
94 | return(QSize(0,0)); | 94 | return(QSize(0,0)); |
95 | } | 95 | } |
96 | else | 96 | else |
97 | { | 97 | { |
98 | QSize size = QTabBar::sizeHint(); | 98 | QSize size = QTabBar::sizeHint(); |
99 | int shrink = 5; | 99 | int shrink = 5; |
100 | if (qApp->desktop()->width() > 600 || qApp->desktop()->height() > 600) | 100 | if (qApp->desktop()->width() > 600 || qApp->desktop()->height() > 600) |
101 | { | 101 | { |
@@ -315,129 +315,129 @@ void Konsole::initCommandList() | |||
315 | break; | 315 | break; |
316 | } | 316 | } |
317 | } | 317 | } |
318 | if (i >= items.count()) { | 318 | if (i >= items.count()) { |
319 | items.append(new HistoryItem(lineno, line)); | 319 | items.append(new HistoryItem(lineno, line)); |
320 | } | 320 | } |
321 | } | 321 | } |
322 | items.sort(); | 322 | items.sort(); |
323 | int n = items.count(); | 323 | int n = items.count(); |
324 | if (n > 40) { | 324 | if (n > 40) { |
325 | n = 40; | 325 | n = 40; |
326 | } | 326 | } |
327 | for(int i=0; i<n; i++) { | 327 | for(int i=0; i<n; i++) { |
328 | // should insert start of command, but keep whole thing | 328 | // should insert start of command, but keep whole thing |
329 | if (items.at(items.count()-i-1)->line.length() < 30) { | 329 | if (items.at(items.count()-i-1)->line.length() < 30) { |
330 | commonCombo->insertItem(items.at(items.count()-i-1)->line); | 330 | commonCombo->insertItem(items.at(items.count()-i-1)->line); |
331 | } | 331 | } |
332 | } | 332 | } |
333 | histfile.close(); | 333 | histfile.close(); |
334 | } | 334 | } |
335 | } | 335 | } |
336 | if (cfg.readEntry("Commands Set","FALSE") == "FALSE") { | 336 | if (cfg.readEntry("Commands Set","FALSE") == "FALSE") { |
337 | for (int i = 0; commonCmds[i] != NULL; i++) { | 337 | for (int i = 0; commonCmds[i] != NULL; i++) { |
338 | commonCombo->insertItem(commonCmds[i]); | 338 | commonCombo->insertItem(commonCmds[i]); |
339 | } | 339 | } |
340 | } else { | 340 | } else { |
341 | for (int i = 0; i < 100; i++) { | 341 | for (int i = 0; i < 100; i++) { |
342 | if (!(cfg.readEntry( QString::number(i),"")).isEmpty()) | 342 | if (!(cfg.readEntry( QString::number(i),"")).isEmpty()) |
343 | commonCombo->insertItem(cfg.readEntry( QString::number(i),"")); | 343 | commonCombo->insertItem(cfg.readEntry( QString::number(i),"")); |
344 | } | 344 | } |
345 | } | 345 | } |
346 | 346 | ||
347 | 347 | ||
348 | } | 348 | } |
349 | 349 | ||
350 | static void sig_handler(int x) | 350 | static void sig_handler(int x) |
351 | { | 351 | { |
352 | printf("got signal %d\n",x); | 352 | printf("got signal %d\n",x); |
353 | } | 353 | } |
354 | 354 | ||
355 | void Konsole::init(const char* _pgm, QStrList & _args) | 355 | void Konsole::init(const char* _pgm, QStrList & _args) |
356 | { | 356 | { |
357 | 357 | ||
358 | #if 0 | 358 | #if 0 |
359 | for(int i=1; i<=31; i++) | 359 | for(int i=1; i<=31; i++) |
360 | { | 360 | { |
361 | if (i != SIGPIPE && i != SIGPROF && i != SIGSEGV | 361 | if (i != SIGPIPE && i != SIGPROF && i != SIGSEGV |
362 | && i != SIGINT && i != SIGILL && i != SIGTERM | 362 | && i != SIGINT && i != SIGILL && i != SIGTERM |
363 | && i != SIGBUS) | 363 | && i != SIGBUS) |
364 | signal(i,sig_handler); | 364 | signal(i,sig_handler); |
365 | } | 365 | } |
366 | #endif | 366 | #endif |
367 | signal(SIGSTOP, sig_handler); | 367 | signal(SIGSTOP, sig_handler); |
368 | signal(SIGCONT, sig_handler); | 368 | signal(SIGCONT, sig_handler); |
369 | signal(SIGTSTP, sig_handler); | 369 | signal(SIGTSTP, sig_handler); |
370 | 370 | ||
371 | b_scroll = TRUE; // histon; | 371 | b_scroll = TRUE; // histon; |
372 | n_keytab = 0; | 372 | n_keytab = 0; |
373 | n_render = 0; | 373 | n_render = 0; |
374 | startUp=0; | 374 | startUp=0; |
375 | fromMenu = FALSE; | 375 | fromMenu = FALSE; |
376 | fullscreen = false; | 376 | fullscreen = false; |
377 | 377 | ||
378 | setCaption( tr( "Konsole" ) ); | 378 | setCaption( tr( "Konsole" ) ); |
379 | setIcon( Resource::loadPixmap( "konsole/Terminal" ) ); | 379 | setIcon( Opie::Core::OResource::loadPixmap( "konsole/Terminal", Opie::Core::OResource::SmallIcon ) ); |
380 | 380 | ||
381 | Config cfg( "Konsole" ); | 381 | Config cfg( "Konsole" ); |
382 | cfg.setGroup("Font"); | 382 | cfg.setGroup("Font"); |
383 | QString tmp; | 383 | QString tmp; |
384 | 384 | ||
385 | // initialize the list of allowed fonts /////////////////////////////////// | 385 | // initialize the list of allowed fonts /////////////////////////////////// |
386 | 386 | ||
387 | QString cfgFontName = cfg.readEntry("FontName","Lcfont"); | 387 | QString cfgFontName = cfg.readEntry("FontName","Lcfont"); |
388 | int cfgFontSize = cfg.readNumEntry("FontSize",18); | 388 | int cfgFontSize = cfg.readNumEntry("FontSize",18); |
389 | 389 | ||
390 | cfont = -1; | 390 | cfont = -1; |
391 | 391 | ||
392 | // this code causes repeated access to all the font files | 392 | // this code causes repeated access to all the font files |
393 | // which does slow down startup | 393 | // which does slow down startup |
394 | QFontDatabase fontDB; | 394 | QFontDatabase fontDB; |
395 | QStringList familyNames; | 395 | QStringList familyNames; |
396 | familyNames = fontDB.families( FALSE ); | 396 | familyNames = fontDB.families( FALSE ); |
397 | QString s; | 397 | QString s; |
398 | int fontIndex = 0; | 398 | int fontIndex = 0; |
399 | int familyNum = 0; | 399 | int familyNum = 0; |
400 | fontList = new QPopupMenu( this ); | 400 | fontList = new QPopupMenu( this ); |
401 | 401 | ||
402 | for(uint j = 0; j < (uint)familyNames.count(); j++) | 402 | for(uint j = 0; j < (uint)familyNames.count(); j++) |
403 | { | 403 | { |
404 | s = familyNames[j]; | 404 | s = familyNames[j]; |
405 | if ( s.contains('-') ) | 405 | if ( s.contains('-') ) |
406 | { | 406 | { |
407 | int i = s.find('-'); | 407 | int i = s.find('-'); |
408 | s = s.right( s.length() - i - 1 ) + " [" + s.left( i ) + "]"; | 408 | s = s.right( s.length() - i - 1 ) + " [" + s.left( i ) + "]"; |
409 | } | 409 | } |
410 | s[0] = s[0].upper(); | 410 | s[0] = s[0].upper(); |
411 | 411 | ||
412 | QValueList<int> sizes = fontDB.pointSizes( familyNames[j] ); | 412 | QValueList<int> sizes = fontDB.pointSizes( familyNames[j] ); |
413 | 413 | ||
414 | printf("family[%d] = %s with %d sizes\n", j, familyNames[j].latin1(), | 414 | printf("family[%d] = %s with %d sizes\n", j, familyNames[j].latin1(), |
415 | sizes.count()); | 415 | sizes.count()); |
416 | 416 | ||
417 | if (sizes.count() > 0) | 417 | if (sizes.count() > 0) |
418 | { | 418 | { |
419 | QPopupMenu *sizeMenu; | 419 | QPopupMenu *sizeMenu; |
420 | QFont f; | 420 | QFont f; |
421 | int last_width = -1; | 421 | int last_width = -1; |
422 | sizeMenu = NULL; | 422 | sizeMenu = NULL; |
423 | 423 | ||
424 | for(uint i = 0; i < (uint)sizes.count() + 4; i++) | 424 | for(uint i = 0; i < (uint)sizes.count() + 4; i++) |
425 | { | 425 | { |
426 | // printf("family %s size %d ", familyNames[j].latin1(), sizes[i]); | 426 | // printf("family %s size %d ", familyNames[j].latin1(), sizes[i]); |
427 | // need to divide by 10 on the Z, but not otherwise | 427 | // need to divide by 10 on the Z, but not otherwise |
428 | int size; | 428 | int size; |
429 | 429 | ||
430 | if (i >= (uint)sizes.count()) | 430 | if (i >= (uint)sizes.count()) |
431 | { | 431 | { |
432 | // try for expandable fonts | 432 | // try for expandable fonts |
433 | size = sizes[sizes.count()-1] + 2 * (i - sizes.count() + 1); | 433 | size = sizes[sizes.count()-1] + 2 * (i - sizes.count() + 1); |
434 | } | 434 | } |
435 | else | 435 | else |
436 | { | 436 | { |
437 | printf("sizes[%d] = %d\n", i, sizes[i]); | 437 | printf("sizes[%d] = %d\n", i, sizes[i]); |
438 | size = sizes[i]; | 438 | size = sizes[i]; |
439 | } | 439 | } |
440 | 440 | ||
441 | f = QFont(familyNames[j], size); | 441 | f = QFont(familyNames[j], size); |
442 | f.setFixedPitch(true); | 442 | f.setFixedPitch(true); |
443 | QFontMetrics fm(f); | 443 | QFontMetrics fm(f); |
@@ -509,173 +509,182 @@ void Konsole::init(const char* _pgm, QStrList & _args) | |||
509 | cfg.setGroup("Menubar"); | 509 | cfg.setGroup("Menubar"); |
510 | if( cfg.readEntry("Hidden","FALSE") == "TRUE") | 510 | if( cfg.readEntry("Hidden","FALSE") == "TRUE") |
511 | { | 511 | { |
512 | ec_cmdlist = editCommandListMenu->insertItem( tr( "Show command list" )); | 512 | ec_cmdlist = editCommandListMenu->insertItem( tr( "Show command list" )); |
513 | listHidden=TRUE; | 513 | listHidden=TRUE; |
514 | } | 514 | } |
515 | else | 515 | else |
516 | { | 516 | { |
517 | ec_cmdlist = editCommandListMenu->insertItem( tr( "Hide command list" )); | 517 | ec_cmdlist = editCommandListMenu->insertItem( tr( "Hide command list" )); |
518 | listHidden=FALSE; | 518 | listHidden=FALSE; |
519 | } | 519 | } |
520 | 520 | ||
521 | cfg.setGroup("Tabs"); | 521 | cfg.setGroup("Tabs"); |
522 | 522 | ||
523 | tabMenu = new QPopupMenu(this); | 523 | tabMenu = new QPopupMenu(this); |
524 | tm_bottom = tabMenu->insertItem(tr("Bottom" )); | 524 | tm_bottom = tabMenu->insertItem(tr("Bottom" )); |
525 | tm_top = tabMenu->insertItem(tr("Top")); | 525 | tm_top = tabMenu->insertItem(tr("Top")); |
526 | tm_hidden = tabMenu->insertItem(tr("Hidden")); | 526 | tm_hidden = tabMenu->insertItem(tr("Hidden")); |
527 | 527 | ||
528 | configMenu->insertItem(tr("Tabs"), tabMenu); | 528 | configMenu->insertItem(tr("Tabs"), tabMenu); |
529 | 529 | ||
530 | tmp=cfg.readEntry("Position","Top"); | 530 | tmp=cfg.readEntry("Position","Top"); |
531 | if(tmp=="Top") | 531 | if(tmp=="Top") |
532 | { | 532 | { |
533 | tab->setTabPosition(QTabWidget::Top); | 533 | tab->setTabPosition(QTabWidget::Top); |
534 | tab->getTabBar()->show(); | 534 | tab->getTabBar()->show(); |
535 | tabPos = tm_top; | 535 | tabPos = tm_top; |
536 | } | 536 | } |
537 | else if (tmp=="Bottom") | 537 | else if (tmp=="Bottom") |
538 | { | 538 | { |
539 | tab->setTabPosition(QTabWidget::Bottom); | 539 | tab->setTabPosition(QTabWidget::Bottom); |
540 | tab->getTabBar()->show(); | 540 | tab->getTabBar()->show(); |
541 | tabPos = tm_bottom; | 541 | tabPos = tm_bottom; |
542 | } | 542 | } |
543 | else | 543 | else |
544 | { | 544 | { |
545 | tab->getTabBar()->hide(); | 545 | tab->getTabBar()->hide(); |
546 | tab->setMargin(tab->margin()); | 546 | tab->setMargin(tab->margin()); |
547 | tabPos = tm_hidden; | 547 | tabPos = tm_hidden; |
548 | } | 548 | } |
549 | 549 | ||
550 | cm_bw = colorMenu->insertItem(tr( "Black on White")); | 550 | cm_bw = colorMenu->insertItem(tr( "Black on White")); |
551 | cm_wb = colorMenu->insertItem(tr( "White on Black")); | 551 | cm_wb = colorMenu->insertItem(tr( "White on Black")); |
552 | cm_gb = colorMenu->insertItem(tr( "Green on Black")); | 552 | cm_gb = colorMenu->insertItem(tr( "Green on Black")); |
553 | // cm_bt = colorMenu->insertItem(tr( "Black on Transparent")); | 553 | // cm_bt = colorMenu->insertItem(tr( "Black on Transparent")); |
554 | cm_br = colorMenu->insertItem(tr( "Black on Pink")); | 554 | cm_br = colorMenu->insertItem(tr( "Black on Pink")); |
555 | cm_rb = colorMenu->insertItem(tr( "Pink on Black")); | 555 | cm_rb = colorMenu->insertItem(tr( "Pink on Black")); |
556 | cm_gy = colorMenu->insertItem(tr( "Green on Yellow")); | 556 | cm_gy = colorMenu->insertItem(tr( "Green on Yellow")); |
557 | cm_bm = colorMenu->insertItem(tr( "Blue on Magenta")); | 557 | cm_bm = colorMenu->insertItem(tr( "Blue on Magenta")); |
558 | cm_mb = colorMenu->insertItem(tr( "Magenta on Blue")); | 558 | cm_mb = colorMenu->insertItem(tr( "Magenta on Blue")); |
559 | cm_cw = colorMenu->insertItem(tr( "Cyan on White")); | 559 | cm_cw = colorMenu->insertItem(tr( "Cyan on White")); |
560 | cm_wc = colorMenu->insertItem(tr( "White on Cyan")); | 560 | cm_wc = colorMenu->insertItem(tr( "White on Cyan")); |
561 | cm_bb = colorMenu->insertItem(tr( "Blue on Black")); | 561 | cm_bb = colorMenu->insertItem(tr( "Blue on Black")); |
562 | cm_ab = colorMenu->insertItem(tr( "Amber on Black")); | 562 | cm_ab = colorMenu->insertItem(tr( "Amber on Black")); |
563 | cm_default = colorMenu->insertItem(tr("default")); | 563 | cm_default = colorMenu->insertItem(tr("default")); |
564 | 564 | ||
565 | #ifdef QT_QWS_OPIE | 565 | #ifdef QT_QWS_OPIE |
566 | 566 | ||
567 | colorMenu->insertItem(tr( "Custom")); | 567 | colorMenu->insertItem(tr( "Custom")); |
568 | #endif | 568 | #endif |
569 | 569 | ||
570 | configMenu->insertItem(tr( "Colors") ,colorMenu); | 570 | configMenu->insertItem(tr( "Colors") ,colorMenu); |
571 | 571 | ||
572 | sessionList = new QPopupMenu(this); | 572 | sessionList = new QPopupMenu(this); |
573 | sessionList-> insertItem ( Resource::loadPixmap ( "konsole/Terminal" ), tr( "new session" ), this, | 573 | sessionList-> insertItem ( Opie::Core::OResource::loadPixmap( "konsole/Terminal", Opie::Core::OResource::SmallIcon ), |
574 | SLOT(newSession()) ); | 574 | tr( "new session" ), this, SLOT(newSession()) ); |
575 | 575 | ||
576 | // connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); | 576 | // connect( fontList, SIGNAL( activated(int) ), this, SLOT( fontChanged(int) )); |
577 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); | 577 | connect( configMenu, SIGNAL( activated(int) ), this, SLOT( configMenuSelected(int) )); |
578 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) )); | 578 | connect( colorMenu, SIGNAL( activated(int) ), this, SLOT( colorMenuIsSelected(int) )); |
579 | connect( tabMenu, SIGNAL( activated(int) ), this, SLOT( tabMenuSelected(int) )); | 579 | connect( tabMenu, SIGNAL( activated(int) ), this, SLOT( tabMenuSelected(int) )); |
580 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); | 580 | connect( scrollMenu, SIGNAL(activated(int)),this,SLOT(scrollMenuSelected(int))); |
581 | connect( editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); | 581 | connect( editCommandListMenu,SIGNAL(activated(int)),this,SLOT(editCommandListMenuSelected(int))); |
582 | connect( sessionList, SIGNAL(activated(int)), this, SLOT( sessionListSelected(int) ) ); | 582 | connect( sessionList, SIGNAL(activated(int)), this, SLOT( sessionListSelected(int) ) ); |
583 | 583 | ||
584 | menuBar->insertItem( tr("View"), configMenu ); | 584 | menuBar->insertItem( tr("View"), configMenu ); |
585 | menuBar->insertItem( tr("Fonts"), fontList ); | 585 | menuBar->insertItem( tr("Fonts"), fontList ); |
586 | menuBar->insertItem( tr("Sessions"), sessionList ); | 586 | menuBar->insertItem( tr("Sessions"), sessionList ); |
587 | 587 | ||
588 | toolBar = new QToolBar( this ); | 588 | toolBar = new QToolBar( this ); |
589 | 589 | ||
590 | QAction *a; | 590 | QAction *a; |
591 | 591 | ||
592 | // Button Commands | 592 | // Button Commands |
593 | a = new QAction( tr("New"), Resource::loadPixmap( "konsole/konsole" ), QString::null, 0, this, 0 ); | 593 | a = new QAction( tr("New"), Opie::Core::OResource::loadPixmap( "konsole/konsole", Opie::Core::OResource::SmallIcon ), |
594 | QString::null, 0, this, 0 ); | ||
594 | connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); | 595 | connect( a, SIGNAL( activated() ), this, SLOT( newSession() ) ); |
595 | a->addTo( toolBar ); | 596 | a->addTo( toolBar ); |
596 | 597 | ||
597 | a = new QAction( tr("Full Screen"), Resource::loadPixmap( "fullscreen" ), QString::null, 0, this, 0 ); | 598 | a = new QAction( tr("Full Screen"), Opie::Core::OResource::loadPixmap( "fullscreen", Opie::Core::OResource::SmallIcon ), |
599 | QString::null, 0, this, 0 ); | ||
598 | connect( a, SIGNAL( activated() ), this, SLOT( toggleFullScreen() ) ); | 600 | connect( a, SIGNAL( activated() ), this, SLOT( toggleFullScreen() ) ); |
599 | a->addTo( toolBar ); | 601 | a->addTo( toolBar ); |
600 | 602 | ||
601 | a = new QAction( tr("Zoom"), Resource::loadPixmap( "zoom" ), QString::null, 0, this, 0 ); | 603 | a = new QAction( tr("Zoom"), Opie::Core::OResource::loadPixmap( "zoom", Opie::Core::OResource::SmallIcon ), |
604 | QString::null, 0, this, 0 ); | ||
602 | connect( a, SIGNAL( activated() ), this, SLOT( cycleZoom() ) ); | 605 | connect( a, SIGNAL( activated() ), this, SLOT( cycleZoom() ) ); |
603 | a->addTo( toolBar ); | 606 | a->addTo( toolBar ); |
604 | 607 | ||
605 | 608 | ||
606 | a = new QAction( tr("Enter"), Resource::loadPixmap( "konsole/enter" ), QString::null, 0, this, 0 ); | 609 | a = new QAction( tr("Enter"), Opie::Core::OResource::loadPixmap( "konsole/enter", Opie::Core::OResource::SmallIcon ), |
610 | QString::null, 0, this, 0 ); | ||
607 | connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolBar ); | 611 | connect( a, SIGNAL( activated() ), this, SLOT( hitEnter() ) ); a->addTo( toolBar ); |
608 | a = new QAction( tr("Space"), Resource::loadPixmap( "konsole/space" ), QString::null, 0, this, 0 ); | 612 | a = new QAction( tr("Space"), Opie::Core::OResource::loadPixmap( "konsole/space", Opie::Core::OResource::SmallIcon ), |
613 | QString::null, 0, this, 0 ); | ||
609 | connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolBar ); | 614 | connect( a, SIGNAL( activated() ), this, SLOT( hitSpace() ) ); a->addTo( toolBar ); |
610 | a = new QAction( tr("Tab"), Resource::loadPixmap( "konsole/tab" ), QString::null, 0, this, 0 ); | 615 | a = new QAction( tr("Tab"), Opie::Core::OResource::loadPixmap( "konsole/tab", Opie::Core::OResource::SmallIcon ), |
616 | QString::null, 0, this, 0 ); | ||
611 | connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolBar ); | 617 | connect( a, SIGNAL( activated() ), this, SLOT( hitTab() ) ); a->addTo( toolBar ); |
612 | a = new QAction( tr("Up"), Resource::loadPixmap( "konsole/up" ), QString::null, 0, this, 0 ); | 618 | a = new QAction( tr("Up"), Opie::Core::OResource::loadPixmap( "konsole/up", Opie::Core::OResource::SmallIcon ), |
619 | QString::null, 0, this, 0 ); | ||
613 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolBar ); | 620 | connect( a, SIGNAL( activated() ), this, SLOT( hitUp() ) ); a->addTo( toolBar ); |
614 | a = new QAction( tr("Down"), Resource::loadPixmap( "konsole/down" ), QString::null, 0, this, 0 ); | 621 | a = new QAction( tr("Down"), Opie::Core::OResource::loadPixmap( "konsole/down", Opie::Core::OResource::SmallIcon ), |
622 | QString::null, 0, this, 0 ); | ||
615 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolBar ); | 623 | connect( a, SIGNAL( activated() ), this, SLOT( hitDown() ) ); a->addTo( toolBar ); |
616 | 624 | ||
617 | a = new QAction( tr("Paste"), Resource::loadPixmap( "paste" ), QString::null, 0, this, 0 ); | 625 | a = new QAction( tr("Paste"), Opie::Core::OResource::loadPixmap( "paste", Opie::Core::OResource::SmallIcon ), |
626 | QString::null, 0, this, 0 ); | ||
618 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); | 627 | connect( a, SIGNAL( activated() ), this, SLOT( hitPaste() ) ); |
619 | a->addTo( toolBar ); | 628 | a->addTo( toolBar ); |
620 | 629 | ||
621 | secondToolBar = new QToolBar( this ); | 630 | secondToolBar = new QToolBar( this ); |
622 | secondToolBar->setHorizontalStretchable( TRUE ); | 631 | secondToolBar->setHorizontalStretchable( TRUE ); |
623 | 632 | ||
624 | commonCombo = new QComboBox( secondToolBar ); | 633 | commonCombo = new QComboBox( secondToolBar ); |
625 | // commonCombo->setMaximumWidth(236); | 634 | // commonCombo->setMaximumWidth(236); |
626 | 635 | ||
627 | ec_quick = editCommandListMenu->insertItem( tr( "Quick Edit" ) ); | 636 | ec_quick = editCommandListMenu->insertItem( tr( "Quick Edit" ) ); |
628 | if( listHidden) | 637 | if( listHidden) |
629 | { | 638 | { |
630 | secondToolBar->hide(); | 639 | secondToolBar->hide(); |
631 | editCommandListMenu->setItemEnabled(ec_quick ,FALSE); | 640 | editCommandListMenu->setItemEnabled(ec_quick ,FALSE); |
632 | } | 641 | } |
633 | ec_edit = editCommandListMenu->insertItem(tr( "Edit..." ) ); | 642 | ec_edit = editCommandListMenu->insertItem(tr( "Edit..." ) ); |
634 | 643 | ||
635 | cfg.setGroup("Commands"); | 644 | cfg.setGroup("Commands"); |
636 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); | 645 | commonCombo->setInsertionPolicy(QComboBox::AtCurrent); |
637 | 646 | ||
638 | initCommandList(); | 647 | initCommandList(); |
639 | // for (int i = 0; commonCmds[i] != NULL; i++) { | 648 | // for (int i = 0; commonCmds[i] != NULL; i++) { |
640 | // commonCombo->insertItem( commonCmds[i], i ); | 649 | // commonCombo->insertItem( commonCmds[i], i ); |
641 | // tmp = cfg.readEntry( QString::number(i),""); | 650 | // tmp = cfg.readEntry( QString::number(i),""); |
642 | // if(tmp != "") | 651 | // if(tmp != "") |
643 | // commonCombo->changeItem( tmp,i ); | 652 | // commonCombo->changeItem( tmp,i ); |
644 | // } | 653 | // } |
645 | 654 | ||
646 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); | 655 | connect( commonCombo, SIGNAL( activated(int) ), this, SLOT( enterCommand(int) )); |
647 | 656 | ||
648 | sm_none = scrollMenu->insertItem(tr( "None" )); | 657 | sm_none = scrollMenu->insertItem(tr( "None" )); |
649 | sm_left = scrollMenu->insertItem(tr( "Left" )); | 658 | sm_left = scrollMenu->insertItem(tr( "Left" )); |
650 | sm_right = scrollMenu->insertItem(tr( "Right" )); | 659 | sm_right = scrollMenu->insertItem(tr( "Right" )); |
651 | // scrollMenu->insertSeparator(4); | 660 | // scrollMenu->insertSeparator(4); |
652 | // scrollMenu->insertItem(tr( "Horizontal" )); | 661 | // scrollMenu->insertItem(tr( "Horizontal" )); |
653 | 662 | ||
654 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); | 663 | configMenu->insertItem(tr( "ScrollBar" ),scrollMenu); |
655 | 664 | ||
656 | configMenu->insertItem(tr( "History..." ), this, SLOT(historyDialog())); | 665 | configMenu->insertItem(tr( "History..." ), this, SLOT(historyDialog())); |
657 | 666 | ||
658 | cm_wrap = configMenu->insertItem(tr( "Wrap" )); | 667 | cm_wrap = configMenu->insertItem(tr( "Wrap" )); |
659 | cfg.setGroup("ScrollBar"); | 668 | cfg.setGroup("ScrollBar"); |
660 | configMenu->setItemChecked(cm_wrap, cfg.readBoolEntry("HorzScroll",0)); | 669 | configMenu->setItemChecked(cm_wrap, cfg.readBoolEntry("HorzScroll",0)); |
661 | 670 | ||
662 | cm_beep = configMenu->insertItem(tr( "Use Beep" )); | 671 | cm_beep = configMenu->insertItem(tr( "Use Beep" )); |
663 | cfg.setGroup("Menubar"); | 672 | cfg.setGroup("Menubar"); |
664 | configMenu->setItemChecked(cm_beep, cfg.readBoolEntry("useBeep",0)); | 673 | configMenu->setItemChecked(cm_beep, cfg.readBoolEntry("useBeep",0)); |
665 | 674 | ||
666 | fullscreen_msg = new QLabel(this); | 675 | fullscreen_msg = new QLabel(this); |
667 | fullscreen_msg-> setAlignment ( AlignCenter | SingleLine ); | 676 | fullscreen_msg-> setAlignment ( AlignCenter | SingleLine ); |
668 | fullscreen_msg-> hide(); | 677 | fullscreen_msg-> hide(); |
669 | fullscreen_msg-> setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding )); | 678 | fullscreen_msg-> setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding )); |
670 | fullscreen_msg-> setAutoResize(true); | 679 | fullscreen_msg-> setAutoResize(true); |
671 | fullscreen_msg-> setFrameStyle(QFrame::PopupPanel | QFrame::Raised); | 680 | fullscreen_msg-> setFrameStyle(QFrame::PopupPanel | QFrame::Raised); |
672 | fullscreen_msg-> setText(tr("To exit fullscreen, tap here.")); | 681 | fullscreen_msg-> setText(tr("To exit fullscreen, tap here.")); |
673 | 682 | ||
674 | fullscreen_timer = new QTimer(this); | 683 | fullscreen_timer = new QTimer(this); |
675 | connect(fullscreen_timer, SIGNAL(timeout()), | 684 | connect(fullscreen_timer, SIGNAL(timeout()), |
676 | this, SLOT(fullscreenTimeout())); | 685 | this, SLOT(fullscreenTimeout())); |
677 | show_fullscreen_msg = true; | 686 | show_fullscreen_msg = true; |
678 | 687 | ||
679 | //scrollMenuSelected(-29); | 688 | //scrollMenuSelected(-29); |
680 | // cfg.setGroup("ScrollBar"); | 689 | // cfg.setGroup("ScrollBar"); |
681 | // if(cfg.readBoolEntry("HorzScroll",0)) { | 690 | // if(cfg.readBoolEntry("HorzScroll",0)) { |