Commit 51d8ae62 authored by sumpfralle's avatar sumpfralle

added an "about" dialog


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@182 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent dfdef1e7
......@@ -314,6 +314,14 @@ class ProjectGui:
self.settings_window = self.gui.get_object("GeneralSettingsWindow")
self.settings_window.connect("delete-event", self.toggle_settings_window, False)
self._settings_window_position = None
# "about" window
self.about_window = self.gui.get_object("AboutWindow")
self.gui.get_object("About").connect("activate", self.toggle_about_window, True)
# we assume, that the last child of the window is the "close" button
# TODO: fix this ugly hack!
self.gui.get_object("AboutWindowButtons").get_children()[-1].connect("clicked", self.toggle_about_window, False)
self.about_window.connect("delete-event", self.toggle_about_window, False)
# set defaults
self.model = None
self.toolpath = GuiCommon.ToolPathList()
self.physics = None
......@@ -550,6 +558,18 @@ class ProjectGui:
# "material allowance" requires ODE support
self.gui.get_object("MaterialAllowanceControl").set_sensitive(self.settings.get("enable_ode"))
@gui_activity_guard
def toggle_about_window(self, widget=None, event=None, state=None):
if state is None:
# the "delete-event" issues the additional "event" argument
state = event
if state:
self.about_window.show()
else:
self.about_window.hide()
# don't close the window - just hide it
return True
@gui_activity_guard
def toggle_settings_window(self, widget=None, event=None, state=None):
if state is None:
......
......@@ -18,6 +18,8 @@
</menu>
<menu action="WindowMenu">
<menuitem action="Toggle3DView"/>
<separator />
<menuitem action="About"/>
</menu>
</menubar>
</ui>
......
......@@ -2416,7 +2416,7 @@
<property name="stock_id">gtk-save</property>
</object>
<object class="GtkAction" id="WindowMenu">
<property name="label">Window</property>
<property name="label">Windows</property>
</object>
<object class="GtkToggleAction" id="Toggle3DView">
<property name="label">3D View Window</property>
......@@ -2660,4 +2660,51 @@
<action-widget response="0">CloseSettingsWindow</action-widget>
</action-widgets>
</object>
<object class="GtkAboutDialog" id="AboutWindow">
<property name="border_width">5</property>
<property name="title" translatable="yes">About PyCAM</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">normal</property>
<property name="gravity">center</property>
<property name="has_separator">False</property>
<property name="program_name">PyCAM</property>
<property name="version">0.2</property>
<property name="copyright" translatable="yes">Copyright &#xA9; 2008-2010 Lode Leroy
Copyright &#xA9; 2010 Lars Kruse</property>
<property name="comments" translatable="yes">Toolpath Generation for 3-Axis CNC machining</property>
<property name="website">http://sourceforge.net/projects/pycam/</property>
<property name="website_label" translatable="yes">Webseite des PyCAM-Projekts</property>
<property name="license" translatable="yes">This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
PyCAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</property>
<property name="wrap_license">True</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
<placeholder/>
</child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="AboutWindowButtons">
<property name="visible">True</property>
<property name="layout_style">end</property>
</object>
<packing>
<property name="expand">False</property>
<property name="pack_type">end</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkAction" id="About">
<property name="label">About</property>
<property name="stock_id">gtk-about</property>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment