Merged client logic, qt library and ui changes from client branch into trunk.

git-svn-id: http://voip.null.ro/svn/yate@3933 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2010-12-08 14:37:24 +00:00
parent 6a34e5b3b9
commit b924220061
149 changed files with 24220 additions and 5199 deletions

View File

@ -29,8 +29,6 @@ LIBS :=
MENUFILES :=
DESKFILES :=
QTCLIENT := qt4/libqt4client.a
ifneq (@HAVE_QT4@,no)
SUBDIRS := $(SUBDIRS) qt4
PROGS := $(PROGS) yate-qt4
@ -147,12 +145,9 @@ do-all do-strip do-clean do-install do-uninstall:
Makefile: @srcdir@/Makefile.in $(MKDEPS)
cd .. && ./config.status
yate-%: @srcdir@/main-%.cpp $(MKDEPS) ../libyate.so $(INCFILES)
yate-%: @srcdir@/main-%.cpp $(MKDEPS) ../libyate.so ../libyateqt4.so $(INCFILES)
$(COMPILE) -o $@ $(LOCALFLAGS) $< $(LDFLAGS) $(LIBTHR) $(LOCALLIBS) $(YATELIBS)
yate-qt4: $(QTCLIENT)
yate-qt4:
yate-qt4: LOCALFLAGS = $(QT4_INC)
yate-qt4: LOCALLIBS = $(QTCLIENT) $(QT4_LIB)
$(QTCLIENT):
$(MAKE) -C qt4
yate-qt4: LOCALLIBS = -lyateqt4 $(QT4_LIB)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -14,16 +14,24 @@ QT4_LIB_NET := @QT4_LIB_NET@
DEFS:=
INCLUDES:=-I. -I@srcdir@ -I@top_srcdir@ $(QT4_INC)
CXXFLAGS:=$(CXXFLAGS) @MODULE_CPPFLAGS@ @INLINE_FLAGS@
CFLAGS := @CFLAGS@ @MODULE_CPPFLAGS@ @INLINE_FLAGS@
LDFLAGS:= @LDFLAGS@
SONAME_OPT := @SONAME_OPT@
YATELIBS := -L../.. -lyate @LIBS@
INCFILES := @top_srcdir@/yateclass.h @top_srcdir@/yatecbase.h @srcdir@/qt4client.h
PROJECT = libqt4client.a
PROGS=
LIBS =
SOURCES = qt4client.cpp
OBJECTS = $(SOURCES:.cpp=.o) qt4client.moc.o
OBJS = $(SOURCES:.cpp=.o) qt4client.moc.o
LIBD_DEV:= libyateqt4.so
LIBD_VER:= $(LIBD_DEV).@PACKAGE_VERSION@
LIBD:= ../../$(LIBD_VER) ../../$(LIBD_DEV)
COMPILE = $(CXX) $(DEFS) $(DEBUG) $(INCLUDES) $(CXXFLAGS)
LOCALFLAGS =
LOCALLIBS =
COMPILE = $(CXX) $(DEFS) $(DEBUG) $(INCLUDES) $(CFLAGS)
LINK = $(CXX) $(LDFLAGS)
ifneq (x@QT4_VER@,x)
DEFS := $(DEFS) -DQT4_VER=@QT4_VER@
@ -35,23 +43,25 @@ exec_prefix = @exec_prefix@
# include optional local make rules
-include YateLocal.mak
.PHONY: all debug ddebug xdebug clean install uninstall
all: $(PROJECT)
.PHONY: all debug ddebug xdebug
all: $(LIBS) $(LIBD) $(PROGS)
debug:
$(MAKE) all DEBUG=-g3
$(MAKE) all DEBUG=-g3 MODSTRIP=
ddebug:
$(MAKE) all DEBUG='-g3 -DDEBUG'
$(MAKE) all DEBUG='-g3 -DDEBUG' MODSTRIP=
xdebug:
$(MAKE) all DEBUG='-g3 -DXDEBUG'
$(MAKE) all DEBUG='-g3 -DXDEBUG' MODSTRIP=
.PHONY: strip
strip: all
strip --strip-debug --discard-locals $(PROGS)
.PHONY: clean
clean:
@-$(RM) $(PROJECT) $(OBJECTS)
$(PROJECT): $(OBJECTS)
$(AR) rcs $@ $^
@-$(RM) $(PROGS) $(LIBS) $(LIBD) $(OBJS) core 2>/dev/null
%.o: @srcdir@/%.cpp $(INCFILES)
$(COMPILE) -c $<
@ -64,3 +74,9 @@ $(PROJECT): $(OBJECTS)
Makefile: @srcdir@/Makefile.in ../../config.status
cd ../.. && ./config.status
../../$(LIBD_VER): $(OBJS)
$(LINK) -o $@ $(SONAME_OPT)$(LIBD_VER) $^ $(QT4_LIB) $(YATELIBS)
../../$(LIBD_DEV): ../../$(LIBD_VER)
cd ../.. && ln -sf $(LIBD_VER) $(LIBD_DEV)

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,8 @@ class QtClient; // The QT based client
class QtDriver; // The QT based telephony driver
class QtWindow; // A QT window
class QtDialog; // A custom modal dialog
class QtUIWidgetItemProps; // Widget container item properties
class QtUIWidget; // A widget container
class QtCustomObject; // A custom QT object
class QtCustomWidget; // A custom QT widget
class QtTable; // A custom QT table widget
@ -120,6 +122,22 @@ class YQT4_API QtClient : public Client
{
friend class QtWindow;
public:
/**
* Generic position flags
*/
enum QtClientPos {
PosNone = 0,
PosLeft = 0x01,
PosRight = 0x02,
PosTop = 0x04,
PosBottom = 0x08,
// Corners
CornerTopLeft = PosTop | PosLeft,
CornerTopRight = PosTop | PosRight,
CornerBottomLeft = PosBottom | PosLeft,
CornerBottomRight = PosBottom | PosRight,
};
QtClient();
virtual ~QtClient();
virtual void run();
@ -324,6 +342,13 @@ public:
*/
static void copyParams(QStringList& dest, const NamedList& src);
/**
* Build QObject properties from list
* @param obj The object
* @param props Comma separated list of properties. Format: name=type
*/
static void buildProps(QObject* obj, const String& props);
/**
* Build custom UI widgets from frames owned by a widget
* @param parent Parent widget
@ -411,6 +436,28 @@ public:
static bool connectObjects(QObject* sender, const char* signal,
QObject* receiver, const char* slot);
/**
* Safely delete a QObject. Disconnect it, reset its parent, calls its deleteLater() method
* @param obj The object to delete
*/
static void deleteLater(QObject* obj);
/**
* Retrieve unavailable space position (if any) in the screen containing a given widget.
* The positions are set using the difference between screen geometry and available geometry
* @param w The widget
* @param pos Unavailable screen space if any (QtClientPos combination)
* @return Valid pointer to global desktop widget on success
*/
static QDesktopWidget* getScreenUnavailPos(QWidget* w, int& pos);
/**
* Move a window to a specified position
* @param w The window to move
* @param pos A corner position
*/
static void moveWindow(QtWindow* w, int pos);
protected:
virtual void loadWindows(const char* file = 0);
private:
@ -617,6 +664,20 @@ public:
return QtClient::connectObjects(b,SIGNAL(toggled(bool)),this,SLOT(toggled(bool)));
}
/**
* Connect an object's text changed signal to window's slot
* @param obj The object to connect
* @return True on success
*/
bool connectTextChanged(QObject* obj);
/**
* Notify text changed to the client
* @param obj The object sending the notification
* @param text Optional object text
*/
void notifyTextChanged(QObject* obj, const QString& text = QString());
/**
* Load a widget from file
* @param fileName UI filename to load
@ -641,6 +702,13 @@ public:
inline QtWindow* parentWindow() const
{ return qobject_cast<QtWindow*>(parentWidget() ? parentWidget()->window() : 0); }
/**
* Check if this window is shown normal (not maximixed, minimized or full screen)
* @return True if the window is not maximixed, minimized or full screen
*/
inline bool isShownNormal() const
{ return !(isMaximized() || isMinimized() || isFullScreen()); }
protected:
// Notify client on selection changes
inline bool select(const String& name, const String& item,
@ -672,7 +740,10 @@ public slots:
// Choose file window was cancelled
void chooseFileRejected();
// Text changed slot. Notify the client
void textChanged(const QString& text);
void textChanged(const QString& text)
{ notifyTextChanged(sender(),text); }
void textChanged()
{ notifyTextChanged(sender()); }
private slots:
void openUrl(const QString& link);
@ -681,10 +752,8 @@ protected:
virtual void doPopulate();
virtual void doInit();
// Methods inherited from QWidget
virtual void moveEvent(QMoveEvent* event)
{ updatePosSize(); }
virtual void resizeEvent(QResizeEvent* event)
{ updatePosSize(); }
virtual void moveEvent(QMoveEvent* event);
virtual void resizeEvent(QResizeEvent* event);
virtual bool event(QEvent* ev);
virtual void mousePressEvent(QMouseEvent* event);
virtual void mouseReleaseEvent(QMouseEvent* event);
@ -695,8 +764,6 @@ protected:
if (handleContextMenuEvent(ev,wndWidget()))
ev->accept();
}
// Update window position and size
void updatePosSize();
// Get the widget with this window's content
inline QWidget* wndWidget()
{ return findChild<QWidget*>(m_widget); }
@ -707,8 +774,8 @@ protected:
String m_oldId; // Old id used to retreive the config section in .rc
int m_x;
int m_y;
int m_width;
int m_height;
int m_width; // Client area width
int m_height; // Client area height
bool m_maximized;
bool m_mainWindow; // Main window flag: close app when this window is closed
QString m_widget; // The widget with window's content
@ -795,18 +862,399 @@ protected slots:
protected:
// Destroy the dialog
virtual void closeEvent(QCloseEvent* event);
// Destroy the dialog
virtual void reject();
String m_notifyOnClose; // Action to notify when closed
QString m_context; // Dialog context
};
/**
* This class holds data about a widget container item
* @short Widget container item properties
*/
class QtUIWidgetItemProps : public String
{
public:
/**
* Constructor
* @param type Item type
*/
explicit inline QtUIWidgetItemProps(const String& type)
: String(type)
{}
String m_ui; // Item UI file
String m_styleSheet; // Item style sheet when not selected
String m_selStyleSheet; // Item selected style
};
/**
* This class holds a basic widget container with functions to rename children
* @short A widget container
*/
class YQT4_API QtUIWidget : public UIWidget
{
YCLASS(QtUIWidget,UIWidget)
public:
/**
* Constructor
* @param name Object name
* @param params Object parameters
* @param parent Optional parent
*/
inline QtUIWidget(const char* name)
: UIWidget(name)
{}
/**
* Build a child name from this one
* @param buf Destination buffer
* @param item Child name
* @return The destination buffer
*/
inline String& buildChildName(String& buf, const String& item)
{ return buildChildName(buf,name(),item); }
/**
* Build a container QString child name
* @param item Child name
* @return QString child name
*/
inline QString buildQChildName(const String& item)
{ return buildQChildName(name(),item); }
/**
* Retrieve item type definition
* @param type Item type name
* @return QtUIWidgetItemProps pointer or 0
*/
inline QtUIWidgetItemProps* getItemProps(const String& type) {
ObjList* o = m_itemProps.find(type);
return o ? static_cast<QtUIWidgetItemProps*>(o->get()) : 0;
}
/**
* Retrieve item type definition from [type:]value. Create it if not found
* @param in Input string
* @param value Item property value
* @return QtUIWidgetItemProps pointer or 0
*/
virtual QtUIWidgetItemProps* getItemProps(QString& in, String& value);
/**
* Retrieve the list of properties to save
* @return The list of properties to save
*/
QStringList saveProps()
{ return m_saveProps; }
/**
* Set the list of properties to save
* @param list The new list of properties to save
*/
void setSaveProps(QStringList list)
{ m_saveProps = list; }
/**
* Retrieve a QObject descendent of this object
* @return QObject pointer or 0
*/
virtual QObject* getQObject()
{ return 0; }
/**
* Retrieve the window owning this object
* @return QtWindow pointer or 0
*/
virtual QtWindow* getWindow()
{ return QtClient::parentWindow(getQObject()); }
/**
* Set widget's parameters.
* Handle an 'applyall' parameter carrying a NamedList to apply to all items
* @param params List of parameters
* @return True if all parameters could be set
*/
virtual bool setParams(const NamedList& params);
/**
* Retrieve a QObject list containing container items
* @return The list of container items
*/
virtual QList<QObject*> getContainerItems()
{ return QList<QObject*>(); }
/**
* Find an item widget by id
* @param id Item id
* @return QWidget pointer or 0
*/
virtual QWidget* findItem(const String& id);
/**
* Apply a list of parameters to all container items
* @return The list of parameters to apply
*/
virtual void applyAllParams(const NamedList& params);
/**
* Retrieve the object identity from '_yate_identity' property or name
* Retrieve the object item from '_yate_widgetlistitem' property.
* Set 'identity' to object_identity[:item_name]
* @param obj The object
* @param identiy Destination buffer
*/
virtual void getIdentity(QObject* obj, String& identity);
/**
* Update an item object and children from a list a parameters
* @param parent Parent object
* @param params The list of parameters
* @return True on success
*/
virtual bool setParams(QObject* parent, const NamedList& params);
/**
* Get an item object's parameters
* @param parent The object
* @param params Parameter list
* @return True on success
*/
virtual bool getParams(QObject* parent, NamedList& params);
/**
* Retrieve object slots
* @param actionSlot Action (triggerred) slot
* @param toggleSlot Toggled slot
* @param selectSlot Selection change slot
*/
virtual void getSlots(String& actionSlot, String& toggleSlot, String& selectSlot) {
actionSlot = SLOT(itemChildAction());
toggleSlot = SLOT(itemChildToggle(bool));
selectSlot = SLOT(itemChildSelect());
}
/**
* Select an item by its index
* @param index Item index to select
* @return True on success
*/
virtual bool setSelectIndex(int index)
{ return false; }
/**
* Retrieve the 0 based index of the current item
* @return The index of the current item (-1 on error or container empty)
*/
virtual int currentItemIndex()
{ return -1; }
/**
* Retrieve the number of items in container
* @return The number of items in container (-1 on error)
*/
virtual int itemCount()
{ return -1; }
/**
* Build a child's widget menu. Connect actions to container slots
* @param w The widget
* @param params Menu params
* @param child Optional widget child target
* @param set True to set the menu, false to build it and just return it
* @return QMenu pointer or 0
*/
QMenu* buildWidgetItemMenu(QWidget* w, const NamedList* params,
const String& child = String::empty(), bool set = true);
/**
* Build a container child name
* @param buf Destination buffer
* @param name Container widget name
* @param item Child name
* @return The destination buffer
*/
static inline String& buildChildName(String& buf, const String& name,
const String& item) {
buf = name + "_" + item;
return buf;
}
/**
* Build a container child name
* @param name Container widget name
* @param item Child name
* @return QString child name
*/
static inline QString buildQChildName(const QString& name, const QString& item)
{ return name + "_" + item; }
/**
* Build a container QString child name
* @param name Container widget name
* @param item Child name
* @return QString child name
*/
static inline QString buildQChildName(const String& name, const String& item) {
String buf;
return QtClient::setUtf8(buildChildName(buf,name,item));
}
/**
* Set the list item id property to a list item object
* @param obj The object
* @param item Item id property value
*/
static inline void setListItemIdProp(QObject* obj, const QString& item)
{ obj->setProperty("_yate_widgetlistitemid",QVariant(item)); }
/**
* Retrieve the list item id property from a list item object
* @param obj The object
* @param item Destination string
*/
static inline void getListItemIdProp(QObject* obj, String& item)
{ QtClient::getProperty(obj,"_yate_widgetlistitemid",item); }
/**
* Set the list item property for an item's child object
* @param obj The object
* @param item Item property value
*/
static inline void setListItemProp(QObject* obj, const QString& item)
{ obj->setProperty("_yate_widgetlistitem",QVariant(item)); }
/**
* Retrieve the list item property from an item's child object
* @param obj The object
* @param item Destination string
*/
static inline void getListItemProp(QObject* obj, String& item)
{ QtClient::getProperty(obj,"_yate_widgetlistitem",item); }
/**
* Retrieve the top level QtUIWidget container parent of an object
* @param obj The object
* @return QtUIWidget pointer or 0 if not found
*/
static QtUIWidget* container(QObject* obj);
protected:
/**
* Default constructor
*/
QtUIWidget()
{}
/**
* Initialize navigation controls
* @param params Parameter list
*/
void initNavigation(const NamedList& params);
/**
* Update navigation controls
*/
void updateNavigation();
/**
* Trigger a custom action from an item. Build a list of parameters containing
* the 'item' and the 'list' object identity
* @param item The item id
* @param action The action name to trigger
* @param sender Optional sender (set it to 0 to use getQObject())
*/
void triggerAction(const String& item, const String& action, QObject* sender = 0);
/**
* Handle a child's action. Retrieve the object identity (using getIdentity()) and
* notify the action 'sender_identity:sender_item_name' to the client
* Internally handle next/prev actions if set
* @param sender The sender
*/
virtual void onAction(QObject* sender);
/**
* Handle a child's action. Retrieve the object identity (using getIdentity()) and
* notify the toggled 'sender_identity:sender_item_name' event to the client
* @param sender The sender
* @param on Toggle status
*/
virtual void onToggle(QObject* sender, bool on);
/**
* Handle a child's selection change. Retrieve the object identity and
* notify the select 'sender_identity:sender_item_name' event to the client.
* @param sender The sender
* @param item Optional selected item if any. Set it to 0 to detect it
*/
virtual void onSelect(QObject* sender, const String* item = 0);
/**
* Load an item's widget. Rename children.
* Set '_yate_widgetlistitemid' widget property to given name.
* Set '_yate_widgetlistitem' to item for each child.
* Connect signals for children not having a '_yate_autoconnect' property set to false.
* Install event filter for children with '_yate_filterevents' property set to true.
* @param parent Parent widget
* @param name Widget name
* @param ui UI file to load
* @return QWidget pointer or 0
*/
QWidget* loadWidget(QWidget* parent, const String& name, const String& ui);
/**
* Load an item's widget using a given type
* @param parent Parent widget
* @param name Widget name
* @param type Item type
* @return QWidget pointer or 0
*/
inline QWidget* loadWidgetType(QWidget* parent, const String& name, const String& type) {
QtUIWidgetItemProps* p = getItemProps(type);
if (p && p->m_ui)
return loadWidget(parent,name,p->m_ui);
return 0;
}
/**
* Apply a QWidget style sheet. Replace ${name} with widget name in style
* @param name The widget
* @param style The style sheet to apply
*/
void applyWidgetStyle(QWidget* w, const String& style);
/**
* Filter key press events. Retrieve an action associated with the key.
* Check if the object is allowed to process the key.
* Raise the action
* @param obj The object
* @param event QKeyEvent event to process
* @param filter Filter key or let the object process it
* @return True if processed, false if no key was filtered
*/
bool filterKeyEvent(QObject* watched, QKeyEvent* event, bool& filter);
ObjList m_itemProps;
QStringList m_saveProps; // List of properties to be automatically
// saved/restored when window owning
// this object is initialized/destroyed
// Navigation
String m_prev; // Goto previous item action
String m_next; // Goto next item action
String m_info; // Info widget: current index, total ...
String m_infoFormat; // Data to be displayed in info
String m_title; // Current item title widget name
};
/**
* This class encapsulates a custom QT object
* @short A custom QT object
*/
class YQT4_API QtCustomObject : public QObject, public UIWidget
class YQT4_API QtCustomObject : public QObject, public QtUIWidget
{
YCLASS(QtCustomObject,UIWidget)
YCLASS(QtCustomObject,QtUIWidget)
Q_CLASSINFO("QtCustomObject","Yate")
Q_OBJECT
public:
@ -816,9 +1264,16 @@ public:
* @param parent Optional parent object
*/
inline QtCustomObject(const char* name, QObject* parent = 0)
: QObject(parent), UIWidget(name)
: QObject(parent), QtUIWidget(name)
{ setObjectName(name); }
/**
* Retrieve a QObject from this one
* @return QObject pointer
*/
virtual QObject* getQObject()
{ return static_cast<QObject*>(this); }
/**
* Parent changed notification
*/
@ -833,9 +1288,9 @@ private:
* This class encapsulates a custom QT widget
* @short A custom QT widget
*/
class YQT4_API QtCustomWidget : public QWidget, public UIWidget
class YQT4_API QtCustomWidget : public QWidget, public QtUIWidget
{
YCLASS(QtCustomWidget,UIWidget)
YCLASS(QtCustomWidget,QtUIWidget)
Q_CLASSINFO("QtCustomWidget","Yate")
Q_OBJECT
public:
@ -845,9 +1300,16 @@ public:
* @param parent Optional parent widget
*/
inline QtCustomWidget(const char* name, QWidget* parent = 0)
: QWidget(parent), UIWidget(name)
: QWidget(parent), QtUIWidget(name)
{ setObjectName(name); }
/**
* Retrieve a QObject from this one
* @return QObject pointer
*/
virtual QObject* getQObject()
{ return static_cast<QObject*>(this); }
private:
QtCustomWidget() {} // No default constructor
};
@ -856,9 +1318,9 @@ private:
* This class encapsulates a custom QT table
* @short A custom QT table widget
*/
class YQT4_API QtTable : public QTableWidget, public UIWidget
class YQT4_API QtTable : public QTableWidget, public QtUIWidget
{
YCLASS(QtTable,UIWidget)
YCLASS(QtTable,QtUIWidget)
Q_CLASSINFO("QtTable","Yate")
Q_OBJECT
public:
@ -868,13 +1330,50 @@ public:
* @param parent Optional parent widget
*/
inline QtTable(const char* name, QWidget* parent = 0)
: QTableWidget(parent), UIWidget(name)
: QTableWidget(parent), QtUIWidget(name)
{ setObjectName(name); }
/**
* Retrieve a QObject from this one
* @return QObject pointer
*/
virtual QObject* getQObject()
{ return static_cast<QObject*>(this); }
private:
QtTable() {} // No default constructor
};
/**
* This class encapsulates a custom QT tree
* @short A custom QT tree widget
*/
class YQT4_API QtTree : public QTreeWidget, public QtUIWidget
{
YCLASS(QtTree,QtUIWidget)
Q_CLASSINFO("QtTree","Yate")
Q_OBJECT
public:
/**
* Constructor
* @param name Tree's name
* @param parent Optional parent widget
*/
inline QtTree(const char* name, QWidget* parent = 0)
: QTreeWidget(parent), QtUIWidget(name)
{ setObjectName(name); }
/**
* Retrieve a QObject from this one
* @return QObject pointer
*/
virtual QObject* getQObject()
{ return static_cast<QObject*>(this); }
private:
QtTree() {} // No default constructor
};
/**
* QT specific sound
* @short A QT client sound
@ -891,7 +1390,7 @@ public:
*/
inline QtSound(const char* name, const char* file, const char* device = 0)
: ClientSound(name,file,device), m_sound(0)
{}
{ m_native = true; }
protected:
virtual bool doStart();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -103,7 +103,7 @@ PROGS := $(PROGS) client/coreaudio.yate
endif
ifneq (@HAVE_QT4@,no)
PROGS := $(PROGS) qt4/updater.yate
PROGS := $(PROGS) qt4/updater.yate qt4/customtable.yate qt4/customtext.yate qt4/customtree.yate qt4/widgetlist.yate
endif
ifneq (@HAVE_ZAP@,no)
@ -342,6 +342,14 @@ qt4/updater.yate: qt4/updater.moc
qt4/updater.yate: LOCALFLAGS = $(QT4_INC_NET)
qt4/updater.yate: LOCALLIBS = $(QT4_LIB_NET)
qt4/customtable.yate: qt4/customtable.moc
qt4/customtext.yate: qt4/customtext.moc
qt4/customtree.yate: qt4/customtree.moc
qt4/widgetlist.yate: qt4/widgetlist.moc
qt4/customtable.yate qt4/customtext.yate qt4/customtree.yate qt4/widgetlist.yate: ../libyateqt4.so
qt4/customtable.yate qt4/customtext.yate qt4/customtree.yate qt4/widgetlist.yate: LOCALFLAGS = $(QT4_INC_NET)
qt4/customtable.yate qt4/customtext.yate qt4/customtree.yate qt4/widgetlist.yate: LOCALLIBS = $(QT4_LIB_NET) -lyateqt4
server/sipfeatures.yate: ../libs/yxml/libyatexml.a
server/sipfeatures.yate: LOCALFLAGS = -I@top_srcdir@/libs/yxml
server/sipfeatures.yate: LOCALLIBS = -L../libs/yxml -lyatexml
@ -386,6 +394,9 @@ server/ysnmpagent.yate: LOCALLIBS = -L../libs/yasn -lyasn -L../libs/ysnmp -lysnm
../libs/ypbx/libyatepbx.a:
$(MAKE) -C ../libs/ypbx
../libyateqt4.so:
$(MAKE) -C ../clients/qt4
../libs/yasn/libyasn.a:
$(MAKE) -C ../libs/yasn

704
modules/qt4/customtable.cpp Normal file
View File

@ -0,0 +1,704 @@
/**
* customtable.cpp
* This file is part of the YATE Project http://YATE.null.ro
*
* Custom table implementation
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2010 Null Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "customtable.h"
using namespace TelEngine;
namespace { // anonymous
// The factory
class CustomTableFactory : public UIFactory
{
public:
inline CustomTableFactory(const char* name = "CustomTableFactory")
: UIFactory(name)
{ m_types.append(new String("CustomTable")); }
virtual void* create(const String& type, const char* name, NamedList* params = 0);
};
// Utility class used to disable/enable a table sorting and widget update flag
class SafeWidget
{
public:
SafeWidget(QTableWidget* table)
: m_widget(table), m_table(0) {
if (m_widget)
m_widget->setUpdatesEnabled(false);
if (table && table->isSortingEnabled()) {
m_table = table;
m_table->setSortingEnabled(false);
}
}
~SafeWidget()
{ drop(); }
inline void drop() {
if (m_table)
m_table->setSortingEnabled(true);
if (m_widget)
m_widget->setUpdatesEnabled(true);
m_widget = 0;
m_table = 0;
}
private:
QWidget* m_widget;
QTableWidget* m_table;
};
static CustomTableFactory s_factory;
static inline const String& objListItem(ObjList* list, int index)
{
GenObject* gen = list ? (*list)[index] : 0;
return gen ? gen->toString() : String::empty();
}
/*
* CustomTable
*/
// Constructor for a custom table
CustomTable::CustomTable(const char *name, const NamedList& params, QWidget* parent)
: QtTable(name,parent),
m_rowHeight(0), m_horzHeader(true),
m_notifyItemChanged(false), m_notifySelChgOnRClick(true),
m_contextMenu(0), m_changing(false)
{
// Build properties
QtClient::buildProps(this,params["buildprops"]);
// Set horizontal header
QHeaderView* h = horizontalHeader();
if (h)
h->setHighlightSections(false);
ObjList* cols = params["hheader_columns"].split(',',false);
ObjList* title = params["hheader_columns_title"].split(',',true);
ObjList* check = params["hheader_columns_check"].split(',',false);
ObjList* size = params["hheader_columns_size"].split(',',true);
ObjList* resize = params["hheader_columns_resize"].split(',',true);
int n = cols->count();
setColumnCount(n);
for (int i = 0; i < n; i++) {
String id = objListItem(cols,i);
String text = objListItem(title,i);
if (!text)
text = id;
QTableWidgetItem* it = new QTableWidgetItem(QtClient::setUtf8(text));
id.toLower();
it->setData(ColumnId,QVariant(QtClient::setUtf8(id)));
if (check->find(id))
it->setData(ColumnItemCheckable,QVariant(true));
setHorizontalHeaderItem(i,it);
if (!h)
continue;
// Set column width
int w = objListItem(size,i).toInteger();
if (w > 0)
h->resizeSection(i,w);
// Set column resize mode
const String& resizeMode = objListItem(resize,i);
if (resizeMode == "fixed")
h->setResizeMode(i,QHeaderView::Fixed);
else if (resizeMode == "stretch")
h->setResizeMode(i,QHeaderView::Stretch);
else if (resizeMode == "contents")
h->setResizeMode(i,QHeaderView::ResizeToContents);
else
h->setResizeMode(i,QHeaderView::Interactive);
}
TelEngine::destruct(cols);
TelEngine::destruct(title);
TelEngine::destruct(check);
TelEngine::destruct(size);
TelEngine::destruct(resize);
// Init properties
m_saveProps << "_yate_col_widths";
m_saveProps << "_yate_sorting";
setSelectionMode(QAbstractItemView::SingleSelection);
setSelectionBehavior(QAbstractItemView::SelectRows);
setEditTriggers(QAbstractItemView::NoEditTriggers);
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
// Connect signals
QtClient::connectObjects(this,SIGNAL(cellChanged(int,int)),this,SLOT(itemCellChanged(int,int)));
// Apply parameters
setParams(params);
}
CustomTable::~CustomTable()
{
}
bool CustomTable::setParams(const NamedList& params)
{
SafeWidget tbl(this);
QtUIWidget::setParams(params);
unsigned int n = params.length();
for (unsigned int i = 0; i < n; i++) {
NamedString* param = params.getParam(i);
if (!param)
continue;
if (param->name() == "filtervalue")
setFilter(*param);
else if (param->name() == "dynamiccellclicked")
setProperty("dynamicCellClicked",QVariant(QString(*param)));
else if (param->name() == "dynamicnoitemselchanged")
setProperty("dynamicNoItemSelChanged",QVariant(QString(*param)));
else if (param->name().startsWith("property:")) {
String prop = param->name().substr(9);
QWidget* target = this;
if (prop.startSkip("hheader:",false))
target = horizontalHeader();
if (target)
QtClient::setProperty(target,prop,*param);
}
else if (param->name() == "menu") {
// Re-build the context menu
if (m_contextMenu) {
QtClient::deleteLater(m_contextMenu);
m_contextMenu = 0;
}
NamedList* menu = static_cast<NamedList*>(param->getObject("NamedList"));
if (menu) {
// Get parent window receiving menu events
QtWindow* wnd = static_cast<QtWindow*>(window());
if (wnd)
m_contextMenu = QtClient::buildMenu(*menu,*menu,wnd,SLOT(action()),
SLOT(toggled(bool)),this);
}
}
else if (param->name() == "notifyselchgonrightclick")
m_notifySelChgOnRClick = param->toBoolean(m_notifySelChgOnRClick);
else if (param->name() == "filterby") {
setFilter();
m_filterBy.clear();
ObjList* list = param->split(',',false);
for (ObjList* o = list->skipNull(); o; o = o->skipNext()) {
String* s = static_cast<String*>(o->get());
m_filterBy.append(QtClient::setUtf8(s->toLower()));
}
TelEngine::destruct(list);
}
}
tbl.drop();
return true;
}
bool CustomTable::getOptions(NamedList& items)
{
int n = rowCount();
for (int i = 0; i < n; i++) {
String id;
if (getId(id,i) && id)
items.addParam(id,"");
}
return true;
}
bool CustomTable::addTableRow(const String& item, const NamedList* data, bool atStart)
{
DDebug(ClientDriver::self(),DebugAll,"CustomTable(%s)::addTableRow(%s,%p,%u)",
name().c_str(),item.c_str(),data,atStart);
SafeWidget tbl(this);
int row = atStart ? 0 : rowCount();
insertRow(row);
if (setRow(row,data,item))
return true;
removeRow(row);
return false;
}
// Add or set one or more table row(s). Screen update is locked while changing the table.
// Each data list element is a NamedPointer carrying a NamedList with item parameters.
// The name of an element is the item to update.
// Set element's value to boolean value 'true' to add a new item if not found
// or 'false' to set an existing one. Set it to empty string to delete the item
bool CustomTable::updateTableRows(const NamedList* data, bool atStart)
{
if (!data)
return true;
DDebug(ClientDriver::self(),DebugAll,"CustomTable(%s)::updateTableRows(%p,%u)",
name().c_str(),data,atStart);
// Remember selected item
bool ok = true;
SafeWidget tbl(this);
unsigned int n = data->length();
ObjList add;
// Delete and update rows
for (unsigned int i = 0; i < n; i++) {
if (Client::exiting())
break;
// Get item and the list of parameters
NamedString* ns = data->getParam(i);
if (!ns)
continue;
// Delete ?
if (ns->null()) {
int row = getRow(ns->name());
if (row >= 0)
removeRow(row);
else
ok = false;
continue;
}
// Set item or postpone add
int row = getRow(ns->name());
if (row >= 0)
setRow(row,YOBJECT(NamedList,ns));
else if (ns->toBoolean())
add.append(ns)->setDelete(false);
else
ok = false;
}
n = add.count();
if (n) {
int row = rowCount();
if (row < 0)
row = 0;
// Append if not requested to insert at start or table is empty
if (!(atStart && row))
setRowCount(row + n);
else {
for (unsigned int i = 0; i < n; i++)
insertRow(0);
}
for (ObjList* o = add.skipNull(); o; row++, o = o->skipNext()) {
NamedString* ns = static_cast<NamedString*>(o->get());
if (!setRow(row,YOBJECT(NamedList,ns),ns->name()))
ok = false;
}
}
return ok;
}
bool CustomTable::delTableRow(const String& item)
{
SafeWidget tbl(this);
int row = getRow(item);
DDebug(ClientDriver::self(),DebugAll,"CustomTable(%s)::delTableRow(%s) found=%d",
name().c_str(),item.c_str(),row);
if (row < 0)
return false;
removeRow(row);
return true;
}
bool CustomTable::setTableRow(const String& item, const NamedList* data)
{
SafeWidget tbl(this);
int row = getRow(item);
DDebug(ClientDriver::self(),DebugAll,"CustomTable(%s)::setTableRow(%s,%p) found=%d",
name().c_str(),item.c_str(),data,row);
if (row < 0)
return false;
return setRow(row,data);
}
bool CustomTable::getTableRow(const String& item, NamedList* data)
{
int row = getRow(item);
DDebug(ClientDriver::self(),DebugAll,"CustomTable(%s)::getTableRow(%s,%p) found=%d",
name().c_str(),item.c_str(),data,row);
if (row < 0)
return false;
if (!data)
return true;
int n = columnCount();
for (int i = 1; i < n; i++) {
String name;
bool checkable = false;
QTableWidgetItem* h = getColumnId(name,checkable,i);
if (!(h && name))
continue;
QTableWidgetItem* it = QTableWidget::item(row,i);
if (!it)
continue;
NamedString* ns = new NamedString(name);
QtClient::getUtf8(*ns,it->text());
data->setParam(ns);
if (checkable)
data->setParam("check:" + name,String::boolText(it->checkState() == Qt::Checked));
}
return true;
}
bool CustomTable::clearTable()
{
setRowCount(0);
return true;
}
// Set the selected entry
bool CustomTable::setSelect(const String& item)
{
if (!item)
return true;
int row = getRow(item);
DDebug(ClientDriver::self(),DebugAll,"CustomTable(%s)::setSelect(%s) found=%d",
name().c_str(),item.c_str(),row);
if (row < 0)
return false;
setCurrentCell(row,1);
return true;
}
bool CustomTable::getSelect(String& item)
{
int row = currentRow();
QTableWidgetItem* it = 0;
if (row >= 0) {
it = QTableWidget::item(row,0);
if (it)
QtClient::getUtf8(item,it->text());
}
DDebug(ClientDriver::self(),DebugAll,"CustomTable(%s)::getSelect() found=(%d,%s)",
name().c_str(),row,item.c_str());
return it != 0;
}
// Find a table row by its item id
int CustomTable::getRow(const String& item)
{
const QString tmp = QtClient::setUtf8(item);
for (int i = 0; i < rowCount(); i++) {
QTableWidgetItem* it = this->item(i,0);
if (it && it->text() == tmp)
return i;
}
return -1;
}
// Find a table row id by its row index
bool CustomTable::getId(String& item, int row)
{
QTableWidgetItem* it = this->item(row,0);
if (it)
QtClient::getUtf8(item,it->text());
return it != 0;
}
// Find a column by its label. Return -1 if not found
QTableWidgetItem* CustomTable::getColumnId(String& id, bool& checkable, int col)
{
QTableWidgetItem* it = horizontalHeaderItem(col);
if (!it)
return 0;
QVariant var = it->data(ColumnId);
if (var.type() == QVariant::String)
QtClient::getUtf8(id,var.toString());
else {
QtClient::getUtf8(id,it->text());
id.toLower();
}
var = it->data(ColumnItemCheckable);
checkable = var.toBool();
return it;
}
// Find a column by its label. Return -1 if not found
int CustomTable::getColumn(const QString& name, bool hidden, bool caseInsensitive)
{
static QString ht("hidden:");
QString what = name;
if (hidden)
what.insert(0,ht);
Qt::CaseSensitivity cs = caseInsensitive ? Qt::CaseInsensitive : Qt::CaseSensitive;
int n = columnCount();
for (int i = 0; i < n; i++) {
QTableWidgetItem* it = horizontalHeaderItem(i);
if (!it)
continue;
QVariant var = it->data(ColumnId);
if (var.type() == QVariant::String) {
if (0 == var.toString().compare(what,cs))
return i;
}
else if (0 == it->text().compare(what,cs))
return i;
}
return -1;
}
// (de)activate enter key press action
void CustomTable::setEnterPressNotify(bool value)
{
QAction* act = qFindChild<QAction*>(this,m_enterKeyActionName);
if (act) {
if (!value) {
QWidget::removeAction(act);
QtClient::deleteLater(act);
}
return;
}
if (!value)
return;
act = new QAction("",this);
act->setObjectName(m_enterKeyActionName);
act->setShortcut(QKeySequence(Qt::Key_Return));
act->setShortcutContext(Qt::WidgetShortcut);
act->setProperty("_yate_autoconnect",QVariant(false));
QWidget::addAction(act);
QtClient::connectObjects(act,SIGNAL(triggered()),this,SLOT(actionTriggered()));
}
// Retrieve table columns widths
QString CustomTable::getColWidths()
{
String widths;
int n = columnCount();
for (int i = 0; i < n; i++)
widths.append(String(columnWidth(i)),",",true);
return QtClient::setUtf8(widths);
}
// Set the table columns widths string
void CustomTable::setColWidths(QString value)
{
QStringList list = value.split(',');
for (int i = 0; i < list.size(); i++) {
bool ok = true;
int w = list[i].toInt(&ok);
if (ok && w >= 0)
setColumnWidth(i,w);
}
}
// Retrieve table sorting
QString CustomTable::getSorting()
{
String sorting;
if (isSortingEnabled()) {
QHeaderView* h = horizontalHeader();
int col = h ? h->sortIndicatorSection() : -1;
if (col >= 0)
sorting << col << "," <<
String::boolText(Qt::AscendingOrder == h->sortIndicatorOrder());
}
return QtClient::setUtf8(sorting);
}
// Set the table sorting
void CustomTable::setSorting(QString value)
{
QStringList list = value.split(',');
if (list.size() < 2)
return;
bool ok = true;
int col = list[0].toInt(&ok);
if (ok && col >= 0 && col < columnCount()) {
String tmp;
QtClient::getUtf8(tmp,list[1]);
sortItems(col,tmp.toBoolean(true) ? Qt::AscendingOrder : Qt::DescendingOrder);
}
}
// Setup a row
bool CustomTable::setRow(int row, const NamedList* data, const String& item)
{
DDebug(ClientDriver::self(),DebugAll,"CustomTable(%s)::setRow(%d,%p,%s)",
name().c_str(),row,data,item.c_str());
m_changing = true;
int n = columnCount();
// First init
if (item) {
// Set row id
setItem(row,0,new QTableWidgetItem(QtClient::setUtf8(item)));
// Set row height
if (m_rowHeight > 0)
QTableWidget::setRowHeight(row,m_rowHeight);
// Set checkable columns
for (int i = 1; i < n; i++) {
String name;
bool checkable = false;
getColumnId(name,checkable,i);
if (!checkable)
continue;
QTableWidgetItem* it = QTableWidget::item(row,i);
if (!it) {
it = new QTableWidgetItem;
setItem(row,i,it);
}
it->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | Qt::ItemIsEnabled);
it->setCheckState(Qt::Unchecked);
}
}
if (!data) {
m_changing = false;
return true;
}
for (int i = 1; i < n; i++) {
String name;
bool checkable = false;
getColumnId(name,checkable,i);
if (!name)
continue;
String* text = data->getParam(name);
String* img = data->getParam(name + "_image");
String* check = checkable ? data->getParam("check:" + name) : 0;
if (!(text || img || check))
continue;
QTableWidgetItem* it = QTableWidget::item(row,i);
if (!it) {
it = new QTableWidgetItem;
setItem(row,i,it);
if (!checkable)
it->setFlags(it->flags() & ~Qt::ItemFlags(Qt::ItemIsUserCheckable));
else {
it->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsSelectable);
it->setCheckState(Qt::Unchecked);
}
}
if (text)
it->setText(QtClient::setUtf8(*text));
if (check)
it->setCheckState(check->toBoolean() ? Qt::Checked : Qt::Unchecked);
if (img)
it->setIcon(QIcon(QtClient::setUtf8(*img)));
}
m_changing = false;
return true;
}
// Handle item cell content changes
void CustomTable::onCellChanged(int row, int col)
{
if (m_changing || row < 0 || !m_notifyItemChanged)
return;
String item;
getId(item,row);
if (item)
triggerAction(item,"listitemchanged",this);
}
void CustomTable::contextMenuEvent(QContextMenuEvent* e)
{
int yMax = rowCount() * rowHeight(0);
if (yMax < e->y())
return;
if (m_contextMenu)
m_contextMenu->exec(e->globalPos());
}
// Catch a mouse press event
// Disable selection change signal on right button events
void CustomTable::mousePressEvent(QMouseEvent* event)
{
if (event->button() == Qt::RightButton && !m_notifySelChgOnRClick) {
int row = rowAt(event->y());
if (row >= 0 && row != currentRow()) {
// Disconnect and re-connect only if connected
QtWindow* wnd = 0;
QVariant var = property("dynamicNoItemSelChanged");
if (!var.toBool())
wnd = QtClient::parentWindow(this);
if (wnd)
disconnect(this,SIGNAL(itemSelectionChanged()),
wnd,SLOT(selectionChanged()));
setCurrentCell(row,1);
if (wnd)
QtClient::connectObjects(this,SIGNAL(itemSelectionChanged()),
wnd,SLOT(selectionChanged()));
event->accept();
}
return;
}
QTableWidget::mousePressEvent(event);
}
// Slot for triggered signals received from actions added to the table
void CustomTable::actionTriggered()
{
if (!sender() || currentRow() < 0)
return;
if (sender()->objectName() == m_enterKeyActionName)
onAction(this);
}
// Set filter (hide not matching items)
void CustomTable::setFilter(const String& value)
{
DDebug(ClientDriver::self(),DebugAll,"CustomTable(%s)::setFilter(%s)",
name().c_str(),value.c_str());
SafeWidget tbl(this);
QString tmp = QtClient::setUtf8(value);
if (tmp == m_filterValue)
return;
m_filterValue = tmp;
// Match rows and show or hide them
int rows = rowCount();
int cols = columnCount();
for (int row = 0; row < rows; row++)
for (int col = 0; col < cols; col++)
if (updateFilter(row,col))
break;
}
// Check if the current filter matches a row. Show it if matched, hide it otherwise.
bool CustomTable::updateFilter(int row, int col)
{
bool hide = !rowFilterMatch(row,col);
if (hide == isRowHidden(row))
return false;
setRowHidden(row,hide);
return true;
}
// Check if the current filter matches a row
bool CustomTable::rowFilterMatch(int row, int col)
{
for (int i = m_filterBy.size() - 1; i >= 0; i--) {
QTableWidgetItem* hdr = horizontalHeaderItem(col);
if (!hdr || hdr->text() != m_filterBy[i])
continue;
QTableWidgetItem* it = item(row,col);
if (it && it->text().contains(m_filterValue,Qt::CaseInsensitive))
return true;
}
return false;
}
/*
* CustomTableFactory
*/
// Build CustomTable
void* CustomTableFactory::create(const String& type, const char* name, NamedList* params)
{
if (!params)
return 0;
QWidget* parentWidget = 0;
String* wndname = params->getParam("parentwindow");
if (!TelEngine::null(wndname)) {
String* wName = params->getParam("parentwidget");
QtWindow* wnd = static_cast<QtWindow*>(Client::self()->getWindow(*wndname));
if (wnd && !TelEngine::null(wName))
parentWidget = qFindChild<QWidget*>(wnd,QtClient::setUtf8(*wName));
}
if (type == "CustomTable")
return new CustomTable(name,*params,parentWidget);
return 0;
}
}; // anonymous namespace
#include "customtable.moc"
/* vi: set ts=8 sw=4 sts=4 noet: */

