RiffImportDlg::RiffImportDlg(QWidget *parent) : QDialog(parent), ui(new Ui::RiffImportDlg) { m_riff = new Riff(this); connect(m_riff, SIGNAL(signalInstrument(int, int, QString)), SLOT(slotInstrument(int, int, QString))); connect(m_riff, SIGNAL(signalSoundFont(QString, QString, QString)), SLOT(slotCompleted(QString, QString, QString))); connect(m_riff, SIGNAL(signalDLS(QString, QString, QString)), SLOT(slotCompleted(QString, QString, QString))); ui->setupUi(this); connect(ui->m_inputBtn, SIGNAL(clicked()), SLOT(openInput())); connect(ui->m_outputBtn, SIGNAL(clicked()), SLOT(openOutput())); }
MenuMedia::MenuMedia() : KPanelMenu( QString::null, 0, "Media" ), mMenuId(0) { disableAutoClear(); setCaption(i18n("Media Menu")); m_DirLister = new KDirLister(); connect( m_DirLister, SIGNAL( clear() ), this, SLOT( slotClear() ) ); connect( m_DirLister, SIGNAL( started(const KURL&) ), this, SLOT( slotStarted(const KURL&) ) ); connect( m_DirLister, SIGNAL( completed() ), this, SLOT( slotCompleted() ) ); connect( m_DirLister, SIGNAL( newItems( const KFileItemList & ) ), this, SLOT( slotNewItems( const KFileItemList & ) ) ); connect( m_DirLister, SIGNAL( deleteItem( KFileItem * ) ), this, SLOT( slotDeleteItem( KFileItem * ) ) ); connect( m_DirLister, SIGNAL( refreshItems( const KFileItemList & ) ), this, SLOT( slotRefreshItems( const KFileItemList & ) ) ); m_ExcludedTypesList.clear(); m_ExcludedTypesList << "media/hdd_mounted"; m_ExcludedTypesList << "media/hdd_unmounted"; m_ExcludedTypesList << "media/nfs_mounted"; m_ExcludedTypesList << "media/nfs_unmounted"; m_ExcludedTypesList << "media/smb_mounted"; m_ExcludedTypesList << "media/smb_unmounted"; }
SystemMenu::SystemMenu(QWidget *parent, const QStringList &/*args*/) : KPanelMenu(parent) { connect( &m_dirLister, SIGNAL( completed() ), this, SLOT( slotCompleted() ) ); m_dirLister.openUrl(KUrl("system:/")); }
KParts::ReadOnlyPart *KWebDesktop::createPart(const QString &mimeType) { delete m_part; m_part = 0; KMimeType::Ptr mime = KMimeType::mimeType(mimeType); if(!mime || mime == KMimeType::defaultMimeTypePtr()) return 0; if(mime->is("text/html") || mime->is("text/xml") || mime->is("application/xhtml+xml")) { KHTMLPart *htmlPart = new KHTMLPart; htmlPart->widget()->resize(m_width, m_height); htmlPart->setMetaRefreshEnabled(false); htmlPart->setJScriptEnabled(false); htmlPart->setJavaEnabled(false); ((QScrollView *)htmlPart->widget())->setHScrollBarMode(QScrollView::AlwaysOff); ((QScrollView *)htmlPart->widget())->setVScrollBarMode(QScrollView::AlwaysOff); connect(htmlPart, SIGNAL(completed()), this, SLOT(slotCompleted())); m_part = htmlPart; } else { // Try to find an appropriate viewer component m_part = KParts::ComponentFactory::createPartInstanceFromQuery< KParts::ReadOnlyPart >(mimeType, QString::null, 0, 0, this, 0); if(!m_part) kdWarning() << "No handler found for " << mimeType << endl; else { kdDebug() << "Loaded " << m_part->className() << endl; connect(m_part, SIGNAL(completed()), this, SLOT(slotCompleted())); } } if(m_part) { connect(m_part, SIGNAL(canceled(const QString &)), this, SLOT(slotCompleted())); } return m_part; }
bool KOfficeCreator::create(const QString &path, int width, int height, QImage &img) { KOdfStore* store = KOdfStore::createStore(path, KOdfStore::Read); if ( store && ( store->open( QString("Thumbnails/thumbnail.png") ) || store->open( QString("preview.png") ) ) ) { // Hooray! No long delay for the user... QByteArray bytes = store->read(store->size()); store->close(); delete store; return img.loadFromData(bytes); } delete store; QString mimetype = KMimeType::findByPath( path )->name(); m_doc = KMimeTypeTrader::self()->createPartInstanceFromQuery<KoDocument>( mimetype ); if (!m_doc) return false; connect(m_doc, SIGNAL(completed()), SLOT(slotCompleted())); KUrl url; url.setPath( path ); m_doc->setCheckAutoSaveFile( false ); m_doc->setAutoErrorHandlingEnabled( false ); // don't show message boxes if ( !m_doc->openUrl( url ) ) return false; m_completed = false; startTimer(5000); // while (!m_completed) // kapp->processOneEvent(); QAbstractEventDispatcher::instance()->unregisterTimers(this); // render the page on a bigger pixmap and use smoothScale, // looks better than directly scaling with the QPainter (malte) QPixmap pix; if (width > 400) { pix = m_doc->generatePreview(QSize(width, height)); } else { pix = m_doc->generatePreview(QSize(400, 400)); } img = pix.toImage(); return true; }
void ImageDescEditTab::initProgressIndicator() { if (!ProgressManager::instance()->findItembyId(QLatin1String("ImageDescEditTabProgress"))) { FileActionProgress* const item = new FileActionProgress(QLatin1String("ImageDescEditTabProgress")); connect(this, SIGNAL(signalProgressMessageChanged(QString)), item, SLOT(slotProgressStatus(QString))); connect(this, SIGNAL(signalProgressValueChanged(float)), item, SLOT(slotProgressValue(float))); connect(this, SIGNAL(signalProgressFinished()), item, SLOT(slotCompleted())); }
MessageSourceWidget::MessageSourceWidget(QWidget *parent, const QModelIndex &messageIndex): QWebView(parent), m_combiner(0), m_loadingSpinner(0) { Q_ASSERT(messageIndex.isValid()); page()->setNetworkAccessManager(0); m_loadingSpinner = new Spinner(this); m_loadingSpinner->setText(tr("Fetching\nMessage")); m_loadingSpinner->setType(Spinner::Sun); m_loadingSpinner->start(250); m_combiner = new Imap::Mailbox::FullMessageCombiner(messageIndex, this); connect(m_combiner, SIGNAL(completed()), this, SLOT(slotCompleted())); connect(m_combiner, SIGNAL(failed(QString)), this, SLOT(slotError(QString))); m_combiner->load(); }
TrashApplet::TrashApplet(const QString &configFile, Type type, int actions, QWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name), mButton(0) { mButton = new TrashButton(this); if(!parent) setBackgroundMode(X11ParentRelative); mButton->setPanelPosition(position()); setAcceptDrops(true); mpDirLister = new KDirLister(); connect(mpDirLister, SIGNAL(clear()), this, SLOT(slotClear())); connect(mpDirLister, SIGNAL(completed()), this, SLOT(slotCompleted())); connect(mpDirLister, SIGNAL(deleteItem(KFileItem *)), this, SLOT(slotDeleteItem(KFileItem *))); mpDirLister->openURL("trash:/"); }
void TextInfo::setDocument(KTextEditor::Document *doc) { KILE_DEBUG_MAIN << "===void TextInfo::setDoc(KTextEditor::Document *doc)==="; if(m_doc == doc) { return; } detach(); if(doc) { m_doc = doc; m_documentContents.clear(); connect(m_doc, SIGNAL(documentNameChanged(KTextEditor::Document*)), this, SLOT(slotFileNameChanged())); connect(m_doc, SIGNAL(documentUrlChanged(KTextEditor::Document*)), this, SLOT(slotFileNameChanged())); connect(m_doc, SIGNAL(completed()), this, SLOT(slotCompleted())); connect(m_doc, SIGNAL(modifiedChanged(KTextEditor::Document*)), this, SLOT(makeDirtyIfModified())); // this could be a KatePart bug, and as "work-around" we manually set the highlighting mode again connect(m_doc, SIGNAL(completed()), this, SLOT(activateDefaultMode())); setMode(m_defaultMode); installEventFilters(); registerCodeCompletionModels(); } }
void KonqView::connectPart() { //kDebug(); connect( m_pPart, SIGNAL( started( KIO::Job * ) ), this, SLOT( slotStarted( KIO::Job * ) ) ); connect( m_pPart, SIGNAL( completed() ), this, SLOT( slotCompleted() ) ); connect( m_pPart, SIGNAL( completed(bool) ), this, SLOT( slotCompleted(bool) ) ); connect( m_pPart, SIGNAL( canceled( const QString & ) ), this, SLOT( slotCanceled( const QString & ) ) ); connect( m_pPart, SIGNAL( setWindowCaption( const QString & ) ), this, SLOT( setCaption( const QString & ) ) ); if (!internalViewMode().isEmpty()) { // Update checked action in "View Mode" menu when switching view mode in dolphin connect(m_pPart, SIGNAL(viewModeChanged()), m_pMainWindow, SLOT(slotInternalViewModeChanged())); } KParts::BrowserExtension *ext = browserExtension(); if ( ext ) { ext->setBrowserInterface( m_browserIface ); connect( ext, SIGNAL( openUrlRequestDelayed(const KUrl &, const KParts::OpenUrlArguments&, const KParts::BrowserArguments &) ), m_pMainWindow, SLOT( slotOpenURLRequest( const KUrl &, const KParts::OpenUrlArguments&, const KParts::BrowserArguments & ) ) ); if ( m_bPopupMenuEnabled ) { m_bPopupMenuEnabled = false; // force enablePopupMenu( true ); } connect( ext, SIGNAL( setLocationBarUrl( const QString & ) ), this, SLOT( setLocationBarURL( const QString & ) ) ); connect( ext, SIGNAL( setIconUrl( const KUrl & ) ), this, SLOT( setIconURL( const KUrl & ) ) ); connect( ext, SIGNAL( setPageSecurity( int ) ), this, SLOT( setPageSecurity( int ) ) ); connect( ext, SIGNAL( createNewWindow(const KUrl &, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &, const KParts::WindowArgs &, KParts::ReadOnlyPart**) ), m_pMainWindow, SLOT( slotCreateNewWindow( const KUrl &, const KParts::OpenUrlArguments &, const KParts::BrowserArguments &, const KParts::WindowArgs &, KParts::ReadOnlyPart**) ) ); connect( ext, SIGNAL( loadingProgress( int ) ), m_pKonqFrame->statusbar(), SLOT( slotLoadingProgress( int ) ) ); connect( ext, SIGNAL( speedProgress( int ) ), m_pKonqFrame->statusbar(), SLOT( slotSpeedProgress( int ) ) ); connect( ext, SIGNAL( selectionInfo( const KFileItemList& ) ), this, SLOT( slotSelectionInfo( const KFileItemList& ) ) ); connect( ext, SIGNAL( mouseOverInfo( const KFileItem& ) ), this, SLOT( slotMouseOverInfo( const KFileItem& ) ) ); connect( ext, SIGNAL( openUrlNotify() ), this, SLOT( slotOpenURLNotify() ) ); connect( ext, SIGNAL( enableAction( const char *, bool ) ), this, SLOT( slotEnableAction( const char *, bool ) ) ); connect( ext, SIGNAL( setActionText( const char *, const QString& ) ), this, SLOT( slotSetActionText( const char *, const QString& ) ) ); connect( ext, SIGNAL( moveTopLevelWidget( int, int ) ), this, SLOT( slotMoveTopLevelWidget( int, int ) ) ); connect( ext, SIGNAL( resizeTopLevelWidget( int, int ) ), this, SLOT( slotResizeTopLevelWidget( int, int ) ) ); connect( ext, SIGNAL( requestFocus(KParts::ReadOnlyPart *) ), this, SLOT( slotRequestFocus(KParts::ReadOnlyPart *) ) ); if (service()->desktopEntryName() != "konq_sidebartng") { connect( ext, SIGNAL( infoMessage( const QString & ) ), m_pKonqFrame->statusbar(), SLOT( message( const QString & ) ) ); connect( ext, SIGNAL( addWebSideBar(const KUrl&, const QString&) ), m_pMainWindow, SLOT( slotAddWebSideBar(const KUrl&, const QString&) ) ); } }
DolphinView::DolphinView(QWidget *parent, const KURL& url, Mode mode, bool showHiddenFiles) : QWidget(parent), m_refreshing(false), m_showProgress(false), m_mode(mode), m_iconsView(0), m_detailsView(0), m_statusBar(0), m_iconSize(0), m_folderCount(0), m_fileCount(0), m_filterBar(0) { setFocusPolicy(QWidget::StrongFocus); m_topLayout = new QVBoxLayout(this); Dolphin& dolphin = Dolphin::mainWin(); connect(this, SIGNAL(signalModeChanged()), &dolphin, SLOT(slotViewModeChanged())); connect(this, SIGNAL(signalShowHiddenFilesChanged()), &dolphin, SLOT(slotShowHiddenFilesChanged())); connect(this, SIGNAL(signalSortingChanged(DolphinView::Sorting)), &dolphin, SLOT(slotSortingChanged(DolphinView::Sorting))); connect(this, SIGNAL(signalSortOrderChanged(Qt::SortOrder)), &dolphin, SLOT(slotSortOrderChanged(Qt::SortOrder))); m_urlNavigator = new URLNavigator(url, this); connect(m_urlNavigator, SIGNAL(urlChanged(const KURL&)), this, SLOT(slotURLChanged(const KURL&))); connect(m_urlNavigator, SIGNAL(urlChanged(const KURL&)), &dolphin, SLOT(slotURLChanged(const KURL&))); connect(m_urlNavigator, SIGNAL(historyChanged()), &dolphin, SLOT(slotHistoryChanged())); m_statusBar = new DolphinStatusBar(this); m_dirLister = new DolphinDirLister(); m_dirLister->setAutoUpdate(true); m_dirLister->setMainWindow(this); m_dirLister->setShowingDotFiles(showHiddenFiles); connect(m_dirLister, SIGNAL(clear()), this, SLOT(slotClear())); connect(m_dirLister, SIGNAL(percent(int)), this, SLOT(slotPercent(int))); connect(m_dirLister, SIGNAL(deleteItem(KFileItem*)), this, SLOT(slotDeleteItem(KFileItem*))); connect(m_dirLister, SIGNAL(completed()), this, SLOT(slotCompleted())); connect(m_dirLister, SIGNAL(infoMessage(const QString&)), this, SLOT(slotInfoMessage(const QString&))); connect(m_dirLister, SIGNAL(errorMessage(const QString&)), this, SLOT(slotErrorMessage(const QString&))); connect(m_dirLister, SIGNAL(refreshItems (const KFileItemList&)), this, SLOT(slotRefreshItems(const KFileItemList&))); connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)), this, SLOT(slotAddItems(const KFileItemList&))); m_iconSize = KIcon::SizeMedium; m_topLayout->addWidget(m_urlNavigator); createView(); m_filterBar = new FilterBar(this); m_filterBar->hide(); m_topLayout->addWidget(m_filterBar); connect(m_filterBar, SIGNAL(signalFilterChanged(const QString&)), this, SLOT(slotChangeNameFilter(const QString&))); m_topLayout->addWidget(m_statusBar); }