ginebra2/RecentUrlToolbarSnippet.cpp
changeset 15 73c48011b8c7
parent 6 1c3b8676e58c
equal deleted inserted replaced
13:491a1d15372f 15:73c48011b8c7
    23 
    23 
    24 #include "RecentUrlToolbarSnippet.h"
    24 #include "RecentUrlToolbarSnippet.h"
    25 #include "ToolbarChromeItem.h"
    25 #include "ToolbarChromeItem.h"
    26 #include "ViewStack.h"
    26 #include "ViewStack.h"
    27 #include "GWebContentView.h"
    27 #include "GWebContentView.h"
    28 #include "BookmarksManager.h"
    28 #include "HistoryManager.h"
    29 #include <QDebug>
    29 #include <QDebug>
    30 
    30 
    31 namespace GVA {
    31 namespace GVA {
    32 
    32 
    33     RecentUrlToolbarSnippet::RecentUrlToolbarSnippet(const QString& elementId, ChromeWidget * chrome,
    33     RecentUrlToolbarSnippet::RecentUrlToolbarSnippet(const QString& elementId, ChromeWidget * chrome,
    34                                                      const QWebElement & element)
    34                                                      const QWebElement & element)
    35         : DualButtonToolbarSnippet(elementId, chrome, element),
    35         : DualButtonToolbarSnippet(elementId, chrome, element),
    36           m_action1(0)
    36           m_action1(0)
    37     {      
    37     {      
       
    38         connect(m_chrome, SIGNAL(aspectChanged(int)) , this, SLOT(onAspectChanged()));    	
    38     }
    39     }
    39 
    40 
    40     RecentUrlToolbarSnippet::~RecentUrlToolbarSnippet()
    41     RecentUrlToolbarSnippet::~RecentUrlToolbarSnippet()
    41     {
    42     {
    42         if(m_action1)
    43         if(m_action1)
    43             delete m_action1;
    44             delete m_action1;
    44     }
    45     }
    45 
    46 
       
    47      void RecentUrlToolbarSnippet::onAspectChanged( ) {
       
    48     	 
       
    49         updateOwnerArea();      
       
    50      }     
    46     RecentUrlToolbarSnippet * RecentUrlToolbarSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element)
    51     RecentUrlToolbarSnippet * RecentUrlToolbarSnippet::instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element)
    47     {
    52     {
    48         RecentUrlToolbarSnippet * that = new RecentUrlToolbarSnippet( elementId, chrome, element );
    53         RecentUrlToolbarSnippet * that = new RecentUrlToolbarSnippet( elementId, chrome, element );
    49         that->setChromeWidget( new ToolbarChromeItem( that ) );
    54         that->setChromeWidget( new ToolbarChromeItem( that ) );
    50         return that;
    55         return that;
    92                 }
    97                 }
    93                 connect(action, SIGNAL(triggered()), this, SLOT(handleBackButton()));
    98                 connect(action, SIGNAL(triggered()), this, SLOT(handleBackButton()));
    94             }
    99             }
    95             else if (t->actionId == RECENTURL_VIEW_ACTION_CLEARALL) {
   100             else if (t->actionId == RECENTURL_VIEW_ACTION_CLEARALL) {
    96                 if( !action ) {
   101                 if( !action ) {
    97 					// Action is created/handled/owned by BookmarksManager
   102 					// Action is created/handled/owned by HistoryManager
    98                     QAction * a = WRT::BookmarksManager::getSingleton()->getActionClearHistory();
   103                     QAction * a = WRT::HistoryManager::getSingleton()->getActionClearHistory();
    99                     button->setDefaultAction(a);
   104                     button->setDefaultAction(a);
   100                 }
   105                 }
   101             }
   106             }
   102         }
   107         }
   103     }
   108     }