Enable the splash screen blur on OSes other than OS X.

svn path=/trunk/; revision=45935
This commit is contained in:
Gerald Combs 2012-11-05 19:58:06 +00:00
parent 64c6710857
commit a2ddc6acc4
3 changed files with 129 additions and 118 deletions

View File

@ -38,6 +38,9 @@
#include <QWidget>
#include <QResizeEvent>
#ifndef Q_WS_MAC
#include <QGraphicsBlurEffect>
#endif
MainWelcome::MainWelcome(QWidget *parent) :
QFrame(parent),
@ -140,11 +143,20 @@ MainWelcome::MainWelcome(QWidget *parent) :
task_list_->setCurrentRow(0);
#ifndef Q_WS_MAC
// This crashes with Qt 4.8.3 on OS X.
QGraphicsBlurEffect *blur = new QGraphicsBlurEffect(welcome_ui_->childContainer);
welcome_ui_->childContainer->setGraphicsEffect(blur);
#endif
splash_overlay_ = new SplashOverlay(this);
}
void MainWelcome::destroySplashOverlay()
{
#ifndef Q_WS_MAC
welcome_ui_->childContainer->setGraphicsEffect(NULL);
#endif
delete splash_overlay_;
splash_overlay_ = NULL;
}

View File

@ -21,120 +21,126 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="mainWelcomeBanner">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Wireshark&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QStackedWidget" name="taskStack">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="InterfaceTree" name="interfaceTree">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="columnCount">
<number>2</number>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">2</string>
</property>
</column>
</widget>
<widget class="QListWidget" name="recentList">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
<widget class="QLabel" name="helpLinks">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;User's Guide&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Wiki&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="QListWidget" name="taskList">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>5</verstretch>
</sizepolicy>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="autoScroll">
<bool>false</bool>
</property>
<property name="textElideMode">
<enum>Qt::ElideNone</enum>
</property>
<item>
<property name="text">
<string>Capture
<widget class="QWidget" name="childContainer" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<widget class="QStackedWidget" name="taskStack">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="InterfaceTree" name="interfaceTree">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="columnCount">
<number>2</number>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">2</string>
</property>
</column>
</widget>
<widget class="QListWidget" name="recentList">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
<widget class="QLabel" name="helpLinks">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;User's Guide&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Wiki&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="QListWidget" name="taskList">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>5</verstretch>
</sizepolicy>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="autoScroll">
<bool>false</bool>
</property>
<property name="textElideMode">
<enum>Qt::ElideNone</enum>
</property>
<item>
<property name="text">
<string>Capture
live packets from the network</string>
</property>
</item>
<item>
<property name="text">
<string>Open
</property>
</item>
<item>
<property name="text">
<string>Open
a recent capture file</string>
</property>
</item>
<item>
<property name="text">
<string>Learn
</property>
</item>
<item>
<property name="text">
<string>Learn
more about Wireshark</string>
</property>
</item>
</widget>
</item>
</layout>
</property>
</item>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="mainWelcomeBanner">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Wireshark&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>

View File

@ -25,7 +25,6 @@
#include "ui_splash_overlay.h"
#include "wireshark_application.h"
//#include <QGraphicsBlurEffect>
#include <QPainter>
#include "ui/utf8_entities.h"
@ -90,12 +89,6 @@ SplashOverlay::SplashOverlay(QWidget *parent) :
connect(wsApp, SIGNAL(splashUpdate(register_action_e,const char*)),
this, SLOT(splashUpdate(register_action_e,const char*)));
// It would be nice to be able to blur the background, sort of like VMware Fusion.
// Unfortunately setGraphicsEffect applies to the widget *and* its children and
// the code below crashes with Qt 4.8.2 on OS X.
// QGraphicsBlurEffect *blur = new QGraphicsBlurEffect();
// setGraphicsEffect(blur);
}
SplashOverlay::~SplashOverlay()