Commits

Anonymous committed 2dd4b2b

Further work on implementing edit functionality. Now a default KDialog gets shown on rightclick of an icon.

  • Participants
  • Parent commits 1952980

Comments (0)

Files changed (2)

 # and exiting. 
 from sys import exit as exit_
 
-
 ### Self Test == Run the Program ###
 
 if __name__ == "__main__":
     # And get and show the GUI
     rad = Rad()
     rad.show()
+    #print kb.questionYesNoWld(rad, "b.ah", "blubb")
     # Finally we execute the program - and exit the script with the exit code from the program. 
     exit_(app.exec_())
 ### Imports ### 
 
 # basic graphical stuff
-from PyQt4.QtGui import QWidget, QDialog, QCursor, QIcon, QLabel, QVBoxLayout
+from PyQt4.QtGui import QWidget, QCursor, QIcon, QLabel
 # basic definitions and datatypes
 from PyQt4.QtCore import Qt, QPointF
 # Basics for KDE integration
 from PyKDE4.kdecore import ki18n, KAboutData
 from PyKDE4.kdeui import KIconLoader
+# And a basic dialog class for the edit item dialog.
+from PyKDE4.kdeui import KDialog
 # For circles
 from math import sin, cos, pi
 # And for starting programs
 ### Window ###
 
 # First we need a message box for editing the entries
-class ItemEditor(QDialog):
+class ItemEditor(KDialog):
     def __init__(self, parent=None):
-        QDialog.__init__(self, parent)
+        KDialog.__init__(self, parent)
         # First add a layout
-        vlay = QVBoxLayout()
-        self.setLayout(vlay)
         # Now add widgets
-        
-        
-        
+                
 
     def edit(self, item):
         """Edit an item - includes deleting it by returning None."""
-        # Be the only window which accepts input
+        # Show the dialog.
         self.show()
         self.raise_()
         self.activateWindow()
+        # And run it.
         return_code = self.exec_()
+        # TODO: Add user entries
+        return return_code