summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/main.cpp2
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp
index 3b4321a..b17f8e8 100644
--- a/noncore/apps/opie-console/main.cpp
+++ b/noncore/apps/opie-console/main.cpp
@@ -80,35 +80,35 @@ FixIt::~FixIt() {
80 */ 80 */
81void FixIt::fixIt() { 81void FixIt::fixIt() {
82 ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" ); 82 ::rename("/etc/inittab", QPEApplication::qpeDir() + "/etc/inittab" );
83 QFile file( "/etc/inittab" ); 83 QFile file( "/etc/inittab" );
84 if ( file.open(IO_WriteOnly | IO_Raw ) ) { 84 if ( file.open(IO_WriteOnly | IO_Raw ) ) {
85 file.writeBlock(m_file,strlen(m_file) ); 85 file.writeBlock(m_file,strlen(m_file) );
86 } 86 }
87 file.close(); 87 file.close();
88 ::kill( SIGHUP, 1 ); 88 ::kill( SIGHUP, 1 );
89} 89}
90#endif 90#endif
91 91
92 92
93int main(int argc, char **argv) { 93int main(int argc, char **argv) {
94// too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole"; 94// too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole";
95 QPEApplication app( argc, argv ); 95 QPEApplication app( argc, argv );
96 96
97#ifdef FSCKED_DISTRIBUTION 97#ifdef FSCKED_DISTRIBUTION
98 qWarning("fscked"); 98 qWarning("fscked");
99 FixIt it; 99 FixIt it;
100 it.fixIt(); 100 it.fixIt();
101#endif 101#endif
102 102
103 MainWindow mw; 103 MainWindow mw;
104 mw.setCaption(QObject::tr("Opie console") ); 104 mw.setCaption(QObject::tr("Opie Console") );
105 app.showMainWidget( &mw ); 105 app.showMainWidget( &mw );
106 106
107 int ap = app.exec(); 107 int ap = app.exec();
108 108
109#ifdef FSCKED_DISTRIBUTION 109#ifdef FSCKED_DISTRIBUTION
110 /* should add a signal handler too */ 110 /* should add a signal handler too */
111 it.breakIt(); 111 it.breakIt();
112#endif 112#endif
113 return ap; 113 return ap;
114} 114}
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 3acbfad..c48116d 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -33,48 +33,49 @@
33#include "emulation_handler.h" 33#include "emulation_handler.h"
34#include "script.h" 34#include "script.h"
35 35
36 36
37MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 37MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
38 KeyTrans::loadAll(); 38 KeyTrans::loadAll();
39 for (int i = 0; i < KeyTrans::count(); i++ ) { 39 for (int i = 0; i < KeyTrans::count(); i++ ) {
40 KeyTrans* s = KeyTrans::find(i ); 40 KeyTrans* s = KeyTrans::find(i );
41 assert( s ); 41 assert( s );
42 } 42 }
43 m_factory = new MetaFactory(); 43 m_factory = new MetaFactory();
44 Default def(m_factory); 44 Default def(m_factory);
45 m_sessions.setAutoDelete( TRUE ); 45 m_sessions.setAutoDelete( TRUE );
46 m_curSession = 0; 46 m_curSession = 0;
47 m_manager = new ProfileManager( m_factory ); 47 m_manager = new ProfileManager( m_factory );
48 m_manager->load(); 48 m_manager->load();
49 m_scriptsData.setAutoDelete(TRUE); 49 m_scriptsData.setAutoDelete(TRUE);
50 50
51 initUI(); 51 initUI();
52 populateProfiles(); 52 populateProfiles();
53 populateScripts(); 53 populateScripts();
54} 54}
55 55
56void MainWindow::initUI() { 56void MainWindow::initUI() {
57
57 setToolBarsMovable( FALSE ); 58 setToolBarsMovable( FALSE );
58 59
59 /* tool bar for the menu */ 60 /* tool bar for the menu */
60 m_tool = new QToolBar( this ); 61 m_tool = new QToolBar( this );
61 m_tool->setHorizontalStretchable( TRUE ); 62 m_tool->setHorizontalStretchable( TRUE );
62 63
63 m_bar = new QMenuBar( m_tool ); 64 m_bar = new QMenuBar( m_tool );
64 m_console = new QPopupMenu( this ); 65 m_console = new QPopupMenu( this );
65 m_scripts = new QPopupMenu( this ); 66 m_scripts = new QPopupMenu( this );
66 m_sessionsPop= new QPopupMenu( this ); 67 m_sessionsPop= new QPopupMenu( this );
67 m_scriptsPop = new QPopupMenu( this ); 68 m_scriptsPop = new QPopupMenu( this );
68 69
69 /* add a toolbar for icons */ 70 /* add a toolbar for icons */
70 m_icons = new QToolBar(this); 71 m_icons = new QToolBar(this);
71 72
72 /* 73 /*
73 * the settings action 74 * the settings action
74 */ 75 */
75 m_setProfiles = new QAction(tr("Configure Profiles"), 76 m_setProfiles = new QAction(tr("Configure Profiles"),
76 Resource::loadPixmap( "SettingsIcon" ), 77 Resource::loadPixmap( "SettingsIcon" ),
77 QString::null, 0, this, 0); 78 QString::null, 0, this, 0);
78 m_setProfiles->addTo( m_console ); 79 m_setProfiles->addTo( m_console );
79 connect( m_setProfiles, SIGNAL(activated() ), 80 connect( m_setProfiles, SIGNAL(activated() ),
80 this, SLOT(slotConfigure() ) ); 81 this, SLOT(slotConfigure() ) );
@@ -99,53 +100,56 @@ void MainWindow::initUI() {
99 connect( saveCon, SIGNAL(activated() ), 100 connect( saveCon, SIGNAL(activated() ),
100 this, SLOT(slotSaveSession() ) ); 101 this, SLOT(slotSaveSession() ) );
101 m_console->insertSeparator(); 102 m_console->insertSeparator();
102 103
103 /* 104 /*
104 * connect action 105 * connect action
105 */ 106 */
106 m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"), 107 m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"),
107 QString::null, 0, this, 0 ); 108 QString::null, 0, this, 0 );
108 m_connect->addTo( m_console ); 109 m_connect->addTo( m_console );
109 connect(m_connect, SIGNAL(activated() ), 110 connect(m_connect, SIGNAL(activated() ),
110 this, SLOT(slotConnect() ) ); 111 this, SLOT(slotConnect() ) );
111 112
112 /* 113 /*
113 * disconnect action 114 * disconnect action
114 */ 115 */
115 m_disconnect = new QAction( tr("Disconnect"), Resource::loadPixmap("console/notconnected"), 116 m_disconnect = new QAction( tr("Disconnect"), Resource::loadPixmap("console/notconnected"),
116 QString::null, 0, this, 0 ); 117 QString::null, 0, this, 0 );
117 m_disconnect->addTo( m_console ); 118 m_disconnect->addTo( m_console );
118 connect(m_disconnect, SIGNAL(activated() ), 119 connect(m_disconnect, SIGNAL(activated() ),
119 this, SLOT(slotDisconnect() ) ); 120 this, SLOT(slotDisconnect() ) );
120 121
121 m_console->insertSeparator(); 122 m_console->insertSeparator();
122 123
124
123 m_quickLaunch = new QAction( tr("QuickLaunch"), Resource::loadPixmap("console/konsole_mini"), QString::null, 0, this, 0 ); 125 m_quickLaunch = new QAction( tr("QuickLaunch"), Resource::loadPixmap("console/konsole_mini"), QString::null, 0, this, 0 );
124 m_quickLaunch->addTo( m_icons ); 126 m_quickLaunch->addTo( m_icons );
125 connect( m_quickLaunch, SIGNAL( activated() ), 127 connect( m_quickLaunch, SIGNAL( activated() ),
126 this, SLOT( slotQuickLaunch() ) ); 128 this, SLOT( slotQuickLaunch() ) );
127 129
130 QWhatsThis::add( m_icons, tr( "The shell button launches the \"default\" profile. If there is none default values are taken" ) );
131
128 m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null, 132 m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null,
129 0, this, 0 ); 133 0, this, 0 );
130 m_transfer->addTo( m_console ); 134 m_transfer->addTo( m_console );
131 connect(m_transfer, SIGNAL(activated() ), 135 connect(m_transfer, SIGNAL(activated() ),
132 this, SLOT(slotTransfer() ) ); 136 this, SLOT(slotTransfer() ) );
133 137
134 138
135 139
136 /* 140 /*
137 * immediate change of line wrap policy 141 * immediate change of line wrap policy
138 */ 142 */
139 m_isWrapped = false; 143 m_isWrapped = false;
140 m_wrap = new QAction( tr("Line wrap"), Resource::loadPixmap( "linewrap" ), QString::null, 0, this, 0 ); 144 m_wrap = new QAction( tr("Line wrap"), Resource::loadPixmap( "linewrap" ), QString::null, 0, this, 0 );
141 m_wrap->addTo( m_console ); 145 m_wrap->addTo( m_console );
142 connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) ); 146 connect( m_wrap, SIGNAL( activated() ), SLOT( slotWrap() ) );
143 147
144 /* 148 /*
145 * fullscreen 149 * fullscreen
146 */ 150 */
147 m_isFullscreen = false; 151 m_isFullscreen = false;
148 152
149 m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" ) 153 m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" )
150 , QString::null, 0, this, 0); 154 , QString::null, 0, this, 0);
151 m_fullscreen->addTo( m_console ); 155 m_fullscreen->addTo( m_console );
@@ -214,75 +218,76 @@ void MainWindow::initUI() {
214 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); 218 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
215 m_keyBar->setHorizontalStretchable( TRUE ); 219 m_keyBar->setHorizontalStretchable( TRUE );
216 m_keyBar->hide(); 220 m_keyBar->hide();
217 221
218 m_kb = new FunctionKeyboard(m_keyBar); 222 m_kb = new FunctionKeyboard(m_keyBar);
219 connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), 223 connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)),
220 this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool))); 224 this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool)));
221 225
222 226
223 a = new QAction(tr("Copy"), 227 a = new QAction(tr("Copy"),
224 Resource::loadPixmap("copy"), QString::null, 228 Resource::loadPixmap("copy"), QString::null,
225 0, this, 0 ); 229 0, this, 0 );
226 //a->addTo( m_icons ); 230 //a->addTo( m_icons );
227 connect( a, SIGNAL(activated() ), 231 connect( a, SIGNAL(activated() ),
228 this, SLOT(slotCopy() ) ); 232 this, SLOT(slotCopy() ) );
229 233
230 QAction *paste = new QAction(tr("Paste"), 234 QAction *paste = new QAction(tr("Paste"),
231 Resource::loadPixmap("paste"), QString::null, 235 Resource::loadPixmap("paste"), QString::null,
232 0, this, 0 ); 236 0, this, 0 );
233 connect( paste, SIGNAL(activated() ), 237 connect( paste, SIGNAL(activated() ),
234 this, SLOT(slotPaste() ) ); 238 this, SLOT(slotPaste() ) );
235 239
236 240
237 newCon->addTo( m_icons ); 241 newCon->addTo( m_icons );
238 m_setProfiles->addTo( m_icons ); 242 //m_setProfiles->addTo( m_icons );
239 paste->addTo( m_icons ); 243 paste->addTo( m_icons );
240 m_openKeys->addTo(m_icons); 244 m_openKeys->addTo(m_icons);
241 m_fullscreen->addTo( m_icons ); 245 m_fullscreen->addTo( m_icons );
242 246
243 m_connect->setEnabled( false ); 247 m_connect->setEnabled( false );
244 m_disconnect->setEnabled( false ); 248 m_disconnect->setEnabled( false );
245 m_terminate->setEnabled( false ); 249 m_terminate->setEnabled( false );
246 m_transfer->setEnabled( false ); 250 m_transfer->setEnabled( false );
247 m_scripts->setItemEnabled(m_runScript_id, false); 251 m_scripts->setItemEnabled(m_runScript_id, false);
248 m_recordScript->setEnabled( false ); 252 m_recordScript->setEnabled( false );
249 m_saveScript->setEnabled( false ); 253 m_saveScript->setEnabled( false );
250 m_fullscreen->setEnabled( false ); 254 m_fullscreen->setEnabled( false );
251 m_closewindow->setEnabled( false ); 255 m_closewindow->setEnabled( false );
252 m_wrap->setEnabled( false ); 256 m_wrap->setEnabled( false );
253 257
254 /* 258 /*
255 * connect to the menu activation 259 * connect to the menu activation
256 */ 260 */
257 connect( m_sessionsPop, SIGNAL(activated( int ) ), 261 connect( m_sessionsPop, SIGNAL(activated( int ) ),
258 this, SLOT(slotProfile( int ) ) ); 262 this, SLOT(slotProfile( int ) ) );
259 263
260 m_consoleWindow = new TabWidget( this, "blah"); 264 m_consoleWindow = new TabWidget( this, "blah");
261 connect(m_consoleWindow, SIGNAL(activated(Session*) ), 265 connect(m_consoleWindow, SIGNAL(activated(Session*) ),
262 this, SLOT(slotSessionChanged(Session*) ) ); 266 this, SLOT(slotSessionChanged(Session*) ) );
263 setCentralWidget( m_consoleWindow ); 267 setCentralWidget( m_consoleWindow );
264 268
269 slotQuickLaunch();
265} 270}
266 271
267ProfileManager* MainWindow::manager() { 272ProfileManager* MainWindow::manager() {
268 return m_manager; 273 return m_manager;
269} 274}
270TabWidget* MainWindow::tabWidget() { 275TabWidget* MainWindow::tabWidget() {
271 return m_consoleWindow; 276 return m_consoleWindow;
272} 277}
273void MainWindow::populateProfiles() { 278void MainWindow::populateProfiles() {
274 m_sessionsPop->clear(); 279 m_sessionsPop->clear();
275 Profile::ValueList list = manager()->all(); 280 Profile::ValueList list = manager()->all();
276 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) { 281 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) {
277 m_sessionsPop->insertItem( (*it).name() ); 282 m_sessionsPop->insertItem( (*it).name() );
278 } 283 }
279 284
280} 285}
281 286
282void MainWindow::populateScripts() { 287void MainWindow::populateScripts() {
283 m_scriptsPop->clear(); 288 m_scriptsPop->clear();
284 m_scriptsData.clear(); 289 m_scriptsData.clear();
285 DocLnkSet files(QPEApplication::documentDir(), "text/plain"); 290 DocLnkSet files(QPEApplication::documentDir(), "text/plain");
286 QListIterator<DocLnk> dit(files.children()); 291 QListIterator<DocLnk> dit(files.children());
287 for (; dit.current(); ++dit) { 292 for (; dit.current(); ++dit) {
288 if (*dit && (*dit)->name().length()>0) { 293 if (*dit && (*dit)->name().length()>0) {