Hi,
Here is a patch to fix two things:
* Fix timespin on GTK so that it displays the complete widget.
* Fix the display of the time when the user choose a date in the
Role/User dialog (should be 00:00:00, and not an empty string).
Comments?
I suppose I have some sort of bugfixes week :) I'll commit all the
bugfixes I did tomorrow night if no-one objects.
--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com
diff --git a/pgadmin/ctl/timespin.cpp b/pgadmin/ctl/timespin.cpp
index 4fc169f..c7e3623 100644
--- a/pgadmin/ctl/timespin.cpp
+++ b/pgadmin/ctl/timespin.cpp
@@ -128,7 +128,11 @@ void wxTimeSpinCtrl::Init()
wxSize wxTimeSpinCtrl::DoGetBestSize() const
{
+#ifdef __WXGTK__
+ return wxSize(100, m_spn->GetBestSize().y);
+#else
return wxSize(100, m_txt->GetBestSize().y);
+#endif
}
diff --git a/pgadmin/dlg/dlgRole.cpp b/pgadmin/dlg/dlgRole.cpp
index 953a604..7c4600e 100644
--- a/pgadmin/dlg/dlgRole.cpp
+++ b/pgadmin/dlg/dlgRole.cpp
@@ -274,6 +274,13 @@ void dlgRole::OnOK(wxCommandEvent &ev)
void dlgRole::OnChangeCal(wxCalendarEvent &ev)
{
CheckChange();
+
+ bool timEn=ev.GetDate().IsValid();
+ timValidUntil->Enable(timEn);
+ if (!timEn)
+ timValidUntil->SetTime(wxDefaultDateTime);
+ else
+ timValidUntil->SetTime(wxDateTime::Today());
}
@@ -285,6 +292,8 @@ void dlgRole::OnChangeDate(wxDateEvent &ev)
timValidUntil->Enable(timEn);
if (!timEn)
timValidUntil->SetTime(wxDefaultDateTime);
+ else
+ timValidUntil->SetTime(wxDateTime::Today());
}
void dlgRole::OnChangeSpin(wxSpinEvent &ev)
diff --git a/pgadmin/dlg/dlgUser.cpp b/pgadmin/dlg/dlgUser.cpp
index b6b263b..6726028 100644
--- a/pgadmin/dlg/dlgUser.cpp
+++ b/pgadmin/dlg/dlgUser.cpp
@@ -199,6 +199,13 @@ wxString dlgUser::GetHelpPage() const
void dlgUser::OnChangeCal(wxCalendarEvent &ev)
{
CheckChange();
+
+ bool timEn=ev.GetDate().IsValid();
+ timValidUntil->Enable(timEn);
+ if (!timEn)
+ timValidUntil->SetTime(wxDefaultDateTime);
+ else
+ timValidUntil->SetTime(wxDateTime::Today());
}
@@ -210,6 +217,8 @@ void dlgUser::OnChangeDate(wxDateEvent &ev)
timValidUntil->Enable(timEn);
if (!timEn)
timValidUntil->SetTime(wxDefaultDateTime);
+ else
+ timValidUntil->SetTime(wxDateTime::Today());
}
void dlgUser::OnChangeSpin(wxSpinEvent &ev)
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers