Пример #1
0
CGroupList::CGroupList(QWidget *parent)
          : QAbstractItemModel(parent),
            itsTimeStamp(0),
            itsModified(false),
            itsParent(parent),
            itsSortOrder(Qt::AscendingOrder)
{
    itsSpecialGroups[CGroupListItem::ALL]=new CGroupListItem(CGroupListItem::ALL, this);
    itsGroups.append(itsSpecialGroups[CGroupListItem::ALL]);
    if(Misc::root())
        itsSpecialGroups[CGroupListItem::PERSONAL]=
        itsSpecialGroups[CGroupListItem::SYSTEM]=NULL;
    else
    {
        itsSpecialGroups[CGroupListItem::PERSONAL]=new CGroupListItem(CGroupListItem::PERSONAL, this);
        itsGroups.append(itsSpecialGroups[CGroupListItem::PERSONAL]);
        itsSpecialGroups[CGroupListItem::SYSTEM]=new CGroupListItem(CGroupListItem::SYSTEM, this);
        itsGroups.append(itsSpecialGroups[CGroupListItem::SYSTEM]);
    }
    itsSpecialGroups[CGroupListItem::UNCLASSIFIED]=
                new CGroupListItem(CGroupListItem::UNCLASSIFIED, this);
    // Locate groups.xml file - normall will be ~/.config/fontgroups.xml
    QString path(KGlobal::dirs()->localxdgconfdir());

    if(!Misc::dExists(path))
        Misc::createDir(path);

    itsFileName=path+'/'+KFI_GROUPS_FILE;

    rescan();
}
Пример #2
0
/**
 *  Constructs a new instance that will check the validity of children
 *  of the given widget.
 *
 *  @param aWidget  Widget whose children should be checked.
 */
QIWidgetValidator::QIWidgetValidator (QWidget *aWidget, QObject *aParent)
    : QObject (aParent)
    , mWidget (aWidget)
    , mOtherValid (true)
{
    rescan();
}
Пример #3
0
void PluginFactory::load()
{
    rescan();

    for( PluginInfoList::iterator it = infoList.begin(); it != infoList.end(); ++it ) {
        PluginInfo *pluginInfo = (*it).first;
        QLibrary *lib = (*it).second;

        if ( !pluginInfo || !lib ) continue;

        PTRACE( 1, "\n '" << pluginInfo->name << "':\n" <<
                "\tdescription:\t" << pluginInfo->description << "\n" <<
                "\tauthor:\t\t" << pluginInfo->author );

        Plugin::Type type = pluginInfo->type;
        int id = pluginInfo->id;
        Plugin *plugin = 0;

        if( onStartupMap.contains(id) ) {
            if( onStartupMap[id] == NotLoad ) continue;
            plugin = createPlugin( *it );
        }
        else {
            if( ancaConf->readBoolEntry( LOAD_NEW_PLUGINS, LOAD_NEW_PLUGINS_DEFAULT ) && noConflicts(type) ) {
                onStartupMap[id] = Load;
                plugin = createPlugin( *it );
            }
            else
                onStartupMap[id] = NotLoad;
        }

        // create GUI that plugin exports?
        if( pluginInfo->flags & P_HAS_GUI ) d->guiPlugins.append(plugin);
    }
}
Пример #4
0
/*
 * Get a single event, process it, and return.
 *
 */
domulti(){
    int event;
	int skipit = 11;
    
    		wind_update(TRUE);
	        BEE_MOUSE;
		    if (rescan(0,0) != OK) {
				errs("[3][|", CANTFMT, "][ EXIT ]");
				ret = skipit;
				goto fnshfmt;
			}
			tformat = TRUE;
			needscan = FALSE;
			if ((ret = dodiform()) != OK)	{
				if (ret == ERROR)
					errs("[3][|", CANTFMT, "][ EXIT ]");
				else
					ret = skipit;
			} else {
				errs("[0][| |", OKFMT, "][ EXIT ]");
			}
	fnshfmt:
			tformat = FALSE;
	   		wind_update(FALSE);
			return(ret);
}
Пример #5
0
WildcharsEnumerator::WildcharsEnumerator(const char *_selection) : selection(_selection) {
  // Test if the system supports U16 at initialization.
#if UTF8
  utf16 = Std::encodingSupportedByOS(SvcStrCnv::UTF16);
#endif
  // Then scan.
  rescan();
}
Пример #6
0
PresetLoader::PresetLoader (int gx, int gy, std::string dirname = std::string()) :_dirname ( dirname ), _dir ( 0 )
{
	_presetFactoryManager.initialize(gx,gy);
	// Do one scan
	if ( _dirname != std::string() )
		rescan();
	else
		clear();
}
Пример #7
0
/**
 *  Constructs a new instance that will check the validity of children
 *  of the given widget.
 *
 *  @param aCaption Caption to use for the warning message.
 *  @param aWidget  Widget whose children should be checked.
 */
