00001 /*************************************************************************** 00002 * * 00003 * rundialog.ui.h * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * Read the file COPYING for details. * 00011 * * 00012 * copyright: (C) 2003 by Jan Mueller * 00013 * email: janmueller7@hotmail.com * 00014 * * 00015 ***************************************************************************/ 00016 00017 /**************************************************************************** 00018 ** ui.h extension file, included from the uic-generated form implementation. 00019 ** 00020 ** If you wish to add, delete or rename functions or slots use 00021 ** Qt Designer which will update this file, preserving your code. Create an 00022 ** init() function in place of a constructor, and a destroy() function in 00023 ** place of a destructor. 00024 *****************************************************************************/ 00025 void RunDialog::init() { 00026 } 00027 00028 void RunDialog::setData(QUrl u) { 00029 url=u; 00030 KMimeMagicResult *mime=KMimeMagic::self()->findFileType(KURL(url).path()); 00031 offers = KTrader::self()->query(mime->mimeType(), "Type == 'Application'"); 00032 00033 KTrader::OfferList::Iterator it; 00034 for(it = offers.begin(); it != offers.end(); ++it ) 00035 servicelist->insertItem((*it)->name()); 00036 } 00037 00038 00039 void RunDialog::slotSelected(QListBoxItem *i) { 00040 KURL::List lst; 00041 lst.append(url); 00042 KRun::run(*offers[servicelist->currentItem()], lst); 00043 close(); 00044 } 00045 00046 00047 void RunDialog::slotClose() { 00048 close(); 00049 }