Committing patch from Michal Ceresna relating to bug 267318.

This is the "alert dialogs" part.
This commit is contained in:
zack%kde.org 2004-12-02 23:29:43 +00:00
parent 26931c5a71
commit 89271cc062
14 changed files with 2066 additions and 0 deletions

View File

@ -1,2 +1,6 @@
.deps
Makefile
ui_*.h
ui_*.cpp
moc_ui_*.cpp
moc_*.cpp

View File

@ -40,14 +40,24 @@ CPPSRCS = \
EmbedEventListener.cpp \
EmbedWindowCreator.cpp \
EmbedStream.cpp \
QtPromptService.cpp \
qgeckoglobals.cpp
MOCSRCS = \
moc_qgeckoembed.cpp \
$(NULL)
UICSRCS = \
alert.ui \
confirm.ui \
prompt.ui \
select.ui \
userpass.ui \
$(NULL)
# Include config.mk
include $(topsrcdir)/config/config.mk
include $(srcdir)/config/qtconfig.mk
# Force applications to be built non-statically
# when building the mozcomps meta component
@ -68,6 +78,9 @@ EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk
include $(srcdir)/config/qtrules.mk
QtPromptService.cpp : $(UI_HSRCS)
ifeq ($(OS_ARCH), SunOS)
ifndef GNU_CC

View File

