[gedit-latex/fixes-for-master] fix insert table / listings dialogs



commit 9573d6681e1d11579372ccf6e4a15a02143653b7
Author: John Stowers <john stowers gmail com>
Date:   Tue Jan 22 00:19:20 2013 +0100

    fix insert table / listings dialogs

 ...org.gnome.gedit.plugins.latex.gschema.xml.in.in |    7 +++++++
 data/ui/insert_listing_dialog.ui                   |   13 +++++--------
 latex/latex/dialogs.py                             |    9 +++++----
 3 files changed, 17 insertions(+), 12 deletions(-)
---
diff --git a/data/org.gnome.gedit.plugins.latex.gschema.xml.in.in b/data/org.gnome.gedit.plugins.latex.gschema.xml.in.in
index 780c783..a5f759b 100644
--- a/data/org.gnome.gedit.plugins.latex.gschema.xml.in.in
+++ b/data/org.gnome.gedit.plugins.latex.gschema.xml.in.in
@@ -84,5 +84,12 @@
       <default>'#2a66e1'</default>
     </key>
 
+    <key name="recent-listing-language" type="s">
+      <default>'Python'</default>
+    </key>
+    <key name="recent-bibtex-style" type="s">
+      <default>'plain'</default>
+    </key>
+
   </schema>
 </schemalist>
diff --git a/data/ui/insert_listing_dialog.ui b/data/ui/insert_listing_dialog.ui
index 2dc90be..1e07a41 100644
--- a/data/ui/insert_listing_dialog.ui
+++ b/data/ui/insert_listing_dialog.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkDialog" id="dialogListing">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
@@ -21,6 +21,7 @@
             <child>
               <object class="GtkButton" id="button2">
                 <property name="label">gtk-cancel</property>
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
@@ -36,6 +37,7 @@
             <child>
               <object class="GtkButton" id="button1">
                 <property name="label">gtk-ok</property>
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
@@ -67,6 +69,7 @@
             <child>
               <object class="GtkCheckButton" id="checkFile">
                 <property name="label" translatable="yes">Load From _File:</property>
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">False</property>
@@ -93,7 +96,7 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="top_attach">0</property>
-                <property name="width">1</property>
+                <property name="width">3</property>
                 <property name="height">1</property>
               </packing>
             </child>
@@ -157,12 +160,6 @@
                 <property name="height">1</property>
               </packing>
             </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
           </object>
           <packing>
             <property name="expand">False</property>
diff --git a/latex/latex/dialogs.py b/latex/latex/dialogs.py
index 479db8c..ab79e01 100644
--- a/latex/latex/dialogs.py
+++ b/latex/latex/dialogs.py
@@ -634,7 +634,7 @@ class UseBibliographyDialog(GladeInterface, PreviewRenderer):
             self._comboStyle.set_model(self._storeStyle)
 
             try:
-                recent = styles.index(Preferences().get("RecentBibtexStyle", "plain"))
+                recent = styles.index(Preferences().get("recent-bibtex-style"))
             except ValueError:
                 recent = 0
             self._comboStyle.set_active(recent)
@@ -947,6 +947,7 @@ class InsertListingDialog(GladeInterface):
 
             lstset = ""
             options = ""
+            extra = r',basicstyle=\small\ttfamily,breaklines=true,showtabs=false,showspaces=false,breakatwhitespace=true'
 
             language = self._storeLanguages[self._comboLanguage.get_active()][0]
             try:
@@ -956,9 +957,9 @@ class InsertListingDialog(GladeInterface):
 
             if self._dialectsEnabled and len(dialect):
                 # we need the lstset command
-                lstset = "\\lstset{language=[%s]%s}\n" % (dialect, language)
+                lstset = "\\lstset{language=[%s]%s%s}\n" % (dialect, language, extra)
             else:
-                options = "[language=%s]" % language
+                options = "[language=%s%s]" % (language, extra)
 
 
             if self._checkFile.get_active():
@@ -989,7 +990,7 @@ class InsertListingDialog(GladeInterface):
             parser = LanguagesParser()
             parser.parse(self._languages, Resources().get_data_file("listings.xml"))
 
-            recentLanguage = Preferences().get("RecentListingLanguage", "Java")
+            recentLanguage = Preferences().get("recent-listing-language")
 
             self._storeLanguages = Gtk.ListStore(str)
             recentLanguageIndex = 0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]