Index: Makefile.am
===================================================================
RCS file: /projects/pgadmin3/src/Makefile.am,v
retrieving revision 1.99
retrieving revision 1.100
diff -Lsrc/Makefile.am -Lsrc/Makefile.am -u -w -r1.99 -r1.100
--- src/Makefile.am
+++ src/Makefile.am
@@ -56,7 +56,7 @@
$(srcdir)/slony/slSequence.cpp $(srcdir)/slony/slTable.cpp $(srcdir)/slony/slSubscription.cpp \
$(srcdir)/slony/dlgRepCluster.cpp $(srcdir)/slony/dlgRepNode.cpp $(srcdir)/slony/dlgRepListen.cpp \
$(srcdir)/slony/dlgRepPath.cpp $(srcdir)/slony/dlgRepSet.cpp $(srcdir)/slony/dlgRepSequence.cpp \
-$(srcdir)/slony/dlgRepTable.cpp $(srcdir)/slony/dlgRepSubscription.cpp \
+$(srcdir)/slony/dlgRepTable.cpp $(srcdir)/slony/dlgRepSubscription.cpp $(srcdir)/slony/slFunctions.cpp \
$(srcdir)/ui/common/xrcDialogs.cpp
noinst_HEADERS = $(srcdir)/include/copyright.h $(srcdir)/include/version.h $(srcdir)/include/ctlSQLBox.h \
@@ -110,7 +110,7 @@
$(srcdir)/slony/include/dlgRepCluster.h $(srcdir)/slony/include/dlgRepNode.h \
$(srcdir)/slony/include/dlgRepListen.h $(srcdir)/slony/include/dlgRepPath.h \
$(srcdir)/slony/include/dlgRepSet.h $(srcdir)/slony/include/dlgRepSequence.h \
-$(srcdir)/slony/include/dlgRepSubscription.h
+$(srcdir)/slony/include/dlgRepSubscription.h $(srcdir)/slony/include/slFunctions.h
EXTRA_DIST = $(srcdir)/pgAdmin3.dsp $(srcdir)/pgAdmin3.dsw \
Index: pgAdmin3.dsp
===================================================================
RCS file: /projects/pgadmin3/src/pgAdmin3.dsp,v
retrieving revision 1.120
retrieving revision 1.121
diff -Lsrc/pgAdmin3.dsp -Lsrc/pgAdmin3.dsp -u -w -r1.120 -r1.121
--- src/pgAdmin3.dsp
+++ src/pgAdmin3.dsp
@@ -1303,6 +1303,30 @@
# End Source File
# Begin Source File
+SOURCE=.\include\images\slcluster.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\sllisten.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\slnode.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\slpath.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\slset.xpm
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\images\slsubscription.xpm
+# End Source File
+# Begin Source File
+
SOURCE=.\include\images\splash.xpm
# End Source File
# Begin Source File
@@ -1603,6 +1627,10 @@
# End Source File
# Begin Source File
+SOURCE=.\slony\include\slFunctions.h
+# End Source File
+# Begin Source File
+
SOURCE=.\slony\include\slListen.h
# End Source File
# Begin Source File
@@ -1708,6 +1736,10 @@
# End Source File
# Begin Source File
+SOURCE=.\slony\slFunctions.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\slony\slListen.cpp
# End Source File
# Begin Source File
Index: frmMain.h
===================================================================
RCS file: /projects/pgadmin3/src/include/frmMain.h,v
retrieving revision 1.60
retrieving revision 1.61
diff -Lsrc/include/frmMain.h -Lsrc/include/frmMain.h -u -w -r1.60 -r1.61
--- src/include/frmMain.h
+++ src/include/frmMain.h
@@ -71,7 +71,7 @@
ctlListView *referencedBy, *dependsOn;
wxNotebook *listViews;
ctlSQLBox *sqlPane;
- wxMenu *newMenu, *toolsMenu, *viewMenu, *treeContextMenu, *newContextMenu;
+ wxMenu *newMenu, *toolsMenu, *viewMenu, *treeContextMenu, *newContextMenu, *slonyMenu;
wxTreeItemId servers;
wxImageList *images;
wxSplitterWindow *horizontal, *vertical;
@@ -111,6 +111,12 @@
void OnMainFileConfig(wxCommandEvent& event);
void OnHbaFileConfig(wxCommandEvent& event);
+ void OnMergeSet(wxCommandEvent& event);
+ void OnMoveSet(wxCommandEvent& event);
+ void OnFailover(wxCommandEvent& event);
+ void OnUpgradeNode(wxCommandEvent& event);
+ void OnRestartNode(wxCommandEvent& event);
+
void OnPageChange(wxNotebookEvent& event);
void OnPropSelChanged(wxListEvent& event);
void OnPropSelActivated(wxListEvent& event);
Index: menu.h
===================================================================
RCS file: /projects/pgadmin3/src/include/menu.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -Lsrc/include/menu.h -Lsrc/include/menu.h -u -w -r1.22 -r1.23
--- src/include/menu.h
+++ src/include/menu.h
@@ -89,6 +89,12 @@
MNU_HINT,
MNU_ONLINEUPDATE,
MNU_ONLINEUPDATE_NEWDATA,
+ MNU_SLONY_RESTART,
+ MNU_SLONY_UPGRADE,
+ MNU_SLONY_FAILOVER,
+ MNU_SLONY_MERGESET,
+ MNU_SLONY_MOVESET,
+ MNU_SLONY_SUBMENU,
MNU_RECENT, // leave space for recent file entries
MNU_NEW=MNU_RECENT+15
};
Index: slNode.cpp
===================================================================
RCS file: /projects/pgadmin3/src/slony/slNode.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/slony/slNode.cpp -Lsrc/slony/slNode.cpp -u -w -r1.4 -r1.5
--- src/slony/slNode.cpp
+++ src/slony/slNode.cpp
@@ -45,6 +45,12 @@
}
+bool slNode::CanDrop()
+{
+ return (GetSlId() != GetCluster()->GetLocalNodeID());
+}
+
+
bool slNode::DropObject(wxFrame *frame, wxTreeCtrl *browser)
{
return GetDatabase()->ExecuteVoid(
Index: slNode.h
===================================================================
RCS file: /projects/pgadmin3/src/slony/include/slNode.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lsrc/slony/include/slNode.h -Lsrc/slony/include/slNode.h -u -w -r1.2 -r1.3
--- src/slony/include/slNode.h
+++ src/slony/include/slNode.h
@@ -36,7 +36,7 @@
static pgObject *ReadObjects(slCollection *coll, wxTreeCtrl *browser, const wxString &restriction);
static pgObject *ReadObjects(slCollection *coll, wxTreeCtrl *browser);
-// bool CanBackup() { return true; }
+ bool CanDrop();
bool RequireDropConfirm() { return true; }
bool WantDummyChild() { return true; }
Index: CHANGELOG.txt
===================================================================
RCS file: /projects/pgadmin3/CHANGELOG.txt,v
retrieving revision 1.185
retrieving revision 1.186
diff -LCHANGELOG.txt -LCHANGELOG.txt -u -w -r1.185 -r1.186
--- CHANGELOG.txt
+++ CHANGELOG.txt
@@ -17,6 +17,7 @@
+ - 2005-02-24 AP some Slony-I stuff
- 2005-02-24 AP 1.2.1 require unicode to compile utffile.cpp
- 2005-02-23 AP Slony-1 statistics
- 2005-02-14 AP 1.2.1 TreeSelChange fixes (menu/statistics/dependency refresh)
Index: calbox.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/calbox.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lsrc/ui/calbox.cpp -Lsrc/ui/calbox.cpp -u -w -r1.15 -r1.16
--- src/ui/calbox.cpp
+++ src/ui/calbox.cpp
@@ -84,8 +84,8 @@
}
m_txt=new wxTextCtrl(this, CTRLID_TXT, txt, wxPoint(0,0), wxSize(cs.x-bs.x-1, cs.y), wxNO_BORDER);
- m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN, (wxObjectEventFunction)&wxCalendarBox::OnEditKey, 0, this);
- m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&wxCalendarBox::OnKillFocus, 0, this);
+ m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN, wxKeyEventHandler(wxCalendarBox::OnEditKey), 0, this);
+ m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KILL_FOCUS, wxFocusEventHandler(wxCalendarBox::OnKillFocus), 0, this);
SetFormat(wxT("%x"));
m_btn = new wxBitmapButton(this, CTRLID_BTN, bmp, wxPoint(cs.x - bs.x, 0), wxSize(bs.x, cs.y));
@@ -95,16 +95,16 @@
wxPanel *panel=new wxPanel(m_dlg, CTRLID_PAN, wxPoint(0, 0), wxDefaultSize, wxSUNKEN_BORDER|wxCLIP_CHILDREN);
m_cal = new wxCalendarCtrl(panel, CTRLID_CAL, wxDefaultDateTime, wxPoint(0,0), wxDefaultSize, wxSUNKEN_BORDER);
- m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_SEL_CHANGED, (wxObjectEventFunction)&wxCalendarBox::OnSelChange, 0, this);
- m_cal->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN, (wxObjectEventFunction)&wxCalendarBox::OnCalKey, 0, this);
- m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_DOUBLECLICKED, (wxObjectEventFunction)&wxCalendarBox::OnSelChange, 0, this);
- m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_DAY_CHANGED, (wxObjectEventFunction)&wxCalendarBox::OnSelChange, 0, this);
- m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_MONTH_CHANGED, (wxObjectEventFunction)&wxCalendarBox::OnSelChange, 0, this);
- m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_YEAR_CHANGED, (wxObjectEventFunction)&wxCalendarBox::OnSelChange, 0, this);
+ m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEventHandler(wxCalendarBox::OnSelChange), 0, this);
+ m_cal->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN, wxKeyEventHandler(wxCalendarBox::OnCalKey), 0, this);
+ m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_DOUBLECLICKED, wxCalendarEventHandler(wxCalendarBox::OnSelChange), 0, this);
+ m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_DAY_CHANGED, wxCalendarEventHandler(wxCalendarBox::OnSelChange), 0, this);
+ m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_MONTH_CHANGED, wxCalendarEventHandler(wxCalendarBox::OnSelChange), 0, this);
+ m_cal->Connect(CTRLID_CAL, CTRLID_CAL, wxEVT_CALENDAR_YEAR_CHANGED, wxCalendarEventHandler(wxCalendarBox::OnSelChange), 0, this);
wxWindow *yearControl = m_cal->GetYearControl();
- Connect(wxID_ANY, wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)&wxCalendarBox::OnSetFocus);
+ Connect(wxID_ANY, wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(wxCalendarBox::OnSetFocus));
wxClientDC dc(yearControl);
dc.SetFont(m_font);
@@ -260,20 +260,20 @@
if (m_txt)
{
- wxStringList valList;
+ wxArrayString valArray;
wxChar c;
for (c='0'; c <= '9'; c++)
- valList.Add(wxString(c, 1));
+ valArray.Add(wxString(c, 1));
wxChar *p=(wxChar*)m_format.c_str();
while (*p)
{
if (*p == '%')
p += 2;
else
- valList.Add(wxString(*p++, 1));
+ valArray.Add(wxString(*p++, 1));
}
wxTextValidator tv(wxFILTER_INCLUDE_CHAR_LIST);
- tv.SetIncludeList(valList);
+ tv.SetIncludes(valArray);
m_txt->SetValidator(tv);
}
Index: timespin.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/timespin.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -Lsrc/ui/timespin.cpp -Lsrc/ui/timespin.cpp -u -w -r1.6 -r1.7
--- src/ui/timespin.cpp
+++ src/ui/timespin.cpp
@@ -57,16 +57,16 @@
wxSize ss=m_spn->GetBestSize();
m_txt=new wxTextCtrl(this, CTRLID_TXT, wxEmptyString, wxPoint(0,0), wxSize(cs.x-ss.x, cs.y), wxNO_BORDER|wxWANTS_CHARS);
- m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN, (wxObjectEventFunction)&wxTimeSpinCtrl::OnEditKey, 0, this);
- m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KILL_FOCUS, (wxObjectEventFunction)&wxTimeSpinCtrl::OnKillFocus, 0, this);
+ m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KEY_DOWN, wxKeyEventHandler(wxTimeSpinCtrl::OnEditKey), 0, this);
+ m_txt->Connect(wxID_ANY, wxID_ANY, wxEVT_KILL_FOCUS, wxFocusEventHandler(wxTimeSpinCtrl::OnKillFocus), 0, this);
- wxStringList valList;
+ wxArrayString valArray;
wxChar c;
for (c='0'; c <= '9'; c++)
- valList.Add(wxString(c, 1));
- valList.Add(wxT(":"));
+ valArray.Add(wxString(c, 1));
+ valArray.Add(wxT(":"));
wxTextValidator tv(wxFILTER_INCLUDE_CHAR_LIST);
- tv.SetIncludeList(valList);
+ tv.SetIncludes(valArray);
m_txt->SetValidator(tv);
m_spn->SetSize(ss.x, cs.y);
Index: frmQuery.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/frmQuery.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -Lsrc/ui/frmQuery.cpp -Lsrc/ui/frmQuery.cpp -u -w -r1.80 -r1.81
--- src/ui/frmQuery.cpp
+++ src/ui/frmQuery.cpp
@@ -203,10 +203,10 @@
output->AddPage(msgResult, _("Messages"));
output->AddPage(msgHistory, _("History"));
- sqlQuery->Connect(wxID_ANY, wxEVT_SET_FOCUS,(wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&frmQuery::OnFocus);
- sqlResult->Connect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&frmQuery::OnFocus);
- msgResult->Connect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&frmQuery::OnFocus);
- msgHistory->Connect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&frmQuery::OnFocus);
+ sqlQuery->Connect(wxID_ANY, wxEVT_SET_FOCUS,wxFocusEventHandler(frmQuery::OnFocus));
+ sqlResult->Connect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
+ msgResult->Connect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
+ msgHistory->Connect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
int splitpos=settings->Read(wxT("frmQuery/Split"), 250);
if (splitpos < 50)
@@ -236,10 +236,10 @@
{
wxLogInfo(wxT("Destroying SQL Query box"));
- sqlQuery->Disconnect(wxID_ANY, wxEVT_SET_FOCUS,(wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&frmQuery::OnFocus);
- sqlResult->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&frmQuery::OnFocus);
- msgResult->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&frmQuery::OnFocus);
- msgHistory->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&frmQuery::OnFocus);
+ sqlQuery->Disconnect(wxID_ANY, wxEVT_SET_FOCUS,wxFocusEventHandler(frmQuery::OnFocus));
+ sqlResult->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
+ msgResult->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
+ msgHistory->Disconnect(wxID_ANY, wxEVT_SET_FOCUS, wxFocusEventHandler(frmQuery::OnFocus));
mainForm->RemoveFrame(this);
Index: events.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/events.cpp,v
retrieving revision 1.124
retrieving revision 1.125
diff -Lsrc/ui/events.cpp -Lsrc/ui/events.cpp -u -w -r1.124 -r1.125
--- src/ui/events.cpp
+++ src/ui/events.cpp
@@ -53,7 +53,7 @@
#include "frmMainConfig.h"
#include "frmHbaConfig.h"
#include "frmUpdate.h"
-
+#include "slFunctions.h"
extern wxString loadPath;
@@ -133,6 +133,12 @@
EVT_MENU(MNU_CONTEXTMENU, frmMain::OnContextMenu)
EVT_MENU(MNU_MAINCONFIG, frmMain::OnMainConfig)
EVT_MENU(MNU_HBACONFIG, frmMain::OnHbaConfig)
+ EVT_MENU(MNU_SLONY_RESTART, frmMain::OnRestartNode)
+ EVT_MENU(MNU_SLONY_UPGRADE, frmMain::OnUpgradeNode)
+ EVT_MENU(MNU_SLONY_FAILOVER, frmMain::OnFailover)
+ EVT_MENU(MNU_SLONY_MERGESET, frmMain::OnMergeSet)
+ EVT_MENU(MNU_SLONY_MOVESET, frmMain::OnMoveSet)
+
EVT_NOTEBOOK_PAGE_CHANGED(CTL_NOTEBOOK, frmMain::OnPageChange)
EVT_LIST_ITEM_SELECTED(CTL_PROPVIEW, frmMain::OnPropSelChanged)
EVT_LIST_ITEM_ACTIVATED(CTL_PROPVIEW, frmMain::OnPropSelActivated)
@@ -1125,6 +1131,13 @@
appendIfEnabled(MNU_CONNECT);
appendIfEnabled(MNU_DISCONNECT);
+ appendIfEnabled(MNU_SLONY_RESTART);
+ appendIfEnabled(MNU_SLONY_UPGRADE);
+ appendIfEnabled(MNU_SLONY_FAILOVER);
+ appendIfEnabled(MNU_SLONY_MERGESET);
+ appendIfEnabled(MNU_SLONY_MOVESET);
+
+
int newSize = treeContextMenu->GetMenuItemCount();
if (newSize > currentSize)
{
@@ -1392,3 +1405,53 @@
checkAlive();
}
}
+
+
+void frmMain::OnMergeSet(wxCommandEvent& event)
+{
+ if (currentObject)
+ {
+ if (!slFunctions::MergeSet(this, currentObject))
+ checkAlive();
+ }
+}
+
+
+void frmMain::OnMoveSet(wxCommandEvent& event)
+{
+ if (currentObject)
+ {
+ if (!slFunctions::MoveSet(this, currentObject))
+ checkAlive();
+ }
+}
+
+
+void frmMain::OnFailover(wxCommandEvent& event)
+{
+ if (currentObject)
+ {
+ if (!slFunctions::Failover(this, currentObject))
+ checkAlive();
+ }
+}
+
+
+void frmMain::OnUpgradeNode(wxCommandEvent& event)
+{
+ if (currentObject)
+ {
+ if (!slFunctions::UpgradeNode(this, currentObject))
+ checkAlive();
+ }
+}
+
+
+void frmMain::OnRestartNode(wxCommandEvent& event)
+{
+ if (currentObject)
+ {
+ if (!slFunctions::RestartNode(this, currentObject))
+ checkAlive();
+ }
+}
Index: frmMain.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/frmMain.cpp,v
retrieving revision 1.118
retrieving revision 1.119
diff -Lsrc/ui/frmMain.cpp -Lsrc/ui/frmMain.cpp -u -w -r1.118 -r1.119
--- src/ui/frmMain.cpp
+++ src/ui/frmMain.cpp
@@ -39,6 +39,7 @@
#include "pgConn.h"
#include "pgDatabase.h"
#include "pgSet.h"
+#include "slSet.h"
#include "pgServer.h"
#include "pgObject.h"
#include "pgCollection.h"
@@ -203,13 +204,21 @@
// toolsMenu->Append(MNU_INDEXCHECK, _("&FK Index check"), _("Checks existence of foreign key indexes"));
toolsMenu->Append(MNU_GRANTWIZARD, _("&Grant Wizard"), _("Grants rights to multiple objects"));
-#ifdef __WXDEBUG__
wxMenu *cfgMenu=new wxMenu();
cfgMenu->Append(MNU_MAINCONFIG, wxT("postgresql.conf"), _("Edit general server configuration file."));
cfgMenu->Append(MNU_HBACONFIG, wxT("pg_hba.conf"), _("Edit server access configuration file."));
-
toolsMenu->Append(MNU_CONFIGSUBMENU, _("Server configuration"), cfgMenu);
-#endif
+
+ slonyMenu=new wxMenu();
+ slonyMenu->Append(MNU_SLONY_RESTART, _("Restart node"), _("Restart node."));
+ slonyMenu->Append(MNU_SLONY_UPGRADE, _("Upgrade node"), _("Upgrade node to newest function version."));
+ slonyMenu->Append(MNU_SLONY_FAILOVER, _("Failover"), _("Failover to backup node."));
+ slonyMenu->Append(MNU_SLONY_MERGESET, _("Merge set"), _("Merge two replication sets."));
+ slonyMenu->Append(MNU_SLONY_MOVESET, _("Move set"), _("Move replication set to different node"));
+ toolsMenu->Append(MNU_SLONY_SUBMENU, _("Replication"), slonyMenu);
+
+ toolsMenu->AppendSeparator();
+
toolsMenu->Append(MNU_STATUS, _("&Server Status"), _("Displays the current database status."));
menuBar->Append(toolsMenu, _("&Tools"));
@@ -987,7 +996,9 @@
backup=false,
restore=false,
status=false,
- config=false;
+ config=false,
+ setissubscribed=false,
+ cluster=false;
if (obj)
{
@@ -1006,6 +1017,13 @@
switch (obj->GetType())
{
+ case SL_CLUSTER:
+ cluster=true;
+ break;
+ case SL_SET:
+ if (((slSet*)obj)->GetSubscriptionCount() > 0)
+ setissubscribed = true;
+ break;
case PG_SERVERS:
case PG_SERVER:
case PG_DATABASES:
@@ -1049,9 +1067,15 @@
toolsMenu->Enable(MNU_VIEWFILTEREDDATA, viewData);
toolsMenu->Enable(MNU_STARTSERVICE, false);
toolsMenu->Enable(MNU_STOPSERVICE, false);
-#ifdef __WXDEBUG__
toolsMenu->Enable(MNU_CONFIGSUBMENU, config);
-#endif
+
+ toolsMenu->Enable(MNU_SLONY_SUBMENU, cluster || setissubscribed);
+ slonyMenu->Enable(MNU_SLONY_RESTART, cluster);
+ slonyMenu->Enable(MNU_SLONY_UPGRADE, cluster);
+ slonyMenu->Enable(MNU_SLONY_FAILOVER, cluster);
+ slonyMenu->Enable(MNU_SLONY_MOVESET, setissubscribed);
+ slonyMenu->Enable(MNU_SLONY_MERGESET, setissubscribed);
+
viewMenu->Enable(MNU_REFRESH, refresh);
viewMenu->Enable(MNU_COUNT, false);
}