~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to pgadmin/dlg/dlgRole.cpp

  • Committer: Package Import Robot
  • Author(s): Christoph Berg
  • Date: 2013-09-10 16:16:38 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20130910161638-wwup1q553ylww7dr
Tags: 1.18.0-1
* New upstream release.
* Don't install /usr/bin/png2c anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
//
3
3
// pgAdmin III - PostgreSQL Tools
4
4
//
5
 
// Copyright (C) 2002 - 2012, The pgAdmin Development Team
 
5
// Copyright (C) 2002 - 2013, The pgAdmin Development Team
6
6
// This software is released under the PostgreSQL Licence
7
7
//
8
8
// dlgRole.cpp - PostgreSQL Role Property
210
210
                chkUpdateCat->SetValue(role->GetUpdateCatalog());
211
211
                chkCanLogin->SetValue(role->GetCanLogin());
212
212
                chkReplication->SetValue(role->GetReplication());
213
 
                datValidUntil->SetValue(role->GetAccountExpires().GetDateOnly());
214
 
                timValidUntil->SetTime(role->GetAccountExpires());
 
213
                if (role->GetAccountExpires().IsValid() && role->GetAccountExpires().GetValue() != -1)
 
214
                {
 
215
                        datValidUntil->SetValue(role->GetAccountExpires().GetDateOnly());
 
216
                        timValidUntil->SetTime(role->GetAccountExpires());
 
217
                }
215
218
                txtConnectionLimit->SetValue(NumToStr(role->GetConnectionLimit()));
216
219
                txtComment->SetValue(role->GetComment());
217
220
 
322
325
 
323
326
void dlgRole::OnChangeCal(wxCalendarEvent &ev)
324
327
{
325
 
        CheckChange();
326
 
 
327
328
        bool timEn = ev.GetDate().IsValid();
328
329
        timValidUntil->Enable(timEn);
329
330
        if (!timEn)
330
331
                timValidUntil->SetTime(wxDefaultDateTime);
331
332
        else
332
333
                timValidUntil->SetTime(wxDateTime::Today());
 
334
 
 
335
        CheckChange();
333
336
}
334
337
 
335
338
 
336
339
void dlgRole::OnChangeDate(wxDateEvent &ev)
337
340
{
338
 
        CheckChange();
339
 
 
340
341
        bool timEn = ev.GetDate().IsValid();
341
342
        timValidUntil->Enable(timEn);
342
343
        if (!timEn)
343
344
                timValidUntil->SetTime(wxDefaultDateTime);
344
345
        else
345
346
                timValidUntil->SetTime(wxDateTime::Today());
 
347
 
 
348
        CheckChange();
346
349
}
347
350
 
348
351
void dlgRole::OnChangeSpin(wxSpinEvent &ev)
359
362
                                    _("Deleting a superuser might result in unwanted behaviour (e.g. when restoring the database).\nAre you sure?"),
360
363
                                    _("Confirm superuser deletion"),
361
364
                                    wxICON_EXCLAMATION | wxYES_NO | wxNO_DEFAULT);
362
 
                if (dlg.ShowModal() != wxYES)
 
365
                if (dlg.ShowModal() != wxID_YES)
363
366
                {
364
367
                        chkSuperuser->SetValue(true);
365
368
                        return;
647
650
                                }
648
651
                        }
649
652
                }
650
 
                if (DateToStr(datValidUntil->GetValue()) != DateToStr(role->GetAccountExpires()))
 
653
                if (!datValidUntil->GetValue().IsValid() || DateToStr(datValidUntil->GetValue() + timValidUntil->GetValue()) != DateToStr(role->GetAccountExpires()))
651
654
                {
652
655
                        if (datValidUntil->GetValue().IsValid())
653
656
                                options += wxT("\n   VALID UNTIL ") + qtDbString(DateToAnsiStr(datValidUntil->GetValue() + timValidUntil->GetValue()));