author | drw <drw> | 2005-04-06 22:41:05 (UTC) |
---|---|---|
committer | drw <drw> | 2005-04-06 22:41:05 (UTC) |
commit | 6ea302df768201e4ab8dd2ec797a5cc9ea6589bf (patch) (side-by-side diff) | |
tree | 9cffcfa9fecd49d0d6a0498de0cccd9aef52bf75 | |
parent | cd1b15147d372d8786c855764d397553651c358d (diff) | |
download | opie-6ea302df768201e4ab8dd2ec797a5cc9ea6589bf.zip opie-6ea302df768201e4ab8dd2ec797a5cc9ea6589bf.tar.gz opie-6ea302df768201e4ab8dd2ec797a5cc9ea6589bf.tar.bz2 |
Use OResource for loading images
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 22 | ||||
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 26 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg.cpp | 13 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 9 |
4 files changed, 37 insertions, 33 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 60f3177..539d6ba 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp @@ -12,27 +12,27 @@ ** 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 <opie2/odebug.h> #include <opie2/opimrecordlist.h> +#include <opie2/oresource.h> #include <qpe/timestring.h> -#include <qpe/resource.h> #include "abtable.h" #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> #include <ctype.h> //toupper() for key hack #if 0 @@ -620,109 +620,109 @@ ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* case Qtopia::Title: item.value = entry.title(); break; case Qtopia::Suffix: item.value = entry.suffix(); break; case Qtopia::FileAs: item.value = entry.fileAs(); break; case Qtopia::DefaultEmail: item.value = entry.defaultEmail(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/email" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); break; case Qtopia::Emails: item.value = entry.emails(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/email" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); break; case Qtopia::HomeStreet: item.value = entry.homeStreet(); break; case Qtopia::HomeCity: item.value = entry.homeCity(); break; case Qtopia::HomeState: item.value = entry.homeState(); break; case Qtopia::HomeZip: item.value = entry.homeZip(); break; case Qtopia::HomeCountry: item.value = entry.homeCountry(); break; case Qtopia::HomePhone: item.value = entry.homePhone(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/phonehome" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/phonehome" ); break; case Qtopia::HomeFax: item.value = entry.homeFax(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/faxhome" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/faxhome" ); break; case Qtopia::HomeMobile: item.value = entry.homeMobile(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/mobilehome" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilehome" ); break; case Qtopia::HomeWebPage: item.value = entry.homeWebpage(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/webpagehome" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagehome" ); break; case Qtopia::Company: item.value = entry.company(); break; case Qtopia::BusinessCity: item.value = entry.businessCity(); break; case Qtopia::BusinessStreet: item.value = entry.businessStreet(); break; case Qtopia::BusinessZip: item.value = entry.businessZip(); break; case Qtopia::BusinessCountry: item.value = entry.businessCountry(); break; case Qtopia::BusinessWebPage: item.value = entry.businessWebpage(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/webpagework" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagework" ); break; case Qtopia::JobTitle: item.value = entry.jobTitle(); break; case Qtopia::Department: item.value = entry.department(); break; case Qtopia::Office: item.value = entry.office(); break; case Qtopia::BusinessPhone: item.value = entry.businessPhone(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/phonework" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/phonework" ); break; case Qtopia::BusinessFax: item.value = entry.businessFax(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/faxwork" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/faxwork" ); break; case Qtopia::BusinessMobile: item.value = entry.businessMobile(); if ( !item.value.isEmpty() ) - item.icon = Resource::loadPixmap( "addressbook/mobilework" ); + item.icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilework" ); break; case Qtopia::BusinessPager: item.value = entry.businessPager(); break; case Qtopia::Profession: item.value = entry.profession(); break; case Qtopia::Assistant: item.value = entry.assistant(); break; case Qtopia::Manager: item.value = entry.manager(); diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index faae0a9..4fa9253 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -18,31 +18,29 @@ **********************************************************************/ #define QTOPIA_INTERNAL_FD // #include "addresssettings.h" #include "addressbook.h" #include <opie2/odebug.h> #include <opie2/ofileselector.h> #include <opie2/ofiledialog.h> #include <opie2/opimcontact.h> #include <opie2/ocontactaccessbackend_vcard.h> +#include <opie2/oresource.h> -#include <qpe/resource.h> #include <qpe/ir.h> #include <qpe/qpemessagebox.h> #include <qmenubar.h> -// #include <qtoolbar.h> -// #include <qmenubar.h> #include <qpe/qpeapplication.h> #include <qaction.h> #include <qlayout.h> #include <qmessagebox.h> #include <qtoolbutton.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include <fcntl.h> #include <unistd.h> @@ -84,45 +82,51 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, vb->addWidget( pLabel ); // Quick search bar m_searchBar = new OFloatBar( "Search", this, QMainWindow::Top, true ); m_searchBar->setHorizontalStretchable( true ); m_searchBar->hide(); m_searchEdit = new QLineEdit( m_searchBar, "m_searchEdit" ); m_searchBar->setStretchableWidget( m_searchEdit ); connect( m_searchEdit, SIGNAL(returnPressed()), this, SLOT(slotFind()) ); - QAction *a = new QAction( tr( "Start Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); + QAction *a = new QAction( tr( "Start Search" ), + Opie::Core::OResource::loadPixmap( "find", Opie::Core::OResource::SmallIcon ), + QString::null, 0, this, 0 ); connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); a->addTo( m_searchBar ); // Insert Contact menu items QActionGroup *items = new QActionGroup( this, QString::null, false ); - m_actionMail = new QAction( tr( "Write Mail To" ), Resource::loadPixmap( "addressbook/sendmail" ), - QString::null, 0, items, 0 ); + m_actionMail = new QAction( tr( "Write Mail To" ), + Opie::Core::OResource::loadPixmap( "addressbook/sendmail" ), + QString::null, 0, items, 0 ); connect( m_actionMail, SIGNAL(activated()), this, SLOT(writeMail()) ); - a = new QAction( tr("Import vCard"), Resource::loadPixmap( "addressbook/fileimport"), - QString::null, 0, items, 0 ); + a = new QAction( tr("Import vCard"), + Opie::Core::OResource::loadPixmap( "addressbook/fileimport" ), + QString::null, 0, items, 0 ); connect( a, SIGNAL(activated()), this, SLOT(importvCard()) ); - a = new QAction( tr("Export vCard"), Resource::loadPixmap( "addressbook/fileexport"), + a = new QAction( tr("Export vCard"), + Opie::Core::OResource::loadPixmap( "addressbook/fileexport" ), QString::null, 0, items, 0 ); connect( a, SIGNAL(activated()), this, SLOT(exportvCard()) ); - m_actionPersonal = new QAction( tr("My Personal Details"), Resource::loadPixmap( "addressbook/identity" ), - QString::null, 0, items, 0 , true ); + m_actionPersonal = new QAction( tr("My Personal Details"), + Opie::Core::OResource::loadPixmap( "addressbook/identity" ), + QString::null, 0, items, 0 , true ); connect( m_actionPersonal, SIGNAL(activated()), this, SLOT(slotPersonalView()) ); insertItemMenuItems( items ); // Insert View menu items items = new QActionGroup( this, QString::null, false ); a = new QAction( tr("Show quick search bar"),QString::null, 0, items, 0, true ); connect( a, SIGNAL(toggled(bool)), this, SLOT(slotShowFind(bool)) ); insertViewMenuItems( items ); diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp index 61e6c7e..a491fc7 100644 --- a/core/pim/addressbook/configdlg.cpp +++ b/core/pim/addressbook/configdlg.cpp @@ -1,43 +1,42 @@ #include "configdlg.h" #include <opie2/odebug.h> #include <opie2/opimcontact.h> -#include "opie2/opimcontactfields.h" - -#include <qpe/resource.h> +#include <opie2/opimcontactfields.h> +#include <opie2/oresource.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qlistbox.h> #include <qpushbutton.h> ConfigDlg::ConfigDlg( QWidget *parent, const char *name): ConfigDlg_Base(parent, name, true ) { contFields = Opie::OPimContactFields::trfields(); // We add all Fields into the Listbox for (uint i=0; i < contFields.count(); i++) { allFieldListBox->insertItem( contFields[i] ); } // Reset Widget Flags: This was not changeable by designer :( setWFlags ( WStyle_ContextHelp ); // Set Pics to Buttons and Tabs - m_upButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/up" ) ) ); - m_downButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/down" ) ) ); - m_addButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/add" ) ) ); - m_removeButton->setIconSet( QIconSet( Resource::loadPixmap( "addressbook/sub" ) ) ); + m_upButton->setIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "addressbook/up" ) ) ); + m_downButton->setIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "addressbook/down" ) ) ); + m_addButton->setIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "addressbook/add" ) ) ); + m_removeButton->setIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "addressbook/sub" ) ) ); // Get the translation maps between Field ID and translated strings m_mapStrToID = Opie::OPimContactFields::trFieldsToId(); m_mapIDToStr = Opie::OPimContactFields::idToTrFields(); connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); connect ( m_downButton, SIGNAL( clicked() ), this, SLOT( slotItemDown() ) ); } diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index dec4c7c..4a0059a 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -15,29 +15,29 @@ * * This is a rewrite of the abeditor.h file, modified to provide a more * intuitive interface to TrollTech's original Address Book editor. This * is made to operate exactly in interface with the exception of name. * */ #include "contacteditor.h" #include "namelineedit.h" #include <opie2/odebug.h> #include <opie2/opimcontact.h> +#include <opie2/oresource.h> #include <qpe/categoryselect.h> #include <qpe/qpeapplication.h> #include <qpe/qpedialog.h> -#include <qpe/resource.h> #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qmultilineedit.h> #include <qtoolbutton.h> #include <qlistbox.h> #include <qmessagebox.h> #include <qwhatsthis.h> #include <assert.h> @@ -208,25 +208,26 @@ void ContactEditor::init() { QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) ); gl->addWidget( l, 7, 0 ); cmbFileAs = new QComboBox( true, container ); gl->addWidget( cmbFileAs, 7, 1 ); labCat = new QLabel( tr( "Category" ), container ); gl->addWidget( labCat, 8, 0 ); cmbCat = new CategorySelect( container ); gl->addWidget( cmbCat, 8, 1 ); labCat->show(); cmbCat->show(); - btnNote = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Notes..." ), container ); + btnNote = new QPushButton( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ), + tr( "Notes..." ), container ); gl->addWidget( btnNote, 9, 1 ); tabMain->addTab( m_generalWidget, "addressbook/AddressBookSmall", tr( "General" ) ); QWidget *tabViewport = new QWidget ( tabMain ); vb = new QVBoxLayout( tabViewport ); svAddress = new QScrollView( tabViewport ); vb->addWidget( svAddress, 0, 0 ); svAddress->setResizePolicy( QScrollView::AutoOneFit ); svAddress->setFrameStyle( QFrame::NoFrame ); @@ -521,50 +522,50 @@ void ContactEditor::init() { QHBox* hBox = new QHBox( container ); l = new QLabel( tr("Birthday"), container ); gl->addWidget( l, counter, 0 ); QPopupMenu* m1 = new QPopupMenu( container ); birthdayPicker = new DateBookMonth( m1, 0, true ); m1->insertItem( birthdayPicker ); birthdayButton= new QToolButton( hBox, "buttonStart" ); birthdayButton->setPopup( m1 ); birthdayButton->setPopupDelay(0); - QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), + QPushButton* deleteButton = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), tr( "Delete" ), hBox, 0 ); gl->addWidget( hBox, counter , 1 ); connect( birthdayPicker, SIGNAL( dateClicked(int,int,int) ), this, SLOT( slotBirthdayDateChanged(int,int,int) ) ); connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); ++counter; // Anniversary hBox = new QHBox( container ); l = new QLabel( tr("Anniversary"), container ); gl->addWidget( l, counter, 0 ); m1 = new QPopupMenu( container ); anniversaryPicker = new DateBookMonth( m1, 0, true ); m1->insertItem( anniversaryPicker ); anniversaryButton= new QToolButton( hBox, "buttonStart" ); anniversaryButton->setPopup( m1 ); anniversaryButton->setPopupDelay(0); - deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), + deleteButton = new QPushButton( Opie::Core::OResource::loadPixmap( "trash", Opie::Core::OResource::SmallIcon ), tr( "Delete" ), hBox, 0 ); gl->addWidget( hBox, counter , 1 ); connect( anniversaryPicker, SIGNAL( dateClicked(int,int,int) ), this, SLOT( slotAnniversaryDateChanged(int,int,int) ) ); connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); ++counter; // Gender l = new QLabel( tr("Gender"), container ); |