Skip to content
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
749566a
Made a more sophisticated game list. It has a root node titled Your g…
Jul 11, 2014
a75e653
Small change. System colours are now used instead of RGB values for t…
Jul 12, 2014
34cb20d
Another small change. Changed the install widget. It now uses system …
Jul 12, 2014
1d1e355
Another small change. Changed the Install a non-listed application wi…
Jul 12, 2014
2804af5
Create README.md
Jul 13, 2014
2d7dd17
Merge remote-tracking branch 'upstream/master'
Jul 14, 2014
60e5dbe
Merge branch 'master' of https://github.com/tfks/POL-POM-4
Jul 14, 2014
f8972a3
Update README.md
Jul 17, 2014
5143af6
Merge remote-tracking branch 'upstream/master'
Jul 21, 2014
abba92e
Merge branch 'master' of https://github.com/tfks/POL-POM-4
Jul 21, 2014
8be7d1e
Forgot the background colour of the new app install wizard - install …
Jul 21, 2014
0ad183a
Ditched the irc include. Don't need it. TFKs
Jul 21, 2014
ef0c0c5
Started with the settings dialog page that stores the shelve names. S…
Jul 22, 2014
b1276db
Made the toolbar a bit more intelligent. Buttons are disabled when th…
Jul 23, 2014
07e5ebc
Created a centralized method in lib/playonlinux.py to create menu ite…
Jul 24, 2014
4d11eed
Adding some files. tfks
Jul 25, 2014
5a0953a
Removing those darn .direcory names. Really have to add this one to g…
Jul 25, 2014
ec2e2d9
Removing those darn .direcory names. Really have to add this one to g…
Jul 25, 2014
4dd46a5
Synched with last release. T.
Sep 11, 2014
5b5fd2a
Separate readme for the changes in this fork. T.
Sep 11, 2014
1bb04b2
Separate readme for the changes in this fork. T.
Sep 11, 2014
2ddb131
Backup file deleted. T.
Sep 11, 2014
b745c26
Basic version with only system colour feature. T.
May 16, 2015
d67616f
Basic version with only system colour feature. T.
May 16, 2015
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
33 changes: 33 additions & 0 deletions README_THISFORK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
POL-POM-4
=========

PlayOnLinux 4 repository

I've fixed a few glitches I wanted to correct for myself.
I've decided to create a fork of the main project to share my changes in good open source tradition.

I am keeping track of the changes in the main repository so any release updates are going to be merged into this one.

The changes so far:

1. The colours used in the interface are now read from the system. This means that dark themes display the various elements in the widgets in the colour of those themes. This makes sure that all elements are readable under all conditions.

2. The game list became somewhat long. I noticed that this list is a TreeView control with just one level and a hidden root. I made this TreeView control two-level and added a root with the text "Your games" in a nice big font size.


How to enable two levels in the TreeView control
The two level system is an open one. It's not based on wine-prefixes but on naming. This way you decide how you want to have your list defined. To define your list do the following:

1. Make sure that there is one game in your list which will be the root item. For instance "Steam".
2. Name all games you want to place under this root item as [Root-Item-Name] - [Name-Of-Your-Game]. For instance "Steam - Crysis"

The list will automatically rearange.


TODO:

1. Some more refining where I run into them.

2. A shelving system is in the making. This is a further development of the TreeView system mentioned above. It allowes the user to define labels (or shelves) in the Options widget and select one of them in a game's Configuration widget. This way the user is free to have entries with hyphens in the gamelist. This is for 80% done.

TFK
Binary file added etc/onglet/folder-saved-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions python/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ def General(self, nom):
self.configurator_title.SetFont(self.fontTitle)
self.configurator_button = wx.Button(self.panelGeneral, 106, _("Run configuration wizard"), pos=(15,324))

self.lnGeneral = wx.StaticLine(self.panelGeneral, wx.ID_ANY, (200, 10), size=wx.DefaultSize, style=wx.LI_HORIZONTAL)
self.lnGeneral.SetSize((self.panelGeneral.GetSize().GetWidth()-20, 1))
self.lnGeneral.SetForegroundColour(playonlinux.get_foreground_colour())

shelves = []
shelves.append("")
shelves.extend(playonlinux.Get_Shelves())

self.AddGeneralElement(_("Shelve"), "shelve", shelves, shelves, 7)

