Package list lightdm-gtk-greeter-settings / c71bb13
polkit files, setup.py updated Andrew P. 7 years ago
6 changed file(s) with 87 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
00 include lightdm-gtk-greeter-settings.desktop.in README COPYING
1 include com.ubuntu.pkexec.lightdm-gtk-greeter-settings.policy
12 include bin/*
23 recursive-include data *.ui *.xml
34 recursive-include lightdm_gtk_greeter_settings *.py
0 #!/bin/sh
1 pkexec "/usr/bin/lightdm-gtk-greeter-settings" "$@"
0 <?xml version="1.0" encoding="UTF-8"?>
1 <!DOCTYPE policyconfig PUBLIC
2 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
3 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
4 <policyconfig>
5
6 <action id="com.ubuntu.pkexec.mytest">
7 <message>Authentication is required to run Settings editor for LightDM GTK+ Greeter</message>
8 <icon_name>preferences-system</icon_name>
9 <defaults>
10 <allow_any>auth_admin</allow_any>
11 <allow_inactive>auth_admin</allow_inactive>
12 <allow_active>auth_admin</allow_active>
13 </defaults>
14 <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/lightdm-gtk-greeter-settings</annotate>
15 <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
16 </action>
17
18 </policyconfig>
11 <interface>
22 <!-- interface-requires gtk+ 3.0 -->
33 <!-- interface-requires gtk_greeter_settings 1.0 -->
4 <object class="GtkImage" id="image1">
4 <object class="GtkImage" id="icon_cancel">
5 <property name="visible">True</property>
6 <property name="can_focus">False</property>
7 <property name="xpad">2</property>
8 <property name="icon_name">dialog-cancel</property>
9 </object>
10 <object class="GtkImage" id="icon_close">
11 <property name="visible">True</property>
12 <property name="can_focus">False</property>
13 <property name="xpad">2</property>
14 <property name="icon_name">dialog-close</property>
15 </object>
16 <object class="GtkImage" id="icon_image">
517 <property name="visible">True</property>
618 <property name="can_focus">False</property>
719 <property name="icon_name">image</property>
820 </object>
9 <object class="GtkImage" id="image2">
21 <object class="GtkImage" id="icon_ok">
22 <property name="visible">True</property>
23 <property name="can_focus">False</property>
24 <property name="icon_name">dialog-ok</property>
25 </object>
26 <object class="GtkImage" id="icon_open">
1027 <property name="visible">True</property>
1128 <property name="can_focus">False</property>
1229 <property name="icon_name">document-open</property>
1330 </object>
14 <object class="GtkImage" id="image3">
31 <object class="GtkImage" id="icon_reset">
1532 <property name="visible">True</property>
1633 <property name="can_focus">False</property>
34 <property name="xpad">2</property>
1735 <property name="icon_name">reload</property>
36 </object>
37 <object class="GtkImage" id="icon_save">
38 <property name="visible">True</property>
39 <property name="can_focus">False</property>
40 <property name="xpad">2</property>
41 <property name="icon_name">document-save</property>
1842 </object>
1943 <object class="GtkListStore" id="indicators_model">
2044 <columns>
6488 <property name="step_increment">1</property>
6589 <property name="page_increment">10</property>
6690 </object>
67 <object class="GtkAdjustment" id="timeout_adjustment">
68 <property name="upper">300</property>
69 <property name="step_increment">1</property>
70 <property name="page_increment">10</property>
71 </object>
7291 <object class="GtkGreeterSettingsWindow" id="settings_window">
7392 <property name="can_focus">False</property>
7493 <property name="title" translatable="yes">LightDM GTK+ Greeter: settings</property>
7594 <property name="window_position">center</property>
95 <property name="icon_name">preferences-system</property>
7696 <signal name="destroy" handler="on_destroy" swapped="no"/>
7797 <child>
7898 <object class="GtkBox" id="box1">
12781298 <child>
12791299 <object class="GtkScale" id="timeout_view">
12801300 <property name="visible">True</property>
1281 <property name="can_focus">False</property>
1301 <property name="can_focus">True</property>
12821302 <property name="margin_left">24</property>
12831303 <property name="adjustment">timeout_adjustment</property>
1284 <property name="lower_stepper_sensitivity">on</property>
12851304 <property name="fill_level">10000</property>
12861305 <property name="round_digits">1</property>
12871306 <property name="digits">0</property>
13271346 <property name="layout_style">end</property>
13281347 <child>
13291348 <object class="GtkButton" id="apply_button">
1330 <property name="label">gtk-save</property>
1349 <property name="label">Save</property>
13311350 <property name="visible">True</property>
13321351 <property name="can_focus">True</property>
13331352 <property name="receives_default">True</property>
1334 <property name="use_stock">True</property>
1353 <property name="image">icon_save</property>
13351354 <signal name="clicked" handler="on_apply_clicked" swapped="no"/>
13361355 </object>
13371356 <packing>
13421361 </child>
13431362 <child>
13441363 <object class="GtkButton" id="close_button">
1345 <property name="label">gtk-close</property>
1364 <property name="label">Close</property>
13461365 <property name="visible">True</property>
13471366 <property name="can_focus">False</property>
13481367 <property name="receives_default">True</property>
1349 <property name="use_stock">True</property>
1368 <property name="image">icon_close</property>
13501369 <signal name="clicked" handler="on_close_clicked" swapped="no"/>
13511370 </object>
13521371 <packing>
13611380 <property name="visible">True</property>
13621381 <property name="can_focus">True</property>
13631382 <property name="receives_default">True</property>
1364 <property name="image">image3</property>
1383 <property name="image">icon_reset</property>
13651384 <signal name="clicked" handler="on_reset_clicked" swapped="no"/>
13661385 </object>
13671386 <packing>
13811400 </object>
13821401 </child>
13831402 </object>
1403 <object class="GtkAdjustment" id="timeout_adjustment">
1404 <property name="upper">300</property>
1405 <property name="step_increment">1</property>
1406 <property name="page_increment">10</property>
1407 </object>
13841408 <object class="GtkMenu" id="userimage_menu">
13851409 <property name="visible">True</property>
13861410 <property name="can_focus">False</property>
13891413 <property name="label">Icon</property>
13901414 <property name="visible">True</property>
13911415 <property name="can_focus">False</property>
1392 <property name="image">image1</property>
1416 <property name="image">icon_image</property>
13931417 <property name="use_stock">False</property>
13941418 </object>
13951419 </child>
13981422 <property name="label">Path</property>
13991423 <property name="visible">True</property>
14001424 <property name="can_focus">False</property>
1401 <property name="image">image2</property>
1425 <property name="image">icon_open</property>
14021426 <property name="use_stock">False</property>
14031427 </object>
14041428 </child>
14391463 <property name="layout_style">end</property>
14401464 <child>
14411465 <object class="GtkButton" id="button2">
1442 <property name="label">gtk-cancel</property>
1466 <property name="label">_Cancel</property>
14431467 <property name="visible">True</property>
14441468 <property name="can_focus">False</property>
14451469 <property name="receives_default">True</property>
1446 <property name="use_stock">True</property>
1470 <property name="image">icon_cancel</property>
1471 <property name="use_underline">True</property>
14471472 </object>
14481473 <packing>
14491474 <property name="expand">False</property>
14531478 </child>
14541479 <child>
14551480 <object class="GtkButton" id="button1">
1456 <property name="label">gtk-ok</property>
1481 <property name="label">_OK</property>
14571482 <property name="visible">True</property>
14581483 <property name="can_focus">False</property>
14591484 <property name="can_default">True</property>
14601485 <property name="has_default">True</property>
14611486 <property name="receives_default">True</property>
1462 <property name="use_stock">True</property>
1487 <property name="image">icon_ok</property>
1488 <property name="use_underline">True</property>
14631489 </object>
14641490 <packing>
14651491 <property name="expand">False</property>
158158 self._apply_button.props.sensitive = self._allow_edit and self._changed_values
159159
160160 def on_format_time_scale(self, scale, value):
161 return '%02d:%02d' % (value // 60, value % 60)
161 value = int(value)
162 if value > 0:
163 return '%02d:%02d' % (value // 60, value % 60)
164 else:
165 return _('Never')
162166
163167 def on_destroy(self, *args):
164168 Gtk.main_quit()
1818 for k, v in values.items():
1919 f.write('%s = %s\n' % (k, v))
2020 except OSError as e:
21 print ("ERROR: Can't write installation_config: %s" % e)
21 print ("ERROR: Can't write installation config: %s" % e)
2222 sys.exit(1)
2323
2424
4949 def update_desktop_file(filename, target_pkgdata, target_scripts):
5050
5151 config = configparser.RawConfigParser(strict=False, allow_no_value=True)
52 config.optionxform = str
5253 try:
5354 config.read(filename)
5455 except configparser.Error as e:
5960 config.add_section('Desktop Entry')
6061
6162 old_command = config.get('Desktop Entry', 'Exec', fallback='').split(None, 1)
62 new_command = target_scripts + 'lightdm-gtk-greeter-settings'
63 new_command = target_scripts + 'lightdm-gtk-greeter-settings-pkexec'
6364 if len(old_command) > 1:
6465 new_command += ' ' + new_command[1]
6566 config.set('Desktop Entry', 'Exec', new_command)
8586 update_desktop_file(desktop_file, target_pkgdata, target_scripts)
8687
8788
88 DistUtilsExtra.auto.setup(
89 DistUtilsExtra.auto.setup \
90 (
8991 name='lightdm-gtk-greeter-settings',
90 version='0.1',
92 version='0.3',
9193 license='GPL-3',
9294 author='Andrew P.',
9395 author_email='pan.pav.7c5@gmail.com',
9496 description='Settings editor for LightDM GTK+ Greeter',
9597 long_description='Settings editor for LightDM GTK+ Greeter',
9698 url='https://launchpad.net/lightdm-gtk-greeter-settings',
97 cmdclass={'install': InstallAndUpdateDataDirectory}
98 )
99 cmdclass={'install': InstallAndUpdateDataDirectory},
100 data_files=\
101 [
102 (os.path.join('share', 'polkit-1', 'actions'),
103 ['com.ubuntu.pkexec.lightdm-gtk-greeter-settings.policy'])
104 ],
105 )
99106