# HG changeset patch
# User nemo
# Date 1420324053 18000
# Node ID d886f319e7b32921465075652963cf17e0e5e55a
# Parent 408803ca951a797f3e036246c1c680ccda4aa5e3
Tired of not knowing which rooms I can't join
diff -r 408803ca951a -r d886f319e7b3 QTfrontend/hedgewars.qrc
--- a/QTfrontend/hedgewars.qrc Sat Jan 03 15:25:42 2015 -0500
+++ b/QTfrontend/hedgewars.qrc Sat Jan 03 17:27:33 2015 -0500
@@ -124,7 +124,11 @@
res/iconHealth.png
res/iconSuddenDeath.png
res/iconDamage.png
+ res/iconDamageLockG.png
+ res/iconDamageLockR.png
res/iconTime.png
+ res/iconTimeLockG.png
+ res/iconTimeLockR.png
res/iconMine.png
res/iconDud.png
res/iconRope.png
diff -r 408803ca951a -r d886f319e7b3 QTfrontend/model/roomslistmodel.cpp
--- a/QTfrontend/model/roomslistmodel.cpp Sat Jan 03 15:25:42 2015 -0500
+++ b/QTfrontend/model/roomslistmodel.cpp Sat Jan 03 17:27:33 2015 -0500
@@ -108,12 +108,32 @@
if (role == Qt::DecorationRole)
{
const QIcon roomBusyIcon(":/res/iconDamage.png");
+ const QIcon roomBusyIconGreen(":/res/iconDamageLockG.png");
+ const QIcon roomBusyIconRed(":/res/iconDamageLockR.png");
const QIcon roomWaitingIcon(":/res/iconTime.png");
+ const QIcon roomWaitingIconGreen(":/res/iconTimeLockG.png");
+ const QIcon roomWaitingIconRed(":/res/iconTimeLockR.png");
+
+ QString flags = m_data.at(row).at(0);
- if (m_data.at(row).at(0).isEmpty())
- return QVariant(roomWaitingIcon);
+ if (flags.contains("g"))
+ {
+ if (flags.contains("j"))
+ return QVariant(roomWaitingIconRed);
+ else if (flags.contains("p"))
+ return QVariant(roomWaitingIconGreen);
+ else
+ return QVariant(roomWaitingIcon);
+ }
else
- return QVariant(roomBusyIcon);
+ {
+ if (flags.contains("j"))
+ return QVariant(roomBusyIconRed);
+ else if (flags.contains("p"))
+ return QVariant(roomBusyIconGreen);
+ else
+ return QVariant(roomBusyIcon);
+ }
}
QString content = m_data.at(row).at(column);
@@ -190,7 +210,7 @@
l.append(rooms[i + t]);
}
- m_data.append(roomInfo2RoomRecord(l));
+ m_data.append(l);
}
endResetModel();
@@ -201,7 +221,7 @@
{
beginInsertRows(QModelIndex(), 0, 0);
- m_data.prepend(roomInfo2RoomRecord(info));
+ m_data.prepend(info);
endInsertRows();
}
@@ -250,25 +270,7 @@
if (i < 0)
return;
- m_data[i] = roomInfo2RoomRecord(info);
+ m_data[i] = info;
emit dataChanged(index(i, 0), index(i, columnCount(QModelIndex()) - 1));
}
-
-
-QStringList RoomsListModel::roomInfo2RoomRecord(const QStringList & info)
-{
- QStringList result;
-
- result = info;
-
- QString flags = info[StateColumn];
- // for matters of less memory usage and quicker access store
- // the boolean string as either "t" or empty
- if (flags.contains('g'))
- result[StateColumn] = "t";
- else
- result[StateColumn] = QString();
-
- return result;
-}
diff -r 408803ca951a -r d886f319e7b3 QTfrontend/model/roomslistmodel.h
--- a/QTfrontend/model/roomslistmodel.h Sat Jan 03 15:25:42 2015 -0500
+++ b/QTfrontend/model/roomslistmodel.h Sat Jan 03 17:27:33 2015 -0500
@@ -66,8 +66,6 @@
QStringList m_headerData;
MapModel * m_staticMapModel;
MapModel * m_missionMapModel;
-
- QStringList roomInfo2RoomRecord(const QStringList & info);
};
#endif // HEDGEWARS_ROOMSLISTMODEL_H
diff -r 408803ca951a -r d886f319e7b3 QTfrontend/res/iconDamageLockG.png
Binary file QTfrontend/res/iconDamageLockG.png has changed
diff -r 408803ca951a -r d886f319e7b3 QTfrontend/res/iconDamageLockR.png
Binary file QTfrontend/res/iconDamageLockR.png has changed
diff -r 408803ca951a -r d886f319e7b3 QTfrontend/res/iconTimeLockG.png
Binary file QTfrontend/res/iconTimeLockG.png has changed
diff -r 408803ca951a -r d886f319e7b3 QTfrontend/res/iconTimeLockR.png
Binary file QTfrontend/res/iconTimeLockR.png has changed
diff -r 408803ca951a -r d886f319e7b3 QTfrontend/res/locks.svg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/res/locks.svg Sat Jan 03 17:27:33 2015 -0500
@@ -0,0 +1,147 @@
+
+