[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevplatform
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2009-11-16 20:53:11
Message-ID: 1258404791.667316.19439.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1050195 by apaku:

Revert the progress-indicator-on-toolviews patch, it doesn't work
correctly and I won't have time to fix it up. So better leave this nice
feature for 4.1.
BUG:214842

 M  +0 -17     interfaces/iuicontroller.h  
 M  +0 -25     plugins/projectmanagerview/projectmanagerview.cpp  
 M  +0 -5      plugins/projectmanagerview/projectmanagerview.h  
 M  +1 -27     plugins/projectmanagerview/projectmanagerviewplugin.cpp  
 M  +0 -6      plugins/projectmanagerview/projectmanagerviewplugin.h  
 M  +0 -6      shell/uicontroller.cpp  
 M  +3 -31     sublime/ideal.cpp  
 M  +1 -9      sublime/ideal.h  
 M  +0 -10     sublime/tooldocument.cpp  
 M  +0 -6      sublime/tooldocument.h  
 M  +0 -20     sublime/view.cpp  
 M  +0 -29     sublime/view.h  


--- trunk/KDE/kdevplatform/interfaces/iuicontroller.h #1050194:1050195
@@ -74,23 +74,6 @@
      * @param view the new sublime view that is being shown
      */
     virtual void viewCreated(Sublime::View* view);
-    
-    /**
-     * Allows a factory to indicate that the widgets created by it 
-     * want to have a progress-indicator shown over the toolview icon
-     * when they execute some long-running action.
-     *
-     * To show the indicator the widget created from create() can
-     * emit the showProgressIndicator() signal. To hide it again it 
-     * should emit the hideProgressIndicator() signal.
-     * 
-     * The default return value is false, indicating that no progress 
-     * indicator will be used.
-     *
-     * @returns true if the toolviews created by this factory want to have a 
-     * progress indicator.
-     */
-    virtual bool viewsWantProgressIndicator() const { return false; }
 };
 
 /**
--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projectmanagerview.cpp \
#1050194:1050195 @@ -22,7 +22,6 @@
 #include "projectmanagerview.h"
 
 #include <QtCore/QDebug>
-#include <QtCore/QTimer>
 #include <QtGui/QHeaderView>
 #include <QtGui/QVBoxLayout>
 #include <QtGui/QHBoxLayout>
@@ -113,33 +112,9 @@
              SLOT(updateSyncAction()));
     connect( KDevelop::ICore::self()->documentController(), \
SIGNAL(documentOpened(KDevelop::IDocument*) ),  SLOT(updateSyncAction()));
-             
-    connect( KDevelop::ICore::self()->projectController(), \
                SIGNAL(projectAboutToBeOpened(KDevelop::IProject*)),
-             SLOT(projectToBeOpened()) );
-    connect( KDevelop::ICore::self()->projectController(), \
                SIGNAL(projectOpened(KDevelop::IProject*)),
-             SLOT(projectOpened()) );
     selectionChanged();
-    // Update the progress-state, but do so in a second so we
-    // can be sure the button has been created
-    QTimer::singleShot( 1000, this, SLOT(projectToBeOpened()) );
 }
 
-void ProjectManagerView::projectOpened()
-{
-    if( m_plugin->numProjectsBeingOpened() == 0 )
-    {
-        emit hideProgressIndicator();
-    }
-}
-
-void ProjectManagerView::projectToBeOpened()
-{
-    if( m_plugin->numProjectsBeingOpened() != 0 )
-    {
-        emit showProgressIndicator();
-    }
-}
-
 void ProjectManagerView::selectionChanged()
 {
     m_ui->buildSetView->selectionChanged();
--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projectmanagerview.h \
#1050194:1050195 @@ -49,9 +49,6 @@
 
     ProjectManagerViewPlugin* plugin() const { return m_plugin; }
     QList<KDevelop::ProjectBaseItem*> selectedItems() const;
-signals:
-    void showProgressIndicator();
-    void hideProgressIndicator();
 private slots:
     void selectionChanged();
     void locateCurrentDocument();
@@ -60,8 +57,6 @@
     void fileCreated( const QString & );
     void fileDirty( const QString & );
     void fileDeleted( const QString & );
-    void projectToBeOpened();
-    void projectOpened();
 
 private:
     KAction* m_syncAction;
--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projectmanagerviewplugin.cpp \
#1050194:1050195 @@ -74,11 +74,6 @@
             return "org.kdevelop.ProjectsView";
         }
         
-        virtual bool viewsWantProgressIndicator() const 
-        {
-            return true;
-        }
-
     private:
         ProjectManagerViewPlugin *mplugin;
 };
@@ -99,14 +94,8 @@
 };
 
 ProjectManagerViewPlugin::ProjectManagerViewPlugin( QObject *parent, const \
                QVariantList& )
-        : IPlugin( ProjectManagerFactory::componentData(), parent ), d(new \
                ProjectManagerViewPluginPrivate),
-        projectsBeingOpened( 0 )
+        : IPlugin( ProjectManagerFactory::componentData(), parent ), d(new \
ProjectManagerViewPluginPrivate)  {
-    connect( core()->projectController(), SIGNAL( projectAboutToBeOpened( \
                KDevelop::IProject* ) ),
-             SLOT( projectToBeOpened() ) );
-    connect( core()->projectController(), SIGNAL( projectOpened( KDevelop::IProject* \
                ) ),
-             SLOT( projectOpened() ) );
-    
     d->m_buildAll = new KAction( i18n("Build all Projects"), this );
     d->m_buildAll->setIcon(KIcon("run-build"));
     connect( d->m_buildAll, SIGNAL(triggered()), this, SLOT(buildAllProjects()) );
@@ -150,21 +139,6 @@
              SLOT(updateFromBuildSetChange()));
 }
 
-void ProjectManagerViewPlugin::projectToBeOpened()
-{
-    projectsBeingOpened++;
-}
-
-void ProjectManagerViewPlugin::projectOpened()
-{
-    projectsBeingOpened--;
-}
-
-int ProjectManagerViewPlugin::numProjectsBeingOpened()
-{
-    return projectsBeingOpened;
-}
-
 void ProjectManagerViewPlugin::updateFromBuildSetChange()
 {
     updateActionState( core()->selectionController()->currentSelection() );
--- trunk/KDE/kdevplatform/plugins/projectmanagerview/projectmanagerviewplugin.h \
#1050194:1050195 @@ -56,8 +56,6 @@
     virtual void unload();
 
     KDevelop::ContextMenuExtension contextMenuExtension( KDevelop::Context* );
-
-    int numProjectsBeingOpened();
 public Q_SLOTS:
     void buildProjectItems();
     void installProjectItems();
@@ -83,15 +81,11 @@
     void removeFileFromContextMenu();
     void updateActionState( KDevelop::Context* ctx );
     void updateFromBuildSetChange();
-    void projectToBeOpened();
-    void projectOpened();
 private:
     static KDevelop::IProjectBuilder* getProjectBuilder( KDevelop::ProjectBaseItem* \
                item );
     QList<KDevelop::ProjectBaseItem*> recurseAndFetchCheckedItems( \
KDevelop::ProjectBaseItem* item );  void runBuilderJob( \
KDevelop::BuilderJob::BuildType );  class ProjectManagerViewPluginPrivate* const d;
-    int projectsBeingOpened;
-
 };
 
 #endif
--- trunk/KDE/kdevplatform/shell/uicontroller.cpp #1050194:1050195
@@ -157,12 +157,6 @@
     }
 
     QString id() const { return m_factory->id(); }
-    
-    bool viewsWantProgressIndicator() const 
-    {
-            return m_factory->viewsWantProgressIndicator();
-    }
-
 private:
     IToolViewFactory *m_factory;
 };
--- trunk/KDE/kdevplatform/sublime/ideal.cpp #1050194:1050195
@@ -42,14 +42,13 @@
 using namespace Sublime;
 
 IdealToolButton::IdealToolButton(Qt::DockWidgetArea area, QWidget *parent)
-    : KAnimatedButton(parent), _area(area), showingIndicator( false )
+    : QToolButton(parent), _area(area)
 {
     setFocusPolicy(Qt::NoFocus);
     KAcceleratorManager::setNoAccel(this);
     setCheckable(true);
     setAutoRaise(true);
     setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
-    setIcons( "process-working-kde" );
 
     setContextMenuPolicy(Qt::CustomContextMenu);
 }
@@ -62,29 +61,6 @@
     return Qt::Horizontal;
 }
 
-void IdealToolButton::hideProgressIndicator()
-{
-    stop();
-    setIcon( normalIcon );
-    showingIndicator = false;
-}
-
-void IdealToolButton::showProgressIndicator()
-{
-    setIcons( "process-working-kde" );
-    showingIndicator = true;
-    start();
-}
-
-void IdealToolButton::updateNormalIcon( const QIcon& icon )
-{
-    normalIcon = icon;
-    if( !showingIndicator )
-    {
-        setIcon( icon );
-    }
-}
-
 QSize IdealToolButton::sizeHint() const
 {
     ensurePolished();
@@ -223,8 +199,6 @@
 
 void IdealButtonBarWidget::removeAction(QAction * action)
 {
-    disconnect(_widgets[action]->view(), SIGNAL(showProgressIndicator()), \
                _buttons[action], 0);
-    disconnect(_widgets[action]->view(), SIGNAL(hideProgressIndicator()), \
_buttons[action], 0);  _widgets.remove(action);
     delete _buttons.take(action);
     delete action;
@@ -292,7 +266,7 @@
             _buttons.insert(action, button);
 
             button->setText(action->text());
-            button->updateNormalIcon(action->icon());
+            button->setIcon(action->icon());
             button->setShortcut(QKeySequence());
             button->setChecked(action->isChecked());
 
@@ -302,8 +276,6 @@
             layout()->addWidget(button);
             connect(action, SIGNAL(toggled(bool)), SLOT(actionToggled(bool)));
             connect(button, SIGNAL(toggled(bool)), action, SLOT(setChecked(bool)));
-            connect(_widgets[action]->view(), SIGNAL(showProgressIndicator()), \
                button, SLOT(showProgressIndicator()));
-            connect(_widgets[action]->view(), SIGNAL(hideProgressIndicator()), \
button, SLOT(hideProgressIndicator()));  connect(button, \
                SIGNAL(customContextMenuRequested(QPoint)),
                     _widgets[action], SLOT(contextMenuRequested(QPoint)));
         }
@@ -327,7 +299,7 @@
     case QEvent::ActionChanged: {
         if (IdealToolButton *button = _buttons.value(action)) {
             button->setText(action->text());
-            button->updateNormalIcon(action->icon());
+            button->setIcon(action->icon());
             button->setShortcut(QKeySequence());
             Q_ASSERT(_widgets.contains(action));
             _widgets[action]->setWindowTitle(action->text());
--- trunk/KDE/kdevplatform/sublime/ideal.h #1050194:1050195
@@ -28,8 +28,6 @@
 #include <QtGui/QDockWidget>
 #include <QtGui/QStyleOption>
 
-#include <kanimatedbutton.h>
-
 #include "ideallayout.h"
 #include "sublimedefs.h"
 
@@ -44,7 +42,7 @@
 class View;
 class MainWindow;
 
-class IdealToolButton: public KAnimatedButton
+class IdealToolButton: public QToolButton
 {
     Q_OBJECT
 
@@ -54,18 +52,12 @@
     Qt::Orientation orientation() const;
 
     virtual QSize sizeHint() const;
-    void updateNormalIcon( const QIcon& );
 
 protected:
     virtual void paintEvent(QPaintEvent *event);
 
-private slots:
-    virtual void showProgressIndicator();
-    virtual void hideProgressIndicator();
 private:
     Qt::DockWidgetArea _area;
-    QIcon normalIcon;
-    bool showingIndicator;
 };
 
 class IdealButtonBarWidget: public QWidget
--- trunk/KDE/kdevplatform/sublime/tooldocument.cpp #1050194:1050195
@@ -22,8 +22,6 @@
 
 #include <kdebug.h>
 
-#include <view.h>
-
 namespace Sublime {
 
 // struct ToolDocumentPrivate
@@ -72,13 +70,5 @@
     return factory()->id();
 }
 
-
-View* ToolDocument::newView(Document* doc)
-{
-    emit viewNumberChanged(this);
-    return new ToolView(doc);
 }
 
-
-}
-
--- trunk/KDE/kdevplatform/sublime/tooldocument.h #1050194:1050195
@@ -40,7 +40,6 @@
     virtual QWidget* create(ToolDocument *doc, QWidget *parent = 0) = 0;
     virtual QList<QAction*> toolBarActions( QWidget* viewWidget ) const = 0;
     virtual QString id() const = 0;
-    virtual bool viewsWantProgressIndicator() const = 0;
 };
 
 /**
@@ -78,16 +77,11 @@
 protected:
     virtual QWidget *createViewWidget(QWidget *parent = 0);
     ToolFactory *factory() const;
-    
-    /**Creates and returns the new view. Reimplement in subclasses to instantiate
-    views of derived from Sublime::View classes.*/
-    virtual View *newView(Document *doc);
 
 private:
     struct ToolDocumentPrivate * const d;
     
     friend class View;
