aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Noldor2008-05-13 15:28:49 +0000
committerGravatar Noldor2008-05-13 15:28:49 +0000
commitbc07070cb9f301d824e73a553289a1824b6c775a (patch)
tree73534846921a7746a04f0dca93edeeec417997a4 /src/modules
parentadded uk locale (ukraine, not united kingdom!) to info.plist (diff)
downloadKVIrc-bc07070cb9f301d824e73a553289a1824b6c775a.tar.gz
KVIrc-bc07070cb9f301d824e73a553289a1824b6c775a.tar.bz2
KVIrc-bc07070cb9f301d824e73a553289a1824b6c775a.zip
Huge QT4 port commit :) (wip)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1765 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/about/aboutdialog.cpp4
-rw-r--r--src/modules/action/libkviaction.cpp8
-rw-r--r--src/modules/actioneditor/actioneditor.cpp205
-rw-r--r--src/modules/actioneditor/actioneditor.h31
-rw-r--r--src/modules/actioneditor/actioneditor_QT4_vc05.vcproj2
-rw-r--r--src/modules/addon/addon_QT4_vc05.vcproj2
-rw-r--r--src/modules/addon/managementdialog.h1
-rw-r--r--src/modules/aliaseditor/aliaseditor.cpp54
-rw-r--r--src/modules/aliaseditor/aliaseditor.h5
-rw-r--r--src/modules/aliaseditor/aliaseditor_QT4_vc05.vcproj4
-rw-r--r--src/modules/avatar/avatar_QT4_vc05.vcproj2
-rw-r--r--src/modules/avatar/libkviavatar.cpp4
-rw-r--r--src/modules/chan/chan_QT4_vc05.vcproj2
-rw-r--r--src/modules/chan/libkvichan.cpp16
-rw-r--r--src/modules/channelsjoin/channelsjoin_QT4_vc05.vcproj2
-rw-r--r--src/modules/channelsjoin/channelsjoinwindow.cpp54
-rw-r--r--src/modules/channelsjoin/channelsjoinwindow.h8
-rw-r--r--src/modules/codetester/codetester.cpp6
-rw-r--r--src/modules/codetester/codetester_QT4_vc05.vcproj2
-rw-r--r--src/modules/config/config_QT4_vc05.vcproj2
-rw-r--r--src/modules/context/context_QT4_vc05.vcproj2
-rw-r--r--src/modules/dialog/dialog_QT4_vc05.vcproj2
-rw-r--r--src/modules/dialog/libkvidialog.cpp12
-rw-r--r--src/modules/editor/editor_QT4_vc05.vcproj2
-rw-r--r--src/modules/editor/scripteditor.cpp107
-rw-r--r--src/modules/editor/scripteditor.h2
-rw-r--r--src/modules/file/libkvifile.cpp46
-rw-r--r--src/modules/http/http_QT4_vc05.vcproj2
-rw-r--r--src/modules/http/httpfiletransfer.cpp4
-rw-r--r--src/modules/http/httpfiletransfer.h1
-rw-r--r--src/modules/ident/ident_QT4_vc05.vcproj2
-rw-r--r--src/modules/lamerizer/lamerizer_QT4_vc05.vcproj2
-rw-r--r--src/modules/links/links_QT4_vc05.vcproj2
-rw-r--r--src/modules/list/list_QT4_vc05.vcproj2
-rw-r--r--src/modules/log/log_QT4_vc05.vcproj2
-rw-r--r--src/modules/mask/mask_QT4_vc05.vcproj2
-rw-r--r--src/modules/math/math_QT4_vc05.vcproj2
-rw-r--r--src/modules/mediaplayer/libkvimediaplayer.cpp4
-rw-r--r--src/modules/mediaplayer/mediaplayer_QT4_vc05.vcproj2
-rw-r--r--src/modules/mediaplayer/mp_amipinterface.cpp10
-rw-r--r--src/modules/mediaplayer/mp_interface.cpp14
-rw-r--r--src/modules/mediaplayer/mp_winampinterface.cpp4
-rw-r--r--src/modules/mircimport/mircimport_QT4_vc05.vcproj2
-rw-r--r--src/modules/my/my_QT4_vc05.vcproj2
-rw-r--r--src/modules/objects/class_listview.cpp42
-rw-r--r--src/modules/objects/class_listview.h4
-rw-r--r--src/modules/objects/class_widget.cpp12
-rw-r--r--src/modules/objects/class_widget.h1
-rw-r--r--src/modules/popupeditor/popupeditor.cpp3
-rw-r--r--src/modules/reguser/dialog.cpp3
-rw-r--r--src/modules/theme/managementdialog.cpp26
-rw-r--r--src/modules/theme/managementdialog.h6
52 files changed, 373 insertions, 370 deletions
diff --git a/src/modules/about/aboutdialog.cpp b/src/modules/about/aboutdialog.cpp
index 9ae053e1a..a9a0fa2b4 100644
--- a/src/modules/about/aboutdialog.cpp
+++ b/src/modules/about/aboutdialog.cpp
@@ -90,7 +90,9 @@ KviAboutDialog::KviAboutDialog()
QLabel * l = new QLabel(w);
l->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
- l->setBackgroundColor(Qt::black);
+ QPalette p = l->palette();
+ p.setColor(backgroundRole(), Qt::black);
+ l->setPalette(p);
l->setAlignment(Qt::AlignCenter);
l->setPixmap(pix);
diff --git a/src/modules/action/libkviaction.cpp b/src/modules/action/libkviaction.cpp
index 8835ea916..cbc53a85c 100644
--- a/src/modules/action/libkviaction.cpp
+++ b/src/modules/action/libkviaction.cpp
@@ -396,10 +396,10 @@ static bool action_kvs_cmd_create(KviKvsModuleCallbackCommandCall * c)
c->switches()->getAsStringIfExisting('w',"window-types",szWindows);
if(!szWindows.isEmpty())
{
- if(szWindows.find('c') != -1)iFlags |= KviAction::WindowChannel;
- if(szWindows.find('x') != -1)iFlags |= KviAction::WindowConsole;
- if(szWindows.find('d') != -1)iFlags |= KviAction::WindowDccChat;
- if(szWindows.find('q') != -1)iFlags |= KviAction::WindowQuery;
+ if(szWindows.indexOf('c',Qt::CaseInsensitive) != -1)iFlags |= KviAction::WindowChannel;
+ if(szWindows.indexOf('x',Qt::CaseInsensitive) != -1)iFlags |= KviAction::WindowConsole;
+ if(szWindows.indexOf('d',Qt::CaseInsensitive) != -1)iFlags |= KviAction::WindowDccChat;
+ if(szWindows.indexOf('q',Qt::CaseInsensitive) != -1)iFlags |= KviAction::WindowQuery;
}
if(c->switches()->find('s',"enable-on-selected"))
{
diff --git a/src/modules/actioneditor/actioneditor.cpp b/src/modules/actioneditor/actioneditor.cpp
index 21224103d..ec8f54757 100644
--- a/src/modules/actioneditor/actioneditor.cpp
+++ b/src/modules/actioneditor/actioneditor.cpp
@@ -43,6 +43,7 @@
#include "kvi_valuelist.h"
#include "kvi_tal_vbox.h"
#include <kvi_tal_groupbox.h>
+#include "kvi_tal_itemdelegates.h"
#include <QSplitter>
#include <QLayout>
@@ -66,77 +67,33 @@ static QString g_szLastEditedAction;
#define LVI_ICON_SIZE 32
#define LVI_BORDER 4
#define LVI_SPACING 8
-#define LVI_MINIMUM_TEXT_WIDTH 150
#define LVI_MINIMUM_CELL_WIDTH (LVI_MINIMUM_TEXT_WIDTH + LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER)
-KviActionEditorListViewItem::KviActionEditorListViewItem(KviTalListView * v,KviActionData * a)
-: KviTalListViewItem(v,"")
+KviActionEditorTreeWidgetItem::KviActionEditorTreeWidgetItem(QTreeWidget * v,KviActionData * a)
+: QTreeWidgetItem(v)
{
m_pActionData = a;
- m_pListView = v;
- m_pIcon = 0;
- setupForActionData();
-}
-
-KviActionEditorListViewItem::~KviActionEditorListViewItem()
-{
- if(m_pIcon)delete m_pIcon;
- delete m_pActionData;
-}
-
-void KviActionEditorListViewItem::setupForActionData()
-{
+ m_pTreeWidget = v;
+ setFlags(Qt::ItemIsUserCheckable);
QString t = "<b>" + m_pActionData->m_szName + "</b>";
t += "<br><font color=\"#808080\" size=\"-1\">" + m_pActionData->m_szVisibleName + "</font>";
m_szKey = m_pActionData->m_szName.upper();
- m_pText = new QTextDocument();
- m_pText->setHtml(t);
- m_pText->setDefaultFont(m_pListView->font());
- if(m_pIcon)delete m_pIcon;
+ setText(0,t);
QPixmap * p = g_pIconManager->getBigIcon(m_pActionData->m_szBigIcon);
- if(p)m_pIcon = new QPixmap(*p);
- else {
- p = g_pIconManager->getImage("kvi_bigicon_unknown.png");
- if(p)m_pIcon = new QPixmap(*p);
- else m_pIcon = new QPixmap(LVI_ICON_SIZE,LVI_ICON_SIZE);
- }
- setup();
+ if(p)setIcon(0,*p);
}
-QString KviActionEditorListViewItem::key(int,bool) const
+KviActionEditorTreeWidgetItem::~KviActionEditorTreeWidgetItem()
{
- return m_szKey;
+ delete m_pActionData;
}
-void KviActionEditorListViewItem::setup()
-{
- KviTalListViewItem::setup();
- int iWidth = m_pListView->visibleWidth();
- if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH;
- iWidth -= LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER;
- int iHeight = m_pText->pageSize().height() + (2 * LVI_BORDER);
- if(iHeight < (LVI_ICON_SIZE + (2 * LVI_BORDER)))iHeight = LVI_ICON_SIZE + (2 * LVI_BORDER);
- setHeight(iHeight);
-}
-void KviActionEditorListViewItem::paintCell(QPainter * p,const QColorGroup & cg,int column,int width,int align)
+QString KviActionEditorTreeWidgetItem::key(int,bool) const
{
- if (isSelected())
- {
- QColor col(m_pListView->palette().highlight());
- col.setAlpha(200);
- p->setBrush(col);
- p->drawRect(0, 0, m_pListView->visibleWidth(), height());
- }
- p->drawPixmap(LVI_BORDER,LVI_BORDER,*m_pIcon);
- int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING;
- int www = m_pListView->visibleWidth() - (afterIcon + LVI_BORDER);
- p->translate(afterIcon,LVI_BORDER);
- m_pText->setPageSize(QSizeF(www,height() - (LVI_BORDER * 2)));
- m_pText->drawContents(p);
+ return m_szKey;
}
-
KviSingleActionEditor::KviSingleActionEditor(QWidget * par,KviActionEditor * ed)
: QWidget(par)
{
@@ -149,13 +106,14 @@ KviSingleActionEditor::KviSingleActionEditor(QWidget * par,KviActionEditor * ed)
g->addWidget(l,0,0);
m_pNameEdit = new QLineEdit(this);
g->addWidget(m_pNameEdit,0,1);
- QToolTip::add(m_pNameEdit,__tr2qs("Internal unique name for the action"));
+ m_pNameEdit->setToolTip(__tr2qs("Internal unique name for the action"));
l = new QLabel(__tr2qs("Label:"),this);
g->addWidget(l,1,0);
m_pVisibleNameEdit = new QLineEdit(this);
g->addWidget(m_pVisibleNameEdit,1,1);
- QToolTip::add(m_pVisibleNameEdit,__tr2qs("Visible name for this action.<br>This string will be displayed to the user so it is a good idea to use $tr() here"));
+ m_pVisibleNameEdit->setToolTip(__tr2qs("Visible name for this action.<br>This string will be displayed to the user so it is a good idea to use $tr() here"));
+
QTabWidget * tw = new QTabWidget(this);
g->addMultiCellWidget(tw,2,2,0,1);
@@ -178,13 +136,13 @@ KviSingleActionEditor::KviSingleActionEditor(QWidget * par,KviActionEditor * ed)
gl->addWidget(l,0,0);
m_pCategoryCombo = new QComboBox(false,tab);
gl->addMultiCellWidget(m_pCategoryCombo,0,0,1,3);
- QToolTip::add(m_pCategoryCombo,__tr2qs("Choose the category that best fits for this action"));
+ m_pCategoryCombo->setToolTip(__tr2qs("Choose the category that best fits for this action"));
l = new QLabel(__tr2qs("Description:"),tab);
gl->addWidget(l,1,0);
m_pDescriptionEdit = new QLineEdit(tab);
gl->addMultiCellWidget(m_pDescriptionEdit,1,1,1,3);
- QToolTip::add(m_pDescriptionEdit,__tr2qs("Visible short description for this action.<br>This string will be displayed to the user so it is a good idea to use $tr() here"));
+ m_pDescriptionEdit->setToolTip(__tr2qs("Visible short description for this action.<br>This string will be displayed to the user so it is a good idea to use $tr() here"));
l = new QLabel(__tr2qs("Small Icon:"),tab);
gl->addWidget(l,2,0);
@@ -197,8 +155,8 @@ KviSingleActionEditor::KviSingleActionEditor(QWidget * par,KviActionEditor * ed)
QString s= __tr2qs("The small icon associated to this action.<br>" \
"It will appear at least in the popup menus when this action is inserted.<br>" \
"It should be 16x16 pixels.");
- QToolTip::add(m_pSmallIconEdit,s);
- QToolTip::add(m_pSmallIconButton,s);
+ m_pSmallIconEdit->setToolTip(s);
+ m_pSmallIconButton->setToolTip(s);
l = new QLabel(__tr2qs("Big Icon:"),tab);
gl->addWidget(l,3,0);
@@ -212,14 +170,14 @@ KviSingleActionEditor::KviSingleActionEditor(QWidget * par,KviActionEditor * ed)
s = __tr2qs("The big icon associated to this action.<br>" \
"It will appear at least in the toolbar buttons when this action is inserted.<br>" \
"It should be 32x32 pixels.");
- QToolTip::add(m_pBigIconEdit,s);
- QToolTip::add(m_pBigIconButton,s);
+ m_pBigIconEdit->setToolTip(s);
+ m_pBigIconButton->setToolTip(s);
l = new QLabel(__tr2qs("Key Sequence:"),tab);
gl->addMultiCellWidget(l,4,5,0,0);
m_pKeySequenceEdit = new QLineEdit(tab);
gl->addMultiCellWidget(m_pKeySequenceEdit,4,5,1,1);
- QToolTip::add(m_pKeySequenceEdit,__tr2qs("Optional keyboard sequence that will activate this action.<br>" \
+ m_pKeySequenceEdit->setToolTip(__tr2qs("Optional keyboard sequence that will activate this action.<br>" \
"The sequence should be expressed as a string of up to four key codes separated by commas " \
"eventually combined with the modifiers \"Ctrl\",\"Shift\",\"Alt\" and \"Meta\".<br>" \
"Examples of such sequences are \"Ctrl+X\", \"Ctrl+Alt+Z\", \"Ctrl+X,Ctrl+C\" ..."));
@@ -242,9 +200,10 @@ KviSingleActionEditor::KviSingleActionEditor(QWidget * par,KviActionEditor * ed)
m_pNeedsContextCheck = new KviStyledCheckBox(__tr2qs("Needs IRC Context"),tab);
connect(m_pNeedsContextCheck,SIGNAL(toggled(bool)),this,SLOT(needsContextCheckToggled(bool)));
- QToolTip::add(m_pNeedsContextCheck,__tr2qs("Check this option if this action should be enabled only when " \
+ m_pNeedsContextCheck->setToolTip(__tr2qs("Check this option if this action should be enabled only when " \
"the active window belongs to an irc context"));
gl->addMultiCellWidget(m_pNeedsContextCheck,0,0,0,3);
+
l = new QLabel(tab);
l->setMinimumWidth(40);
@@ -252,60 +211,62 @@ KviSingleActionEditor::KviSingleActionEditor(QWidget * par,KviActionEditor * ed)
m_pNeedsConnectionCheck = new KviStyledCheckBox(__tr2qs("Needs IRC Connection"),tab);
connect(m_pNeedsConnectionCheck,SIGNAL(toggled(bool)),this,SLOT(needsConnectionCheckToggled(bool)));
- QToolTip::add(m_pNeedsConnectionCheck,__tr2qs("Check this option if this action should be enabled only when " \
+ m_pNeedsConnectionCheck->setToolTip(__tr2qs("Check this option if this action should be enabled only when " \
"the active window has an active IRC connection"));
gl->addMultiCellWidget(m_pNeedsConnectionCheck,1,1,1,3);
+
l = new QLabel(tab);
l->setMinimumWidth(40);
gl->addWidget(l,2,1);
m_pEnableAtLoginCheck = new KviStyledCheckBox(__tr2qs("Enable at Login"),tab);
- QToolTip::add(m_pEnableAtLoginCheck,__tr2qs("Check this option if this action should be enabled also during " \
+ m_pEnableAtLoginCheck->setToolTip(__tr2qs("Check this option if this action should be enabled also during " \
"the login operations (so when the logical IRC connection hasn't been estabilished yet)"));
gl->addMultiCellWidget(m_pEnableAtLoginCheck,2,2,2,3);
m_pSpecificWindowsCheck = new KviStyledCheckBox(__tr2qs("Enable Only in Specified Windows"),tab);
connect(m_pSpecificWindowsCheck,SIGNAL(toggled(bool)),this,SLOT(specificWindowsCheckToggled(bool)));
- QToolTip::add(m_pSpecificWindowsCheck,__tr2qs("Check this option if this action should be enabled only when " \
+ m_pSpecificWindowsCheck->setToolTip(__tr2qs("Check this option if this action should be enabled only when " \
"the active window is of a specified type"));
gl->addMultiCellWidget(m_pSpecificWindowsCheck,3,3,0,3);
+
m_pWindowConsoleCheck = new KviStyledCheckBox(__tr2qs("Enable in Console Windows"),tab);
- QToolTip::add(m_pWindowConsoleCheck,__tr2qs("Check this option if this action should be enabled only when " \
+ m_pWindowConsoleCheck->setToolTip(__tr2qs("Check this option if this action should be enabled only when " \
"the active window is a console"));
connect(m_pWindowConsoleCheck,SIGNAL(toggled(bool)),this,SLOT(channelQueryOrConsoleWindowCheckToggled(bool)));
gl->addMultiCellWidget(m_pWindowConsoleCheck,4,4,1,3);
m_pConsoleOnlyIfUsersSelectedCheck = new KviStyledCheckBox(__tr2qs("Only If There Are Selected Users"),tab);
- QToolTip::add(m_pConsoleOnlyIfUsersSelectedCheck,__tr2qs("This will enable the action only if there are " \
+ m_pConsoleOnlyIfUsersSelectedCheck->setToolTip(__tr2qs("This will enable the action only if there are " \
"selected users in the active window"));
gl->addMultiCellWidget(m_pConsoleOnlyIfUsersSelectedCheck,5,5,2,3);
m_pWindowChannelCheck = new KviStyledCheckBox(__tr2qs("Enable in Channel Windows"),tab);
- QToolTip::add(m_pWindowChannelCheck,__tr2qs("Check this option if this action should be enabled only when " \
+ m_pWindowChannelCheck->setToolTip(__tr2qs("Check this option if this action should be enabled only when " \
"the active window is a channel"));
connect(m_pWindowChannelCheck,SIGNAL(toggled(bool)),this,SLOT(channelQueryOrConsoleWindowCheckToggled(bool)));
gl->addMultiCellWidget(m_pWindowChannelCheck,6,6,1,3);
m_pChannelOnlyIfUsersSelectedCheck = new KviStyledCheckBox(__tr2qs("Only If There Are Selected Users"),tab);
- QToolTip::add(m_pChannelOnlyIfUsersSelectedCheck,__tr2qs("This will enable the action only if there are " \
+ m_pChannelOnlyIfUsersSelectedCheck->setToolTip(__tr2qs("This will enable the action only if there are " \
"selected users in the active window"));
gl->addMultiCellWidget(m_pChannelOnlyIfUsersSelectedCheck,7,7,2,3);
m_pWindowQueryCheck = new KviStyledCheckBox(__tr2qs("Enable in Query Windows"),tab);
- QToolTip::add(m_pWindowQueryCheck,__tr2qs("Check this option if this action should be enabled only when " \
+ m_pWindowQueryCheck->setToolTip(__tr2qs("Check this option if this action should be enabled only when " \
"the active window is a query"));
connect(m_pWindowQueryCheck,SIGNAL(toggled(bool)),this,SLOT(channelQueryOrConsoleWindowCheckToggled(bool)));
gl->addMultiCellWidget(m_pWindowQueryCheck,8,8,1,3);
m_pQueryOnlyIfUsersSelectedCheck = new KviStyledCheckBox(__tr2qs("Only If There Are Selected Users"),tab);
- QToolTip::add(m_pQueryOnlyIfUsersSelectedCheck,__tr2qs("This will enable the action only if there are " \
+ m_pQueryOnlyIfUsersSelectedCheck->setToolTip(__tr2qs("This will enable the action only if there are " \
"selected users in the active window"));
gl->addMultiCellWidget(m_pQueryOnlyIfUsersSelectedCheck,9,9,2,3);
m_pWindowDccChatCheck = new KviStyledCheckBox(__tr2qs("Enable in DCC Chat Windows"),tab);
- QToolTip::add(m_pWindowDccChatCheck,__tr2qs("Check this option if this action should be enabled only when " \
+ m_pWindowDccChatCheck->setToolTip(__tr2qs("Check this option if this action should be enabled only when " \
"the active window is a dcc chat"));
gl->addMultiCellWidget(m_pWindowDccChatCheck,10,10,1,3);
@@ -608,24 +569,28 @@ void KviSingleActionEditor::commit()
}
-KviActionEditorListView::KviActionEditorListView(QWidget * pParent)
-: KviTalListView(pParent)
+KviActionEditorTreeView::KviActionEditorTreeView(QWidget * pParent)
+: QTreeWidget(pParent)
{
- setSelectionMode(Extended);
- int iWidth = visibleWidth();
+ setColumnCount (1);
+ setHeaderLabel(__tr2qs("Action"));
+ setSelectionMode(QAbstractItemView::ExtendedSelection);
+ setSortingEnabled(true);
+ int iWidth = viewport()->width();
if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH;
- addColumn(__tr2qs("Action"),iWidth);
- setSorting(0,true);
+ setRootIsDecorated(false);
+ setColumnWidth(0,iWidth);
+
}
-KviActionEditorListView::~KviActionEditorListView()
+KviActionEditorTreeView::~KviActionEditorTreeView()
{
}
-void KviActionEditorListView::resizeEvent(QResizeEvent * e)
+void KviActionEditorTreeView::resizeEvent(QResizeEvent * e)
{
- KviTalListView::resizeEvent(e);
- int iWidth = visibleWidth();
+ QTreeWidget::resizeEvent(e);
+ int iWidth = viewport()->width();
if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH;
setColumnWidth(0,iWidth);
}
@@ -642,11 +607,12 @@ KviActionEditor::KviActionEditor(QWidget * par)
KviTalVBox * box = new KviTalVBox(m_pSplitter);
- m_pListView = new KviActionEditorListView(box);
- //m_pListView->setMultiSelection(false);
- m_pListView->setShowSortIndicator(true);
- m_pListView->setFocusPolicy(Qt::StrongFocus);
- connect(m_pListView,SIGNAL(currentChanged(KviTalListViewItem *)),this,SLOT(currentChanged(KviTalListViewItem *)));
+ m_pTreeWidget = new KviActionEditorTreeView(box);
+ KviTalIconAndRichTextItemDelegate *itemDelegate=new KviTalIconAndRichTextItemDelegate(m_pTreeWidget);
+ m_pTreeWidget->setItemDelegate(itemDelegate);
+ //m_pTreeWidget->setShowSortIndicator(true);
+ m_pTreeWidget->setFocusPolicy(Qt::StrongFocus);
+ connect(m_pTreeWidget,SIGNAL(currentChanged(KviTalListViewItem *)),this,SLOT(currentChanged(KviTalListViewItem *)));
m_pNewActionButton = new QPushButton(__tr2qs("New Action"),box);
connect(m_pNewActionButton,SIGNAL(clicked()),this,SLOT(newAction()));
@@ -661,8 +627,8 @@ KviActionEditor::KviActionEditor(QWidget * par)
m_pSingleActionEditor = new KviSingleActionEditor(m_pSplitter,this);
- KviActionEditorListViewItem * last = 0;
- KviActionEditorListViewItem * first = 0;
+ KviActionEditorTreeWidgetItem * last = 0;
+ KviActionEditorTreeWidgetItem * first = 0;
KviPointerHashTableIterator<QString,KviAction> it(*(KviActionManager::instance()->actions()));
while(KviAction * a = it.current())
@@ -679,7 +645,7 @@ KviActionEditor::KviActionEditor(QWidget * par)
a->flags(),
a->keySequence(),
0);
- KviActionEditorListViewItem * lvi = new KviActionEditorListViewItem(m_pListView,ad);
+ KviActionEditorTreeWidgetItem * lvi = new KviActionEditorTreeWidgetItem(m_pTreeWidget,ad);
ad->m_pItem = lvi;
if(ad->m_szName == g_szLastEditedAction)
last = lvi;
@@ -693,7 +659,7 @@ KviActionEditor::KviActionEditor(QWidget * par)
if(last)
{
- m_pListView->setCurrentItem(last);
+ m_pTreeWidget->setCurrentItem(last);
currentChanged(last);
} else {
currentChanged(0);
@@ -717,12 +683,11 @@ void KviActionEditor::exportActions()
QString szCode;
- KviActionEditorListViewItem * it = (KviActionEditorListViewItem *)m_pListView->firstChild();
- while(it)
+ for (int i=0;i<m_pTreeWidget->topLevelItemCount();i++)
{
- if(it->isSelected())
+ if(m_pTreeWidget->topLevelItem(i)->isSelected())
{
- KviActionData * a = it->actionData();
+ KviActionData * a = ((KviActionEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i))->actionData();
KviKvsUserAction::exportToKvs(szCode,
a->m_szName,
@@ -735,8 +700,6 @@ void KviActionEditor::exportActions()
a->m_uFlags,
a->m_szKeySequence);
}
-
- it = (KviActionEditorListViewItem *)(it->nextSibling());
}
if(!KviFileUtils::writeFile(szFile,szCode))
@@ -747,16 +710,13 @@ void KviActionEditor::exportActions()
void KviActionEditor::deleteActions()
{
- KviPointerList<KviActionEditorListViewItem> l;
+ KviPointerList<KviActionEditorTreeWidgetItem> l;
l.setAutoDelete(false);
- KviActionEditorListViewItem * it = (KviActionEditorListViewItem *)m_pListView->firstChild();
- while(it)
+ for (int i=0;i<m_pTreeWidget->topLevelItemCount();i++)
{
- if(it->isSelected())
- l.append(it);
-
- it = (KviActionEditorListViewItem *)(it->nextSibling());
+ if(m_pTreeWidget->topLevelItem(i)->isSelected())
+ l.append((KviActionEditorTreeWidgetItem * )m_pTreeWidget->topLevelItem(i));
}
if(l.isEmpty())return;
@@ -764,7 +724,7 @@ void KviActionEditor::deleteActions()
//if(QMessageBox::question(this,__tr2qsf("Confirm Deletion"),__tr2qsf("Do you really want to delete the selected actions ?"),__tr2qsf("Yes"),__tr2qsf("No")) != 0)
// return;
- for(KviActionEditorListViewItem * i = l.first();i;i = l.next())
+ for(KviActionEditorTreeWidgetItem * i = l.first();i;i = l.next())
{
if(m_pSingleActionEditor->actionData() == i->actionData())
m_pSingleActionEditor->setActionData(0);
@@ -811,35 +771,30 @@ void KviActionEditor::newAction()
QString::null,
0);
- KviActionEditorListViewItem * lvi = new KviActionEditorListViewItem(m_pListView,ad);
+ KviActionEditorTreeWidgetItem * lvi = new KviActionEditorTreeWidgetItem(m_pTreeWidget,ad);
ad->m_pItem = lvi;
- m_pListView->setCurrentItem(lvi);
+ m_pTreeWidget->setCurrentItem(lvi);
currentChanged(lvi);
}
bool KviActionEditor::actionExists(const QString &szName)
{
- KviActionEditorListViewItem * it = (KviActionEditorListViewItem *)m_pListView->firstChild();
- while(it)
+ for (int i=0;i<m_pTreeWidget->topLevelItemCount();i++)
{
- if(it->actionData()->m_szName == szName)return true;
- it = (KviActionEditorListViewItem *)(it->nextSibling());
- }
+ if(((KviActionEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i))->actionData()->m_szName == szName)return true;
+ }
return false;
}
-void KviActionEditor::currentChanged(KviTalListViewItem * i)
+void KviActionEditor::currentChanged(QTreeWidgetItem * i)
{
if(m_pSingleActionEditor->actionData())
- {
m_pSingleActionEditor->commit();
- m_pSingleActionEditor->actionData()->m_pItem->setupForActionData();
- }
-
- m_pListView->update();
+
+ m_pTreeWidget->update();
- KviActionEditorListViewItem * it = (KviActionEditorListViewItem *)i;
+ KviActionEditorTreeWidgetItem * it = (KviActionEditorTreeWidgetItem *)i;
if(!it)
{
m_pSingleActionEditor->setActionData(0);
@@ -850,7 +805,7 @@ void KviActionEditor::currentChanged(KviTalListViewItem * i)
m_pDeleteActionsButton->setEnabled(true);
m_pExportActionsButton->setEnabled(true);
- if(!it->isSelected())m_pListView->setSelected(it,true);
+ //if(!it->isSelected())m_pTreeWidget->setSelected(it,true);
m_pSingleActionEditor->setActionData(it->actionData());
g_szLastEditedAction = it->actionData()->m_szName;
@@ -864,9 +819,9 @@ void KviActionEditor::commit()
KviActionManager::instance()->killAllKvsUserActions();
- KviActionEditorListViewItem * it = (KviActionEditorListViewItem *)m_pListView->firstChild();
- while(it)
+ for (int i=0;i<m_pTreeWidget->topLevelItemCount();i++)
{
+ KviActionEditorTreeWidgetItem * it = (KviActionEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i);
KviKvsUserAction * a = KviKvsUserAction::createInstance( // msvc workaround
KviActionManager::instance(),
it->actionData()->m_szName,
@@ -880,8 +835,6 @@ void KviActionEditor::commit()
it->actionData()->m_szKeySequence);
KviActionManager::instance()->registerAction(a);
-
- it = (KviActionEditorListViewItem *)(it->nextSibling());
}
KviCustomToolBarManager::instance()->updateVisibleToolBars();
diff --git a/src/modules/actioneditor/actioneditor.h b/src/modules/actioneditor/actioneditor.h
index 23188fccc..5007b663b 100644
--- a/src/modules/actioneditor/actioneditor.h
+++ b/src/modules/actioneditor/actioneditor.h
@@ -30,6 +30,7 @@
#include <QWidget>
#include <QTextDocument>
+#include <QTreeWidget>
class QLineEdit;
class QComboBox;
@@ -37,7 +38,7 @@ class QToolButton;
class QSimpleRichText;
class QPushButton;
class QSplitter;
-class KviActionEditorListViewItem;
+class KviActionEditorTreeWidgetItem;
class KviScriptEditor;
class KviActionEditor;
@@ -54,7 +55,7 @@ public:
QString m_szSmallIcon;
QString m_szKeySequence;
unsigned int m_uFlags;
- KviActionEditorListViewItem * m_pItem; // ummigarba tanto...
+ KviActionEditorTreeWidgetItem * m_pItem; // ummigarba tanto...
public:
KviActionData(const QString &szName,
const QString &szScriptCode,
@@ -65,7 +66,7 @@ public:
const QString &szSmallIcon,
unsigned int uFlags,
const QString &szKeySequence,
- KviActionEditorListViewItem * pItem)
+ KviActionEditorTreeWidgetItem * pItem)
: m_szName(szName), m_szScriptCode(szScriptCode), m_szVisibleName(szVisibleName),
m_szDescription(szDescription), m_szCategory(szCategory), m_szBigIcon(szBigIcon),
m_szSmallIcon(szSmallIcon), m_szKeySequence(szKeySequence), m_uFlags(uFlags),
@@ -74,34 +75,34 @@ public:
};
-class KviActionEditorListViewItem : public KviTalListViewItem
+class KviActionEditorTreeWidgetItem : public QTreeWidgetItem
{
public:
- KviActionEditorListViewItem(KviTalListView * v,KviActionData * a);
- ~KviActionEditorListViewItem();
+ KviActionEditorTreeWidgetItem(QTreeWidget * v,KviActionData * a);
+ ~KviActionEditorTreeWidgetItem();
protected:
KviActionData * m_pActionData;
//QSimpleRichText * m_pText;
QTextDocument * m_pText;
QPixmap * m_pIcon;
- KviTalListView * m_pListView;
+ QTreeWidget * m_pTreeWidget;
QString m_szKey;
public:
KviActionData * actionData(){ return m_pActionData; };
- void setupForActionData();
+ //void setupForActionData();
public:
- virtual void paintCell(QPainter * p,const QColorGroup & cg,int column,int width,int align);
- virtual void setup();
+ //virtual void paintCell(QPainter * p,const QColorGroup & cg,int column,int width,int align);
+ //virtual void setup();
virtual QString key(int,bool) const;
};
-class KviActionEditorListView : public KviTalListView
+class KviActionEditorTreeView : public QTreeWidget
{
Q_OBJECT
public:
- KviActionEditorListView(QWidget * pParent);
- ~KviActionEditorListView();
+ KviActionEditorTreeView(QWidget * pParent);
+ ~KviActionEditorTreeView();
protected:
virtual void resizeEvent(QResizeEvent * e);
};
@@ -159,7 +160,7 @@ public:
KviActionEditor(QWidget * par);
~KviActionEditor();
protected:
- KviActionEditorListView * m_pListView;
+ KviActionEditorTreeView * m_pTreeWidget;
KviSingleActionEditor * m_pSingleActionEditor;
QSplitter * m_pSplitter;
QPushButton * m_pNewActionButton;
@@ -172,7 +173,7 @@ protected:
int selectedCount();
QString nameForAutomaticAction(const QString &szTemplate);
protected slots:
- void currentChanged(KviTalListViewItem * it);
+ void currentChanged(QTreeWidgetItem * it);
void newAction();
void deleteActions();
void exportActions();
diff --git a/src/modules/actioneditor/actioneditor_QT4_vc05.vcproj b/src/modules/actioneditor/actioneditor_QT4_vc05.vcproj
index d0125c942..469cb7e67 100644
--- a/src/modules/actioneditor/actioneditor_QT4_vc05.vcproj
+++ b/src/modules/actioneditor/actioneditor_QT4_vc05.vcproj
@@ -135,7 +135,7 @@
EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ACTIONEDITOR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ACTIONEDITOR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT"
StringPooling="true"
MinimalRebuild="true"
ExceptionHandling="1"
diff --git a/src/modules/addon/addon_QT4_vc05.vcproj b/src/modules/addon/addon_QT4_vc05.vcproj
index 32525c80b..2262d5277 100644
--- a/src/modules/addon/addon_QT4_vc05.vcproj
+++ b/src/modules/addon/addon_QT4_vc05.vcproj
@@ -272,7 +272,7 @@
>
<Tool
Name="VCCustomBuildTool"
- CommandLine="$(QTDIR)\bin\moc -o &quot;$(InputDir)\moc_$(InputName).cpp&quot; &quot;$(InputDir)\$(InputFileName)&quot;"
+ CommandLine="$(QTDIR)\bin\moc -o &quot;$(InputDir)\moc_$(InputName).cpp&quot; &quot;$(InputDir)\$(InputFileName)&quot;&#x0D;&#x0A;"
Outputs="$(InputDir)\moc_$(InputName).cpp"
/>
</FileConfiguration>
diff --git a/src/modules/addon/managementdialog.h b/src/modules/addon/managementdialog.h
index 0070e3fc5..f558ad38d 100644
--- a/src/modules/addon/managementdialog.h
+++ b/src/modules/addon/managementdialog.h
@@ -24,7 +24,6 @@
//
//=============================================================================
-#include "kvi_listview.h"
#include "kvi_settings.h"
#include "kvi_tal_listwidget.h"
diff --git a/src/modules/aliaseditor/aliaseditor.cpp b/src/modules/aliaseditor/aliaseditor.cpp
index c13904ff9..99bf4343d 100644
--- a/src/modules/aliaseditor/aliaseditor.cpp
+++ b/src/modules/aliaseditor/aliaseditor.cpp
@@ -52,15 +52,15 @@
#include <QRegExp>
#include <QTreeWidget>
#include <QMouseEvent>
+#include <QList>
extern KviAliasEditorWindow * g_pAliasEditorWindow;
extern KviModule * g_pAliasEditorModule;
KviAliasEditorListViewItem::KviAliasEditorListViewItem(QTreeWidget * pListView,Type eType,const QString &szName)
-: QTreeWidgetItem(pListView), m_eType(eType), m_pParentNamespaceItem(0)
+: QTreeWidgetItem(pListView), m_eType(eType), m_pParentNamespaceItem(0), KviHeapObject()
{
setName(szName);
- setFlags(Qt::ItemIsEditable|Qt::ItemIsEnabled|Qt::ItemIsSelectable);
}
KviAliasEditorListViewItem::KviAliasEditorListViewItem(KviAliasNamespaceListViewItem * pParentNamespaceItem,Type eType,const QString &szName)
@@ -122,7 +122,7 @@ KviAliasNamespaceListViewItem::KviAliasNamespaceListViewItem(KviAliasNamespaceLi
KviAliasNamespaceListViewItem::~KviAliasNamespaceListViewItem()
{
-
+ debug("Deleting %s and pointer %d",this->text(0).toUtf8().data(),this);
}
KviAliasNamespaceListViewItem * KviAliasNamespaceListViewItem::findNamespaceItem(const QString &szName)
@@ -229,7 +229,7 @@ KviAliasEditor::KviAliasEditor(QWidget * par)
{
m_pLastEditedItem = 0;
m_pLastClickedItem = 0;
- m_szDir = QDir::homeDirPath();
+ m_szDir = QDir::homePath();
QGridLayout * l = new QGridLayout(this);
@@ -336,15 +336,15 @@ KviAliasListViewItem * KviAliasEditor::getAliasItem(const QString &szName)
void KviAliasEditor::splitFullAliasOrNamespaceName(const QString &szFullName,QStringList &lNamespaces,QString &szName)
{
- lNamespaces = QStringList::split("::",szFullName);
+ lNamespaces = szFullName.split("::");
if(lNamespaces.count() < 1)
{
szName = "unnamed";
lNamespaces.append(QString(""));
return;
}
- szName = *(lNamespaces.fromLast());
- lNamespaces.remove(lNamespaces.fromLast());
+ szName = lNamespaces.last();
+ lNamespaces.removeLast();
}
QString KviAliasEditor::buildFullItemName(KviAliasEditorListViewItem * it)
@@ -579,10 +579,10 @@ void KviAliasEditor::recursiveSearchReplace(const QString &szSearch,KviAliasEdit
{
if(((KviAliasListViewItem *)it->child(i))->isAlias())
{
- if(((KviAliasListViewItem *)it->child(i))->buffer().find(szSearch,0,false) != -1)
+ if(((KviAliasListViewItem *)it->child(i))->buffer().indexOf(szSearch,0,Qt::CaseInsensitive) != -1)
{
it->child(i)->setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ALIASHIGHLIGHTED))));
- if (bReplace) ((QString &)((KviAliasListViewItem *)it->child(i))->buffer()).replace(szSearch,szReplace,false);
+ if (bReplace) ((QString &)((KviAliasListViewItem *)it->child(i))->buffer()).replace(szSearch,szReplace,Qt::CaseInsensitive);
openParentItems(it);
}
//else
@@ -602,13 +602,15 @@ void KviAliasEditor::slotFind()
g_pAliasEditorModule->lock();
bool bOk;
- QString szSearch = QInputDialog::getText(
+
+ QString szSearch = QInputDialog::getText(this,
__tr2qs("Find In Aliases"),
__tr2qs("Please enter the text to be searched for. The matching aliases will be highlighted."),
QLineEdit::Normal,
"",
- &bOk,
- this);
+ &bOk);
+
+
g_pAliasEditorModule->unlock();
if(!bOk)return;
if(szSearch.isEmpty())return;
@@ -617,7 +619,7 @@ void KviAliasEditor::slotFind()
{
if(((KviAliasListViewItem *)m_pListView->topLevelItem(i))->isAlias())
{
- if(((KviAliasListViewItem *)m_pListView->topLevelItem(i))->buffer().find(szSearch,0,false) != -1)
+ if(((KviAliasListViewItem *)m_pListView->topLevelItem(i))->buffer().indexOf(szSearch,0,Qt::CaseInsensitive) != -1)
{
m_pListView->topLevelItem(i)->setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ALIASHIGHLIGHTED))));
}
@@ -700,7 +702,7 @@ void KviAliasEditor::exportSelected()
void KviAliasEditor::exportSelectionInSinglesFiles(KviPointerList<KviAliasListViewItem> *l)
{
if(!m_szDir.endsWith(QString(KVI_PATH_SEPARATOR)))m_szDir += KVI_PATH_SEPARATOR;
- debug ("dir %s",m_szDir.latin1());
+ debug ("dir %s",m_szDir.toUtf8().data());
if (!l->first())
{
g_pAliasEditorModule->lock();
@@ -716,7 +718,7 @@ void KviAliasEditor::exportSelectionInSinglesFiles(KviPointerList<KviAliasListVi
}
if(!m_szDir.endsWith(QString(KVI_PATH_SEPARATOR)))m_szDir += KVI_PATH_SEPARATOR;
- debug ("dir changed in %s",m_szDir.latin1());
+ debug ("dir changed in %s",m_szDir.toUtf8().data());
bool bReplaceAll=false;
@@ -803,7 +805,7 @@ void KviAliasEditor::exportAliases(bool bSelectedOnly,bool bSingleFiles)
g_pAliasEditorModule->unlock();
return;
}
- m_szDir=QFileInfo(szFile).dirPath(TRUE);
+ m_szDir=QFileInfo(szFile).absolutePath();
g_pAliasEditorModule->unlock();
if(!KviFileUtils::writeFile(szFile,out))
@@ -996,6 +998,7 @@ void KviAliasEditor::appendSelectedItems(KviPointerList<KviAliasEditorListViewIt
void KviAliasEditor::removeItemChildren(KviAliasEditorListViewItem *it)
{
+ debug("Deleting");
for (int i=0;i<it->childCount();i++)
{
if (it->child(i)->childCount()) removeItemChildren((KviAliasEditorListViewItem *)it->child(i));
@@ -1039,6 +1042,7 @@ bool KviAliasEditor::removeItem(KviAliasEditorListViewItem *it,bool * pbYesToAll
m_pLastEditedItem = 0;
if(it == m_pLastClickedItem)
m_pLastClickedItem = 0;
+ debug ("Deleting");
if (it->childCount()) removeItemChildren(it);
delete it;
return true;
@@ -1086,13 +1090,12 @@ QString KviAliasEditor::askForAliasName(const QString &szAction,const QString &s
while(szNewName.isEmpty())
{
g_pAliasEditorModule->lock();
- szNewName = QInputDialog::getText(
+ szNewName = QInputDialog::getText(this,
szAction,
szText,
QLineEdit::Normal,
szInitialText,
- &bOk,
- this);
+ &bOk);
g_pAliasEditorModule->unlock();
if(!bOk)return QString::null;
if(szNewName.isEmpty())
@@ -1122,7 +1125,7 @@ QString KviAliasEditor::askForAliasName(const QString &szAction,const QString &s
// make sure that we have only doubled "::" and not ":" or ":::..."
QString tmp = szNewName;
tmp.replace("::","@"); // @ is not allowed by the rule above
- if(tmp.find(":") != -1)
+ if(tmp.indexOf(":",Qt::CaseInsensitive) != -1)
{
g_pAliasEditorModule->lock();
QMessageBox::information(this,
@@ -1133,7 +1136,7 @@ QString KviAliasEditor::askForAliasName(const QString &szAction,const QString &s
szNewName = "";
continue;
}
- if(tmp.find("@@") != -1)
+ if(tmp.indexOf("@@",Qt::CaseInsensitive) != -1)
{
g_pAliasEditorModule->lock();
QMessageBox::information(this,
@@ -1155,13 +1158,12 @@ QString KviAliasEditor::askForNamespaceName(const QString &szAction,const QStrin
while(szNewName.isEmpty())
{
g_pAliasEditorModule->lock();
- szNewName = QInputDialog::getText(
+ szNewName = QInputDialog::getText(this,
szAction,
szText,
QLineEdit::Normal,
szInitialText,
- &bOk,
- this);
+ &bOk);
g_pAliasEditorModule->unlock();
if(!bOk)return QString::null;
if(szNewName.isEmpty())
@@ -1191,7 +1193,7 @@ QString KviAliasEditor::askForNamespaceName(const QString &szAction,const QStrin
// make sure that we have only doubled "::" and not ":" or ":::..."
QString tmp = szNewName;
tmp.replace("::","@"); // @ is not allowed by the rule above
- if(tmp.find(":") != -1)
+ if(tmp.indexOf(":",Qt::CaseInsensitive) != -1)
{
g_pAliasEditorModule->lock();
QMessageBox::information(this,
@@ -1202,7 +1204,7 @@ QString KviAliasEditor::askForNamespaceName(const QString &szAction,const QStrin
szNewName = "";
continue;
}
- if(tmp.find("@@") != -1)
+ if(tmp.indexOf("@@",Qt::CaseInsensitive) != -1)
{
g_pAliasEditorModule->lock();
QMessageBox::information(this,
diff --git a/src/modules/aliaseditor/aliaseditor.h b/src/modules/aliaseditor/aliaseditor.h
index 4acde046a..1de3f930a 100644
--- a/src/modules/aliaseditor/aliaseditor.h
+++ b/src/modules/aliaseditor/aliaseditor.h
@@ -28,7 +28,8 @@
#include "kvi_string.h"
#include "kvi_pointerlist.h"
#include "kvi_tal_popupmenu.h"
-#include "kvi_tal_listview.h"
+#include "kvi_heapobject.h"
+//#include "kvi_tal_listview.h"
#include <QWidget>
#include <QLineEdit>
@@ -42,7 +43,7 @@ class KviScriptEditor;
class KviAliasNamespaceListViewItem;
-class KviAliasEditorListViewItem : public QTreeWidgetItem
+class KviAliasEditorListViewItem : public QTreeWidgetItem, public KviHeapObject
{
public:
enum Type { Alias, Namespace };
diff --git a/src/modules/aliaseditor/aliaseditor_QT4_vc05.vcproj b/src/modules/aliaseditor/aliaseditor_QT4_vc05.vcproj
index 7a169aaf1..9e10b284a 100644
--- a/src/modules/aliaseditor/aliaseditor_QT4_vc05.vcproj
+++ b/src/modules/aliaseditor/aliaseditor_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ALIASEDITOR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ALIASEDITOR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -135,7 +135,7 @@
EnableFiberSafeOptimizations="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ALIASEDITOR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ALIASEDITOR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
StringPooling="true"
MinimalRebuild="true"
ExceptionHandling="1"
diff --git a/src/modules/avatar/avatar_QT4_vc05.vcproj b/src/modules/avatar/avatar_QT4_vc05.vcproj
index 78eaae804..3edd07e13 100644
--- a/src/modules/avatar/avatar_QT4_vc05.vcproj
+++ b/src/modules/avatar/avatar_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;AVATAR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;AVATAR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/avatar/libkviavatar.cpp b/src/modules/avatar/libkviavatar.cpp
index fd3f10341..6b6057012 100644
--- a/src/modules/avatar/libkviavatar.cpp
+++ b/src/modules/avatar/libkviavatar.cpp
@@ -58,8 +58,10 @@ static KviPointerList<KviAsyncAvatarSelectionDialog> * g_pAvatarSelectionDialogL
extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager;
KviAsyncAvatarSelectionDialog::KviAsyncAvatarSelectionDialog(QWidget * par,const QString &szInitialPath,KviIrcConnection * c)
-: QDialog(par,0,false,Qt::WType_Dialog | Qt::WStyle_DialogBorder | Qt::WStyle_StaysOnTop)
+: QDialog(par)
{
+ setModal(false);
+ setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowStaysOnTopHint);
g_pAvatarSelectionDialogList->append(this);
m_pConnection = c;
diff --git a/src/modules/chan/chan_QT4_vc05.vcproj b/src/modules/chan/chan_QT4_vc05.vcproj
index 52a149293..8cc16199e 100644
--- a/src/modules/chan/chan_QT4_vc05.vcproj
+++ b/src/modules/chan/chan_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CHAN_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CHAN_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/chan/libkvichan.cpp b/src/modules/chan/libkvichan.cpp
index c588bdbee..2405de5eb 100644
--- a/src/modules/chan/libkvichan.cpp
+++ b/src/modules/chan/libkvichan.cpp
@@ -1094,20 +1094,20 @@ static bool chan_kvs_fnc_users(KviKvsModuleFunctionCall * c)
KviUserListEntry * e = ch->userListView()->firstItem(); // Thnx Julien :)
bool bCheckMask = !szMask.isEmpty();
- bool bOp = szFlags.find('o',false) != -1;
- bool bVoice = szFlags.find('v',false) != -1;
- bool bHalfOp = szFlags.find('h',false) != -1;
- bool bChanAdmins = szFlags.find('a',false) != -1;
- bool bUserOp = szFlags.find('u',false) != -1;
- bool bNone = szFlags.find('n',false) != -1;
+ bool bOp = szFlags.indexOf('o',Qt::CaseSensitive) != -1;
+ bool bVoice = szFlags.indexOf('v',Qt::CaseSensitive) != -1;
+ bool bHalfOp = szFlags.indexOf('h',Qt::CaseSensitive) != -1;
+ bool bChanAdmins = szFlags.indexOf('a',Qt::CaseSensitive) != -1;
+ bool bUserOp = szFlags.indexOf('u',Qt::CaseSensitive) != -1;
+ bool bNone = szFlags.indexOf('n',Qt::CaseSensitive) != -1;
bool bCheckFlags = bOp || bVoice || bHalfOp || bNone || bChanAdmins || bUserOp;
- bool bAddMask = szFlags.find('m',false) != -1;
+ bool bAddMask = szFlags.indexOf('m',Qt::CaseSensitive) != -1;
int idx = 0;
if(bAddMask || bCheckFlags || bCheckMask)
{
- bool bMaskMustMatch = szFlags.find('i',false) == -1;
+ bool bMaskMustMatch = szFlags.indexOf('i',Qt::CaseSensitive) == -1;
KviIrcMask mask(szMask);
while(e)
diff --git a/src/modules/channelsjoin/channelsjoin_QT4_vc05.vcproj b/src/modules/channelsjoin/channelsjoin_QT4_vc05.vcproj
index e16b5ddc5..d37d8f03b 100644
--- a/src/modules/channelsjoin/channelsjoin_QT4_vc05.vcproj
+++ b/src/modules/channelsjoin/channelsjoin_QT4_vc05.vcproj
@@ -43,7 +43,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CHANNELSJOIN_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CHANNELSJOIN_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/channelsjoin/channelsjoinwindow.cpp b/src/modules/channelsjoin/channelsjoinwindow.cpp
index f8c528799..4ac425fd5 100644
--- a/src/modules/channelsjoin/channelsjoinwindow.cpp
+++ b/src/modules/channelsjoin/channelsjoinwindow.cpp
@@ -33,7 +33,7 @@
#include "kvi_console.h"
#include "kvi_regchan.h"
#include "kvi_kvs_script.h"
-#include "kvi_tal_listview.h"
+#include "kvi_tal_treewidget.h"
#include <kvi_tal_groupbox.h>
#include <QLabel>
@@ -43,9 +43,7 @@
#include <QPushButton>
#include <QEvent>
#include <QCloseEvent>
-
-// FIXME: Qt4 #include <QHeaderView>
-#include <q3header.h>
+#include <QHeaderView>
extern KviChannelsJoinWindow * g_pChannelsWindow;
@@ -55,22 +53,24 @@ extern KVIRC_API KviRegisteredChannelDataBase * g_pRegisteredChannelDataBase;
KviChannelsJoinWindow::KviChannelsJoinWindow(QWidget * par, const char * name)
-: QDialog(par,name)
+: QDialog(par)
{
+ setObjectName(name);
m_pConsole=0;
setWindowTitle(__tr2qs("Join Channels"));
- setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)));
+ setWindowIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)));
QGridLayout * g = new QGridLayout(this);
- m_pListView = new KviTalListView(this);
+ m_pListView = new KviTalTreeWidget(this);
m_pListView->addColumn(__tr2qs("Channel"));
m_pListView->setRootIsDecorated(true);
- m_pListView->setSelectionMode(KviTalListView::Single);
- g->addMultiCellWidget(m_pListView,0,0,0,1);
- connect(m_pListView,SIGNAL(clicked(KviTalListViewItem *)),this,SLOT(itemClicked(KviTalListViewItem *)));
- connect(m_pListView,SIGNAL(doubleClicked(KviTalListViewItem *)),this,SLOT(itemDoubleClicked(KviTalListViewItem *)));
+ m_pListView->setSelectionMode(QAbstractItemView::SingleSelection);
+ g->addWidget(m_pListView,0,0,0,2);
+ //g->addMultiCellWidget(m_pListView,0,0,0,1);
+ connect(m_pListView,SIGNAL(clicked(KviTalTreeWidgetItem *)),this,SLOT(itemClicked(KviTalTreeWidgetItem *)));
+ connect(m_pListView,SIGNAL(doubleClicked(KviTalTreeWidgetItem *)),this,SLOT(itemDoubleClicked(KviTalTreeWidgetItem *)));
m_pGroupBox = new KviTalGroupBox(Qt::Horizontal,__tr2qs("Channel" ),this);
@@ -89,14 +89,16 @@ KviChannelsJoinWindow::KviChannelsJoinWindow(QWidget * par, const char * name)
m_pPass = new QLineEdit(m_pGroupBox);
m_pPass->setEchoMode(QLineEdit::Password);
- g->addMultiCellWidget(m_pGroupBox,1,1,0,1);
+ g->addWidget(m_pGroupBox,1,1,0,1);
+// g->addMultiCellWidget(m_pGroupBox,1,1,0,1);
m_pJoinButton = new QPushButton(__tr2qs("&Join"),this);
// Join on return pressed
m_pJoinButton->setDefault(true);
connect(m_pJoinButton,SIGNAL(clicked()),this,SLOT(joinClicked()));
- g->addMultiCellWidget(m_pJoinButton,2,2,0,1,Qt::AlignHCenter);
+g->addWidget(m_pJoinButton,2,2,0,0,Qt::AlignHCenter);
+// g->addMultiCellWidget(m_pJoinButton,2,2,0,1,Qt::AlignHCenter);
m_pShowAtStartupCheck = new KviStyledCheckBox(__tr2qs("Show this window after connecting"),this);
m_pShowAtStartupCheck->setChecked(KVI_OPTION_BOOL(KviOption_boolShowChannelsJoinOnIrc));
@@ -153,9 +155,9 @@ void KviChannelsJoinWindow::fillListView()
m_pListView->header()->hide();
- KviTalListViewItem * par = new KviTalListViewItem(m_pListView,__tr2qs("Recent Channels"));
- par->setOpen(true);
- KviTalListViewItem * chld;
+ KviTalTreeWidgetItem * par = new KviTalTreeWidgetItem(m_pListView,__tr2qs("Recent Channels"));
+ par->setExpanded(true);
+ KviTalTreeWidgetItem * chld;
if(m_pConsole)
{
@@ -165,15 +167,15 @@ void KviChannelsJoinWindow::fillListView()
{
for(QStringList::Iterator it = pList->begin(); it != pList->end(); ++it)
{
- chld = new KviTalListViewItem(par,*it);
- chld->setPixmap(0,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)));
+ chld = new KviTalTreeWidgetItem(par,*it);
+ chld->setIcon(0,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)));
}
}
}
// FIXME: Registered channels go here!
- par = new KviTalListViewItem(m_pListView,__tr2qs("Registered Channels"));
- par->setOpen(true);
+ par = new KviTalTreeWidgetItem(m_pListView,__tr2qs("Registered Channels"));
+ par->setExpanded(true);
KviPointerHashTable<const char *,KviRegisteredChannelList> * d = g_pRegisteredChannelDataBase->channelDict();
if(d)
@@ -181,23 +183,23 @@ void KviChannelsJoinWindow::fillListView()
KviPointerHashTableIterator<const char *,KviRegisteredChannelList> it(*d);
while(it.current())
{
- chld = new KviTalListViewItem(par,it.currentKey());
- chld->setPixmap(0,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)));
+ chld = new KviTalTreeWidgetItem(par,it.currentKey());
+ chld->setIcon(0,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CHANNEL)));
++it;
}
}
}
-void KviChannelsJoinWindow::itemClicked(KviTalListViewItem * it)
+void KviChannelsJoinWindow::itemClicked(KviTalTreeWidgetItem * it)
{
if(!it)return;
if(!it->parent())return;
- KviStr tmp = it->text(0);
- m_pChannelEdit->setText(tmp.ptr());
+ QString tmp = it->text(0);
+ m_pChannelEdit->setText(tmp);
enableJoin();
}
-void KviChannelsJoinWindow::itemDoubleClicked(KviTalListViewItem * it)
+void KviChannelsJoinWindow::itemDoubleClicked(KviTalTreeWidgetItem * it)
{
if(!it)return;
if(!it->parent())return;
diff --git a/src/modules/channelsjoin/channelsjoinwindow.h b/src/modules/channelsjoin/channelsjoinwindow.h
index 57080ca6e..8f3bc69d7 100644
--- a/src/modules/channelsjoin/channelsjoinwindow.h
+++ b/src/modules/channelsjoin/channelsjoinwindow.h
@@ -26,7 +26,7 @@
#include "kvi_window.h"
#include "kvi_string.h"
#include "kvi_styled_controls.h"
-#include "kvi_tal_listview.h"
+#include "kvi_tal_treewidget.h"
#include <QDialog>
@@ -44,7 +44,7 @@ public:
~KviChannelsJoinWindow();
protected:
QLineEdit * m_pChannelEdit;
- KviTalListView * m_pListView;
+ KviTalTreeWidget * m_pListView;
KviTalGroupBox * m_pGroupBox;
QLineEdit * m_pPass;
KviStyledCheckBox * m_pShowAtStartupCheck;
@@ -58,8 +58,8 @@ public:
void setConsole(KviConsole * pConsole);
protected slots:
void editTextChanged(const QString &);
- void itemClicked(KviTalListViewItem *it);
- void itemDoubleClicked(KviTalListViewItem *it);
+ void itemClicked(KviTalTreeWidgetItem *it);
+ void itemDoubleClicked(KviTalTreeWidgetItem *it);
void editReturnPressed();
void cancelClicked();
void joinClicked();
diff --git a/src/modules/codetester/codetester.cpp b/src/modules/codetester/codetester.cpp
index 0d0ff6cf3..90d2dd295 100644
--- a/src/modules/codetester/codetester.cpp
+++ b/src/modules/codetester/codetester.cpp
@@ -45,11 +45,13 @@ extern KviPointerList<KviCodeTesterWindow> * g_pCodeTesterWindowList;
KviCodeTester::KviCodeTester(QWidget * par)
-: QWidget(par,"code_tester")
+: QWidget(par)
{
+ setObjectName("code_tester");
QGridLayout * g = new QGridLayout(this);
m_pEditor = KviScriptEditor::createInstance(this);
- g->addMultiCellWidget(m_pEditor,0,0,0,3);
+ g->addWidget(m_pEditor,0,0,0,4);
+ //g->addMultiCellWidget(m_pEditor,0,0,0,3);
m_pExecuteButton = new QPushButton(__tr2qs("&Execute"),this);
g->addWidget(m_pExecuteButton,1,3);
connect(m_pExecuteButton,SIGNAL(clicked()),this,SLOT(execute()));
diff --git a/src/modules/codetester/codetester_QT4_vc05.vcproj b/src/modules/codetester/codetester_QT4_vc05.vcproj
index 2d851d88d..8c4fbd55e 100644
--- a/src/modules/codetester/codetester_QT4_vc05.vcproj
+++ b/src/modules/codetester/codetester_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CODETESTER_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CODETESTER_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/config/config_QT4_vc05.vcproj b/src/modules/config/config_QT4_vc05.vcproj
index 40bd9e75d..eaae56c50 100644
--- a/src/modules/config/config_QT4_vc05.vcproj
+++ b/src/modules/config/config_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CONFIG_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;CONFIG_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/context/context_QT4_vc05.vcproj b/src/modules/context/context_QT4_vc05.vcproj
index a16591e43..715193ca5 100644
--- a/src/modules/context/context_QT4_vc05.vcproj
+++ b/src/modules/context/context_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/dialog/dialog_QT4_vc05.vcproj b/src/modules/dialog/dialog_QT4_vc05.vcproj
index 3527237c5..fd6f65380 100644
--- a/src/modules/dialog/dialog_QT4_vc05.vcproj
+++ b/src/modules/dialog/dialog_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DIALOG_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DIALOG_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/dialog/libkvidialog.cpp b/src/modules/dialog/libkvidialog.cpp
index 0ad90b369..f216f6d0f 100644
--- a/src/modules/dialog/libkvidialog.cpp
+++ b/src/modules/dialog/libkvidialog.cpp
@@ -61,16 +61,24 @@ KviKvsCallbackMessageBox::KviKvsCallbackMessageBox(
const QString &szCode,
KviKvsVariantList * pMagicParams,
KviWindow * pWindow,bool modal)
-: QMessageBox(
+: QMessageBox(0)/*
szCaption,
szText,
QMessageBox::NoIcon,
szButton0.isEmpty() ? QMessageBox::NoButton : QMessageBox::Ok | QMessageBox::Default,
szButton1.isEmpty() ? QMessageBox::NoButton : (szButton2.isEmpty() ? QMessageBox::No | QMessageBox::Escape : QMessageBox::No),
szButton2.isEmpty() ? QMessageBox::NoButton : QMessageBox::Cancel | QMessageBox::Escape,
- 0,0,modal) ,
+ 0,0,modal)*/ ,
KviKvsCallbackObject("dialog.message",pWindow,szCode,pMagicParams,0)
{
+ setWindowTitle(szCaption);
+ setText(szText);
+ setIcon(QMessageBox::NoIcon);
+ QMessageBox::StandardButton buttons;
+ if (!szButton0.isEmpty()) buttons=QMessageBox::StandardButton::Ok | QMessageBox::StandardButton::Default;
+ if (!szButton2.isEmpty()) buttons|=QMessageBox::StandardButton::Cancel | QMessageBox::StandardButton::Escape;
+ else if(!szButton1.isEmpty()) buttons|=QMessageBox::No | QMessageBox::Escape;
+ setStandardButtons(buttons)
g_pDialogModuleDialogList->append(this);
QPixmap * pix = g_pIconManager->getImage(szIcon);
diff --git a/src/modules/editor/editor_QT4_vc05.vcproj b/src/modules/editor/editor_QT4_vc05.vcproj
index 59a69d80b..22b461580 100644
--- a/src/modules/editor/editor_QT4_vc05.vcproj
+++ b/src/modules/editor/editor_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;EDITOR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;EDITOR_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/editor/scripteditor.cpp b/src/modules/editor/scripteditor.cpp
index 0bb49799b..bb188a86e 100644
--- a/src/modules/editor/scripteditor.cpp
+++ b/src/modules/editor/scripteditor.cpp
@@ -106,7 +106,7 @@ void KviCompletionBox::updateContents(QString buffer)
szModule.remove(0,1);
}
*/
- QChar* pCur = (QChar *)buffer.ucs2();
+ QChar* pCur = (QChar *)buffer.utf16();
if(pCur->unicode() == '$')
{
buffer.remove(0,1);
@@ -173,10 +173,12 @@ KviScriptEditorWidgetColorOptions::KviScriptEditorWidgetColorOptions(QWidget * p
QGridLayout * g = new QGridLayout(this);
KviFontSelector * f = new KviFontSelector(this,__tr2qs_ctx("Font:","editor"),&g_fntNormal,true);
- g->addMultiCellWidget(f,0,0,0,2);
+ g->addWidget(f,0,0,0,3);
+ //g->addMultiCellWidget(f,0,0,0,2);
m_pSelectorInterfaceList->append(f);
KviTalGroupBox * gbox = new KviTalGroupBox(Qt::Horizontal,__tr2qs("Colors" ),this);
- g->addMultiCellWidget(gbox,1,1,0,2);
+ g->addWidget(gbox,1,1,0,2);
+//g->addMultiCellWidget(gbox,1,1,0,2);
KviColorSelector * s = addColorSelector(gbox,__tr2qs_ctx("Background:","editor"),&g_clrBackground,true);
s = addColorSelector(gbox,__tr2qs_ctx("Normal text:","editor"),&g_clrNormalText,true);
s = addColorSelector(gbox,__tr2qs_ctx("Brackets:","editor"),&g_clrBracket,true);
@@ -228,10 +230,6 @@ KviScriptEditorWidget::KviScriptEditorWidget(QWidget * pParent)
: QTextEdit(pParent)
{
- /*QPalette p=palette();
- p.setColor(QPalette::Base, QColor(0,0,0));
- setPalette(p);
- */
setWordWrapMode(QTextOption::NoWrap);
m_pParent=pParent;
m_szHelp="Nothing";
@@ -249,8 +247,8 @@ KviScriptEditorWidget::~KviScriptEditorWidget()
void KviScriptEditorWidget::contextMenuEvent(QContextMenuEvent *event)
{
QMenu *pop=createStandardContextMenu();
- pop->insertItem(__tr2qs("Context sensitive help"),this,SLOT(slotHelp()),Qt::CTRL+Qt::Key_H);
- pop->insertItem(__tr2qs("&Replace"),this,SLOT(slotReplace()),Qt::CTRL+Qt::Key_R);
+ pop->addAction(__tr2qs("Context sensitive help"),this,SLOT(slotHelp()),Qt::CTRL+Qt::Key_H);
+ pop->addAction(__tr2qs("&Replace"),this,SLOT(slotReplace()),Qt::CTRL+Qt::Key_R);
pop->exec(event->globalPos());
delete pop;
}
@@ -258,7 +256,7 @@ void KviScriptEditorWidget::contextMenuEvent(QContextMenuEvent *event)
void KviScriptEditorWidget::slotFind()
{
m_szFind=((KviScriptEditorImplementation*)m_pParent)->getFindlineedit()->text();
- setText(text());
+ setText(toPlainText());
}
void KviScriptEditorWidget::slotReplace()
@@ -283,11 +281,11 @@ void KviScriptEditorWidget::updateOptions()
p.setColor(QPalette::Text,g_clrNormalText);
setPalette(p);
setFont(g_fntNormal);
- setColor(g_clrNormalText);
- setTextFormat(Qt::PlainText);
+ setTextColor(g_clrNormalText);
+// setTextFormat(Qt::PlainText);
// this will rehighlight everything
- setText(text()); // an "hack" to ensure Update all in the editor
+ setText(toPlainText()); // an "hack" to ensure Update all in the editor
KviScriptSyntaxHighlighter *h = new KviScriptSyntaxHighlighter(this);
(void)h;
p = ((KviScriptEditorImplementation*)m_pParent)->getFindlineedit()->palette();
@@ -298,7 +296,7 @@ void KviScriptEditorWidget::updateOptions()
void KviScriptEditorWidget::keyPressEvent(QKeyEvent * e)
{
- if(e->state() == Qt::ControlButton)
+ if(e->modifiers() == Qt::ControlModifier)
{
switch(e->key())
{
@@ -324,7 +322,7 @@ void KviScriptEditorWidget::keyPressEvent(QKeyEvent * e)
}
}
- if(e->state() == Qt::ShiftButton)
+ if(e->modifiers() == Qt::ShiftModifier)
{
if (e->key() == Qt::Key_Insert)
{
@@ -491,8 +489,8 @@ void KviScriptEditorWidget::getWordOnCursor(QString &buffer,int index) const
{
QRegExp re("[ \t=,\\(\\)\"}{\\[\\]\r\n+-*><;@!]");
//debug("BUFFER IS %s",buffer.toUtf8().data());
- int start = buffer.findRev(re,index);
- int end = buffer.find(re,index);
+ int start = buffer.lastIndexOf(re,index);
+ int end = buffer.lastIndexOf(re,index);
QString tmp;
if(start!=end)
@@ -553,11 +551,11 @@ void KviScriptEditorWidget::getWordBeforeCursor(QString &buffer,int index,bool *
{
QString tmp = buffer.left(index);
buffer=tmp;
- int idx = buffer.findRev(' ');
- int idx1 = buffer.findRev("=");
- int idx2 = buffer.findRev(',');
- int idx3 = buffer.findRev('(');
- int idx4 = buffer.findRev('"');
+ int idx = buffer.lastIndexOf(' ');
+ int idx1 = buffer.lastIndexOf("=");
+ int idx2 = buffer.lastIndexOf(',');
+ int idx3 = buffer.lastIndexOf('(');
+ int idx4 = buffer.lastIndexOf('"');
if(idx1 > idx) idx= idx1;
if(idx2 > idx)idx = idx2;
if(idx3 > idx)idx = idx3;
@@ -608,7 +606,7 @@ KviScriptSyntaxHighlighter::~KviScriptSyntaxHighlighter()
void KviScriptSyntaxHighlighter::highlightBlock(const QString &text)
{
- const QChar * pBuf = (const QChar *)text.ucs2();
+ const QChar * pBuf = (const QChar *)text.utf16();
const QChar * c = pBuf;
QTextCharFormat commentFormat;
commentFormat.setForeground(g_clrComment);
@@ -745,7 +743,7 @@ void KviScriptSyntaxHighlighter::highlightBlock(const QString &text)
{
// might be "else"
QString tmp(pBegin,4);
- if(tmp.lower() == "else")bNewCommand = true;
+ if(tmp.toLower() == "else")bNewCommand = true;
continue;
}
}
@@ -756,7 +754,7 @@ void KviScriptSyntaxHighlighter::highlightBlock(const QString &text)
{
// might be "function"
QString tmp(pBegin,8);
- if(tmp.lower() == "function")bNewCommand = true;
+ if(tmp.toLower() == "function")bNewCommand = true;
continue;
}
}
@@ -767,7 +765,7 @@ void KviScriptSyntaxHighlighter::highlightBlock(const QString &text)
{
// might be "internal"
QString tmp(pBegin,8);
- if(tmp.lower() == "internal")bNewCommand = true;
+ if(tmp.toLower() == "internal")bNewCommand = true;
continue;
}
}
@@ -873,7 +871,7 @@ void KviScriptSyntaxHighlighter::highlightBlock(const QString &text)
int index=0;
while (i)
{
- index=text.find(szFind,index,false);
+ index=text.indexOf(szFind,index,Qt::CaseInsensitive);
if (index != -1)
{
setFormat(index,szFind.length(),findFormat);
@@ -1048,7 +1046,7 @@ void KviScriptEditorImplementation::saveToFile()
QString::null,
QString::null,false,true,true))
{
- QString buffer = m_pEditor->text();
+ QString buffer = m_pEditor->toPlainText();
//if(tmp.isEmpty())tmp = "";
//KviStr buffer = tmp.toUtf8().data();
@@ -1065,15 +1063,15 @@ void KviScriptEditorImplementation::saveToFile()
void KviScriptEditorImplementation::setText(const KviQCString &txt)
{
m_pEditor->setText(txt.data());
- m_pEditor->setTextFormat(Qt::PlainText);
+ //m_pEditor->setTextFormat(Qt::PlainText);
//m_pEditor->moveCursor(KviTalTextEdit::MoveEnd,false);
- m_pEditor->setModified(false);
+ m_pEditor->document()->setModified(false);
updateRowColLabel();
}
void KviScriptEditorImplementation::getText(KviQCString &txt)
{
- txt = m_pEditor->text().toUtf8();
+ txt = m_pEditor->toPlainText().toUtf8();
}
QLineEdit * KviScriptEditorImplementation::getFindlineedit()
@@ -1084,15 +1082,15 @@ QLineEdit * KviScriptEditorImplementation::getFindlineedit()
void KviScriptEditorImplementation::setText(const QString &txt)
{
m_pEditor->setText(txt);
- m_pEditor->setTextFormat(Qt::PlainText);
+// m_pEditor->setTextFormat(Qt::PlainText);
// m_pEditor->moveCursor(KviTalTextEdit::MoveEnd,false);
- m_pEditor->setModified(false);
+ m_pEditor->document()->setModified(false);
updateRowColLabel();
}
void KviScriptEditorImplementation::getText(QString &txt)
{
- txt = m_pEditor->text();
+ txt = m_pEditor->toPlainText();
}
void KviScriptEditorImplementation::setFindText(const QString &txt)
@@ -1195,42 +1193,51 @@ KviScriptEditorReplaceDialog::KviScriptEditorReplaceDialog( QWidget* parent, con
layout->setObjectName("replace layout");
- QLabel *findlabel = new QLabel( this, "findlabel" );
+ QLabel *findlabel = new QLabel( this);
+ findlabel->setObjectName("findlabel");
findlabel->setText(tr("Word to Find"));
layout->addWidget( findlabel, 0, 0 );
- m_pFindlineedit = new QLineEdit( this, "findlineedit" );
+ m_pFindlineedit = new QLineEdit( this);
+ m_pFindlineedit->setObjectName( "findlineedit" );
layout->addWidget(m_pFindlineedit,0,1);
- QLabel *replacelabel = new QLabel( this, "replacelabel" );
- replacelabel->setText(tr("Replace with"));
- layout->addWidget( replacelabel, 1, 0 );
+ QLabel *replaceLabel = new QLabel( this);
+ replaceLabel->setObjectName( "replacelabel" );
+ replaceLabel->setText(tr("Replace with"));
+ layout->addWidget( replaceLabel, 1, 0 );
- m_pReplacelineedit = new QLineEdit( this, "replacelineedit" );
+ m_pReplacelineedit = new QLineEdit( this);
+ m_pReplacelineedit->setObjectName( "replacelineedit" );
layout->addWidget( m_pReplacelineedit,1,1);
m_pFindlineedit->setFocus();
- QPushButton *cancelbutton = new QPushButton( this, "cancelButton" );
- cancelbutton->setText(tr("&Cancel"));
- layout->addWidget( cancelbutton, 3, 1 );
+ QPushButton *cancelButton = new QPushButton( this);
+ cancelButton->setObjectName( "cancelButton" );
+ cancelButton->setText(tr("&Cancel"));
+ layout->addWidget( cancelButton, 3, 1 );
- replacebutton = new QPushButton( this, "replacebutton" );
+ replacebutton = new QPushButton( this);
+ replacebutton->setObjectName("replacebutton" );
replacebutton->setText(tr("&Replace"));
replacebutton->setEnabled( FALSE );
layout->addWidget( replacebutton, 3, 2 );
- checkReplaceAll = new KviStyledCheckBox( this, "replaceAll" );
+ checkReplaceAll = new QCheckBox( this);
+ checkReplaceAll->setObjectName("replaceAll" );
checkReplaceAll->setText(tr("&Replace in all Aliases"));
layout->addWidget( checkReplaceAll, 2, 0 );
- findNext = new QPushButton(this, "findNext(WIP)" );
+ findNext = new QPushButton(this);
+ findNext->setObjectName( "findNext(WIP)" );
findNext->setText(tr("&Findnext"));
layout->addWidget( findNext, 0, 2 );
findNext->setEnabled(false);
- replace = new QPushButton(this, "replace" );
+ replace = new QPushButton(this);
+ replace->setObjectName( "replace" );
replace->setText(tr("&Replace(WIP)"));
layout->addWidget( replace, 1, 2 );
replace->setEnabled(false);
@@ -1238,7 +1245,7 @@ KviScriptEditorReplaceDialog::KviScriptEditorReplaceDialog( QWidget* parent, con
// signals and slots connections
connect( replacebutton, SIGNAL( clicked() ), this, SLOT( slotReplace() ) );
connect( findNext, SIGNAL( clicked() ),this,SLOT( slotNextFind()));
- connect( cancelbutton, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ connect( cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( m_pFindlineedit, SIGNAL( textChanged(const QString &)), this, SLOT( textChanged(const QString &)));
}
@@ -1256,11 +1263,11 @@ void KviScriptEditorReplaceDialog::textChanged(const QString &txt)
void KviScriptEditorReplaceDialog::slotReplace()
{
- QString txt=((KviScriptEditorWidget *)m_pParent)->text();
+ QString txt=((KviScriptEditorWidget *)m_pParent)->toPlainText();
if (checkReplaceAll->isChecked()) emit replaceAll(m_pFindlineedit->text(),m_pReplacelineedit->text());
txt.replace(m_pFindlineedit->text(),m_pReplacelineedit->text(),Qt::CaseInsensitive);
((KviScriptEditorWidget *)m_pParent)->setText(txt);
- ((KviScriptEditorWidget *)m_pParent)->setModified(true);
+ ((KviScriptEditorWidget *)m_pParent)->document()->setModified(true);
m_pFindlineedit->setText("");
m_pReplacelineedit->setText("");
setTabOrder(m_pFindlineedit,m_pReplacelineedit);
diff --git a/src/modules/editor/scripteditor.h b/src/modules/editor/scripteditor.h
index 7170e9a45..329c6af0f 100644
--- a/src/modules/editor/scripteditor.h
+++ b/src/modules/editor/scripteditor.h
@@ -179,7 +179,7 @@ protected:
QPushButton *findNext;
// QPushButton *cancelbutton;
- KviStyledCheckBox *checkReplaceAll;
+ QCheckBox *checkReplaceAll;
QWidget *m_pParent;
protected slots:
void textChanged(const QString &);
diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp
index 4324c2c6e..617c089bf 100644
--- a/src/modules/file/libkvifile.cpp
+++ b/src/modules/file/libkvifile.cpp
@@ -628,25 +628,25 @@ static bool file_kvs_fnc_ls(KviKvsModuleFunctionCall * c)
QFlags<QDir::Filter> iFlags = 0;
if(szFlags.isEmpty())iFlags = QDir::Dirs | QDir::Files | QDir::NoSymLinks | QDir::Readable | QDir::Writable | QDir::Executable | QDir::Hidden | QDir::System;
else {
- if(szFlags.find('d',false) != -1)iFlags |= QDir::Dirs;
- if(szFlags.find('f',false) != -1)iFlags |= QDir::Files;
- if(szFlags.find('l',false) == -1)iFlags |= QDir::NoSymLinks;
- if(szFlags.find('r',false) != -1)iFlags |= QDir::Readable;
- if(szFlags.find('w',false) != -1)iFlags |= QDir::Writable;
- if(szFlags.find('x',false) != -1)iFlags |= QDir::Executable;
- if(szFlags.find('h',false) != -1)iFlags |= QDir::Hidden;
- if(szFlags.find('s',false) != -1)iFlags |= QDir::System;
+ if(szFlags.indexOf('d',Qt::CaseInsensitive) != -1)iFlags |= QDir::Dirs;
+ if(szFlags.indexOf('f',Qt::CaseInsensitive) != -1)iFlags |= QDir::Files;
+ if(szFlags.indexOf('l',Qt::CaseInsensitive) == -1)iFlags |= QDir::NoSymLinks;
+ if(szFlags.indexOf('r',Qt::CaseInsensitive) != -1)iFlags |= QDir::Readable;
+ if(szFlags.indexOf('w',Qt::CaseInsensitive) != -1)iFlags |= QDir::Writable;
+ if(szFlags.indexOf('x',Qt::CaseInsensitive) != -1)iFlags |= QDir::Executable;
+ if(szFlags.indexOf('h',Qt::CaseInsensitive) != -1)iFlags |= QDir::Hidden;
+ if(szFlags.indexOf('s',Qt::CaseInsensitive) != -1)iFlags |= QDir::System;
}
QFlags<QDir::SortFlag> iSort = 0;
if(szFlags.isEmpty())iSort = QDir::Unsorted;
else {
- if(szFlags.find('n',false) != -1)iSort |= QDir::Name;
- if(szFlags.find('t',false) != -1)iSort |= QDir::Time;
- if(szFlags.find('b',false) != -1)iSort |= QDir::Size;
- if(szFlags.find('z',false) != -1)iSort |= QDir::DirsFirst;
- if(szFlags.find('k',false) != -1)iSort |= QDir::Reversed;
- if(szFlags.find('i',false) != -1)iSort |= QDir::IgnoreCase;
+ if(szFlags.indexOf('n',Qt::CaseInsensitive) != -1)iSort |= QDir::Name;
+ if(szFlags.indexOf('t',Qt::CaseInsensitive) != -1)iSort |= QDir::Time;
+ if(szFlags.indexOf('b',Qt::CaseInsensitive) != -1)iSort |= QDir::Size;
+ if(szFlags.indexOf('z',Qt::CaseInsensitive) != -1)iSort |= QDir::DirsFirst;
+ if(szFlags.indexOf('k',Qt::CaseInsensitive) != -1)iSort |= QDir::Reversed;
+ if(szFlags.indexOf('i',Qt::CaseInsensitive) != -1)iSort |= QDir::IgnoreCase;
}
QStringList sl;
@@ -714,7 +714,7 @@ static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c)
KviFileUtils::adjustFilePath(szNameZ);
QFile f(szNameZ);
- if(!f.open(IO_ReadOnly))
+ if(!f.open(QIODevice::ReadOnly))
{
c->warning(__tr2qs("Can't open the file \"%Q\" for reading"),&szNameZ);
return true;
@@ -728,7 +728,7 @@ static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c)
while((uReaded < uSize) && (!f.atEnd()))
{
- int readedNow = f.readBlock(buf + uReaded,uSize - uReaded);
+ int readedNow = f.read(buf + uReaded,uSize - uReaded);
if(readedNow < 0)
{
kvi_free(buf);
@@ -748,7 +748,7 @@ static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c)
buf[uReaded] = '\0';
- if(szFlags.find('l',false) == -1)
+ if(szFlags.indexOf('l',Qt::CaseInsensitive) == -1)
c->returnValue()->setString(QString::fromUtf8(buf));
else
c->returnValue()->setString(QString::fromLocal8Bit(buf));
@@ -806,7 +806,7 @@ static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c)
KviFileUtils::adjustFilePath(szName);
QFile f(szName);
- if(!f.open(IO_ReadOnly))
+ if(!f.open(QIODevice::ReadOnly))
{
c->warning(__tr2qs("Can't open the file \"%Q\" for reading"),&szName);
return true;
@@ -815,7 +815,7 @@ static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c)
if(c->params()->count() < 2)iStartLine = 0;
if(c->params()->count() < 3)iCount = -1;
- bool bLocal8Bit = szFlags.find('l',0,false) != -1;
+ bool bLocal8Bit = szFlags.indexOf('l',0,Qt::CaseInsensitive) != -1;
KviKvsArray * a = new KviKvsArray();
@@ -1006,7 +1006,7 @@ static bool file_kvs_fnc_homedir(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER("relative_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szName)
KVSM_PARAMETERS_END(c)
if(szName.isEmpty())szName.append(KVI_PATH_SEPARATOR_CHAR);
- QString szPath = QDir::homeDirPath();
+ QString szPath = QDir::homePath();
KviQString::ensureLastCharIs(szPath,KVI_PATH_SEPARATOR_CHAR);
szPath.append(szName);
KviFileUtils::adjustFilePath(szPath);
@@ -1043,7 +1043,7 @@ static bool file_kvs_fnc_rootdir(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER("relative_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szName)
KVSM_PARAMETERS_END(c)
if(szName.isEmpty())szName.append(KVI_PATH_SEPARATOR_CHAR);
- QString szPath = QDir::rootDirPath();
+ QString szPath = QDir::rootPath();
KviQString::ensureLastCharIs(szPath,KVI_PATH_SEPARATOR_CHAR);
szPath.append(szName);
KviFileUtils::adjustFilePath(szPath);
@@ -1078,7 +1078,7 @@ static bool file_kvs_fnc_cwd(KviKvsModuleFunctionCall * c)
KVSM_PARAMETER("relative_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szName)
KVSM_PARAMETERS_END(c)
if(szName.isEmpty())szName.append(KVI_PATH_SEPARATOR_CHAR);
- QString szPath = QDir::currentDirPath();
+ QString szPath = QDir::currentPath();
KviQString::ensureLastCharIs(szPath,KVI_PATH_SEPARATOR_CHAR);
szPath.append(szName);
KviFileUtils::adjustFilePath(szPath);
@@ -1155,7 +1155,7 @@ static bool file_kvs_fnc_extractpath(KviKvsModuleFunctionCall * c)
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("filepath",KVS_PT_NONEMPTYSTRING,0,szName)
KVSM_PARAMETERS_END(c)
- c->returnValue()->setString(QFileInfo(szName).dirPath(TRUE));
+ c->returnValue()->setString(QFileInfo(szName).absolutePath());
return true;
}
diff --git a/src/modules/http/http_QT4_vc05.vcproj b/src/modules/http/http_QT4_vc05.vcproj
index 45c211112..c66b3754f 100644
--- a/src/modules/http/http_QT4_vc05.vcproj
+++ b/src/modules/http/http_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HTTP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HTTP_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/http/httpfiletransfer.cpp b/src/modules/http/httpfiletransfer.cpp
index e61c50514..b28b39954 100644
--- a/src/modules/http/httpfiletransfer.cpp
+++ b/src/modules/http/httpfiletransfer.cpp
@@ -83,6 +83,7 @@ KviHttpFileTransfer::~KviHttpFileTransfer()
void KviHttpFileTransfer::autoClean()
{
+ killTimer(m_TimerId);
die();
}
@@ -457,7 +458,8 @@ void KviHttpFileTransfer::transferTerminated(bool bSuccess)
if(m_pAutoCleanTimer)delete m_pAutoCleanTimer;
m_pAutoCleanTimer = new QTimer();
connect(m_pAutoCleanTimer,SIGNAL(timeout()),this,SLOT(autoClean()));
- m_pAutoCleanTimer->start(100,true);
+ m_pAutoCleanTimer->start(100);
+ m_TimerId=m_pAutoCleanTimer->timerId();
}
}
diff --git a/src/modules/http/httpfiletransfer.h b/src/modules/http/httpfiletransfer.h
index 95b1408d3..3800538cb 100644
--- a/src/modules/http/httpfiletransfer.h
+++ b/src/modules/http/httpfiletransfer.h
@@ -43,6 +43,7 @@ public:
KviHttpFileTransfer();
~KviHttpFileTransfer();
private:
+ int m_TimerId;
KviHttpRequest * m_pHttpRequest;
GeneralStatus m_eGeneralStatus;
QString m_szStatusString;
diff --git a/src/modules/ident/ident_QT4_vc05.vcproj b/src/modules/ident/ident_QT4_vc05.vcproj
index 22776cad9..8c5480fb1 100644
--- a/src/modules/ident/ident_QT4_vc05.vcproj
+++ b/src/modules/ident/ident_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IDENT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IDENT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/lamerizer/lamerizer_QT4_vc05.vcproj b/src/modules/lamerizer/lamerizer_QT4_vc05.vcproj
index 0a66355c7..77834ed2d 100644
--- a/src/modules/lamerizer/lamerizer_QT4_vc05.vcproj
+++ b/src/modules/lamerizer/lamerizer_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LAMERIZER_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LAMERIZER_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/links/links_QT4_vc05.vcproj b/src/modules/links/links_QT4_vc05.vcproj
index ddfdac6ac..4615d186a 100644
--- a/src/modules/links/links_QT4_vc05.vcproj
+++ b/src/modules/links/links_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LINKS_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LINKS_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/list/list_QT4_vc05.vcproj b/src/modules/list/list_QT4_vc05.vcproj
index ef14029e3..f667c2840 100644
--- a/src/modules/list/list_QT4_vc05.vcproj
+++ b/src/modules/list/list_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIST_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIST_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/log/log_QT4_vc05.vcproj b/src/modules/log/log_QT4_vc05.vcproj
index f2c395831..bc0036e7f 100644
--- a/src/modules/log/log_QT4_vc05.vcproj
+++ b/src/modules/log/log_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LOG_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LOG_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/mask/mask_QT4_vc05.vcproj b/src/modules/mask/mask_QT4_vc05.vcproj
index c36d2e83a..694a025d4 100644
--- a/src/modules/mask/mask_QT4_vc05.vcproj
+++ b/src/modules/mask/mask_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MASK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MASK_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/math/math_QT4_vc05.vcproj b/src/modules/math/math_QT4_vc05.vcproj
index 34683370a..ab98c1796 100644
--- a/src/modules/math/math_QT4_vc05.vcproj
+++ b/src/modules/math/math_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MATH_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MATH_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/mediaplayer/libkvimediaplayer.cpp b/src/modules/mediaplayer/libkvimediaplayer.cpp
index 15cc30eda..f8b80912f 100644
--- a/src/modules/mediaplayer/libkvimediaplayer.cpp
+++ b/src/modules/mediaplayer/libkvimediaplayer.cpp
@@ -1310,7 +1310,7 @@ MP_KVS_FUNCTION(getEqData)
MP_KVS_FAIL_ON_NO_INTERFACE
- bool bQuiet = szOptions.find('q',false) != -1;
+ bool bQuiet = szOptions.indexOf('q',Qt::CaseInsensitive) != -1;
int ret = g_pMPInterface->getEqData(iValue);
@@ -1401,7 +1401,7 @@ MP_KVS_FUNCTION(localFile)
MP_KVS_FAIL_ON_NO_INTERFACE
QString szRet = g_pMPInterface->mrl();
if(szRet.isEmpty())return true;
- if(szRet.startsWith("file://",false))
+ if(szRet.startsWith("file://",Qt::CaseInsensitive))
{
szRet.remove(0,7);
c->returnValue()->setString(szRet);
diff --git a/src/modules/mediaplayer/mediaplayer_QT4_vc05.vcproj b/src/modules/mediaplayer/mediaplayer_QT4_vc05.vcproj
index 007372deb..4b3ceff15 100644
--- a/src/modules/mediaplayer/mediaplayer_QT4_vc05.vcproj
+++ b/src/modules/mediaplayer/mediaplayer_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MEDIAPLAYER_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MEDIAPLAYER_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/mediaplayer/mp_amipinterface.cpp b/src/modules/mediaplayer/mp_amipinterface.cpp
index 35f0589b0..9cccb87dd 100644
--- a/src/modules/mediaplayer/mp_amipinterface.cpp
+++ b/src/modules/mediaplayer/mp_amipinterface.cpp
@@ -71,7 +71,7 @@ static bool loadAmipDll()
static QTextCodec * mediaplayer_get_codec()
{
- QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding));
+QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toAscii());
if(!c)c = QTextCodec::codecForLocale();
return c;
}
@@ -215,9 +215,9 @@ QString KviAmipInterface::mrl()
QString ret;
QString fn = eval_str("var_fn");
QTextCodec *c=mediaplayer_get_codec();
- if (c) ret = c->toUnicode(fn);
+ if (c) ret = c->toUnicode(fn.toAscii());
else ret=fn;
- if(!ret.startsWith("http://",false))
+ if(!ret.startsWith("http://",Qt::CaseInsensitive))
ret.prepend("file://");
return ret;
@@ -227,7 +227,7 @@ QString getAmipString(const char * var) {
QString ret;
QString s = eval_str(var);
QTextCodec *c=mediaplayer_get_codec();
- if (c) ret = c->toUnicode(s);
+ if (c) ret = c->toUnicode(s.toAscii());
else ret=s;
return ret;
}
@@ -391,7 +391,7 @@ QString KviAmipInterface::amipEval(const QString &cmd)
if((ac_eval(szCmd, buff) == AC_ERR_NOERROR)) {
QString s = buff;
QTextCodec *c=mediaplayer_get_codec();
- if (c) ret = c->toUnicode(s);
+ if (c) ret = c->toUnicode(s.toAscii());
else ret=s;
}
return ret;
diff --git a/src/modules/mediaplayer/mp_interface.cpp b/src/modules/mediaplayer/mp_interface.cpp
index e6a3b0927..104edfdb8 100644
--- a/src/modules/mediaplayer/mp_interface.cpp
+++ b/src/modules/mediaplayer/mp_interface.cpp
@@ -84,7 +84,7 @@ QString KviMediaPlayerInterface::getLocalFile()
{
QString ret = mrl();
if(ret.isEmpty())return ret;
- if(ret.startsWith("file://",false))
+ if(ret.startsWith("file://",Qt::CaseInsensitive))
{
ret.remove(0,7);
return ret;
@@ -265,12 +265,12 @@ bool KviMediaPlayerInterface::setShuffle(bool &bVal)
QString KviMediaPlayerInterface::mediaType()
{
QString ret = mrl();
- if(ret.endsWith(".mp3",false))ret = "MPEG Layer 3";
- else if(ret.endsWith(".ogg",false))ret = "OGG Vorbis";
- else if(ret.endsWith(".avi",false))ret = "Audio Video Interleave";
- else if(ret.endsWith(".mpeg",false))ret = "MPEG Video";
- else if(ret.endsWith(".mpg",false))ret = "MPEG Video";
- else if(ret.startsWith("http://",false))ret = "HTTP Audio Stream";
+ if(ret.endsWith(".mp3",Qt::CaseInsensitive))ret = "MPEG Layer 3";
+ else if(ret.endsWith(".ogg",Qt::CaseInsensitive))ret = "OGG Vorbis";
+ else if(ret.endsWith(".avi",Qt::CaseInsensitive))ret = "Audio Video Interleave";
+ else if(ret.endsWith(".mpeg",Qt::CaseInsensitive))ret = "MPEG Video";
+ else if(ret.endsWith(".mpg",Qt::CaseInsensitive))ret = "MPEG Video";
+ else if(ret.startsWith("http://",Qt::CaseInsensitive))ret = "HTTP Audio Stream";
else ret = QString::null;
return ret;
}
diff --git a/src/modules/mediaplayer/mp_winampinterface.cpp b/src/modules/mediaplayer/mp_winampinterface.cpp
index 0275c8654..547705a68 100644
--- a/src/modules/mediaplayer/mp_winampinterface.cpp
+++ b/src/modules/mediaplayer/mp_winampinterface.cpp
@@ -169,7 +169,7 @@
static QTextCodec * mediaplayer_get_codec()
{
- QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding));
+ QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toAscii());
if(!c)c = QTextCodec::codecForLocale();
return c;
@@ -331,7 +331,7 @@ QString KviWinampInterface::mrl()
QTextCodec *c=mediaplayer_get_codec();
if (c) ret = c->toUnicode(szBuffer);
else ret=szBuffer;
- if(!ret.startsWith("http://",false))
+ if(!ret.startsWith("http://",Qt::CaseInsensitive))
ret.prepend("file://");
}
}
diff --git a/src/modules/mircimport/mircimport_QT4_vc05.vcproj b/src/modules/mircimport/mircimport_QT4_vc05.vcproj
index c90bf5992..704f6ee84 100644
--- a/src/modules/mircimport/mircimport_QT4_vc05.vcproj
+++ b/src/modules/mircimport/mircimport_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MIRCIMPORT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MIRCIMPORT_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/my/my_QT4_vc05.vcproj b/src/modules/my/my_QT4_vc05.vcproj
index 27bc7e450..881be65ce 100644
--- a/src/modules/my/my_QT4_vc05.vcproj
+++ b/src/modules/my/my_QT4_vc05.vcproj
@@ -42,7 +42,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\kvilib\tal&quot;;&quot;$(ProjectDir)\..\..\kvilib\system&quot;;&quot;$(ProjectDir)\..\..\kvilib\irc&quot;;&quot;$(ProjectDir)\..\..\kvilib\file&quot;;&quot;$(ProjectDir)\..\..\kvilib\ext&quot;;&quot;$(ProjectDir)\..\..\kvilib\net&quot;;&quot;$(ProjectDir)\..\..\kvilib\core\wstring&quot;;&quot;$(ProjectDir)\..\..\kvilib\core&quot;;&quot;$(ProjectDir)\..\..\kvilib\config&quot;;&quot;$(SSLINCDIR)&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(ProjectDir)\..\..\kvirc\kvs&quot;;&quot;$(ProjectDir)\..\..\kvirc\module&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser\scripttoolbar&quot;;&quot;$(ProjectDir)\..\..\kvirc\uparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\sparser&quot;;&quot;$(ProjectDir)\..\..\kvirc\kernel&quot;;&quot;$(ProjectDir)\..\..\kvirc\ui&quot;;&quot;$(QTDIR)\include\Qt3Support&quot;;&quot;$(QTDIR)\include\QtCore\&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtNetwork&quot;;&quot;$(QTDIR)\include\QtXml&quot;;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MY_EXPORTS;_CRT_SECURE_NO_DEPRECATE;QT3_SUPPORT;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MY_EXPORTS;_CRT_SECURE_NO_DEPRECATE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
diff --git a/src/modules/objects/class_listview.cpp b/src/modules/objects/class_listview.cpp
index 2ccb4302a..82de3cd16 100644
--- a/src/modules/objects/class_listview.cpp
+++ b/src/modules/objects/class_listview.cpp
@@ -38,6 +38,11 @@
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QUrl>
+#include <QTreeWidget>
+
+#define KviTalListView QTreeWidget
+
+
/*
@doc: listview
@@ -180,7 +185,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_listview,"listview","widget")
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"setRootIsDecorated",function_setRootIsDecorated)
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"setAllColumnsShowFocus",function_setAllColumnsShowFocus)
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"clear",function_clear)
- KVSO_REGISTER_HANDLER(KviKvsObject_listview,"selectedItem",function_selectedItem)
+ KVSO_REGISTER_HANDLER(KviKvsObject_listview,"selectedItems",function_selectedItems)
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"currentItem",function_currentItem)
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"setSelectionMode",function_setSelectionMode)
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"listViewHeaderIsVisible",function_listViewHeaderIsVisible)
@@ -188,7 +193,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_listview,"listview","widget")
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"hideListViewHeader",function_hideListViewHeader)
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"showListViewHeader",function_showListViewHeader)
- KVSO_REGISTER_HANDLER(KviKvsObject_listview,"firstChild",function_firstChild)
+// KVSO_REGISTER_HANDLER(KviKvsObject_listview,"firstChild",function_firstChild)
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"selectionChangedEvent",function_selectionChangedEvent);
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"currentChangedEvent",function_currentChangedEvent);
KVSO_REGISTER_HANDLER(KviKvsObject_listview,"returnPressedEvent",function_returnPressedEvent);
@@ -238,8 +243,12 @@ bool KviKvsObject_listview::function_addColumn(KviKvsObjectFunctionCall *c)
KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel)
KVSO_PARAMETER("width",KVS_PT_INT,0,iW)
KVSO_PARAMETERS_END(c)
- if (widget())
- ((KviTalListView *)object())->addColumn(szLabel,iW);
+ int col=((KviTalListView *)widget())->columnCount();
+ col++;
+ ((KviTalListView *)widget())->setColumnCount(col);
+ QTreeWidgetItem *item = ((KviTalListView *)widget())->headerItem();
+ item->setText(col-1,szLabel);
+ if (iW>0) ((KviTalListView *)widget())->setColumnWidth(col-1,iW);
return true;
}
/*
@@ -261,15 +270,19 @@ bool KviKvsObject_listview::function_clear(KviKvsObjectFunctionCall *c)
return true;
}
-bool KviKvsObject_listview::function_selectedItem(KviKvsObjectFunctionCall *c)
+bool KviKvsObject_listview::function_selectedItems(KviKvsObjectFunctionCall *c)
{
- if(widget())
- c->returnValue()->setHObject(KviKvsObject_listviewitem::itemToHandle(((KviTalListView *)widget())->selectedItem()));
- else
- c->returnValue()->setHObject((kvs_hobject_t)0);
+ KviKvsArray * a = new KviKvsArray();
+ QList<QTreeWidgetItem *> selectedItems=((KviTalListView *)widget())->selectedItems();
+ if (!selectedItems.count()) return true;
+ for (int i=0;i<selectedItems.count();i++)
+ {
+ a->set(i,new KviKvsVariant(KviKvsObject_listviewitem::itemToHandle((KviTalListViewItem *)selectedItems.at(i))));
+ }
+ c->returnValue()->setArray(a);
return true;
}
-
+/*
bool KviKvsObject_listview::function_firstChild(KviKvsObjectFunctionCall *c)
{
if(widget())
@@ -278,11 +291,12 @@ bool KviKvsObject_listview::function_firstChild(KviKvsObjectFunctionCall *c)
c->returnValue()->setHObject((kvs_hobject_t)0);
return true;
}
-
+*/
bool KviKvsObject_listview::function_currentItem(KviKvsObjectFunctionCall *c)
{
- if(widget())
- c->returnValue()->setHObject(KviKvsObject_listviewitem::itemToHandle(((KviTalListView *)widget())->currentItem()));
+ if(widget()){
+ KviTalListViewItem *
+ c->returnValue()->setHObject(KviKvsObject_listviewitem::itemToHandle((KviTalListViewItem *)((KviTalListView *)widget())->currentItem()));
else
c->returnValue()->setHObject((kvs_hobject_t)0);
return true;
@@ -312,7 +326,7 @@ bool KviKvsObject_listview::function_setSelectionMode(KviKvsObjectFunctionCall *
else if(KviQString::equalCI(szMode,"Multi"))
((KviTalListView *)widget())->setSelectionMode(KviTalListView::Multi);
else if(KviQString::equalCI(szMode,"Extended"))
- ((KviTalListView *)widget())->setSelectionMode(KviTalListView::Extended);
+ ((KviTalListView *)widget())->setSelectionMode(QAbstractItemView::ExtendedSelection);
else if(KviQString::equalCI(szMode,"Single"))
((KviTalListView *)widget())->setSelectionMode(KviTalListView::Single);
else c->warning(__tr2qs("Invalid selection mode '%Q'"),&szMode);
diff --git a/src/modules/objects/class_listview.h b/src/modules/objects/class_listview.h
index bfccbdd78..1aba7555d 100644
--- a/src/modules/objects/class_listview.h
+++ b/src/modules/objects/class_listview.h
@@ -62,10 +62,10 @@ protected:
bool function_itemCollapsedEvent(KviKvsObjectFunctionCall *c);
bool function_itemRenamedEvent(KviKvsObjectFunctionCall *c);
bool function_rightButtonClickedEvent(KviKvsObjectFunctionCall *c);
- bool function_selectedItem(KviKvsObjectFunctionCall *c);
+ bool function_selectedItems(KviKvsObjectFunctionCall *c);
bool function_currentItem(KviKvsObjectFunctionCall *c);
bool function_setSelectionMode(KviKvsObjectFunctionCall *c);
- bool function_firstChild(KviKvsObjectFunctionCall *c);
+ //bool function_firstChild(KviKvsObjectFunctionCall *c);
bool function_listViewHeaderIsVisible(KviKvsObjectFunctionCall *c);
bool function_showListViewHeader(KviKvsObjectFunctionCall *c);
bool function_hideListViewHeader(KviKvsObjectFunctionCall *c);
diff --git a/src/modules/objects/class_widget.cpp b/src/modules/objects/class_widget.cpp
index 5314a6863..51fbd5963 100644
--- a/src/modules/objects/class_widget.cpp
+++ b/src/modules/objects/class_widget.cpp
@@ -517,6 +517,9 @@ const Qt::WindowType widgettypes_cod[] = {
!fn: $insertIntoStatusBar(<index:unsigned integer>)
Insert the widget into the statusbar at the given index.
If index is out of range, the widget is appended.
+ See also [classfnc]$removeFromStatusBar[/classfnc]().
+ !fn: $removeFromStatusBar()
+ Remove the widget from statusbar.
@examples:
[example]
%Widget = $new(widget)
@@ -682,7 +685,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_widget,"widget","object")
// statusbar
KVSO_REGISTER_HANDLER(KviKvsObject_widget,"insertIntoStatusBar",function_insertIntoStatusBar)
-
+ KVSO_REGISTER_HANDLER(KviKvsObject_widget,"removeFromStatusBar",function_removeFromStatusBar)
// events
KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KviKvsObject_widget,"mousePressEvent")
KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KviKvsObject_widget,"mouseReleaseEvent")
@@ -1945,6 +1948,13 @@ bool KviKvsObject_widget::function_insertIntoStatusBar(KviKvsObjectFunctionCall
return true;
}
+bool KviKvsObject_widget::function_removeFromStatusBar(KviKvsObjectFunctionCall *c)
+{
+
+ if (widget()) g_pFrame->statusBar()->removeWidget(widget());
+ return true;
+}
+
#ifndef COMPILE_USE_STANDALONE_MOC_SOURCES
#include "m_class_widget.moc"
#endif //!COMPILE_USE_STANDALONE_MOC_SOURCES
diff --git a/src/modules/objects/class_widget.h b/src/modules/objects/class_widget.h
index 518b72beb..35521612f 100644
--- a/src/modules/objects/class_widget.h
+++ b/src/modules/objects/class_widget.h
@@ -76,6 +76,7 @@ protected:
bool function_raise(KviKvsObjectFunctionCall *);
bool function_repaint(KviKvsObjectFunctionCall *c);
bool function_insertIntoStatusBar(KviKvsObjectFunctionCall *c);
+ bool function_removeFromStatusBar(KviKvsObjectFunctionCall *c);
bool function_reparent(KviKvsObjectFunctionCall *c);
bool function_resize(KviKvsObjectFunctionCall *c);
bool function_screenResolution(KviKvsObjectFunctionCall * c);
diff --git a/src/modules/popupeditor/popupeditor.cpp b/src/modules/popupeditor/popupeditor.cpp
index c92674c1c..0045d49a2 100644
--- a/src/modules/popupeditor/popupeditor.cpp
+++ b/src/modules/popupeditor/popupeditor.cpp
@@ -49,6 +49,7 @@
#include <QLabel>
#include <QToolTip>
#include <QPushButton>
+#include <QAbstractItemView>
extern KviPopupEditorWindow * g_pPopupEditorWindow;
@@ -998,7 +999,7 @@ KviPopupEditor::KviPopupEditor(QWidget * par)
m_pListView = new KviTalListView(box);
m_pListView->addColumn(__tr2qs("Popup"));
- m_pListView->setSelectionMode(KviTalListView::Extended);
+ m_pListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_pListView->setShowSortIndicator(true);
QPushButton * pb = new QPushButton(__tr2qs("&Export All To..."),box);
diff --git a/src/modules/reguser/dialog.cpp b/src/modules/reguser/dialog.cpp
index ea7e36c49..38207232e 100644
--- a/src/modules/reguser/dialog.cpp
+++ b/src/modules/reguser/dialog.cpp
@@ -58,6 +58,7 @@
#include <QInputDialog>
#include <QEvent>
#include <QCloseEvent>
+#include <QAbstractItemView>
#define LVI_ICON_SIZE 32
#define LVI_BORDER 4
@@ -175,7 +176,7 @@ KviRegisteredUsersDialog::KviRegisteredUsersDialog(QWidget * par)
m_pListView->setAllColumnsShowFocus(true);
- m_pListView->setSelectionMode(KviTalListView::Extended);
+ m_pListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_pListView->setRootIsDecorated(TRUE);
QToolTip::add(m_pListView,__tr2qs("<center>This is the list of registered users. " \
diff --git a/src/modules/theme/managementdialog.cpp b/src/modules/theme/managementdialog.cpp
index b2f85a4da..13cc23f84 100644
--- a/src/modules/theme/managementdialog.cpp
+++ b/src/modules/theme/managementdialog.cpp
@@ -21,13 +21,7 @@
// Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
//=============================================================================
-/*
-#define LVI_ICON_SIZE 32
-#define LVI_BORDER 4
-#define LVI_SPACING 8
-#define LVI_MINIMUM_TEXT_WIDTH 300
-#define LVI_MINIMUM_CELL_WIDTH (LVI_MINIMUM_TEXT_WIDTH + LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER)
-*/
+
#include "managementdialog.h"
#include "packthemedialog.h"
#include "savethemedialog.h"
@@ -75,7 +69,7 @@
extern QRect g_rectManagementDialogGeometry;
-KviThemeListBoxItem::KviThemeListBoxItem(KviTalListWidget * box,KviThemeInfo * inf)
+KviThemeListWidgetItem::KviThemeListWidgetItem(KviTalListWidget * box,KviThemeInfo * inf)
: KviTalListWidgetItem(box)
{
m_pThemeInfo = inf;
@@ -105,7 +99,7 @@ KviThemeListBoxItem::KviThemeListBoxItem(KviTalListWidget * box,KviThemeInfo * i
setText(t);
}
-KviThemeListBoxItem::~KviThemeListBoxItem()
+KviThemeListWidgetItem::~KviThemeListWidgetItem()
{
delete m_pThemeInfo;
@@ -251,7 +245,7 @@ void KviThemeManagementDialog::packTheme()
dl.setAutoDelete(false);
QList<QListWidgetItem*> itemsSelected = m_pListWidget->selectedItems ();
for(int i=0;i<itemsSelected.count();i++)
- dl.append(((KviThemeListBoxItem *)itemsSelected.at(i))->themeInfo());
+ dl.append(((KviThemeListWidgetItem *)itemsSelected.at(i))->themeInfo());
if(dl.isEmpty())return;
KviPackThemeDialog * pDialog = new KviPackThemeDialog(this,&dl);
@@ -279,7 +273,7 @@ void KviThemeManagementDialog::applyTheme ( QListWidgetItem * it)
void KviThemeManagementDialog::applyCurrentTheme()
{
- KviThemeListBoxItem * it = (KviThemeListBoxItem *)m_pListWidget->currentItem();
+ KviThemeListWidgetItem * it = (KviThemeListWidgetItem *)m_pListWidget->currentItem();
if(!it)return;
if(KviMessageBox::yesNo(__tr2qs_ctx("Apply theme - KVIrc","theme"),
@@ -309,8 +303,8 @@ void KviThemeManagementDialog::deleteTheme()
{
if(!KviMessageBox::yesNo(__tr2qs_ctx("Delete Theme - KVIrc","theme"),
__tr2qs_ctx("Do you really wish to delete theme \"%Q\" (version %Q)?","theme"),
- &(((KviThemeListBoxItem *)itemsSelected.at(i))->themeInfo()->name()),&(((KviThemeListBoxItem *)itemsSelected.at(i))->themeInfo()->version())))goto jump_out;
- KviFileUtils::deleteDir(((KviThemeListBoxItem *)itemsSelected.at(i))->themeInfo()->absoluteDirectory());
+ &(((KviThemeListWidgetItem *)itemsSelected.at(i))->themeInfo()->name()),&(((KviThemeListWidgetItem *)itemsSelected.at(i))->themeInfo()->version())))goto jump_out;
+ KviFileUtils::deleteDir(((KviThemeListWidgetItem *)itemsSelected.at(i))->themeInfo()->absoluteDirectory());
}
jump_out:
fillThemeBox();
@@ -365,8 +359,8 @@ void KviThemeManagementDialog::fillThemeBox(const QString &szDir)
if(inf->loadFromDirectory(szTest))
{
inf->setSubdirectory(*it);
- KviThemeListBoxItem * item = 0;
- item = new KviThemeListBoxItem(m_pListWidget,inf);
+ KviThemeListWidgetItem * item = 0;
+ item = new KviThemeListWidgetItem(m_pListWidget,inf);
} else {
delete inf;
}
@@ -408,7 +402,7 @@ void KviThemeManagementDialog::closeEvent(QCloseEvent * e)
void KviThemeManagementDialog::tipRequest(KviDynamicToolTip *pTip,const QPoint &pnt)
{
- KviThemeListBoxItem * it = (KviThemeListBoxItem *)(m_pListWidget->itemAt(pnt));
+ KviThemeListWidgetItem * it = (KviThemeListWidgetItem *)(m_pListWidget->itemAt(pnt));
if(!it)return;
diff --git a/src/modules/theme/managementdialog.h b/src/modules/theme/managementdialog.h
index 08a03d3dd..a08d4e5ca 100644
--- a/src/modules/theme/managementdialog.h
+++ b/src/modules/theme/managementdialog.h
@@ -48,11 +48,11 @@ class KviDynamicToolTip;
class KviStyledToolButton;
-class KviThemeListBoxItem : public KviTalListWidgetItem
+class KviThemeListWidgetItem : public KviTalListWidgetItem
{
public:
- KviThemeListBoxItem(KviTalListWidget * box,KviThemeInfo * inf);
- virtual ~KviThemeListBoxItem();
+ KviThemeListWidgetItem(KviTalListWidget * box,KviThemeInfo * inf);
+ virtual ~KviThemeListWidgetItem();
public:
KviThemeInfo * m_pThemeInfo;
public: