author | harlekin <harlekin> | 2003-12-10 22:34:29 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-10 22:34:29 (UTC) |
commit | 35e556fc2a9d07e6e2c73cac6f05cfb4c0c3e4f1 (patch) (side-by-side diff) | |
tree | cf9c57d312570cc8d30946d53d6b0fc8c14d38f5 | |
parent | dffe105588cace5d96792155cee3a32a70a05017 (diff) | |
download | opie-35e556fc2a9d07e6e2c73cac6f05cfb4c0c3e4f1.zip opie-35e556fc2a9d07e6e2c73cac6f05cfb4c0c3e4f1.tar.gz opie-35e556fc2a9d07e6e2c73cac6f05cfb4c0c3e4f1.tar.bz2 |
less includes
-rw-r--r-- | core/settings/launcher/doctabsettings.cpp | 3 | ||||
-rw-r--r-- | core/settings/launcher/inputmethodsettings.cpp | 2 | ||||
-rw-r--r-- | core/settings/launcher/launchersettings.cpp | 1 | ||||
-rw-r--r-- | core/settings/launcher/main.cpp | 1 | ||||
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 3 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 1 | ||||
-rw-r--r-- | core/settings/launcher/taskbarsettings.cpp | 1 | ||||
-rw-r--r-- | core/settings/security/main.cpp | 3 | ||||
-rw-r--r-- | core/settings/security/security.cpp | 1 |
9 files changed, 0 insertions, 16 deletions
diff --git a/core/settings/launcher/doctabsettings.cpp b/core/settings/launcher/doctabsettings.cpp index 8077b8c..179a7f9 100644 --- a/core/settings/launcher/doctabsettings.cpp +++ b/core/settings/launcher/doctabsettings.cpp @@ -1,71 +1,68 @@ /* This file is part of the OPIE Project =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> .>+-= _;:, .> :=|. 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_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: 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 "doctabsettings.h" #include <qpe/config.h> -#include <qpe/qlibrary.h> -#include <qpe/qpeapplication.h> -#include <qspinbox.h> #include <qcheckbox.h> #include <qlayout.h> #include <qlabel.h> #include <qwhatsthis.h> DocTabSettings::DocTabSettings( QWidget *parent, const char *name ):QWidget( parent, name ) { QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); _enable = new QCheckBox( tr( "Enable the Documents Tab" ), this ); Config cfg( "Launcher" ); cfg.setGroup( "DocTab" ); _enable->setChecked( cfg.readBoolEntry( "Enable", true ) ); lay->addWidget( _enable ); lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); lay->addStretch(); QWhatsThis::add( _enable, tr( "Check, if you want the Documents Tab to be visible." ) ); } void DocTabSettings::appletChanged() { } void DocTabSettings::accept() { qDebug( "DocTabSettings::accept()" ); Config cfg( "Launcher" ); cfg.setGroup( "DocTab" ); cfg.writeEntry( "Enable", _enable->isChecked() ); cfg.write(); } diff --git a/core/settings/launcher/inputmethodsettings.cpp b/core/settings/launcher/inputmethodsettings.cpp index 147a00d..e342c09 100644 --- a/core/settings/launcher/inputmethodsettings.cpp +++ b/core/settings/launcher/inputmethodsettings.cpp @@ -1,86 +1,84 @@ /* This file is part of the OPIE Project =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> .>+-= _;:, .> :=|. 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_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: 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 <qpe/config.h> -#include <qpe/qlibrary.h> -#include <qpe/qpeapplication.h> #include <qspinbox.h> #include <qcheckbox.h> #include <qlayout.h> #include <qlabel.h> #include <qwhatsthis.h> 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( lay, 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->addWidget( new QLabel( tr( "<b>Note:</b> 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/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index e129849..5c11cc8 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp @@ -1,80 +1,79 @@ /* =. This file is part of the OPIE Project .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> .>+-= _;:, .> :=|. 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_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: 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 <qlayout.h> -#include <qapplication.h> #include <opie/otabwidget.h> #include "launchersettings.h" #include "tabssettings.h" #include "menusettings.h" #include "taskbarsettings.h" #include "inputmethodsettings.h" #include "doctabsettings.h" LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) { setCaption ( tr( "Launcher Settings" )); QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); OTabWidget *tw = new OTabWidget ( this, "otab" ); lay-> addWidget ( tw ); m_tabs = new TabsSettings ( tw ); m_taskbar = new TaskbarSettings ( tw ); m_menu = new MenuSettings ( tw ); m_imethods = new InputMethodSettings ( tw ); m_doctab = new DocTabSettings ( 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-> addTab ( m_doctab, "DocsIcon", tr( "DocTab" ) ); tw-> setCurrentTab ( m_taskbar ); } void LauncherSettings::accept ( ) { m_taskbar-> accept ( ); m_menu-> accept ( ); m_tabs-> accept ( ); m_imethods-> accept ( ); m_doctab-> accept ( ); QDialog::accept ( ); } void LauncherSettings::done ( int r ) { QDialog::done ( r ); close ( ); } diff --git a/core/settings/launcher/main.cpp b/core/settings/launcher/main.cpp index 4cc1d35..bcfdcf6 100644 --- a/core/settings/launcher/main.cpp +++ b/core/settings/launcher/main.cpp @@ -1,35 +1,34 @@ /* =. This file is part of the OPIE Project .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> .>+-= _;:, .> :=|. 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_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: 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 "launchersettings.h" -#include <qpe/qpeapplication.h> #include <opie/oapplicationfactory.h> OPIE_EXPORT_APP( OApplicationFactory<LauncherSettings> ) diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index de99a09..f79ad40 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp @@ -1,232 +1,229 @@ /* =. This file is part of the OPIE Project .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> .>+-= _;:, .> :=|. 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_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: 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 <qpe/resource.h> -#include <qpe/config.h> -#include <qpe/applnk.h> #include <qlayout.h> #include <qvbox.h> #include <qtabbar.h> #include <qiconview.h> #include <qapplication.h> #include <qlabel.h> #include <qradiobutton.h> #include <qbuttongroup.h> -#include <qpushbutton.h> #include <qwhatsthis.h> #include <qcheckbox.h> #include <opie/ofontselector.h> #include <opie/otabwidget.h> #include <opie/ocolorbutton.h> #include <opie/ofiledialog.h> #include "tabdialog.h" class SampleItem : public QIconViewItem { public: SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) { m_large = pix; m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); } void sizeChange ( ) { calcRect ( ); repaint ( ); } QPixmap *pixmap ( ) const { if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) return (QPixmap *) &m_small; else return (QPixmap *) &m_large; } private: QPixmap m_large, m_small; }; class SampleView : public QIconView { public: SampleView ( QWidget *parent = 0, const char *name = 0 ) : QIconView ( parent, name ) { setItemsMovable ( false ); setAutoArrange ( true ); setSorting ( true ); setFrameStyle ( QFrame::NoFrame ); setSpacing ( 4 ); setMargin ( 0 ); setSelectionMode ( QIconView::NoSelection ); setBackgroundMode ( PaletteBase ); setViewMode ( TabConfig::Icon ); calculateGrid ( Bottom ); new SampleItem ( this, QObject::tr( "Sample 1" ), Resource::loadPixmap ( "datebook/DateBook" )); new SampleItem ( this, QObject::tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); new SampleItem ( this, QObject::tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); setBackgroundType ( TabConfig::Ruled, QString::null ); setMaximumHeight ( firstItem ( )-> height ( ) + 16 ); } void setViewMode ( TabConfig::ViewMode m ) { viewport ( )-> setUpdatesEnabled ( false ); switch ( m ) { case TabConfig::List: setItemTextPos( QIconView::Right ); break; case TabConfig::Icon: setItemTextPos( QIconView::Bottom ); break; } // hideOrShowItems ( false ); for ( QIconViewItem *it = firstItem ( ); it; it = it-> nextItem ( )) ((SampleItem *) it )-> sizeChange ( ); arrangeItemsInGrid ( true ); viewport ( )-> setUpdatesEnabled ( true ); update ( ); } void setBackgroundType( TabConfig::BackgroundType t, const QString &val ) { switch ( t ) { case TabConfig::Ruled: { QPixmap bg ( width ( ), 9 ); QPainter painter ( &bg ); for ( int i = 0; i < 3; i++ ) { painter. setPen ( white ); painter. drawLine ( 0, i*3, width()-1, i*3 ); painter. drawLine ( 0, i*3+1, width()-1, i*3+1 ); painter. setPen ( colorGroup().background().light(105) ); painter. drawLine ( 0, i*3+2, width()-1, i*3+2 ); } painter.end ( ); setBackgroundPixmap ( bg ); break; } case TabConfig::SolidColor: { setBackgroundPixmap ( QPixmap ( )); if ( val. isEmpty ( )) setBackgroundColor ( colorGroup ( ). base ( )); else setBackgroundColor ( val ); break; } case TabConfig::Image: { qDebug( "Loading image: %s", val.latin1() ); QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val )); if ( bg. isNull ( )) { QImageIO imgio; imgio. setFileName ( val ); QSize ds = qApp-> desktop ( )-> size ( ); QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( )); imgio. read ( ); bg = imgio. image ( ); } setBackgroundPixmap ( bg ); break; } } m_bgtype = t; viewport ( )-> update ( ); } void setTextColor ( const QColor &tc ) { m_textcolor = tc; QColorGroup cg = colorGroup ( ); cg. setColor ( QColorGroup::Text, tc ); setPalette ( QPalette ( cg, cg, cg )); viewport ( )-> update ( ); } void setViewFont ( const QFont &f ) { setFont ( f ); } void setItemTextPos ( ItemTextPos pos ) { calculateGrid ( pos ); QIconView::setItemTextPos( pos ); } void calculateGrid ( ItemTextPos pos ) { int dw = QApplication::desktop ( )-> width ( ); int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( ); if ( pos == Bottom ) { int cols = 3; if ( viewerWidth <= 200 ) cols = 2; else if ( viewerWidth >= 400 ) cols = viewerWidth/96; setSpacing ( 4 ); setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); setGridY ( fontMetrics ( ). height ( ) * 2 + 24 ); } else { int cols = 2; if ( viewerWidth < 150 ) cols = 1; else if ( viewerWidth >= 400 ) cols = viewerWidth / 150; setSpacing ( 2 ); setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); setGridY ( fontMetrics ( ). height ( ) + 2 ); } } void paletteChange( const QPalette &p ) { static bool excllock = false; if ( excllock ) return; excllock = true; unsetPalette ( ); QIconView::paletteChange ( p ); if ( m_bgtype == TabConfig::Ruled ) setBackgroundType ( TabConfig::Ruled, QString::null ); QColorGroup cg = colorGroup ( ); cg.setColor ( QColorGroup::Text, m_textcolor ); setPalette ( QPalette ( cg, cg, cg )); diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index 3d8b456..a3d31a5 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp @@ -1,222 +1,221 @@ /* =. This file is part of the OPIE Project .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> .>+-= _;:, .> :=|. 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_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: 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 "tabssettings.h" -#include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qpe/applnk.h> #include <qpe/mimetype.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/config.h> #include <qlistbox.h> #include <qpushbutton.h> #include <qlayout.h> #include <qlabel.h> #include <qwhatsthis.h> #include <qcheckbox.h> #include "tabdialog.h" #include <stdlib.h> #include <qmessagebox.h> #define GLOBALID ".global." TabsSettings::TabsSettings ( QWidget *parent, const char *name ) : QWidget ( parent, name ) { QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); QLabel *l = new QLabel ( tr( "Launcher Tabs:" ), this ); lay-> addMultiCellWidget ( l, 0, 0, 0, 1 ); m_list = new QListBox ( this ); lay-> addMultiCellWidget ( m_list, 1, 4, 0, 0 ); QWhatsThis::add ( m_list, tr( "foobar" )); QPushButton *p1, *p2, *p3; p1 = new QPushButton ( tr( "New" ), this ); lay-> addWidget ( p1, 1, 1 ); connect ( p1, SIGNAL( clicked ( )), this, SLOT( newClicked ( ))); p2 = new QPushButton ( tr( "Edit" ), this ); lay-> addWidget ( p2, 2, 1 ); connect ( p2, SIGNAL( clicked ( )), this, SLOT( editClicked ( ))); p3 = new QPushButton ( tr( "Delete" ), this ); lay-> addWidget ( p3, 3, 1 ); connect ( p3, SIGNAL( clicked ( )), this, SLOT( deleteClicked ( ))); lay-> setRowStretch ( 4, 10 ); m_bigbusy = new QCheckBox( tr( "Enable big busy indicator" ), this ); lay-> addMultiCellWidget ( m_bigbusy, 5, 5, 0, 1 ); m_busyani = new QCheckBox ( tr( "Enable animated busy indicator" ), this ); lay-> addMultiCellWidget ( m_busyani, 6, 6, 0, 1 ); p1-> setEnabled ( false ); p3-> setEnabled ( false ); init ( ); QWhatsThis::add ( m_list, tr( "Select the Launcher Tab you want to edit or delete." )); QWhatsThis::add ( p1, tr( "Adds a new Tab to the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); QWhatsThis::add ( p2, tr( "Opens a new dialog to customize the select Tab." )); QWhatsThis::add ( p3, tr( "Deletes a Tab from the Launcher." ) + QString ( "<center><br><i>not yet implemented</i><br>Please use the tabmanager</center>." )); QWhatsThis::add ( m_bigbusy, tr( "Activate this, if you want a big busy indicator in the middle of the screen instead of the one in taskbar." )); QWhatsThis::add ( m_busyani, tr( "Activate this, if you want an animatedbusy indicator for starting applications in the Launcher." )); } void TabsSettings::init ( ) { AppLnkSet rootFolder( MimeType::appsFolderName ( )); QStringList types = rootFolder. types ( ); m_list-> insertItem ( tr( "All Tabs" )); m_ids << GLOBALID; for ( QStringList::Iterator it = types. begin ( ); it != types. end ( ); ++it ) { m_list-> insertItem ( rootFolder. typePixmap ( *it ), rootFolder. typeName ( *it )); m_ids << *it; } QImage img ( Resource::loadImage ( "DocsIcon" )); QPixmap pix; pix = img. smoothScale ( AppLnk::smallIconSize ( ), AppLnk::smallIconSize ( )); m_list-> insertItem ( pix, tr( "Documents" )); m_ids += "Documents"; // No tr Config cfg ( "Launcher" ); readTabSettings ( cfg ); cfg. setGroup ( "GUI" ); m_busyani-> setChecked ( cfg. readEntry ( "BusyType" ). lower ( ) == "animated" ); m_bigbusy->setChecked( cfg. readBoolEntry ( "BigBusy" ) ); } void TabsSettings::readTabSettings ( Config &cfg ) { QString grp ( "Tab %1" ); // No tr m_tabs. clear ( ); TabConfig global_def; global_def. m_view = TabConfig::Icon; global_def. m_bg_type = TabConfig::Ruled; global_def. m_bg_image = "launcher/opie-background"; global_def. m_bg_color = colorGroup ( ). color ( QColorGroup::Base ). name ( ); global_def. m_text_color = colorGroup ( ). color ( QColorGroup::Text ). name ( ); global_def. m_font_use = false; global_def. m_font_family = font ( ). family ( ); global_def. m_font_size = font ( ). pointSize ( ); global_def. m_font_weight = 50; global_def. m_font_italic = false; global_def. m_changed = false; for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { TabConfig tc = ( it != m_ids. begin ( )) ? m_tabs [GLOBALID] : global_def; cfg. setGroup ( grp. arg ( *it )); QString view = cfg. readEntry ( "View" ); if ( view == "Icon" ) // No tr tc. m_view = TabConfig::Icon; if ( view == "List" ) // No tr tc. m_view = TabConfig::List; QString bgType = cfg. readEntry ( "BackgroundType" ); if ( bgType == "Image" ) tc. m_bg_type = TabConfig::Image; else if ( bgType == "SolidColor" ) tc. m_bg_type = TabConfig::SolidColor; else if ( bgType == "Image" ) // No tr tc. m_bg_type = TabConfig::Image; tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image ); tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color ); tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color ); QStringList f = cfg. readListEntry ( "Font", ',' ); if ( f. count ( ) == 4 ) { tc. m_font_use = true; tc. m_font_family = f [0]; tc. m_font_size = f [1]. toInt ( ); tc. m_font_weight = f [2]. toInt ( ); tc. m_font_italic = ( f [3]. toInt ( )); } m_tabs [*it] = tc; } // if all tabs have the same config, then initialize the GLOBALID tab to these values TabConfig *first = 0; bool same = true; for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { if ( *it == GLOBALID ) continue; else if ( !first ) first = &m_tabs [*it]; else same &= ( *first == m_tabs [*it] ); } if ( same ) { m_tabs [GLOBALID] = *first; m_tabs [GLOBALID]. m_changed = true; } } void TabsSettings::accept ( ) { Config cfg ( "Launcher" ); // Launcher Tab QString grp ( "Tab %1" ); // No tr for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { TabConfig &tc = m_tabs [*it]; if ( !tc. m_changed ) continue; cfg. setGroup ( grp. arg ( *it )); switch ( tc. m_view ) { case TabConfig::Icon: cfg.writeEntry ( "View", "Icon" ); break; case TabConfig::List: cfg.writeEntry ( "View", "List" ); break; } diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp index d03ea49..badb98f 100644 --- a/core/settings/launcher/taskbarsettings.cpp +++ b/core/settings/launcher/taskbarsettings.cpp @@ -1,173 +1,172 @@ /* This file is part of the OPIE Project =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> .>+-= _;:, .> :=|. 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_,=:_. -<s. This file is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: 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 "taskbarsettings.h" #include <qpe/config.h> #include <qpe/qlibrary.h> #include <qpe/qpeapplication.h> #include <qpe/taskbarappletinterface.h> #include <qpe/qcopenvelope_qws.h> #include <qdir.h> #include <qlistview.h> -#include <qcheckbox.h> #include <qheader.h> #include <qlayout.h> #include <qlabel.h> #include <qwhatsthis.h> #include <stdlib.h> TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) : QWidget ( parent, name ) { m_applets_changed = false; QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); QLabel *l = new QLabel ( tr( "Load applets in Taskbar:" ), this ); lay-> addWidget ( l ); m_list = new QListView ( this ); m_list-> addColumn ( "foobar" ); m_list-> header ( )-> hide ( ); lay-> addWidget ( m_list ); QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); init ( ); } void TaskbarSettings::init ( ) { Config cfg ( "Taskbar" ); cfg. setGroup ( "Applets" ); QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; #ifdef Q_OS_MACX QStringList list = QDir ( path, "lib*.dylib" ). entryList ( ); #else QStringList list = QDir ( path, "lib*.so" ). entryList ( ); #endif /* Q_OS_MACX */ for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { QString name; QPixmap icon; TaskbarNamedAppletInterface *iface = 0; qWarning("Load applet: %s", (*it).latin1() ); QLibrary *lib = new QLibrary ( path + "/" + *it ); lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); qWarning("<1>"); if ( iface ) { qWarning("<2>"); QString lang = getenv( "LANG" ); QTranslator *trans = new QTranslator ( qApp ); QString type = (*it). left ((*it). find (".")); QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; if ( trans-> load ( tfn )) qApp-> installTranslator ( trans ); else delete trans; name = iface-> name ( ); icon = iface-> icon ( ); iface-> release ( ); } qWarning("<3>"); if ( !iface ) { qWarning("<4>"); lib-> queryInterface ( IID_TaskbarApplet, (QUnknownInterface**) &iface ); if ( iface ) { qWarning("<5>"); name = (*it). mid ( 3 ); qWarning("Found applet: %s", name.latin1() ); #ifdef Q_OS_MACX int sep = name. find( ".dylib" ); #else int sep = name. find( ".so" ); #endif /* Q_OS_MACX */ if ( sep > 0 ) name. truncate ( sep ); sep = name. find ( "applet" ); if ( sep == (int) name.length ( ) - 6 ) name. truncate ( sep ); name[0] = name[0]. upper ( ); iface-> release ( ); } } qWarning("<6>"); if ( iface ) { qWarning("<7>"); QCheckListItem *item; item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); if ( !icon. isNull ( )) item-> setPixmap ( 0, icon ); item-> setOn ( exclude. find ( *it ) == exclude. end ( )); m_applets [*it] = item; } lib-> unload ( ); delete lib; } } void TaskbarSettings::appletChanged() { m_applets_changed = true; } void TaskbarSettings::accept ( ) { Config cfg ( "Taskbar" ); cfg. setGroup ( "Applets" ); if ( m_applets_changed ) { QStringList exclude; QMap <QString, QCheckListItem *>::Iterator it; for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { if ( !(*it)-> isOn ( )) exclude << it. key ( ); } cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); } cfg. writeEntry ( "SafeMode", false ); cfg. write ( ); if ( m_applets_changed ) { QCopEnvelope e ( "QPE/TaskBar", "reloadApplets()" ); m_applets_changed = false; } } diff --git a/core/settings/security/main.cpp b/core/settings/security/main.cpp index 3141fb8..aed8ab2 100644 --- a/core/settings/security/main.cpp +++ b/core/settings/security/main.cpp @@ -1,32 +1,29 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ -#include <qpe/qpeapplication.h> -#include <qpe/qcopenvelope_qws.h> -#include <qpe/global.h> #include "security.h" #include <opie/oapplicationfactory.h> OPIE_EXPORT_APP( OApplicationFactory<Security> ) diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp index d7871b3..7bb14cd 100644 --- a/core/settings/security/security.cpp +++ b/core/settings/security/security.cpp @@ -1,225 +1,224 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "security.h" #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/password.h> #include <qpe/qpedialog.h> #include <qpe/qcopenvelope_qws.h> #include <qcheckbox.h> #include <qpushbutton.h> #include <qcombobox.h> #include <qmessagebox.h> #include <qfile.h> -#include <qlistview.h> #include <qtextstream.h> Security::Security( QWidget* parent, const char* name, WFlags fl ) : SecurityBase( parent, name, TRUE, WStyle_ContextHelp ) { valid=FALSE; Config cfg("Security"); cfg.setGroup("Passcode"); passcode = cfg.readEntry("passcode"); passcode_poweron->setChecked(cfg.readBoolEntry("passcode_poweron",FALSE)); cfg.setGroup("Sync"); int auth_peer = cfg.readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 int auth_peer_bits = cfg.readNumEntry("auth_peer_bits",24); selectNet(auth_peer,auth_peer_bits,TRUE); connect(syncnet, SIGNAL(textChanged(const QString&)), this, SLOT(setSyncNet(const QString&))); cfg.setGroup("Sync"); QString sa = cfg.readEntry("syncapp","Qtopia"); for (int i=0; i<syncapp->count(); i++) { if ( syncapp->text(i) == sa ) { syncapp->setCurrentItem(i); } } /* cfg.setGroup("Remote"); if ( telnetAvailable() ) telnet->setChecked(cfg.readEntry("allow_telnet")); else telnet->hide(); if ( sshAvailable() ) ssh->setChecked(cfg.readEntry("allow_ssh")); else ssh->hide(); */ QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; Config loginCfg(configFile,Config::File); loginCfg.setGroup("General"); autoLoginName=loginCfg.readEntry("AutoLogin",""); if (autoLoginName.stripWhiteSpace().isEmpty()) { autoLogin=false; } else { autoLogin=true; } cfg.setGroup("SyncMode"); int mode = cfg.readNumEntry("Mode",2); // Default to Sharp syncModeCombo->setCurrentItem( mode - 1 ); //since nobody knows what this is and it doesn't do anything, i'll hide it # CoreDump // is this work-in-progress or can it be removed? syncModeCombo->hide(); connect(autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); connect(userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); connect(changepasscode,SIGNAL(clicked()), this, SLOT(changePassCode())); connect(clearpasscode,SIGNAL(clicked()), this, SLOT(clearPassCode())); connect(syncapp,SIGNAL(activated(int)), this, SLOT(changeSyncApp())); connect(restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults())); connect(deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry())); loadUsers(); updateGUI(); dl = new QPEDialogListener(this); showMaximized(); } Security::~Security() { } void Security::deleteListEntry() { syncnet->removeItem(syncnet->currentItem()); } void Security::restoreDefaults() { QMessageBox unrecbox( tr("Attention"), tr( "<p>All user-defined net ranges will be lost."), QMessageBox::Warning, QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, 0, QString::null, TRUE, WStyle_StaysOnTop); unrecbox.setButtonText(QMessageBox::Cancel, tr("Cancel")); unrecbox.setButtonText(QMessageBox::Yes, tr("Ok")); if ( unrecbox.exec() == QMessageBox::Yes) { syncnet->clear(); insertDefaultRanges(); } } void Security::insertDefaultRanges() { syncnet->insertItem( tr( "192.168.129.0/24" ) ); syncnet->insertItem( tr( "192.168.1.0/24" ) ); syncnet->insertItem( tr( "192.168.0.0/16" ) ); syncnet->insertItem( tr( "172.16.0.0/12" ) ); syncnet->insertItem( tr( "10.0.0.0/8" ) ); syncnet->insertItem( tr( "1.0.0.0/8" ) ); syncnet->insertItem( tr( "Any" ) ); syncnet->insertItem( tr( "None" ) ); } void Security::updateGUI() { bool empty = passcode.isEmpty(); changepasscode->setText( empty ? tr("Set passcode" ) : tr("Change passcode" ) ); passcode_poweron->setEnabled( !empty ); clearpasscode->setEnabled( !empty ); autologinToggle->setChecked(autoLogin); userlist->setEnabled(autoLogin); } void Security::show() { //valid=FALSE; setEnabled(FALSE); SecurityBase::show(); if ( passcode.isEmpty() ) { // could insist... //changePassCode(); //if ( passcode.isEmpty() ) //reject(); } else { if (!valid) // security passcode was not asked yet, so ask now { QString pc = enterPassCode(tr("Enter passcode")); if ( pc != passcode ) { QMessageBox::critical(this, tr("Passcode incorrect"), tr("The passcode entered is incorrect.\nAccess denied")); reject(); return; } } } setEnabled(TRUE); valid=TRUE; } void Security::accept() { applySecurity(); QDialog::accept(); QCopEnvelope env("QPE/System", "securityChanged()" ); } void Security::done(int r) { QDialog::done(r); close(); } void Security::selectNet(int auth_peer,int auth_peer_bits, bool update) { QString sn; if ( auth_peer_bits == 0 && auth_peer == 0 ) { sn = tr("Any"); } else if ( auth_peer_bits == 32 && auth_peer == 0 ) { sn = tr("None"); } else { sn = QString::number((auth_peer>>24)&0xff) + "." + QString::number((auth_peer>>16)&0xff) + "." + QString::number((auth_peer>>8)&0xff) + "." + QString::number((auth_peer>>0)&0xff) + "/" + QString::number(auth_peer_bits); } //insert user-defined list of netranges upon start if (update) { //User selected/active netrange first syncnet->insertItem( tr( sn ) ); Config cfg("Security"); cfg.setGroup("Sync"); //set up defaults if needed, if someone manually deletes net0 he'll get a suprise hehe |