-    friend class ToolView;
 };
 
 }
--- trunk/KDE/kdevplatform/sublime/view.cpp #1050194:1050195
@@ -130,26 +130,6 @@
     emit positionChanged(this, newPositionInArea);
 }
 
-
-ToolView::ToolView(Document* doc, View::WidgetOwnership ws)
-    : View( doc, ws )
-{
 }
 
-
-QWidget* ToolView::createWidget(QWidget* parent)
-{
-    QWidget* w = Sublime::View::createWidget(parent);
-    ToolDocument* tooldoc = dynamic_cast<ToolDocument*>( document() );
-    if( tooldoc->factory()->viewsWantProgressIndicator() ) 
-    {
-        connect( w, SIGNAL( showProgressIndicator() ), SIGNAL( \
                showProgressIndicator() ) );
-        connect( w, SIGNAL( hideProgressIndicator() ), SIGNAL( \
                hideProgressIndicator() ) );
-    }
-    return w;
-}
-
-
-}
-
 #include "view.moc"
--- trunk/KDE/kdevplatform/sublime/view.h #1050194:1050195
@@ -100,35 +100,6 @@
     friend class Document;
 };
 
-/**
- * Special type of view for the toolviews
- */
-class SUBLIME_EXPORT ToolView: public View {
-    Q_OBJECT
-Q_SIGNALS:
-    /**
-     * Forwarding signal, emitted when the view's widget
-     * wants to have a progress indicator shown.
-     */
-    void showProgressIndicator();
-    
-    /**
-    * Forwarding signal, emitted when the view's widget
-    * wants to hide the progress indicator again.
-    */
-    void hideProgressIndicator();
-protected:
-    ToolView(Document *doc, View::WidgetOwnership ws = View::DoNotTakeOwnerShip );
-    /**
-    * override this function to create a custom widget in your View subclass
-    * @param parent the parent widget
-    * @returns a new widget which is used for this view
-    */
-    virtual QWidget *createWidget(QWidget *parent);
-private:
-    ToolView( const ToolView& );
-    friend class ToolDocument;
-};
 }
 
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic