[meld] Add gsetting and initial UI for merge file order preference
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Add gsetting and initial UI for merge file order preference
- Date: Wed, 23 Apr 2014 21:05:50 +0000 (UTC)
commit 1a3cbe3c7c815914c882ed9a1a5ad034115ba1ce
Author: Kai Willadsen <kai willadsen gmail com>
Date: Thu Apr 24 06:26:27 2014 +1000
Add gsetting and initial UI for merge file order preference
data/org.gnome.meld.gschema.xml | 10 ++++++++++
data/ui/preferences.ui | 38 ++++++++++++++++++++++++++++++++++++++
meld/preferences.py | 12 +++++++++++-
meld/vcview.py | 3 +++
4 files changed, 62 insertions(+), 1 deletions(-)
---
diff --git a/data/org.gnome.meld.gschema.xml b/data/org.gnome.meld.gschema.xml
index d202595..86144d7 100644
--- a/data/org.gnome.meld.gschema.xml
+++ b/data/org.gnome.meld.gschema.xml
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
+ <enum id="org.gnome.meld.mergefileorder">
+ <value nick="local-merge-remote" value="0"/>
+ <value nick="remote-merge-local" value="1"/>
+ </enum>
+
<enum id="org.gnome.meld.wrapmode">
<value nick="none" value="0"/>
<value nick="char" value="1"/>
@@ -163,6 +168,11 @@
<summary>Present version comparisons as left-local/right-remote</summary>
<description>If true, version control comparisons will use a left-is-local, right-is-remote scheme
to determine what order to present files in panes. Otherwise, a left-is-theirs, right-is-mine scheme is
used.</description>
</key>
+ <key name="vc-merge-file-order" enum="org.gnome.meld.mergefileorder">
+ <default>"remote-merge-local"</default>
+ <summary>Order for files in three-way version control merge comparisons</summary>
+ <description>Choices for file order are remote/merge/local and local/merged/remote. This
preference only affects three-way comparisons launched from the version control view, so is used solely for
merges/conflict resolution within Meld.</description>
+ </key>
<key name="vc-show-commit-margin" type="b">
<default>true</default>
<summary>Show margin in commit message editor</summary>
diff --git a/data/ui/preferences.ui b/data/ui/preferences.ui
index d8fe83b..e0a5464 100644
--- a/data/ui/preferences.ui
+++ b/data/ui/preferences.ui
@@ -33,6 +33,24 @@
</row>
</data>
</object>
+ <object class="GtkListStore" id="mergeorderstore">
+ <columns>
+ <!-- column-name id -->
+ <column type="gchararray"/>
+ <!-- column-name label -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0">local-merge-remote</col>
+ <col id="1" translatable="yes">Remote/Merge/Local</col>
+ </row>
+ <row>
+ <col id="0">remote-merge-local</col>
+ <col id="1" translatable="yes">Local/Merge/Remote</col>
+ </row>
+ </data>
+ </object>
<object class="GtkListStore" id="timestampstore">
<columns>
<!-- column-name value -->
@@ -978,6 +996,26 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GSettingsStringComboBox" id="combo_merge_order">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">mergeorderstore</property>
+ <property name="active">0</property>
+ <property name="gsettings-column">0</property>
+ <child>
+ <object class="GtkCellRendererText" id="merge_order_renderer"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/meld/preferences.py b/meld/preferences.py
index 9866d6e..1ed5d00 100644
--- a/meld/preferences.py
+++ b/meld/preferences.py
@@ -158,12 +158,21 @@ class GSettingsBoolComboBox(GSettingsComboBox):
gsettings_value = GObject.property(type=bool, default=False)
+class GSettingsStringComboBox(GSettingsComboBox):
+
+ __gtype_name__ = "GSettingsStringComboBox"
+
+ gsettings_column = GObject.property(type=int, default=0)
+ gsettings_value = GObject.property(type=str, default="")
+
+
class PreferencesDialog(Component):
def __init__(self, parent):
Component.__init__(self, "preferences.ui", "preferencesdialog",
["adjustment1", "adjustment2", "fileorderstore",
- "sizegroup_editor", "timestampstore"])
+ "sizegroup_editor", "timestampstore",
+ "mergeorderstore"])
self.widget.set_transient_for(parent)
bindings = [
@@ -220,6 +229,7 @@ class PreferencesDialog(Component):
self.combo_timestamp.bind_to('folder-time-resolution')
self.combo_file_order.bind_to('vc-left-is-local')
+ self.combo_merge_order.bind_to('vc-merge-file-order')
self.widget.show()
diff --git a/meld/vcview.py b/meld/vcview.py
index 3a03638..a4c3a80 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -143,6 +143,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
blurb="Files with these statuses will be shown by the comparison.",
)
left_is_local = GObject.property(type=bool, default=False)
+ merge_file_order = GObject.property(type=str, default="local-merge-remote")
# Map action names to VC commands and required arguments list
action_vc_cmds_map = {
@@ -241,6 +242,8 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
Gio.SettingsBindFlags.DEFAULT)
settings.bind('vc-left-is-local', self, 'left-is-local',
Gio.SettingsBindFlags.DEFAULT)
+ settings.bind('vc-merge-file-order', self, 'merge-file-order',
+ Gio.SettingsBindFlags.DEFAULT)
settings.bind('vc-console-visible',
self.actiongroup.get_action('VcConsoleVisible'),
'active', Gio.SettingsBindFlags.DEFAULT)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]