QIWidgetValidator::QIWidgetValidator (const QString &aCaption,
                                      QWidget *aWidget, QObject *aParent)
    : QObject (aParent)
    , mCaption (aCaption)
    , mWidget (aWidget)
    , mOtherValid (true)
{
    rescan();
}
Пример #8
0
void
gtk_file_browser_path_changed (GtkFileBrowser *file_browser)
{
	g_return_if_fail (file_browser != NULL);
	g_return_if_fail (GTK_IS_FILE_BROWSER (file_browser));

	rescan (file_browser);

	gtk_signal_emit (GTK_OBJECT (file_browser),
		file_browser_signals[SIG_PATH_CHANGED], file_browser->path, NULL);
}
Пример #9
0
static int open_scsi_bus (int flags)
{
	if (bus_open) {
		write_log (L"SPTI open_bus() more than once!\n");
		return 1;
	}
	total_devices = 0;
	uae_sem_init (&scgp_sem, 0, 1);
	rescan ();
	bus_open = 1;
	write_log (L"SPTI driver open, %d devices.\n", total_devices);
	return total_devices;
}
Пример #10
0
KSysinfoPart::KSysinfoPart( QWidget * parent, const char * name )
: KHTMLPart( parent, name )
{
    KInstance * instance = new KInstance( "ksysinfopart" );
    setInstance( instance );
    rescanTimer=new QTimer(this);

    connect(rescanTimer, SIGNAL(timeout()),
                         SLOT(rescan()));

    rescanTimer->start( 20000, true );

    installEventFilter( this );
}
Пример #11
0
int
do_lvm_clear_filter (void)
{
  if (deactivate () == -1)
    return -1;

  if (set_filter ("\"a/.*/\"") == -1)
    return -1;

  if (rescan () == -1)
    return -1;

  return reactivate ();
}
void MDnsSdListener::Monitor::run() {
    int pollCount = 1;
    mPollSize = 10;

    mPollFds = (struct pollfd *)calloc(sizeof(struct pollfd), mPollSize);
    mPollRefs = (DNSServiceRef **)calloc(sizeof(DNSServiceRef *), mPollSize);

    mPollFds[0].fd = mCtrlSocketPair[0];
    mPollFds[0].events = POLLIN;

    if (VDBG) ALOGD("MDnsSdListener starting to monitor");
    while (1) {
        if (VDBG) ALOGD("Going to poll with pollCount %d", pollCount);
        int pollResults = poll(mPollFds, pollCount, 10000000);
        if (pollResults < 0) {
            ALOGE("Error in poll - got %d", errno);
        } else if (pollResults > 0) {
            if (VDBG) ALOGD("Monitor poll got data pollCount = %d, %d", pollCount, pollResults);
            for(int i = 1; i < pollCount; i++) {
                if (mPollFds[i].revents != 0) {
                    if (VDBG) {
                        ALOGD("Monitor found [%d].revents = %d - calling ProcessResults",
                                i, mPollFds[i].revents);
                    }
                    DNSServiceProcessResult(*(mPollRefs[i]));
                    mPollFds[i].revents = 0;
                }
            }
            if (VDBG) ALOGD("controlSocket shows revent= %d", mPollFds[0].revents);
            switch (mPollFds[0].revents) {
                case POLLIN: {
                    char readBuf[2];
                    read(mCtrlSocketPair[0], &readBuf, 1);
                    if (DBG) ALOGD("MDnsSdListener::Monitor got %c", readBuf[0]);
                    if (memcmp(RESCAN, readBuf, 1) == 0) {
                        pollCount = rescan();
                    }
                }
            }
            mPollFds[0].revents = 0;
        } else {
            if (VDBG) ALOGD("MDnsSdListener::Monitor poll timed out");
        }
    }
    free(mPollFds);
    free(mPollRefs);
}
Пример #13
0
KstSharedPtr<Plugin> PluginCollection::plugin(const QString& name) {
  if (!_plugins.contains(name)) {
    if (!_installedPluginNames.contains(name)) {
      rescan();
    }

    if (_installedPluginNames.contains(name)) {
      loadPlugin(_installedPluginNames[name]);

      if (!_plugins.contains(name)) {
        return 0L;
      }
    }
  }

  return _plugins[name];
}
Пример #14
0
int
do_lvm_set_filter (char *const *devices)
{
  CLEANUP_FREE char *filter = make_filter_string (devices);
  if (filter == NULL)
    return -1;

  if (deactivate () == -1)
    return -1;

  int r = set_filter (filter);
  if (r == -1)
    return -1;

  if (rescan () == -1)
    return -1;

  return reactivate ();
}
Пример #15
0
/*
 * Get a single event, process it, and return.
 *
 */
