Commit d0509a61 authored by Felix Häcker's avatar Felix Häcker

add view only mode

parent 9e7ab4fe
......@@ -11,7 +11,19 @@
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
<object class="GtkCheckButton" id="view_only_checkbutton">
<property name="label" translatable="yes">View-Only mode</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="clicked" handler="view_only_checkbutton_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="disconnect_button">
......@@ -27,15 +39,6 @@
<property name="position">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="submenu">main</property>
......@@ -421,7 +424,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
......@@ -444,7 +447,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
<child>
......@@ -467,7 +470,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">4</property>
</packing>
</child>
</object>
......
......@@ -105,6 +105,10 @@ public class Remotely.VncBox : Box {
this.destroy();
}
public void set_view_only(bool b){
display.read_only = b;
}
public void set_zoom_mode(ZoomMode mode){
switch(mode){
case ZoomMode.FIT_WINDOW: {
......
......@@ -23,6 +23,7 @@ using Gtk;
public class Remotely.Window : Gtk.ApplicationWindow {
[GtkChild] Entry connect_entry;
[GtkChild] CheckButton view_only_checkbutton;
[GtkChild] Popover new_connection_popover;
[GtkChild] Revealer connection_revealer;
......@@ -93,6 +94,12 @@ public class Remotely.Window : Gtk.ApplicationWindow {
cbox.set_zoom_mode(ZoomMode.ORIGINAL_SIZE);
}
[GtkCallback]
private void view_only_checkbutton_clicked(){
VncBox cbox = (VncBox)vnc_notebook.get_nth_page(vnc_notebook.get_current_page());
cbox.set_view_only(view_only_checkbutton.active);
}
private void update_view(){
if(vnc_notebook.get_n_pages() > 1) vnc_notebook.show_tabs = true;
else vnc_notebook.show_tabs = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment