summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 408d3dd..3066b35 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -45,37 +45,53 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(
45 m_manager->load(); 45 m_manager->load();
46 46
47 initUI(); 47 initUI();
48 populateProfiles(); 48 populateProfiles();
49} 49}
50void MainWindow::initUI() { 50void MainWindow::initUI() {
51 setToolBarsMovable( FALSE ); 51 setToolBarsMovable( FALSE );
52 52
53 /* tool bar for the menu */ 53 /* tool bar for the menu */
54 m_tool = new QToolBar( this ); 54 m_tool = new QToolBar( this );
55 m_tool->setHorizontalStretchable( TRUE ); 55 m_tool->setHorizontalStretchable( TRUE );
56 56
57 m_bar = new QMenuBar( m_tool ); 57 m_bar = new QMenuBar( m_tool );
58 m_console = new QPopupMenu( this ); 58 m_console = new QPopupMenu( this );
59 m_scripts = new QPopupMenu( this ); 59 m_scripts = new QPopupMenu( this );
60 m_sessionsPop= new QPopupMenu( this ); 60 m_sessionsPop= new QPopupMenu( this );
61 m_settings = new QPopupMenu( this ); 61 //m_settings = new QPopupMenu( this );
62 62
63 /* add a toolbar for icons */ 63 /* add a toolbar for icons */
64 m_icons = new QToolBar(this); 64 m_icons = new QToolBar(this);
65 65
66
67
68
69 /*
70 * the settings action
71 */
72 m_setProfiles = new QAction(tr("Configure Profiles"),
73 Resource::loadPixmap( "SettingsIcon" ),
74 QString::null, 0, this, 0);
75 // m_setProfiles->addTo( m_settings );
76 m_setProfiles->addTo( m_icons );
77 m_setProfiles->addTo( m_console );
78 connect( m_setProfiles, SIGNAL(activated() ),
79 this, SLOT(slotConfigure() ) );
80
81
66 /* 82 /*
67 * new Action for new sessions 83 * new Action for new sessions
68 */ 84 */
69 QAction* a = new QAction(tr("New Connection"), 85 QAction* a = new QAction(tr("New Connection"),
70 Resource::loadPixmap( "new" ), 86 Resource::loadPixmap( "new" ),
71 QString::null, 0, this, 0); 87 QString::null, 0, this, 0);
72 a->addTo( m_console ); 88 a->addTo( m_console );
73 a->addTo( m_icons ); 89 a->addTo( m_icons );
74 connect(a, SIGNAL(activated() ), 90 connect(a, SIGNAL(activated() ),
75 this, SLOT(slotNew() ) ); 91 this, SLOT(slotNew() ) );
76 92
77 /* 93 /*
78 * connect action 94 * connect action
79 */ 95 */
80 m_connect = new QAction(); 96 m_connect = new QAction();
81 m_connect->setText( tr("Connect") ); 97 m_connect->setText( tr("Connect") );
@@ -113,42 +129,32 @@ void MainWindow::initUI() {
113 129
114 /* 130 /*
115 * terminate action 131 * terminate action
116 */ 132 */
117 m_terminate = new QAction(); 133 m_terminate = new QAction();
118 m_terminate->setText( tr("Terminate") ); 134 m_terminate->setText( tr("Terminate") );
119 m_terminate->addTo( m_console ); 135 m_terminate->addTo( m_console );
120 connect(m_terminate, SIGNAL(activated() ), 136 connect(m_terminate, SIGNAL(activated() ),
121 this, SLOT(slotTerminate() ) ); 137 this, SLOT(slotTerminate() ) );
122 138
123 m_closewindow = new QAction(); 139 m_closewindow = new QAction();
124 m_closewindow->setText( tr("Close Window") ); 140 m_closewindow->setText( tr("Close Window") );
125 m_closewindow->addTo( m_console ); 141 m_closewindow->addTo( m_console );
126 connect( m_closewindow, SIGNAL(activated() ), 142 connect( m_closewindow, SIGNAL(activated() ),
127 this, SLOT(slotClose() ) ); 143 this, SLOT(slotClose() ) );
128 144
129 /*
130 * the settings action
131 */
132 m_setProfiles = new QAction(tr("Configure Profiles"),
133 Resource::loadPixmap( "SettingsIcon" ),
134 QString::null, 0, this, 0);
135 m_setProfiles->addTo( m_settings );
136 m_setProfiles->addTo( m_icons );
137 connect( m_setProfiles, SIGNAL(activated() ),
138 this, SLOT(slotConfigure() ) );
139 145
140 /* 146 /*
141 * script actions 147 * script actions
142 */ 148 */
143 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); 149 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0);
144 m_recordScript->addTo(m_scripts); 150 m_recordScript->addTo(m_scripts);
145 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); 151 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript()));
146 152
147 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); 153 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0);
148 m_saveScript->addTo(m_scripts); 154 m_saveScript->addTo(m_scripts);
149 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); 155 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript()));
150 156
151 m_runScript = new QAction(tr("Run Script"), QString::null, 0, this, 0); 157 m_runScript = new QAction(tr("Run Script"), QString::null, 0, this, 0);
152 m_runScript->addTo(m_scripts); 158 m_runScript->addTo(m_scripts);
153 connect(m_runScript, SIGNAL(activated()), this, SLOT(slotRunScript())); 159 connect(m_runScript, SIGNAL(activated()), this, SLOT(slotRunScript()));
154 160
@@ -164,33 +170,33 @@ void MainWindow::initUI() {
164 connect (m_openKeys, SIGNAL(toggled(bool)), 170 connect (m_openKeys, SIGNAL(toggled(bool)),
165 this, SLOT(slotOpenKeb(bool))); 171 this, SLOT(slotOpenKeb(bool)));
166 m_openKeys->addTo(m_icons); 172 m_openKeys->addTo(m_icons);
167 173
168 174
169 /* insert the submenu */ 175 /* insert the submenu */
170 m_console->insertItem(tr("New from Profile"), m_sessionsPop, 176 m_console->insertItem(tr("New from Profile"), m_sessionsPop,
171 -1, 0); 177 -1, 0);
172 178
173 /* insert the connection menu */ 179 /* insert the connection menu */
174 m_bar->insertItem( tr("Connection"), m_console ); 180 m_bar->insertItem( tr("Connection"), m_console );
175 181
176 /* the scripts menu */ 182 /* the scripts menu */
177 m_bar->insertItem( tr("Scripts"), m_scripts ); 183 m_bar->insertItem( tr("Scripts"), m_scripts );
178 184
179 /* the settings menu */ 185 /* the settings menu */
180 m_bar->insertItem( tr("Settings"), m_settings ); 186 // m_bar->insertItem( tr("Settings"), m_settings );
181 187
182 /* and the keyboard */ 188 /* and the keyboard */
183 m_keyBar = new QToolBar(this); 189 m_keyBar = new QToolBar(this);
184 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); 190 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
185 m_keyBar->setHorizontalStretchable( TRUE ); 191 m_keyBar->setHorizontalStretchable( TRUE );
186 m_keyBar->hide(); 192 m_keyBar->hide();
187 193
188 m_kb = new FunctionKeyboard(m_keyBar); 194 m_kb = new FunctionKeyboard(m_keyBar);
189 connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)), 195 connect(m_kb, SIGNAL(keyPressed(ushort, ushort, bool, bool, bool)),
190 this, SLOT(slotKeyReceived(ushort, ushort, bool, bool, bool))); 196 this, SLOT(slotKeyReceived(ushort, ushort, bool, bool, bool)));
191 197
192 198
193 199
194 m_connect->setEnabled( false ); 200 m_connect->setEnabled( false );
195 m_disconnect->setEnabled( false ); 201 m_disconnect->setEnabled( false );
196 m_terminate->setEnabled( false ); 202 m_terminate->setEnabled( false );