401
modules/qt4/customtable.h Normal file
View File

@ -0,0 +1,401 @@
/**
* customtable.h
* This file is part of the YATE Project http://YATE.null.ro
*
* A custom table
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2006 Null Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __CUSTOMTABLE_H
#define __CUSTOMTABLE_H
#include <qt4client.h>
using namespace TelEngine;
namespace { // anonymous
class CustomTable : public QtTable
{
YCLASS(CustomTable,QtTable)
Q_CLASSINFO("CustomTable","Yate")
Q_OBJECT
Q_PROPERTY(QStringList _yate_save_props READ saveProps WRITE setSaveProps(QStringList))
Q_PROPERTY(bool _yate_notifyitemchanged READ getNotifyItemChanged WRITE setNotifyItemChanged(bool))
Q_PROPERTY(bool _yate_horizontalheader READ getHHeader WRITE setHHeader(bool))
Q_PROPERTY(bool _yate_notifyonenterpressed READ enterPressNotify WRITE setEnterPressNotify(bool))
Q_PROPERTY(int _yate_rowheight READ getRowHeight WRITE setRowHeight(int))
Q_PROPERTY(QString _yate_col_widths READ getColWidths WRITE setColWidths(QString))
Q_PROPERTY(QString _yate_sorting READ getSorting WRITE setSorting(QString))
public:
/**
* Table item data roles
*/
enum CustomRoles {
ColumnId = Qt::UserRole + 1, // Column id
ColumnItemCheckable = Qt::UserRole + 2, // Column items are checkable
};
/**
* Constructor
* @param name The name of the table
* @param params Parameters for building the table
* @param parent Optional parent
*/
CustomTable(const char* name, const NamedList& params, QWidget* parent = 0);
/**
* Destructor
*/
~CustomTable();
/**
* Check if the table has a filter set
* @return True if a filter is set
*/
inline bool hasFilter() const
{ return 0 != m_filterBy.count() && m_filterValue.length(); }
/**
* Function for setting the properties of the table
* @param params List that contains the properties to be set and their values
* @return True if it has succeeded, false if it hasn't
*/
virtual bool setParams(const NamedList& params);
/**
* Obtain all the entries that the table contains
* @param items List to be filled with all the entries the table contains
* @return True if there are elements, false if the table is empty
*/
virtual bool getOptions(NamedList& items);
/**
* Add a new entry to the table
* @param item The new entry's object name
* @param data The parameters for building the new entry
* @param asStart True if the entry is to be inserted at the start of
* the table, false if it is to be appended
* @return True if the entry has been added, false otherwise
*/
virtual bool addTableRow(const String& item, const NamedList* data = 0,
bool atStart = false);
/**
* Add or set one or more table row(s). Screen update is locked while changing the table.
* Each data list element is a NamedPointer carrying a NamedList with item parameters.
* The name of an element is the item to update.
* Set element's value to boolean value 'true' to add a new item if not found
* or 'false' to set an existing one. Set it to empty string to delete the item
* @param data The list of items to add/set/delete
* @param atStart True to add new items at start, false to add them to the end
* @return True if the operation was successfull
*/
virtual bool updateTableRows(const NamedList* data, bool atStart = false);
/**
* Delete an entry from the table
* @param item Name of the object to be deleted
* @return True if the entry has been deleted, false otherwise
*/
virtual bool delTableRow(const String& item);
/**
* Set/change the properties of a table entry
* @param item Name of the entry for which the properties will be set
* @param data List of properties to be set and their values
* @return True if the entry has been found and set, false if the entry hasn't been found
*/
virtual bool setTableRow(const String& item, const NamedList* data);
/** Get the values of requested properties for an entry
* @param item Name of the searched entry
* @param data List of the properties for which the value is requested.
* It will be filled wiht the properties' values
* @return True if the entry is found and the list filled,
* false if the entry is not found
*/
virtual bool getTableRow(const String& item, NamedList* data = 0);
/**
* Delete all table content
* @return True if it succeeds
*/
virtual bool clearTable();
/**
* Set the selected entry
* @param item String containing the new selection
* @return True if the operation was successfull
*/
virtual bool setSelect(const String& item);
/**
* Obtain the selected entry
* @param item String in which the selected entry name is to be returned
* @return True if something is selected, false otherwise
*/
virtual bool getSelect(String& item);
/**
* Retrieve the 0 based index of the current item
* @return The index of the current item (-1 on error or container empty)
*/
virtual int currentItemIndex()
{ return QTableWidget::currentRow(); }
/**
* Retrieve the number of items in container
* @return The number of items in container (-1 on error)
*/
virtual int itemCount()
{ return QTableWidget::rowCount(); }
/**
* Find a table row by its item id
* @param item Item name to find
* @return The row or -1 if not found
*/
int getRow(const String& item);
/**
* Find a table row id by its row index
* @param item Item id to fill
* @param row Table row
* @return True if the row item was found
*/
bool getId(String& item, int row);
/**
* Find a table column id by its column index
* @param id Column id to fill
* @param checkable Column checkable flag
* @param row Table row
* @return QTableWidgetItem pointer or 0 if not found
*/
QTableWidgetItem* getColumnId(String& id, bool& checkable, int col);
/**
* Find a column by its label. Return -1 if not found
* @param text Column label text to find
* @param hidden True to find a hidden column (search by 'hidden:' prefix)
* @param caseInsensitive True to make a case insensitive comparison
* @return The column index or -1 if not found
*/
int getColumn(const QString& text, bool hidden = false, bool caseInsensitive = true);
/**
* Find a column by its label. Return -1 if not found
* @param text Column label text to find
* @param hidden True to find a hidden column (search by 'hidden:' prefix)
* @param caseInsensitive True to make a case insensitive comparison
* @return The column index or -1 if not found
*/
inline int getColumn(const char* text, bool hidden = false, bool caseInsensitive = true)
{ return getColumn(QtClient::setUtf8(text),hidden,caseInsensitive); }
/**
* Check if this table is notifying item changed
* @return True if this table is notifying item changed
*/
bool getNotifyItemChanged()
{ return m_notifyItemChanged; }
/**
* Set/reset item changed notification flag
* @param on True to notify item changes, false to disable the notification
*/
void setNotifyItemChanged(bool on)
{ m_notifyItemChanged = on; }
/**
* Check if the horizontal header should be visible
* @return True if the horizontal header should be visible
*/
bool getHHeader()
{ return m_horzHeader; }
/**
* Show/hide the horizontal header
* @param on True to show the horizontal header, false to hide it
*/
void setHHeader(bool on) {
m_horzHeader = on;
QHeaderView* h = horizontalHeader();
if (h)
h->setVisible(on);
}
/**
* Check if enter key press action is active. Does nothing
* This method is here to stop MOC compiler complaining about missing READ accessor function
* @return False
*/
bool enterPressNotify()
{ return false; }
/**
* (de)activate enter key press action
* @param value True to activate the enter key press action, false to disable it
*/
void setEnterPressNotify(bool value);
/**
* Retrieve the table's default row height
* @return Table's default row height
*/
int getRowHeight()
{ return m_rowHeight; }
/**
* Set the table's default row height
* @param value Table's new default row height
*/
void setRowHeight(int value)
{ m_rowHeight = value; }
/**
* Retrieve table columns widths
* @return Comma separated list of columns widths
*/
QString getColWidths();
/**
* Set the table columns widths string
* @param value Comma separated list of columns widths
*/
void setColWidths(QString value);
/**
* Retrieve table sorting
* @return Table sorting string
*/
QString getSorting();
/**
* Set the table sorting
* @param value Table sorting value
*/
void setSorting(QString value);
protected:
/**
* Setup a row
* @param row An existing row index
* @param data Row parameters
* @param item Set the row's id if not empty
* @return True on success
*/
virtual bool setRow(int row, const NamedList* data,
const String& item = String::empty());
/**
* Handle item cell content changes
* @param row Item row
* @param col Item column
*/
virtual void onCellChanged(int row, int col);
/**
* Catch a context menu event and show the context menu
* @param e Context menu event
*/
virtual void contextMenuEvent(QContextMenuEvent* e);
/**
* Catch a mouse press event
* Disable selection change signal on right button events
* @param event Mouse press event
*/
virtual void mousePressEvent(QMouseEvent* event);
protected slots:
/**
* Handle item children actions
*/
void itemChildAction()
{ onAction(sender()); }
/**
* Handle item children toggles
*/
void itemChildToggle(bool on)
{ onToggle(sender(),on); }
/**
* Handle item children select
*/
void itemChildSelect()
{ onSelect(sender()); }
/**
* Handle item cell changed
*/
void itemCellChanged(int row, int col)
{ onCellChanged(row,col); }
/**
* Slot for triggered signals received from actions added to the table
*/
void actionTriggered();
private:
/**
* Set filter (hide not matching items)
* @param value Filter value
*/
void setFilter(const String& value = String::empty());
/**
* Check if the current filter matches a row. Show it if matched, hide it otherwise.
* @param row The row to check
* @param col The column containing the widget to check
* @return True if the row visibility changed
*/
bool updateFilter(int row, int col);
/**
* Check if the current filter matches a row
* @param row The row to check
* @param col The column containing the widget to check
* @return True if match
*/
bool rowFilterMatch(int row, int col);
int m_rowHeight;
bool m_horzHeader; // Show/hide the horizontal header
bool m_notifyItemChanged; // Notify 'listitemchanged' action
bool m_notifySelChgOnRClick; // Notify selection changed on mouse right button click
ObjList* m_uiActions; // The list of actions for which the table
// should enqueue an ui.action message
QMenu* m_contextMenu;
QString m_enterKeyActionName; // The name of the Enter key pressed action
// Filter
QStringList m_filterBy; // List of cell widget children name whose text is used to filter
// the table rows
QString m_filterValue; // The filter value
// Notifications
bool m_changing; // Content is changing from client (not from user):
// avoid notifications
};
}; // anonymous namespace
#endif // __CUSTOMTABLE_H
/* vi: set ts=8 sw=4 sts=4 noet: */

