Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

Commit

Permalink
Minor Fixes.
Browse files Browse the repository at this point in the history
- Fixed message view colors when resetting style to "-None-".

- Fixed initialization of jump bridges when bridgemap has changed during run.

- Now saves jumpbridge visibility state.

- Fixed another KOS checker bug, tripped when specific error returns from CVA.
  • Loading branch information
3vi1 committed May 15, 2017
1 parent e364822 commit e7327f3
Show file tree
Hide file tree
Showing 15 changed files with 121 additions and 35 deletions.
1 change: 1 addition & 0 deletions data/dictionaries/common
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on
ship
ships
shiptype
si
still
the
there
Expand Down
15 changes: 14 additions & 1 deletion docs/RELEASES
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
0.8.6 - Fixed message view colors when resetting style to "-None-".

Fixed initialization of jump bridges when bridgemap has changed
during run.

Now saves jumpbridge visibility state.

Fixed another KOS checker bug, tripped when specific error returns
from CVA.

Added si to common words to stop notifications for that system based
on some pilot names.

0.8.5 - Modified message list to be a dockable widget. You can now move it
to any side of the window, or detach it to be it's own floating
window.
Expand Down Expand Up @@ -225,7 +238,7 @@

Coming soon:

- docking.
- fix display of messages with backslashes.
- additional sound/volume options for alerts, dependant on jump distance.
- better memory cache/cleanup.
- investigate crash on region change.
33 changes: 25 additions & 8 deletions src/asyncinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ void AsyncInfo::error(QNetworkReply::NetworkError err)
{
// Manage error here.
qDebug() << "*** In AsyncInfo::error: " << err;
emit kosCheckFailed(checkNames);

if(err == QNetworkReply::UnknownContentError)
{
qDebug() << "An unknown error related to the remote content was detected.";
}
else
{
emit kosCheckFailed(checkNames);
}
this->deleteLater();
}