wx.EVT_TEXT(self, 202, self.setname)
wx.EVT_TEXT(self, 206, self.setargs)
Expand Down
18 changes: 8 additions & 10 deletions python/guiv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ def make_gui(self):
# GUI elements
self.panel = wx.Panel(self, -1, pos=(0,0), size=((520, 398+Variables.windows_add_size)))
self.header = wx.Panel(self.panel, -1, style=Variables.widget_borders, size=(522,65))
self.header.SetBackgroundColour((255,255,255))
self.header.SetBackgroundColour(playonlinux.get_background_colour())
self.footer = wx.Panel(self.panel, -1, size=(522,45), pos=(-1,358), style=Variables.widget_borders)

# Panels
self.MainPanel = wx.Panel(self.panel, -1, pos=(150,0), size=(370,356))
self.MainPanel.SetBackgroundColour((255,255,255))
self.MainPanel.SetBackgroundColour(playonlinux.get_background_colour())


# Images
Expand All @@ -116,19 +116,19 @@ def make_gui(self):
# Text
self.titre_header = wx.StaticText(self.header, -1, _('{0} Wizard').format(os.environ["APPLICATION_TITLE"]),pos=(5,5), size=(340,356),style=wx.ST_NO_AUTORESIZE)
self.titre_header.SetFont(self.fontTitre)
self.titre_header.SetForegroundColour((0,0,0)) # For dark themes
self.titre_header.SetForegroundColour(playonlinux.get_foreground_colour()) # For dark themes

self.texte = wx.StaticText(self.panel, -1, "",pos=(20,80),size=(480,275),style=wx.ST_NO_AUTORESIZE)
self.texte_bis = wx.StaticText(self.panel, -1, "",size=(480,30),style=wx.ST_NO_AUTORESIZE)
self.titre = wx.StaticText(self.header, -1, "",pos=(20,30), size=(340,356),style=wx.ST_NO_AUTORESIZE)
self.titre.SetForegroundColour((0,0,0)) # For dark themes
self.titre.SetForegroundColour(playonlinux.get_foreground_colour()) # For dark themes

self.texteP = wx.StaticText(self.MainPanel, -1, "",pos=(5,50))
self.texteP.SetForegroundColour((0,0,0)) # For dark themes
self.texteP.SetForegroundColour(playonlinux.get_foreground_colour()) # For dark themes

self.titreP = wx.StaticText(self.MainPanel, -1,"",pos=(5,5), size=(340,356))
self.titreP.SetFont(self.fontTitre)
self.titreP.SetForegroundColour((0,0,0)) # For dark themes
self.titreP.SetForegroundColour(playonlinux.get_foreground_colour()) # For dark themes

self.txtEstimation = wx.StaticText(self.panel, -1, "",size=(480,30),style=wx.ST_NO_AUTORESIZE)
self.register_link = ""
Expand Down Expand Up @@ -180,13 +180,11 @@ def make_gui(self):
self.PCheckBox = wx.CheckBox(self.panel, 304, _("Show virtual drives"), pos=(20,325))
self.Menu = wx.ListBox(self.panel, 104, pos=(25,105),size=(460,220), style=Variables.widget_borders)
self.scrolled_panel = wx.ScrolledWindow(self.panel, -1, pos=(20,100), size=(460,220), style=Variables.widget_borders|wx.HSCROLL|wx.VSCROLL)
self.scrolled_panel.SetBackgroundColour((255,255,255))
self.scrolled_panel.SetBackgroundColour(playonlinux.get_background_colour())
self.texte_panel = wx.StaticText(self.scrolled_panel, -1, "",pos=(5,5))

self.gauge = wx.Gauge(self.panel, -1, 50, size=(375, 20))
self.WaitButton = wx.Button(self.panel, 310, "", size=(250,25))



self.animation = wx.StaticBitmap(self.panel, -1, self.GetLoaderFromAngle(1), (228,170))
self.current_angle = 1
Expand All @@ -203,7 +201,7 @@ def make_gui(self):
self.loginbox = wx.TextCtrl(self.panel, -1, "",size=(250,22),pos=(200,115))
self.passbox = wx.TextCtrl(self.panel, -1, "",size=(250,22),pos=(200,145), style=wx.TE_PASSWORD)
self.register = wx.HyperlinkCtrl(self.panel, 303, _("Register"), "", pos=(20,180))
self.register.SetNormalColour(wx.Colour(0,0,0))
self.register.SetNormalColour(playonlinux.get_foreground_colour())

# Fixed Events
wx.EVT_BUTTON(self, wx.ID_YES, self.release_yes)
Expand Down
10 changes: 5 additions & 5 deletions python/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ def addCat(self, name, icon, iid):

#self.cats_icons[name].Bind(wx.EVT_LEFT_DOWN, 2000+iid, self.AddApps)

