summaryrefslogtreecommitdiff
path: root/noncore
authorharlekin <harlekin>2002-10-24 19:16:28 (UTC)
committer harlekin <harlekin>2002-10-24 19:16:28 (UTC)
commit2f2f9dc5f45fe7cf194a057e104c2d54394e4cef (patch) (unidiff)
treebf9a38b4e3d09e2e145b79ecf1e5be78263c530d /noncore
parent94573faf2e89723a49bbaf3630f1d19f80ba6b27 (diff)
downloadopie-2f2f9dc5f45fe7cf194a057e104c2d54394e4cef.zip
opie-2f2f9dc5f45fe7cf194a057e104c2d54394e4cef.tar.gz
opie-2f2f9dc5f45fe7cf194a057e104c2d54394e4cef.tar.bz2
cleanup and icon rearrangement
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp47
-rw-r--r--noncore/apps/opie-console/mainwindow.h1
2 files changed, 17 insertions, 31 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 745efaf..44ef458 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -35,217 +35,204 @@ MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(
35 KeyTrans* s = KeyTrans::find(i ); 35 KeyTrans* s = KeyTrans::find(i );
36 assert( s ); 36 assert( s );
37 } 37 }
38 m_factory = new MetaFactory(); 38 m_factory = new MetaFactory();
39 Default def(m_factory); 39 Default def(m_factory);
40 m_sessions.setAutoDelete( TRUE ); 40 m_sessions.setAutoDelete( TRUE );
41 m_curSession = 0; 41 m_curSession = 0;
42 m_manager = new ProfileManager( m_factory ); 42 m_manager = new ProfileManager( m_factory );
43 m_manager->load(); 43 m_manager->load();
44 44
45 initUI(); 45 initUI();
46 populateProfiles(); 46 populateProfiles();
47} 47}
48void MainWindow::initUI() { 48void MainWindow::initUI() {
49 setToolBarsMovable( FALSE ); 49 setToolBarsMovable( FALSE );
50 50
51 /* tool bar for the menu */ 51 /* tool bar for the menu */
52 m_tool = new QToolBar( this ); 52 m_tool = new QToolBar( this );
53 m_tool->setHorizontalStretchable( TRUE ); 53 m_tool->setHorizontalStretchable( TRUE );
54 54
55 m_bar = new QMenuBar( m_tool ); 55 m_bar = new QMenuBar( m_tool );
56 m_console = new QPopupMenu( this ); 56 m_console = new QPopupMenu( this );
57 m_scripts = new QPopupMenu( this ); 57 m_scripts = new QPopupMenu( this );
58 m_sessionsPop= new QPopupMenu( this ); 58 m_sessionsPop= new QPopupMenu( this );
59 //m_settings = new QPopupMenu( this );
60 59
61 /* add a toolbar for icons */ 60 /* add a toolbar for icons */
62 m_icons = new QToolBar(this); 61 m_icons = new QToolBar(this);
63 62
64
65
66
67 /* 63 /*
68 * the settings action 64 * the settings action
69 */ 65 */
70 m_setProfiles = new QAction(tr("Configure Profiles"), 66 m_setProfiles = new QAction(tr("Configure Profiles"),
71 Resource::loadPixmap( "SettingsIcon" ), 67 Resource::loadPixmap( "SettingsIcon" ),
72 QString::null, 0, this, 0); 68 QString::null, 0, this, 0);
73 // m_setProfiles->addTo( m_settings );
74 m_setProfiles->addTo( m_icons );
75 m_setProfiles->addTo( m_console ); 69 m_setProfiles->addTo( m_console );
76 connect( m_setProfiles, SIGNAL(activated() ), 70 connect( m_setProfiles, SIGNAL(activated() ),
77 this, SLOT(slotConfigure() ) ); 71 this, SLOT(slotConfigure() ) );
78 72
79 m_console->insertSeparator(); 73 m_console->insertSeparator();
80 /* 74 /*
81 * new Action for new sessions 75 * new Action for new sessions
82 */ 76 */
83 QAction* a = new QAction(tr("New Connection"), 77 QAction* newCon = new QAction(tr("New Connection"),
84 Resource::loadPixmap( "new" ), 78 Resource::loadPixmap( "new" ),
85 QString::null, 0, this, 0); 79 QString::null, 0, this, 0);
86 a->addTo( m_console ); 80 newCon->addTo( m_console );
87 a->addTo( m_icons ); 81 connect( newCon, SIGNAL(activated() ),
88 connect(a, SIGNAL(activated() ),
89 this, SLOT(slotNew() ) ); 82 this, SLOT(slotNew() ) );
90 83
91 m_console->insertSeparator(); 84 m_console->insertSeparator();
92 /* save icon is not available */ 85 /* save icon is not available */
93 a = new QAction(tr("Save Connection"), 86
87 QAction *saveCon = new QAction(tr("Save Connection"),
94 Resource::loadPixmap("save"), QString::null, 88 Resource::loadPixmap("save"), QString::null,
95 0, this, 0 ); 89 0, this, 0 );
96 a->addTo( m_console ); 90 saveCon->addTo( m_console );
97 connect(a, SIGNAL(activated() ), 91 connect( saveCon, SIGNAL(activated() ),
98 this, SLOT(slotSaveSession() ) ); 92 this, SLOT(slotSaveSession() ) );
99 m_console->insertSeparator(); 93 m_console->insertSeparator();
100 94
101 /* 95 /*
102 * connect action 96 * connect action
103 */ 97 */
104 m_connect = new QAction(); 98 m_connect = new QAction();
105 m_connect->setText( tr("Connect") ); 99 m_connect->setText( tr("Connect") );
106 m_connect->addTo( m_console ); 100 m_connect->addTo( m_console );
107 connect(m_connect, SIGNAL(activated() ), 101 connect(m_connect, SIGNAL(activated() ),
108 this, SLOT(slotConnect() ) ); 102 this, SLOT(slotConnect() ) );
109 103
110 /* 104 /*
111 * disconnect action 105 * disconnect action
112 */ 106 */
113 m_disconnect = new QAction(); 107 m_disconnect = new QAction();
114 m_disconnect->setText( tr("Disconnect") ); 108 m_disconnect->setText( tr("Disconnect") );
115 m_disconnect->addTo( m_console ); 109 m_disconnect->addTo( m_console );
116 connect(m_disconnect, SIGNAL(activated() ), 110 connect(m_disconnect, SIGNAL(activated() ),
117 this, SLOT(slotDisconnect() ) ); 111 this, SLOT(slotDisconnect() ) );
118 112
119 m_console->insertSeparator(); 113 m_console->insertSeparator();
120 114
121 m_transfer = new QAction(); 115 m_transfer = new QAction();
122 m_transfer->setText( tr("Transfer file...") ); 116 m_transfer->setText( tr("Transfer file...") );
123 m_transfer->addTo( m_console ); 117 m_transfer->addTo( m_console );
124 connect(m_transfer, SIGNAL(activated() ), 118 connect(m_transfer, SIGNAL(activated() ),
125 this, SLOT(slotTransfer() ) ); 119 this, SLOT(slotTransfer() ) );
126 120
127 121
128 /* 122 /*
129 * fullscreen 123 * fullscreen
130 */ 124 */
131 m_isFullscreen = false; 125 m_isFullscreen = false;
132 126
133 m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" ) 127 m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" )
134 , QString::null, 0, this, 0); 128 , QString::null, 0, this, 0);
135 m_fullscreen->addTo( m_console ); 129 m_fullscreen->addTo( m_console );
136 m_fullscreen->addTo( m_icons );
137 connect( m_fullscreen, SIGNAL( activated() ), 130 connect( m_fullscreen, SIGNAL( activated() ),
138 this, SLOT( slotFullscreen() ) ); 131 this, SLOT( slotFullscreen() ) );
139 132
140 m_console->insertSeparator(); 133 m_console->insertSeparator();
141 /* 134 /*
142 * terminate action 135 * terminate action
143 */ 136 */
144 m_terminate = new QAction(); 137 m_terminate = new QAction();
145 m_terminate->setText( tr("Terminate") ); 138 m_terminate->setText( tr("Terminate") );
146 m_terminate->addTo( m_console ); 139 m_terminate->addTo( m_console );
147 connect(m_terminate, SIGNAL(activated() ), 140 connect(m_terminate, SIGNAL(activated() ),
148 this, SLOT(slotTerminate() ) ); 141 this, SLOT(slotTerminate() ) );
149 142
150 m_closewindow = new QAction(); 143 m_closewindow = new QAction();
151 m_closewindow->setText( tr("Close Window") ); 144 m_closewindow->setText( tr("Close Window") );
152 m_closewindow->addTo( m_console ); 145 m_closewindow->addTo( m_console );
153 connect( m_closewindow, SIGNAL(activated() ), 146 connect( m_closewindow, SIGNAL(activated() ),
154 this, SLOT(slotClose() ) ); 147 this, SLOT(slotClose() ) );
155 148
156 149
157 /* 150 /*
158 * script actions 151 * script actions
159 */ 152 */
160 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); 153 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0);
161 m_recordScript->addTo(m_scripts); 154 m_recordScript->addTo(m_scripts);
162 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); 155 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript()));
163 156
164 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); 157 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0);
165 m_saveScript->addTo(m_scripts); 158 m_saveScript->addTo(m_scripts);
166 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); 159 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript()));
167 160
168 m_runScript = new QAction(tr("Run Script"), QString::null, 0, this, 0); 161 m_runScript = new QAction(tr("Run Script"), QString::null, 0, this, 0);
169 m_runScript->addTo(m_scripts); 162 m_runScript->addTo(m_scripts);
170 connect(m_runScript, SIGNAL(activated()), this, SLOT(slotRunScript())); 163 connect(m_runScript, SIGNAL(activated()), this, SLOT(slotRunScript()));
171 164
172 /* 165 /*
173 * action that open/closes the keyboard 166 * action that open/closes the keyboard
174 */ 167 */
175 m_openKeys = new QAction (tr("Open Keyboard..."), 168 m_openKeys = new QAction (tr("Open Keyboard..."),
176 Resource::loadPixmap( "console/keys/keyboard_icon" ), 169 Resource::loadPixmap( "console/keys/keyboard_icon" ),
177 QString::null, 0, this, 0); 170 QString::null, 0, this, 0);
178
179 m_openKeys->setToggleAction(true); 171 m_openKeys->setToggleAction(true);
180 172 connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool)));
181 connect (m_openKeys, SIGNAL(toggled(bool)),
182 this, SLOT(slotOpenKeb(bool)));
183 m_openKeys->addTo(m_icons);
184 173
185 /* insert the submenu */ 174 /* insert the submenu */
186 m_console->insertItem(tr("New from Profile"), m_sessionsPop, 175 m_console->insertItem(tr("New from Profile"), m_sessionsPop,
187 -1, 0); 176 -1, 0);
188 177
189 /* insert the connection menu */ 178 /* insert the connection menu */
190 m_bar->insertItem( tr("Connection"), m_console ); 179 m_bar->insertItem( tr("Connection"), m_console );
191 180
192 /* the scripts menu */ 181 /* the scripts menu */
193 m_bar->insertItem( tr("Scripts"), m_scripts ); 182 m_bar->insertItem( tr("Scripts"), m_scripts );
194 183
195 /* the settings menu */
196 // m_bar->insertItem( tr("Settings"), m_settings );
197
198 /* and the keyboard */ 184 /* and the keyboard */
199 m_keyBar = new QToolBar(this); 185 m_keyBar = new QToolBar(this);
200 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); 186 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
201 m_keyBar->setHorizontalStretchable( TRUE ); 187 m_keyBar->setHorizontalStretchable( TRUE );
202 m_keyBar->hide(); 188 m_keyBar->hide();
203 189
204 m_kb = new FunctionKeyboard(m_keyBar); 190 m_kb = new FunctionKeyboard(m_keyBar);
205 connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), 191 connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)),
206 this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool))); 192 this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool)));
207 193
208 m_buttonBar = new QToolBar( this );
209 addToolBar( m_buttonBar, "Buttons", QMainWindow::Top, TRUE );
210 m_buttonBar->setHorizontalStretchable( TRUE );
211 m_buttonBar->hide();
212 194
213 a = new QAction(tr("Copy"), 195 QAction *a = new QAction(tr("Copy"),
214 Resource::loadPixmap("copy"), QString::null, 196 Resource::loadPixmap("copy"), QString::null,
215 0, this, 0 ); 197 0, this, 0 );
216 //a->addTo( m_icons ); 198 //a->addTo( m_icons );
217 connect( a, SIGNAL(activated() ), 199 connect( a, SIGNAL(activated() ),
218 this, SLOT(slotCopy() ) ); 200 this, SLOT(slotCopy() ) );
219 201
220 a = new QAction(tr("Paste"), 202 QAction *paste = new QAction(tr("Paste"),
221 Resource::loadPixmap("paste"), QString::null, 203 Resource::loadPixmap("paste"), QString::null,
222 0, this, 0 ); 204 0, this, 0 );
223 a->addTo( m_icons ); 205 connect( paste, SIGNAL(activated() ),
224 connect( a, SIGNAL(activated() ),
225 this, SLOT(slotPaste() ) ); 206 this, SLOT(slotPaste() ) );
226 207
227 208
209 newCon->addTo( m_icons );
210 m_setProfiles->addTo( m_icons );
211 paste->addTo( m_icons );
212 m_openKeys->addTo(m_icons);
213 m_fullscreen->addTo( m_icons );
214
228 m_connect->setEnabled( false ); 215 m_connect->setEnabled( false );
229 m_disconnect->setEnabled( false ); 216 m_disconnect->setEnabled( false );
230 m_terminate->setEnabled( false ); 217 m_terminate->setEnabled( false );
231 m_transfer->setEnabled( false ); 218 m_transfer->setEnabled( false );
232 m_recordScript->setEnabled( false ); 219 m_recordScript->setEnabled( false );
233 m_saveScript->setEnabled( false ); 220 m_saveScript->setEnabled( false );
234 m_runScript->setEnabled( false ); 221 m_runScript->setEnabled( false );
235 m_fullscreen->setEnabled( false ); 222 m_fullscreen->setEnabled( false );
236 m_closewindow->setEnabled( false ); 223 m_closewindow->setEnabled( false );
237 224
238 /* 225 /*
239 * connect to the menu activation 226 * connect to the menu activation
240 */ 227 */
241 connect( m_sessionsPop, SIGNAL(activated( int ) ), 228 connect( m_sessionsPop, SIGNAL(activated( int ) ),
242 this, SLOT(slotProfile( int ) ) ); 229 this, SLOT(slotProfile( int ) ) );
243 230
244 m_consoleWindow = new TabWidget( this, "blah"); 231 m_consoleWindow = new TabWidget( this, "blah");
245 connect(m_consoleWindow, SIGNAL(activated(Session*) ), 232 connect(m_consoleWindow, SIGNAL(activated(Session*) ),
246 this, SLOT(slotSessionChanged(Session*) ) ); 233 this, SLOT(slotSessionChanged(Session*) ) );
247 setCentralWidget( m_consoleWindow ); 234 setCentralWidget( m_consoleWindow );
248 235
249} 236}
250 237
251ProfileManager* MainWindow::manager() { 238ProfileManager* MainWindow::manager() {
diff --git a/noncore/apps/opie-console/mainwindow.h b/noncore/apps/opie-console/mainwindow.h
index 7cc2aa5..19d3a3d 100644
--- a/noncore/apps/opie-console/mainwindow.h
+++ b/noncore/apps/opie-console/mainwindow.h
@@ -83,48 +83,47 @@ private:
83 void create( const Profile& ); 83 void create( const Profile& );
84 /** 84 /**
85 * the current session 85 * the current session
86 */ 86 */
87 Session* m_curSession; 87 Session* m_curSession;
88 88
89 /** 89 /**
90 * the session list 90 * the session list
91 */ 91 */
92 QList<Session> m_sessions; 92 QList<Session> m_sessions;
93 93
94 /** 94 /**
95 * the metafactory 95 * the metafactory
96 */ 96 */
97 MetaFactory* m_factory; 97 MetaFactory* m_factory;
98 ProfileManager* m_manager; 98 ProfileManager* m_manager;
99 99
100 TabWidget* m_consoleWindow; 100 TabWidget* m_consoleWindow;
101 QToolBar* m_tool; 101 QToolBar* m_tool;
102 QToolBar* m_icons; 102 QToolBar* m_icons;
103 QToolBar* m_keyBar; 103 QToolBar* m_keyBar;
104 QToolBar* m_buttonBar; 104 QToolBar* m_buttonBar;
105 QMenuBar* m_bar; 105 QMenuBar* m_bar;
106 QPopupMenu* m_console; 106 QPopupMenu* m_console;
107 QPopupMenu* m_settings;
108 QPopupMenu* m_sessionsPop; 107 QPopupMenu* m_sessionsPop;
109 QPopupMenu* m_scripts; 108 QPopupMenu* m_scripts;
110 QAction* m_connect; 109 QAction* m_connect;
111 QAction* m_disconnect; 110 QAction* m_disconnect;
112 QAction* m_terminate; 111 QAction* m_terminate;
113 QAction* m_transfer; 112 QAction* m_transfer;
114 QAction* m_setProfiles; 113 QAction* m_setProfiles;
115 QAction* m_openKeys; 114 QAction* m_openKeys;
116 QAction* m_openButtons; 115 QAction* m_openButtons;
117 QAction* m_recordScript; 116 QAction* m_recordScript;
118 QAction* m_saveScript; 117 QAction* m_saveScript;
119 QAction* m_runScript; 118 QAction* m_runScript;
120 QAction* m_fullscreen; 119 QAction* m_fullscreen;
121 QAction* m_closewindow; 120 QAction* m_closewindow;
122 121
123 FunctionKeyboard *m_kb; 122 FunctionKeyboard *m_kb;
124 bool m_isFullscreen; 123 bool m_isFullscreen;
125 124
126 QWidget* savedParentFullscreen; 125 QWidget* savedParentFullscreen;
127}; 126};
128 127
129 128
130#endif 129#endif