summaryrefslogtreecommitdiff
authortille <tille>2002-11-11 07:47:49 (UTC)
committer tille <tille>2002-11-11 07:47:49 (UTC)
commit204050f404a3cef4ff4f6920d24b16e03d8d6c5e (patch) (unidiff)
treeaf46d63dde093a0fb834059e09df3f25d03e7970
parentcbafca79e0a7993f55c085ead8aaa30604cc646b (diff)
downloadopie-204050f404a3cef4ff4f6920d24b16e03d8d6c5e.zip
opie-204050f404a3cef4ff4f6920d24b16e03d8d6c5e.tar.gz
opie-204050f404a3cef4ff4f6920d24b16e03d8d6c5e.tar.bz2
bug fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/packagelistitem.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp
index 4380393..51d024b 100644
--- a/noncore/unsupported/oipkg/packagelistitem.cpp
+++ b/noncore/unsupported/oipkg/packagelistitem.cpp
@@ -163,77 +163,77 @@ QString PackageListItem::key( int column, bool ascending ) const
163 } else { 163 } else {
164 return QListViewItem::key(column,ascending); 164 return QListViewItem::key(column,ascending);
165 } 165 }
166} 166}
167 167
168void PackageListItem::setOn( bool b ) 168void PackageListItem::setOn( bool b )
169{ 169{
170 QCheckListItem::setOn( b ); 170 QCheckListItem::setOn( b );
171 package->toggleProcess(); 171 package->toggleProcess();
172 package->setLink( settings->createLinks() ); 172 package->setLink( settings->createLinks() );
173 displayDetails(); 173 displayDetails();
174} 174}
175 175
176void PackageListItem::displayDetails() 176void PackageListItem::displayDetails()
177{ 177{
178 QString sod; 178 QString sod;
179 sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits()); 179 sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits());
180 //sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest()); 180 //sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest());
181 sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); 181 sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest());
182 sod = sod.isEmpty()?QString(""):QString(" ("+sod+")"); 182 sod = sod.isEmpty()?QString(""):QString(" ("+sod+")");
183 setText(0, package->name()+sod ); 183 setText(0, package->name()+sod );
184 nameItem->setText( 0, QObject::tr("Name: ")+package->name()); 184 nameItem->setText( 0, QObject::tr("Name: ")+package->name());
185 linkItem->setText( 0, QObject::tr("Link: ")+(package->link()?QObject::tr("Yes"):QObject::tr("No"))); 185 linkItem->setText( 0, QObject::tr("Link: ")+(package->link()?QObject::tr("Yes"):QObject::tr("No")));
186 destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); 186 destItem->setText( 0, QObject::tr("Destination: ")+package->dest() );
187 statusItem->setText( 0, QObject::tr("Status: ")+package->status() ); 187 statusItem->setText( 0, QObject::tr("Status: ")+package->status() );
188 repaint(); 188 repaint();
189} 189}
190 190
191QPopupMenu* PackageListItem::getPopupMenu() 191QPopupMenu* PackageListItem::getPopupMenu()
192{ 192{
193 popupMenu->clear(); 193 popupMenu->clear();
194 destsMenu->clear(); 194 destsMenu->clear();
195 195
196 QAction *popupAction; 196 QAction *popupAction;
197 qDebug("PackageListItem::showPopup "); 197 qDebug("PackageListItem::showPopup ");
198 198
199 if (!package->installed()){ 199 if (!package->installed()){
200 popupMenu->insertItem( QObject::tr("Install to"), destsMenu ); 200 popupMenu->insertItem( QObject::tr("Install to"), destsMenu );
201 QStringList dests = settings->getDestinationNames(); 201 QStringList dests = settings->getDestinationNames();
202 QString ad = settings->getDestinationName(); 202 QString ad = settings->getDestinationName();
203 for (uint i = 0; i < dests.count(); i++ ) 203 for (uint i = 0; i < dests.count(); i++ )
204 { 204 {
205 popupAction = new QAction( dests[i], QString::null, 0, popupMenu, 0 ); 205 popupAction = new QAction( dests[i], QString::null, 0, popupMenu, 0 );
206 popupAction->addTo( destsMenu ); 206 popupAction->addTo( destsMenu );
207 if ( dests[i] == ad && getPackage()->toInstall() ) 207 if ( dests[i] == ad && getPackage()->toInstall() )
208 { 208 {
209 popupAction->setToggleAction( true ); 209 popupAction->setToggleAction( true );
210 popupAction->setOn(true); 210 popupAction->setOn(true);
211 } 211 }
212 } 212 }
213 connect( destsMenu, SIGNAL( activated( int ) ), 213 connect( destsMenu, SIGNAL( activated( int ) ),
214 this, SLOT( menuAction( int ) ) ); 214 this, SLOT( menuAction( int ) ) );
215 popupMenu->popup( QCursor::pos() ); 215 popupMenu->popup( QCursor::pos() );
216 }else{ 216 }else{
217 popupMenu->insertItem( QObject::tr("Remove")); 217 popupMenu->insertItem( QObject::tr("Remove"));
218 connect( popupMenu, SIGNAL( activated( int ) ), 218 connect( popupMenu, SIGNAL( activated( int ) ),
219 this, SLOT( menuAction( int ) ) ); 219 this, SLOT( menuAction( int ) ) );
220 popupMenu->popup( QCursor::pos() ); 220 popupMenu->popup( QCursor::pos() );
221 } 221 }
222 return popupMenu; 222 return popupMenu;
223} 223}
224 224
225void PackageListItem::menuAction( int i ) 225void PackageListItem::menuAction( int i )
226{ 226{
227 if (package->installed()){ 227 if (!package->installed()){
228 package->setDest( destsMenu->text(i) ); 228 package->setDest( destsMenu->text(i) );
229 package->setLink( settings->createLinks() ); 229 package->setLink( settings->createLinks() );
230 } 230 }
231 package->setOn(); 231 package->setOn();
232 displayDetails(); 232 displayDetails();
233} 233}
234 234
235//void PackageListItem::toggleProcess() 235//void PackageListItem::toggleProcess()
236//{ 236//{
237// package->toggleProcess() ; 237// package->toggleProcess() ;
238// displayDetails(); 238// displayDetails();
239//} \ No newline at end of file 239//}