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 | |||
@@ -88,27 +88,27 @@ void FixIt::fixIt() { | |||
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 | |||
@@ -41,32 +41,33 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow( | |||
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 | /* |
@@ -107,37 +108,40 @@ void MainWindow::initUI() { | |||
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 | ||
@@ -222,59 +226,60 @@ void MainWindow::initUI() { | |||
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 | } |