Exemplo n.º 1
0
void MainWindow::show() {
    if (m_updatePropertiesNeeded) {
        plugActionList(m_actionListName.latin1(), m_insertedActions);
        m_updatePropertiesNeeded=false;
        //FIXME: ugly hack: at this point, the m_toolbar has not been changed,
        // so if call adjustSize here will take no effect
        // This is a work around although may be not feasible in some old/slow
        // or heavily loaded machines. IMPROVEMENT for this work around: implement
        // a check in adjustSize, if 100 ms is not long enough, just start
        // another singleShot
        if(isUpdatesEnabled())
            QTimer::singleShot( 100, this, SLOT( adjustSize() ) );
    }

//     if(isUpdatesEnabled())
    {
        if(m_mode == StandAlone && m_autoHideTimeoutTimer)
        {
            m_autoHideTimeoutTimer->stop();
            m_toolbar->show();
            m_moveHandle->show();
            m_logo->hide();
        }

        QFrame::show();

        //adjustSize immediately is not useful here, so we schedule
        //an adjustSize after all the events in the queue are processed
        QTimer::singleShot( 0, this, SLOT( adjustSize() ) );
    }
    m_contentIsVisible = true;
}
Exemplo n.º 2
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());
 }
Exemplo n.º 3
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());
 }
Exemplo n.º 4
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 );
}
Exemplo n.º 5
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());
    }
Exemplo n.º 6
0
void MainWindow::slotNewToolbarConfig() // This is called when OK or Apply is clicked
{
    // ...if you use any action list, use plugActionList on each here...
    createGUI("basketui.rc"); // TODO: Reconnect tags menu aboutToShow() ??
    if (!Global::bnpView->isPart())
        Global::bnpView->connectTagsMenu(); // The Tags menu was created again!
    // TODO: Does this do anything?
    plugActionList(QString::fromLatin1("go_baskets_list"), actBasketsList);
    KConfigGroup group = KGlobal::config()->group(autoSaveGroup());
    applyMainWindowSettings(group);
}
Exemplo n.º 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());
    }
Exemplo n.º 8
0
  void GUIClient::updateActions()
  {
    if ( !factory() )
      return;

    unplugActionList( actionListName );

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

    plugActionList( actionListName, addList );
  }
Exemplo n.º 9
0
 void GUI::activePartChanged(KParts::Part* p)
 {
     unplugActionList("activities_list");
     createGUI(p);
     plugActionList("activities_list", central->activitySwitchingActions());
 }
Exemplo n.º 10
0
void SimonView::updateActionList()
{
  unplugActionList("command_actionlist");
  plugActionList("command_actionlist", ScenarioManager::getInstance()->getCurrentScenario()->actionCollection()->getGuiActions());
}