@ -0,0 +1,499 @@
/*
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Michal Ceresna
* for Lixto GmbH.
*
* Portions created by Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Michal Ceresna <ceresna@amos.sturak.sk>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "QtPromptService.h"
#include <nsString.h>
#include <nsIWindowWatcher.h>
#include <nsIWebBrowserChrome.h>
#include <nsIEmbeddingSiteWindow.h>
#include <nsCOMPtr.h>
#include <nsIServiceManager.h>
#include <nsReadableUtils.h>
#include <qmessagebox.h>
#include <qlabel.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qapplication.h>
#include <qstyle.h>
#include <qpixmap.h>
#include <qpushbutton.h>
#include <qlineedit.h>
#include "ui_alert.h"
#include "ui_confirm.h"
#include "ui_prompt.h"
#include "ui_select.h"
#include "ui_userpass.h"
#if (QT_VERSION < 0x030200)
//constant not defined in older qt version
#define SP_MessageBoxQuestion SP_MessageBoxInformation
#endif
QtPromptService::QtPromptService()
{
}
QtPromptService::~QtPromptService()
{
}
NS_IMPL_ISUPPORTS1(QtPromptService, nsIPromptService)
/**
* Puts up an alert dialog with an OK button.
*/
NS_IMETHODIMP
QtPromptService::Alert(nsIDOMWindow* aParent,
const PRUnichar* aDialogTitle,
const PRUnichar* aDialogText)
{
return
AlertCheck(aParent,
aDialogTitle, aDialogText,
NULL, NULL);
}
/**
* Puts up an alert dialog with an OK button and
* a message with a checkbox.
*/
NS_IMETHODIMP
QtPromptService::AlertCheck(nsIDOMWindow* aParent,
const PRUnichar* aDialogTitle,
const PRUnichar* aDialogText,
const PRUnichar* aCheckMsg,
PRBool* aCheckValue)
{
AlertDialog d(GetQWidgetForDOMWindow(aParent));
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxWarning));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
d.check->hide();
}
d.adjustSize();
d.exec();
if (aCheckMsg) {
*aCheckValue = d.check->isChecked();
}
return NS_OK;
}
/**
* Puts up a dialog with OK and Cancel buttons.
* @return true for OK, false for Cancel
*/
NS_IMETHODIMP
QtPromptService::Confirm(nsIDOMWindow* aParent,
const PRUnichar* aDialogTitle,
const PRUnichar* aDialogText,
PRBool* aConfirm)
{
return
ConfirmCheck(aParent,
aDialogTitle, aDialogText,
NULL, NULL,
aConfirm);
}
/**
* Puts up a dialog with OK and Cancel buttons, and
* a message with a single checkbox.
* @return true for OK, false for Cancel
*/
NS_IMETHODIMP
QtPromptService::ConfirmCheck(nsIDOMWindow* aParent,
const PRUnichar* aDialogTitle,
const PRUnichar* aDialogText,
const PRUnichar* aCheckMsg,
PRBool* aCheckValue,
PRBool* aConfirm)
{
PRInt32 ret;
ConfirmEx(aParent,
aDialogTitle, aDialogText,
STD_OK_CANCEL_BUTTONS,
NULL, NULL, NULL,
aCheckMsg,
aCheckValue,
&ret);
*aConfirm = (ret==0);
return NS_OK;
}
/**
* Puts up a dialog with up to 3 buttons and an optional checkbox.
*
* @param dialogTitle
* @param text
* @param buttonFlags Title flags for each button.
* @param button0Title Used when button 0 uses TITLE_IS_STRING
* @param button1Title Used when button 1 uses TITLE_IS_STRING
* @param button2Title Used when button 2 uses TITLE_IS_STRING
* @param checkMsg null if no checkbox
* @param checkValue
* @return buttonPressed
*
* Buttons are numbered 0 - 2. The implementation can decide whether
* the sequence goes from right to left or left to right.
* Button 0 will be the default button.
*
* A button may use a predefined title, specified by one of the
* constants below. Each title constant can be multiplied by a
* position constant to assign the title to a particular button.
* If BUTTON_TITLE_IS_STRING is used for a button, the string
* parameter for that button will be used. If the value for a button
* position is zero, the button will not be shown
*
*/
NS_IMETHODIMP
QtPromptService::ConfirmEx(nsIDOMWindow* aParent,
const PRUnichar* aDialogTitle,
const PRUnichar* aDialogText,
PRUint32 aButtonFlags,
const PRUnichar* aButton0Title,
const PRUnichar* aButton1Title,
const PRUnichar* aButton2Title,
const PRUnichar* aCheckMsg,
PRBool* aCheckValue,
PRInt32* aRetVal)
{
ConfirmDialog d(GetQWidgetForDOMWindow(aParent));
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
QString l = GetButtonLabel(aButtonFlags, BUTTON_POS_0, aButton0Title);
if (!l.isNull()) d.but1->setText(l); else d.but1->hide();
l = GetButtonLabel(aButtonFlags, BUTTON_POS_1, aButton1Title);
if (!l.isNull()) d.but2->setText(l); else d.but2->hide();
l = GetButtonLabel(aButtonFlags, BUTTON_POS_2, aButton2Title);
if (!l.isNull()) d.but3->setText(l); else d.but3->hide();
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
d.check->hide();
}
d.adjustSize();
int ret = d.exec();
*aRetVal = ret;
return NS_OK;
}
/**
* Puts up a dialog with an edit field and an optional checkbox.
*
* @param dialogTitle
* @param text
* @param value in: Pre-fills the dialog field if non-null
* out: If result is true, a newly allocated
* string. If result is false, in string is not
* touched.
* @param checkMsg if null, check box will not be shown
* @param checkValue
* @return true for OK, false for Cancel
*/
NS_IMETHODIMP
QtPromptService::Prompt(nsIDOMWindow* aParent,
const PRUnichar* aDialogTitle,
const PRUnichar* aDialogText,
PRUnichar** aValue,
const PRUnichar* aCheckMsg,
PRBool* aCheckValue,
PRBool* aConfirm)
{
PromptDialog d(GetQWidgetForDOMWindow(aParent));
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
if (aValue && *aValue) {
d.input->setText(QString::fromUcs2(*aValue));
}
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
d.check->hide();
}
d.adjustSize();
int ret = d.exec();
if (aCheckMsg) {
*aCheckValue = d.check->isChecked();
}
*aConfirm = (ret & QMessageBox::Ok);
if (*aConfirm) {
if (*aValue) nsMemory::Free(*aValue);
*aValue =
ToNewUnicode(NS_ConvertUTF8toUCS2(d.input->text().utf8()));
}
return NS_OK;
}
/**
* Puts up a dialog with an edit field, a password field, and an optional checkbox.
*
* @param dialogTitle
* @param text
* @param username in: Pre-fills the dialog field if non-null
* out: If result is true, a newly allocated
* string. If result is false, in string is not
* touched.
* @param password in: Pre-fills the dialog field if non-null
* out: If result is true, a newly allocated
* string. If result is false, in string is not
* touched.
* @param checkMsg if null, check box will not be shown
* @param checkValue
* @return true for OK, false for Cancel
*/
NS_IMETHODIMP
QtPromptService::PromptUsernameAndPassword(nsIDOMWindow* aParent,
const PRUnichar* aDialogTitle,
const PRUnichar* aDialogText,
PRUnichar** aUsername,
PRUnichar** aPassword,
const PRUnichar* aCheckMsg,
PRBool* aCheckValue,
PRBool* aConfirm)
{
UserpassDialog d(GetQWidgetForDOMWindow(aParent));
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
if (aUsername && *aUsername) {
d.username->setText(QString::fromUcs2(*aUsername));
}
if (aPassword && *aPassword) {
d.password->setText(QString::fromUcs2(*aPassword));
}
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
d.check->hide();
}
d.adjustSize();
int ret = d.exec();
if (aCheckMsg) {
*aCheckValue = d.check->isChecked();
}
*aConfirm = (ret & QMessageBox::Ok);
if (*aConfirm) {
if (*aUsername) nsMemory::Free(*aUsername);
*aUsername =
ToNewUnicode(NS_ConvertUTF8toUCS2(d.username->text().utf8()));
if (*aPassword) nsMemory::Free(*aPassword);
*aPassword =
ToNewUnicode(NS_ConvertUTF8toUCS2(d.password->text().utf8()));
}
return NS_OK;
}
/**
* Puts up a dialog with a password field and an optional checkbox.
*
* @param dialogTitle
* @param text
* @param password in: Pre-fills the dialog field if non-null
* out: If result is true, a newly allocated
* string. If result is false, in string is not
* touched.
* @param checkMsg if null, check box will not be shown
* @param checkValue
* @return true for OK, false for Cancel
*/
NS_IMETHODIMP
QtPromptService::PromptPassword(nsIDOMWindow* aParent,
const PRUnichar* aDialogTitle,
const PRUnichar* aDialogText,
PRUnichar** aPassword,
const PRUnichar* aCheckMsg,
PRBool* aCheckValue,
PRBool* aConfirm)
{
UserpassDialog d(GetQWidgetForDOMWindow(aParent));
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
d.lb_username->hide();
d.username->hide();
if (aPassword && *aPassword) {
d.password->setText(QString::fromUcs2(*aPassword));
}
if (aCheckMsg) {
d.check->setText(QString::fromUcs2(aCheckMsg));
d.check->setChecked(*aCheckValue);
}
else {
d.check->hide();
}
d.adjustSize();
int ret = d.exec();
if (aCheckMsg) {
*aCheckValue = d.check->isChecked();
}
*aConfirm = (ret & QMessageBox::Ok);
if (*aConfirm) {
if (*aPassword) nsMemory::Free(*aPassword);
*aPassword =
ToNewUnicode(NS_ConvertUTF8toUCS2(d.password->text().utf8()));
}
return NS_OK;
}
/**
* Puts up a dialog box which has a list box of strings
*/
NS_IMETHODIMP
QtPromptService::Select(nsIDOMWindow* aParent,
const PRUnichar* aDialogTitle,
const PRUnichar* aDialogText,
PRUint32 aCount,
const PRUnichar** aSelectList,
PRInt32* outSelection,
PRBool* aConfirm)
{
SelectDialog d(GetQWidgetForDOMWindow(aParent));
d.icon->setPixmap(QApplication::style().
stylePixmap(QStyle::SP_MessageBoxQuestion));
if (aDialogTitle) {
d.setCaption(QString::fromUcs2(aDialogTitle));
}
d.message->setText(QString::fromUcs2(aDialogText));
if (aSelectList) {
QStringList l;
for (PRUint32 i = 0; i < aCount; ++i) {
l.append(QString::fromUcs2(aSelectList[i]));
}
d.select->clear();
d.select->insertStringList(l);
}
d.adjustSize();
int ret = d.exec();
*aConfirm = (ret & QMessageBox::Ok);
if (*aConfirm) {
*outSelection = d.select->currentItem();
}
return NS_OK;
}
QWidget*
QtPromptService::GetQWidgetForDOMWindow(nsIDOMWindow* aDOMWindow)
{
nsCOMPtr<nsIWindowWatcher> wwatch = do_GetService("@mozilla.org/embedcomp/window-watcher;1");
nsCOMPtr<nsIWebBrowserChrome> chrome;
wwatch->GetChromeForWindow(aDOMWindow, getter_AddRefs(chrome));
nsCOMPtr<nsIEmbeddingSiteWindow> siteWindow = do_QueryInterface(chrome);
QWidget* parentWidget;
siteWindow->GetSiteWindow((void**)&parentWidget);
return parentWidget;
}
QString
QtPromptService::GetButtonLabel(PRUint32 aFlags,
PRUint32 aPos,
const PRUnichar* aStringValue)
{
PRUint32 posFlag = (aFlags & (255 * aPos)) / aPos;
switch (posFlag) {
case BUTTON_TITLE_OK:
return qApp->translate("QtPromptService", "&OK");
case BUTTON_TITLE_CANCEL:
return qApp->translate("QtPromptService", "&Cancel");
case BUTTON_TITLE_YES:
return qApp->translate("QtPromptService", "&Yes");
case BUTTON_TITLE_NO:
return qApp->translate("QtPromptService", "&No");
case BUTTON_TITLE_SAVE:
return qApp->translate("QtPromptService", "&Save");
case BUTTON_TITLE_DONT_SAVE:
return qApp->translate("QtPromptService", "&Don't Save");
case BUTTON_TITLE_REVERT:
return qApp->translate("QtPromptService", "&Revert");
case BUTTON_TITLE_IS_STRING:
return qApp->translate("QtPromptService",
QString::fromUcs2(aStringValue));
case 0:
return QString::null;
default:
NS_WARNING("Unexpected button flags");
return QString::null;
}
}

