Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 030a2248f3
)
r14.1.x
parent
cafbffba66
commit
7c3b44b810
@ -1,47 +0,0 @@
|
||||
#ifndef _KVI_TAL_FILEDIALOG_QT4_H_
|
||||
#define _KVI_TAL_FILEDIALOG_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_filedialog_qt4.h
|
||||
// Creation date : Fri 19 Jan 2007 02:17:12 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include <tqfiledialog.h>
|
||||
|
||||
class KVILIB_API KviTalFileDialog : public TQFileDialog
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalFileDialog(const TQString &dirName,const TQString &filter = TQString(),TQWidget *parent = 0,const char *name = 0,bool modal = FALSE);
|
||||
~KviTalFileDialog();
|
||||
public:
|
||||
enum FileMode { AnyFile, ExistingFile, ExistingFiles, Directory, DirectoryOnly };
|
||||
|
||||
void setFileMode(FileMode m);
|
||||
void setDirectory(const TQString &szDirectory);
|
||||
|
||||
static TQString getExistingDirectoryPath(const TQString &dir = TQString(),const TQString &caption = TQString(),TQWidget *parent = 0)
|
||||
{ return getExistingDirectory(parent,caption,dir); };
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_FILEDIALOG_TQT_H_
|
@ -1,42 +0,0 @@
|
||||
#ifndef _KVI_TAL_GRID_QT4_H_
|
||||
#define _KVI_TAL_GRID_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_grid_qt4.h
|
||||
// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include "kvi_settings.h"
|
||||
|
||||
#include <tq3grid.h>
|
||||
|
||||
class KVILIB_API KviTalGrid : public Q3Grid
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalGrid(int n,Qt::Orientation orient,TQWidget * pParent = 0)
|
||||
: Q3Grid(n,orient,pParent) {};
|
||||
~KviTalGrid() {};
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_GRID_QT4_H_
|
@ -1,48 +0,0 @@
|
||||
#ifndef _KVI_TAL_GROUPBOX_QT4_H_
|
||||
#define _KVI_TAL_GROUPBOX_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_groupbox_qt4.h
|
||||
// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include <tq3groupbox.h>
|
||||
|
||||
class KVILIB_API KviTalGroupBox : public Q3GroupBox
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalGroupBox(TQWidget * parent = 0)
|
||||
: Q3GroupBox(parent) {};
|
||||
KviTalGroupBox(const TQString & title,TQWidget * parent = 0)
|
||||
: Q3GroupBox(title,parent) {};
|
||||
KviTalGroupBox(int strips,Qt::Orientation orientation,TQWidget * parent = 0)
|
||||
: Q3GroupBox(strips,orientation,parent) {};
|
||||
KviTalGroupBox(int strips,Qt::Orientation orientation,const TQString & title,TQWidget * parent = 0)
|
||||
: Q3GroupBox(strips,orientation,title,parent) {};
|
||||
~KviTalGroupBox() {};
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // _KVI_TAL_GROUPBOX_QT4_H_
|
@ -1,42 +0,0 @@
|
||||
#ifndef _KVI_TAL_HBOX_QT4_H_
|
||||
#define _KVI_TAL_HBOX_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_hbox_qt4.h
|
||||
// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include "kvi_settings.h"
|
||||
|
||||
#include <tq3hbox.h>
|
||||
|
||||
class KVILIB_API KviTalHBox : public Q3HBox
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalHBox(TQWidget * pParent,char* name=0)
|
||||
: Q3HBox(pParent,name) {};
|
||||
virtual ~KviTalHBox() {};
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_HBOX_QT4_H_
|
@ -1,100 +0,0 @@
|
||||
#ifndef _KVI_TAL_ICONVIEW_QT4_H_
|
||||
#define _KVI_TAL_ICONVIEW_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_iconview_qt4.h
|
||||
// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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. ,59 Temple Place - Suite 440, Boston, MA 02111-1407, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include "kvi_settings.h"
|
||||
#include "kvi_qstring.h"
|
||||
|
||||
#include <tq3iconview.h>
|
||||
|
||||
class KviTalIconViewItem;
|
||||
|
||||
class KVILIB_API KviTalIconView : public Q3IconView
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalIconView(TQWidget * pParent,TQt::WFlags f = 0);
|
||||
virtual ~KviTalIconView() {};
|
||||
signals:
|
||||
void selectionChanged(KviTalIconViewItem * pItem);
|
||||
void currentChanged(KviTalIconViewItem * pItem);
|
||||
void clicked(KviTalIconViewItem * pItem);
|
||||
void clicked(KviTalIconViewItem * pItem,const TQPoint &pnt);
|
||||
void pressed(KviTalIconViewItem * pItem);
|
||||
void pressed(KviTalIconViewItem * pItem,const TQPoint &pnt);
|
||||
void doubleClicked(KviTalIconViewItem * pItem);
|
||||
void returnPressed(KviTalIconViewItem * pItem);
|
||||
void rightButtonClicked(KviTalIconViewItem * pItem,const TQPoint &pnt);
|
||||
void rightButtonPressed(KviTalIconViewItem * pItem,const TQPoint &pnt);
|
||||
void mouseButtonClicked(int iButton,KviTalIconViewItem * pItem,const TQPoint &pnt);
|
||||
void mouseButtonPressed(int iButton,KviTalIconViewItem * pItem,const TQPoint &pnt);
|
||||
void contextMenuRequested(KviTalIconViewItem * pItem,const TQPoint &pnt);
|
||||
void onItem(KviTalIconViewItem * pItem);
|
||||
protected slots:
|
||||
void redirect_selectionChanged(Q3IconViewItem * pItem);
|
||||
void redirect_currentChanged(Q3IconViewItem * pItem);
|
||||
void redirect_clicked(Q3IconViewItem * pItem);
|
||||
void redirect_clicked(Q3IconViewItem * pItem,const TQPoint &pnt);
|
||||
void redirect_pressed(Q3IconViewItem * pItem);
|
||||
void redirect_pressed(Q3IconViewItem * pItem,const TQPoint &pnt);
|
||||
void redirect_doubleClicked(Q3IconViewItem * pItem);
|
||||
void redirect_returnPressed(Q3IconViewItem * pItem);
|
||||
void redirect_rightButtonClicked(Q3IconViewItem * pItem,const TQPoint &pnt);
|
||||
void redirect_rightButtonPressed(Q3IconViewItem * pItem,const TQPoint &pnt);
|
||||
void redirect_mouseButtonClicked(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt);
|
||||
void redirect_mouseButtonPressed(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt);
|
||||
void redirect_contextMenuRequested(Q3IconViewItem * pItem,const TQPoint &pnt);
|
||||
void redirect_onItem(Q3IconViewItem * pItem);
|
||||
public:
|
||||
KviTalIconViewItem * firstItem() const { return (KviTalIconViewItem *)Q3IconView::firstItem(); };
|
||||
KviTalIconViewItem * lastItem() const { return (KviTalIconViewItem *)Q3IconView::lastItem(); };
|
||||
KviTalIconViewItem * currentItem() const { return (KviTalIconViewItem *)Q3IconView::currentItem(); };
|
||||
};
|
||||
|
||||
class KVILIB_API KviTalIconViewItem : public Q3IconViewItem
|
||||
{
|
||||
public:
|
||||
KviTalIconViewItem(KviTalIconView * parent)
|
||||
: Q3IconViewItem(parent) {};
|
||||
KviTalIconViewItem(KviTalIconView * parent,KviTalIconViewItem * after)
|
||||
: Q3IconViewItem(parent,after) {};
|
||||
KviTalIconViewItem(KviTalIconView * parent, const TQString & text)
|
||||
: Q3IconViewItem(parent,text) {};
|
||||
KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const TQString & text)
|
||||
: Q3IconViewItem(parent,after,text) {};
|
||||
KviTalIconViewItem(KviTalIconView * parent, const TQString & text, const TQPixmap & icon)
|
||||
: Q3IconViewItem(parent,text,icon) {};
|
||||
KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const TQString & text, const TQPixmap & icon)
|
||||
: Q3IconViewItem(parent,after,text,icon) {};
|
||||
public:
|
||||
KviTalIconView * iconView() const { return (KviTalIconView *)Q3IconViewItem::iconView(); };
|
||||
KviTalIconViewItem * prevItem() const { return (KviTalIconViewItem *)Q3IconViewItem::prevItem(); };
|
||||
KviTalIconViewItem * nextItem() const { return (KviTalIconViewItem *)Q3IconViewItem::nextItem(); };
|
||||
};
|
||||
|
||||
|
||||
#endif // _KVI_TAL_ICONVIEW_QT4_H_
|
@ -1,153 +0,0 @@
|
||||
#ifndef _KVI_TAL_LISTBOX_QT4_H_
|
||||
#define _KVI_TAL_LISTBOX_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_listbox_qt4.h
|
||||
// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include "kvi_settings.h"
|
||||
|
||||
#include <tq3listbox.h>
|
||||
|
||||
class KviTalListBoxItem;
|
||||
|
||||
|
||||
class KVILIB_API KviTalListBox : public Q3ListBox
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalListBox(TQWidget * pParent,TQt::WFlags f = 0);
|
||||
virtual ~KviTalListBox() {};
|
||||
public:
|
||||
KviTalListBoxItem * firstItem() const { return (KviTalListBoxItem *)Q3ListBox::firstItem(); };
|
||||
KviTalListBoxItem * selectedItem() const { return (KviTalListBoxItem *)Q3ListBox::selectedItem(); };
|
||||
KviTalListBoxItem * item(int iIndex) const { return (KviTalListBoxItem *)Q3ListBox::item(iIndex); };
|
||||
signals:
|
||||
void highlighted(KviTalListBoxItem *);
|
||||
void selected(KviTalListBoxItem *);
|
||||
void selectionChanged(KviTalListBoxItem * item);
|
||||
void currentChanged(KviTalListBoxItem * item);
|
||||
void clicked(KviTalListBoxItem * item);
|
||||
void clicked(KviTalListBoxItem * item,const TQPoint & pnt);
|
||||
void pressed(KviTalListBoxItem * item);
|
||||
void pressed(KviTalListBoxItem * item,const TQPoint & pnt);
|
||||
void doubleClicked(KviTalListBoxItem * item);
|
||||
void returnPressed(KviTalListBoxItem * item);
|
||||
void rightButtonClicked(KviTalListBoxItem *, const TQPoint &);
|
||||
void rightButtonPressed(KviTalListBoxItem *, const TQPoint &);
|
||||
void mouseButtonPressed(int button,KviTalListBoxItem * item,const TQPoint & pos);
|
||||
void mouseButtonClicked(int button,KviTalListBoxItem * item,const TQPoint & pos);
|
||||
void contextMenuRequested(KviTalListBoxItem * item,const TQPoint & pos);
|
||||
void onItem(KviTalListBoxItem * i);
|
||||
protected slots:
|
||||
void redirect_highlighted(Q3ListBoxItem *);
|
||||
void redirect_selected(Q3ListBoxItem *);
|
||||
void redirect_selectionChanged(Q3ListBoxItem * item);
|
||||
void redirect_currentChanged(Q3ListBoxItem * item);
|
||||
void redirect_clicked(Q3ListBoxItem * item);
|
||||
void redirect_clicked(Q3ListBoxItem * item,const TQPoint & pnt);
|
||||
void redirect_pressed(Q3ListBoxItem * item);
|
||||
void redirect_pressed(Q3ListBoxItem * item,const TQPoint & pnt);
|
||||
void redirect_doubleClicked(Q3ListBoxItem * item);
|
||||
void redirect_returnPressed(Q3ListBoxItem *);
|
||||
void redirect_rightButtonClicked(Q3ListBoxItem *, const TQPoint &);
|
||||
void redirect_rightButtonPressed(Q3ListBoxItem *, const TQPoint &);
|
||||
void redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const TQPoint & pos);
|
||||
void redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const TQPoint & pos);
|
||||
void redirect_contextMenuRequested(Q3ListBoxItem * item,const TQPoint & pos);
|
||||
void redirect_onItem(Q3ListBoxItem * i);
|
||||
};
|
||||
|
||||
class KVILIB_API KviTalListBoxItem : public Q3ListBoxItem
|
||||
{
|
||||
public:
|
||||
KviTalListBoxItem()
|
||||
: Q3ListBoxItem() {};
|
||||
KviTalListBoxItem(KviTalListBox * pParent)
|
||||
: Q3ListBoxItem(pParent) {};
|
||||
KviTalListBoxItem(KviTalListBox * pParent,KviTalListBoxItem * pAfter)
|
||||
: Q3ListBoxItem(pParent,pAfter) {};
|
||||
virtual ~KviTalListBoxItem() {};
|
||||
public:
|
||||
KviTalListBoxItem * next() const { return (KviTalListBoxItem *)Q3ListBoxItem::next(); };
|
||||
KviTalListBoxItem * prev() const { return (KviTalListBoxItem *)Q3ListBoxItem::prev(); };
|
||||
KviTalListBox * listBox() const { return (KviTalListBox *)Q3ListBoxItem::listBox(); };
|
||||
virtual int height(const KviTalListBox *) const { return 0; };
|
||||
int height(const Q3ListBox *lb) const { return height((KviTalListBox *)lb); };
|
||||
virtual int width(const KviTalListBox *) const { return 0; };
|
||||
int width(const Q3ListBox *lb) const { return width((KviTalListBox *)lb); };
|
||||
};
|
||||
|
||||
|
||||
class KVILIB_API KviTalListBoxText : public KviTalListBoxItem
|
||||
{
|
||||
public:
|
||||
KviTalListBoxText(KviTalListBox* listbox, const TQString & text=TQString());
|
||||
KviTalListBoxText(const TQString & text=TQString());
|
||||
KviTalListBoxText(KviTalListBox* listbox, const TQString & text, KviTalListBoxItem *after);
|
||||
~KviTalListBoxText();
|
||||
|
||||
int height(const KviTalListBox *) const;
|
||||
int width(const KviTalListBox *) const;
|
||||
|
||||
int rtti() const;
|
||||
enum { RTTI = 1 };
|
||||
|
||||
protected:
|
||||
virtual void paint(TQPainter *);
|
||||
|
||||
private:
|
||||
TQ_DISABLE_COPY(KviTalListBoxText)
|
||||
};
|
||||
|
||||
|
||||
class KVILIB_API KviTalListBoxPixmap : public KviTalListBoxItem
|
||||
{
|
||||
public:
|
||||
KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &);
|
||||
KviTalListBoxPixmap(const TQPixmap &);
|
||||
KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap & pix, KviTalListBoxItem *after);
|
||||
KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &, const TQString&);
|
||||
KviTalListBoxPixmap(const TQPixmap &, const TQString&);
|
||||
KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap & pix, const TQString&, KviTalListBoxItem *after);
|
||||
~KviTalListBoxPixmap();
|
||||
|
||||
const TQPixmap *pixmap() const { return ± }
|
||||
|
||||
int height(const KviTalListBox *) const;
|
||||
int width(const KviTalListBox *) const;
|
||||
|
||||
int rtti() const;
|
||||
enum { RTTI = 2 };
|
||||
|
||||
protected:
|
||||
virtual void paint(TQPainter *);
|
||||
|
||||
private:
|
||||
TQ_DISABLE_COPY(KviTalListBoxPixmap)
|
||||
|
||||
TQPixmap pm;
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_LISTBOX_QT4_H_
|
@ -1,200 +0,0 @@
|
||||
#ifndef _KVI_TAL_LISTVIEW_QT4_H_
|
||||
#define _KVI_TAL_LISTVIEW_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_listview_qt4.h
|
||||
// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include "kvi_settings.h"
|
||||
|
||||
#include "kvi_qstring.h"
|
||||
|
||||
#include <tq3listview.h>
|
||||
|
||||
class KviTalListViewItem;
|
||||
|
||||
|
||||
class KVILIB_API KviTalListView : public Q3ListView
|
||||
{
|
||||
friend class KviTalCheckListItem;
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalListView(TQWidget * pParent);
|
||||
virtual ~KviTalListView() {};
|
||||
public:
|
||||
// Shadow the internal TQt methods
|
||||
KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)Q3ListView::firstChild(); };
|
||||
KviTalListViewItem * lastItem() const { return (KviTalListViewItem *)Q3ListView::lastItem(); };
|
||||
KviTalListViewItem * selectedItem() const { return (KviTalListViewItem *)Q3ListView::selectedItem(); };
|
||||
KviTalListViewItem * currentItem() const { return (KviTalListViewItem *)Q3ListView::currentItem(); };
|
||||
KviTalListViewItem * itemAt(const TQPoint &pnt) const { return (KviTalListViewItem *)Q3ListView::itemAt(pnt); };
|
||||
signals:
|
||||
void selectionChanged(KviTalListViewItem * pItem);
|
||||
void currentChanged(KviTalListViewItem * pItem);
|
||||
void clicked(KviTalListViewItem * pItem);
|
||||
void clicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void pressed(KviTalListViewItem * pItem);
|
||||
void pressed(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void doubleClicked(KviTalListViewItem * pItem);
|
||||
void doubleClicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void returnPressed(KviTalListViewItem * pItem);
|
||||
void spacePressed(KviTalListViewItem * pItem);
|
||||
void rightButtonClicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void rightButtonPressed(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void mouseButtonClicked(int iButton,KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void mouseButtonPressed(int iButton,KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void contextMenuRequested(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void onItem(KviTalListViewItem * pItem);
|
||||
void expanded(KviTalListViewItem * pItem);
|
||||
void collapsed(KviTalListViewItem * pItem);
|
||||
protected slots:
|
||||
void redirect_selectionChanged(Q3ListViewItem * pItem);
|
||||
void redirect_currentChanged(Q3ListViewItem * pItem);
|
||||
void redirect_clicked(Q3ListViewItem * pItem);
|
||||
void redirect_clicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void redirect_pressed(Q3ListViewItem * pItem);
|
||||
void redirect_pressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void redirect_doubleClicked(Q3ListViewItem * pItem);
|
||||
void redirect_doubleClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void redirect_returnPressed(Q3ListViewItem * pItem);
|
||||
void redirect_spacePressed(Q3ListViewItem * pItem);
|
||||
void redirect_rightButtonClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void redirect_rightButtonPressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void redirect_mouseButtonClicked(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void redirect_mouseButtonPressed(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void redirect_contextMenuRequested(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn);
|
||||
void redirect_onItem(Q3ListViewItem * pItem);
|
||||
void redirect_expanded(Q3ListViewItem * pItem);
|
||||
void redirect_collapsed(Q3ListViewItem * pItem);
|
||||
|
||||
};
|
||||
|
||||
|
||||
class KVILIB_API KviTalListViewItem : public Q3ListViewItem
|
||||
{
|
||||
public:
|
||||
KviTalListViewItem(KviTalListView * pParent)
|
||||
: Q3ListViewItem(pParent) {};
|
||||
KviTalListViewItem(KviTalListViewItem * pParent)
|
||||
: Q3ListViewItem(pParent) {};
|
||||
KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter)
|
||||
: Q3ListViewItem(pParent,pAfter) {};
|
||||
KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter)
|
||||
: Q3ListViewItem(pParent,pAfter) {};
|
||||
KviTalListViewItem(KviTalListView * pParent,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty,const TQString &szLabel5 = KviTQString::empty)
|
||||
: Q3ListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {};
|
||||
KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty,const TQString &szLabel5 = KviTQString::empty)
|
||||
: Q3ListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {};
|
||||
KviTalListViewItem(KviTalListViewItem * pParent,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty)
|
||||
: Q3ListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4) {};
|
||||
KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty)
|
||||
: Q3ListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4) {};
|
||||
public:
|
||||
// Shadow the internal TQt methods
|
||||
KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)Q3ListViewItem::firstChild(); };
|
||||
KviTalListViewItem * nextSibling() const { return (KviTalListViewItem *)Q3ListViewItem::nextSibling(); };
|
||||
KviTalListViewItem * parent() const { return (KviTalListViewItem *)Q3ListViewItem::parent(); };
|
||||
KviTalListView * listView() const { return (KviTalListView *)Q3ListViewItem::listView(); };
|
||||
KviTalListViewItem * itemAbove() { return (KviTalListViewItem *)Q3ListViewItem::itemAbove(); };
|
||||
KviTalListViewItem * itemBelow() { return (KviTalListViewItem *)Q3ListViewItem::itemBelow(); };
|
||||
};
|
||||
|
||||
struct KviTalCheckListItemPrivate;
|
||||
|
||||
class KVILIB_API KviTalCheckListItem : public KviTalListViewItem
|
||||
{
|
||||
public:
|
||||
enum Type { RadioButton,
|
||||
CheckBox,
|
||||
Controller,
|
||||
RadioButtonController=Controller,
|
||||
CheckBoxController };
|
||||
|
||||
enum ToggleState { Off, NoChange, On };
|
||||
|
||||
KviTalCheckListItem(KviTalCheckListItem *parent, const TQString &text,
|
||||
Type = RadioButtonController);
|
||||
KviTalCheckListItem(KviTalCheckListItem *parent, KviTalListViewItem *after,
|
||||
const TQString &text, Type = RadioButtonController);
|
||||
KviTalCheckListItem(KviTalListViewItem *parent, const TQString &text,
|
||||
Type = RadioButtonController);
|
||||
KviTalCheckListItem(KviTalListViewItem *parent, KviTalListViewItem *after,
|
||||
const TQString &text, Type = RadioButtonController);
|
||||
KviTalCheckListItem(KviTalListView *parent, const TQString &text,
|
||||
Type = RadioButtonController);
|
||||
KviTalCheckListItem(KviTalListView *parent, KviTalListViewItem *after,
|
||||
const TQString &text, Type = RadioButtonController);
|
||||
KviTalCheckListItem(KviTalListViewItem *parent, const TQString &text,
|
||||
const TQPixmap &);
|
||||
KviTalCheckListItem(KviTalListView *parent, const TQString &text,
|
||||
const TQPixmap &);
|
||||
~KviTalCheckListItem();
|
||||
|
||||
void paintCell(TQPainter *, const TQColorGroup & cg,
|
||||
int column, int width, int alignment);
|
||||
virtual void paintFocus(TQPainter *, const TQColorGroup &cg,
|
||||
const TQRect & r);
|
||||
int width(const TQFontMetrics&, const KviTalListView*, int column) const;
|
||||
void setup();
|
||||
|
||||
virtual void setOn(bool);
|
||||
bool isOn() const { return on; }
|
||||
Type type() const { return myType; }
|
||||
TQString text() const { return KviTalListViewItem::text(0); }
|
||||
TQString text(int n) const { return KviTalListViewItem::text(n); }
|
||||
|
||||
void setTristate(bool);
|
||||
bool isTristate() const;
|
||||
ToggleState state() const;
|
||||
void setState(ToggleState s);
|
||||
|
||||
int rtti() const;
|
||||
enum { RTTI = 1 };
|
||||
|
||||
protected:
|
||||
void activate();
|
||||
void turnOffChild();
|
||||
virtual void stateChange(bool);
|
||||
|
||||
private:
|
||||
void init();
|
||||
ToggleState internalState() const;
|
||||
void setStoredState(ToggleState newState, KviTalCheckListItem *key);
|
||||
ToggleState storedState(KviTalCheckListItem *key) const;
|
||||
void stateChange(ToggleState s);
|
||||
void restoreState(KviTalCheckListItem *key, int depth = 0);
|
||||
void updateController(bool update = true , bool store = false);
|
||||
void updateStoredState(KviTalCheckListItem *key);
|
||||
void setState(ToggleState s, bool update, bool store);
|
||||
void setCurrentState(ToggleState s);
|
||||
|
||||
Type myType;
|
||||
bool on;
|
||||
KviTalCheckListItemPrivate *d;
|
||||
};
|
||||
|
||||
#define KviTalListViewItemIterator Q3ListViewItemIterator
|
||||
|
||||
|
||||
#endif // _KVI_TAL_LISTVIEW_QT4_H_
|
@ -1,40 +0,0 @@
|
||||
#ifndef _KVI_TAL_MAINWINDOW_TQT_H_
|
||||
#define _KVI_TAL_MAINWINDOW_TQT_H_
|
||||
|
||||
//
|
||||
// File : kvi_tal_mainwindow_qt.h
|
||||
// Creation date : Sun Aug 12 2001 04:43:58 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
|
||||
#include <tqmainwindow.h>
|
||||
|
||||
class KVILIB_API KviTalMainWindow : public TQMainWindow
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalMainWindow(TQWidget * par,const char * nam);
|
||||
~KviTalMainWindow();
|
||||
public:
|
||||
bool usesBigPixmaps();
|
||||
void setUsesBigPixmaps(bool b);
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_MAINWINDOW_TQT_H_
|
@ -1,90 +0,0 @@
|
||||
#ifndef _KVI_TAL_POPUPMENU_QT4_H_
|
||||
#define _KVI_TAL_POPUPMENU_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_popupmenu_qt3.h
|
||||
// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include "kvi_settings.h"
|
||||
#include "kvi_qstring.h"
|
||||
|
||||
#include <tq3popupmenu.h>
|
||||
#include <tqwidgetaction.h>
|
||||
|
||||
class KVILIB_API KviTalPopupMenu : public Q3PopupMenu
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalPopupMenu(TQWidget * pParent=0,const TQString &szName = KviTQString::empty)
|
||||
: Q3PopupMenu(pParent)
|
||||
{
|
||||
setName(szName);
|
||||
};
|
||||
virtual ~KviTalPopupMenu() {};
|
||||
|
||||
int insertItem(const TQString &szText)
|
||||
{
|
||||
return Q3PopupMenu::insertItem(szText);
|
||||
}
|
||||
int insertItem(const TQPixmap &pix,const TQString &szText)
|
||||
{
|
||||
return Q3PopupMenu::insertItem(TQIcon(pix),szText,-1,-1);
|
||||
}
|
||||
int insertItem(const TQString &szText,int id)
|
||||
{
|
||||
return Q3PopupMenu::insertItem(szText,id);
|
||||
}
|
||||
int insertItem(const TQPixmap &pix,const TQString &szText,int id)
|
||||
{
|
||||
return Q3PopupMenu::insertItem(TQIcon(pix),szText,id,-1);
|
||||
}
|
||||
int insertItem(const TQString &szText,const TQObject * pReceiver,const char * szSlot)
|
||||
{
|
||||
return Q3PopupMenu::insertItem(szText,pReceiver,szSlot);
|
||||
}
|
||||
int insertItem(const TQPixmap &pix,const TQString &szText,const TQObject * pReceiver,const char * szSlot)
|
||||
{
|
||||
return Q3PopupMenu::insertItem(TQIcon(pix),szText,pReceiver,szSlot);
|
||||
}
|
||||
int insertItem(const TQPixmap &pix,const TQString &szText,TQMenu *pMenu)
|
||||
{
|
||||
return Q3PopupMenu::insertItem(TQIcon(pix),szText,pMenu,-1,-1);
|
||||
}
|
||||
int insertItem(const TQString &szText,TQMenu *pMenu)
|
||||
{
|
||||
return Q3PopupMenu::insertItem(szText,pMenu,-1,-1);
|
||||
}
|
||||
int insertItem(TQWidget * pWidget)
|
||||
{
|
||||
// needs TQt 4.2
|
||||
TQWidgetAction * pAct = new TQWidgetAction(this);
|
||||
pAct->setDefaultWidget(pWidget);
|
||||
addAction(pAct);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_POPUPMENU_QT4_H_
|
@ -1,42 +0,0 @@
|
||||
#ifndef _KVI_TAL_SCROLLVIEW_QT4_H_
|
||||
#define _KVI_TAL_SCROLLVIEW_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_scrollview_qt4.h
|
||||
// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include "kvi_settings.h"
|
||||
|
||||
#include <tq3scrollview.h>
|
||||
|
||||
class KVILIB_API KviTalScrollView : public Q3ScrollView
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalScrollView(TQWidget * pParent)
|
||||
: Q3ScrollView(pParent) {};
|
||||
virtual ~KviTalScrollView() {};
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_SCROLLVIEW_QT4_H_
|
@ -1,40 +0,0 @@
|
||||
#ifndef _KVI_TAL_TABDIALOG_QT4_H_
|
||||
#define _KVI_TAL_TABDIALOG_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_tabdialog_qt4.h
|
||||
// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include <tq3tabdialog.h>
|
||||
|
||||
class KVILIB_API KviTalTabDialog : public Q3TabDialog
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalTabDialog(TQWidget * pParent = 0,const char * name = 0,bool bModal = false)
|
||||
: Q3TabDialog(pParent,name,bModal) {};
|
||||
~KviTalTabDialog() {};
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_TABDIALOG_QT3_H_
|
@ -1,40 +0,0 @@
|
||||
#ifndef _KVI_TAL_TEXTEDIT_QT4_H_
|
||||
#define _KVI_TAL_TEXTEDIT_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_textedit_qt4.h
|
||||
// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include <tq3textedit.h>
|
||||
|
||||
class KVILIB_API KviTalTextEdit : public Q3TextEdit
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalTextEdit(TQWidget * pParent = 0,const char * name = 0)
|
||||
: Q3TextEdit(pParent,name) {};
|
||||
~KviTalTextEdit() {};
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_TEXTEDIT_QT4_H_
|
@ -1,48 +0,0 @@
|
||||
#ifndef _KVI_TAL_TOOLBAR_QT4_H_
|
||||
#define _KVI_TAL_TOOLBAR_QT4_H_
|
||||
//
|
||||
// File : kvi_tal_toolbar_qt4.h
|
||||
// Creation date : Wed Feb 1 2007 04:11:11 2001 GMT by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
|
||||
#include "kvi_settings.h"
|
||||
#include "kvi_tal_toolbardocktype.h"
|
||||
|
||||
#include <TQToolBar>
|
||||
#include <TQMainWindow>
|
||||
#include <TQBoxLayout>
|
||||
|
||||
|
||||
class KVILIB_API KviTalToolBar : public TQToolBar
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock = TQT_DOCK_TOP,bool bNewLine = false,const char * nam = 0);
|
||||
KviTalToolBar(TQMainWindow *w,const char * name=0);
|
||||
~KviTalToolBar();
|
||||
public:
|
||||
TQBoxLayout * boxLayout();
|
||||
void setBoxLayout(TQBoxLayout *l);
|
||||
bool usesBigPixmaps();
|
||||
void setUsesBigPixmaps(bool b);
|
||||
};
|
||||
|
||||
#endif //_KVI_TAL_TOOLBAR_TQT_H_
|
@ -1,43 +0,0 @@
|
||||
#ifndef _KVI_TAL_VBOX_QT4_H_
|
||||
#define _KVI_TAL_VBOX_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_vbox_qt4.h
|
||||
// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include "kvi_settings.h"
|
||||
|
||||
#include <tq3vbox.h>
|
||||
|
||||
class KVILIB_API KviTalVBox : public Q3VBox
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalVBox(TQWidget * pParent)
|
||||
: Q3VBox(pParent) {};
|
||||
virtual ~KviTalVBox() {};
|
||||
};
|
||||
|
||||
|
||||
#endif // _KVI_TAL_VBOX_QT4_H_
|
@ -1,43 +0,0 @@
|
||||
#ifndef _KVI_TAL_WIDGETSTACK_QT4_H_
|
||||
#define _KVI_TAL_WIDGETSTACK_QT4_H_
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// File : kvi_tal_widgetstack_qt4.h
|
||||
// Creation date : Mon Jan 22 2007 11:17:08 by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#include "kvi_settings.h"
|
||||
|
||||
//#include <tqstackedwidget.h>
|
||||
#include <tq3widgetstack.h>
|
||||
|
||||
class KVILIB_API KviTalWidgetStack : public Q3WidgetStack
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviTalWidgetStack(TQWidget * pParent)
|
||||
: Q3WidgetStack(pParent) {};
|
||||
virtual ~KviTalWidgetStack() {};
|
||||
};
|
||||
|
||||
#endif // _KVI_TAL_WIDGETSTACK_QT4_H_
|
@ -1,691 +0,0 @@
|
||||
//
|
||||
// File : libkvidockwidget.cpp
|
||||
// Creation date : Tue Jan 02 20001 14:34:12 CEST by Szymon Stefanek
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Copyright (C) 2000-2001 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
|
||||
#include "kvi_settings.h"
|
||||
|
||||
#ifdef COMPILE_USE_QT4
|
||||
|
||||
#ifdef COMPILE_ON_WINDOWS
|
||||
#define ICON_SIZE 16
|
||||
#else
|
||||
#define ICON_SIZE 22
|
||||
#endif
|
||||
|
||||
#include "kvi_app.h"
|
||||
#include "kvi_module.h"
|
||||
#include "kvi_locale.h"
|
||||
#include "kvi_memmove.h"
|
||||
#include "kvi_taskbar.h"
|
||||
#include "kvi_window.h"
|
||||
#include "kvi_dynamictooltip.h"
|
||||
#include "kvi_iconmanager.h"
|
||||
#include "kvi_internalcmd.h"
|
||||
#include "kvi_console.h"
|
||||
#include "kvi_ircconnection.h"
|
||||
#include "kvi_ircconnectionuserinfo.h"
|
||||
#include "kvi_imagelib.h"
|
||||
#include "kvi_options.h"
|
||||
#include "kvi_ircview.h"
|
||||
|
||||
#include "libkvidockwidget.h"
|
||||
#include "kvi_doublebuffer.h"
|
||||
|
||||
#include <tqlabel.h>
|
||||
|
||||
#include "kvi_tal_popupmenu.h"
|
||||
|
||||
|
||||
#include <tqpixmap.h>
|
||||
#include <tqpainter.h>
|
||||
#include <tqtimer.h>
|
||||
#include <tqevent.h>
|
||||
#include <tqregexp.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
extern KVIRC_API KviPointerHashTable<const char *,KviWindow> * g_pGlobalWindowDict;
|
||||
static KviPointerList<KviDockWidget> * g_pDockWidgetList = 0;
|
||||
|
||||
static TQPixmap * g_pDock1 = 0;
|
||||
static TQPixmap * g_pDock2 = 0;
|
||||
static TQPixmap * g_pDock3 = 0;
|
||||
|
||||
KviDockWidget::KviDockWidget(KviFrame * frm)
|
||||
: TQSystemTrayIcon(frm), m_CurrentPixmap(ICON_SIZE,ICON_SIZE)
|
||||
{
|
||||
m_pContextPopup = new KviTalPopupMenu(0);
|
||||
setContextMenu(m_pContextPopup);
|
||||
|
||||
m_iConsoles = 0;
|
||||
m_iChannels = 0;
|
||||
m_iQueries = 0;
|
||||
m_iOther = 0;
|
||||
|
||||
m_pFlashingTimer = new TQTimer(this,"flashing_timer");
|
||||
connect( m_pFlashingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(flashingTimerShot()) );
|
||||
m_bFlashed=0;
|
||||
g_pDockWidgetList->append(this);
|
||||
m_pFrm = frm;
|
||||
m_pFrm->setDockExtension(this);
|
||||
|
||||
m_pTip = new KviDynamicToolTip(frm,"dock_tooltip");
|
||||
m_pAwayPopup = new KviTalPopupMenu(0);
|
||||
|
||||
TQLabel * l = new TQLabel(__tr2qs("KVIrc"),m_pContextPopup);
|
||||
l->setFrameStyle(TQFrame::Raised | TQFrame::StyledPanel);
|
||||
m_pContextPopup->insertItem(l);
|
||||
m_pContextPopup->setCaption(__tr2qs("Context"));
|
||||
m_iAwayMenuId = m_pContextPopup->insertItem ( __tr2qs("Away"), m_pAwayPopup);
|
||||
m_pContextPopup->changeItem(m_iAwayMenuId,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY)),__tr2qs("Away"));
|
||||
|
||||
int id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_OPTIONS)),__tr2qs("&Configure KVIrc..."),m_pFrm,TQT_SLOT(executeInternalCommand(int)));
|
||||
m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_OPTIONS_DIALOG);
|
||||
id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("&About KVIrc"),m_pFrm,TQT_SLOT(executeInternalCommand(int)));
|
||||
m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_ABOUT_ABOUTKVIRC);
|
||||
m_pContextPopup->insertSeparator();
|
||||
m_iToggleFrame = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RAW)),TQString(""),this,TQT_SLOT(toggleParentFrame()));
|
||||
m_pContextPopup->insertSeparator();
|
||||
id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DOCKWIDGET)),__tr2qs("Un&dock"),m_pFrm,TQT_SLOT(executeInternalCommand(int)));
|
||||
m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_DOCKWIDGET_HIDE);
|
||||
id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITAPP)),__tr2qs("&Quit"),g_pApp,TQT_SLOT(quit()));
|
||||
m_pContextPopup->setAccel(__tr2qs("Ctrl+Q"),id);
|
||||
connect(m_pContextPopup,TQT_SIGNAL(aboutToShow()),this,TQT_SLOT(fillContextPopup()));
|
||||
|
||||
TQIcon icon(*g_pDock1);
|
||||
setIcon(icon);
|
||||
|
||||
connect(this,TQT_SIGNAL(activated ( TQSystemTrayIcon::ActivationReason )),this,TQT_SLOT(activatedSlot ( TQSystemTrayIcon::ActivationReason )));
|
||||
}
|
||||
|
||||
|
||||
KviDockWidget::~KviDockWidget()
|
||||
{
|
||||
m_pFrm->setDockExtension(0);
|
||||
g_pDockWidgetList->removeRef(this);
|
||||
}
|
||||
|
||||
void KviDockWidget::die()
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
|
||||
void KviDockWidget::flashingTimerShot()
|
||||
{
|
||||
m_bFlashed=!m_bFlashed;
|
||||
refresh();
|
||||
}
|
||||
|
||||
#define NIDLEMSGS 18
|
||||
|
||||
static const char * idlemsgs[NIDLEMSGS]=
|
||||
{
|
||||
__tr("Nothing is happening...") ,
|
||||
__tr("Just idling...") ,
|
||||
__tr("Dum de dum de dum...") ,
|
||||
__tr("Hey man... do something!") ,
|
||||
__tr("Umpf!") ,
|
||||
__tr("Silence speaking") ,
|
||||
__tr("Are ya here?") ,
|
||||
__tr("The world has stopped?") ,
|
||||
__tr("Everything is all right") ,
|
||||
__tr("idle()") ,
|
||||
__tr("It's so cold here...") ,
|
||||
__tr("Do not disturb... watching TV") ,
|
||||
__tr("Just vegetating") ,
|
||||
__tr("Hey... are ya sure that your network is up?") ,
|
||||
__tr("Seems like the world has stopped spinning") ,
|
||||
__tr("This silence is freaking me out!") ,
|
||||
__tr("Mieeeeeowww!") ,
|
||||
__tr("idle idle idle idle!")
|
||||
};
|
||||
|
||||
void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const TQPoint &pnt)
|
||||
{
|
||||
TQString tmp;
|
||||
|
||||
KviTaskBarBase * t = m_pFrm->taskBar();
|
||||
|
||||
TQString line;
|
||||
|
||||
for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem())
|
||||
{
|
||||
|
||||
if(b->kviWindow()->view())
|
||||
{
|
||||
if(b->kviWindow()->view()->haveUnreadedMessages())
|
||||
{
|
||||
line = b->kviWindow()->lastMessageText();
|
||||
if(!line.isEmpty())
|
||||
{
|
||||
line.replace(TQChar('&'),"&");
|
||||
line.replace(TQChar('<'),"<");
|
||||
line.replace(TQChar('>'),">");
|
||||
tmp += "<b>";
|
||||
tmp += b->kviWindow()->plainTextCaption();
|
||||
tmp += "</b><br>";
|
||||
tmp += line;
|
||||
tmp += "<br><br>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
srand(time(0));
|
||||
|
||||
// We use the bad way to generate random numbers :)))))
|
||||
|
||||
if(tmp.isEmpty())tmp = __tr2qs_no_xgettext(idlemsgs[(int)(rand() % NIDLEMSGS)]);
|
||||
|
||||
//m_pTip->tip(rect(),tmp);
|
||||
}
|
||||
|
||||
//int KviDockWidget::message(int,void *)
|
||||
//{
|
||||
// tqDebug("Message");
|
||||
// update();
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
//FIXME: TQt4 port
|
||||
/*void KviDockWidget::mousePressEvent(TQMouseEvent *e)
|
||||
{
|
||||
if(e->button() & Qt::LeftButton)toggleParentFrame();
|
||||
else if(e->button() & Qt::RightButton)
|
||||
m_pContextPopup->popup(mapToGlobal(e->pos()));
|
||||
}*/
|
||||
|
||||
void KviDockWidget::doAway(int id)
|
||||
{
|
||||
if(id<0)
|
||||
{
|
||||
KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict);
|
||||
while(KviWindow * wnd = it.current())
|
||||
{
|
||||
if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE)
|
||||
{
|
||||
KviConsole* pConsole=(KviConsole*)wnd;
|
||||
if(pConsole->isConnected())
|
||||
if(id==-2)
|
||||
pConsole->connection()->sendFmtData("AWAY");
|
||||
else
|
||||
pConsole->connection()->sendFmtData("AWAY :%s",
|
||||
pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data()
|
||||
);
|
||||
}
|
||||
++it;
|
||||
}
|
||||
} else {
|
||||
KviConsole* pConsole=g_pApp->findConsole((unsigned int)id);
|
||||
if(pConsole)
|
||||
if(pConsole->isConnected())
|
||||
if(pConsole->connection()->userInfo()->isAway())
|
||||
pConsole->connection()->sendFmtData("AWAY");
|
||||
else
|
||||
pConsole->connection()->sendFmtData("AWAY :%s",
|
||||
pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void KviDockWidget::fillContextPopup()
|
||||
{
|
||||
m_pContextPopup->changeItem(m_iToggleFrame,m_pFrm->isVisible() ? __tr2qs("Hide Window") : __tr2qs("Show Window"));
|
||||
if(g_pApp->topmostConnectedConsole())
|
||||
{
|
||||
m_pContextPopup->setItemVisible(m_iAwayMenuId,true);
|
||||
m_pAwayPopup->clear();
|
||||
|
||||
int iAllAway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on all"),this,TQT_SLOT(doAway(int)));
|
||||
m_pAwayPopup->setItemParameter(iAllAway,-1);
|
||||
|
||||
int iAllUnaway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on all"),this,TQT_SLOT(doAway(int)));
|
||||
m_pAwayPopup->setItemParameter(iAllUnaway,-2);
|
||||
|
||||
int iSeparator=m_pAwayPopup->insertSeparator();
|
||||
|
||||
KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict);
|
||||
bool bAllAway=1;
|
||||
bool bAllUnaway=1;
|
||||
int iNetCount=0;
|
||||
while(KviWindow * wnd = it.current())
|
||||
{
|
||||
if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE)
|
||||
{
|
||||
KviConsole* pConsole=(KviConsole*)wnd;
|
||||
if(pConsole->isConnected())
|
||||
{
|
||||
int id;
|
||||
if(pConsole->connection()->userInfo()->isAway())
|
||||
{
|
||||
id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on %1").arg(pConsole->currentNetworkName()),this,TQT_SLOT(doAway(int)));
|
||||
bAllUnaway=0;
|
||||
} else {
|
||||
id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on %1").arg(pConsole->currentNetworkName()),this,TQT_SLOT(doAway(int)));
|
||||
bAllAway=0;
|
||||
}
|
||||
m_pAwayPopup->setItemParameter(id,pConsole->ircContextId());
|
||||
iNetCount++;
|
||||
}
|
||||
}
|
||||
++it;
|
||||
}
|
||||
if(iNetCount==1)
|
||||
{
|
||||
m_pAwayPopup->setItemVisible(iAllAway,false);
|
||||
m_pAwayPopup->setItemVisible(iAllUnaway,false);
|
||||
m_pAwayPopup->setItemVisible(iSeparator,false);
|
||||
} else {
|
||||
m_pAwayPopup->setItemVisible(iAllAway,!bAllAway);
|
||||
m_pAwayPopup->setItemVisible(iAllUnaway,!bAllUnaway);
|
||||
}
|
||||
} else {
|
||||
m_pContextPopup->setItemVisible(m_iAwayMenuId,false);
|
||||
}
|
||||
}
|
||||
|
||||
void KviDockWidget::toggleParentFrame()
|
||||
{
|
||||
TQWidget *top_widget = m_pFrm->topLevelWidget();
|
||||
|
||||
if(m_pFrm->isVisible()) {
|
||||
m_pFrm->hide();
|
||||
} else {
|
||||
top_widget->show();
|
||||
top_widget->raise();
|
||||
top_widget->setActiveWindow();
|
||||
if(g_pActiveWindow) g_pActiveWindow->setFocus();
|
||||
if(m_pFrm->isMinimized())
|
||||
m_pFrm->showNormal();
|
||||
else
|
||||
m_pFrm->show();
|
||||
}
|
||||
}
|
||||
|
||||
void KviDockWidget::refresh()
|
||||
{
|
||||
grabActivityInfo();
|
||||
|
||||
if( (m_iChannels == 2) || (m_iQueries == 2) )
|
||||
{
|
||||
if(!m_pFlashingTimer->isActive() && KVI_OPTION_BOOL(KviOption_boolEnableTrayIconFlashing) )
|
||||
m_pFlashingTimer->start(1000);
|
||||
} else {
|
||||
if(m_pFlashingTimer->isActive()) m_pFlashingTimer->stop();
|
||||
m_bFlashed=false;
|
||||
}
|
||||
|
||||
m_CurrentPixmap.fill(TQt::transparent);
|
||||
TQPainter thisRestrictionOfTQt4IsNotNice(&m_CurrentPixmap);
|
||||
//thisRestrictionOfTQt4IsNotNice.drawPixmap(0,0,22,22,*g_pDock1,0,0,22,22);
|
||||
|
||||
if(m_bFlashed)
|
||||
{
|
||||
thisRestrictionOfTQt4IsNotNice.drawPixmap((ICON_SIZE-16)/2,(ICON_SIZE-16)/2,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16);
|
||||
} else {
|
||||
thisRestrictionOfTQt4IsNotNice.drawPixmap(0,0,ICON_SIZE/2,ICON_SIZE/2,
|
||||
m_iOther ?
|
||||
((m_iOther == 2) ? *g_pDock3 : *g_pDock2)
|
||||
: *g_pDock1,0,0,ICON_SIZE/2,ICON_SIZE/2);
|
||||
|
||||
thisRestrictionOfTQt4IsNotNice.drawPixmap(0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
|
||||
m_iConsoles ?
|
||||
((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2)
|
||||
: *g_pDock1,0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2);
|
||||
|
||||
thisRestrictionOfTQt4IsNotNice.drawPixmap(ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2,
|
||||
m_iQueries ?
|
||||
((m_iQueries == 2)
|
||||
? *g_pDock3 : *g_pDock2)
|
||||
: *g_pDock1,ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2);
|
||||
|
||||
thisRestrictionOfTQt4IsNotNice.drawPixmap(ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,
|
||||
m_iChannels ?
|
||||
((m_iChannels == 2) ? *g_pDock3 : *g_pDock2)
|
||||
: *g_pDock1
|
||||
,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2);
|
||||
|
||||
}
|
||||
updateIcon();
|
||||
}
|
||||
|
||||
void KviDockWidget::activatedSlot( TQSystemTrayIcon::ActivationReason reason )
|
||||
{
|
||||
if(reason==TQSystemTrayIcon::Trigger)
|
||||
{
|
||||
toggleParentFrame();
|
||||
}
|
||||
}
|
||||
|
||||
void KviDockWidget::grabActivityInfo()
|
||||
{
|
||||
KviTaskBarBase * t = m_pFrm->taskBar();
|
||||
|
||||
if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
|
||||
{
|
||||
if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=5;
|
||||
if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=5;
|
||||
|
||||
if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=1;
|
||||
if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=1;
|
||||
|
||||
if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage))
|
||||
KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage);
|
||||
}
|
||||
|
||||
m_iConsoles = 0;
|
||||
m_iChannels = 0;
|
||||
m_iQueries = 0;
|
||||
m_iOther = 0;
|
||||
|
||||
for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem())
|
||||
{
|
||||
if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
|
||||
{
|
||||
int iLevel = b->highlightLevel();
|
||||
switch(b->kviWindow()->type())
|
||||
{
|
||||
case KVI_WINDOW_TYPE_CONSOLE:
|
||||
if(m_iConsoles < iLevel) m_iConsoles = iLevel;
|
||||
break;
|
||||
case KVI_WINDOW_TYPE_CHANNEL:
|
||||
if(m_iChannels < iLevel) m_iChannels = iLevel;
|
||||
break;
|
||||
case KVI_WINDOW_TYPE_QUERY:
|
||||
if(m_iQueries < iLevel) m_iQueries = iLevel;
|
||||
break;
|
||||
default:
|
||||
if(m_iOther < iLevel) m_iOther = iLevel;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
int iLevel=0;
|
||||
if(b->kviWindow()->view())
|
||||
{
|
||||
if(b->kviWindow()->view()->haveUnreadedHighlightedMessages())
|
||||
{
|
||||
iLevel=2;
|
||||
} else if(b->kviWindow()->view()->haveUnreadedMessages())
|
||||
{
|
||||
iLevel=1;
|
||||
}
|
||||
if(iLevel>0)
|
||||
switch(b->kviWindow()->type())
|
||||
{
|
||||
case KVI_WINDOW_TYPE_CONSOLE:
|
||||
if(m_iConsoles < iLevel) m_iConsoles = iLevel;
|
||||
break;
|
||||
case KVI_WINDOW_TYPE_CHANNEL:
|
||||
if(m_iChannels < iLevel) m_iChannels = iLevel;
|
||||
break;
|
||||
case KVI_WINDOW_TYPE_QUERY:
|
||||
if(m_iQueries < iLevel) m_iQueries = iLevel;
|
||||
break;
|
||||
default:
|
||||
if(m_iOther < iLevel) m_iOther = iLevel;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification))
|
||||
{
|
||||
if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iConsoles=2;
|
||||
else if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iConsoles=1;
|
||||
else m_iConsoles=0;
|
||||
|
||||
if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iChannels=2;
|
||||
else if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iChannels=1;
|
||||
else m_iChannels=0;
|
||||
|
||||
if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iQueries=2;
|
||||
else if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iQueries=1;
|
||||
else m_iQueries=0;
|
||||
|
||||
if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iOther=2;
|
||||
else if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iOther=1;
|
||||
else m_iOther=0;
|
||||
}
|
||||
}
|
||||
|
||||
void KviDockWidget::updateIcon()
|
||||
{
|
||||
setIcon(TQIcon(m_CurrentPixmap));
|
||||
}
|
||||
|
||||
|
||||
static KviDockWidget * dockwidget_find(KviFrame *f)
|
||||
{
|
||||
if(!g_pDockWidgetList)return 0;
|
||||
for(KviDockWidget * w = g_pDockWidgetList->first();w;w = g_pDockWidgetList->next())
|
||||
{
|
||||
if(w->frame() == f)return w;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@doc: dockwidget.show
|
||||
@type:
|
||||
command
|
||||
@title:
|
||||
dockwidget.show
|
||||
@short:
|
||||
Shows the dock widget for the current frame window
|
||||
@keyterms:
|
||||
dock widget , system tray
|
||||
@syntax:
|
||||
dockwidget.show
|
||||
@description:
|
||||
Shows the dock widget for the current frame window.[br]
|
||||
The dock widget is a small widget that docks in the TDE panel.[br]
|
||||
It shows a small icon of the earth and eventually displays four squares
|
||||
that cover this icon: the bottom left square appears when there is some new
|
||||
text in any console window, the square becomes red if the text is highlighted.[br]
|
||||
The bottom right square appears when there is some new text in any channel window,
|
||||
and it becomes red when the text is highlighted.[br] The upper right square refers to
|
||||
query windows and the upper left one to any other kind of window (dcc , links...).[br]
|
||||
If you move the mouse over the dock widget a tooltip will show you the last lines
|
||||
of the "new" text in all these windows.[br]
|
||||
This is useful when you keep the main KVIrc window minimized and you're working on something else:
|
||||
if the dock widget shows nothing but the earth icon , nothing is happening in the main KVIrc window.
|
||||
If the dock widget shows one or more white (or red) squares , you can move the mouse over
|
||||
and check what's happened exactly and eventually bring up the main KVIrc window by clicking on the widget.[br]
|
||||
[big]tecnical details[/big]
|
||||
The dock widget is currently working in KDE compilation mode only:
|
||||
it relies on the KWin implementation of the Window Manager interaction protocol.
|
||||
@seealso:
|
||||
[cmd]dockwidget.hide[/cmd]
|
||||
*/
|
||||
|
||||
static bool dockwidget_kvs_cmd_show(KviKvsModuleCommandCall * c)
|
||||
{
|
||||
if(!(dockwidget_find(c->window()->frame())))
|
||||
{
|
||||
KviDockWidget * w = new KviDockWidget(c->window()->frame());
|
||||
w->show();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@doc: dockwidget.hide
|
||||
@type:
|
||||
command
|
||||
@title:
|
||||
dockwidget.hide
|
||||
@short:
|
||||
Hides the dock widget for the current frame window
|
||||
@syntax:
|
||||
dockwidget.hide
|
||||
@description:
|
||||
Hides the dock widget for the current frame window
|
||||
@seealso:
|
||||
[cmd]dockwidget.show[/cmd]
|
||||
*/
|
||||
|
||||
static bool dockwidget_kvs_cmd_hide(KviKvsModuleCommandCall * c)
|
||||
{
|
||||
KviDockWidget * w= dockwidget_find(c->window()->frame());
|
||||
if(w)delete w;
|
||||
// show the parent frame.. otherwise there will be no way to get it back
|
||||
if(!c->window()->frame()->isVisible())
|
||||
{
|
||||
c->window()->frame()->show();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@doc: dockwidget.hidewindow
|
||||
@type:
|
||||
command
|
||||
@title:
|
||||
dockwidget.hidewindow
|
||||
@short:
|
||||
Returns the state of the dock widget
|
||||
@syntax:
|
||||
dockwidget.hidewindow
|
||||
@description:
|
||||
Hides the window, assotiated with dockwidget
|
||||
@seealso:
|
||||
[cmd]dockwidget.show[/cmd], [cmd]dockwidget.hide[/cmd]
|
||||
*/
|
||||
|
||||
static bool dockwidget_kvs_cmd_hidewindow(KviKvsModuleCommandCall * c)
|
||||
{
|
||||
KviDockWidget * w= dockwidget_find(c->window()->frame());
|
||||
if(w)
|
||||
{
|
||||
c->window()->frame()->hide();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
@doc: dockwidget.isVisible
|
||||
@type:
|
||||
function
|
||||
@title:
|
||||
$dockwidget.isVisible
|
||||
@short:
|
||||
Returns the state of the dock widget
|
||||
@syntax:
|
||||
$reguser.isVisible()
|
||||
@description:
|
||||
Returns 1 if the dock widget is actually visible , 0 otherwise.
|
||||
@seealso:
|
||||
[cmd]dockwidget.show[/cmd]
|
||||
*/
|
||||
|
||||
static bool dockwidget_kvs_fnc_isvisible(KviKvsModuleFunctionCall * c)
|
||||
{
|
||||
c->returnValue()->setBoolean(dockwidget_find(c->window()->frame()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// =======================================
|
||||
// init routine
|
||||
// =======================================
|
||||
static bool dockwidget_module_init(KviModule * m)
|
||||
{
|
||||
TQString buffer;
|
||||
#ifdef COMPILE_ON_WINDOWS
|
||||
g_pApp->findImage(buffer,"kvi_dock_win32-0.png");
|
||||
#else
|
||||
g_pApp->findImage(buffer,"kvi_dock_part-0.png");
|
||||
#endif
|
||||
g_pDock1 = new TQPixmap(buffer);
|
||||
|
||||
#ifdef COMPILE_ON_WINDOWS
|
||||
g_pApp->findImage(buffer,"kvi_dock_win32-1.png");
|
||||
#else
|
||||
g_pApp->findImage(buffer,"kvi_dock_part-1.png");
|
||||
#endif
|
||||
g_pDock2 = new TQPixmap(buffer);
|
||||
|
||||
#ifdef COMPILE_ON_WINDOWS
|
||||
g_pApp->findImage(buffer,"kvi_dock_win32-2.png");
|
||||
#else
|
||||
g_pApp->findImage(buffer,"kvi_dock_part-2.png");
|
||||
#endif
|
||||
|
||||
g_pDock3 = new TQPixmap(buffer);
|
||||
|
||||
|
||||
g_pDockWidgetList = new KviPointerList<KviDockWidget>;
|
||||
g_pDockWidgetList->setAutoDelete(false);
|
||||
|
||||
|
||||
KVSM_REGISTER_SIMPLE_COMMAND(m,"hide",dockwidget_kvs_cmd_hide);
|
||||
KVSM_REGISTER_SIMPLE_COMMAND(m,"hidewindow",dockwidget_kvs_cmd_hidewindow);
|
||||
KVSM_REGISTER_SIMPLE_COMMAND(m,"show",dockwidget_kvs_cmd_show);
|
||||
KVSM_REGISTER_FUNCTION(m,"isVisible",dockwidget_kvs_fnc_isvisible);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool dockwidget_module_cleanup(KviModule *m)
|
||||
{
|
||||
while(g_pDockWidgetList->first())delete g_pDockWidgetList->first();
|
||||
delete g_pDockWidgetList;
|
||||
g_pDockWidgetList = 0;
|
||||
|
||||
delete g_pDock1;
|
||||
g_pDock1 = 0;
|
||||
|
||||
delete g_pDock2;
|
||||
g_pDock2 = 0;
|
||||
|
||||
delete g_pDock3;
|
||||
g_pDock3 = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool dockwidget_module_can_unload(KviModule *)
|
||||
{
|
||||
return g_pDockWidgetList->isEmpty();
|
||||
}
|
||||
|
||||
// =======================================
|
||||
// plugin definition structure
|
||||
// =======================================
|
||||
KVIRC_MODULE(
|
||||
"KVIrc dock widget implementation",
|
||||
"2.0.0",
|
||||
"Szymon Stefanek <pragma at kvirc dot net> and Alexey Uzhva <alexey at kvirc dot ru>" ,
|
||||
"exports the /dockwidget.* interface\n",
|
||||
dockwidget_module_init ,
|
||||
dockwidget_module_can_unload,
|
||||
0,
|
||||
dockwidget_module_cleanup
|
||||
)
|
||||
|
||||
#include "libkvidockwidget_qt4.moc"
|
||||
|
||||
#endif
|
@ -1,82 +0,0 @@
|
||||
#ifndef _KVI_DOCKWIDGET_QT4_H_
|
||||
#define _KVI_DOCKWIDGET_QT4_H_
|
||||
//
|
||||
// This file is part of the KVirc irc client distribution
|
||||
// Creation date : Tue 02 Jan 2001 14:28:25 by Szymon Stefanek
|
||||
// Copyright (C) 2000-2001 Szymon Stefanek (pragma at kvirc dot net)
|
||||
//
|
||||
// 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 opinion) 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
|
||||
#include "kvi_settings.h"
|
||||
//#ifdef COMPILE_USE_QT4
|
||||
|
||||
#include "kvi_frame.h"
|
||||
|
||||
class KviTalPopupMenu;
|
||||
#include <TQSystemTrayIcon>
|
||||
|
||||
class TQPixmap;
|
||||
class TQTimer;
|
||||
|
||||
//class KviFrame;
|
||||
class KviDynamicToolTip;
|
||||
|
||||
class KviDockWidget : public TQSystemTrayIcon, public KviDockExtension
|
||||
{
|
||||
TQ_OBJECT
|
||||
|
||||
public:
|
||||
KviDockWidget(KviFrame * win);
|
||||
~KviDockWidget();
|
||||
protected:
|
||||
KviFrame * m_pFrm;
|
||||
KviDynamicToolTip * m_pTip;
|
||||
KviTalPopupMenu * m_pContextPopup;
|
||||
KviTalPopupMenu * m_pAwayPopup;
|
||||
|
||||
int m_iToggleFrame;
|
||||
int m_iAwayMenuId;
|
||||
|
||||
bool m_bFlashed;
|
||||
|
||||
TQPixmap m_CurrentPixmap;
|
||||
TQTimer* m_pFlashingTimer;
|
||||
int m_iConsoles;
|
||||
int m_iChannels;
|
||||
int m_iQueries;
|
||||
int m_iOther;
|
||||
public:
|
||||
KviFrame * frame(){ return m_pFrm; };
|
||||
public:
|
||||
virtual void refresh();
|
||||
virtual void die();
|
||||
void updateIcon();
|
||||
protected:
|
||||
void grabActivityInfo();
|
||||
|
||||
protected slots:
|
||||
void fillContextPopup();
|
||||
void toggleParentFrame();
|
||||
void tipRequest(KviDynamicToolTip *tip,const TQPoint &pnt);
|
||||
void doAway(int);
|
||||
void flashingTimerShot();
|
||||
|
||||
void activatedSlot( TQSystemTrayIcon::ActivationReason reason );
|
||||
};
|
||||
|
||||
//#endif
|
||||
|
||||
#endif //_KVI_DOCKWIDGET_QT4_H_
|
Loading…
Reference in new issue