Skip to content
Snippets Groups Projects
Commit 46ec83a1 authored by Anwar_N's avatar Anwar_N
Browse files

UI refined

parent 6826982f
Branches
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ class ibus_sharada_braille_preferences():
self.guibuilder.add_from_file("/usr/share/ibus-braille-preferences/ui.glade")
self.window = self.guibuilder.get_object("window")
self.combobox_default_languge = self.guibuilder.get_object("combobox_default_languge")
self.box_general = self.guibuilder.get_object("box_general")
self.box_ibus_table = self.guibuilder.get_object("box_ibus_table")
......@@ -97,9 +97,9 @@ class ibus_sharada_braille_preferences():
if item[:-1] in self.checked_languages:
widget.set_active(True)
widget.connect("clicked",self.language_toggled)
self.box_general.pack_start(widget,0,0,0);
self.box_ibus_table.pack_start(widget,0,0,0);
widget.show()
self.box_general.show()
self.box_ibus_table.show()
self.set_keys_and_shortcuts_to_ui(None,None)
......@@ -111,9 +111,15 @@ class ibus_sharada_braille_preferences():
checkbutton_conventional_braille = self.guibuilder.get_object("checkbutton_conventional_braille")
checkbutton_conventional_braille.set_active(int(self.config.get('cfg',"conventional-braille")))
#Set liblouis-mode checkbox
checkbutton_liblouis_mode = self.guibuilder.get_object("checkbutton_liblouis_mode")
checkbutton_liblouis_mode.set_active(int(self.config.get('cfg',"liblouis-mode")))
#Set TableType combobox
combobox_table_type = self.guibuilder.get_object("combobox_table_type")
self.box_ibus_table = self.guibuilder.get_object("box_ibus_table")
self.box_liblouis = self.guibuilder.get_object("box_liblouis")
value = int(self.config.get('cfg',"liblouis-mode"))
combobox_table_type.set_active(value)
self.box_liblouis.set_visible(value)
self.box_ibus_table.set_visible(not value)
self.guibuilder.connect_signals(self)
self.window.show()
......@@ -127,8 +133,11 @@ class ibus_sharada_braille_preferences():
def conventional_braille_toggled(self,widget,data=None):
self.config.set('cfg',"conventional-braille",str(int(widget.get_active())))
def liblouis_mode_toggled(self,widget,data=None):
self.config.set('cfg',"liblouis-mode",str(int(widget.get_active())))
def table_type_changed(self,widget,data=None):
value = int(widget.get_active())
self.config.set('cfg',"liblouis-mode",str(value))
self.box_liblouis.set_visible(value)
self.box_ibus_table.set_visible(not value)
def reset_keys_and_shorcuts(self,widget,data=None):
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.18.3
Copyright (C)
This file is part of .
is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with . If not, see <http://www.gnu.org/licenses/>.
-->
<interface>
<requires lib="gtk+" version="3.10"/>
<requires lib="gtk+" version="3.8"/>
<!-- interface-license-type gplv3 -->
<object class="GtkListStore" id="liststore1">
<columns>
<!-- column-name Text -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">IBus-Braille Builtin</col>
</row>
<row>
<col id="0" translatable="yes">Liblouis</col>
</row>
</data>
</object>
<object class="GtkWindow" id="window">
<property name="can_focus">False</property>
<property name="title" translatable="yes">IBus-Sharada-Braille Preferences</property>
......@@ -19,6 +53,57 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="box7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="border_width">10</property>
<child>
<object class="GtkLabel" id="label19">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Table 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="combobox_table_type">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">liststore1</property>
<signal name="changed" handler="table_type_changed" swapped="no"/>
<child>
<object class="GtkCellRendererText" id="cellrenderertext1"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box_ibus_table">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="checkbutton_simple_mode">
<property name="label" translatable="yes">Simple Mode</property>
......@@ -53,14 +138,35 @@
</packing>
</child>
<child>
<object class="GtkCheckButton" id="checkbutton_liblouis_mode">
<property name="label" translatable="yes">Liblouis-mode</property>
<object class="GtkBox" id="box4">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="liblouis_mode_toggled" swapped="no"/>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label_default_language">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Default Language</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_default_languge</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_default_languge">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="combobox_default_languge_changed" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -68,33 +174,91 @@
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box4">
<object class="GtkBox" id="box_liblouis">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">10</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label_default_language">
<object class="GtkBox" id="box8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Default Language</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">combobox_default_languge</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="box5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="label20">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Table List</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry_table_list">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="combobox_default_languge">
<object class="GtkBox" id="box9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkComboBox" id="combobox_liblouis_table_list">
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="changed" handler="combobox_default_languge_changed" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button4">
<property name="label" translatable="yes">Add to List</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image_position">right</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
......@@ -102,7 +266,14 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment