1
1
//////////////////////////////////////////////////////////////////////////
3
3
// pgAdmin III - PostgreSQL Tools
4
// RCS-ID: $Id: frmStatus.h 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: frmStatus.h 7901 2009-06-09 11:19:10Z dpage $
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
6
// This software is released under the BSD Licence
8
8
// frmStatus.h - Status Screen
19
19
#include <wx/spinctrl.h>
20
20
#include <wx/notebook.h>
23
#include <wx/aui/aui.h>
24
#include <wx/aui/auibook.h>
22
26
#include "dlg/dlgClasses.h"
23
27
#include "utils/factory.h"
25
#define CTL_STATUSLIST 300
67
#define FRMSTATUS_PERSPECTIVE_VER wxT("$Rev: 7901 $")
70
#define FRMSTATUS_DEFAULT_PERSPECTIVE wxT("layout2|name=Activity;caption=Activity;state=6293500;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=321;besth=244;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=462;floaty=165;floatw=595;floath=282|name=Locks;caption=Locks;state=6293500;dir=4;layer=0;row=0;pos=1;prop=100000;bestw=321;besth=244;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-231;floaty=235;floatw=595;floath=282|name=Transactions;caption=Transactions;state=6293500;dir=4;layer=0;row=0;pos=2;prop=100000;bestw=0;besth=0;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=461;floaty=527;floatw=595;floath=282|name=Logfile;caption=Logfile;state=6293500;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=0;besth=0;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-103;floaty=351;floatw=595;floath=282|name=toolBar;caption=Tool bar;state=2124528;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=608;besth=33;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=888;floaty=829;floatw=558;floath=49|dock_size(4,0,0)=583|dock_size(5,0,0)=10|dock_size(1,10,0)=35|")
73
#define FRMSTATUS_DEFAULT_PERSPECTIVE wxT("layout2|name=Activity;caption=Activity;state=6293500;dir=4;layer=0;row=0;pos=2;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=Locks;caption=Locks;state=6293500;dir=4;layer=0;row=0;pos=1;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=Transactions;caption=Transactions;state=6293500;dir=4;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=Logfile;caption=Logfile;state=6293500;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=toolBar;caption=Tool bar;state=2108144;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=720;besth=31;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(4,0,0)=549|dock_size(5,0,0)=22|dock_size(1,10,0)=33|")
75
#define FRMSTATUS_DEFAULT_PERSPECTIVE wxT("layout2|name=Activity;caption=Activity;state=6309884;dir=4;layer=0;row=1;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=174;floaty=216;floatw=578;floath=282|name=Locks;caption=Locks;state=6293500;dir=4;layer=0;row=1;pos=1;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=136;floaty=339;floatw=576;floath=283|name=Transactions;caption=Transactions;state=6293500;dir=4;layer=0;row=1;pos=2;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=133;floaty=645;floatw=577;floath=283|name=Logfile;caption=Logfile;state=6293500;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=20;besth=20;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=toolBar;caption=Tool bar;state=2108144;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=516;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=586;floaty=525;floatw=483;floath=49|dock_size(5,0,0)=22|dock_size(1,10,0)=25|dock_size(4,0,1)=627|")
80
static wxCriticalSection gs_critsect;
27
83
// Class declarations
29
class frmStatus : public pgDialog
85
class frmStatus : public pgFrame
32
88
frmStatus(frmMain *form, const wxString& _title, pgConn *conn);
99
bool logHasTimestamp, logFormatKnown;
102
wxDateTime logfileTimestamp, latestTimestamp;
103
wxString logDirectory, logfileName;
105
wxString savedPartialLine;
107
bool showCurrent, isCurrent;
116
ctlComboBoxFix *cbRate;
117
wxComboBox *cbLogfiles;
118
wxButton *btnRotateLog;
120
wxTimer *refreshUITimer;
121
wxTimer *statusTimer, *locksTimer, *xactTimer, *logTimer;
122
int statusRate, locksRate, xactRate, logRate;
124
ctlListView *statusList;
125
ctlListView *lockList;
126
ctlListView *xactList;
127
ctlListView *logList;
130
wxString rateToCboString(int rate);
132
void AddStatusPane();
37
137
void OnHelp(wxCommandEvent& ev);
38
void OnCloseBtn(wxCommandEvent &event);
138
void OnExit(wxCommandEvent& event);
140
void OnCopy(wxCommandEvent& ev);
142
void OnToggleStatusPane(wxCommandEvent& event);
143
void OnToggleLockPane(wxCommandEvent& event);
144
void OnToggleXactPane(wxCommandEvent& event);
145
void OnToggleLogPane(wxCommandEvent& event);
146
void OnToggleToolBar(wxCommandEvent& event);
147
void OnDefaultView(wxCommandEvent& event);
149
void OnRefreshUITimer(wxTimerEvent &event);
150
void OnRefreshStatusTimer(wxTimerEvent &event);
151
void OnRefreshLocksTimer(wxTimerEvent &event);
152
void OnRefreshXactTimer(wxTimerEvent &event);
153
void OnRefreshLogTimer(wxTimerEvent &event);
155
void OnRateChange(wxCommandEvent &event);
157
void OnPaneClose(wxAuiManagerEvent& evt);
39
159
void OnClose(wxCloseEvent &event);
40
160
void OnRefresh(wxCommandEvent &event);
41
void OnRefreshTimer(wxTimerEvent &event);
42
void OnRateChange(wxScrollEvent &event);
43
void OnNotebookPageChanged(wxNotebookEvent& event);
161
void OnCancelBtn(wxCommandEvent &event);
162
void OnStatusCancelBtn(wxCommandEvent &event);
163
void OnLocksCancelBtn(wxCommandEvent &event);
44
164
void OnTerminateBtn(wxCommandEvent &event);
45
void OnCancelBtn(wxCommandEvent &event);
165
void OnStatusTerminateBtn(wxCommandEvent &event);
166
void OnLocksTerminateBtn(wxCommandEvent &event);
46
167
void OnSelStatusItem(wxListEvent &event);
47
168
void OnSelLockItem(wxListEvent &event);
48
169
void OnSelXactItem(wxListEvent &event);
170
void OnSelLogItem(wxListEvent &event);
49
171
void OnLoadLogfile(wxCommandEvent &event);
50
172
void OnRotateLogfile(wxCommandEvent &event);
51
173
void OnCommit(wxCommandEvent &event);
57
179
void addLogFile(wxDateTime *dt, bool skipFirst);
58
180
void addLogFile(const wxString &filename, const wxDateTime timestamp, long len, long &read, bool skipFirst);
59
void addLogLine(const wxString &str, bool formatted=true);
181
void addLogLine(const wxString &str, bool formatted=true, bool csv_log_format=false);
61
183
void checkConnection();
64
wxButton *btnCancelSt, *btnTerminateSt,*btnCancelLk, *btnTerminateLk, *btnCommit, *btnRollback;
67
bool logHasTimestamp, logFormatKnown;
70
wxDateTime logfileTimestamp, latestTimestamp;
71
wxString logDirectory, logfileName;
72
bool showCurrent, isCurrent;
79
int xactPage, logPage;
81
185
DECLARE_EVENT_TABLE()
85
189
class serverStatusFactory : public actionFactory
88
serverStatusFactory(menuFactoryList *list, wxMenu *mnu, wxToolBar *toolbar);
192
serverStatusFactory(menuFactoryList *list, wxMenu *mnu, ctlMenuToolbar *toolbar);
89
193
wxWindow *StartDialog(frmMain *form, pgObject *obj);
90
194
bool CheckEnable(pgObject *obj);