Kfind::Kfind( QWidget *parent, const char *name, const char *searchPath ) : QWidget( parent, name ) { // init IO buffer iBuffer = 0; //create tabdialog tabDialog = new KfindTabDialog(this,"dialog",searchPath); //prepare window for find results win = new KfindWindow(this,"window"); win->hide(); //and hide it firstly winsize=1; connect(win ,SIGNAL(resultSelected(bool)), this,SIGNAL(resultSelected(bool))); connect(win ,SIGNAL(statusChanged(const char *)), this,SIGNAL(statusChanged(const char *))); connect(this,SIGNAL(deleteFile()), win,SLOT(deleteFiles())); connect(this,SIGNAL(properties()), win,SLOT(fileProperties())); connect(this,SIGNAL(openFolder()), win,SLOT(openFolder())); connect(this,SIGNAL(saveResults()), win,SLOT(saveResults())); connect(this,SIGNAL(addToArchive()), win,SLOT(addToArchive())); connect(this,SIGNAL(open()), win,SLOT(openBinding())); connect(parentWidget(),SIGNAL(selectAll()), win,SLOT(selectAll())); connect(parentWidget(),SIGNAL(unselectAll()), win,SLOT(unselectAll())); connect(parentWidget(),SIGNAL(invertSelection()), win,SLOT(invertSelection())); connect(&findProcess,SIGNAL(processExited(KProcess *)), this,SLOT(processResults())); connect(&findProcess,SIGNAL(receivedStdout(KProcess *, char *, int)), this, SLOT(handleStdout(KProcess *, char *, int))) ; resize(sizeHint()); //emit haveResults(false); // we're not connectd to anything yet!? };
void KfindWindow::slotContextMenu(TDEListView *,TQListViewItem *item,const TQPoint&p) { if (!item) return; int count = selectedItems().count(); if (count == 0) { return; }; if (m_menu==0) m_menu = new TDEPopupMenu(this); else m_menu->clear(); if (count == 1) { //menu = new TDEPopupMenu(item->text(0), this); m_menu->insertTitle(item->text(0)); m_menu->insertItem(SmallIcon("document-open"),i18n("Menu item", "Open"), this, TQT_SLOT(openBinding())); m_menu->insertItem(SmallIcon("window-new"),i18n("Open Folder"), this, TQT_SLOT(openFolder())); m_menu->insertSeparator(); m_menu->insertItem(SmallIcon("edit-copy"),i18n("Copy"), this, TQT_SLOT(copySelection())); m_menu->insertItem(SmallIcon("edit-delete"),i18n("Delete"), this, TQT_SLOT(deleteFiles())); m_menu->insertSeparator(); m_menu->insertItem(i18n("Open With..."), this, TQT_SLOT(slotOpenWith())); m_menu->insertSeparator(); m_menu->insertItem(i18n("Properties"), this, TQT_SLOT(fileProperties())); } else { m_menu->insertTitle(i18n("Selected Files")); m_menu->insertItem(SmallIcon("edit-copy"),i18n("Copy"), this, TQT_SLOT(copySelection())); m_menu->insertItem(SmallIcon("edit-delete"),i18n("Delete"), this, TQT_SLOT(deleteFiles())); } m_menu->popup(p, 1); }