summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Gautier <starmad@pegase.localdomain>2009-03-25 23:35:49 +0100
committerMatthieu Gautier <starmad@pegase.localdomain>2009-03-25 23:35:49 +0100
commitb47c39a0fcf6501706d8e2fb5b8064a8b5fd3600 (patch)
treea0317c01e01af0240e32ad07237b10fc98b03d0c
parent1f857e7cf9fcd85811195365894d822efcf00c78 (diff)
downloadg-ed-it-b47c39a0fcf6501706d8e2fb5b8064a8b5fd3600.zip
g-ed-it-b47c39a0fcf6501706d8e2fb5b8064a8b5fd3600.tar.gz
g-ed-it-b47c39a0fcf6501706d8e2fb5b8064a8b5fd3600.tar.xz
Use a glade file created by glade.
Signed-off-by: Matthieu Gautier <starmad@pegase.localdomain>
-rw-r--r--g-ed-it/commit.glade148
-rw-r--r--g-ed-it/commitDialog.py8
-rw-r--r--g-ed-it/g-ed-it.glade93
-rw-r--r--g-ed-it/g_ed_it.py2
4 files changed, 101 insertions, 150 deletions
diff --git a/g-ed-it/commit.glade b/g-ed-it/commit.glade
deleted file mode 100644
index 8342062..0000000
--- a/g-ed-it/commit.glade
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkDialog" id="commit_dialog">
- <property name="width_request">667</property>
- <property name="visible">False</property>
- <property name="title" translatable="yes">Commit Message</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">True</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_DIALOG</property>
- <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
- <property name="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancel_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-7</property>
- <accelerator key="Escape" modifiers="0" signal="clicked"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="commit_button">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="response_id">-10</property>
- <accelerator key="Return" modifiers="0" signal="clicked"/>
- </widget>
- </child>
-
- </widget>
- <packing>
- <property name="padding">4</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="border_width">10</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
- <child>
- <widget class="GtkLabel" id="labelsearchfor">
- <property name="width_request">80</property>
- <property name="visible">True</property>
- <property name="label" translatable="yes">Commit message</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="GtkEntry" id="commit_text">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <!-- perhaps use GTK Label for explaining this uses Python re-->
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/g-ed-it/commitDialog.py b/g-ed-it/commitDialog.py
index a0bc052..61d4304 100644
--- a/g-ed-it/commitDialog.py
+++ b/g-ed-it/commitDialog.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*-
+import os
+
class CommitDialog (object):
def __init__(self,window,glade_xml):
@@ -22,12 +24,16 @@ class CommitDialog (object):
self.close_button.connect("clicked", self.on_cancel_button_clicked)
self.commit_text_box = self.glade_xml.get_widget("commit_text")
- self.commit_text_box.connect("changed", self.on_commit_text_changed)
+ self.commit_text_box.connect("insert-at-cursor", self.on_commit_text_changed)
def on_cancel_button_clicked(self, close_button):
self.commit_dialog.hide()
def on_commit_button_clicked(self, close_button):
+ commit_text_buffer = self.commit_text_box.get_buffer()
+ os.system("git-commit -s -m'"+commit_text_buffer.get_text(commit_text_buffer.get_start_iter(),commit_text_buffer.get_end_iter())+"'")
+ commit_text_buffer.set_text("")
+ self.commit_dialog.hide()
pass
def on_commit_text_changed(self, commit_text_entry):
diff --git a/g-ed-it/g-ed-it.glade b/g-ed-it/g-ed-it.glade
new file mode 100644
index 0000000..e550a5f
--- /dev/null
+++ b/g-ed-it/g-ed-it.glade
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--Generated with glade3 3.4.5 on Wed Mar 25 23:15:57 2009 -->
+<glade-interface>
+ <widget class="GtkDialog" id="commit_dialog">
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">Commit</property>
+ <property name="modal">True</property>
+ <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="skip_taskbar_hint">True</property>
+ <property name="skip_pager_hint">True</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <child>
+ <widget class="GtkTextView" id="commit_text">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Commit message :&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <child>
+ <widget class="GtkButton" id="cancel_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">Cancel</property>
+ <property name="response_id">0</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkButton" id="commit_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="label" translatable="yes">Commit</property>
+ <property name="response_id">0</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">GTK_PACK_END</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
diff --git a/g-ed-it/g_ed_it.py b/g-ed-it/g_ed_it.py
index 148743f..e5cd15e 100644
--- a/g-ed-it/g_ed_it.py
+++ b/g-ed-it/g_ed_it.py
@@ -11,7 +11,7 @@ import time
import menuManager
import commitDialog
-GLADE_FILE = os.path.join(os.path.dirname(__file__), "commit.glade")
+GLADE_FILE = os.path.join(os.path.dirname(__file__), "g-ed-it.glade")
class PluginHelper:
def __init__(self, plugin, window):