summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp21
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp2
2 files changed, 12 insertions, 11 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 46c5bed..0a58b6c 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -37,33 +37,33 @@ void MainWindow::initUI() {
37 m_tool = new QToolBar( this ); 37 m_tool = new QToolBar( this );
38 m_tool->setHorizontalStretchable( TRUE ); 38 m_tool->setHorizontalStretchable( TRUE );
39 39
40 m_bar = new QMenuBar( m_tool ); 40 m_bar = new QMenuBar( m_tool );
41 m_console = new QPopupMenu( this ); 41 m_console = new QPopupMenu( this );
42 m_scripts = new QPopupMenu( this ); 42 m_scripts = new QPopupMenu( this );
43 m_sessionsPop= new QPopupMenu( this ); 43 m_sessionsPop= new QPopupMenu( this );
44 m_settings = new QPopupMenu( this ); 44 m_settings = new QPopupMenu( this );
45 45
46 /* add a toolbar for icons */ 46 /* add a toolbar for icons */
47 m_icons = new QToolBar(this); 47 m_icons = new QToolBar(this);
48 48
49 /* 49 /*
50 * new Action for new sessions 50 * new Action for new sessions
51 */ 51 */
52 QAction* a = new QAction(tr("New Connection"), 52 QAction* a = new QAction(tr("New Connection"),
53 Resource::loadPixmap( "new" ), 53 Resource::loadPixmap( "new" ),
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 /*
@@ -87,89 +87,89 @@ void MainWindow::initUI() {
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 );
107 connect( m_setProfiles, SIGNAL(activated() ), 107 connect( m_setProfiles, SIGNAL(activated() ),
108 this, SLOT(slotConfigure() ) ); 108 this, SLOT(slotConfigure() ) );
109 109
110 /* 110 /*
111 * script actions 111 * script actions
112 */ 112 */
113 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); 113 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0);
114 m_recordScript->addTo(m_scripts); 114 m_recordScript->addTo(m_scripts);
115 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); 115 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript()));
116 116
117 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); 117 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0);
118 m_saveScript->addTo(m_scripts); 118 m_saveScript->addTo(m_scripts);
119 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); 119 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript()));
120 120
121 m_runScript = new QAction(tr("Run Script"), QString::null, 0, this, 0); 121 m_runScript = new QAction(tr("Run Script"), QString::null, 0, this, 0);
122 m_runScript->addTo(m_scripts); 122 m_runScript->addTo(m_scripts);
123 connect(m_runScript, SIGNAL(activated()), this, SLOT(slotRunScript())); 123 connect(m_runScript, SIGNAL(activated()), this, SLOT(slotRunScript()));
124 124
125 /* 125 /*
126 * action that open/closes the keyboard 126 * action that open/closes the keyboard
127 */ 127 */
128 m_openKeys = new QAction (tr("Open Keyboard..."), 128 m_openKeys = new QAction (tr("Open Keyboard..."),
129 Resource::loadPixmap( "down" ), 129 Resource::loadPixmap( "down" ),
130 QString::null, 0, this, 0); 130 QString::null, 0, this, 0);
131 131
132 m_openKeys->setToggleAction(true); 132 m_openKeys->setToggleAction(true);
133 133
134 connect (m_openKeys, SIGNAL(toggled(bool)), 134 connect (m_openKeys, SIGNAL(toggled(bool)),
135 this, SLOT(slotOpenKeb(bool))); 135 this, SLOT(slotOpenKeb(bool)));
136 m_openKeys->addTo(m_icons); 136 m_openKeys->addTo(m_icons);
137 137
138 138
139 /* insert the submenu */ 139 /* insert the submenu */
140 m_console->insertItem(tr("New from Profile"), m_sessionsPop, 140 m_console->insertItem(tr("New from Profile"), m_sessionsPop,
141 -1, 0); 141 -1, 0);
142 142
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 setCentralWidget( m_consoleWindow ); 167 setCentralWidget( m_consoleWindow );
168 168
169} 169}
170 170
171ProfileManager* MainWindow::manager() { 171ProfileManager* MainWindow::manager() {
172 return m_manager; 172 return m_manager;
173} 173}
174TabWidget* MainWindow::tabWidget() { 174TabWidget* MainWindow::tabWidget() {
175 return m_consoleWindow; 175 return m_consoleWindow;
@@ -189,32 +189,33 @@ MainWindow::~MainWindow() {
189 189
190MetaFactory* MainWindow::factory() { 190MetaFactory* MainWindow::factory() {
191 return m_factory; 191 return m_factory;
192} 192}
193 193
194Session* MainWindow::currentSession() { 194Session* MainWindow::currentSession() {
195 return m_curSession; 195 return m_curSession;
196} 196}
197 197
198QList<Session> MainWindow::sessions() { 198QList<Session> MainWindow::sessions() {
199 return m_sessions; 199 return m_sessions;
200} 200}
201 201
202void MainWindow::slotNew() { 202void MainWindow::slotNew() {
203 qWarning("New Connection"); 203 qWarning("New Connection");
204 ProfileEditorDialog dlg(factory() ); 204 ProfileEditorDialog dlg(factory() );
205 dlg.showMaximized();
205 int ret = dlg.exec(); 206 int ret = dlg.exec();
206 207
207 if ( ret == QDialog::Accepted ) { 208 if ( ret == QDialog::Accepted ) {
208 create( dlg.profile() ); 209 create( dlg.profile() );
209 } 210 }
210} 211}
211 212
212void MainWindow::slotRecordScript() { 213void MainWindow::slotRecordScript() {
213 if (currentSession()) { 214 if (currentSession()) {
214 currentSession()->emulationLayer()->startRecording(); 215 currentSession()->emulationLayer()->startRecording();
215 } 216 }
216} 217}
217 218
218void MainWindow::slotSaveScript() { 219void MainWindow::slotSaveScript() {
219 if (currentSession() && currentSession()->emulationLayer()->isRecording()) { 220 if (currentSession() && currentSession()->emulationLayer()->isRecording()) {
220 MimeTypes types; 221 MimeTypes types;
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp
index 78751e7..c965700 100644
--- a/noncore/apps/opie-console/profilemanager.cpp
+++ b/noncore/apps/opie-console/profilemanager.cpp
@@ -64,33 +64,33 @@ Profile::ValueList ProfileManager::all()const {
64 * add "Widget" to the layout 64 * add "Widget" to the layout
65 * add the dummy to the stack 65 * add the dummy to the stack
66 * raise the dummy 66 * raise the dummy
67 * call session->connect(= 67 * call session->connect(=
68 * this way we only need to reparent 68 * this way we only need to reparent
69 * in TabWidget 69 * in TabWidget
70 */ 70 */
71Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) { 71Session* ProfileManager::fromProfile( const Profile& prof, QWidget* parent) {
72 Session* session = new Session(); 72 Session* session = new Session();
73 session->setName( prof.name() ); 73 session->setName( prof.name() );
74 /* translate the internal name to the external */ 74 /* translate the internal name to the external */
75 session->setIOLayer(m_fact->newIOLayer( m_fact->external(prof.ioLayerName()) , 75 session->setIOLayer(m_fact->newIOLayer( m_fact->external(prof.ioLayerName()) ,
76 prof) ); 76 prof) );
77 77
78 QWidgetStack *stack = new QWidgetStack(parent); 78 QWidgetStack *stack = new QWidgetStack(parent);
79 session->setWidgetStack( stack ); 79 session->setWidgetStack( stack );
80 QWidget* dummy = new QWidget(stack ); 80 QWidget* dummy = new QWidget( stack );
81 QHBoxLayout* lay = new QHBoxLayout(dummy ); 81 QHBoxLayout* lay = new QHBoxLayout(dummy );
82 stack->addWidget( dummy, 0 ); 82 stack->addWidget( dummy, 0 );
83 stack->raiseWidget( 0 ); 83 stack->raiseWidget( 0 );
84 WidgetLayer* wid = new EmulationWidget( prof, dummy ); 84 WidgetLayer* wid = new EmulationWidget( prof, dummy );
85 lay->addWidget( wid ); 85 lay->addWidget( wid );
86 86
87 session->setEmulationWidget( wid ); 87 session->setEmulationWidget( wid );
88 session->setEmulationLayer( m_fact->newEmulationLayer( m_fact->external( prof.terminalName() ), 88 session->setEmulationLayer( m_fact->newEmulationLayer( m_fact->external( prof.terminalName() ),
89 wid ) ); 89 wid ) );
90 session->connect(); 90 session->connect();
91 91
92 return session; 92 return session;
93} 93}
94void ProfileManager::save( ) { 94void ProfileManager::save( ) {
95 QFile::remove( (QString(getenv("HOME") )+ "/Settings/opie-console-profiles.conf" ) ); 95 QFile::remove( (QString(getenv("HOME") )+ "/Settings/opie-console-profiles.conf" ) );
96 ProfileConfig conf("opie-console-profiles"); 96 ProfileConfig conf("opie-console-profiles");