00001 // 00002 // 00003 // C++ Implementation: $MODULE$ 00004 // 00005 // Description: 00006 // 00007 // 00008 // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 00009 // 00010 // Copyright: See COPYING file that comes with this distribution 00011 // 00012 // 00013 #include "applnkitem.h" 00014 00015 #include <opie2/odebug.h> 00016 00017 #include <qpe/applnk.h> 00018 #include <qpe/qcopenvelope_qws.h> 00019 00020 AppLnkItem::AppLnkItem(OListViewItem* parent, AppLnk *app) 00021 : ResultItem(parent) 00022 { 00023 _app = app; 00024 setText(0, _app->name() ); 00025 setPixmap(0, _app->pixmap() ); 00026 } 00027 00028 00029 AppLnkItem::~AppLnkItem() 00030 { 00031 } 00032 00033 00034 QString AppLnkItem::toRichText() 00035 { 00036 QString text; 00037 text += "<b><h3>" + _app->name() + "</b></h3><br>"; 00038 text += _app->comment() + "<br>"; 00039 text += "<br>`" + _app->exec() + "`<br>"; 00040 text += "<br>`" + _app->file() + "`<br>"; 00041 text += "<br>`" + _app->linkFile() + "`<br>"; 00042 return text; 00043 } 00044 00045 void AppLnkItem::action( int act ) 00046 { 00047 if (!_app->isValid()) odebug << "INVALID" << oendl; 00048 if (act == 0) _app->execute(); 00049 else if (act == 1){ 00050 QCopEnvelope e("QPE/Application/advancedfm", "setDocument(QString)"); 00051 e << _app->linkFile(); 00052 } 00053 } 00054 00055 QIntDict<QString> AppLnkItem::actions() 00056 { 00057 QIntDict<QString> result; 00058 result.insert( 0, new QString( QObject::tr("execute") ) ); 00059 result.insert( 1, new QString( QObject::tr("open in filemanager") ) ); 00060 return result; 00061 }
1.4.2