Fixed gfxPlatform initialization

Fixed proper initialization of qt nsWindow
embedding/browser/qt ported for current version of Gecko and QT4
Fixed building of TestQGeckoEmbed application
This commit is contained in:
Oleg Romashin 2008-04-19 18:13:29 +03:00
Родитель a90720d9c6
Коммит 1207d84536
21 изменённых файлов: 1691 добавлений и 1640 удалений

Просмотреть файл

@ -152,7 +152,7 @@ EmbedProgress::OnStatusChange(nsIWebProgress *aWebProgress,
nsresult aStatus,
const PRUnichar *aMessage)
{
QString message = QString::fromUcs2(aMessage);
QString message = QString::fromUtf16(aMessage);
emit mOwner->linkMessage(message);
return NS_OK;

Просмотреть файл

@ -210,7 +210,7 @@ EmbedStream::AppendToStream(const char *aData, PRInt32 aLen)
nsCOMPtr<nsIRequest> request = do_QueryInterface(mChannel);
rv = mStreamListener->OnDataAvailable(request,
NULL,
NS_STATIC_CAST(nsIInputStream *, this),
static_cast<nsIInputStream *>(this),
mOffset, /* offset */
aLen); /* len */
// move our counter

Просмотреть файл

@ -55,7 +55,6 @@
#include <qapplication.h>
#include <qeventloop.h>
#include <q3vbox.h>
#include <qwidget.h>
#include <qtooltip.h>
#include <qcursor.h>
@ -66,17 +65,15 @@ class MozTipLabel : public QLabel
{
public:
MozTipLabel( QWidget* parent)
: QLabel( parent, "toolTipTip",
Qt::WStyle_StaysOnTop | Qt::WStyle_Customize | Qt::WStyle_NoBorder
| Qt::WStyle_Tool | Qt::WX11BypassWM )
: QLabel( "toolTipTip", parent, Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint)
{
setMargin(1);
//setAutoMask( FALSE );
setFrameStyle( QFrame::Plain | QFrame::Box );
setLineWidth( 1 );
setAlignment( Qt::AlignAuto | Qt::AlignTop );
setAlignment( Qt::AlignLeft | Qt::AlignTop );
setIndent(0);
polish();
// polish();
adjustSize();
setFont(QToolTip::font());
setPalette(QToolTip::palette());
@ -112,7 +109,7 @@ EmbedWindow::Init(QGeckoEmbed *aOwner)
return;
}
mWebBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome *, this));
mWebBrowser->SetContainerWindow(static_cast<nsIWebBrowserChrome *>(this));
nsCOMPtr<nsIDocShellTreeItem> item = do_QueryInterface(mWebBrowser);
item->SetItemType(nsIDocShellTreeItem::typeContentWrapper);
@ -175,7 +172,7 @@ EmbedWindow::SetStatus(PRUint32 aStatusType, const PRUnichar *aStatus)
switch (aStatusType) {
case STATUS_SCRIPT:
{
mOwner->emitScriptStatus(QString::fromUcs2(aStatus));
mOwner->emitScriptStatus(QString::fromUtf16(aStatus));
}
break;
case STATUS_SCRIPT_DEFAULT:
@ -184,7 +181,7 @@ EmbedWindow::SetStatus(PRUint32 aStatusType, const PRUnichar *aStatus)
case STATUS_LINK:
{
mLinkMessage = aStatus;
mOwner->emitLinkStatus(QString::fromUcs2(aStatus));
mOwner->emitLinkStatus(QString::fromUtf16(aStatus));
}
break;
}
@ -336,14 +333,14 @@ NS_IMETHODIMP
EmbedWindow::SetTitle(const PRUnichar *aTitle)
{
mTitle = aTitle;
emit mOwner->windowTitleChanged(QString::fromUcs2(aTitle));
emit mOwner->windowTitleChanged(QString::fromUtf16(aTitle));
return NS_OK;
}
NS_IMETHODIMP
EmbedWindow::GetSiteWindow(void **aSiteWindow)
{
*aSiteWindow = NS_STATIC_CAST(void *, mOwner);
*aSiteWindow = static_cast<void *>(mOwner);
return NS_OK;
}
@ -376,13 +373,13 @@ EmbedWindow::SetVisibility(PRBool aVisibility)
NS_IMETHODIMP
EmbedWindow::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText)
{
QString tipText = QString::fromUcs2(aTipText);
QString tipText = QString::fromUtf16(aTipText);
// get the root origin for this content window
nsCOMPtr<nsIWidget> mainWidget;
mBaseWindow->GetMainWidget(getter_AddRefs(mainWidget));
QWidget *window;
window = NS_STATIC_CAST(QWidget*, mainWidget->GetNativeData(NS_NATIVE_WINDOW));
window = static_cast<QWidget*>(mainWidget->GetNativeData(NS_NATIVE_WINDOW));
if (!window) {
NS_ERROR("no qt window in hierarchy!\n");
@ -437,13 +434,13 @@ EmbedWindow::OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsID
nsString attr;
attr.Assign(NS_LITERAL_STRING("href"));
element->GetAttribute(attr, href);
url = mOwner->resolvedUrl(QString::fromUcs2(href.get()));
url = mOwner->resolvedUrl(QString::fromUtf16(href.get()));
} else if (!strcasecmp(ctagname.get(), "img")) {
nsString href;
nsString attr;
attr.Assign(NS_LITERAL_STRING("src"));
element->GetAttribute(attr, href);
url = mOwner->resolvedUrl(QString::fromUcs2(href.get()));
url = mOwner->resolvedUrl(QString::fromUtf16(href.get()));
}
}

Просмотреть файл

