Skip to content

Qt4x dev #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a3627db
Minor fixes:
IslayTzash Jan 3, 2017
c2b8aac
Updates for cygwin & win32 startup - don't try to invoke windows apis…
IslayTzash Jan 3, 2017
58499f1
Update menus and region selector.
IslayTzash Jan 3, 2017
1e8c193
* Dynamically build Region menus based on quick setup preferences. …
IslayTzash Jan 9, 2017
5841fd5
fix broken avatar cache
IslayTzash Jan 14, 2017
ed06e6a
1. Refactor for reload of history from file on startup and on changin…
IslayTzash Jan 15, 2017
6ab34e8
more ships & less character ignoring
IslayTzash Jan 15, 2017
dc43202
rename for extension
IslayTzash Jan 15, 2017
f10b25a
Document the quick config file.
IslayTzash Jan 15, 2017
7d5822f
urls were not meant to be clickable
IslayTzash Jan 15, 2017
9a63420
be bolder
IslayTzash Jan 15, 2017
0b77606
Update SETUP.md
IslayTzash Jan 15, 2017
5b6e3af
Add info about in app menus.
IslayTzash Jan 15, 2017
2218ea6
Update SETUP.md
IslayTzash Jan 15, 2017
a970b99
Update SETUP.md
IslayTzash Jan 15, 2017
3c85adb
Update SETUP.md
IslayTzash Jan 15, 2017
ed495ad
Fix infinite loop. Remove redundant system check.
IslayTzash Jan 18, 2017
02fa41b
Be more careful with word boundaries in system/ship replacement. Us…
IslayTzash Jan 18, 2017
0ba729e
Fix - highlight ship name starting with dash stuck in infinite loop.
IslayTzash Jan 21, 2017
a0952c2
System was rendering white if alarms came in too fast.
IslayTzash Jan 23, 2017
cbd3685
Fix player icon cache in python3
IslayTzash Jan 28, 2017
e9f35a6
Merge ESI migrated calls from qtx5-dev branch.
IslayTzash May 13, 2018
414e93a
oops. local channel names need to be handled as lower case now.
IslayTzash May 21, 2018
7badfb1
Add a helper for anaconda to launch vintel from a shortcut.
IslayTzash May 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea/workspace.xml
.vs/*
*.pyproj
quick_config_slyce.json
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@ pyglet is used to play the sound – If it is not available the sound option wil
https://pypi.python.org/pypi/requests
- Six for python 3 compatibility https://pypi.python.org/pypi/six

## Note for windows users

The anaconda python package will come with most of what you need [download](https://www.continuum.io/downloads#windows).
vintel compilation has been tested with 64 bit anaconda2 v4.2.0 for python 2.7 on windows 10.

You will need to run these two commands to downgrade qt5 to qt4 and install the pyglet package. If you installed anaconda for all
users, you may need to run them in an *admin* anaconda prompt.

```
conda install pyqt=4
pip install pyglet
```

## Note for cygwin users

pyglet doesn't currently work under cygwin. Skip installing it or pip uninstall if it causes problems.

## Building the Vintel Standalone Package

- The standalone is created using pyinstaller. All media files and the .spec-file with the configuration for pyinstaller are included in the source repo. Pyinstaller can be found here: https://github.com/pyinstaller/pyinstaller/wiki.
Expand Down
127 changes: 127 additions & 0 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Vintel Setup

This document describes the settings available in the Vintel application.

## Settings Dialog

The settings dialog has three panes: *Quick Setup*, *Jumpbridges*, and *Chat Channels*.

The *Jumpbridges* pane allows you to specify a source for jumpbridges to be
rendered on the maps. You may specify either a DOTLAN jumpbridge list id or an URL to
a file containing your own jumpbridge list. More details on the format of the file
can be seen in the application pane or in *Quick Setup* below.

The *Chat Channels* pane allows you to specify EVE chat channels to monitor for
intelligence reports. You must keep this chat channel open in a tab in game
and have *Log Chat to File* selected in EVE Settings > Chat. Vintel monitors and
processes these log files on your local disk.

## Quick Setup

The first pane of the settings allows you to paste a quick configuration JSON
blob that may be provided by your alliance.

1. **dotlan_jb_id** The id of a jumpbridge list from DOTLAN. Include just the id,
i.e. from ht<i></i>tp://evemaps.dotlan.net/bridges/**XXXXxxxx** use the XXXXxxxx
2. **jumpbridge_url** A url to a file containing your bridge list. Each line
in the file should contain two systems separated by a `<->`. i.e.
`HED-GP <-> 36N-HZ`
3. **channels** A JSON list of the channels to be monitored.
4. **kos_url** A URL to your alliances KOS server.
5. **region_name** The default region to load on launch. Later, the application will
remember the last region viewed and load that when you restart.
6. **quick_regions** The regions listed here are automatically added to the
application's *Region* menu. Any name starting with a dash will be interpreted
as a separator and will draw a horizontal line between entries. Each entry
should have a **label** field which is how it will appear in the menu. Each
may also have a **region** field which can be used to override the region name
used when looking up this system on DOTLAN if the label is not an exact match
(spaces will be automatically converted to underscores).

The **region** should match a DOTLAN url - i.e. ht<i></i>tp://evemaps.dotlan.net/map/**Catch**.
The **region** can also be one of the special or combined maps listed at the
bottom of the DOTLAN universe page. Vintel also recognizes the custom region
providencecatch.

This is what the Vintel defaults would look like as a quick configuration entry:

```
{
"dotlan_jb_id": "",
"jumpbridge_url": "",
"channels": [
"TheCitadel",
"North Provi Intel",
"North Catch Intel",
"North Querious Intel"
],
"kos_url": "http://kos.cva-eve.org/api/",
"region_name": "Catch",
"quick_regions": [
{"label": "Catch"},
{"label": "Providence"},
{"label": "Querious"},
{"label": "---"},
{"label": "Provi / Catch", "region": "providencecatch"},
{"label": "Provi / Catch (compact)", "region": "Providence-catch"}
]
}
```

## Other Menu Settings

### File > Clear Cache

If you notice any weirdness with maps or avatars, you may try flushing the Vintel
cache. Avatars and maps will be redownloaded.

### Chat > Show Chat

Hide the chat history on the right side of the screen

### Chat > Show Chat Avatars

Do not show character portraits in the chat history. Unfortunately selecting this
doesn't yet make the chat window more compact.

### Sound > Activate Sound

This should be checked to enable sound in Vintel.

### Sound > Sound Setup ...

Test the sound configuration.

### Sound > Spoken Notifications

Doesn't work on Windows 10, what does it do?

### Region

Select a region from the quick region shortcuts configured in *Quick Settings*

### Region > Other Region

Select from a list of all known EVE regions.

### Region > Custom Region ...

Displays a freeform text box to enter a standard or custom region by name.

### K.O.S.

Activate some of the Kill On Sight processing and warnings.

### Window > Always On Top

Keep this window above all other windows.

### Window > Frameless Main Window

Remove OS decorations from the window: titlebar, menubar, ... Once activated a *Restore Frame* button will
be available in the upper left corner of the screen. Click that to restore the window decorations.

### Window > Transparency

Set the window opacity.

20 changes: 20 additions & 0 deletions quick_config_cva.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"dotlan_jb_id": "",
"jumpbridge_url": "",
"channels": [
"TheCitadel",
"North Provi Intel",
"North Catch Intel",
"North Querious Intel"
],
"kos_url": "http://kos.cva-eve.org/api/",
"region_name": "Catch",
"quick_regions": [
{"label": "Catch"},
{"label": "Providence"},
{"label": "Querious"},
{"label": "---"},
{"label": "Provi / Catch", "region": "providencecatch"},
{"label": "Provi / Catch (compact)", "region": "Providence-catch"}
]
}
27 changes: 27 additions & 0 deletions src/conda2_launcher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This is a windows shortcut helper,
#
# Setup a shortcut using your ananconda installation directory and your vintel source triggered
# "E:\Program Files\Anaconda2\pythonw.exe" "\FULL\PATH\TO\src\vintel\src\conda2_launcher.py" "E:\Program File\Anaconda2"
#
# It is based on the cwp.py script included with ananconda, but that script is hardcoded to switch
# the current working directory to the user's home directory on launch

import os
import sys
import subprocess
from os.path import join

prefix = sys.argv[1]

env = os.environ.copy()
env['PATH'] = os.path.pathsep.join([
prefix,
join(prefix, "Scripts"),
join(prefix, "Library", "bin"),
env['PATH'],
])

dir = os.path.abspath(os.path.dirname(__file__))
print("prefix=[%s], dir=[%s]" % (prefix, dir))
os.chdir(os.path.abspath(os.path.dirname(__file__)))
subprocess.call([sys.executable, "vintel.py"], env=env)
42 changes: 35 additions & 7 deletions src/vi/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import threading
import time
import six
import sys
if six.PY2:
def to_blob(x):
return buffer(str(x))
Expand All @@ -30,11 +31,14 @@ def from_blob(x):
def to_blob(x):
return x
def from_blob(x):
return x
return x[0][0]

import logging
from vi.cache.dbstructure import updateDatabase

ONE_DAY = 60 * 60 * 24
DEFAULT_TIME = ONE_DAY * 3
PERMANENT = ONE_DAY * 365

class Cache(object):
# Cache checks PATH_TO_CACHE when init, so you can set this on a
Expand Down Expand Up @@ -74,8 +78,8 @@ def checkVersion(self):
raise e
updateDatabase(version, self.con)

def putIntoCache(self, key, value, maxAge=60 * 60 * 24 * 3):
""" Putting something in the cache maxAge is maximum age in seconds
def putIntoCache(self, key, value, maxAge=DEFAULT_TIME):
""" Putting something in the cache maxAge is maximum age in seconds, default is 3 days
"""
with Cache.SQLITE_WRITE_LOCK:
query = "DELETE FROM cache WHERE key = ?"
Expand All @@ -98,6 +102,32 @@ def getFromCache(self, key, outdated=False):
else:
return founds[0][1]

def getConfigValue(self, key):
""" Retrieve a config value from cache that never expires
"""
return self.getFromCache(key, True)

def saveConfigValue(self, key, value):
""" Save a config value to cache that never expires
"""
return self.putIntoCache(key, value, sys.maxsize)

def deleteFromCache(self, key):
""" Deleteing from cache
"""
with Cache.SQLITE_WRITE_LOCK:
query = "DELETE FROM cache WHERE key = ?"
self.con.execute(query, (key,))
self.con.commit()

def flush(self):
""" Flush non config items from cache
"""
with Cache.SQLITE_WRITE_LOCK:
query = "DELETE FROM cache WHERE maxAge < ?"
self.con.execute(query, (sys.maxsize,))
self.con.commit()

def putPlayerName(self, name, status):
""" Putting a playername into the cache
"""
Expand Down Expand Up @@ -138,8 +168,8 @@ def getAvatar(self, name):
if len(founds) == 0:
return None
else:
# dats is buffer, we convert it back to str
data = from_blob(founds[0][0])
# data is buffer, we convert it back to str
data = from_blob(founds)
return data

def removeAvatar(self, name):
Expand All @@ -161,5 +191,3 @@ def recallAndApplySettings(self, responder, settingsIdentifier):
getattr(obj, setting[1])(setting[2])
except Exception as e:
logging.error(e)


Loading