summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 0a58b6c..bfd1c2e 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -54,53 +54,53 @@ void MainWindow::initUI() {
54 QString::null, 0, this, 0); 54 QString::null, 0, this, 0);
55 a->addTo( m_console ); 55 a->addTo( m_console );
56 a->addTo( m_icons ); 56 a->addTo( m_icons );
57 connect(a, SIGNAL(activated() ), 57 connect(a, SIGNAL(activated() ),
58 this, SLOT(slotNew() ) ); 58 this, SLOT(slotNew() ) );
59 59
60 /* 60 /*
61 * connect action 61 * connect action
62 */ 62 */
63 m_connect = new QAction(); 63 m_connect = new QAction();
64 m_connect->setText( tr("Connect") ); 64 m_connect->setText( tr("Connect") );
65 m_connect->addTo( m_console ); 65 m_connect->addTo( m_console );
66 connect(m_connect, SIGNAL(activated() ), 66 connect(m_connect, SIGNAL(activated() ),
67 this, SLOT(slotConnect() ) ); 67 this, SLOT(slotConnect() ) );
68 68
69 /* 69 /*
70 * disconnect action 70 * disconnect action
71 */ 71 */
72 m_disconnect = new QAction(); 72 m_disconnect = new QAction();
73 m_disconnect->setText( tr("Disconnect") ); 73 m_disconnect->setText( tr("Disconnect") );
74 m_disconnect->addTo( m_console ); 74 m_disconnect->addTo( m_console );
75 connect(m_disconnect, SIGNAL(activated() ), 75 connect(m_disconnect, SIGNAL(activated() ),
76 this, SLOT(slotDisconnect() ) ); 76 this, SLOT(slotDisconnect() ) );
77 77
78 m_transfer = new QAction(); 78 m_transfer = new QAction();
79 m_transfer->setText( tr("Transfer file...") ); 79 m_transfer->setText( tr("Transfer file...") );
80 m_transfer->addTo( m_console ); 80 m_transfer->addTo( m_console );
81 connect(m_transfer, SIGNAL(activated() ), 81 connect(m_transfer, SIGNAL(activated() ),
82 this, SLOT(slotTransfer() ) ); 82 this, SLOT(slotTransfer() ) );
83 83
84 /* 84 /*
85 * terminate action 85 * terminate action
86 */ 86 */
87 m_terminate = new QAction(); 87 m_terminate = new QAction();
88 m_terminate->setText( tr("Terminate") ); 88 m_terminate->setText( tr("Terminate") );
89 m_terminate->addTo( m_console ); 89 m_terminate->addTo( m_console );
90 connect(m_terminate, SIGNAL(activated() ), 90 connect(m_terminate, SIGNAL(activated() ),
91 this, SLOT(slotTerminate() ) ); 91 this, SLOT(slotTerminate() ) );
92 92
93 a = new QAction(); 93 a = new QAction();
94 a->setText( tr("Close Window") ); 94 a->setText( tr("Close Window") );
95 a->addTo( m_console ); 95 a->addTo( m_console );
96 connect(a, SIGNAL(activated() ), 96 connect(a, SIGNAL(activated() ),
97 this, SLOT(slotClose() ) ); 97 this, SLOT(slotClose() ) );
98 98
99 /* 99 /*
100 * the settings action 100 * the settings action
101 */ 101 */
102 m_setProfiles = new QAction(tr("Configure Profiles"), 102 m_setProfiles = new QAction(tr("Configure Profiles"),
103 Resource::loadPixmap( "SettingsIcon" ), 103 Resource::loadPixmap( "SettingsIcon" ),
104 QString::null, 0, this, 0); 104 QString::null, 0, this, 0);
105 m_setProfiles->addTo( m_settings ); 105 m_setProfiles->addTo( m_settings );
106 m_setProfiles->addTo( m_icons ); 106 m_setProfiles->addTo( m_icons );
@@ -143,48 +143,50 @@ void MainWindow::initUI() {
143 /* insert the connection menu */ 143 /* insert the connection menu */
144 m_bar->insertItem( tr("Connection"), m_console ); 144 m_bar->insertItem( tr("Connection"), m_console );
145 145
146 /* the scripts menu */ 146 /* the scripts menu */
147 m_bar->insertItem( tr("Scripts"), m_scripts ); 147 m_bar->insertItem( tr("Scripts"), m_scripts );
148 148
149 /* the settings menu */ 149 /* the settings menu */
150 m_bar->insertItem( tr("Settings"), m_settings ); 150 m_bar->insertItem( tr("Settings"), m_settings );
151 151
152 /* and the keyboard */ 152 /* and the keyboard */
153 m_keyBar = new QToolBar(this); 153 m_keyBar = new QToolBar(this);
154 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); 154 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
155 m_keyBar->setHorizontalStretchable( TRUE ); 155 m_keyBar->setHorizontalStretchable( TRUE );
156 m_keyBar->hide(); 156 m_keyBar->hide();
157 157
158 m_kb = new FunctionKeyboard(m_keyBar); 158 m_kb = new FunctionKeyboard(m_keyBar);
159 159
160 /* 160 /*
161 * connect to the menu activation 161 * connect to the menu activation
162 */ 162 */
163 connect( m_sessionsPop, SIGNAL(activated( int ) ), 163 connect( m_sessionsPop, SIGNAL(activated( int ) ),
164 this, SLOT(slotProfile( int ) ) ); 164 this, SLOT(slotProfile( int ) ) );
165 165
166 m_consoleWindow = new TabWidget( this, "blah"); 166 m_consoleWindow = new TabWidget( this, "blah");
167 connect(m_consoleWindow, SIGNAL(activated(Session*) ),
168 this, SLOT(slotSessionChanged(Session*) ) );
167 setCentralWidget( m_consoleWindow ); 169 setCentralWidget( m_consoleWindow );
168 170
169} 171}
170 172
171ProfileManager* MainWindow::manager() { 173ProfileManager* MainWindow::manager() {
172 return m_manager; 174 return m_manager;
173} 175}
174TabWidget* MainWindow::tabWidget() { 176TabWidget* MainWindow::tabWidget() {
175 return m_consoleWindow; 177 return m_consoleWindow;
176} 178}
177void MainWindow::populateProfiles() { 179void MainWindow::populateProfiles() {
178 m_sessionsPop->clear(); 180 m_sessionsPop->clear();
179 Profile::ValueList list = manager()->all(); 181 Profile::ValueList list = manager()->all();
180 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) { 182 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) {
181 m_sessionsPop->insertItem( (*it).name() ); 183 m_sessionsPop->insertItem( (*it).name() );
182 } 184 }
183 185
184} 186}
185MainWindow::~MainWindow() { 187MainWindow::~MainWindow() {
186 delete m_factory; 188 delete m_factory;
187 manager()->save(); 189 manager()->save();
188} 190}
189 191
190MetaFactory* MainWindow::factory() { 192MetaFactory* MainWindow::factory() {
@@ -307,24 +309,30 @@ void MainWindow::create( const Profile& prof ) {
307 Session *ses = manager()->fromProfile( prof, tabWidget() ); 309 Session *ses = manager()->fromProfile( prof, tabWidget() );
308 310
309 m_sessions.append( ses ); 311 m_sessions.append( ses );
310 tabWidget()->add( ses ); 312 tabWidget()->add( ses );
311 m_curSession = ses; 313 m_curSession = ses;
312 314
313} 315}
314 316
315void MainWindow::slotTransfer() 317void MainWindow::slotTransfer()
316{ 318{
317 if ( currentSession() ) { 319 if ( currentSession() ) {
318 TransferDialog dlg(this); 320 TransferDialog dlg(this);
319 //dlg.showMaximized(); 321 //dlg.showMaximized();
320 dlg.exec(); 322 dlg.exec();
321 } 323 }
322} 324}
323 325
324 326
325void MainWindow::slotOpenKeb(bool state) { 327void MainWindow::slotOpenKeb(bool state) {
326 328
327 if (state) m_keyBar->show(); 329 if (state) m_keyBar->show();
328 else m_keyBar->hide(); 330 else m_keyBar->hide();
329 331
330} 332}
333void MainWindow::slotSessionChanged( Session* ses ) {
334 if ( ses ) {
335 qWarning("changing %s", ses->name().latin1() );
336 m_curSession = ses;
337 }
338}