You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(18) |
Oct
(11) |
Nov
(9) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
(6) |
Mar
|
Apr
(10) |
May
(38) |
Jun
(15) |
Jul
(32) |
Aug
|
Sep
(17) |
Oct
(11) |
Nov
|
Dec
(14) |
| 2006 |
Jan
(2) |
Feb
(5) |
Mar
(3) |
Apr
(2) |
May
(3) |
Jun
(7) |
Jul
|
Aug
|
Sep
(3) |
Oct
(2) |
Nov
(6) |
Dec
(3) |
| 2007 |
Jan
|
Feb
(17) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
(11) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
|
Sep
(6) |
Oct
(4) |
Nov
(1) |
Dec
|
| 2009 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
|
May
(4) |
Jun
(3) |
Jul
|
Aug
(5) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(6) |
| 2010 |
Jan
|
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(8) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
(5) |
| 2013 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(2) |
Dec
(2) |
| 2014 |
Jan
(3) |
Feb
(2) |
Mar
(3) |
Apr
(4) |
May
(4) |
Jun
(3) |
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(2) |
Nov
(5) |
Dec
(2) |
| 2015 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(2) |
Sep
(2) |
Oct
(3) |
Nov
(4) |
Dec
(2) |
| 2017 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(2) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2018 |
Jan
(4) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(2) |
Jun
(2) |
Jul
(8) |
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
(6) |
| 2019 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(4) |
May
(2) |
Jun
(3) |
Jul
(3) |
Aug
(2) |
Sep
(2) |
Oct
(13) |
Nov
(6) |
Dec
(4) |
| 2020 |
Jan
(7) |
Feb
(7) |
Mar
(7) |
Apr
(8) |
May
(5) |
Jun
(3) |
Jul
(10) |
Aug
(4) |
Sep
|
Oct
(37) |
Nov
(30) |
Dec
(8) |
| 2021 |
Jan
(14) |
Feb
(9) |
Mar
(7) |
Apr
(17) |
May
(3) |
Jun
(10) |
Jul
(7) |
Aug
(3) |
Sep
(3) |
Oct
(4) |
Nov
(15) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(3) |
Mar
(3) |
Apr
(3) |
May
(3) |
Jun
(3) |
Jul
(3) |
Aug
(5) |
Sep
(6) |
Oct
(4) |
Nov
(34) |
Dec
(17) |
| 2023 |
Jan
(3) |
Feb
(3) |
Mar
(29) |
Apr
(2) |
May
(18) |
Jun
(12) |
Jul
(12) |
Aug
(2) |
Sep
(7) |
Oct
(2) |
Nov
(2) |
Dec
(2) |
| 2024 |
Jan
(2) |
Feb
(10) |
Mar
(17) |
Apr
(6) |
May
(3) |
Jun
(9) |
Jul
(22) |
Aug
(48) |
Sep
(3) |
Oct
(2) |
Nov
(2) |
Dec
(8) |
| 2025 |
Jan
(3) |
Feb
(2) |
Mar
(9) |
Apr
(7) |
May
(3) |
Jun
(3) |
Jul
(2) |
Aug
(2) |
Sep
(11) |
Oct
(6) |
Nov
(9) |
Dec
(4) |
| 2026 |
Jan
(5) |
Feb
(6) |
Mar
(3) |
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <cn...@us...> - 2020-11-18 03:16:15
|
Revision: 1110
http://sourceforge.net/p/seq/svn/1110
Author: cn187
Date: 2020-11-18 03:16:13 +0000 (Wed, 18 Nov 2020)
Log Message:
-----------
Don't automatically select next spawn in list when current target despawns
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/interface.cpp
showeq/branches/pre_6_0_beta/src/spawnlist.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
Modified: showeq/branches/pre_6_0_beta/src/interface.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-17 23:54:11 UTC (rev 1109)
+++ showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-18 03:16:13 UTC (rev 1110)
@@ -4878,7 +4878,8 @@
if (m_selectedSpawn == item)
{
m_selectedSpawn = 0;
-
+ stsMessage("");
+
// notify others of the new selected spawn
emit selectSpawn(m_selectedSpawn);
}
Modified: showeq/branches/pre_6_0_beta/src/spawnlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-17 23:54:11 UTC (rev 1109)
+++ showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-18 03:16:13 UTC (rev 1110)
@@ -463,6 +463,11 @@
// if there was an item, delete it and all it's children
if (j)
{
+ if (j == currentItem())
+ {
+ selectionModel()->setCurrentIndex(QModelIndex(), QItemSelectionModel::NoUpdate);
+ clearSelection();
+ }
delList += j->takeChildren();
// get the category that the item SpawnListItem belongs to
Modified: showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-17 23:54:11 UTC (rev 1109)
+++ showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-18 03:16:13 UTC (rev 1110)
@@ -289,6 +289,13 @@
// find the list item
SpawnListItem* litem = find(item);
+ if (item == m_selectedItem)
+ {
+ m_selectedItem = NULL;
+ m_spawnList->selectionModel()->setCurrentIndex(QModelIndex(), QItemSelectionModel::NoUpdate);
+ m_spawnList->clearSelection();
+ }
+
// delete the list item
if (litem != NULL)
{
@@ -297,8 +304,6 @@
updateCount();
}
- if (item == m_selectedItem)
- m_selectedItem = NULL;
}
void SpawnListWindow2::changeItem(const Item* item, uint32_t changeItem)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-17 23:54:14
|
Revision: 1109
http://sourceforge.net/p/seq/svn/1109
Author: cn187
Date: 2020-11-17 23:54:11 +0000 (Tue, 17 Nov 2020)
Log Message:
-----------
Revert "Don't automatically select next spawn in list when current target despawns"
Revert previous commit due to unexpected issues.
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/spawnlist.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
Modified: showeq/branches/pre_6_0_beta/src/spawnlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-17 20:54:18 UTC (rev 1108)
+++ showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-17 23:54:11 UTC (rev 1109)
@@ -463,12 +463,6 @@
// if there was an item, delete it and all it's children
if (j)
{
- if (j == currentItem())
- {
- selectionModel()->setCurrentIndex(QModelIndex(), QItemSelectionModel::NoUpdate);
- clearSelection();
- }
-
delList += j->takeChildren();
// get the category that the item SpawnListItem belongs to
@@ -771,7 +765,7 @@
children.clear();
// remove the item from the category list
- delete m_categoryListItems.take(litem);
+ delete m_categoryListItems.take((void*)cat);
}
}
Modified: showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-17 20:54:18 UTC (rev 1108)
+++ showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-17 23:54:11 UTC (rev 1109)
@@ -289,20 +289,16 @@
// find the list item
SpawnListItem* litem = find(item);
- if (item == m_selectedItem)
- {
- m_selectedItem = NULL;
- m_spawnList->clearSelection();
- }
-
// delete the list item
if (litem != NULL)
{
- delete m_spawnListItemDict.take(litem);
+ delete m_spawnListItemDict.take((void*)item);
updateCount();
}
+ if (item == m_selectedItem)
+ m_selectedItem = NULL;
}
void SpawnListWindow2::changeItem(const Item* item, uint32_t changeItem)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-17 20:54:20
|
Revision: 1108
http://sourceforge.net/p/seq/svn/1108
Author: cn187
Date: 2020-11-17 20:54:18 +0000 (Tue, 17 Nov 2020)
Log Message:
-----------
Don't automatically select next spawn in list when current target despawns
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/spawnlist.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
Modified: showeq/branches/pre_6_0_beta/src/spawnlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-09 13:54:30 UTC (rev 1107)
+++ showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-17 20:54:18 UTC (rev 1108)
@@ -463,6 +463,12 @@
// if there was an item, delete it and all it's children
if (j)
{
+ if (j == currentItem())
+ {
+ selectionModel()->setCurrentIndex(QModelIndex(), QItemSelectionModel::NoUpdate);
+ clearSelection();
+ }
+
delList += j->takeChildren();
// get the category that the item SpawnListItem belongs to
@@ -765,7 +771,7 @@
children.clear();
// remove the item from the category list
- delete m_categoryListItems.take((void*)cat);
+ delete m_categoryListItems.take(litem);
}
}
Modified: showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-09 13:54:30 UTC (rev 1107)
+++ showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-17 20:54:18 UTC (rev 1108)
@@ -289,16 +289,20 @@
// find the list item
SpawnListItem* litem = find(item);
+ if (item == m_selectedItem)
+ {
+ m_selectedItem = NULL;
+ m_spawnList->clearSelection();
+ }
+
// delete the list item
if (litem != NULL)
{
- delete m_spawnListItemDict.take((void*)item);
+ delete m_spawnListItemDict.take(litem);
updateCount();
}
- if (item == m_selectedItem)
- m_selectedItem = NULL;
}
void SpawnListWindow2::changeItem(const Item* item, uint32_t changeItem)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-09 13:54:32
|
Revision: 1107
http://sourceforge.net/p/seq/svn/1107
Author: cn187
Date: 2020-11-09 13:54:30 +0000 (Mon, 09 Nov 2020)
Log Message:
-----------
Fix UIC detection on systems that use lib64
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/acinclude.m4
Modified: showeq/branches/pre_6_0_beta/acinclude.m4
===================================================================
--- showeq/branches/pre_6_0_beta/acinclude.m4 2020-11-08 22:56:53 UTC (rev 1106)
+++ showeq/branches/pre_6_0_beta/acinclude.m4 2020-11-09 13:54:30 UTC (rev 1107)
@@ -238,6 +238,7 @@
$QTDIR/src/uic \
/usr/local/qt4/bin \
/usr/lib/*/qt4/bin \
+ /usr/lib64/*/qt4/bin \
/usr/bin \
/usr/X11R6/bin/qt4 \
/usr/X11R6/bin/qt4/bin \
@@ -244,6 +245,7 @@
/usr/X11R6/bin/X11/qt4 \
/usr/X11R6/bin/X11/qt4/bin \
/usr/lib/qt4/bin \
+ /usr/lib64/qt4/bin \
/usr/local/qt*/bin \
/usr/X11R6/bin \
/usr/X11R6/bin/qt* \
@@ -251,7 +253,9 @@
/usr/X11R6/bin/X11/qt* \
/usr/X11R6/bin/X11/qt*/bin \
/usr/lib/qt*/bin \
+ /usr/lib64/qt*/bin \
/usr/lib/*/qt*/bin \
+ /usr/lib64/*/qt*/bin \
/usr/src/qt-*/bin ],
UIC)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 22:56:59
|
Revision: 1106
http://sourceforge.net/p/seq/svn/1106
Author: cn187
Date: 2020-11-08 22:56:53 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Tag for release 6.0.0.0-rc1
Added Paths:
-----------
showeq/tags/v6_0_0_0_rc1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 22:26:57
|
Revision: 1105
http://sourceforge.net/p/seq/svn/1105
Author: cn187
Date: 2020-11-08 22:26:51 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Update version to 6.0.0.0-rc1
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/configure.in
Modified: showeq/branches/pre_6_0_beta/configure.in
===================================================================
--- showeq/branches/pre_6_0_beta/configure.in 2020-11-08 22:03:58 UTC (rev 1104)
+++ showeq/branches/pre_6_0_beta/configure.in 2020-11-08 22:26:51 UTC (rev 1105)
@@ -2,7 +2,7 @@
dnl $Id$ $Name$
AC_PREREQ(2.59)
-AC_INIT(showeq, 6.0.0.0-pre19)
+AC_INIT(showeq, 6.0.0.0-rc1)
AC_CONFIG_SRCDIR(src/main.cpp)
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 22:04:05
|
Revision: 1104
http://sourceforge.net/p/seq/svn/1104
Author: cn187
Date: 2020-11-08 22:03:58 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Update Qt detection macros to use non-x86 host triplets
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/acinclude.m4
Modified: showeq/branches/pre_6_0_beta/acinclude.m4
===================================================================
--- showeq/branches/pre_6_0_beta/acinclude.m4 2020-11-08 21:59:05 UTC (rev 1103)
+++ showeq/branches/pre_6_0_beta/acinclude.m4 2020-11-08 22:03:58 UTC (rev 1104)
@@ -639,8 +639,8 @@
/usr/local/qt4/include \
/usr/qt/4/include \
/usr/include/qt4 \
- /usr/include/i386-linux-gnu/qt4 \
- /usr/include/x86_64-linux-gnu/qt4 \
+ /usr/include/${host_cpu}-linux-gnu/qt4 \
+ /usr/include/*/qt4 \
/usr/lib/qt4/include \
/usr/X11R6/include/X11/qt4 \
/usr/X11R6/include/X11/qt4/include \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 21:59:13
|
Revision: 1103
http://sourceforge.net/p/seq/svn/1103
Author: cn187
Date: 2020-11-08 21:59:05 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Don't stretch the last column, otherwise we can't hide it
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/seqlistview.cpp
Modified: showeq/branches/pre_6_0_beta/src/seqlistview.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/seqlistview.cpp 2020-11-08 21:58:54 UTC (rev 1102)
+++ showeq/branches/pre_6_0_beta/src/seqlistview.cpp 2020-11-08 21:59:05 UTC (rev 1103)
@@ -49,6 +49,9 @@
setRootIsDecorated(false);
setSelectionMode(QAbstractItemView::SingleSelection);
setSelectionBehavior(QAbstractItemView::SelectRows);
+
+ // don't stretch the last column, otherwise we can't hide it
+ header()->setStretchLastSection(false);
}
SEQListView::~SEQListView()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 21:58:56
|
Revision: 1102
http://sourceforge.net/p/seq/svn/1102
Author: cn187
Date: 2020-11-08 21:58:54 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Enable spawnlist2 "add filter" menus when spawn is selected
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
Modified: showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-08 21:58:42 UTC (rev 1101)
+++ showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-08 21:58:54 UTC (rev 1102)
@@ -805,6 +805,10 @@
if (!lvitem) return;
m_spawnList->setCurrentItem(lvitem);
+
+ const Item* item = ((SpawnListItem*)lvitem)->item();
+ if (item != NULL)
+ m_menu->setCurrentItem(item);
}
void SpawnListWindow2::listItemDoubleClicked(QTreeWidgetItem* litem, int col)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 21:58:45
|
Revision: 1101
http://sourceforge.net/p/seq/svn/1101
Author: cn187
Date: 2020-11-08 21:58:42 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Don't link against Qt3 compatibility library
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/configure.in
showeq/branches/pre_6_0_beta/src/Makefile.am
Modified: showeq/branches/pre_6_0_beta/configure.in
===================================================================
--- showeq/branches/pre_6_0_beta/configure.in 2020-11-08 21:58:33 UTC (rev 1100)
+++ showeq/branches/pre_6_0_beta/configure.in 2020-11-08 21:58:42 UTC (rev 1101)
@@ -460,7 +460,7 @@
AC_CHECK_RPATH
CFLAGS="$USE_THREADS $USE_OPT_C $USE_DEBUG_C $USE_INLINE_C $USE_PROFILE_C $CFLAGS"
-CXXFLAGS="$USE_THREADS $USE_OPT_CXX $USE_DEBUG_CXX $USE_INLINE_CXX $USE_PROFILE_CXX -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=${CGI_ICONS} -DICON_DIR=\\\"${CGI_ICON_DIR}\\\" -DQT3_SUPPORT $CXXFLAGS -std=c++11"
+CXXFLAGS="$USE_THREADS $USE_OPT_CXX $USE_DEBUG_CXX $USE_INLINE_CXX $USE_PROFILE_CXX -DQT_THREAD_SUPPORT=1 -DDISPLAY_ICONS=${CGI_ICONS} -DICON_DIR=\\\"${CGI_ICON_DIR}\\\" $CXXFLAGS -std=c++11"
AC_DEFUN([SUCCESS],[
echo "Success!"
Modified: showeq/branches/pre_6_0_beta/src/Makefile.am
===================================================================
--- showeq/branches/pre_6_0_beta/src/Makefile.am 2020-11-08 21:58:33 UTC (rev 1100)
+++ showeq/branches/pre_6_0_beta/src/Makefile.am 2020-11-08 21:58:42 UTC (rev 1101)
@@ -1,6 +1,6 @@
INCLUDES = $(QT_INCLUDES) $(X_INCLUDES) -DPKGDATADIR=\"$(pkgdatadir)/\" -I/usr/include/pcap $(USER_INCLUDES)
-QT_LIBS = -lQtCore -lQtGui -lQtXml -lQt3Support
+QT_LIBS = -lQtCore -lQtGui -lQtXml
bin_PROGRAMS = showeq
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 21:58:35
|
Revision: 1100
http://sourceforge.net/p/seq/svn/1100
Author: cn187
Date: 2020-11-08 21:58:33 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Replace compatibility/deprecated enums with Qt4 equivalents
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/editor.cpp
showeq/branches/pre_6_0_beta/src/interface.cpp
showeq/branches/pre_6_0_beta/src/map.cpp
showeq/branches/pre_6_0_beta/src/xmlconv.cpp
Modified: showeq/branches/pre_6_0_beta/src/editor.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/editor.cpp 2020-11-08 21:58:21 UTC (rev 1099)
+++ showeq/branches/pre_6_0_beta/src/editor.cpp 2020-11-08 21:58:33 UTC (rev 1100)
@@ -93,9 +93,10 @@
};
EditorWindow::EditorWindow(const char *fileName)
- : QMainWindow( 0, Qt::WDestructiveClose )
+ : QMainWindow( 0 )
{
setObjectName("ShowEQ - Editor");
+ setAttribute(Qt::WA_DeleteOnClose);
QPixmap openIcon, saveIcon;
openIcon = QPixmap( fileopen );
saveIcon = QPixmap( filesave );
Modified: showeq/branches/pre_6_0_beta/src/interface.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-08 21:58:21 UTC (rev 1099)
+++ showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-08 21:58:33 UTC (rev 1100)
@@ -148,7 +148,7 @@
m_guildListWindow(0)
{
setObjectName(name);
- setWindowFlags(Qt::WType_TopLevel);
+ setWindowFlags(Qt::Window);
setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks);
@@ -5618,24 +5618,24 @@
{
QPalette p( QColor( 75, 123, 130 ) );
qApp->setStyle("cde");
- p.setColor( QPalette::Active, QColorGroup::Base, QColor( 55, 77, 78 ) );
- p.setColor( QPalette::Inactive, QColorGroup::Base, QColor( 55, 77, 78 ) );
- p.setColor( QPalette::Disabled, QColorGroup::Base, QColor( 55, 77, 78 ) );
- p.setColor( QPalette::Active, QColorGroup::Highlight, Qt::white );
- p.setColor( QPalette::Active, QColorGroup::HighlightedText, QColor( 55, 77, 78 ) );
- p.setColor( QPalette::Inactive, QColorGroup::Highlight, Qt::white );
- p.setColor( QPalette::Inactive, QColorGroup::HighlightedText, QColor( 55, 77, 78 ) );
- p.setColor( QPalette::Disabled, QColorGroup::Highlight, Qt::white );
- p.setColor( QPalette::Disabled, QColorGroup::HighlightedText, QColor( 55, 77, 78 ) );
- p.setColor( QPalette::Active, QColorGroup::Foreground, Qt::white );
- p.setColor( QPalette::Active, QColorGroup::Text, Qt::white );
- p.setColor( QPalette::Active, QColorGroup::ButtonText, Qt::white );
- p.setColor( QPalette::Inactive, QColorGroup::Foreground, Qt::white );
- p.setColor( QPalette::Inactive, QColorGroup::Text, Qt::white );
- p.setColor( QPalette::Inactive, QColorGroup::ButtonText, Qt::white );
- p.setColor( QPalette::Disabled, QColorGroup::Foreground, Qt::lightGray );
- p.setColor( QPalette::Disabled, QColorGroup::Text, Qt::lightGray );
- p.setColor( QPalette::Disabled, QColorGroup::ButtonText, Qt::lightGray );
+ p.setColor( QPalette::Active, QPalette::Base, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Inactive, QPalette::Base, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Disabled, QPalette::Base, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Active, QPalette::Highlight, Qt::white );
+ p.setColor( QPalette::Active, QPalette::HighlightedText, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Inactive, QPalette::Highlight, Qt::white );
+ p.setColor( QPalette::Inactive, QPalette::HighlightedText, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Disabled, QPalette::Highlight, Qt::white );
+ p.setColor( QPalette::Disabled, QPalette::HighlightedText, QColor( 55, 77, 78 ) );
+ p.setColor( QPalette::Active, QPalette::Foreground, Qt::white );
+ p.setColor( QPalette::Active, QPalette::Text, Qt::white );
+ p.setColor( QPalette::Active, QPalette::ButtonText, Qt::white );
+ p.setColor( QPalette::Inactive, QPalette::Foreground, Qt::white );
+ p.setColor( QPalette::Inactive, QPalette::Text, Qt::white );
+ p.setColor( QPalette::Inactive, QPalette::ButtonText, Qt::white );
+ p.setColor( QPalette::Disabled, QPalette::Foreground, Qt::lightGray );
+ p.setColor( QPalette::Disabled, QPalette::Text, Qt::lightGray );
+ p.setColor( QPalette::Disabled, QPalette::ButtonText, Qt::lightGray );
qApp->setPalette(p);
qApp->setFont( QFont( "times", OrigFont.pointSize() ) );
}
Modified: showeq/branches/pre_6_0_beta/src/map.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.cpp 2020-11-08 21:58:21 UTC (rev 1099)
+++ showeq/branches/pre_6_0_beta/src/map.cpp 2020-11-08 21:58:33 UTC (rev 1100)
@@ -202,8 +202,8 @@
// MapLabel
MapLabel::MapLabel( Map* map )
: QLabel(map,
- Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool | Qt::WType_TopLevel
- | Qt::WType_Dialog | Qt::WX11BypassWM)
+ Qt::FramelessWindowHint | Qt::Tool | Qt::Window
+ | Qt::Dialog | Qt::X11BypassWindowManagerHint)
{
this->setObjectName("mapLabel");
m_Map = map;
Modified: showeq/branches/pre_6_0_beta/src/xmlconv.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/xmlconv.cpp 2020-11-08 21:58:21 UTC (rev 1099)
+++ showeq/branches/pre_6_0_beta/src/xmlconv.cpp 2020-11-08 21:58:33 UTC (rev 1100)
@@ -243,9 +243,9 @@
QSizePolicy sp;
if (e.hasAttribute("hsizetype"))
- sp.setHorizontalPolicy((QSizePolicy::SizeType)e.attribute("hsizetype").toInt());
+ sp.setHorizontalPolicy((QSizePolicy::Policy)e.attribute("hsizetype").toInt());
if (e.hasAttribute("vsizetype"))
- sp.setVerticalPolicy((QSizePolicy::SizeType)e.attribute("vsizetype").toInt());
+ sp.setVerticalPolicy((QSizePolicy::Policy)e.attribute("vsizetype").toInt());
if (e.hasAttribute("horstretch"))
sp.setHorizontalStretch(e.attribute("horstretch").toInt());
if (e.hasAttribute("verstretch"))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 21:58:23
|
Revision: 1099
http://sourceforge.net/p/seq/svn/1099
Author: cn187
Date: 2020-11-08 21:58:21 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Update map icon dialog UI to Qt4, switch from uic3 to uic4
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/acinclude.m4
showeq/branches/pre_6_0_beta/src/Makefile.am
showeq/branches/pre_6_0_beta/src/map.cpp
showeq/branches/pre_6_0_beta/src/mapicondialog.ui
Added Paths:
-----------
showeq/branches/pre_6_0_beta/src/mapicondialog.cpp
showeq/branches/pre_6_0_beta/src/mapicondialog.h
Removed Paths:
-------------
showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h
Modified: showeq/branches/pre_6_0_beta/acinclude.m4
===================================================================
--- showeq/branches/pre_6_0_beta/acinclude.m4 2020-11-08 21:58:11 UTC (rev 1098)
+++ showeq/branches/pre_6_0_beta/acinclude.m4 2020-11-08 21:58:21 UTC (rev 1099)
@@ -233,8 +233,7 @@
if [[ -n "$ac_qt_includes" ]]; then
AC_MSG_CHECKING([for Qt4 UIC]);
- #NOTE: we're using uic3 until we can update all of the ui files
- AC_FIND_FILE(uic3, [ $ac_qt_bindir \
+ AC_FIND_FILE(uic, [ $ac_qt_bindir \
$QTDIR/bin \
$QTDIR/src/uic \
/usr/local/qt4/bin \
@@ -257,7 +256,7 @@
UIC)
- UIC="$UIC/uic3"
+ UIC="$UIC/uic"
ac_cv_path_uic="$UIC"
if [[ -n "$ac_cv_path_uic" ]]; then
Modified: showeq/branches/pre_6_0_beta/src/Makefile.am
===================================================================
--- showeq/branches/pre_6_0_beta/src/Makefile.am 2020-11-08 21:58:11 UTC (rev 1098)
+++ showeq/branches/pre_6_0_beta/src/Makefile.am 2020-11-08 21:58:21 UTC (rev 1099)
@@ -15,20 +15,21 @@
datalocationmgr.cpp eqstr.cpp messages.cpp message.cpp messagefilter.cpp messagewindow.cpp \
messageshell.cpp terminal.cpp filteredspawnlog.cpp messagefilterdialog.cpp \
diagnosticmessages.cpp mapicon.cpp filternotifications.cpp netstream.cpp guildshell.cpp \
- guildlist.cpp bazaarlog.cpp
+ guildlist.cpp bazaarlog.cpp mapicondialog.cpp
showeq_moc_SRCS = bazaarlog.moc category.moc combatlog.moc compass.moc \
compassframe.moc datetimemgr.moc editor.moc experiencelog.moc \
filteredspawnlog.moc filtermgr.moc filternotifications.moc group.moc \
guild.moc guildlist.moc guildshell.moc interface.moc logger.moc \
- map.moc mapicon.moc messagefilter.moc messagefilterdialog.moc messages.moc \
- messageshell.moc messagewindow.moc netdiag.moc packet.moc packetinfo.moc \
- packetlog.moc packetstream.moc player.moc seqlistview.moc \
- seqwindow.moc skilllist.moc spawnlist.moc spawnlist2.moc spawnlistcommon.moc \
- spawnlog.moc spawnmonitor.moc spawnpointlist.moc spawnshell.moc spelllist.moc \
- spellshell.moc statlist.moc terminal.moc xmlpreferences.moc zonemgr.moc
+ map.moc mapicon.moc mapicondialog.moc messagefilter.moc \
+ messagefilterdialog.moc messages.moc messageshell.moc messagewindow.moc \
+ netdiag.moc packet.moc packetinfo.moc packetlog.moc packetstream.moc \
+ player.moc seqlistview.moc seqwindow.moc skilllist.moc spawnlist.moc \
+ spawnlist2.moc spawnlistcommon.moc spawnlog.moc spawnmonitor.moc \
+ spawnpointlist.moc spawnshell.moc spelllist.moc spellshell.moc statlist.moc \
+ terminal.moc xmlpreferences.moc zonemgr.moc
-nodist_showeq_SOURCES = ui_mapicondialog.h ui_mapicondialog.cpp $(showeq_moc_SRCS) m_ui_mapicondialog.cpp
+nodist_showeq_SOURCES = ui_mapicondialog.h $(showeq_moc_SRCS)
$(srcdir)/bazaarlog.cpp: bazaarlog.moc
$(srcdir)/category.cpp: category.moc
@@ -49,6 +50,7 @@
$(srcdir)/logger.cpp: logger.moc
$(srcdir)/map.cpp: map.moc
$(srcdir)/mapicon.cpp: mapicon.moc
+$(srcdir)/mapicondialog.cpp: mapicondialog.moc
$(srcdir)/messagefilter.cpp: messagefilter.moc
$(srcdir)/messagefilterdialog.cpp: messagefilterdialog.moc
$(srcdir)/messages.cpp: messages.moc
@@ -111,7 +113,7 @@
EXTRA_DIST = h2info.pl
-noinst_HEADERS = classes.h compass.h everquest.h interface.h main.h map.h filter.h vpacket.h editor.h packet.h packetcapture.h packetcommon.h packetformat.h packetstream.h packetfragment.h packetinfo.h races.h skills.h spells.h util.h experiencelog.h combatlog.h spawn.h spawnshell.h spawnlist.h spellshell.h spelllist.h languages.h weapons.h weapons1.h weapons27.h weapons28.h weapons29.h weapons2a.h weapons2b.h weapons2c.h weapons2d.h decode.h cgiconv.h skilllist.h statlist.h deity.h player.h crctab.h filtermgr.h point.h pointarray.h mapcore.h category.h compassframe.h group.h guild.h fixpt.h netdiag.h zones.h logger.h xmlconv.h xmlpreferences.h seqwindow.h seqlistview.h zonemgr.h spawnmonitor.h spawnpointlist.h typenames.h spawnlistcommon.h spawnlist2.h datetimemgr.h spawnlog.h packetlog.h datalocationmgr.h eqstr.h messages.h messagefilter.h messagewindow.h messageshell.h terminal.h filteredspawnlog.h messagefilterdialog.h diagnosticmessages.h mapicon.h mapicondialog.ui mapicondialog.ui.h filternotifications.h netstream.h guildshell.h guildlist.h bazaarlog.h message.h s_everquest.h staticspells.h
+noinst_HEADERS = classes.h compass.h everquest.h interface.h main.h map.h filter.h vpacket.h editor.h packet.h packetcapture.h packetcommon.h packetformat.h packetstream.h packetfragment.h packetinfo.h races.h skills.h spells.h util.h experiencelog.h combatlog.h spawn.h spawnshell.h spawnlist.h spellshell.h spelllist.h languages.h weapons.h weapons1.h weapons27.h weapons28.h weapons29.h weapons2a.h weapons2b.h weapons2c.h weapons2d.h decode.h cgiconv.h skilllist.h statlist.h deity.h player.h crctab.h filtermgr.h point.h pointarray.h mapcore.h category.h compassframe.h group.h guild.h fixpt.h netdiag.h zones.h logger.h xmlconv.h xmlpreferences.h seqwindow.h seqlistview.h zonemgr.h spawnmonitor.h spawnpointlist.h typenames.h spawnlistcommon.h spawnlist2.h datetimemgr.h spawnlog.h packetlog.h datalocationmgr.h eqstr.h messages.h messagefilter.h messagewindow.h messageshell.h terminal.h filteredspawnlog.h messagefilterdialog.h diagnosticmessages.h mapicon.h mapicondialog.h mapicondialog.ui filternotifications.h netstream.h guildshell.h guildlist.h bazaarlog.h message.h s_everquest.h staticspells.h
CLEANFILES = $(nodist_showeq_SOURCES)
@@ -129,10 +131,8 @@
$(srcdir)/h2info.pl $< $@
ui_%.h: %.ui
- $(UIC) -nounload $< > $@
+ $(UIC) $< > $@
-ui_%.cpp: %.ui ui_%.h
- $(UIC) -nounload -impl ui_$*.h $< > $@
if CGI
install-exec-local: $(CGI_PROGS)
Modified: showeq/branches/pre_6_0_beta/src/map.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.cpp 2020-11-08 21:58:11 UTC (rev 1098)
+++ showeq/branches/pre_6_0_beta/src/map.cpp 2020-11-08 21:58:21 UTC (rev 1099)
@@ -30,7 +30,7 @@
#include "map.h"
-#include "ui_mapicondialog.h"
+#include "mapicondialog.h"
#include "util.h"
#include "main.h"
#include "filtermgr.h"
@@ -3010,8 +3010,9 @@
if (!m_mapIconDialog)
{
// first create the dialog
- m_mapIconDialog = new MapIconDialog(this,
- QString(windowTitle() + " Icon Dialog").toAscii().data(), false);
+ m_mapIconDialog = new MapIconDialog(this);
+ m_mapIconDialog->setObjectName(
+ QString(windowTitle() + " Icon Dialog").toAscii().data());
// then pass it this objects map icons object
m_mapIconDialog->setMapIcons(m_mapIcons);
Copied: showeq/branches/pre_6_0_beta/src/mapicondialog.cpp (from rev 1098, showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h)
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapicondialog.cpp (rev 0)
+++ showeq/branches/pre_6_0_beta/src/mapicondialog.cpp 2020-11-08 21:58:21 UTC (rev 1099)
@@ -0,0 +1,466 @@
+/*
+ * mapicondialog.cpp
+ * Copyright 2001-2003 Zaphod (do...@us...).
+ * Copyright 2005, 2019-2020 by the respective ShowEQ Developers
+ *
+ * This file is part of ShowEQ.
+ * http://www.sourceforge.net/projects/seq
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "mapicondialog.h"
+#include <QPixmap>
+#include <QPainter>
+#include <QColorDialog>
+
+MapIconDialog::MapIconDialog(QWidget* parent):
+ QDialog(parent)
+{
+ setupUi(this);
+ init();
+}
+
+MapIconDialog::~MapIconDialog() {
+ destroy();
+}
+
+
+void MapIconDialog::apply()
+{
+ QPen pen;
+ QBrush brush;
+
+ // get image settings
+ m_currentMapIcon.setImage(m_useImage->isChecked());
+ m_currentMapIcon.setImageStyle(MapIconStyle(m_imageImage->currentIndex()));
+ m_currentMapIcon.setImageSize(MapIconSize(m_imageSize->currentIndex()));
+ m_currentMapIcon.setImageFlash(m_imageFlash->isChecked());
+ m_currentMapIcon.setImageUseSpawnColorPen(m_imageUseSpawnColorPen->isChecked());
+ pen = m_currentMapIcon.imagePen();
+ pen.setStyle(Qt::PenStyle(m_imagePenStyle->currentIndex()));
+ pen.setWidth(m_imagePenWidth->value());
+ m_currentMapIcon.setImagePen(pen);
+ m_currentMapIcon.setImageUseSpawnColorBrush(m_imageUseSpawnColorBrush->isChecked());
+ brush = m_currentMapIcon.imageBrush();
+ brush.setStyle(Qt::BrushStyle(m_imageBrushStyle->currentIndex()));
+ m_currentMapIcon.setImageBrush(brush);
+
+ // get highlight settings
+ m_currentMapIcon.setHighlight(m_useHighlight->isChecked());
+ m_currentMapIcon.setHighlightStyle(MapIconStyle(m_highlightImage->currentIndex()));
+ m_currentMapIcon.setHighlightSize(MapIconSize(m_highlightSize->currentIndex()));
+ m_currentMapIcon.setHighlightFlash(m_highlightFlash->isChecked());
+ m_currentMapIcon.setHighlightUseSpawnColorPen(m_highlightUseSpawnColorPen->isChecked());
+ pen = m_currentMapIcon.highlightPen();
+ pen.setStyle(Qt::PenStyle(m_highlightPenStyle->currentIndex()));
+ pen.setWidth(m_highlightPenWidth->value());
+ m_currentMapIcon.setHighlightPen(pen);
+ m_currentMapIcon.setHighlightUseSpawnColorBrush(m_highlightUseSpawnColorBrush->isChecked());
+ brush = m_currentMapIcon.highlightBrush();
+ brush.setStyle(Qt::BrushStyle(m_highlightBrushStyle->currentIndex()));
+ m_currentMapIcon.setHighlightBrush(brush);
+
+ // get line settings
+ m_currentMapIcon.setShowLine0(m_showLine0->isChecked());
+ pen = m_currentMapIcon.line0Pen();
+ pen.setStyle(Qt::PenStyle(m_line0PenStyle->currentIndex()));
+ pen.setWidth(m_line0PenWidth->value());
+ m_currentMapIcon.setLine0Pen(pen);
+ m_currentMapIcon.setLine1Distance(m_line1Distance->value());
+ pen = m_currentMapIcon.line1Pen();
+ pen.setStyle(Qt::PenStyle(m_line1PenStyle->currentIndex()));
+ pen.setWidth(m_line1PenWidth->value());
+ m_currentMapIcon.setLine1Pen(pen);
+ m_currentMapIcon.setLine2Distance(m_line2Distance->value());
+ pen = m_currentMapIcon.line2Pen();
+ pen.setStyle(Qt::PenStyle(m_line2PenStyle->currentIndex()));
+ pen.setWidth(m_line2PenWidth->value());
+ m_currentMapIcon.setLine2Pen(pen);
+
+ // get general settings
+ m_currentMapIcon.setShowName(m_showName->isChecked());
+ m_currentMapIcon.setShowWalkPath(m_showWalkPath->isChecked());
+ m_currentMapIcon.setUseWalkPathPen(m_useWalkPathPen->isChecked());
+ pen = m_currentMapIcon.walkPathPen();
+ pen.setStyle(Qt::PenStyle(m_walkPathPenStyle->currentIndex()));
+ pen.setWidth(m_walkPathPenWidth->value());
+ m_currentMapIcon.setWalkPathPen(pen);
+
+ // make sure the map icons object has been set
+ if (m_mapIcons)
+ {
+ // set the current map icon types settings
+ m_mapIcons->setIcon(m_currentMapIconType, m_currentMapIcon);
+
+ // retrieve the current map icon types settings (just to be sure)
+ m_currentMapIcon = m_mapIcons->icon(m_currentMapIconType);
+ }
+
+ // re-setup the display
+ setupMapIconDisplay();
+}
+
+void MapIconDialog::revert()
+{
+ // revert the map icon data to the last backup
+ m_currentMapIcon = m_currentMapIconBackup;
+
+ // re-setup the display
+ setupMapIconDisplay();
+}
+
+
+void MapIconDialog::init()
+{
+
+ QString temp;
+ // setup the map icons combo box
+ for (int i = tIconTypeDrop; i <= tIconTypeMax; i++)
+ m_mapIconCombo->insertItem(i-1, MapIcons::iconTypeName((MapIconType)i));
+
+ int sizeWH = m_mapIconCombo->height() - 8;
+ int size = sizeWH >> 1;
+ QPoint point(size, size);
+ // setup the image styles
+ QPixmap pix(QSize(sizeWH+1, sizeWH+1));
+ QPen pen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
+ for (int i = tIconStyleNone; i <= tIconStyleMax; i++)
+ {
+ pix.fill(Qt::white);
+ QPainter p(&pix);
+ p.setPen(pen);
+ p.setBrush(QBrush(Qt::gray));
+ MapIcon::paintIconImage(MapIconStyle(i), p, point, size, sizeWH);
+ p.end();
+
+ temp = MapIcon::iconStyleName((MapIconStyle)i);
+ m_imageImage->insertItem(i, pix, temp);
+ m_highlightImage->insertItem(i, pix, temp);
+ }
+
+ // setup the image sizes
+ for (int i = tIconSizeNone; i <= tIconSizeMax; i++)
+ {
+ temp = MapIcon::iconSizeName((MapIconSize)i);
+ m_imageSize->insertItem(i, temp);
+ m_highlightSize->insertItem(i, temp);
+ }
+
+ const QString penStyleNames[] =
+ {
+ "None",
+ "Solid",
+ "Dash",
+ "Dot",
+ "Dash Dot",
+ "Dash Dot Dot"
+ };
+
+ // setup pen style names
+ pen = QPen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
+ for (int i = Qt::NoPen; i <= Qt::DashDotDotLine; i++)
+ {
+ pix.fill(Qt::white);
+ QPainter p(&pix);
+ pen.setStyle(Qt::PenStyle(i));
+ p.setPen(pen);
+ p.setBrush(QBrush(Qt::gray));
+ p.drawLine(point.x() - size, point.y() - size,
+ point.x() + size, point.y() + size);
+ p.end();
+
+ m_imagePenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_highlightPenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_line0PenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_line1PenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_line2PenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_walkPathPenStyle->insertItem(i, pix, penStyleNames[i]);
+ }
+
+ const QString brushStyleNames[] =
+ {
+ "None",
+ "Solid",
+ "94% Fill",
+ "88% Fill",
+ "63% Fill",
+ "50% Fill",
+ "37% Fill",
+ "12% Fill",
+ "6 % Fill",
+ "Horizontal Lines",
+ "Vertical Lines",
+ "Crossing Lines",
+ "Diagonal Lines /",
+ "Diagonal Lines \\",
+ "Diagonal Cross Lines",
+ };
+
+ // setup brush style names
+ pen = QPen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
+ pen.setWidth(0);
+ for (int i = Qt::NoBrush; i <= Qt::DiagCrossPattern; i++)
+ {
+ pix.fill(Qt::white);
+ QPainter p(&pix);
+ p.setPen(pen);
+ p.setBrush(QBrush(Qt::BrushStyle(i)));
+ p.drawRect(point.x() - size, point.y() - size, sizeWH, sizeWH);
+ p.end();
+
+ m_imageBrushStyle->insertItem(i, pix, brushStyleNames[i]);
+ m_highlightBrushStyle->insertItem(i, pix, brushStyleNames[i]);
+ }
+
+ // setup the display
+ setupMapIconDisplay();
+
+}
+
+void MapIconDialog::destroy()
+{
+
+}
+
+void MapIconDialog::setMapIcons(MapIcons* mapIcons)
+{
+ // set the map icons member
+ m_mapIcons = mapIcons;
+
+ // set the current map icon type
+ m_currentMapIconType = MapIconType(m_mapIconCombo->currentIndex() + 1);
+ m_currentMapIcon = m_mapIcons->icon(m_currentMapIconType);
+ m_currentMapIconBackup = m_currentMapIcon;
+
+ // setup the map icon display
+ setupMapIconDisplay();
+}
+
+void MapIconDialog::mapIconCombo_activated( int id)
+{
+ // validate state and input
+ if (!m_mapIcons || (id >= tIconTypeMax))
+ return;
+
+ // set the current map icon
+ m_currentMapIconType = MapIconType(id + 1);
+ m_currentMapIcon = m_mapIcons->icon(m_currentMapIconType);
+ m_currentMapIconBackup = m_currentMapIcon;
+
+ // setup the display
+ setupMapIconDisplay();
+}
+
+void MapIconDialog::imagePenColor_clicked()
+{
+ QColor color = QColorDialog::getColor(m_currentMapIcon.imagePen().color(),
+ this, windowTitle() + " Image Outline");
+
+ if (color.isValid())
+ {
+ QPen pen = m_currentMapIcon.imagePen();
+ pen.setColor(color);
+ m_currentMapIcon.setImagePen(pen);
+ QPalette p = m_imagePenColorSample->palette();
+ p.setColor(m_imagePenColorSample->backgroundRole(), color);
+ m_imagePenColorSample->setPalette(p);
+ }
+}
+
+void MapIconDialog::imageBrushColor_clicked()
+{
+ QColor color = QColorDialog::getColor(m_currentMapIcon.imageBrush().color(),
+ this, windowTitle() + " Image Fill");
+
+ if (color.isValid())
+ {
+ QBrush brush = m_currentMapIcon.imageBrush();
+ brush.setColor(color);
+ m_currentMapIcon.setImageBrush(brush );
+ QPalette p = m_imageBrushColorSample->palette();
+ p.setColor(m_imageBrushColorSample->backgroundRole(), color);
+ m_imageBrushColorSample->setPalette(p);
+ }
+}
+
+void MapIconDialog::highlightPenColor_clicked()
+{
+ QColor color = QColorDialog::getColor(m_currentMapIcon.highlightPen().color(),
+ this, windowTitle() + " Highlight Outline");
+
+ if (color.isValid())
+ {
+ QPen pen = m_currentMapIcon.highlightPen();
+ pen.setColor(color);
+ m_currentMapIcon.setHighlightPen(pen);
+ QPalette p = m_highlightPenColorSample->palette();
+ p.setColor(m_highlightPenColorSample->backgroundRole(), color);
+ m_highlightPenColorSample->setPalette(p);
+ }
+}
+
+void MapIconDialog::highlightBrushColor_clicked()
+{
+ QColor color = QColorDialog::getColor(m_currentMapIcon.highlightBrush().color(),
+ this, windowTitle() + " Highlight Fill");
+
+ if (color.isValid())
+ {
+ QBrush brush = m_currentMapIcon.highlightBrush();
+ brush.setColor(color);
+ m_currentMapIcon.setHighlightBrush(brush );
+ QPalette p = m_highlightBrushColorSample->palette();
+ p.setColor(m_highlightBrushColorSample->backgroundRole(), color);
+ m_highlightBrushColorSample->setPalette(p);
+ }
+}
+
+void MapIconDialog::line0PenColor_clicked()
+{
+ QColor color = QColorDialog::getColor(m_currentMapIcon.line0Pen().color(),
+ this, windowTitle() + " Line 0");
+
+ if (color.isValid())
+ {
+ QPen pen = m_currentMapIcon.line0Pen();
+ pen.setColor(color);
+ m_currentMapIcon.setLine0Pen(pen);
+ QPalette p = m_line0PenColorSample->palette();
+ p.setColor(m_line0PenColorSample->backgroundRole(), color);
+ m_line0PenColorSample->setPalette(p);
+ }
+}
+
+void MapIconDialog::line1PenColor_clicked()
+{
+ QColor color = QColorDialog::getColor(m_currentMapIcon.line1Pen().color(),
+ this, windowTitle() + " Line 1");
+
+ if (color.isValid())
+ {
+ QPen pen = m_currentMapIcon.line1Pen();
+ pen.setColor(color);
+ m_currentMapIcon.setLine1Pen(pen);
+ QPalette p = m_line1PenColorSample->palette();
+ p.setColor(m_line1PenColorSample->backgroundRole(), color);
+ m_line1PenColorSample->setPalette(p);
+ }
+}
+
+void MapIconDialog::line2PenColor_clicked()
+{
+ QColor color = QColorDialog::getColor(m_currentMapIcon.line2Pen().color(),
+ this, windowTitle() + " Line 2");
+
+ if (color.isValid())
+ {
+ QPen pen = m_currentMapIcon.line2Pen();
+ pen.setColor(color);
+ m_currentMapIcon.setLine2Pen(pen);
+ QPalette p = m_line2PenColorSample->palette();
+ p.setColor(m_line2PenColorSample->backgroundRole(), color);
+ m_line2PenColorSample->setPalette(p);
+ }
+}
+
+void MapIconDialog::walkPathPenColor_clicked()
+{
+ QColor color = QColorDialog::getColor(m_currentMapIcon.walkPathPen().color(),
+ this, windowTitle() + " Walk Path Line");
+
+ if (color.isValid())
+ {
+ QPen pen = m_currentMapIcon.walkPathPen();
+ pen.setColor(color);
+ m_currentMapIcon.setWalkPathPen(pen);
+ QPalette p = m_walkPathPenColorSample->palette();
+ p.setColor(m_walkPathPenColorSample->backgroundRole(), color);
+ m_walkPathPenColorSample->setPalette(p);
+ }
+}
+
+void MapIconDialog::setupMapIconDisplay()
+{
+ // setup image fields
+ m_useImage->setChecked(m_currentMapIcon.image());
+ m_imageImage->setCurrentIndex(m_currentMapIcon.imageStyle());
+ m_imageSize->setCurrentIndex(m_currentMapIcon.imageSize());
+ m_imageFlash->setChecked(m_currentMapIcon.imageFlash());
+ m_imageUseSpawnColorPen->setChecked(m_currentMapIcon.imageUseSpawnColorPen());
+ QPalette p_ip = m_imagePenColorSample->palette();
+ p_ip.setColor(m_imagePenColorSample->backgroundRole(), m_currentMapIcon.imagePen().color());
+ m_imagePenColorSample->setPalette(p_ip);
+ m_imagePenStyle->setCurrentIndex(m_currentMapIcon.imagePen().style());
+ m_imagePenWidth->setValue(m_currentMapIcon.imagePen().width());
+ m_imageUseSpawnColorBrush->setChecked(m_currentMapIcon.imageUseSpawnColorBrush());
+ QPalette p_ib = m_imageBrushColorSample->palette();
+ p_ib.setColor(m_imageBrushColorSample->backgroundRole(), m_currentMapIcon.imageBrush().color());
+ m_imageBrushColorSample->setPalette(p_ib);
+
+ m_imageBrushStyle->setCurrentIndex(m_currentMapIcon.imageBrush().style());
+
+ // setup highlight fields
+ m_useHighlight->setChecked(m_currentMapIcon.highlight());
+ m_highlightImage->setCurrentIndex(m_currentMapIcon.highlightStyle());
+ m_highlightSize->setCurrentIndex(m_currentMapIcon.highlightSize());
+ m_highlightFlash->setChecked(m_currentMapIcon.highlightFlash());
+ m_highlightUseSpawnColorPen->setChecked(m_currentMapIcon.highlightUseSpawnColorPen());
+ QPalette p_hp = m_highlightPenColorSample->palette();
+ p_hp.setColor(m_highlightPenColorSample->backgroundRole(), m_currentMapIcon.highlightPen().color());
+ m_highlightPenColorSample->setPalette(p_hp);
+ m_highlightPenStyle->setCurrentIndex(m_currentMapIcon.highlightPen().style());
+ m_highlightPenWidth->setValue(m_currentMapIcon.highlightPen().width());
+ m_highlightUseSpawnColorBrush->setChecked(m_currentMapIcon.highlightUseSpawnColorBrush());
+ QPalette p_hb = m_highlightBrushColorSample->palette();
+ p_hb.setColor(m_highlightBrushColorSample->backgroundRole(), m_currentMapIcon.highlightBrush().color());
+ m_highlightBrushColorSample->setPalette(p_hb);
+ m_highlightBrushStyle->setCurrentIndex(m_currentMapIcon.highlightBrush().style());
+
+ // setup lines
+ m_showLine0->setChecked(m_currentMapIcon.showLine0());
+ QPalette p_l0 = m_line0PenColorSample->palette();
+ p_l0.setColor(m_line0PenColorSample->backgroundRole(), m_currentMapIcon.line0Pen().color());
+ m_line0PenColorSample->setPalette(p_l0);
+ m_line0PenStyle->setCurrentIndex(m_currentMapIcon.line0Pen().style());
+ m_line0PenWidth->setValue(m_currentMapIcon.line0Pen().width());
+ m_line1Distance->setValue(m_currentMapIcon.line1Distance());
+ QPalette p_l1 = m_line1PenColorSample->palette();
+ p_l1.setColor(m_line1PenColorSample->backgroundRole(), m_currentMapIcon.line1Pen().color());
+ m_line1PenColorSample->setPalette(p_l1);
+ m_line1PenStyle->setCurrentIndex(m_currentMapIcon.line1Pen().style());
+ m_line1PenWidth->setValue(m_currentMapIcon.line1Pen().width());
+ m_line2Distance->setValue(m_currentMapIcon.line2Distance());
+ QPalette p_l2 = m_line2PenColorSample->palette();
+ p_l2.setColor(m_line2PenColorSample->backgroundRole(), m_currentMapIcon.line2Pen().color());
+ m_line2PenColorSample->setPalette(p_l2);
+ m_line2PenStyle->setCurrentIndex(m_currentMapIcon.line2Pen().style());
+ m_line2PenWidth->setValue(m_currentMapIcon.line2Pen().width());
+
+ // setup other
+ m_showName->setChecked(m_currentMapIcon.showName());
+ m_showWalkPath->setChecked(m_currentMapIcon.showWalkPath());
+ m_useWalkPathPen->setChecked(m_currentMapIcon.useWalkPathPen());
+ QPalette p_wp = m_walkPathPenColorSample->palette();
+ p_wp.setColor(m_walkPathPenColorSample->backgroundRole(), m_currentMapIcon.walkPathPen().color());
+ m_walkPathPenColorSample->setPalette(p_wp);
+ m_walkPathPenStyle->setCurrentIndex(m_currentMapIcon.walkPathPen().style());
+ m_walkPathPenWidth->setValue(m_currentMapIcon.walkPathPen().width());
+}
+
+
+#ifndef QMAKEBUILD
+#include "mapicondialog.moc"
+#endif
Added: showeq/branches/pre_6_0_beta/src/mapicondialog.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapicondialog.h (rev 0)
+++ showeq/branches/pre_6_0_beta/src/mapicondialog.h 2020-11-08 21:58:21 UTC (rev 1099)
@@ -0,0 +1,62 @@
+/*
+ * mapicondialog.h
+ * Copyright 2001-2003 Zaphod (do...@us...).
+ * Copyright 2005, 2019-2020 by the respective ShowEQ Developers
+ *
+ * This file is part of ShowEQ.
+ * http://www.sourceforge.net/projects/seq
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _MAPICONDIALOG_H_
+#define _MAPICONDIALOG_H_
+
+#include "ui_mapicondialog.h"
+
+class MapIconDialog : public QDialog, protected Ui::MapIconDialog
+{
+ Q_OBJECT
+
+ public:
+ MapIconDialog(QWidget* parent = 0);
+ ~MapIconDialog();
+
+ public slots:
+ virtual void apply();
+ virtual void revert();
+ virtual void init();
+ virtual void destroy();
+ virtual void setMapIcons( MapIcons * mapIcons );
+ virtual void mapIconCombo_activated( int id );
+ virtual void imagePenColor_clicked();
+ virtual void imageBrushColor_clicked();
+ virtual void highlightPenColor_clicked();
+ virtual void highlightBrushColor_clicked();
+ virtual void line0PenColor_clicked();
+ virtual void line1PenColor_clicked();
+ virtual void line2PenColor_clicked();
+ virtual void walkPathPenColor_clicked();
+ virtual void setupMapIconDisplay();
+
+ protected:
+ MapIcons* m_mapIcons;
+ MapIcon m_currentMapIcon;
+ MapIcon m_currentMapIconBackup;
+ MapIconType m_currentMapIconType;
+
+};
+
+#endif // end _MAPICONDIALOG_H_
Property changes on: showeq/branches/pre_6_0_beta/src/mapicondialog.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: showeq/branches/pre_6_0_beta/src/mapicondialog.ui
===================================================================
(Binary files differ)
Deleted: showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h 2020-11-08 21:58:11 UTC (rev 1098)
+++ showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h 2020-11-08 21:58:21 UTC (rev 1099)
@@ -1,455 +0,0 @@
-/*
- * mapicondialog.ui.h
- * Copyright 2001-2003 Zaphod (do...@us...).
- * Copyright 2005, 2019 by the respective ShowEQ Developers
- *
- * This file is part of ShowEQ.
- * http://www.sourceforge.net/projects/seq
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <QPixmap>
-
-/****************************************************************************
-** ui.h extension file, included from the uic-generated form implementation.
-**
-** If you wish to add, delete or rename functions or slots use
-** Qt Designer which will update this file, preserving your code. Create an
-** init() function in place of a constructor, and a destroy() function in
-** place of a destructor.
-*****************************************************************************/
-
-
-void MapIconDialog::apply()
-{
- QPen pen;
- QBrush brush;
-
- // get image settings
- m_currentMapIcon.setImage(m_useImage->isChecked());
- m_currentMapIcon.setImageStyle(MapIconStyle(m_imageImage->currentIndex()));
- m_currentMapIcon.setImageSize(MapIconSize(m_imageSize->currentIndex()));
- m_currentMapIcon.setImageFlash(m_imageFlash->isChecked());
- m_currentMapIcon.setImageUseSpawnColorPen(m_imageUseSpawnColorPen->isChecked());
- pen = m_currentMapIcon.imagePen();
- pen.setStyle(Qt::PenStyle(m_imagePenStyle->currentIndex()));
- pen.setWidth(m_imagePenWidth->value());
- m_currentMapIcon.setImagePen(pen);
- m_currentMapIcon.setImageUseSpawnColorBrush(m_imageUseSpawnColorBrush->isChecked());
- brush = m_currentMapIcon.imageBrush();
- brush.setStyle(Qt::BrushStyle(m_imageBrushStyle->currentIndex()));
- m_currentMapIcon.setImageBrush(brush);
-
- // get highlight settings
- m_currentMapIcon.setHighlight(m_useHighlight->isChecked());
- m_currentMapIcon.setHighlightStyle(MapIconStyle(m_highlightImage->currentIndex()));
- m_currentMapIcon.setHighlightSize(MapIconSize(m_highlightSize->currentIndex()));
- m_currentMapIcon.setHighlightFlash(m_highlightFlash->isChecked());
- m_currentMapIcon.setHighlightUseSpawnColorPen(m_highlightUseSpawnColorPen->isChecked());
- pen = m_currentMapIcon.highlightPen();
- pen.setStyle(Qt::PenStyle(m_highlightPenStyle->currentIndex()));
- pen.setWidth(m_highlightPenWidth->value());
- m_currentMapIcon.setHighlightPen(pen);
- m_currentMapIcon.setHighlightUseSpawnColorBrush(m_highlightUseSpawnColorBrush->isChecked());
- brush = m_currentMapIcon.highlightBrush();
- brush.setStyle(Qt::BrushStyle(m_highlightBrushStyle->currentIndex()));
- m_currentMapIcon.setHighlightBrush(brush);
-
- // get line settings
- m_currentMapIcon.setShowLine0(m_showLine0->isChecked());
- pen = m_currentMapIcon.line0Pen();
- pen.setStyle(Qt::PenStyle(m_line0PenStyle->currentIndex()));
- pen.setWidth(m_line0PenWidth->value());
- m_currentMapIcon.setLine0Pen(pen);
- m_currentMapIcon.setLine1Distance(m_line1Distance->value());
- pen = m_currentMapIcon.line1Pen();
- pen.setStyle(Qt::PenStyle(m_line1PenStyle->currentIndex()));
- pen.setWidth(m_line1PenWidth->value());
- m_currentMapIcon.setLine1Pen(pen);
- m_currentMapIcon.setLine2Distance(m_line2Distance->value());
- pen = m_currentMapIcon.line2Pen();
- pen.setStyle(Qt::PenStyle(m_line2PenStyle->currentIndex()));
- pen.setWidth(m_line2PenWidth->value());
- m_currentMapIcon.setLine2Pen(pen);
-
- // get general settings
- m_currentMapIcon.setShowName(m_showName->isChecked());
- m_currentMapIcon.setShowWalkPath(m_showWalkPath->isChecked());
- m_currentMapIcon.setUseWalkPathPen(m_useWalkPathPen->isChecked());
- pen = m_currentMapIcon.walkPathPen();
- pen.setStyle(Qt::PenStyle(m_walkPathPenStyle->currentIndex()));
- pen.setWidth(m_walkPathPenWidth->value());
- m_currentMapIcon.setWalkPathPen(pen);
-
- // make sure the map icons object has been set
- if (m_mapIcons)
- {
- // set the current map icon types settings
- m_mapIcons->setIcon(m_currentMapIconType, m_currentMapIcon);
-
- // retrieve the current map icon types settings (just to be sure)
- m_currentMapIcon = m_mapIcons->icon(m_currentMapIconType);
- }
-
- // re-setup the display
- setupMapIconDisplay();
-}
-
-void MapIconDialog::revert()
-{
- // revert the map icon data to the last backup
- m_currentMapIcon = m_currentMapIconBackup;
-
- // re-setup the display
- setupMapIconDisplay();
-}
-
-
-void MapIconDialog::init()
-{
-
- QString temp;
- // setup the map icons combo box
- for (int i = tIconTypeDrop; i <= tIconTypeMax; i++)
- m_mapIconCombo->insertItem(i-1, MapIcons::iconTypeName((MapIconType)i));
-
- int sizeWH = m_mapIconCombo->height() - 8;
- int size = sizeWH >> 1;
- QPoint point(size, size);
- // setup the image styles
- QPixmap pix(QSize(sizeWH+1, sizeWH+1));
- QPen pen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
- for (int i = tIconStyleNone; i <= tIconStyleMax; i++)
- {
- pix.fill(Qt::white);
- QPainter p(&pix);
- p.setPen(pen);
- p.setBrush(QBrush(Qt::gray));
- MapIcon::paintIconImage(MapIconStyle(i), p, point, size, sizeWH);
- p.end();
-
- temp = MapIcon::iconStyleName((MapIconStyle)i);
- m_imageImage->insertItem(i, pix, temp);
- m_highlightImage->insertItem(i, pix, temp);
- }
-
- // setup the image sizes
- for (int i = tIconSizeNone; i <= tIconSizeMax; i++)
- {
- temp = MapIcon::iconSizeName((MapIconSize)i);
- m_imageSize->insertItem(i, temp);
- m_highlightSize->insertItem(i, temp);
- }
-
- const QString penStyleNames[] =
- {
- "None",
- "Solid",
- "Dash",
- "Dot",
- "Dash Dot",
- "Dash Dot Dot"
- };
-
- // setup pen style names
- pen = QPen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
- for (int i = Qt::NoPen; i <= Qt::DashDotDotLine; i++)
- {
- pix.fill(Qt::white);
- QPainter p(&pix);
- pen.setStyle(Qt::PenStyle(i));
- p.setPen(pen);
- p.setBrush(QBrush(Qt::gray));
- p.drawLine(point.x() - size, point.y() - size,
- point.x() + size, point.y() + size);
- p.end();
-
- m_imagePenStyle->insertItem(i, pix, penStyleNames[i]);
- m_highlightPenStyle->insertItem(i, pix, penStyleNames[i]);
- m_line0PenStyle->insertItem(i, pix, penStyleNames[i]);
- m_line1PenStyle->insertItem(i, pix, penStyleNames[i]);
- m_line2PenStyle->insertItem(i, pix, penStyleNames[i]);
- m_walkPathPenStyle->insertItem(i, pix, penStyleNames[i]);
- }
-
- const QString brushStyleNames[] =
- {
- "None",
- "Solid",
- "94% Fill",
- "88% Fill",
- "63% Fill",
- "50% Fill",
- "37% Fill",
- "12% Fill",
- "6 % Fill",
- "Horizontal Lines",
- "Vertical Lines",
- "Crossing Lines",
- "Diagonal Lines /",
- "Diagonal Lines \\",
- "Diagonal Cross Lines",
- };
-
- // setup brush style names
- pen = QPen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
- pen.setWidth(0);
- for (int i = Qt::NoBrush; i <= Qt::DiagCrossPattern; i++)
- {
- pix.fill(Qt::white);
- QPainter p(&pix);
- p.setPen(pen);
- p.setBrush(QBrush(Qt::BrushStyle(i)));
- p.drawRect(point.x() - size, point.y() - size, sizeWH, sizeWH);
- p.end();
-
- m_imageBrushStyle->insertItem(i, pix, brushStyleNames[i]);
- m_highlightBrushStyle->insertItem(i, pix, brushStyleNames[i]);
- }
-
- // setup the display
- setupMapIconDisplay();
-}
-
-void MapIconDialog::destroy()
-{
-
-}
-
-void MapIconDialog::setMapIcons(MapIcons* mapIcons)
-{
- // set the map icons member
- m_mapIcons = mapIcons;
-
- // set the current map icon type
- m_currentMapIconType = MapIconType(m_mapIconCombo->currentIndex() + 1);
- m_currentMapIcon = m_mapIcons->icon(m_currentMapIconType);
- m_currentMapIconBackup = m_currentMapIcon;
-
- // setup the map icon display
- setupMapIconDisplay();
-}
-
-void MapIconDialog::mapIconCombo_activated( int id)
-{
- // validate state and input
- if (!m_mapIcons || (id >= tIconTypeMax))
- return;
-
- // set the current map icon
- m_currentMapIconType = MapIconType(id + 1);
- m_currentMapIcon = m_mapIcons->icon(m_currentMapIconType);
- m_currentMapIconBackup = m_currentMapIcon;
-
- // setup the display
- setupMapIconDisplay();
-}
-
-void MapIconDialog::imagePenColor_clicked()
-{
- QColor color = QColorDialog::getColor(m_currentMapIcon.imagePen().color(),
- this, windowTitle() + " Image Outline");
-
- if (color.isValid())
- {
- QPen pen = m_currentMapIcon.imagePen();
- pen.setColor(color);
- m_currentMapIcon.setImagePen(pen);
- QPalette p = m_imagePenColorSample->palette();
- p.setColor(m_imagePenColorSample->backgroundRole(), color);
- m_imagePenColorSample->setPalette(p);
- }
-}
-
-void MapIconDialog::imageBrushColor_clicked()
-{
- QColor color = QColorDialog::getColor(m_currentMapIcon.imageBrush().color(),
- this, windowTitle() + " Image Fill");
-
- if (color.isValid())
- {
- QBrush brush = m_currentMapIcon.imageBrush();
- brush.setColor(color);
- m_currentMapIcon.setImageBrush(brush );
- QPalette p = m_imageBrushColorSample->palette();
- p.setColor(m_imageBrushColorSample->backgroundRole(), color);
- m_imageBrushColorSample->setPalette(p);
- }
-}
-
-void MapIconDialog::highlightPenColor_clicked()
-{
- QColor color = QColorDialog::getColor(m_currentMapIcon.highlightPen().color(),
- this, windowTitle() + " Highlight Outline");
-
- if (color.isValid())
- {
- QPen pen = m_currentMapIcon.highlightPen();
- pen.setColor(color);
- m_currentMapIcon.setHighlightPen(pen);
- QPalette p = m_highlightPenColorSample->palette();
- p.setColor(m_highlightPenColorSample->backgroundRole(), color);
- m_highlightPenColorSample->setPalette(p);
- }
-}
-
-void MapIconDialog::highlightBrushColor_clicked()
-{
- QColor color = QColorDialog::getColor(m_currentMapIcon.highlightBrush().color(),
- this, windowTitle() + " Highlight Fill");
-
- if (color.isValid())
- {
- QBrush brush = m_currentMapIcon.highlightBrush();
- brush.setColor(color);
- m_currentMapIcon.setHighlightBrush(brush );
- QPalette p = m_highlightBrushColorSample->palette();
- p.setColor(m_highlightBrushColorSample->backgroundRole(), color);
- m_highlightBrushColorSample->setPalette(p);
- }
-}
-
-void MapIconDialog::line0PenColor_clicked()
-{
- QColor color = QColorDialog::getColor(m_currentMapIcon.line0Pen().color(),
- this, windowTitle() + " Line 0");
-
- if (color.isValid())
- {
- QPen pen = m_currentMapIcon.line0Pen();
- pen.setColor(color);
- m_currentMapIcon.setLine0Pen(pen);
- QPalette p = m_line0PenColorSample->palette();
- p.setColor(m_line0PenColorSample->backgroundRole(), color);
- m_line0PenColorSample->setPalette(p);
- }
-}
-
-void MapIconDialog::line1PenColor_clicked()
-{
- QColor color = QColorDialog::getColor(m_currentMapIcon.line1Pen().color(),
- this, windowTitle() + " Line 1");
-
- if (color.isValid())
- {
- QPen pen = m_currentMapIcon.line1Pen();
- pen.setColor(color);
- m_currentMapIcon.setLine1Pen(pen);
- QPalette p = m_line1PenColorSample->palette();
- p.setColor(m_line1PenColorSample->backgroundRole(), color);
- m_line1PenColorSample->setPalette(p);
- }
-}
-
-void MapIconDialog::line2PenColor_clicked()
-{
- QColor color = QColorDialog::getColor(m_currentMapIcon.line2Pen().color(),
- this, windowTitle() + " Line 2");
-
- if (color.isValid())
- {
- QPen pen = m_currentMapIcon.line2Pen();
- pen.setColor(color);
- m_currentMapIcon.setLine2Pen(pen);
- QPalette p = m_line2PenColorSample->palette();
- p.setColor(m_line2PenColorSample->backgroundRole(), color);
- m_line2PenColorSample->setPalette(p);
- }
-}
-
-void MapIconDialog::walkPathPenColor_clicked()
-{
- QColor color = QColorDialog::getColor(m_currentMapIcon.walkPathPen().color(),
- this, windowTitle() + " Walk Path Line");
-
- if (color.isValid())
- {
- QPen pen = m_currentMapIcon.walkPathPen();
- pen.setColor(color);
- m_currentMapIcon.setWalkPathPen(pen);
- QPalette p = m_walkPathPenColorSample->palette();
- p.setColor(m_walkPathPenColorSample->backgroundRole(), color);
- m_walkPathPenColorSample->setPalette(p);
- }
-}
-
-void MapIconDialog::setupMapIconDisplay()
-{
- // setup image fields
- m_useImage->setChecked(m_currentMapIcon.image());
- m_imageImage->setCurrentIndex(m_currentMapIcon.imageStyle());
- m_imageSize->setCurrentIndex(m_currentMapIcon.imageSize());
- m_imageFlash->setChecked(m_currentMapIcon.imageFlash());
- m_imageUseSpawnColorPen->setChecked(m_currentMapIcon.imageUseSpawnColorPen());
- QPalette p_ip = m_imagePenColorSample->palette();
- p_ip.setColor(m_imagePenColorSample->backgroundRole(), m_currentMapIcon.imagePen().color());
- m_imagePenColorSample->setPalette(p_ip);
- m_imagePenStyle->setCurrentIndex(m_currentMapIcon.imagePen().style());
- m_imagePenWidth->setValue(m_currentMapIcon.imagePen().width());
- m_imageUseSpawnColorBrush->setChecked(m_currentMapIcon.imageUseSpawnColorBrush());
- QPalette p_ib = m_imageBrushColorSample->palette();
- p_ib.setColor(m_imageBrushColorSample->backgroundRole(), m_currentMapIcon.imageBrush().color());
- m_imageBrushColorSample->setPalette(p_ib);
-
- m_imageBrushStyle->setCurrentIndex(m_currentMapIcon.imageBrush().style());
-
- // setup highlight fields
- m_useHighlight->setChecked(m_currentMapIcon.highlight());
- m_highlightImage->setCurrentIndex(m_currentMapIcon.highlightStyle());
- m_highlightSize->setCurrentIndex(m_currentMapIcon.highlightSize());
- m_highlightFlash->setChecked(m_currentMapIcon.highlightFlash());
- m_highlightUseSpawnColorPen->setChecked(m_currentMapIcon.highlightUseSpawnColorPen());
- QPalette p_hp = m_highlightPenColorSample->palette();
- p_ib.setColor(m_highlightPenColorSample->backgroundRole(), m_currentMapIcon.highlightPen().color());
- m_highlightPenColorSample->setPalette(p_ib);
- m_highlightPenStyle->setCurrentIndex(m_currentMapIcon.highlightPen().style());
- m_highlightPenWidth->setValue(m_currentMapIcon.highlightPen().width());
- m_highlightUseSpawnColorBrush->setChecked(m_currentMapIcon.highlightUseSpawnColorBrush());
- QPalette p_hb = m_highlightBrushColorSample->palette();
- p_hb.setColor(m_highlightBrushColorSample->backgroundRole(), m_currentMapIcon.highlightBrush().color());
- m_highlightBrushColorSample->setPalette(p_hb);
- m_highlightBrushStyle->setCurrentIndex(m_currentMapIcon.highlightBrush().style());
-
- // setup lines
- m_showLine0->setChecked(m_currentMapIcon.showLine0());
- QPalette p_l0 = m_line0PenColorSample->palette();
- p_l0.setColor(m_line0PenColorSample->backgroundRole(), m_currentMapIcon.line0Pen().color());
- m_line0PenColorSample->setPalette(p_l0);
- m_line0PenStyle->setCurrentIndex(m_currentMapIcon.line0Pen().style());
- m_line0PenWidth->setValue(m_currentMapIcon.line0Pen().width());
- m_line1Distance->setValue(m_currentMapIcon.line1Distance());
- QPalette p_l1 = m_line1PenColorSample->palette();
- p_l1.setColor(m_line1PenColorSample->backgroundRole(), m_currentMapIcon.line1Pen().color());
- m_line1PenColorSample->setPalette(p_l1);
- m_line1PenStyle->setCurrentIndex(m_currentMapIcon.line1Pen().style());
- m_line1PenWidth->setValue(m_currentMapIcon.line1Pen().width());
- m_line2Distance->setValue(m_currentMapIcon.line2Distance());
- QPalette p_l2 = m_line2PenColorSample->palette();
- p_l2.setColor(m_line2PenColorSample->backgroundRole(), m_currentMapIcon.line2Pen().color());
- m_line2PenColorSample->setPalette(p_l2);
- m_line2PenStyle->setCurrentIndex(m_currentMapIcon.line2Pen().style());
- m_line2PenWidth->setValue(m_currentMapIcon.line2Pen().width());
-
- // setup other
- m_showName->setChecked(m_currentMapIcon.showName());
- m_showWalkPath->setChecked(m_currentMapIcon.showWalkPath());
- m_useWalkPathPen->setChecked(m_currentMapIcon.useWalkPathPen());
- QPalette p_wp = m_walkPathPenColorSample->palette();
- p_wp.setColor(m_walkPathPenColorSample->backgroundRole(), m_currentMapIcon.walkPathPen().color());
- m_walkPathPenColorSample->setPalette(p_wp);
- m_walkPathPenStyle->setCurrentIndex(m_currentMapIcon.walkPathPen().style());
- m_walkPathPenWidth->setValue(m_currentMapIcon.walkPathPen().width());
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 21:58:13
|
Revision: 1098
http://sourceforge.net/p/seq/svn/1098
Author: cn187
Date: 2020-11-08 21:58:11 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Set default dock state of SpawnPointList to be consistent with other default windows
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/conf/seqdef.xml
Modified: showeq/branches/pre_6_0_beta/conf/seqdef.xml
===================================================================
--- showeq/branches/pre_6_0_beta/conf/seqdef.xml 2020-11-08 21:58:00 UTC (rev 1097)
+++ showeq/branches/pre_6_0_beta/conf/seqdef.xml 2020-11-08 21:58:11 UTC (rev 1098)
@@ -2440,6 +2440,10 @@
<bool value="true" />
<comment>Dock Spawn List</comment>
</property>
+ <property name="DockedSpawnPoint" >
+ <bool value="true" />
+ <comment>Dock Spawn Point List</comment>
+ </property>
<property name="DockedSpellList" >
<bool value="true" />
<comment>Dock Spell List</comment>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 21:58:03
|
Revision: 1097
http://sourceforge.net/p/seq/svn/1097
Author: cn187
Date: 2020-11-08 21:58:00 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Replace Q3MainWindow/Q3DockArea/Q3DockWindow with QMainWindow/QDockWidget
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/combatlog.cpp
showeq/branches/pre_6_0_beta/src/experiencelog.cpp
showeq/branches/pre_6_0_beta/src/guildlist.cpp
showeq/branches/pre_6_0_beta/src/interface.cpp
showeq/branches/pre_6_0_beta/src/interface.h
showeq/branches/pre_6_0_beta/src/seqwindow.cpp
showeq/branches/pre_6_0_beta/src/seqwindow.h
Modified: showeq/branches/pre_6_0_beta/src/combatlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-08 21:57:35 UTC (rev 1096)
+++ showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-08 21:58:00 UTC (rev 1097)
@@ -255,6 +255,10 @@
m_dDPS(0.0),
m_dDPSLast(0.0)
{
+
+ if (!name)
+ setObjectName("Combat");
+
/* Hopefully this is only called once to set up the window,
so this is a good place to initialize some things which
otherwise won't be. */
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-08 21:57:35 UTC (rev 1096)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-08 21:58:00 UTC (rev 1097)
@@ -167,6 +167,9 @@
m_group(groupMgr),
m_zoneMgr(zoneMgr)
{
+ if (!name)
+ setObjectName("Experience");
+
/* Hopefully this is only called once to set up the window,
so this is a good place to initialize some things which
otherwise won't be. */
Modified: showeq/branches/pre_6_0_beta/src/guildlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/guildlist.cpp 2020-11-08 21:57:35 UTC (rev 1096)
+++ showeq/branches/pre_6_0_beta/src/guildlist.cpp 2020-11-08 21:58:00 UTC (rev 1097)
@@ -163,8 +163,8 @@
// Guild Name
m_guildName = new QLabel("Guild", this);
m_guildName->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
- m_guildName->setFrameShape(LineEditPanel);
- m_guildName->setFrameShadow(Sunken);
+ m_guildName->setFrameShape(QFrame::StyledPanel);
+ m_guildName->setFrameShadow(QFrame::Sunken);
m_guildName->setMinimumWidth(50);
m_guildName->setMaximumWidth(300);
hLayout->addWidget(m_guildName, 1, Qt::AlignLeft);
@@ -173,8 +173,8 @@
// Guild Totals
m_guildTotals = new QLabel("", this);
m_guildTotals->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
- m_guildTotals->setFrameShape(LineEditPanel);
- m_guildTotals->setFrameShadow(Sunken);
+ m_guildTotals->setFrameShape(QFrame::StyledPanel);
+ m_guildTotals->setFrameShadow(QFrame::Sunken);
m_guildTotals->setMinimumWidth(30);
m_guildTotals->setMaximumWidth(120);
hLayout->addWidget(m_guildTotals, 0, Qt::AlignRight);
Modified: showeq/branches/pre_6_0_beta/src/interface.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-08 21:57:35 UTC (rev 1096)
+++ showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-08 21:58:00 UTC (rev 1097)
@@ -88,7 +88,6 @@
#include <QInputDialog>
#include <QFontDialog>
#include <QColorDialog>
-#include <Q3DockArea>
#include <QWindowsStyle>
#include <QPlastiqueStyle>
#include <QMotifStyle>
@@ -96,6 +95,7 @@
#include <QCleanlooksStyle>
#include <QMenu>
#include <QWidgetAction>
+#include <QDesktopWidget>
// this define is used to diagnose the order with which zone packets are rcvd
#define ZONE_ORDER_DIAG
@@ -103,7 +103,7 @@
/* The main interface widget */
EQInterface::EQInterface(DataLocationMgr* dlm,
QWidget * parent, const char *name)
- : Q3MainWindow (parent, nullptr, Qt::WType_TopLevel),
+ : QMainWindow (parent),
m_player(0),
m_dataLocationMgr(dlm),
m_mapMgr(0),
@@ -148,12 +148,10 @@
m_guildListWindow(0)
{
setObjectName(name);
+ setWindowFlags(Qt::WType_TopLevel);
- // disable the dock menu
- setDockMenuEnabled(false);
+ setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks);
- setCentralWidget(new QWidget(this));
-
QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
sizePolicy.setHeightForWidth(false);
setSizePolicy(sizePolicy);
@@ -361,51 +359,47 @@
// Initialize the experience window;
m_expWindow = new ExperienceWindow(m_dataLocationMgr, m_player, m_groupMgr,
- m_zoneMgr);
- setDockEnabled(m_expWindow,
- pSEQPrefs->getPrefBool("DockableExperienceWindow",
- section, false));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_expWindow->preferenceName(),
- Qt::DockUnmanaged);
- addDockWindow(m_expWindow, edge, false);
- m_expWindow->undock();
+ m_zoneMgr, this);
+ setDockEnabled(m_expWindow,
+ pSEQPrefs->getPrefBool("DockableExperienceWindow", section, false));
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_expWindow->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_expWindow);
+ m_expWindow->setFloating(true);
- m_expWindow->restoreSize();
-
- // move window to new position
- if (pSEQPrefs->getPrefBool("UseWindowPos", section, true))
- m_expWindow->restorePosition();
-
if (pSEQPrefs->getPrefBool("ShowExpWindow", section, false))
+ {
m_expWindow->show();
+ insertWindowMenu(m_expWindow);
+ }
+ else
+ {
+ m_expWindow->hide();
+ removeWindowMenu(m_expWindow);
+ }
- // insert its menu into the window menu
- insertWindowMenu(m_expWindow);
+
// Initialize the combat window
- m_combatWindow = new CombatWindow(m_player);
- setDockEnabled(m_combatWindow,
- pSEQPrefs->getPrefBool("DockableCombatWindow",
- section, false));
- edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_combatWindow->preferenceName(),
- Qt::DockUnmanaged);
- addDockWindow(m_combatWindow, edge, false);
- m_combatWindow->undock();
+ m_combatWindow = new CombatWindow(m_player, this);
+ setDockEnabled(m_combatWindow,
+ pSEQPrefs->getPrefBool("DockableCombatWindow", section, false));
+ edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_combatWindow->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_combatWindow);
+ m_combatWindow->setFloating(true);
- m_combatWindow->restoreSize();
-
- // move window to new position
- if (pSEQPrefs->getPrefBool("UseWindowPos", "Interface", true))
- m_combatWindow->restorePosition();
-
if (pSEQPrefs->getPrefBool("ShowCombatWindow", section, false))
+ {
m_combatWindow->show();
+ insertWindowMenu(m_combatWindow);
+ }
+ else
+ {
+ m_combatWindow->hide();
+ removeWindowMenu(m_combatWindow);
+ }
- // insert its menu into the window menu
- insertWindowMenu(m_combatWindow);
-
/////////////////
// Main widgets
// Make a VBox to use as central widget
@@ -500,7 +494,7 @@
//
// Create the Spawn List listview (always exists, just hidden if not specified)
//
- m_isSpawnPointListDocked = pSEQPrefs->getPrefBool("DockedSpawnPointList", section, false);
+ m_isSpawnPointListDocked = pSEQPrefs->getPrefBool("DockedSpawnPointList", section, true);
if (pSEQPrefs->getPrefBool("ShowSpawnPointList", section, false))
showSpawnPointList();
@@ -2449,13 +2443,10 @@
m_combatWindow, SLOT(savePrefs(void)));
}
-
+
//
// Geometry Configuration
//
-
- QSize s;
- QPoint p;
// interface components
@@ -2462,34 +2453,45 @@
// set mainwindow Geometry
section = "Interface";
- s = pSEQPrefs->getPrefSize("WindowSize", section, size());
- resize(s);
- if (pSEQPrefs->getPrefBool("UseWindowPos", section, true))
+
+ // The way window/dock state was saved with Qt3 won't work with Qt4+, so
+ // we use the Qt-provided functions instead. Unforunately, that means the
+ // size/position preferences saved in the Qt3 version won't be usable, and
+ // the users will have to redo their window/dock size/placement.
+ QString dockPrefsState = pSEQPrefs->getPrefString("DockingInfoState",
+ section, QString());
+ QString dockPrefsGeometry = pSEQPrefs->getPrefString("DockingInfoGeometry",
+ section, QString());
+
+ bool usePos = pSEQPrefs->getPrefBool("UseWindowPos", section, true);
+ if (usePos)
{
- p = pSEQPrefs->getPrefPoint("WindowPos", section, pos());
- move(p);
+ if (!restoreGeometry(QByteArray::fromBase64(dockPrefsGeometry.toAscii())))
+ seqWarn("Could not restore dock/window geometry. Rearrange windows "
+ "as desired and then re-save preferences");
+ else
+ // work around QTBUG-46620
+ if (isMaximized())
+ setGeometry(QApplication::desktop()->availableGeometry(this));
+
+ if (!restoreState(QByteArray::fromBase64(dockPrefsState.toAscii())))
+ seqWarn("Could not restore dock/window state. Rearrange windows as"
+ " desired and then re-save prefrences");
}
- show();
new QShortcut(Qt::CTRL+Qt::ALT+Qt::Key_S, this, SLOT(toggle_view_statusbar()));
new QShortcut(Qt::CTRL+Qt::ALT+Qt::Key_T, this, SLOT(toggle_view_menubar()));
- // load in the docking preferences if any have been saved
- QString dockPrefs = pSEQPrefs->getPrefString("DockingInfo", section,
- QString());
- if (!dockPrefs.isEmpty())
- {
- QTextStream ts(&dockPrefs, QIODevice::ReadOnly);
- ts >> *this;
- }
-
// Set main window title
// TODO: Add % replacement values and a signal to update, for ip address currently
// TODO: being monitored.
- Q3MainWindow::setWindowTitle(pSEQPrefs->getPrefString("Caption", section,
- "ShowEQ - Main (ctrl+alt+t to toggle menubar)"));
+ QMainWindow::setWindowTitle(pSEQPrefs->getPrefString("Caption", section,
+ "ShowEQ - Main (ctrl+alt+t to toggle menubar)"));
+ show();
+
+
// load the format strings for display
loadFormatStrings();
@@ -2772,13 +2774,9 @@
// attempt to undock the window
if (widget)
{
- if (docked)
- widget->dock();
- else
- {
- widget->undock();
+ widget->setFloating(!docked);
+ if (!docked)
widget->activateWindow();
- }
// make the widget update it's geometry
widget->updateGeometry();
@@ -3301,52 +3299,32 @@
EQInterface::savePrefs(void)
{
seqDebug("==> EQInterface::savePrefs()");
-
- if( isVisible() )
+
+ QString section = "Interface";
+ bool savePos = pSEQPrefs->getPrefBool("SavePosition", section, true);
+
+ if( isVisible() && savePos)
{
seqDebug("\tisVisible()");
- QString section;
- QString interfaceSection = "Interface";
- QString tempStr;
- QString dockPrefs;
- QTextStream ts(&dockPrefs, QIODevice::WriteOnly);
+ QString dockPrefsState = saveState().toBase64();
+ pSEQPrefs->setPrefString("DockingInfoState", section, dockPrefsState);
- ts << *this;
+ QString dockPrefsGeometry = saveGeometry().toBase64();
+ pSEQPrefs->setPrefString("DockingInfoGeometry", section, dockPrefsGeometry);
- pSEQPrefs->setPrefString("DockingInfo", interfaceSection, dockPrefs);
-
// send savePrefs signal out
emit saveAllPrefs();
-
- section = "Interface";
- if (pSEQPrefs->getPrefBool("SavePosition", interfaceSection, true))
- {
- pSEQPrefs->setPrefPoint("WindowPos", section,
- topLevelWidget()->pos());
- pSEQPrefs->setPrefSize("WindowSize", section,
- topLevelWidget()->size());
- }
-
+
// save prefs to file
pSEQPrefs->save();
}
} // end savePrefs
-void EQInterface::saveDockAreaPrefs(Q3DockArea* a, Qt::ToolBarDock edge)
-{
- QList<Q3DockWindow*> l = a->dockWindowList();
- for (QList<Q3DockWindow*>::iterator dw = l.begin(); dw != l.end(); ++dw)
- {
- if ((*dw)->inherits("SEQWindow"))
- pSEQPrefs->setPrefInt("Dock", ((SEQWindow*)(*dw))->preferenceName(), edge);
- }
-}
-
void EQInterface::setCaption(const QString& text)
{
- Q3MainWindow::setWindowTitle(text);
+ QMainWindow::setWindowTitle(text);
pSEQPrefs->setPrefString("Caption", "Interface", windowTitle());
}
@@ -3529,9 +3507,14 @@
void EQInterface::listInterfaceInfo(void)
{
#ifdef DEBUG
- qDebug ("listMapInfo()");
+ qDebug ("listInterfaceInfo()");
#endif /* DEBUG */
+ //FIXME - writing directly from the main interface no longer works with QT4.
+ //it may be possible to extract the info from saveState and saveGeometry, or
+ //it may be necessary to enumerate each window and get the layout
+ //info individually
+
QString outText;
// open the output data stream
@@ -3539,10 +3522,10 @@
out << "Map window layout info:" << endl;
out << "-----------------------" << endl;
- out << *this;
+ //FIXME out << *this;
+ out << "FIXME" << endl;
out << "-----------------------" << endl;
-
seqInfo(outText.toAscii().data());
}
@@ -3992,9 +3975,15 @@
void EQInterface::toggle_view_ExpWindow ()
{
if (!m_expWindow->isVisible())
+ {
m_expWindow->show();
+ insertWindowMenu(m_expWindow);
+ }
else
+ {
m_expWindow->hide();
+ removeWindowMenu(m_expWindow);
+ }
pSEQPrefs->setPrefBool("ShowExpWindow", "Interface",
m_expWindow->isVisible());
@@ -4003,9 +3992,15 @@
void EQInterface::toggle_view_CombatWindow (void)
{
if (!m_combatWindow->isVisible())
+ {
m_combatWindow->show();
+ insertWindowMenu(m_combatWindow);
+ }
else
+ {
m_combatWindow->hide();
+ removeWindowMenu(m_combatWindow);
+ }
pSEQPrefs->setPrefBool("ShowCombatWindow", "Interface",
m_combatWindow->isVisible());
@@ -5719,34 +5714,26 @@
pSEQPrefs->getPrefBool(QString("Dockable") + mapPrefName,
"Interface", true));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock", m_map[i]->preferenceName(),
- Qt::DockLeft);
- addDockWindow(m_map[i], mapName, edge, true);
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_map[i]->preferenceName(), Qt::RightDockWidgetArea);
+ addDockWidget(edge, m_map[i]);
if (!m_isMapDocked[i])
- m_map[i]->undock();
+ m_map[i]->setFloating(!m_isMapDocked[i]);
- connect(this, SIGNAL(saveAllPrefs(void)),
- m_map[i], SLOT(savePrefs()));
- connect(this, SIGNAL(restoreFonts(void)),
- m_map[i], SLOT(restoreFont(void)));
-
+ connect(this, SIGNAL(saveAllPrefs(void)), m_map[i], SLOT(savePrefs()));
+ connect(this, SIGNAL(restoreFonts(void)), m_map[i], SLOT(restoreFont(void)));
+
// Get the map...
Map* map = m_map[i]->map();
-
+
// supply the Map slots with signals from EQInterface
- connect (this, SIGNAL(selectSpawn(const Item*)),
- map, SLOT(selectSpawn(const Item*)));
-
+ connect (this, SIGNAL(selectSpawn(const Item*)),
+ map, SLOT(selectSpawn(const Item*)));
+
// supply EQInterface slots with signals from Map
connect (map, SIGNAL(spawnSelected(const Item*)),
- this, SLOT(spawnSelected(const Item*)));
+ this, SLOT(spawnSelected(const Item*)));
- m_map[i]->restoreSize();
-
- // restore it's position if necessary and practical
- if (pSEQPrefs->getPrefBool("UseWindowPos", "Interface", true))
- m_map[i]->restorePosition();
-
// insert its menu into the window menu
insertWindowMenu(m_map[i]);
}
@@ -5779,24 +5766,16 @@
setDockEnabled(m_messageWindow[i],
pSEQPrefs->getPrefBool(QString("Dockable") + prefName,
"Interface", false));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_messageWindow[i]->preferenceName(),
- Qt::DockLeft);
- addDockWindow(m_messageWindow[i], edge, false);
- if (!m_isMessageWindowDocked[i])
- m_messageWindow[i]->undock();
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_messageWindow[i]->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_messageWindow[i]);
+ m_messageWindow[i]->setFloating(!m_isMessageWindowDocked[i]);
connect(this, SIGNAL(saveAllPrefs(void)),
m_messageWindow[i], SLOT(savePrefs(void)));
connect(this, SIGNAL(restoreFonts(void)),
m_messageWindow[i], SLOT(restoreFont(void)));
-
- m_messageWindow[i]->restoreSize();
- // restore it's position if necessary and practical
- if (pSEQPrefs->getPrefBool("UseWindowPos", "Interface", true))
- m_messageWindow[i]->restorePosition();
-
// insert its menu into the window menu
insertWindowMenu(m_messageWindow[i]);
}
@@ -5818,22 +5797,11 @@
pSEQPrefs->getPrefBool("DockableSpawnList",
"Interface", true));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_spawnList->preferenceName(),
- Qt::DockLeft);
- addDockWindow(m_spawnList, edge, false);
- if (m_isSpawnListDocked)
- m_spawnList->undock();
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_spawnList->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_spawnList);
+ m_spawnList->setFloating(!m_isSpawnListDocked);
- // restore the size of the spawn list
- m_spawnList->restoreSize();
-
- // only do this move stuff iff the spawn list isn't docked
- // and the user set the option to do so.
- if (!m_isSpawnListDocked &&
- pSEQPrefs->getPrefBool("UseWindowPos", "Interface", 0))
- m_spawnList->restorePosition();
-
// connections from spawn list to interface
connect (m_spawnList->spawnList(), SIGNAL(spawnSelected(const Item*)),
this, SLOT(spawnSelected(const Item*)));
@@ -5866,22 +5834,11 @@
setDockEnabled(m_spawnList2,
pSEQPrefs->getPrefBool("DockableSpawnList2",
"Interface", true));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_spawnList2->preferenceName(),
- Qt::DockLeft);
- addDockWindow(m_spawnList2, edge, false);
- if (!m_isSpawnList2Docked)
- m_spawnList2->undock();
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_spawnList2->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_spawnList2);
+ m_spawnList2->setFloating(!m_isSpawnList2Docked);
- // restore the size of the spawn list
- m_spawnList2->restoreSize();
-
- // only do this move stuff iff the spawn list isn't docked
- // and the user set the option to do so.
- if (!m_isSpawnList2Docked &&
- pSEQPrefs->getPrefBool("UseWindowPos", "Interface", 0))
- m_spawnList2->restorePosition();
-
// connections from spawn list to interface
connect (m_spawnList2, SIGNAL(spawnSelected(const Item*)),
this, SLOT(spawnSelected(const Item*)));
@@ -5908,36 +5865,22 @@
// if it doesn't exist, create it.
if (m_spawnPointList == 0)
{
- m_spawnPointList = new SpawnPointWindow(m_spawnMonitor,
- 0, "spawnlist");
- setDockEnabled(m_spawnPointList,
- pSEQPrefs->getPrefBool("DockableSpawnPointList",
- "Interface", true));
- Qt::ToolBarDock edge =
- (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_spawnPointList->preferenceName(),
- Qt::DockLeft);
- addDockWindow(m_spawnPointList, edge, false);
- if (!m_isSpawnPointListDocked)
- m_spawnPointList->undock();
+ m_spawnPointList = new SpawnPointWindow(m_spawnMonitor, 0, "spawnlist");
+ setDockEnabled(m_spawnPointList,
+ pSEQPrefs->getPrefBool("DockableSpawnPointList", "Interface", true));
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_spawnPointList->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_spawnPointList);
+ m_spawnPointList->setFloating(!m_isSpawnPointListDocked);
- // restore the size of the spawn list
- m_spawnPointList->restoreSize();
+ // connections from interface to spawn list
+ connect(this, SIGNAL(saveAllPrefs(void)),
+ m_spawnPointList, SLOT(savePrefs(void)));
+ connect(this, SIGNAL(restoreFonts(void)),
+ m_spawnPointList, SLOT(restoreFont(void)));
- // only do this move stuff iff the spawn list isn't docked
- // and the user set the option to do so.
- if (!m_isSpawnPointListDocked &&
- pSEQPrefs->getPrefBool("UseWindowPos", "Interface", 0))
- m_spawnPointList->restorePosition();
-
- // connections from interface to spawn list
- connect(this, SIGNAL(saveAllPrefs(void)),
- m_spawnPointList, SLOT(savePrefs(void)));
- connect(this, SIGNAL(restoreFonts(void)),
- m_spawnPointList, SLOT(restoreFont(void)));
-
- // insert its menu into the window menu
- insertWindowMenu(m_spawnPointList);
+ // insert its menu into the window menu
+ insertWindowMenu(m_spawnPointList);
}
// make sure it's visible
@@ -5951,31 +5894,17 @@
if (m_statList == 0)
{
m_statList = new StatListWindow(m_player, 0, "stats");
- setDockEnabled(m_statList,
- pSEQPrefs->getPrefBool("DockablePlayerStats",
- "Interface", true));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_statList->preferenceName(),
- Qt::DockLeft);
- addDockWindow(m_statList, edge, false);
- if (!m_isStatListDocked)
- m_statList->undock();
+ setDockEnabled(m_statList, pSEQPrefs->getPrefBool("DockablePlayerStats",
+ "Interface", true));
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_statList->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_statList);
+ m_statList->setFloating(!m_isStatListDocked);
// connect stat list slots to interface signals
- connect(this, SIGNAL(saveAllPrefs(void)),
- m_statList, SLOT(savePrefs(void)));
- connect(this, SIGNAL(restoreFonts(void)),
- m_statList, SLOT(restoreFont(void)));
+ connect(this, SIGNAL(saveAllPrefs(void)), m_statList, SLOT(savePrefs(void)));
+ connect(this, SIGNAL(restoreFonts(void)), m_statList, SLOT(restoreFont(void)));
- // restore the size of the spawn list
- m_statList->restoreSize();
-
- // only do this move stuff iff the spawn list isn't docked
- // and the user set the option to do so.
- if (!m_isStatListDocked &&
- pSEQPrefs->getPrefBool("UseWindowPos", "Interface", 0))
- m_statList->restorePosition();
-
// insert its menu into the window menu
insertWindowMenu(m_statList);
}
@@ -5991,31 +5920,17 @@
if (m_skillList == 0)
{
m_skillList = new SkillListWindow(m_player, 0, "skills");
- setDockEnabled(m_skillList,
- pSEQPrefs->getPrefBool("DockablePlayerSkills",
- "Interface", true));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_skillList->preferenceName(),
- Qt::DockLeft);
- addDockWindow(m_skillList, edge, false);
- if (!m_isSkillListDocked)
- m_skillList->undock();
+ setDockEnabled(m_skillList,
+ pSEQPrefs->getPrefBool("DockablePlayerSkills", "Interface", true));
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_skillList->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_skillList);
+ m_skillList->setFloating(!m_isSkillListDocked);
// connect skill list slots to interfaces signals
- connect(this, SIGNAL(saveAllPrefs(void)),
- m_skillList, SLOT(savePrefs(void)));
- connect(this, SIGNAL(restoreFonts(void)),
- m_skillList, SLOT(restoreFont(void)));
+ connect(this, SIGNAL(saveAllPrefs(void)), m_skillList, SLOT(savePrefs(void)));
+ connect(this, SIGNAL(restoreFonts(void)), m_skillList, SLOT(restoreFont(void)));
- // restore the size of the spawn list
- m_skillList->restoreSize();
-
- // only do this move stuff iff the spawn list isn't docked
- // and the user set the option to do so.
- if (!m_isSkillListDocked &&
- pSEQPrefs->getPrefBool("UseWindowPos", "Interface", 0))
- m_skillList->restorePosition();
-
// insert its menu into the window menu
insertWindowMenu(m_skillList);
}
@@ -6031,15 +5946,12 @@
if (m_spellList == 0)
{
m_spellList = new SpellListWindow(m_spellShell, this, "spelllist");
- setDockEnabled(m_spellList,
- pSEQPrefs->getPrefBool("DockableSpellList",
- "Interface", true));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_spellList->preferenceName(),
- Qt::DockLeft);
- addDockWindow(m_spellList, edge, false);
- if (!m_isSpellListDocked)
- m_spellList->undock();
+ setDockEnabled(m_spellList,
+ pSEQPrefs->getPrefBool("DockableSpellList", "Interface", true));
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_spellList->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_spellList);
+ m_spellList->setFloating(!m_isSpellListDocked);
SpellList* spellList = m_spellList->spellList();
@@ -6057,15 +5969,6 @@
connect(this, SIGNAL(restoreFonts(void)),
m_spellList, SLOT(restoreFont(void)));
- // restore the size of the spell list
- m_spellList->restoreSize();
-
- // only do this move stuff iff the spell list isn't docked
- // and the user set the option to do so.
- if (!m_isSpellListDocked &&
- pSEQPrefs->getPrefBool("UseWindowPos", "Interface", 0))
- m_spellList->restorePosition();
-
// insert its menu into the window menu
insertWindowMenu(m_spellList);
}
@@ -6081,15 +5984,12 @@
if (m_compass == 0)
{
m_compass = new CompassFrame(m_player, 0, "compass");
- setDockEnabled(m_compass,
- pSEQPrefs->getPrefBool("DockableCompass",
- "Interface", true));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_compass->preferenceName(),
- Qt::DockLeft);
- addDockWindow(m_compass, edge, false);
- if (!m_isCompassDocked)
- m_compass->undock();
+ setDockEnabled(m_compass,
+ pSEQPrefs->getPrefBool("DockableCompass", "Interface", true));
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_compass->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_compass);
+ m_compass->setFloating(!m_isCompassDocked);
// supply the compass slots with EQInterface signals
connect (this, SIGNAL(selectSpawn(const Item*)),
@@ -6099,12 +5999,6 @@
connect(this, SIGNAL(saveAllPrefs(void)),
m_compass, SLOT(savePrefs(void)));
- m_compass->restoreSize();
-
- // move window to new position
- if (pSEQPrefs->getPrefBool("UseWindowPos", "Interface", true))
- m_compass->restorePosition();
-
// insert its menu into the window menu
insertWindowMenu(m_compass);
}
@@ -6119,26 +6013,16 @@
if (m_netDiag == 0)
{
m_netDiag = new NetDiag(m_packet, 0, "NetDiag");
- setDockEnabled(m_netDiag,
- pSEQPrefs->getPrefBool("DockableNetDiag",
- "Interface", true));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_netDiag->preferenceName(),
- Qt::DockBottom);
- addDockWindow(m_netDiag, edge, true);
- m_netDiag->undock();
+ setDockEnabled(m_netDiag,
+ pSEQPrefs->getPrefBool("DockableNetDiag", "Interface", true));
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_netDiag->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_netDiag);
+ m_netDiag->setFloating(true);
- connect(this, SIGNAL(restoreFonts(void)),
- m_netDiag, SLOT(restoreFont(void)));
- connect(this, SIGNAL(saveAllPrefs(void)),
- m_netDiag, SLOT(savePrefs(void)));
+ connect(this, SIGNAL(restoreFonts(void)), m_netDiag, SLOT(restoreFont(void)));
+ connect(this, SIGNAL(saveAllPrefs(void)), m_netDiag, SLOT(savePrefs(void)));
- m_netDiag->restoreSize();
-
- // move window to new position
- if (pSEQPrefs->getPrefBool("UseWindowPos", "Interface", true))
- m_netDiag->restorePosition();
-
// insert its menu into the window menu
insertWindowMenu(m_netDiag);
}
@@ -6152,28 +6036,17 @@
{
if (!m_guildListWindow)
{
- m_guildListWindow = new GuildListWindow(m_player, m_guildShell,
- 0, "GuildList");
- setDockEnabled(m_guildListWindow,
- pSEQPrefs->getPrefBool("DockableGuildListWindow",
- "Interface", true));
- Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock",
- m_guildListWindow->preferenceName(),
- Qt::DockBottom);
- addDockWindow(m_guildListWindow, edge, true);
- m_guildListWindow->undock();
+ m_guildListWindow = new GuildListWindow(m_player, m_guildShell, 0, "GuildList");
+ setDockEnabled(m_guildListWindow,
+ pSEQPrefs->getPrefBool("DockableGuildListWindow", "Interface", true));
+ Qt::DockWidgetArea edge = (Qt::DockWidgetArea)pSEQPrefs->getPrefInt("Dock",
+ m_guildListWindow->preferenceName(), Qt::LeftDockWidgetArea);
+ addDockWidget(edge, m_guildListWindow);
+ m_guildListWindow->setFloating(true);
- connect(this, SIGNAL(restoreFonts(void)),
- m_guildListWindow, SLOT(restoreFont(void)));
- connect(this, SIGNAL(saveAllPrefs(void)),
- m_guildListWindow, SLOT(savePrefs(void)));
+ connect(this, SIGNAL(restoreFonts(void)), m_guildListWindow, SLOT(restoreFont(void)));
+ connect(this, SIGNAL(saveAllPrefs(void)), m_guildListWindow, SLOT(savePrefs(void)));
- m_guildListWindow->restoreSize();
-
- // move window to new position
- if (pSEQPrefs->getPrefBool("UseWindowPos", "Interface", true))
- m_guildListWindow->restorePosition();
-
// insert its menu into the window menu
insertWindowMenu(m_guildListWindow);
}
@@ -6421,12 +6294,12 @@
}
}
-void EQInterface::setDockEnabled(Q3DockWindow* dw, bool enable)
+void EQInterface::setDockEnabled(QDockWidget* dw, bool enable)
{
- Q3MainWindow::setDockEnabled(dw, Qt::DockTop, enable);
- Q3MainWindow::setDockEnabled(dw, Qt::DockBottom, enable);
- Q3MainWindow::setDockEnabled(dw, Qt::DockLeft, enable);
- Q3MainWindow::setDockEnabled(dw, Qt::DockRight, enable);
+ if (enable)
+ dw->setAllowedAreas(Qt::AllDockWidgetAreas);
+ else
+ dw->setAllowedAreas(Qt::NoDockWidgetArea);
}
#ifndef QMAKEBUILD
Modified: showeq/branches/pre_6_0_beta/src/interface.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.h 2020-11-08 21:57:35 UTC (rev 1096)
+++ showeq/branches/pre_6_0_beta/src/interface.h 2020-11-08 21:58:00 UTC (rev 1097)
@@ -29,7 +29,7 @@
#include <QLayout>
#include <QMenuBar>
#include <QMenu>
-#include <Q3MainWindow>
+#include <QMainWindow>
#include <QSplitter>
#include <QList>
#include <QTimer>
@@ -119,7 +119,7 @@
/*!
\brief QMainWindow from Hell! Also known as ShowEQ's main window.
*/
-class EQInterface:public Q3MainWindow
+class EQInterface:public QMainWindow
{
Q_OBJECT
@@ -169,7 +169,6 @@
void updateSelectedSpawnStatus(const Item* item);
void savePrefs(void);
- void saveDockAreaPrefs(Q3DockArea* a, Qt::ToolBarDock edge);
void addCategory(void);
void reloadCategories(void);
@@ -341,7 +340,7 @@
void createOPCodeMonitorLog(const QString&);
void insertWindowMenu(SEQWindow* window);
void removeWindowMenu(SEQWindow* window);
- void setDockEnabled(Q3DockWindow* dw, bool enable);
+ void setDockEnabled(QDockWidget* dw, bool enable);
public:
Player* m_player;
Modified: showeq/branches/pre_6_0_beta/src/seqwindow.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/seqwindow.cpp 2020-11-08 21:57:35 UTC (rev 1096)
+++ showeq/branches/pre_6_0_beta/src/seqwindow.cpp 2020-11-08 21:58:00 UTC (rev 1097)
@@ -34,19 +34,19 @@
SEQWindow::SEQWindow(const QString prefName, const QString caption,
QWidget* parent, const char* name, Qt::WFlags f)
- : Q3DockWindow(parent, name, f),
+ : QDockWidget(parent),
m_preferenceName(prefName)
{
+ setObjectName(name);
+ setWindowFlags(f);
// set the windows caption
- Q3DockWindow::setWindowTitle(pSEQPrefs->getPrefString("Caption", preferenceName(),
- caption));
+ QDockWidget::setWindowTitle(pSEQPrefs->getPrefString("Caption", preferenceName(),
+ caption));
- // windows default to resizable
- setResizeEnabled(true);
+ setFeatures(QDockWidget::DockWidgetClosable |
+ QDockWidget::DockWidgetMovable |
+ QDockWidget::DockWidgetFloatable);
- // windows default to be closable when not docked
- setCloseMode(Always);
-
// restore the font
restoreFont();
@@ -69,7 +69,7 @@
void SEQWindow::setCaption(const QString& text)
{
// set the caption
- Q3DockWindow::setWindowTitle(text);
+ QDockWidget::setWindowTitle(text);
setObjectName(windowTitle());
// set the preference
@@ -96,68 +96,8 @@
}
}
-void SEQWindow::restoreSize()
-{
- if (place() == InDock)
- {
- QSize s = pSEQPrefs->getPrefSize("DockFixedExtent", preferenceName(),
- fixedExtent());
- setFixedExtentWidth(s.width());
- setFixedExtentHeight(s.height());
- }
- else
- {
- // retrieve the saved size information
- QSize s = pSEQPrefs->getPrefSize("WindowSize", preferenceName(), size());
-
- resize(s);
- }
+void SEQWindow::savePrefs(void) {}
- if (pSEQPrefs->getPrefBool("DockVisible", preferenceName(), !isHidden()))
- show();
- else
- hide();
-}
-
-void SEQWindow::restorePosition()
-{
- if (place() == InDock)
- {
- setNewLine(pSEQPrefs->getPrefBool("DockNewLine", preferenceName(),
- newLine()));
- setOffset(pSEQPrefs->getPrefInt("DockOffset", preferenceName(), offset()));
- }
- else
- {
- // retrieve the saved position information
- QPoint p = pSEQPrefs->getPrefPoint("WindowPos", preferenceName(), pos());
-
- // Move window to new position
- move(p);
- }
-}
-
-void SEQWindow::savePrefs(void)
-{
- if (pSEQPrefs->getPrefBool("SavePosition", "Interface", true))
- {
- if (place() == InDock)
- {
- pSEQPrefs->setPrefBool("DockNewLine", preferenceName(), newLine());
- pSEQPrefs->setPrefInt("DockOffset", preferenceName(), offset());
- pSEQPrefs->setPrefSize("DockFixedExtent", preferenceName(), fixedExtent());
- }
- else
- {
- // save the windows size and position information
- pSEQPrefs->setPrefSize("WindowSize", preferenceName(), size());
- pSEQPrefs->setPrefPoint("WindowPos", preferenceName(), pos());
- }
-
- pSEQPrefs->setPrefBool("DockVisible", preferenceName(), !isHidden());
- }
-}
-
void SEQWindow::mousePressEvent(QMouseEvent* e)
{
if (e->button() == Qt::RightButton)
@@ -166,10 +106,10 @@
if (popupMenu)
popupMenu->popup(mapToGlobal(e->pos()));
else
- Q3DockWindow::mousePressEvent(e);
+ QDockWidget::mousePressEvent(e);
}
else
- Q3DockWindow::mousePressEvent(e);
+ QDockWidget::mousePressEvent(e);
}
#ifndef QMAKEBUILD
Modified: showeq/branches/pre_6_0_beta/src/seqwindow.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/seqwindow.h 2020-11-08 21:57:35 UTC (rev 1096)
+++ showeq/branches/pre_6_0_beta/src/seqwindow.h 2020-11-08 21:58:00 UTC (rev 1097)
@@ -31,13 +31,13 @@
#include <QWidget>
#include <QString>
-#include <Q3DockWindow>
+#include <QDockWidget>
#include <QMenu>
#include <QMouseEvent>
class QMenu;
-class SEQWindow : public Q3DockWindow
+class SEQWindow : public QDockWidget
{
Q_OBJECT
@@ -53,8 +53,6 @@
public slots:
virtual void setCaption(const QString&);
virtual void setWindowFont(const QFont&);
- virtual void restoreSize();
- virtual void restorePosition();
virtual void restoreFont();
virtual void savePrefs(void);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-08 21:57:38
|
Revision: 1096
http://sourceforge.net/p/seq/svn/1096
Author: cn187
Date: 2020-11-08 21:57:35 +0000 (Sun, 08 Nov 2020)
Log Message:
-----------
Replace Q3ListView with QTreeWidget
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/combatlog.cpp
showeq/branches/pre_6_0_beta/src/combatlog.h
showeq/branches/pre_6_0_beta/src/experiencelog.cpp
showeq/branches/pre_6_0_beta/src/experiencelog.h
showeq/branches/pre_6_0_beta/src/guildlist.cpp
showeq/branches/pre_6_0_beta/src/guildlist.h
showeq/branches/pre_6_0_beta/src/interface.h
showeq/branches/pre_6_0_beta/src/seqlistview.cpp
showeq/branches/pre_6_0_beta/src/seqlistview.h
showeq/branches/pre_6_0_beta/src/skilllist.cpp
showeq/branches/pre_6_0_beta/src/skilllist.h
showeq/branches/pre_6_0_beta/src/spawnlist.cpp
showeq/branches/pre_6_0_beta/src/spawnlist.h
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.h
showeq/branches/pre_6_0_beta/src/spawnlistcommon.cpp
showeq/branches/pre_6_0_beta/src/spawnlistcommon.h
showeq/branches/pre_6_0_beta/src/spawnpointlist.cpp
showeq/branches/pre_6_0_beta/src/spawnpointlist.h
showeq/branches/pre_6_0_beta/src/spelllist.cpp
showeq/branches/pre_6_0_beta/src/spelllist.h
showeq/branches/pre_6_0_beta/src/spellshell.h
showeq/branches/pre_6_0_beta/src/statlist.cpp
showeq/branches/pre_6_0_beta/src/statlist.h
Modified: showeq/branches/pre_6_0_beta/src/combatlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-08 21:57:35 UTC (rev 1096)
@@ -308,7 +308,7 @@
QWidget* CombatWindow::initOffenseWidget()
{
- QWidget *pWidget = new QWidget(m_tab);
+ QWidget *pWidget = new QWidget(m_tab);
m_layout_offense = new QVBoxLayout(pWidget);
@@ -315,27 +315,19 @@
QGroupBox *listGBox = new QGroupBox(pWidget);
m_layout_offense->addWidget(listGBox);
- m_listview_offense = new SEQListView(preferenceName(), listGBox);
- m_listview_offense->addColumn("Type");
- m_listview_offense->setColumnAlignment(0, Qt::AlignRight);
- m_listview_offense->addColumn("Hit");
- m_listview_offense->setColumnAlignment(1, Qt::AlignRight);
- m_listview_offense->addColumn("Miss");
- m_listview_offense->setColumnAlignment(2, Qt::AlignRight);
- m_listview_offense->addColumn("Ratio");
- m_listview_offense->setColumnAlignment(3, Qt::AlignRight);
- m_listview_offense->addColumn("Avg");
- m_listview_offense->setColumnAlignment(4, Qt::AlignRight);
- m_listview_offense->addColumn("Min");
- m_listview_offense->setColumnAlignment(5, Qt::AlignRight);
- m_listview_offense->addColumn("Max");
- m_listview_offense->setColumnAlignment(6, Qt::AlignRight);
- m_listview_offense->addColumn("Total");
- m_listview_offense->setColumnAlignment(7, Qt::AlignRight);
+ m_listview_offense = new SEQListView(preferenceName(), listGBox);
+ m_listview_offense->addColumn("Type");
+ m_listview_offense->addColumn("Hit");
+ m_listview_offense->addColumn("Miss");
+ m_listview_offense->addColumn("Ratio");
+ m_listview_offense->addColumn("Avg");
+ m_listview_offense->addColumn("Min");
+ m_listview_offense->addColumn("Max");
+ m_listview_offense->addColumn("Total");
- m_listview_offense->restoreColumns();
+ m_listview_offense->restoreColumns();
- m_listview_offense->setMinimumSize(m_listview_offense->sizeHint().width(), 200);
+ m_listview_offense->setMinimumSize(m_listview_offense->sizeHint().width(), 200);
QHBoxLayout * listGBoxLayout = new QHBoxLayout(listGBox);
listGBoxLayout->addWidget(m_listview_offense);
@@ -493,42 +485,34 @@
QWidget* CombatWindow::initMobWidget()
{
- QWidget *pWidget = new QWidget(m_tab);
+ QWidget *pWidget = new QWidget(m_tab);
- m_layout_mob = new QVBoxLayout(pWidget);
+ m_layout_mob = new QVBoxLayout(pWidget);
- QGroupBox *listGBox = new QGroupBox(pWidget);
- m_layout_mob->addWidget(listGBox);
+ QGroupBox *listGBox = new QGroupBox(pWidget);
+ m_layout_mob->addWidget(listGBox);
- m_listview_mob = new SEQListView(preferenceName(), listGBox);
- m_listview_mob->addColumn("Time");
- m_listview_mob->setColumnAlignment(0, Qt::AlignRight);
- m_listview_mob->addColumn("Name");
- m_listview_mob->setColumnAlignment(1, Qt::AlignRight);
- m_listview_mob->addColumn("ID");
- m_listview_mob->setColumnAlignment(2, Qt::AlignRight);
- m_listview_mob->addColumn("Duration");
- m_listview_mob->setColumnAlignment(3, Qt::AlignRight);
- m_listview_mob->addColumn("Damage Given");
- m_listview_mob->setColumnAlignment(4, Qt::AlignRight);
- m_listview_mob->addColumn("DPS");
- m_listview_mob->setColumnAlignment(5, Qt::AlignRight);
- m_listview_mob->addColumn("Damage Taken");
- m_listview_mob->setColumnAlignment(6, Qt::AlignRight);
- m_listview_mob->addColumn("MOB DPS");
- m_listview_mob->setColumnAlignment(7, Qt::AlignRight);
+ m_listview_mob = new SEQListView(preferenceName(), listGBox);
+ m_listview_mob->addColumn("Time");
+ m_listview_mob->addColumn("Name");
+ m_listview_mob->addColumn("ID");
+ m_listview_mob->addColumn("Duration");
+ m_listview_mob->addColumn("Damage Given");
+ m_listview_mob->addColumn("DPS");
+ m_listview_mob->addColumn("Damage Taken");
+ m_listview_mob->addColumn("MOB DPS");
- m_listview_mob->restoreColumns();
+ m_listview_mob->restoreColumns();
- m_listview_mob->setMinimumSize(m_listview_mob->sizeHint().width(), 200);
+ m_listview_mob->setMinimumSize(m_listview_mob->sizeHint().width(), 200);
QHBoxLayout *listGBoxLayout = new QHBoxLayout(listGBox);
listGBoxLayout->addWidget(m_listview_mob);
- QGroupBox *summaryGBox = new QGroupBox("Summary", pWidget);
+ QGroupBox *summaryGBox = new QGroupBox("Summary", pWidget);
QHBoxLayout *summaryGBoxLayout = new QHBoxLayout(summaryGBox);
- m_layout_mob->addWidget(summaryGBox);
+ m_layout_mob->addWidget(summaryGBox);
QGridLayout *summaryGridLayout = new QGridLayout();
@@ -676,12 +660,22 @@
QString s_damage;
s_damage.setNum(iDamage);
- Q3ListViewItem *pItem = new Q3ListViewItem(m_listview_offense,
- s_type, s_hits, s_misses, s_ratio,
- s_avgdamage, s_mindamage, s_maxdamage, s_damage);
+ QStringList item_values;
+ item_values << s_type << s_hits << s_misses << s_ratio
+ << s_avgdamage << s_mindamage << s_maxdamage << s_damage;
- m_listview_offense->insertItem(pItem);
+ SEQListViewItem *pItem = new SEQListViewItem(m_listview_offense, item_values);
+ pItem->setTextAlignment(0, Qt::AlignRight);
+ pItem->setTextAlignment(1, Qt::AlignRight);
+ pItem->setTextAlignment(2, Qt::AlignRight);
+ pItem->setTextAlignment(3, Qt::AlignRight);
+ pItem->setTextAlignment(4, Qt::AlignRight);
+ pItem->setTextAlignment(5, Qt::AlignRight);
+ pItem->setTextAlignment(6, Qt::AlignRight);
+ pItem->setTextAlignment(7, Qt::AlignRight);
+
+
switch(iType)
{
case 0: // 1H Blunt
@@ -819,13 +813,22 @@
QString s_iDamageTaken = QString::number(iDamageTaken);
QString s_mobdps = QString::number(dMobDPS);
+ QStringList item_values;
+ item_values << s_time << s_name << s_id << s_duration << s_damagegiven
+ << s_dps << s_iDamageTaken << s_mobdps;
- Q3ListViewItem *pItem = new Q3ListViewItem(m_listview_mob,
- s_time, s_name, s_id, s_duration, s_damagegiven,
- s_dps, s_iDamageTaken, s_mobdps);
+ SEQListViewItem* pItem = new SEQListViewItem(m_listview_mob, item_values);
- m_listview_mob->insertItem(pItem);
+ pItem->setTextAlignment(0, Qt::AlignRight);
+ pItem->setTextAlignment(1, Qt::AlignRight);
+ pItem->setTextAlignment(2, Qt::AlignRight);
+ pItem->setTextAlignment(3, Qt::AlignRight);
+ pItem->setTextAlignment(4, Qt::AlignRight);
+ pItem->setTextAlignment(5, Qt::AlignRight);
+ pItem->setTextAlignment(6, Qt::AlignRight);
+ pItem->setTextAlignment(7, Qt::AlignRight);
+
iTotalMobs++;
dDPSSum += dDPS;
}
Modified: showeq/branches/pre_6_0_beta/src/combatlog.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/combatlog.h 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/combatlog.h 2020-11-08 21:57:35 UTC (rev 1096)
@@ -27,7 +27,6 @@
# include <QWidget>
# include <QTabWidget>
# include <QList>
-# include <Q3ListView>
# include <QComboBox>
# include <QLabel>
# include <QLayout>
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-08 21:57:35 UTC (rev 1096)
@@ -400,15 +400,17 @@
strftime(s_time, 64, "%m/%d %H:%M:%S", localtime( &timev ));
/* Update suggested by Shag */
- Q3ListViewItem *new_exp_entry =
- new Q3ListViewItem( m_exp_listview, s_time, s_mob_name,
- s_mob_level, s_xp_value, s_xp_valueZEM,
- s_xp_valuep, s_xp_valueg, s_xp_gained );
+ QStringList values;
+ values << s_time << s_mob_name << s_mob_level << s_xp_value
+ << s_xp_valueZEM << s_xp_valuep << s_xp_valueg << s_xp_gained;
- m_exp_listview->insertItem( new_exp_entry );
- m_exp_listview->setSelected( new_exp_entry, TRUE );
- m_exp_listview->ensureItemVisible( new_exp_entry );
+ SEQListViewItem* new_exp_entry =
+ new SEQListViewItem(m_exp_listview, values);
+ m_exp_listview->setCurrentItem(new_exp_entry);
+
+ m_exp_listview->scrollToItem(new_exp_entry);
+
// Initial work on new logging mechanism with more data
FILE* newlogfp = NULL;
@@ -416,7 +418,7 @@
newlogfp = fopen(m_newExpLogFile.toAscii().data(), "a");
if (newlogfp != NULL)
- {
+ {
// append a new record entry
fprintf(newlogfp,
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.h 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.h 2020-11-08 21:57:35 UTC (rev 1096)
@@ -29,7 +29,6 @@
#include <QObject>
#include <QWidget>
#include <QList>
-#include <Q3ListView>
#include <QComboBox>
#include <QLabel>
#include <QLayout>
@@ -136,6 +135,7 @@
QVBoxLayout *m_layout;
SEQListView *m_exp_listview;
+ //QTreeWidget *m_exp_listview;
QLabel *m_experience_rate_label;
QLabel *m_total_received, *m_mob_count, *m_average_per_mob,
Modified: showeq/branches/pre_6_0_beta/src/guildlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/guildlist.cpp 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/guildlist.cpp 2020-11-08 21:57:35 UTC (rev 1096)
@@ -37,13 +37,14 @@
#include <QHBoxLayout>
#include <QBoxLayout>
#include <QVBoxLayout>
+#include <QHeaderView>
//----------------------------------------------------------------------
// GuildListItem
-GuildListItem::GuildListItem(Q3ListView* parent,
- const GuildMember* member,
- const GuildShell* guildShell)
- : Q3ListViewItem(parent),
+GuildListItem::GuildListItem(SEQListView* parent,
+ const GuildMember* member,
+ const GuildShell* guildShell)
+ : SEQListViewItem(parent),
m_member(member)
{
update(guildShell);
@@ -53,61 +54,48 @@
{
}
-void GuildListItem::paintCell( QPainter *p, const QColorGroup &cg,
- int column, int width, int alignment )
+QVariant GuildListItem::data(int column, int role) const
{
- QFont font = this->listView()->font();
+ QFont font = treeWidget()->font();
+ switch(role)
+ {
+ case Qt::FontRole:
+ if (m_member->zoneId())
+ font.setBold(true);
+ else
+ font.setBold(false);
- // members that are actually logged in have their names in bold
- if (m_member->zoneId())
- font.setBold(true);
- else
- font.setBold(false);
+ return font;
- p->setFont(font);
+ default:
+ return SEQListViewItem::data(column, role);
+ }
- Q3ListViewItem::paintCell( p, cg, column, width, alignment );
}
-int GuildListItem::compare(Q3ListViewItem *o, int col, bool ascending) const
+bool GuildListItem::operator<(const GuildListItem& other) const
{
- if (!m_member)
- return -1;
+ int column = treeWidget() ? treeWidget()->sortColumn() : 0;
- GuildListItem* other = (GuildListItem*)o;
- const GuildMember* otherMember = other->guildMember();
+ switch(column)
+ {
+ case 1: // level
+ return data(column, Qt::DisplayRole).value<int>() <
+ other.data(column, Qt::DisplayRole).value<int>();
- switch (col)
- {
- case 1: // Level
- if (m_member->level() == otherMember->level())
- return 0;
- else
- return m_member->level() > otherMember->level() ? 1 : -1;
- case 3: // Guild Rank
- if (m_member->guildRank() == otherMember->guildRank())
- return 0;
- else
- return m_member->guildRank() > otherMember->guildRank() ? 1 : -1;
- case 4: // Banker Rank
- if (m_member->bankRank() == otherMember->bankRank())
- return 0;
- else
- return m_member->bankRank() > otherMember->bankRank() ? 1 : -1;
+ case 6: // last on
+ return guildMember()->lastOn() < other.guildMember()->lastOn();
- case 5: // Alt rank
- if (m_member->altRank() == otherMember->altRank())
- return 0;
- else
- return m_member->altRank() > otherMember->altRank() ? 1 : -1;
- case 6: // Last On
- if (m_member->lastOn() == otherMember->lastOn())
- return 0;
- else
- return m_member->lastOn() > otherMember->lastOn() ? 1 : -1;
- default:
- return Q3ListViewItem::compare(o, col, ascending);
- }
+ case 0: // name
+ case 2: // class
+ case 3: // rank
+ case 4: // banker
+ case 5: // alt
+ case 7: // zone
+ case 8: // public note
+ default: // Qt sorts values as strings by default
+ return text(column) < other.text(column);
+ }
}
static const QString dateFormat("ddd MMM dd hh:mm:ss yyyy");
@@ -192,8 +180,9 @@
hLayout->addWidget(m_guildTotals, 0, Qt::AlignRight);
// create the spawn listview
- m_guildList = new SEQListView(preferenceName(),
- this, "guildlistview");
+ m_guildList = new SEQListView(preferenceName(), this, "guildlistview");
+ m_guildList->setSortingEnabled(m_keepSorted);
+
vLayout->addWidget(m_guildList);
// setup the columns
@@ -220,6 +209,9 @@
connect(m_player, SIGNAL(guildChanged()),
this, SLOT(guildChanged()));
+ connect(m_guildList, SIGNAL(mouseRightButtonPressed(QMouseEvent*)),
+ this, SLOT(listMouseRightButtonPressed(QMouseEvent*)));
+
// populate the window
populate();
}
@@ -228,6 +220,14 @@
{
}
+void GuildListWindow::listMouseRightButtonPressed(QMouseEvent* event)
+{
+ if (event->button() == Qt::RightButton)
+ {
+ menu()->popup(event->globalPos());
+ }
+}
+
QMenu* GuildListWindow::menu()
{
if (m_menu)
@@ -386,7 +386,8 @@
// make sure the guild list is sorted
if (m_keepSorted)
- m_guildList->sort();
+ m_guildList->sortByColumn(m_guildList->sortColumn(),
+ m_guildList->header()->sortIndicatorOrder());
updateCount();
}
@@ -430,10 +431,11 @@
void GuildListWindow::toggle_keepSorted(bool enable)
{
m_keepSorted = enable;
- pSEQPrefs->setPrefBool("KeepSorted", preferenceName(),
- m_keepSorted);
+ pSEQPrefs->setPrefBool("KeepSorted", preferenceName(), m_keepSorted);
+ m_guildList->setSortingEnabled(enable);
if (m_keepSorted)
- m_guildList->sort();
+ m_guildList->sortByColumn(m_guildList->sortColumn(),
+ m_guildList->header()->sortIndicatorOrder());
}
void GuildListWindow::toggle_guildListCol(QAction* col)
@@ -533,7 +535,9 @@
}
// make sure the guild list is sorted
- m_guildList->sort();
+ if (m_keepSorted)
+ m_guildList->sortByColumn(m_guildList->sortColumn(),
+ m_guildList->header()->sortIndicatorOrder());
// update the counts
updateCount();
Modified: showeq/branches/pre_6_0_beta/src/guildlist.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/guildlist.h 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/guildlist.h 2020-11-08 21:57:35 UTC (rev 1096)
@@ -33,7 +33,6 @@
#include "seqwindow.h"
#include "seqlistview.h"
-#include <Q3ListView>
#include <QHash>
#include <QString>
#include <QLabel>
@@ -65,24 +64,23 @@
//----------------------------------------------------------------------
// GuildListItem
-class GuildListItem : public Q3ListViewItem
+class GuildListItem : public SEQListViewItem
{
public:
- GuildListItem(Q3ListView* parent,
- const GuildMember* member,
- const GuildShell* guildShell);
- virtual ~GuildListItem();
+ GuildListItem(SEQListView* parent,
+ const GuildMember* member,
+ const GuildShell* guildShell);
+ virtual ~GuildListItem();
- virtual void paintCell( QPainter *p, const QColorGroup &cg,
- int column, int width, int alignment );
+ bool operator<(const GuildListItem& other) const;
- virtual int compare(Q3ListViewItem *i, int col, bool ascending) const;
-
void update(const GuildShell* guildShell);
- const GuildMember* guildMember() { return m_member; }
+ const GuildMember* guildMember() const { return m_member; }
void setGuildMember(const GuildMember* member);
+ QVariant data(int column, int role) const;
+
virtual int rtti() const;
protected:
@@ -116,6 +114,7 @@
void toggle_guildListCol(QAction* col);
void set_font();
void set_caption();
+ void listMouseRightButtonPressed(QMouseEvent*);
protected:
void clear(void);
@@ -124,7 +123,7 @@
Player* m_player;
GuildShell* m_guildShell;
-
+
QLabel* m_guildName;
QLabel* m_guildTotals;
SEQListView* m_guildList;
Modified: showeq/branches/pre_6_0_beta/src/interface.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.h 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/interface.h 2020-11-08 21:57:35 UTC (rev 1096)
@@ -26,7 +26,6 @@
#include <QWidget>
#include <QPushButton>
#include <QLabel>
-#include <Q3ListView>
#include <QLayout>
#include <QMenuBar>
#include <QMenu>
Modified: showeq/branches/pre_6_0_beta/src/seqlistview.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/seqlistview.cpp 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/seqlistview.cpp 2020-11-08 21:57:35 UTC (rev 1096)
@@ -25,25 +25,30 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <Q3Header>
+#include <QHeaderView>
#include <QSizePolicy>
#include "seqlistview.h"
#include "main.h"
-SEQListView::SEQListView(const QString prefName,
- QWidget* parent, const char* name, Qt::WFlags f)
- : Q3ListView(parent, name, f),
+SEQListView::SEQListView(const QString prefName,
+ QWidget* parent,
+ const char* name,
+ Qt::WFlags f)
+ : QTreeWidget(parent),
m_preferenceName(prefName),
m_sortColumn(0),
m_sortIncreasing(true)
{
- // setup common listview defaults
- setShowSortIndicator(true);
- setRootIsDecorated(false);
- setSelectionMode(Single);
- setAllColumnsShowFocus(true);
- setShowSortIndicator(true);
+ setObjectName(name);
+ setWindowFlags(f);
+
+ // setup common listview defaults
+ setSortingEnabled(true);
+ setSorting(0, true);
+ setRootIsDecorated(false);
+ setSelectionMode(QAbstractItemView::SingleSelection);
+ setSelectionBehavior(QAbstractItemView::SelectRows);
}
SEQListView::~SEQListView()
@@ -52,189 +57,213 @@
const QString& SEQListView::columnPreferenceName(int column) const
{
- // return the base name of the preference for the requested column
- return m_columns[column];
+ // return the base name of the preference for the requested column
+ return m_columns[column];
}
QSizePolicy SEQListView::sizePolicy() const
{
- return QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ return QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}
int SEQListView::addColumn(const QString& label,
- int width)
+ int width)
{
- return addColumn(label, label, width);
+ return addColumn(label, label, width);
}
-int SEQListView::addColumn(const QString& label,
- const QString& preference,
- int width)
+int SEQListView::addColumn(const QString& label,
+ const QString& preference,
+ int width)
{
- // add the column to the listview
- int column = Q3ListView::addColumn(label, width);
+ // add the column to the list of preferences
+ m_columns.append(preference);
- // add the column to the list of preferences
- m_columns.append(preference);
+ // add the column to the list of headers
+ m_headers.append(label);
- // return the column index
- return column;
+ // update the header row
+ setHeaderLabels(m_headers);
+
+ // return the column index
+ return m_headers.indexOf(label);
}
void SEQListView::removeColumn(int column)
{
- // remove the column from the listview
- Q3ListView::removeColumn(column);
+ // remove the preference from the list
+ m_columns.removeAt(column);
- // remove the preference from the list
- m_columns.removeAt(column);
+ // remove the header from the list
+ m_headers.removeAt(column);
+
+ //update the header row
+ setHeaderLabels(m_headers);
}
+void SEQListView::insertItem(QTreeWidgetItem* item) {
+ insertTopLevelItem(topLevelItemCount(), item);
+}
+
void SEQListView::setSorting(int column, bool increasing)
{
- // save the sort information
- m_sortColumn = column;
- m_sortIncreasing = increasing;
+ // save the sort information
+ m_sortColumn = column;
+ m_sortIncreasing = increasing;
- // set the sort order in the underlying listview
- Q3ListView::setSorting(column, increasing);
+ // set the sort order in the underlying listview
+ sortByColumn(column, increasing ? Qt::AscendingOrder : Qt::DescendingOrder);
}
void SEQListView::savePrefs()
{
- // only save the preferences if visible
- if (isVisible())
- {
+ // only save the preferences if visible
+ if (isVisible())
+ {
+ int i;
+ int width;
+ QString columnName;
+ QString show = "Show";
+
+ // save the column width's/visibility
+ for (i = 0; i < columnCount(); i++)
+ {
+ columnName = columnPreferenceName(i);
+ width = columnWidth(i);
+ if (width != 0)
+ {
+ pSEQPrefs->setPrefInt(columnName + "Width", preferenceName(), width);
+ pSEQPrefs->setPrefBool(show + columnName, preferenceName(), true);
+ }
+ else
+ pSEQPrefs->setPrefBool(show + columnName, preferenceName(), false);
+ }
+
+ // save the column order
+ QString tempStr, tempStr2;
+ if (header()->count() > 0)
+ tempStr.sprintf("%d", header()->logicalIndex(0));
+ for(i=1; i < header()->count(); i++)
+ {
+ tempStr2.sprintf(":%d", header()->logicalIndex(i));
+ tempStr += tempStr2;
+ }
+ pSEQPrefs->setPrefString("ColumnOrder", preferenceName(), tempStr);
+
+ // save the current sorting state
+ pSEQPrefs->setPrefInt("SortColumn", preferenceName(), m_sortColumn);
+ pSEQPrefs->setPrefBool("SortIncreasing", preferenceName(),
+ m_sortIncreasing);
+ }
+}
+
+void SEQListView::restoreColumns()
+{
int i;
int width;
QString columnName;
QString show = "Show";
- // save the column width's/visibility
- for (i = 0; i < columns(); i++)
+ // restore the column width's/visibility
+ for (i = 0; i < columnCount(); i++)
{
- columnName = columnPreferenceName(i);
- width = columnWidth(i);
- if (width != 0)
- {
- pSEQPrefs->setPrefInt(columnName + "Width", preferenceName(), width);
- pSEQPrefs->setPrefBool(show + columnName, preferenceName(), true);
- }
- else
- pSEQPrefs->setPrefBool(show + columnName, preferenceName(), false);
+ columnName = columnPreferenceName(i);
+
+ // check if the column is visible
+ if (pSEQPrefs->getPrefBool(show + columnName, preferenceName(), true))
+ {
+ // check if the column has a width specified
+ if (pSEQPrefs->isPreference(columnName + "Width", preferenceName()))
+ {
+ // use the specified column width
+ width = pSEQPrefs->getPrefInt(columnName + "Width", preferenceName());
+ }
+ else
+ {
+ width = header()->sectionSizeHint(i);
+ }
+
+ header()->setResizeMode(i, QHeaderView::Interactive);
+ header()->resizeSection(i, width);
+ setColumnWidth(i, width);
+ }
+ else
+ {
+ // column is not visible, hide it.
+ header()->setResizeMode(i, QHeaderView::Interactive);
+ header()->resizeSection(i, 0);
+ setColumnWidth(i, 0);
+ }
}
-
- // save the column order
- QString tempStr, tempStr2;
- if (header()->count() > 0)
- tempStr.sprintf("%d", header()->mapToSection(0));
- for(i=1; i < header()->count(); i++)
- {
- tempStr2.sprintf(":%d", header()->mapToSection(i));
- tempStr += tempStr2;
- }
- pSEQPrefs->setPrefString("ColumnOrder", preferenceName(), tempStr);
- // save the current sorting state
- pSEQPrefs->setPrefInt("SortColumn", preferenceName(), m_sortColumn);
- pSEQPrefs->setPrefBool("SortIncreasing", preferenceName(),
- m_sortIncreasing);
- }
-}
+ // restore the column order
+ QString tStr = pSEQPrefs->getPrefString("ColumnOrder", preferenceName(), "N/A");
-void SEQListView::restoreColumns()
-{
- int i;
- int width;
- QString columnName;
- QString show = "Show";
-
- // restore the column width's/visibility
- for (i = 0; i < columns(); i++)
- {
- columnName = columnPreferenceName(i);
-
- // check if the column is visible
- if (pSEQPrefs->getPrefBool(show + columnName, preferenceName(), true))
+ QHeaderView* hdr = header();
+ if (tStr != "N/A")
{
- // check if the column has a width specified
- if (pSEQPrefs->isPreference(columnName + "Width", preferenceName()))
- {
- // use the specified column width
- width = pSEQPrefs->getPrefInt(columnName + "Width", preferenceName());
- setColumnWidthMode(i, Q3ListView::Manual);
- setColumnWidth(i, width);
- }
+ int i = 0;
+ while (!tStr.isEmpty())
+ {
+ int toIndex;
+ if (tStr.indexOf(':') != -1)
+ {
+ toIndex = tStr.left(tStr.indexOf(':')).toInt();
+ tStr = tStr.right(tStr.length() - tStr.indexOf(':') - 1);
+ }
+ else
+ {
+ toIndex = tStr.toInt();
+ tStr = "";
+ }
+ hdr->moveSection(hdr->visualIndex(toIndex), i++);
+ }
}
- else
- {
- // column is not visible, hide it.
- setColumnWidthMode(i, Q3ListView::Manual);
- setColumnWidth(i, 0);
- }
- }
-
- // restore the column order
- QString tStr = pSEQPrefs->getPrefString("ColumnOrder", preferenceName(),
- "N/A");
- if (tStr != "N/A")
- {
- int i = 0;
- while (!tStr.isEmpty())
- {
- int toIndex;
- if (tStr.indexOf(':') != -1)
- {
- toIndex = tStr.left(tStr.indexOf(':')).toInt();
- tStr = tStr.right(tStr.length() - tStr.indexOf(':') - 1);
- }
- else
- {
- toIndex = tStr.toInt();
- tStr = "";
- }
- header()->moveSection(toIndex, i++);
- }
- }
- // restore sorting state
- setSorting(pSEQPrefs->getPrefInt("SortColumn", preferenceName(),
- m_sortColumn),
- pSEQPrefs->getPrefBool("SortIncreasing", preferenceName(),
- m_sortIncreasing));
+ // restore sorting state
+ setSorting(pSEQPrefs->getPrefInt("SortColumn", preferenceName(),
+ m_sortColumn),
+ pSEQPrefs->getPrefBool("SortIncreasing", preferenceName(),
+ m_sortIncreasing));
}
void SEQListView::setColumnVisible(int column, bool visible)
{
- QString columnName = columnPreferenceName(column);
+ QString columnName = columnPreferenceName(column);
- // default width is 0
- int width = 0;
+ // default width is 0
+ int width = 0;
- // if column is to become visible, get it's width
- if (visible)
- {
- // get the column width
- width = pSEQPrefs->getPrefInt(columnName + "Width", preferenceName(),
- columnWidth(column));
+ // if column is to become visible, get it's width
+ if (visible)
+ {
+ // get the column width
+ width = pSEQPrefs->getPrefInt(columnName + "Width", preferenceName(),
+ columnWidth(column));
- // if it's zero, use default width of 40
- if (width == 0)
- width = 40;
- }
+ // if it's zero, use default width of 40
+ if (width == 0)
+ width = 40;
+ }
- // set the column width mode
- setColumnWidthMode(column, Q3ListView::Manual);
+ header()->setResizeMode(column, QHeaderView::Interactive);
+ header()->resizeSection(column, width);
+ setColumnWidth(column, width);
- // set the column width
- setColumnWidth(column, width);
+ // set the the preferences as to if the column is shown
+ pSEQPrefs->setPrefBool(QString("Show") + columnName, preferenceName(),
+ (width != 0));
- // set the the preferences as to if the column is shown
- pSEQPrefs->setPrefBool(QString("Show") + columnName, preferenceName(),
- (width != 0));
+ // trigger an update, otherwise things may look messy
+ update();
+}
- // trigger an update, otherwise things may look messy
- triggerUpdate();
+void SEQListView::mousePressEvent(QMouseEvent* event)
+{
+ if (event->button() == Qt::RightButton)
+ emit mouseRightButtonPressed(event);
+
+ QTreeWidget::mousePressEvent(event);
}
#ifndef QMAKEBUILD
Modified: showeq/branches/pre_6_0_beta/src/seqlistview.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/seqlistview.h 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/seqlistview.h 2020-11-08 21:57:35 UTC (rev 1096)
@@ -29,46 +29,57 @@
#ifndef SEQLISTVIEW_H
#define SEQLISTVIEW_H
-#include <Q3ListView>
+#include <QTreeWidget>
+#include <QMouseEvent>
#include <QString>
#include <QStringList>
+typedef QTreeWidgetItem SEQListViewItem;
+typedef QTreeWidgetItemIterator SEQListViewItemIterator;
-class SEQListView : public Q3ListView
+class SEQListView : public QTreeWidget
{
- Q_OBJECT
+ Q_OBJECT
- public:
- SEQListView(const QString prefName,
- QWidget* parent = 0, const char* name = 0, Qt::WFlags f = 0);
- ~SEQListView();
+ public:
+ SEQListView(const QString prefName,
+ QWidget* parent = 0,
+ const char* name = 0,
+ Qt::WFlags f = 0);
+ ~SEQListView();
- const QString& preferenceName() const { return m_preferenceName; }
- const QString& columnPreferenceName(int column) const;
+ const QString& preferenceName() const { return m_preferenceName; }
+ const QString& columnPreferenceName(int column) const;
- QSizePolicy sizePolicy() const;
+ QSizePolicy sizePolicy() const;
- virtual int addColumn(const QString& label,
- int width = -1);
- virtual int addColumn(const QString& label,
- const QString& preference,
- int width = -1);
- virtual void removeColumn(int column);
- bool columnVisible(int column) { return (columnWidth(column) != 0); }
- virtual void setSorting(int column, bool increasing = true);
- int sortColumn() const { return m_sortColumn; }
- bool sortIncreasing() const { return m_sortIncreasing; }
+ virtual int addColumn(const QString& label,
+ int width = -1);
+ virtual int addColumn(const QString& label,
+ const QString& preference,
+ int width = -1);
+ virtual void removeColumn(int column);
+ void insertItem(QTreeWidgetItem* item);
+ bool columnVisible(int column) { return (columnWidth(column) != 0); }
+ virtual void setSorting(int column, bool increasing = true);
+ int sortColumn() const { return m_sortColumn; }
+ bool sortIncreasing() const { return m_sortIncreasing; }
- public slots:
- virtual void restoreColumns(void);
- virtual void savePrefs(void);
- void setColumnVisible(int column, bool visible);
+ public slots:
+ virtual void restoreColumns(void);
+ virtual void savePrefs(void);
+ void setColumnVisible(int column, bool visible);
+ void mousePressEvent(QMouseEvent* event);
- private:
- QString m_preferenceName;
- QStringList m_columns;
- int m_sortColumn;
- bool m_sortIncreasing;
+ signals:
+ void mouseRightButtonPressed(QMouseEvent*);
+
+ private:
+ QString m_preferenceName;
+ QStringList m_columns;
+ QStringList m_headers;
+ int m_sortColumn;
+ bool m_sortIncreasing;
};
#endif // SEQLISTVIEW_H
Modified: showeq/branches/pre_6_0_beta/src/skilllist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/skilllist.cpp 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/skilllist.cpp 2020-11-08 21:57:35 UTC (rev 1096)
@@ -30,10 +30,10 @@
SkillList::SkillList(Player* player,
- QWidget* parent,
- const char* name)
- : SEQListView("SkillList", parent, name),
- m_pPlayer(player)
+ QWidget* parent,
+ const char* name)
+ : SEQListView("SkillList", parent, name),
+ m_pPlayer(player)
{
int i;
@@ -115,8 +115,11 @@
* to the list
*/
if (!m_skillList[skillId])
- m_skillList[skillId] =
- new Q3ListViewItem (this, skill_name (skillId), str);
+ {
+ QStringList item_values;
+ item_values << skill_name(skillId) << str;
+ m_skillList[skillId] = new SEQListViewItem (this, item_values);
+ }
else
m_skillList[skillId]->setText (1, str);
}
@@ -126,12 +129,12 @@
{
if (skillId >= MAX_KNOWN_SKILLS)
{
- seqWarn("skillId (%d) is more than max skillId (%d)\n",
- skillId, MAX_KNOWN_SKILLS - 1);
+ seqWarn("skillId (%d) is more than max skillId (%d)\n",
+ skillId, MAX_KNOWN_SKILLS - 1);
return;
}
-
+
QString str;
/* Update skill value with new value */
str.sprintf ("%3d", value);
@@ -138,8 +141,11 @@
// create skill entry if needed or set the value of the existing item
if (!m_skillList[skillId])
- m_skillList[skillId] =
- new Q3ListViewItem (this, skill_name (skillId), str);
+ {
+ QStringList item_values;
+ item_values << skill_name(skillId) << str;
+ m_skillList[skillId] = new SEQListViewItem (this, item_values);
+ }
else
m_skillList[skillId]->setText (1, str);
}
@@ -169,7 +175,7 @@
return;
}
-
+
// Check if this is a valid skill
if (value == 255)
return;
@@ -185,8 +191,11 @@
// If the language is not added yet, look up the correct skill namd and
// add it to the list
if (!m_languageList[langId])
- m_languageList[langId] =
- new Q3ListViewItem (this, language_name(langId), str);
+ {
+ QStringList item_values;
+ item_values << language_name(langId) << str;
+ m_languageList[langId] = new SEQListViewItem (this, item_values);
+ }
else
m_languageList[langId]->setText (1, str);
}
@@ -205,7 +214,7 @@
return;
}
-
+
QString str;
/* Update skill value with new value */
@@ -213,8 +222,11 @@
// create language entry if needed or set the value of the existing item
if (!m_languageList[langId])
- m_languageList[langId] =
- new Q3ListViewItem (this, language_name (langId), str);
+ {
+ QStringList item_values;
+ item_values << language_name(langId) << str;
+ m_languageList[langId] = new SEQListViewItem (this, item_values);
+ }
else
m_languageList[langId]->setText (1, str);
}
Modified: showeq/branches/pre_6_0_beta/src/skilllist.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/skilllist.h 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/skilllist.h 2020-11-08 21:57:35 UTC (rev 1096)
@@ -24,7 +24,6 @@
#define EQSKILLLIST_H
#include <QWidget>
-#include <Q3ListView>
#include "seqlistview.h"
#include "seqwindow.h"
@@ -40,9 +39,9 @@
public:
// constructor
SkillList (Player* player,
- QWidget* parent = 0,
- const char* name = 0);
-
+ QWidget* parent = 0,
+ const char* name = 0);
+
// destructor
~SkillList();
@@ -63,10 +62,10 @@
Player* m_pPlayer;
// the list view items related to skills
- Q3ListViewItem* m_skillList[MAX_KNOWN_SKILLS];
+ SEQListViewItem* m_skillList[MAX_KNOWN_SKILLS];
// the list view items related to languages
- Q3ListViewItem* m_languageList[MAX_KNOWN_LANGS];
+ SEQListViewItem* m_languageList[MAX_KNOWN_LANGS];
// whether or not to show languages
bool m_showLanguages;
Modified: showeq/branches/pre_6_0_beta/src/spawnlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-03 02:02:50 UTC (rev 1095)
+++ showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-08 21:57:35 UTC (rev 1096)
@@ -93,15 +93,18 @@
restoreColumns();
// connect a QListView signal to ourselves
- connect(this, SIGNAL(selectionChanged(Q3ListViewItem*)),
- this, SLOT(selChanged(Q3ListViewItem*)));
+ connect(this, SIGNAL(itemSelectionChanged()),
+ this, SLOT(selChanged()));
- connect (this, SIGNAL(mouseButtonPressed(int, Q3ListViewItem*, const QPoint&, int)),
- this, SLOT(mousePressEvent(int, Q3ListViewItem*, const QPoint&, int)));
+ connect (this, SIGNAL(itemPressed(QTreeWidgetItem*, int)),
+ this, SLOT(listItemPressed(QTreeWidgetItem*, int)));
- connect (this, SIGNAL(doubleClicked(Q3ListViewItem*)),
- this, SLOT(mouseDoubleClickEvent(Q3ListViewItem*)));
+ connect (this, SIGNAL(mouseRightButtonPressed(QMouseEvent*)),
+ this, SLOT(listMouseRightButtonPressed(QMouseEvent*)));
+ connect (this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),
+ this, SLOT(listItemDoubleClicked(QTreeWidgetItem*, int)));
+
// connect SpawnList slots to SpawnShell signals
connect(m_spawnShell, SIGNAL(addItem(const Item *)),
this, SLOT(addItem(const Item *)));
@@ -143,36 +146,38 @@
int32_t degrees)
{
// seqDebug("SpawnList::setPlayer()");
- char buff[200];
+ SEQListViewItemIterator it(this);
+ SpawnListItem* litem;
+ QString buff;
- SpawnListItem *i = (SpawnListItem*)firstChild();
-// if (i) seqDebug("============= firstChild, name=%s type=%s", i->item()->name().data(), i->type());
-
// is this a fast machine?
if (!showeq_params->fast_machine)
{
// no, cheat using integer distance calculation ignoring Z dimension
- while (i != NULL)
- {
- if (i->type() != tUnknown)
+ while (*it)
+ {
+ litem = (SpawnListItem*)*it;
+
+ if (litem->type() != tUnknown)
{
- sprintf(buff, "%5d", i->item()->calcDist2DInt(x, y));
- i->setText(tSpawnColDist, buff);
+ buff.sprintf("%5d", litem->item()->calcDist2DInt(x, y));
+ litem->setText(tSpawnColDist, buff);
}
- i = (SpawnListItem*)i->nextSibling();
+ ++it;
}
}
else
{
// fast machine so calculate the correct floating point 3D distance
- while (i != NULL)
- {
- if (i->type() != tUnknown)
+ while (*it)
+ {
+ litem = (SpawnListItem*)*it;
+ if (litem->type() != tUnknown)
{
- sprintf(buff, "%5.1f", i->item()->calcDist(x, y, z));
- i->setText(tSpawnColDist, buff);
+ buff.sprintf("%5.1f", litem->item()->calcDist(x, y, z));
+ litem->setText(tSpawnColDist, buff);
}
- i = (SpawnListItem*)i->nextSibling();
+ ++it;
}
}
}
@@ -182,39 +187,39 @@
if (item == NULL)
return;
- Q3ListViewItemIterator it(this);
+ SEQListViewItemIterator it(this);
SpawnListItem *i = Find(it, item);
- while (i)
+ while (i)
{
// reinsert only if level, NPC or filterFlags changes
if (!(changeItem & (tSpawnChangedLevel |
- tSpawnChangedNPC |
- tSpawnChangedFilter |
- tSpawnChangedRuntimeFilter)))
+ tSpawnChangedNPC |
+ tSpawnChangedFilter |
+ tSpawnChangedRuntimeFilter)))
i->update(m_player, changeItem);
- else
+ else
{
bool select = false;
-
+
// check if this is the selected item.
if (Selected() == i)
- select = true;
-
+ select = true;
+
// delete ALL SpawnListItems that relate to item
delItem(item);
-
+
// reinsert ALL the SpawnListItems that relate to item
addItem(item);
-
+
// reset the selected item, if it was this item.
if (select)
- selectSpawn(item);
-
+ selectSpawn(item);
+
// Delete item deleted everything, addItem re-inserted everything
// nothing more to be done.
- break;
+ break;
}
-
+
// keep searching/updating...
i = Find(it, item);
} // while i
@@ -225,28 +230,28 @@
if (item == NULL)
return;
- Q3ListViewItemIterator it(this);
+ SEQListViewItemIterator it(this);
const SpawnListItem *i = Find(it, item);
// was this spawn in the list
- if (i)
+ if (i)
{
// yes, remove and re-add it.
bool select = false;
-
+
// check if this is the selected item.
if (Selected() == i)
select = true;
-
+
// delete ALL SpawnListItems that relate to item
delItem(item);
-
+
// reinsert ALL the SpawnListItems that relate to item
addItem(item);
-
+
// reset the selected item, if it was this item.
if (select)
selectSpawn(item);
-
+
// Delete item deleted everything, addItem re-inserted everything
// nothing more to be done.
}
@@ -254,21 +259,21 @@
addItem(item);
}
-SpawnListItem* SpawnList::Find(Q3ListViewItemIterator& it,
- const Item* item,
- bool first)
+SpawnListItem* SpawnList::Find(SEQListViewItemIterator& it,
+ const Item* item,
+ bool first)
{
- if (first)
- it = Q3ListViewItemIterator(this); // reset iterator to the beginning
+ if (first)
+ it = SEQListViewItemIterator(this); // reset iterator to the beginning
else
it++; // increment past the current item
SpawnListItem *i;
// while there are still items, increment forward
- while(it.current())
+ while(*it)
{
// get the current item
- i = (SpawnListItem*)it.current();
+ i = (SpawnListItem*)*it;
// is it the one we're looking for?
if (i->item() == item)
@@ -291,7 +296,7 @@
// ZB: Need to figure out how to derive flags
int flags = 0;
- Q3ListViewItemIterator it(this);
+ SEQListViewItemIterator it(this);
const Item* i;
SpawnListItem* j = NULL;
@@ -307,8 +312,8 @@
// check if the ID is already in the list
j = Find(it, item);
-
- if (j)
+
+ if (j)
{
// yes, check if it's a major modification, or can get by with just
// an update
@@ -316,8 +321,8 @@
// reinsert only if name, level, NPC, or filterFlags changes
if ((l == level) &&
- (j->m_npc == item->NPC()) &&
- (j->text(tSpawnColName) == item->name()))
+ (j->m_npc == item->NPC()) &&
+ (j->text(tSpawnColName) == item->name()))
{
// it matches, just update all of it's instances
@@ -324,17 +329,17 @@
// loop through all instances relating to item
while (j != NULL)
{
- // update the SpawnListItem
- j->update(m_player, tSpawnChangedALL);
+ // update the SpawnListItem
+ j->update(m_player, tSpawnChangedALL);
- // find the next one
- j = Find(it, item);
+ // find the next one
+ j = Find(it, item);
}
-
+
// return the first one so the caller has the option of selecting it
return;
- }
- else
+ }
+ else
{
// major change, delete all instances relating to item
delItem(item);
@@ -354,18 +359,18 @@
j = Find(it, i, true);
// loop until we run out of pets
- while (j)
+ while (j)
{
- // create a new SpawnListItem
- SpawnListItem *k = new SpawnListItem(j);
-
- // set the item
- k->setShellItem(item);
- k->pickTextColor(item, m_player);
- k->update(m_player, tSpawnChangedALL);
-
- // find the next item
- j = Find(it, i);
+ // create a new SpawnListItem
+ SpawnListItem *k = new SpawnListItem(j);
+
+ // set the item
+ k->setShellItem(item);
+ k->pickTextColor(item, m_player);
+ k->update(m_player, tSpawnChangedALL);
+
+ // find the next item
+ j = Find(it, i);
}
}
} // if petOwnerId
@@ -388,44 +393,46 @@
break;
if ((item->filterFlags() & FILTER_FLAG_FILTERED) &&
- !cat->isFilteredFilter())
+ !cat->isFilteredFilter())
{
- continue;
+ continue;
}
if (cat->isFiltered(filterStr, level))
{
- // retrieve the list item associated with the category
- catlitem = m_categoryListItems.value((void*)cat, nullptr);
+ // retrieve the list item associated with the category
+ catlitem = m_categoryListItems.value((void*)cat, nullptr);
+ if (!catlitem)
+ continue;
- // We have a good category, add spawn as it's child
- j = new SpawnListItem(catlitem);
+ // We have a good category, add spawn as it's child
+ j = new SpawnListItem(catlitem);
#if 0
- seqDebug("`-- Adding to %s (%d)",
- (const char*)cat->name(), catlitem->childCount());
+ seqDebug("`-- Adding to %s (%d)",
+ (const char*)cat->name(), catlitem->childCount());
#endif
- j->setShellItem(item);
- j->update(m_player, tSpawnChangedALL);
+ j->setShellItem(item);
+ j->update(m_player, tSpawnChangedALL);
- // color spawn
- j->pickTextColor(item, m_player, cat->color());
-
- // update childcount in header
- catlitem->updateTitle(cat->name());
+ // color spawn
+ j->pickTextColor(item, m_player, cat->color());
+
+ // update childcount in header
+ catlitem->updateTitle(cat->name());
} // end if spawn should be in this category
}
} // end if categories
- else
+ else
{
// just create a new SpawnListItem
j = new SpawnListItem(this);
j->setShellItem(item);
-
+
// color spawn
j->pickTextColor(item, m_player);
j->update(m_player, tSpawnChangedALL);
} // else
-
+
return;
} // end addItem
@@ -438,7 +445,7 @@
SpawnListItem *j = NULL;
// create a list of items to be deleted
- QList<Q3ListViewItem*>* delList = new QList<Q3ListViewItem*>();
+ QList<SEQListViewItem*> delList;
// create a list of categories to be updated
QList<const Category*> catUpdateList;
@@ -446,50 +453,35 @@
const Category* cat;
// start at the top of the list
- Q3ListViewItemIterator it(this);
-
- do
+ SEQListViewItemIterator it(this);
+
+ do
{
// find the next item in the list
j = Find(it, item);
// if there was an item, delete it and all it's children
- if (j)
+ if (j)
{
- // seqDebug(" Deleting...");
- // delete children
- Q3ListViewItem* child = j->firstChild();
- Q3ListViewItem* next;
- while(child)
- {
- // get the next child
- next = (SpawnListItem *) child->nextSibling();
+ delList += j->takeChildren();
- // add to the list of items to delete
- delList->append(child);
-
- // the next child is now the current child
- child = next;
- }
-
// get the category that the item SpawnListItem belongs to
cat = getCategory(j);
// add to the list of items to delete
- delList->append(j);
+ delList.append(j);
// if there's a category, add it to the list to be updated
if (cat != NULL)
- catUpdateList.append(cat);
+ catUpdateList.append(cat);
} // if j
// not done until out of items
} while (j);
- // delete the list of items to be deleted, which auto-deletes the items
- qDeleteAll(*delList);
- delList->clear();
- delete delList;
+ // delete the list of items to be deleted
+ qDeleteAll(delList);
+ delList.clear();
// now iterate over the updated categories and update them
QList<const Category*>::iterator cit;
@@ -498,7 +490,7 @@
cat = *cit;
// retrieve the category list item
SpawnListItem* catlitem = m_categoryListItems.value((void*)cat, nullptr);
-
+
// update the list items title
catlitem->updateTitle(cat->name());
}
@@ -511,55 +503,55 @@
return;
// start iterator at the beginning of this QListView
- Q3ListViewItemIterator it(this);
+ SEQListViewItemIterator it(this);
SpawnListItem *j = NULL;
// attempt to find a match on an item that is not collapsed (open)
- do
+ do
{
// attempt to find the item
j = Find(it, item);
// if it's found, see if it's parent is open, and if so, select it
- if (j)
+ if (j)
{
// get the parent
- Q3ListViewItem* litem = (SpawnListItem*) j->parent();
+ SEQListViewItem* litem = (SpawnListItem*) j->parent();
bool bOpen = true;
// make sure the parent and all it's parents are open
- while (litem)
+ while (litem)
{
- // is it open
- if (!litem->isOpen())
- {
- // nope, stop looking at the parents, next item
- bOpen = false;
- break;
- }
-
- // get this parents parent
- litem = (SpawnListItem*) litem->parent();
+ // is it open
+ if (!isItemExpanded(litem))
+ {
+ // nope, stop looking at the parents, next item
+ bOpen = false;
+ break;
+ }
+
+ // get this parents parent
+ litem = (SpawnListItem*) litem->parent();
}
// yes, this one should be opened, finished
if (bOpen)
- break;
+ break;
}
// continue until out of items
} while (j);
-
+
// if an item was found, select it
- if (j)
+ if (j)
{
// select the item
setSelectedQuiet(j, true);
-
+
// if configured to do so, make sure it's visible
if (showeq_params->keep_selected_visible)
- ensureItemVisible(j);
+ scrollToItem(j);
}
else // try again forcing open
{
@@ -574,7 +566,7 @@
SpawnListItem* SpawnList::Selected()
{
- return ((SpawnListItem*) selectedItem());
+ return ((SpawnListItem*) currentItem());
}
@@ -581,12 +573,12 @@
void SpawnList::selectAndOpen(SpawnListItem *i)
{
// get the item
- Q3ListViewItem* item = i;
-
+ SEQListViewItem* item = i;
+
// loop over it's parents, opening all of them
- while (item)
+ while (item)
{
- item->setOpen(true);
+ expandItem(item);
item = (SpawnListItem*) item->parent();
}
@@ -595,17 +587,17 @@
// if configured to do so, make sure it's visible
if (showeq_params->keep_selected_visible)
- ensureItemVisible(i);
+ scrollToItem(i);
}
-void SpawnList::setSelectedQuiet(Q3ListViewItem* item, bool selected)
+void SpawnList::setSelectedQuiet(SEQListViewItem* item, bool selected)
{
- if (!item || (item->isSelected() == selected) ||
- !item->isSelectable())
+ if (!item || (item->isSelected() == selected ) ||
+ !(item->flags() & Qt::ItemIsSelectable))
return;
// get the old selection
- Q3ListViewItem *oldItem = selectedItem();
+ SEQListViewItem *oldItem = currentItem();
// unselect the old selected item if any
if ((oldItem != item) && (oldItem != NULL) && (oldItem->isSelected()))
@@ -618,12 +610,7 @@
// notifications since the selection state is already changed).
setCurrentItem(item);
- // repaint the old item
- if (oldItem != NULL)
- repaintItem(oldItem);
-
- // repaint the selected item
- repaintItem(item);
+ update();
}
// Select next item of the same type and id as currently selected item
@@ -634,7 +621,7 @@
const Item* item;
// retrieve the currently selected item
- i = (SpawnListItem *) selectedItem();
+ i = (SpawnListItem *) currentItem();
// nothing selected, nothing to do
if (!i)
@@ -641,7 +628,7 @@
return;
// start the iterator at the current item
- Q3ListViewItemIterator it(i);
+ SEQListViewItemIterator it(i);
// get the Item from the SpawnListItem
item = i->item();
@@ -652,11 +639,11 @@
i = Find(it, item);
// there are no more with item, wrap around to beginning
- if (!i)
+ if (!i)
i = Find(it, item, true);
// if it's found, select it, and make sure it's parents are open
- if (i)
+ if (i)
{
//seqDebug("SelectNext(): Next selection '%s'", i->text(0).latin1());
selectAndOpen(i);
@@ -671,7 +658,7 @@
const Item* item;
// start at the current item
- i = cur = (SpawnListItem *) selectedItem();
+ i = cur = (SpawnListItem *) currentItem();
// nothing selected, nothing to do
if (!i)
@@ -678,7 +665,7 @@
return;
// start the iterator at the current item
- Q3ListViewItemIterator it(i);
+ SEQListViewItemIterator it(i);
// get the SpawnShellitem from the SpawnListItem
item = i->item();
@@ -689,7 +676,7 @@
//seqDebug("SelectPrev(): Current selection '%s'", i->text(0).ascii());
// search backwards, wrapping around, until we hit the current item
- do
+ do
{
// the current item becomes the last item
last = i;
@@ -698,8 +685,8 @@
i = Find(it, item);
// if no more found, then wrap to the beginning
- if (!i)
- {
+ if (!i)
+ {
// Start searching again from the beginning
i = Find(it, item, true);
}
@@ -708,7 +695,7 @@
} while (i != cur);
// if there is a last item, select and open it.
- if (last)
+ if (last)
{
//seqDebug("SelectPrev(): Prev selection '%s'", i->text(0).ascii());
selectAndOpen(last);
@@ -718,7 +705,7 @@
void SpawnList::clear(void)
{
//seqDebug("SpawnList::clear()");
- Q3ListView::clear();
+ SEQListView::clear();
m_categoryListItems.clear();
// rebuild headers
@@ -733,7 +720,7 @@
// create the spawn list item
litem = new SpawnListItem(this);
-
+
// insert the category and it's respective list item
m_categoryListItems.insert((void*)cat, litem);
@@ -755,7 +742,7 @@
// set color
litem->setTextColor(cat->color());
-
+
// update count
litem->updateTitle(cat->name());
@@ -771,25 +758,11 @@
// if there's a list item associated with this category, clean it out
if (litem != NULL)
{
- SpawnListItem *next;
- SpawnListItem *child;
// remove all children from list
- // start with the first child
- child = (SpawnListItem *) litem->firstChild();
-
- // iterate until the category is out of children
- while (child)
- {
- // get the next child
- next = (SpawnListItem *) child->nextSibling();
-
- // delete the current child
- delete child;
-
- // the next child is now the current child
- child = next;
- }
+ QList<SEQListViewItem*> children = litem->takeChildren();
+ qDeleteAll(children);
+ children.clear();
// remove the item from the category list
delete m_categoryListItems.take((void*)cat);
@@ -803,7 +776,7 @@
m_categoryListItems.clear();
// clear out the list
- Q3ListView::clear();
+ SEQListView::clear();
}
void SpawnList::loadedCategories(void)
@@ -840,16 +813,16 @@
void SpawnList::playerLevelChanged(uint8_t)
{
- Q3ListViewItemIterator it(this);
+ SEQListViewItemIterator it(this);
SpawnListItem* slitem = NULL;
const Category* cat = NULL;
const Item* item = NULL;
-
+
// iterate until we are out of items
- while (it.current())
+ while (*it)
{
// get the current SpawnListItem
- slitem = (SpawnListItem*)it.current();
+ slitem = (SpawnListItem*)*it;
// if this is a top level item, see if it's a category item, and if so
// get the category.
@@ -861,17 +834,17 @@
for (it = m_categoryListItems.begin();
it != m_categoryListItems.end() && *it != NULL; ++it)
{
- if (slitem == *it)
- {
- cat = (const Category*)it.key();
- break;
- }
+ if (slitem == *it)
+ {
+ cat = (const Category*)it.key();
+ break;
+ }
}
}
// get the item associated with the list item
item = slitem->item();
-
+
// set the color
if (cat != NULL)
slitem->pickTextColor(item, m_player, cat->color());
@@ -899,7 +872,7 @@
const Item* item;
SpawnListItem* litem;
SpawnListItem* catlitem = m_categoryListItems.value((void*)cat, nullptr);
-
+
// iterate over all spawn types
for (uint8_t i = 0; i < (sizeof(types) / sizeof(spawnItemType)); i++)
{
@@ -919,25 +892,25 @@
// skip filtered spawns
if ((item->filterFlags() & FILTER_FLAG_FILTERED) &&
- !cat->isFilteredFilter())
- continue;
+ !cat->isFilteredFilter())
+ continue;
// if item is a spawn, get its level
if ((item->type() == tSpawn) || (item->type() == tPlayer))
- level = ((Spawn*)item)->level();
+ level = ((Spawn*)item)->level();
// does this spawn match the category
if (cat->isFiltered(filterString(item, flags), level))
{
- // yes, add it
- litem = new SpawnListItem(catlitem);
+ // yes, add it
+ litem = new SpawnListItem(catlitem);
- // set up the list item
- litem->setShellItem(item);
- litem->update(m_player, tSpawnChangedALL);
+ // set up the list item
+ litem->setShellItem(item);
+ litem->update(m_player, tSpawnChangedALL);
- // color the spawn
- litem->pickTextColor(item, m_player, cat->color());
+ // color the spawn
+ litem->pickTextColor(item, m_player, cat->color());
}
}
}
@@ -968,7 +941,7 @@
const Category* cat;
QString filterStr;
CategoryListIterator cit(m_categoryMgr->getCategories());
-
+
// iterate over all spawn types
for (uint8_t i = 0; i < (sizeof(types) / sizeof(spawnItemType)); i++)
{
@@ -1067,11 +1040,15 @@
}
}
-void SpawnList::selChanged(Q3ListViewItem* litem)
+void SpawnList::selChanged()
{
- if (litem == NULL)
- return;
-
+ QList<QTreeWidgetItem*> selected = selectedItems();
+ if (!selected.count()) return;
+
+ // the list is limited to one selection at a time, so we can take the first
+ SEQListViewItem* litem = selected.first();
+ if (litem == NULL) return;
+
const Item* item = ((SpawnListItem*)litem)->item();
// it might have been a category title selected, only select if it's an item
@@ -1079,36 +1056,37 @@
emit spawnSelected(item);
}
-void SpawnList::mousePressEvent(int button, Q3ListViewItem* litem,
- const QPoint &point, int col)
+void SpawnList::listItemPressed(QTreeWidgetItem* litem, int col)
{
- // Left Mouse Button Events
- if (button == Qt::LeftButton && litem != NULL)
- ...
[truncated message content] |
|
From: <cn...@us...> - 2020-11-03 02:02:51
|
Revision: 1095
http://sourceforge.net/p/seq/svn/1095
Author: cn187
Date: 2020-11-03 02:02:50 +0000 (Tue, 03 Nov 2020)
Log Message:
-----------
Convert QString to const char* for variadic call
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/packetstream.cpp
Modified: showeq/branches/pre_6_0_beta/src/packetstream.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-11-02 01:42:38 UTC (rev 1094)
+++ showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-11-03 02:02:50 UTC (rev 1095)
@@ -120,7 +120,8 @@
seqDebug("connect2: Unknown opcode '%s' with payload type '%s'",
opcodeName.toAscii().data(), payloadType);
seqDebug("\tfor receiver '%s' of type '%s' to member '%s'",
- receiver->objectName(), receiver->metaObject()->className(), member);
+ receiver->objectName().toAscii().data(),
+ receiver->metaObject()->className(), member);
return false;
}
@@ -148,7 +149,8 @@
seqDebug("\tdir '%d' payload '%s' szt '%d'",
m_dir, payloadType, szt);
seqDebug("\tfor receiver '%s' of type '%s' to member '%s'",
- receiver->objectName(), receiver->metaObject()->className(), member);
+ receiver->objectName().toAscii().data(),
+ receiver->metaObject()->className(), member);
return false;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-02 01:42:44
|
Revision: 1094
http://sourceforge.net/p/seq/svn/1094
Author: cn187
Date: 2020-11-02 01:42:38 +0000 (Mon, 02 Nov 2020)
Log Message:
-----------
Replace compatibility/deprecated functions with Qt4 equivalents
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/combatlog.cpp
showeq/branches/pre_6_0_beta/src/compassframe.cpp
showeq/branches/pre_6_0_beta/src/experiencelog.cpp
showeq/branches/pre_6_0_beta/src/guildlist.cpp
showeq/branches/pre_6_0_beta/src/interface.cpp
showeq/branches/pre_6_0_beta/src/main.cpp
showeq/branches/pre_6_0_beta/src/map.cpp
showeq/branches/pre_6_0_beta/src/messagewindow.cpp
showeq/branches/pre_6_0_beta/src/netdiag.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
Modified: showeq/branches/pre_6_0_beta/src/combatlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -269,8 +269,13 @@
#ifdef DEBUGCOMBAT
seqDebug("CombatWindow::initUI: starting...");
#endif
- QVBoxLayout* layout = new QVBoxLayout(boxLayout());
+ QWidget* mainWidget = new QWidget();
+ setWidget(mainWidget);
+
+ QVBoxLayout* layout = new QVBoxLayout(mainWidget);
+ layout->setContentsMargins(0, 0, 0, 0);
+
m_menu_bar = new QMenuBar(this);
layout->addWidget(m_menu_bar);
Modified: showeq/branches/pre_6_0_beta/src/compassframe.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/compassframe.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/compassframe.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -31,7 +31,13 @@
CompassFrame::CompassFrame(Player* player, QWidget* parent, const char* name)
: SEQWindow("Compass", "ShowEQ - Compass", parent, name)
{
- QVBoxLayout* layout = new QVBoxLayout(boxLayout());
+
+ QWidget* mainWidget = new QWidget();
+ setWidget(mainWidget);
+
+ QVBoxLayout* layout = new QVBoxLayout(mainWidget);
+ layout->setContentsMargins(0, 0, 0, 0);
+
m_compass = new Compass (this, "compass");
layout->addWidget(m_compass);
QWidget* coordsbox = new QWidget(this);
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -234,8 +234,12 @@
this, SLOT(calcZEMNextKill()) );
m_action_calc_zem->setCheckable(true);
- m_layout = new QVBoxLayout(boxLayout());
+ QWidget* mainWidget = new QWidget();
+ setWidget(mainWidget);
+ m_layout = new QVBoxLayout(mainWidget);
+ m_layout->setContentsMargins(0, 0, 0, 0);
+
m_menu_bar = new QMenuBar( this );
m_menu_bar->addMenu(m_view_menu );
//m_layout->addSpacing( m_menu_bar->height() + 5 );
Modified: showeq/branches/pre_6_0_beta/src/guildlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/guildlist.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/guildlist.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -164,9 +164,13 @@
m_showAlts = pSEQPrefs->getPrefBool("ShowAlts", preferenceName(), true);
- QBoxLayout* vLayout = new QVBoxLayout(boxLayout());
+ QWidget* mainWidget = new QWidget();
+ setWidget(mainWidget);
+
+ QBoxLayout* vLayout = new QVBoxLayout(mainWidget);
+ vLayout->setContentsMargins(0, 0, 0, 0);
QHBoxLayout* hLayout= new QHBoxLayout();
- vLayout->addLayout(hLayout);
+ vLayout->addLayout(hLayout);
// Guild Name
m_guildName = new QLabel("Guild", this);
Modified: showeq/branches/pre_6_0_beta/src/interface.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -101,9 +101,9 @@
#define ZONE_ORDER_DIAG
/* The main interface widget */
-EQInterface::EQInterface(DataLocationMgr* dlm,
- QWidget * parent, const char *name)
- : Q3MainWindow (parent),
+EQInterface::EQInterface(DataLocationMgr* dlm,
+ QWidget * parent, const char *name)
+ : Q3MainWindow (parent, nullptr, Qt::WType_TopLevel),
m_player(0),
m_dataLocationMgr(dlm),
m_mapMgr(0),
@@ -186,7 +186,7 @@
if (pSEQPrefs->isPreference("Font", section))
{
QFont appFont = pSEQPrefs->getPrefFont("Font", section, qApp->font());
- qApp->setFont( appFont, true );
+ qApp->setFont( appFont );
}
// initialize packet count
@@ -3117,18 +3117,17 @@
// get a new application font
QFont newFont;
- newFont = QFontDialog::getFont(&ok, QApplication::font(),
- this, name);
+ newFont = QFontDialog::getFont(&ok, QApplication::font(),
+ this, name);
// if the user clicked ok and selected a valid font, set it
if (ok)
{
// set the new application font
- qApp->setFont( newFont, true );
+ qApp->setFont( newFont );
// set the preference for future sessions
- pSEQPrefs->setPrefFont("Font", "Interface",
- newFont);
+ pSEQPrefs->setPrefFont("Font", "Interface", newFont);
// make sure the windows that override the application font, do so
emit restoreFonts();
@@ -3267,18 +3266,15 @@
newFont.setPointSize(8);
// get new status font
- newFont = QFontDialog::getFont(&ok,
- pSEQPrefs->getPrefFont("StatusFont",
- "Interface",
- newFont),
- this, name);
+ newFont = QFontDialog::getFont(&ok,
+ pSEQPrefs->getPrefFont("StatusFont", "Interface", newFont),
+ this, name);
// if the user clicked ok and selected a valid font, set it
if (ok)
{
// set the preference for future sessions
- pSEQPrefs->setPrefFont("StatusFont", "Interface",
- newFont);
+ pSEQPrefs->setPrefFont("StatusFont", "Interface", newFont);
// make sure to reset the status font since the previous call may have
// changed it
@@ -5612,14 +5608,14 @@
{
QPalette p( QColor( 239, 239, 239 ) );
qApp->setStyle("plastique");
- qApp->setPalette( p, TRUE );
+ qApp->setPalette(p);
}
break;
case 2: // windows
{
qApp->setStyle("windows");
- qApp->setFont( OrigFont, TRUE );
- qApp->setPalette( OrigPalette, TRUE );
+ qApp->setFont( OrigFont );
+ qApp->setPalette(OrigPalette);
}
break;
case 3: // cde
@@ -5645,8 +5641,8 @@
p.setColor( QPalette::Disabled, QColorGroup::Foreground, Qt::lightGray );
p.setColor( QPalette::Disabled, QColorGroup::Text, Qt::lightGray );
p.setColor( QPalette::Disabled, QColorGroup::ButtonText, Qt::lightGray );
- qApp->setPalette( p, TRUE );
- qApp->setFont( QFont( "times", OrigFont.pointSize() ), TRUE );
+ qApp->setPalette(p);
+ qApp->setFont( QFont( "times", OrigFont.pointSize() ) );
}
break;
case 5: // motif
@@ -5653,8 +5649,8 @@
{
QPalette p( QColor( 192, 192, 192 ) );
qApp->setStyle("motif");
- qApp->setPalette( p, TRUE );
- qApp->setFont( OrigFont, TRUE );
+ qApp->setPalette(p);
+ qApp->setFont( OrigFont );
}
break;
case 6: // cleanlooks
@@ -5661,8 +5657,8 @@
{
//QPalette p( QColor( 192, 192, 192 ) );
qApp->setStyle("cleanlooks");
- qApp->setPalette( OrigPalette, TRUE );
- qApp->setFont( OrigFont, TRUE );
+ qApp->setPalette(OrigPalette);
+ qApp->setFont( OrigFont );
}
break;
default: // system default
@@ -5669,8 +5665,8 @@
{
QPalette p( QColor( 192, 192, 192 ) );
qApp->setStyle("motif");
- qApp->setPalette( p, TRUE );
- qApp->setFont( OrigFont, TRUE );
+ qApp->setPalette(p);
+ qApp->setFont( OrigFont );
theme = 2;
}
break;
Modified: showeq/branches/pre_6_0_beta/src/main.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/main.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/main.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -746,8 +746,7 @@
{
/* The main interface widget */
EQInterface intf(&dataLocMgr, 0, "interface");
- qapp.setMainWidget (&intf);
-
+
/* Start the main loop */
ret = qapp.exec ();
}
Modified: showeq/branches/pre_6_0_beta/src/map.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/map.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -4632,8 +4632,12 @@
QLabel* tmpLabel;
+ QWidget* mainWidget = new QWidget();
+ setWidget(mainWidget);
+
// setup the vertical box
- m_vertical = new QVBoxLayout(boxLayout());
+ m_vertical = new QVBoxLayout(mainWidget);
+ m_vertical->setContentsMargins(0, 0, 0, 0);
// setup the top control window
m_topControlBox = new QWidget(this);
Modified: showeq/branches/pre_6_0_beta/src/messagewindow.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/messagewindow.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/messagewindow.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -122,7 +122,7 @@
setWindowTitle(caption);
// setup the GUI
- QGridLayout* grid = new QGridLayout(this, 5, 2);
+ QGridLayout* grid = new QGridLayout(this);
// sets margin around the grid
grid->setMargin(5);
@@ -130,8 +130,8 @@
m_findText = new QLineEdit(this);
m_findText->setReadOnly(false);
connect(m_findText, SIGNAL(textChanged(const QString&)),
- this, SLOT(textChanged(const QString&)));
- grid->addMultiCellWidget(m_findText, 0, 0, 1, 2);
+ this, SLOT(textChanged(const QString&)));
+ grid->addWidget(m_findText, 0, 1, 1, 3);
QLabel* label = new QLabel("Find &Text:", this);
label->setBuddy(m_findText);
grid->addWidget(label, 0, 0);
@@ -142,20 +142,14 @@
m_findBackwards = new QCheckBox("Find &Backwards", this);
grid->addWidget(m_findBackwards, 3, 1);
- QHBoxLayout* layout = new QHBoxLayout(grid);
- grid->addMultiCell(layout, 5, 5, 0, 2);
- layout->addStretch();
+
m_find = new QPushButton("&Find", this);
- layout->addWidget(m_find);
+ grid->addWidget(m_find, 4, 1);
m_find->setEnabled(false);
- connect(m_find, SIGNAL(clicked()),
- this, SLOT(find()));
- layout->addStretch();
+ connect(m_find, SIGNAL(clicked()), this, SLOT(find()));
QPushButton* close = new QPushButton("&Close", this);
- layout->addWidget(close);
- connect(close, SIGNAL(clicked()),
- this, SLOT(close()));
- layout->addStretch();
+ grid->addWidget(close, 4, 3);
+ connect(close, SIGNAL(clicked()), this, SLOT(close()));
// turn off resizing
setSizeGripEnabled(false);
Modified: showeq/branches/pre_6_0_beta/src/netdiag.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/netdiag.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/netdiag.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -35,15 +35,19 @@
m_packet(packet),
m_playbackSpeed(NULL)
{
+
+ QWidget* mainWidget = new QWidget();
+ setWidget(mainWidget);
+
// setResizeEnabled(false);
// get preferences
- QGridLayout* tmpGrid = new QGridLayout(boxLayout(), 26, 9);
- tmpGrid->addColSpacing(3, 5);
- tmpGrid->addColSpacing(6, 5);
- tmpGrid->addRowSpacing(1, 5);
- tmpGrid->addRowSpacing(3, 5);
- tmpGrid->addRowSpacing(6, 5);
- tmpGrid->addRowSpacing(8, 5);
+ QGridLayout* tmpGrid = new QGridLayout(mainWidget);
+ tmpGrid->addItem(new QSpacerItem(5, 0), 0, 3);
+ tmpGrid->addItem(new QSpacerItem(5, 0), 0, 6);
+ tmpGrid->addItem(new QSpacerItem(0, 5), 1, 0);
+ tmpGrid->addItem(new QSpacerItem(0, 5), 3, 0);
+ tmpGrid->addItem(new QSpacerItem(0, 5), 6, 0);
+ tmpGrid->addItem(new QSpacerItem(0, 5), 8, 0);
int row = 0;
int col = 0;
@@ -94,8 +98,8 @@
tmpGrid->addWidget(new QLabel("Filter: ", this), row, col++);
m_filterLabel = new QLabel(this);
m_filterLabel->setText(m_packet->pcapFilter());
- tmpGrid->addMultiCellWidget(m_filterLabel, row, row, col, col+5);
-
+ tmpGrid->addWidget(m_filterLabel, row, col, 1, 5);
+
// stream specific statistics
row++; row++; col = 0;
Modified: showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-02 01:42:23 UTC (rev 1093)
+++ showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-02 01:42:38 UTC (rev 1094)
@@ -65,7 +65,11 @@
int fpm = pSEQPrefs->getPrefInt("FPM", preferenceName(), 10);
m_delay = 60000L / fpm;
- QBoxLayout* vLayout = new QVBoxLayout(boxLayout());
+ QWidget* mainWidget = new QWidget();
+ setWidget(mainWidget);
+
+ QBoxLayout* vLayout = new QVBoxLayout(mainWidget);
+ vLayout->setContentsMargins(0, 0, 0, 0);
QHBoxLayout* hLayout= new QHBoxLayout();
vLayout->addLayout(hLayout);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-02 01:42:31
|
Revision: 1093
http://sourceforge.net/p/seq/svn/1093
Author: cn187
Date: 2020-11-02 01:42:23 +0000 (Mon, 02 Nov 2020)
Log Message:
-----------
Fix issues relating to setting of caption/font for windows
* Fix issue where setting default application/status fonts also prompted you
to set the spawnlist font
* Fix issue where setting spawnpointlist font/caption set them for spawnlist2
instead
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/interface.cpp
Modified: showeq/branches/pre_6_0_beta/src/interface.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-02 01:42:12 UTC (rev 1092)
+++ showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-02 01:42:23 UTC (rev 1093)
@@ -1715,11 +1715,13 @@
QMenu* windowFontMenu = new QMenu("&Font");
m_windowMenu->insertMenu(m_windowMenu->actions()[1], windowFontMenu);
- windowFontMenu->addAction("&Application Default...", this,
+ tmpAction = windowFontMenu->addAction("&Application Default...", this,
SLOT(set_main_Font()));
+ tmpAction->setData(-1);
- windowFontMenu->addAction("Main Window Status Font...", this,
+ tmpAction = windowFontMenu->addAction("Main Window Status Font...", this,
SLOT(set_main_statusbar_Font()));
+ tmpAction->setData(-1);
// x = windowFontMenu->insertItem("&Main Window");
// windowFontMenu->setItemParameter(x, 5);
@@ -2963,6 +2965,7 @@
widget = m_spawnPointList;
window = "Spawn Point List";
+ break;
case 10: // Spawn List
widget = m_spawnList2;
@@ -3015,6 +3018,16 @@
// up it will have to do
switch(winnum)
{
+ case -1:
+ // since the entire submenu is bound to this function, this function
+ // gets called for font changes that aren't handled here (default app
+ // and status bar). So we've set the ID to -1 in both case, and we
+ // ignore it here.
+ //
+ // TODO this can be fixed by creating an action group for the menu,
+ // adding the relevant entries to to, and then changing the connect
+ // call to connect the action group instead of the entire menu.
+ return;
case 0: // Spawn List
title = "Spawn List";
@@ -3062,6 +3075,7 @@
title = "Spawn Point List";
window = m_spawnPointList;
+ break;
case 10: // Spawn List
title = "Spawn List 2";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-02 01:42:15
|
Revision: 1092
http://sourceforge.net/p/seq/svn/1092
Author: cn187
Date: 2020-11-02 01:42:12 +0000 (Mon, 02 Nov 2020)
Log Message:
-----------
Replace compatibility/deprecated functions with Qt4 equivalents
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h
showeq/branches/pre_6_0_beta/src/netdiag.cpp
showeq/branches/pre_6_0_beta/src/packet.cpp
showeq/branches/pre_6_0_beta/src/packetinfo.cpp
showeq/branches/pre_6_0_beta/src/packetlog.cpp
showeq/branches/pre_6_0_beta/src/packetstream.cpp
showeq/branches/pre_6_0_beta/src/player.cpp
showeq/branches/pre_6_0_beta/src/seqlistview.cpp
showeq/branches/pre_6_0_beta/src/seqwindow.cpp
showeq/branches/pre_6_0_beta/src/spawn.cpp
showeq/branches/pre_6_0_beta/src/spawnlist.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
showeq/branches/pre_6_0_beta/src/spawnlist2.h
showeq/branches/pre_6_0_beta/src/spawnlistcommon.cpp
showeq/branches/pre_6_0_beta/src/spawnlistcommon.h
showeq/branches/pre_6_0_beta/src/spawnlog.cpp
showeq/branches/pre_6_0_beta/src/spawnmonitor.cpp
showeq/branches/pre_6_0_beta/src/spawnpointlist.cpp
showeq/branches/pre_6_0_beta/src/spawnpointlist.h
showeq/branches/pre_6_0_beta/src/spawnshell.cpp
showeq/branches/pre_6_0_beta/src/spelllist.cpp
showeq/branches/pre_6_0_beta/src/spelllist.h
showeq/branches/pre_6_0_beta/src/spells.cpp
showeq/branches/pre_6_0_beta/src/spellshell.cpp
showeq/branches/pre_6_0_beta/src/terminal.cpp
showeq/branches/pre_6_0_beta/src/util.cpp
showeq/branches/pre_6_0_beta/src/xmlconv.cpp
showeq/branches/pre_6_0_beta/src/xmlpreferences.cpp
showeq/branches/pre_6_0_beta/src/zonemgr.cpp
Modified: showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/mapicondialog.ui.h 2020-11-02 01:42:12 UTC (rev 1092)
@@ -40,48 +40,48 @@
// get image settings
m_currentMapIcon.setImage(m_useImage->isChecked());
- m_currentMapIcon.setImageStyle(MapIconStyle(m_imageImage->currentItem()));
- m_currentMapIcon.setImageSize(MapIconSize(m_imageSize->currentItem()));
+ m_currentMapIcon.setImageStyle(MapIconStyle(m_imageImage->currentIndex()));
+ m_currentMapIcon.setImageSize(MapIconSize(m_imageSize->currentIndex()));
m_currentMapIcon.setImageFlash(m_imageFlash->isChecked());
m_currentMapIcon.setImageUseSpawnColorPen(m_imageUseSpawnColorPen->isChecked());
pen = m_currentMapIcon.imagePen();
- pen.setStyle(Qt::PenStyle(m_imagePenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_imagePenStyle->currentIndex()));
pen.setWidth(m_imagePenWidth->value());
m_currentMapIcon.setImagePen(pen);
m_currentMapIcon.setImageUseSpawnColorBrush(m_imageUseSpawnColorBrush->isChecked());
brush = m_currentMapIcon.imageBrush();
- brush.setStyle(Qt::BrushStyle(m_imageBrushStyle->currentItem()));
+ brush.setStyle(Qt::BrushStyle(m_imageBrushStyle->currentIndex()));
m_currentMapIcon.setImageBrush(brush);
// get highlight settings
m_currentMapIcon.setHighlight(m_useHighlight->isChecked());
- m_currentMapIcon.setHighlightStyle(MapIconStyle(m_highlightImage->currentItem()));
- m_currentMapIcon.setHighlightSize(MapIconSize(m_highlightSize->currentItem()));
+ m_currentMapIcon.setHighlightStyle(MapIconStyle(m_highlightImage->currentIndex()));
+ m_currentMapIcon.setHighlightSize(MapIconSize(m_highlightSize->currentIndex()));
m_currentMapIcon.setHighlightFlash(m_highlightFlash->isChecked());
m_currentMapIcon.setHighlightUseSpawnColorPen(m_highlightUseSpawnColorPen->isChecked());
pen = m_currentMapIcon.highlightPen();
- pen.setStyle(Qt::PenStyle(m_highlightPenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_highlightPenStyle->currentIndex()));
pen.setWidth(m_highlightPenWidth->value());
m_currentMapIcon.setHighlightPen(pen);
m_currentMapIcon.setHighlightUseSpawnColorBrush(m_highlightUseSpawnColorBrush->isChecked());
brush = m_currentMapIcon.highlightBrush();
- brush.setStyle(Qt::BrushStyle(m_highlightBrushStyle->currentItem()));
+ brush.setStyle(Qt::BrushStyle(m_highlightBrushStyle->currentIndex()));
m_currentMapIcon.setHighlightBrush(brush);
// get line settings
m_currentMapIcon.setShowLine0(m_showLine0->isChecked());
pen = m_currentMapIcon.line0Pen();
- pen.setStyle(Qt::PenStyle(m_line0PenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_line0PenStyle->currentIndex()));
pen.setWidth(m_line0PenWidth->value());
m_currentMapIcon.setLine0Pen(pen);
m_currentMapIcon.setLine1Distance(m_line1Distance->value());
pen = m_currentMapIcon.line1Pen();
- pen.setStyle(Qt::PenStyle(m_line1PenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_line1PenStyle->currentIndex()));
pen.setWidth(m_line1PenWidth->value());
m_currentMapIcon.setLine1Pen(pen);
m_currentMapIcon.setLine2Distance(m_line2Distance->value());
pen = m_currentMapIcon.line2Pen();
- pen.setStyle(Qt::PenStyle(m_line2PenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_line2PenStyle->currentIndex()));
pen.setWidth(m_line2PenWidth->value());
m_currentMapIcon.setLine2Pen(pen);
@@ -90,7 +90,7 @@
m_currentMapIcon.setShowWalkPath(m_showWalkPath->isChecked());
m_currentMapIcon.setUseWalkPathPen(m_useWalkPathPen->isChecked());
pen = m_currentMapIcon.walkPathPen();
- pen.setStyle(Qt::PenStyle(m_walkPathPenStyle->currentItem()));
+ pen.setStyle(Qt::PenStyle(m_walkPathPenStyle->currentIndex()));
pen.setWidth(m_walkPathPenWidth->value());
m_currentMapIcon.setWalkPathPen(pen);
@@ -124,8 +124,8 @@
QString temp;
// setup the map icons combo box
for (int i = tIconTypeDrop; i <= tIconTypeMax; i++)
- m_mapIconCombo->insertItem(MapIcons::iconTypeName((MapIconType)i), i-1);
-
+ m_mapIconCombo->insertItem(i-1, MapIcons::iconTypeName((MapIconType)i));
+
int sizeWH = m_mapIconCombo->height() - 8;
int size = sizeWH >> 1;
QPoint point(size, size);
@@ -134,57 +134,57 @@
QPen pen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
for (int i = tIconStyleNone; i <= tIconStyleMax; i++)
{
- pix.fill(Qt::white);
- QPainter p(&pix);
- p.setPen(pen);
- p.setBrush(QBrush(Qt::gray));
- MapIcon::paintIconImage(MapIconStyle(i), p, point, size, sizeWH);
- p.end();
-
- temp = MapIcon::iconStyleName((MapIconStyle)i);
- m_imageImage->insertItem(pix, temp, i);
- m_highlightImage->insertItem(pix, temp, i);
+ pix.fill(Qt::white);
+ QPainter p(&pix);
+ p.setPen(pen);
+ p.setBrush(QBrush(Qt::gray));
+ MapIcon::paintIconImage(MapIconStyle(i), p, point, size, sizeWH);
+ p.end();
+
+ temp = MapIcon::iconStyleName((MapIconStyle)i);
+ m_imageImage->insertItem(i, pix, temp);
+ m_highlightImage->insertItem(i, pix, temp);
}
-
+
// setup the image sizes
for (int i = tIconSizeNone; i <= tIconSizeMax; i++)
{
- temp = MapIcon::iconSizeName((MapIconSize)i);
- m_imageSize->insertItem(temp, i);
- m_highlightSize->insertItem(temp, i);
+ temp = MapIcon::iconSizeName((MapIconSize)i);
+ m_imageSize->insertItem(i, temp);
+ m_highlightSize->insertItem(i, temp);
}
-
+
const QString penStyleNames[] =
{
- "None",
- "Solid",
- "Dash",
- "Dot",
- "Dash Dot",
- "Dash Dot Dot"
+ "None",
+ "Solid",
+ "Dash",
+ "Dot",
+ "Dash Dot",
+ "Dash Dot Dot"
};
-
+
// setup pen style names
pen = QPen(Qt::black, 0, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin);
for (int i = Qt::NoPen; i <= Qt::DashDotDotLine; i++)
{
- pix.fill(Qt::white);
- QPainter p(&pix);
- pen.setStyle(Qt::PenStyle(i));
- p.setPen(pen);
- p.setBrush(QBrush(Qt::gray));
- p.drawLine(point.x() - size, point.y() - size,
- point.x() + size, point.y() + size);
- p.end();
+ pix.fill(Qt::white);
+ QPainter p(&pix);
+ pen.setStyle(Qt::PenStyle(i));
+ p.setPen(pen);
+ p.setBrush(QBrush(Qt::gray));
+ p.drawLine(point.x() - size, point.y() - size,
+ point.x() + size, point.y() + size);
+ p.end();
- m_imagePenStyle->insertItem(pix, penStyleNames[i], i);
- m_highlightPenStyle->insertItem(pix, penStyleNames[i], i);
- m_line0PenStyle->insertItem(pix, penStyleNames[i], i);
- m_line1PenStyle->insertItem(pix, penStyleNames[i], i);
- m_line2PenStyle->insertItem(pix, penStyleNames[i], i);
- m_walkPathPenStyle->insertItem(pix, penStyleNames[i], i);
+ m_imagePenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_highlightPenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_line0PenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_line1PenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_line2PenStyle->insertItem(i, pix, penStyleNames[i]);
+ m_walkPathPenStyle->insertItem(i, pix, penStyleNames[i]);
}
-
+
const QString brushStyleNames[] =
{
"None",
@@ -209,17 +209,17 @@
pen.setWidth(0);
for (int i = Qt::NoBrush; i <= Qt::DiagCrossPattern; i++)
{
- pix.fill(Qt::white);
- QPainter p(&pix);
- p.setPen(pen);
- p.setBrush(QBrush(Qt::BrushStyle(i)));
- p.drawRect(point.x() - size, point.y() - size, sizeWH, sizeWH);
- p.end();
+ pix.fill(Qt::white);
+ QPainter p(&pix);
+ p.setPen(pen);
+ p.setBrush(QBrush(Qt::BrushStyle(i)));
+ p.drawRect(point.x() - size, point.y() - size, sizeWH, sizeWH);
+ p.end();
- m_imageBrushStyle->insertItem(pix, brushStyleNames[i], i);
- m_highlightBrushStyle->insertItem(pix, brushStyleNames[i], i);
+ m_imageBrushStyle->insertItem(i, pix, brushStyleNames[i]);
+ m_highlightBrushStyle->insertItem(i, pix, brushStyleNames[i]);
}
-
+
// setup the display
setupMapIconDisplay();
}
@@ -235,7 +235,7 @@
m_mapIcons = mapIcons;
// set the current map icon type
- m_currentMapIconType = MapIconType(m_mapIconCombo->currentItem() + 1);
+ m_currentMapIconType = MapIconType(m_mapIconCombo->currentIndex() + 1);
m_currentMapIcon = m_mapIcons->icon(m_currentMapIconType);
m_currentMapIconBackup = m_currentMapIcon;
@@ -261,14 +261,16 @@
void MapIconDialog::imagePenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.imagePen().color(),
- this, caption() + " Image Outline");
-
+ this, windowTitle() + " Image Outline");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.imagePen();
- pen.setColor(color);
- m_currentMapIcon.setImagePen(pen);
- m_imagePenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.imagePen();
+ pen.setColor(color);
+ m_currentMapIcon.setImagePen(pen);
+ QPalette p = m_imagePenColorSample->palette();
+ p.setColor(m_imagePenColorSample->backgroundRole(), color);
+ m_imagePenColorSample->setPalette(p);
}
}
@@ -275,14 +277,16 @@
void MapIconDialog::imageBrushColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.imageBrush().color(),
- this, caption() + " Image Fill");
-
+ this, windowTitle() + " Image Fill");
+
if (color.isValid())
{
- QBrush brush = m_currentMapIcon.imageBrush();
- brush.setColor(color);
- m_currentMapIcon.setImageBrush(brush );
- m_imageBrushColorSample->setPaletteBackgroundColor(color);
+ QBrush brush = m_currentMapIcon.imageBrush();
+ brush.setColor(color);
+ m_currentMapIcon.setImageBrush(brush );
+ QPalette p = m_imageBrushColorSample->palette();
+ p.setColor(m_imageBrushColorSample->backgroundRole(), color);
+ m_imageBrushColorSample->setPalette(p);
}
}
@@ -289,14 +293,16 @@
void MapIconDialog::highlightPenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.highlightPen().color(),
- this, caption() + " Highlight Outline");
-
+ this, windowTitle() + " Highlight Outline");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.highlightPen();
- pen.setColor(color);
- m_currentMapIcon.setHighlightPen(pen);
- m_highlightPenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.highlightPen();
+ pen.setColor(color);
+ m_currentMapIcon.setHighlightPen(pen);
+ QPalette p = m_highlightPenColorSample->palette();
+ p.setColor(m_highlightPenColorSample->backgroundRole(), color);
+ m_highlightPenColorSample->setPalette(p);
}
}
@@ -303,14 +309,16 @@
void MapIconDialog::highlightBrushColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.highlightBrush().color(),
- this, caption() + " Highlight Fill");
-
+ this, windowTitle() + " Highlight Fill");
+
if (color.isValid())
{
- QBrush brush = m_currentMapIcon.highlightBrush();
- brush.setColor(color);
- m_currentMapIcon.setHighlightBrush(brush );
- m_highlightBrushColorSample->setPaletteBackgroundColor(color);
+ QBrush brush = m_currentMapIcon.highlightBrush();
+ brush.setColor(color);
+ m_currentMapIcon.setHighlightBrush(brush );
+ QPalette p = m_highlightBrushColorSample->palette();
+ p.setColor(m_highlightBrushColorSample->backgroundRole(), color);
+ m_highlightBrushColorSample->setPalette(p);
}
}
@@ -317,14 +325,16 @@
void MapIconDialog::line0PenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.line0Pen().color(),
- this, caption() + " Line 0");
-
+ this, windowTitle() + " Line 0");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.line0Pen();
- pen.setColor(color);
- m_currentMapIcon.setLine0Pen(pen);
- m_line0PenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.line0Pen();
+ pen.setColor(color);
+ m_currentMapIcon.setLine0Pen(pen);
+ QPalette p = m_line0PenColorSample->palette();
+ p.setColor(m_line0PenColorSample->backgroundRole(), color);
+ m_line0PenColorSample->setPalette(p);
}
}
@@ -331,14 +341,16 @@
void MapIconDialog::line1PenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.line1Pen().color(),
- this, caption() + " Line 1");
-
+ this, windowTitle() + " Line 1");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.line1Pen();
- pen.setColor(color);
- m_currentMapIcon.setLine1Pen(pen);
- m_line1PenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.line1Pen();
+ pen.setColor(color);
+ m_currentMapIcon.setLine1Pen(pen);
+ QPalette p = m_line1PenColorSample->palette();
+ p.setColor(m_line1PenColorSample->backgroundRole(), color);
+ m_line1PenColorSample->setPalette(p);
}
}
@@ -345,14 +357,16 @@
void MapIconDialog::line2PenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.line2Pen().color(),
- this, caption() + " Line 2");
-
+ this, windowTitle() + " Line 2");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.line2Pen();
- pen.setColor(color);
- m_currentMapIcon.setLine2Pen(pen);
- m_line2PenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.line2Pen();
+ pen.setColor(color);
+ m_currentMapIcon.setLine2Pen(pen);
+ QPalette p = m_line2PenColorSample->palette();
+ p.setColor(m_line2PenColorSample->backgroundRole(), color);
+ m_line2PenColorSample->setPalette(p);
}
}
@@ -359,14 +373,16 @@
void MapIconDialog::walkPathPenColor_clicked()
{
QColor color = QColorDialog::getColor(m_currentMapIcon.walkPathPen().color(),
- this, caption() + " Walk Path Line");
-
+ this, windowTitle() + " Walk Path Line");
+
if (color.isValid())
{
- QPen pen = m_currentMapIcon.walkPathPen();
- pen.setColor(color);
- m_currentMapIcon.setWalkPathPen(pen);
- m_walkPathPenColorSample->setPaletteBackgroundColor(color);
+ QPen pen = m_currentMapIcon.walkPathPen();
+ pen.setColor(color);
+ m_currentMapIcon.setWalkPathPen(pen);
+ QPalette p = m_walkPathPenColorSample->palette();
+ p.setColor(m_walkPathPenColorSample->backgroundRole(), color);
+ m_walkPathPenColorSample->setPalette(p);
}
}
@@ -374,49 +390,66 @@
{
// setup image fields
m_useImage->setChecked(m_currentMapIcon.image());
- m_imageImage->setCurrentItem(m_currentMapIcon.imageStyle());
- m_imageSize->setCurrentItem(m_currentMapIcon.imageSize());
+ m_imageImage->setCurrentIndex(m_currentMapIcon.imageStyle());
+ m_imageSize->setCurrentIndex(m_currentMapIcon.imageSize());
m_imageFlash->setChecked(m_currentMapIcon.imageFlash());
m_imageUseSpawnColorPen->setChecked(m_currentMapIcon.imageUseSpawnColorPen());
- m_imagePenColorSample->setPaletteBackgroundColor(m_currentMapIcon.imagePen().color());
- m_imagePenStyle->setCurrentItem(m_currentMapIcon.imagePen().style());
+ QPalette p_ip = m_imagePenColorSample->palette();
+ p_ip.setColor(m_imagePenColorSample->backgroundRole(), m_currentMapIcon.imagePen().color());
+ m_imagePenColorSample->setPalette(p_ip);
+ m_imagePenStyle->setCurrentIndex(m_currentMapIcon.imagePen().style());
m_imagePenWidth->setValue(m_currentMapIcon.imagePen().width());
m_imageUseSpawnColorBrush->setChecked(m_currentMapIcon.imageUseSpawnColorBrush());
- m_imageBrushColorSample->setPaletteBackgroundColor(m_currentMapIcon.imageBrush().color());
- m_imageBrushStyle->setCurrentItem(m_currentMapIcon.imageBrush().style());
-
+ QPalette p_ib = m_imageBrushColorSample->palette();
+ p_ib.setColor(m_imageBrushColorSample->backgroundRole(), m_currentMapIcon.imageBrush().color());
+ m_imageBrushColorSample->setPalette(p_ib);
+
+ m_imageBrushStyle->setCurrentIndex(m_currentMapIcon.imageBrush().style());
+
// setup highlight fields
m_useHighlight->setChecked(m_currentMapIcon.highlight());
- m_highlightImage->setCurrentItem(m_currentMapIcon.highlightStyle());
- m_highlightSize->setCurrentItem(m_currentMapIcon.highlightSize());
+ m_highlightImage->setCurrentIndex(m_currentMapIcon.highlightStyle());
+ m_highlightSize->setCurrentIndex(m_currentMapIcon.highlightSize());
m_highlightFlash->setChecked(m_currentMapIcon.highlightFlash());
m_highlightUseSpawnColorPen->setChecked(m_currentMapIcon.highlightUseSpawnColorPen());
- m_highlightPenColorSample->setPaletteBackgroundColor(m_currentMapIcon.highlightPen().color());
- m_highlightPenStyle->setCurrentItem(m_currentMapIcon.highlightPen().style());
+ QPalette p_hp = m_highlightPenColorSample->palette();
+ p_ib.setColor(m_highlightPenColorSample->backgroundRole(), m_currentMapIcon.highlightPen().color());
+ m_highlightPenColorSample->setPalette(p_ib);
+ m_highlightPenStyle->setCurrentIndex(m_currentMapIcon.highlightPen().style());
m_highlightPenWidth->setValue(m_currentMapIcon.highlightPen().width());
m_highlightUseSpawnColorBrush->setChecked(m_currentMapIcon.highlightUseSpawnColorBrush());
- m_highlightBrushColorSample->setPaletteBackgroundColor(m_currentMapIcon.highlightBrush().color());
- m_highlightBrushStyle->setCurrentItem(m_currentMapIcon.highlightBrush().style());
-
+ QPalette p_hb = m_highlightBrushColorSample->palette();
+ p_hb.setColor(m_highlightBrushColorSample->backgroundRole(), m_currentMapIcon.highlightBrush().color());
+ m_highlightBrushColorSample->setPalette(p_hb);
+ m_highlightBrushStyle->setCurrentIndex(m_currentMapIcon.highlightBrush().style());
+
// setup lines
m_showLine0->setChecked(m_currentMapIcon.showLine0());
- m_line0PenColorSample->setPaletteBackgroundColor(m_currentMapIcon.line0Pen().color());
- m_line0PenStyle->setCurrentItem(m_currentMapIcon.line0Pen().style());
+ QPalette p_l0 = m_line0PenColorSample->palette();
+ p_l0.setColor(m_line0PenColorSample->backgroundRole(), m_currentMapIcon.line0Pen().color());
+ m_line0PenColorSample->setPalette(p_l0);
+ m_line0PenStyle->setCurrentIndex(m_currentMapIcon.line0Pen().style());
m_line0PenWidth->setValue(m_currentMapIcon.line0Pen().width());
m_line1Distance->setValue(m_currentMapIcon.line1Distance());
- m_line1PenColorSample->setPaletteBackgroundColor(m_currentMapIcon.line1Pen().color());
- m_line1PenStyle->setCurrentItem(m_currentMapIcon.line1Pen().style());
+ QPalette p_l1 = m_line1PenColorSample->palette();
+ p_l1.setColor(m_line1PenColorSample->backgroundRole(), m_currentMapIcon.line1Pen().color());
+ m_line1PenColorSample->setPalette(p_l1);
+ m_line1PenStyle->setCurrentIndex(m_currentMapIcon.line1Pen().style());
m_line1PenWidth->setValue(m_currentMapIcon.line1Pen().width());
m_line2Distance->setValue(m_currentMapIcon.line2Distance());
- m_line2PenColorSample->setPaletteBackgroundColor(m_currentMapIcon.line2Pen().color());
- m_line2PenStyle->setCurrentItem(m_currentMapIcon.line2Pen().style());
+ QPalette p_l2 = m_line2PenColorSample->palette();
+ p_l2.setColor(m_line2PenColorSample->backgroundRole(), m_currentMapIcon.line2Pen().color());
+ m_line2PenColorSample->setPalette(p_l2);
+ m_line2PenStyle->setCurrentIndex(m_currentMapIcon.line2Pen().style());
m_line2PenWidth->setValue(m_currentMapIcon.line2Pen().width());
-
+
// setup other
m_showName->setChecked(m_currentMapIcon.showName());
m_showWalkPath->setChecked(m_currentMapIcon.showWalkPath());
m_useWalkPathPen->setChecked(m_currentMapIcon.useWalkPathPen());
- m_walkPathPenColorSample->setPaletteBackgroundColor(m_currentMapIcon.walkPathPen().color());
- m_walkPathPenStyle->setCurrentItem(m_currentMapIcon.walkPathPen().style());
+ QPalette p_wp = m_walkPathPenColorSample->palette();
+ p_wp.setColor(m_walkPathPenColorSample->backgroundRole(), m_currentMapIcon.walkPathPen().color());
+ m_walkPathPenColorSample->setPalette(p_wp);
+ m_walkPathPenStyle->setCurrentIndex(m_currentMapIcon.walkPathPen().style());
m_walkPathPenWidth->setValue(m_currentMapIcon.walkPathPen().width());
}
Modified: showeq/branches/pre_6_0_beta/src/netdiag.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/netdiag.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/netdiag.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -105,7 +105,7 @@
{
tmpGrid->addWidget(new QLabel(eqStreams[a], this), row, col++);
tmpGrid->addWidget(new QLabel("Max Length:", this), row, col++);
- m_maxLength[a] = new QLabel(this, "unknown");
+ m_maxLength[a] = new QLabel("unknown", this);
m_maxLength[a]->setNum((int)m_packet->currentMaxLength(a));
tmpGrid->addWidget(m_maxLength[a], row, col++);
col++;
@@ -115,15 +115,15 @@
// packet throughput
tmpGrid->addWidget(new QLabel("Packets ", this), row, col++);
tmpGrid->addWidget(new QLabel("Total: ", this), row, col++);
- m_packetTotal[a] = new QLabel(this, "count");
+ m_packetTotal[a] = new QLabel("count", this);
tmpGrid->addWidget(m_packetTotal[a], row, col++);
col++;
tmpGrid->addWidget(new QLabel("Recent: ", this), row, col++);
- m_packetRecent[a] = new QLabel(this, "recent");
+ m_packetRecent[a] = new QLabel("recent", this);
tmpGrid->addWidget(m_packetRecent[a], row, col++);
col++;
tmpGrid->addWidget(new QLabel("Rate: ", this), row, col++);
- m_packetAvg[a] = new QLabel(this, "avg");
+ m_packetAvg[a] = new QLabel("avg", this);
tmpGrid->addWidget(m_packetAvg[a], row, col++);
resetPacket(m_packet->packetCount(a), a);
@@ -132,19 +132,19 @@
// network status
tmpGrid->addWidget(new QLabel("Status ", this), row, col++);
tmpGrid->addWidget(new QLabel("Cached: ", this), row, col++);
- m_cache[a] = new QLabel(this, "cached");
+ m_cache[a] = new QLabel("cached", this);
m_cache[a]->setNum((int)m_packet->currentCacheSize(a));
tmpGrid->addWidget(m_cache[a], row, col++);
col++;
tmpGrid->addWidget(new QLabel("SeqExp: ", this), row, col++);
- m_seqExp[a] = new QLabel(this, "seqexp");
+ m_seqExp[a] = new QLabel("seqexp", this);
tmpGrid->addWidget(m_seqExp[a], row, col++);
col++;
tmpGrid->addWidget(new QLabel("SeqCur: ", this), row, col++);
- m_seqCur[a] = new QLabel(this, "seqcur");
+ m_seqCur[a] = new QLabel("seqcur", this);
tmpGrid->addWidget(m_seqCur[a], row, col++);
row++; row++; col = 0;
- seqExpect(m_packet->serverSeqExp(a), a);
+ seqExpect(m_packet->serverSeqExp(a), a);
m_seqCur[a]->setText("????");
}
@@ -152,7 +152,11 @@
{
tmpGrid->addWidget(new QLabel("Playback ", this), row, col++);
tmpGrid->addWidget(new QLabel("Rate: ", this), row, col++);
- m_playbackSpeed = new QSpinBox(-1, 9, 1, this, "speed");
+ m_playbackSpeed = new QSpinBox(this);
+ m_playbackSpeed->setObjectName("speed");
+ m_playbackSpeed->setMinimum(-1);
+ m_playbackSpeed->setMaximum(9);
+ m_playbackSpeed->setSingleStep(1);
m_playbackSpeed->setSuffix("x");
m_playbackSpeed->setSpecialValueText("Pause");
m_playbackSpeed->setWrapping(true);
@@ -170,7 +174,7 @@
QShortcut *decPlayback_shortcut = new QShortcut(key, this);
connect (decPlayback_shortcut, SIGNAL(activated()), m_packet, SLOT(decPlayback()));
}
-
+
// supply the LCD's with signals
connect (m_packet, SIGNAL(cacheSize(int, int)),
this, SLOT(cacheSize(int, int)));
Modified: showeq/branches/pre_6_0_beta/src/packet.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packet.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/packet.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -104,7 +104,7 @@
int playbackPackets,
int8_t playbackSpeed,
QObject * parent, const char *name)
- : QObject (parent, name),
+ : QObject (parent),
m_packetCapture(NULL),
m_vPacket(NULL),
m_timer(NULL),
@@ -119,6 +119,7 @@
m_playbackPackets(playbackPackets),
m_playbackSpeed(playbackSpeed)
{
+ setObjectName(name);
// create the packet type db
m_packetTypeDB = new EQPacketTypeDB();
@@ -131,8 +132,8 @@
// load the world opcode db
if (!m_worldOPCodeDB->load(*m_packetTypeDB, worldopcodesxml))
- seqFatal("Error loading '%s'!", (const char*)worldopcodesxml);
-
+ seqFatal("Error loading '%s'!", worldopcodesxml.toAscii().data());
+
#ifdef PACKET_OPCODEDB_DIAG
m_worldOPCodeDB->list();
#endif
@@ -144,7 +145,7 @@
// load the zone opcode db
if (!m_zoneOPCodeDB->load(*m_packetTypeDB, zoneopcodesxml))
- seqFatal("Error loading '%s'!", (const char*)zoneopcodesxml);
+ seqFatal("Error loading '%s'!", zoneopcodesxml.toAscii().data());
#ifdef PACKET_OPCODEDB_DIAG
m_zoneOPCodeDB->list();
@@ -200,11 +201,11 @@
if (m_ip == "auto")
inet_aton (AUTOMATIC_CLIENT_IP, &ia);
- else if (inet_aton (m_ip, &ia) == 0)
+ else if (inet_aton (m_ip.toAscii().data(), &ia) == 0)
{
- he = gethostbyname(m_ip);
+ he = gethostbyname(m_ip.toAscii().data());
if (!he)
- seqFatal("Invalid address; %s", (const char*)m_ip);
+ seqFatal("Invalid address; %s", m_ip.toAscii().data());
memcpy (&ia, he->h_addr_list[0], he->h_length);
}
@@ -219,23 +220,22 @@
else
{
m_detectingClient = false;
- seqInfo("Listening for client: %s",
- (const char*)m_ip);
+ seqInfo("Listening for client: %s", m_ip.toAscii().data());
}
}
-
+
if (m_playbackPackets == PLAYBACK_OFF)
{
// create the pcap object and initialize, either with MAC or IP
m_packetCapture = new PacketCaptureThread();
if (m_mac.length() == 17)
- m_packetCapture->start(m_device,
- m_mac,
- m_realtime, MAC_ADDRESS_TYPE );
+ m_packetCapture->start(m_device.toAscii().data(),
+ m_mac.toAscii().data(),
+ m_realtime, MAC_ADDRESS_TYPE );
else
- m_packetCapture->start(m_device,
- m_ip,
- m_realtime, IP_ADDRESS_TYPE );
+ m_packetCapture->start(m_device.toAscii().data(),
+ m_ip.toAscii().data(),
+ m_realtime, IP_ADDRESS_TYPE );
emit filterChanged();
}
else if (m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
@@ -243,12 +243,11 @@
// Create the pcap object and initialize with the file input given
m_packetCapture = new PacketCaptureThread();
- const char* filename =
- pSEQPrefs->getPrefString("Filename", "VPacket");
+ QString filename = pSEQPrefs->getPrefString("Filename", "VPacket");
- m_packetCapture->startOffline(filename, m_playbackSpeed);
- seqInfo("Playing back packets from '%s' at speed '%d'",
- filename, m_playbackSpeed);
+ m_packetCapture->startOffline(filename.toAscii().data(), m_playbackSpeed);
+ seqInfo("Playing back packets from '%s' at speed '%d'",
+ filename.toAscii().data(), m_playbackSpeed);
}
// Flag session tracking properly on streams
@@ -282,26 +281,26 @@
// Second param is playback speed: 0 = fast as poss, 1 = 1X, 2 = 2X etc
if (pSEQPrefs->isPreference("Filename", section))
{
- const char *filename = pSEQPrefs->getPrefString("Filename", section);
-
+ QString filename = pSEQPrefs->getPrefString("Filename", section);
+
if (m_recordPackets)
{
- m_vPacket = new VPacket(filename, 1, true);
+ m_vPacket = new VPacket(filename.toAscii().data(), 1, true);
// Must appear befire next call to getPrefString, which uses a static string
- seqInfo("Recording packets to '%s' for future playback", filename);
-
+ seqInfo("Recording packets to '%s' for future playback", filename.toAscii().data());
+
if (!pSEQPrefs->getPrefString("FlushPackets", section).isNull())
- m_vPacket->setFlushPacket(true);
+ m_vPacket->setFlushPacket(true);
}
else if (m_playbackPackets == PLAYBACK_FORMAT_SEQ)
{
- m_vPacket = new VPacket(filename, 1, false);
+ m_vPacket = new VPacket(filename.toAscii().data(), 1, false);
m_vPacket->setCompressTime(pSEQPrefs->getPrefInt("CompressTime", section, 0));
m_vPacket->setPlaybackSpeed(m_playbackSpeed);
-
- seqInfo("Playing back packets from '%s' at speed '%d'", filename,
-
- m_playbackSpeed);
+
+ seqInfo("Playing back packets from '%s' at speed '%d'", filename.toAscii().data(),
+
+ m_playbackSpeed);
}
}
else
@@ -371,7 +370,7 @@
#ifdef DEBUG_PACKET
qDebug ("start()");
#endif /* DEBUG_PACKET */
- m_timer->start (delay, false);
+ m_timer->start (delay);
}
/* Stop the timer to process packets */
@@ -612,7 +611,7 @@
m_client_addr = packet.getIPv4DestN();
m_detectingClient = false;
emit clientChanged(m_client_addr);
- seqInfo("Client Detected: %s", (const char*)m_ip);
+ seqInfo("Client Detected: %s", m_ip.toAscii().data());
}
else if (m_detectingClient &&
(packet.getDestPort() >= WorldServerGeneralMinPort
@@ -622,7 +621,7 @@
m_client_addr = packet.getIPv4SourceN();
m_detectingClient = false;
emit clientChanged(m_client_addr);
- seqInfo("Client Detected: %s", (const char*)m_ip);
+ seqInfo("Client Detected: %s", m_ip.toAscii().data());
}
// Dispatch based on known streams
@@ -691,8 +690,8 @@
(m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP))
{
- m_packetCapture->setFilter(m_device, m_ip,
- m_realtime, IP_ADDRESS_TYPE, 0, 0);
+ m_packetCapture->setFilter(m_device.toAscii().data(), m_ip.toAscii().data(),
+ m_realtime, IP_ADDRESS_TYPE, 0, 0);
emit filterChanged();
}
@@ -711,7 +710,7 @@
emit clientPortLatched(m_clientPort);
seqInfo("EQPacket: SessionDisconnect detected, awaiting next zone session, pcap filter: EQ Client %s",
- (const char*)m_ip);
+ m_ip.toAscii().data());
}
}
@@ -722,25 +721,25 @@
m_serverPort = serverPort;
m_clientPort = clientPort;
- if (m_playbackPackets == PLAYBACK_OFF ||
+ if (m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
{
if (m_mac.length() == 17)
{
- m_packetCapture->setFilter(m_device,
- m_mac,
- m_realtime,
- MAC_ADDRESS_TYPE, 0,
- m_clientPort);
+ m_packetCapture->setFilter(m_device.toAscii().data(),
+ m_mac.toAscii().data(),
+ m_realtime,
+ MAC_ADDRESS_TYPE, 0,
+ m_clientPort);
emit filterChanged();
}
else
{
- m_packetCapture->setFilter(m_device,
- m_ip,
- m_realtime,
- IP_ADDRESS_TYPE, 0,
- m_clientPort);
+ m_packetCapture->setFilter(m_device.toAscii().data(),
+ m_ip.toAscii().data(),
+ m_realtime,
+ IP_ADDRESS_TYPE, 0,
+ m_clientPort);
emit filterChanged();
}
}
@@ -749,14 +748,14 @@
if (m_mac.length() == 17)
{
seqInfo("EQPacket: SessionRequest detected, pcap filter: EQ Client %s, Client port %d. Server port %d",
- (const char*)m_mac, m_clientPort, m_serverPort);
+ m_mac.toAscii().data(), m_clientPort, m_serverPort);
}
else
{
seqInfo("EQPacket: SessionRequest detected, pcap filter: EQ Client %s, Client port %d. Server port %d",
- (const char*)m_ip, m_clientPort, m_serverPort);
+ m_ip.toAscii().data(), m_clientPort, m_serverPort);
}
-
+
emit clientPortLatched(m_clientPort);
}
@@ -918,19 +917,20 @@
{
m_ip = ip;
struct in_addr ia;
- inet_aton (m_ip, &ia);
+ inet_aton (m_ip.toAscii().data(), &ia);
m_client_addr = ia.s_addr;
emit clientChanged(m_client_addr);
-
+
resetEQPacket();
-
- seqInfo("Listening for IP client: %s", (const char*)m_ip);
- if (m_playbackPackets == PLAYBACK_OFF ||
+
+ seqInfo("Listening for IP client: %s", m_ip.toAscii().data());
+ if (m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
{
- m_packetCapture->setFilter(m_device, m_ip,
- m_realtime,
- IP_ADDRESS_TYPE, 0, 0);
+ m_packetCapture->setFilter(m_device.toAscii().data(),
+ m_ip.toAscii().data(),
+ m_realtime,
+ IP_ADDRESS_TYPE, 0, 0);
emit filterChanged();
}
}
@@ -948,15 +948,15 @@
resetEQPacket();
- seqInfo("Listening for MAC client: %s",
- (const char*)m_mac);
+ seqInfo("Listening for MAC client: %s", m_mac.toAscii().data());
if (m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
{
- m_packetCapture->setFilter(m_device, m_ip,
- m_realtime,
- IP_ADDRESS_TYPE, 0, 0);
+ m_packetCapture->setFilter(m_device.toAscii().data(),
+ m_ip.toAscii().data(),
+ m_realtime,
+ IP_ADDRESS_TYPE, 0, 0);
emit filterChanged();
}
}
@@ -968,7 +968,7 @@
m_detectingClient = true;
m_ip = AUTOMATIC_CLIENT_IP;
struct in_addr ia;
- inet_aton (m_ip, &ia);
+ inet_aton (m_ip.toAscii().data(), &ia);
m_client_addr = ia.s_addr;
emit clientChanged(m_client_addr);
@@ -979,9 +979,9 @@
if (m_playbackPackets == PLAYBACK_OFF ||
m_playbackPackets == PLAYBACK_FORMAT_TCPDUMP)
{
- m_packetCapture->setFilter(m_device, NULL,
- m_realtime,
- DEFAULT_ADDRESS_TYPE, 0, 0);
+ m_packetCapture->setFilter(m_device.toAscii().data(), NULL,
+ m_realtime,
+ DEFAULT_ADDRESS_TYPE, 0, 0);
emit filterChanged();
}
}
@@ -1008,20 +1008,20 @@
/* Substitute "special" IP which is interpreted
to set up a different filter for picking up new sessions */
-
+
if (m_ip == "auto")
inet_aton (AUTOMATIC_CLIENT_IP, &ia);
- else if (inet_aton (m_ip, &ia) == 0)
+ else if (inet_aton (m_ip.toAscii().data(), &ia) == 0)
{
- he = gethostbyname(m_ip);
+ he = gethostbyname(m_ip.toAscii().data());
if (!he)
- seqFatal("Invalid address; %s", (const char*)m_ip);
+ seqFatal("Invalid address; %s", m_ip.toAscii().data());
memcpy (&ia, he->h_addr_list[0], he->h_length);
}
m_client_addr = ia.s_addr;
m_ip = inet_ntoa(ia);
-
+
if (m_ip == AUTOMATIC_CLIENT_IP)
{
m_detectingClient = true;
@@ -1030,21 +1030,20 @@
else
{
m_detectingClient = false;
- seqInfo("Listening for client: %s",
- (const char*)m_ip);
+ seqInfo("Listening for client: %s", m_ip.toAscii().data());
}
}
-
+
resetEQPacket();
// restart packet capture
if (m_mac.length() == 17)
- m_packetCapture->start(m_device,
- m_mac,
- m_realtime, MAC_ADDRESS_TYPE );
+ m_packetCapture->start(m_device.toAscii().data(),
+ m_mac.toAscii().data(),
+ m_realtime, MAC_ADDRESS_TYPE );
else
- m_packetCapture->start(m_device, m_ip,
- m_realtime, IP_ADDRESS_TYPE );
+ m_packetCapture->start(m_device.toAscii().data(), m_ip.toAscii().data(),
+ m_realtime, IP_ADDRESS_TYPE );
emit filterChanged();
}
Modified: showeq/branches/pre_6_0_beta/src/packetinfo.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -137,8 +137,9 @@
//----------------------------------------------------------------------
// EQPacketDispatch
EQPacketDispatch::EQPacketDispatch(QObject* parent, const char* name)
- : QObject(parent, name)
+ : QObject(parent)
{
+ setObjectName(name);
}
EQPacketDispatch::~EQPacketDispatch()
@@ -319,12 +320,13 @@
// create a QTextStream object on the QFile object
QTextStream out(&file);
-
+
// set the output encoding to be UTF8
- out.setEncoding(QTextStream::UnicodeUTF8);
+ out.setCodec("UTF-8");
// set the number output to be left justified decimal
- out.setf(QTextStream::dec | QTextStream::left);
+ out.setIntegerBase(10);
+ out.setFieldAlignment(QTextStream::AlignLeft);
// print document header
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl
@@ -446,29 +448,29 @@
if (!it.value())
break;
current = it.value();
- fprintf(stderr, "\tkey=%04lx opcode=%04x",
+ fprintf(stderr, "\tkey=%04x opcode=%04x",
it.key(), current->opcode());
if (!current->name().isNull())
- fprintf(stderr, " name='%s'", current->name().latin1());
+ fprintf(stderr, " name='%s'", current->name().toLatin1().data());
if (current->implicitLen())
fprintf(stderr, " implicitlen='%d'", current->implicitLen());
-
+
if (!current->updated().isNull())
- fprintf(stderr, " updated='%s'", current->updated().latin1());
+ fprintf(stderr, " updated='%s'", current->updated().toLatin1().data());
fputc('\n', stderr);
QStringList comments = current->comments();
-
+
fprintf(stderr, "\t\t%d comment(s)\n", comments.count());
- for (QStringList::Iterator cit = comments.begin();
- cit != comments.end(); ++cit)
- fprintf(stderr, "\t\t\t'%s'\n", (*cit).latin1());
-
+ for (QStringList::Iterator cit = comments.begin();
+ cit != comments.end(); ++cit)
+ fprintf(stderr, "\t\t\t'%s'\n", (*cit).toLatin1().data());
+
fprintf(stderr, "\t\t%d payload(s)\n", current->count());
-
+
QListIterator<EQPacketPayload*> pit(*current);
while (pit.hasNext())
{
@@ -477,7 +479,7 @@
break;
seqInfo("\t\t\tdir=%d typename=%s size=%d sizechecktype=%d",
- currentPayload->dir(), (const char*)currentPayload->typeName(),
+ currentPayload->dir(), currentPayload->typeName().toAscii().data(),
currentPayload->typeSize(), currentPayload->sizeCheckType());
}
}
@@ -602,7 +604,7 @@
if (!ok)
{
seqWarn("OPCodeXmlContentHandler::startElement(): opcode '%s' failed to convert to uint16_t (result: %#04x)",
- attr.value(index).latin1(), opcode);
+ attr.value(index).toLatin1().data(), opcode);
return false; // this is an error
}
@@ -689,9 +691,9 @@
if (!value.isEmpty())
{
- if (!m_currentPayload->setType(m_typeDB, value))
- seqWarn("Unknown payload typename '%s' for opcode '%04x'",
- value.latin1(), m_currentOPCode->opcode());
+ if (!m_currentPayload->setType(m_typeDB, value.toAscii().data()))
+ seqWarn("Unknown payload typename '%s' for opcode '%04x'",
+ value.toLatin1().data(), m_currentOPCode->opcode());
}
}
Modified: showeq/branches/pre_6_0_beta/src/packetlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetlog.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/packetlog.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -94,9 +94,9 @@
{
if (!open())
return;
-
- outputf ("%s\n", (const char*)message);
+ outputf ("%s\n", message.toAscii().data());
+
flush();
}
@@ -109,11 +109,11 @@
return;
if (!prefix.isEmpty())
- outputf("%s ", (const char*)prefix.utf8());
+ outputf("%s ", prefix.toUtf8().data());
- outputf("[Size: %d] %s\n",
- len,
- (const char*)QDateTime::currentDateTime().toString(m_timeDateFormat).utf8());
+ outputf("[Size: %d] %s\n",
+ len,
+ QDateTime::currentDateTime().toString(m_timeDateFormat).toUtf8().data());
// make sure there is a len before attempting to print it
if (len)
@@ -300,14 +300,14 @@
uint16_t opcode, const QString& origPrefix)
{
if (!origPrefix.isEmpty())
- ::printf("%s ", (const char*)origPrefix);
+ ::printf("%s ", origPrefix.toAscii().data());
else
::putchar('\n');
-
- ::printf("%s [Size: %u]%s\n",
- ((dir == DIR_Server) ? "[Server->Client]" : "[Client->Server]"),
- len, (const char*)opCodeToString(opcode));
+ ::printf("%s [Size: %lu]%s\n",
+ ((dir == DIR_Server) ? "[Server->Client]" : "[Client->Server]"),
+ len, opCodeToString(opcode).toAscii().data());
+
if (len)
{
for (size_t a = 0; a < len; a ++)
@@ -415,8 +415,7 @@
}
seqInfo("OpCode monitoring ENABLED...");
- seqInfo("Using list:\t%s",
- (const char*)monitoredOPCodes);
+ seqInfo("Using list:\t%s", monitoredOPCodes.toAscii().data());
QString qsCommaBuffer (""); /* Construct these outside the loop so we don't have to construct
@@ -434,59 +433,59 @@
MonitoredOpCodeList [uiIndex] [1] = 3; /* Direction, DEFAULT: Client <--> Server */
MonitoredOpCodeList [uiIndex] [2] = 1; /* Show raw data if packet is marked as known */
MonitoredOpCodeAliasList [uiIndex] = "Monitored OpCode"; /* Name used when displaying the raw data */
-
- iCommaPos = monitoredOPCodes.find (",");
-
+
+ iCommaPos = monitoredOPCodes.indexOf(",");
+
if (iCommaPos == -1)
iCommaPos = monitoredOPCodes.length ();
-
+
qsCommaBuffer = monitoredOPCodes.left (iCommaPos);
monitoredOPCodes.remove (0, iCommaPos + 1);
-
+
uiIterationID = 0;
-
+
uint8_t uiColonCount = qsCommaBuffer.count(":");
- iColonPos = qsCommaBuffer.find (":");
-
+ iColonPos = qsCommaBuffer.indexOf(":");
+
if (iColonPos == -1)
qsColonBuffer = qsCommaBuffer;
-
+
else
qsColonBuffer = qsCommaBuffer.left (iColonPos);
-
+
while (uiIterationID <= uiColonCount)
{
if (uiIterationID == 0)
- MonitoredOpCodeList [uiIndex] [0] = qsColonBuffer.toUInt (NULL, 16);
-
+ MonitoredOpCodeList [uiIndex] [0] = qsColonBuffer.toUInt (NULL, 16);
+
else if (uiIterationID == 1)
- MonitoredOpCodeAliasList [uiIndex] = qsColonBuffer;
-
+ MonitoredOpCodeAliasList [uiIndex] = qsColonBuffer;
+
else if (uiIterationID == 2)
- MonitoredOpCodeList [uiIndex] [1] = qsColonBuffer.toUInt (NULL, 10);
-
+ MonitoredOpCodeList [uiIndex] [1] = qsColonBuffer.toUInt (NULL, 10);
+
else if (uiIterationID == 3)
- MonitoredOpCodeList [uiIndex] [2] = qsColonBuffer.toUInt (NULL, 10);
-
+ MonitoredOpCodeList [uiIndex] [2] = qsColonBuffer.toUInt (NULL, 10);
+
qsCommaBuffer.remove (0, iColonPos + 1);
-
- iColonPos = qsCommaBuffer.find (":");
-
+
+ iColonPos = qsCommaBuffer.indexOf(":");
+
if (iColonPos == -1)
- qsColonBuffer = qsCommaBuffer;
-
+ qsColonBuffer = qsCommaBuffer;
+
else
- qsColonBuffer = qsCommaBuffer.left (iColonPos);
-
+ qsColonBuffer = qsCommaBuffer.left (iColonPos);
+
uiIterationID ++;
}
-
+
#if 1 // ZBTEMP
seqDebug("opcode=%04x name='%s' dir=%d known=%d",
- MonitoredOpCodeList [uiIndex] [0],
- (const char*)MonitoredOpCodeAliasList [uiIndex],
- MonitoredOpCodeList [uiIndex] [1],
- MonitoredOpCodeList [uiIndex] [2]);
+ MonitoredOpCodeList [uiIndex] [0],
+ MonitoredOpCodeAliasList [uiIndex].toAscii().data(),
+ MonitoredOpCodeList [uiIndex] [1],
+ MonitoredOpCodeList [uiIndex] [2]);
#endif
}
}
@@ -512,14 +511,14 @@
}
}
}
-
+
if (uiOpCodeIndex > 0)
{
- QString opCodeName = MonitoredOpCodeAliasList[uiOpCodeIndex - 1].latin1();
-
+ QString opCodeName = MonitoredOpCodeAliasList[uiOpCodeIndex - 1].toLatin1().data();
+
if (m_view)
printData(data, len, dir, opcode, opCodeName);
-
+
if (m_log)
logData(data, len, dir, opcode, opcodeEntry,opCodeName);
}
Modified: showeq/branches/pre_6_0_beta/src/packetstream.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -77,7 +77,7 @@
uint16_t arqSeqGiveUp,
EQPacketOPCodeDB& opcodeDB,
QObject* parent, const char* name)
- : QObject(parent, name),
+ : QObject(parent),
m_opcodeDB(opcodeDB),
m_dispatchers(),
m_streamid(streamid),
@@ -96,6 +96,7 @@
m_decodeKey(0),
m_validKey(true)
{
+ setObjectName(name);
}
////////////////////////////////////////////////////
@@ -117,9 +118,9 @@
if (!opcode)
{
seqDebug("connect2: Unknown opcode '%s' with payload type '%s'",
- (const char*)opcodeName, payloadType);
+ opcodeName.toAscii().data(), payloadType);
seqDebug("\tfor receiver '%s' of type '%s' to member '%s'",
- receiver->name(), receiver->className(), member);
+ receiver->objectName(), receiver->metaObject()->className(), member);
return false;
}
@@ -143,11 +144,11 @@
if (!payload)
{
seqDebug("connect2: Warning! opcode '%s' has no matching payload.",
- (const char*)opcodeName);
+ opcodeName.toAscii().data());
seqDebug("\tdir '%d' payload '%s' szt '%d'",
- m_dir, payloadType, szt);
+ m_dir, payloadType, szt);
seqDebug("\tfor receiver '%s' of type '%s' to member '%s'",
- receiver->name(), receiver->className(), member);
+ receiver->objectName(), receiver->metaObject()->className(), member);
return false;
}
@@ -161,12 +162,12 @@
// construct a name for the dispatch
QString dispatchName(256, '\0');
dispatchName.sprintf("PacketDispatch:%s:%s:%d:%s:%d",
- (const char*)name(), (const char*)opcodeName,
- payload->dir(), (const char*)payload->typeName(),
- payload->sizeCheckType());
+ objectName().toAscii().data(), opcodeName.toAscii().data(),
+ payload->dir(), payload->typeName().toAscii().data(),
+ payload->sizeCheckType());
// create new dispatch object
- dispatch = new EQPacketDispatch(this, dispatchName);
+ dispatch = new EQPacketDispatch(this, dispatchName.toAscii().data());
// insert dispatcher into dispatcher dictionary
m_dispatchers.insert((void*)payload, dispatch);
@@ -461,8 +462,8 @@
{
QString tempStr;
tempStr.sprintf("%s (%#04x) (dataLen: %lu) doesn't match:",
- (const char*)opcodeEntry->name(), opcodeEntry->opcode(),
- len);
+ opcodeEntry->name().toAscii().data(),
+ opcodeEntry->opcode(), len);
pit.toFront();
while (pit.hasNext())
@@ -480,9 +481,9 @@
tempStr += QString(" modulus of sizeof(%1):%2")
.arg(payload->typeName()).arg(payload->typeSize());
}
- }
+ }
- seqWarn(tempStr);
+ seqWarn(tempStr.toAscii().data());
}
#endif // PACKET_PAYLOAD_SIZE_DIAG
}
Modified: showeq/branches/pre_6_0_beta/src/player.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/player.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/player.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -60,11 +60,12 @@
ZoneMgr* zoneMgr,
GuildMgr* guildMgr,
const char* name)
- : QObject(parent, name),
+ : QObject(parent),
Spawn(),
m_zoneMgr(zoneMgr),
m_guildMgr(guildMgr)
{
+ setObjectName(name);
#ifdef DEBUG_PLAYER
qDebug ("Player()");
#endif
@@ -1296,7 +1297,7 @@
d << MAX_KNOWN_SKILLS;
d << MAX_KNOWN_LANGS;
- d << m_zoneMgr->shortZoneName().lower();
+ d << m_zoneMgr->shortZoneName().toLower();
// write out the rest
d << m_name;
@@ -1378,7 +1379,7 @@
if (magicTest != *magic)
{
seqWarn("Failure loading %s: Bad magic string!",
- (const char*)fileName);
+ fileName.toAscii().data());
reset();
clear();
return;
@@ -1388,8 +1389,8 @@
d >> testVal;
if (testVal != sizeof(charProfileStruct))
{
- seqWarn("Failure loading %s: Bad player size!",
- (const char*)fileName);
+ seqWarn("Failure loading %s: Bad player size!",
+ fileName.toAscii().data());
reset();
clear();
return;
@@ -1398,8 +1399,8 @@
d >> testVal;
if (testVal != MAX_KNOWN_SKILLS)
{
- seqWarn("Failure loading %s: Bad known skills!",
- (const char*)fileName);
+ seqWarn("Failure loading %s: Bad known skills!",
+ fileName.toAscii().data());
reset();
clear();
return;
@@ -1408,21 +1409,21 @@
d >> testVal;
if (testVal != MAX_KNOWN_LANGS)
{
- seqWarn("Failure loading %s: Bad known langs!",
- (const char*)fileName);
+ seqWarn("Failure loading %s: Bad known langs!",
+ fileName.toAscii().data());
reset();
clear();
return;
}
-
+
// attempt to validate that the info is from the current zone
QString zoneShortName;
d >> zoneShortName;
- if (zoneShortName != m_zoneMgr->shortZoneName().lower())
+ if (zoneShortName != m_zoneMgr->shortZoneName().toLower())
{
seqWarn("\aWARNING: Restoring player state for potentially incorrect zone (%s != %s)!",
- (const char*)zoneShortName,
- (const char*)m_zoneMgr->shortZoneName().lower());
+ zoneShortName.toAscii().data(),
+ m_zoneMgr->shortZoneName().toLower().toAscii().data());
}
// read in the rest
@@ -1492,13 +1493,13 @@
fillConTable();
seqInfo("Restored PLAYER: %s (%s)!",
- (const char*)m_name,
- (const char*)m_lastName);
+ m_name.toAscii().data(),
+ m_lastName.toAscii().data());
}
else
{
- seqWarn("Failure loading %s: Unable to open!",
- (const char*)fileName);
+ seqWarn("Failure loading %s: Unable to open!",
+ fileName.toAscii().data());
reset();
clear();
}
Modified: showeq/branches/pre_6_0_beta/src/seqlistview.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/seqlistview.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/seqlistview.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -85,9 +85,9 @@
{
// remove the column from the listview
Q3ListView::removeColumn(column);
-
+
// remove the preference from the list
- m_columns.remove(m_columns.at(column));
+ m_columns.removeAt(column);
}
void SEQListView::setSorting(int column, bool increasing)
@@ -183,12 +183,12 @@
while (!tStr.isEmpty())
{
int toIndex;
- if (tStr.find(':') != -1)
+ if (tStr.indexOf(':') != -1)
{
- toIndex = tStr.left(tStr.find(':')).toInt();
- tStr = tStr.right(tStr.length() - tStr.find(':') - 1);
- }
- else
+ toIndex = tStr.left(tStr.indexOf(':')).toInt();
+ tStr = tStr.right(tStr.length() - tStr.indexOf(':') - 1);
+ }
+ else
{
toIndex = tStr.toInt();
tStr = "";
Modified: showeq/branches/pre_6_0_beta/src/seqwindow.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/seqwindow.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/seqwindow.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -38,7 +38,7 @@
m_preferenceName(prefName)
{
// set the windows caption
- Q3DockWindow::setCaption(pSEQPrefs->getPrefString("Caption", preferenceName(),
+ Q3DockWindow::setWindowTitle(pSEQPrefs->getPrefString("Caption", preferenceName(),
caption));
// windows default to resizable
@@ -69,11 +69,11 @@
void SEQWindow::setCaption(const QString& text)
{
// set the caption
- Q3DockWindow::setCaption(text);
- setName((const char*)caption());
+ Q3DockWindow::setWindowTitle(text);
+ setObjectName(windowTitle());
// set the preference
- pSEQPrefs->setPrefString("Caption", preferenceName(), caption());
+ pSEQPrefs->setPrefString("Caption", preferenceName(), windowTitle());
}
void SEQWindow::setWindowFont(const QFont& font)
Modified: showeq/branches/pre_6_0_beta/src/spawn.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawn.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/spawn.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -249,10 +249,10 @@
{
QString buff;
buff.sprintf("Name:%s:Race:%s:Class:%s:NPC:%d:X:%d:Y:%d:Z:%d",
- (const char*)transformedName().utf8(),
- (const char*)raceString(),
- (const char*)classString(),
- NPC(), x(), y(), z());
+ transformedName().toUtf8().data(),
+ raceString().toUtf8().data(),
+ classString().toUtf8().data(),
+ NPC(), x(), y(), z());
return buff;
}
@@ -365,10 +365,10 @@
: Item(tSpawn, id)
{
// restore Spawn info
- d.readRawBytes((char*)this, sizeof(EQPoint));
- d.readRawBytes((char*)&m_lastUpdate,
+ d.readRawData((char*)this, sizeof(EQPoint));
+ d.readRawData((char*)&m_lastUpdate,
((char*)this + sizeof(Item)) - (char*)&m_lastUpdate);
- d.readRawBytes((char*)&m_petOwnerID,
+ d.readRawData((char*)&m_petOwnerID,
((char*)this + sizeof(Spawn)) - (char*)&m_petOwnerID);
d >> m_name;
d >> m_lastName;
@@ -894,20 +894,20 @@
QString buff;
buff.sprintf("Name:%s:Level:%d:Race:%s:Class:%s:NPC:%d:X:%d:Y:%d:Z:%d:"
- "Light:%s:Deity:%s:RTeam:%d:DTeam:%d:Type:%s:LastName:%s:Guild:%s:",
- (const char*)name.utf8(),
- level(),
- (const char*)raceString(),
- (const char*)classString(),
- ((NPC() == 10) ? 0 : NPC()),
- x(), y(), z(),
- (const char*)lightName(),
- (const char*)deityName(),
- raceTeam(),
- deityTeam(),
- (const char*)typeString(),
- (const char*)lastName().utf8(),
- (const char*)guildTag().utf8());
+ "Light:%s:Deity:%s:RTeam:%d:DTeam:%d:Type:%s:LastName:%s:Guild:%s:",
+ name.toUtf8().data(),
+ level(),
+ raceString().toUtf8().data(),
+ classString().toUtf8().data(),
+ ((NPC() == 10) ? 0 : NPC()),
+ x(), y(), z(),
+ lightName().toUtf8().data(),
+ deityName().toUtf8().data(),
+ raceTeam(),
+ deityTeam(),
+ typeString().toUtf8().data(),
+ lastName().toUtf8().data(),
+ guildTag().toUtf8().data());
if (gm())
buff += QString("GM:") + QString::number(gm()) + ":";
@@ -977,11 +977,11 @@
// write out the raw spawn structure, skipping over the QStrings,
// and SpawnTrackList (which can't be persisted in this fashion),
// and the data we don't wan't copied over (heading/delta info).
- d.writeRawBytes((const char*)this, sizeof(EQPoint));
- d.writeRawBytes((const char*)&m_lastUpdate,
+ d.writeRawData((const char*)this, sizeof(EQPoint));
+ d.writeRawData((const char*)&m_lastUpdate,
((char*)this + sizeof(Item))
- (char*)&m_lastUpdate);
- d.writeRawBytes((const char*)&m_petOwnerID,
+ d.writeRawData((const char*)&m_petOwnerID,
((char*)this + sizeof(Spawn)) - (char*)&m_petOwnerID);
d << m_name;
d << m_lastName;
Modified: showeq/branches/pre_6_0_beta/src/spawnlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/spawnlist.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -1111,7 +1111,7 @@
const Item* item = ((SpawnListItem*)litem)->item();
if (item != NULL)
{
- seqInfo("%s",(const char*)item->filterString());
+ seqInfo("%s", item->filterString().toAscii().data());
}
}
Modified: showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-02 01:41:58 UTC (rev 1091)
+++ showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-11-02 01:42:12 UTC (rev 1092)
@@ -66,10 +66,13 @@
m_delay = 60000L / fpm;
QBoxLayout* vLayout = new QVBoxLayout(boxLayout());
- QHBoxLayout* hLayout= new QHBoxLayout(vLayout);
+ QHBoxLayout* hLayout= new QHBoxLayout();
+ vLayout->addLayout(hLayout);
// create the spawn list combo box
- m_categoryCombo = new QComboBox(false, this, "spawnlistcombo");
+ m_categoryCombo = new QComboBox(this);
+ m_categoryCombo->setObjectName("spawnlistcombo");
+ m_categoryCombo->setEditable(false);
m_categoryCombo->setDuplicatesEnabled(false);
hLayout->addWidget(m_categoryCombo, 0, Qt::AlignLeft);
connect(m_categoryCombo, SIGNAL(activated(int)),
@@ -84,7 +87,11 @@
hLayout->addWidget(m_totalSpawns, 0, Qt::AlignCenter);
// setup spinbox to control frame rate (FPM)
- m_fpmSpinBox = new QSpinBox(5, 60, 1, this, "fpmSpinBox");
+ m_fpmSpinBox = new QSpinBox(this);
+ m_fpmSpinBox->setObjectName("fpmSpinBox");
+ m_fpmSpinBox->setMinimum(5);
+ m_fpmSpinBox->setMaximum(60);
+ m_fpmSpinBox->setSingleStep(1);
m_fpmSpinBox->setValue(fpm);
m_fpmSpinBox->setSuffix("FPM");
hLayout->addWidget(m_fpmSpinBox, 0, Qt::AlignRight);
@@ -128,7 +135,8 @@
m_spawnList->restoreColumns();
// setup timer for refreshing the spawn list
- m_timer = new QTimer(this, "spawnlist2timer");
+ m_timer = new QTimer(this);
+ m_timer->setObjectName("spawnlist2timer");
// connect a QListView signal to ourselves
connect(m_spawnList, SIGNAL(selectionChanged(Q3ListViewItem*)),
@@ -230,19 +238,26 @@
}
m_menu = new SpawnListMenu(m_spawnList, this, m_spawnShell->filterMgr(),
- m_categoryMgr, this, "spawnlist menu");
- m_menu->insertSeparator(-1);
- int x;
- x = m_menu->insertItem("Immediate Update",
- this, SLOT(toggle_immediateUpdate(int)));
- m_menu->setItemChecked(x, m_immediateUpdate);
- x = m_menu->insertItem("Keep Sorted",
- this, SLOT(toggle_keepSorted(int)));
- m_menu->setItemChecked(x, m_keepSorted);
- x = m_menu->insertItem("Keep Selected Visible",
- this, SLOT(toggle_keepSelectedVisible(i...
[truncated message content] |
|
From: <cn...@us...> - 2020-11-02 01:42:01
|
Revision: 1091
http://sourceforge.net/p/seq/svn/1091
Author: cn187
Date: 2020-11-02 01:41:58 +0000 (Mon, 02 Nov 2020)
Log Message:
-----------
Replace compatibility/deprecated functions with Qt4 equivalents
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/gdbmconv.cpp
showeq/branches/pre_6_0_beta/src/group.cpp
showeq/branches/pre_6_0_beta/src/guild.cpp
showeq/branches/pre_6_0_beta/src/guildlist.cpp
showeq/branches/pre_6_0_beta/src/guildshell.cpp
showeq/branches/pre_6_0_beta/src/interface.cpp
showeq/branches/pre_6_0_beta/src/logger.cpp
showeq/branches/pre_6_0_beta/src/main.cpp
showeq/branches/pre_6_0_beta/src/map.cpp
showeq/branches/pre_6_0_beta/src/mapcore.cpp
showeq/branches/pre_6_0_beta/src/mapicon.cpp
showeq/branches/pre_6_0_beta/src/messagefilter.cpp
showeq/branches/pre_6_0_beta/src/messagefilterdialog.cpp
showeq/branches/pre_6_0_beta/src/messages.cpp
showeq/branches/pre_6_0_beta/src/messageshell.cpp
showeq/branches/pre_6_0_beta/src/messagewindow.cpp
showeq/branches/pre_6_0_beta/src/packetinfo.h
Modified: showeq/branches/pre_6_0_beta/src/gdbmconv.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/gdbmconv.cpp 2020-11-02 01:41:45 UTC (rev 1090)
+++ showeq/branches/pre_6_0_beta/src/gdbmconv.cpp 2020-11-02 01:41:58 UTC (rev 1091)
@@ -75,7 +75,7 @@
dbName += ".dbm";
// attempt to open the database for write
- if ((dbf = gdbm_open((char*)(const char*)dbName, 0, GDBM_WRCREAT, 0644, 0))
+ if ((dbf = gdbm_open(dbName.toAscii().data(), 0, GDBM_WRCREAT, 0644, 0))
!= NULL)
{
// if successful, then attempt to insert or replace data under key
@@ -83,10 +83,10 @@
{
case 0:
case 1:
- success = true;
- break;
+ success = true;
+ break;
default:
- displayGDBMError("Insert: gdbm_store", (const char*)dbName);
+ displayGDBMError("Insert: gdbm_store", dbName.toAscii().data());
}
// close the database
@@ -95,8 +95,8 @@
else
{
// display GDBM Error
- displayGDBMError("Insert: gdbm_open", (const char*)dbName);
-
+ displayGDBMError("Insert: gdbm_open", dbName.toAscii().data());
+
// attempt to diagnose the open for write failure
diagFileWriteFail(dbName);
}
@@ -116,7 +116,7 @@
dbName += ".dbm";
// attempt to open the database for write
- if ((dbf = gdbm_open((char*)(const char*)dbName, 0, GDBM_WRITER, 0644, 0))
+ if ((dbf = gdbm_open(dbName.toAscii().data(), 0, GDBM_WRITER, 0644, 0))
!= NULL)
{
// if successful, then attempt to insert or replace data under key
@@ -123,7 +123,7 @@
if (gdbm_delete(dbf, key_) == 0)
success = true;
else
- displayGDBMError("Delete: gdbm_delete", (const char*)dbName);
+ displayGDBMError("Delete: gdbm_delete", dbName.toAscii().data());
// close the database
gdbm_close(dbf);
@@ -131,8 +131,8 @@
else
{
// display GDBM Error
- displayGDBMError("Delete: gdbm_open", (const char*)dbName);
-
+ displayGDBMError("Delete: gdbm_open", dbName.toAscii().data());
+
// attempt to diagnose the open for write failure
diagFileWriteFail(dbName);
}
@@ -153,7 +153,7 @@
dbName += ".dbm";
// attempt to open the database for read
- if ((dbf = gdbm_open((char*)(const char*)dbName, 0, GDBM_READER,
+ if ((dbf = gdbm_open(dbName.toAscii().data(), 0, GDBM_READER,
0644, 0)) != NULL)
{
// attempt to retrieve the entry from the database
@@ -188,7 +188,7 @@
dbName += ".dbm";
// attmpet to open the database for read
- if ((dbf = gdbm_open((char*)(const char*)dbName, 0, GDBM_READER,
+ if ((dbf = gdbm_open(dbName.toAscii().data(), 0, GDBM_READER,
0644, 0)) != NULL)
{
// attempt to retrieve the entry from the database
@@ -208,7 +208,7 @@
else
{
// display the notice (this isn't necessarily bad)
- displayGDBMError("GetEntry: gdbm_open", (const char*)dbName, "Notice");
+ displayGDBMError("GetEntry: gdbm_open", dbName.toAscii().data(), "Notice");
// attempt to diagnose the open for read failure
diagFileReadFail(dbName);
@@ -227,7 +227,7 @@
dbName += ".dbm";
// attempt to open the database for write
- if ((dbf = gdbm_open((char*)(const char*)dbName, 0, GDBM_WRITER, 0644, 0))
+ if ((dbf = gdbm_open(dbName.toAscii().data(), 0, GDBM_WRITER, 0644, 0))
!= NULL)
{
// if successful, then attempt to insert or replace data under key
@@ -234,7 +234,7 @@
if (gdbm_reorganize(dbf) == 0)
success = true;
else
- displayGDBMError("Reorganize: gdbm_reorganize", (const char*)dbName);
+ displayGDBMError("Reorganize: gdbm_reorganize", dbName.toAscii().data());
// close the database
gdbm_close(dbf);
@@ -242,7 +242,7 @@
else
{
// display GDBM Error
- displayGDBMError("Reorganize: gdbm_open", (const char*)dbName);
+ displayGDBMError("Reorganize: gdbm_open", dbName.toAscii().data());
// attempt to diagnose the open for write failure
diagFileWriteFail(dbName);
@@ -311,13 +311,13 @@
dbName += ".dbm";
// open the specified DB file for reading
- m_dbf = gdbm_open((char*)(const char*)dbName, 0, GDBM_READER,
+ m_dbf = gdbm_open(dbName.toAscii().data(), 0, GDBM_READER,
0644, 0);
// if failed, then nothing to read
if (m_dbf == NULL)
{
- displayGDBMError("GetFirstKey: gdbm_open", (const char*)dbName);
+ displayGDBMError("GetFirstKey: gdbm_open", dbName.toAscii().data());
// attempt to diagnose the open for read failure
diagFileReadFail(dbName);
Modified: showeq/branches/pre_6_0_beta/src/group.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/group.cpp 2020-11-02 01:41:45 UTC (rev 1090)
+++ showeq/branches/pre_6_0_beta/src/group.cpp 2020-11-02 01:41:58 UTC (rev 1091)
@@ -30,15 +30,16 @@
#include <QTextStream>
-GroupMgr::GroupMgr(SpawnShell* spawnShell,
- Player* player,
- QObject* parent, const char* name)
- : QObject( parent, name),
+GroupMgr::GroupMgr(SpawnShell* spawnShell,
+ Player* player,
+ QObject* parent, const char* name)
+ : QObject(parent),
m_spawnShell(spawnShell),
m_player(player),
m_memberCount(0),
m_membersInZoneCount(0)
{
+ setObjectName(name);
for (int i=0; i<MAX_GROUP_MEMBERS; i++)
{
m_members[i] = new GroupMember();
@@ -156,7 +157,7 @@
for(uint32_t i = 0; i < MAX_GROUP_MEMBERS; i++)
{
if(!m_members[i]->m_name.isEmpty())
- seqDebug("GroupMgr::groupUpdate '%s'", m_members[i]->m_name.latin1());
+ seqDebug("GroupMgr::groupUpdate '%s'", m_members[i]->m_name.toLatin1().data());
}
#endif
}
@@ -197,7 +198,7 @@
const groupDisbandStruct* gmem = (const groupDisbandStruct*)data;
// If we're disbanding, reset counters and clear member slots
- if(!strcmp(gmem->membername, m_player->name()))
+ if(!strcmp(gmem->membername, m_player->name().toAscii().data()))
{
m_memberCount = 0;
m_membersInZoneCount = 0;
Modified: showeq/branches/pre_6_0_beta/src/guild.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/guild.cpp 2020-11-02 01:41:45 UTC (rev 1090)
+++ showeq/branches/pre_6_0_beta/src/guild.cpp 2020-11-02 01:41:58 UTC (rev 1091)
@@ -35,8 +35,9 @@
#include <QTextStream>
GuildMgr::GuildMgr(QString fn, QObject* parent, const char* name)
- : QObject(parent, name)
+ : QObject(parent)
{
+ setObjectName(name);
guildsFileName = fn;
readGuildList();
@@ -66,7 +67,7 @@
if (guildsfile.exists()) {
if (!guildsfile.remove()) {
seqWarn("GuildMgr: Could not remove old %s, unable to replace with server data!",
- guildsFileName.latin1());
+ guildsFileName.toLatin1().data());
return;
}
}
@@ -73,7 +74,7 @@
if(!guildsfile.open(QIODevice::WriteOnly))
seqWarn("GuildMgr: Could not open %s for writing, unable to replace with server data!",
- guildsFileName.latin1());
+ guildsFileName.toLatin1().data());
QDataStream guildDataStream(&guildsfile);
@@ -122,9 +123,9 @@
{
char szGuildName[64] = {0};
- strcpy(szGuildName, it->second.latin1());
+ strcpy(szGuildName, it->second.toLatin1().data());
//seqDebug("GuildMgr::writeGuildList - add guild '%s' (%d)", szGuildName, it->first);
- guildDataStream.writeRawBytes(szGuildName, sizeof(szGuildName));
+ guildDataStream.writeRawData(szGuildName, sizeof(szGuildName));
}
guildsfile.close();
@@ -142,7 +143,7 @@
{
char szGuildName[64] = {0};
- guildsfile.readBlock(szGuildName, sizeof(szGuildName));
+ guildsfile.read(szGuildName, sizeof(szGuildName));
//seqDebug("GuildMgr::readGuildList - read guild '%s'", szGuildName);
m_guildMap.push_back(QString::fromUtf8(szGuildName));
}
@@ -151,7 +152,7 @@
seqInfo("GuildMgr: Guildsfile loaded");
}
else
- seqWarn("GuildMgr: Could not load guildsfile, %s", (const char*)guildsFileName);
+ seqWarn("GuildMgr: Could not load guildsfile, %s", guildsFileName.toAscii().data());
}
void GuildMgr::guildList2text(QString fn)
@@ -162,7 +163,7 @@
if (guildsfile.exists()) {
if (!guildsfile.remove()) {
seqWarn("GuildMgr: Could not remove old %s, unable to process request!",
- fn.latin1());
+ fn.toLatin1().data());
return;
}
}
@@ -169,7 +170,7 @@
if (!guildsfile.open(QIODevice::WriteOnly)) {
seqWarn("GuildMgr: Could not open %s for writing, unable to process request!",
- fn.latin1());
+ fn.toLatin1().data());
return;
}
@@ -187,10 +188,10 @@
void GuildMgr::listGuildInfo()
{
- for (unsigned int i = 0; i < m_guildMap.size(); i++)
+ for (unsigned int i = 0; i < m_guildMap.size(); i++)
{
if (!m_guildMap[i].isNull())
- seqInfo("%d\t%s", i, (const char*)m_guildMap[i]);
+ seqInfo("%d\t%s", i, m_guildMap[i].toAscii().data());
}
}
Modified: showeq/branches/pre_6_0_beta/src/guildlist.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/guildlist.cpp 2020-11-02 01:41:45 UTC (rev 1090)
+++ showeq/branches/pre_6_0_beta/src/guildlist.cpp 2020-11-02 01:41:58 UTC (rev 1091)
@@ -165,11 +165,12 @@
m_showAlts = pSEQPrefs->getPrefBool("ShowAlts", preferenceName(), true);
QBoxLayout* vLayout = new QVBoxLayout(boxLayout());
- QHBoxLayout* hLayout= new QHBoxLayout(vLayout);
+ QHBoxLayout* hLayout= new QHBoxLayout();
+ vLayout->addLayout(hLayout);
// Guild Name
m_guildName = new QLabel("Guild", this);
- m_guildName->setAlignment(Qt::AlignLeft|Qt::AlignVCenter|Qt::SingleLine);
+ m_guildName->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
m_guildName->setFrameShape(LineEditPanel);
m_guildName->setFrameShadow(Sunken);
m_guildName->setMinimumWidth(50);
@@ -179,7 +180,7 @@
// Guild Totals
m_guildTotals = new QLabel("", this);
- m_guildTotals->setAlignment(Qt::AlignRight|Qt::AlignVCenter|Qt::SingleLine);
+ m_guildTotals->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
m_guildTotals->setFrameShape(LineEditPanel);
m_guildTotals->setFrameShadow(Sunken);
m_guildTotals->setMinimumWidth(30);
@@ -443,7 +444,7 @@
bool ok = false;
// get a new font
newFont = QFontDialog::getFont(&ok, font(),
- this, caption() + " Font");
+ this, windowTitle() + " Font");
// if the user entered a font and clicked ok, set the windows font
@@ -455,15 +456,14 @@
{
bool ok = false;
- QString captionText =
- QInputDialog::getText("ShowEQ Guild List Window Caption",
- "Enter caption for the Guild List Window:",
- QLineEdit::Normal, caption(),
- &ok, this);
-
+ QString captionText =
+ QInputDialog::getText(this, "ShowEQ Guild List Window Caption",
+ "Enter caption for the Guild List Window:",
+ QLineEdit::Normal, windowTitle());
+
// if the user entered a caption and clicked ok, set the windows caption
if (ok)
- setCaption(captionText);
+ setWindowTitle(captionText);
}
void GuildListWindow::clear(void)
Modified: showeq/branches/pre_6_0_beta/src/guildshell.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/guildshell.cpp 2020-11-02 01:41:45 UTC (rev 1090)
+++ showeq/branches/pre_6_0_beta/src/guildshell.cpp 2020-11-02 01:41:58 UTC (rev 1091)
@@ -173,10 +173,11 @@
//----------------------------------------------------------------------
// GuildShell implementation
GuildShell::GuildShell(ZoneMgr* zoneMgr, QObject* parent, const char* name)
- : QObject(parent, name),
+ : QObject(parent),
m_maxNameLength(0),
m_zoneMgr(zoneMgr)
{
+ setObjectName(name);
}
GuildShell::~GuildShell()
@@ -203,13 +204,13 @@
QString format("%1 %2 %3 %4%5%6%7 %8 %9");
QString dateFormat("ddd MMM dd hh:mm:ss yyyy");
-
+
// calculate the maximum class name width
- size_t maxClassNameLength = 0;
+ int maxClassNameLength = 0;
for (uint8_t i = 1; i <= PLAYER_CLASSES; i++)
if (classString(i).length() > maxClassNameLength)
maxClassNameLength = classString(i).length();
-
+
out << "Guild has " << m_members.count() << " members: " << endl;
int nameFieldWidth = - m_maxNameLength;
@@ -291,7 +292,7 @@
// insert the new member into the dictionary
m_members.insert(member->name(), member);
-
+
// check for new longest member name
if (member->name().length() > m_maxNameLength)
m_maxNameLength = member->name().length();
Modified: showeq/branches/pre_6_0_beta/src/interface.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-02 01:41:45 UTC (rev 1090)
+++ showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-02 01:41:58 UTC (rev 1091)
@@ -103,7 +103,7 @@
/* The main interface widget */
EQInterface::EQInterface(DataLocationMgr* dlm,
QWidget * parent, const char *name)
- : Q3MainWindow (parent, name),
+ : Q3MainWindow (parent),
m_player(0),
m_dataLocationMgr(dlm),
m_mapMgr(0),
@@ -147,13 +147,17 @@
m_messageFilterDialog(0),
m_guildListWindow(0)
{
+ setObjectName(name);
+
// disable the dock menu
setDockMenuEnabled(false);
-
- setCentralWidget(new QWidget(this, "filler"));
-
- setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum, false));
+ setCentralWidget(new QWidget(this));
+
+ QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ sizePolicy.setHeightForWidth(false);
+ setSizePolicy(sizePolicy);
+
for (int l = 0; l < maxNumMaps; l++)
m_map[l] = 0;
@@ -219,8 +223,8 @@
fileInfo2 = m_dataLocationMgr->findExistingFile(".", fileName2);
- m_packet = new EQPacket(fileInfo.absFilePath(),
- fileInfo2.absFilePath(),
+ m_packet = new EQPacket(fileInfo.absoluteFilePath(),
+ fileInfo2.absoluteFilePath(),
pSEQPrefs->getPrefInt("ArqSeqGiveUp", section, 512),
pSEQPrefs->getPrefString("Device", section, "eth0"),
pSEQPrefs->getPrefString("IP", section,
@@ -253,7 +257,7 @@
fileInfo = m_dataLocationMgr->findExistingFile(".", fileName);
- m_spells = new Spells(fileInfo.absFilePath());
+ m_spells = new Spells(fileInfo.absoluteFilePath());
// Create the EQStr storage
m_eqStrings = new EQStr();
@@ -267,7 +271,7 @@
fileInfo = m_dataLocationMgr->findWriteFile("tmp", fileName);
- m_guildmgr = new GuildMgr(fileInfo.absFilePath(),
+ m_guildmgr = new GuildMgr(fileInfo.absoluteFilePath(),
this, "guildmgr");
// Create our player object
@@ -515,7 +519,7 @@
// QMenuBar
// The first call to menuBar() makes it exist
- menuBar()->setSeparator(QMenuBar::InWindowsStyle);
+ menuBar()->addSeparator();
// File Menu
QMenu* pFileMenu = new QMenu("&File");
@@ -1050,7 +1054,10 @@
tmpAction->setChecked(showeq_params->walkpathrecord);
subMenu = new QMenu("Walk Path Length");
- QSpinBox* walkPathLengthSpinBox = new QSpinBox(0, 8192, 1, subMenu);
+ QSpinBox* walkPathLengthSpinBox = new QSpinBox(subMenu);
+ walkPathLengthSpinBox->setMinimum(0);
+ walkPathLengthSpinBox->setMaximum(8192);
+ walkPathLengthSpinBox->setSingleStep(1);
walkPathLengthSpinBox->setValue(showeq_params->walkpathlength);
connect(walkPathLengthSpinBox, SIGNAL(valueChanged(int)), this,
SLOT(set_opt_WalkPathLength(int)));
@@ -1084,7 +1091,10 @@
pSaveStateMenu->addSeparator();
subMenu = new QMenu("Spawn Save Frequency (s)");
- QSpinBox* saveFrequencySpinBox = new QSpinBox(1, 320, 1, subMenu);
+ QSpinBox* saveFrequencySpinBox = new QSpinBox(subMenu);
+ saveFrequencySpinBox->setMinimum(1);
+ saveFrequencySpinBox->setMaximum(320);
+ saveFrequencySpinBox->setSingleStep(1);
saveFrequencySpinBox->setValue(showeq_params->saveSpawnsFrequency / 1000);
connect(saveFrequencySpinBox, SIGNAL(valueChanged(int)), this,
SLOT(set_opt_save_SpawnFrequency(int)));
@@ -1237,7 +1247,10 @@
// Advanced menu
subMenu = new QMenu("Advanced");
QMenu* subSubMenu = new QMenu("Arq Seq Give Up");
- QSpinBox* arqSeqGiveUpSpinBox = new QSpinBox(32, 1024, 8, subSubMenu);
+ QSpinBox* arqSeqGiveUpSpinBox = new QSpinBox(subSubMenu);
+ arqSeqGiveUpSpinBox->setMinimum(32);
+ arqSeqGiveUpSpinBox->setMaximum(1024);
+ arqSeqGiveUpSpinBox->setSingleStep(8);
arqSeqGiveUpSpinBox->setValue(m_packet->arqSeqGiveUp());
connect(arqSeqGiveUpSpinBox, SIGNAL(valueChanged(int)),
this, SLOT(set_net_arq_giveup(int)));
@@ -1258,7 +1271,11 @@
// Character -> Level
m_charLevelMenu = new QMenu("Choose &Level");
m_charMenu->addMenu(m_charLevelMenu);
- m_levelSpinBox = new QSpinBox(1, 100, 1, this, "m_levelSpinBox");
+ m_levelSpinBox = new QSpinBox(this);
+ m_levelSpinBox->setObjectName("m_levelSpinBox");
+ m_levelSpinBox->setMinimum(1);
+ m_levelSpinBox->setMaximum(115);
+ m_levelSpinBox->setSingleStep(1);
QWidgetAction* levelSpinBoxAction = new QWidgetAction(m_charLevelMenu);
levelSpinBoxAction->setDefaultWidget(m_levelSpinBox);
m_charLevelMenu->addAction( levelSpinBoxAction );
@@ -1559,7 +1576,7 @@
SLOT(enableAllShowUserFilters()));
m_terminalShowUserFilterMenu->addAction("&Disable All", this,
SLOT(disableAllShowUserFilters()));
- m_terminalShowUserFilterMenu->insertSeparator(-1);
+ m_terminalShowUserFilterMenu->addSeparator();
m_terminalHideUserFilterMenu = new QMenu("User Message Filter - &Hide");
m_terminalMenu->addMenu(m_terminalHideUserFilterMenu);
@@ -1794,49 +1811,58 @@
int sts_widget_count = 0; // total number of widgets visible on status bar
//Status widget
- m_stsbarStatus = new QLabel(statusBar(), "Status");
+ m_stsbarStatus = new QLabel(statusBar());
+ m_stsbarStatus->setObjectName("Status");
m_stsbarStatus->setMinimumWidth(80);
m_stsbarStatus->setText(QString("ShowEQ %1").arg(VERSION));
statusBar()->addWidget(m_stsbarStatus, 8);
//Zone widget
- m_stsbarZone = new QLabel(statusBar(), "Zone");
+ m_stsbarZone = new QLabel(statusBar());
+ m_stsbarZone->setObjectName("Zone");
m_stsbarZone->setText("Zone: [unknown]");
statusBar()->addWidget(m_stsbarZone, 2);
//Mobs widget
- m_stsbarSpawns = new QLabel(statusBar(), "Mobs");
+ m_stsbarSpawns = new QLabel(statusBar());
+ m_stsbarSpawns->setObjectName("Mobs");
m_stsbarSpawns->setText("Mobs:");
statusBar()->addWidget(m_stsbarSpawns, 1);
//Exp widget
- m_stsbarExp = new QLabel(statusBar(), "Exp");
+ m_stsbarExp = new QLabel(statusBar());
+ m_stsbarExp->setObjectName("Exp");
m_stsbarExp->setText("Exp [unknown]");
statusBar()->addWidget(m_stsbarExp, 2);
//ExpAA widget
- m_stsbarExpAA = new QLabel(statusBar(), "ExpAA");
+ m_stsbarExpAA = new QLabel(statusBar());
+ m_stsbarExpAA->setObjectName("ExpAA");
m_stsbarExpAA->setText("ExpAA [unknown]");
statusBar()->addWidget(m_stsbarExpAA, 2);
-
+
//Pkt widget
- m_stsbarPkt = new QLabel(statusBar(), "Pkt");
+ m_stsbarPkt = new QLabel(statusBar());
+ m_stsbarPkt->setObjectName("Pkt");
m_stsbarPkt->setText("Pkt 0");
statusBar()->addWidget(m_stsbarPkt, 1);
//EQTime widget
- m_stsbarEQTime = new QLabel(statusBar(), "EQTime");
+ m_stsbarEQTime = new QLabel(statusBar());
+ m_stsbarEQTime->setObjectName("EQTime");
m_stsbarEQTime->setText("EQTime");
statusBar()->addWidget(m_stsbarEQTime, 1);
// Run Speed widget
- m_stsbarSpeed = new QLabel(statusBar(), "Speed");
+ m_stsbarSpeed = new QLabel(statusBar());
+ m_stsbarSpeed->setObjectName("Speed");
m_stsbarSpeed->setText("Run Speed:");
statusBar()->addWidget(m_stsbarSpeed, 1);
// ZEM code
// Zone Exp Mult widget
- m_stsbarZEM = new QLabel(statusBar(), "ZEM");
+ m_stsbarZEM = new QLabel(statusBar());
+ m_stsbarZEM->setObjectName("ZEM");
m_stsbarZEM->setText("ZEM: [unknown]");
statusBar()->addWidget(m_stsbarZEM, 1);
@@ -2443,10 +2469,8 @@
}
show();
- QShortcut *toggle_view_status_bar_shortcut = new QShortcut(
- Qt::CTRL+Qt::ALT+Qt::Key_S, this, SLOT(toggle_view_statusbar()));
- QShortcut *toggle_view_menubar_shortcut = new QShortcut(
- Qt::CTRL+Qt::ALT+Qt::Key_T, this, SLOT(toggle_view_menubar()));
+ new QShortcut(Qt::CTRL+Qt::ALT+Qt::Key_S, this, SLOT(toggle_view_statusbar()));
+ new QShortcut(Qt::CTRL+Qt::ALT+Qt::Key_T, this, SLOT(toggle_view_menubar()));
// load in the docking preferences if any have been saved
QString dockPrefs = pSEQPrefs->getPrefString("DockingInfo", section,
@@ -2461,7 +2485,7 @@
// TODO: Add % replacement values and a signal to update, for ip address currently
// TODO: being monitored.
- Q3MainWindow::setCaption(pSEQPrefs->getPrefString("Caption", section,
+ Q3MainWindow::setWindowTitle(pSEQPrefs->getPrefString("Caption", section,
"ShowEQ - Main (ctrl+alt+t to toggle menubar)"));
// load the format strings for display
@@ -2961,15 +2985,15 @@
if (widget != 0)
{
bool ok = false;
- QString caption =
- QInputDialog::getText("ShowEQ " + window + "Caption",
- "Enter caption for the " + window + ":",
- QLineEdit::Normal, widget->caption(),
- &ok, this);
+ QString caption =
+ QInputDialog::getText(this, "ShowEQ " + window + "Caption",
+ "Enter caption for the " + window + ":",
+ QLineEdit::Normal, widget->windowTitle(),
+ &ok);
// if the user entered a caption and clicked ok, set the windows caption
if (ok)
- widget->setCaption(caption);
+ widget->setWindowTitle(caption);
}
}
@@ -3107,7 +3131,7 @@
QString newFormatFile =
QFileDialog::getOpenFileName(this, "Select Format File",
- fileInfo.absFilePath(), "*.txt");
+ fileInfo.absoluteFilePath(), "*.txt");
// if the newFormatFile name is not empty, then the user selected a file
if (!newFormatFile.isEmpty())
@@ -3129,7 +3153,7 @@
QString newSpellsFile =
QFileDialog::getOpenFileName(this, "Select Spells File",
- fileInfo.absFilePath(), "*.txt");
+ fileInfo.absoluteFilePath(), "*.txt");
// if the newFormatFile name is not empty, then the user selected a file
if (!newSpellsFile.isEmpty())
@@ -3312,9 +3336,9 @@
void EQInterface::setCaption(const QString& text)
{
- Q3MainWindow::setCaption(text);
+ Q3MainWindow::setWindowTitle(text);
- pSEQPrefs->setPrefString("Caption", "Interface", caption());
+ pSEQPrefs->setPrefString("Caption", "Interface", windowTitle());
}
@@ -3328,7 +3352,7 @@
formatFileName);
// load the strings
- m_eqStrings->load(fileInfo.absFilePath());
+ m_eqStrings->load(fileInfo.absoluteFilePath());
}
void
@@ -3425,11 +3449,11 @@
"/usr/bin/esdplay " PKGDATADIR "/spawn.wav &");
bool ok = false;
- QString command =
- QInputDialog::getText("ShowEQ " + prettyName + "Command",
- "Enter command line to use for " + prettyName + "'s:",
- QLineEdit::Normal, value,
- &ok, this);
+ QString command =
+ QInputDialog::getText(this, "ShowEQ " + prettyName + "Command",
+ "Enter command line to use for " + prettyName + "'s:",
+ QLineEdit::Normal, value,
+ &ok);
if (ok)
pSEQPrefs->setPrefString(property, "Filters", command);
@@ -3449,7 +3473,7 @@
// dump the spawns
m_spawnShell->dumpSpawns(tSpawn, out);
- seqInfo((const char*)outText);
+ seqInfo(outText.toAscii().data());
}
void EQInterface::listDrops (void)
@@ -3465,7 +3489,7 @@
// dump the drops
m_spawnShell->dumpSpawns(tDrop, out);
- seqInfo((const char*)outText);
+ seqInfo(outText.toAscii().data());
}
void EQInterface::listMapInfo(void)
@@ -3489,7 +3513,7 @@
m_map[i]->dumpInfo(out);
}
- seqInfo((const char*)outText);
+ seqInfo(outText.toAscii().data());
}
void EQInterface::listInterfaceInfo(void)
@@ -3509,7 +3533,7 @@
out << "-----------------------" << endl;
- seqInfo((const char*)outText);
+ seqInfo(outText.toAscii().data());
}
void EQInterface::listGroup(void)
@@ -3525,7 +3549,7 @@
// dump the drops
m_groupMgr->dumpInfo(out);
- seqInfo((const char*)outText);
+ seqInfo(outText.toAscii().data());
}
@@ -3542,7 +3566,7 @@
// dump the drops
m_guildShell->dumpMembers(out);
- seqInfo((const char*)outText);
+ seqInfo(outText.toAscii().data());
}
void EQInterface::dumpSpawns (void)
@@ -3557,7 +3581,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("dumps", logFile);
// open the output data stream
- QFile file(logFileInfo.absFilePath());
+ QFile file(logFileInfo.absoluteFilePath());
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
@@ -3577,7 +3601,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("dumps", logFile);
// open the output data stream
- QFile file(logFileInfo.absFilePath());
+ QFile file(logFileInfo.absoluteFilePath());
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
@@ -3598,7 +3622,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("dumps", logFile);
// open the output data stream
- QFile file(logFileInfo.absFilePath());
+ QFile file(logFileInfo.absoluteFilePath());
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
@@ -3622,7 +3646,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("dumps", logFile);
- emit guildList2text(logFileInfo.absFilePath());
+ emit guildList2text(logFileInfo.absoluteFilePath());
}
void EQInterface::dumpSpellBook(void)
@@ -3638,13 +3662,13 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("dumps", logFile);
// open the output data stream
- QFile file(logFileInfo.absFilePath());
+ QFile file(logFileInfo.absoluteFilePath());
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
QString txt;
seqInfo("Dumping Spell Book to '%s'\n",
- (const char*)file.name().utf8());
+ file.fileName().toUtf8().data());
out << "Spellbook of " << m_player->name() << " a level "
<< m_player->level() << " " << m_player->raceString()
<< " " << m_player->classString()
@@ -3665,17 +3689,17 @@
if (spell)
{
- txt.sprintf("%.3d %.2d %.2d %#4.04x %02d\t%s",
- i, ((i / 8) + 1), ((i % 8) + 1),
- spellid, spell->level(playerClass),
- spell->name().latin1());
+ txt.sprintf("%.3d %.2d %.2d %#4.04x %02d\t%s",
+ i, ((i / 8) + 1), ((i % 8) + 1),
+ spellid, spell->level(playerClass),
+ spell->name().toLatin1().data());
}
else
{
- txt.sprintf("%.3d %.2d %.2d %#4.04x \t%s",
- i, ((i / 8) + 1), ((i % 8) + 1),
- spellid,
- spell_name(spellid).latin1());
+ txt.sprintf("%.3d %.2d %.2d %#4.04x \t%s",
+ i, ((i / 8) + 1), ((i % 8) + 1),
+ spellid,
+ spell_name(spellid).toLatin1().data());
}
out << txt << endl;
@@ -3694,7 +3718,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("dumps", logFile);
// open the output data stream
- QFile file(logFileInfo.absFilePath());
+ QFile file(logFileInfo.absoluteFilePath());
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
@@ -3714,7 +3738,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("dumps", logFile);
// open the output data stream
- QFile file(logFileInfo.absFilePath());
+ QFile file(logFileInfo.absoluteFilePath());
file.open(QIODevice::WriteOnly);
QTextStream out(&file);
@@ -3725,8 +3749,8 @@
void
EQInterface::launch_editor_filters(void)
{
- EditorWindow * ew = new EditorWindow(m_filterMgr->filterFile());
- ew->setCaption(m_filterMgr->filterFile());
+ EditorWindow * ew = new EditorWindow(m_filterMgr->filterFile().toAscii().data());
+ ew->setWindowTitle(m_filterMgr->filterFile());
ew->show();
}
@@ -3733,8 +3757,8 @@
void
EQInterface::launch_editor_zoneFilters(void)
{
- EditorWindow * ew = new EditorWindow(m_filterMgr->zoneFilterFile());
- ew->setCaption(m_filterMgr->zoneFilterFile());
+ EditorWindow * ew = new EditorWindow(m_filterMgr->zoneFilterFile().toAscii().data());
+ ew->setWindowTitle(m_filterMgr->zoneFilterFile());
ew->show();
}
@@ -4283,36 +4307,36 @@
QString& opCodeList)
{
bool ok = false;
- QString newMonitorOpCode_List =
- QInputDialog::getText(title,
- "A list of OpCodes seperated by commas...\n"
- "\n"
- "Each Opcode has 4 arguments, only one of which is actually necessary...\n"
- "They are:\n"
- "OpCode: 16-bit HEX value of the OpCode\n"
- " (REQUIRED - No Default)\n"
- "\n"
- "Alias: Name used when displaying the Opcode\n"
- " (DEFAULT: Monitored OpCode)\n"
- "\n"
- "Direction: 1 = Client ---> Server\n"
- " 2 = Client <--- Server\n"
- " 3 = Client <--> Server (BOTH)\n"
- " (DEFAULT: 3)\n"
- "\n"
- "Show known 1 = Show if OpCode is marked as known.\n"
- " 0 = Ignore if OpCode is known.\n"
- " (DEFAULT: 0)\n"
- "\n"
- "The way which you include the arguments in the list of OpCodes is:\n"
- "adding a ':' inbetween arguments and a ',' after the last OpCode\n"
- "argument.\n"
- "\n"
- "(i.e. 7F21:Mana Changed:3:1, 7E21:Unknown Spell Event(OUT):1,\n"
- " 7E21:Unknown Spell Event(IN):2 )\n",
- QLineEdit::Normal,
- opCodeList,
- &ok, this);
+ QString newMonitorOpCode_List =
+ QInputDialog::getText(this, title,
+ "A list of OpCodes seperated by commas...\n"
+ "\n"
+ "Each Opcode has 4 arguments, only one of which is actually necessary...\n"
+ "They are:\n"
+ "OpCode: 16-bit HEX value of the OpCode\n"
+ " (REQUIRED - No Default)\n"
+ "\n"
+ "Alias: Name used when displaying the Opcode\n"
+ " (DEFAULT: Monitored OpCode)\n"
+ "\n"
+ "Direction: 1 = Client ---> Server\n"
+ " 2 = Client <--- Server\n"
+ " 3 = Client <--> Server (BOTH)\n"
+ " (DEFAULT: 3)\n"
+ "\n"
+ "Show known 1 = Show if OpCode is marked as known.\n"
+ " 0 = Ignore if OpCode is known.\n"
+ " (DEFAULT: 0)\n"
+ "\n"
+ "The way which you include the arguments in the list of OpCodes is:\n"
+ "adding a ':' inbetween arguments and a ',' after the last OpCode\n"
+ "argument.\n"
+ "\n"
+ "(i.e. 7F21:Mana Changed:3:1, 7E21:Unknown Spell Event(OUT):1,\n"
+ " 7E21:Unknown Spell Event(IN):2 )\n",
+ QLineEdit::Normal,
+ opCodeList,
+ &ok);
if (ok)
opCodeList = newMonitorOpCode_List;
@@ -4336,10 +4360,9 @@
// set the list of monitored opcodes
pSEQPrefs->setPrefString("OpCodeList", section, opCodeList);
-
- seqInfo("OpCode monitoring is now ENABLED...\nUsing list:\t%s",
- (const char*)opCodeList);
+
+ seqInfo("OpCode monitoring is now ENABLED...\nUsing list:\t%s", opCodeList.toAscii().data());
}
}
else
@@ -4359,16 +4382,15 @@
{
QString section = "OpCodeMonitoring";
QString opCodeList = pSEQPrefs->getPrefString("OpCodeList", section, "");
- bool ok = getMonitorOpCodeList("ShowEQ - Reload OpCode Monitor",
- opCodeList);
+ bool ok = getMonitorOpCodeList("ShowEQ - Reload OpCode Monitor", opCodeList);
if (ok && m_opcodeMonitorLog)
{
m_opcodeMonitorLog->init(opCodeList);
-
- seqInfo("The monitored OpCode list has been reloaded...\nUsing list:\t%s",
- (const char*)opCodeList);
-
+
+ seqInfo("The monitored OpCode list has been reloaded...\nUsing list:\t%s",
+ opCodeList.toAscii().data());
+
// set the list of monitored opcodes
pSEQPrefs->setPrefString("OpCodeList", section, opCodeList);
}
@@ -4417,7 +4439,7 @@
logFile =
QFileDialog::getSaveFileName(this, "ShowEQ - OpCode Log File",
- logFileInfo.absFilePath(), "*.log");
+ logFileInfo.absoluteFilePath(), "*.log");
// set log filename
if (!logFile.isEmpty())
@@ -4890,15 +4912,15 @@
// construct a message for the status message display
QString string("");
if (spawn != 0)
- string.sprintf("%d: %s:%d (%d/%d) Pos:", // "%d/%d/%d (%d) %s %s Item:%s",
- item->id(),
- (const char*)item->name().utf8(),
- spawn->level(), spawn->HP(),
- spawn->maxHP());
+ string.sprintf("%d: %s:%d (%d/%d) Pos:", // "%d/%d/%d (%d) %s %s Item:%s",
+ item->id(),
+ item->name().toUtf8().data(),
+ spawn->level(), spawn->HP(),
+ spawn->maxHP());
else
- string.sprintf("%d: %s: Pos:", // "%d/%d/%d (%d) %s %s Item:%s",
- item->id(),
- (const char*)item->name().utf8());
+ string.sprintf("%d: %s: Pos:", // "%d/%d/%d (%d) %s %s Item:%s",
+ item->id(),
+ item->name().toUtf8().data());
if (showeq_params->retarded_coords)
string += QString::number(item->y()) + "/"
@@ -4955,13 +4977,11 @@
void EQInterface::saveSelectedSpawnPath(void)
{
QString fileName;
- fileName.sprintf("%s_mobpath.map",
- (const char*)m_zoneMgr->shortZoneName());
+ fileName.sprintf("%s_mobpath.map", m_zoneMgr->shortZoneName().toAscii().data());
- QFileInfo fileInfo = m_dataLocationMgr->findWriteFile("maps", fileName,
- false);
+ QFileInfo fileInfo = m_dataLocationMgr->findWriteFile("maps", fileName, false);
- QFile mobPathFile(fileInfo.absFilePath());
+ QFile mobPathFile(fileInfo.absoluteFilePath());
if (mobPathFile.open(QIODevice::Append | QIODevice::WriteOnly))
{
QTextStream out(&mobPathFile);
@@ -4968,7 +4988,7 @@
// append the selected spawns path to the end
saveSpawnPath(out, m_selectedSpawn);
- seqInfo("Finished appending '%s'!\n", (const char*)fileName);
+ seqInfo("Finished appending '%s'!\n", fileName.toAscii().data());
}
}
@@ -4975,13 +4995,11 @@
void EQInterface::saveSpawnPaths(void)
{
QString fileName;
- fileName.sprintf("%s_mobpath.map",
- (const char*)m_zoneMgr->shortZoneName());
+ fileName.sprintf("%s_mobpath.map", m_zoneMgr->shortZoneName().toAscii().data());
- QFileInfo fileInfo = m_dataLocationMgr->findWriteFile("maps", fileName,
- false);
+ QFileInfo fileInfo = m_dataLocationMgr->findWriteFile("maps", fileName, false);
- QFile mobPathFile(fileInfo.absFilePath());
+ QFile mobPathFile(fileInfo.absoluteFilePath());
if (mobPathFile.open(QIODevice::Truncate | QIODevice::WriteOnly))
{
QTextStream out(&mobPathFile);
@@ -5005,7 +5023,7 @@
saveSpawnPath(out, it.value());
}
- seqInfo("Finished writing '%s'!\n", (const char*)fileName);
+ seqInfo("Finished writing '%s'!\n", fileName.toAscii().data());
}
}
@@ -5063,12 +5081,12 @@
{
QStringList iplst;
for( int l = 0; l < 5; l++)
- iplst += ipstr[l];
+ iplst += ipstr[l];
bool ok = false;
- QString address =
- QInputDialog::getItem("ShowEQ - EQ Client IP Address",
- "Enter IP address of EQ client",
- iplst, 0, TRUE, &ok, this );
+ QString address =
+ QInputDialog::getItem(this, "ShowEQ - EQ Client IP Address",
+ "Enter IP address of EQ client",
+ iplst, 0, TRUE, &ok);
if (ok)
{
for (int i = 4; i > 0; i--)
@@ -5085,19 +5103,18 @@
void EQInterface::set_net_client_MAC_address()
{
QStringList maclst;
- for( int l = 0; l < 5; l++)
+ for( int l = 0; l < 5; l++)
maclst += macstr[l];
bool ok = false;
- QString address =
- QInputDialog::getItem("ShowEQ - EQ Client MAC Address",
- "Enter MAC address of EQ client",
- maclst, 0, TRUE, &ok, this );
+ QString address =
+ QInputDialog::getItem(this, "ShowEQ - EQ Client MAC Address",
+ "Enter MAC address of EQ client",
+ maclst, 0, TRUE, &ok);
if (ok)
{
if (address.length() != 17)
{
- seqWarn("Invalid MAC Address (%s)! Ignoring!",
- (const char*)address);
+ seqWarn("Invalid MAC Address (%s)! Ignoring!", address.toAscii().data());
return;
}
for (int i = 4; i > 0; i--)
@@ -5114,11 +5131,11 @@
void EQInterface::set_net_device()
{
bool ok = false;
- QString dev =
- QInputDialog::getText("ShowEQ - Device",
- "Enter the device to sniff for EQ Packets:",
- QLineEdit::Normal, m_packet->device(),
- &ok, this);
+ QString dev =
+ QInputDialog::getText(this, "ShowEQ - Device",
+ "Enter the device to sniff for EQ Packets:",
+ QLineEdit::Normal, m_packet->device(),
+ &ok);
if (ok)
{
@@ -5677,20 +5694,20 @@
}
m_map[i] = new MapFrame(m_filterMgr,
- m_mapMgr,
- m_player,
- m_spawnShell,
- m_zoneMgr,
- m_spawnMonitor,
- mapPrefName,
- mapCaption,
- mapName,
- 0);
+ m_mapMgr,
+ m_player,
+ m_spawnShell,
+ m_zoneMgr,
+ m_spawnMonitor,
+ mapPrefName,
+ mapCaption,
+ mapName.toAscii().data(),
+ 0);
- setDockEnabled(m_map[i],
- pSEQPrefs->getPrefBool(QString("Dockable") + mapPrefName,
- "Interface", true));
+ setDockEnabled(m_map[i],
+ pSEQPrefs->getPrefBool(QString("Dockable") + mapPrefName,
+ "Interface", true));
Qt::ToolBarDock edge = (Qt::ToolBarDock)pSEQPrefs->getPrefInt("Dock", m_map[i]->preferenceName(),
Qt::DockLeft);
@@ -5746,8 +5763,8 @@
caption += QString::number(winNum);
m_messageWindow[i] = new MessageWindow(m_messages, m_messageFilters,
- prefName, caption,
- 0, name);
+ prefName, caption,
+ 0, name.toAscii().data());
setDockEnabled(m_messageWindow[i],
pSEQPrefs->getPrefBool(QString("Dockable") + prefName,
@@ -6165,7 +6182,7 @@
"filtered_spawns.log");
m_filteredSpawnLog = new FilteredSpawnLog(m_dateTimeMgr, m_filterMgr,
- logFileInfo.absFilePath());
+ logFileInfo.absoluteFilePath());
connect(m_spawnShell, SIGNAL(addItem(const Item*)),
m_filteredSpawnLog, SLOT(addItem(const Item*)));
@@ -6187,7 +6204,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("logs", logFile);
- logFile = logFileInfo.absFilePath();
+ logFile = logFileInfo.absoluteFilePath();
// create the spawn logger
m_spawnLogger = new SpawnLog(m_dateTimeMgr, logFile);
@@ -6231,7 +6248,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("logs", logFile);
m_globalLog = new PacketLog(*m_packet,
- logFileInfo.absFilePath(),
+ logFileInfo.absoluteFilePath(),
this, "GlobalLog");
connect(m_packet, SIGNAL(newPacket(const EQUDPIPPacketFormat&)),
@@ -6250,7 +6267,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("logs", logFile);
m_worldLog = new PacketStreamLog(*m_packet,
- logFileInfo.absFilePath(),
+ logFileInfo.absoluteFilePath(),
this, "WorldLog");
m_worldLog->setRaw(pSEQPrefs->getPrefBool("LogRawPackets", "PacketLogging",
@@ -6274,7 +6291,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("logs", logFile);
m_zoneLog = new PacketStreamLog(*m_packet,
- logFileInfo.absFilePath(),
+ logFileInfo.absoluteFilePath(),
this, "ZoneLog");
m_zoneLog->setRaw(pSEQPrefs->getPrefBool("LogRawPackets", "PacketLogging",
@@ -6300,7 +6317,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("logs", logFile);
m_bazaarLog = new BazaarLog(*m_packet,
- logFileInfo.absFilePath(),
+ logFileInfo.absoluteFilePath(),
this,
*m_spawnShell,
"BazaarLog");
@@ -6322,7 +6339,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("logs", logFile);
- logFile = logFileInfo.absFilePath();
+ logFile = logFileInfo.absoluteFilePath();
m_unknownZoneLog = new UnknownPacketLog(*m_packet,
logFile,
@@ -6350,7 +6367,7 @@
QFileInfo logFileInfo = m_dataLocationMgr->findWriteFile("logs", logFile);
- logFile = logFileInfo.absFilePath();
+ logFile = logFileInfo.absoluteFilePath();
m_opcodeMonitorLog = new OPCodeMonitorPacketLog(*m_packet,
logFile,
@@ -6370,7 +6387,7 @@
QMenu* menu = window->menu();
if (menu)
{
- menu->setTitle(window->caption());
+ menu->setTitle(window->windowTitle());
// insert the windows menu into the window menu
QAction* menuAction = m_windowMenu->addMenu(menu);
Modified: showeq/branches/pre_6_0_beta/src/logger.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/logger.cpp 2020-11-02 01:41:45 UTC (rev 1090)
+++ showeq/branches/pre_6_0_beta/src/logger.cpp 2020-11-02 01:41:58 UTC (rev 1091)
@@ -31,15 +31,17 @@
#include "logger.h"
SEQLogger::SEQLogger(FILE *fp, QObject* parent, const char* name)
- : QObject(parent, name)
+ : QObject(parent)
{
+ setObjectName(name);
m_fp = fp;
m_errOpen = false;
}
SEQLogger::SEQLogger(const QString& fname, QObject* parent, const char* name)
- : QObject(parent, name)
+ : QObject(parent)
{
+ setObjectName(name);
m_fp = NULL;
m_filename = fname;
m_errOpen = false;
@@ -49,33 +51,33 @@
{
if (m_fp)
return true;
-
- m_fp = fopen((const char*)m_filename,"a");
-
+
+ m_fp = fopen(m_filename.toAscii().data(),"a");
+
if (!m_fp)
- {
+ {
if (!m_errOpen)
{
::fprintf(stderr, "Error opening %s: %s (will keep trying)\n",
- (const char*)m_filename, strerror(errno));
+ m_filename.toAscii().data(), strerror(errno));
m_errOpen = true;
}
-
+
return false;
}
-
+
m_errOpen = false;
- if (!m_file.open(QIODevice::Append | QIODevice::WriteOnly, m_fp))
+ if (!m_file.open(m_fp, QIODevice::Append | QIODevice::WriteOnly))
return false;
-
+
m_out.setDevice(&m_file);
-
+
return true;
}
void SEQLogger::flush()
-{
+{
m_file.flush();
}
@@ -84,14 +86,14 @@
{
va_list args;
int count;
-
+
if (!m_fp)
return 0;
-
+
va_start(args, fmt);
count = vfprintf(m_fp, fmt, args);
va_end(args);
-
+
return count;
}
Modified: showeq/branches/pre_6_0_beta/src/main.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/main.cpp 2020-11-02 01:41:45 UTC (rev 1090)
+++ showeq/branches/pre_6_0_beta/src/main.cpp 2020-11-02 01:41:58 UTC (rev 1091)
@@ -226,7 +226,7 @@
exit(-1);
}
- QString configFileDef = configFileDefInfo.absFilePath();
+ QString configFileDef = configFileDefInfo.absoluteFilePath();
QFileInfo configFileInfo = dataLocMgr.findWriteFile(".", "showeq.xml",
true, true);
@@ -234,10 +234,10 @@
// deal with funky border case since we may be running setuid
QString configFile;
if (configFileInfo.dir() != QDir::root())
- configFile = configFileInfo.absFilePath();
+ configFile = configFileInfo.absoluteFilePath();
else
- configFile = QFileInfo(dataLocMgr.userDataDir(".").absPath(),
- "showeq.xml").absFilePath();
+ configFile = QFileInfo(dataLocMgr.userDataDir(".").absolutePath(),
+ "showeq.xml").absoluteFilePath();
// scan command line arguments for a specified config file
int i = 1;
@@ -250,7 +250,7 @@
}
/* NOTE: See preferencefile.cpp for info on how to use prefrences class */
- printf("Using config file '%s'\n", (const char*)configFile);
+ printf("Using config file '%s'\n", configFile.toAscii().data());
pSEQPrefs = new XMLPreferences(configFileDef, configFile);
showeq_params = new ShowEQParams;
@@ -290,7 +290,7 @@
showeq_params->restorePlayerState = false;
showeq_params->restoreZoneState = false;
showeq_params->restoreSpawns = false;
- showeq_params->saveRestoreBaseFilename = dataLocMgr.findWriteFile("tmp", pSEQPrefs->getPrefString("BaseFilename", section, "last")).absFilePath();
+ showeq_params->saveRestoreBaseFilename = dataLocMgr.findWriteFile("tmp", pSEQPrefs->getPrefString("BaseFilename", section, "last")).absoluteFilePath();
showeq_params->filterZoneDataLog = 0;
/* Parse the commandline for commandline parameters */
Modified: showeq/branches/pre_6_0_beta/src/map.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.cpp 2020-11-02 01:41:45 UTC (rev 1090)
+++ showeq/branches/pre_6_0_beta/src/map.cpp 2020-11-02 01:41:58 UTC (rev 1091)
@@ -98,19 +98,22 @@
//----------------------------------------------------------------------
// CLineDlg
CLineDlg::CLineDlg(QWidget *parent, QString name, MapMgr *mapMgr)
- : QDialog(parent, name, FALSE)
+ : QDialog(parent)
{
+ setObjectName(name);
#ifdef DEBUGMAP
qDebug ("CLineDlg()");
#endif /* DEBUGMAP */
-
+
QFont labelFont;
labelFont.setBold(true);
QBoxLayout *topLayout = new QVBoxLayout(this);
- QBoxLayout *row2Layout = new QHBoxLayout(topLayout);
- QBoxLayout *row1Layout = new QHBoxLayout(topLayout);
-
+ QBoxLayout *row2Layout = new QHBoxLayout();
+ QBoxLayout *row1Layout = new QHBoxLayout();
+ topLayout->addLayout(row2Layout);
+ topLayout->addLayout(row1Layout);
+
QLabel *colorLabel = new QLabel ("Color", this);
colorLabel->setFont(labelFont);
colorLabel->setFixedHeight(colorLabel->sizeHint().height());
@@ -117,29 +120,31 @@
colorLabel->setFixedWidth(colorLabel->sizeHint().width()+10);
colorLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
row1Layout->addWidget(colorLabel);
-
- m_LineColor = new QComboBox(FALSE, this, "LineColor");
- m_LineColor->insertItem("gray");
- m_LineColor->insertItem("darkBlue");
- m_LineColor->insertItem("darkGreen");
- m_LineColor->insertItem("darkCyan");
- m_LineColor->insertItem("darkRed");
- m_LineColor->insertItem("darkMagenta");
- m_LineColor->insertItem("darkGray");
- m_LineColor->insertItem("white");
- m_LineColor->insertItem("blue");
- m_LineColor->insertItem("green");
- m_LineColor->insertItem("cyan");
- m_LineColor->insertItem("red");
- m_LineColor->insertItem("magenta");
- m_LineColor->insertItem("yellow");
- m_LineColor->insertItem("white");
-
+
+ m_LineColor = new QComboBox(this);
+ m_LineColor->setEditable(false);
+ m_LineColor->setObjectName("LineColor");
+ m_LineColor->insertItem(m_LineColor->count(), "gray");
+ m_LineColor->insertItem(m_LineColor->count(), "darkBlue");
+ m_LineColor->insertItem(m_LineColor->count(), "darkGreen");
+ m_LineColor->insertItem(m_LineColor->count(), "darkCyan");
+ m_LineColor->insertItem(m_LineColor->count(), "darkRed");
+ m_LineColor->insertItem(m_LineColor->count(), "darkMagenta");
+ m_LineColor->insertItem(m_LineColor->count(), "darkGray");
+ m_LineColor->insertItem(m_LineColor->count(), "white");
+ m_LineColor->insertItem(m_LineColor->count(), "blue");
+ m_LineColor->insertItem(m_LineColor->count(), "green");
+ m_LineColor->insertItem(m_LineColor->count(), "cyan");
+ m_LineColor->insertItem(m_LineColor->count(), "red");
+ m_LineColor->insertItem(m_LineColor->count(), "magenta");
+ m_LineColor->insertItem(m_LineColor->count(), "yellow");
+ m_LineColor->insertItem(m_LineColor->count(), "white");
+
m_LineColor->setFont(labelFont);
m_LineColor->setFixedHeight(m_LineColor->sizeHint().height());
m_LineColor->setFixedWidth(m_LineColor->sizeHint().width());
row1Layout->addWidget(m_LineColor, 0, Qt::AlignLeft);
-
+
m_ColorPreview = new QFrame(this);
m_ColorPreview->setFrameStyle(QFrame::Box|QFrame::Raised);
m_ColorPreview->setFixedWidth(50);
@@ -146,11 +151,11 @@
m_ColorPreview->setFixedHeight(m_LineColor->sizeHint().height());
m_ColorPreview->setPalette(QPalette(QColor(Qt::gray)));
row1Layout->addWidget(m_ColorPreview);
-
+
// Hook on when a color changes
connect(m_LineColor, SIGNAL(activated(const QString &)), mapMgr, SLOT(setLineColor(const QString &)));
connect(m_LineColor, SIGNAL(activated(const QString &)), SLOT(changeColor(const QString &)));
-
+
QLabel *nameLabel = new QLabel ("Name", this);
nameLabel->setFont(labelFont);
nameLabel->setFixedHeight(nameLabel->sizeHint().height());
@@ -158,27 +163,28 @@
nameLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
row2Layout->addWidget(nameLabel);
- m_LineName = new QLineEdit(this, "LineName");
+ m_LineName = new QLineEdit(this);
+ m_LineName->setObjectName("LineName");
m_LineName->setFont(labelFont);
m_LineName->setFixedHeight(m_LineName->sizeHint().height());
m_LineName->setFixedWidth(150);
row2Layout->addWidget(m_LineName);
-
+
// Hook on when the line name changes
connect(m_LineName, SIGNAL(textChanged(const QString &)), mapMgr, SLOT(setLineName(const QString &)));
-
+
QPushButton *ok = new QPushButton("OK", this);
ok->setFixedWidth(30);
ok->setFixedHeight(30);
topLayout->addWidget(ok, 0, Qt::AlignCenter);
-
+
// Hook on pressing the OK button
connect(ok, SIGNAL(clicked()), SLOT(accept()));
-
+
for (int i=0; i < m_LineColor->count(); i++)
{
- if (m_LineColor->text(i) == mapMgr->curLineColor())
- m_LineColor->setCurrentItem(i);
+ if (m_LineColor->itemText(i) == mapMgr->curLineColor())
+ m_LineColor->setCurrentIndex(i);
}
m_LineName->setText(mapMgr->curLineName());
@@ -206,7 +212,7 @@
setFrameStyle( QFrame::Plain | QFrame::Box );
setLineWidth( 1 );
setAlignment( Qt::AlignLeft | Qt::AlignTop );
- polish();
+ ensurePolished();
setText( "" );
adjustSize();
}
@@ -255,12 +261,13 @@
MapMgr::MapMgr(const DataLocationMgr* dataLocMgr,
SpawnShell* spawnShell, Player* player, ZoneMgr* zoneMgr,
QWidget* dialogParent, QObject* parent, const char* name)
- : QObject(parent, name),
+ : QObject(parent),
m_dataLocMgr(dataLocMgr),
m_spawnShell(spawnShell),
m_player(player),
m_dialogParent(dialogParent)
{
+ setObjectName(name);
m_dlgLineProps = NULL;
// get the preferences
@@ -342,8 +349,8 @@
void MapMgr::zoneEnd(const QString& shortZoneName, const QString& longZoneName)
{
#ifdef DEBUGMAP
- qDebug ("zoneEnd(%s, %s)",
- (const char*)longZoneName, (const char*)shortZoneName);
+ qDebug ("zoneEnd(%s, %s)",
+ longZoneName.toAscii().data(), shortZoneName.toAscii().data());
#endif /* DEBUGMAP */
// atttempt to load the new map
@@ -369,18 +376,19 @@
if (fileInfo.exists())
{
// load the map if it's not already loaded
- if (fileInfo.absFilePath() != m_mapData.fileName())
- loadFileMap(fileInfo.absFilePath());
+ if (fileInfo.absoluteFilePath() != m_mapData.fileName())
+ loadFileMap(fileInfo.absoluteFilePath());
}
else
{
- seqInfo("No Map found for zone '%s'!", (const char*)shortZoneName);
+ seqInfo("No Map found for zone '%s'!", shortZoneName.toAscii().data());
seqInfo(" Checked for all variants of '%s.map', '%s.txt', and '%s_1.txt'",
- (const char*)shortZoneName,
- (const char*)shortZoneName, (const char*)shortZoneName);
+ shortZoneName.toAscii().data(),
+ shortZoneName.toAscii().data(),
+ shortZoneName.toAscii().data());
seqInfo(" in directories '%s' and '%s'!",
- (const char*)m_dataLocMgr->userDataDir("maps").absPath(),
- (const char*)m_dataLocMgr->pkgDataDir("maps").absPath());
+ m_dataLocMgr->userDataDir("maps").absolutePath().toAscii().data(),
+ m_dataLocMgr->pkgDataDir("maps").absolutePath().toAscii().data());
}
}
@@ -393,7 +401,7 @@
QString fileName = m_mapData.fileName();
if (fileName.isEmpty())
- fileName = m_dataLocMgr->findExistingFile("maps", fileName).absFilePath();
+ fileName = m_dataLocMgr->findExistingFile("maps", fileName).absoluteFilePath();
// create a file dialog the defaults to the currently open map
fileName = QFileDialog::getOpenFileName(m_dialogParent, "Load Map", fileName,
@@ -402,7 +410,7 @@
if (fileName.isEmpty ())
return;
- seqInfo("Attempting to load map: %s", (const char*)fileName);
+ seqInfo("Attempting to load map: %s", fileName.toAscii().data());
// load the map
loadFileMap(fileName, false, true);
@@ -417,7 +425,7 @@
QString fileName = m_mapData.fileName();
if (fileName.isEmpty())
- fileName = m_dataLocMgr->findExistingFile("maps", fileName).absFilePath();
+ fileName = m_dataLocMgr->findExistingFile("maps", fileName).absoluteFilePath();
// create a file dialog the defaults to the currently open map
fileName = QFileDialog::getOpenFileName(m_dialogParent, "Import Map", fileName,
@@ -426,7 +434,7 @@
if (fileName.isEmpty ())
return;
- seqInfo("Attempting to import map: %s", (const char*)fileName);
+ seqInfo("Attempting to import map: %s", fileName.toAscii().data());
// load the map
loadFileMap(fileName, true, true);
@@ -496,7 +504,7 @@
fileInfo = m_dataLocMgr->findWriteFile("maps", fileInfo.baseName() + ".map",
false);
- m_mapData.saveMap(fileInfo.absFilePath());
+ m_mapData.saveMap(fileInfo.absoluteFilePath());
}
void MapMgr::saveSOEMap ()
@@ -509,7 +517,7 @@
fileInfo = m_dataLocMgr->findWriteFile("maps", fileInfo.baseName() + "_2.txt",
false);
- m_mapData.saveSOEMap(fileInfo.absFilePath());
+ m_mapData.saveSOEMap(fileInfo.absoluteFilePath());
}
void MapMgr::addItem(const Item* item)
@@ -584,10 +592,10 @@
{
// ZBTEMP: Should create a real dialog to enter location info
bool ok;
- QString name = QInputDialog::getText("Location Name",
+ QString name = QInputDialog::getText(parent, "Location Name",
"Please enter a location name",
QLineEdit::Normal,
- QString::null, &ok, parent);
+ QString::null, &ok);
// if the user clicked ok, and actually gave a name, add it
if (ok && !name.isEmpty())
@@ -731,7 +739,7 @@
QString preferenceName = m_map->preferenceName();
// set the caption to be the preference name of the map
- setCaption(preferenceName);
+ setWindowTitle(preferenceName);
QMenu* subMenu;
QMenu* subSubMenu;
@@ -1000,7 +1008,10 @@
addAction("Edit Map Icons...", m_map, SLOT(showMapIconDialog()));
subMenu = new QMenu("Draw Size");
- m_drawSizeSpinBox = new QSpinBox(1, 6, 1, subMenu);
+ m_drawSizeSpinBox = new QSpinBox(subMenu);
+ m_drawSizeSpinBox->setMinimum(1);
+ m_drawSizeSpinBox->setMaximum(6);
+ m_drawSizeSpinBox->setSingleStep(1);
m_drawSizeSpinBox->setValue(m_mapIcons->drawSize());
connect(m_drawSizeSpinBox, SIGNAL(valueChanged(int)),
m_mapIcons, SLOT(setDrawSize(int)));
@@ -1014,7 +1025,11 @@
QHBoxLayout* tmpHBoxLayout = new QHBoxLayout(tmpHBox);
tmpHBoxLayout->setContentsMargins(1, 1, 1, 1);
m_fovSpinBoxLabel = new QLabel("Distance:", tmpHBox);
- m_fovSpinBox = new QSpinBox(20, 1200, 20, tmpHBox, "FOV");
+ m_fovSpinBox = new QSpinBox(tmpHBox);
+ m_fovSpinBox->setObjectName("FOV");
+ m_fovSpinBox->setMinimum(20);
+ m_fovSpinBox->setMaximum(1200);
+ m_fovSpinBox->setSingleStep(20);
tmpHBoxLayout->addWidget(m_fovSpinBoxLabel);
tmpHBoxLayout->addWidget(m_fovSpinBox);
m_fovSpinBox->setValue(m_mapIcons->fovDistance());
@@ -1114,7 +1129,10 @@
m_action_FOV = addMenu(subMenu);
subMenu = new QMenu("Default Zoom");
- m_zoomDefaultSpinBox = new QSpinBox(1, 32, 1, subMenu);
+ m_zoomDefaultSpinBox = new QSpinBox(subMenu);
+ m_zoomDefaultSpinBox->setMinimum(1);
+ m_zoomDefaultSpinBox->setMaximum(32);
+ m_zoomDefaultSpinBox->setSingleStep(1);
m_zoomDefaultSpinBox->setValue(m_mapIcons->drawSize());
connect(m_zoomDefaultSpinBox, SIGNAL(valueChanged(int)),
m_map, SLOT(setZoomDefault(int)));
@@ -1244,7 +1262,7 @@
int fovDistance = m_mapIcons->fovDistance();
m_fovSpinBox->setRange(newFOVDistMin, newFOVDistMax);
- m_fovSpinBox->setLineStep(newFOVDistInc);
+ m_fovSpinBox->setSingleStep(newFOVDistInc);
m_fovSpinBox->setValue(fovDistance);
m_action_FOVDistanceBased->setChecked(fovMode == tFOVDistanceBased);
@@ -1521,7 +1539,7 @@
uint32_t runtimeFilterFlagMask,
QWidget * parent,
const char *name)
- : QWidget (parent, name),
+ : QWidget (parent),
m_preferenceName(preferenceName),
m_param(mapMgr->mapData()),
m_mapMgr(mapMgr),
@@ -1535,6 +1553,8 @@
m_zoneMgr(zoneMgr),
m_spawnMonitor(spawnMonitor)
{
+
+ setObjectName(name);
#ifdef DEBUGMAP
qDebug ("Map()");
#endif /* DEBUGMAP */
@@ -1573,7 +1593,7 @@
tmpPrefString = "Caption";
tmpDefault = QString("ShowEQ - ") + prefString;
- setCaption(pSEQPrefs->getPrefString(tmpPrefString, prefString, tmpDefault));
+ setWindowTitle(pSEQPrefs->getPrefString(tmpPrefString, prefString, tmpDefault));
tmpPrefString = "CacheChanges";
m_cacheChanges = pSEQPrefs->getPrefBool(tmpPrefString, prefString, true);
@@ -1777,7 +1797,7 @@
m_param.setScreenSize(size());
// Setup offscreen image
- m_offscreen.resize(m_param.screenLength());
+ m_offscreen = QPixmap(m_param.screenLength());
// m_offscreen.setOptimization(m_param.pixmapOptimizationMethod());
m_mapTip = new MapLabel( this );
@@ -1807,9 +1827,9 @@
connect (m_spawnShell,SIGNAL(changeItem(const Item*, uint32_t)),
this, SLOT(changeItem(const Item*, uint32_t)));
- m_timer->start(1000/m_frameRate, false);
+ m_timer->start(1000/m_frameRate);
-#ifdef DEBUG
+#ifdef DEBUG
if (m_showDebugInfo)
m_time.start();
#endif
@@ -2339,7 +2359,7 @@
emit frameRateChanged(m_frameRate);
if (m_timer->isActive())
- m_timer->changeInterval(1000/m_frameRate);
+ m_timer->setInterval(1000/m_frameRate);
}
}
@@ -2887,7 +2907,7 @@
void Map::dumpInfo(QTextStream& out)
{
out << "[" << preferenceName() << "]" << endl;
- out << "Caption: " << caption() << endl;
+ out << "Caption: " << windowTitle() << endl;
out << "AnimateSpawnMovement: " << m_animate << endl;
out << "VelocityLines: " << m_showVelocityLines << endl;
out << "SpawnDepthFilter: " << m_showVelocityLines << endl;
@@ -2990,9 +3010,9 @@
if (!m_mapIconDialog)
{
// first create the dialog
- m_mapIconDialog = new MapIconDialog(this, caption() + " Icon Dialog",
- false);
-
+ m_mapIconDialog = new MapIconDialog(this,
+ QString(windowTitle() + " Icon Dialog").toAscii().data(), false);
+
// then pass it this objects map icons object
m_mapIconDialog->setMapIcons(m_mapIcons);
}
@@ -3008,7 +3028,7 @@
#endif /* DEBUGMAP */
m_param.setScreenSize(qs->size());
- m_offscreen.resize(m_param.screenLength());
+ m_offscreen = QPixmap(m_param.screenLength());
reAdjust();
@@ -3021,7 +3041,7 @@
reAdjust();
// then, repaint the map
- repaint(mapRect(), FALSE);
+ repaint(mapRect());
}
void Map::refreshMap(void)
@...
[truncated message content] |
|
From: <cn...@us...> - 2020-11-02 01:41:48
|
Revision: 1090
http://sourceforge.net/p/seq/svn/1090
Author: cn187
Date: 2020-11-02 01:41:45 +0000 (Mon, 02 Nov 2020)
Log Message:
-----------
Replace compatibility/deprecated functions with Qt4 equivalents
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/bazaarlog.cpp
showeq/branches/pre_6_0_beta/src/category.cpp
showeq/branches/pre_6_0_beta/src/cgiconv.cpp
showeq/branches/pre_6_0_beta/src/combatlog.cpp
showeq/branches/pre_6_0_beta/src/compass.cpp
showeq/branches/pre_6_0_beta/src/datalocationmgr.cpp
showeq/branches/pre_6_0_beta/src/datetimemgr.cpp
showeq/branches/pre_6_0_beta/src/db3conv.cpp
showeq/branches/pre_6_0_beta/src/drawmap.cpp
showeq/branches/pre_6_0_beta/src/editor.cpp
showeq/branches/pre_6_0_beta/src/eqstr.cpp
showeq/branches/pre_6_0_beta/src/experiencelog.cpp
showeq/branches/pre_6_0_beta/src/experiencelog.h
showeq/branches/pre_6_0_beta/src/filter.cpp
showeq/branches/pre_6_0_beta/src/filteredspawnlog.cpp
showeq/branches/pre_6_0_beta/src/filtermgr.cpp
showeq/branches/pre_6_0_beta/src/filternotifications.cpp
showeq/branches/pre_6_0_beta/src/map.h
showeq/branches/pre_6_0_beta/src/messagefilter.h
Modified: showeq/branches/pre_6_0_beta/src/bazaarlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/bazaarlog.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/bazaarlog.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -58,9 +58,9 @@
const struct bazaarSearchResponseStruct& resp = r[i];
// First copy and remove count from item name
- char name[256];
+ char name[256] = { 0 };
// assert(255>sizeof(resp.item_name));
- strncpy(name,resp.item_name,sizeof(resp.item_name));
+ strncpy(name,resp.item_name,qMin(sizeof(resp.item_name), 255UL));
char *p;
if ((p = rindex(name,'(')) != NULL && isdigit(*(p+1)))
*p=0;
@@ -67,7 +67,7 @@
Item *merchant = m_shell.spawns().value(resp.player_id, nullptr);
const char *merchant_name = "unknown";
if (merchant)
- merchant_name = merchant->name();
+ merchant_name = merchant->name().toAscii().data();
QString csv;
csv.sprintf("1^%d^%d^%d^%s^%s",
int(time(NULL)),resp.price,resp.count,
Modified: showeq/branches/pre_6_0_beta/src/category.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/category.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/category.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -56,12 +56,12 @@
if (!filterout.isEmpty())
m_filterout = filterout;
m_color = color;
-
+
int cFlags = REG_EXTENDED | REG_ICASE;
// allocate the filter item
m_filterItem = new FilterItem(filter, cFlags);
- m_filteredFilter = (filter.find(":Filtered:", 0, false) != -1);
+ m_filteredFilter = (filter.indexOf(":Filtered:", 0, Qt::CaseInsensitive) != -1);
// allocate the filter out item
if (m_filterout.isEmpty())
@@ -94,17 +94,26 @@
// ------------------------------------------------------
// CategoryDlg
CategoryDlg::CategoryDlg(QWidget *parent, QString name)
- : QDialog(parent, name, TRUE)
+ : QDialog(parent, Qt::Dialog)
{
+ setObjectName(name);
+ setModal(true);
+ setWindowTitle("Add Category");
+
QFont labelFont;
labelFont.setBold(true);
QBoxLayout* topLayout = new QVBoxLayout(this);
- QBoxLayout* row4Layout = new QHBoxLayout(topLayout);
- QBoxLayout* row3Layout = new QHBoxLayout(topLayout);
- QBoxLayout* row2Layout = new QHBoxLayout(topLayout);
- QBoxLayout* row1Layout = new QHBoxLayout(topLayout);
- QBoxLayout* row0Layout = new QHBoxLayout(topLayout);
+ QBoxLayout* row4Layout = new QHBoxLayout();
+ topLayout->addLayout(row4Layout);
+ QBoxLayout* row3Layout = new QHBoxLayout();
+ topLayout->addLayout(row3Layout);
+ QBoxLayout* row2Layout = new QHBoxLayout();
+ topLayout->addLayout(row2Layout);
+ QBoxLayout* row1Layout = new QHBoxLayout();
+ topLayout->addLayout(row1Layout);
+ QBoxLayout* row0Layout = new QHBoxLayout();
+ topLayout->addLayout(row0Layout);
QLabel *colorLabel = new QLabel ("Color", this);
colorLabel->setFont(labelFont);
@@ -111,7 +120,8 @@
colorLabel->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
row1Layout->addWidget(colorLabel, 0, Qt::AlignLeft);
- m_Color = new QPushButton(this, "color");
+ m_Color = new QPushButton(this);
+ m_Color->setObjectName("color");
m_Color->setText("...");
m_Color->setFont(labelFont);
connect(m_Color, SIGNAL(clicked()),
@@ -123,7 +133,8 @@
nameLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
row4Layout->addWidget(nameLabel);
- m_Name = new QLineEdit(this, "Name");
+ m_Name = new QLineEdit(this);
+ m_Name->setObjectName("Name");
m_Name->setFont(labelFont);
row4Layout->addWidget(m_Name);
@@ -132,7 +143,8 @@
filterLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
row3Layout->addWidget(filterLabel);
- m_Filter = new QLineEdit(this, "Filter");
+ m_Filter = new QLineEdit(this);
+ m_Filter->setObjectName("Filter");
m_Filter->setFont(labelFont);
row3Layout->addWidget(m_Filter);
@@ -141,7 +153,8 @@
filteroutLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
row2Layout->addWidget(filteroutLabel);
- m_FilterOut = new QLineEdit(this, "FilterOut");
+ m_FilterOut = new QLineEdit(this);
+ m_FilterOut->setObjectName("FilterOut");
m_FilterOut->setFont(labelFont);
row2Layout->addWidget(m_FilterOut);
@@ -162,8 +175,8 @@
void CategoryDlg::select_color(void)
{
- QColor newColor =
- QColorDialog::getColor(m_Color->backgroundColor(), this, QString("Category Color"));
+ QColor newColor =
+ QColorDialog::getColor(palette().color(backgroundRole()), this);
if (newColor.isValid())
m_Color->setPalette(QPalette(QColor(newColor)));
@@ -172,8 +185,9 @@
// ------------------------------------------------------
// CategoryMgr
CategoryMgr::CategoryMgr(QObject* parent, const char* name)
- : QObject(parent, name)
+ : QObject(parent)
{
+ setObjectName(name);
reloadCategories();
}
@@ -304,11 +318,11 @@
// name?name:"", color?color:"", filter?filter:"", filterout?filterout:"");
if (!name.isEmpty() && !filter.isEmpty())
- addCategory(name,
- filter,
- dlg->m_FilterOut->text(),
- dlg->m_Color->backgroundColor());
-
+ addCategory(name,
+ filter,
+ dlg->m_FilterOut->text(),
+ dlg->m_Color->palette().color(dlg->m_Color->backgroundRole()));
+
delete dlg;
}
Modified: showeq/branches/pre_6_0_beta/src/cgiconv.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/cgiconv.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/cgiconv.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -28,7 +28,7 @@
#include <cstdlib>
#include <QRegExp>
-#include <QFilh>
+#include <QFile>
#include <QTextStream>
#include "cgiconv.h"
@@ -52,26 +52,15 @@
QString content_length_str = getenv("CONTENT_LENGTH");
int content_length = content_length_str.toInt();
- // allocate a buffer to hold the query
- char* query_str = new char[content_length + 1];
-
// open the data stream
QTextStream postStream(stdin, QIODevice::ReadOnly);
// set the encoding (required for readRawBytes to work)
- postStream.setEncoding(QTextStream::Latin1);
-
+ postStream.setCodec("latin1");
+
// read the data into the allocated buffer
- postStream.readRawBytes(query_str, content_length);
+ query_string = postStream.read(content_length);
- // make sure to NULL terminate the string
- query_str[content_length] = '\0';
-
- // store the data
- query_string = query_str;
-
- // delete the temporary buffer
- delete query_str;
}
else if (request_method == "GET")
{
@@ -96,7 +85,7 @@
do
{
// find the end of the parameter name (ends at '=')
- index = query_string.find('=', oldindex);
+ index = query_string.indexOf('=', oldindex);
if (index == -1)
break;
@@ -113,8 +102,8 @@
oldindex = index + 1;
// find the end of the parameter pair (ends at '&')
- index = query_string.find(paramEndExp, oldindex);
-
+ index = query_string.indexOf(paramEndExp, oldindex);
+
// extract the value from the query_string
if (index != -1)
value = query_string.mid(oldindex, (index - oldindex));
@@ -188,15 +177,14 @@
QString CGI::getParamName(int paramNum)
{
int count = 0;
-
+
// iterate over the list of parameters
- for (CGIParam* param = cgiParams.first();
- param != 0;
- param = cgiParams.next(), ++count)
+ foreach (CGIParam* param, cgiParams)
{
// if the count matches the parameter number requested, then return it.
if (count == paramNum)
return param->getValue();
+ ++count;
}
return "";
@@ -205,11 +193,9 @@
int CGI::getParamNameCount(const QString& paramName)
{
int count = 0;
-
+
// iterate over the list of parameters
- for (CGIParam* param = cgiParams.first();
- param != 0;
- param = cgiParams.next())
+ foreach (CGIParam* param, cgiParams)
{
// if this is the correct parameter, increment the count
if (param->getName() == paramName)
@@ -223,11 +209,9 @@
QString CGI::getParamValue(const QString& paramName, int instance)
{
int count = 0;
-
+
// iterate over the list of parameters
- for (CGIParam* param = cgiParams.first();
- param != 0;
- param = cgiParams.next())
+ foreach (CGIParam* param, cgiParams)
{
// is this the correct parameter
if (param->getName() == paramName)
@@ -234,13 +218,13 @@
{
// yes, is the count correct, if so return the value
if (count == instance)
- return param->getValue();
+ return param->getValue();
// otherwise, increment the count
count++;
- }
+ }
}
-
+
return "";
}
@@ -429,9 +413,9 @@
QString CGI::unescapeURL(QString url)
{
int index = 0;
-
+
// find first % in the string
- index = url.find('%', index);
+ index = url.indexOf('%', index);
// loop over string while %'s exist
while (index != -1)
@@ -440,7 +424,7 @@
url.replace(index, 3, QString(QChar((char)url.mid(index + 1, 2).toInt(NULL, 16))));
// find next occurrence of % in the URL
- index = url.find('%', index + 1);
+ index = url.indexOf('%', index + 1);
}
return url;
Modified: showeq/branches/pre_6_0_beta/src/combatlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/combatlog.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -286,11 +286,11 @@
m_widget_mob = initMobWidget();
m_tab->addTab(m_widget_mob, "&Mobs");
- m_clear_menu = new QMenu(this);
- m_clear_menu->insertItem("Clear Offense Stats", this, SLOT(clearOffense()));
- m_clear_menu->insertItem("Clear Mob Stats", this, SLOT(clearMob()));
+ m_clear_menu = new QMenu("&Clear");
+ m_clear_menu->addAction("Clear Offense Stats", this, SLOT(clearOffense()));
+ m_clear_menu->addAction("Clear Mob Stats", this, SLOT(clearMob()));
- m_menu_bar->insertItem("&Clear", m_clear_menu);
+ m_menu_bar->addMenu(m_clear_menu);
updateOffense();
updateDefense();
@@ -369,8 +369,8 @@
m_label_offense_avgnonmelee = new QLabel(summaryGBox);
summaryGridLayout->addWidget(m_label_offense_avgnonmelee, 2, 3);
- summaryGridLayout->setColStretch(1, 1);
- summaryGridLayout->setColStretch(3, 1);
+ summaryGridLayout->setColumnStretch(1, 1);
+ summaryGridLayout->setColumnStretch(3, 1);
summaryGridLayout->setSpacing(5);
return pWidget;
@@ -416,9 +416,9 @@
avoidanceGridLayout->addItem(new QSpacerItem(1,1), 2, 0, 1, 6);
- avoidanceGridLayout->setColStretch(1, 1);
- avoidanceGridLayout->setColStretch(3, 1);
- avoidanceGridLayout->setColStretch(5, 1);
+ avoidanceGridLayout->setColumnStretch(1, 1);
+ avoidanceGridLayout->setColumnStretch(3, 1);
+ avoidanceGridLayout->setColumnStretch(5, 1);
avoidanceGridLayout->setRowStretch(2, 1);
avoidanceGridLayout->setSpacing(5);
@@ -446,9 +446,9 @@
mitigationGridLayout->addItem(new QSpacerItem(1,1), 1, 0, 1, 6);
- mitigationGridLayout->setColStretch(1, 1);
- mitigationGridLayout->setColStretch(3, 1);
- mitigationGridLayout->setColStretch(5, 1);
+ mitigationGridLayout->setColumnStretch(1, 1);
+ mitigationGridLayout->setColumnStretch(3, 1);
+ mitigationGridLayout->setColumnStretch(5, 1);
mitigationGridLayout->setRowStretch(1, 1);
mitigationGridLayout->setSpacing(5);
@@ -477,9 +477,9 @@
summaryGridLayout->addItem(new QSpacerItem(1,1), 2, 0, 1, 6);
- summaryGridLayout->setColStretch(1, 1);
- summaryGridLayout->setColStretch(3, 1);
- summaryGridLayout->setColStretch(5, 1);
+ summaryGridLayout->setColumnStretch(1, 1);
+ summaryGridLayout->setColumnStretch(3, 1);
+ summaryGridLayout->setColumnStretch(5, 1);
summaryGridLayout->setRowStretch(1, 1);
summaryGridLayout->setSpacing(5);
@@ -545,8 +545,8 @@
m_label_mob_lastdps = new QLabel(summaryGBox);
summaryGridLayout->addWidget(m_label_mob_lastdps, 1, 3);
- summaryGridLayout->setColStretch(1, 1);
- summaryGridLayout->setColStretch(3, 1);
+ summaryGridLayout->setColumnStretch(1, 1);
+ summaryGridLayout->setColumnStretch(3, 1);
summaryGridLayout->setSpacing(5);
@@ -638,12 +638,12 @@
case 52: // Tiger Claw
{
// this is a normal skill
- s_type.sprintf("%s(%d)", (const char*)skill_name(iType), iType);
+ s_type.sprintf("%s(%d)", skill_name(iType).toAscii().data(), iType);
break;
}
case 231: // Non Melee Damage
{
- s_type.sprintf("Spell: %s(%d)", (const char*)spell_name(iSpell), iSpell);
+ s_type.sprintf("Spell: %s(%d)", spell_name(iSpell).toAscii().data(), iSpell);
break;
}
default: // Damage Shield?
Modified: showeq/branches/pre_6_0_beta/src/compass.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/compass.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/compass.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -36,10 +36,11 @@
#include <cstdio>
Compass::Compass (QWidget *parent, const char *name)
- : QWidget ( parent, name )
+ : QWidget ( parent )
{
m_ang = 0;
m_dSpawnAngle = -1;
+ setObjectName(name);
}
const QRect compass_rect(-3, 0, 40, 6);
@@ -75,7 +76,7 @@
m_dSpawnAngle = quadDegs;
- repaint ( compassRect(), FALSE);
+ repaint (compassRect());
}
QRect Compass::compassRect() const
@@ -90,7 +91,7 @@
if (m_ang == ((360-degrees)+90))
return;
m_ang = (360-degrees)+90;
- repaint ( compassRect(), FALSE);
+ repaint (compassRect());
emit angleChanged(m_ang);
}
@@ -160,7 +161,7 @@
if (m_dSpawnAngle > 0)
{
- tmp.resetXForm();
+ tmp.resetMatrix();
tmp.translate(pwd2, phd2);
tmp.rotate(-m_dSpawnAngle);
tmp.setPen(Qt::green);
Modified: showeq/branches/pre_6_0_beta/src/datalocationmgr.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/datalocationmgr.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/datalocationmgr.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -36,7 +36,7 @@
m_pkgData = PKGDATADIR;
// create the user directory object
- m_userData = QDir::homeDirPath() + "/" + homeSubDir;
+ m_userData = QDir::homePath() + "/" + homeSubDir;
}
DataLocationMgr::~DataLocationMgr()
@@ -53,10 +53,9 @@
QDir userDataDir(m_userData);
// no, then attempt to create it.
- if (!userDataDir.mkdir(m_userData, true))
+ if (!userDataDir.mkdir(m_userData))
{
- seqWarn("Failed to create '%s'\n",
- (const char*)userDataDir.absPath());
+ seqWarn("Failed to create '%s'\n", userDataDir.absolutePath().toAscii().data());
return false;
}
}
@@ -139,7 +138,7 @@
if (!caseSensitive)
{
// create a case insensitive regex
- QRegExp regex(filename, false, false);
+ QRegExp regex(filename, Qt::CaseInsensitive);
// construct the filterspec to choose only the files with matching access
QDir::Filters filterSpec;
@@ -195,7 +194,7 @@
// ok, try to make it
dir = findOrMakeSubDir(dir1, subdir);
- QFileInfo dirInfo(dir.absPath());
+ QFileInfo dirInfo(dir.absolutePath());
// see if we found or made the subdir and it is writable...
if (dirInfo.exists() && dirInfo.isDir() && dirInfo.isWritable())
@@ -216,9 +215,9 @@
// ok, try to make it
dir = findOrMakeSubDir(dir2, subdir);
-
- dirInfo.setFile(dir.absPath());
+ dirInfo.setFile(dir.absolutePath());
+
// see if we found or made the subdir and it is writable...
if (dirInfo.exists() && dirInfo.isDir() && dirInfo.isWritable())
return QFileInfo(dir, filename);
@@ -230,11 +229,11 @@
if (!dir.cd("tmp"))
if (!dir.cd("temp"))
if (!dir.cd("/var/tmp"))
- return QFileInfo(dir, filename); // can't catch a break
-
+ return QFileInfo(dir, filename); // can't catch a break
+
// ok, try to make the subdirectory
- dir = findOrMakeSubDir(dir.absPath(), subdir);
- dirInfo.setFile(dir.absPath());
+ dir = findOrMakeSubDir(dir.absolutePath(), subdir);
+ dirInfo.setFile(dir.absolutePath());
// see if we found or made the subdir and it is writable...
if (dirInfo.exists() && dirInfo.isDir() && dirInfo.isWritable())
@@ -259,11 +258,11 @@
// if the parent directory doesn't exist, attempt to create it.
if (!dirDir.exists())
- dirDir.mkdir(".", false);
+ dirDir.mkdir(".");
// attempt to create the directory;
if (!dirDir.exists(subdir))
- dirDir.mkdir(subdir, false);
+ dirDir.mkdir("./" + subdir);
// attempt to cd into the directory that was theoretically just created.
if (dirDir.cd(subdir))
@@ -271,5 +270,5 @@
// return a QFileInfo, the caller can use its methods to determine the
// directories status
- return QDir(QFileInfo(dirDir, subdir).dirPath(true));
+ return QDir(QFileInfo(dirDir, subdir).absolutePath());
}
Modified: showeq/branches/pre_6_0_beta/src/datetimemgr.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/datetimemgr.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/datetimemgr.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -31,10 +31,11 @@
#include <QTimer>
DateTimeMgr::DateTimeMgr(QObject* parent, const char* name)
- : QObject(parent, name),
+ : QObject(parent),
m_updateFrequency(60 * 1000),
m_timer(0)
{
+ setObjectName(name);
}
void DateTimeMgr::setUpdateFrequency(int seconds)
@@ -48,7 +49,7 @@
update();
// set the timer to the new interval
- m_timer->changeInterval(m_updateFrequency);
+ m_timer->setInterval(m_updateFrequency);
}
}
@@ -56,7 +57,7 @@
{
const timeOfDayStruct* tday = (const timeOfDayStruct*)data;
- m_refDateTime = QDateTime::currentDateTime(Qt::UTC);
+ m_refDateTime = QDateTime::currentDateTime().toTimeSpec(Qt::UTC);
m_eqDateTime.setDate(QDate(tday->year, tday->month, tday->day));
m_eqDateTime.setTime(QTime(tday->hour - 1, tday->minute, 0));
if (!m_timer)
@@ -63,7 +64,7 @@
{
m_timer = new QTimer(this);
connect(m_timer, SIGNAL(timeout()), SLOT(update()));
- m_timer->start(m_updateFrequency, false);
+ m_timer->start(m_updateFrequency);
}
emit syncDateTime(m_eqDateTime);
@@ -74,7 +75,7 @@
if (!m_eqDateTime.isValid())
return;
- const QDateTime& current = QDateTime::currentDateTime(Qt::UTC);
+ const QDateTime& current = QDateTime::currentDateTime().toTimeSpec(Qt::UTC);
int secs = m_refDateTime.secsTo(current);
if (secs)
Modified: showeq/branches/pre_6_0_beta/src/db3conv.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/db3conv.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/db3conv.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -87,7 +87,7 @@
QFileInfo fileInfo(dbName);
// Get information about the directory the file should be in
- QFileInfo dirInfo(fileInfo.dirPath());
+ QFileInfo dirInfo(fileInfo.absoluteFilePath());
// if the directory that the db will be opened in doesn't exist, just
// warn and fail now
@@ -94,7 +94,7 @@
if (!dirInfo.exists())
{
fprintf(stderr, "DB3Convenience: Data Directory '%s' doesn't exist.\n",
- (const char*)dirInfo.absFilePath());
+ dirInfo.absoluteFilePath().toAscii().data());
// nothing more to do, just return NULL
return (Db*)NULL;
@@ -104,7 +104,7 @@
if (!dirInfo.isDir())
{
fprintf(stderr, "DB3Convenience: Data Directory '%s isn't a directory.\n",
- (const char*)dirInfo.absFilePath());
+ dirInfo.absoluteFilePath().toAscii().data());
// nothing more to do, just return NULL
return (Db*)NULL;
@@ -119,8 +119,8 @@
{
// if the file isn't readable, no point in going on is there...
fprintf(stderr, "DB3Convenience: Data File '%s isn't readable.\n",
- (const char*)dirInfo.absFilePath());
-
+ dirInfo.absoluteFilePath().toAscii().data());
+
// nothing more to do, just return NULL
return (Db*)NULL;
}
@@ -156,9 +156,9 @@
// setup the common database environment for all databases opened
// using this object
- ret = m_dbEnv->open((const char*)dirInfo.absFilePath(), dbEnvFlags,
- 0664);
-
+ ret = m_dbEnv->open(dirInfo.absoluteFilePath().toAscii().data(), dbEnvFlags,
+ 0664);
+
if (ret != 0)
{
// display a human readable error
@@ -187,16 +187,16 @@
#if 1 // can't do verify with transactions, logging, or locking
// verify the database before we go any further
- ret = retdbp->verify((const char*)dbName, NULL, NULL, 0);
+ ret = retdbp->verify(dbName.toAscii().data(), NULL, NULL, 0);
if (ret != 0)
{
// display a human readable error
fprintf(stderr, "DB3Convenience: Db::verify() failed on file '%s': %s\n",
- (const char*)dbName, DbEnv::strerror(ret));
+ dbName.toAscii().data(), DbEnv::strerror(ret));
if (ret == DB_RUNRECOVERY)
- fprintf(stderr, "DB3Convenience: Please run db_recover on file '%s'\n",
- (const char*)dbName);
+ fprintf(stderr, "DB3Convenience: Please run db_recover on file '%s'\n",
+ dbName.toAscii().data());
// check if it's a file access problem
if (openForReadOnly)
@@ -220,8 +220,8 @@
{
// display a human readable error
fprintf(stderr,
- "DB3Convenience: Db::set_flags(0) failed on file '%s': %s\n",
- (const char*)dbName, DbEnv::strerror(ret));
+ "DB3Convenience: Db::set_flags(0) failed on file '%s': %s\n",
+ dbName.toAscii().data(), DbEnv::strerror(ret));
// delete the database handle since it's not usable
delete retdbp;
@@ -233,13 +233,13 @@
// open the database
// ret = retdbp->open((const char*)dbName, NULL, DB_HASH, dbOpenFlags, 0664);
- ret = retdbp->open((const char*)dbName, NULL, DB_BTREE, dbOpenFlags, 0664);
-
+ ret = retdbp->open(NULL, dbName.toAscii().data(), NULL, DB_BTREE, dbOpenFlags, 0664);
+
if (ret != 0)
{
// display a human readable error
- fprintf(stderr, "DB3Convenience: Db::open() failed on file '%s': %s\n",
- (const char*)dbName, DbEnv::strerror(ret));
+ fprintf(stderr, "DB3Convenience: Db::open() failed on file '%s': %s\n",
+ dbName.toAscii().data(), DbEnv::strerror(ret));
// check if it's a file access problem
if (openForReadOnly)
@@ -283,7 +283,7 @@
success = true;
break;
default:
- displayDB3Error(ret, "Insert: put", (const char*)dbName);
+ displayDB3Error(ret, "Insert: put", dbName.toAscii().data());
}
}
@@ -307,7 +307,7 @@
success = true;
break;
default:
- displayDB3Error(ret, "Delete: del", (const char*)dbName);
+ displayDB3Error(ret, "Delete: del", dbName.toAscii().data());
}
}
@@ -335,7 +335,7 @@
success = false;
break;
default:
- displayDB3Error(ret, "IsEntryExist: get", (const char*)dbName);
+ displayDB3Error(ret, "IsEntryExist: get", dbName.toAscii().data());
}
}
@@ -368,7 +368,7 @@
success = false;
break;
default:
- displayDB3Error(ret, "GetEntry: get", (const char*)dbName);
+ displayDB3Error(ret, "GetEntry: get", dbName.toAscii().data());
}
}
@@ -404,7 +404,7 @@
int ret = db->close(0);
if (ret != 0)
- displayDB3Error(ret, "Close: close", (const char*)dbName);
+ displayDB3Error(ret, "Close: close", dbName.toAscii().data());
// remove the db from the dictionary
m_dbDict.remove(dbName);
@@ -440,11 +440,8 @@
ret = db->close(0);
if (ret != 0)
- displayDB3Error(ret, "Shutdown: close", (const char*)dbName);
+ displayDB3Error(ret, "Shutdown: close", dbName.toAscii().data());
- // increment to next database
- ++it;
-
// remove the db from the dictionary
m_dbDict.remove(dbName);
@@ -513,7 +510,7 @@
if (ret != 0)
{
- displayDB3Error(ret, "GetFirstKey: cursor", (const char*)dbName);
+ displayDB3Error(ret, "GetFirstKey: cursor", dbName.toAscii().data());
return false;
}
@@ -531,7 +528,7 @@
// display an error on any other error returns
if (ret != 0)
{
- displayDB3Error(ret, "GetFirstKey: get", (const char*)m_dbName);
+ displayDB3Error(ret, "GetFirstKey: get", m_dbName.toAscii().data());
return false;
}
@@ -582,7 +579,7 @@
// display an error on any other error returns
if (ret != 0)
{
- displayDB3Error(ret, "GetNextKey: get", (const char*)m_dbName);
+ displayDB3Error(ret, "GetNextKey: get", m_dbName.toAscii().data());
return false;
}
@@ -645,7 +642,7 @@
int ret = m_db->close(0);
if (ret != 0)
- displayDB3Error(ret, "Done: close", (const char*)m_dbName);
+ displayDB3Error(ret, "Done: close", m_dbName.toAscii().data());
}
// if there is any data left over that the user didn't get, then free it
Modified: showeq/branches/pre_6_0_beta/src/drawmap.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/drawmap.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/drawmap.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -205,9 +205,9 @@
"yellow",
"gray"
};
-
- QString lcolorname = colorname.lower();
+ QString lcolorname = colorname.toLower();
+
for (uint32_t i = 0; i < sizeof(colornames)/sizeof(const char*); i++)
{
if (lcolorname == colornames[i])
@@ -396,11 +396,11 @@
break;
}
}
-
+
fclose (fh);
- char message[128];
+ char message[258];
sprintf (message, "%s [%s]", zoneLong, zoneShort);
-
+
reAdjust ();
}
#ifdef ZBTEMP
@@ -524,10 +524,10 @@
tmpcolor = mapcolors[locationColor[n]];
}
- gdImageString (im, gdFontSmall,
- calcXOffset (locationX[n]) - 2,
- calcYOffset (locationY[n]) - 2,
- (unsigned char*)(const char *)locationName[n], tmpcolor);
+ gdImageString (im, gdFontSmall,
+ calcXOffset (locationX[n]) - 2,
+ calcYOffset (locationY[n]) - 2,
+ (unsigned char*)locationName[n].toAscii().data(), tmpcolor);
}
/* Print the http header */
@@ -583,7 +583,7 @@
mapName.replace(slashExp, "_");
mapName.prepend(PKGDATADIR "maps/");
- loadFileMap ((const char*)mapName);
+ loadFileMap (mapName.toAscii().data());
paintMap();
}
else
@@ -590,9 +590,10 @@
{
// open the output data stream
QTextStream out(stdout, QIODevice::WriteOnly);
- out.setEncoding(QTextStream::Latin1);
- out.flags(QTextStream::showbase | QTextStream::dec);
-
+ out.setCodec("latin1");
+ out.setIntegerBase(10);
+ out.setNumberFlags(QTextStream::ShowBase);
+
const char* header =
"Content-type: text/html; charset=iso-8859-1\n\n"
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n"
@@ -647,23 +648,21 @@
out << "<TD><SELECT name=\"map\" size=\"1\">\n";
// create a file info list
- const QFileInfoList *list = mapDir.entryInfoList();
+ const QFileInfoList list = mapDir.entryInfoList();
// create an iterator over the list
- QFileInfoListIterator it( *list );
-
+ QListIterator<QFileInfo> it( list );
+
// pointer to the file info for the current file
- QFileInfo *fi;
+ QFileInfo fi;
- while ( (fi=it.current()) )
+ while (it.hasNext())
{
- out << "<OPTION value=\"" << fi->fileName() << "\"";
- if (mapName == fi->fileName())
- out << " selected";
- out << ">" << fi->baseName() << "</OPTION>\n";
-
- // goto next element from list
- ++it;
+ fi = it.next();
+ out << "<OPTION value=\"" << fi.fileName() << "\"";
+ if (mapName == fi.fileName())
+ out << " selected";
+ out << ">" << fi.baseName() << "</OPTION>\n";
}
out << "</SELECT></TD>\n";
Modified: showeq/branches/pre_6_0_beta/src/editor.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/editor.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/editor.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -27,7 +27,6 @@
#include <cstring>
#include <cerrno>
-#include <QApplication>
#include <QToolBar>
#include <QStatusBar>
#include <QMenu>
@@ -94,20 +93,21 @@
};
EditorWindow::EditorWindow(const char *fileName)
- : QMainWindow( 0, "ShowEQ - Editor", Qt::WDestructiveClose )
+ : QMainWindow( 0, Qt::WDestructiveClose )
{
+ setObjectName("ShowEQ - Editor");
QPixmap openIcon, saveIcon;
openIcon = QPixmap( fileopen );
saveIcon = QPixmap( filesave );
fileTools = new QToolBar(this);
- fileTools->setLabel( tr( "File Operations" ) );
+ fileTools->setWindowTitle( tr( "File Operations" ) );
fileTools->addAction(openIcon, "Open File", this, SLOT(load()));
fileTools->addAction(saveIcon, "Save File", this, SLOT(save()));
addToolBar(fileTools);
- QMenu * file = new QMenu( this );
- menuBar()->insertItem( "&File", file );
+ QMenu * file = new QMenu("&File", this);
+ menuBar()->addMenu(file);
file->addAction( openIcon, "&Open", this, SLOT(load()), Qt::CTRL+Qt::Key_O );
@@ -115,11 +115,12 @@
file->addSeparator();
file->addAction( "&Close Editor", this, SLOT(close()), Qt::CTRL+Qt::Key_W );
- e = new QTextEdit( this, "editor" );
+ e = new QTextEdit(this);
+ e->setObjectName("editor");
e->setFocus();
setCentralWidget( e );
- statusBar()->message( "Ready", 2000 );
+ statusBar()->showMessage( "Ready", 2000 );
resize( 600, 450 );
filename = (QString)fileName;
@@ -134,9 +135,9 @@
{
QString fn = QFileDialog::getOpenFileName(this);
if ( !fn.isEmpty() )
- load( fn );
+ load(fn.toAscii().data());
else
- statusBar()->message( "File Open Cancelled", 2000 );
+ statusBar()->showMessage( "File Open Cancelled", 2000 );
}
void EditorWindow::load( const char *fileName )
@@ -155,11 +156,11 @@
f.close();
e->repaint();
- e->setModified( FALSE );
- setCaption( fileName );
+ e->document()->setModified( FALSE );
+ setWindowTitle( fileName );
QString s;
s.sprintf( "Opened %s", fileName );
- statusBar()->message( s, 2000 );
+ statusBar()->showMessage( s, 2000 );
}
void EditorWindow::save()
@@ -169,10 +170,10 @@
return;
}
- QString text = e->text();
+ QString text = e->toPlainText();
QFile f( filename );
if ( !f.open( QIODevice::WriteOnly ) ) {
- statusBar()->message( QString("Could not write to %1").arg(filename),
+ statusBar()->showMessage( QString("Could not write to %1").arg(filename),
2000 );
return;
}
@@ -181,11 +182,11 @@
t << text;
f.close();
- e->setModified( FALSE );
+ e->document()->setModified( FALSE );
- setCaption( filename );
+ setWindowTitle( filename );
- statusBar()->message( QString( "Saved %1" ).arg( filename ), 2000 );
+ statusBar()->showMessage( QString( "Saved %1" ).arg( filename ), 2000 );
}
void EditorWindow::saveAs()
@@ -195,13 +196,13 @@
filename = fn;
save();
} else {
- statusBar()->message( "Saving cancelled", 2000 );
+ statusBar()->showMessage( "Saving cancelled", 2000 );
}
}
void EditorWindow::closeEvent( QCloseEvent* ce )
{
- if ( !e->isModified() ) {
+ if ( !e->document()->isModified() ) {
ce->accept();
return;
}
Modified: showeq/branches/pre_6_0_beta/src/eqstr.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/eqstr.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/eqstr.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -56,8 +56,7 @@
// open the file read only
if (!formatFile.open(QIODevice::ReadOnly))
{
- seqWarn("EQStr: Failed to open '%s'",
- fileName.latin1());
+ seqWarn("EQStr: Failed to open '%s'", fileName.toLatin1().data());
return false;
}
@@ -69,11 +68,10 @@
// construct a regex to deal with either style line termination
QRegExp lineTerm("[\r\n]{1,2}");
-
+
// split the data into lines at the line termination
- QStringList lines = QStringList::split(lineTerm,
- QString::fromUtf8(textData), false);
-
+ QStringList lines = QString::fromUtf8(textData).split(lineTerm, QString::SkipEmptyParts);
+
// start iterating over the lines
QStringList::Iterator it = lines.begin();
@@ -91,8 +89,8 @@
for (; it != lines.end(); ++it)
{
// find the beginning space
- spc = (*it).find(' ');
-
+ spc = (*it).indexOf(' ');
+
// convert the beginnign of the string to a ULong
formatId = (*it).left(spc).toULong();
@@ -107,9 +105,9 @@
m_loaded = true;
seqInfo("Loaded %d message strings from '%s' maxFormat=%d",
- m_messageStrings.count(), fileName.latin1(),
- maxFormatId);
-
+ m_messageStrings.count(), fileName.toLatin1().data(),
+ maxFormatId);
+
return true;
}
@@ -183,7 +181,7 @@
bool ok;
int curPos;
- size_t substArg;
+ int substArg;
int substArgValue;
QString substFormatStringRes;
QString substFormatString;
@@ -191,10 +189,10 @@
////////////////////////////
// replace template (%T) arguments in formatted string
QString formatString = formatStringRes;
- QRegExp rxt("%T(\\d{1,3})", true, false);
+ QRegExp rxt("%T(\\d{1,3})");
// find first template substitution
- curPos = rxt.search(formatString, 0);
+ curPos = rxt.indexIn(formatString, 0);
while (curPos != -1)
{
@@ -215,7 +213,7 @@
curPos += rxt.matchedLength(); // if no replacement string, skip over
// find next substitution
- curPos = rxt.search(formatString, curPos);
+ curPos = rxt.indexIn(formatString, curPos);
}
////////////////////////////
@@ -222,10 +220,10 @@
// now replace substitution arguments in formatted string
// NOTE: not using QString::arg() because not all arguments are always used
// and it will do screwy stuff in this situation
- QRegExp rx("%(\\d{1,3})", true, false);
+ QRegExp rx("%(\\d{1,3})");
// find first template substitution
- curPos = rx.search(formatString, 0);
+ curPos = rx.indexIn(formatString, 0);
while (curPos != -1)
{
@@ -238,7 +236,7 @@
curPos += rx.matchedLength(); // if no such argument, skip over
// find next substitution
- curPos = rx.search(formatString, curPos);
+ curPos = rx.indexIn(formatString, curPos);
}
return formatString;
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -176,36 +176,68 @@
m_calcZEM=0;
m_ZEMviewtype = 0;
- m_view_menu = new QMenu( this );
- m_view_menu->insertItem( "&All Mobs", this, SLOT(viewAll()) );
- m_view_menu->insertItem( "Previous &15 Minutes", this, SLOT(view15Minutes()) );
- m_view_menu->insertItem( "Previous &30 Minutes", this, SLOT(view30Minutes()) );
- m_view_menu->insertItem( "Previous &60 Minutes", this, SLOT(view60Minutes()) );
- m_view_menu->setItemChecked( m_view_menu->idAt(0), true );
+ QAction* tmpAction;
- m_view_menu->insertSeparator();
- m_exp_rate_menu = new QMenu( this );
- m_exp_rate_menu->insertItem( "per &minute", this, SLOT(viewRatePerMinute()) );
- m_exp_rate_menu->insertItem( "per &hour", this, SLOT(viewRatePerHour()) );
- m_exp_rate_menu->setItemChecked( m_exp_rate_menu->idAt(0), true );
- m_view_menu->insertItem( "Experience &Rate", m_exp_rate_menu );
+ m_view_menu = new QMenu("&View");
+ QActionGroup* view_time_action_group = new QActionGroup(m_view_menu);
- m_view_menu->insertSeparator();
- m_view_menu->insertItem( "Clear Kills", this, SLOT(viewClear()) );
+ tmpAction = m_view_menu->addAction( "&All Mobs", this, SLOT(viewAll()) );
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(true);
+ view_time_action_group->addAction(tmpAction);
+ tmpAction = m_view_menu->addAction( "Previous &15 Minutes", this, SLOT(view15Minutes()) );
+ tmpAction->setCheckable(true);
+ view_time_action_group->addAction(tmpAction);
+ tmpAction = m_view_menu->addAction( "Previous &30 Minutes", this, SLOT(view30Minutes()) );
+ tmpAction->setCheckable(true);
+ view_time_action_group->addAction(tmpAction);
+ tmpAction = m_view_menu->addAction( "Previous &60 Minutes", this, SLOT(view60Minutes()) );
+ tmpAction->setCheckable(true);
+ view_time_action_group->addAction(tmpAction);
+ view_time_action_group->setExclusive(true);
- m_view_menu->insertSeparator();
- m_ZEM_menu = new QMenu( this );
- m_ZEM_menu->insertItem( "Calculated Value", this, SLOT(viewZEMcalculated()) );
- m_ZEM_menu->insertItem( "Raw Value", this, SLOT(viewZEMraw()) );
- m_ZEM_menu->insertItem( "Percent Bonus", this, SLOT(viewZEMpercent()) );
- m_ZEM_menu->setItemChecked( m_ZEM_menu->idAt(0), true );
- m_view_menu->insertItem( "ZEM View Options", m_ZEM_menu );
- m_view_menu->insertItem( "Calculate ZEM on next kill", this, SLOT(calcZEMNextKill()) );
+ m_view_menu->addSeparator();
+ QActionGroup* exp_rate_action_group = new QActionGroup(m_view_menu);
+ m_exp_rate_menu = new QMenu("Experience &Rate");
+ tmpAction = m_exp_rate_menu->addAction( "per &minute", this, SLOT(viewRatePerMinute()) );
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(true);
+ exp_rate_action_group->addAction(tmpAction);
+ tmpAction = m_exp_rate_menu->addAction( "per &hour", this, SLOT(viewRatePerHour()) );
+ exp_rate_action_group->addAction(tmpAction);
+ tmpAction->setCheckable(true);
+ exp_rate_action_group->setExclusive(true);
+ m_view_menu->addMenu(m_exp_rate_menu);
+
+ m_view_menu->addSeparator();
+ m_view_menu->addAction( "Clear Kills", this, SLOT(viewClear()) );
+
+ m_view_menu->addSeparator();
+ m_ZEM_menu = new QMenu("ZEM View Options");
+ QActionGroup* zem_options_action_group = new QActionGroup(m_view_menu);
+ tmpAction = m_ZEM_menu->addAction( "Calculated Value", this, SLOT(viewZEMcalculated()) );
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(true);
+ zem_options_action_group->addAction(tmpAction);
+ tmpAction = m_ZEM_menu->addAction( "Raw Value", this, SLOT(viewZEMraw()) );
+ tmpAction->setCheckable(true);
+ zem_options_action_group->addAction(tmpAction);
+ tmpAction = m_ZEM_menu->addAction( "Percent Bonus", this, SLOT(viewZEMpercent()) );
+ tmpAction->setCheckable(true);
+ zem_options_action_group->addAction(tmpAction);
+ zem_options_action_group->setExclusive(true);
+
+ m_view_menu->addMenu(m_ZEM_menu);
+
+ m_action_calc_zem = m_view_menu->addAction( "Calculate ZEM on next kill",
+ this, SLOT(calcZEMNextKill()) );
+ m_action_calc_zem->setCheckable(true);
+
m_layout = new QVBoxLayout(boxLayout());
m_menu_bar = new QMenuBar( this );
- m_menu_bar->insertItem( "&View", m_view_menu );
+ m_menu_bar->addMenu(m_view_menu );
//m_layout->addSpacing( m_menu_bar->height() + 5 );
m_layout->addWidget(m_menu_bar);
@@ -221,7 +253,7 @@
m_exp_listview->addColumn("Class total");
m_exp_listview->addColumn("Group total");
m_exp_listview->addColumn("Experience Gained");
-
+
m_exp_listview->restoreColumns();
m_exp_listview->setMinimumSize( m_exp_listview->sizeHint().width(),
@@ -272,8 +304,8 @@
m_time_to_level = new QLabel(statsGBox);
statsGridLayout->addWidget(m_time_to_level, 3, 3);
- statsGridLayout->setColStretch( 1, 1 );
- statsGridLayout->setColStretch( 3, 1 );
+ statsGridLayout->setColumnStretch( 1, 1 );
+ statsGridLayout->setColumnStretch( 3, 1 );
statsGridLayout->setSpacing( 5 );
updateAverage( );
@@ -285,7 +317,7 @@
QFileInfo fileInfo = m_dataLocMgr->findWriteFile("logs", "exp.log");
- m_log = fopen(fileInfo.absFilePath(), "a");
+ m_log = fopen(fileInfo.absoluteFilePath().toAscii().data(), "a");
if (m_log == 0)
{
m_log_exp = 0;
@@ -298,7 +330,7 @@
fileInfo = m_dataLocMgr->findWriteFile("logs", "newexp.log");
- m_newExpLogFile = fileInfo.absFilePath();
+ m_newExpLogFile = fileInfo.absoluteFilePath();
}
void ExperienceWindow::savePrefs()
@@ -324,7 +356,7 @@
#ifdef DEBUGEXP
resize( sizeHint() );
qDebug("ExperienceWindow::addExpRecord() '%s', lvl %d, exp %d",
- mob_name.ascii(), mob_level, xp_gained);
+ mob_name.toAscii().data(), mob_level, xp_gained);
#endif
if (m_log_exp)
@@ -344,8 +376,8 @@
{
calculateZEM(xp_gained, mob_level);
m_calcZEM = 0;
- m_view_menu->setItemChecked(m_view_menu->idAt(10), false);
- }
+ m_action_calc_zem->setChecked(false);
+ }
s_xp_value.setNum(xp->getExpValue());
QString s_xp_valueZEM;
switch (m_ZEMviewtype) {
@@ -377,21 +409,19 @@
FILE* newlogfp = NULL;
// open the file for append
- newlogfp = fopen(m_newExpLogFile, "a");
+ newlogfp = fopen(m_newExpLogFile.toAscii().data(), "a");
if (newlogfp != NULL)
{
// append a new record entry
- fprintf(newlogfp,
- "0\t%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%d\t%d\t%lu",
- s_time, (const char*)s_mob_name, mob_level,
- (const char*)s_xp_value, (const char*)s_xp_valueZEM,
- (const char*)s_xp_valuep, (const char*)s_xp_valueg,
- (const char*)s_xp_gained,
- (const char*)m_player->name(),
- (const char*)m_player->lastName(),
- m_player->level(),
+ fprintf(newlogfp,
+ "0\t%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%d\t%d\t%lu",
+ s_time, s_mob_name.toAscii().data(), mob_level,
+ s_xp_value.toAscii().data(), s_xp_valueZEM.toAscii().data(),
+ s_xp_valuep.toAscii().data(), s_xp_valueg.toAscii().data(),
+ s_xp_gained.toAscii().data(), m_player->name().toAscii().data(),
+ m_player->lastName().toAscii().data(), m_player->level(),
m_player->classVal(), m_group->groupSize());
const Spawn* spawn;
@@ -564,99 +594,60 @@
}
-void ExperienceWindow::viewAll()
+void ExperienceWindow::viewAll()
{
m_timeframe = 0;
updateAverage();
- m_view_menu->setItemChecked(m_view_menu->idAt(0), true);
- m_view_menu->setItemChecked(m_view_menu->idAt(1), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(2), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(3), false);
-
}
-void ExperienceWindow::view15Minutes()
+void ExperienceWindow::view15Minutes()
{
m_timeframe = 15;
updateAverage();
- m_view_menu->setItemChecked(m_view_menu->idAt(0), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(1), true);
- m_view_menu->setItemChecked(m_view_menu->idAt(2), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(3), false);
-
}
-void ExperienceWindow::view30Minutes()
+void ExperienceWindow::view30Minutes()
{
m_timeframe = 30;
updateAverage();
- m_view_menu->setItemChecked(m_view_menu->idAt(0), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(1), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(2), true);
- m_view_menu->setItemChecked(m_view_menu->idAt(3), false);
-
}
-void ExperienceWindow::view60Minutes()
+void ExperienceWindow::view60Minutes()
{
m_timeframe = 60;
updateAverage();
- m_view_menu->setItemChecked(m_view_menu->idAt(0), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(1), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(2), false);
- m_view_menu->setItemChecked(m_view_menu->idAt(3), true);
-
}
-void ExperienceWindow::viewRatePerHour()
+void ExperienceWindow::viewRatePerHour()
{
m_ratio = 60;
updateAverage();
- m_exp_rate_menu->setItemChecked(m_exp_rate_menu->idAt(0), false);
- m_exp_rate_menu->setItemChecked(m_exp_rate_menu->idAt(1), true);
-
}
-void ExperienceWindow::viewRatePerMinute()
+void ExperienceWindow::viewRatePerMinute()
{
m_ratio = 1;
updateAverage();
- m_exp_rate_menu->setItemChecked(m_exp_rate_menu->idAt(0), true);
- m_exp_rate_menu->setItemChecked(m_exp_rate_menu->idAt(1), false);
-
}
-void ExperienceWindow::calcZEMNextKill()
+void ExperienceWindow::calcZEMNextKill()
{
m_calcZEM = 1;
- m_view_menu->setItemChecked(m_view_menu->idAt(10), true);
}
-void ExperienceWindow::viewZEMcalculated()
+void ExperienceWindow::viewZEMcalculated()
{
m_ZEMviewtype = 0;
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(0), true);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(1), false);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(2), false);
-
}
-void ExperienceWindow::viewZEMraw()
+void ExperienceWindow::viewZEMraw()
{
m_ZEMviewtype = 1;
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(0), false);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(1), true);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(2), false);
-
}
-void ExperienceWindow::viewZEMpercent()
+void ExperienceWindow::viewZEMpercent()
{
m_ZEMviewtype = 2;
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(0), false);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(1), false);
- m_ZEM_menu->setItemChecked(m_ZEM_menu->idAt(2), true);
-
}
void ExperienceWindow::viewClear()
Modified: showeq/branches/pre_6_0_beta/src/experiencelog.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/experiencelog.h 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/experiencelog.h 2020-11-02 01:41:45 UTC (rev 1090)
@@ -150,6 +150,7 @@
int m_timeframe;
int m_ratio;
int m_calcZEM;
+ QAction* m_action_calc_zem;
int m_ZEMviewtype;
int m_log_exp;
FILE* m_log;
Modified: showeq/branches/pre_6_0_beta/src/filter.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filter.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/filter.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -79,7 +79,7 @@
QString regexString = workString;
// find the semi-colon that seperates the regex from the level info
- int breakPoint = workString.find(';');
+ int breakPoint = workString.indexOf(';');
// if no semi-colon, then it's all a regex
if (breakPoint == -1)
@@ -99,7 +99,7 @@
#endif
// see if the level string is a range
- breakPoint = levelString.find('-');
+ breakPoint = levelString.indexOf('-');
bool ok;
int level;
@@ -175,23 +175,23 @@
(const char*)regexString, minLevel, maxLevel);
#endif
- m_regexp.setWildcard(false);
- m_regexp.setCaseSensitive(caseSensitive);
+ m_regexp.setPatternSyntax(QRegExp::RegExp);
+ m_regexp.setCaseSensitivity(caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
// For the pattern, save off the original. This is what will be saved
// during save operations. But the actual regexp we filter with will
// mark the # in spawn names as optional to aid in filter writing.
- m_regexpOriginalPattern = QString(regexString.ascii());
+ m_regexpOriginalPattern = QString(regexString.toAscii().data());
QString fixedFilterPattern = regexString;
- fixedFilterPattern.replace("Name:", "Name:#?", false);
+ fixedFilterPattern.replace("Name:", "Name:#?", Qt::CaseInsensitive);
m_regexp.setPattern(fixedFilterPattern);
if (!m_regexp.isValid())
{
seqWarn("Filter Error: '%s' - %s",
- (const char*)m_regexp.pattern(),
- (const char*)m_regexp.errorString());
+ m_regexp.pattern().toAscii().data(),
+ m_regexp.errorString().toAscii().data());
}
}
@@ -203,8 +203,8 @@
if (!m_regexp.isValid())
{
seqWarn("Filter Error: '%s' - %s",
- (const char*)m_regexp.pattern(),
- (const char*)m_regexp.errorString());
+ m_regexp.pattern().toAscii().data(),
+ m_regexp.errorString().toAscii().data());
}
}
@@ -237,7 +237,7 @@
bool FilterItem::isFiltered(const QString& filterString, uint8_t level) const
{
// check the main filter string
- if (m_regexp.search(filterString) != -1)
+ if (m_regexp.indexIn(filterString) != -1)
{
// is there is a level range component to this filter
if ((m_minLevel > 0) || (m_maxLevel > 0))
@@ -355,7 +355,7 @@
if (re->name() == filterPattern) // if match
{
// remove the filter
- m_filterItems.remove(re);
+ delete m_filterItems.takeAt(m_filterItems.indexOf(re));
#ifdef DEBUG_FILTER
seqDebug("Removed '%s' from List", (const char*)filterPattern);
@@ -455,10 +455,10 @@
break;
if (re->minLevel() || re->maxLevel())
- seqInfo("\t'%s' (%d, %d)",
- (const char*)re->name().utf8(), re->minLevel(), re->maxLevel());
+ seqInfo("\t'%s' (%d, %d)",
+ re->name().toUtf8().data(), re->minLevel(), re->maxLevel());
else
- seqInfo("\t'%s'", (const char*)re->name().utf8());
+ seqInfo("\t'%s'", re->name().toUtf8().data());
}
}
@@ -556,9 +556,9 @@
// create a QTextStream object on the QFile object
QTextStream out(&file);
-
+
// set the output encoding to be UTF8
- out.setEncoding(QTextStream::UnicodeUTF8);
+ out.setCodec("UTF-8");
// set the number output to be left justified decimal
out.setIntegerBase(10);
@@ -604,13 +604,13 @@
FilterMap::const_iterator it;
seqInfo("Filters from file '%s':",
- (const char*)m_file);
+ m_file.toAscii().data());
// iterate over the filters
for (it = m_filters.begin(); it != m_filters.end(); it++)
{
// print the header
- seqInfo("Filter Type '%s':",
- (const char*)m_types.name(it->first));
+ seqInfo("Filter Type '%s':",
+ m_types.name(it->first).toAscii().data());
// list off the actual filters
it->second->listFilters();
Modified: showeq/branches/pre_6_0_beta/src/filteredspawnlog.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filteredspawnlog.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/filteredspawnlog.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -92,12 +92,12 @@
// log the information
outputf("%s %s %s LOC %dy, %dx, %dz at %s (%s)\n",
- (const char*)m_filterMgr->filterString(flag),
- action,
- (const char*)item->name(),
- item->y(), item->x(), item->z(),
- eqDate.isValid() ? (const char*)eqDate.toString() : "",
- (const char*)item->spawnTimeStr());
+ m_filterMgr->filterString(flag).toAscii().data(),
+ action,
+ item->name().toAscii().data(),
+ item->y(), item->x(), item->z(),
+ eqDate.isValid() ? eqDate.toString().toAscii().data() : "",
+ item->spawnTimeStr().toAscii().data());
flush();
}
Modified: showeq/branches/pre_6_0_beta/src/filtermgr.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filtermgr.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/filtermgr.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -44,12 +44,13 @@
//----------------------------------------------------------------------
// FilterMgr
-FilterMgr::FilterMgr(const DataLocationMgr* dataLocMgr,
+FilterMgr::FilterMgr(const DataLocationMgr* dataLocMgr,
const QString filterFile, bool spawnfilter_case)
- : QObject(NULL, "filtermgr"),
+ : QObject(NULL),
m_dataLocMgr(dataLocMgr),
m_caseSensitive(spawnfilter_case)
{
+ setObjectName("filtermgr");
// Initialize filters
// allocate general filter types object
@@ -135,9 +136,9 @@
fileInfo =
m_dataLocMgr->findExistingFile("filters", fileInfo.fileName(), false);
- m_filterFile = fileInfo.absFilePath();
+ m_filterFile = fileInfo.absoluteFilePath();
- seqInfo("Loading Filters from '%s'", (const char*)m_filterFile);
+ seqInfo("Loading Filters from '%s'", m_filterFile.toAscii().data());
m_filters->load(m_filterFile);
@@ -149,9 +150,9 @@
QFileInfo fileInfo =
m_dataLocMgr->findExistingFile("filters", fileName, false);
- m_filterFile = fileInfo.absFilePath();
+ m_filterFile = fileInfo.absoluteFilePath();
- seqInfo("Loading Filters from '%s'", (const char*)m_filterFile);
+ seqInfo("Loading Filters from '%s'", m_filterFile.toAscii().data());
m_filters->load(m_filterFile);
@@ -165,9 +166,9 @@
fileInfo = m_dataLocMgr->findWriteFile("filters", fileInfo.fileName(), true);
- m_filterFile = fileInfo.absFilePath();
+ m_filterFile = fileInfo.absoluteFilePath();
- seqInfo("Saving filters to %s", (const char*)m_filterFile);
+ seqInfo("Saving filters to %s", m_filterFile.toAscii().data());
m_filters->save(m_filterFile);
}
@@ -240,9 +241,9 @@
QFileInfo fileInfo =
m_dataLocMgr->findExistingFile("filters", fileName, false);
- m_zoneFilterFile = fileInfo.absFilePath();
+ m_zoneFilterFile = fileInfo.absoluteFilePath();
- seqInfo("Loading Zone Filter File: %s", (const char*)m_zoneFilterFile);
+ seqInfo("Loading Zone Filter File: %s", m_zoneFilterFile.toAscii().data());
m_zoneFilters->load(m_zoneFilterFile);
@@ -256,9 +257,9 @@
fileInfo = m_dataLocMgr->findExistingFile("filters", fileInfo.fileName(),
false);
- m_zoneFilterFile = fileInfo.absFilePath();
+ m_zoneFilterFile = fileInfo.absoluteFilePath();
- seqInfo("Loading Zone Filter File: %s", (const char*)m_zoneFilterFile);
+ seqInfo("Loading Zone Filter File: %s", m_zoneFilterFile.toAscii().data());
m_zoneFilters->load(m_zoneFilterFile);
@@ -278,9 +279,9 @@
fileInfo = m_dataLocMgr->findWriteFile("filters", fileInfo.fileName(), true);
- m_zoneFilterFile = fileInfo.absFilePath();
+ m_zoneFilterFile = fileInfo.absoluteFilePath();
- seqInfo("Saving filters to %s", (const char*)m_zoneFilterFile);
+ seqInfo("Saving filters to %s", m_zoneFilterFile.toAscii().data());
if (! m_zoneFilters->save(m_zoneFilterFile))
{
Modified: showeq/branches/pre_6_0_beta/src/filternotifications.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filternotifications.cpp 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/filternotifications.cpp 2020-11-02 01:41:45 UTC (rev 1090)
@@ -33,15 +33,17 @@
#include <QApplication>
FilterNotifications::FilterNotifications(QObject* parent, const char* name)
- : QObject(parent, name),
+ : QObject(parent),
m_useSystemBeep(false),
m_useCommands(false)
{
- m_useSystemBeep =
+ setObjectName(name);
+
+ m_useSystemBeep =
pSEQPrefs->getPrefBool("SystemBeep", "Filters", m_useSystemBeep);
- m_useCommands =
- pSEQPrefs->getPrefBool("EnableCommands", "Filters",
- m_useCommands);
+ m_useCommands =
+ pSEQPrefs->getPrefBool("EnableCommands", "Filters",
+ m_useCommands);
}
FilterNotifications::~FilterNotifications()
@@ -137,9 +139,9 @@
// now, replace all occurrances of %c with the audio cue
command.replace(cueExp, audioCue);
-
+
// fire off the command
- system ((const char*)command);
+ system (command.toAscii().data());
}
#ifndef QMAKEBUILD
Modified: showeq/branches/pre_6_0_beta/src/map.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.h 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/map.h 2020-11-02 01:41:45 UTC (rev 1090)
@@ -677,7 +677,7 @@
{
public:
MapFilterLineEdit(QWidget* parent = 0, const char* name = 0)
- : QLineEdit(parent, name) {}
+ : QLineEdit(parent) {}
~MapFilterLineEdit() {} ;
protected:
Modified: showeq/branches/pre_6_0_beta/src/messagefilter.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/messagefilter.h 2020-11-02 01:41:33 UTC (rev 1089)
+++ showeq/branches/pre_6_0_beta/src/messagefilter.h 2020-11-02 01:41:45 UTC (rev 1090)
@@ -82,7 +82,7 @@
const QString& message) const
{
return (((m_types & messageTypeMask) != 0) &&
- (m_regexp.search(message) != -1));
+ (m_regexp.indexIn(message) != -1));
}
inline bool MessageFilter::operator==(const MessageFilter& filter) const
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-11-02 01:41:36
|
Revision: 1089
http://sourceforge.net/p/seq/svn/1089
Author: cn187
Date: 2020-11-02 01:41:33 +0000 (Mon, 02 Nov 2020)
Log Message:
-----------
Replace Q3TextStream with QTextStream
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/cgiconv.cpp
showeq/branches/pre_6_0_beta/src/drawmap.cpp
showeq/branches/pre_6_0_beta/src/editor.cpp
showeq/branches/pre_6_0_beta/src/filter.cpp
showeq/branches/pre_6_0_beta/src/filter.h
showeq/branches/pre_6_0_beta/src/group.cpp
showeq/branches/pre_6_0_beta/src/group.h
showeq/branches/pre_6_0_beta/src/guild.cpp
showeq/branches/pre_6_0_beta/src/guildshell.cpp
showeq/branches/pre_6_0_beta/src/guildshell.h
showeq/branches/pre_6_0_beta/src/interface.cpp
showeq/branches/pre_6_0_beta/src/interface.h
showeq/branches/pre_6_0_beta/src/listitem.cpp
showeq/branches/pre_6_0_beta/src/listspawn.cpp
showeq/branches/pre_6_0_beta/src/logger.h
showeq/branches/pre_6_0_beta/src/map.cpp
showeq/branches/pre_6_0_beta/src/map.h
showeq/branches/pre_6_0_beta/src/mapicon.cpp
showeq/branches/pre_6_0_beta/src/mapicon.h
showeq/branches/pre_6_0_beta/src/messagewindow.cpp
showeq/branches/pre_6_0_beta/src/packetinfo.cpp
showeq/branches/pre_6_0_beta/src/packetinfo.h
showeq/branches/pre_6_0_beta/src/showitem.cpp
showeq/branches/pre_6_0_beta/src/showspawn.cpp
showeq/branches/pre_6_0_beta/src/sortitem.cpp
showeq/branches/pre_6_0_beta/src/spawnlist.h
showeq/branches/pre_6_0_beta/src/spawnmonitor.cpp
showeq/branches/pre_6_0_beta/src/spawnshell.cpp
showeq/branches/pre_6_0_beta/src/spawnshell.h
Modified: showeq/branches/pre_6_0_beta/src/cgiconv.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/cgiconv.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/cgiconv.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -29,7 +29,7 @@
#include <QRegExp>
#include <QFilh>
-#include <Q3TextStream>
+#include <QTextStream>
#include "cgiconv.h"
@@ -56,10 +56,10 @@
char* query_str = new char[content_length + 1];
// open the data stream
- Q3TextStream postStream(stdin, QIODevice::ReadOnly);
+ QTextStream postStream(stdin, QIODevice::ReadOnly);
// set the encoding (required for readRawBytes to work)
- postStream.setEncoding(Q3TextStream::Latin1);
+ postStream.setEncoding(QTextStream::Latin1);
// read the data into the allocated buffer
postStream.readRawBytes(query_str, content_length);
@@ -150,7 +150,7 @@
if (file.open(QIODevice::WriteOnly))
{
// create a QTextStream object on the file
- Q3TextStream textFile(&file);
+ QTextStream textFile(&file);
// get the environment
textFile << "REQUEST_METHOD=" << getenv("REQUEST_METHOD") << endl;
Modified: showeq/branches/pre_6_0_beta/src/drawmap.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/drawmap.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/drawmap.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -30,7 +30,7 @@
#include <QString>
#include <QDir>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QRegExp>
#include "cgiconv.h"
@@ -589,9 +589,9 @@
else
{
// open the output data stream
- Q3TextStream out(stdout, QIODevice::WriteOnly);
- out.setEncoding(Q3TextStream::Latin1);
- out.flags(Q3TextStream::showbase | Q3TextStream::dec);
+ QTextStream out(stdout, QIODevice::WriteOnly);
+ out.setEncoding(QTextStream::Latin1);
+ out.flags(QTextStream::showbase | QTextStream::dec);
const char* header =
"Content-type: text/html; charset=iso-8859-1\n\n"
Modified: showeq/branches/pre_6_0_beta/src/editor.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/editor.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/editor.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -35,7 +35,7 @@
#include <QMainWindow>
#include <QFileDialog>
#include <QToolButton>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QPaintDevice>
#include <QObject>
#include <QTextEdit>
@@ -147,8 +147,8 @@
e->clear();
- Q3TextStream t(&f);
- while ( !t.eof() ) {
+ QTextStream t(&f);
+ while ( !t.atEnd() ) {
QString s = t.readLine();
e->append( s );
}
@@ -177,7 +177,7 @@
return;
}
- Q3TextStream t( &f );
+ QTextStream t( &f );
t << text;
f.close();
Modified: showeq/branches/pre_6_0_beta/src/filter.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/filter.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/filter.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -32,7 +32,7 @@
#include <climits>
#include <QFile>
-#include <Q3TextStream>
+#include <QTextStream>
#define MAXLEN 5000
@@ -212,7 +212,7 @@
{
}
-bool FilterItem::save(QString& indent, Q3TextStream& out)
+bool FilterItem::save(QString& indent, QTextStream& out)
{
out << indent << "<oldfilter>";
@@ -308,7 +308,7 @@
//
// parses the filter file and builds filter list
//
-bool Filter::save(QString& indent, Q3TextStream& out)
+bool Filter::save(QString& indent, QTextStream& out)
{
FilterItem *re;
@@ -555,13 +555,14 @@
return false;
// create a QTextStream object on the QFile object
- Q3TextStream out(&file);
+ QTextStream out(&file);
// set the output encoding to be UTF8
- out.setEncoding(Q3TextStream::UnicodeUTF8);
+ out.setEncoding(QTextStream::UnicodeUTF8);
// set the number output to be left justified decimal
- out.setf(Q3TextStream::dec | Q3TextStream::left);
+ out.setIntegerBase(10);
+ out.setFieldAlignment(QTextStream::AlignLeft);
// print document header
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl
Modified: showeq/branches/pre_6_0_beta/src/filter.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/filter.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/filter.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -35,7 +35,7 @@
#include <QList>
#include <QRegExp>
#include <QXmlAttributes>
-#include <Q3TextStream>
+#include <QTextStream>
#include <map>
@@ -62,7 +62,7 @@
FilterItem(const QString& filterPattern, bool caseSensitive,
uint8_t minLevel, uint8_t maxLevel);
~FilterItem(void);
- bool save(QString& indent, Q3TextStream& out);
+ bool save(QString& indent, QTextStream& out);
bool isFiltered(const QString& filterString, uint8_t level) const;
@@ -91,7 +91,7 @@
Filter(bool caseSensitive = 0);
~Filter();
- bool save(QString& indent, Q3TextStream& out);
+ bool save(QString& indent, QTextStream& out);
bool isFiltered(const QString& filterString, uint8_t level);
bool addFilter(const QString& filterPattern);
bool addFilter(const QString& filterPattern, uint8_t minLevel, uint8_t maxLevel);
Modified: showeq/branches/pre_6_0_beta/src/group.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/group.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/group.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -28,7 +28,7 @@
#include "diagnosticmessages.h"
#include "netstream.h"
-#include <Q3TextStream>
+#include <QTextStream>
GroupMgr::GroupMgr(SpawnShell* spawnShell,
Player* player,
@@ -322,7 +322,7 @@
}
}
-void GroupMgr::dumpInfo(Q3TextStream& out)
+void GroupMgr::dumpInfo(QTextStream& out)
{
// dump general group manager information
out << "[GroupMgr]" << endl;
Modified: showeq/branches/pre_6_0_beta/src/group.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/group.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/group.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -27,7 +27,7 @@
#include <QObject>
#include <QString>
-#include <Q3TextStream>
+#include <QTextStream>
#include "everquest.h"
@@ -69,7 +69,7 @@
void killSpawn(const Item* item);
// dump debug info
- void dumpInfo(Q3TextStream& out);
+ void dumpInfo(QTextStream& out);
signals:
void added(const QString& name, const Spawn* mem);
Modified: showeq/branches/pre_6_0_beta/src/guild.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/guild.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/guild.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -32,7 +32,7 @@
#include <QFile>
#include <QDataStream>
-#include <Q3TextStream>
+#include <QTextStream>
GuildMgr::GuildMgr(QString fn, QObject* parent, const char* name)
: QObject(parent, name)
@@ -157,7 +157,7 @@
void GuildMgr::guildList2text(QString fn)
{
QFile guildsfile(fn);
- Q3TextStream guildtext(&guildsfile);
+ QTextStream guildtext(&guildsfile);
if (guildsfile.exists()) {
if (!guildsfile.remove()) {
Modified: showeq/branches/pre_6_0_beta/src/guildshell.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/guildshell.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/guildshell.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -29,7 +29,7 @@
#include "diagnosticmessages.h"
#include <QDateTime>
-#include <Q3TextStream>
+#include <QTextStream>
//----------------------------------------------------------------------
// diagnostic defines
@@ -195,7 +195,7 @@
return m_zoneMgr->zoneNameFromID(zoneid);
}
-void GuildShell::dumpMembers(Q3TextStream& out)
+void GuildShell::dumpMembers(QTextStream& out)
{
QDateTime dt;
GuildMemberDictIterator it(m_members);
Modified: showeq/branches/pre_6_0_beta/src/guildshell.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/guildshell.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/guildshell.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -30,11 +30,11 @@
#include <QString>
#include <QObject>
#include <QHash>
-#include <Q3TextStream>
+#include <QTextStream>
//----------------------------------------------------------------------
// forward declarations
-class Q3TextStream;
+class QTextStream;
class NetStream;
class ZoneMgr;
@@ -102,7 +102,7 @@
const GuildMemberDict& members() { return m_members; }
size_t maxNameLength() { return m_maxNameLength; }
- void dumpMembers(Q3TextStream& out);
+ void dumpMembers(QTextStream& out);
QString zoneString(uint16_t zoneid) const;
Modified: showeq/branches/pre_6_0_beta/src/interface.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/interface.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -84,7 +84,7 @@
#include <QShortcut>
#include <QFileInfo>
#include <QFile>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QInputDialog>
#include <QFontDialog>
#include <QColorDialog>
@@ -3444,7 +3444,7 @@
QString outText;
// open the output data stream
- Q3TextStream out(&outText, QIODevice::WriteOnly);
+ QTextStream out(&outText, QIODevice::WriteOnly);
// dump the spawns
m_spawnShell->dumpSpawns(tSpawn, out);
@@ -3460,7 +3460,7 @@
QString outText;
// open the output data stream
- Q3TextStream out(&outText, QIODevice::WriteOnly);
+ QTextStream out(&outText, QIODevice::WriteOnly);
// dump the drops
m_spawnShell->dumpSpawns(tDrop, out);
@@ -3476,7 +3476,7 @@
QString outText;
// open the output data stream
- Q3TextStream out(&outText, QIODevice::WriteOnly);
+ QTextStream out(&outText, QIODevice::WriteOnly);
// dump map managers info
m_mapMgr->dumpInfo(out);
@@ -3520,7 +3520,7 @@
QString outText;
// open the output data stream
- Q3TextStream out(&outText, QIODevice::WriteOnly);
+ QTextStream out(&outText, QIODevice::WriteOnly);
// dump the drops
m_groupMgr->dumpInfo(out);
@@ -3537,7 +3537,7 @@
QString outText;
// open the output data stream
- Q3TextStream out(&outText, QIODevice::WriteOnly);
+ QTextStream out(&outText, QIODevice::WriteOnly);
// dump the drops
m_guildShell->dumpMembers(out);
@@ -3559,7 +3559,7 @@
// open the output data stream
QFile file(logFileInfo.absFilePath());
file.open(QIODevice::WriteOnly);
- Q3TextStream out(&file);
+ QTextStream out(&file);
// dump the spawns
m_spawnShell->dumpSpawns(tSpawn, out);
@@ -3579,7 +3579,7 @@
// open the output data stream
QFile file(logFileInfo.absFilePath());
file.open(QIODevice::WriteOnly);
- Q3TextStream out(&file);
+ QTextStream out(&file);
// dump the drops
m_spawnShell->dumpSpawns(tDrop, out);
@@ -3600,7 +3600,7 @@
// open the output data stream
QFile file(logFileInfo.absFilePath());
file.open(QIODevice::WriteOnly);
- Q3TextStream out(&file);
+ QTextStream out(&file);
// dump map managers info
m_mapMgr->dumpInfo(out);
@@ -3640,7 +3640,7 @@
// open the output data stream
QFile file(logFileInfo.absFilePath());
file.open(QIODevice::WriteOnly);
- Q3TextStream out(&file);
+ QTextStream out(&file);
QString txt;
seqInfo("Dumping Spell Book to '%s'\n",
@@ -3696,7 +3696,7 @@
// open the output data stream
QFile file(logFileInfo.absFilePath());
file.open(QIODevice::WriteOnly);
- Q3TextStream out(&file);
+ QTextStream out(&file);
// dump the drops
m_groupMgr->dumpInfo(out);
@@ -3716,7 +3716,7 @@
// open the output data stream
QFile file(logFileInfo.absFilePath());
file.open(QIODevice::WriteOnly);
- Q3TextStream out(&file);
+ QTextStream out(&file);
// dump the drops
m_guildShell->dumpMembers(out);
@@ -4964,7 +4964,7 @@
QFile mobPathFile(fileInfo.absFilePath());
if (mobPathFile.open(QIODevice::Append | QIODevice::WriteOnly))
{
- Q3TextStream out(&mobPathFile);
+ QTextStream out(&mobPathFile);
// append the selected spawns path to the end
saveSpawnPath(out, m_selectedSpawn);
@@ -4984,7 +4984,7 @@
QFile mobPathFile(fileInfo.absFilePath());
if (mobPathFile.open(QIODevice::Truncate | QIODevice::WriteOnly))
{
- Q3TextStream out(&mobPathFile);
+ QTextStream out(&mobPathFile);
// map header line
out << m_zoneMgr->longZoneName() << ","
<< m_zoneMgr->shortZoneName() << ",0,0" << endl;
@@ -5009,7 +5009,7 @@
}
}
-void EQInterface::saveSpawnPath(Q3TextStream& out, const Item* item)
+void EQInterface::saveSpawnPath(QTextStream& out, const Item* item)
{
if (item == 0)
return;
Modified: showeq/branches/pre_6_0_beta/src/interface.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/interface.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -37,7 +37,7 @@
#include <QMessageBox>
#include <QSpinBox>
#include <QHash>
-#include <Q3TextStream>
+#include <QTextStream>
#include "everquest.h"
#include "spawnlist.h"
#include "spawnshell.h"
@@ -179,7 +179,7 @@
void selectPrev(void);
void saveSelectedSpawnPath(void);
void saveSpawnPaths(void);
- void saveSpawnPath(Q3TextStream& out, const Item* item);
+ void saveSpawnPath(QTextStream& out, const Item* item);
void toggle_log_AllPackets();
void toggle_log_WorldData();
void toggle_log_ZoneData();
Modified: showeq/branches/pre_6_0_beta/src/listitem.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/listitem.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/listitem.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -28,7 +28,7 @@
#include <cstring>
#include <QString>
-#include <Q3TextStream>
+#include <QTextStream>
#include "cgiconv.h"
#include "util.h"
@@ -36,7 +36,7 @@
#include "qmap.h"
// forward declaration
-void displayForm(Q3TextStream& out,
+void displayForm(QTextStream& out,
CGI& cgiconv,
bool displayIcon);
@@ -110,9 +110,9 @@
}
// open the output data stream
- Q3TextStream out(stdout, QIODevice::WriteOnly);
- out.setEncoding(Q3TextStream::Latin1);
- out.flags(Q3TextStream::showbase | Q3TextStream::dec);
+ QTextStream out(stdout, QIODevice::WriteOnly);
+ out.setEncoding(QTextStream::Latin1);
+ out.flags(QTextStream::showbase | QTextStream::dec);
const char* header =
"Content-type: text/html; charset=iso-8859-1\n\n"
@@ -511,7 +511,7 @@
out << "</HTML>";
}
-void displaySelectOption(Q3TextStream& out,
+void displaySelectOption(QTextStream& out,
const QString& value,
const QString& name,
const QString currentChk)
@@ -522,7 +522,7 @@
out << ">" << name << "</OPTION>\n";
}
-void displayForm(Q3TextStream& out,
+void displayForm(QTextStream& out,
CGI& cgiconv,
bool displayIcon)
{
Modified: showeq/branches/pre_6_0_beta/src/listspawn.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/listspawn.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/listspawn.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -26,7 +26,7 @@
#include <cerrno>
#include <QString>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QRegExp>
#include "cgiconv.h"
@@ -80,9 +80,9 @@
}
// open the output data stream
- Q3TextStream out(stdout, QIODevice::WriteOnly);
- out.setEncoding(Q3TextStream::Latin1);
- out.flags(Q3TextStream::showbase | Q3TextStream::dec);
+ QTextStream out(stdout, QIODevice::WriteOnly);
+ out.setEncoding(QTextStream::Latin1);
+ out.flags(QTextStream::showbase | QTextStream::dec);
const char* header =
"Content-type: text/html; charset=iso-8859-1\n\n"
Modified: showeq/branches/pre_6_0_beta/src/logger.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/logger.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/logger.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -25,7 +25,7 @@
#include <QObject>
#include <QFile>
-#include <Q3TextStream>
+#include <QTextStream>
#ifdef __FreeBSD__
// since they are incapable of following standards
@@ -52,7 +52,7 @@
protected:
FILE* m_fp;
QFile m_file;
- Q3TextStream m_out;
+ QTextStream m_out;
QString m_filename;
bool m_errOpen;
};
Modified: showeq/branches/pre_6_0_beta/src/map.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/map.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -79,7 +79,7 @@
#include <QResizeEvent>
#include <QLabel>
#include <QHBoxLayout>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QMouseEvent>
//----------------------------------------------------------------------
@@ -695,7 +695,7 @@
#endif
}
-void MapMgr::dumpInfo(Q3TextStream& out)
+void MapMgr::dumpInfo(QTextStream& out)
{
out << "[MapMgr]" << endl;
out << "DefaultLineColor: " << m_curLineColor << endl;
@@ -2884,7 +2884,7 @@
refreshMap ();
}
-void Map::dumpInfo(Q3TextStream& out)
+void Map::dumpInfo(QTextStream& out)
{
out << "[" << preferenceName() << "]" << endl;
out << "Caption: " << caption() << endl;
@@ -5031,7 +5031,7 @@
m_map->savePrefs();
}
-void MapFrame::dumpInfo(Q3TextStream& out)
+void MapFrame::dumpInfo(QTextStream& out)
{
// first dump information about the map frame
out << "[" << preferenceName() << "]" << endl;
Modified: showeq/branches/pre_6_0_beta/src/map.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/map.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -40,7 +40,7 @@
#include <QToolTip>
#include <QRegExp>
#include <QHash>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QDateTime>
#include <QPen>
#include <QBrush>
@@ -200,7 +200,7 @@
void savePrefs(void);
// dump debug info
- void dumpInfo(Q3TextStream& out);
+ void dumpInfo(QTextStream& out);
signals:
void mapLoaded(void);
@@ -551,7 +551,7 @@
void setShowInstanceLocationMarker(bool val);
// dump debug info
- void dumpInfo(Q3TextStream& out);
+ void dumpInfo(QTextStream& out);
void showMapIconDialog();
@@ -718,7 +718,7 @@
virtual void savePrefs(void);
// dump debug info
- void dumpInfo(Q3TextStream& out);
+ void dumpInfo(QTextStream& out);
protected slots:
void init_Menu(void);
Modified: showeq/branches/pre_6_0_beta/src/mapicon.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapicon.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/mapicon.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -31,7 +31,7 @@
#include <QPainter>
#include <QPoint>
#include <QTimer>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QPolygon>
//----------------------------------------------------------------------
@@ -819,7 +819,7 @@
m_mapIcons[k].save(iconTypePrefBaseNames[k], preferenceName());
}
-void MapIcons::dumpInfo(Q3TextStream& out)
+void MapIcons::dumpInfo(QTextStream& out)
{
out << "[" << preferenceName() << " MapIcons]" << endl;
out << "ShowSpawnNames: " << m_showSpawnNames << endl;
Modified: showeq/branches/pre_6_0_beta/src/mapicon.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapicon.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/mapicon.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -41,7 +41,7 @@
#include <QPen>
#include <QBrush>
#include <QString>
-#include <Q3TextStream>
+#include <QTextStream>
//----------------------------------------------------------------------
// forward declarations
@@ -317,7 +317,7 @@
void setIcon(int iconType, const MapIcon& icon);
// dump debug info
- void dumpInfo(Q3TextStream& out);
+ void dumpInfo(QTextStream& out);
// painting slots
void paintIcon(MapParameters& param,
Modified: showeq/branches/pre_6_0_beta/src/messagewindow.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/messagewindow.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/messagewindow.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -39,7 +39,7 @@
#include <QGroupBox>
#include <QFileDialog>
#include <QFile>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QHBoxLayout>
#include <QKeyEvent>
#include <QGridLayout>
@@ -864,7 +864,7 @@
QFile file( fileName ); // Write the text to a file
if ( file.open( QIODevice::WriteOnly ) )
{
- Q3TextStream stream( &file );
+ QTextStream stream( &file );
stream << m_messageWindow->toPlainText() << endl;
}
Modified: showeq/branches/pre_6_0_beta/src/packetinfo.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -28,7 +28,7 @@
#include <QMetaObject>
#include <QFile>
#include <QXmlAttributes>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QByteArray>
#include <map>
@@ -318,13 +318,13 @@
return false;
// create a QTextStream object on the QFile object
- Q3TextStream out(&file);
+ QTextStream out(&file);
// set the output encoding to be UTF8
- out.setEncoding(Q3TextStream::UnicodeUTF8);
+ out.setEncoding(QTextStream::UnicodeUTF8);
// set the number output to be left justified decimal
- out.setf(Q3TextStream::dec | Q3TextStream::left);
+ out.setf(QTextStream::dec | QTextStream::left);
// print document header
out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl
Modified: showeq/branches/pre_6_0_beta/src/packetinfo.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetinfo.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/packetinfo.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -33,7 +33,7 @@
#include <QByteArray>
#include <QString>
#include <QStringList>
-#include <Q3TextStream>
+#include <QTextStream>
//----------------------------------------------------------------------
// forward declarations
Modified: showeq/branches/pre_6_0_beta/src/showitem.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/showitem.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/showitem.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -28,7 +28,7 @@
#include <cstdio>
#include <cstring>
-#include <Q3TextStream>
+#include <QTextStream>
#include "cgiconv.h"
#include "util.h"
@@ -35,12 +35,12 @@
#include "itemdb.h"
// forward declarations
-void printdata (Q3TextStream& out, int len, char *data);
+void printdata (QTextStream& out, int len, char *data);
int main (int argc, char *argv[])
{
// open the output data stream
- Q3TextStream out(stdout, QIODevice::WriteOnly);
+ QTextStream out(stdout, QIODevice::WriteOnly);
const char* header =
"Content-type: text/html; charset=iso-8859-1\n\n"
@@ -404,7 +404,7 @@
return 0;
}
-void printdata (Q3TextStream& out, int len, char *data)
+void printdata (QTextStream& out, int len, char *data)
{
char asc[1024];
uint8_t fieldCount = 1;
Modified: showeq/branches/pre_6_0_beta/src/showspawn.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/showspawn.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/showspawn.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -27,7 +27,7 @@
#include <QString>
#include <QRegExp>
-#include <Q3TextStream>
+#include <QTextStream>
#include "cgiconv.h"
#include "spawn.h"
@@ -34,7 +34,7 @@
#include "util.h"
// forward declarations
-void printdata (Q3TextStream& out, int len, unsigned char *data);
+void printdata (QTextStream& out, int len, unsigned char *data);
int main (int argc, char *argv[])
{
@@ -82,9 +82,9 @@
}
// open the output data stream
- Q3TextStream out(stdout, QIODevice::WriteOnly);
- out.setEncoding(Q3TextStream::Latin1);
- out.flags(Q3TextStream::showbase | Q3TextStream::dec);
+ QTextStream out(stdout, QIODevice::WriteOnly);
+ out.setEncoding(QTextStream::Latin1);
+ out.flags(QTextStream::showbase | QTextStream::dec);
const char* header =
"Content-type: text/html; charset=iso-8859-1\n\n"
@@ -275,7 +275,7 @@
out << footer;
}
-void printdata (Q3TextStream& out, int len, unsigned char *data)
+void printdata (QTextStream& out, int len, unsigned char *data)
{
char hex[128];
char asc[128];
Modified: showeq/branches/pre_6_0_beta/src/sortitem.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/sortitem.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/sortitem.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -23,7 +23,7 @@
#include <cstdlib>
#include <cstdio>
-#include <Q3TextStream>
+#include <QTextStream>
#include "util.h"
@@ -33,7 +33,7 @@
int main (int, char *[])
{
// open the data stream
- Q3TextStream out(stdout, QIODevice::WriteOnly);
+ QTextStream out(stdout, QIODevice::WriteOnly);
// format that the text will be output to.
QString format = "%1:%2:%3\n";
Modified: showeq/branches/pre_6_0_beta/src/spawnlist.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/spawnlist.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -46,7 +46,7 @@
#include <Q3ListView>
#include <QHash>
-#include <Q3TextStream>
+#include <QTextStream>
#include <QMenu>
// these are all used for the CFilterDlg
Modified: showeq/branches/pre_6_0_beta/src/spawnmonitor.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnmonitor.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/spawnmonitor.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -31,7 +31,7 @@
#include <QDir>
#include <QFile>
#include <QFileInfo>
-#include <Q3TextStream>
+#include <QTextStream>
SpawnPoint::SpawnPoint(uint16_t spawnID,
@@ -303,7 +303,7 @@
return;
}
- Q3TextStream output(&spFile);
+ QTextStream output(&spFile);
QHashIterator<QString, SpawnPoint*> it( m_points );
SpawnPoint* sp;
@@ -380,7 +380,7 @@
return;
}
- Q3TextStream input( &spFile );
+ QTextStream input( &spFile );
int16_t x, y, z;
unsigned long diffTime;
Modified: showeq/branches/pre_6_0_beta/src/spawnshell.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnshell.cpp 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/spawnshell.cpp 2020-11-02 01:41:33 UTC (rev 1089)
@@ -39,7 +39,7 @@
#include <QFile>
#include <QDataStream>
-#include <Q3TextStream>
+#include <QTextStream>
#ifdef __FreeBSD__
#include <sys/types.h>
@@ -335,7 +335,7 @@
return false;
}
-void SpawnShell::dumpSpawns(spawnItemType type, Q3TextStream& out)
+void SpawnShell::dumpSpawns(spawnItemType type, QTextStream& out)
{
ItemIterator it(getMap(type));
Modified: showeq/branches/pre_6_0_beta/src/spawnshell.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnshell.h 2020-10-29 13:30:18 UTC (rev 1088)
+++ showeq/branches/pre_6_0_beta/src/spawnshell.h 2020-11-02 01:41:33 UTC (rev 1089)
@@ -44,7 +44,7 @@
#include <QHash>
#include <QTimer>
-#include <Q3TextStream>
+#include <QTextStream>
#include "everquest.h"
#include "spawn.h"
@@ -94,7 +94,7 @@
double& minDistance);
Spawn* findSpawnByName(const QString& name);
- void dumpSpawns(spawnItemType type, Q3TextStream& out);
+ void dumpSpawns(spawnItemType type, QTextStream& out);
FilterMgr* filterMgr(void) { return &m_filterMgr; }
const ItemMap& getConstMap(spawnItemType type) const;
const ItemMap& spawns(void) const;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-10-29 13:30:21
|
Revision: 1088
http://sourceforge.net/p/seq/svn/1088
Author: cn187
Date: 2020-10-29 13:30:18 +0000 (Thu, 29 Oct 2020)
Log Message:
-----------
Fix spawnlist2 category selection
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
Modified: showeq/branches/pre_6_0_beta/src/spawnlist2.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-10-28 14:23:07 UTC (rev 1087)
+++ showeq/branches/pre_6_0_beta/src/spawnlist2.cpp 2020-10-29 13:30:18 UTC (rev 1088)
@@ -729,17 +729,14 @@
void SpawnListWindow2::categorySelected(int index)
{
- CategoryListIterator it(m_categoryMgr->getCategories());
+ const CategoryList categories = m_categoryMgr->getCategories();
Category* cat = nullptr;
- int i = 0;
- while (it.hasNext() && (i < index))
- {
- cat = it.next();
- if (!cat)
- break;
- ++i;
- }
+ if (index >= categories.count()) return;
+
+ cat = categories.at(index);
+ if (!cat) return;
+
// set the current category
m_currentCategory = cat;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-10-28 14:23:10
|
Revision: 1087
http://sourceforge.net/p/seq/svn/1087
Author: cn187
Date: 2020-10-28 14:23:07 +0000 (Wed, 28 Oct 2020)
Log Message:
-----------
Replace Q3PopupMenu with QMenu
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/messagewindow.cpp
showeq/branches/pre_6_0_beta/src/messagewindow.h
showeq/branches/pre_6_0_beta/src/spelllist.h
Modified: showeq/branches/pre_6_0_beta/src/messagewindow.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/messagewindow.cpp 2020-10-28 14:22:59 UTC (rev 1086)
+++ showeq/branches/pre_6_0_beta/src/messagewindow.cpp 2020-10-28 14:23:07 UTC (rev 1087)
@@ -26,7 +26,7 @@
#include "messages.h"
#include "main.h"
-#include <Q3PopupMenu>
+#include <QMenu>
#include <QInputDialog>
#include <QFontDialog>
#include <QColorDialog>
@@ -524,18 +524,20 @@
this, SLOT(toggleLockedText()));
m_menu = new QMenu;
- QMenu* typeStyleMenu = new Q3PopupMenu;
+ QMenu* typeStyleMenu = new QMenu("Type St&yles");
- m_typeFilterMenu = new QMenu;
- m_menu->insertItem("Message &Type Filter - Show", m_typeFilterMenu);
+ m_typeFilterMenu = new QMenu("Message &Type Filter - Show");
+ m_menu->addMenu(m_typeFilterMenu);
- m_typeFilterMenu->insertItem("&Enable All",
- this, SLOT(enableAllTypeFilters()), 0, 64);
- m_typeFilterMenu->insertItem("&Disable All",
- this, SLOT(disableAllTypeFilters()), 0, 65);
-
- m_typeFilterMenu->insertSeparator(-1);
+ QAction* tmpAction;
+ tmpAction = m_typeFilterMenu->addAction("&Enable All", this, SLOT(enableAllTypeFilters()));
+ tmpAction->setData(-1);
+ tmpAction = m_typeFilterMenu->addAction("&Disable All", this, SLOT(disableAllTypeFilters()));
+ tmpAction->setData(-1);
+
+ m_typeFilterMenu->addSeparator();
+
QString typeName;
// iterate over the message types, filling in various menus and getting
// font color preferences
@@ -544,37 +546,46 @@
typeName = MessageEntry::messageTypeString((MessageType)i);
if (!typeName.isEmpty())
{
- m_typeFilterMenu->insertItem(typeName, i);
- m_typeFilterMenu->setItemChecked(i, (((uint64_t(1) << i) & m_enabledTypes) != 0));
- typeStyleMenu->insertItem(typeName + "...", i);
+ tmpAction = m_typeFilterMenu->addAction(typeName);
+ tmpAction->setData(i);
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(((uint64_t(1) << i) & m_enabledTypes) != 0);
+ tmpAction = typeStyleMenu->addAction(typeName + "...");
+ tmpAction->setData(i);
+
m_typeStyles[i].load(preferenceName(), typeName);
}
}
-
- connect(m_typeFilterMenu, SIGNAL(activated(int)),
- this, SLOT(toggleTypeFilter(int)));
- connect(typeStyleMenu, SIGNAL(activated(int)),
- this, SLOT(setTypeStyle(int)));
- m_showUserFilterMenu = new QMenu;
- m_menu->insertItem("User Message Filter - &Show", m_showUserFilterMenu);
+ connect(m_typeFilterMenu, SIGNAL(triggered(QAction*)),
+ this, SLOT(toggleTypeFilter(QAction*)));
+ connect(typeStyleMenu, SIGNAL(triggered(QAction*)),
+ this, SLOT(setTypeStyle(QAction*)));
- m_showUserFilterMenu->insertItem("&Enable All",
- this, SLOT(enableAllShowUserFilters()), 0, 66);
- m_showUserFilterMenu->insertItem("&Disable All",
- this, SLOT(disableAllShowUserFilters()), 0, 67);
- m_showUserFilterMenu->insertSeparator(-1);
+ m_showUserFilterMenu = new QMenu("User Message Filter - &Show");
+ m_menu->addMenu(m_showUserFilterMenu);
- m_hideUserFilterMenu = new QMenu;
- m_menu->insertItem("User Message Filter - &Hide", m_hideUserFilterMenu);
+ tmpAction = m_showUserFilterMenu->addAction("&Enable All", this,
+ SLOT(enableAllShowUserFilters()));
+ tmpAction->setData(-1);
+ tmpAction = m_showUserFilterMenu->addAction("&Disable All", this,
+ SLOT(disableAllShowUserFilters()));
+ tmpAction->setData(-1);
+ m_showUserFilterMenu->addSeparator();
- m_hideUserFilterMenu->insertItem("&Enable All",
- this, SLOT(enableAllHideUserFilters()), 0, 66);
- m_hideUserFilterMenu->insertItem("&Disable All",
- this, SLOT(disableAllHideUserFilters()), 0, 67);
- m_hideUserFilterMenu->insertSeparator(-1);
+ m_hideUserFilterMenu = new QMenu("User Message Filter - &Hide");
+ m_menu->addMenu(m_hideUserFilterMenu);
+
+ tmpAction = m_hideUserFilterMenu->addAction("&Enable All", this,
+ SLOT(enableAllHideUserFilters()));
+ tmpAction->setData(-1);
+ tmpAction = m_hideUserFilterMenu->addAction("&Disable All", this,
+ SLOT(disableAllHideUserFilters()));
+ tmpAction->setData(-1);
+ m_hideUserFilterMenu->addSeparator();
+
const MessageFilter* filter;
for(int i = 0; i < maxMessageFilters; i++)
{
@@ -581,54 +592,71 @@
filter = m_messageFilters->filter(i);
if (filter)
{
- m_showUserFilterMenu->insertItem(filter->name(), i);
- m_showUserFilterMenu->setItemChecked(i, (1 << i) & m_enabledShowUserFilters);
+ tmpAction = m_showUserFilterMenu->addAction(filter->name());
+ tmpAction->setData(i);
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked((1 << i) & m_enabledShowUserFilters);
- m_hideUserFilterMenu->insertItem(filter->name(), i);
- m_hideUserFilterMenu->setItemChecked(i, (1 << i) & m_enabledHideUserFilters);
+ tmpAction = m_hideUserFilterMenu->addAction(filter->name());
+ tmpAction->setData(i);
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked((1 << i) & m_enabledHideUserFilters);
}
}
- connect(m_showUserFilterMenu, SIGNAL(activated(int)),
- this, SLOT(toggleShowUserFilter(int)));
- connect(m_hideUserFilterMenu, SIGNAL(activated(int)),
- this, SLOT(toggleHideUserFilter(int)));
- m_menu->insertItem("Edit User &Message Filters...",
- this, SLOT(messageFilterDialog()));
+ connect(m_showUserFilterMenu, SIGNAL(triggered(QAction*)),
+ this, SLOT(toggleShowUserFilter(QAction*)));
+ connect(m_hideUserFilterMenu, SIGNAL(triggered(QAction*)),
+ this, SLOT(toggleHideUserFilter(QAction*)));
- m_menu->insertSeparator(-1);
- m_menu->insertItem("&Find...", this, SLOT(findDialog()),
- Qt::CTRL+Qt::Key_F);
- m_menu->insertSeparator(-1);
- m_id_lockText = m_menu->insertItem("&Lock Text", this,
- SLOT(toggleLockedText()), Qt::CTRL+Qt::Key_L);
- int x;
- x = m_menu->insertItem("Refresh Messages...", this, SLOT(refreshMessages()),
- Qt::CTRL+Qt::Key_R);
- m_menu->insertItem("Save Message Text...", this, SLOT(saveText()),
- Qt::CTRL+Qt::Key_S);
- m_menu->insertSeparator(-1);
- m_menu->setItemChecked(x, m_lockedText);
- m_menu->insertSeparator(-1);
- x = m_menu->insertItem("&Display Type", this, SLOT(toggleDisplayType(int)));
- m_menu->setItemChecked(x, m_displayType);
- x = m_menu->insertItem("Display T&ime/Date", this,
- SLOT(toggleDisplayTime(int)));
- m_menu->setItemChecked(x, m_displayDateTime);
- x = m_menu->insertItem("Display &EQ Date/Time", this,
- SLOT(toggleEQDisplayTime(int)));
- m_menu->setItemChecked(x, m_displayEQDateTime);
- x = m_menu->insertItem("&Use Type Styles", this,
- SLOT(toggleUseTypeStyles(int)));
- m_menu->setItemChecked(x, m_useTypeStyles);
- x = m_menu->insertItem("&Wrap Text", this, SLOT(toggleWrapText(int)));
- m_menu->setItemChecked(x, m_wrapText);
- m_menu->insertItem("Fo&nt...", this, SLOT(setFont()));
- m_menu->insertItem("&Caption...", this, SLOT(setCaption()));
- m_menu->insertItem("Text Colo&r...", this, SLOT(setColor()));
- m_menu->insertItem("Text Back&ground Color...", this, SLOT(setBGColor()));
- m_menu->insertItem("Type St&yles", typeStyleMenu);
+ m_menu->addAction("Edit User &Message Filters...", this,
+ SLOT(messageFilterDialog()));
+ m_menu->addSeparator();
+ m_menu->addAction("&Find...", this, SLOT(findDialog()), Qt::CTRL+Qt::Key_F);
+ m_menu->addSeparator();
+
+ m_action_lockText = m_menu->addAction("&Lock Text", this,
+ SLOT(toggleLockedText()), Qt::CTRL+Qt::Key_L);
+ m_action_lockText->setCheckable(true);
+ m_action_lockText->setChecked(m_lockedText);
+ m_menu->addAction("Refresh Messages...", this,
+ SLOT(refreshMessages()), Qt::CTRL+Qt::Key_R);
+ m_menu->addAction("Save Message Text...", this, SLOT(saveText()),
+ Qt::CTRL+Qt::Key_S);
+ m_menu->addSeparator();
+
+ tmpAction = m_menu->addAction("&Display Type", this,
+ SLOT(toggleDisplayType(bool)));
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(m_displayType);
+
+ tmpAction = m_menu->addAction("Display T&ime/Date", this,
+ SLOT(toggleDisplayTime(bool)));
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(m_displayDateTime);
+
+ tmpAction = m_menu->addAction("Display &EQ Date/Time", this,
+ SLOT(toggleEQDisplayTime(bool)));
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(m_displayEQDateTime);
+
+ tmpAction = m_menu->addAction("&Use Type Styles", this,
+ SLOT(toggleUseTypeStyles(bool)));
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(m_useTypeStyles);
+
+ tmpAction = m_menu->addAction("&Wrap Text", this, SLOT(toggleWrapText(bool)));
+ tmpAction->setCheckable(true);
+ tmpAction->setChecked(m_wrapText);
+
+ m_menu->addAction("Fo&nt...", this, SLOT(setFont()));
+ m_menu->addAction("&Caption...", this, SLOT(setCaption()));
+ m_menu->addAction("Text Colo&r...", this, SLOT(setColor()));
+ m_menu->addAction("Text Back&ground Color...", this, SLOT(setBGColor()));
+
+ m_menu->addMenu(typeStyleMenu);
+
refreshMessages();
}
@@ -769,7 +797,7 @@
m_messageWindow->append(" ");
// set the cursor to the beginning of the document
- //m_messageWindow->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
+ m_messageWindow->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
// move the cursor to the end of the document
m_messageWindow->moveCursor(QTextEdit::MoveEnd, QTextCursor::MoveAnchor);
@@ -842,8 +870,17 @@
}
}
-void MessageWindow::toggleTypeFilter(int id)
+void MessageWindow::toggleTypeFilter(QAction* action)
{
+
+ int id = action->data().value<int>();
+
+ //Enable/Disable All also invokes this method (due to connecting via the
+ //menu rather than the individual items), and this causes issues
+ //with MT_Guild since it's type 0. So we've given Enable/Disable all their
+ //own bogus type value
+ if (id == -1) return;
+
// toggle whether the message type is shown or not
if (((uint64_t(1) << id) & m_enabledTypes) != 0)
m_enabledTypes &= ~(uint64_t(1) << id);
@@ -853,8 +890,6 @@
// save the new setting
pSEQPrefs->setPrefUInt64("EnabledTypes", preferenceName(), m_enabledTypes);
- // (un)check the appropriate menu item
- m_typeFilterMenu->setItemChecked(id, ((m_enabledTypes & (uint64_t(1) << id)) != 0));
}
void MessageWindow::disableAllTypeFilters()
@@ -863,17 +898,16 @@
m_enabledTypes = 0;
pSEQPrefs->setPrefUInt64("EnabledTypes", preferenceName(), m_enabledTypes);
- // make sure the All menu items are unchecked
- m_typeFilterMenu->setItemChecked(64, false);
- m_typeFilterMenu->setItemChecked(65, false);
// uncheck all the menu items
- QString typeName;
- for (int i = MT_Guild; i <= MT_Max; i++)
+ foreach (QAction* action, m_typeFilterMenu->actions())
{
- typeName = MessageEntry::messageTypeString((MessageType)i);
- if (!typeName.isEmpty())
- m_typeFilterMenu->setItemChecked(i, false);
+ if (action->text().contains("&Enable All") ||
+ action->text().contains("&Disable All") ||
+ action->isSeparator())
+ continue;
+
+ action->setChecked(false);
}
}
@@ -883,22 +917,29 @@
m_enabledTypes = 0xFFFFFFFFFFFFFFFFULL;
pSEQPrefs->setPrefUInt64("EnabledTypes", preferenceName(), m_enabledTypes);
- // make sure the All menu items are unchecked
- m_typeFilterMenu->setItemChecked(64, false);
- m_typeFilterMenu->setItemChecked(65, false);
// check all the menu items
- QString typeName;
- for (int i = MT_Guild; i <= MT_Max; i++)
+ foreach (QAction* action, m_typeFilterMenu->actions())
{
- typeName = MessageEntry::messageTypeString((MessageType)i);
- if (!typeName.isEmpty())
- m_typeFilterMenu->setItemChecked(i, true);
+ if (action->text().contains("&Enable All") ||
+ action->text().contains("&Disable All") ||
+ action->isSeparator())
+ continue;
+
+ action->setChecked(true);
}
}
-void MessageWindow::toggleShowUserFilter(int id)
+void MessageWindow::toggleShowUserFilter(QAction* action)
{
+ int id = action->data().value<int>();
+
+ //Enable/Disable All also invokes this method (due to connecting via the
+ //menu rather than the individual items), and this causes issues
+ //with MT_Guild since it's type 0. So we've given Enable/Disable all their
+ //own bogus type value
+ if (id == -1) return;
+
// toggle whether the filter is enabled/disabled
if (((1 << id) & m_enabledShowUserFilters) != 0)
m_enabledShowUserFilters &= ~(1 << id);
@@ -906,12 +947,9 @@
m_enabledShowUserFilters |= (1 << id);
// save the new setting
- pSEQPrefs->setPrefUInt("EnabledShowUserFilters", preferenceName(),
- m_enabledShowUserFilters);
-
- // (un)check the appropriate menu item
- m_showUserFilterMenu->setItemChecked(id,
- ((m_enabledShowUserFilters & (1 << id)) != 0));
+ pSEQPrefs->setPrefUInt("EnabledShowUserFilters", preferenceName(),
+ m_enabledShowUserFilters);
+
}
void MessageWindow::disableAllShowUserFilters()
@@ -918,19 +956,18 @@
{
// set and save all filters disabled setting
m_enabledShowUserFilters = 0;
- pSEQPrefs->setPrefUInt("EnabledShowUserFilters", preferenceName(),
- m_enabledShowUserFilters);
-
- // make sure the All menu items are unchecked
- m_showUserFilterMenu->setItemChecked(66, false);
- m_showUserFilterMenu->setItemChecked(67, false);
+ pSEQPrefs->setPrefUInt("EnabledShowUserFilters", preferenceName(),
+ m_enabledShowUserFilters);
// uncheck all the menu items
- QString typeName;
- for (int i = 0; i <= maxMessageFilters; i++)
+ foreach (QAction* action, m_showUserFilterMenu->actions())
{
- if (m_messageFilters->filter(i))
- m_showUserFilterMenu->setItemChecked(i, false);
+ if (action->text().contains("&Enable All") ||
+ action->text().contains("&Disable All") ||
+ action->isSeparator())
+ continue;
+
+ action->setChecked(false);
}
}
@@ -938,24 +975,31 @@
{
// set and save all filters enabled flag
m_enabledShowUserFilters = 0xFFFFFFFF;
- pSEQPrefs->setPrefUInt("EnabledShowUserFilters", preferenceName(),
- m_enabledShowUserFilters);
+ pSEQPrefs->setPrefUInt("EnabledShowUserFilters", preferenceName(),
+ m_enabledShowUserFilters);
- // make sure the All menu items are unchecked
- m_showUserFilterMenu->setItemChecked(66, false);
- m_showUserFilterMenu->setItemChecked(67, false);
-
// check all the menu items
- QString typeName;
- for (int i = 0; i <= maxMessageFilters; i++)
+ foreach (QAction* action, m_showUserFilterMenu->actions())
{
- if (m_messageFilters->filter(i))
- m_showUserFilterMenu->setItemChecked(i, true);
+ if (action->text().contains("&Enable All") ||
+ action->text().contains("&Disable All") ||
+ action->isSeparator())
+ continue;
+
+ action->setChecked(true);
}
}
-void MessageWindow::toggleHideUserFilter(int id)
+void MessageWindow::toggleHideUserFilter(QAction* action)
{
+ int id = action->data().value<int>();
+
+ //Enable/Disable All also invokes this method (due to connecting via the
+ //menu rather than the individual items), and this causes issues
+ //with MT_Guild since it's type 0. So we've given Enable/Disable all their
+ //own bogus type value
+ if (id == -1) return;
+
// toggle whether the filter is enabled/disabled
if (((1 << id) & m_enabledHideUserFilters) != 0)
m_enabledHideUserFilters &= ~(1 << id);
@@ -963,12 +1007,8 @@
m_enabledHideUserFilters |= (1 << id);
// save the new setting
- pSEQPrefs->setPrefUInt("EnabledHideUserFilters", preferenceName(),
- m_enabledHideUserFilters);
-
- // (un)check the appropriate menu item
- m_hideUserFilterMenu->setItemChecked(id,
- ((m_enabledHideUserFilters & (1 << id)) != 0));
+ pSEQPrefs->setPrefUInt("EnabledHideUserFilters", preferenceName(),
+ m_enabledHideUserFilters);
}
void MessageWindow::disableAllHideUserFilters()
@@ -975,19 +1015,18 @@
{
// set and save all filters disabled setting
m_enabledHideUserFilters = 0;
- pSEQPrefs->setPrefUInt("EnabledHideUserFilters", preferenceName(),
- m_enabledHideUserFilters);
-
- // make sure the All menu items are unchecked
- m_hideUserFilterMenu->setItemChecked(66, false);
- m_hideUserFilterMenu->setItemChecked(67, false);
+ pSEQPrefs->setPrefUInt("EnabledHideUserFilters", preferenceName(),
+ m_enabledHideUserFilters);
// uncheck all the menu items
- QString typeName;
- for (int i = 0; i <= maxMessageFilters; i++)
+ foreach (QAction* action, m_hideUserFilterMenu->actions())
{
- if (m_messageFilters->filter(i))
- m_hideUserFilterMenu->setItemChecked(i, false);
+ if (action->text().contains("&Enable All") ||
+ action->text().contains("&Disable All") ||
+ action->isSeparator())
+ continue;
+
+ action->setChecked(false);
}
}
@@ -995,26 +1034,25 @@
{
// set and save all filters enabled flag
m_enabledHideUserFilters = 0xFFFFFFFF;
- pSEQPrefs->setPrefUInt("EnabledHideUserFilters", preferenceName(),
- m_enabledHideUserFilters);
+ pSEQPrefs->setPrefUInt("EnabledHideUserFilters", preferenceName(),
+ m_enabledHideUserFilters);
- // make sure the All menu items are unchecked
- m_hideUserFilterMenu->setItemChecked(66, false);
- m_hideUserFilterMenu->setItemChecked(67, false);
-
// check all the menu items
- QString typeName;
- for (int i = 0; i <= maxMessageFilters; i++)
+ foreach (QAction* action, m_hideUserFilterMenu->actions())
{
- if (m_messageFilters->filter(i))
- m_hideUserFilterMenu->setItemChecked(i, true);
+ if (action->text().contains("&Enable All") ||
+ action->text().contains("&Disable All") ||
+ action->isSeparator())
+ continue;
+
+ action->setChecked(true);
}
}
void MessageWindow::toggleLockedText()
{
+// m_lockedText = enable;
m_lockedText = !m_lockedText;
- m_menu->setItemChecked(m_id_lockText, m_lockedText);
// if the text had been locked, refresh the messages
if (!m_lockedText)
@@ -1021,41 +1059,39 @@
refreshMessages();
}
-void MessageWindow::toggleDisplayType(int id)
+void MessageWindow::toggleDisplayType(bool enable)
{
- m_displayType = !m_displayType;
- m_menu->setItemChecked(id, m_displayType);
+ m_displayType = enable;
pSEQPrefs->setPrefBool("DisplayType", preferenceName(), m_displayType);
}
-void MessageWindow::toggleDisplayTime(int id)
+void MessageWindow::toggleDisplayTime(bool enable)
{
- m_displayDateTime = !m_displayDateTime;
- m_menu->setItemChecked(id, m_displayDateTime);
+ m_displayDateTime = enable;
+
pSEQPrefs->setPrefBool("DisplayDateTime", preferenceName(),
- m_displayDateTime);
+ m_displayDateTime);
}
-void MessageWindow::toggleEQDisplayTime(int id)
+void MessageWindow::toggleEQDisplayTime(bool enable)
{
- m_displayEQDateTime = ! m_displayEQDateTime;
- m_menu->setItemChecked(id, m_displayEQDateTime);
+ m_displayEQDateTime = enable;
+
pSEQPrefs->setPrefBool("DisplayEQDateTime", preferenceName(),
- m_displayEQDateTime);
+ m_displayEQDateTime);
}
-void MessageWindow::toggleUseTypeStyles(int id)
+void MessageWindow::toggleUseTypeStyles(bool enable)
{
- m_useTypeStyles = !m_useTypeStyles;
- m_menu->setItemChecked(id, m_useTypeStyles);
+ m_useTypeStyles = enable;
+
pSEQPrefs->setPrefBool("UseTypeStyles", preferenceName(), m_useTypeStyles);
}
-void MessageWindow::toggleWrapText(int id)
+void MessageWindow::toggleWrapText(bool enable)
{
- m_wrapText = !m_wrapText;
- m_menu->setItemChecked(id, m_wrapText);
+ m_wrapText = enable;
pSEQPrefs->setPrefBool("WrapText", preferenceName(), m_wrapText);
@@ -1064,8 +1100,11 @@
QTextEdit::WidgetWidth : QTextEdit::NoWrap);
}
-void MessageWindow::setTypeStyle(int id)
+void MessageWindow::setTypeStyle(QAction* action)
{
+
+ int id = action->data().value<int>();
+
// Create the dialog object
QString typeName = MessageEntry::messageTypeString((MessageType)id);
QString styleCaption = caption() + " - " + typeName + " Style";
@@ -1197,11 +1236,16 @@
void MessageWindow::addedFilter(uint32_t mask, uint8_t filterid,
const MessageFilter& filter)
{
+ QAction* action;
// insert a user filter menu item for the new filter
- m_showUserFilterMenu->insertItem(filter.name(), filterid);
+ action = m_showUserFilterMenu->addAction(filter.name());
+ action->setCheckable(true);
+ action->setData(filterid);
// insert a user filter menu item for the new filter
- m_hideUserFilterMenu->insertItem(filter.name(), filterid);
+ action = m_hideUserFilterMenu->addAction(filter.name());
+ action->setCheckable(true);
+ action->setData(filterid);
}
#ifndef QMAKEBUILD
Modified: showeq/branches/pre_6_0_beta/src/messagewindow.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/messagewindow.h 2020-10-28 14:22:59 UTC (rev 1086)
+++ showeq/branches/pre_6_0_beta/src/messagewindow.h 2020-10-28 14:23:07 UTC (rev 1087)
@@ -178,22 +178,22 @@
void saveText(void);
protected slots:
- void toggleTypeFilter(int);
+ void toggleTypeFilter(QAction*);
void disableAllTypeFilters();
void enableAllTypeFilters();
- void toggleShowUserFilter(int);
+ void toggleShowUserFilter(QAction*);
void disableAllShowUserFilters();
void enableAllShowUserFilters();
- void toggleHideUserFilter(int);
+ void toggleHideUserFilter(QAction*);
void disableAllHideUserFilters();
void enableAllHideUserFilters();
void toggleLockedText();
- void toggleDisplayType(int);
- void toggleDisplayTime(int);
- void toggleEQDisplayTime(int);
- void toggleUseTypeStyles(int);
- void toggleWrapText(int);
- void setTypeStyle(int);
+ void toggleDisplayType(bool);
+ void toggleDisplayTime(bool);
+ void toggleEQDisplayTime(bool);
+ void toggleUseTypeStyles(bool);
+ void toggleWrapText(bool);
+ void setTypeStyle(QAction*);
void setColor();
void setBGColor();
void setFont();
@@ -205,7 +205,7 @@
protected:
void addMessage(const MessageEntry& message);
void addColorMessage(const MessageEntry& message);
-
+
Messages* m_messages;
MessageFilters* m_messageFilters;
MessageBrowser* m_messageWindow;
@@ -213,7 +213,7 @@
QMenu* m_typeFilterMenu;
QMenu* m_showUserFilterMenu;
QMenu* m_hideUserFilterMenu;
- int m_id_lockText;
+ QAction* m_action_lockText;
MessageFindDialog* m_findDialog;
MessageFilterDialog* m_filterDialog;
uint64_t m_enabledTypes;
Modified: showeq/branches/pre_6_0_beta/src/spelllist.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/spelllist.h 2020-10-28 14:22:59 UTC (rev 1086)
+++ showeq/branches/pre_6_0_beta/src/spelllist.h 2020-10-28 14:23:07 UTC (rev 1087)
@@ -31,7 +31,6 @@
#include <QList>
#include <Q3ListView>
-#include <Q3PopupMenu>
#include <ctime>
#include <sys/time.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cn...@us...> - 2020-10-28 14:23:02
|
Revision: 1086
http://sourceforge.net/p/seq/svn/1086
Author: cn187
Date: 2020-10-28 14:22:59 +0000 (Wed, 28 Oct 2020)
Log Message:
-----------
Replace Q3ToolBar with QToolbar
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/editor.cpp
showeq/branches/pre_6_0_beta/src/editor.h
showeq/branches/pre_6_0_beta/src/interface.h
showeq/branches/pre_6_0_beta/src/map.cpp
Modified: showeq/branches/pre_6_0_beta/src/editor.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/editor.cpp 2020-10-28 14:22:52 UTC (rev 1085)
+++ showeq/branches/pre_6_0_beta/src/editor.cpp 2020-10-28 14:22:59 UTC (rev 1086)
@@ -28,11 +28,11 @@
#include <cerrno>
#include <QApplication>
-#include <Q3ToolBar>
+#include <QToolBar>
#include <QStatusBar>
-#include <Q3PopupMenu>
+#include <QMenu>
#include <QMenuBar>
-#include <Q3MainWindow>
+#include <QMainWindow>
#include <QFileDialog>
#include <QToolButton>
#include <Q3TextStream>
@@ -94,36 +94,27 @@
};
EditorWindow::EditorWindow(const char *fileName)
- : Q3MainWindow( 0, "ShowEQ - Editor", Qt::WDestructiveClose )
+ : QMainWindow( 0, "ShowEQ - Editor", Qt::WDestructiveClose )
{
- int id;
-
QPixmap openIcon, saveIcon;
-
- fileTools = new Q3ToolBar( this, "file operations" );
+ openIcon = QPixmap( fileopen );
+ saveIcon = QPixmap( filesave );
+ fileTools = new QToolBar(this);
fileTools->setLabel( tr( "File Operations" ) );
-
- openIcon = QPixmap( fileopen );
- new QToolButton( openIcon, "Open File", QString::null,
- this, SLOT(load()), fileTools, "open file" );
-
- saveIcon = QPixmap( filesave );
- new QToolButton( saveIcon, "Save File", QString::null,
- this, SLOT(save()), fileTools, "save file" );
-
- QMenu * file = new Q3PopupMenu( this );
+ fileTools->addAction(openIcon, "Open File", this, SLOT(load()));
+ fileTools->addAction(saveIcon, "Save File", this, SLOT(save()));
+ addToolBar(fileTools);
+
+ QMenu * file = new QMenu( this );
menuBar()->insertItem( "&File", file );
-
- id = file->insertItem( openIcon, "&Open",
- this, SLOT(load()), Qt::CTRL+Qt::Key_O );
-
- id = file->insertItem( saveIcon, "&Save",
- this, SLOT(save()), Qt::CTRL+Qt::Key_S );
- file->insertSeparator();
- file->insertItem( "&Close Editor", this, SLOT(close()), Qt::CTRL+Qt::Key_W );
+ file->addAction( openIcon, "&Open", this, SLOT(load()), Qt::CTRL+Qt::Key_O );
+ file->addAction( saveIcon, "&Save", this, SLOT(save()), Qt::CTRL+Qt::Key_S );
+ file->addSeparator();
+ file->addAction( "&Close Editor", this, SLOT(close()), Qt::CTRL+Qt::Key_W );
+
e = new QTextEdit( this, "editor" );
e->setFocus();
setCentralWidget( e );
Modified: showeq/branches/pre_6_0_beta/src/editor.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/editor.h 2020-10-28 14:22:52 UTC (rev 1085)
+++ showeq/branches/pre_6_0_beta/src/editor.h 2020-10-28 14:22:59 UTC (rev 1086)
@@ -23,15 +23,15 @@
#ifndef EDITOR_H
#define EDITOR_H
-#include <Q3MainWindow>
+#include <QMainWindow>
#include <QCloseEvent>
#include <QMenu>
class QTextEdit;
-class Q3ToolBar;
+class QToolBar;
class QMenu;
-class EditorWindow: public Q3MainWindow
+class EditorWindow: public QMainWindow
{
Q_OBJECT
public:
@@ -50,7 +50,7 @@
private:
QTextEdit *e;
- Q3ToolBar *fileTools;
+ QToolBar *fileTools;
QString filename;
};
Modified: showeq/branches/pre_6_0_beta/src/interface.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/interface.h 2020-10-28 14:22:52 UTC (rev 1085)
+++ showeq/branches/pre_6_0_beta/src/interface.h 2020-10-28 14:22:59 UTC (rev 1086)
@@ -35,7 +35,6 @@
#include <QList>
#include <QTimer>
#include <QMessageBox>
-#include <Q3TabDialog>
#include <QSpinBox>
#include <QHash>
#include <Q3TextStream>
Modified: showeq/branches/pre_6_0_beta/src/map.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/map.cpp 2020-10-28 14:22:52 UTC (rev 1085)
+++ showeq/branches/pre_6_0_beta/src/map.cpp 2020-10-28 14:22:59 UTC (rev 1086)
@@ -57,7 +57,6 @@
#include <QEvent>
#include <QPushButton>
#include <QLayout>
-#include <Q3ToolBar>
#include <QShortcut>
#include <QColorDialog>
#include <QFontDialog>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|