Commits

Marcin Kasperski committed 581fb10

zacząteczki

Comments (0)

Files changed (6)

 \.py[co]$
 ^src/mekk\.nozbe2xmind\.egg-info
 ^build/
-^dist/
-^binary_distribution/buildnozbe2xmind
+^dist/
+^binary_distribution/buildnozbe2xmind
+\.bak$

data/nozbe2xmind.glade

+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="main_window">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Nozbe2XMind</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+
+  <child>
+    <widget class="GtkVBox" id="vbox1">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child>
+	<widget class="GtkLabel" id="label1">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">label1</property>
+	  <property name="use_underline">False</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">0.5</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkLabel" id="label2">
+	  <property name="visible">True</property>
+	  <property name="label" translatable="yes">label2</property>
+	  <property name="use_underline">False</property>
+	  <property name="use_markup">False</property>
+	  <property name="justify">GTK_JUSTIFY_LEFT</property>
+	  <property name="wrap">False</property>
+	  <property name="selectable">False</property>
+	  <property name="xalign">0.5</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xpad">0</property>
+	  <property name="ypad">0</property>
+	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	  <property name="width_chars">-1</property>
+	  <property name="single_line_mode">False</property>
+	  <property name="angle">0</property>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkButton" id="button1">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="label" translatable="yes">OK</property>
+	  <property name="use_underline">True</property>
+	  <property name="relief">GTK_RELIEF_NORMAL</property>
+	  <property name="focus_on_click">True</property>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>

data/nozbe2xmind.gladep

+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
+
+<glade-project>
+  <name>Nozbe2XMind</name>
+  <program_name>nozbe2xmind</program_name>
+  <gnome_support>FALSE</gnome_support>
+</glade-project>

scripts/nozbe2xmindgui

+#!/usr/bin/python
+
+import mekk.nozbe2xmind.gui
+
+mekk.nozbe2xmind.gui.run()
       test_suite = 'nose.collector',
       zip_safe=False,
       install_requires=[
-          'lxml', 'Twisted', 'simplejson', 'mekk.xmind>=0.2.0',
+          'lxml', 'Twisted', 'simplejson',
+          'mekk.xmind>=0.3.0',
       ],
       #include_package_data = True,
       package_data = {

src/mekk/nozbe2xmind/gui.py

+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+"""
+Skrypcik prezentujący okienko
+"""
+
+from twisted.internet import gtk2reactor
+gtk2reactor.install()
+
+import pygtk
+import gtk, gtk.glade
+
+# Patrz /usr/share/doc/python-gtk2-tutorial/html/
+# Patrz przede wszystkim pygtk-demo
+
+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()
+
+
+class MainWindow(object):
+
+    def __init__(self):
+        self.gladefile = "../../../data/nozbe2xmind.glade"
+        self.wTree = gtk.glade.XML(self.gladefile)
+        self.window = self.wTree.get_widget("MainWindow")
+        if (self.window):
+            self.window.connect("destroy", gtk.main_quit)
+
+if __name__ == "__main__":
+    hwg = MainWindow()
+    gtk.main()