summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2007-08-08 00:29:43 +0200
committerGuillaume Seguin <guillaume@segu.in>2007-08-08 00:29:43 +0200
commit4fdf4986738e4b931bbe2257dbfdead005217279 (patch)
tree66e5175d90b1ca81e5e11c58bcf4fa71a74d796c
parentdceb283f7a24c855015eb172230561ced21e0ae6 (diff)
downloadgshaderedit-4fdf4986738e4b931bbe2257dbfdead005217279.tar.gz
gshaderedit-4fdf4986738e4b931bbe2257dbfdead005217279.tar.bz2
* Add shader loading capability
* Make application window bigger * Update French po
-rw-r--r--gshaderedit.glade91
-rwxr-xr-xgshaderedit.in12
-rw-r--r--po/fr.po18
3 files changed, 104 insertions, 17 deletions
diff --git a/gshaderedit.glade b/gshaderedit.glade
index ceff46e..187fd54 100644
--- a/gshaderedit.glade
+++ b/gshaderedit.glade
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.3.1 on Sat Jul 21 02:25:35 2007 by ixce@ed3n-m-->
+<!--Generated with glade3 3.3.3 on Wed Aug 8 00:28:52 2007 -->
<glade-interface>
<widget class="GtkWindow" id="mainWindow">
- <property name="width_request">500</property>
+ <property name="width_request">800</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="title">gShaderEdit</property>
<property name="resizable">False</property>
@@ -46,7 +46,7 @@
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<child>
<widget class="GtkTextView" id="editorView">
- <property name="height_request">150</property>
+ <property name="height_request">200</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -69,18 +69,87 @@ END</property>
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
- <widget class="GtkButton" id="openButton">
+ <widget class="GtkButton" id="openFileButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="label">gtk-open</property>
- <property name="use_stock">True</property>
<property name="response_id">0</property>
- <signal name="clicked" handler="open"/>
+ <signal name="clicked" handler="open_file"/>
+ <child>
+ <widget class="GtkHBox" id="openFileHBox">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkAlignment" id="openFileAlignment">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkImage" id="openFileImage">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-open</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="openFileLabel">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Load an image</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
</widget>
</child>
<child>
+ <widget class="GtkButton" id="openShaderButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="response_id">0</property>
+ <signal name="clicked" handler="open_shader"/>
+ <child>
+ <widget class="GtkHBox" id="openShaderHBox">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkAlignment" id="openShaderAlignment">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <child>
+ <widget class="GtkImage" id="openFileImage3">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-open</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="openShaderLabel">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="label" translatable="yes">Load a shader</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkButton" id="resetButton">
<property name="visible">True</property>
<property name="sensitive">False</property>
@@ -93,7 +162,7 @@ END</property>
<signal name="clicked" handler="reset"/>
</widget>
<packing>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -108,7 +177,7 @@ END</property>
<signal name="clicked" handler="apply"/>
</widget>
<packing>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -123,7 +192,7 @@ END</property>
<signal name="clicked" handler="save"/>
</widget>
<packing>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -144,7 +213,7 @@ END</property>
</widget>
<packing>
<property name="expand">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</widget>
diff --git a/gshaderedit.in b/gshaderedit.in
index c461366..d60c97c 100755
--- a/gshaderedit.in
+++ b/gshaderedit.in
@@ -142,7 +142,7 @@ class gShaderEdit ():
button = gtk.STOCK_SAVE
return self.file_dialog (_("Save as..."), action, button, filters)
- def open (self, *args):
+ def open_file (self, *args):
'''Open a file chooser to choose a custom image file and load it'''
filters = []
filter = gtk.FileFilter ()
@@ -157,6 +157,16 @@ class gShaderEdit ():
if file:
self.load_image (file)
+ def open_shader (self, *args):
+ '''Open a file chooser to choose a shader file and load it'''
+ file = self.open_dialog ()
+ if file:
+ f = open (file)
+ if not f:
+ return
+ source = f.read ()
+ self.editorBuffer.set_text (source)
+
def save (self, *args):
'''Open a file chooser to choose target file and save filter'''
file = self.save_dialog ()
diff --git a/po/fr.po b/po/fr.po
index d6309ef..2ec9ed3 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: gShaderEdit 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-08-06 23:17+0200\n"
+"POT-Creation-Date: 2007-08-08 00:23+0200\n"
"PO-Revision-Date: 2007-08-06 23:18+0200\n"
"Last-Translator: Guillaume Seguin <guillaume@segu.in>\n"
"Language-Team: None\n"
@@ -45,22 +45,30 @@ msgstr "L'extension GL_ARB_texture_rectangle n'est pas disponible, abandon"
msgid "File and surface can't both be None"
msgstr "Fichier et surface ne peuvent valoir tous les deux None"
-#: ../gshaderedit.in:100
+#: ../gshaderedit.in:102
msgid "Warning : Empty source"
msgstr "Attention : Source vide"
-#: ../gshaderedit.in:136
+#: ../gshaderedit.in:138
msgid "Open file..."
msgstr "Ouvrir un fichier..."
-#: ../gshaderedit.in:141
+#: ../gshaderedit.in:143
msgid "Save as..."
msgstr "Enregistrer sous..."
-#: ../gshaderedit.in:151
+#: ../gshaderedit.in:153
msgid "All files"
msgstr "Tous les fichiers"
#: ../gshaderedit.glade.h:1
msgid "Copyright © 2007 Guillaume Seguin"
msgstr "Copyright © 2007 Guillaume Seguin"
+
+#: ../gshaderedit.glade.h:2
+msgid "Load a shader"
+msgstr "Charger un shader"
+
+#: ../gshaderedit.glade.h:3
+msgid "Load an image"
+msgstr "Charger une image"