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.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index c48116d..3c9603c 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -63,58 +63,58 @@ void MainWindow::initUI() {
63 63
64 m_bar = new QMenuBar( m_tool ); 64 m_bar = new QMenuBar( m_tool );
65 m_console = new QPopupMenu( this ); 65 m_console = new QPopupMenu( this );
66 m_scripts = new QPopupMenu( this ); 66 m_scripts = new QPopupMenu( this );
67 m_sessionsPop= new QPopupMenu( this ); 67 m_sessionsPop= new QPopupMenu( this );
68 m_scriptsPop = new QPopupMenu( this ); 68 m_scriptsPop = new QPopupMenu( this );
69 69
70 /* add a toolbar for icons */ 70 /* add a toolbar for icons */
71 m_icons = new QToolBar(this); 71 m_icons = new QToolBar(this);
72 72
73 /* 73 /*
74 * the settings action 74 * the settings action
75 */ 75 */
76 m_setProfiles = new QAction(tr("Configure Profiles"), 76 m_setProfiles = new QAction(tr("Configure Profiles"),
77 Resource::loadPixmap( "SettingsIcon" ), 77 Resource::loadPixmap( "SettingsIcon" ),
78 QString::null, 0, this, 0); 78 QString::null, 0, this, 0);
79 m_setProfiles->addTo( m_console ); 79 m_setProfiles->addTo( m_console );
80 connect( m_setProfiles, SIGNAL(activated() ), 80 connect( m_setProfiles, SIGNAL(activated() ),
81 this, SLOT(slotConfigure() ) ); 81 this, SLOT(slotConfigure() ) );
82 82
83 m_console->insertSeparator(); 83 m_console->insertSeparator();
84 /* 84 /*
85 * new Action for new sessions 85 * new Action for new sessions
86 */ 86 */
87 QAction* newCon = new QAction(tr("New Connection"), 87 QAction* newCon = new QAction(tr("New Profile"),
88 Resource::loadPixmap( "new" ), 88 Resource::loadPixmap( "new" ),
89 QString::null, 0, this, 0); 89 QString::null, 0, this, 0);
90 newCon->addTo( m_console ); 90 newCon->addTo( m_console );
91 connect( newCon, SIGNAL(activated() ), 91 connect( newCon, SIGNAL(activated() ),
92 this, SLOT(slotNew() ) ); 92 this, SLOT(slotNew() ) );
93 93
94 m_console->insertSeparator(); 94 m_console->insertSeparator();
95 95
96 QAction *saveCon = new QAction(tr("Save Connection"), 96 QAction *saveCon = new QAction( tr("Save Profile" ),
97 Resource::loadPixmap( "save" ), QString::null, 97 Resource::loadPixmap( "save" ), QString::null,
98 0, this, 0 ); 98 0, this, 0 );
99 saveCon->addTo( m_console ); 99 saveCon->addTo( m_console );
100 connect( saveCon, SIGNAL(activated() ), 100 connect( saveCon, SIGNAL(activated() ),
101 this, SLOT(slotSaveSession() ) ); 101 this, SLOT(slotSaveSession() ) );
102 m_console->insertSeparator(); 102 m_console->insertSeparator();
103 103
104 /* 104 /*
105 * connect action 105 * connect action
106 */ 106 */
107 m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"), 107 m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"),
108 QString::null, 0, this, 0 ); 108 QString::null, 0, this, 0 );
109 m_connect->addTo( m_console ); 109 m_connect->addTo( m_console );
110 connect(m_connect, SIGNAL(activated() ), 110 connect(m_connect, SIGNAL(activated() ),
111 this, SLOT(slotConnect() ) ); 111 this, SLOT(slotConnect() ) );
112 112
113 /* 113 /*
114 * disconnect action 114 * disconnect action
115 */ 115 */
116 m_disconnect = new QAction( tr("Disconnect"), Resource::loadPixmap("console/notconnected"), 116 m_disconnect = new QAction( tr("Disconnect"), Resource::loadPixmap("console/notconnected"),
117 QString::null, 0, this, 0 ); 117 QString::null, 0, this, 0 );
118 m_disconnect->addTo( m_console ); 118 m_disconnect->addTo( m_console );
119 connect(m_disconnect, SIGNAL(activated() ), 119 connect(m_disconnect, SIGNAL(activated() ),
120 this, SLOT(slotDisconnect() ) ); 120 this, SLOT(slotDisconnect() ) );
@@ -407,48 +407,49 @@ void MainWindow::slotDisconnect() {
407 } 407 }
408} 408}
409 409
410void MainWindow::slotTerminate() { 410void MainWindow::slotTerminate() {
411 if ( currentSession() ) 411 if ( currentSession() )
412 currentSession()->layer()->close(); 412 currentSession()->layer()->close();
413 413
414 slotClose(); 414 slotClose();
415 /* FIXME move to the next session */ 415 /* FIXME move to the next session */
416} 416}
417 417
418 418
419 419
420 420
421 421
422 422
423void MainWindow::slotQuickLaunch() { 423void MainWindow::slotQuickLaunch() {
424 Profile prof = manager()->profile( "default" ); 424 Profile prof = manager()->profile( "default" );
425 if ( prof.name() == "default" ) { 425 if ( prof.name() == "default" ) {
426 create( prof ); 426 create( prof );
427 } else { 427 } else {
428 Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 ); 428 Profile newProf = Profile( "default", "console", "default" , 0, 3, 0 );
429 newProf.setAutoConnect( true ); 429 newProf.setAutoConnect( true );
430 create( newProf ); 430 create( newProf );
431 slotSaveSession();
431 } 432 }
432 433
433} 434}
434 435
435void MainWindow::slotConfigure() { 436void MainWindow::slotConfigure() {
436 ConfigDialog conf( manager()->all(), factory() ); 437 ConfigDialog conf( manager()->all(), factory() );
437 conf.showMaximized(); 438 conf.showMaximized();
438 439
439 int ret = conf.exec(); 440 int ret = conf.exec();
440 441
441 if ( QDialog::Accepted == ret ) { 442 if ( QDialog::Accepted == ret ) {
442 manager()->setProfiles( conf.list() ); 443 manager()->setProfiles( conf.list() );
443 manager()->save(); 444 manager()->save();
444 populateProfiles(); 445 populateProfiles();
445 } 446 }
446} 447}
447/* 448/*
448 * we will remove 449 * we will remove
449 * this window from the tabwidget 450 * this window from the tabwidget
450 * remove it from the list 451 * remove it from the list
451 * delete it 452 * delete it
452 * and set the currentSession() 453 * and set the currentSession()
453 */ 454 */
454void MainWindow::slotClose() { 455void MainWindow::slotClose() {