author | harlekin <harlekin> | 2002-10-24 19:36:02 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-24 19:36:02 (UTC) |
commit | a6f955c55d44341f25986bb1a9d008ade58b44b0 (patch) (unidiff) | |
tree | e5fd0b7aa4115f5c83401462685f16e68bb21b19 | |
parent | 1fb831ed1804a22455b5e4c9c8d9411e098c17e8 (diff) | |
download | opie-a6f955c55d44341f25986bb1a9d008ade58b44b0.zip opie-a6f955c55d44341f25986bb1a9d008ade58b44b0.tar.gz opie-a6f955c55d44341f25986bb1a9d008ade58b44b0.tar.bz2 |
added save icon
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 103 |
1 files changed, 100 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 2e00a07..895fa9e 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -9,109 +9,206 @@ | |||
9 | #include <qpushbutton.h> | 9 | #include <qpushbutton.h> |
10 | #include <qwhatsthis.h> | 10 | #include <qwhatsthis.h> |
11 | 11 | ||
12 | #include <qpe/resource.h> | 12 | #include <qpe/resource.h> |
13 | #include <qpe/qpeapplication.h> | 13 | #include <qpe/qpeapplication.h> |
14 | #include <qpe/filemanager.h> | 14 | #include <qpe/filemanager.h> |
15 | #include <qpe/mimetype.h> | 15 | #include <qpe/mimetype.h> |
16 | 16 | ||
17 | #include <opie/ofiledialog.h> | 17 | #include <opie/ofiledialog.h> |
18 | 18 | ||
19 | #include "keytrans.h" | 19 | #include "keytrans.h" |
20 | #include "profileeditordialog.h" | 20 | #include "profileeditordialog.h" |
21 | #include "configdialog.h" | 21 | #include "configdialog.h" |
22 | #include "default.h" | 22 | #include "default.h" |
23 | #include "metafactory.h" | 23 | #include "metafactory.h" |
24 | #include "profile.h" | 24 | #include "profile.h" |
25 | #include "profilemanager.h" | 25 | #include "profilemanager.h" |
26 | #include "mainwindow.h" | 26 | #include "mainwindow.h" |
27 | #include "tabwidget.h" | 27 | #include "tabwidget.h" |
28 | #include "transferdialog.h" | 28 | #include "transferdialog.h" |
29 | #include "function_keyboard.h" | 29 | #include "function_keyboard.h" |
30 | #include "emulation_handler.h" | 30 | #include "emulation_handler.h" |
31 | #include "script.h" | 31 | #include "script.h" |
32 | 32 | ||
33 | static char * filesave_xpm[] = { | ||
34 | "16 16 78 1", | ||
35 | " c None", | ||
36 | ". c #343434", | ||
37 | "+ c #A0A0A0", | ||
38 | "@ c #565656", | ||
39 | "# c #9E9E9E", | ||
40 | "$ c #525252", | ||
41 | "% c #929292", | ||
42 | "& c #676767", | ||
43 | "* c #848484", | ||
44 | "= c #666666", | ||
45 | "- c #D8D8D8", | ||
46 | "; c #FFFFFF", | ||
47 | "> c #DBDBDB", | ||
48 | ", c #636363", | ||
49 | "' c #989898", | ||
50 | ") c #2D2D2D", | ||
51 | "! c #909090", | ||
52 | "~ c #AEAEAE", | ||
53 | "{ c #EAEAEA", | ||
54 | "] c #575757", | ||
55 | "^ c #585858", | ||
56 | "/ c #8A8A8A", | ||
57 | "( c #828282", | ||
58 | "_ c #6F6F6F", | ||
59 | ": c #C9C9C9", | ||
60 | "< c #050505", | ||
61 | "[ c #292929", | ||
62 | "} c #777777", | ||
63 | "| c #616161", | ||
64 | "1 c #3A3A3A", | ||
65 | "2 c #BEBEBE", | ||
66 | "3 c #2C2C2C", | ||
67 | "4 c #7C7C7C", | ||
68 | "5 c #F6F6F6", | ||
69 | "6 c #FCFCFC", | ||
70 | "7 c #6B6B6B", | ||
71 | "8 c #959595", | ||
72 | "9 c #4F4F4F", | ||
73 | "0 c #808080", | ||
74 | "a c #767676", | ||
75 | "b c #818181", | ||
76 | "c c #B8B8B8", | ||
77 | "d c #FBFBFB", | ||
78 | "e c #F9F9F9", | ||
79 | "f c #CCCCCC", | ||
80 | "g c #030303", | ||
81 | "h c #737373", | ||
82 | "i c #7A7A7A", | ||
83 | "j c #7E7E7E", | ||
84 | "k c #6A6A6A", | ||
85 | "l c #FAFAFA", | ||
86 | "m c #505050", | ||
87 | "n c #9D9D9D", | ||
88 | "o c #333333", | ||
89 | "p c #7B7B7B", | ||
90 | "q c #787878", | ||
91 | "r c #696969", | ||
92 | "s c #494949", | ||
93 | "t c #555555", | ||
94 | "u c #949494", | ||
95 | "v c #E6E6E6", | ||
96 | "w c #424242", | ||
97 | "x c #515151", | ||
98 | "y c #535353", | ||
99 | "z c #3E3E3E", | ||
100 | "A c #D4D4D4", | ||
101 | "B c #0C0C0C", | ||
102 | "C c #353535", | ||
103 | "D c #474747", | ||
104 | "E c #ECECEC", | ||
105 | "F c #919191", | ||
106 | "G c #7D7D7D", | ||
107 | "H c #000000", | ||
108 | "I c #404040", | ||
109 | "J c #858585", | ||
110 | "K c #323232", | ||
111 | "L c #D0D0D0", | ||
112 | "M c #1C1C1C", | ||
113 | " ...+ ", | ||
114 | " @#$%&..+ ", | ||
115 | " .*=-;;>,..+ ", | ||
116 | " ')!~;;;;;;{]..", | ||
117 | " ^/(-;;;;;;;_:<", | ||
118 | " [}|;;;;;;;{12$", | ||
119 | " #34-55;;;;678$+", | ||
120 | " 90ab=c;dd;e1fg ", | ||
121 | " [ahij((kbl0mn$ ", | ||
122 | " op^q^^7r&]s/$+ ", | ||
123 | "@btu;vbwxy]zAB ", | ||
124 | "CzDEvEv;;DssF$ ", | ||
125 | "G.H{E{E{IxsJ$+ ", | ||
126 | " +...vEKxzLM ", | ||
127 | " +...z]n$ ", | ||
128 | " +... "}; | ||
129 | |||
33 | 130 | ||
34 | 131 | ||
35 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 132 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
36 | KeyTrans::loadAll(); | 133 | KeyTrans::loadAll(); |
37 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 134 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
38 | KeyTrans* s = KeyTrans::find(i ); | 135 | KeyTrans* s = KeyTrans::find(i ); |
39 | assert( s ); | 136 | assert( s ); |
40 | } | 137 | } |
41 | m_factory = new MetaFactory(); | 138 | m_factory = new MetaFactory(); |
42 | Default def(m_factory); | 139 | Default def(m_factory); |
43 | m_sessions.setAutoDelete( TRUE ); | 140 | m_sessions.setAutoDelete( TRUE ); |
44 | m_curSession = 0; | 141 | m_curSession = 0; |
45 | m_manager = new ProfileManager( m_factory ); | 142 | m_manager = new ProfileManager( m_factory ); |
46 | m_manager->load(); | 143 | m_manager->load(); |
47 | 144 | ||
48 | initUI(); | 145 | initUI(); |
49 | populateProfiles(); | 146 | populateProfiles(); |
50 | populateScripts(); | 147 | populateScripts(); |
51 | } | 148 | } |
52 | void MainWindow::initUI() { | 149 | void MainWindow::initUI() { |
53 | setToolBarsMovable( FALSE ); | 150 | setToolBarsMovable( FALSE ); |
54 | 151 | ||
55 | /* tool bar for the menu */ | 152 | /* tool bar for the menu */ |
56 | m_tool = new QToolBar( this ); | 153 | m_tool = new QToolBar( this ); |
57 | m_tool->setHorizontalStretchable( TRUE ); | 154 | m_tool->setHorizontalStretchable( TRUE ); |
58 | 155 | ||
59 | m_bar = new QMenuBar( m_tool ); | 156 | m_bar = new QMenuBar( m_tool ); |
60 | m_console = new QPopupMenu( this ); | 157 | m_console = new QPopupMenu( this ); |
61 | m_scripts = new QPopupMenu( this ); | 158 | m_scripts = new QPopupMenu( this ); |
62 | m_sessionsPop= new QPopupMenu( this ); | 159 | m_sessionsPop= new QPopupMenu( this ); |
63 | m_scriptsPop = new QPopupMenu( this ); | 160 | m_scriptsPop = new QPopupMenu( this ); |
64 | 161 | ||
65 | /* add a toolbar for icons */ | 162 | /* add a toolbar for icons */ |
66 | m_icons = new QToolBar(this); | 163 | m_icons = new QToolBar(this); |
67 | 164 | ||
68 | /* | 165 | /* |
69 | * the settings action | 166 | * the settings action |
70 | */ | 167 | */ |
71 | m_setProfiles = new QAction(tr("Configure Profiles"), | 168 | m_setProfiles = new QAction(tr("Configure Profiles"), |
72 | Resource::loadPixmap( "SettingsIcon" ), | 169 | Resource::loadPixmap( "SettingsIcon" ), |
73 | QString::null, 0, this, 0); | 170 | QString::null, 0, this, 0); |
74 | m_setProfiles->addTo( m_console ); | 171 | m_setProfiles->addTo( m_console ); |
75 | connect( m_setProfiles, SIGNAL(activated() ), | 172 | connect( m_setProfiles, SIGNAL(activated() ), |
76 | this, SLOT(slotConfigure() ) ); | 173 | this, SLOT(slotConfigure() ) ); |
77 | 174 | ||
78 | m_console->insertSeparator(); | 175 | m_console->insertSeparator(); |
79 | /* | 176 | /* |
80 | * new Action for new sessions | 177 | * new Action for new sessions |
81 | */ | 178 | */ |
82 | QAction* newCon = new QAction(tr("New Connection"), | 179 | QAction* newCon = new QAction(tr("New Connection"), |
83 | Resource::loadPixmap( "new" ), | 180 | Resource::loadPixmap( "new" ), |
84 | QString::null, 0, this, 0); | 181 | QString::null, 0, this, 0); |
85 | newCon->addTo( m_console ); | 182 | newCon->addTo( m_console ); |
86 | connect( newCon, SIGNAL(activated() ), | 183 | connect( newCon, SIGNAL(activated() ), |
87 | this, SLOT(slotNew() ) ); | 184 | this, SLOT(slotNew() ) ); |
88 | 185 | ||
89 | m_console->insertSeparator(); | 186 | m_console->insertSeparator(); |
90 | /* save icon is not available */ | 187 | /* save icon is not available */ |
91 | 188 | ||
92 | QAction *saveCon = new QAction(tr("Save Connection"), | 189 | QAction *saveCon = new QAction(tr("Save Connection"), |
93 | Resource::loadPixmap("save"), QString::null, | 190 | QPixmap( ( const char** ) filesave_xpm ) , QString::null, |
94 | 0, this, 0 ); | 191 | 0, this, 0 ); |
95 | saveCon->addTo( m_console ); | 192 | saveCon->addTo( m_console ); |
96 | connect( saveCon, SIGNAL(activated() ), | 193 | connect( saveCon, SIGNAL(activated() ), |
97 | this, SLOT(slotSaveSession() ) ); | 194 | this, SLOT(slotSaveSession() ) ); |
98 | m_console->insertSeparator(); | 195 | m_console->insertSeparator(); |
99 | 196 | ||
100 | /* | 197 | /* |
101 | * connect action | 198 | * connect action |
102 | */ | 199 | */ |
103 | m_connect = new QAction(); | 200 | m_connect = new QAction(); |
104 | m_connect->setText( tr("Connect") ); | 201 | m_connect->setText( tr("Connect") ); |
105 | m_connect->addTo( m_console ); | 202 | m_connect->addTo( m_console ); |
106 | connect(m_connect, SIGNAL(activated() ), | 203 | connect(m_connect, SIGNAL(activated() ), |
107 | this, SLOT(slotConnect() ) ); | 204 | this, SLOT(slotConnect() ) ); |
108 | 205 | ||
109 | /* | 206 | /* |
110 | * disconnect action | 207 | * disconnect action |
111 | */ | 208 | */ |
112 | m_disconnect = new QAction(); | 209 | m_disconnect = new QAction(); |
113 | m_disconnect->setText( tr("Disconnect") ); | 210 | m_disconnect->setText( tr("Disconnect") ); |
114 | m_disconnect->addTo( m_console ); | 211 | m_disconnect->addTo( m_console ); |
115 | connect(m_disconnect, SIGNAL(activated() ), | 212 | connect(m_disconnect, SIGNAL(activated() ), |
116 | this, SLOT(slotDisconnect() ) ); | 213 | this, SLOT(slotDisconnect() ) ); |
117 | 214 | ||
@@ -136,49 +233,49 @@ void MainWindow::initUI() { | |||
136 | this, SLOT( slotFullscreen() ) ); | 233 | this, SLOT( slotFullscreen() ) ); |
137 | 234 | ||
138 | m_console->insertSeparator(); | 235 | m_console->insertSeparator(); |
139 | /* | 236 | /* |
140 | * terminate action | 237 | * terminate action |
141 | */ | 238 | */ |
142 | m_terminate = new QAction(); | 239 | m_terminate = new QAction(); |
143 | m_terminate->setText( tr("Terminate") ); | 240 | m_terminate->setText( tr("Terminate") ); |
144 | m_terminate->addTo( m_console ); | 241 | m_terminate->addTo( m_console ); |
145 | connect(m_terminate, SIGNAL(activated() ), | 242 | connect(m_terminate, SIGNAL(activated() ), |
146 | this, SLOT(slotTerminate() ) ); | 243 | this, SLOT(slotTerminate() ) ); |
147 | 244 | ||
148 | m_closewindow = new QAction(); | 245 | m_closewindow = new QAction(); |
149 | m_closewindow->setText( tr("Close Window") ); | 246 | m_closewindow->setText( tr("Close Window") ); |
150 | m_closewindow->addTo( m_console ); | 247 | m_closewindow->addTo( m_console ); |
151 | connect( m_closewindow, SIGNAL(activated() ), | 248 | connect( m_closewindow, SIGNAL(activated() ), |
152 | this, SLOT(slotClose() ) ); | 249 | this, SLOT(slotClose() ) ); |
153 | 250 | ||
154 | 251 | ||
155 | /* | 252 | /* |
156 | * script actions | 253 | * script actions |
157 | */ | 254 | */ |
158 | m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0); | 255 | m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0); |
159 | connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int))); | 256 | connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int))); |
160 | 257 | ||
161 | m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); | 258 | m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); |
162 | m_recordScript->addTo(m_scripts); | 259 | m_recordScript->addTo(m_scripts); |
163 | connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); | 260 | connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); |
164 | 261 | ||
165 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); | 262 | m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); |
166 | m_saveScript->addTo(m_scripts); | 263 | m_saveScript->addTo(m_scripts); |
167 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); | 264 | connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); |
168 | 265 | ||
169 | 266 | ||
170 | /* | 267 | /* |
171 | * action that open/closes the keyboard | 268 | * action that open/closes the keyboard |
172 | */ | 269 | */ |
173 | m_openKeys = new QAction (tr("Open Keyboard..."), | 270 | m_openKeys = new QAction (tr("Open Keyboard..."), |
174 | Resource::loadPixmap( "console/keys/keyboard_icon" ), | 271 | Resource::loadPixmap( "console/keys/keyboard_icon" ), |
175 | QString::null, 0, this, 0); | 272 | QString::null, 0, this, 0); |
176 | m_openKeys->setToggleAction(true); | 273 | m_openKeys->setToggleAction(true); |
177 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); | 274 | connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); |
178 | 275 | ||
179 | /* insert the submenu */ | 276 | /* insert the submenu */ |
180 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, | 277 | m_console->insertItem(tr("New from Profile"), m_sessionsPop, |
181 | -1, 0); | 278 | -1, 0); |
182 | 279 | ||
183 | /* insert the connection menu */ | 280 | /* insert the connection menu */ |
184 | m_bar->insertItem( tr("Connection"), m_console ); | 281 | m_bar->insertItem( tr("Connection"), m_console ); |