View File

@ -0,0 +1,61 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Michal Ceresna
* for Lixto GmbH.
*
* Portions created by Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Michal Ceresna <ceresna@amos.sturak.sk>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef qtpromptservice_h
#define qtpromptservice_h
#include <nsIPromptService.h>
#include <nsString.h>
#include <qwidget.h>
class nsIDOMWindow;
class QtPromptService : public nsIPromptService
{
public:
QtPromptService();
virtual ~QtPromptService();
NS_DECL_ISUPPORTS
NS_DECL_NSIPROMPTSERVICE
private:
QWidget* GetQWidgetForDOMWindow(nsIDOMWindow* aDOMWindow);
QString GetButtonLabel(PRUint32 aFlags, PRUint32 aPos,
const PRUnichar* aStringValue);
};
#endif /* qtpromptservice_h */

View File

@ -0,0 +1,234 @@
<!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">
<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>

View File

@ -0,0 +1,23 @@
#need a fullpath here, otherwise uic complains about
#already defined symbols
FULLDIST = `(cd $(DIST); pwd)`
DIST_QTDESIGNERPLUGINS = $(FULLDIST)/lib/designer
ifneq (,$(filter Linux FreeBSD SunOS,$(OS_ARCH)))
UIC = $(QTDIR)/bin/uic -L $(DIST_QTDESIGNERPLUGINS)
endif
ifeq ($(OS_ARCH), WINNT)
UIC = $(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_%)
ifdef IMAGES
IMGUI_CPPSRCS = uiimg_collection.cpp
endif
CPPSRCS += $(UI_CPPSRCS) $(MOCUI_CPPSRCS) $(IMGUI_CPPSRCS)
GARBAGE += $(UI_HSRCS) $(UI_CPPSRCS) $(MOCUI_CPPSRCS) $(IMGUI_CPPSRCS)

