summaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2005-12-01 15:48:39 +0000
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>2005-12-01 15:48:39 +0000
commit564dd13d7ae1b54964710052a0ee275703ddd853 (patch)
tree209e590a904ff084a025f5acc5c6792518941d83 /vncviewer
parentbaa71192bef100f7d2d3eec381116a45f4e5d67e (diff)
downloadtigervnc-564dd13d7ae1b54964710052a0ee275703ddd853.tar.gz
tigervnc-564dd13d7ae1b54964710052a0ee275703ddd853.zip
Added implementation of the vnc viewer options parameter "Show toolbar by default".
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@425 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/OptionsDialog.cxx2
-rw-r--r--vncviewer/cview.cxx13
2 files changed, 11 insertions, 4 deletions
diff --git a/vncviewer/OptionsDialog.cxx b/vncviewer/OptionsDialog.cxx
index 8655dc70..0985f5b1 100644
--- a/vncviewer/OptionsDialog.cxx
+++ b/vncviewer/OptionsDialog.cxx
@@ -165,6 +165,7 @@ public:
enableItem(IDC_PROTOCOL_3_3, (!dlg->view) || (dlg->view->state() != CConnection::RFBSTATE_NORMAL));
setItemChecked(IDC_PROTOCOL_3_3, dlg->options.protocol3_3);
setItemChecked(IDC_ACCEPT_BELL, dlg->options.acceptBell);
+ setItemChecked(IDC_SHOW_TOOLBAR, dlg->options.showToolbar);
}
virtual bool onOk() {
dlg->options.shared = isItemChecked(IDC_CONN_SHARED);
@@ -173,6 +174,7 @@ public:
dlg->options.useDesktopResize = isItemChecked(IDC_DESKTOP_RESIZE);
dlg->options.protocol3_3 = isItemChecked(IDC_PROTOCOL_3_3);
dlg->options.acceptBell = isItemChecked(IDC_ACCEPT_BELL);
+ dlg->options.showToolbar = isItemChecked(IDC_SHOW_TOOLBAR);
((VNCviewerOptions*)propSheet)->setChanged();
return true;
}
diff --git a/vncviewer/cview.cxx b/vncviewer/cview.cxx
index 413d1a7b..d73a170e 100644
--- a/vncviewer/cview.cxx
+++ b/vncviewer/cview.cxx
@@ -263,9 +263,6 @@ CView::CView()
// Create the backing buffer
buffer = new win32::DIBSectionBuffer(getFrameHandle());
-
- // Show the toolbar if needed
- if (toolbar) tb.show();
}
CView::~CView() {
@@ -285,7 +282,7 @@ bool CView::initialise(network::Socket* s) {
HMENU wndmenu = GetSystemMenu(hwnd, FALSE);
AppendMenu(wndmenu, MF_SEPARATOR, 0, 0);
AppendMenu(wndmenu, MF_STRING, IDM_FULLSCREEN, _T("&Full screen"));
- AppendMenu(wndmenu, (toolbar ? MF_STRING | MF_CHECKED : MF_STRING),
+ AppendMenu(wndmenu, (options.showToolbar ? MF_STRING | MF_CHECKED : MF_STRING),
IDM_SHOW_TOOLBAR, _T("Show tool&bar"));
AppendMenu(wndmenu, MF_SEPARATOR, 0, 0);
AppendMenu(wndmenu, MF_STRING, IDM_CTRL_KEY, _T("Ctr&l"));
@@ -323,6 +320,11 @@ bool CView::initialise(network::Socket* s) {
m_fileTransfer.initialize(&s->inStream(), &s->outStream());
+ // Show toolbar if needed
+ toolbar = options.showToolbar;
+ if (options.showToolbar) tb.show();
+ else tb.hide();
+
return true;
}
@@ -397,6 +399,9 @@ CView::applyOptions(CViewOptions& opt) {
// - Bell
options.acceptBell = opt.acceptBell;
+
+ // - Show/hide toolbar
+ options.showToolbar = opt.showToolbar;
}
void