Index: CHANGELOG.txt
===================================================================
RCS file: /projects/pgadmin3/CHANGELOG.txt,v
retrieving revision 1.116
retrieving revision 1.117
diff -LCHANGELOG.txt -LCHANGELOG.txt -u -w -r1.116 -r1.117
--- CHANGELOG.txt
+++ CHANGELOG.txt
@@ -16,6 +16,8 @@
+ - 2004-01-21 AP Improved disconnect handling
+
- 2004-01-21 AP StatusBar with size handle for frmStatus, dlgFunction and dlgView
- 2004-01-21 AP Update ServerStatus to pg_logdir_ls
- 2004-01-21 AP catch SIGPIPE
- 2004-01-20 AP owner, name, comment refactoring in dlgProperty
Index: dlgProperty.h
===================================================================
RCS file: /projects/pgadmin3/src/include/dlgProperty.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -Lsrc/include/dlgProperty.h -Lsrc/include/dlgProperty.h -u -w -r1.37 -r1.38
--- src/include/dlgProperty.h
+++ src/include/dlgProperty.h
@@ -30,8 +30,8 @@
class dlgProperty : public DialogWithHelp
{
public:
- static void CreateObjectDialog(frmMain *frame, pgObject *node, int type);
- static void EditObjectDialog(frmMain *frame, ctlSQLBox *sqlbox, pgObject *node);
+ static bool CreateObjectDialog(frmMain *frame, pgObject *node, int type);
+ static bool EditObjectDialog(frmMain *frame, ctlSQLBox *sqlbox, pgObject *node);
wxString GetName();
@@ -83,6 +83,7 @@
wxTextValidator numericValidator;
wxTextCtrl *statusBox;
+ wxStatusBar *statusBar;
wxNotebook *nbNotebook;
wxTextCtrl *txtName, *txtOid, *txtComment;
ctlComboBox *cbOwner;
Index: dlgProperty.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/dlgProperty.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -Lsrc/ui/dlgProperty.cpp -Lsrc/ui/dlgProperty.cpp -u -w -r1.79 -r1.80
--- src/ui/dlgProperty.cpp
+++ src/ui/dlgProperty.cpp
@@ -116,7 +116,16 @@
wxSize size=GetSize();
- if (wxWindow::FindWindow(XRCID("txtStatus")))
+ if (XRCID("unkStatusBar"))
+ {
+ statusBox = 0;
+ statusBar = new wxStatusBar(this, -1);
+ wxXmlResource::Get()->AttachUnknownControl(wxT("unkStatusBar"), statusBar);
+ }
+ else
+ {
+ statusBar = 0;
+ if (XRCID("txtStatus"))
statusBox=CTRL_TEXT("txtStatus");
else
{
@@ -128,9 +137,9 @@
size.SetHeight(stdTxtSize.GetHeight());
statusBox = new wxTextCtrl(this, 178, wxT(""), pos, size, wxTE_READONLY);
}
-
statusBox->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
}
+}
dlgProperty::~dlgProperty()
@@ -164,7 +173,10 @@
{
if (!condition)
{
+ if (statusBox)
statusBox->SetValue(msg);
+ if (statusBar)
+ statusBar->SetStatusText(msg);
enable=false;
}
}
@@ -187,7 +199,12 @@
btnOK->Enable(enable);
if (enable)
- statusBox->SetValue(wxT(""));
+ {
+ if (statusBox)
+ statusBox->SetValue(wxEmptyString);
+ if (statusBar)
+ statusBar->SetStatusText(wxEmptyString);
+ }
}
@@ -527,7 +544,10 @@
if (!apply(sql))
return;
+ if (statusBox)
statusBox->SetValue(_("Changes applied."));
+ if (statusBar)
+ statusBar->SetStatusText(_("Changes applied."));
}
@@ -750,11 +770,11 @@
}
-void dlgProperty::CreateObjectDialog(frmMain *frame, pgObject *node, int type)
+bool dlgProperty::CreateObjectDialog(frmMain *frame, pgObject *node, int type)
{
pgConn *conn=node->GetConnection();
- if (!conn || conn->GetStatus() != PGCONN_OK)
- return;
+ if (!conn || conn->GetStatus() != PGCONN_OK || !conn->IsAlive())
+ return false;
dlgProperty *dlg=CreateDlg(frame, node, true, type);
@@ -767,14 +787,16 @@
}
else
wxMessageBox(_("Not implemented."));
+
+ return true;
}
-void dlgProperty::EditObjectDialog(frmMain *frame, ctlSQLBox *sqlbox, pgObject *node)
+bool dlgProperty::EditObjectDialog(frmMain *frame, ctlSQLBox *sqlbox, pgObject *node)
{
pgConn *conn=node->GetConnection();
- if (!conn || conn->GetStatus() != PGCONN_OK)
- return;
+ if (!conn || conn->GetStatus() != PGCONN_OK || !conn->IsAlive())
+ return false;
dlgProperty *dlg=CreateDlg(frame, node, false);
@@ -787,6 +809,8 @@
}
else
wxMessageBox(_("Not implemented."));
+
+ return true;
}
Index: events.cpp
===================================================================
RCS file: /projects/pgadmin3/src/ui/events.cpp,v
retrieving revision 1.98
retrieving revision 1.99
diff -Lsrc/ui/events.cpp -Lsrc/ui/events.cpp -u -w -r1.98 -r1.99
--- src/ui/events.cpp
+++ src/ui/events.cpp
@@ -1092,7 +1092,8 @@
if (data)
{
- dlgProperty::CreateObjectDialog(this, data, -1);
+ if (!dlgProperty::CreateObjectDialog(this, data, -1))
+ checkAlive();
}
}
@@ -1108,7 +1109,10 @@
pgObject *data = GetSelectedObject();
if (data)
- dlgProperty::CreateObjectDialog(this, data, type);
+ {
+ if (!dlgProperty::CreateObjectDialog(this, data, type))
+ checkAlive();
+ }
}
@@ -1117,7 +1121,10 @@
pgObject *data = GetSelectedObject();
if (data)
- dlgProperty::EditObjectDialog(this, sqlPane, data);
+ {
+ if (!dlgProperty::EditObjectDialog(this, sqlPane, data))
+ checkAlive();
+ }
}
////////////////////////////////////////////////////////////////////////////////
Index: dlgFunction.xrc
===================================================================
RCS file: /projects/pgadmin3/src/ui/common/dlgFunction.xrc,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lsrc/ui/common/dlgFunction.xrc -Lsrc/ui/common/dlgFunction.xrc -u -w -r1.15 -r1.16
--- src/ui/common/dlgFunction.xrc
+++ src/ui/common/dlgFunction.xrc
@@ -315,9 +315,8 @@
0