@ -87,8 +87,8 @@ EmbedWindowCreator::CreateChromeWindow(nsIWebBrowserChrome *aParent,
if (aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)
newEmbed->setIsChrome(PR_TRUE);
*_retval = NS_STATIC_CAST(nsIWebBrowserChrome *,
(newEmbed->window()));
*_retval = static_cast<nsIWebBrowserChrome *>
(newEmbed->window());
if (*_retval) {
NS_ADDREF(*_retval);

Просмотреть файл

@ -7,6 +7,19 @@ include $(DEPTH)/config/autoconf.mk
MODULE = qgeckoembed
LIBRARY_NAME = qgeckoembed
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
DEFINES += -DIMPL_XREAPI
MOZ_QTEMBED_DYN = 1
ifdef MOZ_QTEMBED_DYN
FORCE_SHARED_LIB = 1
ifdef MOZ_ENABLE_LIBXUL
LIBXUL_LIBRARY =
endif
endif
REQUIRES = xpcom \
string \
docshell \
@ -24,6 +37,7 @@ REQUIRES = xpcom \
embed_base \
windowwatcher \
profdirserviceprovider \
xulapp \
$(NULL)
ifdef ACCESSIBILITY
@ -39,14 +53,15 @@ CPPSRCS = \
EmbedEventListener.cpp \
EmbedWindowCreator.cpp \
EmbedStream.cpp \
QtPromptService.cpp \
qgeckoglobals.cpp
qgeckoglobals.cpp
# $(srcdir)/QtPromptService.cpp \
MOCSRCS = \
moc_qgeckoembed.cpp \
$(NULL)
UICSRCS = \
UICSRCS = \
alert.ui \
confirm.ui \
prompt.ui \
@ -58,38 +73,29 @@ UICSRCS = \
include $(topsrcdir)/config/config.mk
include $(srcdir)/config/qtconfig.mk
# Force applications to be built non-statically
# when building the mozcomps meta component
ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
BUILD_STATIC_LIBS=
endif
SHARED_LIBRARY_LIBS= \
$(DIST)/lib/libembed_base_s.$(LIB_SUFFIX) \
$(DIST)/lib/libprofdirserviceprovider_s.$(LIB_SUFFIX) \
$(NULL)
EXPORTS = qgeckoembed.h
EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) \
$(MOZ_QT_LDFLAGS) \
ifdef MOZ_QTEMBED_DYN
EXTRA_DSO_LDOPTS += \
$(DIST)/lib/libxpcomglue_s.$(LIB_SUFFIX) \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_QT_LIBS) \
$(NULL)
ifndef MOZ_ENABLE_LIBXUL
EXTRA_DSO_LDOPTS += \
-lxul \
$(NULL)
endif
endif
include $(topsrcdir)/config/rules.mk
include $(srcdir)/config/qtrules.mk
QtPromptService.cpp : $(UI_HSRCS)
ifeq ($(OS_ARCH), SunOS)
ifndef GNU_CC
# When using Sun's WorkShop compiler, including
# /wherever/workshop-5.0/SC5.0/include/CC/std/time.h
# causes most of these compiles to fail with:
# line 29: Error: Multiple declaration for std::tm.
# So, this gets around the problem.
DEFINES += -D_TIME_H=1
endif
endif
_NO_PROMPT_UI=1
DEFINES += -D_NO_PROMPT_UI
CXXFLAGS += $(MOZ_QT_CFLAGS) -g02
CFLAGS += $(MOZ_QT_CFLAGS) -g02
CXXFLAGS += $(MOZ_QT_CFLAGS)
CFLAGS += $(MOZ_QT_CFLAGS)

Просмотреть файл