544
modules/qt4/customtext.cpp Normal file
View File

@ -0,0 +1,544 @@
/**
* customtext.cpp
* This file is part of the YATE Project http://YATE.null.ro
*
* Custom text edit objects
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2010 Null Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "customtext.h"
using namespace TelEngine;
namespace { // anonymous
// The factory
class CustomTextFactory : public UIFactory
{
public:
inline CustomTextFactory(const char* name = "CustomFactory")
: UIFactory(name)
{ m_types.append(new String("CustomTextEdit")); }
virtual void* create(const String& type, const char* name, NamedList* params = 0);
};
// Scroll an area to the end if has a vertical scroll bar
class ScrollToEnd
{
public:
inline ScrollToEnd(QAbstractScrollArea* area)
: m_area(area)
{}
inline ~ScrollToEnd() {
QScrollBar* bar = m_area ? m_area->verticalScrollBar() : 0;
if (bar)
bar->setSliderPosition(bar->maximum());
}
private:
QAbstractScrollArea* m_area;
};
static CustomTextFactory s_factory;
// Global list of URL handlers
static NamedList s_urlHandlers("");
// Check if a char is a word break one (including NULL)
static inline bool isWordBreak(char c)
{
return (c == ' ' || c == '\t' || c == '\r' || c == '\n' || !c);
}
// Check if a char should be ignored from URL end (including NULL)
static inline bool isIgnoreUrlEnd(char c)
{
return (c == '.' || c == ';' || c == ':' || c == '?' || c == '!');
}
// Replace plain text chars with HTML escape or markup
static void plain2html(String& buf)
{
static const String htmlBr = "<br>";
static const String htmlAmp = "&amp;";
static const String htmlLt = "&lt;";
static const String htmlGt = "&gt;";
static const String htmlQuot = "&quot;";
unsigned int i = 0;
while (i < buf.length()) {
const String* mark = 0;
if (buf[i] == '\r' || buf[i] == '\n')
mark = &htmlBr;
else if (buf[i] == '&')
mark = &htmlAmp;
else if (buf[i] == '<')
mark = &htmlLt;
else if (buf[i] == '>')
mark = &htmlGt;
else if (buf[i] == '\"')
mark = &htmlQuot;
else {
i++;
continue;
}
// Handle "\r\n" as single <br>
if (buf[i] == '\r' && i != buf.length() - 1 && buf[i + 1] == '\n')
buf = buf.substr(0,i) + *mark + buf.substr(i + 2);
else
buf = buf.substr(0,i) + *mark + buf.substr(i + 1);
i += mark->length();
}
}
// Move a cursor at document start/end.
// Adjust position by 'blocks' count
// Select if required and blocks is not 0
static void moveCursor(QTextCursor& c, bool atStart, int blocks = 0,
bool select = false)
{
c.movePosition(!atStart ? QTextCursor::End : QTextCursor::Start);
if (!blocks)
return;
c.movePosition(!atStart ? QTextCursor::PreviousBlock : QTextCursor::NextBlock,
select ? QTextCursor::KeepAnchor : QTextCursor::MoveAnchor,
blocks > 0 ? blocks : -blocks);
}
/*
* CustomTextFormat
*/
// Constructor. Build a Block type
CustomTextFormat::CustomTextFormat(const String& id, const char* color, const char* bgcolor)
: NamedString(id),
m_type(Block), m_blockFormat(0), m_charFormat(0)
{
m_blockFormat = new QTextBlockFormat;
if (bgcolor)
m_blockFormat->setBackground(QColor(bgcolor));
m_charFormat = new QTextCharFormat;
if (color)
m_charFormat->setForeground(QColor(color));
}
// Constructor. Build a Html/Plain type
CustomTextFormat::CustomTextFormat(const String& id, const char* value, bool html)
: NamedString(id,value),
m_type(html ? Html : Plain), m_blockFormat(0), m_charFormat(0)
{
}
CustomTextFormat::~CustomTextFormat()
{
if (m_blockFormat)
delete m_blockFormat;
if (m_charFormat)
delete m_charFormat;
}
// Add/insert text into an edit widget
int CustomTextFormat::insertText(QTextEdit* edit, const String& text, bool atStart, int blocks)
{
QTextDocument* doc = edit ? edit->document() : 0;
if (!doc)
return 0;
QTextCursor c(doc);
moveCursor(c,atStart,blocks,false);
int oldBlocks = doc->blockCount();
c.insertBlock();
c.movePosition(QTextCursor::PreviousBlock,QTextCursor::MoveAnchor);
// Insert text
if (type() == Html)
c.insertHtml(QtClient::setUtf8(text));
else {
if (m_blockFormat)
c.setBlockFormat(*m_blockFormat);
if (m_charFormat)
c.setCharFormat(*m_charFormat);
c.insertText(QtClient::setUtf8(text));
}
return doc->blockCount() - oldBlocks;
}
// Set text from value. Replace text parameters if not empty
void CustomTextFormat::buildText(String& text, const NamedList* params,
CustomTextEdit* owner)
{
if (null())
return;
text = *this;
NamedList dummy("");
const NamedList* repl = &dummy;
if (params) {
// Escape or replace HTML markups.
// Make a copy of the input list if we are going to change it
if (type() == Html) {
dummy = *params;
unsigned int n = dummy.length();
for (unsigned int i = 0; i < n; i++) {
String* s = dummy.getParam(i);
if (!TelEngine::null(s)) {
plain2html(*s);
if (owner)
owner->replace(*s);
}
}
}
else
repl = params;
}
repl->replaceParams(text);
}
/*
* CustomTextEdit
*/
// Constructor
CustomTextEdit::CustomTextEdit(const char* name, const NamedList& params, QWidget* parent)
: QtCustomWidget(name,parent),
m_edit(0),
m_debug(false),
m_items(""),
m_defItem(String::empty(),"",false),
m_followUrl(true),
m_urlHandlers(""),
m_tempItemCount(0),
m_tempItemReplace(true)
{
// Build properties
QtClient::buildProps(this,params["buildprops"]);
m_edit = new QTextBrowser(this);
m_edit->setObjectName(params.getValue("textedit_name",this->name() + "_textedit"));
m_edit->setOpenLinks(false);
m_edit->setOpenExternalLinks(false);
m_edit->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
QtClient::setWidget(this,m_edit);
m_debug = params.getBoolValue("_yate_debug_widget");
if (m_debug) {
m_items.addParam(new CustomTextFormat(String(-1),"white")); // Output() or client set status
m_items.addParam(new CustomTextFormat(String(0),"yellow","red")); // DebugFail - blinking yellow on red
m_items.addParam(new CustomTextFormat(String(1),"yellow","red")); // Unnamed - yellow on red
m_items.addParam(new CustomTextFormat(String(2),"white","red")); // DebugGoOn - white on red
m_items.addParam(new CustomTextFormat(String(3),"lightgrey","red")); // DebugConf - gray on red
m_items.addParam(new CustomTextFormat(String(4),"red")); // DebugStub - red on black
m_items.addParam(new CustomTextFormat(String(5),"orangered")); // DebugWarn - light red on black
m_items.addParam(new CustomTextFormat(String(6),"yellow")); // DebugMild - yellow on black
m_items.addParam(new CustomTextFormat(String(7),"white")); // DebugCall - white on black
m_items.addParam(new CustomTextFormat(String(8),"lightgreen")); // DebugNote - light green on black
m_items.addParam(new CustomTextFormat(String(9),"cyan")); // DebugInfo - light cyan on black
m_items.addParam(new CustomTextFormat(String(10),"teal")); // DebugAll - cyan on black
}
setParams(params);
// Connect signals
QtClient::connectObjects(m_edit,SIGNAL(anchorClicked(const QUrl&)),this,SLOT(urlTrigerred(const QUrl&)));
}
// Set parameters
bool CustomTextEdit::setParams(const NamedList& params)
{
static const String s_setRichItem = "set_richtext_item";
static const String s_setPlainItem = "set_plaintext_item";
unsigned int n = params.length();
bool ok = true;
for (unsigned int i = 0; i < n; i++) {
NamedString* ns = params.getParam(i);
if (!(ns && ns->name()))
continue;
if (ns->name() == s_setRichItem)
setItem(*ns,true);
else if (ns->name() == s_setPlainItem)
setItem(*ns,false);
else {
// Prefixed parameters
String tmp(ns->name());
if (tmp.startSkip("set_url_handler:",false)) {
// Set handler from prefix[{scheme}]=formatting_template
if (!tmp)
continue;
if (!m_urlHandlers.c_str())
m_urlHandlers.assign(s_urlHandlers.c_str());
// Check for optional scheme
int pos = tmp.find('{');
if (pos <= 0 || tmp[tmp.length() - 1] != '}')
m_urlHandlers.setParam(new CustomTextEditUrl(tmp,*ns));
else
m_urlHandlers.setParam(new CustomTextEditUrl(tmp.substr(0,pos),*ns,
tmp.substr(pos + 1,tmp.length() - pos - 2)));
}
else if (tmp.startSkip("property:",false)) {
QObject* target = m_edit;
if (tmp.startSkip(name() + ":",false))
target = this;
if (!QtClient::setProperty(target,tmp,*ns))
ok = false;
}
}
}
return ok;
}
// Append or insert text lines to this widget
bool CustomTextEdit::addLines(const NamedList& lines, unsigned int max, bool atStart)
{
unsigned int n = lines.length();
if (!n)
return true;
ScrollToEnd scroll(m_edit);
// Remove the temporary item(s)
if (m_tempItemCount && m_tempItemReplace) {
removeBlocks(m_tempItemCount);
m_tempItemCount = 0;
}
if (!m_debug) {
String text;
CustomTextFormat* last = 0;
// Line format: item=
// Each parameter may contain an optional list of parameters to be replaced in item
for (unsigned int i = 0; i < n; i++) {
NamedString* ns = lines.getParam(i);
if (!ns)
continue;
CustomTextFormat* crt = find(ns->name());
if (!crt)
crt = &m_defItem;
if (last && last->type() != crt->type() && text) {
// Format changed: insert text now and reset it
insert(*last,text,atStart);
text.clear();
}
last = crt;
if (last != &m_defItem) {
String tmp;
last->buildText(tmp,YOBJECT(NamedList,ns),this);
text << tmp;
}
else
text << ns->name();
}
if (last && text)
insert(*last,text,atStart);
}
else {
// Handle 'max'
QTextDocument* doc = m_edit->document();
if (doc)
doc->setMaximumBlockCount((int)max);
// Line format: text=debuglevel
for (unsigned int i = 0; i < n; i++) {
NamedString* ns = lines.getParam(i);
if (!ns)
continue;
CustomTextFormat* f = find(*ns);
// Use default output if not found
if (!f)
f = find(String("-1"));
if (f) {
// Ignore CR, LF or CR/LF at text end: we are adding a block
unsigned int n = 0;
if (ns->name().endsWith("\r\n"))
n = 2;
else if (ns->name().length()) {
int pos = ns->name().length() - 1;
if (ns->name()[pos] == '\r' || ns->name()[pos] == '\n')
n = 1;
}
if (n)
insert(*f,ns->name().substr(0,ns->name().length() - n),atStart);
else
insert(*f,ns->name(),atStart);
}
}
}
return true;
}
// Set the displayed text of this widget
bool CustomTextEdit::setText(const String& text, bool richText)
{
ScrollToEnd scroll(m_edit);
m_edit->clear();
if (richText)
m_edit->insertHtml(QtClient::setUtf8(text));
else
m_edit->insertPlainText(QtClient::setUtf8(text));
return true;
}
// Retrieve the displayed text of this widget
bool CustomTextEdit::getText(String& text, bool richText)
{
if (richText)
QtClient::getUtf8(text,m_edit->toHtml());
else
QtClient::getUtf8(text,m_edit->toPlainText());
return true;
}
// Add/change/clear a pre-formatted item (item must be name[:[value])
void CustomTextEdit::setItem(const String& value, bool html)
{
if (!value)
return;
int pos = value.find(':');
if (pos > 0 && pos != (int)value.length() - 1) {
String id = value.substr(0,pos);
String val = value.substr(pos + 1);
CustomTextFormat* f = find(id);
// Remove existing if format changes
if (f && ((html && f->type() != CustomTextFormat::Html) ||
(!html && f->type() == CustomTextFormat::Plain))) {
m_items.clearParam(f);
f = 0;
}
if (!f)
m_items.addParam(new CustomTextFormat(id,val,html));
else
f->assign(val);
}
else if (pos < 0)
m_items.clearParam(value);
else if (pos > 0)
m_items.clearParam(value.substr(0,pos));
}
// Replace string sequences with formatted text
void CustomTextEdit::replace(String& text)
{
if (!text)
return;
// Replace URLs ?
if (m_followUrl) {
const NamedList& urls = m_urlHandlers.c_str() ? m_urlHandlers : s_urlHandlers;
unsigned int n = urls.length();
for (int start = 0; start < (int)text.length();) {
int len = 1;
for (unsigned int i = 0; i < n; i++) {
const CustomTextEditUrl* ns = static_cast<CustomTextEditUrl*>(urls.getParam(i));
// Parameter name is the URL prefix
if (!(ns && ns->name()))
continue;
if (ns->name().length() >= text.length() - start)
continue;
// Get html template from parameter value or list name
const char* templ = *ns ? ns->c_str() : urls.c_str();
if (TelEngine::null(templ))
continue;
// Check for prefix match
if (::strncmp(text.c_str() + start,ns->name().c_str(),ns->name().length()))
continue;
// Detect url end
int end = start + (int)ns->name().length();
while (!isWordBreak(text[end]))
end++;
// Go back 1 char if the last one should be ignored
if ((end > start + (int)ns->name().length()) && isIgnoreUrlEnd(text[end - 1]))
end--;
len = end - start;
// Replace the URL if have something after prefix
if (len <= (int)ns->name().length()) {
len++;
break;
}
// Check if we have a scheme to prepend for this one
String url = text.substr(start,len);
NamedList p("");
p.addParam("url-display",url);
p.addParam("url",ns->m_scheme ? (ns->m_scheme + url) : url);
String u = templ;
p.replaceParams(u);
text = text.substr(0,start) + u + text.substr(end);
len = (int)u.length();
break;
}
start += len;
}
}
}
// Insert text using a given format. Update temporary item length if appropriate
void CustomTextEdit::insert(CustomTextFormat& fmt, const String& text, bool atStart)
{
int n = fmt.insertText(m_edit,text,atStart,m_tempItemReplace ? 0 : m_tempItemCount);
if (m_tempItemName != fmt.toString()) {
// Reset counter if temporary item was replaced
if (m_tempItemReplace)
m_tempItemCount = 0;
}
else
m_tempItemCount = !atStart ? n : -n;
}
// Remove blocks from edit widget
void CustomTextEdit::removeBlocks(int blocks)
{
if (!blocks)
return;
QTextDocument* doc = m_edit->document();
if (!doc)
return;
QTextCursor c(doc);
moveCursor(c,blocks < 0,blocks,true);
c.removeSelectedText();
}
// URL clicked notification
void CustomTextEdit::urlTrigerred(const QUrl& url)
{
if (!(m_followUrl && Client::valid()))
return;
String tmp;
QtClient::getUtf8(tmp,url.toString());
XDebug(ClientDriver::self(),DebugAll,"CustomTextEdit(%s)::urlTrigerred(%s)",
name().c_str(),tmp.c_str());
Client::self()->openUrl(tmp);
}
/*
* CustomTextFactory
*/
// Build objects
void* CustomTextFactory::create(const String& type, const char* name, NamedList* params)
{
// Init URL handlers
if (!s_urlHandlers.c_str()) {
s_urlHandlers.assign("<a href=\"${url}\"><span style=\"text-decoration: underline; color:#0000ff;\">${url-display}</span></a>");
s_urlHandlers.addParam(new CustomTextEditUrl("http://"));
s_urlHandlers.addParam(new CustomTextEditUrl("https://"));
s_urlHandlers.addParam(new CustomTextEditUrl("www.","","http://"));
}
if (!params)
return 0;
QWidget* parentWidget = 0;
String* wndname = params->getParam("parentwindow");
if (!TelEngine::null(wndname)) {
String* wName = params->getParam("parentwidget");
QtWindow* wnd = static_cast<QtWindow*>(Client::self()->getWindow(*wndname));
if (wnd && !TelEngine::null(wName))
parentWidget = qFindChild<QWidget*>(wnd,QtClient::setUtf8(*wName));
}
if (type == "CustomTextEdit")
return new CustomTextEdit(name,*params,parentWidget);
return 0;
}
}; // anonymous namespace
#include "customtext.moc"
/* vi: set ts=8 sw=4 sts=4 noet: */

