summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-11 21:08:16 (UTC)
committer alwin <alwin>2004-11-11 21:08:16 (UTC)
commite85cf7184c3444e26c1858d0564fa5d3614dd7b5 (patch) (unidiff)
tree19b28857c856bfb2d5c399892e059c30f992aaf4
parent364f1787cd32a132614791b04c886dee174e2aa4 (diff)
downloadopie-e85cf7184c3444e26c1858d0564fa5d3614dd7b5.zip
opie-e85cf7184c3444e26c1858d0564fa5d3614dd7b5.tar.gz
opie-e85cf7184c3444e26c1858d0564fa5d3614dd7b5.tar.bz2
send qcop signal when enable/disable doctab
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/doctabsettings.cpp53
-rw-r--r--core/settings/launcher/doctabsettings.h42
2 files changed, 53 insertions, 42 deletions
diff --git a/core/settings/launcher/doctabsettings.cpp b/core/settings/launcher/doctabsettings.cpp
index dfdc9be..9a001a6 100644
--- a/core/settings/launcher/doctabsettings.cpp
+++ b/core/settings/launcher/doctabsettings.cpp
@@ -1,72 +1,83 @@
1/* 1/*
2                This file is part of the OPIE Project 2 This file is part of the OPIE Project
3 =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> 3 =. Copyright (c) 2002 Trolltech AS <info@trolltech.com>
4             .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> 4 .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org>
5           .>+-= 5 .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6_;:, .> :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_, > . <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.-- : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i, .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10- . .-<_> .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11 ._= =} : or (at your option) any later version.
12    .%`+i>       _;_. 12 .%`+i> _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13 .i_,=:_. -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15 : .. .:, . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.= = ; Public License for more details.
19++=   -.     .`     .: 19++= -. .` .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20: = ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21-. .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22 -_. . . )=. = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23 -- :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "doctabsettings.h" 29#include "doctabsettings.h"
30 30
31/* OPIE */ 31/* OPIE */
32#include <qpe/config.h> 32#include <qpe/config.h>
33#include <opie2/odebug.h> 33#include <opie2/odebug.h>
34 34
35/* QT */ 35/* QT */
36#include <qcheckbox.h> 36#include <qcheckbox.h>
37#include <qlayout.h> 37#include <qlayout.h>
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qwhatsthis.h> 39#include <qwhatsthis.h>
40 40
41#ifdef Q_WS_QWS
42#include <qtopia/qcopenvelope_qws.h>
43#endif
44
41 45
42DocTabSettings::DocTabSettings( QWidget *parent, const char *name ):QWidget( parent, name ) 46DocTabSettings::DocTabSettings( QWidget *parent, const char *name ):QWidget( parent, name )
43{ 47{
44 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); 48 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 );
45 49
46 _enable = new QCheckBox( tr( "Enable the Documents Tab" ), this ); 50 _enable = new QCheckBox( tr( "Enable the Documents Tab" ), this );
47 51
48 Config cfg( "Launcher" ); 52 Config cfg( "Launcher" );
49 cfg.setGroup( "DocTab" ); 53 cfg.setGroup( "DocTab" );
50 _enable->setChecked( cfg.readBoolEntry( "Enable", true ) ); 54 _enable->setChecked( cfg.readBoolEntry( "Enable", true ) );
51 55
52 lay->addWidget( _enable ); 56 lay->addWidget( _enable );
53 lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); 57 lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) );
54 58
55 lay->addStretch(); 59 lay->addStretch();
56 60
57 QWhatsThis::add( _enable, tr( "Check, if you want the Documents Tab to be visible." ) ); 61 QWhatsThis::add( _enable, tr( "Check, if you want the Documents Tab to be visible." ) );
58} 62}
59 63
60void DocTabSettings::appletChanged() 64void DocTabSettings::appletChanged()
61{ 65{
62} 66}
63 67
64void DocTabSettings::accept() 68void DocTabSettings::accept()
65{ 69{
66 odebug << "DocTabSettings::accept()" << oendl; 70 odebug << "DocTabSettings::accept()" << oendl;
67 Config cfg( "Launcher" ); 71 Config cfg( "Launcher" );
68 cfg.setGroup( "DocTab" ); 72 cfg.setGroup( "DocTab" );
69 cfg.writeEntry( "Enable", _enable->isChecked() ); 73 cfg.writeEntry( "Enable", _enable->isChecked() );
70 cfg.write(); 74 cfg.write();
75#if defined(Q_WS_QWS)
76 {
77 QCopEnvelope cop("QPE/Launcher","doctabEnabled(int)");
78 cop << _enable->isChecked();
79 odebug << "Sending envelope" << oendl;
80 }
81#endif
71} 82}
72 83
diff --git a/core/settings/launcher/doctabsettings.h b/core/settings/launcher/doctabsettings.h
index ad6447c..777c32c 100644
--- a/core/settings/launcher/doctabsettings.h
+++ b/core/settings/launcher/doctabsettings.h
@@ -1,55 +1,55 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2 =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> 3 .=l. Copyright (c) 2003 Michael Lauer <mickeyl@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#ifndef __DOCTAB_SETTINGS_H__ 28#ifndef __DOCTAB_SETTINGS_H__
29#define __DOCTAB_SETTINGS_H__ 29#define __DOCTAB_SETTINGS_H__
30 30
31#include <qwidget.h> 31#include <qwidget.h>
32 32
33class QCheckBox; 33class QCheckBox;
34class QSpinBox; 34class QSpinBox;
35 35
36class DocTabSettings : public QWidget 36class DocTabSettings : public QWidget
37{ 37{
38 Q_OBJECT 38 Q_OBJECT
39 39
40 public: 40 public:
41 DocTabSettings ( QWidget *parent = 0, const char *name = 0 ); 41 DocTabSettings ( QWidget *parent = 0, const char *name = 0 );
42 42
43 void accept ( ); 43 void accept ( );
44 44
45 protected slots: 45 protected slots:
46 void appletChanged ( ); 46 void appletChanged ( );
47 47
48 protected: 48 protected:
49 void init ( ); 49 void init ( );
50 50
51 private: 51 private:
52 QCheckBox* _enable; 52 QCheckBox* _enable;
53}; 53};
54 54
55#endif 55#endif