~ubuntu-branches/debian/wheezy/playonlinux/wheezy

« back to all changes in this revision

Viewing changes to .pc/x-terminal-emulator.diff/python/options.py

  • Committer: Bazaar Package Importer
  • Author(s): Bertrand Marc
  • Date: 2011-09-17 11:14:44 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20110917111444-b02ft5g75aljjkrp
Tags: 4.0.12-1
* New upstream release (Closes: #639558).
* Remove patches/license.diff, not necessary any more.
* debian/rules: remove permission fixing.
* debian/rules: add build-arch and build-indep.
* Migrate to dh_python2.
* debian/patches: disable update alert on new release
  (Closes: #639463).

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from asyncore import dispatcher
22
22
import wxversion, os, getopt, sys, urllib, signal, socket, string
23
 
wxversion.select("2.8")
24
23
import wx, time
25
24
import webbrowser, shutil
26
25
import threading, time, codecs
76
75
class Onglets(wx.Notebook):
77
76
        # Classe dérivée du wx.Notebook
78
77
        def __init__(self, parent):
 
78
                if(os.environ["POL_OS"] == "Mac"):
 
79
                        self.fontTitle = wx.Font(14, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, "", wx.FONTENCODING_DEFAULT)
 
80
                        self.caption_font = wx.Font(11, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL,False, "", wx.FONTENCODING_DEFAULT)
 
81
                else :
 
82
                        self.fontTitle = wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, "", wx.FONTENCODING_DEFAULT)
 
83
                        self.caption_font = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL,False, "", wx.FONTENCODING_DEFAULT)
 
84
                
 
85
                
79
86
                self.notebook = wx.Notebook.__init__(self, parent, -1)
80
87
                self.images_onglets = wx.ImageList(16, 16)
81
88
                self.images_onglets.Add(wx.Bitmap(Variables.playonlinux_env+"/etc/onglet/input-gaming.png"));
342
349
                self.FileDialog.SetWildcard("POL Packages (*.pol)|*.pol")
343
350
                self.FileDialog.ShowModal()
344
351
                if(self.FileDialog.GetPath() != ""):
345
 
                        if(wx.YES == wx.MessageBox(_("Are you sure you want to install: ")+self.FileDialog.GetPath()+"?", style=wx.YES_NO | wx.ICON_QUESTION)):
 
352
                        if(wx.YES == wx.MessageBox(_("Are you sure you want to install: ").decode("utf-8")+self.FileDialog.GetPath()+"?", style=wx.YES_NO | wx.ICON_QUESTION)):
346
353
                                os.system("bash \""+Variables.playonlinux_env+"/playonlinux-pkg\" -i \""+self.FileDialog.GetPath().encode('utf-8')+"\"")
347
354
                                self.LoadPlugins()
348
355
                self.FileDialog.Destroy()
350
357
        def delete_plug(self, event):
351
358
                self.current_plugin = self.pluginlist.GetItemText(self.pluginlist.GetSelection())
352
359
                self.plugin_path = Variables.playonlinux_rep+"/plugins/"+self.current_plugin
353
 
                if(wx.YES == wx.MessageBox(_("Are you sure you want to delete: ")+self.current_plugin+"?", style=wx.YES_NO | wx.ICON_QUESTION)):
 
360
                if(wx.YES == wx.MessageBox(_("Are you sure you want to delete: ").decode("utf-8")+self.current_plugin+"?", style=wx.YES_NO | wx.ICON_QUESTION)):
354
361
                        shutil.rmtree(self.plugin_path)
355
362
                        self.LoadPlugins()
356
363
        def disable(self, event):
407
414
                        
408
415
 
409
416
class MainWindow(wx.Frame):
410
 
  def __init__(self,parent,id,title):
 
417
  def __init__(self,parent,id,title,onglet):
411
418
    wx.Frame.__init__(self, parent, -1, title, size = (505, 550), style = wx.CLOSE_BOX | wx.CAPTION | wx.MINIMIZE_BOX)
412
419
    self.SetIcon(wx.Icon(Variables.playonlinux_env+"/etc/playonlinux.png", wx.BITMAP_TYPE_ANY))
413
420
    self.panelFenp = wx.Panel(self, -1)
420
427
    self.sizer.Add(self.onglets, 10, wx.EXPAND|wx.ALL, 2)
421
428
    self.sizer.Add(self.panels_buttons, 1, wx.EXPAND|wx.ALL, 2)
422
429
 
423
 
    self.onglets.General(_("General"))
 
430
    #self.onglets.General(_("General"))
424
431
    self.onglets.Internet(_("Internet"))
425
 
    self.onglets.Wine(_("Environment"))
426
 
    self.onglets.System(_("System"))
 
432
    #self.onglets.Wine(_("Environment"))
 
433
    #self.onglets.System(_("System"))
427
434
    self.onglets.Plugins(_("Plugins"))
428
 
    if len(sys.argv) > 1:
429
 
        self.onglets.SetSelection(int(sys.argv[1]))
 
435
    try:
 
436
                self.onglets.SetSelection(onglet)
 
437
    except:
 
438
                pass
430
439
 
431
440
    self.panelFenp.SetSizer(self.sizer)
432
441
    self.panelFenp.SetAutoLayout(True)
434
443
    wx.EVT_BUTTON(self, wx.ID_CLOSE, self.app_Close)
435
444
 
436
445
  def app_Close(self, event):
437
 
    exit(0)
 
446
    self.Destroy()
438
447
 
439
448
  def apply_settings(self, event):
440
449
    #Navigateur
467
476
    self.env_chaine = "DESKTOP="+self.desk+"\nWINEVERSION="+self.onglets.WineVersion.GetValue()
468
477
    open(Variables.playonlinux_rep+"/configurations/options/env",'w').write(self.env_chaine)
469
478
    wx.MessageBox(_("You must restart PlayOnLinux for the changes to take effect."), "PlayOnLinux", wx.OK)
470
 
    sys.exit(0)
471
 
class PlayOnLinuxApp(wx.App):
472
 
   def OnInit(self):
473
 
        self.frame = MainWindow(None, -1, _("PlayOnLinux Settings"))
474
 
        self.SetTopWindow(self.frame)
475
 
        self.frame.Center(wx.BOTH)
476
 
        self.frame.Show(True)
477
 
        return True
478
 
 
479
 
 
480
 
lng.Lang()
481
 
app = PlayOnLinuxApp()
482
 
app.MainLoop()
483
 
 
484
 
sys.exit(0)
 
479
    self.Destroy()
 
480