self.cats_links[name].SetColours(wx.Colour(0,0,0), wx.Colour(0,0,0), wx.Colour(0,0,0))
self.cats_links[name].SetColours(playonlinux.get_foreground_colour(),playonlinux.get_foreground_colour(),playonlinux.get_foreground_hover_colour())
self.cats_links[name].AutoBrowse(False)
self.cats_links[name].UpdateLink(True)
self.cats_links[name].SetUnderlines(False, False, False)

self.cats_links[name].SetFont(self.fontText)
self.cats_links[name].SetBackgroundColour((255,255,255))
self.cats_links[name].SetBackgroundColour(playonlinux.get_background_colour())

def __init__(self,parent,id,title):
wx.Frame.__init__(self, parent, -1, title, size = (800, 550+Variables.windows_add_size), style = wx.CLOSE_BOX | wx.CAPTION | wx.MINIMIZE_BOX)
Expand All @@ -202,7 +202,7 @@ def __init__(self,parent,id,title):

# Categories
self.panelButton = wx.Panel(self.panelFenp, -1, size=(802,69), pos=(-1,-1),style=Variables.widget_borders)
self.panelButton.SetBackgroundColour((255,255,255))
self.panelButton.SetBackgroundColour(playonlinux.get_background_colour())

if(os.environ["POL_OS"] == "Mac"):
self.fontText = wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL,False, "", wx.FONTENCODING_DEFAULT)
Expand Down Expand Up @@ -299,14 +299,14 @@ def __init__(self,parent,id,title):
self.install_button.Enable(False)

self.new_panel = wx.Panel(self.panelItems, -1, pos=(740-160,113-71), style=Variables.widget_borders, size=self.new_size)
self.new_panel.SetBackgroundColour((255,255,255))
self.new_panel.SetBackgroundColour(playonlinux.get_background_colour())
self.animation = wx.animate.GIFAnimationCtrl(self.new_panel, -1, Variables.playonlinux_env+"/resources/images/install/wait_mini.gif", (90,100))
self.animation.Hide()
self.new_panel.Hide()


self.manualInstall = wx.lib.hyperlink.HyperLinkCtrl(self.panelFenp, 111, _("Install a non-listed program"), pos=(10,515))
self.manualInstall.SetColours(wx.Colour(0,0,0),wx.Colour(0,0,0),wx.Colour(0,0,0))
self.manualInstall.SetColours(playonlinux.get_foreground_colour(),playonlinux.get_foreground_colour(),playonlinux.get_foreground_hover_colour())
self.manualInstall.AutoBrowse(False)
self.manualInstall.UpdateLink(True)

Expand Down
95 changes: 66 additions & 29 deletions python/lib/playonlinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
import Variables, os, string
import subprocess, shlex, pipes, wx

def get_foreground_colour():
return wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNTEXT )

def get_foreground_hover_colour():
return wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DHILIGHT )

def get_background_colour():
return wx.SystemSettings.GetColour( wx.SYS_COLOUR_BACKGROUND )

def get_background_test_colour():
return wx.Colour(90,90,222)

def winpath(script, path):
#path=os.path.realpath(path)
if(path[0] != "/"):
Expand Down Expand Up @@ -56,6 +68,8 @@ def GetSettings(setting, prefix='_POL_'):
cfile = Variables.playonlinux_rep+"/playonlinux.cfg"
elif(prefix == "_EXT_"):
cfile = Variables.playonlinux_rep+"/extensions.cfg"
elif(prefix == "_SHV_"):
cfile = Variables.playonlinux_rep+"/shelves.cfg"
else:
cfile = Variables.playonlinux_rep+"/wineprefix/"+prefix+"/playonlinux.cfg"

Expand Down Expand Up @@ -84,6 +98,8 @@ def SetSettings(setting, value, prefix='_POL_'):
cfile = Variables.playonlinux_rep+"/playonlinux.cfg"
elif(prefix == "_EXT_"):
cfile = Variables.playonlinux_rep+"/extensions.cfg"
elif(prefix == "_SHV_"):
cfile = Variables.playonlinux_rep+"/shelves.cfg"
else:
cfile = Variables.playonlinux_rep+"/wineprefix/"+prefix+"/playonlinux.cfg"

Expand All @@ -92,35 +108,42 @@ def SetSettings(setting, value, prefix='_POL_'):
except:
pass
else:
i = 0
line = []
found = False
while(i < len(fichier)):
fichier[i] = fichier[i].replace("\n","")
if(setting+"=" in fichier[i]):
line.append(setting+"="+value)
found = True
else:
line.append(fichier[i])
i += 1
if(found == False):
line.append(setting+"="+value)

