summaryrefslogtreecommitdiff
path: root/core/settings/launcher/tabssettings.cpp
authorar <ar>2004-02-08 16:09:19 (UTC)
committer ar <ar>2004-02-08 16:09:19 (UTC)
commit6506eeeeaa8d52ae0895630de00e38bc2b8ff10c (patch) (unidiff)
treea306b368cc4192e6a8528c7d602e4726c73a247c /core/settings/launcher/tabssettings.cpp
parent811821ed75b87468f521bef2077cf5988aac9b47 (diff)
downloadopie-6506eeeeaa8d52ae0895630de00e38bc2b8ff10c.zip
opie-6506eeeeaa8d52ae0895630de00e38bc2b8ff10c.tar.gz
opie-6506eeeeaa8d52ae0895630de00e38bc2b8ff10c.tar.bz2
improve support for BigScreen
Diffstat (limited to 'core/settings/launcher/tabssettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/tabssettings.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp
index a3d31a5..17a1609 100644
--- a/core/settings/launcher/tabssettings.cpp
+++ b/core/settings/launcher/tabssettings.cpp
@@ -1,82 +1,83 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This file is free software; you can 5 _;:,     .>    :=|. This file is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This file is distributed in the hope that 12    .i_,=:_.      -<s. This file is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
17..}^=.=       =       ; Public License for more details. 17..}^=.=       =       ; Public License for more details.
18++=   -.     .`     .: 18++=   -.     .`     .:
19 :     =  ...= . :.=- You should have received a copy of the GNU 19 :     =  ...= . :.=- You should have received a copy of the GNU
20 -.   .:....=;==+<; General Public License along with this file; 20 -.   .:....=;==+<; General Public License along with this file;
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
25 25
26*/ 26*/
27 27
28#include "tabssettings.h" 28#include "tabssettings.h"
29 29
30#include <qpe/resource.h> 30#include <qpe/resource.h>
31#include <qpe/applnk.h> 31#include <qpe/applnk.h>
32#include <qpe/mimetype.h> 32#include <qpe/mimetype.h>
33#include <qpe/qcopenvelope_qws.h> 33#include <qpe/qcopenvelope_qws.h>
34#include <qpe/config.h> 34#include <qpe/config.h>
35#include <qpe/qpeapplication.h>
35 36
36#include <qlistbox.h> 37#include <qlistbox.h>
37#include <qpushbutton.h> 38#include <qpushbutton.h>
38#include <qlayout.h> 39#include <qlayout.h>
39#include <qlabel.h> 40#include <qlabel.h>
40#include <qwhatsthis.h> 41#include <qwhatsthis.h>
41#include <qcheckbox.h> 42#include <qcheckbox.h>
42 43
43#include "tabdialog.h" 44#include "tabdialog.h"
44 45
45#include <stdlib.h> 46#include <stdlib.h>
46#include <qmessagebox.h> 47#include <qmessagebox.h>
47 48
48 49
49 #define GLOBALID ".global." 50 #define GLOBALID ".global."
50 51
51 52
52TabsSettings::TabsSettings ( QWidget *parent, const char *name ) 53TabsSettings::TabsSettings ( QWidget *parent, const char *name )
53 : QWidget ( parent, name ) 54 : QWidget ( parent, name )
54{ 55{
55 QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); 56 QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 );
56 57
57 QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this ); 58 QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this );
58 lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); 59 lay-> addMultiCellWidget ( l, 0, 0, 0, 1 );
59 60
60 m_list = new QListBox ( this ); 61 m_list = new QListBox ( this );
61 lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); 62 lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 );
62 63
63 QWhatsThis::add ( m_list, tr( "foobar" )); 64 QWhatsThis::add ( m_list, tr( "foobar" ));
64 65
65 QPushButton *p1, *p2, *p3; 66 QPushButton *p1, *p2, *p3;
66 p1 = new QPushButton ( tr( "New" ), this ); 67 p1 = new QPushButton ( tr( "New" ), this );
67 lay-> addWidget ( p1, 1, 1 ); 68 lay-> addWidget ( p1, 1, 1 );
68 connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); 69 connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( )));
69 70
70 p2 = new QPushButton ( tr( "Edit" ), this ); 71 p2 = new QPushButton ( tr( "Edit" ), this );
71 lay-> addWidget ( p2, 2, 1 ); 72 lay-> addWidget ( p2, 2, 1 );
72 connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); 73 connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( )));
73 74
74 p3 = new QPushButton ( tr( "Delete" ), this ); 75 p3 = new QPushButton ( tr( "Delete" ), this );
75 lay-> addWidget ( p3, 3, 1 ); 76 lay-> addWidget ( p3, 3, 1 );
76 connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); 77 connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( )));
77 78
78 lay-> setRowStretch ( 4, 10 ); 79 lay-> setRowStretch ( 4, 10 );
79 80
80 m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this ); 81 m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this );
81 lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 ); 82 lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 );
82 83
@@ -255,63 +256,62 @@ void TabsSettings::accept ( )
255 256
256 QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" ); 257 QCopEnvelope fe ( "QPE/Launcher", "setFont(QString,QString,int,int,int)" );
257 fe << *it; 258 fe << *it;
258 fe << ( tc. m_font_use ? tc. m_font_family : QString::null ); 259 fe << ( tc. m_font_use ? tc. m_font_family : QString::null );
259 fe << tc. m_font_size; 260 fe << tc. m_font_size;
260 fe << tc. m_font_weight; 261 fe << tc. m_font_weight;
261 fe << ( tc. m_font_italic ? 1 : 0 ); 262 fe << ( tc. m_font_italic ? 1 : 0 );
262 263
263 tc. m_changed = false; 264 tc. m_changed = false;
264 } 265 }
265 cfg. setGroup ( "GUI" ); 266 cfg. setGroup ( "GUI" );
266 QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" ); 267 QString busytype = QString ( m_busyani-> isChecked ( ) ? "Animated" : "" );
267 cfg. writeEntry ( "BusyType", busytype ); 268 cfg. writeEntry ( "BusyType", busytype );
268 269
269 cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) ); 270 cfg. writeEntry ( "BigBusy", m_bigbusy->isChecked( ) );
270 271
271 { 272 {
272 QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); 273 QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" );
273 e << busytype; 274 e << busytype;
274 } 275 }
275} 276}
276 277
277void TabsSettings::newClicked ( ) 278void TabsSettings::newClicked ( )
278{ 279{
279 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); 280 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
280} 281}
281 282
282void TabsSettings::deleteClicked ( ) 283void TabsSettings::deleteClicked ( )
283{ 284{
284 int ind = m_list-> currentItem ( ); 285 int ind = m_list-> currentItem ( );
285 286
286 if ( ind < 0 ) 287 if ( ind < 0 )
287 return; 288 return;
288 289
289 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" )); 290 QMessageBox::information ( this, tr( "Error" ), tr( "Not implemented yet" ));
290} 291}
291 292
292void TabsSettings::editClicked ( ) 293void TabsSettings::editClicked ( )
293{ 294{
294 int ind = m_list-> currentItem ( ); 295 int ind = m_list-> currentItem ( );
295 296
296 if ( ind < 0 ) 297 if ( ind < 0 )
297 return; 298 return;
298 299
299 TabConfig tc = m_tabs [m_ids [ind]]; 300 TabConfig tc = m_tabs [m_ids [ind]];
300 301
301 TabDialog *d = new TabDialog ( m_list-> pixmap ( ind ), m_list-> text ( ind ), tc, this, "TabDialog", true ); 302 TabDialog *d = new TabDialog ( m_list-> pixmap ( ind ), m_list-> text ( ind ), tc, this, "TabDialog", true );
302 303
303 d-> showMaximized ( ); 304 if ( QPEApplication::execDialog( d ) == QDialog::Accepted ) {
304 if ( d-> exec ( ) == QDialog::Accepted ) {
305 tc. m_changed = true; 305 tc. m_changed = true;
306 m_tabs [m_ids [ind]] = tc; 306 m_tabs [m_ids [ind]] = tc;
307 307
308 if ( m_ids [ind] == GLOBALID ) { 308 if ( m_ids [ind] == GLOBALID ) {
309 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { 309 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
310 if ( *it != GLOBALID ) 310 if ( *it != GLOBALID )
311 m_tabs [*it] = tc; 311 m_tabs [*it] = tc;
312 } 312 }
313 } 313 }
314 } 314 }
315 315
316 delete d; 316 delete d;
317} 317}