1. Marcin Kasperski
  2. mekk.nozbe2xmind

Commits

Marcin Kasperski  committed a35059d

chaotyczne poprawki

  • Participants
  • Parent commits df96882
  • Branches default

Comments (0)

Files changed (5)

File src/mekk/nozbe2xmind/gui/__init__.py

View file
 # Patrz przede wszystkim pygtk-demo
 
 
-# Pliki glade - edycja przy pomocy gazpacho
+# Pliki glade - edycja przy pomocy glade-3
 
 
 class MainWindow(object):
 
     def __init__(self):
-        self.gladefile = "../../../data/nozbe2xmind.glade"
+        self.gladefile = "nozbe2xmind.glade"
         self.wTree = gtk.glade.XML(self.gladefile)
         self.window = self.wTree.get_widget("MainWindow")
         if (self.window):
             self.window.connect("destroy", self.close)
+            self.window.show()
 
     def close(self, widget, data=None):
         reactor.stop()

File src/mekk/nozbe2xmind/gui/log_window.py

-# -*- coding: utf-8 -*-
-
-
-class LogWindow(gtk.Window):
-    def __init__(self, buffer, title):
-        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
-        self.set_title(title)
-        self.connect('destroy', self.close)
-        #
-        vbox = gtk.VBox(False, 0)
-        self.add(vbox)
-        #vbox.pack_start(self.item_factory.get_widget("<main>"), False, False, 0)        
-        sw = gtk.ScrolledWindow()
-        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
-        # Tekstowy panel
-        self.textview = gtk.TextView(buffer)
-        self.textview.set_editable(False)
-        self.textview.set_wrap_mode(gtk.WRAP_NONE)
-        self.textview.set_justification(gtk.JUSTIFY_LEFT)
-        #self.textview.set_border_window_size(gtk.TEXT_WINDOW_TOP, 15)
-        #self.textview.set_border_window_size(gtk.TEXT_WINDOW_BOTTOM, 15)
-        #self.textview.set_border_window_size(gtk.TEXT_WINDOW_RIGHT, 30)
-        #self.textview.set_border_window_size(gtk.TEXT_WINDOW_LEFT, 30)
-        vbox.pack_start(sw, True, True, 0)
-        sw.add(self.textview)
-        self.set_default_size(500, 500)
-        self.textview.grab_focus()        
-        # Przycisk kończący
-        #stop_button = gtk.Button('Stop')
-        #stop_button.connect('clicked', self.close)
-        #vbox.add(stop_button)
-        # Główne okno
-        self.show_all()
-    def close(self, widget, data=None):
-        reactor.stop()

File src/mekk/nozbe2xmind/gui/main.py

View file
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+from twisted.internet import gtk2reactor
+gtk2reactor.install()
+
+from twisted.internet import reactor
+
+import pygtk
+import gtk, gtk.glade
+
+from widgets import wTree
+
+class MainWindow(object):
+    def __init__(self):
+        self.win = wTree.get_widget("MainWindow")
+        wTree.signal_autoconnect(self)
+        self.win.show()
+
+def close_reactor(widget, data=None):
+    reactor.stop()
+
+if __name__ == "__main__":
+    apref = MainWindow()
+    apref.win.connect("destroy", close_reactor)
+    reactor.run()

File src/mekk/nozbe2xmind/gui/prefs.py

View file
 
 from widgets import wTree
 
+class AuthPrefsWindow(object):
+    def __init__(self):
+        self.dialog = wTree.get_widget("AuthPrefsWindow")
+        wTree.signal_autoconnect(self)
+        self.dialog.show()
+
 def close_reactor(widget, data=None):
     reactor.stop()
 
-
 if __name__ == "__main__":
-    dialog = wTree.get_widget("AuthPrefsWindow")
-    dialog.show()
-    dialog.connect("destroy", close_reactor)
+    apref = AuthPrefsWindow()
+    apref.dialog.connect("destroy", close_reactor)
     reactor.run()

File src/mekk/nozbe2xmind/gui/settings.glade

-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://gazpacho.sicem.biz/gazpacho-0.1.dtd">
-<glade-interface>
-    <widget class="GtkDialog" id="dialog1">
-        <property name="default_height">260</property>
-        <property name="default_width">320</property>
-        <property name="height_request">200</property>
-        <property name="title" context="yes" translatable="yes">Connection Settings</property>
-        <property name="type_hint">normal</property>
-        <property name="width_request">300</property>
-        <child internal-child="vbox">
-            <widget class="GtkVBox" id="dialog1-vbox">
-                <property name="border_width">2</property>
-                <property name="visible">True</property>
-                <child>
-                    <placeholder/>
-                    <packing>
-                        <property name="position">2</property>
-                    </packing>
-                </child>
-                <child internal-child="action_area">
-                    <widget class="GtkHButtonBox" id="dialog1-action_area">
-                        <property name="border_width">5</property>
-                        <property name="layout_style">end</property>
-                        <property name="spacing">6</property>
-                        <property name="visible">True</property>
-                        <child>
-                            <widget class="GtkButton" id="button2">
-                                <property name="is_focus">True</property>
-                                <property name="label">gtk-ok</property>
-                                <property name="use_stock">True</property>
-                                <property name="visible">True</property>
-                            </widget>
-                        </child>
-                        <child>
-                            <widget class="GtkButton" id="button1">
-                                <property name="label">gtk-cancel</property>
-                                <property name="use_stock">True</property>
-                                <property name="visible">True</property>
-                            </widget>
-                            <packing>
-                                <property name="position">1</property>
-                            </packing>
-                        </child>
-                    </widget>
-                    <packing>
-                        <property name="expand">False</property>
-                        <property name="pack_type">end</property>
-                    </packing>
-                </child>
-            </widget>
-        </child>
-    </widget>
-</glade-interface>