author | drw <drw> | 2005-05-04 22:20:27 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-04 22:20:27 (UTC) |
commit | 5db2256e7e342f290e17096cf70b8b318bfcd987 (patch) (side-by-side diff) | |
tree | 771eae383e635aa9117944984b1ec6a4d96973be | |
parent | 4d719fdcf636f855cb2def7c715a13420ce8a1b6 (diff) | |
download | opie-5db2256e7e342f290e17096cf70b8b318bfcd987.zip opie-5db2256e7e342f290e17096cf70b8b318bfcd987.tar.gz opie-5db2256e7e342f290e17096cf70b8b318bfcd987.tar.bz2 |
Resource -> OResource
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 61 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 50 |
2 files changed, 56 insertions, 55 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index 555e64e..c6bdf8f 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp @@ -1,63 +1,63 @@ /* - =. 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., + =. 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 "tabdialog.h" /* OPIE */ -#include <opie2/ofontselector.h> -#include <opie2/otabwidget.h> #include <opie2/ocolorbutton.h> -#include <opie2/ofiledialog.h> #include <opie2/odebug.h> +#include <opie2/ofiledialog.h> +#include <opie2/ofontselector.h> +#include <opie2/oresource.h> +#include <opie2/otabwidget.h> /* QPE */ -#include <qpe/resource.h> #include <qpe/qpeapplication.h> /* QT */ #include <qlayout.h> #include <qvbox.h> #include <qtabbar.h> #include <qiconview.h> #include <qapplication.h> #include <qlabel.h> #include <qfileinfo.h> #include <qradiobutton.h> #include <qbuttongroup.h> #include <qwhatsthis.h> #include <qcheckbox.h> #include <qspinbox.h> using namespace Opie::Ui; 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 )); @@ -78,51 +78,54 @@ public: } private: QPixmap m_large, m_small; }; //FIXME: Why not derive SampleView from LauncherView ??? 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" )); + new SampleItem ( this, QObject::tr( "Sample 1" ), + Opie::Core::OResource::loadPixmap ( "datebook/DateBook", Opie::Core::OResource::BigIcon )); + new SampleItem ( this, QObject::tr( "Sample 2" ), + Opie::Core::OResource::loadPixmap ( "Calibrate", Opie::Core::OResource::BigIcon )); + new SampleItem ( this, QObject::tr( "Sample 3" ), + Opie::Core::OResource::loadPixmap ( "UnknownDocument", Opie::Core::OResource::BigIcon )); 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 ); @@ -138,49 +141,49 @@ public: 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: { odebug << "Loading image: " << val << "" << oendl; - QPixmap bg = Resource::loadPixmap ( val ); + QPixmap bg = Opie::Core::OResource::loadPixmap ( val ); if ( bg. isNull () ) bg = QPixmap( val ); 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 ); } diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp index fca6b20..e7660ef 100644 --- a/core/settings/launcher/tabssettings.cpp +++ b/core/settings/launcher/tabssettings.cpp @@ -1,54 +1,55 @@ /* - =. 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., + =. 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/resource.h> +#include <opie2/oresource.h> + #include <qpe/applnk.h> #include <qpe/mimetype.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/config.h> #include <qpe/qpeapplication.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 ) @@ -92,52 +93,49 @@ TabsSettings::TabsSettings ( QWidget *parent, const char *name ) 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." )); QWhatsThis::add ( m_staticbackground, tr( "Activate this, if you want the background pixmap not to scroll with the icons." )); } 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_list-> insertItem ( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ), 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" ) ); m_staticbackground->setChecked( cfg.readBoolEntry( "StaticBackground", true ) ); } 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_iconcolumns = 0; // automatic |