SVN Commit by dpage: r4181 - in trunk/pgadmin3: i18n src src/agent src/base src/ctl src/include/base src/include/ctl

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4181 - in trunk/pgadmin3: i18n src src/agent src/base src/ctl src/include/base src/include/ctl
Date: 2005-05-13 11:12:03
Message-ID: 200505131112.j4DBC3lf027428@developer.pgadmin.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Author: dpage
Date: 2005-05-13 12:12:03 +0100 (Fri, 13 May 2005)
New Revision: 4181

Modified:
trunk/pgadmin3/i18n/Makefile.am
trunk/pgadmin3/src/agent/dlgSchedule.cpp
trunk/pgadmin3/src/base/appbase.cpp
trunk/pgadmin3/src/ctl/ctlListView.cpp
trunk/pgadmin3/src/include/base/appbase.h
trunk/pgadmin3/src/include/ctl/ctlListView.h
trunk/pgadmin3/src/pgAdmin3.cpp
Log:
This patch makes the osx build work again, by doing the following
.) Change i18n/Makefile.am to install i18n-files into
$(datadir)i18n instead of $(datadir)/pgadmin3/i18n when
building an appbundle.
.) Put the files listed in TMP_ui in i18n/Makefile.am
into EXTRA_DIST instead. I guess this was an error,
since TMP_ui is never used in this Makefile...
.) Support DESTDIR in i18n/Makefile.am
.) Moves the path-hint support for windows from
pgAdmin3.cpp to base/appbase.cpp,
because this saves some conditionals and is cleaner
.) Make "path" a global variable, like loadPath, ...

Now all path-related setups are done in InitPaths in AppBase
[Florian G. Pflug]

Modified: trunk/pgadmin3/i18n/Makefile.am
===================================================================
--- trunk/pgadmin3/i18n/Makefile.am 2005-05-13 10:01:01 UTC (rev 4180)
+++ trunk/pgadmin3/i18n/Makefile.am 2005-05-13 11:12:03 UTC (rev 4181)
@@ -19,25 +19,27 @@

EXTRA_DIST = \
$(srcdir)/wxstd.pot \
- $(srcdir)/??_??/pgadmin3.po
-
-TMP_ui = \
+ $(srcdir)/??_??/pgadmin3.po \
$(srcdir)/wxstd.mo \
$(srcdir)/pgadmin3.lng \
$(srcdir)/pg_settings.csv \
$(srcdir)/??_??/pgadmin3.mo \
$(srcdir)/??_??/wxstd.mo

+if !APPBUNDLE
+i18ndir = $(pkgdatadir)/i18n
+else
+i18ndir = $(datadir)/i18n
+endif

install-data-local:
- $(mkinstalldirs) $(datadir)/pgadmin3/i18n
+ $(mkinstalldirs) $(PREFIX)$(i18ndir)
@pub_tx='$(PUB_TX)'; \
for DIR in $$pub_tx; do \
- $(mkinstalldirs) $(datadir)/pgadmin3/i18n/$$DIR; \
+ $(mkinstalldirs) $(PREFIX)$(i18ndir)/$$DIR; \
for FILE in `ls $$DIR/*.mo`; do \
- $(install_sh) -c -m 644 $$FILE $(datadir)/pgadmin3/i18n/$$DIR/; \
+ $(install_sh) -c -m 644 $$FILE $(PREFIX)$(i18ndir)/$$DIR/; \
done \
done
- $(install_sh) -c -m 644 pgadmin3.lng $(datadir)/pgadmin3/i18n/$$DIR
- $(install_sh) -c -m 644 wxstd.mo $(datadir)/pgadmin3/i18n/$$DIR
-
+ $(install_sh) -c -m 644 pgadmin3.lng $(PREFIX)$(i18ndir)/$$DIR
+ $(install_sh) -c -m 644 wxstd.mo $(PREFIX)$(i18ndir)/$$DIR

