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

List:       kde-commits
Subject:    kdelibs
From:       Stephan Binner <binner () kde ! org>
Date:       2005-02-02 18:27:49
Message-ID: 20050202182749.E22E21CFDA () office ! kde ! org
[Download RAW message or body]

CVS commit by binner: 

My simple little suppressed popup window indicator
FEATURE
CCBUG: 85246


  A            pics/crystalsvg/cr16-action-window_suppressed.png   1.1
  M +22 -0     khtml/khtml_part.cpp   1.1085
  M +6 -0      khtml/khtml_part.h   1.276
  M +1 -0      khtml/khtmlpart_p.h   1.61
  M +1 -0      khtml/ecma/kjs_window.cpp   1.396


--- kdelibs/khtml/khtmlpart_p.h  #1.60:1.61
@@ -304,4 +304,5 @@ public:
   KURLLabel* m_statusBarUALabel;
   KURLLabel* m_statusBarJSErrorLabel;
+  KURLLabel* m_statusBarPopupLabel;
   DOM::DocumentImpl *m_doc;
   khtml::Decoder *m_decoder;

--- kdelibs/khtml/khtml_part.cpp  #1.1084:1.1085
@@ -241,4 +241,5 @@ void KHTMLPart::init( KHTMLView *view, G
   d->m_statusBarExtension = new KParts::StatusBarExtension( this );
   d->m_statusBarIconLabel = 0L;
+  d->m_statusBarPopupLabel = 0L;
 
   d->m_bSecurityInQuestion = false;
@@ -458,4 +459,5 @@ KHTMLPart::~KHTMLPart()
   if (!parentPart()) { // only delete it if the top khtml_part closes
     removeJSErrorExtension();
+    delete d->m_statusBarPopupLabel;
   }
 
@@ -1826,4 +1828,6 @@ void KHTMLPart::begin( const KURL &url, 
   }
 
+  setSuppressedPopupIndicator( false );
+
   // ###
   //stopParser();
@@ -7051,4 +7055,22 @@ void KHTMLPart::setDebugScript( bool ena
 }
 
+void KHTMLPart::setSuppressedPopupIndicator( bool enable )
+{
+    if ( enable && !d->m_statusBarPopupLabel && !parentPart() ) {
+        d->m_statusBarPopupLabel = new KURLLabel( \
d->m_statusBarExtension->statusBar() ); +        \
d->m_statusBarPopupLabel->setFixedHeight( instance()->iconLoader()->currentSize( \
KIcon::Small) ); +        d->m_statusBarPopupLabel->setSizePolicy( QSizePolicy( \
QSizePolicy::Fixed, QSizePolicy::Fixed )); +        \
d->m_statusBarPopupLabel->setUseCursor( false ); +        \
d->m_statusBarExtension->addStatusBarItem( d->m_statusBarPopupLabel, 0, false ); +    \
d->m_statusBarPopupLabel->setPixmap( SmallIcon( "window_suppressed", instance() ) ); \
+        QToolTip::add( d->m_statusBarPopupLabel, i18n("Konqueror prevented this site \
from opening a popup window." ) ); +    } else if ( !enable && \
d->m_statusBarPopupLabel ) { +        QToolTip::remove( d->m_statusBarPopupLabel );
+        d->m_statusBarExtension->removeStatusBarItem( d->m_statusBarPopupLabel );
+        delete d->m_statusBarPopupLabel;
+        d->m_statusBarPopupLabel = 0L;
+    }
+}
+
 using namespace KParts;
 #include "khtml_part.moc"

--- kdelibs/khtml/khtml_part.h  #1.275:1.276
@@ -1009,4 +1009,10 @@ public:
   bool isModified() const;
 
+  /**
+   * Shows or hides the suppressed popup indicator
+   * @since 3.4
+   */
+  void setSuppressedPopupIndicator( bool enable );
+
 signals:
   /**

--- kdelibs/khtml/ecma/kjs_window.cpp  #1.395:1.396
@@ -1303,4 +1303,5 @@ Value Window::openWindow(ExecState *exec
   }
   if ( policy != KHTMLSettings::KJSWindowOpenAllow ) {
+    part->setSuppressedPopupIndicator(true);
     return Undefined();
   } else {


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

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