300
modules/qt4/customtext.h Normal file
View File

@ -0,0 +1,300 @@
/**
* customtext.h
* This file is part of the YATE Project http://YATE.null.ro
*
* Custom text edit objects
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2006 Null Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __CUSTOMTEXT_H
#define __CUSTOMTEXT_H
#include "qt4client.h"
using namespace TelEngine;
namespace { // anonymous
class CustomTextFormat; // Custom QTextEdit format entry
class CustomTextEditUrl; // Custom text edit url
class CustomTextEdit; // Custom QTextEdit
/**
* Implements interfaces used to add/insert text into a CustomTextEdit widget
* The value of the NamedString may contain a template used to replace parameters
* @short A custom QTextEdit format entry
*/
class CustomTextFormat : public NamedString
{
YCLASS(CustomTextFormat,NamedString)
public:
/**
* Text format type enumeration
*/
enum Type {
Html, // HTML formatted text
Plain, // Plain text
Block, // Use QT format class(es)
};
/**
* Constructor. Build a Block type
*/
CustomTextFormat(const String& id, const char* color, const char* bgcolor = 0);
/**
* Constructor. Build a Html/Plain type
*/
CustomTextFormat(const String& id, const char* value, bool html);
/**
* Destructor
*/
virtual ~CustomTextFormat();
/**
* Retrieve this object's type
*/
inline Type type() const
{ return m_type; }
/**
* Add/insert text into an edit widget
* @param edit Edit widget
* @param text Text buffer
* @param atStart True to insert at start, false to append
* @param blocks The number of blocks to skip if inserted at start or insert before if added
* @return The number of blocks added
*/
int insertText(QTextEdit* edit, const String& text, bool atStart, int blocks);
/**
* Set text from value. Replace text parameters if not empty
* @param text Text buffer
* @param params Parameters to replace
* @param owner Text edit owner
*/
void buildText(String& text, const NamedList* params, CustomTextEdit* owner);
private:
Type m_type;
QTextBlockFormat* m_blockFormat;
QTextCharFormat* m_charFormat;
};
/**
* This class holds an url definition with an optional scheme
* NamedString's value may contain optional formatting template
* @short Custom text edit url
*/
class CustomTextEditUrl : public NamedString
{
public:
inline CustomTextEditUrl(const char* name, const char* value = 0, const char* scheme = 0)
: NamedString(name,value),
m_scheme(scheme)
{}
String m_scheme;
};
/**
* This class holds custom text edit widget with abilities to add pre-formated
* parameterized text
* @short A custom text edit widget
*/
class CustomTextEdit : public QtCustomWidget
{
YCLASS(CustomTextEdit,QtCustomWidget)
Q_CLASSINFO("CustomTextEdit","Yate")
Q_OBJECT
Q_PROPERTY(bool _yate_followurl READ followUrl WRITE setFollowUrl(bool))
Q_PROPERTY(QString _yate_tempitemname READ tempItemName WRITE setTempItemName(QString))
Q_PROPERTY(int _yate_tempitemcount READ tempItemCount WRITE setTempItemCount(int))
Q_PROPERTY(bool _yate_tempitemreplace READ tempItemReplace WRITE setTempItemReplace(bool))
public:
/**
* Constructor
* @param name Object name
* @param params Object parameters
* @param parent Optional parent
*/
CustomTextEdit(const char* name, const NamedList& params, QWidget* parent);
/**
* Set parameters. Add text
* @param params Parameter list
* @return True on success
*/
virtual bool setParams(const NamedList& params);
/**
* Clear the edit widget
* @return True
*/
virtual bool clearTable() {
m_edit->clear();
return true;
}
/**
* Append or insert text lines to this widget
* @param name The name of the widget
* @param lines List containing the lines
* @param max The maximum number of lines allowed to be displayed. Set to 0 to ignore
* @param atStart True to insert, false to append
* @return True on success
*/
virtual bool addLines(const NamedList& lines, unsigned int max, bool atStart = false);
/**
* Set the displayed text of this widget
* @param text Text value to set
* @param richText True if the text contains format data
* @return True on success
*/
virtual bool setText(const String& text, bool richText = false);
/**
* Retrieve the displayed text of this widget
* @param text Text value
* @param richText True to retrieve formatted data
* @return True on success
*/
virtual bool getText(String& text, bool richText = false);
/**
* Add/change/clear a pre-formatted item (item must be name[:[value])
* @param value Formatted item to set or clear
* @param html True to add rich text, false to add plain text
*/
void setItem(const String& value, bool html);
/**
* Replace string sequences with formatted text
* @param text Text buffer
*/
void replace(String& text);
/**
* Insert text using a given format. Update temporary item length if appropriate
* @param fmt Format to use
* @param text Text to insert
* @param atStart Insert at start or append
*/
void insert(CustomTextFormat& fmt, const String& text, bool atStart);
/**
* Remove blocks from edit widget
* @param blocks The number of blocks to remove, negative to remove from start
*/
void removeBlocks(int blocks);
/**
* Retrieve the value of _yate_followurl property
* @return The value of _yate_followurl property
*/
bool followUrl()
{ return m_followUrl; }
/**
* Set the value of _yate_followurl property
* @param value The new value of _yate_followurl property
*/
void setFollowUrl(bool value)
{ m_followUrl = value; }
/**
* Retrieve the value of _yate_tempitemname property
* @return The value of _yate_tempitemname property
*/
QString tempItemName()
{ return QtClient::setUtf8(m_tempItemName); }
/**
* Set the value of _yate_tempitemname property
* @param value The new value of _yate_tempitemname property
*/
void setTempItemName(QString value)
{ QtClient::getUtf8(m_tempItemName,value); }
/**
* Retrieve the value of _yate_tempitemcount property
* @return The value of _yate_tempitemcount property
*/
int tempItemCount()
{ return m_tempItemCount; }
/**
* Set the value of _yate_tempitemcount property
* @param value The new value of _yate_tempitemcount property
*/
void setTempItemCount(int value) {
if (!value && m_tempItemCount)
removeBlocks(m_tempItemCount);
m_tempItemCount = value;
}
/**
* Retrieve the value of _yate_tempitemreplace property
* @return The value of _yate_tempitemreplace property
*/
bool tempItemReplace()
{ return m_tempItemReplace; }
/**
* Set the value of _yate_tempitemreplace property
* @param value The new value of _yate_tempitemreplace property
*/
void setTempItemReplace(bool value)
{ m_tempItemReplace = value; }
public slots:
/**
* URL clicked notification
* Use this slot instead of QT open external links:
* displayed text will be cleared if the link is not handled
*/
void urlTrigerred(const QUrl& url);
protected:
/**
* Retrieve a custom text format object
* @param name Item name
* @return CustomTextFormat pointer or 0 if not found
*/
inline CustomTextFormat* find(const String& name)
{ return YOBJECT(CustomTextFormat,m_items.getParam(name)); }
QTextBrowser* m_edit; // The edit widget
bool m_debug; // This is a debug widget
NamedList m_items; // Formatted items
CustomTextFormat m_defItem; // Default text format used to add plain text
// when an item is not found
bool m_followUrl; // Follow URLs
NamedList m_urlHandlers; // List specific URL handlers
String m_tempItemName; // Temporary last item name
int m_tempItemCount; // Temporary last item count
// negative: start, positive: end, 0: none
bool m_tempItemReplace; // Replace (delete) temporary item(s)
};
}; // anonymous namespace
#endif // __CUSTOMTEXT_H
/* vi: set ts=8 sw=4 sts=4 noet: */

1388
modules/qt4/customtree.cpp Normal file

File diff suppressed because it is too large Load Diff

827
modules/qt4/customtree.h Normal file
View File