domulti(){
    int event;
    
    event = evnt_multi(MU_MESAG,
			1,1,butdown,
			0,0,0,0,0,
			0,0,0,0,0,
			msgbuff,0,0,&mx,&my,&ret,&ret,&keycode,&ret);

    if (event & MU_MESAG) {
    	wind_update(TRUE);
	switch (msgbuff[0]) {
	    case WM_REDRAW:
		do_redraw(msgbuff[4],msgbuff[5],msgbuff[6],msgbuff[7]);
		break;

	    case MN_SELECTED:
	        BEE_MOUSE;
		switch(msgbuff[3]) {
		    case MNDISK:
			switch (msgbuff[4]) {
			    case DIFORM:
		        	if ((needscan) && (rescan(0,0) == ERROR))	{
						break;	/* don't report medium changed */
					}
			        tformat = TRUE;
					needscan = FALSE;
			        dodiform();
			        tformat = FALSE;
			        break;
			    case DIPART:
		        	if ((needscan)&&(rescan(0,0) == ERROR))	{
						break;	/* don't report medium changed */
					}
					needscan = FALSE;
			        dodipart(-1, NULL, NULL);
			    	break;
			    case DIZERO:
					if (pnf)	{
						err(needboot);
					} else {
		        		if ((needscan)&&(rescan(0,1) == ERROR))	{
							break;	/* don't report medium changed */
						}
						needscan = FALSE;
			        	dodizero();
					}
			        break;
			    case DIMARK:
					if (pnf)	{
						err(needboot);
					} else {
		        		if ((needscan)&&(rescan(0,1) == ERROR))	{
							break;	/* don't report medium changed */
						}
						needscan = FALSE;
			        	dodimark();
					}
			        break;
			    case DISHIP:
		        	if ((needscan)&&(rescan(0,0) == ERROR))	{
						break;	/* don't report medium changed */
					}
					needscan = FALSE;
			        dodiship();
			        break;
			    default:	    break;
			}
			break;

		    case MNFILE:
			switch (msgbuff[4]) {
			    case FIQUIT:
				running = 0;
				break;

			    default:
				break;
			}
			break;
			
		    case MNDESK:
			if(msgbuff[4] == DEABOUT) {
			    strcpy(abtdial[ABVERSN].ob_spec, "Version 3.5");
			    abtdial[ABOK].ob_state = NORMAL;
			    execform(abtdial);
			}
			break;		/* "cannot happen" */
		}

		menu_tnormal(menuobj, msgbuff[3], 1);	/* back to normal */
	        ARROW_MOUSE;
		break;
		
	    case WM_NEWTOP:
	    case WM_TOPPED:
		wind_set(wi_handle, WF_TOP, 0, 0, 0, 0);
		break;

	    case WM_CLOSED:
		running = FALSE;
		break;

	    default:
		break;
	}
	wind_update(FALSE);
    }
}
Пример #16
0
AlsaOutputDeviceFactory::AlsaOutputDeviceFactory() {
	rescan();
}
// Constructor.
qtractorPluginSelectForm::qtractorPluginSelectForm (
	QWidget *pParent, Qt::WindowFlags wflags )
	: QDialog(pParent, wflags)
{
	// Setup UI struct...
	m_ui.setupUi(this);

	// Window modality (let plugin/tool windows rave around).
	QDialog::setWindowModality(Qt::WindowModal);

	m_pPluginList = NULL;

	// Populate plugin type hints...
	m_ui.PluginTypeComboBox->addItem(
		qtractorPluginType::textFromHint(qtractorPluginType::Any));
#ifdef CONFIG_LADSPA
	m_ui.PluginTypeComboBox->addItem(
		qtractorPluginType::textFromHint(qtractorPluginType::Ladspa));
#endif
#ifdef CONFIG_DSSI
	m_ui.PluginTypeComboBox->addItem(
		qtractorPluginType::textFromHint(qtractorPluginType::Dssi));
#endif
#ifdef CONFIG_VST
	m_ui.PluginTypeComboBox->addItem(
		qtractorPluginType::textFromHint(qtractorPluginType::Vst));
#endif
#ifdef CONFIG_LV2
	m_ui.PluginTypeComboBox->addItem(
		qtractorPluginType::textFromHint(qtractorPluginType::Lv2));
#endif

	QHeaderView *pHeader = m_ui.PluginListView->header();
//	pHeader->setDefaultSectionSize(240);
#if QT_VERSION >= 0x050000
//	pHeader->setSectionResizeMode(QHeaderView::Custom);
	pHeader->setSectionsMovable(false);
#else
//	pHeader->setResizeMode(QHeaderView::Custom);
	pHeader->setMovable(false);
#endif
	pHeader->setStretchLastSection(true);

	QTreeWidgetItem *pHeaderItem = m_ui.PluginListView->headerItem();
	pHeaderItem->setTextAlignment(0, Qt::AlignLeft);	// Name.
	pHeaderItem->setTextAlignment(5, Qt::AlignLeft);	// Filename.
	pHeaderItem->setTextAlignment(6, Qt::AlignLeft);	// Index.
	pHeaderItem->setTextAlignment(7, Qt::AlignLeft);	// Instances.
	pHeaderItem->setTextAlignment(8, Qt::AlignLeft);	// Type.

	pHeader->resizeSection(0, 240);						// Name.
	m_ui.PluginListView->resizeColumnToContents(1);		// Audio.
	m_ui.PluginListView->resizeColumnToContents(2);		// MIDI.
	m_ui.PluginListView->resizeColumnToContents(3);		// Controls.
	m_ui.PluginListView->resizeColumnToContents(4);		// Modes.
	pHeader->resizeSection(5, 120);						// Path.
	m_ui.PluginListView->resizeColumnToContents(6);		// Index
	m_ui.PluginListView->resizeColumnToContents(7);		// Instances

	m_ui.PluginListView->setSortingEnabled(true);
	m_ui.PluginListView->sortItems(0, Qt::AscendingOrder);

	m_ui.PluginScanProgressBar->setMaximum(100);
	m_ui.PluginScanProgressBar->hide();

	// Initialize conveniency options...
	qtractorOptions *pOptions = qtractorOptions::getInstance();
	if (pOptions) {
		pOptions->loadComboBoxHistory(m_ui.PluginSearchComboBox);
		m_ui.PluginSearchComboBox->setEditText(
			pOptions->sPluginSearch);
		m_ui.PluginTypeComboBox->setCurrentIndex(pOptions->iPluginType);
		m_ui.PluginActivateCheckBox->setChecked(pOptions->bPluginActivate);
	}

	// Let the search begin...
	m_ui.PluginSearchComboBox->setFocus();
	
	adjustSize();

	// Restore last seen dialog position and extent...
	if (pOptions)
		pOptions->loadWidgetGeometry(this, true);

	// UI signal/slot connections...
	QObject::connect(m_ui.PluginResetToolButton,
		SIGNAL(clicked()),
		SLOT(reset()));
	QObject::connect(m_ui.PluginSearchComboBox,
		SIGNAL(editTextChanged(const QString&)),
		SLOT(refresh()));
	QObject::connect(m_ui.PluginTypeComboBox,
		SIGNAL(activated(int)),
		SLOT(typeHintChanged(int)));
	QObject::connect(m_ui.PluginListView,
		SIGNAL(itemSelectionChanged()),
		SLOT(stabilize()));
//	QObject::connect(m_ui.PluginListView,
//		SIGNAL(itemActivated(QTreeWidgetItem *, int)),
//		SLOT(accept()));
	QObject::connect(m_ui.PluginListView,
		SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),
		SLOT(accept()));
	QObject::connect(m_ui.PluginActivateCheckBox,
		SIGNAL(clicked()),
		SLOT(stabilize()));
	QObject::connect(m_ui.PluginRescanPushButton,
		SIGNAL(clicked()),
		SLOT(rescan()));
	QObject::connect(m_ui.DialogButtonBox,
		SIGNAL(accepted()),
		SLOT(accept()));
	QObject::connect(m_ui.DialogButtonBox,
		SIGNAL(rejected()),
		SLOT(reject()));

	qtractorPluginFactory *pPluginFactory
		= qtractorPluginFactory::getInstance();
	if (pPluginFactory) {
		QObject::connect(pPluginFactory,
			SIGNAL(scanned(int)),
			SLOT(scanned(int)));
	}

	typeHintChanged(m_ui.PluginTypeComboBox->currentIndex());
}
Пример #18
0
 Busses::Busses(void)
 {
   usb_init();
   rescan();
 }
