From 4c9bda8027049b7ea423471a213eca2068490b08 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 02 Oct 2003 15:53:52 +0000 Subject: Start with some customization bits for inputmethods as part of the BigScreen initiative. You can now choose to have free floating and resizable inputmethods. Two outstanding things: 1.) Hiding the inputmethod via the [x] button confuses the show/hide toggle button. 2.) The new size and position of a moved/resized inputmethod should be remembered. --- (limited to 'core/settings') 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 @@ +/* +                This file is part of the OPIE Project + =. Copyright (c) 2002 Trolltech AS +             .=l. Copyright (c) 2003 Michael Lauer +           .>+-= + _;:,     .>    :=|. This file is free software; you can +.> <`_,   >  .   <= redistribute it and/or modify it under +:`=1 )Y*s>-.--   : the terms of the GNU General Public +.="- .-=="i,     .._ License as published by the Free Software + - .   .-<_>     .<> Foundation; either version 2 of the License, +     ._= =}       : or (at your option) any later version. +    .%`+i>       _;_. +    .i_,=:_.      -`: PARTICULAR PURPOSE. See the GNU General +..}^=.=       =       ; Public License for more details. +++=   -.     .`     .: + :     =  ...= . :.=- You should have received a copy of the GNU + -.   .:....=;==+<; General Public License along with this file; +  -_. . .   )=.  = see the file COPYING. If not, write to the +    --        :-=` Free Software Foundation, Inc., + 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#include "inputmethodsettings.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name ) +{ + QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); + + _resize = new QCheckBox( tr( "Resize application on Popup" ), this ); + _float = new QCheckBox( tr( "Enable floating and resizing" ), this ); + + QHBoxLayout* hbox = new QHBoxLayout( this, 4, 4 ); + hbox->addWidget( new QLabel( "Initial Width:", this ) ); + _size = new QSpinBox( 10, 100, 10, this ); + _size->setSuffix( "%" ); + hbox->addWidget( _size ); + hbox->addStretch(); + + Config cfg( "Launcher" ); + cfg.setGroup( "InputMethods" ); + _resize->setChecked( cfg.readBoolEntry( "Resize", true ) ); + _float->setChecked( cfg.readBoolEntry( "Float", false ) ); + _size->setValue( cfg.readNumEntry( "Width", 100 ) ); + + lay->addWidget( _resize ); + lay->addWidget( _float ); + lay->addLayout( hbox ); + lay->addWidget( new QLabel( tr( "Note: Changing these settings may need restarting Opie to become effective." ), this ) ); + + lay->addStretch(); + + QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) ); + QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) ); + QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) ); +} + +void InputMethodSettings::appletChanged() +{ +} + +void InputMethodSettings::accept() +{ + qDebug( "InputMethodSettings::accept()" ); + Config cfg( "Launcher" ); + cfg.setGroup( "InputMethods" ); + cfg.writeEntry( "Resize", _resize->isChecked() ); + cfg.writeEntry( "Float", _float->isChecked() ); + cfg.writeEntry( "Width", _size->value() ); + cfg.write(); +} + diff --git a/core/settings/launcher/inputmethodsettings.h b/core/settings/launcher/inputmethodsettings.h new file mode 100644 index 0000000..486ee5e --- a/dev/null +++ b/core/settings/launcher/inputmethodsettings.h @@ -0,0 +1,57 @@ +/* +               =. This file is part of the OPIE Project +             .=l. Copyright (c) 2003 Michael Lauer +           .>+-= + _;:,     .>    :=|. This file is free software; you can +.> <`_,   >  .   <= redistribute it and/or modify it under +:`=1 )Y*s>-.--   : the terms of the GNU General Public +.="- .-=="i,     .._ License as published by the Free Software + - .   .-<_>     .<> Foundation; either version 2 of the License, +     ._= =}       : or (at your option) any later version. +    .%`+i>       _;_. +    .i_,=:_.      -`: PARTICULAR PURPOSE. See the GNU General +..}^=.=       =       ; Public License for more details. +++=   -.     .`     .: + :     =  ...= . :.=- You should have received a copy of the GNU + -.   .:....=;==+<; General Public License along with this file; +  -_. . .   )=.  = see the file COPYING. If not, write to the +    --        :-=` Free Software Foundation, Inc., + 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#ifndef __IMETHOD_SETTINGS_H__ +#define __IMETHOD_SETTINGS_H__ + +#include + +class QCheckBox; +class QSpinBox; + +class InputMethodSettings : public QWidget +{ + Q_OBJECT + + public: + InputMethodSettings ( QWidget *parent = 0, const char *name = 0 ); + + void accept ( ); + + protected slots: + void appletChanged ( ); + + protected: + void init ( ); + + private: + QCheckBox* _resize; + QCheckBox* _float; + QSpinBox* _size; +}; + +#endif diff --git a/core/settings/launcher/launcher.pro b/core/settings/launcher/launcher.pro index e532852..cea268d 100644 --- a/core/settings/launcher/launcher.pro +++ b/core/settings/launcher/launcher.pro @@ -5,6 +5,7 @@ HEADERS = launchersettings.h \ tabssettings.h \ taskbarsettings.h \ menusettings.h \ + inputmethodsettings.h \ tabconfig.h \ tabdialog.h @@ -13,6 +14,7 @@ SOURCES = main.cpp \ tabssettings.cpp \ taskbarsettings.cpp \ menusettings.cpp \ + inputmethodsettings.cpp \ tabdialog.cpp INCLUDEPATH += $(OPIEDIR)/include diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index cb6e98a..3982194 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp @@ -35,7 +35,7 @@ #include "tabssettings.h" #include "menusettings.h" #include "taskbarsettings.h" - +#include "inputmethodsettings.h" LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) { @@ -49,10 +49,12 @@ LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false, m_tabs = new TabsSettings ( tw ); m_taskbar = new TaskbarSettings ( tw ); m_menu = new MenuSettings ( tw ); + m_imethods = new InputMethodSettings ( tw ); tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); tw-> addTab ( m_menu, "go", tr( "O-Menu" )); tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); + tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); tw-> setCurrentTab ( m_taskbar ); } @@ -62,6 +64,7 @@ void LauncherSettings::accept ( ) m_taskbar-> accept ( ); m_menu-> accept ( ); m_tabs-> accept ( ); + m_imethods-> accept ( ); QDialog::accept ( ); } diff --git a/core/settings/launcher/launchersettings.h b/core/settings/launcher/launchersettings.h index 56c916e..71165a3 100644 --- a/core/settings/launcher/launchersettings.h +++ b/core/settings/launcher/launchersettings.h @@ -33,6 +33,7 @@ class TabsSettings; class TaskbarSettings; class MenuSettings; +class InputMethodSettings; class LauncherSettings : public QDialog { Q_OBJECT @@ -47,6 +48,7 @@ private: TabsSettings *m_tabs; TaskbarSettings *m_taskbar; MenuSettings *m_menu; + InputMethodSettings* m_imethods; }; #endif -- cgit v0.9.0.2