@ -0,0 +1,827 @@
/**
* customtree.h
* This file is part of the YATE Project http://YATE.null.ro
*
* Custom QtTree based objects
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2006 Null Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __CUSTOMTREE_H
#define __CUSTOMTREE_H
#include "qt4client.h"
using namespace TelEngine;
namespace { // anonymous
class QtTreeItem; // A tree widget item
class QtCustomTree; // A custom tree widget
class ContactList; // A contact list tree
class ContactItem; // A contact list contact
/**
* This class holds data about a tree widget container item
* @short Tree widget container item properties
*/
class QtTreeItemProps : public QtUIWidgetItemProps
{
YCLASS(QtTreeItemProps,QtUIWidgetItemProps)
public:
/**
* Constructor
* @param type Item type
*/
explicit inline QtTreeItemProps(const String& type)
: QtUIWidgetItemProps(type)
{}
String m_stateWidget; // Item widget showing the state
String m_stateExpandedImg; // Image to show when expanded
String m_stateCollapsedImg; // Image to show when collapsed
};
/**
* This class holds a custom tree widget item
* @short A tree widget item
*/
class QtTreeItem : public QTreeWidgetItem, public NamedList
{
YCLASS(QtTreeItem,NamedList)
public:
/**
* Constructor
* @param id Item id
* @param type Item type
* @param text Optional text for item column 0
*/
QtTreeItem(const char* id, int type = Type, const char* text = 0);
/**
* Destructor
*/
~QtTreeItem();
/**
* Retrieve the item id
* @return Item id
*/
inline const String& id() const
{ return toString(); }
};
/**
* This class holds a custom tree widget
* @short QT based tree widget
*/
class QtCustomTree : public QtTree
{
YCLASS(QtCustomTree,QtTree)
Q_CLASSINFO("QtCustomTree","Yate")
Q_OBJECT
Q_PROPERTY(QStringList _yate_save_props READ saveProps WRITE setSaveProps(QStringList))
Q_PROPERTY(bool autoExpand READ autoExpand WRITE setAutoExpand(bool))
Q_PROPERTY(int rowHeight READ rowHeight WRITE setRowHeight(int))
Q_PROPERTY(QString _yate_itemui READ itemUi WRITE setItemUi(QString))
Q_PROPERTY(QString _yate_itemstyle READ itemStyle WRITE setItemStyle(QString))
Q_PROPERTY(QString _yate_itemselectedstyle READ itemSelectedStyle WRITE setItemSelectedStyle(QString))
Q_PROPERTY(QString _yate_itemstatewidget READ itemStateWidget WRITE setItemStateWidget(QString))
Q_PROPERTY(QString _yate_itemexpandedimage READ itemExpandedImage WRITE setExpandedImage(QString))
Q_PROPERTY(QString _yate_itemcollapsedimage READ itemCollapsedImage WRITE setItemCollapsedImage(QString))
Q_PROPERTY(QString _yate_col_widths READ colWidths WRITE setColWidths(QString))
Q_PROPERTY(QString _yate_sorting READ sorting WRITE setSorting(QString))
public:
/**
* List item type enumeration
*/
enum ItemType {
TypeCount = QTreeWidgetItem::UserType
};
/**
* Constructor
* @param name Object name
* @param params Parameters
* @param parent Optional parent
*/
QtCustomTree(const char* name, const NamedList& params, QWidget* parent = 0);
/**
* Destructor
*/
virtual ~QtCustomTree();
/**
* Retrieve item type definition from [type:]value. Create it if not found
* @param in Input string
* @param value Item property value
* @return QtUIWidgetItemProps pointer or 0
*/
virtual QtUIWidgetItemProps* getItemProps(QString& in, String& value);
/**
* Set object parameters
* @param params Parameters list
* @return True on success
*/
virtual bool setParams(const NamedList& params);
/**
* Retrieve an item
* @param item Item id
* @param data Item parameters to fill
* @return True on success
*/
virtual bool getTableRow(const String& item, NamedList* data = 0);
/**
* Update an existing item
* @param item Item id
* @param data Item parameters
* @return True on success
*/
virtual bool setTableRow(const String& item, const NamedList* data);
/**
* Add a new entry (account or contact) to the tree
* @param item Item id
* @param data Item parameters
* @param asStart True if the entry is to be inserted at the start of
* the table, false if it is to be appended
* @return True if the entry has been added, false otherwise
*/
virtual bool addTableRow(const String& item, const NamedList* data = 0,
bool atStart = false);
/**
* Remove an item from tree
* @param item Item id
* @return True on success
*/
virtual bool delTableRow(const String& item);
/**
* Add, set or remove one or more items.
* Screen update is locked while changing the tree.
* Each data list element is a NamedPointer carrying a NamedList with item parameters.
* The name of an element is the item to update.
* Set element's value to boolean value 'true' to add a new item if not found
* or 'false' to set an existing one. Set it to empty string to delete the item
* @param data The list of items to add/set/delete
* @param atStart True to add new items at start, false to add them to the end
* @return True on success
*/
virtual bool updateTableRows(const NamedList* data, bool atStart = false);
/**
* Set the widget's selection
* @param item String containing the new selection
* @return True if the operation was successfull
*/
virtual bool setSelect(const String& item);
/**
* Retrieve the current selection
* @param item String to fill with selected item id
* @return True on success
*/
virtual bool getSelect(String& item);
/**
* Remove all items from tree
* @return True
*/
virtual bool clearTable();
/**
* Retrieve all items' id
* @param items List to fill with widget's items
* @return True
*/
virtual bool getOptions(NamedList& items);
/**
* Retrieve a QObject list containing tree item widgets
* @return The list of container item widgets
*/
virtual QList<QObject*> getContainerItems();
/**
* Find a tree item
* @param id Item id
* @param start Optional start item. Set it to 0 to start with root item
* @param includeStart Include start item in id check.
* Set it to false to check start children only
* @param recursive True to make a recursive search,
* false to check only start first level children
* @return QTreeItem pointer or 0
*/
virtual QtTreeItem* find(const String& id, QtTreeItem* start = 0,
bool includeStart = true, bool recursive = true);
/**
* Find all tree items
* @param recursive True to make a recursive search, false to add only direct children
* @param parent Optional parent item. Set it to 0 to use the root item
* @return The list of items
*/
QList<QtTreeItem*> findItems(bool recursive = true, QtTreeItem* parent = 0);
/**
* Find all tree items having a given id
* @param id Item id
* @param start Optional start item. Set it to 0 to start with root item
* @param includeStart Include start item in id check.
* Set it to false to check start children only
* @param recursive True to make a recursive search,
* false to check only start first level children
* @return The list of items
*/
QList<QtTreeItem*> findItems(const String& id, QtTreeItem* start = 0,
bool includeStart = true, bool recursive = true);
/**
* Find all tree items having a given type
* @param id Item type
* @param start Optional start item. Set it to 0 to start with root item
* @param includeStart Include start item in id check.
* Set it to false to check start children only
* @param recursive True to make a recursive search,
* false to check only start first level children
* @return The list of items
*/
QList<QtTreeItem*> findItems(int type, QtTreeItem* start = 0,
bool includeStart = true, bool recursive = true);
/**
* Find all tree items
* @param list List to fill
* @param start Optional start item. Set it to 0 to start with root item
* @param includeStart Include start item in id check.
* Set it to false to check start children only
* @param recursive True to make a recursive search,
* false to check only start first level children
*/
void findItems(NamedList& list, QtTreeItem* start = 0,
bool includeStart = true, bool recursive = true);
/**
* Add a child to a given item
* @param child Child to add
* @param pos Position to insert. Negative to add after the last child
* @param parent The parent item. Set it to 0 to add to the root
* @return QtTreeItem pointer on failure, 0 on success
*/
QtTreeItem* addChild(QtTreeItem* child, int pos = -1, QtTreeItem* parent = 0);
/**
* Add a child to a given item
* @param child Child to add
* @param atStart True to insert at start, false to add aftr the last child
* @param parent The parent item. Set it to 0 to add to the root
* @return QtTreeItem pointer on failure, 0 on success
*/
inline QtTreeItem* addChild(QtTreeItem* child, bool atStart, QtTreeItem* parent = 0)
{ return addChild(child,atStart ? 0 : -1,parent); }
/**
* Show or hide empty children.
* An empty item is an item without children or with all children hidden
* @param show True to show, false to hide
* @param parent The parent item. Set it to 0 to add to the root
*/
void showEmptyChildren(bool show, QtTreeItem* parent = 0);
/**
* Set the expanded/collapsed image of an item
* @param item The item to set
*/
void setStateImage(QtTreeItem& item);
/**
* Retrieve the auto expand property
* @return The value of the auto expand property
*/
bool autoExpand()
{ return m_autoExpand; }
/**
* Set the auto expand property
* @param autoExpand The new value of the auto expand property
*/
void setAutoExpand(bool autoExpand)
{ m_autoExpand = autoExpand; }
/**
* Retrieve the row height
* @return The row height
*/
int rowHeight()
{ return m_rowHeight; }
/**
* Set the row height
* @param h The new value of the row height
*/
void setRowHeight(int h)
{ m_rowHeight = h; }
/**
* Read _yate_itemui property accessor: does nothing
* This method is here to stop MOC compiler complaining about missing READ accessor function
*/
QString itemUi()
{ return QString(); }
/**
* Set an item props ui
* @param value Item props ui. Format [type:]ui_name
*/
void setItemUi(QString value);
/**
* Read _yate_itemstyle property accessor: does nothing
* This method is here to stop MOC compiler complaining about missing READ accessor function
*/
QString itemStyle()
{ return QString(); }
/**
* Set an item props style sheet
* @param value Item props style sheet. Format [type:]stylesheet
*/
void setItemStyle(QString value);
/**
* Read _yate_itemselectedstyle property accessor: does nothing
* This method is here to stop MOC compiler complaining about missing READ accessor function
*/
QString itemSelectedStyle()
{ return QString(); }
/**
* Set an item props selected style sheet
* @param value Item props selected style sheet. Format [type:]stylesheet
*/
void setItemSelectedStyle(QString value);
/**
* Read _yate_itemstatewidget property accessor: does nothing
* This method is here to stop MOC compiler complaining about missing READ accessor function
*/
QString itemStateWidget()
{ return QString(); }
/**
* Set an item props state widget name
* @param value Item props state widget name. Format [type:]widgetname
*/
void setItemStateWidget(QString value);
/**
* Read _yate_itemexpandedimage property accessor: does nothing
* This method is here to stop MOC compiler complaining about missing READ accessor function
*/
QString itemExpandedImage()
{ return QString(); }
/**
* Set an item's expanded image
* @param value Item props expanded image. Format [type:]imagefile
*/
void setExpandedImage(QString value);
/**
* Read _yate_itemcollapsedimage property accessor: does nothing
* This method is here to stop MOC compiler complaining about missing READ accessor function
*/
QString itemCollapsedImage()
{ return QString(); }
/**
* Set an item's collapsed image
* @param value Item props collapsed image. Format [type:]imagefile
*/
void setItemCollapsedImage(QString value);
/**
* Retrieve a comma separated list with column widths
* @return Comma separated list containing column widths
*/
QString colWidths();
/**
* Set column widths
* @param witdhs Comma separated list containing column widths
*/
void setColWidths(QString widths);
/**
* Retrieve tree sorting string (column and order)
* @return Sorting string
*/
QString sorting();
/**
* Set sorting (column and order)
* @param s Sorting string
*/
void setSorting(QString s);
protected slots:
/**
* Handle item children actions
*/
void itemChildAction()
{ onAction(sender()); }
/**
* Handle item children toggles
*/
void itemChildToggle(bool on)
{ onToggle(sender(),on); }
/**
* Handle item children select
*/
void itemChildSelect()
{ onSelect(sender()); }
/**
* Catch item selection changes
* @param sel Selected item
* @param prev Previous selected item
*/
void selectionChangedSlot(QTreeWidgetItem* sel, QTreeWidgetItem* prev)
{ onSelChanged(static_cast<QtTreeItem*>(sel),static_cast<QtTreeItem*>(prev)); }
/**
* Catch item double click
* @param item The item
* @param column Clicked column
*/
void itemDoubleClickedSlot(QTreeWidgetItem* item, int column)
{ onItemDoubleClicked(static_cast<QtTreeItem*>(item),column); }
/**
* Catch item expanded signal
* @param item The item
*/
void itemExpandedSlot(QTreeWidgetItem* item)
{ onItemExpandedChanged(static_cast<QtTreeItem*>(item)); }
/**
* Catch item collapsed signal
* @param item The item
*/
void itemCollapsedSlot(QTreeWidgetItem* item)
{ onItemExpandedChanged(static_cast<QtTreeItem*>(item)); }
protected:
/**
* Retrieve the item props name associated with tree item type
* @param type Item type
* @return Item props name or empty if not found
*/
inline const String& itemPropsName(int type) const
{ return m_itemPropsType[String(type)]; }
/**
* Build a tree context menu
* @param menu Menu to replace on success
* @param ns Pointer to received parameter
* @return True on success
*/
bool buildMenu(QMenu*& menu, NamedString* ns);
/**
* Retrieve all items' id
* @param items List to fill with widget's items
* @param parent Optional parent
* @param recursive True to retrieve parent children
*/
void getOptions(NamedList& items, QtTreeItem* parent = 0, bool recursive = true);
/**
* Apply item widget style sheet
* @param item Target item
* @param selected True to apply selected item style
*/
void applyStyleSheet(QtTreeItem* item, bool selected);
/**
* Update a tree item
* @param item Item to update
* @param params Item parameters
* @return True on success
*/
virtual bool updateItem(QtTreeItem& item, const NamedList& params);
/**
* Process item selection changes
* @param sel Selected item
* @param prev Previous selected item
*/
virtual void onSelChanged(QtTreeItem* sel, QtTreeItem* prev);
/**
* Process item double click
* @param item The item
* @param column Clicked column
*/
virtual void onItemDoubleClicked(QtTreeItem* item, int column);
/**
* Item expanded/collapsed notification
* @param item The item
*/
virtual void onItemExpandedChanged(QtTreeItem* item);
/**
* Catch a context menu event and show the context menu
* @param e Context menu event
*/
virtual void contextMenuEvent(QContextMenuEvent* e);
/**
* Get the context menu associated with a given item
* @param item The item (can be 0)
* @return QMenu pointer or 0
*/
virtual QMenu* contextMenu(QtTreeItem* item);
/**
* Item added notification
* @param item Added item
*/
virtual void itemAdded(QtTreeItem& item);
QMenu* m_menu; // Tree context menu
bool m_autoExpand; // Items are expanded when added
int m_rowHeight; // Tree row height
NamedList m_itemPropsType; // Tree item type to item props translation
};
/**
* This class holds a contact list tree
* @short A contact list tree
*/
class ContactList : public QtCustomTree
{
YCLASS(ContactList,QtCustomTree)
Q_CLASSINFO("ContactList","Yate")
Q_OBJECT
Q_PROPERTY(QString _yate_nogroup_caption READ noGroupCaption WRITE setNoGroupCaption(QString))
Q_PROPERTY(bool _yate_flatlist READ flatList WRITE setFlatList(bool))
Q_PROPERTY(bool _yate_showofflinecontacts READ showOffline WRITE setShowOffline(bool))
Q_PROPERTY(bool _yate_hideemptygroups READ hideEmptyGroups WRITE setHideEmptyGroups(bool))
public:
/**
* List item type enumeration
*/
enum ItemType {
TypeContact = QtCustomTree::TypeCount,
TypeGroup,
};
/**
* Constructor
* @param name The name of the object
* @param params List parameters
* @param parent List parent
*/
ContactList(const char* name, const NamedList& params, QWidget* parent);
/**
* Set list parameters
* @param params Parameter list
* @return True on success
*/
virtual bool setParams(const NamedList& params);
/**
* Update an existing item
* @param item Item id
* @param data Item parameters
* @return True on success
*/
virtual bool setTableRow(const String& item, const NamedList* data);
/**
* Add a new entry (account or contact) to the tree
* @param item Item id
* @param data Item parameters
* @param asStart True if the entry is to be inserted at the start of
* the table, false if it is to be appended
* @return True if the entry has been added, false otherwise
*/
virtual bool addTableRow(const String& item, const NamedList* data = 0,
bool atStart = false);
/**
* Remove an item from tree
* @param item Item id
* @return True on success
*/
virtual bool delTableRow(const String& item);
/**
* Add, set or remove one or more contacts.
* Screen update is locked while changing the tree.
* Each data list element is a NamedPointer carrying a NamedList with item parameters.
* The name of an element is the item to update.
* Set element's value to boolean value 'true' to add a new item if not found
* or 'false' to set an existing one. Set it to empty string to delete the item
* @param data The list of items to add/set/delete
* @param atStart True to add new items at start, false to add them to the end
* @return True on success
*/
virtual bool updateTableRows(const NamedList* data, bool atStart = false);
/**
* Count online/total contacts in a group.
* @param grp The group item
* @param total The number of contacts in the group
* @param online The number of online contacts in the group
*/
virtual void countContacts(QtTreeItem* grp, int& total, int& online);
/**
* Contact list changed notification
* This method is called each time a contact is added, removed or changed or
* properties affecting display are changed
*/
virtual void listChanged();
/**
* Retrieve the value of '_yate_nogroup_caption' property
* @return The value of '_yate_nogroup_caption' property
*/
QString noGroupCaption()
{ return QtClient::setUtf8(m_noGroupText); }
/**
* Set '_yate_nogroup_caption' property
* @param value The new value for '_yate_nogroup_caption' property
*/
void setNoGroupCaption(QString value);
/**
* Check if the list is flat
* @return True if contacts are not grouped
*/
bool flatList()
{ return m_flatList; }
/**
* Set the flat list property
* @param flat The new value of the flat list property
*/
void setFlatList(bool flat);
/**
* Check if offline contacts are shown
* @return True if the list displaying offline contacts
*/
bool showOffline()
{ return m_showOffline; }
/**
* Show or hide offline contacts
* @param value True to show, false to hide offline contacts
*/
void setShowOffline(bool value);
/**
* Check if empty groups are hidden
* @return True if empty groups are hidden
*/
bool hideEmptyGroups()
{ return m_hideEmptyGroups; }
/**
* Show or hide empty groups
* @param value True to hide, false to show empty groups
*/
void setHideEmptyGroups(bool value) {
if (m_hideEmptyGroups == value)
return;
m_hideEmptyGroups = value;
if (!m_flatList)
showEmptyChildren(!m_hideEmptyGroups);
}
protected:
// Update contact count in a group
void updateGroupCountContacts(QtTreeItem& item);
// Add or update a contact
bool updateContact(const String& id, const NamedList& params, bool atStart);
// Update a contact
bool updateContact(ContactItem& c, const NamedList& params, bool all = true);
// Remove a contact from tree
bool removeContact(const String& id);
/**
* Update a tree item
* @param item Item to update
* @param params Item parameters
* @return True on success
*/
virtual bool updateItem(QtTreeItem& item, const NamedList& params);
/**
* Item expanded/collapsed notification
* @param item The item
*/
virtual void onItemExpandedChanged(QtTreeItem* item);
/**
* Get the context menu associated with a given item
* @param item The item (can be 0)
* @return QMenu pointer or 0
*/
virtual QMenu* contextMenu(QtTreeItem* item);
/**
* Item added notification
* @param item Added item
*/
virtual void itemAdded(QtTreeItem& item);
/**
* Retrieve a group item from root or create a new one
* @param name Group name or empry to use the empty group
* @param create True to create if not found
* @return QtTreeItem pointer or 0
*/
QtTreeItem* getGroup(const String& name = String::empty(), bool create = true);
/**
* Add a contact to a group item
*
*/
bool addContactToGroup(const String& id,
const NamedList& params, bool atStart, const String& grp = String::empty(),
QList<ContactItem*>* bucket = 0, const NamedList* origParams = 0);
/**
* Remove a contact from a group item and add it to a list
*
*/
void removeContactFromGroup(QList<ContactItem*> list, const String& id,
const String& grp = String::empty());
private:
int m_savedIndent;
bool m_flatList; // Flat list
bool m_showOffline; // Show or hide offline contacts
bool m_hideEmptyGroups; // Show or hide empty groups
String m_groupCountWidget; // The name of the widget used to display
// online/count contacts
String m_noGroupText; // Group text to show for contacts not belonging to any group
QMap<QString,QString> m_statusOrder; // Status order (names are mapped to status icons)
QMenu* m_menuContact;
};
/**
* This class holds a contact list contact tree item
* @short A contact list contact
*/
class ContactItem : public QtTreeItem
{
YCLASS(ContactItem,QtTreeItem)
public:
inline ContactItem(const char* id, const NamedList& p = NamedList::empty())
: QtTreeItem(id,ContactList::TypeContact,p.getValue("name"))
{}
// Build and return a list of groups
inline ObjList* groups() const
{ return Client::splitUnescape((*this)["groups"]); }
// Check if the contact status is 'offline'
bool offline();
};
}; // anonymous namespace
#endif // __CUSTOMTREE_H
/* vi: set ts=8 sw=4 sts=4 noet: */

598
modules/qt4/widgetlist.cpp Normal file
View File

