Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHrud-0001km-VL for pgadmin-hackers@arkaria.postgresql.org; Fri, 16 Dec 2016 12:47:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cHrud-0001Ye-FO for pgadmin-hackers@arkaria.postgresql.org; Fri, 16 Dec 2016 12:46:59 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cHruP-0001Jt-AM for pgadmin-hackers@postgresql.org; Fri, 16 Dec 2016 12:46:45 +0000 Received: from mail-it0-x22f.google.com ([2607:f8b0:4001:c0b::22f]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cHruG-0001gY-SY for pgadmin-hackers@postgresql.org; Fri, 16 Dec 2016 12:46:43 +0000 Received: by mail-it0-x22f.google.com with SMTP id c20so15666558itb.0 for ; Fri, 16 Dec 2016 04:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FNMiTfiB5fmD4GLBaZqXGqcdSYOg463ooiPTTdhM3B0=; b=l/J/FGVmvnya+AyAraXgJj9eJtzBLqKm7AGBUM3dfSDBbN6yaV3pqhKO/Dh7hAKgmp QuumMT1GPNQbN8wd7qY31uqsMUaoMzRsRaALsVpD7RC9MjjZb+JEsJQUKM4A6XunCwNN q34c45qm1G6fX1nHzi9K32ByigFGMqYfCeRHh8yTiCPcRh18L44fn6RTkzd3qmqawkif OPUeZg1PyuAA9BQMfG2I8s63OarryWdgC0Na1gbDuN9c5FQFQLdHApzo2JutbRtTkfso Tfhk0cTKmsy0B0UifAvWyOW/TMtydrCScdCrh4K3NyGRxie+8uIxKcpSFpp8NceetdJm SLWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FNMiTfiB5fmD4GLBaZqXGqcdSYOg463ooiPTTdhM3B0=; b=aBQwnBPVh6XFbxVRlau7/HTTFjtGqGwgIJQHryj7uhRpMsX+n/QP8cnKOizvU+LRss 4phokbNs4IThvQgAk9H03A4ZG5yYr7uS9sQ433RCXwlqREMX9tcpE2E+1uoSH7Lp0m+t IR1L4HRdzXi6zPBYkjRPNlU7N/rfGDS4e1KnjCR1ZyKKkFzs1SBp5Kiduubh9loYNJuy v5cZus9qC8z+rHJiudGKJ3+/7ZaMAh8fkyGP4nJuffYMK5LpOjeD/2dmhaec68hA2xJ1 RLCEJzECCXYwDlpG/iYWXSNY+cP7xnnj6cdh9FQ4Jn5x6kAKMkyhXIAcwexqXiZaXack m+ww== X-Gm-Message-State: AKaTC02fZIQ1TNfXtS2ODapDNveMMeGh3RbMQGXvPWfCJVZTd1+qkxdTj9ovsj3ewpk1VhTLvjE8tWcHmbAOcDc8 X-Received: by 10.36.246.193 with SMTP id u184mr2480444ith.96.1481892395879; Fri, 16 Dec 2016 04:46:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.129.10 with HTTP; Fri, 16 Dec 2016 04:46:35 -0800 (PST) In-Reply-To: References: From: Akshay Joshi Date: Fri, 16 Dec 2016 18:16:35 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: RM #1807 Query Tool Does Not Recognize When File Changes Have Been Saved To: Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary=94eb2c03194cda23bc0543c5f508 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --94eb2c03194cda23bc0543c5f508 Content-Type: text/plain; charset=UTF-8 Hi Dave On Fri, Dec 16, 2016 at 5:22 PM, Dave Page wrote: > Hi > > On Fri, Dec 16, 2016 at 8:47 AM, Akshay Joshi < > akshay.joshi@enterprisedb.com> wrote: > >> Hi All >> >> Please find the attached patch to fix the RM #1807 Query Tool Does Not >> Recognize When File Changes Have Been Saved. >> > > If I open a file with the patch applied, and make a change (add a space to > the end), it's correctly detected. > > If I then undo the change by deleting the space, the file is still marked > as dirty. > This was an old behaviour. To achieve this we need to compare the original content with changed content on each key press event. > > If I then clear the window entirely, the save button is disabled, but the > tab still shows the file is dirty (the *). > Again this was an old behaviour, I have added only one if condition to check whether to popped up "Unsaved Changes" message or not. > > Also - the patch seems to undo the change I made > in 4a280b251755091af9bf56bcdee964601df104ae. > As per commit id 4a280b251755091af9bf56bcdee964601df104ae, you have made following changes: - self.setTitle(self.gridView.current_file. replace(/^\/|\/$/g, '')); + self.setTitle(self.gridView.current_file. split('\\').pop().split('/').pop()); And as per me I haven't change any thing there, I have only disabled the save button when file is loaded which was not there previously. > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- *Akshay Joshi* *Principal Software Engineer * *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* --94eb2c03194cda23bc0543c5f508 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dave

On Fri, Dec 16, 2016 at 5:22 PM, Dave Page <dpage@pgadmin.org&g= t; wrote:
Hi

On Fri, Dec 16, 2016 at 8:= 47 AM, Akshay Joshi <akshay.joshi@enterprisedb.com>= ; wrote:
Hi All

Please find the attached patch to fix the RM=C2=A0#1807 Qu= ery Tool Does Not Recognize When File Changes Have Been Saved.
<= /blockquote>

If I open a file with the patch appl= ied, and make a change (add a space to the end), it's correctly detecte= d.=C2=A0

If I then undo the change by deleting the= space, the file is still marked as dirty.=C2=A0

=C2=A0 =C2=A0This was an old behaviour. To ac= hieve this we need to compare the original content with changed content on = each key press event.

If I then clear= the window entirely, the save button is disabled, but the tab still shows = the file is dirty (the *).

=C2=A0 =C2=A0Again this was an old behaviour, I have added only one= if condition to check whether to popped up "Unsaved Changes" mes= sage or not.=C2=A0

Also - the patch s= eems to undo the change I made in=C2=A04a280b251755091af9bf56bcdee9646= 01df104ae.

=C2=A0 = =C2=A0 As per commit id 4a280b251755091af9bf56bcdee964601df104ae, you = have made following changes:=C2=A0

-=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0self.setTitle(self.gridView.current_fil= e.= replace(/^\/|\/$/g,=C2=A0''));
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0self.setTitle(self.gridView.current_file.split(= 9;\\').pop().split('/').pop());

And as per me I haven't ch= ange any thing there, I have only disabled the save button when file is loa= ded which was not there previously.




--
Akshay Joshi
Principal Software Engineer=C2=A0<= /div>

=

Phone: +91 20-3058-9517Mobile: +91 976-788-8246
--94eb2c03194cda23bc0543c5f508--