@ -43,7 +43,6 @@
#include <nsIEmbeddingSiteWindow.h>
#include <nsCOMPtr.h>
#include <nsIServiceManager.h>
#include <nsReadableUtils.h>
#include <qmessagebox.h>
#include <qlabel.h>
@ -100,15 +99,19 @@ QtPromptService::AlertCheck(nsIDOMWindow* aParent,
const PRUnichar* aCheckMsg,
PRBool* aCheckValue)
{
AlertDialog d(GetQWidgetForDOMWindow(aParent));
Ui::AlertDialog ui;
QDialog d;
ui.setupUi(&d);
// static_cast<QDialog*>(GetQWidgetForDOMWindow(aParent)));
// Hell
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxWarning));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
d.setWindowTitle(QString::fromUtf16(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
d.message->setText(QString::fromUtf16(aDialogText));
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setText(QString::fromUtf16(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
@ -204,13 +207,14 @@ QtPromptService::ConfirmEx(nsIDOMWindow* aParent,
PRBool* aCheckValue,
PRInt32* aRetVal)
{
ConfirmDialog d(GetQWidgetForDOMWindow(aParent));
Ui::ConfirmDialog d;
d.setupUi(static_cast<QDialog*>(GetQWidgetForDOMWindow(aParent)));
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
d.setWindowTitle(QString::fromUtf16(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
d.message->setText(QString::fromUtf16(aDialogText));
QString l = GetButtonLabel(aButtonFlags, BUTTON_POS_0, aButton0Title);
if (!l.isNull()) d.but1->setText(l); else d.but1->hide();
@ -220,7 +224,7 @@ QtPromptService::ConfirmEx(nsIDOMWindow* aParent,
if (!l.isNull()) d.but3->setText(l); else d.but3->hide();
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setText(QString::fromUtf16(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
@ -256,18 +260,19 @@ QtPromptService::Prompt(nsIDOMWindow* aParent,
PRBool* aCheckValue,
PRBool* aConfirm)
{
PromptDialog d(GetQWidgetForDOMWindow(aParent));
Ui::PromptDialog d;
d.setupUi(static_cast<QDialog*>(GetQWidgetForDOMWindow(aParent)));
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
d.setWindowTitle(QString::fromUtf16(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
d.message->setText(QString::fromUtf16(aDialogText));
if (aValue && *aValue) {
d.input->setText(QString::fromUcs2(*aValue));
d.input->setText(QString::fromUtf16(*aValue));
}
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setText(QString::fromUtf16(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
@ -320,17 +325,17 @@ QtPromptService::PromptUsernameAndPassword(nsIDOMWindow* aParent,
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
d.setWindowTitle(QString::fromUtf16(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
d.message->setText(QString::fromUtf16(aDialogText));
if (aUsername && *aUsername) {
d.username->setText(QString::fromUcs2(*aUsername));
d.username->setText(QString::fromUtf16(*aUsername));
}
if (aPassword && *aPassword) {
d.password->setText(QString::fromUcs2(*aPassword));
d.password->setText(QString::fromUtf16(*aPassword));
}
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setText(QString::fromUtf16(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
@ -381,16 +386,16 @@ QtPromptService::PromptPassword(nsIDOMWindow* aParent,
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
d.setWindowTitle(QString::fromUtf16(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
d.message->setText(QString::fromUtf16(aDialogText));
d.lb_username->hide();
d.username->hide();
if (aPassword && *aPassword) {
d.password->setText(QString::fromUcs2(*aPassword));
d.password->setText(QString::fromUtf16(*aPassword));
}
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setText(QString::fromUtf16(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
@ -428,13 +433,13 @@ QtPromptService::Select(nsIDOMWindow* aParent,
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
d.setWindowTitle(QString::fromUtf16(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
d.message->setText(QString::fromUtf16(aDialogText));
if (aSelectList) {
QStringList l;
for (PRUint32 i = 0; i < aCount; ++i) {
l.append(QString::fromUcs2(aSelectList[i]));
l.append(QString::fromUtf16(aSelectList[i]));
}
d.select->clear();
d.select->insertStringList(l);
@ -487,7 +492,7 @@ QtPromptService::GetButtonLabel(PRUint32 aFlags,
return qApp->translate("QtPromptService", "&Revert");
case BUTTON_TITLE_IS_STRING:
return qApp->translate("QtPromptService",
QString::fromUcs2(aStringValue));
QString::fromUtf16(aStringValue));
case 0:
return QString::null;
default:

Просмотреть файл

@ -1,234 +1,217 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>AlertDialog</class>
<widget class="QDialog">
<property name="name">
<cstring>AlertDialog</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>195</width>
<height>133</height>
</rect>
</property>
<property name="caption">
<string>Alert</string>
</property>
<property name="sizeGripEnabled">
<ui version="4.0" >
<class>AlertDialog</class>
<widget class="QDialog" name="AlertDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>187</width>
<height>122</height>
</rect>
</property>
<property name="windowTitle" >
<string>Alert</string>
</property>
<property name="sizeGripEnabled" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>alert text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<widget class="QCheckBox" name="check" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>confirm</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout18</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer row="1" column="1">
<property name="name">
<cstring>check_spacer1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>message</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>3</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>alert text</string>
</property>
<property name="alignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
<spacer row="2" column="0">
<property name="name">
<cstring>spacer1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QCheckBox" row="2" column="1">
<property name="name">
<cstring>check</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>confirm</string>
</property>
</widget>
<spacer row="1" column="0">
<property name="name">
<cstring>check_spacer2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>icon</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>AlignTop|AlignLeft</set>
</property>
</widget>
</grid>
</widget>
<spacer>
<property name="name">
<cstring>spacer2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout6</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>spacer3</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>ok</cstring>
</property>
<property name="text">
<string>&amp;OK</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer4</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>AlertDialog</receiver>
<slot>accept()</slot>
</connection>
</connections>
<tabstops>
<tabstop>ok</tabstop>
<tabstop>check</tabstop>
</tabstops>
<pixmapinproject/>
<layoutdefaults spacing="6" margin="11"/>
</UI>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ok" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>ok</tabstop>
<tabstop>check</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>AlertDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -5,16 +5,19 @@ FULLDIST = `(cd $(DIST); pwd)`
DIST_QTDESIGNERPLUGINS = $(FULLDIST)/lib/designer
ifneq (,$(filter Linux FreeBSD SunOS,$(OS_ARCH)))
UIC = $(QTDIR)/bin/uic -L $(DIST_QTDESIGNERPLUGINS)
UICEX = $(UIC)
# -L $(DIST_QTDESIGNERPLUGINS)
endif
ifeq ($(OS_ARCH), WINNT)
UIC = $(CYGWIN_WRAPPER) $(QTDIR)/bin/uic$(BIN_SUFFIX) -L $(DIST_QTDESIGNERPLUGINS)
UICEX = $(CYGWIN_WRAPPER) $(QTDIR)/bin/uic$(BIN_SUFFIX) -L $(DIST_QTDESIGNERPLUGINS)
endif
UI_HSRCS = $(UICSRCS:%.ui=ui_%.h)
UI_CPPSRCS = $(UICSRCS:%.ui=ui_%.cpp)
MOCUI_CPPSRCS = $(UI_CPPSRCS:%=moc_%)
UI_CPPSRCS =
#$(UICSRCS:%.ui=ui_%.cpp)
MOCUI_CPPSRCS =
#$(UI_CPPSRCS:%=moc_%)
ifdef IMAGES
IMGUI_CPPSRCS = uiimg_collection.cpp
endif

Просмотреть файл

@ -1,11 +1,11 @@
ui_%.h: %.ui Makefile Makefile.in
$(UIC) $< -o $@
$(UICEX) $< -o $@
ui_%.cpp: %.ui ui_%.h Makefile Makefile.in
$(UIC) $< -i $(<:%.ui=ui_%.h) -o $@
$(UICEX) $< -i $(<:%.ui=ui_%.h) -o $@
uiimg_%.cpp: $(IMAGES) Makefile Makefile.in
$(UIC) -embed $(PROGRAM) $(IMAGES) -o $@
$(UICEX) -embed $(PROGRAM) $(IMAGES) -o $@
libs::
ifdef IS_QTDESIGNERPLUGIN

Просмотреть файл

@ -1,277 +1,271 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>ConfirmDialog</class>
<widget class="QDialog">
<property name="name">
<cstring>ConfirmDialog</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>296</width>
<height>152</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
<ui version="4.0" >
<class>ConfirmDialog</class>
<widget class="QDialog" name="ConfirmDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>296</width>
<height>152</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle" >
<string>Confirm</string>
</property>
<property name="sizeGripEnabled" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<widget class="QCheckBox" name="check" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="caption">
<string>Confirm</string>
</property>
<property name="sizeGripEnabled">
</property>
<property name="text" >
<string>confirm</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>confirm text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout14</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer row="1" column="0">
<property name="name">
<cstring>check_spacer2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<spacer row="2" column="0">
<property name="name">
<cstring>spacer1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QCheckBox" row="2" column="1">
<property name="name">
<cstring>check</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>confirm</string>
</property>
</widget>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>message</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>3</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>confirm text</string>
</property>
<property name="alignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>icon</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>AlignTop|AlignLeft</set>
</property>
</widget>
<spacer row="1" column="1">
<property name="name">
<cstring>check_spacer1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</grid>
</widget>
<spacer>
<property name="name">
<cstring>spacer2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout15</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>spacer4</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>but1</cstring>
</property>
<property name="text">
<string>1</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>but2</cstring>
</property>
<property name="text">
<string>2</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>but3</cstring>
</property>
<property name="text">
<string>3</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer4_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</hbox>
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>but1</sender>
<signal>clicked()</signal>
<receiver>ConfirmDialog</receiver>
<slot>done1()</slot>
</connection>
<connection>
<sender>but2</sender>
<signal>clicked()</signal>
<receiver>ConfirmDialog</receiver>
<slot>done2()</slot>
</connection>
<connection>
<sender>but3</sender>
<signal>clicked()</signal>
<receiver>ConfirmDialog</receiver>
<slot>done3()</slot>
</connection>
</connections>
<slots>
<slot>done1()</slot>
<slot>done2()</slot>
<slot>done3()</slot>
</slots>
<pixmapinproject/>
<layoutdefaults spacing="6" margin="11"/>
</UI>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="but1" >
<property name="text" >
<string>1</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="but2" >
<property name="text" >
<string>2</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="but3" >
<property name="text" >
<string>3</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<resources/>
<connections>
<connection>
<sender>but1</sender>
<signal>clicked()</signal>
<receiver>ConfirmDialog</receiver>
<slot>done1()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>but2</sender>
<signal>clicked()</signal>
<receiver>ConfirmDialog</receiver>
<slot>done2()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>but3</sender>
<signal>clicked()</signal>
<receiver>ConfirmDialog</receiver>
<slot>done3()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -1,309 +1,291 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>PromptDialog</class>
<widget class="QDialog">
<property name="name">
<cstring>PromptDialog</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>222</width>
<height>177</height>
</rect>
</property>
<property name="caption">
<string>Prompt</string>
</property>
<property name="sizeGripEnabled">
<ui version="4.0" >
<class>PromptDialog</class>
<widget class="QDialog" name="PromptDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>222</width>
<height>177</height>
</rect>
</property>
<property name="windowTitle" >
<string>Prompt</string>
</property>
<property name="sizeGripEnabled" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>prompt text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout15</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>message</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>3</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>prompt text</string>
</property>
<property name="alignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>icon</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>AlignTop|AlignLeft</set>
</property>
</widget>
<widget class="QCheckBox" row="3" column="1">
<property name="name">
<cstring>check</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>confirm</string>
</property>
</widget>
<widget class="QLayoutWidget" row="1" column="1">
<property name="name">
<cstring>layout13</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLineEdit">
<property name="name">
<cstring>input</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer23_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<spacer row="3" column="0">
<property name="name">
<cstring>spacer1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<spacer row="2" column="1">
<property name="name">
<cstring>check_spacer1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<spacer row="2" column="0">
<property name="name">
<cstring>check_spacer2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<spacer row="1" column="0">
<property name="name">
<cstring>check_spacer2_2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</grid>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QCheckBox" name="check" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>confirm</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLineEdit" name="input" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<spacer>
<property name="name">
<cstring>spacer2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout10</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>Horizontal Spacing2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>ok</cstring>
</property>
<property name="text">
<string>&amp;OK</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>cancel</cstring>
</property>
<property name="text">
<string>&amp;Cancel</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
<spacer>
<property name="name">
<cstring>Horizontal Spacing2_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>PromptDialog</receiver>
<slot>accept()</slot>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
<receiver>PromptDialog</receiver>
<slot>reject()</slot>
</connection>
</connections>
<tabstops>
<tabstop>input</tabstop>
<tabstop>check</tabstop>
<tabstop>ok</tabstop>
<tabstop>cancel</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
</UI>
</item>
</layout>
</item>
<item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ok" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancel" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>input</tabstop>
<tabstop>check</tabstop>
<tabstop>ok</tabstop>
<tabstop>cancel</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>PromptDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
<receiver>PromptDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -59,19 +59,22 @@
#include <nsIWindowWatcher.h>
#include <nsILocalFile.h>
#include <nsEmbedAPI.h>
#include <nsXULAppAPI.h>
#include <nsWidgetsCID.h>
#include <nsIDOMUIEvent.h>
#include <nsIInterfaceRequestor.h>
#include <nsIComponentManager.h>
#include <nsIFocusController.h>
#include <nsProfileDirServiceProvider.h>
#include "nsIDirectoryService.h"
#include "nsAppDirectoryServiceDefs.h"
#include <nsIGenericFactory.h>
#include <nsIComponentRegistrar.h>
#include <nsVoidArray.h>
#include <nsIDOMDocument.h>
#include <nsIDOMBarProp.h>
#include <nsIDOMWindow.h>
#include <nsIDOMEventReceiver.h>
#include "nsPIDOMEventTarget.h"
#include <nsCOMPtr.h>
#include <nsPIDOMWindow.h>
@ -107,7 +110,7 @@ public:
nsCOMPtr<nsISHistory> sessionHistory;
// our event receiver
nsCOMPtr<nsIDOMEventReceiver> eventReceiver;
nsCOMPtr<nsPIDOMEventTarget> eventReceiver;
// chrome mask
PRUint32 chromeMask;
@ -130,8 +133,6 @@ QGeckoEmbedPrivate::QGeckoEmbedPrivate(QGeckoEmbed *qq)
chromeLoaded(FALSE),
listenersAttached(FALSE)
{
initGUI();
init();
}
QGeckoEmbedPrivate::~QGeckoEmbedPrivate()
@ -151,28 +152,28 @@ QGeckoEmbedPrivate::init()
// initialize it. It is assumed that this window will be destroyed
// when we go out of scope.
window = new EmbedWindow();
windowGuard = NS_STATIC_CAST(nsIWebBrowserChrome *, window);
windowGuard = static_cast<nsIWebBrowserChrome *>(window);
window->Init(q);
// Create our progress listener object, make an owning reference,
// and initialize it. It is assumed that this progress listener
// will be destroyed when we go out of scope.
progress = new EmbedProgress(q);
progressGuard = NS_STATIC_CAST(nsIWebProgressListener *,
progress);
progressGuard = static_cast<nsIWebProgressListener *>
(progress);
// Create our content listener object, initialize it and attach it.
// It is assumed that this will be destroyed when we go out of
// scope.
contentListener = new EmbedContentListener(q);
contentListenerGuard = NS_STATIC_CAST(nsISupports*,
NS_STATIC_CAST(nsIURIContentListener*, contentListener));
contentListenerGuard = static_cast<nsISupports*>
(static_cast<nsIURIContentListener*>(contentListener));
// Create our key listener object and initialize it. It is assumed
// that this will be destroyed before we go out of scope.
eventListener = new EmbedEventListener(q);
eventListenerGuard =
NS_STATIC_CAST(nsISupports *, NS_STATIC_CAST(nsIDOMKeyListener *,
eventListener));
static_cast<nsISupports *>(static_cast<nsIDOMKeyListener *>
(eventListener));
// has the window creator service been set up?
static int initialized = PR_FALSE;
@ -219,7 +220,7 @@ QGeckoEmbedPrivate::init()
nsCOMPtr<nsIWidget> qtWidget;
window->mBaseWindow->GetMainWidget(getter_AddRefs(qtWidget));
// get the native drawing area
mMainWidget = NS_STATIC_CAST(QWidget*, qtWidget->GetNativeData(NS_NATIVE_WINDOW));
mMainWidget = static_cast<QWidget*>(qtWidget->GetNativeData(NS_NATIVE_WINDOW));
// Apply the current chrome mask
ApplyChromeMask();
@ -229,7 +230,8 @@ void
QGeckoEmbedPrivate::initGUI()
{
QBoxLayout *l = new QHBoxLayout(q);
l->setAutoAdd(TRUE);
qDebug("FIXME: %s:%i: Q3-4: setAutoAdd(TRUE)", __PRETTY_FUNCTION__, __LINE__);
// l->setAutoAdd(TRUE);
}
void
@ -258,9 +260,13 @@ QGeckoEmbedPrivate::ApplyChromeMask()
QGeckoEmbed::QGeckoEmbed(QWidget *parent, const char *name)
: QWidget(parent, name)
: QWidget(parent)
{
setObjectName(QString::fromAscii(name));
d = new QGeckoEmbedPrivate(this);
if (!d) return;
d->initGUI();
d->init();
}
QGeckoEmbed::~QGeckoEmbed()
@ -291,7 +297,7 @@ void
QGeckoEmbed::loadURL(const QString &url)
{
if (!url.isEmpty()) {
d->navigation->LoadURI((const PRUnichar*)url.ucs2(),
d->navigation->LoadURI((const PRUnichar*)url.utf16 (),
nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags
nsnull, // Referring URI
nsnull, // Post data
@ -321,7 +327,7 @@ QGeckoEmbed::goBack()
}
void
QGeckoEmbed::renderData(const Q3CString &data, const QString &baseURI,
QGeckoEmbed::renderData(const QByteArray &data, const QString &baseURI,
const QString &mimeType)
{
openStream(baseURI, mimeType);
@ -343,12 +349,12 @@ QGeckoEmbed::openStream(const QString &baseURI, const QString &mimeType)
return rv;
}
rv = d->stream->OpenStream(baseURI, mimeType);
rv = d->stream->OpenStream(baseURI.toUtf8().data(), mimeType.toUtf8().data());
return rv;
}
int
QGeckoEmbed::appendData(const Q3CString &data)
QGeckoEmbed::appendData(const QByteArray &data)
{
if (!d->stream)
return NS_ERROR_FAILURE;
@ -618,8 +624,8 @@ QGeckoEmbed::attachListeners()
return;
nsIDOMEventListener *eventListener =
NS_STATIC_CAST(nsIDOMEventListener *,
NS_STATIC_CAST(nsIDOMKeyListener *, d->eventListener));
static_cast<nsIDOMEventListener *>
(static_cast<nsIDOMKeyListener *>(d->eventListener));
// add the key listener
nsresult rv;
@ -712,15 +718,16 @@ QString QGeckoEmbed::resolvedUrl(const QString &relativepath) const
nsCOMPtr<nsIURI> uri;
d->navigation->GetCurrentURI(getter_AddRefs(uri));
nsCAutoString rel;
rel.Assign(relativepath.utf8().data());
rel.Assign(relativepath.toUtf8().data());
nsCAutoString resolved;
uri->Resolve(rel, resolved);
return QString::fromUtf8(resolved.get());
}
void QGeckoEmbed::initialize(const char *aDir, const char *aName)
void QGeckoEmbed::initialize(const char *aDir, const char *aName, const char *xpcomPath)
{
QGeckoGlobals::setPath(xpcomPath);
QGeckoGlobals::setProfilePath(aDir, aName);
}

Просмотреть файл

@ -41,7 +41,17 @@
#define QECKOEMBED_H
#include <qwidget.h>
#include <q3cstring.h>
#include <qstring.h>
#define DISABLE_SLOTS 1
#ifdef DISABLE_SLOTS
#define NS_SLOTS
#define NS_VISIBILITY_DEFAULT __attribute__ ((visibility ("default")))
#else
#define NS_SLOTS slots
#define NS_VISIBILITY_DEFAULT
#endif
class nsIDOMKeyEvent;
class nsIDOMMouseEvent;
@ -71,7 +81,7 @@ class QGeckoEmbed : public QWidget
{
Q_OBJECT
public:
static void initialize(const char *aDir, const char *aName);
NS_VISIBILITY_DEFAULT static void initialize(const char *aDir, const char *aName, const char *xpcomPath);
public:
enum ReloadFlags
{
@ -82,35 +92,35 @@ public:
CharsetChange
};
public:
QGeckoEmbed(QWidget *parent, const char *name);
~QGeckoEmbed();
NS_VISIBILITY_DEFAULT QGeckoEmbed(QWidget *parent, const char *name);
NS_VISIBILITY_DEFAULT ~QGeckoEmbed();
bool canGoBack() const;
bool canGoForward() const;
NS_VISIBILITY_DEFAULT bool canGoBack() const;
NS_VISIBILITY_DEFAULT bool canGoForward() const;
void setIsChrome(bool);
int chromeMask() const;
NS_VISIBILITY_DEFAULT void setIsChrome(bool);
NS_VISIBILITY_DEFAULT int chromeMask() const;
nsIDOMDocument *document() const;
QString url() const;
QString resolvedUrl(const QString &relativepath) const;
NS_VISIBILITY_DEFAULT nsIDOMDocument *document() const;
NS_VISIBILITY_DEFAULT QString url() const;
NS_VISIBILITY_DEFAULT QString resolvedUrl(const QString &relativepath) const;
public slots:
void loadURL(const QString &url);
void stopLoad();
void goForward();
void goBack();
public NS_SLOTS:
NS_VISIBILITY_DEFAULT void loadURL(const QString &url);
NS_VISIBILITY_DEFAULT void stopLoad();
NS_VISIBILITY_DEFAULT void goForward();
NS_VISIBILITY_DEFAULT void goBack();
void renderData(const Q3CString &data, const QString &baseURI,
NS_VISIBILITY_DEFAULT void renderData(const QByteArray &data, const QString &baseURI,
const QString &mimeType);
int openStream(const QString &baseURI, const QString &mimeType);
int appendData(const Q3CString &data);
int closeStream();
NS_VISIBILITY_DEFAULT int openStream(const QString &baseURI, const QString &mimeType);
NS_VISIBILITY_DEFAULT int appendData(const QByteArray &data);
NS_VISIBILITY_DEFAULT int closeStream();
void reload(ReloadFlags flags = Normal);
NS_VISIBILITY_DEFAULT void reload(ReloadFlags flags = Normal);
void setChromeMask(int);
NS_VISIBILITY_DEFAULT void setChromeMask(int);
signals:
void linkMessage(const QString &message);

Просмотреть файл

@ -55,6 +55,7 @@
#include <nsIWindowWatcher.h>
#include <nsILocalFile.h>
#include <nsEmbedAPI.h>
#include <nsXULAppAPI.h>
#include <nsWidgetsCID.h>
#include <nsIDOMUIEvent.h>
@ -62,24 +63,83 @@
#include <nsIComponentManager.h>
#include <nsIFocusController.h>
#include <nsProfileDirServiceProvider.h>
#include "nsIDirectoryService.h"
#include "nsAppDirectoryServiceDefs.h"
#include <nsIGenericFactory.h>
#include <nsIComponentRegistrar.h>
#include <nsVoidArray.h>
#include <nsIDOMBarProp.h>
#include <nsIDOMWindow.h>
#include <nsIDOMEventReceiver.h>
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
#include <nsIDOMEvent.h>
#include <nsPIDOMEventTarget.h>
char *QGeckoGlobals::sPath = nsnull;
PRUint32 QGeckoGlobals::sWidgetCount = 0;
char *QGeckoGlobals::sCompPath = nsnull;
nsIAppShell *QGeckoGlobals::sAppShell = nsnull;
char *QGeckoGlobals::sProfileDir = nsnull;
char *QGeckoGlobals::sProfileName = nsnull;
nsILocalFile *QGeckoGlobals::sProfileDir = nsnull;
nsISupports *QGeckoGlobals::sProfileLock = nsnull;
nsVoidArray *QGeckoGlobals::sWindowList = nsnull;
nsIDirectoryServiceProvider *QGeckoGlobals::sAppFileLocProvider = nsnull;
nsProfileDirServiceProvider *QGeckoGlobals::sProfileDirServiceProvider = nsnull;
class QTEmbedDirectoryProvider : public nsIDirectoryServiceProvider2
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
};
static const QTEmbedDirectoryProvider kDirectoryProvider;
NS_IMPL_QUERY_INTERFACE2(QTEmbedDirectoryProvider,
nsIDirectoryServiceProvider,
nsIDirectoryServiceProvider2)
NS_IMETHODIMP_(nsrefcnt)
QTEmbedDirectoryProvider::AddRef()
{
return 1;
}
NS_IMETHODIMP_(nsrefcnt)
QTEmbedDirectoryProvider::Release()
{
return 1;
}
NS_IMETHODIMP
QTEmbedDirectoryProvider::GetFile(const char *aKey, PRBool *aPersist,
nsIFile* *aResult)
{
if (QGeckoGlobals::sAppFileLocProvider) {
nsresult rv = QGeckoGlobals::sAppFileLocProvider->GetFile(aKey, aPersist,
aResult);
if (NS_SUCCEEDED(rv))
return rv;
}
if (QGeckoGlobals::sProfileDir && !strcmp(aKey, NS_APP_USER_PROFILE_50_DIR)) {
*aPersist = PR_TRUE;
return QGeckoGlobals::sProfileDir->Clone(aResult);
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
QTEmbedDirectoryProvider::GetFiles(const char *aKey,
nsISimpleEnumerator* *aResult)
{
nsCOMPtr<nsIDirectoryServiceProvider2>
dp2(do_QueryInterface(QGeckoGlobals::sAppFileLocProvider));
if (!dp2)
return NS_ERROR_FAILURE;
return dp2->GetFiles(aKey, aResult);
}
#ifndef _NO_PROMPT_UI
#define NS_PROMPTSERVICE_CID \
{0x95611356, 0xf583, 0x46f5, {0x81, 0xff, 0x4b, 0x3e, 0x01, 0x62, 0xc6, 0x19}}
@ -93,6 +153,9 @@ static const nsModuleComponentInfo defaultAppComps[] = {
QtPromptServiceConstructor
}
};
#else
static const nsModuleComponentInfo defaultAppComps[] = {};
#endif
void
QGeckoGlobals::pushStartup()
@ -111,7 +174,25 @@ QGeckoGlobals::pushStartup()
return;
}
rv = NS_InitEmbedding(binDir, sAppFileLocProvider);
const char *grePath = sPath;
if (!grePath)
grePath = getenv("MOZILLA_FIVE_HOME");
if (!grePath)
return;
nsCOMPtr<nsILocalFile> greDir;
rv = NS_NewNativeLocalFile(nsDependentCString(grePath), PR_TRUE,
getter_AddRefs(greDir));
if (NS_FAILED(rv))
return;
rv = XRE_InitEmbedding(greDir, binDir,
const_cast<QTEmbedDirectoryProvider*>
(&kDirectoryProvider),
nsnull, nsnull);
if (NS_FAILED(rv))
return;
@ -121,24 +202,11 @@ QGeckoGlobals::pushStartup()
sAppFileLocProvider = nsnull;
}
rv = startupProfile();
NS_ASSERTION(NS_SUCCEEDED(rv), "Warning: Failed to start up profiles.\n");
if (sProfileDir)
XRE_NotifyProfile();
rv = registerAppComponents();
NS_ASSERTION(NS_SUCCEEDED(rv), "Warning: Failed to register app components.\n");
// XXX startup appshell service?
nsCOMPtr<nsIAppShell> appShell;
appShell = do_CreateInstance(kAppShellCID);
if (!appShell) {
NS_WARNING("Failed to create appshell in QGeckoGlobals::pushStartup!\n");
return;
}
sAppShell = appShell.get();
NS_ADDREF(sAppShell);
sAppShell->Create(0, nsnull);
sAppShell->Spinup();
}
}
@ -147,21 +215,23 @@ QGeckoGlobals::popStartup()
{
sWidgetCount--;
if (sWidgetCount == 0) {
// shut down the profiles
shutdownProfile();
if (sAppShell) {
// Shutdown the appshell service.
sAppShell->Spindown();
NS_RELEASE(sAppShell);
sAppShell = 0;
}
// shut down XPCOM/Embedding
NS_TermEmbedding();
XRE_TermEmbedding();
}
}
void
QGeckoGlobals::setPath(const char *aPath)
{
if (sPath)
free(sPath);
if (aPath)
sPath = strdup(aPath);
else
sPath = nsnull;
}
void
QGeckoGlobals::setCompPath(const char *aPath)
{
@ -183,20 +253,30 @@ void
QGeckoGlobals::setProfilePath(const char *aDir, const char *aName)
{
if (sProfileDir) {
nsMemory::Free(sProfileDir);
sProfileDir = nsnull;
if (sWidgetCount) {
NS_ERROR("Cannot change profile directory during run.");
return;
}
NS_RELEASE(sProfileDir);
NS_RELEASE(sProfileLock);
}
if (sProfileName) {
nsMemory::Free(sProfileName);
sProfileName = nsnull;
nsresult rv =
NS_NewNativeLocalFile(nsDependentCString(aDir), PR_TRUE, &sProfileDir);
if (NS_SUCCEEDED(rv)) {
rv = XRE_LockProfileDirectory(sProfileDir, &sProfileLock);
if (NS_SUCCEEDED(rv)) {
if (sWidgetCount)
XRE_NotifyProfile();
return;
}
}
if (aDir)
sProfileDir = (char *)nsMemory::Clone(aDir, strlen(aDir) + 1);
if (aName)
sProfileName = (char *)nsMemory::Clone(aName, strlen(aName) + 1);
NS_WARNING("Failed to lock profile.");
// Failed
NS_IF_RELEASE(sProfileDir);
NS_IF_RELEASE(sProfileLock);
}
void
@ -212,50 +292,6 @@ QGeckoGlobals::setDirectoryServiceProvider(nsIDirectoryServiceProvider
}
}
/* static */
int
QGeckoGlobals::startupProfile(void)
{
// initialize profiles
if (sProfileDir && sProfileName) {
nsresult rv;
nsCOMPtr<nsILocalFile> profileDir;
NS_NewNativeLocalFile(nsDependentCString(sProfileDir), PR_TRUE,
getter_AddRefs(profileDir));
if (!profileDir)
return NS_ERROR_FAILURE;
rv = profileDir->AppendNative(nsDependentCString(sProfileName));
if (NS_FAILED(rv))
return NS_ERROR_FAILURE;
nsCOMPtr<nsProfileDirServiceProvider> locProvider;
NS_NewProfileDirServiceProvider(PR_TRUE, getter_AddRefs(locProvider));
if (!locProvider)
return NS_ERROR_FAILURE;
rv = locProvider->Register();
if (NS_FAILED(rv))
return rv;
rv = locProvider->SetProfileDir(profileDir);
if (NS_FAILED(rv))
return rv;
// Keep a ref so we can shut it down.
NS_ADDREF(sProfileDirServiceProvider = locProvider);
}
return NS_OK;
}
/* static */
void
QGeckoGlobals::shutdownProfile(void)
{
if (sProfileDirServiceProvider) {
sProfileDirServiceProvider->Shutdown();
NS_RELEASE(sProfileDirServiceProvider);
sProfileDirServiceProvider = 0;
}
}
/* static */
int
QGeckoGlobals::registerAppComponents()
@ -310,11 +346,11 @@ QGeckoEmbed *QGeckoGlobals::findPrivateForBrowser(nsIWebBrowserChrome *aBrowser)
// creating a new window ) so it's OK to walk the list of open
// windows.
for (int i = 0; i < count; i++) {
QGeckoEmbed *tmpPrivate = NS_STATIC_CAST(QGeckoEmbed *,
sWindowList->ElementAt(i));
QGeckoEmbed *tmpPrivate = static_cast<QGeckoEmbed *>
(sWindowList->ElementAt(i));
// get the browser object for that window
nsIWebBrowserChrome *chrome = NS_STATIC_CAST(nsIWebBrowserChrome *,
tmpPrivate->window());
nsIWebBrowserChrome *chrome = static_cast<nsIWebBrowserChrome *>
(tmpPrivate->window());
if (chrome == aBrowser)
return tmpPrivate;
}

Просмотреть файл

@ -46,33 +46,39 @@ class nsIDirectoryServiceProvider;
class nsModuleComponentInfo;
class nsIAppShell;
class nsVoidArray;
class nsProfileDirServiceProvider;
class nsIDirectoryServiceProvider;
class nsIWebBrowserChrome;
class QGeckoEmbed;
class nsILocalFile;
class nsISupports;
class QTEmbedDirectoryProvider;
class QGeckoGlobals
{
friend class QGeckoEmbed;
friend class QTEmbedDirectoryProvider;
public:
static void initializeGlobalObjects();
static void pushStartup();
static void popStartup();
static void setPath(const char *aPath);
static void setCompPath(const char *aPath);
static void setAppComponents(const nsModuleComponentInfo *aComps,
int aNumComponents);
static void setProfilePath(const char *aDir, const char *aName);
static void setDirectoryServiceProvider(nsIDirectoryServiceProvider
*appFileLocProvider);
static int startupProfile(void);
static void shutdownProfile(void);
static int registerAppComponents();
static void addEngine(QGeckoEmbed *embed);
static void removeEngine(QGeckoEmbed *embed);
static QGeckoEmbed *findPrivateForBrowser(nsIWebBrowserChrome *aBrowser);
static nsIDirectoryServiceProvider *sAppFileLocProvider;
private:
static PRUint32 sWidgetCount;
// the path to the GRE
static char *sPath;
// the path to components
static char *sCompPath;
// the list of application-specific components to register
@ -81,11 +87,9 @@ private:
// the appshell we have created
static nsIAppShell *sAppShell;
// what is our profile path?
static char *sProfileDir;
static char *sProfileName;
// for profiles
static nsProfileDirServiceProvider *sProfileDirServiceProvider;
static nsIDirectoryServiceProvider *sAppFileLocProvider;
static nsILocalFile *sProfileDir;
static nsISupports *sProfileLock;
// the list of all open windows
static nsVoidArray *sWindowList;

Просмотреть файл

@ -1,241 +1,229 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>SelectDialog</class>
<widget class="QDialog">
<property name="name">
<cstring>SelectDialog</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>222</width>
<height>141</height>
</rect>
</property>
<property name="caption">
<string>Select</string>
</property>
<property name="sizeGripEnabled">
<ui version="4.0" >
<class>SelectDialog</class>
<widget class="QDialog" name="SelectDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>222</width>
<height>141</height>
</rect>
</property>
<property name="windowTitle" >
<string>Select</string>
</property>
<property name="sizeGripEnabled" >
<bool>false</bool>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>select text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout15</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>message</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>3</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>select text</string>
</property>
<property name="alignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>icon</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>AlignTop|AlignLeft</set>
</property>
</widget>
<widget class="QLayoutWidget" row="1" column="1">
<property name="name">
<cstring>layout13</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QComboBox">
<property name="name">
<cstring>select</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer23_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
</hbox>
</widget>
<spacer row="1" column="0">
<property name="name">
<cstring>check_spacer2_2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</grid>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1" >
<layout class="QHBoxLayout" >
<item>
<widget class="QComboBox" name="select" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<spacer>
<property name="name">
<cstring>spacer2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout10</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>Horizontal Spacing2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>ok</cstring>
</property>
<property name="text">
<string>&amp;OK</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>cancel</cstring>
</property>
<property name="text">
<string>&amp;Cancel</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
<spacer>
<property name="name">
<cstring>Horizontal Spacing2_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>SelectDialog</receiver>
<slot>accept()</slot>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
<receiver>SelectDialog</receiver>
<slot>reject()</slot>
</connection>
</connections>
<tabstops>
<tabstop>select</tabstop>
<tabstop>ok</tabstop>
<tabstop>cancel</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
</UI>
</item>
</layout>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ok" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancel" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>select</tabstop>
<tabstop>ok</tabstop>
<tabstop>cancel</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>SelectDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
<receiver>SelectDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -1,341 +1,335 @@
<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
<class>UserpassDialog</class>
<widget class="QDialog">
<property name="name">
<cstring>UserpassDialog</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>264</width>
<height>204</height>
</rect>
</property>
<property name="caption">
<string>Prompt</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout12</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="0" column="1">
<property name="name">
<cstring>message</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>3</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>prompt text</string>
</property>
<property name="alignment">
<set>WordBreak|AlignVCenter</set>
</property>
</widget>
<spacer row="3" column="0">
<property name="name">
<cstring>spacer7</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<spacer row="2" column="1">
<property name="name">
<cstring>spacer7_2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>icon</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
<widget class="QLayoutWidget" row="1" column="1">
<property name="name">
<cstring>layout9</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLineEdit" row="0" column="1">
<property name="name">
<cstring>username</cstring>
</property>
</widget>
<spacer row="1" column="2">
<property name="name">
<cstring>spacer23_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QLineEdit" row="1" column="1">
<property name="name">
<cstring>password</cstring>
</property>
<property name="echoMode">
<enum>Password</enum>
</property>
</widget>
<widget class="QLabel" row="1" column="0">
<property name="name">
<cstring>lb_password</cstring>
</property>
<property name="text">
<string>Password:</string>
</property>
</widget>
<spacer row="0" column="2">
<property name="name">
<cstring>spacer23</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QLabel" row="0" column="0">
<property name="name">
<cstring>lb_username</cstring>
</property>
<property name="text">
<string>Username:</string>
</property>
</widget>
</grid>
</widget>
<spacer row="1" column="0">
<property name="name">
<cstring>spacer7_3_2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QCheckBox" row="3" column="1">
<property name="name">
<cstring>check</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>confirm</string>
</property>
</widget>
<spacer row="2" column="0">
<property name="name">
<cstring>spacer7_3</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</grid>
</widget>
<ui version="4.0" >
<class>UserpassDialog</class>
<widget class="QDialog" name="UserpassDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>264</width>
<height>204</height>
</rect>
</property>
<property name="windowTitle" >
<string>Prompt</string>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QGridLayout" >
<item row="0" column="1" >
<widget class="QLabel" name="message" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>prompt text</string>
</property>
<property name="alignment" >
<set>Qt::AlignVCenter</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="icon" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="scaledContents" >
<bool>false</bool>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1" >
<layout class="QGridLayout" >
<item row="0" column="1" >
<widget class="QLineEdit" name="username" />
</item>
<item row="1" column="2" >
<spacer>
<property name="name">
<cstring>spacer2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout6</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<property name="name">
<cstring>spacer4</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>ok</cstring>
</property>
<property name="text">
<string>&amp;OK</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>cancel</cstring>
</property>
<property name="text">
<string>&amp;Cancel</string>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer4_2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</hbox>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="password" >
<property name="echoMode" >
<enum>QLineEdit::Password</enum>
</property>
</widget>
</vbox>
</widget>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>UserpassDialog</receiver>
<slot>accept()</slot>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
<receiver>UserpassDialog</receiver>
<slot>reject()</slot>
</connection>
<connection>
<sender>password</sender>
<signal>returnPressed()</signal>
<receiver>UserpassDialog</receiver>
<slot>accept()</slot>
</connection>
</connections>
<tabstops>
<tabstop>username</tabstop>
<tabstop>password</tabstop>
<tabstop>check</tabstop>
<tabstop>ok</tabstop>
<tabstop>cancel</tabstop>
</tabstops>
<pixmapinproject/>
<layoutdefaults spacing="6" margin="11"/>
</UI>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="lb_password" >
<property name="text" >
<string>Password:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>10</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="lb_username" >
<property name="text" >
<string>Username:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1" >
<widget class="QCheckBox" name="check" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>confirm</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<size>
<width>5</width>
<height>5</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="ok" >
<property name="text" >
<string>&amp;OK</string>
</property>
<property name="autoDefault" >
<bool>true</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancel" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<tabstops>
<tabstop>username</tabstop>
<tabstop>password</tabstop>
<tabstop>check</tabstop>
<tabstop>ok</tabstop>
<tabstop>cancel</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>ok</sender>
<signal>clicked()</signal>
<receiver>UserpassDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>cancel</sender>
<signal>clicked()</signal>
<receiver>UserpassDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>password</sender>
<signal>returnPressed()</signal>
<receiver>UserpassDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel" >
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

Просмотреть файл

@ -28,16 +28,23 @@ MOCSRCS = \
moc_mainwindow.cpp \
$(NULL)
IMAGES = fileopen.png reload.png back.png forward.png stop.png
#IMAGES = fileopen.png reload.png back.png forward.png stop.png
CXXFLAGS += $(MOZ_QT_CFLAGS)
PROGRAM = TestQGeckoEmbed$(BIN_SUFFIX)
ifdef MOZ_ENABLE_QT
LIBS += \
-lqgeckoembed \
$(XLDFLAGS) \
$(XLIBS) \
$(MOZ_QT_LIBS) \
$(NULL)
#LIBS += \
# -lqgeckoembed \
# $(NULL)
LIBS += \
-lxul \
$(NULL)
endif
@ -68,10 +75,14 @@ EXTRA_LIBS += $(MOZ_COMPONENT_LIBS)
include $(topsrcdir)/config/rules.mk
include $(srcdir)/../src/config/qtrules.mk
LIBS += $(XPCOM_STANDALONE_GLUE_LDOPTS)
DEFINES += -DXPCOM_GLUE
CXXFLAGS += $(MOZ_QT_CFLAGS)
EXTRA_LIBS += \
$(TK_LIBS) \
$(MOZ_QT_LIBS) \
$(NULL)
ifeq ($(OS_ARCH), SunOS)

Просмотреть файл

@ -1,6 +1,7 @@
#include <qapplication.h>
#include "mainwindow.h"
#include "qgeckoembed.h"
#include "nsXPCOMGlue.h"
#include <qdir.h>
@ -8,11 +9,34 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
QGeckoEmbed::initialize(QDir::homeDirPath().latin1(),
".TestQGeckoEmbed");
static const GREVersionRange greVersion = {
"1.9a", PR_TRUE,
"2", PR_TRUE
};
char xpcomPath[PATH_MAX];
nsresult rv = GRE_GetGREPathWithProperties(&greVersion, 1, nsnull, 0,
xpcomPath, sizeof(xpcomPath));
if (NS_FAILED(rv)) {
fprintf(stderr, "Couldn't find a compatible GRE.\n");
return 1;
}
rv = XPCOMGlueStartup(xpcomPath);
if (NS_FAILED(rv)) {
fprintf(stderr, "Couldn't start XPCOM.\n");
return 1;
}
char *lastSlash = strrchr(xpcomPath, '/');
if (lastSlash)
*lastSlash = '\0';
QGeckoEmbed::initialize(QDir::homePath().toUtf8(),
".TestQGeckoEmbed", xpcomPath);
MyMainWindow *mainWindow = new MyMainWindow();
app.setMainWidget(mainWindow);
//app.setMainWidget(mainWindow);
mainWindow->resize(700, 500);
mainWindow->show();

Просмотреть файл

@ -6,48 +6,53 @@
#include <qtoolbar.h>
#include <qfiledialog.h>
#include <qstatusbar.h>
#include <qvbox.h>
#include <qlayout.h>
#include "qgeckoembed.h"
const QString rsrcPath = ":/images/lin";
MyMainWindow::MyMainWindow()
{
QVBox *box = new QVBox(this);
QFrame *box = new QFrame(this);
qecko = new QGeckoEmbed(box, "qgecko");
box->setFrameStyle(QFrame::Panel | QFrame::Sunken);
setCentralWidget( box );
QToolBar *toolbar = new QToolBar(this);
toolbar->setLabel("Location:");
toolbar->setWindowTitle("Location:");
QAction *action = new QAction(QPixmap::fromMimeSource( "back.png" ), tr( "Go Back"), CTRL + Key_B,
toolbar, "goback");
QAction *action = new QAction(QIcon(rsrcPath + "/back.png"), tr( "Go Back"), toolbar);
action->setShortcut(Qt::ControlModifier + Qt::Key_B);
// toolbar, "goback");
connect(action, SIGNAL(activated()), this, SLOT(goBack()));
action->addTo(toolbar);
toolbar->addAction(action);
action = new QAction(QPixmap::fromMimeSource( "forward.png" ), tr( "Go Forward"), CTRL + Key_F,
toolbar, "goforward");
action = new QAction(QIcon(rsrcPath + "/forward.png" ), tr( "Go Forward"), toolbar);
action->setShortcut(Qt::ControlModifier + Qt::Key_F);
// toolbar, "goforward");
connect(action, SIGNAL(activated()), this, SLOT(goForward()));
action->addTo(toolbar);
toolbar->addAction(action);
action = new QAction(QPixmap::fromMimeSource( "stop.png" ), tr("Stop"), CTRL + Key_S,
toolbar, "stop");
action = new QAction(QIcon(rsrcPath + "/stop.png" ), tr("Stop"), toolbar);
action->setShortcut(Qt::ControlModifier + Qt::Key_S);
// toolbar, "stop");
connect(action, SIGNAL(activated()), this, SLOT(stop()));
action->addTo(toolbar);
toolbar->addAction(action);
location = new QLineEdit(toolbar);
toolbar->setStretchableWidget(location);
qDebug("Func:%s::%d: QT4 PORT: toolbar->setStretchableWidget(location);\n", __PRETTY_FUNCTION__, __LINE__);
//toolbar->setStretchableWidget(location);
QPopupMenu *menu = new QPopupMenu(this);
menuBar()->insertItem( tr( "&File" ), menu );
QMenu *menu = new QMenu(tr( "&File" ), this);
menuBar()->addMenu( menu );
QAction *a = new QAction( QPixmap::fromMimeSource( "fileopen.png" ), tr( "&Open..." ), CTRL + Key_O,
toolbar, "fileOpen" );
QAction *a = new QAction( QIcon(rsrcPath + "/fileopen.png" ), tr( "&Open..." ), toolbar);
a->setShortcut( Qt::ControlModifier + Qt::Key_O );
// toolbar, "fileOpen" );
connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
//a->addTo( toolbar );
a->addTo( menu );
menu->addAction(a);
connect( qecko, SIGNAL(linkMessage(const QString &)),
@ -72,9 +77,9 @@ MyMainWindow::MyMainWindow()
void MyMainWindow::fileOpen()
{
QString fn = QFileDialog::getOpenFileName( QString::null, tr( "HTML-Files (*.htm *.html);;All Files (*)" ), this );
QString fn = QFileDialog::getOpenFileName( this, tr( "HTML-Files (*.htm *.html);;All Files (*)" ), QDir::currentPath());
if ( !fn.isEmpty() )
qecko->loadURL( fn );
qecko->loadURL( fn );
}
void MyMainWindow::startURIOpen(const QString &, bool &)
@ -104,7 +109,7 @@ void MyMainWindow::stop()
void MyMainWindow::slotProgress(const QString &url, int current, int max)
{
qDebug("progress %d / %d (%s)", current, max, url.latin1());
qDebug("progress %d / %d (%s)", current, max, url.toUtf8().data());
}
void MyMainWindow::slotProgress(int current, int max)

Просмотреть файл

@ -62,6 +62,8 @@ REQUIRES = xpcom \
uconv \
necko \
view \
thebes \
cairo \
$(NULL)
MOCSRCS><-->= \