@ -0,0 +1,598 @@
/**
* widgetlist.cpp
* This file is part of the YATE Project http://YATE.null.ro
*
* Custom widget list objects
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2010 Null Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "widgetlist.h"
using namespace TelEngine;
namespace { // anonymous
// The factory
class WidgetListFactory : public UIFactory
{
public:
inline WidgetListFactory(const char* name = "WidgetListFactory")
: UIFactory(name)
{ m_types.append(new String("WidgetList")); }
virtual void* create(const String& type, const char* name, NamedList* params = 0);
};
static const TokenDict s_delItemDict[] = {
{"global", WidgetList::DelItemGlobal},
{"single", WidgetList::DelItemSingle},
{"native", WidgetList::DelItemNative},
{0,0}
};
static WidgetListFactory s_factory;
/*
* WidgetListTabWidget
*/
WidgetListTabWidget::WidgetListTabWidget(WidgetList* parent, const NamedList& params)
: QTabWidget(parent)
{
// Configure delete item button
#if QT_VERSION >= 0x040500
if (parent->m_delItemType == WidgetList::DelItemSingle ||
parent->m_delItemType == WidgetList::DelItemNative) {
// Set closable tabs
bool closable = parent->m_delItemType == WidgetList::DelItemNative;
setTabsClosable(closable);
// Connect close signal if native close is used
if (tabsClosable())
QtClient::connectObjects(this,SIGNAL(tabCloseRequested(int)),parent,SLOT(closeItem(int)));
}
#else
// Override settings: we don't support close button on tab page
if (parent->m_delItemType != WidgetList::DelItemNone)
parent->setDelItemType(WidgetList::DelItemGlobal);
#endif
if (parent->m_delItemType == WidgetList::DelItemGlobal)
setCloseButton();
}
// Build and set a close button for a given tab or a global close if index is negative
void WidgetListTabWidget::setCloseButton(int index)
{
WidgetList* list = static_cast<WidgetList*>(parent());
if (!list)
return;
// Check if we can set a close button
#if QT_VERSION >= 0x040500
if (index >= 0) {
if (list->m_delItemType != WidgetList::DelItemSingle || tabsClosable() || !tabBar())
return;
}
else if (list->m_delItemType != WidgetList::DelItemGlobal)
return;
#else
if (index >= 0 || list->m_delItemType != WidgetList::DelItemGlobal)
return;
#endif
// Build the button
QToolButton* b = new QToolButton(this);
b->setProperty("_yate_noautoconnect",QVariant(true));
if (index >= 0) {
#if QT_VERSION >= 0x040500
QWidget* w = widget(index);
String item;
QtUIWidget::getListItemIdProp(w,item);
QtUIWidget::setListItemProp(b,QtClient::setUtf8(item));
tabBar()->setTabButton(index,QTabBar::RightSide,b);
#else
delete b;
return;
#endif
}
else
setCornerWidget(b,Qt::TopRightCorner);
list->applyDelItemProps(b);
QtClient::connectObjects(b,SIGNAL(clicked()),list,SLOT(closeItem()));
}
// Set tab close button if needed
void WidgetListTabWidget::tabInserted(int index)
{
#if QT_VERSION >= 0x040500
if (!tabsClosable())
setCloseButton(index);
#endif
QTabWidget::tabInserted(index);
}
/*
* WidgetListStackedWidget
*/
WidgetListStackedWidget::WidgetListStackedWidget(WidgetList* parent, const NamedList& params)
: QStackedWidget(parent)
{
}
/*
* WidgetList
*/
// Constructor
WidgetList::WidgetList(const char* name, const NamedList& params, QWidget* parent)
: QtCustomWidget(name,parent),
m_hideWndWhenEmpty(false),
m_tab(0),
m_pages(0),
m_delItemType(DelItemNone),
m_delItemProps("")
{
// Build properties
QtClient::buildProps(this,params["buildprops"]);
// Retrieve the delete item props
updateDelItemProps(params,true);
const String& type = params["type"];
XDebug(ClientDriver::self(),DebugAll,"WidgetList(%s) type=%s",name,type.c_str());
if (type == "tabs") {
m_tab = new WidgetListTabWidget(this,params);
QtClient::setWidget(this,m_tab);
}
else if (type == "pages") {
QWidget* hdr = 0;
const String& header = params["header"];
if (header)
hdr = QtWindow::loadUI(Client::s_skinPath + header,this,header);
if (hdr)
hdr->setObjectName(QtClient::setUtf8("pages_header"));
m_pages = new WidgetListStackedWidget(this,params);
QVBoxLayout* newLayout = new QVBoxLayout;
newLayout->setSpacing(0);
newLayout->setContentsMargins(0,0,0,0);
if (hdr)
newLayout->addWidget(hdr);
newLayout->addWidget(m_pages);
QLayout* l = layout();
if (l)
delete l;
setLayout(newLayout);
}
// Set navigation
QtUIWidget::initNavigation(params);
setParams(params);
}
// Find an item widget by index
QWidget* WidgetList::findItemByIndex(int index)
{
QWidget* w = 0;
if (m_tab)
w = m_tab->widget(index);
else if (m_pages)
w = m_pages->widget(index);
return w;
}
// Set widget parameters
bool WidgetList::setParams(const NamedList& params)
{
bool ok = QtUIWidget::setParams(params);
ok = QtUIWidget::setParams(this,params) && ok;
updateDelItemProps(params);
return ok;
}
// Retrieve item parameters
bool WidgetList::getTableRow(const String& item, NamedList* data)
{
QWidget* w = findItem(item);
DDebug(ClientDriver::self(),DebugAll,"WidgetList(%s)::getTableRow(%s,%p) found=%p",
name().c_str(),item.c_str(),data,w);
if (!w)
return false;
if (data)
getParams(w,*data);
return true;
}
// Add an item
bool WidgetList::addTableRow(const String& item, const NamedList* data, bool atStart)
{
DDebug(ClientDriver::self(),DebugAll,"WidgetList(%s)::addTableRow(%s,%p,%u)",
name().c_str(),item.c_str(),data,atStart);
QWidget* parent = 0;
if (item) {
if (m_tab)
parent = m_tab;
else
parent = m_pages;
}
if (!parent)
return false;
const String& type = data ? (*data)["item_type"] : String::empty();
QWidget* w = loadWidgetType(parent,item,type);
if (!w)
return false;
QtUIWidgetItemProps* p = QtUIWidget::getItemProps(type);
if (p && p->m_styleSheet)
applyWidgetStyle(w,p->m_styleSheet);
if (addItem(w,atStart))
setTableRow(item,data);
return w != 0;
}
// Add or set one or more table row(s)
bool WidgetList::updateTableRows(const NamedList* data, bool atStart)
{
DDebug(ClientDriver::self(),DebugAll,"WidgetList(%s)::updateTableRows(%p,%u)",
name().c_str(),data,atStart);
// Save the hide empty window flag
bool oldHide = m_hideWndWhenEmpty;
String oldWHide = m_hideWidgetWhenEmpty;
m_hideWndWhenEmpty = false;
m_hideWidgetWhenEmpty = "";
bool ok = true;
unsigned int n = data->length();
for (unsigned int i = 0; i < n; i++) {
if (Client::exiting())
break;
// Get item and the list of parameters
NamedString* ns = data->getParam(i);
if (!ns)
continue;
// Delete ?
if (ns->null()) {
ok = delTableRow(ns->name()) && ok;
continue;
}
// Set existing item or add a new one
if (getTableRow(ns->name()))
ok = setTableRow(ns->name(),YOBJECT(NamedList,ns)) && ok;
else if (ns->toBoolean())
ok = addTableRow(ns->name(),YOBJECT(NamedList,ns),atStart) && ok;
else
ok = false;
}
m_hideWndWhenEmpty = oldHide;
m_hideWidgetWhenEmpty = oldWHide;
QtUIWidget::updateNavigation();
hideEmpty();
return ok;
}
// Delete an item
bool WidgetList::delTableRow(const String& item)
{
QWidget* w = findItem(item);
DDebug(ClientDriver::self(),DebugAll,"WidgetList(%s)::delTableRow(%s) found=%p",
name().c_str(),item.c_str(),w);
if (!w)
return false;
QtClient::deleteLater(w);
QtUIWidget::updateNavigation();
hideEmpty();
return true;
}
// Set existing item parameters
bool WidgetList::setTableRow(const String& item, const NamedList* data)
{
QWidget* w = findItem(item);
DDebug(ClientDriver::self(),DebugAll,"WidgetList(%s)::setTableRow(%s,%p) wid=%p",
name().c_str(),item.c_str(),data,w);
if (!w)
return false;
if (data) {
if (m_tab) {
// Hook some parameters to set them in tab
String* name = m_itemTextParam ? data->getParam(m_itemTextParam) : 0;
if (name)
m_tab->setTabText(m_tab->indexOf(w),QtClient::setUtf8(*name));
if (m_itemImgParam) {
String* tmp = data->getParam("image:" + m_itemImgParam);
if (tmp)
m_tab->setTabIcon(m_tab->indexOf(w),QIcon(QtClient::setUtf8(*tmp)));
}
}
QtUIWidget::setParams(w,*data);
}
return true;
}
// Delete all items
bool WidgetList::clearTable()
{
if (m_tab || m_pages) {
QList<QObject*> list = getContainerItems();
for (int i = 0; i < list.size(); i++)
if (list[i]->isWidgetType())
QtClient::deleteLater(list[i]);
}
else
return false;
QtUIWidget::updateNavigation();
hideEmpty();
return true;
}
// Select (set active) an item
bool WidgetList::setSelect(const String& item)
{
QWidget* w = findItem(item);
if (!w)
return false;
if (m_tab)
m_tab->setCurrentWidget(w);
else if (m_pages)
m_pages->setCurrentWidget(w);
else
return false;
QtUIWidget::updateNavigation();
return true;
}
// Retrieve the selected (active) item
bool WidgetList::getSelect(String& item)
{
QWidget* w = selectedItem();
if (w)
QtUIWidget::getListItemIdProp(w,item);
DDebug(ClientDriver::self(),DebugAll,"WidgetList(%s)::getSelect() '%s' wid=%p",
name().c_str(),item.c_str(),w);
return w != 0;
}
// Retrieve a QObject list containing container items
QList<QObject*> WidgetList::getContainerItems()
{
QList<QObject*> list;
if (m_tab) {
int n = m_tab->count();
for (int i = 0; i < n; i++) {
QWidget* w = m_tab->widget(i);
if (w)
list.append(static_cast<QObject*>(w));
}
}
else if (m_pages) {
int n = m_pages->count();
for (int i = 0; i < n; i++) {
QWidget* w = m_pages->widget(i);
if (w)
list.append(static_cast<QObject*>(w));
}
}
return list;
}
// Select an item by its index
bool WidgetList::setSelectIndex(int index)
{
if (index < 0 || index >= itemCount())
return false;
QWidget* w = findItemByIndex(index);
String item;
if (w)
QtUIWidget::getListItemIdProp(w,item);
return item ? setSelect(item) : false;
}
// Retrieve the 0 based index of the current item
int WidgetList::currentItemIndex()
{
if (m_tab)
return m_tab->currentIndex();
if (m_pages)
return m_pages->currentIndex();
return -1;
}
// Retrieve the number of items in container
int WidgetList::itemCount()
{
if (m_tab)
return m_tab->count();
if (m_pages)
return m_pages->count();
return -1;
}
// Set _yate_hidewndwhenempty property value. Apply it if changed
void WidgetList::setHideWndWhenEmpty(bool value)
{
if (m_hideWndWhenEmpty == value)
return;
m_hideWndWhenEmpty = value;
hideEmpty();
}
// Set _yate_hidewidgetwhenempty property value. Apply it if changed
void WidgetList::setHideWidgetWhenEmpty(QString value)
{
String s;
QtClient::getUtf8(s,value);
if (m_hideWidgetWhenEmpty == s)
return;
m_hideWidgetWhenEmpty = s;
hideEmpty();
}
// Handle current item close action
void WidgetList::closeItem(int index)
{
if (!m_delItemActionPrefix)
return;
String item;
if (index < 0) {
if (m_delItemType == DelItemSingle)
QtUIWidget::getListItemProp(sender(),item);
else if (m_delItemType == DelItemGlobal)
getSelect(item);
}
else if (m_delItemType == DelItemNative) {
// Signalled by tab native close button
QWidget* w = findItemByIndex(index);
if (w)
QtUIWidget::getListItemIdProp(w,item);
}
XDebug(ClientDriver::self(),DebugAll,
"WidgetList(%s)::closeItem(%d) sender (%p,%s) found=%s",
name().c_str(),index,sender(),YQT_OBJECT_NAME(sender()),item.c_str());
QtWindow* wnd = item ? QtClient::parentWindow(this) : 0;
if (wnd)
Client::self()->action(wnd,m_delItemActionPrefix + item);
}
// Handle children events
bool WidgetList::eventFilter(QObject* watched, QEvent* event)
{
if (!Client::valid())
return QWidget::eventFilter(watched,event);
if (event->type() == QEvent::KeyPress) {
bool filter = false;
if (!filterKeyEvent(watched,static_cast<QKeyEvent*>(event),filter))
return QWidget::eventFilter(watched,event);
return filter;
}
return QWidget::eventFilter(watched,event);
}
// Hide the parent window if the container is empty
void WidgetList::hideEmpty()
{
if (itemCount() || !Client::valid() || !(m_hideWndWhenEmpty || m_hideWidgetWhenEmpty))
return;
QtWindow* wnd = QtClient::parentWindow(this);
if (!wnd)
return;
if (m_hideWndWhenEmpty)
Client::self()->setVisible(wnd->id(),false);
if (m_hideWidgetWhenEmpty)
wnd->setShow(m_hideWidgetWhenEmpty,false);
}
// Insert/add a widget item
bool WidgetList::addItem(QWidget*& w, bool atStart)
{
if (!w)
return false;
int index = atStart ? 0 : itemCount();
if (m_tab)
m_tab->insertTab(index,w,QString());
else if (m_pages)
m_pages->insertWidget(index,w);
else {
QtClient::deleteLater(w);
w = 0;
}
if (w)
QtUIWidget::updateNavigation();
return w != 0;
}
// Retrieve the selected item widget
QWidget* WidgetList::selectedItem()
{
if (m_tab)
return m_tab->currentWidget();
if (m_pages)
return m_pages->currentWidget();
return 0;
}
// Set delete item type
void WidgetList::setDelItemType(int type)
{
if (type == m_delItemType)
return;
m_delItemType = type;
XDebug(ClientDriver::self(),DebugAll,"WidgetList(%s)::setDelItemType(%d = %s)",
name().c_str(),type,lookup(type,s_delItemDict));
}
// Retrieve delete item object properties
void WidgetList::updateDelItemProps(const NamedList& params, bool first)
{
static const String s_delItemProp = "delete_item_property:";
if (first) {
m_delItemActionPrefix = params.getValue("delete_item_action");
if (m_delItemActionPrefix) {
setDelItemType(params.getIntValue("delete_item_type",s_delItemDict,DelItemNone));
if (m_delItemType != DelItemNone)
m_delItemActionPrefix << ":" << this->name() << ":";
else
m_delItemActionPrefix.clear();
}
}
if (m_delItemType == DelItemNone)
return;
unsigned int n = params.length();
for (unsigned int i = 0; i < n; i++) {
NamedString* ns = params.getParam(i);
if (!(ns && ns->name().startsWith(s_delItemProp)))
continue;
String prop = ns->name().substr(s_delItemProp.length());
if (!prop)
continue;
m_delItemProps.setParam(prop,*ns);
// TODO: Apply the property to all delete item objects if changed
}
}
// Apply delete item object properties
void WidgetList::applyDelItemProps(QObject* obj)
{
if (!obj)
return;
unsigned int n = m_delItemProps.length();
for (unsigned int i = 0; i < n; i++) {
NamedString* ns = m_delItemProps.getParam(i);
if (!ns)
continue;
Debug(ClientDriver::self(),DebugAll,
"WidgetList(%s)::applyDelItemProps() %s=%s",
name().c_str(),ns->name().c_str(),ns->c_str());
QtClient::setProperty(obj,ns->name(),*ns);
}
}
/*
* WidgetListFactory
*/
// Build objects
void* WidgetListFactory::create(const String& type, const char* name, NamedList* params)
{
if (!params)
return 0;
QWidget* parentWidget = 0;
String* wndname = params->getParam("parentwindow");
if (!TelEngine::null(wndname)) {
String* wName = params->getParam("parentwidget");
QtWindow* wnd = static_cast<QtWindow*>(Client::self()->getWindow(*wndname));
if (wnd && !TelEngine::null(wName))
parentWidget = qFindChild<QWidget*>(wnd,QtClient::setUtf8(*wName));
}
if (type == "WidgetList")
return new WidgetList(name,*params,parentWidget);
return 0;
}
}; // anonymous namespace
#include "widgetlist.moc"
/* vi: set ts=8 sw=4 sts=4 noet: */

376
modules/qt4/widgetlist.h Normal file
View File

@ -0,0 +1,376 @@
/**
* widgetlist.h
* This file is part of the YATE Project http://YATE.null.ro
*
* Custom widget list objects
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2006 Null Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __WIDGETLIST_H
#define __WIDGETLIST_H
#include "qt4client.h"
using namespace TelEngine;
namespace { // anonymous
class WidgetListTabWidget; // A tab widget client of a widget list
class WidgetListStackedWidget; // A stacked widget client of a widget list
class WidgetList; // A widget list
class WidgetListTabWidget : public QTabWidget
{
public:
/**
* Constructor
* @param parent WidgetList parent
*/
WidgetListTabWidget(WidgetList* parent, const NamedList& params);
protected:
/**
* Build and set a close button for a given tab or a global close if index is negative
* Connect the button to parent's slot.
* This method is called from tabInserted() with non negative index
*/
void setCloseButton(int index = -1);
/**
* Tab inserted. Set tab close button if needed
*/
virtual void tabInserted(int index);
};
class WidgetListStackedWidget : public QStackedWidget
{
public:
/**
* Constructor
* @param parent WidgetList parent
*/
WidgetListStackedWidget(WidgetList* parent, const NamedList& params);
};
/**
* This class holds a basic widget list container
* @short A widget list
*/
class WidgetList : public QtCustomWidget
{
friend class WidgetListTabWidget;
YCLASS(WidgetList,QtCustomWidget)
Q_CLASSINFO("WidgetList","Yate")
Q_OBJECT
Q_PROPERTY(bool _yate_hidewndwhenempty READ hideWndWhenEmpty WRITE setHideWndWhenEmpty(bool))
Q_PROPERTY(QString _yate_hidewidgetwhenempty READ hideWidgetWhenEmpty WRITE setHideWidgetWhenEmpty(QString))
Q_PROPERTY(QString _yate_itemui READ itemUi WRITE setItemUi(QString))
Q_PROPERTY(QString _yate_itemstyle READ itemStyle WRITE setItemStyle(QString))
Q_PROPERTY(QString _yate_itemtextparam READ itemTextParam WRITE setItemTextParam(QString))
Q_PROPERTY(QString _yate_itemimageparam READ itemImageParam WRITE setItemImageParam(QString))
public:
/**
* Delete item button type
*/
enum DelItem {
DelItemNone = 0, // No delete item button
DelItemGlobal, // Global (delete selected) button
DelItemSingle, // Delete button on each item
DelItemNative, // Delete button on each item: use native if available
};
/**
* Constructor
* @param name Object name
* @param params Object parameters
* @param parent Optional parent
*/
WidgetList(const char* name, const NamedList& params, QWidget* parent);
/**
* Find an item widget by index
* @param index Item index
* @return QWidget pointer or 0
*/
QWidget* findItemByIndex(int index);
/**
* Set widget parameters
* @param params Parameter list
* @return True on success
*/
virtual bool setParams(const NamedList& params);
/**
* Retrieve item parameters
* @param item Item id
* @param data List to be filled with parameters
* @return True on success
*/
virtual bool getTableRow(const String& item, NamedList* data = 0);
/**
* Add a new item
* @param item Item id
* @param data Item parameters
* @param asStart True to insert at start, false to append
* @return True on success
*/
virtual bool addTableRow(const String& item, const NamedList* data = 0,
bool atStart = false);
/**
* Add/set/delete one or more item(s)
* @param data The list of items to add/set/delete
* @param atStart True to add new items at start, false to add them to the end
* @return True if the operation was successfull
*/
virtual bool updateTableRows(const NamedList* data, bool atStart = false);
/**
* Delete an item
* @param item Item id
* @return True on success
*/
virtual bool delTableRow(const String& item);
/**
* Set existing item parameters
* @param item Item id
* @param data Item parameters
* @return True on success
*/
virtual bool setTableRow(const String& item, const NamedList* data);
/**
* Delete all items
* @return True on success
*/
virtual bool clearTable();
/**
* Select (set active) an item
* @param item Item id
* @return True on success
*/
virtual bool setSelect(const String& item);
/**
* Retrieve the selected (active) item
* @param item Item id
* @return True on success
*/
virtual bool getSelect(String& item);
/**
* Retrieve a QObject list containing tree item widgets
* @return The list of container item widgets
*/
virtual QList<QObject*> getContainerItems();
/**
* Select an item by its index
* @param index Item index to select
* @return True on success
*/
virtual bool setSelectIndex(int index);
/**
* Retrieve the 0 based index of the current item
* @return The index of the current item (-1 on error or container empty)
*/
virtual int currentItemIndex();
/**
* Retrieve the number of items in container
* @return The number of items in container (-1 on error)
*/
virtual int itemCount();
/**
* Retrieve _yate_hidewndwhenempty property value
* @return _yate_hidewndwhenempty property value
*/
bool hideWndWhenEmpty()
{ return m_hideWndWhenEmpty; }
/**
* Set _yate_hidewndwhenempty property value. Apply it if changed
* @param value The new value of _yate_hidewndwhenempty property
*/
void setHideWndWhenEmpty(bool value);
/**
* Retrieve _yate_hidewidgetwhenempty property value
* @return _yate_hidewidgetwhenempty property value
*/
QString hideWidgetWhenEmpty()
{ return QtClient::setUtf8(m_hideWidgetWhenEmpty); }
/**
* Set _yate_hidewidgetwhenempty property value. Apply it if changed
* @param value The new value of _yate_hidewidgetwhenempty property
*/
void setHideWidgetWhenEmpty(QString value);
/**
* Read _yate_itemui property accessor: does nothing
* This method is here to stop MOC compiler complaining about missing READ accessor function
*/
QString itemUi()
{ return QString(); }
/**
* Set an item props ui
* @param value Item props ui. Format [type:]ui_name
*/
void setItemUi(QString value) {
String tmp;
QtUIWidgetItemProps* p = getItemProps(value,tmp);
p->m_ui = tmp;
}
/**
* Read _yate_itemstyle property accessor: does nothing
* This method is here to stop MOC compiler complaining about missing READ accessor function
*/
QString itemStyle()
{ return QString(); }
/**
* Set an item props style sheet
* @param value Item props style sheet. Format [type:]stylesheet
*/
void setItemStyle(QString value) {
String tmp;
QtUIWidgetItemProps* p = getItemProps(value,tmp);
p->m_styleSheet = tmp;
}
/**
* Retrieve _yate_itemtextparam property value
* @return The value of _yate_itemtextparam property
*/
QString itemTextParam()
{ return QtClient::setUtf8(m_itemTextParam); }
/**
* Set _yate_itemtextparam property value
* @param value The new value of _yate_itemtextparam property
*/
void setItemTextParam(QString value)
{ QtClient::getUtf8(m_itemTextParam,value); }
/**
* Retrieve _yate_itemimageparam property value
* @return The value of _yate_itemimageparam property
*/
QString itemImageParam()
{ return QtClient::setUtf8(m_itemImgParam); }
/**
* Set _yate_itemimageparam property value
* @param value The new value of _yate_itemimageparam property
*/
void setItemImageParam(QString value)
{ QtClient::getUtf8(m_itemImgParam,value); }
protected slots:
/**
* Handle item children actions
*/
void itemChildAction()
{ onAction(sender()); }
/**
* Handle item children toggles
*/
void itemChildToggle(bool on)
{ onToggle(sender(),on); }
/**
* Handle item children select
*/
void itemChildSelect()
{ onSelect(sender()); }
/**
* Handle item close action
*/
void closeItem(int index = -1);
protected:
/**
* Handle children events
*/
virtual bool eventFilter(QObject* watched, QEvent* event);
/**
* Hide the parent window or widget if the container is empty
*/
void hideEmpty();
/**
* Insert/add a widget item
* @param w Widget to append or insert (it will be deleted and reset on failure)
* @param atStart True to insert, false to add
* @return True on success
*/
bool addItem(QWidget*& w, bool atStart);
/**
* Retrieve the selected item widget
* @return QWidget pointer or 0
*/
QWidget* selectedItem();
/**
* Set delete item type
* @param type The new delete item type
*/
void setDelItemType(int type);
/**
* Retrieve delete item object properties
* @param params Parameter list
* @param first True if called from constructor: update delete item type also
*/
void updateDelItemProps(const NamedList& params, bool first = false);
/**
* Apply delete item object properties
* @param obj The object
*/
void applyDelItemProps(QObject* obj);
bool m_hideWndWhenEmpty; // Hide the parent window when the container is empty
String m_hideWidgetWhenEmpty; // Widget to hide when the container is empty
WidgetListTabWidget* m_tab; // Tab widget if used
WidgetListStackedWidget* m_pages; // Stacked widget if used
int m_delItemType; // Delete item type
NamedList m_delItemProps; // Delete item widget properties
String m_delItemActionPrefix; // Delete item action prefix
String m_itemTextParam; // Hook this parameter to set item text
String m_itemImgParam; // Hook this parameter to set item image
};
}; // anonymous namespace
#endif // __WIDGETLIST_H
/* vi: set ts=8 sw=4 sts=4 noet: */

