summaryrefslogtreecommitdiff
path: root/core/settings/launcher/inputmethodsettings.cpp
Unidiff
Diffstat (limited to 'core/settings/launcher/inputmethodsettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/settings/launcher/inputmethodsettings.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/core/settings/launcher/inputmethodsettings.cpp b/core/settings/launcher/inputmethodsettings.cpp
new file mode 100644
index 0000000..1aa1ae8
--- a/dev/null
+++ b/core/settings/launcher/inputmethodsettings.cpp
@@ -0,0 +1,87 @@
1/*
2                This file is part of the OPIE Project
3 =. Copyright (c) 2002 Trolltech AS <info@trolltech.com>
4             .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org>
5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include "inputmethodsettings.h"
30
31#include <qpe/config.h>
32#include <qpe/qlibrary.h>
33#include <qpe/qpeapplication.h>
34
35#include <qspinbox.h>
36#include <qcheckbox.h>
37#include <qlayout.h>
38#include <qlabel.h>
39#include <qwhatsthis.h>
40
41InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name )
42{
43 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 );
44
45 _resize = new QCheckBox( tr( "Resize application on Popup" ), this );
46 _float = new QCheckBox( tr( "Enable floating and resizing" ), this );
47
48 QHBoxLayout* hbox = new QHBoxLayout( this, 4, 4 );
49 hbox->addWidget( new QLabel( "Initial Width:", this ) );
50 _size = new QSpinBox( 10, 100, 10, this );
51 _size->setSuffix( "%" );
52 hbox->addWidget( _size );
53 hbox->addStretch();
54
55 Config cfg( "Launcher" );
56 cfg.setGroup( "InputMethods" );
57 _resize->setChecked( cfg.readBoolEntry( "Resize", true ) );
58 _float->setChecked( cfg.readBoolEntry( "Float", false ) );
59 _size->setValue( cfg.readNumEntry( "Width", 100 ) );
60
61 lay->addWidget( _resize );
62 lay->addWidget( _float );
63 lay->addLayout( hbox );
64 lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) );
65
66 lay->addStretch();
67
68 QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) );
69 QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) );
70 QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) );
71}
72
73void InputMethodSettings::appletChanged()
74{
75}
76
77void InputMethodSettings::accept()
78{
79 qDebug( "InputMethodSettings::accept()" );
80 Config cfg( "Launcher" );
81 cfg.setGroup( "InputMethods" );
82 cfg.writeEntry( "Resize", _resize->isChecked() );
83 cfg.writeEntry( "Float", _float->isChecked() );
84 cfg.writeEntry( "Width", _size->value() );
85 cfg.write();
86}
87