Modified: trunk/pgadmin3/src/agent/dlgSchedule.cpp
===================================================================
--- trunk/pgadmin3/src/agent/dlgSchedule.cpp 2005-05-13 10:01:01 UTC (rev 4180)
+++ trunk/pgadmin3/src/agent/dlgSchedule.cpp 2005-05-13 11:12:03 UTC (rev 4181)
@@ -277,6 +277,56 @@

void dlgSchedule::OnChangeException(wxCommandEvent &ev)
{
+ if (!calException->GetValue().IsValid() && timException->GetValue().IsNull())
+ {
+ wxMessageBox(_("You must enter a valid date and/or time!"), _("Add exception"), wxICON_EXCLAMATION | wxOK, this);
+ return;
+ }
+
+ wxString exDate, exTime;
+
+ if (calException->GetValue().IsValid())
+ exDate = calException->GetValue().FormatDate();
+ else
+ exDate = _("<any>");
+
+ if (!timException->GetValue().IsNull())
+ exTime = timException->GetValue().Format();
+ else
+ exTime = _("<any>");
+
+ for (int pos=0; pos < lstExceptions->GetItemCount(); pos++)
+ {
+ if (lstExceptions->GetFocusedItem() != pos)
+ {
+ if (lstExceptions->GetText(pos, 0) == exDate &&
+ lstExceptions->GetText(pos, 1) == exTime)
+ {
+ wxMessageBox(_("The specified exception already exists!"), _("Add exception"), wxICON_EXCLAMATION | wxOK, this);
+ return;
+ }
+
+ if (lstExceptions->GetText(pos, 0) == exDate &&
+ lstExceptions->GetText(pos, 1) == _("<any>"))
+ {
+ wxMessageBox(_("An exception already exists for any time on this date!"), _("Add exception"), wxICON_EXCLAMATION | wxOK, this);
+ return;
+ }
+
+ if (lstExceptions->GetText(pos, 1) == exTime &&
+ lstExceptions->GetText(pos, 0) == _("<any>"))
+ {
+ wxMessageBox(_("An exception already exists for this time on any date!"), _("Add exception"), wxICON_EXCLAMATION | wxOK, this);
+ return;
+ }
+ }
+ }
+
+ lstExceptions->SetText(lstExceptions->GetFocusedItem(), 0, exDate);
+ lstExceptions->SetText(lstExceptions->GetFocusedItem(), 1, exTime);
+ lstExceptions->SetText(lstExceptions->GetFocusedItem(), 2, BoolToStr(true));
+ lstExceptions->RefreshItem(lstExceptions->GetFocusedItem());
+ CheckChange();
}

Modified: trunk/pgadmin3/src/base/appbase.cpp
===================================================================
--- trunk/pgadmin3/src/base/appbase.cpp 2005-05-13 10:01:01 UTC (rev 4180)
+++ trunk/pgadmin3/src/base/appbase.cpp 2005-05-13 11:12:03 UTC (rev 4181)
@@ -19,11 +19,13 @@
#include <wx/xrc/xmlres.h>
#include <wx/stdpaths.h>

+#include "copyright.h"
#include "base/base.h"
#include "base/appbase.h"
#include "base/pgConnBase.h"
#include "base/sysLogger.h"

+wxPathList path; // The search path
wxString loadPath; // Where the program is loaded from
wxString docPath; // Where docs are stored
wxString uiPath; // Where ui data is stored
@@ -60,6 +62,18 @@
docPath = loadPath + DOC_DIR;
else
docPath = loadPath + wxT("/../..") DOC_DIR;
+
+ // Look for a path 'hint' on Windows. This registry setting may
+ // be set by the Win32 PostgreSQL installer which will generally
+ // install pg_dump et al. in the PostgreSQL bindir rather than
+ // the pgAdmin directory.
+ wxRegKey hintKey(wxT("HKEY_LOCAL_MACHINE\\Software\\") APPNAME_L);
+ if (hintKey.HasValue(wxT("Helper Path")))
+ {
+ wxString hintPath;
+ hintKey.QueryValue(wxT("Helper Path"), hintPath);
+ path.Add(hintPath);
+ }