File diff suppressed because it is too large Load Diff

View File

@ -16,239 +16,140 @@
<iconset>user.png</iconset>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>6</number>
<number>0</number>
</property>
<property name="topMargin" >
<number>6</number>
<number>0</number>
</property>
<property name="rightMargin" >
<number>6</number>
<number>0</number>
</property>
<property name="bottomMargin" >
<number>6</number>
<number>0</number>
</property>
<item>
<widget class="QTableWidget" name="accounts" >
<property name="editTriggers" >
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors" >
<bool>true</bool>
</property>
<property name="selectionMode" >
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior" >
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="columnCount" >
<number>3</number>
</property>
<column>
<property name="text" >
<string>Account</string>
</property>
</column>
<column>
<property name="text" >
<string>Protocol</string>
</property>
</column>
<column>
<property name="text" >
<string>Status</string>
</property>
</column>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>2</number>
<number>6</number>
</property>
<property name="leftMargin" >
<number>6</number>
</property>
<property name="topMargin" >
<number>6</number>
</property>
<property name="rightMargin" >
<number>6</number>
</property>
<property name="bottomMargin" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="acc_login" >
<property name="enabled" >
<bool>false</bool>
</property>
<widget class="QFrame" name="frame_accounts" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>30</width>
<height>25</height>
</size>
<property name="_yate_uiwidget" stdset="0" >
<bool>true</bool>
</property>
<property name="maximumSize" >
<size>
<width>30</width>
<height>25</height>
</size>
<property name="_yate_uiwidget_name" stdset="0" >
<string>accounts</string>
</property>
<property name="toolTip" >
<string>Login the selected account</string>
<property name="_yate_uiwidget_class" stdset="0" >
<string>CustomTable</string>
</property>
<property name="text" >
<string/>
</property>
<property name="icon" >
<iconset>handshake.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
<property name="_yate_uiwidget_params" stdset="0" >
<stringlist>
<string>property:sortingEnabled=true</string>
<string>property:styleSheet=QTableWidget{background:white; selection-background-color: lightblue;}</string>
<string>property:tabKeyNavigation=false</string>
<string>property:_yate_horizontalheader=true</string>
<string>property:_yate_notifyonenterpressed=true</string>
<string>property:_yate_notifyitemchanged=true</string>
<string>property:_yate_itemheight=0</string>
<string>property:_yate_sorting=2,true</string>
<string>hheader_columns=Enabled,Account,Status</string>
<string>hheader_columns_check=enabled</string>
<string>hheader_columns_size=60</string>
<string>hheader_columns_resize=contents</string>
</stringlist>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="acc_logout" >
<property name="enabled" >
<bool>false</bool>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>2</number>
</property>
<property name="minimumSize" >
<size>
<width>30</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>30</width>
<height>25</height>
</size>
</property>
<property name="toolTip" >
<string>Logout the selected account</string>
</property>
<property name="text" >
<string/>
</property>
<property name="icon" >
<iconset>handshake_x.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="acc_new" >
<property name="minimumSize" >
<size>
<width>70</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>70</width>
<height>25</height>
</size>
</property>
<property name="toolTip" >
<string>Create a new account</string>
</property>
<property name="text" >
<string>New</string>
</property>
<property name="icon" >
<iconset>user.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="acc_del" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="minimumSize" >
<size>
<width>70</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>70</width>
<height>25</height>
</size>
</property>
<property name="toolTip" >
<string>Delete the selected account</string>
</property>
<property name="text" >
<string>Delete</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="_yate_identity" stdset="0" >
<string>deleteselecteditem:accounts:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="acc_edit" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="minimumSize" >
<size>
<width>70</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>70</width>
<height>25</height>
</size>
</property>
<property name="toolTip" >
<string>Edit the selected account</string>
</property>
<property name="text" >
<string>Edit</string>
</property>
<property name="icon" >
<iconset>edit.png</iconset>
</property>
</widget>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="acc_new" >
<property name="toolTip" >
<string>Create a new account</string>
</property>
<property name="text" >
<string>New</string>
</property>
<property name="icon" >
<iconset>user.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="acc_del" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="toolTip" >
<string>Delete the selected account</string>
</property>
<property name="text" >
<string>Delete</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
</property>
<property name="_yate_identity" stdset="0" >
<string>deleteselecteditem:accounts:</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="acc_edit" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="toolTip" >
<string>Edit the selected account</string>
</property>
<property name="text" >
<string>Edit</string>
</property>
<property name="icon" >
<iconset>edit.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

View File

@ -71,7 +71,7 @@
<number>8</number>
</property>
<property name="bottomMargin" >
<number>8</number>
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
@ -125,19 +125,7 @@
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="abk_accept" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<widget class="QPushButton" name="abk_accept" >
<property name="toolTip" >
<string>Update the contact data</string>
</property>
@ -147,25 +135,10 @@
<property name="icon" >
<iconset>ok.png</iconset>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_hide" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<widget class="QPushButton" name="button_hide" >
<property name="toolTip" >
<string>Abandon changes and exit</string>
</property>
@ -175,15 +148,6 @@
<property name="icon" >
<iconset>close.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
@ -222,12 +186,6 @@
<property name="icon" >
<iconset>quest.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="checkable" >
<bool>true</bool>
</property>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 610 B

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 806 B

BIN
share/skins/default/ask.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1017 B

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 B

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1017 B

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

456
share/skins/default/chat.ui Normal file
View File

@ -0,0 +1,456 @@
<ui version="4.0" >
<class>chat</class>
<widget class="QWidget" name="chat" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>567</width>
<height>352</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy" >
<enum>Qt::StrongFocus</enum>
</property>
<property name="windowTitle" >
<string comment="VoIP Client" >Chat</string>
</property>
<property name="windowIcon" >
<iconset>chat.png</iconset>
</property>
<property name="styleSheet" >
<string>QLabel {background:none; font-size: 11px;}
</string>
</property>
<property name="_yate_destroyonhide" stdset="0" >
<bool>true</bool>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>2</number>
</property>
<property name="leftMargin" >
<number>4</number>
</property>
<property name="topMargin" >
<number>4</number>
</property>
<property name="rightMargin" >
<number>4</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="name" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="font" >
<font>
<family>Arial</family>
<pointsize>-1</pointsize>
</font>
</property>
<property name="autoFillBackground" >
<bool>false</bool>
</property>
<property name="styleSheet" >
<string>QLabel {font-family: Arial; font-size: 14px;}</string>
</property>
<property name="indent" >
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="frame_history" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet" >
<string>QTextEdit {
background-color: #ffffff;
border: 1px solid #b3b6b0;
color: #666666;
font-family: Arial;
font-size: 12px;
}</string>
</property>
<property name="_yate_uiwidget" stdset="0" >
<bool>true</bool>
</property>
<property name="_yate_uiwidget_name" stdset="0" >
<string>history</string>
</property>
<property name="_yate_uiwidget_class" stdset="0" >
<string>CustomTextEdit</string>
</property>
<property name="_yate_uiwidget_params" stdset="0" >
<stringlist>
<string>property:readOnly=true</string>
<string>property:history:_yate_tempitemname=tempnotify</string>
<string>set_richtext_item=chat_in:&lt;font color="red">[${time}] ${sender}:&lt;/font>&lt;font color="black"> ${text}&lt;/font></string>
<string>set_richtext_item=chat_out:&lt;font color="blue">[${time}] ${sender}:&lt;/font>&lt;font color="black"> ${text}&lt;/font></string>
<string>set_richtext_item=chat_delayed:&lt;font color="darkgreen">[${time}] ${sender}:&lt;/font>&lt;font color="black"> ${text}&lt;/font>&lt;font color="darkgreen">${delayed_by}&lt;/font></string>
<string>set_richtext_item=notify:&lt;font color="grey">[${time}] ${text}&lt;/font></string>
<string>set_richtext_item=tempnotify:&lt;font color="grey">${text}&lt;/font></string>
</stringlist>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_edit" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>16</width>
<height>60</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>60</height>
</size>
</property>
<property name="frameShape" >
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Plain</enum>
</property>
<layout class="QHBoxLayout" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>8</number>
</property>
<item>
<widget class="QTextEdit" name="message" >
<property name="sizePolicy" >
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="focusPolicy" >
<enum>Qt::StrongFocus</enum>
</property>
<property name="styleSheet" >
<string>QTextEdit {background-color: #ffffff; border: 1px solid #b3b6b0; color: #666666; font-family: Arial; font-size: 12px;}</string>
</property>
<property name="tabChangesFocus" >
<bool>true</bool>
</property>
<property name="textInteractionFlags" >
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::NoTextInteraction|Qt::TextBrowserInteraction|Qt::TextEditable|Qt::TextEditorInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
<property name="_yate_filterevents" stdset="0" >
<bool>true</bool>
</property>
<property name="dynamicActionEnter" stdset="0" >
<string>send_chat</string>
</property>
<property name="dynamicActionEnterModifiers" stdset="0" >
<string>Ctrl+, Shift+</string>
</property>
<property name="dynamicActionReturn" stdset="0" >
<string>send_chat</string>
</property>
<property name="dynamicActionReturnFilter" stdset="0" >
<bool>true</bool>
</property>
<property name="_yate_textchangednotify" stdset="0" >
<bool>true</bool>
</property>
<property name="_yate_identity" stdset="0" >
<string>message</string>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="rightMargin" >
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="send_chat_button" >
<property name="minimumSize" >
<size>
<width>60</width>
<height>50</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>60</width>
<height>50</height>
</size>
</property>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip" >
<string>Send chat</string>
</property>
<property name="iconSize" >
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="autoRaise" >
<bool>true</bool>
</property>
<property name="_yate_setaction" stdset="0" >
<string>send_chat</string>
</property>
<property name="_yate_noautoconnect" stdset="0" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_status" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>16</width>
<height>24</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="frameShape" >
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Plain</enum>
</property>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>1</number>
</property>
<property name="topMargin" >
<number>1</number>
</property>
<property name="rightMargin" >
<number>1</number>
</property>
<property name="bottomMargin" >
<number>1</number>
</property>
<item>
<widget class="QLabel" name="status_image" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>24</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
<property name="indent" >
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="status_text" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet" >
<string/>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="account_image" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="toolTip" >
<string>Account</string>
</property>
<property name="pixmap" >
<pixmap>user.png</pixmap>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="account" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip" >
<string>Account</string>
</property>
<property name="text" >
<string/>
</property>
<property name="indent" >
<number>5</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
<action name="send_chat" >
<property name="icon" >
<iconset>sendchat_32.png</iconset>
</property>
<property name="text" >
<string>Send</string>
</property>
<property name="_yate_identity" stdset="0" >
<string>send_chat</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>message</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 521 B

After

Width:  |  Height:  |  Size: 510 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 B

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 686 B

View File

@ -1,15 +1,12 @@
<ui version="4.0" >
<class>Confirm</class>
<widget class="QWidget" name="Confirm" >
<property name="windowModality" >
<enum>Qt::NonModal</enum>
</property>
<class>confirm</class>
<widget class="QWidget" name="confirm" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>80</height>
<width>400</width>
<height>120</height>
</rect>
</property>
<property name="sizePolicy" >
@ -20,178 +17,145 @@
</property>
<property name="minimumSize" >
<size>
<width>4</width>
<height>80</height>
<width>400</width>
<height>120</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>300</width>
<height>80</height>
<width>400</width>
<height>120</height>
</size>
</property>
<property name="windowTitle" >
<string>Confirm</string>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>0</number>
<number>4</number>
</property>
<property name="topMargin" >
<number>0</number>
<number>4</number>
</property>
<property name="rightMargin" >
<number>0</number>
<number>4</number>
</property>
<property name="bottomMargin" >
<number>0</number>
<number>4</number>
</property>
<item>
<widget class="QFrame" name="frame" >
<property name="frameShape" >
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>8</number>
</property>
<property name="leftMargin" >
<number>4</number>
</property>
<property name="topMargin" >
<number>4</number>
</property>
<property name="rightMargin" >
<number>4</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<item>
<widget class="QLabel" name="text" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="ok" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="text" >
<string>Ok</string>
</property>
<property name="icon" >
<iconset>ok.png</iconset>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_hide" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>26</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="text" >
<string>Cancel</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<layout class="QHBoxLayout" >
<item>
<layout class="QVBoxLayout" >
<item>
<widget class="QLabel" name="image" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="pixmap" >
<pixmap>ask_32.png</pixmap>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>0</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTextEdit" name="text" >
<property name="styleSheet" >
<string>QTextEdit {&#xd;
background:transparent;&#xd;
}</string>
</property>
<property name="frameShape" >
<enum>QFrame::NoFrame</enum>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</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>Ok</string>
</property>
<property name="icon" >
<iconset>ok.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_hide" >
<property name="text" >
<string>Cancel</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>

View File

@ -0,0 +1,581 @@
<ui version="4.0" >
<class>contactedit</class>
<widget class="QWidget" name="contactedit" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>286</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>400</width>
<height>286</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>400</width>
<height>286</height>
</size>
</property>
<property name="windowIcon" >
<iconset>edit.png</iconset>
</property>
<property name="styleSheet" >
<string>QWidget {&#xd;
color: black;&#xd;
}&#xd;
QWidget#contactedit {&#xd;
background-color:#e0dfe3;&#xd;
}&#xd;
</string>
</property>
<property name="_yate_destroyonhide" stdset="0" >
<bool>true</bool>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>4</number>
</property>
<property name="leftMargin" >
<number>6</number>
</property>
<property name="topMargin" >
<number>4</number>
</property>
<property name="rightMargin" >
<number>6</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_account" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>Account:</string>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="chataccount" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="chatcontact_account" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_username" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>Username:</string>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_uri" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>16</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>2</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="username" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>100</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>100</width>
<height>22</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>@</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="domain" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>78</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLineEdit" name="chatcontact_uri" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_name" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>Name:</string>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="name" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_groups" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>Group(s):</string>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_groups" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>16</width>
<height>100</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="_yate_uiwidget" stdset="0" >
<bool>true</bool>
</property>
<property name="_yate_uiwidget_name" stdset="0" >
<string>groups</string>
</property>
<property name="_yate_uiwidget_class" stdset="0" >
<string>CustomTable</string>
</property>
<property name="_yate_uiwidget_params" stdset="0" >
<stringlist>
<string>buildprops=_yate_noautoconnect=bool</string>
<string>property:sortingEnabled=false</string>
<string>property:showGrid=false</string>
<string>property:styleSheet=QTableWidget{background:white;}</string>
<string>property:tabKeyNavigation=false</string>
<string>property:_yate_horizontalheader=false</string>
<string>property:_yate_notifyonenterpressed=false</string>
<string>property:_yate_notifyitemchanged=false</string>
<string>property:_yate_rowheight=16</string>
<string>property:_yate_noautoconnect=true</string>
<string>hheader_columns=Group</string>
<string>hheader_columns_check=group</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_newgroup" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>New group:</string>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editgroup" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="contactedit_addgroup" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<property name="text" >
<string>Add</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="request_subscribe" >
<property name="text" >
<string>Request subscription</string>
</property>
<property name="_yate_noautoconnect" stdset="0" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>392</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>4</number>
</property>
<property name="topMargin" >
<number>4</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="contactedit_ok" >
<property name="text" >
<string>Ok</string>
</property>
<property name="icon" >
<iconset>ok.png</iconset>
</property>
<property name="shortcut" >
<string>Return</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_hide" >
<property name="text" >
<string>Cancel</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
</property>
<property name="shortcut" >
<string>Esc</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<tabstops>
<tabstop>chataccount</tabstop>
<tabstop>chatcontact_account</tabstop>
<tabstop>username</tabstop>
<tabstop>domain</tabstop>
<tabstop>chatcontact_uri</tabstop>
<tabstop>name</tabstop>
<tabstop>frame_groups</tabstop>
<tabstop>editgroup</tabstop>
<tabstop>contactedit_addgroup</tabstop>
<tabstop>request_subscribe</tabstop>
<tabstop>contactedit_ok</tabstop>
<tabstop>button_hide</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,472 @@
<ui version="4.0" >
<class>contactinfo</class>
<widget class="QWidget" name="contactinfo" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>400</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>400</width>
<height>400</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>400</width>
<height>400</height>
</size>
</property>
<property name="windowIcon" >
<iconset>info.png</iconset>
</property>
<property name="styleSheet" >
<string>QWidget {&#xd;
color: black;&#xd;
}&#xd;
QWidget#contactinfo {&#xd;
background-color: #e0dfe3;&#xd;
}&#xd;
QLabel {&#xd;
background: none;&#xd;
}&#xd;
</string>
</property>
<property name="_yate_destroyonhide" stdset="0" >
<bool>true</bool>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>2</number>
</property>
<property name="leftMargin" >
<number>6</number>
</property>
<property name="topMargin" >
<number>4</number>
</property>
<property name="rightMargin" >
<number>6</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<item>
<widget class="QLabel" name="name" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="styleSheet" >
<string>font-size:16px;&#xd;
color:blue;</string>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_username" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>Username:</string>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="username" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_account" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>Account:</string>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="account" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_subscription" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>Subscription:</string>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="subscription" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_groups" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>90</width>
<height>80</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>90</width>
<height>80</height>
</size>
</property>
<property name="text" >
<string>Groups:</string>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="groups" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>80</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>80</height>
</size>
</property>
<property name="alternatingRowColors" >
<bool>false</bool>
</property>
<property name="selectionMode" >
<enum>QAbstractItemView::NoSelection</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_resources" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text" >
<string>Resources:</string>
</property>
<property name="indent" >
<number>0</number>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_resources" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="_yate_uiwidget" stdset="0" >
<bool>true</bool>
</property>
<property name="_yate_uiwidget_name" stdset="0" >
<string>resources</string>
</property>
<property name="_yate_uiwidget_class" stdset="0" >
<string>CustomTable</string>
</property>
<property name="_yate_uiwidget_params" stdset="0" >
<stringlist>
<string>property:sortingEnabled=false</string>
<string>property:styleSheet=QTableWidget{background:white; selection-background-color: lightblue;}</string>
<string>property:tabKeyNavigation=false</string>
<string>property:_yate_horizontalheader=true</string>
<string>property:_yate_notifyonenterpressed=false</string>
<string>property:_yate_notifyitemchanged=false</string>
<string>property:_yate_itemheight=0</string>
<string>hheader_columns=Name,Audio,Status</string>
<string>hheader_columns_size=120,50</string>
<string>hheader_columns_resize=,fixed</string>
</stringlist>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="topMargin" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="chatcontact_edit" >
<property name="text" >
<string>Edit</string>
</property>
<property name="icon" >
<iconset>edit.png</iconset>
</property>
<property name="_yate_identity" stdset="0" >
<string>chatcontact_edit</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_hide" >
<property name="text" >
<string>Close</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
</property>
<property name="shortcut" >
<string>Esc</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,149 @@
<ui version="4.0" >
<class>contactlist_contact</class>
<widget class="QWidget" name="contactlist_contact" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>471</width>
<height>42</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>42</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>42</height>
</size>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>1</number>
</property>
<property name="leftMargin" >
<number>1</number>
</property>
<property name="topMargin" >
<number>1</number>
</property>
<property name="rightMargin" >
<number>1</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="status_image" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="name" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="toolTip" >
<string>Contact name</string>
</property>
<property name="styleSheet" >
<string>QLabel {
font-size:12px;
}</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>21</number>
</property>
<item>
<widget class="QLabel" name="status_text" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>12</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>12</height>
</size>
</property>
<property name="toolTip" >
<string>Status</string>
</property>
<property name="styleSheet" >
<string>QLabel {
font-size:10px;
}</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,112 @@
<ui version="4.0" >
<class>contactlist_group</class>
<widget class="QWidget" name="contactlist_group" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>471</width>
<height>22</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<property name="styleSheet" >
<string/>
</property>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>2</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QLabel" name="state" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>24</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>24</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="group" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet" >
<string>QLabel {
font-size:12px;
}</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="count" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet" >
<string/>
</property>
<property name="text" >
<string/>
</property>
<property name="indent" >
<number>6</number>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1013 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

