author | harlekin <harlekin> | 2003-03-23 14:45:21 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-03-23 14:45:21 (UTC) |
commit | fd1b86e8590b34efb38b82953e5bf897a8de1cdf (patch) (unidiff) | |
tree | 3e4b84c715084bedf08e33f6f8b1b2db032c5259 | |
parent | 376aa038c75b3fbccdcb2e81d5b2ac3de787a447 (diff) | |
download | opie-fd1b86e8590b34efb38b82953e5bf897a8de1cdf.zip opie-fd1b86e8590b34efb38b82953e5bf897a8de1cdf.tar.gz opie-fd1b86e8590b34efb38b82953e5bf897a8de1cdf.tar.bz2 |
spawn default profile on startup
-rw-r--r-- | noncore/apps/opie-console/main.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 7 |
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 | |||
@@ -40,75 +40,75 @@ FixIt::FixIt() { | |||
40 | # 5 - JavaVM(Intent) | 40 | # 5 - JavaVM(Intent) |
41 | # 6 - reboot (Do NOT set initdefault to this) | 41 | # 6 - reboot (Do NOT set initdefault to this) |
42 | # | 42 | # |
43 | id:5:initdefault: | 43 | id:5:initdefault: |
44 | 44 | ||
45 | # Specify things to do when starting | 45 | # Specify things to do when starting |
46 | si::sysinit:/etc/rc.d/rc.sysinit | 46 | si::sysinit:/etc/rc.d/rc.sysinit |
47 | 47 | ||
48 | l0:0:wait:/root/etc/rc.d/rc 0 | 48 | l0:0:wait:/root/etc/rc.d/rc 0 |
49 | l1:1:wait:/etc/rc.d/rc 1 | 49 | l1:1:wait:/etc/rc.d/rc 1 |
50 | l2:2:wait:/etc/rc.d/rc 2 | 50 | l2:2:wait:/etc/rc.d/rc 2 |
51 | l3:3:wait:/etc/rc.d/rc 3 | 51 | l3:3:wait:/etc/rc.d/rc 3 |
52 | l4:4:wait:/etc/rc.d/rc 4 | 52 | l4:4:wait:/etc/rc.d/rc 4 |
53 | l5:5:wait:/etc/rc.d/rc 5 | 53 | l5:5:wait:/etc/rc.d/rc 5 |
54 | l6:6:wait:/root/etc/rc.d/rc 6 | 54 | l6:6:wait:/root/etc/rc.d/rc 6 |
55 | 55 | ||
56 | # Specify things to do before rebooting | 56 | # Specify things to do before rebooting |
57 | um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1 | 57 | um::ctrlaltdel:/bin/umount -a -r > /dev/null 2>&1 |
58 | sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1 | 58 | sw::ctrlaltdel:/sbin/swapoff -a > /dev/null 2>&1 |
59 | 59 | ||
60 | # Specify program to run on ttyS0 | 60 | # Specify program to run on ttyS0 |
61 | s0:24:respawn:/sbin/getty 9600 ttyS0 | 61 | s0:24:respawn:/sbin/getty 9600 ttyS0 |
62 | #pd:5:respawn:/etc/sync/serialctl | 62 | #pd:5:respawn:/etc/sync/serialctl |
63 | 63 | ||
64 | # Specify program to run on tty1 | 64 | # Specify program to run on tty1 |
65 | 1:2:respawn:/sbin/getty 9600 tty1 | 65 | 1:2:respawn:/sbin/getty 9600 tty1 |
66 | ln:345:respawn:survive -l 6 /sbin/launch | 66 | ln:345:respawn:survive -l 6 /sbin/launch |
67 | #qt:5:respawn:/sbin/qt | 67 | #qt:5:respawn:/sbin/qt |
68 | 68 | ||
69 | # collie sp. | 69 | # collie sp. |
70 | sy::respawn:/sbin/shsync\n"; | 70 | sy::respawn:/sbin/shsync\n"; |
71 | 71 | ||
72 | 72 | ||
73 | } | 73 | } |
74 | FixIt::~FixIt() { | 74 | FixIt::~FixIt() { |
75 | } | 75 | } |
76 | /* | 76 | /* |
77 | * the retail Zaurus is broken in many ways | 77 | * the retail Zaurus is broken in many ways |
78 | * one is that pppd is listening on our port... | 78 | * one is that pppd is listening on our port... |
79 | * we've to stop it from that and then do kill(SIGHUP,1); | 79 | * we've to stop it from that and then do kill(SIGHUP,1); |
80 | */ | 80 | */ |
81 | void FixIt::fixIt() { | 81 | void 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 | ||
93 | int main(int argc, char **argv) { | 93 | int 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 | |||
@@ -1,328 +1,333 @@ | |||
1 | #include <assert.h> | 1 | #include <assert.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qmenubar.h> | 4 | #include <qmenubar.h> |
5 | #include <qlabel.h> | 5 | #include <qlabel.h> |
6 | #include <qpopupmenu.h> | 6 | #include <qpopupmenu.h> |
7 | #include <qtoolbar.h> | 7 | #include <qtoolbar.h> |
8 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
9 | #include <qpushbutton.h> | 9 | #include <qpushbutton.h> |
10 | #include <qwhatsthis.h> | 10 | #include <qwhatsthis.h> |
11 | #include <qfileinfo.h> | 11 | #include <qfileinfo.h> |
12 | #include <qtextstream.h> | 12 | #include <qtextstream.h> |
13 | 13 | ||
14 | #include <qpe/resource.h> | 14 | #include <qpe/resource.h> |
15 | #include <qpe/qpeapplication.h> | 15 | #include <qpe/qpeapplication.h> |
16 | #include <qpe/filemanager.h> | 16 | #include <qpe/filemanager.h> |
17 | #include <qpe/mimetype.h> | 17 | #include <qpe/mimetype.h> |
18 | 18 | ||
19 | #include <opie/ofiledialog.h> | 19 | #include <opie/ofiledialog.h> |
20 | 20 | ||
21 | #include "TEmulation.h" | 21 | #include "TEmulation.h" |
22 | #include "keytrans.h" | 22 | #include "keytrans.h" |
23 | #include "profileeditordialog.h" | 23 | #include "profileeditordialog.h" |
24 | #include "configdialog.h" | 24 | #include "configdialog.h" |
25 | #include "default.h" | 25 | #include "default.h" |
26 | #include "metafactory.h" | 26 | #include "metafactory.h" |
27 | #include "profile.h" | 27 | #include "profile.h" |
28 | #include "profilemanager.h" | 28 | #include "profilemanager.h" |
29 | #include "mainwindow.h" | 29 | #include "mainwindow.h" |
30 | #include "tabwidget.h" | 30 | #include "tabwidget.h" |
31 | #include "transferdialog.h" | 31 | #include "transferdialog.h" |
32 | #include "function_keyboard.h" | 32 | #include "function_keyboard.h" |
33 | #include "emulation_handler.h" | 33 | #include "emulation_handler.h" |
34 | #include "script.h" | 34 | #include "script.h" |
35 | 35 | ||
36 | 36 | ||
37 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 37 | MainWindow::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 | ||
56 | void MainWindow::initUI() { | 56 | void 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() ) ); |
81 | 82 | ||
82 | m_console->insertSeparator(); | 83 | m_console->insertSeparator(); |
83 | /* | 84 | /* |
84 | * new Action for new sessions | 85 | * new Action for new sessions |
85 | */ | 86 | */ |
86 | QAction* newCon = new QAction(tr("New Connection"), | 87 | QAction* newCon = new QAction(tr("New Connection"), |
87 | Resource::loadPixmap( "new" ), | 88 | Resource::loadPixmap( "new" ), |
88 | QString::null, 0, this, 0); | 89 | QString::null, 0, this, 0); |
89 | newCon->addTo( m_console ); | 90 | newCon->addTo( m_console ); |
90 | connect( newCon, SIGNAL(activated() ), | 91 | connect( newCon, SIGNAL(activated() ), |
91 | this, SLOT(slotNew() ) ); | 92 | this, SLOT(slotNew() ) ); |
92 | 93 | ||
93 | m_console->insertSeparator(); | 94 | m_console->insertSeparator(); |
94 | 95 | ||
95 | QAction *saveCon = new QAction(tr("Save Connection"), | 96 | QAction *saveCon = new QAction(tr("Save Connection"), |
96 | Resource::loadPixmap( "save" ), QString::null, | 97 | Resource::loadPixmap( "save" ), QString::null, |
97 | 0, this, 0 ); | 98 | 0, this, 0 ); |
98 | saveCon->addTo( m_console ); | 99 | saveCon->addTo( m_console ); |
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 ); |
152 | connect( m_fullscreen, SIGNAL( activated() ), | 156 | connect( m_fullscreen, SIGNAL( activated() ), |
153 | this, SLOT( slotFullscreen() ) ); | 157 | this, SLOT( slotFullscreen() ) ); |
154 | 158 | ||
155 | m_console->insertSeparator(); | 159 | m_console->insertSeparator(); |
156 | 160 | ||
157 | QAction *a = new QAction(); | 161 | QAction *a = new QAction(); |
158 | a->setText( tr("Save history") ); | 162 | a->setText( tr("Save history") ); |
159 | a->addTo( m_console ); | 163 | a->addTo( m_console ); |
160 | connect(a, SIGNAL(activated() ), | 164 | connect(a, SIGNAL(activated() ), |
161 | this, SLOT(slotSaveHistory() ) ); | 165 | this, SLOT(slotSaveHistory() ) ); |
162 | /* | 166 | /* |
163 | * terminate action | 167 | * terminate action |
164 | */ | 168 | */ |
165 | m_terminate = new QAction(); | 169 | m_terminate = new QAction(); |
166 | m_terminate->setText( tr("Terminate") ); | 170 | m_terminate->setText( tr("Terminate") ); |
167 | m_terminate->addTo( m_console ); | 171 | m_terminate->addTo( m_console ); |
168 | connect(m_terminate, SIGNAL(activated() ), | 172 | connect(m_terminate, SIGNAL(activated() ), |
169 | this, SLOT(slotTerminate() ) ); | 173 | this, SLOT(slotTerminate() ) ); |
170 | 174 | ||
171 | m_closewindow = new QAction(); | 175 | m_closewindow = new QAction(); |
172 | m_closewindow->setText( tr("Close Window") ); | 176 | m_closewindow->setText( tr("Close Window") ); |
173 | m_closewindow->addTo( m_console ); | 177 | m_closewindow->addTo( m_console ); |
174 | connect( m_closewindow, SIGNAL(activated() ), | 178 | connect( m_closewindow, SIGNAL(activated() ), |
175 | this, SLOT(slotClose() ) ); | 179 | this, SLOT(slotClose() ) ); |
176 | 180 | ||
177 | 181 | ||
178 | /* | 182 | /* |
179 | * script actions | 183 | * script actions |
180 | */ | 184 | */ |
181 | m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0); | 185 | m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0); |
182 | connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int))); | 186 | connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int))); |
183 | 187 | ||
184 | m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); | 188 | m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); |
185 | m_recordScript->addTo(m_scripts); | 189 | m_recordScript->addTo(m_scripts); |
186 | connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); | 190 | connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); |
187 | 191 | ||
188 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); | 192 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); |
189 | m_saveScript->addTo(m_scripts); | 193 | m_saveScript->addTo(m_scripts); |
190 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); | 194 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); |
191 | 195 | ||
192 | 196 | ||
193 | /* | 197 | /* |
194 | * action that open/closes the keyboard | 198 | * action that open/closes the keyboard |
195 | */ | 199 | */ |
196 | m_openKeys = new QAction (tr("Open Keyboard..."), | 200 | m_openKeys = new QAction (tr("Open Keyboard..."), |
197 | Resource::loadPixmap( "console/keys/keyboard_icon" ), | 201 | Resource::loadPixmap( "console/keys/keyboard_icon" ), |
198 | QString::null, 0, this, 0); | 202 | QString::null, 0, this, 0); |
199 | m_openKeys->setToggleAction(true); | 203 | m_openKeys->setToggleAction(true); |
200 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); | 204 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); |
201 | 205 | ||
202 | /* insert the submenu */ | 206 | /* insert the submenu */ |
203 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, | 207 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, |
204 | -1, 0); | 208 | -1, 0); |
205 | 209 | ||
206 | /* insert the connection menu */ | 210 | /* insert the connection menu */ |
207 | m_bar->insertItem( tr("Connection"), m_console ); | 211 | m_bar->insertItem( tr("Connection"), m_console ); |
208 | 212 | ||
209 | /* the scripts menu */ | 213 | /* the scripts menu */ |
210 | m_bar->insertItem( tr("Scripts"), m_scripts ); | 214 | m_bar->insertItem( tr("Scripts"), m_scripts ); |
211 | 215 | ||
212 | /* and the keyboard */ | 216 | /* and the keyboard */ |
213 | m_keyBar = new QToolBar(this); | 217 | m_keyBar = new QToolBar(this); |
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 | ||
267 | ProfileManager* MainWindow::manager() { | 272 | ProfileManager* MainWindow::manager() { |
268 | return m_manager; | 273 | return m_manager; |
269 | } | 274 | } |
270 | TabWidget* MainWindow::tabWidget() { | 275 | TabWidget* MainWindow::tabWidget() { |
271 | return m_consoleWindow; | 276 | return m_consoleWindow; |
272 | } | 277 | } |
273 | void MainWindow::populateProfiles() { | 278 | void 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 | ||
282 | void MainWindow::populateScripts() { | 287 | void 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) { |
289 | QFileInfo info((*dit)->file()); | 294 | QFileInfo info((*dit)->file()); |
290 | if (info.extension(false) == "script") { | 295 | if (info.extension(false) == "script") { |
291 | m_scriptsData.append(new DocLnk(**dit)); | 296 | m_scriptsData.append(new DocLnk(**dit)); |
292 | m_scriptsPop->insertItem((*dit)->name()); | 297 | m_scriptsPop->insertItem((*dit)->name()); |
293 | } | 298 | } |
294 | } | 299 | } |
295 | } | 300 | } |
296 | 301 | ||
297 | } | 302 | } |
298 | 303 | ||
299 | MainWindow::~MainWindow() { | 304 | MainWindow::~MainWindow() { |
300 | delete m_factory; | 305 | delete m_factory; |
301 | manager()->save(); | 306 | manager()->save(); |
302 | } | 307 | } |
303 | 308 | ||
304 | MetaFactory* MainWindow::factory() { | 309 | MetaFactory* MainWindow::factory() { |
305 | return m_factory; | 310 | return m_factory; |
306 | } | 311 | } |
307 | 312 | ||
308 | Session* MainWindow::currentSession() { | 313 | Session* MainWindow::currentSession() { |
309 | return m_curSession; | 314 | return m_curSession; |
310 | } | 315 | } |
311 | 316 | ||
312 | QList<Session> MainWindow::sessions() { | 317 | QList<Session> MainWindow::sessions() { |
313 | return m_sessions; | 318 | return m_sessions; |
314 | } | 319 | } |
315 | 320 | ||
316 | void MainWindow::slotNew() { | 321 | void MainWindow::slotNew() { |
317 | ProfileEditorDialog dlg(factory() ); | 322 | ProfileEditorDialog dlg(factory() ); |
318 | dlg.showMaximized(); | 323 | dlg.showMaximized(); |
319 | dlg.setCaption( tr("New Connection") ); | 324 | dlg.setCaption( tr("New Connection") ); |
320 | int ret = dlg.exec(); | 325 | int ret = dlg.exec(); |
321 | 326 | ||
322 | if ( ret == QDialog::Accepted ) { | 327 | if ( ret == QDialog::Accepted ) { |
323 | create( dlg.profile() ); | 328 | create( dlg.profile() ); |
324 | } | 329 | } |
325 | } | 330 | } |
326 | 331 | ||
327 | void MainWindow::slotRecordScript() { | 332 | void MainWindow::slotRecordScript() { |
328 | if (currentSession()) { | 333 | if (currentSession()) { |