Commits

Arne Babenhauserheide  committed 3d87c40

First steps in adding the config widget: Widget has valid syntax.

  • Participants
  • Parent commits 99e6c43

Comments (0)

Files changed (1)

 from user import home
 
 # basic graphical stuff
-from PyQt4.QtGui import QWidget, QGridLayout, QCursor, QIcon, QLabel, QLineEdit, QPushButton, QKeySequence, QPolygon
+from PyQt4.QtGui import QWidget, QGridLayout, QVBoxLayout, QHBoxLayout, QCursor, QIcon, QLabel, QLineEdit, QPushButton, QKeySequence, QPolygon
 # basic definitions and datatypes
 from PyQt4.QtCore import Qt, QPointF, QPoint, SIGNAL, SLOT
 
 
 ### Window ###
 
+class ConfigWidget(QWidget):
+    """A widget for configuring pyRad."""
+    def __init__(self, parent=None):
+        QWidget.__init__(self, parent)
+        # first a layout
+        self.lay = QVBoxLayout()
+        self.setLayout(self.lay)
+        # now the config buttons, horizontally
+        self.config_layout = QHBoxLayout()
+        self.config_keyboard = QPushButton("Keyboard")
+        self.config_gestures = QPushButton("Gestures")
+        self.config_layout.addWidget(self.config_keyboard)
+        self.config_layout.addWidget(self.config_gestures)
+        self.lay.addWidget(self.config_layout)
+        # now a flattr line
+        self.flattr_html = QWebView()
+        # I use the flattr button from Wikimedia commons to avoid data retention hassles. TODO: ship our own flattr button to avoid the web access. 
+        self.flattr_html.setHtml("""<html><head><title>flattr me</title></head><body><table><tr><td>If you <br />
+        like pyRad</td><td><a href="http://flattr.com/thing/58752/pyRad-a-wheel-type-command-interface-for-KDE" target="_blank">
+<img src="http://upload.wikimedia.org/wikipedia/commons/4/49/Flattr_Button.png" alt="Flattr this" title="Flattr this" border="0" /></a></td><td>Why don’t you <br />
+flattr me? :)</td></tr>
+<tr><td colspan=3><a href="http://draketo.de/light/english/pyrad">http://draketo.de/light/english/pyrad</a></td></tr></table></body></html>""")
+        self.lay.addWidget(self.flattr_html)
+        
+
 class ItemEditWidget(QWidget):
     def __init__(self, parent=None, icon="konqueror", action=None):
         QWidget.__init__(self, parent)