#else
wxString dataDir;
@@ -123,6 +137,8 @@
docPath = loadPath + wxT("/..") DOC_DIR ;
}
#endif
+
+ path.AddEnvList(wxT("PATH"));
}

Modified: trunk/pgadmin3/src/ctl/ctlListView.cpp
===================================================================
--- trunk/pgadmin3/src/ctl/ctlListView.cpp 2005-05-13 10:01:01 UTC (rev 4180)
+++ trunk/pgadmin3/src/ctl/ctlListView.cpp 2005-05-13 11:12:03 UTC (rev 4181)
@@ -40,7 +40,17 @@
return item.GetText();
};

+void ctlListView::SetText(long row, long col, const wxString &text)
+{
+ wxListItem item;
+ item.SetId(row);
+ item.SetColumn(col);
+ item.SetMask(wxLIST_MASK_TEXT);
+ GetItem(item);
+ item.SetText(text);
+};

+
void ctlListView::AddColumn(const wxChar *text, int size, int format)
{
InsertColumn(GetColumnCount(), text, format, ConvertDialogToPixels(wxPoint(size,0)).x);

Modified: trunk/pgadmin3/src/include/base/appbase.h
===================================================================
--- trunk/pgadmin3/src/include/base/appbase.h 2005-05-13 10:01:01 UTC (rev 4180)
+++ trunk/pgadmin3/src/include/base/appbase.h 2005-05-13 11:12:03 UTC (rev 4181)
@@ -9,6 +9,7 @@
//
//////////////////////////////////////////////////////////////////////////

+extern wxPathList path; // The search path
extern wxString loadPath; // Where the program is loaded from
extern wxString docPath; // Where docs are stored
extern wxString uiPath; // Where ui data is stored

Modified: trunk/pgadmin3/src/include/ctl/ctlListView.h
===================================================================
--- trunk/pgadmin3/src/include/ctl/ctlListView.h 2005-05-13 10:01:01 UTC (rev 4180)
+++ trunk/pgadmin3/src/include/ctl/ctlListView.h 2005-05-13 11:12:03 UTC (rev 4181)
@@ -26,6 +26,7 @@
ctlListView(wxWindow *p, int id, wxPoint pos, wxSize siz, long attr=0);
long GetSelection();
wxString GetText(long row, long col=0);
+ void SetText(long row, long col, const wxString &text);

void CreateColumns(wxImageList *images, const wxString &left, const wxString &right, int leftSize=60);

Modified: trunk/pgadmin3/src/pgAdmin3.cpp
===================================================================
--- trunk/pgadmin3/src/pgAdmin3.cpp 2005-05-13 10:01:01 UTC (rev 4180)
+++ trunk/pgadmin3/src/pgAdmin3.cpp 2005-05-13 11:12:03 UTC (rev 4181)
@@ -147,31 +147,6 @@
}
}

-
- wxPathList path;
-
- path.Add(loadPath);
-
-#ifdef __WXMSW__
-
- // Look for a path 'hint' on Windows. This registry setting may
- // be set by the Win32 PostgreSQL installer which will generally
- // install pg_dump et al. in the PostgreSQL bindir rather than
- // the pgAdmin directory.
-
- wxRegKey hintKey(wxT("HKEY_LOCAL_MACHINE\\Software\\") APPNAME_L);
-
- if (hintKey.HasValue(wxT("Helper Path")))
- {
- wxString hintPath;
- hintKey.QueryValue(wxT("Helper Path"), hintPath);
- path.Add(hintPath);
- }
-
-#endif
-
- path.AddEnvList(wxT("PATH"));
-
// evaluate all working paths

#if defined(__WXMSW__)

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2005-05-13 11:15:03 Re: [PATCH] Repair OSX Port after i18n reorganization
Previous Message svn 2005-05-13 10:01:01 SVN Commit by dpage: r4180 - trunk/pgadmin3/src