Add About Dialog.

This commit is contained in:
iabdalkader 2015-09-25 23:53:08 +02:00
parent 2b9b69bf92
commit 29cbe8dc12
4 changed files with 68 additions and 1 deletions

BIN
usr/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -2,6 +2,65 @@
<interface>
<!-- interface-requires gtk+ 3.0 -->
<!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAboutDialog" id="about_dialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="destroy_with_parent">True</property>
<property name="type_hint">dialog</property>
<property name="program_name">OpenMV IDE v1.1</property>
<property name="copyright" translatable="yes">Copyright (c) 2014 Ibrahim Abdalkader &lt;i.abdalkader@gmail.com&gt;</property>
<property name="comments" translatable="yes">Machine vision with Python! </property>
<property name="website">https://openmv.io/</property>
<property name="website_label" translatable="yes">https://openmv.io/</property>
<property name="license" translatable="yes">The MIT License (MIT)
Copyright (c) 2014 Ibrahim Abdalkader &lt;i.abdalkader@gmail.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE</property>
<property name="authors">Ibrahim Abdalkader
Kwabena W. Agyeman</property>
<property name="logo">logo.png</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
<object class="GtkListStore" id="baud_liststore">
<columns>
<!-- column-name baudrate -->
@ -337,6 +396,7 @@
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_about_dialog" swapped="no"/>
</object>
</child>
</object>

View File

@ -164,6 +164,7 @@ class OMVGtk:
"on_new_file" : self.new_file,
"on_save_file" : self.save_file,
"on_save_file_as" : self.save_file_as,
"on_about_dialog" : self.about_dialog,
"on_save_template_activate" : self.save_template,
"on_save_descriptor_activate" : self.save_descriptor,
"on_ctrl_scale_value_changed" : self.on_ctrl_scale_value_changed,
@ -668,6 +669,11 @@ class OMVGtk:
self.file_path = os.path.join(basedir, widget.get_label())
self._load_file(self.file_path)
def about_dialog(self, widget):
dialog = self.builder.get_object("about_dialog")
dialog.run()
dialog.hide()
def text_changed(self, widget):
self.save_button.set_sensitive(True)

View File

@ -18,7 +18,8 @@ if sysname in ["Linux", "Darwin"]:
else:
exe_name ='openmv-ide.exe'
exe_tree = [('openmv-ide.glade', 'openmv-ide.glade', 'DATA')]
exe_tree = [('logo.png', 'logo.png', 'DATA'),
('openmv-ide.glade', 'openmv-ide.glade', 'DATA')]
exe = EXE(pyz,
a.scripts,