summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-10-26 11:53:47 (UTC)
committer harlekin <harlekin>2002-10-26 11:53:47 (UTC)
commit88504fa6ed3e4ec1c11d3e1cde13c821b1a9b846 (patch) (unidiff)
treeb3acc8683f44c7fa960c4d422ae781ed7b854f65
parent2dc92ada34785bbfff8ca1202e4d53eb0606c362 (diff)
downloadopie-88504fa6ed3e4ec1c11d3e1cde13c821b1a9b846.zip
opie-88504fa6ed3e4ec1c11d3e1cde13c821b1a9b846.tar.gz
opie-88504fa6ed3e4ec1c11d3e1cde13c821b1a9b846.tar.bz2
only enable tranfer if layer supports it
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 5f6dc12..e3c3c38 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -1,720 +1,726 @@
1#include <assert.h> 1#include <assert.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qmenubar.h> 4#include <qmenubar.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qpopupmenu.h> 6#include <qpopupmenu.h>
7#include <qtoolbar.h> 7#include <qtoolbar.h>
8#include <qmessagebox.h> 8#include <qmessagebox.h>
9#include <qpushbutton.h> 9#include <qpushbutton.h>
10#include <qwhatsthis.h> 10#include <qwhatsthis.h>
11#include <qfileinfo.h> 11#include <qfileinfo.h>
12 12
13#include <qpe/resource.h> 13#include <qpe/resource.h>
14#include <qpe/qpeapplication.h> 14#include <qpe/qpeapplication.h>
15#include <qpe/filemanager.h> 15#include <qpe/filemanager.h>
16#include <qpe/mimetype.h> 16#include <qpe/mimetype.h>
17 17
18#include <opie/ofiledialog.h> 18#include <opie/ofiledialog.h>
19 19
20#include "keytrans.h" 20#include "keytrans.h"
21#include "profileeditordialog.h" 21#include "profileeditordialog.h"
22#include "configdialog.h" 22#include "configdialog.h"
23#include "default.h" 23#include "default.h"
24#include "metafactory.h" 24#include "metafactory.h"
25#include "profile.h" 25#include "profile.h"
26#include "profilemanager.h" 26#include "profilemanager.h"
27#include "mainwindow.h" 27#include "mainwindow.h"
28#include "tabwidget.h" 28#include "tabwidget.h"
29#include "transferdialog.h" 29#include "transferdialog.h"
30#include "function_keyboard.h" 30#include "function_keyboard.h"
31#include "emulation_handler.h" 31#include "emulation_handler.h"
32#include "script.h" 32#include "script.h"
33 33
34static char * filesave_xpm[] = { 34static char * filesave_xpm[] = {
35"16 16 78 1", 35"16 16 78 1",
36" c None", 36" c None",
37". c #343434", 37". c #343434",
38"+ c #A0A0A0", 38"+ c #A0A0A0",
39"@ c #565656", 39"@ c #565656",
40"# c #9E9E9E", 40"# c #9E9E9E",
41"$ c #525252", 41"$ c #525252",
42"% c #929292", 42"% c #929292",
43"& c #676767", 43"& c #676767",
44"* c #848484", 44"* c #848484",
45"= c #666666", 45"= c #666666",
46"- c #D8D8D8", 46"- c #D8D8D8",
47"; c #FFFFFF", 47"; c #FFFFFF",
48"> c #DBDBDB", 48"> c #DBDBDB",
49", c #636363", 49", c #636363",
50"' c #989898", 50"' c #989898",
51") c #2D2D2D", 51") c #2D2D2D",
52"! c #909090", 52"! c #909090",
53"~ c #AEAEAE", 53"~ c #AEAEAE",
54"{ c #EAEAEA", 54"{ c #EAEAEA",
55"] c #575757", 55"] c #575757",
56"^ c #585858", 56"^ c #585858",
57"/ c #8A8A8A", 57"/ c #8A8A8A",
58"( c #828282", 58"( c #828282",
59"_ c #6F6F6F", 59"_ c #6F6F6F",
60": c #C9C9C9", 60": c #C9C9C9",
61"< c #050505", 61"< c #050505",
62"[ c #292929", 62"[ c #292929",
63"} c #777777", 63"} c #777777",
64"| c #616161", 64"| c #616161",
65"1 c #3A3A3A", 65"1 c #3A3A3A",
66"2 c #BEBEBE", 66"2 c #BEBEBE",
67"3 c #2C2C2C", 67"3 c #2C2C2C",
68"4 c #7C7C7C", 68"4 c #7C7C7C",
69"5 c #F6F6F6", 69"5 c #F6F6F6",
70"6 c #FCFCFC", 70"6 c #FCFCFC",
71"7 c #6B6B6B", 71"7 c #6B6B6B",
72"8 c #959595", 72"8 c #959595",
73"9 c #4F4F4F", 73"9 c #4F4F4F",
74"0 c #808080", 74"0 c #808080",
75"a c #767676", 75"a c #767676",
76"b c #818181", 76"b c #818181",
77"c c #B8B8B8", 77"c c #B8B8B8",
78"d c #FBFBFB", 78"d c #FBFBFB",
79"e c #F9F9F9", 79"e c #F9F9F9",
80"f c #CCCCCC", 80"f c #CCCCCC",
81"g c #030303", 81"g c #030303",
82"h c #737373", 82"h c #737373",
83"i c #7A7A7A", 83"i c #7A7A7A",
84"j c #7E7E7E", 84"j c #7E7E7E",
85"k c #6A6A6A", 85"k c #6A6A6A",
86"l c #FAFAFA", 86"l c #FAFAFA",
87"m c #505050", 87"m c #505050",
88"n c #9D9D9D", 88"n c #9D9D9D",
89"o c #333333", 89"o c #333333",
90"p c #7B7B7B", 90"p c #7B7B7B",
91"q c #787878", 91"q c #787878",
92"r c #696969", 92"r c #696969",
93"s c #494949", 93"s c #494949",
94"t c #555555", 94"t c #555555",
95"u c #949494", 95"u c #949494",
96"v c #E6E6E6", 96"v c #E6E6E6",
97"w c #424242", 97"w c #424242",
98"x c #515151", 98"x c #515151",
99"y c #535353", 99"y c #535353",
100"z c #3E3E3E", 100"z c #3E3E3E",
101"A c #D4D4D4", 101"A c #D4D4D4",
102"B c #0C0C0C", 102"B c #0C0C0C",
103"C c #353535", 103"C c #353535",
104"D c #474747", 104"D c #474747",
105"E c #ECECEC", 105"E c #ECECEC",
106"F c #919191", 106"F c #919191",
107"G c #7D7D7D", 107"G c #7D7D7D",
108"H c #000000", 108"H c #000000",
109"I c #404040", 109"I c #404040",
110"J c #858585", 110"J c #858585",
111"K c #323232", 111"K c #323232",
112"L c #D0D0D0", 112"L c #D0D0D0",
113"M c #1C1C1C", 113"M c #1C1C1C",
114" ...+ ", 114" ...+ ",
115" @#$%&..+ ", 115" @#$%&..+ ",
116" .*=-;;>,..+ ", 116" .*=-;;>,..+ ",
117" ')!~;;;;;;{]..", 117" ')!~;;;;;;{]..",
118" ^/(-;;;;;;;_:<", 118" ^/(-;;;;;;;_:<",
119" [}|;;;;;;;{12$", 119" [}|;;;;;;;{12$",
120" #34-55;;;;678$+", 120" #34-55;;;;678$+",
121" 90ab=c;dd;e1fg ", 121" 90ab=c;dd;e1fg ",
122" [ahij((kbl0mn$ ", 122" [ahij((kbl0mn$ ",
123" op^q^^7r&]s/$+ ", 123" op^q^^7r&]s/$+ ",
124"@btu;vbwxy]zAB ", 124"@btu;vbwxy]zAB ",
125"CzDEvEv;;DssF$ ", 125"CzDEvEv;;DssF$ ",
126"G.H{E{E{IxsJ$+ ", 126"G.H{E{E{IxsJ$+ ",
127" +...vEKxzLM ", 127" +...vEKxzLM ",
128" +...z]n$ ", 128" +...z]n$ ",
129" +... "}; 129" +... "};
130 130
131 131
132 132
133MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 133MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
134 KeyTrans::loadAll(); 134 KeyTrans::loadAll();
135 for (int i = 0; i < KeyTrans::count(); i++ ) { 135 for (int i = 0; i < KeyTrans::count(); i++ ) {
136 KeyTrans* s = KeyTrans::find(i ); 136 KeyTrans* s = KeyTrans::find(i );
137 assert( s ); 137 assert( s );
138 } 138 }
139 m_factory = new MetaFactory(); 139 m_factory = new MetaFactory();
140 Default def(m_factory); 140 Default def(m_factory);
141 m_sessions.setAutoDelete( TRUE ); 141 m_sessions.setAutoDelete( TRUE );
142 m_curSession = 0; 142 m_curSession = 0;
143 m_manager = new ProfileManager( m_factory ); 143 m_manager = new ProfileManager( m_factory );
144 m_manager->load(); 144 m_manager->load();
145 m_scriptsData.setAutoDelete(TRUE); 145 m_scriptsData.setAutoDelete(TRUE);
146 146
147 initUI(); 147 initUI();
148 populateProfiles(); 148 populateProfiles();
149 populateScripts(); 149 populateScripts();
150} 150}
151void MainWindow::initUI() { 151void MainWindow::initUI() {
152 setToolBarsMovable( FALSE ); 152 setToolBarsMovable( FALSE );
153 153
154 /* tool bar for the menu */ 154 /* tool bar for the menu */
155 m_tool = new QToolBar( this ); 155 m_tool = new QToolBar( this );
156 m_tool->setHorizontalStretchable( TRUE ); 156 m_tool->setHorizontalStretchable( TRUE );
157 157
158 m_bar = new QMenuBar( m_tool ); 158 m_bar = new QMenuBar( m_tool );
159 m_console = new QPopupMenu( this ); 159 m_console = new QPopupMenu( this );
160 m_scripts = new QPopupMenu( this ); 160 m_scripts = new QPopupMenu( this );
161 m_sessionsPop= new QPopupMenu( this ); 161 m_sessionsPop= new QPopupMenu( this );
162 m_scriptsPop = new QPopupMenu( this ); 162 m_scriptsPop = new QPopupMenu( this );
163 163
164 /* add a toolbar for icons */ 164 /* add a toolbar for icons */
165 m_icons = new QToolBar(this); 165 m_icons = new QToolBar(this);
166 166
167 /* 167 /*
168 * the settings action 168 * the settings action
169 */ 169 */
170 m_setProfiles = new QAction(tr("Configure Profiles"), 170 m_setProfiles = new QAction(tr("Configure Profiles"),
171 Resource::loadPixmap( "SettingsIcon" ), 171 Resource::loadPixmap( "SettingsIcon" ),
172 QString::null, 0, this, 0); 172 QString::null, 0, this, 0);
173 m_setProfiles->addTo( m_console ); 173 m_setProfiles->addTo( m_console );
174 connect( m_setProfiles, SIGNAL(activated() ), 174 connect( m_setProfiles, SIGNAL(activated() ),
175 this, SLOT(slotConfigure() ) ); 175 this, SLOT(slotConfigure() ) );
176 176
177 m_console->insertSeparator(); 177 m_console->insertSeparator();
178 /* 178 /*
179 * new Action for new sessions 179 * new Action for new sessions
180 */ 180 */
181 QAction* newCon = new QAction(tr("New Connection"), 181 QAction* newCon = new QAction(tr("New Connection"),
182 Resource::loadPixmap( "new" ), 182 Resource::loadPixmap( "new" ),
183 QString::null, 0, this, 0); 183 QString::null, 0, this, 0);
184 newCon->addTo( m_console ); 184 newCon->addTo( m_console );
185 connect( newCon, SIGNAL(activated() ), 185 connect( newCon, SIGNAL(activated() ),
186 this, SLOT(slotNew() ) ); 186 this, SLOT(slotNew() ) );
187 187
188 m_console->insertSeparator(); 188 m_console->insertSeparator();
189 189
190 QAction *saveCon = new QAction(tr("Save Connection"), 190 QAction *saveCon = new QAction(tr("Save Connection"),
191 QPixmap( ( const char** ) filesave_xpm ) , QString::null, 191 QPixmap( ( const char** ) filesave_xpm ) , QString::null,
192 0, this, 0 ); 192 0, this, 0 );
193 saveCon->addTo( m_console ); 193 saveCon->addTo( m_console );
194 connect( saveCon, SIGNAL(activated() ), 194 connect( saveCon, SIGNAL(activated() ),
195 this, SLOT(slotSaveSession() ) ); 195 this, SLOT(slotSaveSession() ) );
196 m_console->insertSeparator(); 196 m_console->insertSeparator();
197 197
198 /* 198 /*
199 * connect action 199 * connect action
200 */ 200 */
201 m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"), 201 m_connect = new QAction( tr("Connect"), Resource::loadPixmap("console/connected"),
202 QString::null, 0, this, 0 ); 202 QString::null, 0, this, 0 );
203 m_connect->addTo( m_console ); 203 m_connect->addTo( m_console );
204 connect(m_connect, SIGNAL(activated() ), 204 connect(m_connect, SIGNAL(activated() ),
205 this, SLOT(slotConnect() ) ); 205 this, SLOT(slotConnect() ) );
206 206
207 /* 207 /*
208 * disconnect action 208 * disconnect action
209 */ 209 */
210 m_disconnect = new QAction( tr("Disconnect"), Resource::loadPixmap("console/notconnected"), 210 m_disconnect = new QAction( tr("Disconnect"), Resource::loadPixmap("console/notconnected"),
211 QString::null, 0, this, 0 ); 211 QString::null, 0, this, 0 );
212 m_disconnect->addTo( m_console ); 212 m_disconnect->addTo( m_console );
213 connect(m_disconnect, SIGNAL(activated() ), 213 connect(m_disconnect, SIGNAL(activated() ),
214 this, SLOT(slotDisconnect() ) ); 214 this, SLOT(slotDisconnect() ) );
215 215
216 m_console->insertSeparator(); 216 m_console->insertSeparator();
217 217
218 m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null, 218 m_transfer = new QAction( tr("Transfer file..."), Resource::loadPixmap("pass") , QString::null,
219 0, this, 0 ); 219 0, this, 0 );
220 m_transfer->addTo( m_console ); 220 m_transfer->addTo( m_console );
221 connect(m_transfer, SIGNAL(activated() ), 221 connect(m_transfer, SIGNAL(activated() ),
222 this, SLOT(slotTransfer() ) ); 222 this, SLOT(slotTransfer() ) );
223 223
224 224
225 /* 225 /*
226 * fullscreen 226 * fullscreen
227 */ 227 */
228 m_isFullscreen = false; 228 m_isFullscreen = false;
229 229
230 m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" ) 230 m_fullscreen = new QAction( tr("Full screen"), Resource::loadPixmap( "fullscreen" )
231 , QString::null, 0, this, 0); 231 , QString::null, 0, this, 0);
232 m_fullscreen->addTo( m_console ); 232 m_fullscreen->addTo( m_console );
233 connect( m_fullscreen, SIGNAL( activated() ), 233 connect( m_fullscreen, SIGNAL( activated() ),
234 this, SLOT( slotFullscreen() ) ); 234 this, SLOT( slotFullscreen() ) );
235 235
236 m_console->insertSeparator(); 236 m_console->insertSeparator();
237 /* 237 /*
238 * terminate action 238 * terminate action
239 */ 239 */
240 m_terminate = new QAction(); 240 m_terminate = new QAction();
241 m_terminate->setText( tr("Terminate") ); 241 m_terminate->setText( tr("Terminate") );
242 m_terminate->addTo( m_console ); 242 m_terminate->addTo( m_console );
243 connect(m_terminate, SIGNAL(activated() ), 243 connect(m_terminate, SIGNAL(activated() ),
244 this, SLOT(slotTerminate() ) ); 244 this, SLOT(slotTerminate() ) );
245 245
246 m_closewindow = new QAction(); 246 m_closewindow = new QAction();
247 m_closewindow->setText( tr("Close Window") ); 247 m_closewindow->setText( tr("Close Window") );
248 m_closewindow->addTo( m_console ); 248 m_closewindow->addTo( m_console );
249 connect( m_closewindow, SIGNAL(activated() ), 249 connect( m_closewindow, SIGNAL(activated() ),
250 this, SLOT(slotClose() ) ); 250 this, SLOT(slotClose() ) );
251 251
252 252
253 /* 253 /*
254 * script actions 254 * script actions
255 */ 255 */
256 m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0); 256 m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0);
257 connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int))); 257 connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int)));
258 258
259 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); 259 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0);
260 m_recordScript->addTo(m_scripts); 260 m_recordScript->addTo(m_scripts);
261 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); 261 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript()));
262 262
263 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); 263 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0);
264 m_saveScript->addTo(m_scripts); 264 m_saveScript->addTo(m_scripts);
265 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); 265 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript()));
266 266
267 267
268 /* 268 /*
269 * action that open/closes the keyboard 269 * action that open/closes the keyboard
270 */ 270 */
271 m_openKeys = new QAction (tr("Open Keyboard..."), 271 m_openKeys = new QAction (tr("Open Keyboard..."),
272 Resource::loadPixmap( "console/keys/keyboard_icon" ), 272 Resource::loadPixmap( "console/keys/keyboard_icon" ),
273 QString::null, 0, this, 0); 273 QString::null, 0, this, 0);
274 m_openKeys->setToggleAction(true); 274 m_openKeys->setToggleAction(true);
275 connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); 275 connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool)));
276 276
277 /* insert the submenu */ 277 /* insert the submenu */
278 m_console->insertItem(tr("New from Profile"), m_sessionsPop, 278 m_console->insertItem(tr("New from Profile"), m_sessionsPop,
279 -1, 0); 279 -1, 0);
280 280
281 /* insert the connection menu */ 281 /* insert the connection menu */
282 m_bar->insertItem( tr("Connection"), m_console ); 282 m_bar->insertItem( tr("Connection"), m_console );
283 283
284 /* the scripts menu */ 284 /* the scripts menu */
285 m_bar->insertItem( tr("Scripts"), m_scripts ); 285 m_bar->insertItem( tr("Scripts"), m_scripts );
286 286
287 /* and the keyboard */ 287 /* and the keyboard */
288 m_keyBar = new QToolBar(this); 288 m_keyBar = new QToolBar(this);
289 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); 289 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
290 m_keyBar->setHorizontalStretchable( TRUE ); 290 m_keyBar->setHorizontalStretchable( TRUE );
291 m_keyBar->hide(); 291 m_keyBar->hide();
292 292
293 m_kb = new FunctionKeyboard(m_keyBar); 293 m_kb = new FunctionKeyboard(m_keyBar);
294 connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), 294 connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)),
295 this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool))); 295 this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool)));
296 296
297 297
298 QAction *a = new QAction(tr("Copy"), 298 QAction *a = new QAction(tr("Copy"),
299 Resource::loadPixmap("copy"), QString::null, 299 Resource::loadPixmap("copy"), QString::null,
300 0, this, 0 ); 300 0, this, 0 );
301 //a->addTo( m_icons ); 301 //a->addTo( m_icons );
302 connect( a, SIGNAL(activated() ), 302 connect( a, SIGNAL(activated() ),
303 this, SLOT(slotCopy() ) ); 303 this, SLOT(slotCopy() ) );
304 304
305 QAction *paste = new QAction(tr("Paste"), 305 QAction *paste = new QAction(tr("Paste"),
306 Resource::loadPixmap("paste"), QString::null, 306 Resource::loadPixmap("paste"), QString::null,
307 0, this, 0 ); 307 0, this, 0 );
308 connect( paste, SIGNAL(activated() ), 308 connect( paste, SIGNAL(activated() ),
309 this, SLOT(slotPaste() ) ); 309 this, SLOT(slotPaste() ) );
310 310
311 311
312 newCon->addTo( m_icons ); 312 newCon->addTo( m_icons );
313 m_setProfiles->addTo( m_icons ); 313 m_setProfiles->addTo( m_icons );
314 paste->addTo( m_icons ); 314 paste->addTo( m_icons );
315 m_openKeys->addTo(m_icons); 315 m_openKeys->addTo(m_icons);
316 m_fullscreen->addTo( m_icons ); 316 m_fullscreen->addTo( m_icons );
317 317
318 m_connect->setEnabled( false ); 318 m_connect->setEnabled( false );
319 m_disconnect->setEnabled( false ); 319 m_disconnect->setEnabled( false );
320 m_terminate->setEnabled( false ); 320 m_terminate->setEnabled( false );
321 m_transfer->setEnabled( false ); 321 m_transfer->setEnabled( false );
322 m_scripts->setItemEnabled(m_runScript_id, false); 322 m_scripts->setItemEnabled(m_runScript_id, false);
323 m_recordScript->setEnabled( false ); 323 m_recordScript->setEnabled( false );
324 m_saveScript->setEnabled( false ); 324 m_saveScript->setEnabled( false );
325 m_fullscreen->setEnabled( false ); 325 m_fullscreen->setEnabled( false );
326 m_closewindow->setEnabled( false ); 326 m_closewindow->setEnabled( false );
327 327
328 /* 328 /*
329 * connect to the menu activation 329 * connect to the menu activation
330 */ 330 */
331 connect( m_sessionsPop, SIGNAL(activated( int ) ), 331 connect( m_sessionsPop, SIGNAL(activated( int ) ),
332 this, SLOT(slotProfile( int ) ) ); 332 this, SLOT(slotProfile( int ) ) );
333 333
334 m_consoleWindow = new TabWidget( this, "blah"); 334 m_consoleWindow = new TabWidget( this, "blah");
335 connect(m_consoleWindow, SIGNAL(activated(Session*) ), 335 connect(m_consoleWindow, SIGNAL(activated(Session*) ),
336 this, SLOT(slotSessionChanged(Session*) ) ); 336 this, SLOT(slotSessionChanged(Session*) ) );
337 setCentralWidget( m_consoleWindow ); 337 setCentralWidget( m_consoleWindow );
338 338
339} 339}
340 340
341ProfileManager* MainWindow::manager() { 341ProfileManager* MainWindow::manager() {
342 return m_manager; 342 return m_manager;
343} 343}
344TabWidget* MainWindow::tabWidget() { 344TabWidget* MainWindow::tabWidget() {
345 return m_consoleWindow; 345 return m_consoleWindow;
346} 346}
347void MainWindow::populateProfiles() { 347void MainWindow::populateProfiles() {
348 m_sessionsPop->clear(); 348 m_sessionsPop->clear();
349 Profile::ValueList list = manager()->all(); 349 Profile::ValueList list = manager()->all();
350 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) { 350 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) {
351 m_sessionsPop->insertItem( (*it).name() ); 351 m_sessionsPop->insertItem( (*it).name() );
352 } 352 }
353 353
354} 354}
355 355
356void MainWindow::populateScripts() { 356void MainWindow::populateScripts() {
357 m_scriptsPop->clear(); 357 m_scriptsPop->clear();
358 m_scriptsData.clear(); 358 m_scriptsData.clear();
359 DocLnkSet files(QPEApplication::documentDir(), "text/plain"); 359 DocLnkSet files(QPEApplication::documentDir(), "text/plain");
360 QListIterator<DocLnk> dit(files.children()); 360 QListIterator<DocLnk> dit(files.children());
361 for (; dit.current(); ++dit) { 361 for (; dit.current(); ++dit) {
362 if (*dit && (*dit)->name().length()>0) { 362 if (*dit && (*dit)->name().length()>0) {
363 QFileInfo info((*dit)->file()); 363 QFileInfo info((*dit)->file());
364 if (info.extension(false) == "script") { 364 if (info.extension(false) == "script") {
365 m_scriptsData.append(new DocLnk(**dit)); 365 m_scriptsData.append(new DocLnk(**dit));
366 m_scriptsPop->insertItem((*dit)->name()); 366 m_scriptsPop->insertItem((*dit)->name());
367 } 367 }
368 } 368 }
369 } 369 }
370 370
371} 371}
372 372
373MainWindow::~MainWindow() { 373MainWindow::~MainWindow() {
374 delete m_factory; 374 delete m_factory;
375 manager()->save(); 375 manager()->save();
376} 376}
377 377
378MetaFactory* MainWindow::factory() { 378MetaFactory* MainWindow::factory() {
379 return m_factory; 379 return m_factory;
380} 380}
381 381
382Session* MainWindow::currentSession() { 382Session* MainWindow::currentSession() {
383 return m_curSession; 383 return m_curSession;
384} 384}
385 385
386QList<Session> MainWindow::sessions() { 386QList<Session> MainWindow::sessions() {
387 return m_sessions; 387 return m_sessions;
388} 388}
389 389
390void MainWindow::slotNew() { 390void MainWindow::slotNew() {
391 ProfileEditorDialog dlg(factory() ); 391 ProfileEditorDialog dlg(factory() );
392 dlg.showMaximized(); 392 dlg.showMaximized();
393 dlg.setCaption( tr("New Connection") ); 393 dlg.setCaption( tr("New Connection") );
394 int ret = dlg.exec(); 394 int ret = dlg.exec();
395 395
396 if ( ret == QDialog::Accepted ) { 396 if ( ret == QDialog::Accepted ) {
397 create( dlg.profile() ); 397 create( dlg.profile() );
398 } 398 }
399} 399}
400 400
401void MainWindow::slotRecordScript() { 401void MainWindow::slotRecordScript() {
402 if (currentSession()) { 402 if (currentSession()) {
403 currentSession()->emulationHandler()->startRecording(); 403 currentSession()->emulationHandler()->startRecording();
404 m_saveScript->setEnabled(true); 404 m_saveScript->setEnabled(true);
405 m_recordScript->setEnabled(false); 405 m_recordScript->setEnabled(false);
406 } 406 }
407} 407}
408 408
409void MainWindow::slotSaveScript() { 409void MainWindow::slotSaveScript() {
410 if (currentSession() && currentSession()->emulationHandler()->isRecording()) { 410 if (currentSession() && currentSession()->emulationHandler()->isRecording()) {
411 QMap<QString, QStringList> map; 411 QMap<QString, QStringList> map;
412 QStringList text; 412 QStringList text;
413 text << "text/plain"; 413 text << "text/plain";
414 map.insert(tr("Script"), text ); 414 map.insert(tr("Script"), text );
415 QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map); 415 QString filename = OFileDialog::getSaveFileName(2, QPEApplication::documentDir(), QString::null, map);
416 if (!filename.isEmpty()) { 416 if (!filename.isEmpty()) {
417 QFileInfo info(filename); 417 QFileInfo info(filename);
418 if (info.extension(FALSE) != "script") 418 if (info.extension(FALSE) != "script")
419 filename += ".script"; 419 filename += ".script";
420 DocLnk nf; 420 DocLnk nf;
421 nf.setType("text/plain"); 421 nf.setType("text/plain");
422 nf.setFile(filename); 422 nf.setFile(filename);
423 nf.setName(info.fileName()); 423 nf.setName(info.fileName());
424 FileManager fm; 424 FileManager fm;
425 fm.saveFile(nf, currentSession()->emulationHandler()->script()->script()); 425 fm.saveFile(nf, currentSession()->emulationHandler()->script()->script());
426 currentSession()->emulationHandler()->clearScript(); 426 currentSession()->emulationHandler()->clearScript();
427 m_saveScript->setEnabled(false); 427 m_saveScript->setEnabled(false);
428 m_recordScript->setEnabled(true); 428 m_recordScript->setEnabled(true);
429 populateScripts(); 429 populateScripts();
430 } 430 }
431 } 431 }
432} 432}
433 433
434void MainWindow::slotRunScript(int id) { 434void MainWindow::slotRunScript(int id) {
435 if (currentSession()) { 435 if (currentSession()) {
436 int index = m_scriptsPop->indexOf(id); 436 int index = m_scriptsPop->indexOf(id);
437 DocLnk *lnk = m_scriptsData.at(index); 437 DocLnk *lnk = m_scriptsData.at(index);
438 QString filePath = lnk->file(); 438 QString filePath = lnk->file();
439 Script script(filePath); 439 Script script(filePath);
440 currentSession()->emulationHandler()->runScript(&script); 440 currentSession()->emulationHandler()->runScript(&script);
441 } 441 }
442} 442}
443 443
444void MainWindow::slotConnect() { 444void MainWindow::slotConnect() {
445 if ( currentSession() ) { 445 if ( currentSession() ) {
446 bool ret = currentSession()->layer()->open(); 446 bool ret = currentSession()->layer()->open();
447 if(!ret) QMessageBox::warning(currentSession()->widgetStack(), 447 if(!ret) QMessageBox::warning(currentSession()->widgetStack(),
448 QObject::tr("Failed"), 448 QObject::tr("Failed"),
449 QObject::tr("Connecting failed for this session.")); 449 QObject::tr("Connecting failed for this session."));
450 else { 450 else {
451 m_connect->setEnabled( false ); 451 m_connect->setEnabled( false );
452 m_disconnect->setEnabled( true ); 452 m_disconnect->setEnabled( true );
453 m_transfer->setEnabled( true ); 453
454 // if it does not support file transfer, disable the menu entry
455 if ( ( m_curSession->layer() )->supports()[1] == 0 ) {
456 m_transfer->setEnabled( false );
457 } else {
458 m_transfer->setEnabled( true );
459 }
460
454 m_recordScript->setEnabled( true ); 461 m_recordScript->setEnabled( true );
455 m_scripts->setItemEnabled(m_runScript_id, true); 462 m_scripts->setItemEnabled(m_runScript_id, true);
456 } 463 }
457 } 464 }
458} 465}
459 466
460void MainWindow::slotDisconnect() { 467void MainWindow::slotDisconnect() {
461 if ( currentSession() ) { 468 if ( currentSession() ) {
462 currentSession()->layer()->close(); 469 currentSession()->layer()->close();
463 m_connect->setEnabled( true ); 470 m_connect->setEnabled( true );
464 m_disconnect->setEnabled( false ); 471 m_disconnect->setEnabled( false );
465 m_transfer->setEnabled( false ); 472 m_transfer->setEnabled( false );
466 m_recordScript->setEnabled( false); 473 m_recordScript->setEnabled( false);
467 m_saveScript->setEnabled( false ); 474 m_saveScript->setEnabled( false );
468 m_scripts->setItemEnabled(m_runScript_id, false); 475 m_scripts->setItemEnabled(m_runScript_id, false);
469 } 476 }
470} 477}
471 478
472void MainWindow::slotTerminate() { 479void MainWindow::slotTerminate() {
473 if ( currentSession() ) 480 if ( currentSession() )
474 currentSession()->layer()->close(); 481 currentSession()->layer()->close();
475 482
476 slotClose(); 483 slotClose();
477 /* FIXME move to the next session */ 484 /* FIXME move to the next session */
478} 485}
479 486
480void MainWindow::slotConfigure() { 487void MainWindow::slotConfigure() {
481 ConfigDialog conf( manager()->all(), factory() ); 488 ConfigDialog conf( manager()->all(), factory() );
482 conf.showMaximized(); 489 conf.showMaximized();
483 490
484 int ret = conf.exec(); 491 int ret = conf.exec();
485 492
486 if ( QDialog::Accepted == ret ) { 493 if ( QDialog::Accepted == ret ) {
487 manager()->setProfiles( conf.list() ); 494 manager()->setProfiles( conf.list() );
488 manager()->save(); 495 manager()->save();
489 populateProfiles(); 496 populateProfiles();
490 } 497 }
491} 498}
492/* 499/*
493 * we will remove 500 * we will remove
494 * this window from the tabwidget 501 * this window from the tabwidget
495 * remove it from the list 502 * remove it from the list
496 * delete it 503 * delete it
497 * and set the currentSession() 504 * and set the currentSession()
498 */ 505 */
499void MainWindow::slotClose() { 506void MainWindow::slotClose() {
500 if (!currentSession() ) 507 if (!currentSession() )
501 return; 508 return;
502 509
503 Session* ses = currentSession(); 510 Session* ses = currentSession();
504 qWarning("removing! currentSession %s", currentSession()->name().latin1() ); 511 qWarning("removing! currentSession %s", currentSession()->name().latin1() );
505 /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ 512 /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */
506 m_curSession = NULL; 513 m_curSession = NULL;
507 tabWidget()->remove( /*currentSession()*/ses ); 514 tabWidget()->remove( /*currentSession()*/ses );
508 /*it's autodelete */ 515 /*it's autodelete */
509 m_sessions.remove( ses ); 516 m_sessions.remove( ses );
510 qWarning("after remove!!"); 517 qWarning("after remove!!");
511 518
512 if (!currentSession() ) { 519 if (!currentSession() ) {
513 m_connect->setEnabled( false ); 520 m_connect->setEnabled( false );
514 m_disconnect->setEnabled( false ); 521 m_disconnect->setEnabled( false );
515 m_terminate->setEnabled( false ); 522 m_terminate->setEnabled( false );
516 m_transfer->setEnabled( false ); 523 m_transfer->setEnabled( false );
517 m_recordScript->setEnabled( false ); 524 m_recordScript->setEnabled( false );
518 m_saveScript->setEnabled( false ); 525 m_saveScript->setEnabled( false );
519 m_scripts->setItemEnabled(m_runScript_id, false); 526 m_scripts->setItemEnabled(m_runScript_id, false);
520 m_fullscreen->setEnabled( false ); 527 m_fullscreen->setEnabled( false );
521 m_closewindow->setEnabled( false ); 528 m_closewindow->setEnabled( false );
522 } 529 }
523 530
524 m_kb->loadDefaults(); 531 m_kb->loadDefaults();
525} 532}
526 533
527/* 534/*
528 * We will get the name 535 * We will get the name
529 * Then the profile 536 * Then the profile
530 * and then we will make a profile 537 * and then we will make a profile
531 */ 538 */
532void MainWindow::slotProfile( int id) { 539void MainWindow::slotProfile( int id) {
533 Profile prof = manager()->profile( m_sessionsPop->text( id) ); 540 Profile prof = manager()->profile( m_sessionsPop->text( id) );
534 create( prof ); 541 create( prof );
535} 542}
536void MainWindow::create( const Profile& prof ) { 543void MainWindow::create( const Profile& prof ) {
537 if(m_curSession) 544 if(m_curSession)
538 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); 545 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide();
539 546
540 Session *ses = manager()->fromProfile( prof, tabWidget() ); 547 Session *ses = manager()->fromProfile( prof, tabWidget() );
541 548
542 if((!ses) || (!ses->layer()) || (!ses->widgetStack())) 549 if((!ses) || (!ses->layer()) || (!ses->widgetStack()))
543 { 550 {
544 QMessageBox::warning(this, 551 QMessageBox::warning(this,
545 QObject::tr("Session failed"), 552 QObject::tr("Session failed"),
546 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); 553 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
547 //if(ses) delete ses; 554 //if(ses) delete ses;
548 return; 555 return;
549 } 556 }
550 557
551 m_sessions.append( ses ); 558 m_sessions.append( ses );
552 tabWidget()->add( ses ); 559 tabWidget()->add( ses );
553 tabWidget()->repaint(); 560 tabWidget()->repaint();
554 m_curSession = ses; 561 m_curSession = ses;
555 562
556 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it 563 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it
557 m_connect->setEnabled( true ); 564 m_connect->setEnabled( true );
558 m_disconnect->setEnabled( false ); 565 m_disconnect->setEnabled( false );
559 m_terminate->setEnabled( true ); 566 m_terminate->setEnabled( true );
560 m_fullscreen->setEnabled( true ); 567 m_fullscreen->setEnabled( true );
561 m_closewindow->setEnabled( true ); 568 m_closewindow->setEnabled( true );
562 m_transfer->setEnabled( false ); 569 m_transfer->setEnabled( false );
563 m_recordScript->setEnabled( false ); 570 m_recordScript->setEnabled( false );
564 m_saveScript->setEnabled( false ); 571 m_saveScript->setEnabled( false );
565 m_scripts->setItemEnabled(m_runScript_id, false); 572 m_scripts->setItemEnabled(m_runScript_id, false);
566 573
567 // is io_layer wants direct connection, then autoconnect 574 // is io_layer wants direct connection, then autoconnect
568 //if ( ( m_curSession->layer() )->supports()[0] == 1 ) { 575 //if ( ( m_curSession->layer() )->supports()[0] == 1 ) {
569 if (prof.autoConnect()) { 576 if (prof.autoConnect()) {
570 slotConnect(); 577 slotConnect();
571 } 578 }
572 579
573 580
574
575 QWidget *w = currentSession()->widget(); 581 QWidget *w = currentSession()->widget();
576 if(w) w->setFocus(); 582 if(w) w->setFocus();
577 583
578 m_kb->load(currentSession()->profile()); 584 m_kb->load(currentSession()->profile());
579} 585}
580 586
581void MainWindow::slotTransfer() 587void MainWindow::slotTransfer()
582{ 588{
583 if ( currentSession() ) { 589 if ( currentSession() ) {
584 Session *mysession = currentSession(); 590 Session *mysession = currentSession();
585 TransferDialog dlg(mysession->widgetStack(), this); 591 TransferDialog dlg(mysession->widgetStack(), this);
586 mysession->setTransferDialog(&dlg); 592 mysession->setTransferDialog(&dlg);
587 dlg.show(); 593 dlg.show();
588 //dlg.showMaximized(); 594 //dlg.showMaximized();
589 //currentSession()->widgetStack()->add(dlg); 595 //currentSession()->widgetStack()->add(dlg);
590 //dlg.exec(); 596 //dlg.exec();
591 while(dlg.isRunning()) qApp->processEvents(); 597 while(dlg.isRunning()) qApp->processEvents();
592 mysession->setTransferDialog(0l); 598 mysession->setTransferDialog(0l);
593 } 599 }
594} 600}
595 601
596 602
597void MainWindow::slotOpenKeb(bool state) { 603void MainWindow::slotOpenKeb(bool state) {
598 604
599 if (state) m_keyBar->show(); 605 if (state) m_keyBar->show();
600 else m_keyBar->hide(); 606 else m_keyBar->hide();
601 607
602} 608}
603 609
604 610
605void MainWindow::slotOpenButtons( bool state ) { 611void MainWindow::slotOpenButtons( bool state ) {
606 612
607 if ( state ) { 613 if ( state ) {
608 m_buttonBar->show(); 614 m_buttonBar->show();
609 } else { 615 } else {
610 m_buttonBar->hide(); 616 m_buttonBar->hide();
611 } 617 }
612} 618}
613 619
614 620
615 621
616void MainWindow::slotSessionChanged( Session* ses ) { 622void MainWindow::slotSessionChanged( Session* ses ) {
617 qWarning("changed!"); 623 qWarning("changed!");
618 624
619 if(m_curSession) 625 if(m_curSession)
620 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); 626 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide();
621 if(ses) 627 if(ses)
622 if(ses->transferDialog()) ses->transferDialog()->show(); 628 if(ses->transferDialog()) ses->transferDialog()->show();
623 629
624 if ( ses ) { 630 if ( ses ) {
625 m_curSession = ses; 631 m_curSession = ses;
626 qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); 632 qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) );
627 if ( m_curSession->layer()->isConnected() ) { 633 if ( m_curSession->layer()->isConnected() ) {
628 m_connect->setEnabled( false ); 634 m_connect->setEnabled( false );
629 m_disconnect->setEnabled( true ); 635 m_disconnect->setEnabled( true );
630 m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); 636 m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording());
631 m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); 637 m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording());
632 m_scripts->setItemEnabled(m_runScript_id, true); 638 m_scripts->setItemEnabled(m_runScript_id, true);
633 } else { 639 } else {
634 m_connect->setEnabled( true ); 640 m_connect->setEnabled( true );
635 m_disconnect->setEnabled( false ); 641 m_disconnect->setEnabled( false );
636 m_recordScript->setEnabled( false ); 642 m_recordScript->setEnabled( false );
637 m_saveScript->setEnabled( false ); 643 m_saveScript->setEnabled( false );
638 m_scripts->setItemEnabled(m_runScript_id, false); 644 m_scripts->setItemEnabled(m_runScript_id, false);
639 } 645 }
640 646
641 if ( ( m_curSession->layer() )->supports()[1] == 0 ) { 647 if ( ( m_curSession->layer() )->supports()[1] == 0 ) {
642 m_transfer->setEnabled( false ); 648 m_transfer->setEnabled( false );
643 } else { 649 } else {
644 m_transfer->setEnabled( true ); 650 m_transfer->setEnabled( true );
645 } 651 }
646 652
647 QWidget *w = m_curSession->widget(); 653 QWidget *w = m_curSession->widget();
648 if(w) w->setFocus(); 654 if(w) w->setFocus();
649 655
650 m_kb->load(currentSession()->profile()); 656 m_kb->load(currentSession()->profile());
651 } 657 }
652} 658}
653 659
654void MainWindow::slotFullscreen() { 660void MainWindow::slotFullscreen() {
655 661
656 662
657 663
658 if ( m_isFullscreen ) { 664 if ( m_isFullscreen ) {
659 ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true ); 665 ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), true );
660 ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() ); 666 ( m_curSession->widgetStack() )->resize( savedParentFullscreen->width(), savedParentFullscreen->height() );
661 ( m_curSession->emulationHandler() )->cornerButton()->hide(); 667 ( m_curSession->emulationHandler() )->cornerButton()->hide();
662 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 668 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
663 669
664 } else { 670 } else {
665 savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget(); 671 savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget();
666 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); 672 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
667 ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop 673 ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop
668 , QPoint(0,0), false ); 674 , QPoint(0,0), false );
669 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); 675 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() );
670 ( m_curSession->widgetStack() )->setFocus(); 676 ( m_curSession->widgetStack() )->setFocus();
671 ( m_curSession->widgetStack() )->show(); 677 ( m_curSession->widgetStack() )->show();
672 678
673 ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); 679 ( ( m_curSession->emulationHandler() )->cornerButton() )->show();
674 680
675 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 681 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
676 } 682 }
677 683
678 m_isFullscreen = !m_isFullscreen; 684 m_isFullscreen = !m_isFullscreen;
679} 685}
680 686
681 687
682void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) { 688void MainWindow::slotKeyReceived(FKey k, ushort, ushort, bool pressed) {
683 689
684 if ( m_curSession ) { 690 if ( m_curSession ) {
685 691
686 QEvent::Type state; 692 QEvent::Type state;
687 693
688 if (pressed) state = QEvent::KeyPress; 694 if (pressed) state = QEvent::KeyPress;
689 else state = QEvent::KeyRelease; 695 else state = QEvent::KeyRelease;
690 696
691 QKeyEvent ke(state, k.qcode, k.unicode, 0, QString(QChar(k.unicode))); 697 QKeyEvent ke(state, k.qcode, k.unicode, 0, QString(QChar(k.unicode)));
692 698
693 // is this the best way to do this? cant figure out any other way to work 699 // is this the best way to do this? cant figure out any other way to work
694 QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); 700 QApplication::sendEvent((QObject *)m_curSession->widget(), &ke);
695 ke.ignore(); 701 ke.ignore();
696 } 702 }
697} 703}
698void MainWindow::slotCopy() { 704void MainWindow::slotCopy() {
699 if (!currentSession() ) return; 705 if (!currentSession() ) return;
700 currentSession()->emulationHandler()->copy(); 706 currentSession()->emulationHandler()->copy();
701} 707}
702void MainWindow::slotPaste() { 708void MainWindow::slotPaste() {
703 if (!currentSession() ) return; 709 if (!currentSession() ) return;
704 currentSession()->emulationHandler()->paste(); 710 currentSession()->emulationHandler()->paste();
705} 711}
706 712
707/* 713/*
708 * Save the session 714 * Save the session
709 */ 715 */
710 716
711void MainWindow::slotSaveSession() { 717void MainWindow::slotSaveSession() {
712 if (!currentSession() ) { 718 if (!currentSession() ) {
713 QMessageBox::information(this, tr("Save Connection"), 719 QMessageBox::information(this, tr("Save Connection"),
714 tr("<qt>There is no Connection.</qt>"), 1 ); 720 tr("<qt>There is no Connection.</qt>"), 1 );
715 return; 721 return;
716 } 722 }
717 manager()->add( currentSession()->profile() ); 723 manager()->add( currentSession()->profile() );
718 manager()->save(); 724 manager()->save();
719 populateProfiles(); 725 populateProfiles();
720} 726}