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

« back to all changes in this revision

Viewing changes to pgadmin/frm/frmHint.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: frmHint.cpp 7034 2008-02-01 13:31:41Z dpage $
5
 
// Copyright (C) 2002 - 2008, The pgAdmin Development Team
6
 
// This software is released under the Artistic Licence
 
4
// RCS-ID:      $Id: frmHint.cpp 7758 2009-03-26 20:49:59Z dpage $
 
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
 
6
// This software is released under the BSD Licence
7
7
//
8
8
// frmHint.cpp - PostgreSQL Guru hints
9
9
//
21
21
 
22
22
// App headers
23
23
#include "copyright.h"
 
24
#include "ctl/ctlMenuToolbar.h"
24
25
#include "frm/frmHint.h"
25
26
#include "frm/frmMain.h"
26
27
#include "schema/pgObject.h"
178
179
{
179
180
    wxString page;
180
181
 
181
 
    extern wxString docPath;
182
 
    wxString cn=settings->GetCanonicalLanguage();
 
182
    wxString cn=settings->GetCanonicalLanguageName();
183
183
    if (cn.IsEmpty())
184
184
        cn=wxT("en_US");
185
185
 
451
451
 
452
452
 
453
453
 
454
 
hintFactory::hintFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar, bool bigTool) : actionFactory(list)
 
454
hintFactory::hintFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar, bool bigTool) : actionFactory(list)
455
455
{
456
456
    mnu->Append(id, _("Hints"), _("Display helpful hints on current object."));
457
457
    if (toolbar)
458
458
    {
459
 
        char **img=(bigTool ? hint_xpm : hint2_xpm);
 
459
        const char **img=(bigTool ? hint_xpm : hint2_xpm);
460
460
        toolbar->AddTool(id, _("Hints"), wxBitmap(img), _("Display helpful hints on current object."));
461
461
    }
462
462
}
464
464
 
465
465
wxWindow *hintFactory::StartDialog(frmMain *form, pgObject *obj)
466
466
{
467
 
    obj->ShowHint(form, true);
 
467
    if (obj)
 
468
        obj->ShowHint(form, true);
 
469
    else
 
470
        wxLogMessage(_("There are no hints available for the current object."));
 
471
 
468
472
    return 0;
469
473
}
470
474
 
474
478
    return obj && obj->GetCanHint();
475
479
}
476
480
 
477
 
 
478
 
tipOfDayFactory::tipOfDayFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar) : actionFactory(list)
479
 
{
480
 
    if (mnu)
481
 
        mnu->Append(id, _("&Tip of the Day"), _("Show a tip of the day."));
482
 
}
483
 
 
484
 
 
485
 
wxWindow *tipOfDayFactory::StartDialog(frmMain *form, pgObject *obj)
486
 
{
487
 
    extern wxString docPath;
488
 
    extern wxLocale *locale;
489
 
 
490
 
    wxString file;
491
 
    
492
 
    file = docPath + wxT("/") + locale->GetCanonicalName() + wxT("/tips.txt");
493
 
 
494
 
    if (!wxFile::Exists(file))
495
 
        file = docPath + wxT("/en_US/tips.txt");    
496
 
 
497
 
    if (!wxFile::Exists(file)) {
498
 
        wxLogError(_("Couldn't open a tips.txt file!"));
499
 
        return 0;
500
 
    }
501
 
 
502
 
    wxTipProvider *tipProvider = wxCreateFileTipProvider(file, settings->GetNextTipOfTheDay());
503
 
    settings->SetShowTipOfTheDay(wxShowTip(form, tipProvider));
504
 
    settings->SetNextTipOfTheDay(tipProvider->GetCurrentTip());
505
 
 
506
 
    delete tipProvider;
507
 
    return 0;
508
 
}