~ubuntu-branches/debian/sid/pgadmin3/sid

« back to all changes in this revision

Viewing changes to pgadmin/frm/events.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2009-07-30 12:27:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730122716-fddbh42on721bbs2
Tags: 1.10.0-1
* New upstream release.
* Adjusted watch file to match release candidates.
* Updated to Standards-Version 3.8.2:
  - Moved to Section: database.
  - Add DEB_BUILD_OPTIONS support for parallel building.
  - Move from findstring to filter suggestion for DEB_BUILD_OPTIONS parsing.
* pgagent got split into its own separate source package by upstream.
* Exclude Docs.vcproj from installation.
* Move doc-base.enus from pgadmin3 to pgadmin3-data package, the files are
  in there too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//////////////////////////////////////////////////////////////////////////
2
2
//
3
3
// pgAdmin III - PostgreSQL Tools
4
 
// RCS-ID:      $Id: events.cpp 6930 2008-01-02 00:10:01Z dpage $
5
 
// Copyright (C) 2002 - 2008, The pgAdmin Development Team
6
 
// This software is released under the Artistic Licence
 
4
// RCS-ID:      $Id: events.cpp 7939 2009-06-23 08:43:51Z dpage $
 
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
 
6
// This software is released under the BSD Licence
7
7
//
8
8
// events.cpp - Event handlers for frmMain
9
9
//
28
28
#include "frm/frmMain.h"
29
29
#include "frm/frmOptions.h"
30
30
#include "ctl/ctlSQLBox.h"
 
31
#include "ctl/ctlMenuToolbar.h"
31
32
#include "db/pgConn.h"
32
33
#include "schema/pgDatabase.h"
33
34
#include "db/pgSet.h"
37
38
#include "schema/pgTable.h"
38
39
#include "dlg/dlgProperty.h"
39
40
 
40
 
extern wxString loadPath;
41
 
 
42
 
 
43
41
// Event table
44
42
BEGIN_EVENT_TABLE(frmMain, pgFrame)
45
43
    EVT_ERASE_BACKGROUND(                   frmMain::OnEraseBackground)
85
83
    event.Skip();
86
84
}
87
85
 
88
 
 
89
86
// unfortunately, under GTK we won't get the original wxKeyEvent
90
87
// to reset m_metaDown
91
88
void frmMain::OnTreeKeyDown(wxTreeEvent& event)
257
254
    if (currentNode)
258
255
    {
259
256
        properties->ClearAll();
260
 
        properties->AddColumn(_("Properties"), 500);
 
257
        properties->AddColumn(_("Properties"), properties->GetSize().GetWidth() - 10);
261
258
        properties->InsertItem(0, _("No properties are available for the current selection"), PGICON_PROPERTY);
262
259
 
263
260
        sqlPane->Clear();
591
588
                            text = _("Are you sure you wish to drop multiple objects?");
592
589
                            caption = _("Drop multiple objects?");
593
590
                        }
594
 
                        wxMessageDialog msg(this, text, caption, wxYES_NO | wxICON_QUESTION);
 
591
                        wxMessageDialog msg(this, text, caption, wxYES_NO | wxICON_QUESTION | wxNO_DEFAULT);
595
592
                        if (msg.ShowModal() != wxID_YES)
596
593
                        {
597
594
                            return;
671
668
            }
672
669
            else
673
670
            {
674
 
                text = wxString::Format(_("Are you sure you wish to drop %s %s?"),
675
 
                    data->GetTranslatedTypeName().c_str(), data->GetFullIdentifier().c_str());
 
671
                /*
 
672
                *  curerntObject is set using the following command.
 
673
                *  i.e. currentObject = browser->GetObject(item);
 
674
                *  While fetching this object using this code, somehow it looses its virtual table pointer.
 
675
                *  Hence, it is not able to call the GetFullIdentifier - virtual function from the 
 
676
                *  particular class, but it will always call this functions from pgObject class always.
 
677
                *  To rectify this problem, we need to explicitly check the meta data type and call the
 
678
                *  function from the particular class.
 
679
                */
 
680
                if (data->GetMetaType() == PGM_SERVER)
 
681
                    text = wxString::Format(_("Are you sure you wish to drop %s \"%s\"?"),
 
682
                        data->GetTranslatedTypeName().c_str(), ((pgServer*)data)->GetFullIdentifier().c_str());
 
683
                else
 
684
                    text = wxString::Format(_("Are you sure you wish to drop %s %s?"),
 
685
                        data->GetTranslatedTypeName().c_str(), data->GetFullIdentifier().c_str());
676
686
                caption = wxString::Format(_("Drop %s?"), data->GetTranslatedTypeName().c_str());
677
687
            }
678
 
            wxMessageDialog msg(this, text, caption, wxYES_NO | wxICON_QUESTION);
 
688
            wxMessageDialog msg(this, text, caption, wxYES_NO | wxICON_QUESTION | wxNO_DEFAULT);
679
689
            if (msg.ShowModal() != wxID_YES)
680
690
            {
681
691
                return false;