try:
fichier_write = open(cfile,"w")
except IOError:
pass
else:
i = 0
while(i < len(line)): # On ecrit
fichier_write.write(line[i]+"\n")
i+=1
if(prefix == "_SHV_"):
fichier = open(cfile,"w")
fichier.write(value)
fichier.close()
else:
i = 0
line = []
found = False
while(i < len(fichier)):
fichier[i] = fichier[i].replace("\n","")
if(setting+"=" in fichier[i]):
line.append(setting+"="+value)
found = True
else:
line.append(fichier[i])
i += 1
if(found == False):
line.append(setting+"="+value)

try:
fichier_write = open(cfile,"w")
except IOError:
pass
else:
i = 0
while(i < len(line)): # On ecrit
fichier_write.write(line[i]+"\n")
i+=1

def DeleteSettings(setting, prefix='_POL_'):
if(prefix == "_POL_"):
cfile = Variables.playonlinux_rep+"/playonlinux.cfg"
elif(prefix == "_EXT_"):
cfile = Variables.playonlinux_rep+"/extensions.cfg"
elif(prefix == "_SHV_"):
cfile = Variables.playonlinux_rep+"/shelves.cfg"
else:
cfile = Variables.playonlinux_rep+"/wineprefix/"+prefix+"/playonlinux.cfg"

Expand All @@ -129,17 +152,17 @@ def DeleteSettings(setting, prefix='_POL_'):
line = []
found = False
while(i < len(fichier)):
fichier[i] = fichier[i].replace("\n","")
if(setting+"=" not in fichier[i]):
line.append(fichier[i])
i += 1
fichier[i] = fichier[i].replace("\n","")
if(setting+"=" not in fichier[i]):
line.append(fichier[i])
i += 1

fichier_write = open(cfile,"w")

i = 0
while(i < len(line)): # On ecrit
fichier_write.write(line[i]+"\n")
i+=1
fichier_write.write(line[i]+"\n")
i+=1


def getLog(game):
Expand Down Expand Up @@ -393,6 +416,8 @@ def Get_Drives():
pref.sort()
return pref

def Get_Shelves():
return open(os.environ["POL_USER_ROOT"]+"/shelves.cfg").readlines()

def SetWinePrefix(game, prefix):
cfile = Variables.playonlinux_rep+"shortcuts/"+game
Expand Down Expand Up @@ -452,3 +477,15 @@ def POL_Open(arg):

def POL_Error(message):
wx.MessageBox(message,_("{0} error").format(os.environ["APPLICATION_TITLE"]))

def SetMenuBitmap(menuitem, path):
if(os.path.exists(path)):
bitmap = wx.Bitmap(path)
menuitem.SetBitmap(bitmap)

def AddMenuItem(parent, menuId, label, pathtobitmap):
newMenuItem = wx.MenuItem(parent, menuId, label)
if(os.path.exists(pathtobitmap)):
SetMenuBitmap(newMenuItem, pathtobitmap)
parent.AppendItem(newMenuItem)
return newMenuItem
4 changes: 2 additions & 2 deletions python/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ def generate_menu(self, shortcut=None):

def menuGaucheAddTitle(self,id,text,pos):
self.menuElem[id] = wx.StaticText(self.menu_gauche, -1, text,pos=(5,5+pos*20))
self.menuElem[id].SetForegroundColour((0,0,0)) # For dark themes
self.menuElem[id].SetForegroundColour(playonlinux.get_foreground_colour()) # For dark themes
self.menuElem[id].SetFont(self.fontTitre)


Expand All @@ -852,7 +852,7 @@ def menuGaucheAddLink(self,id,text,pos,image,evt,url=None):
self.menuElem[id] = wx.lib.hyperlink.HyperLinkCtrl(self.menu_gauche, 10000+pos, text, pos=(35,15+pos*20))
self.menuElem[id].setURL(url)

self.menuElem[id].SetColours(wx.Colour(0,0,0),wx.Colour(0,0,0),wx.Colour(0,0,0))
self.menuElem[id].SetColours(playonlinux.get_foreground_colour(),playonlinux.get_foreground_colour(),playonlinux.get_foreground_hover_colour())
self.menuElem[id].UpdateLink(True)
#self.menuElem[id].SetVisited(False)
#self.menuElem[id].SetNormalColour(wx.Colour(0,0,0))
Expand Down
Binary file added resources/images/menu/emblem-favorite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/menu/internet-news-reader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/menu/media-optical.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/menu/software-update-available.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/menu/text-x-script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/menu/x-office-address-book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.