Пример #1
0
void MainWindow::emptyToolbar(bool isFrontEndProperties)
{
    if(isFrontEndProperties)
        unplugActionList(ACTIONLIST_FRONTEND);
    else
        unplugActionList(ACTIONLIST_GUI);
}
Пример #2
0
void MainWindow::updateProperties (bool isFrontEndProperties) {
    KActionPtrList exta = isFrontEndProperties ?
            m_defaultActionCollection->frontendPropertyActions() : m_defaultActionCollection->guiPropertyActions();
    m_actionListName = isFrontEndProperties ? ACTIONLIST_FRONTEND : ACTIONLIST_GUI;

    m_insertedActions.clear();
    for(uint i=0; i<exta.size(); i++) {
        bool visible = true;
        if(ScimAction * action = dynamic_cast<ScimAction *>(exta[i])){
            if(!action->visible() || !action->currentShown())
                visible = false;
        }
        if(visible)
            m_insertedActions.append(exta[i]);
    }

    if(m_insertedActions.count())
        m_updatePropertiesNeeded = true;

    unplugActionList(m_actionListName);

    if(m_updatePropertiesNeeded && m_contentIsVisible)
        show();

    //FIXME: see the FIXME in MainWindow::show()
    if(isVisible())
        QTimer::singleShot( 100, this, SLOT( adjustSize() ) );
}
Пример #3
0
 void GUI::removeActivity(Activity* act)
 {
     unplugActionList("activities_list");
     central->removeActivity(act);
     if (act->part())
         part_manager->removePart(act->part());
     plugActionList("activities_list", central->activitySwitchingActions());
 }
Пример #4
0
 void GUI::addActivity(Activity* act)
 {
     unplugActionList("activities_list");
     central->addActivity(act);
     if (act->part())
         part_manager->addPart(act->part(), false);
     plugActionList("activities_list", central->activitySwitchingActions());
 }
Пример #5
0
void MainWindow::updateProfileActions()
{
    qDeleteAll( m_selectProfileActions );
    m_selectProfileActions.clear();
    qDeleteAll( m_editProfileActions );
    m_editProfileActions.clear();
    qDeleteAll( m_deleteProfileActions );
    m_deleteProfileActions.clear();

    QList<Profile*>::ConstIterator it = m_profiles.constBegin();
    QList<Profile*>::ConstIterator end = m_profiles.constEnd();
    while ( it != end ) {
        Profile* profile = *it;
        ++it;

        QString name = profile->name();

        KAction* selectProfileAction = new KAction( name, 0 );
        connect( selectProfileAction, SIGNAL(triggered()),
                 m_selectProfileSignalMapper, SLOT(map()) );
        m_selectProfileSignalMapper->setMapping( selectProfileAction, profile );
        m_selectProfileActions << selectProfileAction;

        KAction* editProfileAction = new KAction( name, 0 );
        connect( editProfileAction, SIGNAL(triggered()),
                 m_editProfileSignalMapper, SLOT(map()) );
        m_editProfileSignalMapper->setMapping( editProfileAction, profile );
        m_editProfileActions << editProfileAction;

        KAction* deleteProfileAction = new KAction( name, 0 );
        connect( deleteProfileAction, SIGNAL(triggered()),
                 m_deleteProfileSignalMapper, SLOT(map()) );
        m_deleteProfileSignalMapper->setMapping( deleteProfileAction, profile );
        m_deleteProfileActions << deleteProfileAction;
    }

    unplugActionList( "select_profiles" );
    plugActionList( "select_profiles", m_selectProfileActions );
    unplugActionList( "edit_profiles" );
    plugActionList( "edit_profiles", m_editProfileActions );
    unplugActionList( "delete_profiles" );
    plugActionList( "delete_profiles", m_deleteProfileActions );
}
Пример #6
0
    void GUI::configureToolbars()
    {
        saveMainWindowSettings(KGlobal::config()->group("MainWindow"));
        KEditToolBar dlg(factory());
        connect(&dlg, SIGNAL(newToolBarConfig()), this, SLOT(newToolBarConfig()));
        dlg.exec();

        // Replug action list
        unplugActionList("activities_list");
        plugActionList("activities_list", central->activitySwitchingActions());
    }
Пример #7
0
    void GUI::configureToolbars()
    {
        //KF5 saveMainWindowSettings(KSharedConfig::openConfig()->group("MainWindow"));
        KEditToolBar dlg(factory());
        connect(&dlg, &KEditToolBar::newToolBarConfig, this, &GUI::newToolBarConfig);
        dlg.exec();

        // Replug action list
        unplugActionList("activities_list");
        plugActionList("activities_list", central->activitySwitchingActions());
    }
Пример #8
0
  void GUIClient::updateActions()
  {
    if ( !factory() )
      return;

    unplugActionList( actionListName );

    QList<QAction*> addList;
    addList.append(m_toolMenu);

    plugActionList( actionListName, addList );
  }
Пример #9
0
 void GUI::activePartChanged(KParts::Part* p)
 {
     unplugActionList("activities_list");
     createGUI(p);
     plugActionList("activities_list", central->activitySwitchingActions());
 }
Пример #10
0
void SimonView::updateActionList()
{
  unplugActionList("command_actionlist");
  plugActionList("command_actionlist", ScenarioManager::getInstance()->getCurrentScenario()->actionCollection()->getGuiActions());
}