View File

@ -0,0 +1,94 @@
<ui version="4.0" >
<class>dockedchat</class>
<widget class="QWidget" name="dockedchat" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>505</width>
<height>326</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>500</width>
<height>300</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy" >
<enum>Qt::WheelFocus</enum>
</property>
<property name="contextMenuPolicy" >
<enum>Qt::DefaultContextMenu</enum>
</property>
<property name="windowTitle" >
<string comment="VoIP Client" >Chat</string>
</property>
<property name="windowIcon" >
<iconset>chat.png</iconset>
</property>
<property name="styleSheet" >
<string>QLabel {&#xd;
background:none;&#xd;
font-size: 11px;&#xd;
}&#xd;
</string>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>2</number>
</property>
<property name="leftMargin" >
<number>4</number>
</property>
<property name="topMargin" >
<number>2</number>
</property>
<property name="rightMargin" >
<number>4</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<item>
<widget class="QFrame" name="frame_dockedchat" >
<property name="_yate_uiwidget" stdset="0" >
<bool>true</bool>
</property>
<property name="_yate_uiwidget_name" stdset="0" >
<string>dockedchatwidget</string>
</property>
<property name="_yate_uiwidget_class" stdset="0" >
<string>WidgetList</string>
</property>
<property name="_yate_uiwidget_params" stdset="0" >
<stringlist>
<string>type=tabs</string>
<string>delete_item_action=deleteitem</string>
<string>delete_item_type=native</string>
<string>delete_item_property:styleSheet=QToolButton{qproperty-icon:url(close.png);qproperty-toolTip:"Close chat";qproperty-arrowType:"Qt::NoArrow";background:transparent;}QToolButton:hover{background:lightgrey;}</string>
<string>property:_yate_hidewndwhenempty=true</string>
<string>property:_yate_itemui=chat.ui</string>
<string>property:_yate_itemtextparam=name</string>
<string>property:_yate_itemimageparam=status_image</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 648 B

View File

@ -10,384 +10,306 @@
</rect>
</property>
<property name="windowTitle" >
<string>Yate Event Log</string>
<string>Yate Debug Log</string>
</property>
<property name="windowIcon" >
<iconset>events.png</iconset>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>0</number>
<number>2</number>
</property>
<property name="leftMargin" >
<number>0</number>
<number>4</number>
</property>
<property name="topMargin" >
<number>0</number>
<number>2</number>
</property>
<property name="rightMargin" >
<number>0</number>
<number>4</number>
</property>
<property name="bottomMargin" >
<number>0</number>
<number>4</number>
</property>
<item>
<widget class="QFrame" name="frame" >
<property name="frameShape" >
<enum>QFrame::NoFrame</enum>
<widget class="QFrame" name="log_events_frame" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
<property name="styleSheet" >
<string>QTextEdit {background:black; color: white; font-family: Courier; }</string>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>2</number>
</property>
<property name="leftMargin" >
<number>2</number>
</property>
<property name="topMargin" >
<number>2</number>
</property>
<property name="rightMargin" >
<number>2</number>
</property>
<property name="bottomMargin" >
<number>2</number>
</property>
<item>
<widget class="QTextEdit" name="log_events" >
<property name="readOnly" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="_yate_uiwidget" stdset="0" >
<bool>true</bool>
</property>
<property name="_yate_uiwidget_name" stdset="0" >
<string>log_events</string>
</property>
<property name="_yate_uiwidget_class" stdset="0" >
<string>CustomTextEdit</string>
</property>
<property name="_yate_uiwidget_params" stdset="0" >
<stringlist>
<string>_yate_debug_widget=true</string>
<string>property:readOnly=true</string>
</stringlist>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QGroupBox" name="log_events_debug" >
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="title" >
<string>Debug Here</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>false</bool>
</property>
<property name="_yate_identity" stdset="0" >
<string/>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
<number>4</number>
</property>
<item>
<widget class="QGroupBox" name="log_events_debug" >
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="title" >
<string>Debug Here</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>false</bool>
</property>
<property name="_yate_identity" stdset="0" >
<string/>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="topMargin" >
<number>10</number>
</property>
<property name="bottomMargin" >
<number>10</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>10</number>
</property>
<item>
<widget class="QCheckBox" name="debug_jingle" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text" >
<string>JABBER</string>
</property>
<property name="_yate_identity" stdset="0" >
<string>debug:jingle:level 9:level 5</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="debug_sip" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text" >
<string>SIP</string>
</property>
<property name="_yate_identity" stdset="0" >
<string>debug:sip:level 9:level 5</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="debug_h323" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text" >
<string>H.323</string>
</property>
<property name="_yate_identity" stdset="0" >
<string>debug:h323:level 9:level 5</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="debug_iax" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text" >
<string>IAX</string>
</property>
<property name="_yate_identity" stdset="0" >
<string>debug:iax:level 9:level 5</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QToolButton" name="debug_sniffer" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text" >
<string>Message Sniffer</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="autoRepeat" >
<bool>true</bool>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextOnly</enum>
</property>
<property name="_yate_identity" stdset="0" >
<string>command:sniffer</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QVBoxLayout" >
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>1</number>
<number>10</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QToolButton" name="log_events_clear" >
<widget class="QCheckBox" name="debug_jingle" >
<property name="minimumSize" >
<size>
<width>70</width>
<height>26</height>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>26</height>
<height>25</height>
</size>
</property>
<property name="text" >
<string>Clear</string>
</property>
<property name="icon" >
<iconset>events_x.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="checkable" >
<bool>false</bool>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
<string>JABBER</string>
</property>
<property name="_yate_identity" stdset="0" >
<string>clear:log_events</string>
<string>debug:jingle,jabberclient:level 9:level 5</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="button_hide" >
<widget class="QCheckBox" name="debug_sip" >
<property name="minimumSize" >
<size>
<width>70</width>
<height>26</height>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>26</height>
<height>25</height>
</size>
</property>
<property name="text" >
<string>Close</string>
<string>SIP</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
<property name="_yate_identity" stdset="0" >
<string>debug:sip:level 9:level 5</string>
</property>
<property name="iconSize" >
</widget>
</item>
<item>
<widget class="QCheckBox" name="debug_h323" >
<property name="minimumSize" >
<size>
<width>20</width>
<height>20</height>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text" >
<string>H.323</string>
</property>
<property name="_yate_identity" stdset="0" >
<string>debug:h323:level 9:level 5</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="debug_iax" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>25</height>
</size>
</property>
<property name="text" >
<string>IAX</string>
</property>
<property name="_yate_identity" stdset="0" >
<string>debug:iax:level 9:level 5</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Maximum</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>2</height>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QToolButton" name="toggle_show_help" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="minimumSize" >
<size>
<width>70</width>
<height>26</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>26</height>
</size>
</property>
<property name="toolTip" >
<string>Help on this window</string>
</property>
<property name="icon" >
<iconset>quest.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
<widget class="QToolButton" name="debug_sniffer" >
<property name="text" >
<string>Message Sniffer</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="autoRepeat" >
<bool>true</bool>
</property>
<property name="_yate_identity" stdset="0" >
<string>showwindow:help:4</string>
<string>command:sniffer</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>1</number>
</property>
<item>
<widget class="QPushButton" name="log_events_clear" >
<property name="text" >
<string>Clear</string>
</property>
<property name="icon" >
<iconset>clear.png</iconset>
</property>
<property name="_yate_identity" stdset="0" >
<string>clear:log_events</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_hide" >
<property name="text" >
<string>Close</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>2</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="toggle_show_help" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="toolTip" >
<string>Help on this window</string>
</property>
<property name="text" >
<string>Help</string>
</property>
<property name="icon" >
<iconset>quest.png</iconset>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
<property name="_yate_identity" stdset="0" >
<string>showwindow:help:4</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

View File

@ -0,0 +1,65 @@
<ui version="4.0" >
<class>fileprogress</class>
<widget class="QWidget" name="fileprogress" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>493</width>
<height>459</height>
</rect>
</property>
<property name="windowTitle" >
<string>File transfer</string>
</property>
<layout class="QVBoxLayout" >
<property name="leftMargin" >
<number>6</number>
</property>
<property name="topMargin" >
<number>6</number>
</property>
<property name="rightMargin" >
<number>6</number>
</property>
<property name="bottomMargin" >
<number>6</number>
</property>
<item>
<widget class="QFrame" name="frame_chat_contacts" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet" >
<string/>
</property>
<property name="_yate_uiwidget" stdset="0" >
<bool>true</bool>
</property>
<property name="_yate_uiwidget_name" stdset="0" >
<string>fileprogresslist</string>
</property>
<property name="_yate_uiwidget_class" stdset="0" >
<string>ContactList</string>
</property>
<property name="_yate_uiwidget_params" stdset="0" >
<stringlist>
<string>property:_yate_flatlist=true</string>
<string>property:itemsExpandable=false</string>
<string>property:autoExpand=false</string>
<string>property:styleSheet=QTreeWidget {border-image: none;font-size: 11px;background:white;border: 0px solid #97acbc;border-radius:2px;}</string>
<string>property:_yate_itemui=contact:fileprogress_item.ui</string>
<string>property:_yate_itemstyle=contact:QWidget#${name}{background:white;}</string>
<string>property:_yate_itemselectedstyle=contact:QWidget#${name}{background:lightblue;}</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,469 @@
<ui version="4.0" >
<class>fileprogress_item</class>
<widget class="QWidget" name="fileprogress_item" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>74</height>
</rect>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>74</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>74</height>
</size>
</property>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>0</number>
</property>
<property name="leftMargin" >
<number>4</number>
</property>
<property name="topMargin" >
<number>2</number>
</property>
<property name="rightMargin" >
<number>4</number>
</property>
<property name="bottomMargin" >
<number>2</number>
</property>
<item>
<widget class="QTextEdit" name="text" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>38</height>
</size>
</property>
<property name="styleSheet" >
<string>QTextEdit {
background: transparent;
font-size: 11px;
}
</string>
</property>
<property name="frameShape" >
<enum>QFrame::NoFrame</enum>
</property>
<property name="tabChangesFocus" >
<bool>true</bool>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
<property name="html" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'MS Shell Dlg 2'; font-weight:400; font-style:normal;">
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="bottomMargin" >
<number>4</number>
</property>
<item>
<widget class="QProgressBar" name="progress" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="styleSheet" >
<string>QProgressBar::chunk {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #dce5ee, stop:1#aeb9cf );
width: 3px;
border-left: 1.5px solid #dce5ee;
}
QProgressBar {
border: 1px solid darkblue;
border-radius: 3px;
color: darkgreen;
background-color: lightblue;
}</string>
</property>
<property name="value" >
<number>33</number>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
<property name="textDirection" >
<enum>QProgressBar::TopToBottom</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="cancel" >
<property name="minimumSize" >
<size>
<width>80</width>
<height>24</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>80</width>
<height>24</height>
</size>
</property>
<property name="text" >
<string>Cancel</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="_yate_identity" stdset="0" >
<string>fileprogress_close</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>3</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>3</height>
</size>
</property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
<action name="actionProfile" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>My profile</string>
</property>
<property name="menuRole" >
<enum>QAction::TextHeuristicRole</enum>
</property>
</action>
<action name="actionLogout" >
<property name="checkable" >
<bool>false</bool>
</property>
<property name="enabled" >
<bool>false</bool>
</property>
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/antenax.png</iconset>
</property>
<property name="text" >
<string>Logout</string>
</property>
<property name="toolTip" >
<string>Logout the current user</string>
</property>
<property name="statusTip" >
<string>Logout the current user</string>
</property>
<property name="shortcutContext" >
<enum>Qt::ApplicationShortcut</enum>
</property>
<property name="autoRepeat" >
<bool>false</bool>
</property>
</action>
<action name="actionExit" >
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/stop.png</iconset>
</property>
<property name="text" >
<string>Close</string>
</property>
<property name="shortcutContext" >
<enum>Qt::ApplicationShortcut</enum>
</property>
<property name="menuRole" >
<enum>QAction::QuitRole</enum>
</property>
</action>
<action name="actionLogin" >
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/antena.png</iconset>
</property>
<property name="text" >
<string>Login</string>
</property>
</action>
<action name="actionSettings" >
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/configure.png</iconset>
</property>
<property name="text" >
<string>Settings</string>
</property>
</action>
<action name="actionEditAccounts" >
<property name="text" >
<string>Edit accounts</string>
</property>
</action>
<action name="actionShowIncomingCalls" >
<property name="text" >
<string>Show incoming calls</string>
</property>
</action>
<action name="actionAbout" >
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/Reception.png</iconset>
</property>
<property name="text" >
<string>About</string>
</property>
</action>
<action name="actionHelp" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Help</string>
</property>
</action>
<action name="actionSettingsAlerts" >
<property name="text" >
<string>Alerts</string>
</property>
</action>
<action name="actionSettingsNotifications" >
<property name="text" >
<string>Notifications and sounds</string>
</property>
</action>
<action name="actionSettingsMoh" >
<property name="text" >
<string>MOH</string>
</property>
</action>
<action name="actionUrlLearn" >
<property name="text" >
<string>Learn more about this application</string>
</property>
<property name="accessibleName" stdset="0" >
<string>openurl:http://yate.null.ro</string>
</property>
</action>
<action name="actionMenuShortkey" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>Change shortkey</string>
</property>
</action>
<action name="actionAudio" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Audio</string>
</property>
</action>
<action name="actionMenuNewCall" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/new_call.png</iconset>
</property>
<property name="text" >
<string>New call</string>
</property>
<property name="shortcutContext" >
<enum>Qt::WidgetShortcut</enum>
</property>
<property name="accessibleName" stdset="0" >
<string>actionNewCall</string>
</property>
</action>
<action name="actionStart_conference" >
<property name="text" >
<string>Start conference</string>
</property>
</action>
<action name="actionMenuNewMessage" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/new_message.png</iconset>
</property>
<property name="text" >
<string>New message</string>
</property>
<property name="shortcutContext" >
<enum>Qt::WidgetShortcut</enum>
</property>
<property name="accessibleName" stdset="0" >
<string>actionNewMessage</string>
</property>
</action>
<action name="actionChangeLanguage" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Change language</string>
</property>
</action>
<action name="actionViewStatistics" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>View statistics</string>
</property>
<property name="accessibleName" stdset="0" >
<string>openurl:http://yate.null.ro</string>
</property>
</action>
<action name="actionMenuMakeTestCall" >
<property name="text" >
<string>Make a test call</string>
</property>
</action>
<action name="actionAddrbookAdd" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>Add address book entry</string>
</property>
<property name="toolTip" >
<string>Add a contact in the address book</string>
</property>
</action>
<action name="actionAddrbookRemove" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/minus.png</iconset>
</property>
<property name="text" >
<string>Remove</string>
</property>
<property name="toolTip" >
<string>Remove the currently selected contact</string>
</property>
</action>
<action name="actionAddrbookEdit" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/pencil.png</iconset>
</property>
<property name="text" >
<string>Edit</string>
</property>
<property name="toolTip" >
<string>Change the currently selected contact</string>
</property>
</action>
<action name="actionAddrbookChat" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/sendmsg.png</iconset>
</property>
<property name="text" >
<string>Chat</string>
</property>
</action>
<action name="actionChatContactAdd" >
<property name="text" >
<string>Add chat contact</string>
</property>
</action>
<action name="actionEditIdentity" >
<property name="text" >
<string>Identity</string>
</property>
</action>
<action name="actionImportAbkOutlook" >
<property name="text" >
<string>Import contacts from MS Outlook</string>
</property>
</action>
<action name="actionMenuNewFax" >
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/fax.png</iconset>
</property>
<property name="text" >
<string>New fax</string>
</property>
</action>
<action name="actionMenuViewFaxes" >
<property name="icon" >
<iconset>../../../../../../private/changenetworks/clients/share/skins/reception/fax_show.png</iconset>
</property>
<property name="text" >
<string>Show faxes</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

View File

@ -77,25 +77,7 @@
<number>2</number>
</property>
<item>
<widget class="QToolButton" name="help_prev" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>26</width>
<height>26</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>100</width>
<height>26</height>
</size>
</property>
<widget class="QPushButton" name="help_prev" >
<property name="toolTip" >
<string/>
</property>
@ -105,34 +87,13 @@
<property name="icon" >
<iconset>prev.png</iconset>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="_yate_identity" stdset="0" >
<string>help:prev</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="help_home" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>26</width>
<height>26</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>100</width>
<height>26</height>
</size>
</property>
<widget class="QPushButton" name="help_home" >
<property name="toolTip" >
<string>Home</string>
</property>
@ -142,43 +103,19 @@
<property name="icon" >
<iconset>home.png</iconset>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="_yate_identity" stdset="0" >
<string>help:home</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="help_next" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>26</width>
<height>26</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>100</width>
<height>26</height>
</size>
</property>
<widget class="QPushButton" name="help_next" >
<property name="text" >
<string>Next</string>
</property>
<property name="icon" >
<iconset>next.png</iconset>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
<property name="_yate_identity" stdset="0" >
<string>help:next</string>
</property>
@ -198,40 +135,13 @@
</spacer>
</item>
<item>
<widget class="QToolButton" name="button_hide" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>75</width>
<height>26</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>100</width>
<height>26</height>
</size>
</property>
<widget class="QPushButton" name="button_hide" >
<property name="text" >
<string>Close</string>
</property>
<property name="icon" >
<iconset>close.png</iconset>
</property>
<property name="iconSize" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="toolButtonStyle" >
<enum>Qt::ToolButtonTextBesideIcon</enum>
</property>
</widget>
</item>
</layout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 B

After

Width:  |  Height:  |  Size: 3.1 KiB

Some files were not shown because too many files have changed in this diff Show More