View File

@ -0,0 +1,15 @@
ui_%.h: %.ui Makefile Makefile.in
$(UIC) $< -o $@
ui_%.cpp: %.ui ui_%.h Makefile Makefile.in
$(UIC) $< -i $(<:%.ui=ui_%.h) -o $@
uiimg_%.cpp: $(IMAGES) Makefile Makefile.in
$(UIC) -embed $(PROGRAM) $(IMAGES) -o $@
libs::
ifdef IS_QTDESIGNERPLUGIN
@if test ! -d $(DIST_QTDESIGNERPLUGINS); then echo Creating $(DIST_QTDESIGNERPLUGINS); rm -rf $(DIST_QTDESIGNERPLUGINS); $(NSINSTALL) -D $(DIST_QTDESIGNERPLUGINS); else true; fi
$(INSTALL) $(SHARED_LIBRARY) $(DIST_QTDESIGNERPLUGINS)
endif

View File

@ -0,0 +1,277 @@
<!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>
</sizepolicy>
</property>
<property name="caption">
<string>Confirm</string>
</property>
<property name="sizeGripEnabled">
<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>

View File

@ -0,0 +1,309 @@
<!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">
<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>
</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>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>

View File

@ -41,6 +41,7 @@
#include "qgeckoembed.h"
#include "EmbedWindow.h"
#include "QtPromptService.h"
#include "nsIAppShell.h"
#include <nsIDocShell.h>
@ -81,6 +82,20 @@ nsVoidArray *QGeckoGlobals::sWindowList = nsnull;
nsIDirectoryServiceProvider *QGeckoGlobals::sAppFileLocProvider = nsnull;
nsProfileDirServiceProvider *QGeckoGlobals::sProfileDirServiceProvider = nsnull;
#define NS_PROMPTSERVICE_CID \
{0x95611356, 0xf583, 0x46f5, {0x81, 0xff, 0x4b, 0x3e, 0x01, 0x62, 0xc6, 0x19}}
NS_GENERIC_FACTORY_CONSTRUCTOR(QtPromptService)
static const nsModuleComponentInfo defaultAppComps[] = {
{
"Prompt Service",
NS_PROMPTSERVICE_CID,
"@mozilla.org/embedcomp/prompt-service;1",
QtPromptServiceConstructor
}
};
void
QGeckoGlobals::pushStartup()
{
@ -111,6 +126,9 @@ QGeckoGlobals::pushStartup()
rv = startupProfile();
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Warning: Failed to start up profiles.\n");
rv = registerAppComponents();
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Warning: Failed to register app components.\n");
// XXX startup appshell service?
nsCOMPtr<nsIAppShell> appShell;
@ -252,6 +270,32 @@ QGeckoGlobals::shutdownProfile(void)
}
}
/* static */
int
QGeckoGlobals::registerAppComponents()
{
nsCOMPtr<nsIComponentRegistrar> cr;
nsresult rv = NS_GetComponentRegistrar(getter_AddRefs(cr));
NS_ENSURE_SUCCESS(rv, rv);
int numAppComps = sizeof(defaultAppComps) / sizeof(nsModuleComponentInfo);
for (int i = 0; i < numAppComps; ++i) {
nsCOMPtr<nsIGenericFactory> componentFactory;
rv = NS_NewGenericFactory(getter_AddRefs(componentFactory),
&(defaultAppComps[i]));
if (NS_FAILED(rv)) {
NS_WARNING("Unable to create factory for component");
continue; // don't abort registering other components
}
rv = cr->RegisterFactory(defaultAppComps[i].mCID, defaultAppComps[i].mDescription,
defaultAppComps[i].mContractID, componentFactory);
NS_ASSERTION(NS_SUCCEEDED(rv), "Unable to register factory for component");
}
return rv;
}
void QGeckoGlobals::initializeGlobalObjects()
{
if (!sWindowList) {

View File

@ -67,6 +67,8 @@ public:
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);

View File

@ -0,0 +1,241 @@
<!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">
<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>
</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>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>

View File

@ -0,0 +1,341 @@
<!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>
<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>
</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>
</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>

View File

@ -1,2 +1,5 @@
Makefile
.deps
TestQGeckoEmbed
mainwindow
moc_*.cpp