Re: Windows support



On Wed, Apr 15, 2009 at 11:44 PM, Stephen Kennedy <stevek gnome org> wrote:
>>> Ah, because of toggled->refresh->set_location->choose_vc
>>> How about storing the last chosen vc name in vcview? Then
>>> choose vc can default to that one next time. It might even
>>> be worth persisting in preferences (but no gui for it).
>> An implementation detail, though... You ultimately would like
>> VC choice persistence to be per-location, wouldn't you ?
>
> Ultimately, ... maybe. I was going to say yes, but I'm not so sure
> anymore. File managers for instance drive me crazy when they switch
> views when navigating. When I make a choice I want it to stick
> until I say otherwise.

The attached patch implements just that: keep the same VC plugin if
it can handle the new location else use the first in the new list...

>>>> - I've reproduced bug 578303 and tested proposed patches
> ...> On the C++ need for \n at EOF, this would hold if meld actually
>> modified the file content to then have the added \n and saved it,
>> but I looked at the code, and it does not seem to do that...
>
> It's an edge case so I'm happy to see all of:
> * highlighting fix patch
> * piotrs updated patch

Who will commit Piotr's 2 patches ?

> * newline at eof default to false

Done

> (& eventually to go away)

We'll see that after Piotr's patches are shown to fix all remaining cases...

> BTW the newline option adds the newline before the buffer modified
> flag is set in filediff.py:1323 Thus the newline doesn't get written
> nor the timestamp change unless the user makes some other change.

I'd say: "ougl". I personnally would not have expected the file to change
under my feet without any indication of that...

would it be sensible to queue a:

self.scheduler.add_task(on_text_insert_text(buf, buf.get_end_iter(), "\n", 1))

Or something like that ?

So that user:
- is notified of the file modification
- is able to undo it

-- 
Vincent Legoll
Index: vcview.py
===================================================================
--- vcview.py	(revision 1347)
+++ vcview.py	(working copy)
@@ -227,13 +227,18 @@
         self.combobox_vcs.get_model().clear()
         tooltip_texts = [_("Choose one Version Control"),
                          _("Only one Version Control in this directory")]
-        for avc in vcs:
+        default_active = 0
+        # Try to keep the same VC plugin active on refresh()
+        for idx, avc in enumerate(vcs):
+            if (self.vc is not None and
+                self.vc.__class__ == avc.__class__):
+                default_active = idx
             self.combobox_vcs.get_model().append([avc.NAME, avc])
         if gtk.pygtk_version >= (2, 12, 0):
             self.combobox_vcs.set_tooltip_text(tooltip_texts[len(vcs) == 1])
         self.combobox_vcs.set_sensitive(len(vcs) > 1)
         self.combobox_vcs.lock = False
-        self.combobox_vcs.set_active(0)
+        self.combobox_vcs.set_active(default_active)
   
     def on_vc_change(self, cb):
         if not cb.lock:


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