Expand All @@ -136,19 +144,26 @@ void AsyncInfo::kosCheck(const QString &reqNames)
void AsyncInfo::kosCheck(const QString &reqNames,
const char* slot,
QString queryType)
{
{
QString names = reqNames;

int nameCount = 1;
foreach (QChar c, names)
if (c == '\n') nameCount++;
if (nameCount > 1 && queryType == "unit")
queryType = "multi";

names.replace('\n',',');
//qDebug() << "* kosCheck requested for " << names;
qDebug() << "* kosCheck requested for " << names;

QUrl url("http://kos.cva-eve.org/api/");
QUrlQuery query;
query.addQueryItem("c", "json");
query.addQueryItem("type", queryType);
query.addQueryItem("q", names);
query.addQueryItem("q", names); //QUrl::toPercentEncoding(names, ","));
url.setQuery(query);

//qDebug() << "Query = " << url.query();
qDebug() << "Query = " << url.query();

QNetworkRequest request(url);
request.setRawHeader("User-Agent", meta.agentString.toUtf8());
Expand All @@ -165,7 +180,7 @@ void AsyncInfo::gotKosCheckReply()
QByteArray b = kosReply->readAll();
kosReply->deleteLater();

//qDebug() << "gotKosCheckReply = " << b;
qDebug() << "gotKosCheckReply = " << b;

if(b.length() == 0)
{
Expand Down Expand Up @@ -233,7 +248,7 @@ void AsyncInfo::rblCheck(const QString& name, int id)

void AsyncInfo::rblCheck(int id)
{
qDebug() << "AsyncInfo::rblCheck() - " << id;
qDebug() << "AsyncInfo::rblCheck(" << id << ")";

// Request the Character Information
QUrl url("https://api.eveonline.com/eve/CharacterInfo.xml.aspx");
Expand All @@ -259,6 +274,8 @@ void AsyncInfo::rblIdRetrieved()
QByteArray b = reply->readAll();
reply->deleteLater();

qDebug() << "AsyncInfo::rblIdRetrieved - b = " << b;

QXmlQuery query;
query.setFocus(b);
query.setQuery("//*:row/@characterID/string()");
Expand All @@ -281,7 +298,7 @@ void AsyncInfo::rblInfoRetrieved()
QByteArray b = infoReply->readAll();
infoReply->deleteLater();

//qDebug() << "AsyncInfo::rblInfoRetrieved() - " << b;
qDebug() << "AsyncInfo::rblInfoRetrieved() - " << b;

if(b.length() == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/asyncinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public slots:
int m_corpNum = 0;

void requestId(const QString& name, const char* slot);
void kosCheck(const QString &reqNames, const char* slot, QString queryType = "multi");
void kosCheck(const QString &reqNames, const char* slot, QString queryType = "unit");
};

#endif // ASYNCINFO_H
2 changes: 1 addition & 1 deletion src/imp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = imp
TEMPLATE = app

VERSION = 0.8.5
VERSION = 0.8.6
QMAKE_TARGET_COMPANY = EternalDusk
QMAKE_TARGET_DESCRIPTION = Eve Online Intelligence Management Program
QMAKE_TARGET_COPYRIGHT = (c) Copyright 2016-2017 Jesse Litton
Expand Down
48 changes: 36 additions & 12 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ MainWindow::MainWindow(QWidget *parent) :
// function to compare the previous/current clipboard value, because
// they cannot detect the clipboard is changed until the app is activated.

connect(QApplication::clipboard(), SIGNAL(dataChanged()),
this, SLOT(clipboardUpdated()));
connect(QApplication::clipboard(), &QClipboard::dataChanged,
this, &MainWindow::clipboardUpdated, Qt::UniqueConnection);

// Normally, you could just set these shortcuts in the UI, but since we hide the menus they may become
// disabled on some Desktop Environments (like KDE) if we did it that way.
Expand Down Expand Up @@ -393,19 +393,24 @@ void MainWindow::changeImpStatus(const QString& text)

void MainWindow::clipboardUpdated()
{
QString currentText = QApplication::clipboard()->text();
if(options.getKosCheck())
{
qDebug() << "MainWindow::clipboardUpdated options.getKosOnDouble() = " << options.getKosOnDouble();
qDebug() << "MainWindow::clipboardUpdated m_lastClipboard = " << m_lastClipboard;
qDebug() << "MainWindow::clipboardUpdated QApplication::clipboard()->text() = " << currentText;
if(options.getKosOnDouble() &&
QApplication::clipboard()->text() != m_lastClipboard)
m_lastClipboard != currentText)
{
m_lastClipboard = QApplication::clipboard()->text();
m_lastClipboard = currentText;
qDebug() << "Clipboard has changed, and we're only firing on double-ctrl-c. Exiting";
return;
}

kosSoundPlayed = false;

QStringList lines, names;
lines = QApplication::clipboard()->text().split('\n');
lines = currentText.split('\n');

foreach(QString line, lines)
{
Expand Down Expand Up @@ -506,8 +511,9 @@ void MainWindow::gotRblReply(QString name, bool rbl, int corpNum)

qDebug() << "MainWindow::gotRblReply - Finished checking" << name;

if(--pilotsBeingChecked == 0)
if(--pilotsBeingChecked <= 0)
{
//pilotsBeingChecked = 0
if(kosSoundPlayed)
{
kosSoundPlayed = false;
Expand All @@ -534,8 +540,6 @@ void MainWindow::gotKosReply(const QString& pilotNames, const QList<KosEntry>& e
bool playKos = false;
foreach(KosEntry e, entries)
{
pilots.remove(e.pilot.name);

qDebug() << "MainWindow::gotKosReply - " << e.pilot.name;
MessageInfo info;
info.sender = "Khasm Kaotiqa";
Expand All @@ -548,20 +552,29 @@ void MainWindow::gotKosReply(const QString& pilotNames, const QList<KosEntry>& e
info.markedUpText = "<warn>" + e.pilot.name + " is KOS!";
playKos = true;
addMessage(info);
qDebug() << "MainWindow::gotKosReply - Finished checking" << e.pilot.name;
pilots.remove(e.pilot.name);
pilotsBeingChecked--;
}
else if(e.corp.kos)
{
info.text = e.pilot.name + "'s corp (" + e.corp.name + ") is KOS!";
info.markedUpText = e.pilot.name + "'s corp (" + e.corp.name + ") is <warn>KOS!";
playKos = true;
addMessage(info);
qDebug() << "MainWindow::gotKosReply - Finished checking" << e.pilot.name;
pilots.remove(e.pilot.name);
pilotsBeingChecked--;
}
else if(e.alliance.kos)
{
info.text = e.pilot.name + "'s alliance (" + e.alliance.name + ") is KOS!";
info.markedUpText = e.pilot.name + "'s alliance (" + e.alliance.name + ") is <warn>KOS!";
playKos = true;
addMessage(info);
qDebug() << "MainWindow::gotKosReply - Finished checking" << e.pilot.name;
pilots.remove(e.pilot.name);
pilotsBeingChecked--;
}
else
{
Expand All @@ -573,8 +586,6 @@ void MainWindow::gotKosReply(const QString& pilotNames, const QList<KosEntry>& e
}
}

qDebug() << "MainWindow::gotKosReply - Finished checking" << e.pilot.name;
pilotsBeingChecked--;
}

// Do red-by-last checks on any pilots the CVA checker didn't know about.
Expand Down Expand Up @@ -726,6 +737,12 @@ void MainWindow::gotRegionFile()
ui->mapView->setTransform(m_mapTransform);
ui->mapView->rotateSystems(m_savedSystemRotation);

if(options.getShowBridges())
{
ui->actionShow_Bridges->setChecked(true);
on_actionShow_Bridges_triggered(true);
}

regionMap->startUpdates();
}

Expand Down Expand Up @@ -787,6 +804,7 @@ void MainWindow::gotBridgeFile()
errorRetrievingBridgeFile = false;
}

ui->mapView->clearBridges();
foreach(QGraphicsLineItem* arrow, bridgeMap->arrows)
{
ui->mapView->addBridge(arrow);
Expand Down Expand Up @@ -866,6 +884,9 @@ void MainWindow::saveSettings()
settings.setValue("center", ui->mapView->getViewportCenter());

settings.setValue("windowOpacity", windowOpacity());

settings.setValue("showBridges", options.getShowBridges());

}

QString dataPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
Expand All @@ -876,7 +897,7 @@ void MainWindow::saveSettings()
QDateTime oldestTime = QDateTime::currentDateTimeUtc();
if(options.getHistoryMax() > 0)
{
oldestTime.addDays(-1 * (options.getAvatarExpiration() - 1));
oldestTime = oldestTime.addDays(-1 * (options.getAvatarExpiration() - 1));
}

QMap<QString, PilotEntry>::iterator i;
Expand Down Expand Up @@ -1461,6 +1482,7 @@ void MainWindow::logDirChanged(const QString& dir)

void MainWindow::on_actionShow_Bridges_triggered(bool checked)
{
options.showBridges(checked);
if(checked)
loadBridges();
else
Expand Down Expand Up @@ -1729,6 +1751,7 @@ void MainWindow::gotStyleSheetChange(const QString styleName)
{
if(styleName == "-None-")
{
msgStyle->reset();
qApp->setStyleSheet("");
return;
}
Expand Down Expand Up @@ -1758,7 +1781,8 @@ void MainWindow::on_action_Messages_triggered()
}


void MainWindow::on_dockWidget_visibilityChanged(bool visible)
/*void MainWindow::on_dockWidget_visibilityChanged(bool visible)
{

}
*/
2 changes: 1 addition & 1 deletion src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private slots:
void on_action_Frameless_Window_triggered();
void on_action_Menu_Toggle_triggered();
void on_action_Messages_triggered();
void on_dockWidget_visibilityChanged(bool visible);
//void on_dockWidget_visibilityChanged(bool visible);

private:
void initParsing();
Expand Down
4 changes: 2 additions & 2 deletions src/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ static const struct Version
{
Version(){}

QString release = "0.8.5"; //VERSION;
QString name = "Wolves Up, Dock!";
QString release = "0.8.6"; //VERSION;
QString name = "Nah Loopy Just Lupine.";

QString styleHeader1 = "<span style=\" color:#0000ff;\">";
QString styleFooter1 = "</span>";
Expand Down
13 changes: 13 additions & 0 deletions src/msgstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,18 @@

MsgStyle::MsgStyle(QWidget *parent) : QWidget(parent)
{
reset();
}

void MsgStyle::reset()
{
m_clearColor = Qt::green;
m_gateColor = Qt::darkBlue;
m_infoColor = Qt::darkMagenta;
m_locationColor = Qt::darkRed;
m_shipColor = Qt::darkYellow;
m_stampColor = Qt::black;
m_statusColor = Qt::darkCyan;
m_systemColor = Qt::blue;
m_warnColor = Qt::red;
}
20 changes: 11 additions & 9 deletions src/msgstyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,23 @@ class MsgStyle : public QWidget
QColor getWarnColor() const { return m_warnColor; }
void setWarnColor( const QColor c ) { m_warnColor = c; }

void reset();

signals:

public slots:

private:

QColor m_clearColor = Qt::green;
QColor m_gateColor = Qt::darkBlue;
QColor m_infoColor = Qt::darkMagenta;
QColor m_locationColor = Qt::darkRed;
QColor m_shipColor = Qt::darkYellow;
QColor m_stampColor = Qt::black;
QColor m_statusColor = Qt::darkCyan;
QColor m_systemColor = Qt::blue;
QColor m_warnColor = Qt::red;
QColor m_clearColor;
QColor m_gateColor;
QColor m_infoColor;
QColor m_locationColor;
QColor m_shipColor;
QColor m_stampColor;
QColor m_statusColor;
QColor m_systemColor;
QColor m_warnColor;
};

#endif // MSGSTYLE_H
2 changes: 2 additions & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ void Options::loadSettings(QSettings& settings)
ui->mapEdit->setText(settings.value("mapPath", "http://evemaps.dotlan.net/svg/").toString());
ui->bridgeEdit->setText(settings.value("bridgePath", "http://eternaldusk.com/imp/jb/").toString());

m_showBridges = settings.value("showBridges", false).toBool();

// Font settings
ui->fontComboBox->setCurrentIndex(
ui->fontComboBox->findText(
Expand Down
4 changes: 4 additions & 0 deletions src/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class Options : public QDialog

QString getBridgePath();

bool getShowBridges(){return m_showBridges;}
void showBridges(bool b){m_showBridges = b;}

bool getEssAndKos();
int getHistoryMax();
bool getKosCheck();
Expand Down Expand Up @@ -161,6 +164,7 @@ private slots:

bool _autofollow = true;
bool m_showAvatar = true;
bool m_showBridges = false;
bool _smoothAutofollow;
bool _essAndKos;
bool _kosDouble;
Expand Down
Loading

0 comments on commit e7327f3

Please sign in to comment.