author | zecke <zecke> | 2004-04-03 00:02:12 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-04-03 00:02:12 (UTC) |
commit | cc5b13ad3cd093239e004f1b92bca9f6d88073a9 (patch) (unidiff) | |
tree | 0af3af7a913b12ef357d0b20764df6300aca5226 | |
parent | 02bb854283a7b0abecf3d3e9dd4c9ece0c5ef6a9 (diff) | |
download | opie-cc5b13ad3cd093239e004f1b92bca9f6d88073a9.zip opie-cc5b13ad3cd093239e004f1b92bca9f6d88073a9.tar.gz opie-cc5b13ad3cd093239e004f1b92bca9f6d88073a9.tar.bz2 |
- remove qWarning
- pixmaps for the keyboard actions
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 4a20648..f415d39 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp | |||
@@ -50,51 +50,51 @@ namespace { | |||
50 | QString m_path; | 50 | QString m_path; |
51 | bool m_isDir : 1; | 51 | bool m_isDir : 1; |
52 | bool m_noInfo :1; | 52 | bool m_noInfo :1; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | 55 | ||
56 | /* | 56 | /* |
57 | * If we request an Image or String | 57 | * If we request an Image or String |
58 | * we add it to the map | 58 | * we add it to the map |
59 | */ | 59 | */ |
60 | QMap<QString, IconViewItem*> g_stringInf; | 60 | QMap<QString, IconViewItem*> g_stringInf; |
61 | QMap<QString, IconViewItem*> g_stringPix; | 61 | QMap<QString, IconViewItem*> g_stringPix; |
62 | 62 | ||
63 | IconViewItem::IconViewItem( QIconView* view,const QString& path, | 63 | IconViewItem::IconViewItem( QIconView* view,const QString& path, |
64 | const QString& name, bool isDir ) | 64 | const QString& name, bool isDir ) |
65 | : QIconViewItem( view, name ), m_path( path ), m_isDir( isDir ), | 65 | : QIconViewItem( view, name ), m_path( path ), m_isDir( isDir ), |
66 | m_noInfo( false ) | 66 | m_noInfo( false ) |
67 | { | 67 | { |
68 | if ( isDir && !_dirPix ) | 68 | if ( isDir && !_dirPix ) |
69 | _dirPix = new QPixmap( Resource::loadPixmap("advancedfm/FileBrowser")); | 69 | _dirPix = new QPixmap( Resource::loadPixmap("advancedfm/FileBrowser")); |
70 | else if ( !isDir && !_unkPix ) | 70 | else if ( !isDir && !_unkPix ) |
71 | _unkPix = new QPixmap( Resource::loadPixmap( "UnknownDocument" ) ); | 71 | _unkPix = new QPixmap( Resource::loadPixmap( "UnknownDocument" ) ); |
72 | } | 72 | } |
73 | inline QPixmap* IconViewItem::pixmap()const { | 73 | inline QPixmap* IconViewItem::pixmap()const { |
74 | qWarning( "Name is " + m_path.right( 15 ) + " rect is %d %d %d %d | %d %d", | 74 | // qWarning( "Name is " + m_path.right( 15 ) + " rect is %d %d %d %d | %d %d", |
75 | rect().x(),rect().y(),rect().width(),rect().height(), | 75 | // rect().x(),rect().y(),rect().width(),rect().height(), |
76 | iconView()->contentsX(), iconView()->contentsY()); | 76 | // iconView()->contentsX(), iconView()->contentsY()); |
77 | 77 | ||
78 | if ( m_isDir ) | 78 | if ( m_isDir ) |
79 | return _dirPix; | 79 | return _dirPix; |
80 | else{ | 80 | else{ |
81 | if (!m_noInfo && !g_stringInf.contains( m_path ) ) { | 81 | if (!m_noInfo && !g_stringInf.contains( m_path ) ) { |
82 | currentView()->dirLister()->imageInfo( m_path ); | 82 | currentView()->dirLister()->imageInfo( m_path ); |
83 | g_stringInf.insert( m_path, const_cast<IconViewItem*>(this)); | 83 | g_stringInf.insert( m_path, const_cast<IconViewItem*>(this)); |
84 | } | 84 | } |
85 | 85 | ||
86 | m_pix = PPixmapCache::self()->cachedImage( m_path, 64, 64 ); | 86 | m_pix = PPixmapCache::self()->cachedImage( m_path, 64, 64 ); |
87 | if ( !m_pix && !g_stringPix.contains( m_path )) { | 87 | if ( !m_pix && !g_stringPix.contains( m_path )) { |
88 | currentView()->dirLister()->thumbNail( m_path, 64, 64 ); | 88 | currentView()->dirLister()->thumbNail( m_path, 64, 64 ); |
89 | g_stringPix.insert( m_path, const_cast<IconViewItem*>(this)); | 89 | g_stringPix.insert( m_path, const_cast<IconViewItem*>(this)); |
90 | } | 90 | } |
91 | return m_pix ? m_pix : _unkPix; | 91 | return m_pix ? m_pix : _unkPix; |
92 | } | 92 | } |
93 | } | 93 | } |
94 | inline void IconViewItem::setText( const QString& str ) { | 94 | inline void IconViewItem::setText( const QString& str ) { |
95 | QString text = QIconViewItem::text()+"\n"+str; | 95 | QString text = QIconViewItem::text()+"\n"+str; |
96 | m_noInfo = true; | 96 | m_noInfo = true; |
97 | QIconViewItem::setText( text ); | 97 | QIconViewItem::setText( text ); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
@@ -136,61 +136,61 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
136 | 136 | ||
137 | PIconView::~PIconView() { | 137 | PIconView::~PIconView() { |
138 | { | 138 | { |
139 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); | 139 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); |
140 | } | 140 | } |
141 | m_viewManager->save(); | 141 | m_viewManager->save(); |
142 | delete m_viewManager; | 142 | delete m_viewManager; |
143 | } | 143 | } |
144 | 144 | ||
145 | Opie::Ui::OKeyConfigManager* PIconView::manager() { | 145 | Opie::Ui::OKeyConfigManager* PIconView::manager() { |
146 | return m_viewManager; | 146 | return m_viewManager; |
147 | } | 147 | } |
148 | 148 | ||
149 | void PIconView::initKeys() { | 149 | void PIconView::initKeys() { |
150 | Opie::Ui::OKeyPair::List lst; | 150 | Opie::Ui::OKeyPair::List lst; |
151 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); | 151 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); |
152 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); | 152 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); |
153 | lst.append( Opie::Ui::OKeyPair::leftArrowKey() ); | 153 | lst.append( Opie::Ui::OKeyPair::leftArrowKey() ); |
154 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); | 154 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); |
155 | lst.append( Opie::Ui::OKeyPair::returnKey() ); | 155 | lst.append( Opie::Ui::OKeyPair::returnKey() ); |
156 | 156 | ||
157 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "View-KeyBoard-Config", | 157 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "View-KeyBoard-Config", |
158 | lst, false,this, "keyconfig name" ); | 158 | lst, false,this, "keyconfig name" ); |
159 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("Beam Current Item") , "beam", | 159 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("Beam Current Item") , "beam", |
160 | QString::fromLatin1("beam"), BeamItem, | 160 | Resource::loadPixmap("beam"), BeamItem, |
161 | Opie::Ui::OKeyPair(Qt::Key_B, Qt::ShiftButton), | 161 | Opie::Ui::OKeyPair(Qt::Key_B, Qt::ShiftButton), |
162 | this, SLOT(slotBeam())) ); | 162 | this, SLOT(slotBeam())) ); |
163 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("Delete Current Item"), "delete", | 163 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("Delete Current Item"), "delete", |
164 | QString::fromLatin1("trash"), DeleteItem, | 164 | Resource::loadPixmap("trash"), DeleteItem, |
165 | Opie::Ui::OKeyPair(Qt::Key_D, Qt::ShiftButton), | 165 | Opie::Ui::OKeyPair(Qt::Key_D, Qt::ShiftButton), |
166 | this, SLOT(slotTrash())) ); | 166 | this, SLOT(slotTrash())) ); |
167 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("View Current Item"), "view", | 167 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("View Current Item"), "view", |
168 | QString::fromLatin1("1to1"), ViewItem, | 168 | Resource::loadPixmap("1to1"), ViewItem, |
169 | Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton), | 169 | Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton), |
170 | this, SLOT(slotShowImage()))); | 170 | this, SLOT(slotShowImage()))); |
171 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("Show Image Info") , "info", | 171 | m_viewManager->addKeyConfig( OKeyConfigItem(tr("Show Image Info") , "info", |
172 | QString::fromLatin1("DocumentTypeWord"), InfoItem, | 172 | Resource::loadPixmap("DocumentTypeWord"), InfoItem, |
173 | Opie::Ui::OKeyPair(Qt::Key_I, Qt::ShiftButton ), | 173 | Opie::Ui::OKeyPair(Qt::Key_I, Qt::ShiftButton ), |
174 | this, SLOT(slotImageInfo()) ) ); | 174 | this, SLOT(slotImageInfo()) ) ); |
175 | m_viewManager->load(); | 175 | m_viewManager->load(); |
176 | m_viewManager->handleWidget( m_view ); | 176 | m_viewManager->handleWidget( m_view ); |
177 | } | 177 | } |
178 | 178 | ||
179 | void PIconView::slotDirUp() { | 179 | void PIconView::slotDirUp() { |
180 | QDir dir( m_path ); | 180 | QDir dir( m_path ); |
181 | dir.cdUp(); | 181 | dir.cdUp(); |
182 | slotChangeDir( dir.absPath() ); | 182 | slotChangeDir( dir.absPath() ); |
183 | 183 | ||
184 | } | 184 | } |
185 | 185 | ||
186 | void PIconView::slotChangeDir(const QString& path) { | 186 | void PIconView::slotChangeDir(const QString& path) { |
187 | if ( !currentView() ) | 187 | if ( !currentView() ) |
188 | return; | 188 | return; |
189 | 189 | ||
190 | PDirLister *lister = currentView()->dirLister(); | 190 | PDirLister *lister = currentView()->dirLister(); |
191 | if (!lister ) | 191 | if (!lister ) |
192 | return; | 192 | return; |
193 | 193 | ||
194 | lister->setStartPath( path ); | 194 | lister->setStartPath( path ); |
195 | m_path = lister->currentPath(); | 195 | m_path = lister->currentPath(); |
196 | 196 | ||