Anonymous avatar Anonymous committed 7391bc8

Config: Flattr is shown, but not yet nice.

Comments (0)

Files changed (1)

 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
+from PyQt4.QtWebKit import QWebView
 
 # Basics for KDE integration
 from PyKDE4.kdeui import KIconLoader, KAction, KActionCollection, KShortcut, KShapeGesture
         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)
+        self.lay.addLayout(self.config_layout)
         # now a flattr line
+        self.flattr_layout = QHBoxLayout()
+        self.flattr_left = QLabel("""If you like
+pyRad""")
+        self.flattr_right = QLabel("""Why don’t you
+Flattr me? :)""")
         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">
+        self.flattr_html.setHtml("""<html><head><title>flattr me</title></head><body><table><tr><td style="text-align: right">If you like<br />
+        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 ConfigEditor(KDialog):
+    """edit the base config"""
+    def __init__(self, parent=None):
+        QWidget.__init__(self, parent)
+        # Add the ConfigWidget
+        self.main = ConfigWidget(self)
+        self.setMainWidget(self.main)
+        
+    def config(self):
+        """Show and raise the config dialog."""
+        self.show()
+        self.raise_()
+        self.activateWindow()
+        # run it, but don’t do anything with the result. 
+        if self.exec_() == self.Accepted:
+            return
         
 
 class ItemEditWidget(QWidget):
 
         # Also we need an editor for the items. Call it with self.editor.exec(item).
         self.editor = ItemEditor(self)
+        # and a config editor
+        self.editor_config = ConfigEditor(self)
 
 
     def focusOutEvent(self, event):
 		elif event.button() == Qt.RightButton and i == self.circle[0]:
 		    # TODO: right-click on the middle item should show the options. 
 		    # currently we just don't edit it. 
-                    break
+                    self.editor_config.config()
 		elif event.button() == Qt.MidButton:
                     self.addLabelAfter(i)
                     break
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.