Commit dbabd9408d60bcd6aca319cf45f7aa4222c84db4

Authored by Silvan Calarco
1 parent 6a380bd20d
Exists in master

Use icons from theme and don't ask confirmation if the user refuses

Fixes icons after oxygen moved from kde to default system path.

Showing 1 changed file with 12 additions and 15 deletions Side-by-side Diff

... ... @@ -9,13 +9,13 @@
9 9 # Decisione presa in run-time
10 10 desktop_session = QtCore.QString(os.getenv('DESKTOP_SESSION')) # Codice preso da mambatray
11 11 if (desktop_session == 'default') or (desktop_session.left(3) == 'kde'): # Scelgo le icone di kde
12   - imgAccetto = "/opt/kde/share/icons/oxygen/32x32/actions/dialog-ok-apply.png"
13   - imgRifiuto = "/opt/kde/share/icons/oxygen/32x32/actions/dialog-close.png"
14   - imgForm = "/opt/kde/share/icons/oxygen/32x32/mimetypes/text-rtf.png"
  12 + imgAccetto = "dialog-ok-apply"
  13 + imgRifiuto = "dialog-close"
  14 + imgForm = "text-rtf"
15 15 else: # In alternativa quelle di gnome
16   - imgAccetto = "/usr/share/icons/gnome/32x32/emblems/emblem-default.png"
17   - imgRifiuto = "/usr/share/icons/gnome/32x32/actions/gtk-stop.png"
18   - imgForm = "/usr/share/icons/gnome/32x32/mimetypes/document.png"
  16 + imgAccetto = "emblem-default"
  17 + imgRifiuto = "gtk-stop"
  18 + imgForm = "document"
19 19  
20 20  
21 21 def usage():
22 22  
23 23  
24 24  
... ... @@ -67,24 +67,22 @@
67 67 QtGui.QWidget.__init__(self, parent)
68 68  
69 69 self.setWindowTitle(_("Licenze"))
70   - self.setWindowIcon(QtGui.QIcon(imgForm))
  70 + self.setWindowIcon(QtGui.QIcon.fromTheme(imgForm))
71 71 self.resize(500, 400)
72 72 center(self)
73 73 QtGui.QToolTip.setFont(QtGui.QFont('sans', 10))
74 74  
75   - btnAccetto = QtGui.QPushButton(QtGui.QIcon(imgAccetto), _("I agree"))
  75 + btnAccetto = QtGui.QPushButton(QtGui.QIcon.fromTheme(imgAccetto), _("I agree"))
76 76 btnAccetto.setToolTip(_("Click here if you want to accept the license"))
77 77 self.connect(btnAccetto, QtCore.SIGNAL('clicked()'), evtAccetto)
78 78  
79   - btnRifiuto = QtGui.QPushButton(QtGui.QIcon(imgRifiuto), _("I do not agree"))
  79 + btnRifiuto = QtGui.QPushButton(QtGui.QIcon.fromTheme(imgRifiuto), _("I do not agree"))
80 80 btnRifiuto.setToolTip(_("Click here if you do <b>not</b> want to accept the license"))
81 81 self.connect(btnRifiuto, QtCore.SIGNAL('clicked()'), evtRifiuto)
82 82  
83 83 licenza = QtGui.QTextEdit()
84 84 licenza.setReadOnly(True)
85 85 licenza.setPlainText(txt)
86   -
87   -
88 86  
89 87 grid = QtGui.QGridLayout()
90 88 grid.setSpacing(10)
... ... @@ -108,9 +106,9 @@
108 106  
109 107 def evtRifiuto():
110 108 #mostra un messaggio:
111   - msg = QtGui.QMessageBox.question(form, _("Message"), _("Are you sure to refuse?"), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No)
112   - if msg == QtGui.QMessageBox.Yes:
113   - sys.exit(1)
  109 + #msg = QtGui.QMessageBox.question(form, _("Message"), _("Are you sure to refuse?"), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No)
  110 + #if msg == QtGui.QMessageBox.Yes:
  111 + sys.exit(1)
114 112  
115 113  
116 114 #crea la finestra di dialogo