author | drw <drw> | 2005-04-05 22:38:32 (UTC) |
---|---|---|
committer | drw <drw> | 2005-04-05 22:38:32 (UTC) |
commit | 0f7b159f0a4972b6ffdc292f5eb4d2169c7fa75d (patch) (side-by-side diff) | |
tree | 27fb276e59b1eab586d029feaf21f45ddf1cb96a | |
parent | 327e938f58125a52482b9a6543dd1aa4243bb5d3 (diff) | |
download | opie-0f7b159f0a4972b6ffdc292f5eb4d2169c7fa75d.zip opie-0f7b159f0a4972b6ffdc292f5eb4d2169c7fa75d.tar.gz opie-0f7b159f0a4972b6ffdc292f5eb4d2169c7fa75d.tar.bz2 |
Use OResource for loading images
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 81 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.h | 46 | ||||
-rw-r--r-- | libopie2/opieui/otabwidget.cpp | 66 | ||||
-rw-r--r-- | libopie2/opieui/otabwidget.h | 52 | ||||
-rw-r--r-- | libopie2/opieui/owait.cpp | 50 | ||||
-rw-r--r-- | libopie2/opieui/owait.h | 47 |
6 files changed, 163 insertions, 179 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 8b53038..f3e7501 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp @@ -1,55 +1,56 @@ - /* - =. This file is part of the OPIE Project - .=l. Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org> - .>+-= - _;:, .> :=|. This library is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 library 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +         This file is part of the Opie Project + + Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org> + =. + .=l. +      .>+-= + _;:,   .>   :=|. This program is free software; you can +.> <`_,  >  .  <= redistribute it and/or modify it under +:`=1 )Y*s>-.--  : the terms of the GNU Library 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 program 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 +..}^=.=    =    ; Library General Public License for more +++=  -.   .`   .: details. + :   =  ...= . :.=- + -.  .:....=;==+<; You should have received a copy of the GNU + -_. . .  )=.  = Library General Public License along with +  --     :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ /* hacky but we need to get FileSelector::filter */ #define private public #include <qpe/fileselector.h> #undef private #include "ofileselector_p.h" /* OPIE */ -#include <opie2/ofileselector.h> #include <opie2/odebug.h> +#include <opie2/ofileselector.h> +#include <opie2/oresource.h> #include <qpe/qpeapplication.h> #include <qpe/mimetype.h> -#include <qpe/resource.h> #include <qpe/storage.h> /* QT */ #include <qcombobox.h> #include <qdir.h> #include <qhbox.h> #include <qheader.h> #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qlistview.h> #include <qpopupmenu.h> @@ -325,65 +326,58 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st * One Button For Up * Home * Doc * And a dropdown menu with FileSystems * FUTURE: one to change dir with lineedit * Bookmarks * Create Dir */ QHBox* box = new QHBox(this ); box->setBackgroundMode( PaletteButton ); box->setSpacing( 0 ); - QPixmap pic; QToolButton *btn = new QToolButton( box ); btn->setUsesBigPixmap( true ); - pic.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - btn->setPixmap( pic ); + btn->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ); connect(btn, SIGNAL(clicked() ), this, SLOT( cdUP() ) ); btn = new QToolButton( box ); btn->setUsesBigPixmap( true ); - pic.convertFromImage( Resource::loadImage( "home" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - btn->setPixmap( pic ); + btn->setPixmap( Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ) ); connect(btn, SIGNAL(clicked() ), this, SLOT( cdHome() ) ); btn = new QToolButton( box ); btn->setUsesBigPixmap( true ); - pic.convertFromImage( Resource::loadImage( "DocsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - btn->setPixmap( pic ); + btn->setPixmap( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ) ); connect(btn, SIGNAL(clicked() ), this, SLOT(cdDoc() ) ); m_btnNew = new QToolButton( box ); m_btnNew->setUsesBigPixmap( true ); - pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - m_btnNew->setPixmap( pic ); + m_btnNew->setPixmap( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ) ); connect(m_btnNew, SIGNAL(clicked() ), this, SLOT(slotNew() ) ); m_btnClose = new QToolButton( box ); m_btnClose->setUsesBigPixmap( true ); - pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - m_btnClose->setPixmap( pic ); + m_btnClose->setPixmap( Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ) ); connect(m_btnClose, SIGNAL(clicked() ), selector(), SIGNAL(closeMe() ) ); btn = new QToolButton( box ); btn->setUsesBigPixmap( true ); - pic.convertFromImage( Resource::loadImage( "cardmon/pcmcia" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - btn->setPixmap( pic ); + btn->setPixmap( Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ) ); m_fsButton = btn; /* let's fill device parts */ QPopupMenu* pop = new QPopupMenu(this); connect(pop, SIGNAL( activated(int) ), this, SLOT(slotFSActivated(int) ) ); StorageInfo storage; const QList<FileSystem> &fs = storage.fileSystems(); QListIterator<FileSystem> it(fs); for ( ; it.current(); ++it ) { @@ -630,61 +624,62 @@ void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) { MimeType type( info->absFilePath() ); if (!compliesMime( type.id() ) ) return; QPixmap pix = type.pixmap(); QString dir, name; bool locked; if ( pix.isNull() ) { QWMatrix matrix; - QPixmap pixer(Resource::loadPixmap("UnknownDocument") ); + QPixmap pixer( Opie::Core::OResource::loadPixmap( "UnknownDocument" ) ); matrix.scale( .4, .4 ); pix = pixer.xForm( matrix ); } dir = info->dirPath( true ); locked = false; if ( symlink ) name = info->fileName() + " -> " + createNewPath(info->dirPath(),info->readLink()); else { name = info->fileName(); if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) { - locked = true; pix = Resource::loadPixmap("locked"); + locked = true; + pix = Opie::Core::OResource::loadPixmap( "locked" ); } } (void)new OFileSelectorItem( m_view, pix, name, info->lastModified().toString(), QString::number( info->size() ), dir, locked ); } void OFileViewFileListView::addDir( QFileInfo* info, bool symlink ) { bool locked = false; QString name; QPixmap pix; if ( ( ( selector()->mode() == OFileSelector::Open ) && !info->isReadable() ) || ( ( selector()->mode() == OFileSelector::Save ) && !info->isWritable() ) ) { locked = true; if ( symlink ) - pix = Resource::loadPixmap( "opie/symlink" ); + pix = Opie::Core::OResource::loadPixmap( "opie/symlink" ); else - pix = Resource::loadPixmap( "lockedfolder" ); + pix = Opie::Core::OResource::loadPixmap( "lockedfolder" ); } else - pix = symlink ? Resource::loadPixmap( "opie/symlink") : Resource::loadPixmap("folder"); + pix = symlink ? Opie::Core::OResource::loadPixmap( "opie/symlink" ) : Opie::Core::OResource::loadPixmap( "folder" ); name = symlink ? info->fileName() + " -> " + createNewPath(info->dirPath(true),info->readLink()) : info->fileName(); (void)new OFileSelectorItem( m_view, pix, name, info->lastModified().toString(), QString::number( info->size() ), info->dirPath( true ), locked, true ); } diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h index d166afd..f32e3ed 100644 --- a/libopie2/opieui/fileselector/ofileselector.h +++ b/libopie2/opieui/fileselector/ofileselector.h @@ -1,38 +1,40 @@ /* - =. This file is part of the OPIE Project - .=l. Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org> - .>+-= - _;:, .> :=|. This library is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 library 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +         This file is part of the Opie Project + + Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org> + =. + .=l. +      .>+-= + _;:,   .>   :=|. This program is free software; you can +.> <`_,  >  .  <= redistribute it and/or modify it under +:`=1 )Y*s>-.--  : the terms of the GNU Library 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 program 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 +..}^=.=    =    ; Library General Public License for more +++=  -.   .`   .: details. + :   =  ...= . :.=- + -.  .:....=;==+<; You should have received a copy of the GNU + -_. . .  )=.  = Library General Public License along with +  --     :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ /* This is based on code and ideas of L. J. Potter ljp@llornkcor.com Thanks a lot */ #ifndef OFILESELECTOR_H #define OFILESELECTOR_H /* OPIE */ diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index 8d7806c..7333f5e 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp @@ -1,50 +1,50 @@ /* - This file is part of the Opie Project +         This file is part of the Opie Project - Copyright (c) 2002, 2005 Dan Williams <drw@handhelds.org> + Copyright (C) 2002, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 program 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +      .>+-= + _;:,   .>   :=|. This program is free software; you can +.> <`_,  >  .  <= redistribute it and/or modify it under +:`=1 )Y*s>-.--  : the terms of the GNU Library 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 program 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 +..}^=.=    =    ; Library General Public License for more +++=  -.   .`   .: details. + :   =  ...= . :.=- + -.  .:....=;==+<; You should have received a copy of the GNU + -_. . .  )=.  = Library General Public License along with +  --     :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include <opie2/otabwidget.h> /* OPIE */ +#include <opie2/oresource.h> +#include <opie2/otabbar.h> + #include <qpe/applnk.h> #include <qpe/config.h> -#include <qpe/resource.h> -#include <opie2/otabbar.h> /* QT */ #include <qcombobox.h> #include <qwidgetstack.h> using namespace Opie::Ui; OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) : QWidget( parent, name ) , m_currTab( 0l ) , m_tabBarStyle( Global ) , m_tabBarPosition( Top ) @@ -88,36 +88,36 @@ void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &lab { int tabid = -1; if ( m_usingTabs ) { // Create new tab in tab bar QTab *tab = new QTab(); // Set label (and icon if necessary) if ( m_tabBarStyle == IconTab ) { tab->label = QString::null; - tab->iconset = new QIconSet( loadSmooth( icon ) ); + tab->iconset = new QIconSet( Opie::Core::OResource::loadPixmap( icon, Opie::Core::OResource::SmallIcon ) ); } else tab->label = label; tabid = m_tabBar->addTab( tab ); } else { // Insert entry (with icon if necessary) into drop down list if ( m_tabBarStyle == IconList ) - m_tabList->insertItem( loadSmooth( icon ), label, -1 ); + m_tabList->insertItem( Opie::Core::OResource::loadPixmap( icon, Opie::Core::OResource::SmallIcon ), label, -1 ); else m_tabList->insertItem( label ); } // Add widget to stack m_widgetStack->addWidget( child, tabid ); m_widgetStack->raiseWidget( child ); m_widgetStack->setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); // Keep track of tab information OTabInfo *tabinfo = new OTabInfo( tabid, child, icon, label ); m_tabs.append( tabinfo ); @@ -171,25 +171,25 @@ void OTabWidget::removePage( QWidget *childwidget ) } } void OTabWidget::changeTab( QWidget *widget, const QString &iconset, const QString &label) { // Find tab information for desired widget OTabInfo *currtab = m_tabs.first(); while ( currtab && currtab->control() != widget ) currtab = m_tabs.next(); if ( currtab && currtab->control() == widget ) { - QPixmap icon( loadSmooth( iconset ) ); + QPixmap icon( Opie::Core::OResource::loadPixmap( iconset, Opie::Core::OResource::SmallIcon ) ); if ( m_usingTabs ) { // Update tab label and icon (if necessary) QTab *tab = m_tabBar->tab( currtab->id() ); tab->setText( label ); if ( m_tabBarStyle == IconTab ) tab->setIconSet( icon ); } else { // Update entry label and icon (if necessary) @@ -289,45 +289,46 @@ void OTabWidget::setTabStyle( TabStyle s ) connect( m_tabBar, SIGNAL(selected(int)), this, SLOT(slotTabBarSelected(int)) ); // Add all current tabs to tab bar for ( OTabInfo *tabinfo = m_tabs.first(); tabinfo; tabinfo = m_tabs.next() ) { // Create new tab in tab bar QTab *tab = new QTab(); // Set label (and icon if necessary) if ( m_tabBarStyle == IconTab ) { tab->label = QString::null; - tab->iconset = new QIconSet( loadSmooth( tabinfo->icon() ) ); + tab->iconset = new QIconSet( Opie::Core::OResource::loadPixmap( tabinfo->icon(), Opie::Core::OResource::SmallIcon ) ); } else tab->label = tabinfo->label(); // Add tab and save its Id int tabid = m_tabBar->addTab( tab ); tabinfo->setId( tabid ); } } else { // Create new drop down list selector m_tabList = new QComboBox( false, this ); connect( m_tabList, SIGNAL(activated(int)), this, SLOT(slotTabListSelected(int)) ); // Add all current tabs to drop down list for ( OTabInfo *tabinfo = m_tabs.first(); tabinfo; tabinfo = m_tabs.next() ) { if ( m_tabBarStyle == IconList ) - m_tabList->insertItem( loadSmooth( tabinfo->icon() ), tabinfo->label() ); + m_tabList->insertItem( Opie::Core::OResource::loadPixmap( tabinfo->icon(), Opie::Core::OResource::SmallIcon ), + tabinfo->label() ); else m_tabList->insertItem( tabinfo->label() ); } } // Redraw widget setUpLayout(); } OTabWidget::TabPosition OTabWidget::tabPosition() const { return m_tabBarPosition; @@ -356,31 +357,24 @@ void OTabWidget::slotTabBarSelected( int id ) if ( newtab && newtab->id() == id ) selectTab( newtab ); } void OTabWidget::slotTabListSelected( int index ) { OTabInfo *newtab = m_tabs.at( index ); if ( newtab ) selectTab( newtab ); } -QPixmap OTabWidget::loadSmooth( const QString &name ) -{ - QPixmap p; - p.convertFromImage( Resource::loadImage( name ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - return p; -} - void OTabWidget::selectTab( OTabInfo *tab ) { if ( m_tabBarStyle == IconTab ) { // Remove text label from currently selected tab if ( m_currTab ) { m_tabBar->tab( m_currTab->id() )->setText( QString::null ); //setUpLayout(); } // Set text label for newly selected tab diff --git a/libopie2/opieui/otabwidget.h b/libopie2/opieui/otabwidget.h index e925592..3af8fac 100644 --- a/libopie2/opieui/otabwidget.h +++ b/libopie2/opieui/otabwidget.h @@ -1,40 +1,40 @@ /* - This file is part of the Opie Project - Copyright (C) 2002, 2005 Dan Williams <drw@handhelds.org> +         This file is part of the Opie Project + + Copyright (C) 2002, 2005 Dan Williams <drw@handhelds.org> =. .=l. - .>+-= -_;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 program 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. -: = ...= . :.=- --. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +      .>+-= + _;:,   .>   :=|. This program is free software; you can +.> <`_,  >  .  <= redistribute it and/or modify it under +:`=1 )Y*s>-.--  : the terms of the GNU Library 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 program 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 +..}^=.=    =    ; Library General Public License for more +++=  -.   .`   .: details. + :   =  ...= . :.=- + -.  .:....=;==+<; You should have received a copy of the GNU + -_. . .  )=.  = Library General Public License along with +  --     :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef OTABWIDGET_H #define OTABWIDGET_H /* OPIE */ #include <opie2/otabinfo.h> /* QT */ #include <qwidget.h> #include <qlist.h> @@ -222,32 +222,24 @@ private: bool m_usingTabs; // Indicates whether style is either TextTab or IconTab // (saves from having to always check for these 2 values) // UI components OTabBar *m_tabBar; QComboBox *m_tabList; QWidgetStack *m_widgetStack; class Private; Private* d; /** - * @fn loadSmooth( const QString &name ) - * @brief Loads icon for widget. - * - * @param name Name of icon image file. - */ - QPixmap loadSmooth( const QString & ); - -/** * @fn selectTab( OTabInfo *tab ) * @brief Internal function to select desired widget. * * @param tab Pointer to data for widget. */ void selectTab( OTabInfo * ); /** * @fn setUpLayout() * @brief Internal function to adjust layout. */ void setUpLayout(); diff --git a/libopie2/opieui/owait.cpp b/libopie2/opieui/owait.cpp index ec1f25a..5f89ad2 100644 --- a/libopie2/opieui/owait.cpp +++ b/libopie2/opieui/owait.cpp @@ -1,47 +1,49 @@ /* - This file is part of the Opie Project - Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org> +         This file is part of the Opie Project + + Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 program 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +      .>+-= + _;:,   .>   :=|. This program is free software; you can +.> <`_,  >  .  <= redistribute it and/or modify it under +:`=1 )Y*s>-.--  : the terms of the GNU Library 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 program 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 +..}^=.=    =    ; Library General Public License for more +++=  -.   .`   .: details. + :   =  ...= . :.=- + -.  .:....=;==+<; You should have received a copy of the GNU + -_. . .  )=.  = Library General Public License along with +  --     :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #include "owait.h" /* OPIE */ +#include <opie2/oresource.h> + + #include <qpe/qpeapplication.h> -#include <qpe/resource.h> /* QT */ #include <qlayout.h> #include <qpainter.h> using namespace Opie::Ui; static int frame = 0; /** * This will construct a modal dialog. * @@ -56,25 +58,25 @@ OWait::OWait( QWidget *parent, const char* msg, bool dispIcon ) { Q_UNUSED( dispIcon ) QHBoxLayout * hbox = new QHBoxLayout( this ); m_lb = new QLabel( this ); m_lb->setBackgroundMode ( NoBackground ); hbox->addWidget( m_lb ); hbox->activate(); - m_pix = Resource::loadPixmap( "BigBusy" ); + m_pix = Opie::Core::OResource::loadPixmap( "BigBusy" ); m_aniSize = m_pix.height(); resize( m_aniSize, m_aniSize ); m_timerLength = 10; m_waitTimer = new QTimer( this ); connect( m_waitTimer, SIGNAL( timeout() ), this, SLOT( hide() ) ); } void OWait::timerEvent( QTimerEvent * ) { frame = ( ++frame ) % 4; diff --git a/libopie2/opieui/owait.h b/libopie2/opieui/owait.h index 03c33e4..0036bb1 100644 --- a/libopie2/opieui/owait.h +++ b/libopie2/opieui/owait.h @@ -1,61 +1,60 @@ /* - This file is part of the Opie Project - Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org> +         This file is part of the Opie Project + + Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU Library 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 program 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 -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. +      .>+-= + _;:,   .>   :=|. This program is free software; you can +.> <`_,  >  .  <= redistribute it and/or modify it under +:`=1 )Y*s>-.--  : the terms of the GNU Library 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 program 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 +..}^=.=    =    ; Library General Public License for more +++=  -.   .`   .: details. + :   =  ...= . :.=- + -.  .:....=;==+<; You should have received a copy of the GNU + -_. . .  )=.  = Library General Public License along with +  --     :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ #ifndef OWAIT_H #define OWAIT_H /* QT */ #include <qdialog.h> #include <qlabel.h> #include <qpixmap.h> #include <qtimer.h> namespace Opie { namespace Ui { /** * This class displays a animated waiting icon in the middle of the screen. * * @short modal hour glass dialog * @see QDialog - * @author Maximilian Reiß - */ + * @author Maximilian Rei� */ class OWait : public QDialog { Q_OBJECT public: OWait( QWidget *parent = 0, const char* name = 0, bool dispIcon = TRUE ); ~OWait(); /** * reimplemented for control reasons */ void show(); |