Пример #19
0
void DocumentListModel::setDocumentsFolder(const QString& newFolder)
{
    m_documentsFolder = newFolder;
    rescan();
}
Пример #20
0
CollectionWidget::CollectionWidget( QWidget* parent ):
        QWidget(parent)
{
    p = new CollectionWidgetPrivate;

    QPushButton *pushRandom =new QPushButton();
    QPixmap pixmap2(":shuffle.png");
    pushRandom->setIcon(QIcon(pixmap2));
    pushRandom->setIconSize(QSize(27,27));
    pushRandom->setMaximumWidth(40);
    pushRandom->setStyleSheet("QPushButton { border: none; padding: 0px; margin-left: 10px;max-height: 20px; margin-right: 4px;}");
    pushRandom->setToolTip(tr( "Random Tracks" ));

    p->searchEdit = new SearchEdit();
    p->searchEdit->setToolTip(tr( "Enter space-separated terms to filter collection" ));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    QWidget *headWidget = new QWidget(this);
    headWidget->setMaximumHeight(38);

    QHBoxLayout *headWidgetLayout = new QHBoxLayout;
    headWidgetLayout->setMargin(0);
    headWidgetLayout->setSpacing(1);

    headWidgetLayout->addSpacerItem(new QSpacerItem(10, 0, QSizePolicy::Fixed, QSizePolicy::Expanding));
    headWidgetLayout->addWidget(p->searchEdit);
    headWidgetLayout->addWidget(pushRandom);
    headWidget->setLayout(headWidgetLayout);

    p->updater = new CollectionUpdater();

    p->timer = new QTimer( this );
    p->timer->setInterval(300);
    p->timer->setSingleShot(true);

    p->collectiontree = new CollectionTree(this);
    p->modeSelect = new ModeSelector(p->collectiontree);

    headWidget->raise();
    mainLayout->addWidget(headWidget);

    mainLayout->setMargin(0);
    mainLayout->setSpacing(0);
 
    connect(pushRandom,SIGNAL(clicked()),
            p->collectiontree,SLOT(triggerRandomSelection()) );

    connect ( p->modeSelect , SIGNAL(modeChanged(ModeSelector::modeType)),
            this, SLOT(onModeSelected(ModeSelector::modeType)));

    connect( p->searchEdit, SIGNAL( textChanged( const QString& ) ),
             this,           SLOT( onSetFilterTimeout() ) );

    connect( p->searchEdit, SIGNAL( trackDropped(QString)),
             this,           SIGNAL( trackDropped(QString)) );

    connect( p->collectiontree, SIGNAL(selectionChanged(QList<Track*>)),
             this,           SIGNAL(selectionChanged(QList<Track*>)));

    connect( p->collectiontree, SIGNAL(wantLoad(QList<Track*>,QString)),
             this,           SIGNAL(wantLoad(QList<Track*>,QString)));

    connect( p->updater, SIGNAL(changesDone()), p->collectiontree, SLOT(createTrunk()));
    connect( p->collectiontree, SIGNAL(rescan()), p->updater, SLOT(scan()));

    connect( p->timer, SIGNAL(timeout()), SLOT(onSetFilter())  );

    setFocusProxy( p->collectiontree ); //default object to get focus
    setMaximumWidth(400);

    //Pogressbar for re-read collection
    p->progress = new ProgressBar(this);
    p->progress->setValue(0);
    p->progress->setStyleSheet("* { margin-bottom: 3px; }");

    mainLayout->addWidget(p->collectiontree);


    // Read config values
    QSettings settings;
    p->modeSelect->setMode( static_cast<ModeSelector::modeType>(settings.value("TreeMode",ModeSelector::MODENONE).toUInt()));


    p->collectiontree->createTrunk();
    setLayout(mainLayout);

    connect(p->updater, SIGNAL(progressChanged(int)), p->progress,SLOT(setValue(int)));
    connect(p->progress, SIGNAL(stopped()), p->updater,SLOT(stop()));
    p->modeSelect->show();
}