gtk4: break settings
This commit is contained in:
parent
4415da6f3b
commit
bb322f8614
|
@ -20,23 +20,18 @@
|
||||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.12"/>
|
<requires lib="gtk" version="4.0"/>
|
||||||
<object class="GtkAdjustment" id="adjustment_duration">
|
<object class="GtkAdjustment" id="adjustment_duration">
|
||||||
<property name="lower">1</property>
|
<property name="lower">1</property>
|
||||||
<property name="upper">3600</property>
|
<property name="upper">3600</property>
|
||||||
<property name="step_increment">1</property>
|
<property name="step-increment">1</property>
|
||||||
<property name="page_increment">10</property>
|
<property name="page-increment">10</property>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkAdjustment" id="adjustment_interval">
|
<object class="GtkAdjustment" id="adjustment_interval">
|
||||||
<property name="lower">1</property>
|
<property name="lower">1</property>
|
||||||
<property name="upper">120</property>
|
<property name="upper">120</property>
|
||||||
<property name="step_increment">1</property>
|
<property name="step-increment">1</property>
|
||||||
<property name="page_increment">10</property>
|
<property name="page-increment">10</property>
|
||||||
</object>
|
|
||||||
<object class="GtkImage" id="img_break">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="stock">gtk-missing-image</property>
|
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkListStore" id="lst_break_types">
|
<object class="GtkListStore" id="lst_break_types">
|
||||||
<columns>
|
<columns>
|
||||||
|
@ -53,152 +48,93 @@
|
||||||
</data>
|
</data>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkWindow" id="dialog_settings_break">
|
<object class="GtkWindow" id="dialog_settings_break">
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="title" translatable="yes">Properties</property>
|
<property name="title" translatable="yes">Properties</property>
|
||||||
<property name="resizable">False</property>
|
<property name="resizable">0</property>
|
||||||
<property name="modal">True</property>
|
<property name="modal">1</property>
|
||||||
<property name="window_position">center-on-parent</property>
|
<property name="default-width">500</property>
|
||||||
<property name="default_width">500</property>
|
<property name="default-height">50</property>
|
||||||
<property name="default_height">50</property>
|
<property name="destroy-with-parent">1</property>
|
||||||
<property name="destroy_with_parent">True</property>
|
<property name="icon-name">safeeyes</property>
|
||||||
<property name="icon_name">safeeyes</property>
|
|
||||||
<property name="type_hint">dialog</property>
|
|
||||||
<property name="skip_taskbar_hint">True</property>
|
|
||||||
<property name="gravity">center</property>
|
|
||||||
<signal name="delete-event" handler="on_window_delete" swapped="no"/>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box_settings">
|
<object class="GtkBox" id="box_settings">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-start">10</property>
|
||||||
<property name="margin_left">10</property>
|
<property name="margin-end">10</property>
|
||||||
<property name="margin_right">10</property>
|
<property name="margin-top">10</property>
|
||||||
<property name="margin_top">10</property>
|
<property name="margin-bottom">10</property>
|
||||||
<property name="margin_bottom">10</property>
|
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="spacing">5</property>
|
<property name="spacing">5</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="frame2">
|
<object class="GtkFrame" id="frame2">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkAlignment" id="alignment2">
|
<object class="GtkBox" id="box6">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-start">12</property>
|
||||||
<property name="left_padding">12</property>
|
<property name="margin-end">10</property>
|
||||||
|
<property name="margin-top">5</property>
|
||||||
|
<property name="margin-bottom">10</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
|
<property name="spacing">3</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box6">
|
<object class="GtkEntry" id="txt_break">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can-focus">1</property>
|
||||||
<property name="margin_right">10</property>
|
<property name="valign">center</property>
|
||||||
<property name="margin_top">5</property>
|
</object>
|
||||||
<property name="margin_bottom">10</property>
|
</child>
|
||||||
<property name="orientation">vertical</property>
|
<child>
|
||||||
<property name="spacing">3</property>
|
<object class="GtkBox" id="box7">
|
||||||
|
<property name="visible">1</property>
|
||||||
|
<property name="spacing">10</property>
|
||||||
|
<property name="homogeneous">1</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkEntry" id="txt_break">
|
<object class="GtkLabel" id="lbl_duration3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="halign">start</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
|
<property name="label" translatable="yes">Type</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box7">
|
<object class="GtkComboBox" id="cmb_type">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="model">lst_break_types</property>
|
||||||
<property name="spacing">10</property>
|
<property name="active">0</property>
|
||||||
|
<property name="id-column">0</property>
|
||||||
|
<property name="halign">end</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="lbl_duration3">
|
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
||||||
<property name="visible">True</property>
|
<attributes>
|
||||||
<property name="can_focus">False</property>
|
<attribute name="text">0</attribute>
|
||||||
<property name="halign">start</property>
|
</attributes>
|
||||||
<property name="valign">center</property>
|
|
||||||
<property name="label" translatable="yes">Type</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkComboBox" id="cmb_type">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="model">lst_break_types</property>
|
|
||||||
<property name="active">0</property>
|
|
||||||
<property name="id_column">0</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkCellRendererText" id="cellrenderertext1"/>
|
|
||||||
<attributes>
|
|
||||||
<attribute name="text">0</attribute>
|
|
||||||
</attributes>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
</child>
|
||||||
<property name="expand">False</property>
|
</object>
|
||||||
<property name="fill">True</property>
|
</child>
|
||||||
<property name="position">1</property>
|
<child>
|
||||||
</packing>
|
<object class="GtkBox" id="box8">
|
||||||
|
<property name="visible">1</property>
|
||||||
|
<property name="spacing">10</property>
|
||||||
|
<property name="homogeneous">1</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="lbl_duration4">
|
||||||
|
<property name="visible">1</property>
|
||||||
|
<property name="halign">start</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="label" translatable="yes">Image</property>
|
||||||
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box8">
|
<object class="GtkButton" id="btn_image">
|
||||||
<property name="visible">True</property>
|
<property name="halign">end</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="label" translatable="yes">Select</property>
|
||||||
<property name="spacing">10</property>
|
<property name="visible">1</property>
|
||||||
<child>
|
<property name="can-focus">1</property>
|
||||||
<object class="GtkLabel" id="lbl_duration4">
|
<property name="receives-default">1</property>
|
||||||
<property name="visible">True</property>
|
<property name="icon-name">gtk-missing-image</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="valign">center</property>
|
|
||||||
<property name="label" translatable="yes">Image</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="btn_image">
|
|
||||||
<property name="label" translatable="yes">Select</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="image">img_break</property>
|
|
||||||
<property name="always_show_image">True</property>
|
|
||||||
<signal name="clicked" handler="select_image" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
@ -206,377 +142,208 @@
|
||||||
</child>
|
</child>
|
||||||
<child type="label">
|
<child type="label">
|
||||||
<object class="GtkLabel" id="label2">
|
<object class="GtkLabel" id="label2">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Break</property>
|
<property name="label" translatable="yes">Break</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="frame4">
|
<object class="GtkFrame" id="frame4">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkAlignment" id="alignment4">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="left_padding">12</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box9">
|
<object class="GtkBox" id="box9">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-start">12</property>
|
||||||
<property name="margin_right">10</property>
|
<property name="margin-end">10</property>
|
||||||
<property name="margin_top">5</property>
|
<property name="margin-top">5</property>
|
||||||
<property name="margin_bottom">10</property>
|
<property name="margin-bottom">10</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="spacing">3</property>
|
<property name="spacing">3</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box10">
|
<object class="GtkBox" id="box10">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="spacing">10</property>
|
<property name="spacing">10</property>
|
||||||
|
<property name="homogeneous">1</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="lbl_duration5">
|
<object class="GtkLabel" id="lbl_duration5">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="label" translatable="yes">Override</property>
|
<property name="label" translatable="yes">Override</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="switch_override_interval">
|
<object class="GtkSwitch" id="switch_override_interval">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can-focus">1</property>
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box11">
|
<object class="GtkBox" id="box11">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="spacing">100</property>
|
<property name="spacing">100</property>
|
||||||
|
<property name="homogeneous">1</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="lbl_duration6">
|
<object class="GtkLabel" id="lbl_duration6">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="label" translatable="yes">Time (in minutes)</property>
|
<property name="label" translatable="yes">Time (in minutes)</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSpinButton" id="spin_interval">
|
<object class="GtkSpinButton" id="spin_interval">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can-focus">1</property>
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="text" translatable="yes">0</property>
|
<property name="text" translatable="yes">0</property>
|
||||||
<property name="adjustment">adjustment_interval</property>
|
<property name="adjustment">adjustment_interval</property>
|
||||||
<property name="numeric">True</property>
|
<property name="numeric">1</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
</child>
|
||||||
<child type="label">
|
<child type="label">
|
||||||
<object class="GtkLabel" id="label4">
|
<object class="GtkLabel" id="label4">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Time to wait</property>
|
<property name="label" translatable="yes">Time to wait</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="frame1">
|
<object class="GtkFrame" id="frame1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkAlignment" id="alignment1">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="left_padding">12</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box2">
|
<object class="GtkBox" id="box2">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-start">12</property>
|
||||||
<property name="margin_right">10</property>
|
<property name="margin-end">10</property>
|
||||||
<property name="margin_top">5</property>
|
<property name="margin-top">5</property>
|
||||||
<property name="margin_bottom">10</property>
|
<property name="margin-bottom">10</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="spacing">3</property>
|
<property name="spacing">3</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box4">
|
<object class="GtkBox" id="box4">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="spacing">10</property>
|
<property name="spacing">10</property>
|
||||||
|
<property name="homogeneous">1</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="lbl_duration1">
|
<object class="GtkLabel" id="lbl_duration1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="label" translatable="yes">Override</property>
|
<property name="label" translatable="yes">Override</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="switch_override_duration">
|
<object class="GtkSwitch" id="switch_override_duration">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can-focus">1</property>
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box3">
|
<object class="GtkBox" id="box3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="spacing">100</property>
|
<property name="spacing">100</property>
|
||||||
|
<property name="homogeneous">1</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="lbl_duration">
|
<object class="GtkLabel" id="lbl_duration">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="label" translatable="yes">Time (in seconds)</property>
|
<property name="label" translatable="yes">Time (in seconds)</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSpinButton" id="spin_duration">
|
<object class="GtkSpinButton" id="spin_duration">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can-focus">1</property>
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="adjustment">adjustment_duration</property>
|
<property name="adjustment">adjustment_duration</property>
|
||||||
<property name="numeric">True</property>
|
<property name="numeric">1</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
</child>
|
||||||
<child type="label">
|
<child type="label">
|
||||||
<object class="GtkLabel" id="label1">
|
<object class="GtkLabel" id="label1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Duration</property>
|
<property name="label" translatable="yes">Duration</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="frame3">
|
<object class="GtkFrame" id="frame3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkAlignment" id="alignment3">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="left_padding">12</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="box1">
|
<object class="GtkBox" id="box1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-start">12</property>
|
||||||
<property name="margin_top">5</property>
|
<property name="margin-top">5</property>
|
||||||
<property name="margin_bottom">10</property>
|
<property name="margin-bottom">10</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="spacing">3</property>
|
<property name="spacing">3</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="box5">
|
<object class="GtkBox" id="box5">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-end">10</property>
|
||||||
<property name="margin_right">10</property>
|
<property name="margin-top">5</property>
|
||||||
<property name="margin_top">5</property>
|
<property name="margin-bottom">10</property>
|
||||||
<property name="margin_bottom">10</property>
|
|
||||||
<property name="spacing">10</property>
|
<property name="spacing">10</property>
|
||||||
|
<property name="homogeneous">1</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="lbl_duration2">
|
<object class="GtkLabel" id="lbl_duration2">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="label" translatable="yes">Override</property>
|
<property name="label" translatable="yes">Override</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="switch_override_plugins">
|
<object class="GtkSwitch" id="switch_override_plugins">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can-focus">1</property>
|
||||||
<property name="halign">end</property>
|
<property name="halign">end</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkGrid" id="grid_plugins">
|
<object class="GtkGrid" id="grid_plugins">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="margin-end">10</property>
|
||||||
<property name="margin_right">10</property>
|
<property name="margin-bottom">10</property>
|
||||||
<property name="margin_bottom">10</property>
|
<property name="row-homogeneous">1</property>
|
||||||
<property name="row_homogeneous">True</property>
|
<property name="column-homogeneous">1</property>
|
||||||
<property name="column_homogeneous">True</property>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
</child>
|
||||||
<child type="label">
|
<child type="label">
|
||||||
<object class="GtkLabel" id="label3">
|
<object class="GtkLabel" id="label3">
|
||||||
<property name="visible">True</property>
|
<property name="visible">1</property>
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Plugins</property>
|
<property name="label" translatable="yes">Plugins</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">False</property>
|
|
||||||
<property name="position">3</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
|
@ -24,8 +24,8 @@ from safeeyes import utility
|
||||||
from safeeyes.model import Config
|
from safeeyes.model import Config
|
||||||
|
|
||||||
gi.require_version('Gtk', '4.0')
|
gi.require_version('Gtk', '4.0')
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk, Gio
|
||||||
from gi.repository import GdkPixbuf
|
from gi.repository import GdkPixbuf, Gdk
|
||||||
|
|
||||||
|
|
||||||
SETTINGS_DIALOG_GLADE = os.path.join(utility.BIN_DIRECTORY, "glade/settings_dialog.glade")
|
SETTINGS_DIALOG_GLADE = os.path.join(utility.BIN_DIRECTORY, "glade/settings_dialog.glade")
|
||||||
|
@ -442,7 +442,6 @@ class BreakSettingsDialog:
|
||||||
self.on_remove = on_remove
|
self.on_remove = on_remove
|
||||||
|
|
||||||
builder = utility.create_gtk_builder(SETTINGS_DIALOG_BREAK_GLADE)
|
builder = utility.create_gtk_builder(SETTINGS_DIALOG_BREAK_GLADE)
|
||||||
builder.connect_signals(self)
|
|
||||||
self.window = builder.get_object('dialog_settings_break')
|
self.window = builder.get_object('dialog_settings_break')
|
||||||
self.txt_break = builder.get_object('txt_break')
|
self.txt_break = builder.get_object('txt_break')
|
||||||
self.switch_override_interval = builder.get_object('switch_override_interval')
|
self.switch_override_interval = builder.get_object('switch_override_interval')
|
||||||
|
@ -450,7 +449,7 @@ class BreakSettingsDialog:
|
||||||
self.switch_override_plugins = builder.get_object('switch_override_plugins')
|
self.switch_override_plugins = builder.get_object('switch_override_plugins')
|
||||||
self.spin_interval = builder.get_object('spin_interval')
|
self.spin_interval = builder.get_object('spin_interval')
|
||||||
self.spin_duration = builder.get_object('spin_duration')
|
self.spin_duration = builder.get_object('spin_duration')
|
||||||
self.img_break = builder.get_object('img_break')
|
self.btn_image = builder.get_object('btn_image')
|
||||||
self.cmb_type = builder.get_object('cmb_type')
|
self.cmb_type = builder.get_object('cmb_type')
|
||||||
|
|
||||||
grid_plugins = builder.get_object('grid_plugins')
|
grid_plugins = builder.get_object('grid_plugins')
|
||||||
|
@ -488,7 +487,7 @@ class BreakSettingsDialog:
|
||||||
row = 0
|
row = 0
|
||||||
col = 0
|
col = 0
|
||||||
for plugin_id in plugin_map.keys():
|
for plugin_id in plugin_map.keys():
|
||||||
chk_button = Gtk.CheckButton(_(plugin_map[plugin_id]))
|
chk_button = Gtk.CheckButton.new_with_label(_(plugin_map[plugin_id]))
|
||||||
self.plugin_check_buttons[plugin_id] = chk_button
|
self.plugin_check_buttons[plugin_id] = chk_button
|
||||||
grid_plugins.attach(chk_button, row, col, 1, 1)
|
grid_plugins.attach(chk_button, row, col, 1, 1)
|
||||||
if plugins_overriden:
|
if plugins_overriden:
|
||||||
|
@ -499,14 +498,21 @@ class BreakSettingsDialog:
|
||||||
if row > 2:
|
if row > 2:
|
||||||
col += 1
|
col += 1
|
||||||
row = 0
|
row = 0
|
||||||
# GtkSwitch state-set signal is available only from 3.14
|
|
||||||
if Gtk.get_minor_version() >= 14:
|
if 'image' in self.break_config:
|
||||||
self.switch_override_interval.connect('state-set', self.on_switch_override_interval_activate)
|
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(self.break_config['image'], 16, 16, True)
|
||||||
self.switch_override_duration.connect('state-set', self.on_switch_override_duration_activate)
|
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||||
self.switch_override_plugins.connect('state-set', self.on_switch_override_plugins_activate)
|
self.btn_image.set_child(image)
|
||||||
self.on_switch_override_interval_activate(self.switch_override_interval, self.switch_override_interval.get_active())
|
|
||||||
self.on_switch_override_duration_activate(self.switch_override_duration, self.switch_override_duration.get_active())
|
self.window.connect("close-request", self.on_window_delete)
|
||||||
self.on_switch_override_plugins_activate(self.switch_override_plugins, self.switch_override_plugins.get_active())
|
self.btn_image.connect('clicked', self.select_image)
|
||||||
|
|
||||||
|
self.switch_override_interval.connect('state-set', self.on_switch_override_interval_activate)
|
||||||
|
self.switch_override_duration.connect('state-set', self.on_switch_override_duration_activate)
|
||||||
|
self.switch_override_plugins.connect('state-set', self.on_switch_override_plugins_activate)
|
||||||
|
self.on_switch_override_interval_activate(self.switch_override_interval, self.switch_override_interval.get_active())
|
||||||
|
self.on_switch_override_duration_activate(self.switch_override_duration, self.switch_override_duration.get_active())
|
||||||
|
self.on_switch_override_plugins_activate(self.switch_override_plugins, self.switch_override_plugins.get_active())
|
||||||
|
|
||||||
def on_switch_override_interval_activate(self, switch_button, state):
|
def on_switch_override_interval_activate(self, switch_button, state):
|
||||||
"""
|
"""
|
||||||
|
@ -531,24 +537,36 @@ class BreakSettingsDialog:
|
||||||
"""
|
"""
|
||||||
Show a file chooser dialog and let the user to select an image.
|
Show a file chooser dialog and let the user to select an image.
|
||||||
"""
|
"""
|
||||||
dialog = Gtk.FileChooserDialog(_('Please select an image'), self.window, Gtk.FileChooserAction.OPEN, (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
|
dialog = Gtk.FileDialog()
|
||||||
|
dialog.set_title(_('Please select an image'))
|
||||||
|
|
||||||
png_filter = Gtk.FileFilter()
|
png_filter = Gtk.FileFilter()
|
||||||
png_filter.set_name("PNG files")
|
png_filter.set_name("PNG files")
|
||||||
png_filter.add_mime_type("image/png")
|
png_filter.add_mime_type("image/png")
|
||||||
png_filter.add_pattern("*.png")
|
png_filter.add_pattern("*.png")
|
||||||
dialog.add_filter(png_filter)
|
filters = Gio.ListStore.new(Gtk.FileFilter)
|
||||||
|
filters.append(png_filter)
|
||||||
|
dialog.set_filters(filters)
|
||||||
|
|
||||||
response = dialog.run()
|
dialog.open(self.window, None, self.select_image_callback)
|
||||||
if response == Gtk.ResponseType.OK:
|
|
||||||
self.break_config['image'] = dialog.get_filename()
|
def select_image_callback(self, dialog, result):
|
||||||
|
response = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
response = dialog.open_finish(result)
|
||||||
|
except Exception:
|
||||||
|
# user pressing "Cancel" throws a generic exception here
|
||||||
|
pass
|
||||||
|
|
||||||
|
if response is not None:
|
||||||
|
self.break_config['image'] = response.get_path()
|
||||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(self.break_config['image'], 16, 16, True)
|
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(self.break_config['image'], 16, 16, True)
|
||||||
self.img_break.set_from_pixbuf(pixbuf)
|
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||||
elif response == Gtk.ResponseType.CANCEL:
|
self.btn_image.set_child(image)
|
||||||
|
else:
|
||||||
self.break_config.pop('image', None)
|
self.break_config.pop('image', None)
|
||||||
self.img_break.set_from_stock('gtk-missing-image', Gtk.IconSize.BUTTON)
|
self.btn_image.set_icon_name('gtk-missing-image')
|
||||||
|
|
||||||
dialog.destroy()
|
|
||||||
|
|
||||||
def on_window_delete(self, *args):
|
def on_window_delete(self, *args):
|
||||||
"""
|
"""
|
||||||
|
@ -594,7 +612,7 @@ class BreakSettingsDialog:
|
||||||
"""
|
"""
|
||||||
Show the Properties dialog.
|
Show the Properties dialog.
|
||||||
"""
|
"""
|
||||||
self.window.show_all()
|
self.window.present()
|
||||||
|
|
||||||
|
|
||||||
class NewBreakDialog:
|
class NewBreakDialog:
|
||||||
|
|
Loading…
Reference in New Issue