Re: [pgadmin-support] Some little userfriendly - Mailing list pgadmin-hackers

From Guillaume Lelarge
Subject Re: [pgadmin-support] Some little userfriendly
Date
Msg-id 44E1A9F9.7050407@lelarge.info
Whole thread Raw
In response to Re: [pgadmin-support] Some little userfriendly improvements  ("Dave Page" <dpage@vale-housing.co.uk>)
Responses Re: [pgadmin-support] Some little userfriendly
List pgadmin-hackers
Dave Page a écrit :
>
>
>> -----Original Message-----
>> From: Guillaume Lelarge [mailto:guillaume@lelarge.info]
>> Sent: 03 August 2006 14:57
>> To: Dave Page
>> Cc: pgadmin-hackers@postgresql.org
>> Subject: Re: [pgadmin-hackers] [pgadmin-support] Some little
>> userfriendly improvements
>>
>> Dave Page a ecrit le 03/08/2006 15:03:
>>>> There are some little, but useful improvements: :-)
>>>> - In left tree, left click on a table, and select 'view
>>>> filtered data'.
>>>> Can be set to focus to the filter text input?
>>>> - In left tree, left click on a table, and select 'view data', and
>>>> select 'sort/filter option' icon. 'Data  sorting' tab.
>>>> If there are more than 1 sorting column in the list -> You press
>>>> 'remove' button. It is remove the selected item from the
>>>> list, but not
>>>> select the next item in the list.
>>> Thise are good suggestions and an ideal starter project for anyone
>>> wanting to start hacking on pgAdmin.
>>>
>>> Anyone want t give them a go?
>>>
>> Well, I'm interested. But I will be pretty slow so I don't
>> want to stop
>> anyone from doing it.
>
> Please go ahead - I'm on vacation for a couple of weeks from Sunday
> anyway and won't get anything done before then.
>
> These should be little more than one or two line tweaks, but give the
> newcomer a nice chance to setup an SVN tree and have a wander around the
> code without having to delve deeply into the complex bits on a first
> outing :-)
>

So here it is. This patch (listitem.patch) is for the second request. It
was really quick to do, juste a few lines to add.

For the first ui issue, I just added this line at end of
DlgEditGridOptions' constructor:
  filter->SetFocus();

In fact, this line does nothing with modal dialog on Linux and I don't
know if it works on windows... pretty bad heh :) What's strange is that
it works on non-modal dialog. With a bit of googling, it seems there's a
bug on wxWidget with focus on modal dialog some time ago. Don't know if
this is still true. I'll continue to work on this but if you have any
idea, I'm really interested in hearing it.


--
Guillaume.
<!-- http://abs.traduc.org/
     http://lfs.traduc.org/
     http://traduc.postgresqlfr.org/ -->
Index: dlg/dlgEditGridOptions.cpp
===================================================================
--- dlg/dlgEditGridOptions.cpp    (révision 5293)
+++ dlg/dlgEditGridOptions.cpp    (copie de travail)
@@ -170,6 +170,15 @@
     itm = lstSortCols->GetNextItem(itm, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
     cboColumns->Append(lstSortCols->GetItemText(itm));
     lstSortCols->DeleteItem(itm);
+    if (lstSortCols->GetItemCount() > 0)
+    {
+        if (lstSortCols->GetItemCount() < itm+1)
+            lstSortCols->SetItemState(lstSortCols->GetItemCount()-1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
+        else
+            lstSortCols->SetItemState(itm, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
+    }
+    wxListEvent nullLstEvent;
+    OnLstSortColsChange(nullLstEvent);
 }

 void dlgEditGridOptions::OnAsc(wxCommandEvent &ev)

pgadmin-hackers by date:

Previous
From: Giuseppe Sacco
Date:
Subject: italian translation update and a few questions
Next
From: Dave Page
Date:
Subject: Re: italian translation update and a few