Exemple #1
0
int PLModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QAbstractItemModel::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: currentChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 1: rootChanged(); break;
        case 2: activateItem((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 3: activateItem((*reinterpret_cast< playlist_item_t*(*)>(_a[1]))); break;
        case 4: popupPlay(); break;
        case 5: popupDel(); break;
        case 6: popupInfo(); break;
        case 7: popupStream(); break;
        case 8: popupSave(); break;
        case 9: popupExplore(); break;
        case 10: popupAddNode(); break;
        case 11: popupSort((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 12: processInputItemUpdate((*reinterpret_cast< input_item_t*(*)>(_a[1]))); break;
        case 13: processInputItemUpdate((*reinterpret_cast< input_thread_t*(*)>(_a[1]))); break;
        case 14: processItemRemoval((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 15: processItemAppend((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        default: ;
        }
        _id -= 16;
    }
    return _id;
}
void QxrdFileBrowserModel::setRootPath(QString path)
{
  QcepMutexLocker lock(__FILE__, __LINE__, &m_Mutex);

  m_RootPath = path;

  updateModel();

  emit rootChanged(m_RootPath);
}
Exemple #3
0
RKVarSelector::RKVarSelector (const QDomElement &element, RKComponent *parent_component, QWidget *parent_widget) : RKComponent (parent_component, parent_widget) {
	RK_TRACE (PLUGIN);

	XMLHelper *xml = parent_component->xmlHelper ();

// TODO: read filter settings
	addChild ("selected", selected = new RKComponentPropertyRObjects (this, false));
	selected->setInternal (true);
	addChild ("root", root = new RKComponentPropertyRObjects (this, false));
	connect (root, SIGNAL (valueChanged(RKComponentPropertyBase*)), this, SLOT (rootChanged()));
	root->setInternal (true);

	QVBoxLayout *vbox = new QVBoxLayout (this);
	vbox->setContentsMargins (0, 0, 0, 0);

	QHBoxLayout *hbox = new QHBoxLayout ();
	hbox->setContentsMargins (0, 0, 0, 0);
	vbox->addLayout (hbox);
	QLabel *label = new QLabel (xml->i18nStringAttribute (element, "label", i18n ("Select Variable(s)"), DL_INFO), this);
	hbox->addWidget (label);
	QToolButton *advanced_button = new QToolButton (this);
	advanced_button->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionConfigureGeneric));
	advanced_button->setPopupMode (QToolButton::InstantPopup);
	advanced_button->setAutoRaise (true);
	hbox->addWidget (advanced_button);

	// TODO: Or should these actions be moved to RKObjectListView, non-tool-window-mode?
	show_all_envs_action = new QAction (i18n ("Show all environments"), this);
	show_all_envs_action->setCheckable (true);
	show_all_envs_action->setToolTip (i18n ("Show objects in all environments on the <i>search()</i> path, instead of just those in <i>.GlobalEnv</i>. Check this, if you want to select objects from a loaded package."));
	connect (show_all_envs_action, SIGNAL (toggled(bool)), this, SLOT (rootChanged()));

	filter_widget = 0;
	filter_widget_placeholder = new QVBoxLayout (this);
	filter_widget_placeholder->setContentsMargins (0, 0, 0, 0);
	vbox->addLayout (filter_widget_placeholder);
	show_filter_action = new QAction (i18n ("Show filter options"), this);
	show_filter_action->setCheckable (true);
	show_filter_action->setShortcut (QKeySequence ("Ctrl+F"));
	show_filter_action->setIcon (RKStandardIcons::getIcon (RKStandardIcons::ActionSearch));
	connect (show_filter_action, SIGNAL (toggled(bool)), this, SLOT(showFilterWidget()));

	list_view = new RKObjectListView (false, this);
	list_view->setSelectionMode (QAbstractItemView::ExtendedSelection);
	list_view->initialize ();
	vbox->addWidget (list_view);
	connect (list_view, SIGNAL (selectionChanged()), this, SLOT (objectSelectionChanged()));

	QAction* sep = list_view->contextMenu ()->insertSeparator (list_view->contextMenu ()->actions ().value (0));
	list_view->contextMenu ()->insertAction (sep, show_filter_action);
	list_view->contextMenu ()->insertAction (sep, show_all_envs_action);
	advanced_button->setMenu (list_view->contextMenu ());

	rootChanged ();
}
Exemple #4
0
void PaperManager::setRoot(int id)
{
    if( p->root == id && p->root != 0)
        return;

    p->root = id;

    switch( p->type )
    {
    case Clean:
        p->papers.clear();
        break;

    case All:
        p->papers = Papyrus::database()->papers();
        break;

    case Search:
        p->papers.clear();
        if( p->keyword.isEmpty() )
            break;

        p->papers = Papyrus::database()->search(p->keyword);
        break;

    case AdvanceSearch:
        p->papers.clear();
        p->papers = Papyrus::database()->advanceSearch(p->advsearch_keyword, p->advsearch_startDate,
                                                     p->advsearch_endDate, p->advsearch_startTime,
                                                     p->advsearch_endTime, p->advsearch_group,
                                                     p->advsearch_domain , p->advsearch_geo,
                                                     p->advsearch_weather);
        break;

    case Date:
        p->papers = Papyrus::database()->papersOf( AsemanCalendarConverter::convertDaysToDate(id) );
        break;

    case Group:
        p->papers = Papyrus::database()->papersOf(id);
        qSort( p->papers.begin(), p->papers.end(), actionLessThan );
        break;
    }

    init_buffer();
    for( int i=0; i<BUFFER_SIZE && i<p->papers.length(); i++ )
        p->buffer[i]->setProperty( "paperItem", p->papers[i] );

    p->current = 0;
    emit rootChanged();
    emit currentPaperChanged();
    emit papersChanged();
    emit currentIndexChanged();
}
Exemple #5
0
/*!
 * \copydoc MythUIType::Reset()
 */
void MythUIButtonTree::Reset(void)
{
    m_rootNode = m_currentNode = NULL;
    m_visibleLists = 0;
    m_currentDepth = m_oldDepth = 0;
    m_activeList = NULL;
    m_activeListID = 0;
    m_active = true;

    SetTreeState(true);
    emit rootChanged(m_rootNode);

    MythUIType::Reset();
}
Exemple #6
0
/*!
 * \brief Assign the root node of the tree to be displayed
 *
 * MythUIButtonTree() is merely responsible for the display and navigation of a
 * tree, the structure of that tree and the data it contains are the
 * responsibility of MythGenericTree(). Generally MythUIButtonTree() will not
 * modify the tree, for technical reason RemoteItem() is an exception to the rule.
 *
 * You should operate directly on MythGenericTree() to change it's content.
 *
 * \param tree The node to make the root of the displayed tree
 *
 * \return True if successful
 */
bool MythUIButtonTree::AssignTree(MythGenericTree *tree)
{
    if (!tree || !tree->visibleChildCount())
        return false;

    if (m_rootNode)
        Reset();

    m_rootNode = tree;
    m_currentNode = m_rootNode->getSelectedChild();
    // The node we are given may not be the root node of that tree, we need
    // to keep track of our depth in the tree so that we can navigate
    // as though the parent nodes do not exist
    m_depthOffset = m_rootNode->currentDepth();
    SetTreeState(true);
    emit rootChanged(m_rootNode);

    return true;
}
StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
                                  intf_thread_t *_p_intf,
                                  playlist_item_t *p_root,
                                  PLSelector *_p_selector,
                                  PLModel *_p_model,
                                  MLModel *_p_plmodel)
                : QWidget( _parent ),
                  model( _p_model ),
                  mlmodel( _p_plmodel),
                  p_intf( _p_intf ),
                  p_selector( _p_selector )
{
    viewStack = new QStackedLayout( this );
    viewStack->setSpacing( 0 ); viewStack->setMargin( 0 );
    setMinimumWidth( 300 );

    iconView    = NULL;
    treeView    = NULL;
    listView    = NULL;
    picFlowView = NULL;

    currentRootIndexId  = -1;
    lastActivatedId     = -1;

    /* Saved Settings */
    int i_savedViewMode = getSettings()->value( "Playlist/view-mode", TREE_VIEW ).toInt();
    showView( i_savedViewMode );

    DCONNECT( THEMIM, leafBecameParent( int ),
              this, browseInto( int ) );

    CONNECT( model, currentChanged( const QModelIndex& ),
             this, handleExpansion( const QModelIndex& ) );
    CONNECT( model, rootChanged(), this, browseInto() );

    setRoot( p_root, false );
}
void StatusRootAction::init()
{
	Kopete::StatusManager *statusManager = Kopete::StatusManager::self();
	connect( statusManager, SIGNAL(changed()), this, SLOT(rootChanged()) );
	d->group = statusManager->getRootGroup();

	connect( d->group, SIGNAL(childRemoved(Kopete::Status::StatusItem*)),
	         this, SLOT(childRemoved(Kopete::Status::StatusItem*)) );
	connect( d->group, SIGNAL(childInserted(int,Kopete::Status::StatusItem*)),
	         this, SLOT(childInserted(int,Kopete::Status::StatusItem*)) );

	foreach( Kopete::Status::StatusItem* child, d->group->childList() )
		insertChild( d->insertBefore, child );

	d->statusSeparator = d->menu->insertSeparator( d->insertBefore );

	QAction *statusAction = new QAction( i18n( "Edit Message..." ), this );
	connect (statusAction, SIGNAL(triggered(bool)), this, SLOT(showEditStatusDialog()) );
	d->menu->insertAction( d->insertBefore, statusAction );

	QAction *action = new QAction( i18n("Edit Statuses..."), this );
	connect( action, SIGNAL(triggered(bool)), this, SLOT(editStatuses()) );
	d->menu->insertAction( d->insertBefore, action );
}
Exemple #9
0
StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
                                  intf_thread_t *_p_intf,
                                  playlist_t *p_playlist,
                                  playlist_item_t *p_root ):
                                  QWidget( _parent ), p_intf( _p_intf )
{
    layout = new QGridLayout( this );
    layout->setSpacing( 0 ); layout->setMargin( 0 );
    setMinimumWidth( 300 );

    iconView = NULL;
    treeView = NULL;
    listView = NULL;
    viewStack = new QStackedLayout();
    layout->addLayout( viewStack, 1, 0, 1, -1 );

    model = new PLModel( p_playlist, p_intf, p_root, this );
    currentRootId = -1;
    currentRootIndexId = -1;
    lastActivatedId = -1;

    locationBar = new LocationBar( model );
    locationBar->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Preferred );
    layout->addWidget( locationBar, 0, 0 );
    layout->setColumnStretch( 0, 5 );
    CONNECT( locationBar, invoked( const QModelIndex & ),
             this, browseInto( const QModelIndex & ) );

    searchEdit = new SearchLineEdit( this );
    searchEdit->setMaximumWidth( 250 );
    searchEdit->setMinimumWidth( 80 );
    layout->addWidget( searchEdit, 0, 2 );
    CONNECT( searchEdit, textChanged( const QString& ),
             this, search( const QString& ) );
    layout->setColumnStretch( 2, 3 );

    /* Button to switch views */
    QToolButton *viewButton = new QToolButton( this );
    viewButton->setIcon( style()->standardIcon( QStyle::SP_FileDialogDetailedView ) );
    viewButton->setToolTip( qtr("Change playlistview"));
    layout->addWidget( viewButton, 0, 1 );

    /* View selection menu */
    viewSelectionMapper = new QSignalMapper( this );
    CONNECT( viewSelectionMapper, mapped( int ), this, showView( int ) );

    QActionGroup *actionGroup = new QActionGroup( this );

    for( int i = 0; i < VIEW_COUNT; i++ )
    {
        viewActions[i] = actionGroup->addAction( viewNames[i] );
        viewActions[i]->setCheckable( true );
        viewSelectionMapper->setMapping( viewActions[i], i );
        CONNECT( viewActions[i], triggered(), viewSelectionMapper, map() );
    }

    BUTTONACT( viewButton, cycleViews() );
    QMenu *viewMenu = new QMenu( this );
    viewMenu->addActions( actionGroup->actions() );

    viewButton->setMenu( viewMenu );

    /* Saved Settings */
    getSettings()->beginGroup("Playlist");

    int i_viewMode = getSettings()->value( "view-mode", TREE_VIEW ).toInt();

    getSettings()->endGroup();

    showView( i_viewMode );

    DCONNECT( THEMIM, leafBecameParent( input_item_t *),
              this, browseInto( input_item_t * ) );

    CONNECT( model, currentChanged( const QModelIndex& ),
             this, handleExpansion( const QModelIndex& ) );
    CONNECT( model, rootChanged(), this, handleRootChange() );
}