Codebase list policykit-1-gnome / c995062
Merge branch 'upstream' Michael Biebl 14 years ago
105 changed file(s) with 19329 addition(s) and 1110 deletion(s). Raw diff Collapse all Expand all
0
1 The polkit-gnome library (polkit-gnome/*) is licensed to you under the
2 GNU Lesser General Public License version 2 or later. The PolicyKit
3 GNOME authentication D-Bus service (src/*) is licensed to you under
4 the GNU General Public License version 2 or later.
5
6 Both licenses are included here. Each source code file is marked with
7 the proper copyright and license information.
8
9 -- GPL BEGIN --
010
111 GNU GENERAL PUBLIC LICENSE
212 Version 2, June 1991
338348 consider it more useful to permit linking proprietary applications with the
339349 library. If this is what you want to do, use the GNU Library General
340350 Public License instead of this License.
351
352 -- GPL END --
353
354 -- LGPL BEGIN --
355 GNU LIBRARY GENERAL PUBLIC LICENSE
356 Version 2, June 1991
357
358 Copyright (C) 1991 Free Software Foundation, Inc.
359 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
360 Everyone is permitted to copy and distribute verbatim copies
361 of this license document, but changing it is not allowed.
362
363 [This is the first released version of the library GPL. It is
364 numbered 2 because it goes with version 2 of the ordinary GPL.]
365
366 Preamble
367
368 The licenses for most software are designed to take away your
369 freedom to share and change it. By contrast, the GNU General Public
370 Licenses are intended to guarantee your freedom to share and change
371 free software--to make sure the software is free for all its users.
372
373 This license, the Library General Public License, applies to some
374 specially designated Free Software Foundation software, and to any
375 other libraries whose authors decide to use it. You can use it for
376 your libraries, too.
377
378 When we speak of free software, we are referring to freedom, not
379 price. Our General Public Licenses are designed to make sure that you
380 have the freedom to distribute copies of free software (and charge for
381 this service if you wish), that you receive source code or can get it
382 if you want it, that you can change the software or use pieces of it
383 in new free programs; and that you know you can do these things.
384
385 To protect your rights, we need to make restrictions that forbid
386 anyone to deny you these rights or to ask you to surrender the rights.
387 These restrictions translate to certain responsibilities for you if
388 you distribute copies of the library, or if you modify it.
389
390 For example, if you distribute copies of the library, whether gratis
391 or for a fee, you must give the recipients all the rights that we gave
392 you. You must make sure that they, too, receive or can get the source
393 code. If you link a program with the library, you must provide
394 complete object files to the recipients so that they can relink them
395 with the library, after making changes to the library and recompiling
396 it. And you must show them these terms so they know their rights.
397
398 Our method of protecting your rights has two steps: (1) copyright
399 the library, and (2) offer you this license which gives you legal
400 permission to copy, distribute and/or modify the library.
401
402 Also, for each distributor's protection, we want to make certain
403 that everyone understands that there is no warranty for this free
404 library. If the library is modified by someone else and passed on, we
405 want its recipients to know that what they have is not the original
406 version, so that any problems introduced by others will not reflect on
407 the original authors' reputations.
408
409 Finally, any free program is threatened constantly by software
410 patents. We wish to avoid the danger that companies distributing free
411 software will individually obtain patent licenses, thus in effect
412 transforming the program into proprietary software. To prevent this,
413 we have made it clear that any patent must be licensed for everyone's
414 free use or not licensed at all.
415
416 Most GNU software, including some libraries, is covered by the ordinary
417 GNU General Public License, which was designed for utility programs. This
418 license, the GNU Library General Public License, applies to certain
419 designated libraries. This license is quite different from the ordinary
420 one; be sure to read it in full, and don't assume that anything in it is
421 the same as in the ordinary license.
422
423 The reason we have a separate public license for some libraries is that
424 they blur the distinction we usually make between modifying or adding to a
425 program and simply using it. Linking a program with a library, without
426 changing the library, is in some sense simply using the library, and is
427 analogous to running a utility program or application program. However, in
428 a textual and legal sense, the linked executable is a combined work, a
429 derivative of the original library, and the ordinary General Public License
430 treats it as such.
431
432 Because of this blurred distinction, using the ordinary General
433 Public License for libraries did not effectively promote software
434 sharing, because most developers did not use the libraries. We
435 concluded that weaker conditions might promote sharing better.
436
437 However, unrestricted linking of non-free programs would deprive the
438 users of those programs of all benefit from the free status of the
439 libraries themselves. This Library General Public License is intended to
440 permit developers of non-free programs to use free libraries, while
441 preserving your freedom as a user of such programs to change the free
442 libraries that are incorporated in them. (We have not seen how to achieve
443 this as regards changes in header files, but we have achieved it as regards
444 changes in the actual functions of the Library.) The hope is that this
445 will lead to faster development of free libraries.
446
447 The precise terms and conditions for copying, distribution and
448 modification follow. Pay close attention to the difference between a
449 "work based on the library" and a "work that uses the library". The
450 former contains code derived from the library, while the latter only
451 works together with the library.
452
453 Note that it is possible for a library to be covered by the ordinary
454 General Public License rather than by this special one.
455
456 GNU LIBRARY GENERAL PUBLIC LICENSE
457 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
458
459 0. This License Agreement applies to any software library which
460 contains a notice placed by the copyright holder or other authorized
461 party saying it may be distributed under the terms of this Library
462 General Public License (also called "this License"). Each licensee is
463 addressed as "you".
464
465 A "library" means a collection of software functions and/or data
466 prepared so as to be conveniently linked with application programs
467 (which use some of those functions and data) to form executables.
468
469 The "Library", below, refers to any such software library or work
470 which has been distributed under these terms. A "work based on the
471 Library" means either the Library or any derivative work under
472 copyright law: that is to say, a work containing the Library or a
473 portion of it, either verbatim or with modifications and/or translated
474 straightforwardly into another language. (Hereinafter, translation is
475 included without limitation in the term "modification".)
476
477 "Source code" for a work means the preferred form of the work for
478 making modifications to it. For a library, complete source code means
479 all the source code for all modules it contains, plus any associated
480 interface definition files, plus the scripts used to control compilation
481 and installation of the library.
482
483 Activities other than copying, distribution and modification are not
484 covered by this License; they are outside its scope. The act of
485 running a program using the Library is not restricted, and output from
486 such a program is covered only if its contents constitute a work based
487 on the Library (independent of the use of the Library in a tool for
488 writing it). Whether that is true depends on what the Library does
489 and what the program that uses the Library does.
490
491 1. You may copy and distribute verbatim copies of the Library's
492 complete source code as you receive it, in any medium, provided that
493 you conspicuously and appropriately publish on each copy an
494 appropriate copyright notice and disclaimer of warranty; keep intact
495 all the notices that refer to this License and to the absence of any
496 warranty; and distribute a copy of this License along with the
497 Library.
498
499 You may charge a fee for the physical act of transferring a copy,
500 and you may at your option offer warranty protection in exchange for a
501 fee.
502
503 2. You may modify your copy or copies of the Library or any portion
504 of it, thus forming a work based on the Library, and copy and
505 distribute such modifications or work under the terms of Section 1
506 above, provided that you also meet all of these conditions:
507
508 a) The modified work must itself be a software library.
509
510 b) You must cause the files modified to carry prominent notices
511 stating that you changed the files and the date of any change.
512
513 c) You must cause the whole of the work to be licensed at no
514 charge to all third parties under the terms of this License.
515
516 d) If a facility in the modified Library refers to a function or a
517 table of data to be supplied by an application program that uses
518 the facility, other than as an argument passed when the facility
519 is invoked, then you must make a good faith effort to ensure that,
520 in the event an application does not supply such function or
521 table, the facility still operates, and performs whatever part of
522 its purpose remains meaningful.
523
524 (For example, a function in a library to compute square roots has
525 a purpose that is entirely well-defined independent of the
526 application. Therefore, Subsection 2d requires that any
527 application-supplied function or table used by this function must
528 be optional: if the application does not supply it, the square
529 root function must still compute square roots.)
530
531 These requirements apply to the modified work as a whole. If
532 identifiable sections of that work are not derived from the Library,
533 and can be reasonably considered independent and separate works in
534 themselves, then this License, and its terms, do not apply to those
535 sections when you distribute them as separate works. But when you
536 distribute the same sections as part of a whole which is a work based
537 on the Library, the distribution of the whole must be on the terms of
538 this License, whose permissions for other licensees extend to the
539 entire whole, and thus to each and every part regardless of who wrote
540 it.
541
542 Thus, it is not the intent of this section to claim rights or contest
543 your rights to work written entirely by you; rather, the intent is to
544 exercise the right to control the distribution of derivative or
545 collective works based on the Library.
546
547 In addition, mere aggregation of another work not based on the Library
548 with the Library (or with a work based on the Library) on a volume of
549 a storage or distribution medium does not bring the other work under
550 the scope of this License.
551
552 3. You may opt to apply the terms of the ordinary GNU General Public
553 License instead of this License to a given copy of the Library. To do
554 this, you must alter all the notices that refer to this License, so
555 that they refer to the ordinary GNU General Public License, version 2,
556 instead of to this License. (If a newer version than version 2 of the
557 ordinary GNU General Public License has appeared, then you can specify
558 that version instead if you wish.) Do not make any other change in
559 these notices.
560
561 Once this change is made in a given copy, it is irreversible for
562 that copy, so the ordinary GNU General Public License applies to all
563 subsequent copies and derivative works made from that copy.
564
565 This option is useful when you wish to copy part of the code of
566 the Library into a program that is not a library.
567
568 4. You may copy and distribute the Library (or a portion or
569 derivative of it, under Section 2) in object code or executable form
570 under the terms of Sections 1 and 2 above provided that you accompany
571 it with the complete corresponding machine-readable source code, which
572 must be distributed under the terms of Sections 1 and 2 above on a
573 medium customarily used for software interchange.
574
575 If distribution of object code is made by offering access to copy
576 from a designated place, then offering equivalent access to copy the
577 source code from the same place satisfies the requirement to
578 distribute the source code, even though third parties are not
579 compelled to copy the source along with the object code.
580
581 5. A program that contains no derivative of any portion of the
582 Library, but is designed to work with the Library by being compiled or
583 linked with it, is called a "work that uses the Library". Such a
584 work, in isolation, is not a derivative work of the Library, and
585 therefore falls outside the scope of this License.
586
587 However, linking a "work that uses the Library" with the Library
588 creates an executable that is a derivative of the Library (because it
589 contains portions of the Library), rather than a "work that uses the
590 library". The executable is therefore covered by this License.
591 Section 6 states terms for distribution of such executables.
592
593 When a "work that uses the Library" uses material from a header file
594 that is part of the Library, the object code for the work may be a
595 derivative work of the Library even though the source code is not.
596 Whether this is true is especially significant if the work can be
597 linked without the Library, or if the work is itself a library. The
598 threshold for this to be true is not precisely defined by law.
599
600 If such an object file uses only numerical parameters, data
601 structure layouts and accessors, and small macros and small inline
602 functions (ten lines or less in length), then the use of the object
603 file is unrestricted, regardless of whether it is legally a derivative
604 work. (Executables containing this object code plus portions of the
605 Library will still fall under Section 6.)
606
607 Otherwise, if the work is a derivative of the Library, you may
608 distribute the object code for the work under the terms of Section 6.
609 Any executables containing that work also fall under Section 6,
610 whether or not they are linked directly with the Library itself.
611
612 6. As an exception to the Sections above, you may also compile or
613 link a "work that uses the Library" with the Library to produce a
614 work containing portions of the Library, and distribute that work
615 under terms of your choice, provided that the terms permit
616 modification of the work for the customer's own use and reverse
617 engineering for debugging such modifications.
618
619 You must give prominent notice with each copy of the work that the
620 Library is used in it and that the Library and its use are covered by
621 this License. You must supply a copy of this License. If the work
622 during execution displays copyright notices, you must include the
623 copyright notice for the Library among them, as well as a reference
624 directing the user to the copy of this License. Also, you must do one
625 of these things:
626
627 a) Accompany the work with the complete corresponding
628 machine-readable source code for the Library including whatever
629 changes were used in the work (which must be distributed under
630 Sections 1 and 2 above); and, if the work is an executable linked
631 with the Library, with the complete machine-readable "work that
632 uses the Library", as object code and/or source code, so that the
633 user can modify the Library and then relink to produce a modified
634 executable containing the modified Library. (It is understood
635 that the user who changes the contents of definitions files in the
636 Library will not necessarily be able to recompile the application
637 to use the modified definitions.)
638
639 b) Accompany the work with a written offer, valid for at
640 least three years, to give the same user the materials
641 specified in Subsection 6a, above, for a charge no more
642 than the cost of performing this distribution.
643
644 c) If distribution of the work is made by offering access to copy
645 from a designated place, offer equivalent access to copy the above
646 specified materials from the same place.
647
648 d) Verify that the user has already received a copy of these
649 materials or that you have already sent this user a copy.
650
651 For an executable, the required form of the "work that uses the
652 Library" must include any data and utility programs needed for
653 reproducing the executable from it. However, as a special exception,
654 the source code distributed need not include anything that is normally
655 distributed (in either source or binary form) with the major
656 components (compiler, kernel, and so on) of the operating system on
657 which the executable runs, unless that component itself accompanies
658 the executable.
659
660 It may happen that this requirement contradicts the license
661 restrictions of other proprietary libraries that do not normally
662 accompany the operating system. Such a contradiction means you cannot
663 use both them and the Library together in an executable that you
664 distribute.
665
666 7. You may place library facilities that are a work based on the
667 Library side-by-side in a single library together with other library
668 facilities not covered by this License, and distribute such a combined
669 library, provided that the separate distribution of the work based on
670 the Library and of the other library facilities is otherwise
671 permitted, and provided that you do these two things:
672
673 a) Accompany the combined library with a copy of the same work
674 based on the Library, uncombined with any other library
675 facilities. This must be distributed under the terms of the
676 Sections above.
677
678 b) Give prominent notice with the combined library of the fact
679 that part of it is a work based on the Library, and explaining
680 where to find the accompanying uncombined form of the same work.
681
682 8. You may not copy, modify, sublicense, link with, or distribute
683 the Library except as expressly provided under this License. Any
684 attempt otherwise to copy, modify, sublicense, link with, or
685 distribute the Library is void, and will automatically terminate your
686 rights under this License. However, parties who have received copies,
687 or rights, from you under this License will not have their licenses
688 terminated so long as such parties remain in full compliance.
689
690 9. You are not required to accept this License, since you have not
691 signed it. However, nothing else grants you permission to modify or
692 distribute the Library or its derivative works. These actions are
693 prohibited by law if you do not accept this License. Therefore, by
694 modifying or distributing the Library (or any work based on the
695 Library), you indicate your acceptance of this License to do so, and
696 all its terms and conditions for copying, distributing or modifying
697 the Library or works based on it.
698
699 10. Each time you redistribute the Library (or any work based on the
700 Library), the recipient automatically receives a license from the
701 original licensor to copy, distribute, link with or modify the Library
702 subject to these terms and conditions. You may not impose any further
703 restrictions on the recipients' exercise of the rights granted herein.
704 You are not responsible for enforcing compliance by third parties to
705 this License.
706
707 11. If, as a consequence of a court judgment or allegation of patent
708 infringement or for any other reason (not limited to patent issues),
709 conditions are imposed on you (whether by court order, agreement or
710 otherwise) that contradict the conditions of this License, they do not
711 excuse you from the conditions of this License. If you cannot
712 distribute so as to satisfy simultaneously your obligations under this
713 License and any other pertinent obligations, then as a consequence you
714 may not distribute the Library at all. For example, if a patent
715 license would not permit royalty-free redistribution of the Library by
716 all those who receive copies directly or indirectly through you, then
717 the only way you could satisfy both it and this License would be to
718 refrain entirely from distribution of the Library.
719
720 If any portion of this section is held invalid or unenforceable under any
721 particular circumstance, the balance of the section is intended to apply,
722 and the section as a whole is intended to apply in other circumstances.
723
724 It is not the purpose of this section to induce you to infringe any
725 patents or other property right claims or to contest validity of any
726 such claims; this section has the sole purpose of protecting the
727 integrity of the free software distribution system which is
728 implemented by public license practices. Many people have made
729 generous contributions to the wide range of software distributed
730 through that system in reliance on consistent application of that
731 system; it is up to the author/donor to decide if he or she is willing
732 to distribute software through any other system and a licensee cannot
733 impose that choice.
734
735 This section is intended to make thoroughly clear what is believed to
736 be a consequence of the rest of this License.
737
738 12. If the distribution and/or use of the Library is restricted in
739 certain countries either by patents or by copyrighted interfaces, the
740 original copyright holder who places the Library under this License may add
741 an explicit geographical distribution limitation excluding those countries,
742 so that distribution is permitted only in or among countries not thus
743 excluded. In such case, this License incorporates the limitation as if
744 written in the body of this License.
745
746 13. The Free Software Foundation may publish revised and/or new
747 versions of the Library General Public License from time to time.
748 Such new versions will be similar in spirit to the present version,
749 but may differ in detail to address new problems or concerns.
750
751 Each version is given a distinguishing version number. If the Library
752 specifies a version number of this License which applies to it and
753 "any later version", you have the option of following the terms and
754 conditions either of that version or of any later version published by
755 the Free Software Foundation. If the Library does not specify a
756 license version number, you may choose any version ever published by
757 the Free Software Foundation.
758
759 14. If you wish to incorporate parts of the Library into other free
760 programs whose distribution conditions are incompatible with these,
761 write to the author to ask for permission. For software which is
762 copyrighted by the Free Software Foundation, write to the Free
763 Software Foundation; we sometimes make exceptions for this. Our
764 decision will be guided by the two goals of preserving the free status
765 of all derivatives of our free software and of promoting the sharing
766 and reuse of software generally.
767
768 NO WARRANTY
769
770 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
771 WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
772 EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
773 OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
774 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
775 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
776 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
777 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
778 THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
779
780 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
781 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
782 AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
783 FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
784 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
785 LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
786 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
787 FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
788 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
789 DAMAGES.
790
791 END OF TERMS AND CONDITIONS
792
793 How to Apply These Terms to Your New Libraries
794
795 If you develop a new library, and you want it to be of the greatest
796 possible use to the public, we recommend making it free software that
797 everyone can redistribute and change. You can do so by permitting
798 redistribution under these terms (or, alternatively, under the terms of the
799 ordinary General Public License).
800
801 To apply these terms, attach the following notices to the library. It is
802 safest to attach them to the start of each source file to most effectively
803 convey the exclusion of warranty; and each file should have at least the
804 "copyright" line and a pointer to where the full notice is found.
805
806 <one line to give the library's name and a brief idea of what it does.>
807 Copyright (C) <year> <name of author>
808
809 This library is free software; you can redistribute it and/or
810 modify it under the terms of the GNU Library General Public
811 License as published by the Free Software Foundation; either
812 version 2 of the License, or (at your option) any later version.
813
814 This library is distributed in the hope that it will be useful,
815 but WITHOUT ANY WARRANTY; without even the implied warranty of
816 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
817 Library General Public License for more details.
818
819 You should have received a copy of the GNU Library General Public
820 License along with this library; if not, write to the
821 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
822 Boston, MA 02111-1307 USA.
823
824 Also add information on how to contact you by electronic and paper mail.
825
826 You should also get your employer (if you work as a programmer) or your
827 school, if any, to sign a "copyright disclaimer" for the library, if
828 necessary. Here is a sample; alter the names:
829
830 Yoyodyne, Inc., hereby disclaims all copyright interest in the
831 library `Frob' (a library for tweaking knobs) written by James Random Hacker.
832
833 <signature of Ty Coon>, 1 April 1990
834 Ty Coon, President of Vice
835
836 That's all there is to it!
837 -- LGPL END --
0 commit 9b14480c175928ea41604fcb56c24a52f39b967e
1 Author: David Zeuthen <davidz@redhat.com>
2 Date: Thu Dec 6 00:19:51 2007 -0500
3
4 update NEWS file
5
6 NEWS | 99
7 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 1 files changed, 99 insertions(+), 0 deletions(-)
9
10 commit adf6d3d0a209f1e043b89c086136105e50d1867c
11 Author: David Zeuthen <davidz@redhat.com>
12 Date: Wed Dec 5 23:00:18 2007 -0500
13
14 update for latest PolicyKit API changes
15
16 tools/polkit-gnome-authorization.c | 69
17 +++++++++++++++++++++++------------
18 1 files changed, 45 insertions(+), 24 deletions(-)
19
20 commit ed45e4f30ecdaacc7b4b0b05c12b034b0cd6a391
21 Author: David Zeuthen <davidz@redhat.com>
22 Date: Wed Dec 5 22:58:35 2007 -0500
23
24 introduce new polkit-action-sufficient property
25
26 polkit-gnome/polkit-gnome-action.c | 111
27 +++++++++++++++++++++++++++++++++++-
28 1 files changed, 110 insertions(+), 1 deletions(-)
29
30 commit f293e08834908ec49d4c34d749dd3d1d3b5f6a2d
31 Author: David Zeuthen <davidz@redhat.com>
32 Date: Wed Dec 5 22:57:53 2007 -0500
33
34 update to latest PolicyKit API changes
35
36 polkit-gnome/polkit-gnome-toggle-action.c | 2 +-
37 1 files changed, 1 insertions(+), 1 deletions(-)
38
39 commit 14d24658fbe8b2dbb828324914abc84715d0f5be
40 Author: David Zeuthen <davidz@redhat.com>
41 Date: Tue Nov 20 22:17:03 2007 -0500
42
43 for negative auths, make the face bw to make the stop icon stand out
44
45 tools/polkit-gnome-authorization.c | 9 +++++++--
46 1 files changed, 7 insertions(+), 2 deletions(-)
47
48 commit d9f0f13f3cdbd7cb6dbc4a590b2dcadaa17cc785
49 Author: David Zeuthen <davidz@redhat.com>
50 Date: Tue Nov 20 22:10:19 2007 -0500
51
52 update docs to reflect the interface switch from org.gnome to
53 org.freedesktop
54
55 doc/polkit-gnome-docs.xml | 30 +++++++++++++++---------------
56 polkit-gnome/polkit-gnome-auth.c | 15 +++++++++++++--
57 src/polkit-gnome-manager.xml | 6 ++++--
58 3 files changed, 32 insertions(+), 19 deletions(-)
59
60 commit 2927ed348e96dc792da80f5b7551c06a4715f90a
61 Author: David Zeuthen <davidz@redhat.com>
62 Date: Tue Nov 20 21:57:11 2007 -0500
63
64 fix up POLKIT_TYPE_GNOME_CONTEXT to be POLKIT_GNOME_TYPE_CONTEXT
65
66 polkit-gnome/polkit-gnome-context.c | 4 ++--
67 polkit-gnome/polkit-gnome-context.h | 13 ++++++-------
68 2 files changed, 8 insertions(+), 9 deletions(-)
69
70 commit 4816ba22085774dd3f63d0c8a8321ad9a3e4b814
71 Author: David Zeuthen <davidz@redhat.com>
72 Date: Tue Nov 20 16:42:26 2007 -0500
73
74 add support for "target-pid" property and streamline auth interface
75
76 Also fix a small bug in ToggleAction
77
78 examples/polkit-gnome-example.c | 1 +
79 polkit-gnome/polkit-gnome-action.c | 64
80 +++++++++++++++++++++++++----
81 polkit-gnome/polkit-gnome-auth.c | 17 +++++---
82 polkit-gnome/polkit-gnome-auth.h | 7 +++-
83 polkit-gnome/polkit-gnome-toggle-action.c | 10 +++-
84 src/polkit-gnome-manager.c | 58
85 +++++++++++++++++---------
86 src/polkit-gnome-manager.h | 6 +++
87 src/polkit-gnome-manager.xml | 6 ++-
88 8 files changed, 130 insertions(+), 39 deletions(-)
89
90 commit 65e3eec218a6cb957db80bf6b1d0dd0e0d846d83
91 Author: David Zeuthen <davidz@redhat.com>
92 Date: Tue Nov 20 01:31:10 2007 -0500
93
94 also claim the name org.freedesktop.PolicyKit.AuthenticationAgent
95
96 ... and the associated interface of the same name for the object /.
97
98 Also call into the standardized name from
99 polkit_gnome_auth_show_dialog().
100 Will need to standardize all this in the PolicyKit docs; watch out for
101 an upcoming commit there..
102
103 data/Makefile.am | 7 +++++-
104 ...esktop.PolicyKit.AuthenticationAgent.service.in | 3 ++
105 polkit-gnome/polkit-gnome-auth.c | 6 ++--
106 src/main.c | 21
107 ++++++++++-------
108 src/polkit-gnome-manager.c | 9 +++++--
109 src/polkit-gnome-manager.xml | 24
110 +++++++++++++++++--
111 6 files changed, 51 insertions(+), 19 deletions(-)
112
113 commit 61c8eea7f6b54eee745176baa815603c6423390d
114 Author: David Zeuthen <davidz@redhat.com>
115 Date: Tue Nov 20 00:27:45 2007 -0500
116
117 fix corner case for the toggle action
118
119 Assume an action A and user U. Suppose that
120
121 - there is a negative auth for A for U "granted" by U itself
122 - auth is needed
123
124 then one need, when the user clicks the proxy widget, to reevaluate
125 the polkit result after having revoked the self-granted negative
126 auths.
127
128 polkit-gnome/polkit-gnome-toggle-action.c | 88
129 ++++++++++++++++++-----------
130 1 files changed, 54 insertions(+), 34 deletions(-)
131
132 commit f5a88e7bb512a6e588e87f5e11f043065fa45eaa
133 Author: David Zeuthen <davidz@redhat.com>
134 Date: Mon Nov 19 23:30:30 2007 -0500
135
136 add support for negative auths
137
138 This implements the UI bits for supporting the negative auths feature
139 added to PolicyKit in commit 45f52acbfd1d898e37f4ccaa830d6425fa4bc2da
140
141 http://gitweb.freedesktop.org/?p=PolicyKit.git;a=commitdiff;h=45f52acbfd1d898e37f4ccaa830d6425fa4bc2da
142
143 polkit-gnome/polkit-gnome-action.c | 335
144 +++++++++++++++++++++++++---
145 polkit-gnome/polkit-gnome-action.h | 1 +
146 polkit-gnome/polkit-gnome-toggle-action.c | 129 ++++++++---
147 tools/polkit-gnome-authorization.c | 168 ++++++++++++--
148 4 files changed, 538 insertions(+), 95 deletions(-)
149
150 commit 97554bffa8e8f6b98c8b74596d18ad9ee10dd3b2
151 Author: David Zeuthen <davidz@redhat.com>
152 Date: Sun Nov 18 17:17:02 2007 -0500
153
154 actually do single instance by refusing to run if we can't claim
155 the Name
156
157 tools/polkit-gnome-authorization.c | 16 ++++++++++++----
158 1 files changed, 12 insertions(+), 4 deletions(-)
159
160 commit 93ddf49fec0d93f30a8e4c5cd3af435fbaeb2388
161 Author: David Zeuthen <davidz@redhat.com>
162 Date: Sun Nov 18 16:37:27 2007 -0500
163
164 make auth dialog show a link to the auth manager and add a .desktop
165 file
166
167 data/Makefile.am | 16 +-
168 ...gnome.PolicyKit.AuthorizationManager.service.in | 3 +
169 data/polkit-gnome-authorization.desktop.in | 11 +
170 po/POTFILES.in | 1 +
171 po/da.po | 570
172 +++++++++++++++++---
173 src/polkit-gnome-auth-dialog.c | 58 ++-
174 tools/Makefile.am | 10 +-
175 tools/polkit-gnome-authorization.c | 135 +++++-
176 tools/single-instance.xml | 9 +
177 9 files changed, 721 insertions(+), 92 deletions(-)
178
179 commit 23f0a8aac96557615688621a15853c29de6bf15c
180 Author: David Zeuthen <davidz@redhat.com>
181 Date: Sun Nov 18 15:14:10 2007 -0500
182
183 pull in sexy and gnome-vfs for better presentation and handling of
184 vendor url's
185
186 configure.ac | 12 ++-
187 src/Makefile.am | 4 +
188 src/polkit-gnome-auth-dialog.c | 54 ++++++--
189 tools/Makefile.am | 4 +
190 tools/polkit-gnome-authorization.c | 283
191 +++++++++++++++++++-----------------
192 5 files changed, 214 insertions(+), 143 deletions(-)
193
194 commit 6a31dd819f4fca16ed0f091aa51a8b2ae20bd5d8
195 Author: David Zeuthen <davidz@redhat.com>
196 Date: Sat Nov 17 21:20:52 2007 -0500
197
198 add support for vendor and icon
199
200 Looks roughly like this
201
202 http://people.freedesktop.org/~david/polkit-icon-and-vendor.png
203
204 using a hacked up .policy file for the intlclock thingie.
205
206 src/polkit-gnome-auth-dialog.c | 124
207 ++++++++++++++++++++++++++++++++++--
208 src/polkit-gnome-auth-dialog.h | 3 +
209 src/polkit-gnome-manager.c | 10 +++
210 tools/polkit-gnome-authorization.c | 83 ++++++++++++++++++++++--
211 4 files changed, 207 insertions(+), 13 deletions(-)
212
213 commit e9a1d572994f228e9ae64e70ceaf16aa21a4ae85
214 Author: David Zeuthen <davidz@redhat.com>
215 Date: Sat Nov 17 18:09:32 2007 -0500
216
217 add notebook to avoid showing summary when an action isn't selected
218
219 tools/polkit-gnome-authorization.c | 16 ++++++++++++++--
220 1 files changed, 14 insertions(+), 2 deletions(-)
221
222 commit 65adf6218b63658c64ad91733a365785d54f2b3c
223 Author: David Zeuthen <davidz@redhat.com>
224 Date: Sat Nov 17 17:49:40 2007 -0500
225
226 add support for grant, revoke and editing implicit authorizations
227
228 src/polkit-gnome-auth-dialog.c | 2 +-
229 tools/polkit-gnome-authorization.c | 1831
230 +++++++++++++++++++++++++++---------
231 2 files changed, 1376 insertions(+), 457 deletions(-)
232
233 commit 5b1acacbb28706bcb0f286fa15659a0703647248
234 Author: David Zeuthen <davidz@redhat.com>
235 Date: Mon Nov 12 18:45:57 2007 -0500
236
237 use a tree for the actions and their namespaces instead of a flat list
238
239 tools/polkit-gnome-authorization.c | 458
240 +++++++++++++++++++++++++-----------
241 1 files changed, 321 insertions(+), 137 deletions(-)
242
243 commit d0fdee5061b2516e7005838b8585d845161de5a8
244 Author: David Zeuthen <davidz@redhat.com>
245 Date: Mon Nov 12 13:47:57 2007 -0500
246
247 update to gtk-doc.make to handle parallel builds
248
249 gtk-doc.make | 4 ++++
250 1 files changed, 4 insertions(+), 0 deletions(-)
251
252 commit a7862e497c27b7ce2b7ec23054bff6a9255d9b6e
253 Author: David Zeuthen <davidz@redhat.com>
254 Date: Fri Nov 9 21:24:16 2007 -0500
255
256 update to slightly modified iterator API in PolicyKit HEAD
257
258 tools/polkit-gnome-authorization.c | 5 ++++-
259 1 files changed, 4 insertions(+), 1 deletions(-)
260
261 commit 2e6bb36b612859e2b28d50cfa5b9c743f9c6976f
262 Author: David Zeuthen <davidz@redhat.com>
263 Date: Wed Oct 31 23:39:05 2007 -0400
264
265 update screenshots in docs
266
267 doc/polkit-gnome-example-screenshot-authorized.png | Bin 70745 ->
268 104073 bytes
269 doc/polkit-gnome-example-screenshot.png | Bin 69409 ->
270 101821 bytes
271 2 files changed, 0 insertions(+), 0 deletions(-)
272
273 commit 104c7ee8599126a90dc4a38fd449ebf4ef672bed
274 Author: David Zeuthen <davidz@redhat.com>
275 Date: Wed Oct 31 23:33:44 2007 -0400
276
277 add support for one-shot authorizations
278
279 This was introduced in commit 1b4fa91bb66135cf53d37117680cb2f23c3055ac
280 of PolicyKit.
281
282 examples/polkit-gnome-example.c | 142
283 +++++++++++++++++++----------
284 examples/polkit-gnome-example.policy.in | 9 ++
285 polkit-gnome/polkit-gnome-action.c | 140
286 +++++++++++++++-------------
287 polkit-gnome/polkit-gnome-toggle-action.c | 4 +
288 src/polkit-gnome-manager.c | 11 ++
289 tools/polkit-gnome-authorization.c | 18 ++++
290 6 files changed, 210 insertions(+), 114 deletions(-)
291
292 commit 40a42d5df7902307263ed7dc7f38184096b3f172
293 Author: David Zeuthen <davidz@redhat.com>
294 Date: Wed Oct 31 15:40:34 2007 -0400
295
296 update for recent changes on PolicyKit HEAD
297
298 data/polkit-gnome.pc.in | 2 +-
299 examples/Makefile.am | 1 +
300 po/POTFILES.in | 2 ++
301 polkit-gnome/Makefile.am | 1 +
302 tools/Makefile.am | 2 ++
303 tools/polkit-gnome-authorization.c | 29 +++++++++++++++++++----------
304 6 files changed, 26 insertions(+), 11 deletions(-)
305
306 commit 0c3799f88e8b1bc5517eaeea72a156fa822bbb16
307 Author: David Zeuthen <davidz@redhat.com>
308 Date: Mon Oct 29 00:38:02 2007 -0400
309
310 various work-in-progress bits for the authorization tool
311
312 tools/polkit-gnome-authorization.c | 548
313 ++++++++++++++++++++++++++++++------
314 1 files changed, 466 insertions(+), 82 deletions(-)
315
316 commit 7f12aa928fcc3abd01db724987f14c1e9ce18b58
317 Author: David Zeuthen <davidz@redhat.com>
318 Date: Mon Oct 29 00:37:25 2007 -0400
319
320 use PolKitGnomeToggleAction in example
321
322 examples/polkit-gnome-example.c | 55
323 ++++++++++++++++++++++++++++--
324 examples/polkit-gnome-example.policy.in | 9 +++++
325 2 files changed, 60 insertions(+), 4 deletions(-)
326
327 commit 1680f78868f312f112e592d84ef02ecc30efc27d
328 Author: David Zeuthen <davidz@redhat.com>
329 Date: Mon Oct 29 00:36:44 2007 -0400
330
331 include PolKitGnomeToggleAction and update a screenshot
332
333 doc/polkit-gnome-docs.xml | 1 +
334 doc/polkit-gnome-example-screenshot.png | Bin 54605 -> 69409 bytes
335 2 files changed, 1 insertions(+), 0 deletions(-)
336
337 commit 0e879817180bd0273fd7d688b3f8cdff550167fb
338 Author: David Zeuthen <davidz@redhat.com>
339 Date: Mon Oct 29 00:36:00 2007 -0400
340
341 new class PolKitGnomeToggleAction
342
343 polkit-gnome/Makefile.am | 16 +-
344 polkit-gnome/polkit-gnome-toggle-action.c | 842
345 +++++++++++++++++++++++++++++
346 polkit-gnome/polkit-gnome-toggle-action.h | 85 +++
347 polkit-gnome/polkit-gnome.h | 1 +
348 4 files changed, 937 insertions(+), 7 deletions(-)
349
350 commit 6ebce0a7f3cd953a1104d3b80c632b3f480c06a0
351 Author: David Zeuthen <davidz@redhat.com>
352 Date: Mon Oct 29 00:34:29 2007 -0400
353
354 include png
355
356 doc/Makefile.am | 1 +
357 1 files changed, 1 insertions(+), 0 deletions(-)
358
359 commit d0eae1d56b4a3fa1a9102134b4f3f377744a6b05
360 Author: David Zeuthen <davidz@redhat.com>
361 Date: Mon Oct 29 00:33:43 2007 -0400
362
363 various fixed for PolKitGnomeAction
364
365 doc/polkit-gnome-example-screenshot-authorized.png | Bin 0 ->
366 70745 bytes
367 polkit-gnome/polkit-gnome-action.c | 182
368 +++++++++++--------
369 polkit-gnome/polkit-gnome-action.h | 33 ++--
370 3 files changed, 121 insertions(+), 94 deletions(-)
371
372 commit 5c18fbee32e4aebe34be0a86970aa0caea17d9ea
373 Author: David Zeuthen <davidz@redhat.com>
374 Date: Mon Oct 22 12:32:14 2007 -0400
375
376 add a "Manage Authorization" application
377
378 Makefile.am | 2 +-
379 configure.ac | 3 +-
380 tools/Makefile.am | 35 +++
381 tools/polkit-gnome-authorization.c | 537
382 ++++++++++++++++++++++++++++++++++++
383 4 files changed, 575 insertions(+), 2 deletions(-)
384
385 commit c010724e64637ff1f9b033dbc48acb0f0b366bdc
386 Author: David Zeuthen <davidz@redhat.com>
387 Date: Mon Oct 22 12:31:45 2007 -0400
388
389 fix description of the Kick actions in the example
390
391 examples/polkit-gnome-example.policy.in | 6 +++---
392 1 files changed, 3 insertions(+), 3 deletions(-)
393
394 commit b88a5b25db2e3e968e501a9833497ddff4a4ff30
395 Author: David Zeuthen <davidz@redhat.com>
396 Date: Sun Oct 21 16:49:49 2007 -0400
397
398 assorted libpolkit-gnome fixes
399
400 - add 'master' visibility and sensitivity properties (and C bindings)
401 to PolKitGnomeAction; this is useful for applications that wants to
402 e.g. hide proxy widgets and don't care if the answer from PolicyKit
403 changes
404
405 - disconnect from signals when finalizing PolKitGnomeAction instances
406
407 - avoid recomputing PolicyKit answer if user sets the same properties
408
409 - Make 'clicked' work as expected on the GtkButton instances we
410 create via polkit_gnome_action_create_button (only emit 'clicked'
411 when PolicyKit says yes and synthesize 'clicked' when a privilege
412 is gained)
413
414 - Our namespace is PolKitGnome - so fix
415 s/POLKIT_IS_GNOME/POLKIT_GNOME_IS/
416
417 - Remove a lot of debug statements
418
419 examples/polkit-gnome-example.c | 11 +-
420 polkit-gnome/polkit-gnome-action.c | 212
421 ++++++++++++++++++++++++++++-------
422 polkit-gnome/polkit-gnome-action.h | 35 ++++---
423 polkit-gnome/polkit-gnome-context.c | 9 +-
424 polkit-gnome/polkit-gnome-context.h | 4 +-
425 5 files changed, 206 insertions(+), 65 deletions(-)
426
427 commit f6e8ca6003f72c58bdd1414fca15a59b28fd8d0c
428 Author: David Zeuthen <davidz@redhat.com>
429 Date: Sun Oct 21 12:08:51 2007 -0400
430
431 for PolKitGnomeAction define what happens if PolKitAction is set
432 to NULL
433
434 Also make buttons embedded in GtkDialog work.
435
436 polkit-gnome/polkit-gnome-action.c | 56
437 ++++++++++++++++++++++++++++++++++--
438 1 files changed, 53 insertions(+), 3 deletions(-)
439
440 commit 72fba75d28ab6d3e78ef17aea3da26a11a0597f7
441 Author: David Zeuthen <davidz@redhat.com>
442 Date: Sat Oct 20 18:25:28 2007 -0400
443
444 clean TODO - yay, down to one single trivial entry
445
446 TODO | 20 --------------------
447 1 files changed, 0 insertions(+), 20 deletions(-)
448
449 commit 509ae22858772acc7cc829faa27f4188dac0f7d5
450 Author: David Zeuthen <davidz@redhat.com>
451 Date: Sat Oct 20 18:24:35 2007 -0400
452
453 separate library dependencies into separate pkg-config modules
454
455 configure.ac | 24 +++++++++++++++---------
456 doc/Makefile.am | 16 +++++++++++-----
457 examples/Makefile.am | 12 ++++++++----
458 polkit-gnome/Makefile.am | 16 +++++++++++++---
459 src/Makefile.am | 10 ++++++++--
460 5 files changed, 55 insertions(+), 23 deletions(-)
461
462 commit bdffca9df0cb364aabbaeea5159baf64305e20ab
463 Author: David Zeuthen <davidz@redhat.com>
464 Date: Sat Oct 20 18:11:42 2007 -0400
465
466 we don't use libgnome nor libgnomeui so don't check for it in
467 configure.ac
468
469 configure.ac | 2 --
470 1 files changed, 0 insertions(+), 2 deletions(-)
471
472 commit 17bc2b736d9517d07ed6f3065085036d785008fa
473 Author: David Zeuthen <davidz@redhat.com>
474 Date: Sat Oct 20 18:10:53 2007 -0400
475
476 the auth daemon is not multi-threaded, no need to init threads
477
478 src/main.c | 4 ----
479 1 files changed, 0 insertions(+), 4 deletions(-)
480
481 commit 1fec84245de0366432a7ed98c8845b46bcae25de
482 Author: David Zeuthen <davidz@redhat.com>
483 Date: Sat Oct 20 18:06:45 2007 -0400
484
485 add some warning flags from gcc and fix up some warnings
486
487 configure.ac | 80
488 ++++++++++++++++++++++++++++++++++++
489 polkit-gnome/polkit-gnome-action.c | 18 +-------
490 2 files changed, 82 insertions(+), 16 deletions(-)
491
492 commit c1711b26b15bc27793b9736bc7c37d43d362e6ab
493 Author: David Zeuthen <davidz@redhat.com>
494 Date: Sat Oct 20 17:51:52 2007 -0400
495
496 add documentation for the authentication daemon
497
498 doc/Makefile.am | 9 ++-
499 doc/auth-details.png | Bin 0 -> 33008 bytes
500 doc/auth-retain-always.png | Bin 0 -> 30495 bytes
501 doc/auth-retain-session.png | Bin 0 -> 29800 bytes
502 doc/auth-root.png | Bin 0 -> 26805 bytes
503 doc/auth-self.png | Bin 0 -> 28037 bytes
504 doc/auth-wheel-group-1.png | Bin 0 -> 35436 bytes
505 doc/auth-wheel-group-2.png | Bin 0 -> 37226 bytes
506 doc/polkit-gnome-docs.xml | 150
507 ++++++++++++++++++++++++++++++++++++
508 polkit-gnome/polkit-gnome-action.c | 2 +-
509 polkit-gnome/polkit-gnome-auth.c | 6 +-
510 src/polkit-gnome-manager.xml | 7 ++
511 12 files changed, 169 insertions(+), 5 deletions(-)
512
513 commit 6edc6ef1272212de72c2c4235ad664f12aa33212
514 Author: David Zeuthen <davidz@redhat.com>
515 Date: Sat Oct 20 14:53:24 2007 -0400
516
517 fixed some i18n issues with polkit-gnome-example
518
519 examples/polkit-gnome-example.c | 2 +-
520 po/POTFILES.in | 4 +
521 po/da.po | 203
522 +++++++++++++++++++++++++++++----------
523 3 files changed, 155 insertions(+), 54 deletions(-)
524
525 commit 4f9ae9712f8110243acd34f82094f1110f56120f
526 Author: David Zeuthen <davidz@redhat.com>
527 Date: Sat Oct 20 14:43:30 2007 -0400
528
529 minor style / translation fixes for polkit-gnome-example
530
531 examples/polkit-gnome-example.c | 28 ++++++++++++++--------------
532 1 files changed, 14 insertions(+), 14 deletions(-)
533
534 commit e39388a123e29984f6bb30a612cac92429b8b292
535 Author: David Zeuthen <davidz@redhat.com>
536 Date: Sat Oct 20 14:21:48 2007 -0400
537
538 add toolbar and menubar to the example
539
540 doc/polkit-gnome-example-screenshot.png | Bin 43726 -> 54605 bytes
541 examples/polkit-gnome-example.c | 159
542 +++++++++++++++++++++++++++----
543 2 files changed, 138 insertions(+), 21 deletions(-)
544
545 commit 1ebe9f509c5ee82cebc0def23046172c73508de8
546 Author: David Zeuthen <davidz@redhat.com>
547 Date: Sat Oct 20 14:14:10 2007 -0400
548
549 add support for the 'short-label' property in PolKitGnomeAction
550
551 polkit-gnome/polkit-gnome-action.c | 185
552 +++++++++++++++++++++++++++++-------
553 1 files changed, 152 insertions(+), 33 deletions(-)
554
555 commit 473737a423e1ad9a3e449a4c2b0707dbf933f956
556 Author: David Zeuthen <davidz@redhat.com>
557 Date: Sat Oct 20 12:48:40 2007 -0400
558
559 update example
560
561 doc/polkit-gnome-example-screenshot.png | Bin 37848 -> 43726 bytes
562 examples/polkit-gnome-example.c | 80
563 ++++++++++++++++++++++++++-----
564 2 files changed, 67 insertions(+), 13 deletions(-)
565
566 commit 4530215a8cd40818b9f961931829deca12e75062
567 Author: David Zeuthen <davidz@redhat.com>
568 Date: Sat Oct 20 12:38:34 2007 -0400
569
570 also propagate the ::activate signal if PolicyKit says 'no'
571
572 polkit-gnome/polkit-gnome-action.c | 31 +++++++++++++++++++------------
573 1 files changed, 19 insertions(+), 12 deletions(-)
574
575 commit 81b8924658015a10c430ec8d495b9d894898e709
576 Author: David Zeuthen <davidz@redhat.com>
577 Date: Sat Oct 20 12:02:10 2007 -0400
578
579 show an example of properties of PolKitGnomeAction can be overridden
580
581 examples/polkit-gnome-example.c | 22 ++++++++++++++++++++++
582 1 files changed, 22 insertions(+), 0 deletions(-)
583
584 commit 524be9f9230c6c715bd92086cb95dd8886c3c622
585 Author: David Zeuthen <davidz@redhat.com>
586 Date: Sat Oct 20 12:01:28 2007 -0400
587
588 update label for buttons created with
589 polkit_gnome_action_create_button()
590
591 polkit-gnome/polkit-gnome-action.c | 11 +++++++++++
592 1 files changed, 11 insertions(+), 0 deletions(-)
593
594 commit fa4eb13d8f7be5b7f602d007671da84ff24e48e5
595 Author: David Zeuthen <davidz@redhat.com>
596 Date: Sat Oct 20 11:31:36 2007 -0400
597
598 require (unreleased) PolicyKit 0.7 instead of 0.5
599
600 configure.ac | 4 ++--
601 1 files changed, 2 insertions(+), 2 deletions(-)
602
603 commit 1de742ebee56da6e826f452373bcf5acada1457c
604 Author: David Zeuthen <davidz@redhat.com>
605 Date: Sat Oct 20 11:26:26 2007 -0400
606
607 in the example, unref the PolKitAction objects to plug memory leaks
608
609 The PolKitGnomeAction class refs the PolKitAction object itself.
610
611 examples/polkit-gnome-example.c | 4 ++++
612 1 files changed, 4 insertions(+), 0 deletions(-)
613
614 commit e8bf99b57e75cac8c2dae48b137f15378f72933c
615 Author: David Zeuthen <davidz@redhat.com>
616 Date: Sat Oct 20 11:23:37 2007 -0400
617
618 ref the PolKitAction when returning it as a property
619
620 The caller needs to unref it himself then; this is consistent with how
621 GObject works.
622
623 polkit-gnome/polkit-gnome-action.c | 2 +-
624 1 files changed, 1 insertions(+), 1 deletions(-)
625
626 commit 00b2c4a66e0f31ac2924a54734df92c3d1359caa
627 Author: David Zeuthen <davidz@redhat.com>
628 Date: Sat Oct 20 11:21:05 2007 -0400
629
630 clean up the example, include it in inline docs and remove the helper
631
632 Makefile.am | 5 +-
633 doc/Makefile.am | 4 +-
634 doc/polkit-gnome-example-auth-dialog-twiddle.png | Bin 0 -> 39378 bytes
635 doc/polkit-gnome-example-screenshot.png | Bin 0 -> 37848 bytes
636 examples/Makefile.am | 26 --
637 examples/polkit-gnome-example-helper.c | 212 ----------
638 examples/polkit-gnome-example.c | 473
639 ++++------------------
640 polkit-gnome/polkit-gnome-action.c | 31 ++-
641 polkit-gnome/polkit-gnome-context.h | 1 +
642 9 files changed, 114 insertions(+), 638 deletions(-)
643
644 commit 0b75bbc8a7b309a5a6d1527124b6118a419cf38b
645 Author: David Zeuthen <davidz@redhat.com>
646 Date: Sat Oct 20 01:23:15 2007 -0400
647
648 make all setters of PolKitGnomeAction private
649
650 Application programmers should use g_object_set() instead.
651
652 polkit-gnome/polkit-gnome-action.c | 62
653 +++++++++++++++++++++++++-----------
654 polkit-gnome/polkit-gnome-action.h | 21 ------------
655 2 files changed, 43 insertions(+), 40 deletions(-)
656
657 commit 243a681378490b593c7528095fa6e8e01f6a8c2f
658 Author: David Zeuthen <davidz@redhat.com>
659 Date: Sat Oct 20 01:16:38 2007 -0400
660
661 add signals for ::auth_start, ::auth_end on PolKitGnomeAction
662
663 polkit-gnome/polkit-gnome-action.c | 74
664 ++++++++++++++++++++++++++++++-----
665 polkit-gnome/polkit-gnome-action.h | 4 +-
666 2 files changed, 66 insertions(+), 12 deletions(-)
667
668 commit 7f7624e09cc4aa5a9f38bad04a7f55c6ab1f9138
669 Author: David Zeuthen <davidz@redhat.com>
670 Date: Fri Oct 19 21:18:15 2007 -0400
671
672 show labels in buttons created by polkit_gnome_action_create_button()
673
674 examples/polkit-gnome-example.c | 1 +
675 polkit-gnome/polkit-gnome-action.c | 50
676 +++++++++++++++++++++++------------
677 2 files changed, 34 insertions(+), 17 deletions(-)
678
679 commit a7e50ce61fd9b730710888a769dd382e39d6fef2
680 Author: David Zeuthen <davidz@redhat.com>
681 Date: Fri Oct 19 20:03:42 2007 -0400
682
683 pass XID for top-level of the widget that caused the ::activate signal
684
685 polkit-gnome/polkit-gnome-action.c | 41
686 +++++++++++++++++++++++++++++++++++-
687 1 files changed, 40 insertions(+), 1 deletions(-)
688
689 commit b96fded512ca0645e33c5043cfed21a1c37495d0
690 Author: David Zeuthen <davidz@redhat.com>
691 Date: Fri Oct 19 19:41:02 2007 -0400
692
693 remove functionality to pass the X11 XID in PolKitGnomeAction
694
695 This isn't going to be useful anyway - next commit will add code to
696 figure out the parent window that the auth dialog should be transient
697 from, from the widget that caused the activation.
698
699 polkit-gnome/polkit-gnome-action.c | 45
700 ++---------------------------------
701 polkit-gnome/polkit-gnome-action.h | 2 -
702 2 files changed, 3 insertions(+), 44 deletions(-)
703
704 commit 8572bf1ff80e40150284d901f28213fd93e18a2c
705 Author: David Zeuthen <davidz@redhat.com>
706 Date: Fri Oct 19 02:29:44 2007 -0400
707
708 add a polkit_gnome_action_create_button() convenience method
709
710 It's all about the porcelain!
711
712 examples/polkit-gnome-example.c | 22 +---------------------
713 polkit-gnome/polkit-gnome-action.c | 25 +++++++++++++++++++++++++
714 polkit-gnome/polkit-gnome-action.h | 4 +++-
715 3 files changed, 29 insertions(+), 22 deletions(-)
716
717 commit e6b41e50cf43b05cb080bb720c887ac480189662
718 Author: David Zeuthen <davidz@redhat.com>
719 Date: Fri Oct 19 02:02:10 2007 -0400
720
721 add authentication convience function and make PolKitGnomeAction
722 smarter
723
724 The latter includes only emitting 'activate' when PolicyKit says yes
725 to the PolKitAction in question. This entails automatically bringing
726 up authentication dialogs on the trapped 'activate' signals from the
727 base class.
728
729 doc/polkit-gnome-docs.xml | 1 +
730 examples/polkit-gnome-example.c | 12 +++
731 polkit-gnome/Makefile.am | 6 +-
732 polkit-gnome/polkit-gnome-action.c | 157
733 +++++++++++++++++++++++++++++++++++-
734 polkit-gnome/polkit-gnome-action.h | 7 ++-
735 polkit-gnome/polkit-gnome-auth.c | 153
736 +++++++++++++++++++++++++++++++++++
737 polkit-gnome/polkit-gnome-auth.h | 50 +++++++++++
738 polkit-gnome/polkit-gnome.h | 3 +-
739 8 files changed, 383 insertions(+), 6 deletions(-)
740
741 commit 72292f0fc8d471b3cb6ac59d37e92ac7dcb3d9b6
742 Author: David Zeuthen <davidz@redhat.com>
743 Date: Thu Oct 18 20:15:14 2007 -0400
744
745 first stab at subclassing GtkAction for the libpolkit-gnome library
746
747 doc/polkit-gnome-docs.xml | 3 +-
748 examples/Makefile.am | 9 +-
749 examples/polkit-gnome-example.c | 50 ++
750 polkit-gnome/Makefile.am | 8 +-
751 polkit-gnome/polkit-gnome-action.c | 1059
752 +++++++++++++++++++++++++++++++++++
753 polkit-gnome/polkit-gnome-action.h | 105 ++++
754 polkit-gnome/polkit-gnome-context.c | 369 ++++++++++++
755 polkit-gnome/polkit-gnome-context.h | 111 ++++
756 polkit-gnome/polkit-gnome.c | 51 --
757 polkit-gnome/polkit-gnome.h | 13 +-
758 10 files changed, 1714 insertions(+), 64 deletions(-)
759
760 commit 669bdc8d9922b769bbf681fbf822f45ab0b1301e
761 Author: David Zeuthen <davidz@redhat.com>
762 Date: Wed Oct 17 21:21:22 2007 -0400
763
764 forgot to add gtk-doc.make
765
766 gtk-doc.make | 155
767 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
768 1 files changed, 155 insertions(+), 0 deletions(-)
769
770 commit fe19cb60a5148cfb03820699dfcc2e1c854314a8
771 Author: David Zeuthen <davidz@redhat.com>
772 Date: Wed Oct 17 21:20:03 2007 -0400
773
774 add infrastructure for building a library
775
776 This library is LPGLv2 or later. Also add gtk-doc infrastructure.
777
778 COPYING | 497
779 +++++++++++++++++++++++++++++++++++++++++++
780 Makefile.am | 25 ++-
781 configure.ac | 43 ++++
782 data/Makefile.am | 9 +-
783 data/polkit-gnome.pc.in | 11 +
784 doc/Makefile.am | 67 ++++++
785 doc/polkit-gnome-docs.xml | 92 ++++++++
786 doc/version.xml.in | 1 +
787 polkit-gnome/Makefile.am | 31 +++
788 polkit-gnome/polkit-gnome.c | 51 +++++
789 polkit-gnome/polkit-gnome.h | 36 +++
790 11 files changed, 858 insertions(+), 5 deletions(-)
791
792 commit f93f1c03534fd8e72c354e9f6f91c4270f39a045
793 Author: David Zeuthen <davidz@redhat.com>
794 Date: Mon Oct 15 21:25:20 2007 -0400
795
796 do grab the keyboard anyway
797
798 After some more testing, it appears to work with Orca. At least when
799 Orca doesn't fail to work...
800
801 src/polkit-gnome-manager.c | 13 ++++++++++++-
802 1 files changed, 12 insertions(+), 1 deletions(-)
803
804 commit 37377d244ea6d3d3d46972dc9e948c3e88a4f98b
805 Author: David Zeuthen <davidz@redhat.com>
806 Date: Mon Oct 15 18:07:11 2007 -0400
807
808 don't grab the X keyboard; only grab the X pointer
809
810 There's a couple of reasons for this; first, grabbing the keyboard
811 breaks accessibility; try for yourself or see some horrible workaround
812 that Orca built into their application (and, sigh, they don't even
813 bother testing for whether gksu is installed anyway);
814
815 http://live.gnome.org/Orca/ConfigurationGui#head-eed11f78d766f588c85a5b4fd698d431f48085c8
816
817 Second, it's sufficient for our purposes (to keep focus on our
818 password dialog) to just grab the pointer
819
820 Third, "XGrabKeyboard is not a security interface"
821
822 http://seclists.org/fulldisclosure/2005/May/0676.html
823
824 And, sure, try xspy.c to see that even with the keyboard grabbed we
825 can still get key strokes. There's a couple of mails flying around the
826 net saying the XSECURITY extension should fix this; it doesn't appear
827 gnome-screensaver is using this (probably it doesn't want to break
828 a11y either?) and also some other comments that even XSECURITY is not
829 adequate.
830
831 Bottom line is that we probably want to wait until XACE is in...
832
833 src/polkit-gnome-manager.c | 20 +++++++-------------
834 1 files changed, 7 insertions(+), 13 deletions(-)
835
836 commit 19ac8b3d6e7ba19ddf062a0f18c4542741d1dfc2
837 Author: David Zeuthen <davidz@redhat.com>
838 Date: Fri Oct 12 23:33:44 2007 -0400
839
840 grab the pointer and keyboard when showing an auth dialog
841
842 src/polkit-gnome-manager.c | 32 +++++++++++++++++++++++++++++++-
843 1 files changed, 31 insertions(+), 1 deletions(-)
844
845 commit c067a338593eacc51a1f31b0c7d1d792238f904c
846 Author: David Zeuthen <davidz@redhat.com>
847 Date: Fri Oct 12 21:40:31 2007 -0400
848
849 post-release version bump
850
851 configure.ac | 2 +-
852 1 files changed, 1 insertions(+), 1 deletions(-)
853
854 commit d3239a403c6386c16318fd03d38f9f3169ef68a3
855 Author: David Zeuthen <davidz@redhat.com>
856 Date: Thu Oct 11 17:55:44 2007 -0400
857
858 update NEWS
859
860 NEWS | 32 ++++++++++++++++++++++++++++++++
861 1 files changed, 32 insertions(+), 0 deletions(-)
862
863 commit 18b42f0f21c003f5b599269ae03c761ce9836082
864 Author: David Zeuthen <davidz@redhat.com>
865 Date: Thu Oct 11 17:28:51 2007 -0400
866
867 add a --no-exit option to polkit-gnome-manager
868
869 This is useful for debugging.
870
871 src/main.c | 9 +++------
872 src/polkit-gnome-manager.c | 7 ++++++-
873 src/polkit-gnome-manager.h | 2 +-
874 3 files changed, 10 insertions(+), 8 deletions(-)
875
876 commit 33c8bbd517fc3a08c2fa34cc64bc92aa190fe09a
877 Author: David Zeuthen <davidz@redhat.com>
878 Date: Fri Sep 28 14:55:57 2007 -0400
879
880 exit authentication daemon after 30 seconds of inactivity
881
882 src/polkit-gnome-manager.c | 36 ++++++++++++++++++++++++++++++++++++
883 1 files changed, 36 insertions(+), 0 deletions(-)
884
885 commit ac17bb46c54fbf4b93f2224d876bbed89a98b7e6
886 Author: David Zeuthen <davidz@redhat.com>
887 Date: Fri Sep 28 14:36:36 2007 -0400
888
889 fix danish translations
890
891 po/da.po | 2 +-
892 1 files changed, 1 insertions(+), 1 deletions(-)
893
894 commit ce826cc8625d5d79aacc100daa6e069dc3a20918
895 Author: David Zeuthen <davidz@redhat.com>
896 Date: Fri Sep 28 14:26:23 2007 -0400
897
898 fix heuristics for localizing PAM strings and support thinkfinger
899 better
900
901 Our catch test to see if we should use a localized version of the
902 "password" request from PAM catched a bit too much, in particular the
903 "Password or swipe finger: " that pam_thinkfinger.so emits. So fix
904 that up and in the process add heuristics to properly translate
905 "Password and swipe finger:" and actually add this in the Danish
906 translations.
907
908 po/da.po | 21 +++++++++++++++++----
909 src/polkit-gnome-manager.c | 14 +++++++++++++-
910 2 files changed, 30 insertions(+), 5 deletions(-)
911
912 commit d8ce6a04500aff0e84a65fef8f7eded1637b7270
913 Author: David Zeuthen <davidz@redhat.com>
914 Date: Tue Sep 25 18:40:35 2007 -0400
915
916 post release bump to 0.6
917
918 configure.ac | 2 +-
919 1 files changed, 1 insertions(+), 1 deletions(-)
920
921 commit f26911488b849e016157269e33972413c9c98bec
922 Author: David Zeuthen <davidz@redhat.com>
923 Date: Tue Sep 25 16:26:42 2007 -0400
924
925 build example by default
926
927 configure.ac | 2 +-
928 1 files changed, 1 insertions(+), 1 deletions(-)
929
930 commit e52d7b02b71f1482e5154e25c77c2a7ccdcaa54c
931 Author: Michael Biebl <mbiebl@gmail.com>
932 Date: Tue Sep 25 16:25:26 2007 -0400
933
934 make it possible to build without the demo application
935
936 2007/9/20, Michael Biebl <mbiebl@gmail.com>:
937 > 2007/9/20, Doug Goldstein <cardoe@gentoo.org>:
938 > > It's not superfluous since it's actually used in the Makefiles. So
939 now
940 > > without this check, if you run "make check", and you don't
941 have the
942 > > binary it will bomb for you. While the program is not necessary
943 for
944 > > "make && make install", it doesn't mean it's not a dependency.
945 > >
946 > > The tool is used to validate that the installed files are
947 proper and
948 > > functional. Many packagers like to run a package's "make check"
949 step
950 > > before building up the package.
951
952 After a quick discussion on IRC, I added an --enable-examples
953 configure option, which defaults to off. So the check for
954 polkit-policy-file-validate is only done when the examples are built.
955
956 Please review and apply if ok.
957
958 Cheers,
959 Michael
960
961 Makefile.am | 6 +-
962 configure.ac | 16 +++-
963 po/PolicyKit-gnome.pot | 224
964 ------------------------------------------------
965 3 files changed, 17 insertions(+), 229 deletions(-)
966
967 commit a7c748b3b00045917942fdfa9631cddd8062e78e
968 Author: David Zeuthen <davidz@redhat.com>
969 Date: Tue Sep 25 16:22:10 2007 -0400
970
971 removed bogus aclocal.m4 file from repository
972
973 aclocal.m4 | 8325
974 ------------------------------------------------
975 po/PolicyKit-gnome.pot | 2 +-
976 po/da.po | 2 +-
977 3 files changed, 2 insertions(+), 8327 deletions(-)
978
979 commit f0e8103269b755a715750510420ebaea65294b2a
980 Author: David Zeuthen <davidz@redhat.com>
981 Date: Fri Aug 31 16:10:16 2007 -0400
982
983 Revert "post-release version bump"
984
985 This reverts commit f641decc9eae2dda95006fab741fca66dbd32b9e.
986
987 configure.ac | 2 +-
988 1 files changed, 1 insertions(+), 1 deletions(-)
989
990 commit f641decc9eae2dda95006fab741fca66dbd32b9e
991 Author: David Zeuthen <davidz@redhat.com>
992 Date: Fri Aug 31 16:09:26 2007 -0400
993
994 post-release version bump
995
996 configure.ac | 2 +-
997 1 files changed, 1 insertions(+), 1 deletions(-)
998
999 commit 512c99d37065f7d830e8e45a4519141228d4222f
1000 Author: David Zeuthen <davidz@redhat.com>
1001 Date: Fri Aug 31 16:05:37 2007 -0400
1002
1003 update NEWS
1004
1005 NEWS | 40 +++++++++++++++++++++++++++++++++++++++-
1006 1 files changed, 39 insertions(+), 1 deletions(-)
1007
1008 commit 68fefb2af5364e47915ed1491f85ce41d2609cb8
1009 Author: David Zeuthen <davidz@redhat.com>
1010 Date: Fri Aug 31 16:02:10 2007 -0400
1011
1012 rename the session daemon from polkit-gnome to polkit-gnome-manager
1013
1014 data/Makefile.am | 2 +-
1015 data/org.gnome.PolicyKit.service.in | 2 +-
1016 po/PolicyKit-gnome.pot | 2 +-
1017 po/da.po | 2 +-
1018 src/Makefile.am | 18 +++++++++---------
1019 5 files changed, 13 insertions(+), 13 deletions(-)
1020
1021 commit 688db47fc7f76f6413b1bceec9d15ff995cc154e
1022 Author: David Zeuthen <davidz@redhat.com>
1023 Date: Thu Aug 23 22:16:21 2007 -0400
1024
1025 update danish translations and remove en_CA translations
1026
1027 po/LINGUAS | 1 -
1028 po/PolicyKit-gnome.pot | 60 ++++++++++----
1029 po/da.po | 74 ++++++++++++-----
1030 po/en_CA.po | 220
1031 ------------------------------------------------
1032 4 files changed, 97 insertions(+), 258 deletions(-)
1033
1034 commit e783f6e9c8e2f30e411dfe6f9c2de2982dd13dfb
1035 Author: David Zeuthen <davidz@redhat.com>
1036 Date: Wed Aug 22 18:33:34 2007 -0400
1037
1038 add an example of how annotations are used
1039
1040 Also see
1041 http://gitweb.freedesktop.org/?p=PolicyKit.git;a=commitdiff;h=9924987f324953fa9e58b937dfedc1cc06ece0b3
1042
1043 examples/polkit-gnome-example-helper.c | 85
1044 ++++++++++++++++++-------------
1045 examples/polkit-gnome-example.c | 36 +++++++++++--
1046 examples/polkit-gnome-example.policy.in | 30 +++++++++++
1047 3 files changed, 111 insertions(+), 40 deletions(-)
1048
1049 commit 691f8688f833e218d6765b2c37491925946a7b43
1050 Author: David Zeuthen <davidz@redhat.com>
1051 Date: Mon Aug 20 23:07:32 2007 -0400
1052
1053 update to be compatible with PolicyKit HEAD
1054
1055 Specifically this change
1056
1057 http://gitweb.freedesktop.org/?p=PolicyKit.git;a=commitdiff;h=829838ea1df46923f9cdfe93af74c44c7e1752b2
1058
1059 examples/polkit-gnome-example-helper.c | 8 +-
1060 examples/polkit-gnome-example.c | 8 +-
1061 examples/polkit-gnome-example.policy.in | 73 +++++++++++------------
1062 po/LINGUAS | 1 +
1063 po/PolicyKit-gnome.pot | 94
1064 ++++++++++++++++++++----------
1065 po/da.po | 96
1066 ++++++++++++++++++++----------
1067 src/polkit-gnome-manager.c | 1 -
1068 7 files changed, 170 insertions(+), 111 deletions(-)
1069
1070 commit 57ef7f3c4125db9d0a043134c13fe37491ded82f
1071 Author: David Zeuthen <davidz@redhat.com>
1072 Date: Mon Aug 20 23:06:13 2007 -0400
1073
1074 add en_CA translations
1075
1076 http://people.freedesktop.org/~david/polkit-new-action-en_CA.png
1077
1078 This was added simply to test whether intltool would use
1079 xml:lang="en_CA" (which it did) or xml:lang="en-CA" (which it
1080 didn't). I believe the XML standard dictates the latter but am unsure.
1081
1082 po/en_CA.po | 220
1083 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1084 1 files changed, 220 insertions(+), 0 deletions(-)
1085
1086 commit 3898bff3829a7441856654b118ff4f86af6940eb
1087 Author: David Zeuthen <davidz@redhat.com>
1088 Date: Mon Aug 13 15:32:23 2007 -0400
1089
1090 break the D-Bus by taking an X11 window ID
1091
1092 This is used such that the dialog will be made transient for the given
1093 window; meaning that the WM will have a lot more information to
1094 properly position and manage our dialog.
1095
1096 examples/polkit-gnome-example.c | 17 +++++++++++------
1097 src/polkit-gnome-manager.c | 29 +++++++++++++++++++++++++----
1098 src/polkit-gnome-manager.h | 1 +
1099 src/polkit-gnome-manager.xml | 1 +
1100 4 files changed, 38 insertions(+), 10 deletions(-)
1101
1102 commit 24725de423d6b2035dee9c3616b02876a94a1e40
1103 Author: David Zeuthen <davidz@redhat.com>
1104 Date: Mon Aug 13 13:45:26 2007 -0400
1105
1106 update to work with PolicyKit HEAD's support for <define_admin_auth/>
1107
1108 This means that instead of "auth as root" we can now have "auth as a
1109 user in the wheel group".
1110
1111 examples/polkit-gnome-example.c | 6 +-
1112 src/polkit-gnome-auth-dialog.c | 246
1113 +++++++++++++++++++++++++++++++++++++-
1114 src/polkit-gnome-auth-dialog.h | 9 ++-
1115 src/polkit-gnome-manager.c | 181 +++++++++++++++++++++++++---
1116 4 files changed, 413 insertions(+), 29 deletions(-)
1117
1118 commit d88a0376b56fcd620a0dc9e803cc5669b2431a39
1119 Author: David Zeuthen <davidz@redhat.com>
1120 Date: Thu Aug 9 16:40:15 2007 -0400
1121
1122 put icons on buttons to signify whether the action is permitted
1123
1124 Also listen for config_changed() callbacks from libpolkit so the icons
1125 are updated in real-time.
1126
1127 examples/polkit-gnome-example-helper.c | 4 -
1128 examples/polkit-gnome-example.c | 162
1129 +++++++++++++++++++++++++++++++-
1130 2 files changed, 159 insertions(+), 7 deletions(-)
1131
1132 commit 6992e119bbb15282aec91f4fb63285255a68c734
1133 Author: David Zeuthen <davidz@redhat.com>
1134 Date: Wed Aug 1 17:04:44 2007 -0400
1135
1136 fix make distcheck
1137
1138 examples/Makefile.am | 30 +++++++++++++++---------------
1139 1 files changed, 15 insertions(+), 15 deletions(-)
1140
1141 commit dcecf2f4520911ad7ff5d0f10ecf869273e16247
1142 Author: David Zeuthen <davidz@redhat.com>
1143 Date: Wed Aug 1 17:00:56 2007 -0400
1144
1145 fix up i18n framework and add Danish translations
1146
1147 If building from source, you will need a recent a patch for intltool
1148 with this patch
1149
1150 http://bugzilla.gnome.org/show_bug.cgi?id=462312
1151
1152 aclocal.m4 | 2 +
1153 examples/Makefile.am | 10 +-
1154 examples/polkit-gnome-example.c | 2 +-
1155 examples/polkit-gnome-example.policy.in | 8 +-
1156 po/ChangeLog | 5 +
1157 po/LINGUAS | 3 +
1158 po/POTFILES.in | 2 +-
1159 po/PolicyKit-gnome.pot | 40 +++++++-
1160 po/da.po | 187
1161 +++++++++++++++++++++++++++++++
1162 src/main.c | 2 +-
1163 src/polkit-gnome-auth-dialog.c | 2 +-
1164 src/polkit-gnome-manager.c | 2 +-
1165 12 files changed, 249 insertions(+), 16 deletions(-)
1166
1167 commit 1cf57a05b7361d952acafa3b85271ddc16d0100c
1168 Author: David Zeuthen <davidz@redhat.com>
1169 Date: Tue Jul 31 11:23:27 2007 -0400
1170
1171 post-release version bump to version 0.5
1172
1173 Also require PolicyKit >= 0.5
1174
1175 configure.ac | 6 +++---
1176 1 files changed, 3 insertions(+), 3 deletions(-)
1177
1178 commit c9403954dec353de518e0a17547df8b6b40d6377
1179 Author: David Zeuthen <davidz@redhat.com>
1180 Date: Wed Jul 25 22:11:56 2007 -0400
1181
1182 temporarily remove polkit-gnome-example.policy.in from POTFILES.in
1183
1184 po/POTFILES.in | 2 +-
1185 1 files changed, 1 insertions(+), 1 deletions(-)
1186
1187 commit 479b21056c3a631f0f60e9e02c044062cf62f020
1188 Author: David Zeuthen <davidz@redhat.com>
1189 Date: Wed Jul 25 22:10:00 2007 -0400
1190
1191 update NEWS
1192
1193 NEWS | 21 +++++++++++++++++++++
1194 1 files changed, 21 insertions(+), 0 deletions(-)
1195
1196 commit 49541098c3661587c8455adfb0f0712692780b22
1197 Author: David Zeuthen <davidz@redhat.com>
1198 Date: Wed Jul 25 19:10:07 2007 -0400
1199
1200 get dialog message from the .policy file
1201
1202 See this commit
1203
1204 http://gitweb.freedesktop.org/?p=PolicyKit.git;a=commit;h=e833c740cb2b124e451b028637148bc829c3c650
1205
1206 for details.
1207
1208 TODO | 2 +-
1209 aclocal.m4 | 4 +-
1210 examples/Makefile.am | 4 ++
1211 examples/polkit-gnome-example.c | 7 ----
1212 examples/polkit-gnome-example.policy | 52
1213 ---------------------------
1214 examples/polkit-gnome-example.policy.in | 58
1215 +++++++++++++++++++++++++++++++
1216 po/POTFILES.in | 1 +
1217 po/PolicyKit-gnome.pot | 41 ++++++---------------
1218 src/polkit-gnome-manager.c | 50 ++++++++------------------
1219 src/polkit-gnome-manager.h | 2 -
1220 src/polkit-gnome-manager.xml | 2 -
1221 11 files changed, 93 insertions(+), 130 deletions(-)
1222
1223 commit cfb54e5968270ae522a63a87f7d4abbcff8298d9
1224 Author: David Zeuthen <davidz@redhat.com>
1225 Date: Wed Jul 25 14:33:31 2007 -0400
1226
1227 updated pot file
1228
1229 po/PolicyKit-gnome.pot | 2 +-
1230 1 files changed, 1 insertions(+), 1 deletions(-)
1231
1232 commit 49cced119f102c3514a13b8220d6f414dfa4e416
1233 Author: David Zeuthen <davidz@redhat.com>
1234 Date: Tue Jul 24 15:43:19 2007 -0400
1235
1236 update to s/root/admin/ change made in PK HEAD
1237
1238 examples/polkit-gnome-example.policy | 4 ++--
1239 po/PolicyKit-gnome.pot | 6 +++---
1240 src/polkit-gnome-manager.c | 24 ++++++++++++------------
1241 3 files changed, 17 insertions(+), 17 deletions(-)
1242
1243 commit ea5e66ded9fc70193c1ea4f3cbe1090bb4fc8526
1244 Author: David Zeuthen <davidz@redhat.com>
1245 Date: Mon Jul 23 22:24:41 2007 -0400
1246
1247 update to work with latest PolicyKit
1248
1249 examples/polkit-gnome-example-helper.c | 36 ++
1250 src/Makefile.am | 2 -
1251 src/file-monitor.c | 676
1252 --------------------------------
1253 src/file-monitor.h | 86 ----
1254 src/polkit-gnome-manager.c | 131 ++-----
1255 5 files changed, 71 insertions(+), 860 deletions(-)
1256
1257 commit 445abbc651860428765465780604d412af19ac8c
1258 Author: David Zeuthen <davidz@redhat.com>
1259 Date: Wed Jun 20 01:57:16 2007 -0400
1260
1261 post-release version bump
1262
1263 configure.ac | 2 +-
1264 1 files changed, 1 insertions(+), 1 deletions(-)
1265
1266 commit 01378715884ff63c59a13e3e16058fa1a87c171a
1267 Author: David Zeuthen <davidz@redhat.com>
1268 Date: Wed Jun 20 01:52:40 2007 -0400
1269
1270 update TODO
1271
1272 TODO | 6 +++++-
1273 1 files changed, 5 insertions(+), 1 deletions(-)
1274
1275 commit 1343801cd7d1721367f183e9afa59aa2d4c77829
1276 Author: David Zeuthen <davidz@redhat.com>
1277 Date: Wed Jun 20 01:33:53 2007 -0400
1278
1279 update NEWS for release
1280
1281 NEWS | 22 +++++++++++++++++++++-
1282 1 files changed, 21 insertions(+), 1 deletions(-)
1283
1284 commit 500e9cd0da6fdc1b44c22dc718f4dec4cfb99037
1285 Author: David Zeuthen <davidz@redhat.com>
1286 Date: Wed Jun 20 01:33:38 2007 -0400
1287
1288 update HACKING
1289
1290 HACKING | 85
1291 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1292 1 files changed, 81 insertions(+), 4 deletions(-)
1293
1294 commit 8691bfa695de591d0101abb8379e8a897feb9efc
1295 Author: David Zeuthen <davidz@redhat.com>
1296 Date: Wed Jun 20 01:20:44 2007 -0400
1297
1298 make sure i18n works
1299
1300 examples/polkit-gnome-example.c | 26 ++++----
1301 po/POTFILES.in | 4 +
1302 po/PolicyKit-gnome.pot | 147
1303 +++++++++++++++++++++++++++++++++++++++
1304 src/main.c | 2 +-
1305 src/polkit-gnome-auth-dialog.c | 88 +++--------------------
1306 src/polkit-gnome-manager.c | 4 +-
1307 6 files changed, 178 insertions(+), 93 deletions(-)
1308
1309 commit ad3f4c21d719921f85223e6e0548c94b3d608588
1310 Author: David Zeuthen <davidz@redhat.com>
1311 Date: Wed Jun 20 01:20:07 2007 -0400
1312
1313 the policy directory have moved in PolicyKit; fix this
1314
1315 configure.ac | 6 ++++++
1316 examples/Makefile.am | 8 ++++++--
1317 2 files changed, 12 insertions(+), 2 deletions(-)
1318
1319 commit 521f373ee260af8493028771a383de25fc8ae4ce
1320 Author: David Zeuthen <davidz@redhat.com>
1321 Date: Wed Jun 20 01:18:37 2007 -0400
1322
1323 write TODO items
1324
1325 TODO | 19 ++++++++++++++++++-
1326 1 files changed, 18 insertions(+), 1 deletions(-)
1327
1328 commit 680239eb57133706868697120b2982018f1e4174
1329 Author: David Zeuthen <davidz@redhat.com>
1330 Date: Tue Jun 19 20:58:55 2007 -0400
1331
1332 launch the helper from the right place
1333
1334 examples/polkit-gnome-example.c | 2 +-
1335 1 files changed, 1 insertions(+), 1 deletions(-)
1336
1337 commit 700e409b9d180f7e2fcf236be632812b8784290e
1338 Author: David Zeuthen <davidz@redhat.com>
1339 Date: Tue Jun 19 20:53:09 2007 -0400
1340
1341 also dist HACKING
1342
1343 Makefile.am | 3 ++-
1344 1 files changed, 2 insertions(+), 1 deletions(-)
1345
1346 commit 947ea455c52f576f4b5586288c719cb02b340cde
1347 Author: David Zeuthen <davidz@redhat.com>
1348 Date: Tue Jun 19 20:46:12 2007 -0400
1349
1350 update copyright and COPYING file (GPLv2 or later)
1351
1352 COPYING | 493
1353 --------------------------------
1354 examples/polkit-gnome-example-helper.c | 21 ++-
1355 examples/polkit-gnome-example.c | 20 ++-
1356 src/main.c | 20 ++-
1357 src/polkit-gnome-auth-dialog.c | 20 ++-
1358 src/polkit-gnome-auth-dialog.h | 20 ++-
1359 src/polkit-gnome-manager.c | 20 ++-
1360 src/polkit-gnome-manager.h | 20 ++-
1361 8 files changed, 133 insertions(+), 501 deletions(-)
1362
1363 commit f584416b133a9c85f4686b38f634e25c5315b7fa
1364 Author: David Zeuthen <davidz@redhat.com>
1365 Date: Tue Jun 19 20:41:18 2007 -0400
1366
1367 align to PolicyKit version number (0.3) and ensure that make
1368 distcheck works
1369
1370 TODO | 2 ++
1371 configure.ac | 2 +-
1372 data/Makefile.am | 2 ++
1373 examples/Makefile.am | 4 ----
1374 src/Makefile.am | 3 +++
1375 5 files changed, 8 insertions(+), 5 deletions(-)
1376
1377 commit 3cffd4884d9d59806cc1e49bd4f1915ceef5a20b
1378 Author: David Zeuthen <davidz@redhat.com>
1379 Date: Tue Jun 19 16:40:26 2007 -0400
1380
1381 update .policy file
1382
1383 examples/polkit-gnome-example.policy | 20 ++------------------
1384 1 files changed, 2 insertions(+), 18 deletions(-)
1385
1386 commit a71f9d0195db75db56d3bf4bf4c48e7613a344cd
1387 Author: David Zeuthen <davidz@redhat.com>
1388 Date: Tue Jun 19 16:36:35 2007 -0400
1389
1390 update to PolicyKit HEAD; the notion of PolicyKit resources are gone
1391
1392 examples/Makefile.am | 14 ++--
1393 examples/polkit-gnome-example-helper.c | 148
1394 +++++++++++++++++++++++++++++++
1395 examples/polkit-gnome-example-helper1.c | 100 ---------------------
1396 examples/polkit-gnome-example.c | 102 +++++++++++++++------
1397 examples/polkit-gnome-example.policy | 53 +++++++++--
1398 src/polkit-gnome-auth-dialog.c | 55 +-----------
1399 src/polkit-gnome-auth-dialog.h | 8 +--
1400 src/polkit-gnome-manager.c | 56 ++----------
1401 src/polkit-gnome-manager.h | 2 -
1402 src/polkit-gnome-manager.xml | 4 +-
1403 10 files changed, 288 insertions(+), 254 deletions(-)
1404
1405 commit b04852b1a5083ffa820987f8ff232275442b3ff7
1406 Author: David Zeuthen <davidz@redhat.com>
1407 Date: Thu Jun 14 12:56:08 2007 -0400
1408
1409 move auth dialog service to /usr/libexec and add D-Bus activation bits
1410
1411 data/Makefile.am | 11 ++++++++++-
1412 data/org.gnome.PolicyKit.service.in | 3 +++
1413 src/Makefile.am | 2 +-
1414 3 files changed, 14 insertions(+), 2 deletions(-)
1415
1416 commit a0342abfa35b6761c5c3b3a68edfcc8c2ac7d0c7
1417 Author: David Zeuthen <davidz@redhat.com>
1418 Date: Thu Jun 14 12:25:00 2007 -0400
1419
1420 forgot to add XML definitions for D-Bus session service
1421
1422 src/polkit-gnome-manager.xml | 14 ++++++++++++++
1423 1 files changed, 14 insertions(+), 0 deletions(-)
1424
1425 commit 9dd41ecb999639ce594734d9a41e2d2f864e10d5
1426 Author: David Zeuthen <davidz@redhat.com>
1427 Date: Thu Jun 14 12:13:39 2007 -0400
1428
1429 initial code dump
1430
1431 AUTHORS | 2 +
1432 COPYING | 834 ++++
1433 HACKING | 8 +
1434 MAINTAINERS | 1 +
1435 Makefile.am | 16 +
1436 NEWS | 1 +
1437 README | 1 +
1438 aclocal.m4 | 8323
1439 +++++++++++++++++++++++++++++++
1440 autogen.sh | 20 +
1441 configure.ac | 71 +
1442 data/Makefile.am | 3 +
1443 examples/Makefile.am | 69 +
1444 examples/polkit-gnome-example-helper1.c | 100 +
1445 examples/polkit-gnome-example.c | 192 +
1446 examples/polkit-gnome-example.policy | 33 +
1447 po/LINGUAS | 1 +
1448 po/POTFILES.in | 2 +
1449 src/Makefile.am | 40 +
1450 src/file-monitor.c | 676 +++
1451 src/file-monitor.h | 86 +
1452 src/inotify_local.h | 192 +
1453 src/main.c | 178 +
1454 src/polkit-gnome-auth-dialog.c | 607 +++
1455 src/polkit-gnome-auth-dialog.h | 59 +
1456 src/polkit-gnome-manager.c | 924 ++++
1457 src/polkit-gnome-manager.h | 54 +
1458 26 files changed, 12493 insertions(+), 0 deletions(-)
0 SUBDIRS = data src po
0 SUBDIRS = data src polkit-gnome tools
11
22 if BUILD_EXAMPLES
33 SUBDIRS += examples
44 endif
5
6 # Need to build docs after examples because the docs include generated files
7 SUBDIRS += doc po
8
9 # Creating ChangeLog from git log (taken from cairo/Makefile.am):
10 ChangeLog: $(srcdir)/ChangeLog
11
12 $(srcdir)/ChangeLog:
13 @if test -d "$(srcdir)/.git"; then \
14 (cd "$(srcdir)" && \
15 ./missing --run git-log --stat) | fmt --split-only > $@.tmp \
16 && mv -f $@.tmp $@ \
17 || ($(RM) $@.tmp; \
18 echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
19 (test -f $@ || echo git-log is required to generate this file >> $@)); \
20 else \
21 test -f $@ || \
22 (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
23 echo A git checkout and git-log is required to generate this file >> $@); \
24 fi
25
26 .PHONY: ChangeLog $(srcdir)/ChangeLog
27
528
629 EXTRA_DIST = \
730 autogen.sh \
932 intltool-merge.in \
1033 intltool-update.in \
1134 TODO \
12 HACKING
35 HACKING \
36 ChangeLog
1337
1438 DISTCLEANFILES = \
1539 intltool-extract \
3434 subdir = .
3535 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
3636 $(srcdir)/Makefile.in $(srcdir)/config.h.in \
37 $(top_srcdir)/configure AUTHORS COPYING NEWS TODO config.guess \
38 config.sub depcomp install-sh ltmain.sh missing mkinstalldirs
37 $(top_srcdir)/configure AUTHORS COPYING ChangeLog NEWS TODO \
38 config.guess config.sub depcomp install-sh ltmain.sh missing \
39 mkinstalldirs
3940 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
4041 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
4142 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
5859 distclean-recursive maintainer-clean-recursive
5960 ETAGS = etags
6061 CTAGS = ctags
61 DIST_SUBDIRS = data src po examples
62 DIST_SUBDIRS = data src polkit-gnome tools examples doc po
6263 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
6364 distdir = $(PACKAGE)-$(VERSION)
6465 top_distdir = $(distdir)
9697 CXXFLAGS = @CXXFLAGS@
9798 CYGPATH_W = @CYGPATH_W@
9899 DATADIRNAME = @DATADIRNAME@
100 DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
101 DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
99102 DEFS = @DEFS@
100103 DEPDIR = @DEPDIR@
101104 DISABLE_DEPRECATED = @DISABLE_DEPRECATED@
111114 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
112115 GMOFILES = @GMOFILES@
113116 GMSGFMT = @GMSGFMT@
117 GNOME_VFS_CFLAGS = @GNOME_VFS_CFLAGS@
118 GNOME_VFS_LIBS = @GNOME_VFS_LIBS@
114119 GREP = @GREP@
120 GTKDOC_CHECK = @GTKDOC_CHECK@
121 GTK_CFLAGS = @GTK_CFLAGS@
122 GTK_LIBS = @GTK_LIBS@
115123 HELP_DIR = @HELP_DIR@
124 HTML_DIR = @HTML_DIR@
116125 INSTALL = @INSTALL@
117126 INSTALL_DATA = @INSTALL_DATA@
118127 INSTALL_PROGRAM = @INSTALL_PROGRAM@
149158 LIBTOOL = @LIBTOOL@
150159 LN_S = @LN_S@
151160 LTLIBOBJS = @LTLIBOBJS@
161 LT_AGE = @LT_AGE@
162 LT_CURRENT = @LT_CURRENT@
163 LT_REVISION = @LT_REVISION@
152164 MAINT = @MAINT@
153165 MAKEINFO = @MAKEINFO@
154166 MKDIR_P = @MKDIR_P@
166178 PATH_SEPARATOR = @PATH_SEPARATOR@
167179 PKG_CONFIG = @PKG_CONFIG@
168180 POFILES = @POFILES@
169 POLKIT_GNOME_CFLAGS = @POLKIT_GNOME_CFLAGS@
170 POLKIT_GNOME_LIBS = @POLKIT_GNOME_LIBS@
181 POLKIT_DBUS_CFLAGS = @POLKIT_DBUS_CFLAGS@
182 POLKIT_DBUS_LIBS = @POLKIT_DBUS_LIBS@
183 POLKIT_GRANT_CFLAGS = @POLKIT_GRANT_CFLAGS@
184 POLKIT_GRANT_LIBS = @POLKIT_GRANT_LIBS@
171185 POLKIT_POLICY_FILE_VALIDATE = @POLKIT_POLICY_FILE_VALIDATE@
172186 POSUB = @POSUB@
173187 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
175189 RANLIB = @RANLIB@
176190 SED = @SED@
177191 SET_MAKE = @SET_MAKE@
192 SEXY_CFLAGS = @SEXY_CFLAGS@
193 SEXY_LIBS = @SEXY_LIBS@
178194 SHELL = @SHELL@
179195 STRIP = @STRIP@
180196 USE_NLS = @USE_NLS@
232248 target_alias = @target_alias@
233249 top_builddir = @top_builddir@
234250 top_srcdir = @top_srcdir@
235 SUBDIRS = data src po $(am__append_1)
251
252 # Need to build docs after examples because the docs include generated files
253 SUBDIRS = data src polkit-gnome tools $(am__append_1) doc po
236254 EXTRA_DIST = \
237255 autogen.sh \
238256 intltool-extract.in \
239257 intltool-merge.in \
240258 intltool-update.in \
241259 TODO \
242 HACKING
260 HACKING \
261 ChangeLog
243262
244263 DISTCLEANFILES = \
245264 intltool-extract \
690709 tags tags-recursive uninstall uninstall-am
691710
692711
712 # Creating ChangeLog from git log (taken from cairo/Makefile.am):
713 ChangeLog: $(srcdir)/ChangeLog
714
715 $(srcdir)/ChangeLog:
716 @if test -d "$(srcdir)/.git"; then \
717 (cd "$(srcdir)" && \
718 ./missing --run git-log --stat) | fmt --split-only > $@.tmp \
719 && mv -f $@.tmp $@ \
720 || ($(RM) $@.tmp; \
721 echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
722 (test -f $@ || echo git-log is required to generate this file >> $@)); \
723 else \
724 test -f $@ || \
725 (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
726 echo A git checkout and git-log is required to generate this file >> $@); \
727 fi
728
729 .PHONY: ChangeLog $(srcdir)/ChangeLog
730
693731 clean-local :
694732 rm -f *~ po/*~
695733 # Tell versions [3.59,3.63) of GNU make to not export all variables.
0 ==========
1 PolicyKit-gnome 0.7
2 ==========
3
4 Released on December 5th 2007.
5
6 This is the fifth release of PolicyKit-gnome.
7
8 Highlights of this release
9
10 o Also listen on the new desktop-neutral session bus interface as
11 defined by PolicyKit
12 http://hal.freedesktop.org/docs/PolicyKit/model-authentication-agent.html
13
14 o New libpolkit-gnome library with lots of cool features
15
16 o New polkit-gnome-authorizations tool for managing authorizations
17
18 o Support for vendor name, site and icon. The icon will be blended over
19 the south-east quarter of the lock icon
20
21 o Various bug fixes
22
23 David Zeuthen (65):
24 post-release version bump
25 grab the pointer and keyboard when showing an auth dialog
26 don't grab the X keyboard; only grab the X pointer
27 do grab the keyboard anyway
28 add infrastructure for building a library
29 forgot to add gtk-doc.make
30 first stab at subclassing GtkAction for the libpolkit-gnome library
31 add authentication convience function and make PolKitGnomeAction smarter
32 add a polkit_gnome_action_create_button() convenience method
33 remove functionality to pass the X11 XID in PolKitGnomeAction
34 pass XID for top-level of the widget that caused the ::activate signal
35 show labels in buttons created by polkit_gnome_action_create_button()
36 add signals for ::auth_start, ::auth_end on PolKitGnomeAction
37 make all setters of PolKitGnomeAction private
38 clean up the example, include it in inline docs and remove the helper
39 ref the PolKitAction when returning it as a property
40 in the example, unref the PolKitAction objects to plug memory leaks
41 require (unreleased) PolicyKit 0.7 instead of 0.5
42 update label for buttons created with polkit_gnome_action_create_button()
43 show an example of properties of PolKitGnomeAction can be overridden
44 also propagate the ::activate signal if PolicyKit says 'no'
45 update example
46 add support for the 'short-label' property in PolKitGnomeAction
47 add toolbar and menubar to the example
48 minor style / translation fixes for polkit-gnome-example
49 fixed some i18n issues with polkit-gnome-example
50 add documentation for the authentication daemon
51 add some warning flags from gcc and fix up some warnings
52 the auth daemon is not multi-threaded, no need to init threads
53 we don't use libgnome nor libgnomeui so don't check for it in configure.ac
54 separate library dependencies into separate pkg-config modules
55 clean TODO - yay, down to one single trivial entry
56 for PolKitGnomeAction define what happens if PolKitAction is set to NULL
57 assorted libpolkit-gnome fixes
58 fix description of the Kick actions in the example
59 add a "Manage Authorization" application
60 various fixed for PolKitGnomeAction
61 include png
62 new class PolKitGnomeToggleAction
63 include PolKitGnomeToggleAction and update a screenshot
64 use PolKitGnomeToggleAction in example
65 various work-in-progress bits for the authorization tool
66 update for recent changes on PolicyKit HEAD
67 add support for one-shot authorizations
68 update screenshots in docs
69 update to slightly modified iterator API in PolicyKit HEAD
70 update to gtk-doc.make to handle parallel builds
71 use a tree for the actions and their namespaces instead of a flat list
72 add support for grant, revoke and editing implicit authorizations
73 add notebook to avoid showing summary when an action isn't selected
74 add support for vendor and icon
75 pull in sexy and gnome-vfs for better presentation and handling of vendor url's
76 make auth dialog show a link to the auth manager and add a .desktop file
77 actually do single instance by refusing to run if we can't claim the Name
78 add support for negative auths
79 fix corner case for the toggle action
80 also claim the name org.freedesktop.PolicyKit.AuthenticationAgent
81 add support for "target-pid" property and streamline auth interface
82 fix up POLKIT_TYPE_GNOME_CONTEXT to be POLKIT_GNOME_TYPE_CONTEXT
83 update docs to reflect the interface switch from org.gnome to org.freedesktop
84 for negative auths, make the face bw to make the stop icon stand out
85 update to latest PolicyKit API changes
86 introduce new polkit-action-sufficient property
87 update for latest PolicyKit API changes
88 update NEWS file
89
90 Requirements for PolicyKit-gnome 0.7
91
92 - PolicyKit == 0.7
93 - GTK+ >= 2.12
94 - dbus >= 1.0
95 - dbus-glib >= 0.71
96 - gnome-vfs >= 2.4
97 - libsexy >= 0.1.11
98
099 ==========
1100 PolicyKit-gnome 0.6
2101 ==========
0
1 - Extend the D-Bus interface to take an XID so the dialog can be
2 managed accordingly by the Window Manager
3
4 - Would it make sense to have a convience library libpolkit-gnome
5 that calls into the D-Bus service?
6
7 - HIGgy stuff
8
9 - Clean up the code; parts of it is somewhat a mess right now; do
10 we really need to link to libgnome and libgnome-ui?
11
12 - Support for systems that don't use the root account; e.g. instead
13 of authenticating as root, authenticate any user in e.g. the
14 'wheel' group. Probably means we need a combobox for selecting the
15 user to auth as. See also the TODO in PolicyKit
160
171 - Move the GNOME SVN (ticket ID [gnome.org #2863])
182
19 - Make the daemon exit after 30 seconds of no service requests
20
21 - Make the example use the new D-Bus system bus activation for the
22 helper as well as the (to be) setuid binary we've got now
686686 fi
687687
688688 GNOME_DOC_DEFINES
689 ])
690
691 dnl -*- mode: autoconf -*-
692
693 # serial 1
694
695 dnl Usage:
696 dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
697 AC_DEFUN([GTK_DOC_CHECK],
698 [
699 AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
700 AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
701 dnl for overriding the documentation installation directory
702 AC_ARG_WITH([html-dir],
703 AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
704 [with_html_dir='${datadir}/gtk-doc/html'])
705 HTML_DIR="$with_html_dir"
706 AC_SUBST([HTML_DIR])
707
708 dnl enable/disable documentation building
709 AC_ARG_ENABLE([gtk-doc],
710 AS_HELP_STRING([--enable-gtk-doc],
711 [use gtk-doc to build documentation [[default=no]]]),,
712 [enable_gtk_doc=no])
713
714 if test x$enable_gtk_doc = xyes; then
715 ifelse([$1],[],
716 [PKG_CHECK_EXISTS([gtk-doc],,
717 AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
718 [PKG_CHECK_EXISTS([gtk-doc >= $1],,
719 AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build gtk-doc]))])
720 fi
721
722 AC_MSG_CHECKING([whether to build gtk-doc documentation])
723 AC_MSG_RESULT($enable_gtk_doc)
724
725 AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,)
726
727 AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
728 AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
689729 ])
690730
691731
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.61 for PolicyKit-gnome 0.6.
2 # Generated by GNU Autoconf 2.61 for PolicyKit-gnome 0.7.
33 #
44 # Report bugs to <mailto:david@fubar.dk>.
55 #
727727 # Identity of this package.
728728 PACKAGE_NAME='PolicyKit-gnome'
729729 PACKAGE_TARNAME='PolicyKit-gnome'
730 PACKAGE_VERSION='0.6'
731 PACKAGE_STRING='PolicyKit-gnome 0.6'
730 PACKAGE_VERSION='0.7'
731 PACKAGE_STRING='PolicyKit-gnome 0.7'
732732 PACKAGE_BUGREPORT='mailto:david@fubar.dk'
733733
734734 ac_unique_file="src"
830830 MAINTAINER_MODE_TRUE
831831 MAINTAINER_MODE_FALSE
832832 MAINT
833 LT_CURRENT
834 LT_REVISION
835 LT_AGE
833836 CC
834837 CFLAGS
835838 LDFLAGS
884887 HAVE_GNOME_DOC_UTILS_FALSE
885888 WARN_CFLAGS
886889 DISABLE_DEPRECATED
887 POLKIT_GNOME_CFLAGS
888 POLKIT_GNOME_LIBS
890 HTML_DIR
891 GTKDOC_CHECK
892 ENABLE_GTK_DOC_TRUE
893 ENABLE_GTK_DOC_FALSE
894 GTK_DOC_USE_LIBTOOL_TRUE
895 GTK_DOC_USE_LIBTOOL_FALSE
896 GTK_CFLAGS
897 GTK_LIBS
898 SEXY_CFLAGS
899 SEXY_LIBS
900 GNOME_VFS_CFLAGS
901 GNOME_VFS_LIBS
902 DBUS_GLIB_CFLAGS
903 DBUS_GLIB_LIBS
904 POLKIT_DBUS_CFLAGS
905 POLKIT_DBUS_LIBS
906 POLKIT_GRANT_CFLAGS
907 POLKIT_GRANT_LIBS
889908 BUILD_EXAMPLES_TRUE
890909 BUILD_EXAMPLES_FALSE
891910 POLKIT_POLICY_FILE_VALIDATE
953972 F77
954973 FFLAGS
955974 PKG_CONFIG
956 POLKIT_GNOME_CFLAGS
957 POLKIT_GNOME_LIBS'
975 GTK_CFLAGS
976 GTK_LIBS
977 SEXY_CFLAGS
978 SEXY_LIBS
979 GNOME_VFS_CFLAGS
980 GNOME_VFS_LIBS
981 DBUS_GLIB_CFLAGS
982 DBUS_GLIB_LIBS
983 POLKIT_DBUS_CFLAGS
984 POLKIT_DBUS_LIBS
985 POLKIT_GRANT_CFLAGS
986 POLKIT_GRANT_LIBS'
958987
959988
960989 # Initialize some variables set by options.
14571486 # Omit some internal or obsolete options to make the list less imposing.
14581487 # This message is too long to be a string in the A/UX 3.1 sh.
14591488 cat <<_ACEOF
1460 \`configure' configures PolicyKit-gnome 0.6 to adapt to many kinds of systems.
1489 \`configure' configures PolicyKit-gnome 0.7 to adapt to many kinds of systems.
14611490
14621491 Usage: $0 [OPTION]... [VAR=VALUE]...
14631492
15271556
15281557 if test -n "$ac_init_help"; then
15291558 case $ac_init_help in
1530 short | recursive ) echo "Configuration of PolicyKit-gnome 0.6:";;
1559 short | recursive ) echo "Configuration of PolicyKit-gnome 0.7:";;
15311560 esac
15321561 cat <<\_ACEOF
15331562
15481577 --enable-compile-warnings=[no/minimum/yes/maximum/error]
15491578 Turn on compiler warnings
15501579 --enable-iso-c Try to warn if code is not ISO C
1580 --enable-gtk-doc use gtk-doc to build documentation default=yes
1581 --enable-gtk-doc use gtk-doc to build documentation [default=no]
15511582 --enable-examples Build the example programs
15521583
15531584 Optional Packages:
15611592 --with-omf-dir=DIR path to OMF files
15621593 --with-help-formats=FORMATS
15631594 list of formats
1595 --with-html-dir=PATH path to installed docs
15641596
15651597 Some influential environment variables:
15661598 CC C compiler command
15771609 F77 Fortran 77 compiler command
15781610 FFLAGS Fortran 77 compiler flags
15791611 PKG_CONFIG path to pkg-config utility
1580 POLKIT_GNOME_CFLAGS
1581 C compiler flags for POLKIT_GNOME, overriding pkg-config
1582 POLKIT_GNOME_LIBS
1583 linker flags for POLKIT_GNOME, overriding pkg-config
1612 GTK_CFLAGS C compiler flags for GTK, overriding pkg-config
1613 GTK_LIBS linker flags for GTK, overriding pkg-config
1614 SEXY_CFLAGS C compiler flags for SEXY, overriding pkg-config
1615 SEXY_LIBS linker flags for SEXY, overriding pkg-config
1616 GNOME_VFS_CFLAGS
1617 C compiler flags for GNOME_VFS, overriding pkg-config
1618 GNOME_VFS_LIBS
1619 linker flags for GNOME_VFS, overriding pkg-config
1620 DBUS_GLIB_CFLAGS
1621 C compiler flags for DBUS_GLIB, overriding pkg-config
1622 DBUS_GLIB_LIBS
1623 linker flags for DBUS_GLIB, overriding pkg-config
1624 POLKIT_DBUS_CFLAGS
1625 C compiler flags for POLKIT_DBUS, overriding pkg-config
1626 POLKIT_DBUS_LIBS
1627 linker flags for POLKIT_DBUS, overriding pkg-config
1628 POLKIT_GRANT_CFLAGS
1629 C compiler flags for POLKIT_GRANT, overriding pkg-config
1630 POLKIT_GRANT_LIBS
1631 linker flags for POLKIT_GRANT, overriding pkg-config
15841632
15851633 Use these variables to override the choices made by `configure' or to help
15861634 it to find libraries and programs with nonstandard names/locations.
16461694 test -n "$ac_init_help" && exit $ac_status
16471695 if $ac_init_version; then
16481696 cat <<\_ACEOF
1649 PolicyKit-gnome configure 0.6
1697 PolicyKit-gnome configure 0.7
16501698 generated by GNU Autoconf 2.61
16511699
16521700 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
16601708 This file contains any messages produced by compilers while
16611709 running configure, to aid debugging if configure makes a mistake.
16621710
1663 It was created by PolicyKit-gnome $as_me 0.6, which was
1711 It was created by PolicyKit-gnome $as_me 0.7, which was
16641712 generated by GNU Autoconf 2.61. Invocation command line was
16651713
16661714 $ $0 $@
23512399
23522400 # Define the identity of the package.
23532401 PACKAGE='PolicyKit-gnome'
2354 VERSION='0.6'
2402 VERSION='0.7'
23552403
23562404
23572405 cat >>confdefs.h <<_ACEOF
25222570 fi
25232571
25242572 MAINT=$MAINTAINER_MODE_TRUE
2573
2574
2575
2576 # libtool versioning - this applies to all libraries in this package
2577 #
2578 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
2579 #
2580 LT_CURRENT=0
2581 LT_REVISION=0
2582 LT_AGE=0
2583
25252584
25262585
25272586
49104969 ;;
49114970 *-*-irix6*)
49124971 # Find out which ABI we are using.
4913 echo '#line 4914 "configure"' > conftest.$ac_ext
4972 echo '#line 4973 "configure"' > conftest.$ac_ext
49144973 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
49154974 (eval $ac_compile) 2>&5
49164975 ac_status=$?
72487307 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
72497308 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
72507309 -e 's:$: $lt_compiler_flag:'`
7251 (eval echo "\"\$as_me:7252: $lt_compile\"" >&5)
7310 (eval echo "\"\$as_me:7311: $lt_compile\"" >&5)
72527311 (eval "$lt_compile" 2>conftest.err)
72537312 ac_status=$?
72547313 cat conftest.err >&5
7255 echo "$as_me:7256: \$? = $ac_status" >&5
7314 echo "$as_me:7315: \$? = $ac_status" >&5
72567315 if (exit $ac_status) && test -s "$ac_outfile"; then
72577316 # The compiler can only warn and ignore the option if not recognized
72587317 # So say no if there are warnings other than the usual output.
75387597 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
75397598 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
75407599 -e 's:$: $lt_compiler_flag:'`
7541 (eval echo "\"\$as_me:7542: $lt_compile\"" >&5)
7600 (eval echo "\"\$as_me:7601: $lt_compile\"" >&5)
75427601 (eval "$lt_compile" 2>conftest.err)
75437602 ac_status=$?
75447603 cat conftest.err >&5
7545 echo "$as_me:7546: \$? = $ac_status" >&5
7604 echo "$as_me:7605: \$? = $ac_status" >&5
75467605 if (exit $ac_status) && test -s "$ac_outfile"; then
75477606 # The compiler can only warn and ignore the option if not recognized
75487607 # So say no if there are warnings other than the usual output.
76427701 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
76437702 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
76447703 -e 's:$: $lt_compiler_flag:'`
7645 (eval echo "\"\$as_me:7646: $lt_compile\"" >&5)
7704 (eval echo "\"\$as_me:7705: $lt_compile\"" >&5)
76467705 (eval "$lt_compile" 2>out/conftest.err)
76477706 ac_status=$?
76487707 cat out/conftest.err >&5
7649 echo "$as_me:7650: \$? = $ac_status" >&5
7708 echo "$as_me:7709: \$? = $ac_status" >&5
76507709 if (exit $ac_status) && test -s out/conftest2.$ac_objext
76517710 then
76527711 # The compiler can only warn and ignore the option if not recognized
999310052 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
999410053 lt_status=$lt_dlunknown
999510054 cat > conftest.$ac_ext <<EOF
9996 #line 9997 "configure"
10055 #line 10056 "configure"
999710056 #include "confdefs.h"
999810057
999910058 #if HAVE_DLFCN_H
1009310152 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1009410153 lt_status=$lt_dlunknown
1009510154 cat > conftest.$ac_ext <<EOF
10096 #line 10097 "configure"
10155 #line 10156 "configure"
1009710156 #include "confdefs.h"
1009810157
1009910158 #if HAVE_DLFCN_H
1251312572 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1251412573 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1251512574 -e 's:$: $lt_compiler_flag:'`
12516 (eval echo "\"\$as_me:12517: $lt_compile\"" >&5)
12575 (eval echo "\"\$as_me:12576: $lt_compile\"" >&5)
1251712576 (eval "$lt_compile" 2>conftest.err)
1251812577 ac_status=$?
1251912578 cat conftest.err >&5
12520 echo "$as_me:12521: \$? = $ac_status" >&5
12579 echo "$as_me:12580: \$? = $ac_status" >&5
1252112580 if (exit $ac_status) && test -s "$ac_outfile"; then
1252212581 # The compiler can only warn and ignore the option if not recognized
1252312582 # So say no if there are warnings other than the usual output.
1261712676 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1261812677 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1261912678 -e 's:$: $lt_compiler_flag:'`
12620 (eval echo "\"\$as_me:12621: $lt_compile\"" >&5)
12679 (eval echo "\"\$as_me:12680: $lt_compile\"" >&5)
1262112680 (eval "$lt_compile" 2>out/conftest.err)
1262212681 ac_status=$?
1262312682 cat out/conftest.err >&5
12624 echo "$as_me:12625: \$? = $ac_status" >&5
12683 echo "$as_me:12684: \$? = $ac_status" >&5
1262512684 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1262612685 then
1262712686 # The compiler can only warn and ignore the option if not recognized
1418114240 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1418214241 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1418314242 -e 's:$: $lt_compiler_flag:'`
14184 (eval echo "\"\$as_me:14185: $lt_compile\"" >&5)
14243 (eval echo "\"\$as_me:14244: $lt_compile\"" >&5)
1418514244 (eval "$lt_compile" 2>conftest.err)
1418614245 ac_status=$?
1418714246 cat conftest.err >&5
14188 echo "$as_me:14189: \$? = $ac_status" >&5
14247 echo "$as_me:14248: \$? = $ac_status" >&5
1418914248 if (exit $ac_status) && test -s "$ac_outfile"; then
1419014249 # The compiler can only warn and ignore the option if not recognized
1419114250 # So say no if there are warnings other than the usual output.
1428514344 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1428614345 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1428714346 -e 's:$: $lt_compiler_flag:'`
14288 (eval echo "\"\$as_me:14289: $lt_compile\"" >&5)
14347 (eval echo "\"\$as_me:14348: $lt_compile\"" >&5)
1428914348 (eval "$lt_compile" 2>out/conftest.err)
1429014349 ac_status=$?
1429114350 cat out/conftest.err >&5
14292 echo "$as_me:14293: \$? = $ac_status" >&5
14351 echo "$as_me:14352: \$? = $ac_status" >&5
1429314352 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1429414353 then
1429514354 # The compiler can only warn and ignore the option if not recognized
1647416533 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1647516534 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1647616535 -e 's:$: $lt_compiler_flag:'`
16477 (eval echo "\"\$as_me:16478: $lt_compile\"" >&5)
16536 (eval echo "\"\$as_me:16537: $lt_compile\"" >&5)
1647816537 (eval "$lt_compile" 2>conftest.err)
1647916538 ac_status=$?
1648016539 cat conftest.err >&5
16481 echo "$as_me:16482: \$? = $ac_status" >&5
16540 echo "$as_me:16541: \$? = $ac_status" >&5
1648216541 if (exit $ac_status) && test -s "$ac_outfile"; then
1648316542 # The compiler can only warn and ignore the option if not recognized
1648416543 # So say no if there are warnings other than the usual output.
1676416823 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1676516824 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1676616825 -e 's:$: $lt_compiler_flag:'`
16767 (eval echo "\"\$as_me:16768: $lt_compile\"" >&5)
16826 (eval echo "\"\$as_me:16827: $lt_compile\"" >&5)
1676816827 (eval "$lt_compile" 2>conftest.err)
1676916828 ac_status=$?
1677016829 cat conftest.err >&5
16771 echo "$as_me:16772: \$? = $ac_status" >&5
16830 echo "$as_me:16831: \$? = $ac_status" >&5
1677216831 if (exit $ac_status) && test -s "$ac_outfile"; then
1677316832 # The compiler can only warn and ignore the option if not recognized
1677416833 # So say no if there are warnings other than the usual output.
1686816927 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1686916928 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1687016929 -e 's:$: $lt_compiler_flag:'`
16871 (eval echo "\"\$as_me:16872: $lt_compile\"" >&5)
16930 (eval echo "\"\$as_me:16931: $lt_compile\"" >&5)
1687216931 (eval "$lt_compile" 2>out/conftest.err)
1687316932 ac_status=$?
1687416933 cat out/conftest.err >&5
16875 echo "$as_me:16876: \$? = $ac_status" >&5
16934 echo "$as_me:16935: \$? = $ac_status" >&5
1687616935 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1687716936 then
1687816937 # The compiler can only warn and ignore the option if not recognized
1952319582
1952419583
1952519584
19585 #### gcc warning flags
19586
19587 if test "x$GCC" = "xyes"; then
19588 case " $CFLAGS " in
19589 *[\ \ ]-Wall[\ \ ]*) ;;
19590 *) CFLAGS="$CFLAGS -Wall" ;;
19591 esac
19592
19593 case " $CFLAGS " in
19594 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
19595 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
19596 esac
19597
19598 case " $CFLAGS " in
19599 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
19600 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
19601 esac
19602
19603 case " $CFLAGS " in
19604 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
19605 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
19606 esac
19607
19608 case " $CFLAGS " in
19609 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
19610 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
19611 esac
19612
19613 case " $CFLAGS " in
19614 *[\ \ ]-Wcast-align[\ \ ]*) ;;
19615 *) CFLAGS="$CFLAGS -Wcast-align" ;;
19616 esac
19617
19618 case " $CFLAGS " in
19619 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
19620 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
19621 esac
19622
19623 if test "x$enable_ansi" = "xyes"; then
19624 case " $CFLAGS " in
19625 *[\ \ ]-ansi[\ \ ]*) ;;
19626 *) CFLAGS="$CFLAGS -ansi" ;;
19627 esac
19628
19629 case " $CFLAGS " in
19630 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
19631 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
19632 esac
19633
19634 case " $CFLAGS " in
19635 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
19636 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
19637 esac
19638
19639 case " $CFLAGS " in
19640 *[\ \ ]-pedantic[\ \ ]*) ;;
19641 *) CFLAGS="$CFLAGS -pedantic" ;;
19642 esac
19643 fi
19644 if test x$enable_gcov = xyes; then
19645 case " $CFLAGS " in
19646 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
19647 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
19648 esac
19649 case " $CFLAGS " in
19650 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
19651 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
19652 esac
19653
19654 ## remove optimization
19655 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
19656 fi
19657 else
19658 if test x$enable_gcov = xyes; then
19659 { { echo "$as_me:$LINENO: error: --enable-gcov can only be used with gcc" >&5
19660 echo "$as_me: error: --enable-gcov can only be used with gcc" >&2;}
19661 { (exit 1); exit 1; }; }
19662 fi
19663 fi
19664
1952619665 # *****
1952719666 # GNOME
1952819667 # *****
1989920038
1990020039
1990120040
20041 # Check whether --enable-gtk-doc was given.
20042 if test "${enable_gtk_doc+set}" = set; then
20043 enableval=$enable_gtk_doc;
20044 else
20045 enable_gtk_doc=yes
20046 fi
20047
20048
20049
20050 # Check whether --with-html-dir was given.
20051 if test "${with_html_dir+set}" = set; then
20052 withval=$with_html_dir;
20053 else
20054 with_html_dir='${datadir}/gtk-doc/html'
20055 fi
20056
20057 HTML_DIR="$with_html_dir"
20058
20059
20060 # Check whether --enable-gtk-doc was given.
20061 if test "${enable_gtk_doc+set}" = set; then
20062 enableval=$enable_gtk_doc;
20063 else
20064 enable_gtk_doc=no
20065 fi
20066
20067
20068 if test x$enable_gtk_doc = xyes; then
20069 if test -n "$PKG_CONFIG" && \
20070 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.3\"") >&5
20071 ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.3") 2>&5
20072 ac_status=$?
20073 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20074 (exit $ac_status); }; then
20075 :
20076 else
20077 { { echo "$as_me:$LINENO: error: You need to have gtk-doc >= 1.3 installed to build gtk-doc" >&5
20078 echo "$as_me: error: You need to have gtk-doc >= 1.3 installed to build gtk-doc" >&2;}
20079 { (exit 1); exit 1; }; }
20080 fi
20081 fi
20082
20083 { echo "$as_me:$LINENO: checking whether to build gtk-doc documentation" >&5
20084 echo $ECHO_N "checking whether to build gtk-doc documentation... $ECHO_C" >&6; }
20085 { echo "$as_me:$LINENO: result: $enable_gtk_doc" >&5
20086 echo "${ECHO_T}$enable_gtk_doc" >&6; }
20087
20088 for ac_prog in gtkdoc-check
20089 do
20090 # Extract the first word of "$ac_prog", so it can be a program name with args.
20091 set dummy $ac_prog; ac_word=$2
20092 { echo "$as_me:$LINENO: checking for $ac_word" >&5
20093 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
20094 if test "${ac_cv_path_GTKDOC_CHECK+set}" = set; then
20095 echo $ECHO_N "(cached) $ECHO_C" >&6
20096 else
20097 case $GTKDOC_CHECK in
20098 [\\/]* | ?:[\\/]*)
20099 ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path.
20100 ;;
20101 *)
20102 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
20103 for as_dir in $PATH
20104 do
20105 IFS=$as_save_IFS
20106 test -z "$as_dir" && as_dir=.
20107 for ac_exec_ext in '' $ac_executable_extensions; do
20108 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
20109 ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext"
20110 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
20111 break 2
20112 fi
20113 done
20114 done
20115 IFS=$as_save_IFS
20116
20117 ;;
20118 esac
20119 fi
20120 GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK
20121 if test -n "$GTKDOC_CHECK"; then
20122 { echo "$as_me:$LINENO: result: $GTKDOC_CHECK" >&5
20123 echo "${ECHO_T}$GTKDOC_CHECK" >&6; }
20124 else
20125 { echo "$as_me:$LINENO: result: no" >&5
20126 echo "${ECHO_T}no" >&6; }
20127 fi
20128
20129
20130 test -n "$GTKDOC_CHECK" && break
20131 done
20132
20133
20134 if test x$enable_gtk_doc = xyes; then
20135 ENABLE_GTK_DOC_TRUE=
20136 ENABLE_GTK_DOC_FALSE='#'
20137 else
20138 ENABLE_GTK_DOC_TRUE='#'
20139 ENABLE_GTK_DOC_FALSE=
20140 fi
20141
20142 if test -n "$LIBTOOL"; then
20143 GTK_DOC_USE_LIBTOOL_TRUE=
20144 GTK_DOC_USE_LIBTOOL_FALSE='#'
20145 else
20146 GTK_DOC_USE_LIBTOOL_TRUE='#'
20147 GTK_DOC_USE_LIBTOOL_FALSE=
20148 fi
20149
20150
20151
1990220152 # ***************************
1990320153 # Check for required packages
1990420154 # ***************************
1990520155
19906 GTK_REQUIRED=2.6.0
19907 LIBGNOME_REQUIRED=2.14.0
19908 LIBGNOMEUI_REQUIRED=2.14.0
20156 GTK_REQUIRED=2.12.0
20157 SEXY_REQUIRED=0.1.11
20158 GNOME_VFS_REQUIRED=2.4
1990920159 DBUS_GLIB_REQUIRED=0.71
19910 POLKIT_DBUS_REQUIRED=0.5
19911 POLKIT_GRANT_REQUIRED=0.5
20160 POLKIT_DBUS_REQUIRED=0.7
20161 POLKIT_GRANT_REQUIRED=0.7
1991220162
1991320163
1991420164 pkg_failed=no
19915 { echo "$as_me:$LINENO: checking for POLKIT_GNOME" >&5
19916 echo $ECHO_N "checking for POLKIT_GNOME... $ECHO_C" >&6; }
20165 { echo "$as_me:$LINENO: checking for GTK" >&5
20166 echo $ECHO_N "checking for GTK... $ECHO_C" >&6; }
1991720167
1991820168 if test -n "$PKG_CONFIG"; then
19919 if test -n "$POLKIT_GNOME_CFLAGS"; then
19920 pkg_cv_POLKIT_GNOME_CFLAGS="$POLKIT_GNOME_CFLAGS"
20169 if test -n "$GTK_CFLAGS"; then
20170 pkg_cv_GTK_CFLAGS="$GTK_CFLAGS"
1992120171 else
1992220172 if test -n "$PKG_CONFIG" && \
19923 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_REQUIRED
19924 libgnome-2.0 >= \$LIBGNOME_REQUIRED
19925 libgnomeui-2.0 >= \$LIBGNOMEUI_REQUIRED
19926 dbus-glib-1 >= \$DBUS_GLIB_REQUIRED
19927 polkit-dbus >= \$POLKIT_DBUS_REQUIRED
19928 polkit-grant >= \$POLKIT_GRANT_REQUIRED\"") >&5
19929 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= $GTK_REQUIRED
19930 libgnome-2.0 >= $LIBGNOME_REQUIRED
19931 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
19932 dbus-glib-1 >= $DBUS_GLIB_REQUIRED
19933 polkit-dbus >= $POLKIT_DBUS_REQUIRED
19934 polkit-grant >= $POLKIT_GRANT_REQUIRED") 2>&5
20173 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_REQUIRED\"") >&5
20174 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= $GTK_REQUIRED") 2>&5
1993520175 ac_status=$?
1993620176 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1993720177 (exit $ac_status); }; then
19938 pkg_cv_POLKIT_GNOME_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= $GTK_REQUIRED
19939 libgnome-2.0 >= $LIBGNOME_REQUIRED
19940 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
19941 dbus-glib-1 >= $DBUS_GLIB_REQUIRED
19942 polkit-dbus >= $POLKIT_DBUS_REQUIRED
19943 polkit-grant >= $POLKIT_GRANT_REQUIRED" 2>/dev/null`
20178 pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= $GTK_REQUIRED" 2>/dev/null`
1994420179 else
1994520180 pkg_failed=yes
1994620181 fi
1994920184 pkg_failed=untried
1995020185 fi
1995120186 if test -n "$PKG_CONFIG"; then
19952 if test -n "$POLKIT_GNOME_LIBS"; then
19953 pkg_cv_POLKIT_GNOME_LIBS="$POLKIT_GNOME_LIBS"
20187 if test -n "$GTK_LIBS"; then
20188 pkg_cv_GTK_LIBS="$GTK_LIBS"
1995420189 else
1995520190 if test -n "$PKG_CONFIG" && \
19956 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_REQUIRED
19957 libgnome-2.0 >= \$LIBGNOME_REQUIRED
19958 libgnomeui-2.0 >= \$LIBGNOMEUI_REQUIRED
19959 dbus-glib-1 >= \$DBUS_GLIB_REQUIRED
19960 polkit-dbus >= \$POLKIT_DBUS_REQUIRED
19961 polkit-grant >= \$POLKIT_GRANT_REQUIRED\"") >&5
19962 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= $GTK_REQUIRED
19963 libgnome-2.0 >= $LIBGNOME_REQUIRED
19964 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
19965 dbus-glib-1 >= $DBUS_GLIB_REQUIRED
19966 polkit-dbus >= $POLKIT_DBUS_REQUIRED
19967 polkit-grant >= $POLKIT_GRANT_REQUIRED") 2>&5
20191 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_REQUIRED\"") >&5
20192 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= $GTK_REQUIRED") 2>&5
1996820193 ac_status=$?
1996920194 echo "$as_me:$LINENO: \$? = $ac_status" >&5
1997020195 (exit $ac_status); }; then
19971 pkg_cv_POLKIT_GNOME_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= $GTK_REQUIRED
19972 libgnome-2.0 >= $LIBGNOME_REQUIRED
19973 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
19974 dbus-glib-1 >= $DBUS_GLIB_REQUIRED
19975 polkit-dbus >= $POLKIT_DBUS_REQUIRED
19976 polkit-grant >= $POLKIT_GRANT_REQUIRED" 2>/dev/null`
20196 pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= $GTK_REQUIRED" 2>/dev/null`
1997720197 else
1997820198 pkg_failed=yes
1997920199 fi
1999220212 _pkg_short_errors_supported=no
1999320213 fi
1999420214 if test $_pkg_short_errors_supported = yes; then
19995 POLKIT_GNOME_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gtk+-2.0 >= $GTK_REQUIRED
19996 libgnome-2.0 >= $LIBGNOME_REQUIRED
19997 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
19998 dbus-glib-1 >= $DBUS_GLIB_REQUIRED
19999 polkit-dbus >= $POLKIT_DBUS_REQUIRED
20000 polkit-grant >= $POLKIT_GRANT_REQUIRED"`
20215 GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gtk+-2.0 >= $GTK_REQUIRED"`
2000120216 else
20002 POLKIT_GNOME_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= $GTK_REQUIRED
20003 libgnome-2.0 >= $LIBGNOME_REQUIRED
20004 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
20005 dbus-glib-1 >= $DBUS_GLIB_REQUIRED
20006 polkit-dbus >= $POLKIT_DBUS_REQUIRED
20007 polkit-grant >= $POLKIT_GRANT_REQUIRED"`
20217 GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= $GTK_REQUIRED"`
2000820218 fi
2000920219 # Put the nasty error message in config.log where it belongs
20010 echo "$POLKIT_GNOME_PKG_ERRORS" >&5
20011
20012 { { echo "$as_me:$LINENO: error: Package requirements (gtk+-2.0 >= $GTK_REQUIRED
20013 libgnome-2.0 >= $LIBGNOME_REQUIRED
20014 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
20015 dbus-glib-1 >= $DBUS_GLIB_REQUIRED
20016 polkit-dbus >= $POLKIT_DBUS_REQUIRED
20017 polkit-grant >= $POLKIT_GRANT_REQUIRED) were not met:
20018
20019 $POLKIT_GNOME_PKG_ERRORS
20220 echo "$GTK_PKG_ERRORS" >&5
20221
20222 { { echo "$as_me:$LINENO: error: Package requirements (gtk+-2.0 >= $GTK_REQUIRED) were not met:
20223
20224 $GTK_PKG_ERRORS
2002020225
2002120226 Consider adjusting the PKG_CONFIG_PATH environment variable if you
2002220227 installed software in a non-standard prefix.
2002320228
20024 Alternatively, you may set the environment variables POLKIT_GNOME_CFLAGS
20025 and POLKIT_GNOME_LIBS to avoid the need to call pkg-config.
20229 Alternatively, you may set the environment variables GTK_CFLAGS
20230 and GTK_LIBS to avoid the need to call pkg-config.
2002620231 See the pkg-config man page for more details.
2002720232 " >&5
20028 echo "$as_me: error: Package requirements (gtk+-2.0 >= $GTK_REQUIRED
20029 libgnome-2.0 >= $LIBGNOME_REQUIRED
20030 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
20031 dbus-glib-1 >= $DBUS_GLIB_REQUIRED
20032 polkit-dbus >= $POLKIT_DBUS_REQUIRED
20033 polkit-grant >= $POLKIT_GRANT_REQUIRED) were not met:
20034
20035 $POLKIT_GNOME_PKG_ERRORS
20233 echo "$as_me: error: Package requirements (gtk+-2.0 >= $GTK_REQUIRED) were not met:
20234
20235 $GTK_PKG_ERRORS
2003620236
2003720237 Consider adjusting the PKG_CONFIG_PATH environment variable if you
2003820238 installed software in a non-standard prefix.
2003920239
20040 Alternatively, you may set the environment variables POLKIT_GNOME_CFLAGS
20041 and POLKIT_GNOME_LIBS to avoid the need to call pkg-config.
20240 Alternatively, you may set the environment variables GTK_CFLAGS
20241 and GTK_LIBS to avoid the need to call pkg-config.
2004220242 See the pkg-config man page for more details.
2004320243 " >&2;}
2004420244 { (exit 1); exit 1; }; }
2004720247 is in your PATH or set the PKG_CONFIG environment variable to the full
2004820248 path to pkg-config.
2004920249
20050 Alternatively, you may set the environment variables POLKIT_GNOME_CFLAGS
20051 and POLKIT_GNOME_LIBS to avoid the need to call pkg-config.
20250 Alternatively, you may set the environment variables GTK_CFLAGS
20251 and GTK_LIBS to avoid the need to call pkg-config.
2005220252 See the pkg-config man page for more details.
2005320253
2005420254 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
2005720257 is in your PATH or set the PKG_CONFIG environment variable to the full
2005820258 path to pkg-config.
2005920259
20060 Alternatively, you may set the environment variables POLKIT_GNOME_CFLAGS
20061 and POLKIT_GNOME_LIBS to avoid the need to call pkg-config.
20260 Alternatively, you may set the environment variables GTK_CFLAGS
20261 and GTK_LIBS to avoid the need to call pkg-config.
2006220262 See the pkg-config man page for more details.
2006320263
2006420264 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
2006520265 See \`config.log' for more details." >&2;}
2006620266 { (exit 1); exit 1; }; }
2006720267 else
20068 POLKIT_GNOME_CFLAGS=$pkg_cv_POLKIT_GNOME_CFLAGS
20069 POLKIT_GNOME_LIBS=$pkg_cv_POLKIT_GNOME_LIBS
20268 GTK_CFLAGS=$pkg_cv_GTK_CFLAGS
20269 GTK_LIBS=$pkg_cv_GTK_LIBS
2007020270 { echo "$as_me:$LINENO: result: yes" >&5
2007120271 echo "${ECHO_T}yes" >&6; }
2007220272 :
2007320273 fi
20274
20275
20276
20277
20278 pkg_failed=no
20279 { echo "$as_me:$LINENO: checking for SEXY" >&5
20280 echo $ECHO_N "checking for SEXY... $ECHO_C" >&6; }
20281
20282 if test -n "$PKG_CONFIG"; then
20283 if test -n "$SEXY_CFLAGS"; then
20284 pkg_cv_SEXY_CFLAGS="$SEXY_CFLAGS"
20285 else
20286 if test -n "$PKG_CONFIG" && \
20287 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsexy >= \$SEXY_REQUIRED\"") >&5
20288 ($PKG_CONFIG --exists --print-errors "libsexy >= $SEXY_REQUIRED") 2>&5
20289 ac_status=$?
20290 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20291 (exit $ac_status); }; then
20292 pkg_cv_SEXY_CFLAGS=`$PKG_CONFIG --cflags "libsexy >= $SEXY_REQUIRED" 2>/dev/null`
20293 else
20294 pkg_failed=yes
20295 fi
20296 fi
20297 else
20298 pkg_failed=untried
20299 fi
20300 if test -n "$PKG_CONFIG"; then
20301 if test -n "$SEXY_LIBS"; then
20302 pkg_cv_SEXY_LIBS="$SEXY_LIBS"
20303 else
20304 if test -n "$PKG_CONFIG" && \
20305 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsexy >= \$SEXY_REQUIRED\"") >&5
20306 ($PKG_CONFIG --exists --print-errors "libsexy >= $SEXY_REQUIRED") 2>&5
20307 ac_status=$?
20308 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20309 (exit $ac_status); }; then
20310 pkg_cv_SEXY_LIBS=`$PKG_CONFIG --libs "libsexy >= $SEXY_REQUIRED" 2>/dev/null`
20311 else
20312 pkg_failed=yes
20313 fi
20314 fi
20315 else
20316 pkg_failed=untried
20317 fi
20318
20319
20320
20321 if test $pkg_failed = yes; then
20322
20323 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
20324 _pkg_short_errors_supported=yes
20325 else
20326 _pkg_short_errors_supported=no
20327 fi
20328 if test $_pkg_short_errors_supported = yes; then
20329 SEXY_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libsexy >= $SEXY_REQUIRED"`
20330 else
20331 SEXY_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libsexy >= $SEXY_REQUIRED"`
20332 fi
20333 # Put the nasty error message in config.log where it belongs
20334 echo "$SEXY_PKG_ERRORS" >&5
20335
20336 { { echo "$as_me:$LINENO: error: Package requirements (libsexy >= $SEXY_REQUIRED) were not met:
20337
20338 $SEXY_PKG_ERRORS
20339
20340 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20341 installed software in a non-standard prefix.
20342
20343 Alternatively, you may set the environment variables SEXY_CFLAGS
20344 and SEXY_LIBS to avoid the need to call pkg-config.
20345 See the pkg-config man page for more details.
20346 " >&5
20347 echo "$as_me: error: Package requirements (libsexy >= $SEXY_REQUIRED) were not met:
20348
20349 $SEXY_PKG_ERRORS
20350
20351 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20352 installed software in a non-standard prefix.
20353
20354 Alternatively, you may set the environment variables SEXY_CFLAGS
20355 and SEXY_LIBS to avoid the need to call pkg-config.
20356 See the pkg-config man page for more details.
20357 " >&2;}
20358 { (exit 1); exit 1; }; }
20359 elif test $pkg_failed = untried; then
20360 { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
20361 is in your PATH or set the PKG_CONFIG environment variable to the full
20362 path to pkg-config.
20363
20364 Alternatively, you may set the environment variables SEXY_CFLAGS
20365 and SEXY_LIBS to avoid the need to call pkg-config.
20366 See the pkg-config man page for more details.
20367
20368 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20369 See \`config.log' for more details." >&5
20370 echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
20371 is in your PATH or set the PKG_CONFIG environment variable to the full
20372 path to pkg-config.
20373
20374 Alternatively, you may set the environment variables SEXY_CFLAGS
20375 and SEXY_LIBS to avoid the need to call pkg-config.
20376 See the pkg-config man page for more details.
20377
20378 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20379 See \`config.log' for more details." >&2;}
20380 { (exit 1); exit 1; }; }
20381 else
20382 SEXY_CFLAGS=$pkg_cv_SEXY_CFLAGS
20383 SEXY_LIBS=$pkg_cv_SEXY_LIBS
20384 { echo "$as_me:$LINENO: result: yes" >&5
20385 echo "${ECHO_T}yes" >&6; }
20386 :
20387 fi
20388
20389
20390
20391
20392 pkg_failed=no
20393 { echo "$as_me:$LINENO: checking for GNOME_VFS" >&5
20394 echo $ECHO_N "checking for GNOME_VFS... $ECHO_C" >&6; }
20395
20396 if test -n "$PKG_CONFIG"; then
20397 if test -n "$GNOME_VFS_CFLAGS"; then
20398 pkg_cv_GNOME_VFS_CFLAGS="$GNOME_VFS_CFLAGS"
20399 else
20400 if test -n "$PKG_CONFIG" && \
20401 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gnome-vfs-2.0 >= \$GNOME_VFS_REQUIRED\"") >&5
20402 ($PKG_CONFIG --exists --print-errors "gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED") 2>&5
20403 ac_status=$?
20404 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20405 (exit $ac_status); }; then
20406 pkg_cv_GNOME_VFS_CFLAGS=`$PKG_CONFIG --cflags "gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED" 2>/dev/null`
20407 else
20408 pkg_failed=yes
20409 fi
20410 fi
20411 else
20412 pkg_failed=untried
20413 fi
20414 if test -n "$PKG_CONFIG"; then
20415 if test -n "$GNOME_VFS_LIBS"; then
20416 pkg_cv_GNOME_VFS_LIBS="$GNOME_VFS_LIBS"
20417 else
20418 if test -n "$PKG_CONFIG" && \
20419 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gnome-vfs-2.0 >= \$GNOME_VFS_REQUIRED\"") >&5
20420 ($PKG_CONFIG --exists --print-errors "gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED") 2>&5
20421 ac_status=$?
20422 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20423 (exit $ac_status); }; then
20424 pkg_cv_GNOME_VFS_LIBS=`$PKG_CONFIG --libs "gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED" 2>/dev/null`
20425 else
20426 pkg_failed=yes
20427 fi
20428 fi
20429 else
20430 pkg_failed=untried
20431 fi
20432
20433
20434
20435 if test $pkg_failed = yes; then
20436
20437 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
20438 _pkg_short_errors_supported=yes
20439 else
20440 _pkg_short_errors_supported=no
20441 fi
20442 if test $_pkg_short_errors_supported = yes; then
20443 GNOME_VFS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED"`
20444 else
20445 GNOME_VFS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED"`
20446 fi
20447 # Put the nasty error message in config.log where it belongs
20448 echo "$GNOME_VFS_PKG_ERRORS" >&5
20449
20450 { { echo "$as_me:$LINENO: error: Package requirements (gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED) were not met:
20451
20452 $GNOME_VFS_PKG_ERRORS
20453
20454 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20455 installed software in a non-standard prefix.
20456
20457 Alternatively, you may set the environment variables GNOME_VFS_CFLAGS
20458 and GNOME_VFS_LIBS to avoid the need to call pkg-config.
20459 See the pkg-config man page for more details.
20460 " >&5
20461 echo "$as_me: error: Package requirements (gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED) were not met:
20462
20463 $GNOME_VFS_PKG_ERRORS
20464
20465 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20466 installed software in a non-standard prefix.
20467
20468 Alternatively, you may set the environment variables GNOME_VFS_CFLAGS
20469 and GNOME_VFS_LIBS to avoid the need to call pkg-config.
20470 See the pkg-config man page for more details.
20471 " >&2;}
20472 { (exit 1); exit 1; }; }
20473 elif test $pkg_failed = untried; then
20474 { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
20475 is in your PATH or set the PKG_CONFIG environment variable to the full
20476 path to pkg-config.
20477
20478 Alternatively, you may set the environment variables GNOME_VFS_CFLAGS
20479 and GNOME_VFS_LIBS to avoid the need to call pkg-config.
20480 See the pkg-config man page for more details.
20481
20482 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20483 See \`config.log' for more details." >&5
20484 echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
20485 is in your PATH or set the PKG_CONFIG environment variable to the full
20486 path to pkg-config.
20487
20488 Alternatively, you may set the environment variables GNOME_VFS_CFLAGS
20489 and GNOME_VFS_LIBS to avoid the need to call pkg-config.
20490 See the pkg-config man page for more details.
20491
20492 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20493 See \`config.log' for more details." >&2;}
20494 { (exit 1); exit 1; }; }
20495 else
20496 GNOME_VFS_CFLAGS=$pkg_cv_GNOME_VFS_CFLAGS
20497 GNOME_VFS_LIBS=$pkg_cv_GNOME_VFS_LIBS
20498 { echo "$as_me:$LINENO: result: yes" >&5
20499 echo "${ECHO_T}yes" >&6; }
20500 :
20501 fi
20502
20503
20504
20505
20506 pkg_failed=no
20507 { echo "$as_me:$LINENO: checking for DBUS_GLIB" >&5
20508 echo $ECHO_N "checking for DBUS_GLIB... $ECHO_C" >&6; }
20509
20510 if test -n "$PKG_CONFIG"; then
20511 if test -n "$DBUS_GLIB_CFLAGS"; then
20512 pkg_cv_DBUS_GLIB_CFLAGS="$DBUS_GLIB_CFLAGS"
20513 else
20514 if test -n "$PKG_CONFIG" && \
20515 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1 >= \$DBUS_GLIB_REQUIRED\"") >&5
20516 ($PKG_CONFIG --exists --print-errors "dbus-glib-1 >= $DBUS_GLIB_REQUIRED") 2>&5
20517 ac_status=$?
20518 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20519 (exit $ac_status); }; then
20520 pkg_cv_DBUS_GLIB_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1 >= $DBUS_GLIB_REQUIRED" 2>/dev/null`
20521 else
20522 pkg_failed=yes
20523 fi
20524 fi
20525 else
20526 pkg_failed=untried
20527 fi
20528 if test -n "$PKG_CONFIG"; then
20529 if test -n "$DBUS_GLIB_LIBS"; then
20530 pkg_cv_DBUS_GLIB_LIBS="$DBUS_GLIB_LIBS"
20531 else
20532 if test -n "$PKG_CONFIG" && \
20533 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1 >= \$DBUS_GLIB_REQUIRED\"") >&5
20534 ($PKG_CONFIG --exists --print-errors "dbus-glib-1 >= $DBUS_GLIB_REQUIRED") 2>&5
20535 ac_status=$?
20536 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20537 (exit $ac_status); }; then
20538 pkg_cv_DBUS_GLIB_LIBS=`$PKG_CONFIG --libs "dbus-glib-1 >= $DBUS_GLIB_REQUIRED" 2>/dev/null`
20539 else
20540 pkg_failed=yes
20541 fi
20542 fi
20543 else
20544 pkg_failed=untried
20545 fi
20546
20547
20548
20549 if test $pkg_failed = yes; then
20550
20551 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
20552 _pkg_short_errors_supported=yes
20553 else
20554 _pkg_short_errors_supported=no
20555 fi
20556 if test $_pkg_short_errors_supported = yes; then
20557 DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "dbus-glib-1 >= $DBUS_GLIB_REQUIRED"`
20558 else
20559 DBUS_GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "dbus-glib-1 >= $DBUS_GLIB_REQUIRED"`
20560 fi
20561 # Put the nasty error message in config.log where it belongs
20562 echo "$DBUS_GLIB_PKG_ERRORS" >&5
20563
20564 { { echo "$as_me:$LINENO: error: Package requirements (dbus-glib-1 >= $DBUS_GLIB_REQUIRED) were not met:
20565
20566 $DBUS_GLIB_PKG_ERRORS
20567
20568 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20569 installed software in a non-standard prefix.
20570
20571 Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS
20572 and DBUS_GLIB_LIBS to avoid the need to call pkg-config.
20573 See the pkg-config man page for more details.
20574 " >&5
20575 echo "$as_me: error: Package requirements (dbus-glib-1 >= $DBUS_GLIB_REQUIRED) were not met:
20576
20577 $DBUS_GLIB_PKG_ERRORS
20578
20579 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20580 installed software in a non-standard prefix.
20581
20582 Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS
20583 and DBUS_GLIB_LIBS to avoid the need to call pkg-config.
20584 See the pkg-config man page for more details.
20585 " >&2;}
20586 { (exit 1); exit 1; }; }
20587 elif test $pkg_failed = untried; then
20588 { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
20589 is in your PATH or set the PKG_CONFIG environment variable to the full
20590 path to pkg-config.
20591
20592 Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS
20593 and DBUS_GLIB_LIBS to avoid the need to call pkg-config.
20594 See the pkg-config man page for more details.
20595
20596 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20597 See \`config.log' for more details." >&5
20598 echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
20599 is in your PATH or set the PKG_CONFIG environment variable to the full
20600 path to pkg-config.
20601
20602 Alternatively, you may set the environment variables DBUS_GLIB_CFLAGS
20603 and DBUS_GLIB_LIBS to avoid the need to call pkg-config.
20604 See the pkg-config man page for more details.
20605
20606 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20607 See \`config.log' for more details." >&2;}
20608 { (exit 1); exit 1; }; }
20609 else
20610 DBUS_GLIB_CFLAGS=$pkg_cv_DBUS_GLIB_CFLAGS
20611 DBUS_GLIB_LIBS=$pkg_cv_DBUS_GLIB_LIBS
20612 { echo "$as_me:$LINENO: result: yes" >&5
20613 echo "${ECHO_T}yes" >&6; }
20614 :
20615 fi
20616
20617
20618
20619
20620 pkg_failed=no
20621 { echo "$as_me:$LINENO: checking for POLKIT_DBUS" >&5
20622 echo $ECHO_N "checking for POLKIT_DBUS... $ECHO_C" >&6; }
20623
20624 if test -n "$PKG_CONFIG"; then
20625 if test -n "$POLKIT_DBUS_CFLAGS"; then
20626 pkg_cv_POLKIT_DBUS_CFLAGS="$POLKIT_DBUS_CFLAGS"
20627 else
20628 if test -n "$PKG_CONFIG" && \
20629 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"polkit-dbus >= \$POLKIT_DBUS_REQUIRED\"") >&5
20630 ($PKG_CONFIG --exists --print-errors "polkit-dbus >= $POLKIT_DBUS_REQUIRED") 2>&5
20631 ac_status=$?
20632 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20633 (exit $ac_status); }; then
20634 pkg_cv_POLKIT_DBUS_CFLAGS=`$PKG_CONFIG --cflags "polkit-dbus >= $POLKIT_DBUS_REQUIRED" 2>/dev/null`
20635 else
20636 pkg_failed=yes
20637 fi
20638 fi
20639 else
20640 pkg_failed=untried
20641 fi
20642 if test -n "$PKG_CONFIG"; then
20643 if test -n "$POLKIT_DBUS_LIBS"; then
20644 pkg_cv_POLKIT_DBUS_LIBS="$POLKIT_DBUS_LIBS"
20645 else
20646 if test -n "$PKG_CONFIG" && \
20647 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"polkit-dbus >= \$POLKIT_DBUS_REQUIRED\"") >&5
20648 ($PKG_CONFIG --exists --print-errors "polkit-dbus >= $POLKIT_DBUS_REQUIRED") 2>&5
20649 ac_status=$?
20650 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20651 (exit $ac_status); }; then
20652 pkg_cv_POLKIT_DBUS_LIBS=`$PKG_CONFIG --libs "polkit-dbus >= $POLKIT_DBUS_REQUIRED" 2>/dev/null`
20653 else
20654 pkg_failed=yes
20655 fi
20656 fi
20657 else
20658 pkg_failed=untried
20659 fi
20660
20661
20662
20663 if test $pkg_failed = yes; then
20664
20665 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
20666 _pkg_short_errors_supported=yes
20667 else
20668 _pkg_short_errors_supported=no
20669 fi
20670 if test $_pkg_short_errors_supported = yes; then
20671 POLKIT_DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "polkit-dbus >= $POLKIT_DBUS_REQUIRED"`
20672 else
20673 POLKIT_DBUS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "polkit-dbus >= $POLKIT_DBUS_REQUIRED"`
20674 fi
20675 # Put the nasty error message in config.log where it belongs
20676 echo "$POLKIT_DBUS_PKG_ERRORS" >&5
20677
20678 { { echo "$as_me:$LINENO: error: Package requirements (polkit-dbus >= $POLKIT_DBUS_REQUIRED) were not met:
20679
20680 $POLKIT_DBUS_PKG_ERRORS
20681
20682 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20683 installed software in a non-standard prefix.
20684
20685 Alternatively, you may set the environment variables POLKIT_DBUS_CFLAGS
20686 and POLKIT_DBUS_LIBS to avoid the need to call pkg-config.
20687 See the pkg-config man page for more details.
20688 " >&5
20689 echo "$as_me: error: Package requirements (polkit-dbus >= $POLKIT_DBUS_REQUIRED) were not met:
20690
20691 $POLKIT_DBUS_PKG_ERRORS
20692
20693 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20694 installed software in a non-standard prefix.
20695
20696 Alternatively, you may set the environment variables POLKIT_DBUS_CFLAGS
20697 and POLKIT_DBUS_LIBS to avoid the need to call pkg-config.
20698 See the pkg-config man page for more details.
20699 " >&2;}
20700 { (exit 1); exit 1; }; }
20701 elif test $pkg_failed = untried; then
20702 { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
20703 is in your PATH or set the PKG_CONFIG environment variable to the full
20704 path to pkg-config.
20705
20706 Alternatively, you may set the environment variables POLKIT_DBUS_CFLAGS
20707 and POLKIT_DBUS_LIBS to avoid the need to call pkg-config.
20708 See the pkg-config man page for more details.
20709
20710 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20711 See \`config.log' for more details." >&5
20712 echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
20713 is in your PATH or set the PKG_CONFIG environment variable to the full
20714 path to pkg-config.
20715
20716 Alternatively, you may set the environment variables POLKIT_DBUS_CFLAGS
20717 and POLKIT_DBUS_LIBS to avoid the need to call pkg-config.
20718 See the pkg-config man page for more details.
20719
20720 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20721 See \`config.log' for more details." >&2;}
20722 { (exit 1); exit 1; }; }
20723 else
20724 POLKIT_DBUS_CFLAGS=$pkg_cv_POLKIT_DBUS_CFLAGS
20725 POLKIT_DBUS_LIBS=$pkg_cv_POLKIT_DBUS_LIBS
20726 { echo "$as_me:$LINENO: result: yes" >&5
20727 echo "${ECHO_T}yes" >&6; }
20728 :
20729 fi
20730
20731
20732
20733
20734 pkg_failed=no
20735 { echo "$as_me:$LINENO: checking for POLKIT_GRANT" >&5
20736 echo $ECHO_N "checking for POLKIT_GRANT... $ECHO_C" >&6; }
20737
20738 if test -n "$PKG_CONFIG"; then
20739 if test -n "$POLKIT_GRANT_CFLAGS"; then
20740 pkg_cv_POLKIT_GRANT_CFLAGS="$POLKIT_GRANT_CFLAGS"
20741 else
20742 if test -n "$PKG_CONFIG" && \
20743 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"polkit-grant >= \$POLKIT_GRANT_REQUIRED\"") >&5
20744 ($PKG_CONFIG --exists --print-errors "polkit-grant >= $POLKIT_GRANT_REQUIRED") 2>&5
20745 ac_status=$?
20746 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20747 (exit $ac_status); }; then
20748 pkg_cv_POLKIT_GRANT_CFLAGS=`$PKG_CONFIG --cflags "polkit-grant >= $POLKIT_GRANT_REQUIRED" 2>/dev/null`
20749 else
20750 pkg_failed=yes
20751 fi
20752 fi
20753 else
20754 pkg_failed=untried
20755 fi
20756 if test -n "$PKG_CONFIG"; then
20757 if test -n "$POLKIT_GRANT_LIBS"; then
20758 pkg_cv_POLKIT_GRANT_LIBS="$POLKIT_GRANT_LIBS"
20759 else
20760 if test -n "$PKG_CONFIG" && \
20761 { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"polkit-grant >= \$POLKIT_GRANT_REQUIRED\"") >&5
20762 ($PKG_CONFIG --exists --print-errors "polkit-grant >= $POLKIT_GRANT_REQUIRED") 2>&5
20763 ac_status=$?
20764 echo "$as_me:$LINENO: \$? = $ac_status" >&5
20765 (exit $ac_status); }; then
20766 pkg_cv_POLKIT_GRANT_LIBS=`$PKG_CONFIG --libs "polkit-grant >= $POLKIT_GRANT_REQUIRED" 2>/dev/null`
20767 else
20768 pkg_failed=yes
20769 fi
20770 fi
20771 else
20772 pkg_failed=untried
20773 fi
20774
20775
20776
20777 if test $pkg_failed = yes; then
20778
20779 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
20780 _pkg_short_errors_supported=yes
20781 else
20782 _pkg_short_errors_supported=no
20783 fi
20784 if test $_pkg_short_errors_supported = yes; then
20785 POLKIT_GRANT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "polkit-grant >= $POLKIT_GRANT_REQUIRED"`
20786 else
20787 POLKIT_GRANT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "polkit-grant >= $POLKIT_GRANT_REQUIRED"`
20788 fi
20789 # Put the nasty error message in config.log where it belongs
20790 echo "$POLKIT_GRANT_PKG_ERRORS" >&5
20791
20792 { { echo "$as_me:$LINENO: error: Package requirements (polkit-grant >= $POLKIT_GRANT_REQUIRED) were not met:
20793
20794 $POLKIT_GRANT_PKG_ERRORS
20795
20796 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20797 installed software in a non-standard prefix.
20798
20799 Alternatively, you may set the environment variables POLKIT_GRANT_CFLAGS
20800 and POLKIT_GRANT_LIBS to avoid the need to call pkg-config.
20801 See the pkg-config man page for more details.
20802 " >&5
20803 echo "$as_me: error: Package requirements (polkit-grant >= $POLKIT_GRANT_REQUIRED) were not met:
20804
20805 $POLKIT_GRANT_PKG_ERRORS
20806
20807 Consider adjusting the PKG_CONFIG_PATH environment variable if you
20808 installed software in a non-standard prefix.
20809
20810 Alternatively, you may set the environment variables POLKIT_GRANT_CFLAGS
20811 and POLKIT_GRANT_LIBS to avoid the need to call pkg-config.
20812 See the pkg-config man page for more details.
20813 " >&2;}
20814 { (exit 1); exit 1; }; }
20815 elif test $pkg_failed = untried; then
20816 { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
20817 is in your PATH or set the PKG_CONFIG environment variable to the full
20818 path to pkg-config.
20819
20820 Alternatively, you may set the environment variables POLKIT_GRANT_CFLAGS
20821 and POLKIT_GRANT_LIBS to avoid the need to call pkg-config.
20822 See the pkg-config man page for more details.
20823
20824 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20825 See \`config.log' for more details." >&5
20826 echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
20827 is in your PATH or set the PKG_CONFIG environment variable to the full
20828 path to pkg-config.
20829
20830 Alternatively, you may set the environment variables POLKIT_GRANT_CFLAGS
20831 and POLKIT_GRANT_LIBS to avoid the need to call pkg-config.
20832 See the pkg-config man page for more details.
20833
20834 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
20835 See \`config.log' for more details." >&2;}
20836 { (exit 1); exit 1; }; }
20837 else
20838 POLKIT_GRANT_CFLAGS=$pkg_cv_POLKIT_GRANT_CFLAGS
20839 POLKIT_GRANT_LIBS=$pkg_cv_POLKIT_GRANT_LIBS
20840 { echo "$as_me:$LINENO: result: yes" >&5
20841 echo "${ECHO_T}yes" >&6; }
20842 :
20843 fi
20844
20845
2007420846
2007520847 # Check whether --enable-examples was given.
2007620848 if test "${enable_examples+set}" = set; then
2197222744
2197322745
2197422746
21975 ac_config_files="$ac_config_files Makefile data/Makefile examples/Makefile src/Makefile po/Makefile.in"
22747 ac_config_files="$ac_config_files Makefile data/Makefile data/polkit-gnome.pc examples/Makefile polkit-gnome/Makefile src/Makefile tools/Makefile doc/Makefile doc/version.xml po/Makefile.in"
2197622748
2197722749
2197822750 cat >confcache <<\_ACEOF
2211022882 { { echo "$as_me:$LINENO: error: conditional \"HAVE_GNOME_DOC_UTILS\" was never defined.
2211122883 Usually this means the macro was only invoked conditionally." >&5
2211222884 echo "$as_me: error: conditional \"HAVE_GNOME_DOC_UTILS\" was never defined.
22885 Usually this means the macro was only invoked conditionally." >&2;}
22886 { (exit 1); exit 1; }; }
22887 fi
22888 if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then
22889 { { echo "$as_me:$LINENO: error: conditional \"ENABLE_GTK_DOC\" was never defined.
22890 Usually this means the macro was only invoked conditionally." >&5
22891 echo "$as_me: error: conditional \"ENABLE_GTK_DOC\" was never defined.
22892 Usually this means the macro was only invoked conditionally." >&2;}
22893 { (exit 1); exit 1; }; }
22894 fi
22895 if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then
22896 { { echo "$as_me:$LINENO: error: conditional \"GTK_DOC_USE_LIBTOOL\" was never defined.
22897 Usually this means the macro was only invoked conditionally." >&5
22898 echo "$as_me: error: conditional \"GTK_DOC_USE_LIBTOOL\" was never defined.
2211322899 Usually this means the macro was only invoked conditionally." >&2;}
2211422900 { (exit 1); exit 1; }; }
2211522901 fi
2242423210 # report actual input values of CONFIG_FILES etc. instead of their
2242523211 # values after options handling.
2242623212 ac_log="
22427 This file was extended by PolicyKit-gnome $as_me 0.6, which was
23213 This file was extended by PolicyKit-gnome $as_me 0.7, which was
2242823214 generated by GNU Autoconf 2.61. Invocation command line was
2242923215
2243023216 CONFIG_FILES = $CONFIG_FILES
2247723263 _ACEOF
2247823264 cat >>$CONFIG_STATUS <<_ACEOF
2247923265 ac_cs_version="\\
22480 PolicyKit-gnome config.status 0.6
23266 PolicyKit-gnome config.status 0.7
2248123267 configured by $0, generated by GNU Autoconf 2.61,
2248223268 with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
2248323269
2260123387 "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
2260223388 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
2260323389 "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;;
23390 "data/polkit-gnome.pc") CONFIG_FILES="$CONFIG_FILES data/polkit-gnome.pc" ;;
2260423391 "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
23392 "polkit-gnome/Makefile") CONFIG_FILES="$CONFIG_FILES polkit-gnome/Makefile" ;;
2260523393 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
23394 "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
23395 "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
23396 "doc/version.xml") CONFIG_FILES="$CONFIG_FILES doc/version.xml" ;;
2260623397 "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
2260723398 "po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;;
2260823399
2272923520 MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
2273023521 MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
2273123522 MAINT!$MAINT$ac_delim
23523 LT_CURRENT!$LT_CURRENT$ac_delim
23524 LT_REVISION!$LT_REVISION$ac_delim
23525 LT_AGE!$LT_AGE$ac_delim
2273223526 CC!$CC$ac_delim
2273323527 CFLAGS!$CFLAGS$ac_delim
2273423528 LDFLAGS!$LDFLAGS$ac_delim
2276123555 ECHO!$ECHO$ac_delim
2276223556 AR!$AR$ac_delim
2276323557 RANLIB!$RANLIB$ac_delim
22764 CXX!$CXX$ac_delim
22765 CXXFLAGS!$CXXFLAGS$ac_delim
22766 ac_ct_CXX!$ac_ct_CXX$ac_delim
2276723558 _ACEOF
2276823559
2276923560 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
2280523596 ac_delim='%!_!# '
2280623597 for ac_last_try in false false false false false :; do
2280723598 cat >conf$$subs.sed <<_ACEOF
23599 CXX!$CXX$ac_delim
23600 CXXFLAGS!$CXXFLAGS$ac_delim
23601 ac_ct_CXX!$ac_ct_CXX$ac_delim
2280823602 CXXDEPMODE!$CXXDEPMODE$ac_delim
2280923603 am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
2281023604 am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
2282423618 HAVE_GNOME_DOC_UTILS_FALSE!$HAVE_GNOME_DOC_UTILS_FALSE$ac_delim
2282523619 WARN_CFLAGS!$WARN_CFLAGS$ac_delim
2282623620 DISABLE_DEPRECATED!$DISABLE_DEPRECATED$ac_delim
22827 POLKIT_GNOME_CFLAGS!$POLKIT_GNOME_CFLAGS$ac_delim
22828 POLKIT_GNOME_LIBS!$POLKIT_GNOME_LIBS$ac_delim
23621 HTML_DIR!$HTML_DIR$ac_delim
23622 GTKDOC_CHECK!$GTKDOC_CHECK$ac_delim
23623 ENABLE_GTK_DOC_TRUE!$ENABLE_GTK_DOC_TRUE$ac_delim
23624 ENABLE_GTK_DOC_FALSE!$ENABLE_GTK_DOC_FALSE$ac_delim
23625 GTK_DOC_USE_LIBTOOL_TRUE!$GTK_DOC_USE_LIBTOOL_TRUE$ac_delim
23626 GTK_DOC_USE_LIBTOOL_FALSE!$GTK_DOC_USE_LIBTOOL_FALSE$ac_delim
23627 GTK_CFLAGS!$GTK_CFLAGS$ac_delim
23628 GTK_LIBS!$GTK_LIBS$ac_delim
23629 SEXY_CFLAGS!$SEXY_CFLAGS$ac_delim
23630 SEXY_LIBS!$SEXY_LIBS$ac_delim
23631 GNOME_VFS_CFLAGS!$GNOME_VFS_CFLAGS$ac_delim
23632 GNOME_VFS_LIBS!$GNOME_VFS_LIBS$ac_delim
23633 DBUS_GLIB_CFLAGS!$DBUS_GLIB_CFLAGS$ac_delim
23634 DBUS_GLIB_LIBS!$DBUS_GLIB_LIBS$ac_delim
23635 POLKIT_DBUS_CFLAGS!$POLKIT_DBUS_CFLAGS$ac_delim
23636 POLKIT_DBUS_LIBS!$POLKIT_DBUS_LIBS$ac_delim
23637 POLKIT_GRANT_CFLAGS!$POLKIT_GRANT_CFLAGS$ac_delim
23638 POLKIT_GRANT_LIBS!$POLKIT_GRANT_LIBS$ac_delim
2282923639 BUILD_EXAMPLES_TRUE!$BUILD_EXAMPLES_TRUE$ac_delim
2283023640 BUILD_EXAMPLES_FALSE!$BUILD_EXAMPLES_FALSE$ac_delim
2283123641 POLKIT_POLICY_FILE_VALIDATE!$POLKIT_POLICY_FILE_VALIDATE$ac_delim
2287823688 LTLIBOBJS!$LTLIBOBJS$ac_delim
2287923689 _ACEOF
2288023690
22881 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 71; then
23691 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then
2288223692 break
2288323693 elif $ac_last_try; then
2288423694 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
2351924329 $ac_cs_success || { (exit 1); exit 1; }
2352024330 fi
2352124331
24332
24333 echo "
24334 PolicyKit-gnome $VERSION
24335 =======================
24336
24337 prefix: ${prefix}
24338 libdir: ${libdir}
24339 libexecdir: ${libexecdir}
24340 bindir: ${bindir}
24341 sbindir: ${sbindir}
24342 datadir: ${datadir}
24343 sysconfdir: ${sysconfdir}
24344 localstatedir: ${localstatedir}
24345
24346 compiler: ${CC}
24347 cflags: ${CFLAGS}
24348 cppflags: ${CPPFLAGS}
24349
24350 Maintainer mode: ${USE_MAINTAINER_MODE}
24351 Building api docs: ${enable_gtk_doc}
24352 "
0 AC_INIT([PolicyKit-gnome],[0.6],[mailto:david@fubar.dk],[PolicyKit-gnome])
0 AC_INIT([PolicyKit-gnome],[0.7],[mailto:david@fubar.dk],[PolicyKit-gnome])
11
22 AM_INIT_AUTOMAKE([1.9 foreign dist-bzip2 no-dist-gzip])
33
55 AC_CONFIG_HEADERS([config.h])
66
77 AM_MAINTAINER_MODE
8
9 # libtool versioning - this applies to all libraries in this package
10 #
11 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
12 #
13 LT_CURRENT=0
14 LT_REVISION=0
15 LT_AGE=0
16 AC_SUBST(LT_CURRENT)
17 AC_SUBST(LT_REVISION)
18 AC_SUBST(LT_AGE)
819
920 AC_PROG_CC
1021 AC_ISC_POSIX
1122 AC_HEADER_STDC
1223 AC_PROG_LIBTOOL
24
25 #### gcc warning flags
26
27 if test "x$GCC" = "xyes"; then
28 changequote(,)dnl
29 case " $CFLAGS " in
30 *[\ \ ]-Wall[\ \ ]*) ;;
31 *) CFLAGS="$CFLAGS -Wall" ;;
32 esac
33
34 case " $CFLAGS " in
35 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
36 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
37 esac
38
39 case " $CFLAGS " in
40 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
41 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
42 esac
43
44 case " $CFLAGS " in
45 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
46 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
47 esac
48
49 case " $CFLAGS " in
50 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
51 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
52 esac
53
54 case " $CFLAGS " in
55 *[\ \ ]-Wcast-align[\ \ ]*) ;;
56 *) CFLAGS="$CFLAGS -Wcast-align" ;;
57 esac
58
59 case " $CFLAGS " in
60 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
61 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
62 esac
63
64 if test "x$enable_ansi" = "xyes"; then
65 case " $CFLAGS " in
66 *[\ \ ]-ansi[\ \ ]*) ;;
67 *) CFLAGS="$CFLAGS -ansi" ;;
68 esac
69
70 case " $CFLAGS " in
71 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
72 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
73 esac
74
75 case " $CFLAGS " in
76 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
77 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
78 esac
79
80 case " $CFLAGS " in
81 *[\ \ ]-pedantic[\ \ ]*) ;;
82 *) CFLAGS="$CFLAGS -pedantic" ;;
83 esac
84 fi
85 if test x$enable_gcov = xyes; then
86 case " $CFLAGS " in
87 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
88 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
89 esac
90 case " $CFLAGS " in
91 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
92 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
93 esac
94
95 ## remove optimization
96 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
97 fi
98 changequote([,])dnl
99 else
100 if test x$enable_gcov = xyes; then
101 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
102 fi
103 fi
13104
14105 # *****
15106 # GNOME
21112 GNOME_COMPILE_WARNINGS([maximum])
22113 GNOME_MAINTAINER_MODE_DEFINES
23114
115 AC_ARG_ENABLE(gtk-doc, AC_HELP_STRING([--enable-gtk-doc],
116 [use gtk-doc to build documentation [default=yes]]),,
117 enable_gtk_doc=yes)
118 GTK_DOC_CHECK([1.3])
119
24120 # ***************************
25121 # Check for required packages
26122 # ***************************
27123
28 GTK_REQUIRED=2.6.0
29 LIBGNOME_REQUIRED=2.14.0
30 LIBGNOMEUI_REQUIRED=2.14.0
124 GTK_REQUIRED=2.12.0
125 SEXY_REQUIRED=0.1.11
126 GNOME_VFS_REQUIRED=2.4
31127 DBUS_GLIB_REQUIRED=0.71
32 POLKIT_DBUS_REQUIRED=0.5
33 POLKIT_GRANT_REQUIRED=0.5
34
35 PKG_CHECK_MODULES(POLKIT_GNOME,
36 gtk+-2.0 >= $GTK_REQUIRED
37 libgnome-2.0 >= $LIBGNOME_REQUIRED
38 libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
39 dbus-glib-1 >= $DBUS_GLIB_REQUIRED
40 polkit-dbus >= $POLKIT_DBUS_REQUIRED
41 polkit-grant >= $POLKIT_GRANT_REQUIRED)
128 POLKIT_DBUS_REQUIRED=0.7
129 POLKIT_GRANT_REQUIRED=0.7
130
131 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
132 AC_SUBST(GTK_CFLAGS)
133 AC_SUBST(GTK_LIBS)
134
135 PKG_CHECK_MODULES(SEXY, libsexy >= $SEXY_REQUIRED)
136 AC_SUBST(SEXY_CFLAGS)
137 AC_SUBST(SEXY_LIBS)
138
139 PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED)
140 AC_SUBST(GNOME_VFS_CFLAGS)
141 AC_SUBST(GNOME_VFS_LIBS)
142
143 PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= $DBUS_GLIB_REQUIRED)
144 AC_SUBST(DBUS_GLIB_CFLAGS)
145 AC_SUBST(DBUS_GLIB_LIBS)
146
147 PKG_CHECK_MODULES(POLKIT_DBUS, polkit-dbus >= $POLKIT_DBUS_REQUIRED)
148 AC_SUBST(POLKIT_DBUS_CFLAGS)
149 AC_SUBST(POLKIT_DBUS_LIBS)
150
151 PKG_CHECK_MODULES(POLKIT_GRANT, polkit-grant >= $POLKIT_GRANT_REQUIRED)
152 AC_SUBST(POLKIT_GRANT_CFLAGS)
153 AC_SUBST(POLKIT_GRANT_LIBS)
42154
43155 AC_ARG_ENABLE([examples],
44156 AC_HELP_STRING([--enable-examples], [Build the example programs]),,
76188 AC_CONFIG_FILES([
77189 Makefile
78190 data/Makefile
191 data/polkit-gnome.pc
79192 examples/Makefile
193 polkit-gnome/Makefile
80194 src/Makefile
195 tools/Makefile
196 doc/Makefile
197 doc/version.xml
81198 po/Makefile.in
82199 ])
83200
84201 AC_OUTPUT
202
203 echo "
204 PolicyKit-gnome $VERSION
205 =======================
206
207 prefix: ${prefix}
208 libdir: ${libdir}
209 libexecdir: ${libexecdir}
210 bindir: ${bindir}
211 sbindir: ${sbindir}
212 datadir: ${datadir}
213 sysconfdir: ${sysconfdir}
214 localstatedir: ${localstatedir}
215
216 compiler: ${CC}
217 cflags: ${CFLAGS}
218 cppflags: ${CPPFLAGS}
219
220 Maintainer mode: ${USE_MAINTAINER_MODE}
221 Building api docs: ${enable_gtk_doc}
222 "
0
1 @INTLTOOL_DESKTOP_RULE@
2 desktopdir = $(datadir)/applications
3 desktop_in_files = polkit-gnome-authorization.desktop.in
4 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
05
16 servicedir = $(datadir)/dbus-1/services
2 service_in_files = org.gnome.PolicyKit.service.in
7 service_in_files = org.gnome.PolicyKit.service.in \
8 org.gnome.PolicyKit.AuthorizationManager.service.in \
9 gnome-org.freedesktop.PolicyKit.AuthenticationAgent.service.in
310 service_DATA = $(service_in_files:.service.in=.service)
411
5 $(service_DATA): $(service_in_files) Makefile
12 org.gnome.PolicyKit.service : org.gnome.PolicyKit.service.in Makefile
613 @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
714
8 DISTCLEANFILES = $(service_DATA)
15 gnome-org.freedesktop.PolicyKit.AuthenticationAgent.service : gnome-org.freedesktop.PolicyKit.AuthenticationAgent.service.in Makefile
16 @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
917
10 EXTRA_DIST = $(service_in_files)
18 org.gnome.PolicyKit.AuthorizationManager.service : org.gnome.PolicyKit.AuthorizationManager.service.in Makefile
19 @sed -e "s|\@bindir\@|$(bindir)|" $< > $@
20
21 pkgconfigdir = $(libdir)/pkgconfig
22 pkgconfig_DATA = polkit-gnome.pc
23
24 DISTCLEANFILES = $(service_DATA) $(desktop_DATA) $(pkgconfig_DATA)
25
26 EXTRA_DIST = $(service_in_files) $(desktop_in_files) polkit-gnome.pc.in
1127
1228 clean-local :
13 rm -f *~ $(service_DATA)
29 rm -f *~ $(service_DATA) $(pkgconfig_DATA)
3232 build_triplet = @build@
3333 host_triplet = @host@
3434 subdir = data
35 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
35 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
36 $(srcdir)/polkit-gnome.pc.in
3637 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
3738 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
3839 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
3940 $(ACLOCAL_M4)
4041 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
4142 CONFIG_HEADER = $(top_builddir)/config.h
42 CONFIG_CLEAN_FILES =
43 CONFIG_CLEAN_FILES = polkit-gnome.pc
4344 SOURCES =
4445 DIST_SOURCES =
4546 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
4849 *) f=$$p;; \
4950 esac;
5051 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
51 am__installdirs = "$(DESTDIR)$(servicedir)"
52 am__installdirs = "$(DESTDIR)$(desktopdir)" \
53 "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(servicedir)"
54 desktopDATA_INSTALL = $(INSTALL_DATA)
55 pkgconfigDATA_INSTALL = $(INSTALL_DATA)
5256 serviceDATA_INSTALL = $(INSTALL_DATA)
53 DATA = $(service_DATA)
57 DATA = $(desktop_DATA) $(pkgconfig_DATA) $(service_DATA)
5458 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
5559 ACLOCAL = @ACLOCAL@
5660 ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
7882 CXXFLAGS = @CXXFLAGS@
7983 CYGPATH_W = @CYGPATH_W@
8084 DATADIRNAME = @DATADIRNAME@
85 DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
86 DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
8187 DEFS = @DEFS@
8288 DEPDIR = @DEPDIR@
8389 DISABLE_DEPRECATED = @DISABLE_DEPRECATED@
9399 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
94100 GMOFILES = @GMOFILES@
95101 GMSGFMT = @GMSGFMT@
102 GNOME_VFS_CFLAGS = @GNOME_VFS_CFLAGS@
103 GNOME_VFS_LIBS = @GNOME_VFS_LIBS@
96104 GREP = @GREP@
105 GTKDOC_CHECK = @GTKDOC_CHECK@
106 GTK_CFLAGS = @GTK_CFLAGS@
107 GTK_LIBS = @GTK_LIBS@
97108 HELP_DIR = @HELP_DIR@
109 HTML_DIR = @HTML_DIR@
98110 INSTALL = @INSTALL@
99111 INSTALL_DATA = @INSTALL_DATA@
100112 INSTALL_PROGRAM = @INSTALL_PROGRAM@
131143 LIBTOOL = @LIBTOOL@
132144 LN_S = @LN_S@
133145 LTLIBOBJS = @LTLIBOBJS@
146 LT_AGE = @LT_AGE@
147 LT_CURRENT = @LT_CURRENT@
148 LT_REVISION = @LT_REVISION@
134149 MAINT = @MAINT@
135150 MAKEINFO = @MAKEINFO@
136151 MKDIR_P = @MKDIR_P@
148163 PATH_SEPARATOR = @PATH_SEPARATOR@
149164 PKG_CONFIG = @PKG_CONFIG@
150165 POFILES = @POFILES@
151 POLKIT_GNOME_CFLAGS = @POLKIT_GNOME_CFLAGS@
152 POLKIT_GNOME_LIBS = @POLKIT_GNOME_LIBS@
166 POLKIT_DBUS_CFLAGS = @POLKIT_DBUS_CFLAGS@
167 POLKIT_DBUS_LIBS = @POLKIT_DBUS_LIBS@
168 POLKIT_GRANT_CFLAGS = @POLKIT_GRANT_CFLAGS@
169 POLKIT_GRANT_LIBS = @POLKIT_GRANT_LIBS@
153170 POLKIT_POLICY_FILE_VALIDATE = @POLKIT_POLICY_FILE_VALIDATE@
154171 POSUB = @POSUB@
155172 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
157174 RANLIB = @RANLIB@
158175 SED = @SED@
159176 SET_MAKE = @SET_MAKE@
177 SEXY_CFLAGS = @SEXY_CFLAGS@
178 SEXY_LIBS = @SEXY_LIBS@
160179 SHELL = @SHELL@
161180 STRIP = @STRIP@
162181 USE_NLS = @USE_NLS@
214233 target_alias = @target_alias@
215234 top_builddir = @top_builddir@
216235 top_srcdir = @top_srcdir@
236 desktopdir = $(datadir)/applications
237 desktop_in_files = polkit-gnome-authorization.desktop.in
238 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
217239 servicedir = $(datadir)/dbus-1/services
218 service_in_files = org.gnome.PolicyKit.service.in
240 service_in_files = org.gnome.PolicyKit.service.in \
241 org.gnome.PolicyKit.AuthorizationManager.service.in \
242 gnome-org.freedesktop.PolicyKit.AuthenticationAgent.service.in
243
219244 service_DATA = $(service_in_files:.service.in=.service)
220 DISTCLEANFILES = $(service_DATA)
221 EXTRA_DIST = $(service_in_files)
245 pkgconfigdir = $(libdir)/pkgconfig
246 pkgconfig_DATA = polkit-gnome.pc
247 DISTCLEANFILES = $(service_DATA) $(desktop_DATA) $(pkgconfig_DATA)
248 EXTRA_DIST = $(service_in_files) $(desktop_in_files) polkit-gnome.pc.in
222249 all: all-am
223250
224251 .SUFFIXES:
251278 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
252279 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
253280 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
281 polkit-gnome.pc: $(top_builddir)/config.status $(srcdir)/polkit-gnome.pc.in
282 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
254283
255284 mostlyclean-libtool:
256285 -rm -f *.lo
257286
258287 clean-libtool:
259288 -rm -rf .libs _libs
289 install-desktopDATA: $(desktop_DATA)
290 @$(NORMAL_INSTALL)
291 test -z "$(desktopdir)" || $(MKDIR_P) "$(DESTDIR)$(desktopdir)"
292 @list='$(desktop_DATA)'; for p in $$list; do \
293 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
294 f=$(am__strip_dir) \
295 echo " $(desktopDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(desktopdir)/$$f'"; \
296 $(desktopDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(desktopdir)/$$f"; \
297 done
298
299 uninstall-desktopDATA:
300 @$(NORMAL_UNINSTALL)
301 @list='$(desktop_DATA)'; for p in $$list; do \
302 f=$(am__strip_dir) \
303 echo " rm -f '$(DESTDIR)$(desktopdir)/$$f'"; \
304 rm -f "$(DESTDIR)$(desktopdir)/$$f"; \
305 done
306 install-pkgconfigDATA: $(pkgconfig_DATA)
307 @$(NORMAL_INSTALL)
308 test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
309 @list='$(pkgconfig_DATA)'; for p in $$list; do \
310 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
311 f=$(am__strip_dir) \
312 echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
313 $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
314 done
315
316 uninstall-pkgconfigDATA:
317 @$(NORMAL_UNINSTALL)
318 @list='$(pkgconfig_DATA)'; for p in $$list; do \
319 f=$(am__strip_dir) \
320 echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
321 rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
322 done
260323 install-serviceDATA: $(service_DATA)
261324 @$(NORMAL_INSTALL)
262325 test -z "$(servicedir)" || $(MKDIR_P) "$(DESTDIR)$(servicedir)"
311374 check: check-am
312375 all-am: Makefile $(DATA)
313376 installdirs:
314 for dir in "$(DESTDIR)$(servicedir)"; do \
377 for dir in "$(DESTDIR)$(desktopdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(servicedir)"; do \
315378 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
316379 done
317380 install: install-am
357420
358421 info-am:
359422
360 install-data-am: install-serviceDATA
423 install-data-am: install-desktopDATA install-pkgconfigDATA \
424 install-serviceDATA
361425
362426 install-dvi: install-dvi-am
363427
391455
392456 ps-am:
393457
394 uninstall-am: uninstall-serviceDATA
458 uninstall-am: uninstall-desktopDATA uninstall-pkgconfigDATA \
459 uninstall-serviceDATA
395460
396461 .MAKE: install-am install-strip
397462
398463 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
399464 clean-local distclean distclean-generic distclean-libtool \
400465 distdir dvi dvi-am html html-am info info-am install \
401 install-am install-data install-data-am install-dvi \
402 install-dvi-am install-exec install-exec-am install-html \
403 install-html-am install-info install-info-am install-man \
404 install-pdf install-pdf-am install-ps install-ps-am \
405 install-serviceDATA install-strip installcheck installcheck-am \
406 installdirs maintainer-clean maintainer-clean-generic \
407 mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
408 ps ps-am uninstall uninstall-am uninstall-serviceDATA
409
410
411 $(service_DATA): $(service_in_files) Makefile
466 install-am install-data install-data-am install-desktopDATA \
467 install-dvi install-dvi-am install-exec install-exec-am \
468 install-html install-html-am install-info install-info-am \
469 install-man install-pdf install-pdf-am install-pkgconfigDATA \
470 install-ps install-ps-am install-serviceDATA install-strip \
471 installcheck installcheck-am installdirs maintainer-clean \
472 maintainer-clean-generic mostlyclean mostlyclean-generic \
473 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
474 uninstall-desktopDATA uninstall-pkgconfigDATA \
475 uninstall-serviceDATA
476
477
478 @INTLTOOL_DESKTOP_RULE@
479
480 org.gnome.PolicyKit.service : org.gnome.PolicyKit.service.in Makefile
412481 @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
413482
483 gnome-org.freedesktop.PolicyKit.AuthenticationAgent.service : gnome-org.freedesktop.PolicyKit.AuthenticationAgent.service.in Makefile
484 @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
485
486 org.gnome.PolicyKit.AuthorizationManager.service : org.gnome.PolicyKit.AuthorizationManager.service.in Makefile
487 @sed -e "s|\@bindir\@|$(bindir)|" $< > $@
488
414489 clean-local :
415 rm -f *~ $(service_DATA)
490 rm -f *~ $(service_DATA) $(pkgconfig_DATA)
416491 # Tell versions [3.59,3.63) of GNU make to not export all variables.
417492 # Otherwise a system limit (for SysV at least) may be exceeded.
418493 .NOEXPORT:
0 [D-BUS Service]
1 Name=org.freedesktop.PolicyKit.AuthenticationAgent
2 Exec=@libexecdir@/polkit-gnome-manager
0 [D-BUS Service]
1 Name=org.gnome.PolicyKit.AuthorizationManager
2 Exec=@bindir@/polkit-gnome-authorization
0 [Desktop Entry]
1 Encoding=UTF-8
2 _Name=Authorizations
3 _Comment=Configure authorizations
4 Icon=gtk-dialog-authentication
5 Exec=polkit-gnome-authorization
6 Terminal=false
7 Type=Application
8 Categories=Settings;X-GNOME-SystemSettings;
9 OnlyShowIn=GNOME;
10 StartupNotify=true
0 prefix=@prefix@
1 exec_prefix=@exec_prefix@
2 libdir=@libdir@
3 includedir=@includedir@
4
5 Name: polkit-gnome
6 Description: PolicyKit add-on library for GNOME
7 Version: @VERSION@
8 Requires: polkit polkit-dbus polkit-grant gtk+-2.0
9 Libs: -L${libdir} -lpolkit-gnome
10 Cflags: -I${includedir}/PolicyKit
0 ## Process this file with automake to create Makefile.in.
1
2 NULL =
3
4 AUTOMAKE_OPTIONS = 1.7
5
6 # The name of the module.
7 DOC_MODULE=polkit-gnome
8
9 # The top-level SGML file.
10 DOC_MAIN_SGML_FILE=polkit-gnome-docs.xml
11
12 # Extra options to supply to gtkdoc-scan
13 SCAN_OPTIONS=--ignore-headers=config.h
14
15 # The directory containing the source code. Relative to $(srcdir)
16 DOC_SOURCE_DIR=../polkit-gnome
17
18 # Used for dependencies
19 HFILE_GLOB=$(top_srcdir)/polkit-gnome/*.h
20 CFILE_GLOB=$(top_srcdir)/polkit-gnome/*.c
21
22 # Headers to ignore
23 IGNORE_HFILES= \
24 $(NULL)
25
26 # CFLAGS and LDFLAGS for compiling scan program. Only needed
27 # if $(DOC_MODULE).types is non-empty.
28 INCLUDES = \
29 $(GTK_CFLAGS) \
30 $(DBUS_GLIB_CFLAGS) \
31 $(POLKIT_DBUS_CFLAGS) \
32 $(POLKIT_GRANT_CFLAGS) \
33 -I$(top_srcdir) \
34 -I$(top_builddir) \
35 $(NULL)
36
37 GTKDOC_LIBS = \
38 $(GTK_LIBS) \
39 $(DBUS_GLIB_LIBS) \
40 $(POLKIT_DBUS_LIBS) \
41 $(POLKIT_GRANT_LIBS) \
42 $(top_builddir)/polkit-gnome/libpolkit-gnome.la \
43 $(NULL)
44
45 # Extra options to supply to gtkdoc-mkdb
46 MKDB_OPTIONS=--sgml-mode --output-format=xml
47
48 # Extra options to supply to gtkdoc-mktmpl
49 MKTMPL_OPTIONS=
50
51 # Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
52 content_files = \
53 version.xml \
54 $(NULL)
55
56 # Images to copy into HTML directory
57 HTML_IMAGES = \
58 polkit-gnome-example-screenshot.png \
59 polkit-gnome-example-screenshot-authorized.png \
60 polkit-gnome-example-auth-dialog-twiddle.png \
61 auth-details.png \
62 auth-retain-always.png \
63 auth-retain-session.png \
64 auth-root.png \
65 auth-self.png \
66 auth-wheel-group-1.png \
67 auth-wheel-group-2.png
68
69 # Extra options to supply to gtkdoc-fixref
70 FIXXREF_OPTIONS=
71
72 MAINTAINERCLEANFILES = \
73 *~ \
74 Makefile.in \
75 polkit-gnome.types \
76 polkit-gnome-*.txt \
77 $(NULL)
78
79 include $(top_srcdir)/gtk-doc.make
80
81 # Version information for marking the documentation
82 EXTRA_DIST += version.xml.in
0 # Makefile.in generated by automake 1.10 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 # -*- mode: makefile -*-
17
18 ####################################
19 # Everything below here is generic #
20 ####################################
21 VPATH = @srcdir@
22 pkgdatadir = $(datadir)/@PACKAGE@
23 pkglibdir = $(libdir)/@PACKAGE@
24 pkgincludedir = $(includedir)/@PACKAGE@
25 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
26 install_sh_DATA = $(install_sh) -c -m 644
27 install_sh_PROGRAM = $(install_sh) -c
28 install_sh_SCRIPT = $(install_sh) -c
29 INSTALL_HEADER = $(INSTALL_DATA)
30 transform = $(program_transform_name)
31 NORMAL_INSTALL = :
32 PRE_INSTALL = :
33 POST_INSTALL = :
34 NORMAL_UNINSTALL = :
35 PRE_UNINSTALL = :
36 POST_UNINSTALL = :
37 build_triplet = @build@
38 host_triplet = @host@
39 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
40 $(srcdir)/version.xml.in $(top_srcdir)/gtk-doc.make
41 subdir = doc
42 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
43 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
44 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
45 $(ACLOCAL_M4)
46 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
47 CONFIG_HEADER = $(top_builddir)/config.h
48 CONFIG_CLEAN_FILES = version.xml
49 SOURCES =
50 DIST_SOURCES =
51 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
52 ACLOCAL = @ACLOCAL@
53 ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
54 ALL_LINGUAS = @ALL_LINGUAS@
55 AMTAR = @AMTAR@
56 AM_CFLAGS = @AM_CFLAGS@
57 AM_CPPFLAGS = @AM_CPPFLAGS@
58 AM_CXXFLAGS = @AM_CXXFLAGS@
59 AM_LDFLAGS = @AM_LDFLAGS@
60 AR = @AR@
61 AUTOCONF = @AUTOCONF@
62 AUTOHEADER = @AUTOHEADER@
63 AUTOMAKE = @AUTOMAKE@
64 AWK = @AWK@
65 CATALOGS = @CATALOGS@
66 CATOBJEXT = @CATOBJEXT@
67 CC = @CC@
68 CCDEPMODE = @CCDEPMODE@
69 CFLAGS = @CFLAGS@
70 CPP = @CPP@
71 CPPFLAGS = @CPPFLAGS@
72 CXX = @CXX@
73 CXXCPP = @CXXCPP@
74 CXXDEPMODE = @CXXDEPMODE@
75 CXXFLAGS = @CXXFLAGS@
76 CYGPATH_W = @CYGPATH_W@
77 DATADIRNAME = @DATADIRNAME@
78 DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
79 DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
80 DEFS = @DEFS@
81 DEPDIR = @DEPDIR@
82 DISABLE_DEPRECATED = @DISABLE_DEPRECATED@
83 DOC_USER_FORMATS = @DOC_USER_FORMATS@
84 ECHO = @ECHO@
85 ECHO_C = @ECHO_C@
86 ECHO_N = @ECHO_N@
87 ECHO_T = @ECHO_T@
88 EGREP = @EGREP@
89 EXEEXT = @EXEEXT@
90 F77 = @F77@
91 FFLAGS = @FFLAGS@
92 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
93 GMOFILES = @GMOFILES@
94 GMSGFMT = @GMSGFMT@
95 GNOME_VFS_CFLAGS = @GNOME_VFS_CFLAGS@
96 GNOME_VFS_LIBS = @GNOME_VFS_LIBS@
97 GREP = @GREP@
98 GTKDOC_CHECK = @GTKDOC_CHECK@
99 GTK_CFLAGS = @GTK_CFLAGS@
100 GTK_LIBS = @GTK_LIBS@
101 HELP_DIR = @HELP_DIR@
102 HTML_DIR = @HTML_DIR@
103 INSTALL = @INSTALL@
104 INSTALL_DATA = @INSTALL_DATA@
105 INSTALL_PROGRAM = @INSTALL_PROGRAM@
106 INSTALL_SCRIPT = @INSTALL_SCRIPT@
107 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
108 INSTOBJEXT = @INSTOBJEXT@
109 INTLLIBS = @INTLLIBS@
110 INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
111 INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
112 INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
113 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
114 INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
115 INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
116 INTLTOOL_MERGE = @INTLTOOL_MERGE@
117 INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
118 INTLTOOL_PERL = @INTLTOOL_PERL@
119 INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@
120 INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
121 INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
122 INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
123 INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
124 INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
125 INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
126 INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
127 INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
128 INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
129 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
130 INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
131 INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
132 INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
133 LDFLAGS = @LDFLAGS@
134 LIBOBJS = @LIBOBJS@
135 LIBS = @LIBS@
136 LIBTOOL = @LIBTOOL@
137 LN_S = @LN_S@
138 LTLIBOBJS = @LTLIBOBJS@
139 LT_AGE = @LT_AGE@
140 LT_CURRENT = @LT_CURRENT@
141 LT_REVISION = @LT_REVISION@
142 MAINT = @MAINT@
143 MAKEINFO = @MAKEINFO@
144 MKDIR_P = @MKDIR_P@
145 MKINSTALLDIRS = @MKINSTALLDIRS@
146 MSGFMT = @MSGFMT@
147 MSGFMT_OPTS = @MSGFMT_OPTS@
148 OBJEXT = @OBJEXT@
149 OMF_DIR = @OMF_DIR@
150 PACKAGE = @PACKAGE@
151 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
152 PACKAGE_NAME = @PACKAGE_NAME@
153 PACKAGE_STRING = @PACKAGE_STRING@
154 PACKAGE_TARNAME = @PACKAGE_TARNAME@
155 PACKAGE_VERSION = @PACKAGE_VERSION@
156 PATH_SEPARATOR = @PATH_SEPARATOR@
157 PKG_CONFIG = @PKG_CONFIG@
158 POFILES = @POFILES@
159 POLKIT_DBUS_CFLAGS = @POLKIT_DBUS_CFLAGS@
160 POLKIT_DBUS_LIBS = @POLKIT_DBUS_LIBS@
161 POLKIT_GRANT_CFLAGS = @POLKIT_GRANT_CFLAGS@
162 POLKIT_GRANT_LIBS = @POLKIT_GRANT_LIBS@
163 POLKIT_POLICY_FILE_VALIDATE = @POLKIT_POLICY_FILE_VALIDATE@
164 POSUB = @POSUB@
165 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
166 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
167 RANLIB = @RANLIB@
168 SED = @SED@
169 SET_MAKE = @SET_MAKE@
170 SEXY_CFLAGS = @SEXY_CFLAGS@
171 SEXY_LIBS = @SEXY_LIBS@
172 SHELL = @SHELL@
173 STRIP = @STRIP@
174 USE_NLS = @USE_NLS@
175 VERSION = @VERSION@
176 WARN_CFLAGS = @WARN_CFLAGS@
177 XGETTEXT = @XGETTEXT@
178 abs_builddir = @abs_builddir@
179 abs_srcdir = @abs_srcdir@
180 abs_top_builddir = @abs_top_builddir@
181 abs_top_srcdir = @abs_top_srcdir@
182 ac_ct_CC = @ac_ct_CC@
183 ac_ct_CXX = @ac_ct_CXX@
184 ac_ct_F77 = @ac_ct_F77@
185 am__include = @am__include@
186 am__leading_dot = @am__leading_dot@
187 am__quote = @am__quote@
188 am__tar = @am__tar@
189 am__untar = @am__untar@
190 bindir = @bindir@
191 build = @build@
192 build_alias = @build_alias@
193 build_cpu = @build_cpu@
194 build_os = @build_os@
195 build_vendor = @build_vendor@
196 builddir = @builddir@
197 datadir = @datadir@
198 datarootdir = @datarootdir@
199 docdir = @docdir@
200 dvidir = @dvidir@
201 exec_prefix = @exec_prefix@
202 host = @host@
203 host_alias = @host_alias@
204 host_cpu = @host_cpu@
205 host_os = @host_os@
206 host_vendor = @host_vendor@
207 htmldir = @htmldir@
208 includedir = @includedir@
209 infodir = @infodir@
210 install_sh = @install_sh@
211 libdir = @libdir@
212 libexecdir = @libexecdir@
213 localedir = @localedir@
214 localstatedir = @localstatedir@
215 mandir = @mandir@
216 mkdir_p = @mkdir_p@
217 oldincludedir = @oldincludedir@
218 pdfdir = @pdfdir@
219 prefix = @prefix@
220 program_transform_name = @program_transform_name@
221 psdir = @psdir@
222 sbindir = @sbindir@
223 sharedstatedir = @sharedstatedir@
224 srcdir = @srcdir@
225 sysconfdir = @sysconfdir@
226 target_alias = @target_alias@
227 top_builddir = @top_builddir@
228 top_srcdir = @top_srcdir@
229 NULL =
230 AUTOMAKE_OPTIONS = 1.7
231
232 # The name of the module.
233 DOC_MODULE = polkit-gnome
234
235 # The top-level SGML file.
236 DOC_MAIN_SGML_FILE = polkit-gnome-docs.xml
237
238 # Extra options to supply to gtkdoc-scan
239 SCAN_OPTIONS = --ignore-headers=config.h
240
241 # The directory containing the source code. Relative to $(srcdir)
242 DOC_SOURCE_DIR = ../polkit-gnome
243
244 # Used for dependencies
245 HFILE_GLOB = $(top_srcdir)/polkit-gnome/*.h
246 CFILE_GLOB = $(top_srcdir)/polkit-gnome/*.c
247
248 # Headers to ignore
249 IGNORE_HFILES = \
250 $(NULL)
251
252
253 # CFLAGS and LDFLAGS for compiling scan program. Only needed
254 # if $(DOC_MODULE).types is non-empty.
255 INCLUDES = \
256 $(GTK_CFLAGS) \
257 $(DBUS_GLIB_CFLAGS) \
258 $(POLKIT_DBUS_CFLAGS) \
259 $(POLKIT_GRANT_CFLAGS) \
260 -I$(top_srcdir) \
261 -I$(top_builddir) \
262 $(NULL)
263
264 GTKDOC_LIBS = \
265 $(GTK_LIBS) \
266 $(DBUS_GLIB_LIBS) \
267 $(POLKIT_DBUS_LIBS) \
268 $(POLKIT_GRANT_LIBS) \
269 $(top_builddir)/polkit-gnome/libpolkit-gnome.la \
270 $(NULL)
271
272
273 # Extra options to supply to gtkdoc-mkdb
274 MKDB_OPTIONS = --sgml-mode --output-format=xml
275
276 # Extra options to supply to gtkdoc-mktmpl
277 MKTMPL_OPTIONS =
278
279 # Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
280 content_files = \
281 version.xml \
282 $(NULL)
283
284
285 # Images to copy into HTML directory
286 HTML_IMAGES = \
287 polkit-gnome-example-screenshot.png \
288 polkit-gnome-example-screenshot-authorized.png \
289 polkit-gnome-example-auth-dialog-twiddle.png \
290 auth-details.png \
291 auth-retain-always.png \
292 auth-retain-session.png \
293 auth-root.png \
294 auth-self.png \
295 auth-wheel-group-1.png \
296 auth-wheel-group-2.png
297
298
299 # Extra options to supply to gtkdoc-fixref
300 FIXXREF_OPTIONS =
301 MAINTAINERCLEANFILES = \
302 *~ \
303 Makefile.in \
304 polkit-gnome.types \
305 polkit-gnome-*.txt \
306 $(NULL)
307
308 @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
309 @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
310 @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
311 @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
312
313 # We set GPATH here; this gives us semantics for GNU make
314 # which are more like other make's VPATH, when it comes to
315 # whether a source that is a target of one rule is then
316 # searched for in VPATH/GPATH.
317 #
318 GPATH = $(srcdir)
319 TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE)
320
321 # Version information for marking the documentation
322 EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \
323 $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt \
324 version.xml.in
325 DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
326 $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
327
328 SCANOBJ_FILES = \
329 $(DOC_MODULE).args \
330 $(DOC_MODULE).hierarchy \
331 $(DOC_MODULE).interfaces \
332 $(DOC_MODULE).prerequisites \
333 $(DOC_MODULE).signals
334
335 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
336 all: all-am
337
338 .SUFFIXES:
339 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps)
340 @for dep in $?; do \
341 case '$(am__configure_deps)' in \
342 *$$dep*) \
343 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
344 && exit 0; \
345 exit 1;; \
346 esac; \
347 done; \
348 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
349 cd $(top_srcdir) && \
350 $(AUTOMAKE) --foreign doc/Makefile
351 .PRECIOUS: Makefile
352 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
353 @case '$?' in \
354 *config.status*) \
355 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
356 *) \
357 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
358 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
359 esac;
360
361 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
362 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
363
364 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
365 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
366 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
367 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
368 version.xml: $(top_builddir)/config.status $(srcdir)/version.xml.in
369 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
370
371 mostlyclean-libtool:
372 -rm -f *.lo
373
374 clean-libtool:
375 -rm -rf .libs _libs
376 tags: TAGS
377 TAGS:
378
379 ctags: CTAGS
380 CTAGS:
381
382
383 distdir: $(DISTFILES)
384 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
385 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
386 list='$(DISTFILES)'; \
387 dist_files=`for file in $$list; do echo $$file; done | \
388 sed -e "s|^$$srcdirstrip/||;t" \
389 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
390 case $$dist_files in \
391 */*) $(MKDIR_P) `echo "$$dist_files" | \
392 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
393 sort -u` ;; \
394 esac; \
395 for file in $$dist_files; do \
396 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
397 if test -d $$d/$$file; then \
398 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
399 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
400 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
401 fi; \
402 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
403 else \
404 test -f $(distdir)/$$file \
405 || cp -p $$d/$$file $(distdir)/$$file \
406 || exit 1; \
407 fi; \
408 done
409 $(MAKE) $(AM_MAKEFLAGS) \
410 top_distdir="$(top_distdir)" distdir="$(distdir)" \
411 dist-hook
412 check-am: all-am
413 check: check-am
414 all-am: Makefile all-local
415 installdirs:
416 install: install-am
417 install-exec: install-exec-am
418 install-data: install-data-am
419 uninstall: uninstall-am
420
421 install-am: all-am
422 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
423
424 installcheck: installcheck-am
425 install-strip:
426 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
427 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
428 `test -z '$(STRIP)' || \
429 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
430 mostlyclean-generic:
431
432 clean-generic:
433 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
434
435 distclean-generic:
436 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
437
438 maintainer-clean-generic:
439 @echo "This command is intended for maintainers to use"
440 @echo "it deletes files that may require special tools to rebuild."
441 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
442 clean: clean-am
443
444 clean-am: clean-generic clean-libtool clean-local mostlyclean-am
445
446 distclean: distclean-am
447 -rm -f Makefile
448 distclean-am: clean-am distclean-generic
449
450 dvi: dvi-am
451
452 dvi-am:
453
454 html: html-am
455
456 info: info-am
457
458 info-am:
459
460 install-data-am: install-data-local
461
462 install-dvi: install-dvi-am
463
464 install-exec-am:
465
466 install-html: install-html-am
467
468 install-info: install-info-am
469
470 install-man:
471
472 install-pdf: install-pdf-am
473
474 install-ps: install-ps-am
475
476 installcheck-am:
477
478 maintainer-clean: maintainer-clean-am
479 -rm -f Makefile
480 maintainer-clean-am: distclean-am maintainer-clean-generic \
481 maintainer-clean-local
482
483 mostlyclean: mostlyclean-am
484
485 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
486
487 pdf: pdf-am
488
489 pdf-am:
490
491 ps: ps-am
492
493 ps-am:
494
495 uninstall-am: uninstall-local
496
497 .MAKE: install-am install-strip
498
499 .PHONY: all all-am all-local check check-am clean clean-generic \
500 clean-libtool clean-local dist-hook distclean \
501 distclean-generic distclean-libtool distdir dvi dvi-am html \
502 html-am info info-am install install-am install-data \
503 install-data-am install-data-local install-dvi install-dvi-am \
504 install-exec install-exec-am install-html install-html-am \
505 install-info install-info-am install-man install-pdf \
506 install-pdf-am install-ps install-ps-am install-strip \
507 installcheck installcheck-am installdirs maintainer-clean \
508 maintainer-clean-generic maintainer-clean-local mostlyclean \
509 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
510 uninstall uninstall-am uninstall-local
511
512
513 @ENABLE_GTK_DOC_TRUE@all-local: html-build.stamp
514 @ENABLE_GTK_DOC_FALSE@all-local:
515
516 docs: html-build.stamp
517
518 #### scan ####
519
520 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
521 @echo 'gtk-doc: Scanning header files'
522 @-chmod -R u+w $(srcdir)
523 cd $(srcdir) && \
524 gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
525 if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
526 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
527 else \
528 cd $(srcdir) ; \
529 for i in $(SCANOBJ_FILES) ; do \
530 test -f $$i || touch $$i ; \
531 done \
532 fi
533 touch scan-build.stamp
534
535 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
536 @true
537
538 #### templates ####
539
540 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
541 @echo 'gtk-doc: Rebuilding template files'
542 @-chmod -R u+w $(srcdir)
543 cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
544 touch tmpl-build.stamp
545
546 tmpl.stamp: tmpl-build.stamp
547 @true
548
549 tmpl/*.sgml:
550 @true
551
552 #### xml ####
553
554 sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
555 @echo 'gtk-doc: Building XML'
556 @-chmod -R u+w $(srcdir)
557 cd $(srcdir) && \
558 gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
559 touch sgml-build.stamp
560
561 sgml.stamp: sgml-build.stamp
562 @true
563
564 #### html ####
565
566 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
567 @echo 'gtk-doc: Building HTML'
568 @-chmod -R u+w $(srcdir)
569 rm -rf $(srcdir)/html
570 mkdir $(srcdir)/html
571 cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
572 test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
573 @echo 'gtk-doc: Fixing cross-references'
574 cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
575 touch html-build.stamp
576
577 ##############
578
579 clean-local:
580 rm -f *~ *.bak
581 rm -rf .libs
582
583 maintainer-clean-local: clean
584 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
585
586 install-data-local:
587 installfiles=`echo $(srcdir)/html/*`; \
588 if test "$$installfiles" = '$(srcdir)/html/*'; \
589 then echo '-- Nothing to install' ; \
590 else \
591 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
592 for i in $$installfiles; do \
593 echo '-- Installing '$$i ; \
594 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
595 done; \
596 echo '-- Installing $(srcdir)/html/index.sgml' ; \
597 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \
598 fi
599
600 uninstall-local:
601 rm -f $(DESTDIR)$(TARGET_DIR)/*
602
603 #
604 # Require gtk-doc when making dist
605 #
606 @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc:
607 @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc:
608 @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist"
609 @ENABLE_GTK_DOC_FALSE@ @false
610
611 dist-hook: dist-check-gtkdoc dist-hook-local
612 mkdir $(distdir)/tmpl
613 mkdir $(distdir)/xml
614 mkdir $(distdir)/html
615 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
616 -cp $(srcdir)/xml/*.xml $(distdir)/xml
617 cp $(srcdir)/html/* $(distdir)/html
618 if test -f $(srcdir)/$(DOC_MODULE).types; then \
619 cp $(srcdir)/$(DOC_MODULE).types $(distdir)/$(DOC_MODULE).types; \
620 fi
621
622 .PHONY : dist-hook-local docs
623 # Tell versions [3.59,3.63) of GNU make to not export all variables.
624 # Otherwise a system limit (for SysV at least) may be exceeded.
625 .NOEXPORT:
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>PolKitGnomeAction</title>
5 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
6 <link rel="start" href="index.html" title="PolicyKit-gnome Library Reference Manual">
7 <link rel="up" href="ref-core.html" title="API Reference">
8 <link rel="prev" href="PolKitGnomeContext.html" title="PolKitGnomeContext">
9 <link rel="next" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">
10 <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
11 <link rel="stylesheet" href="style.css" type="text/css">
12 <link rel="reference" href="ref-core.html" title="API Reference">
13 <link rel="reference" href="ref-auth-daemon.html" title="Authentication Agent">
14 <link rel="appendix" href="license.html" title="Appendix&#160;A.&#160;License">
15 </head>
16 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
17 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
18 <tr valign="middle">
19 <td><a accesskey="p" href="PolKitGnomeContext.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
20 <td><a accesskey="u" href="ref-core.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
22 <th width="100%" align="center">PolicyKit-gnome Library Reference Manual</th>
23 <td><a accesskey="n" href="PolKitGnomeToggleAction.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
24 </tr>
25 <tr><td colspan="5" class="shortcuts"><nobr><a href="#id2775053" class="shortcut">Top</a>
26 &#160;|&#160;
27 <a href="#id2778808" class="shortcut">Description</a>
28 &#160;|&#160;
29 <a href="#id2785933" class="shortcut">Object Hierarchy</a>
30 &#160;|&#160;
31 <a href="#id2780677" class="shortcut">Implemented Interfaces</a>
32 &#160;|&#160;
33 <a href="#id2780698" class="shortcut">Properties</a>
34 &#160;|&#160;
35 <a href="#id2778771" class="shortcut">Signals</a></nobr></td></tr>
36 </table>
37 <div class="refentry" lang="en">
38 <a name="PolKitGnomeAction"></a><div class="titlepage"></div>
39 <div class="refnamediv"><table width="100%"><tr>
40 <td valign="top">
41 <h2>
42 <a name="id2775053"></a><span class="refentrytitle">PolKitGnomeAction</span>
43 </h2>
44 <p>PolKitGnomeAction &#8212; A GtkAction subclass where instances can be tied to a specific PolicyKit action.</p>
45 </td>
46 <td valign="top" align="right"></td>
47 </tr></table></div>
48 <div class="refsynopsisdiv">
49 <h2>Synopsis</h2>
50 <pre class="synopsis">
51
52
53
54 <a class="link" href="PolKitGnomeAction.html#PolKitGnomeActionPrivate">PolKitGnomeActionPrivate</a>;
55 <a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction-struct">PolKitGnomeAction</a>;
56 <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a>* <a class="link" href="PolKitGnomeAction.html#polkit-gnome-action-new">polkit_gnome_action_new</a> (const <a
57 href="../glib/glib-Basic-Types.html#gchar"
58 >gchar</a> *name);
59 <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a>* <a class="link" href="PolKitGnomeAction.html#polkit-gnome-action-new-default">polkit_gnome_action_new_default</a> (const <a
60 href="../glib/glib-Basic-Types.html#gchar"
61 >gchar</a> *name,
62 <a
63 href="../polkit/polkit-polkit-action.html#PolKitAction"
64 >PolKitAction</a> *polkit_action,
65 const <a
66 href="../glib/glib-Basic-Types.html#gchar"
67 >gchar</a> *label,
68 const <a
69 href="../glib/glib-Basic-Types.html#gchar"
70 >gchar</a> *tooltip);
71 <a
72 href="../polkit/polkit-polkit-result.html#PolKitResult"
73 >PolKitResult</a> <a class="link" href="PolKitGnomeAction.html#polkit-gnome-action-get-polkit-result">polkit_gnome_action_get_polkit_result</a>
74 (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action);
75 <a
76 href="../glib/glib-Basic-Types.html#gboolean"
77 >gboolean</a> <a class="link" href="PolKitGnomeAction.html#polkit-gnome-action-get-sensitive">polkit_gnome_action_get_sensitive</a> (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action);
78 void <a class="link" href="PolKitGnomeAction.html#polkit-gnome-action-set-sensitive">polkit_gnome_action_set_sensitive</a> (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action,
79 <a
80 href="../glib/glib-Basic-Types.html#gboolean"
81 >gboolean</a> sensitive);
82 <a
83 href="../glib/glib-Basic-Types.html#gboolean"
84 >gboolean</a> <a class="link" href="PolKitGnomeAction.html#polkit-gnome-action-get-visible">polkit_gnome_action_get_visible</a> (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action);
85 void <a class="link" href="PolKitGnomeAction.html#polkit-gnome-action-set-visible">polkit_gnome_action_set_visible</a> (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action,
86 <a
87 href="../glib/glib-Basic-Types.html#gboolean"
88 >gboolean</a> visible);
89 GtkWidget* <a class="link" href="PolKitGnomeAction.html#polkit-gnome-action-create-button">polkit_gnome_action_create_button</a> (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action);
90
91 </pre>
92 </div>
93 <div class="refsect1" lang="en">
94 <a name="id2785933"></a><h2>Object Hierarchy</h2>
95 <pre class="synopsis">
96
97 <a
98 href="../gobject/gobject-The-Base-Object-Type.html#GObject"
99 >GObject</a>
100 +----GtkAction
101 +----PolKitGnomeAction
102 +----<a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">PolKitGnomeToggleAction</a>
103 </pre>
104 </div>
105 <div class="refsect1" lang="en">
106 <a name="id2780677"></a><h2>Implemented Interfaces</h2>
107 <p>
108 PolKitGnomeAction implements
109 GtkBuildable.</p>
110 </div>
111 <div class="refsect1" lang="en">
112 <a name="id2780698"></a><h2>Properties</h2>
113 <pre class="synopsis">
114
115 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--auth-icon-name">auth-icon-name</a>" <a
116 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
117 >gchararray</a> : Read / Write
118 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--auth-label">auth-label</a>" <a
119 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
120 >gchararray</a> : Read / Write
121 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--auth-sensitive">auth-sensitive</a>" <a
122 href="../glib/glib-Basic-Types.html#gboolean"
123 >gboolean</a> : Read / Write
124 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--auth-short-label">auth-short-label</a>" <a
125 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
126 >gchararray</a> : Read / Write
127 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--auth-tooltip">auth-tooltip</a>" <a
128 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
129 >gchararray</a> : Read / Write
130 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--auth-visible">auth-visible</a>" <a
131 href="../glib/glib-Basic-Types.html#gboolean"
132 >gboolean</a> : Read / Write
133 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--master-sensitive">master-sensitive</a>" <a
134 href="../glib/glib-Basic-Types.html#gboolean"
135 >gboolean</a> : Read / Write
136 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--master-visible">master-visible</a>" <a
137 href="../glib/glib-Basic-Types.html#gboolean"
138 >gboolean</a> : Read / Write
139 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--no-icon-name">no-icon-name</a>" <a
140 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
141 >gchararray</a> : Read / Write
142 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--no-label">no-label</a>" <a
143 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
144 >gchararray</a> : Read / Write
145 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--no-sensitive">no-sensitive</a>" <a
146 href="../glib/glib-Basic-Types.html#gboolean"
147 >gboolean</a> : Read / Write
148 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--no-short-label">no-short-label</a>" <a
149 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
150 >gchararray</a> : Read / Write
151 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--no-tooltip">no-tooltip</a>" <a
152 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
153 >gchararray</a> : Read / Write
154 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--no-visible">no-visible</a>" <a
155 href="../glib/glib-Basic-Types.html#gboolean"
156 >gboolean</a> : Read / Write
157 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--polkit-action">polkit-action</a>" <a
158 href="../glib/glib-Basic-Types.html#gpointer"
159 >gpointer</a> : Read / Write / Construct
160 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--polkit-action-sufficient">polkit-action-sufficient</a>" <a
161 href="../gobject/gobject-Value-arrays.html#GValueArray"
162 >GValueArray</a> : Read / Write / Construct
163 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-icon-name">self-blocked-icon-name</a>" <a
164 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
165 >gchararray</a> : Read / Write
166 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-label">self-blocked-label</a>" <a
167 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
168 >gchararray</a> : Read / Write
169 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-sensitive">self-blocked-sensitive</a>" <a
170 href="../glib/glib-Basic-Types.html#gboolean"
171 >gboolean</a> : Read / Write
172 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-short-label">self-blocked-short-label</a>" <a
173 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
174 >gchararray</a> : Read / Write
175 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-tooltip">self-blocked-tooltip</a>" <a
176 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
177 >gchararray</a> : Read / Write
178 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-visible">self-blocked-visible</a>" <a
179 href="../glib/glib-Basic-Types.html#gboolean"
180 >gboolean</a> : Read / Write
181 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--target-pid">target-pid</a>" <a
182 href="../glib/glib-Basic-Types.html#guint"
183 >guint</a> : Read / Write / Construct
184 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--yes-icon-name">yes-icon-name</a>" <a
185 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
186 >gchararray</a> : Read / Write
187 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--yes-label">yes-label</a>" <a
188 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
189 >gchararray</a> : Read / Write
190 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--yes-sensitive">yes-sensitive</a>" <a
191 href="../glib/glib-Basic-Types.html#gboolean"
192 >gboolean</a> : Read / Write
193 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--yes-short-label">yes-short-label</a>" <a
194 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
195 >gchararray</a> : Read / Write
196 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--yes-tooltip">yes-tooltip</a>" <a
197 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
198 >gchararray</a> : Read / Write
199 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction--yes-visible">yes-visible</a>" <a
200 href="../glib/glib-Basic-Types.html#gboolean"
201 >gboolean</a> : Read / Write
202 </pre>
203 </div>
204 <div class="refsect1" lang="en">
205 <a name="id2778771"></a><h2>Signals</h2>
206 <pre class="synopsis">
207
208 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction-auth-end">auth-end</a>" : Run Last
209 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction-auth-start">auth-start</a>" : Run Last
210 "<a class="link" href="PolKitGnomeAction.html#PolKitGnomeAction-polkit-result-changed">polkit-result-changed</a>" : Run Last
211 </pre>
212 </div>
213 <div class="refsect1" lang="en">
214 <a name="id2778808"></a><h2>Description</h2>
215 <p>
216 Actions in GTK+ represent operations that the user can be perform,
217 along with some information how it should be presented in the
218 interface. Each action provides methods to create icons, menu items
219 and toolbar items representing itself. Each action can have one or
220 more proxy menu item, toolbar button or other proxy
221 widgets. Proxies mirror the state of the action (text label,
222 tooltip, icon, visible, sensitive, etc), and should change when the
223 action's state changes. When the proxy is activated, it should
224 activate its action.
225 </p>
226 <p>
227 Instances of <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> class updates the label, tooltip,
228 icon-name, visible and properties of the parent <span class="type">GtkAction</span> instance
229 according to what result PolicyKit gives about a given
230 <a
231 href="../polkit/polkit-polkit-action.html#PolKitAction"
232 ><span class="type">PolKitAction</span></a> object. The <a class="link" href="PolKitGnomeContext.html" title="PolKitGnomeContext"><span class="type">PolKitGnomeContext</span></a> class is used
233 internally to track changes. This means that external events (such
234 as the editing of the /etc/PolicyKit/PolicyKit.conf file,
235 ConsoleKit session activity changes or if the user gains a
236 privilege via authentication) will trigger the action, and thus
237 connected proxy widgets, to be updated.
238 </p>
239 <p>
240 In addition, the <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> class intercepts the ::activate
241 signal defined in <span class="type">GtkAction</span>. When the result from PolicyKit is
242 yes, the signal is propagated. If the result is auth,
243 <code class="function">polkit_gnome_auth_show_dialog()</code> will be used to bring up an
244 authentication dialog for the given <a
245 href="../polkit/polkit-polkit-action.html#PolKitAction"
246 ><span class="type">PolKitAction</span></a>. If the user
247 succesfully gained the privilege, a ::activate signal will be
248 synthesized. If the result is no, the signal is also propagated.
249 </p>
250 <p>
251 As a result, everything happens under the covers; the application
252 programmer using <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> will only get the ::activate
253 signal when the answer from PolicyKit is yes and as such don't have
254 to worry about bringing up authentication dialogs if the property
255 "no-sensitive" is set to <a
256 href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
257 ><span class="type">FALSE</span></a>.
258 </p>
259 <p>
260 When an authentication dialog is show, the <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> class
261 will pass the XID of the top-level window that the proxy widget
262 causing the activation to <code class="function">polkit_gnome_auth_show_dialog()</code>.
263 </p>
264 <p>
265 An example of how to use <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> follows. First, build
266 the following program
267 </p>
268 <p>
269 </p>
270 <pre class="programlisting">/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
271 *
272 * polkit-gnome-example: Simple example showing how a GTK+ application
273 * can use PolicyKit.
274 *
275 * Copyright (C) 2007 David Zeuthen &lt;david@fubar.dk&gt;
276 *
277 * This program is free software; you can redistribute it and/or modify
278 * it under the terms of the GNU General Public License as published by
279 * the Free Software Foundation; either version 2 of the License, or
280 * (at your option) any later version.
281 *
282 * This program is distributed in the hope that it will be useful,
283 * but WITHOUT ANY WARRANTY; without even the implied warranty of
284 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
285 * GNU General Public License for more details.
286 *
287 * You should have received a copy of the GNU General Public License
288 * along with this program; if not, write to the Free Software
289 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
290 *
291 */
292
293 #ifdef HAVE_CONFIG_H
294 # include "config.h"
295 #endif
296
297 #include &lt;sys/types.h&gt;
298 #include &lt;unistd.h&gt;
299 #include &lt;stdlib.h&gt;
300 #include &lt;string.h&gt;
301 #include &lt;glib/gi18n.h&gt;
302 #include &lt;polkit-gnome/polkit-gnome.h&gt;
303
304 static GtkWidget *toplevel_window;
305 static PolKitGnomeContext *pkgc;
306
307 static void
308 _button_toggled (GtkToggleButton *toggle_button, PolKitGnomeAction *action)
309 {
310 g_debug ("in _button_toggled for action '%s'", gtk_action_get_name (GTK_ACTION (action)));
311 }
312
313 static void
314 _button_clicked (GtkToggleButton *toggle_button, PolKitGnomeAction *action)
315 {
316 g_debug ("in _button_clicked for '%s'", gtk_action_get_name (GTK_ACTION (action)));
317 }
318
319 /* This function is called when the following two conditions are true
320 *
321 * - the user clicks one of the buttons created via the method
322 * polkit_gnome_action_create_button() (see main() below)
323 *
324 * - For the PolKitAction associated with the button, PolicyKit
325 * reports either 'no' or 'yes'.
326 *
327 * In the event the user clicks a button and he is not privileged
328 * (e.g. PolicyKit returns one of the 'auth' results) he will be
329 * asked to authenticate; this all happens behind the scenes; the
330 * application _only_ gets the ::activate signal on PolKitGnomeAction
331 * instances when PolicyKit reports that the user is privileged.
332 *
333 * Note that for action org.gnome.policykit.examples.tweak, the
334 * corresponding PolKitGnomeAction is configured to be sensitive (see
335 * main() below) even when PolicyKit reports 'no'. Hence we need to
336 * handle that case too and we do that by popping up a dialog. Note
337 * that this can only be triggered by adding a stanza like
338 *
339 * &lt;match action="org.gnome.policykit.examples.tweak"&gt;
340 * &lt;return result="no"/&gt;
341 * &lt;/match&gt;
342 *
343 * to the /etc/PolicyKit/PolicyKit.conf file.
344 */
345 static void
346 activate_polkit_gnome_action (PolKitGnomeAction *action, gpointer user_data)
347 {
348 PolKitCaller *pk_caller;
349 PolKitAction *pk_action;
350 PolKitResult pk_result;
351 DBusError dbus_error;
352
353 if (strcmp (gtk_action_get_name (GTK_ACTION (action)), "toggle") == 0) {
354 /* we're not supposed to run actions when the
355 * authorization is flipped.. we're supposed to make
356 * some UI sensitive and de-sensitive.. (one use at least) */
357 g_debug ("toggled for '%s'", gtk_action_get_name (GTK_ACTION (action)));
358 return;
359 }
360
361 g_debug ("pretending to be the mechanism for action '%s'", gtk_action_get_name (GTK_ACTION (action)));
362
363 g_object_get (action, "polkit-action", &amp;pk_action, NULL);
364
365 dbus_error_init (&amp;dbus_error);
366 pk_caller = polkit_tracker_get_caller_from_pid (pkgc-&gt;pk_tracker,
367 getpid (),
368 &amp;dbus_error);
369 if (pk_caller == NULL) {
370 g_warning ("Cannot get PolKitCaller object for ourselves (pid=%d): %s: %s",
371 getpid (), dbus_error.name, dbus_error.message);
372 dbus_error_free (&amp;dbus_error);
373 } else {
374 /* note how we pass #TRUE to revoke_if_one_shot - this is because we're
375 * pretending to be the mechanism
376 */
377 pk_result = polkit_context_is_caller_authorized (pkgc-&gt;pk_context,
378 pk_action,
379 pk_caller,
380 TRUE,
381 NULL);
382
383 polkit_caller_unref (pk_caller);
384 }
385
386 polkit_action_unref (pk_action);
387
388 }
389
390 static void
391 activate_action (GtkAction *action, gpointer user_data)
392 {
393 if (g_ascii_strcasecmp (gtk_action_get_name (action), "Quit") == 0) {
394 exit (0);
395 } else if (g_ascii_strcasecmp (gtk_action_get_name (action), "About") == 0) {
396 const char *authors[] = {
397 "David Zeuthen &lt;david@fubar.dk&gt;",
398 NULL};
399 const char *documenters[] = {
400 "David Zeuthen &lt;david@fubar.dk&gt;",
401 NULL};
402
403
404 gtk_show_about_dialog (NULL,
405 "version", VERSION,
406 "copyright", _("Copyright &#169; 2007 David Zeuthen"),
407 "website-label", _("PolicyKit-gnome Website"),
408 "website", "http://hal.freedesktop.org/docs/PolicyKit-gnome/",
409 "program-name", _("PolicyKit-gnome demo"),
410 "comments", _("PolicyKit for the GNOME desktop"),
411 "logo-icon-name", GTK_STOCK_DIALOG_AUTHENTICATION,
412 "authors", authors,
413 "documenters", documenters,
414 NULL);
415
416 }
417 }
418
419 static GtkActionEntry entries[] = {
420 { "FileMenu", NULL, N_("_File") }, /* name, stock id, label */
421 { "ActionsMenu", NULL, N_("_Actions") }, /* name, stock id, label */
422 { "HelpMenu", NULL, N_("_Help") }, /* name, stock id, label */
423
424 { "Quit", GTK_STOCK_QUIT, /* name, stock id */
425 N_("_Quit"), "&lt;control&gt;Q", /* label, accelerator */
426 N_("Quit"), /* tooltip */
427 G_CALLBACK (activate_action) },
428
429 { "About", GTK_STOCK_ABOUT, /* name, stock id */
430 N_("_About"), "&lt;control&gt;A", /* label, accelerator */
431 N_("About"), /* tooltip */
432 G_CALLBACK (activate_action) },
433 };
434 static guint n_entries = G_N_ELEMENTS (entries);
435
436 static const gchar *ui_info =
437 "&lt;ui&gt;"
438 " &lt;menubar name='MenuBar'&gt;"
439 " &lt;menu action='FileMenu'&gt;"
440 " &lt;menuitem action='Quit'/&gt;"
441 " &lt;/menu&gt;"
442 " &lt;menu action='ActionsMenu'&gt;"
443 " &lt;menuitem action='frobnicate'/&gt;"
444 " &lt;menuitem action='jump'/&gt;"
445 " &lt;menuitem action='tweak'/&gt;"
446 " &lt;menuitem action='twiddle'/&gt;"
447 " &lt;menuitem action='punch'/&gt;"
448 " &lt;menuitem action='toggle'/&gt;"
449 " &lt;/menu&gt;"
450 " &lt;menu action='HelpMenu'&gt;"
451 " &lt;menuitem action='About'/&gt;"
452 " &lt;/menu&gt;"
453 " &lt;/menubar&gt;"
454 " &lt;toolbar name='ToolBar'&gt;"
455 " &lt;toolitem action='Quit'/&gt;"
456 " &lt;toolitem action='About'/&gt;"
457 " &lt;separator action='Sep1'/&gt;"
458 " &lt;toolitem action='frobnicate'/&gt;"
459 " &lt;toolitem action='jump'/&gt;"
460 " &lt;toolitem action='tweak'/&gt;"
461 " &lt;toolitem action='twiddle'/&gt;"
462 " &lt;toolitem action='punch'/&gt;"
463 " &lt;toolitem action='toggle'/&gt;"
464 " &lt;/toolbar&gt;"
465 "&lt;/ui&gt;";
466
467 int
468 main (int argc, char **argv)
469 {
470 GtkWidget *hbox;
471 GtkWidget *vbox;
472 GtkWidget *vbox2;
473 GtkWidget *label;
474 GMainLoop*loop;
475 PolKitAction *pk_action;
476 PolKitGnomeAction *action;
477 GtkWidget *button;
478 GtkUIManager *ui;
479 GtkActionGroup *actions;
480
481 gtk_init (&amp;argc, &amp;argv);
482
483 pkgc = polkit_gnome_context_get (NULL);
484
485 loop = g_main_loop_new (NULL, FALSE);
486
487 toplevel_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
488
489 actions = gtk_action_group_new ("Actions");
490 gtk_action_group_add_actions (actions, entries, n_entries, NULL);
491
492 ui = gtk_ui_manager_new ();
493 gtk_ui_manager_insert_action_group (ui, actions, 0);
494
495 gtk_window_add_accel_group (GTK_WINDOW (toplevel_window),
496 gtk_ui_manager_get_accel_group (ui));
497
498
499 gtk_ui_manager_add_ui_from_string (ui, ui_info, -1, NULL);
500
501 /*----------------------------------------------------------------*/
502
503 vbox = gtk_vbox_new (FALSE, 10);
504 gtk_container_add (GTK_CONTAINER (toplevel_window), vbox);
505
506 vbox2 = gtk_vbox_new (FALSE, 0);
507 gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
508
509 /*----------------------------------------------------------------*/
510
511 label = gtk_label_new (NULL);
512 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper &lt;b&gt;Frobnicate&lt;/b&gt; requires the "
513 "user to authenticate. The authorization is kept for "
514 "the life time of the process"));
515 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
516 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
517 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
518
519 pk_action = polkit_action_new ();
520 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.frobnicate");
521 action = polkit_gnome_action_new_default ("frobnicate", pk_action, _("Frobnicate!"), NULL);
522 polkit_action_unref (pk_action);
523 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
524 gtk_action_group_add_action (actions, GTK_ACTION (action));
525 button = polkit_gnome_action_create_button (action);
526 gtk_box_pack_start (GTK_BOX (vbox),
527 button,
528 FALSE, FALSE, 0);
529 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
530
531 /*----------------------------------------------------------------*/
532 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
533 /*----------------------------------------------------------------*/
534
535 label = gtk_label_new (NULL);
536 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper &lt;b&gt;Jump&lt;/b&gt; requires the "
537 "user to authenticate. This is a one-shot authorization."));
538 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
539 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
540 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
541
542 pk_action = polkit_action_new ();
543 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.jump");
544 action = polkit_gnome_action_new_default ("jump", pk_action, _("Jump!"), NULL);
545 polkit_action_unref (pk_action);
546 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
547 gtk_action_group_add_action (actions, GTK_ACTION (action));
548 button = polkit_gnome_action_create_button (action);
549 gtk_box_pack_start (GTK_BOX (vbox),
550 button,
551 FALSE, FALSE, 0);
552 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
553
554 /*----------------------------------------------------------------*/
555 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
556 /*----------------------------------------------------------------*/
557
558 label = gtk_label_new (NULL);
559 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper &lt;b&gt;Tweak&lt;/b&gt; requires a system "
560 "administrator to authenticate. This instance "
561 "overrides the defaults set in polkit_gnome_action_new()."));
562 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
563 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
564 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
565
566 pk_action = polkit_action_new ();
567 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.tweak");
568 action = polkit_gnome_action_new_default ("tweak", pk_action, _("Tweak!"), NULL);
569 polkit_action_unref (pk_action);
570
571 /* For this particular GtkAction instance, we want to customize the appearence */
572 g_object_set (action,
573 "no-visible", TRUE,
574 "no-sensitive", TRUE,
575 "no-short-label", _("Tweak"),
576 "no-label", _("Tweak (long)"),
577 "no-tooltip", _("If your admin wasn't annoying, you could do this"),
578 "no-icon-name", GTK_STOCK_NO,
579
580 "auth-visible", TRUE,
581 "auth-sensitive", TRUE,
582 "auth-short-label", _("Tweak..."),
583 "auth-label", _("Tweak... (long)"),
584 "auth-tooltip", _("Only card carrying tweakers can do this!"),
585 "auth-icon-name", GTK_STOCK_DIALOG_AUTHENTICATION,
586
587 "yes-visible", TRUE,
588 "yes-sensitive", TRUE,
589 "yes-short-label", _("Tweak!"),
590 "yes-label", _("Tweak! (long)"),
591 "yes-tooltip", _("Go ahead, tweak tweak tweak!"),
592 "yes-icon-name", GTK_STOCK_YES,
593 NULL);
594
595 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
596 gtk_action_group_add_action (actions, GTK_ACTION (action));
597 button = polkit_gnome_action_create_button (action);
598 gtk_box_pack_start (GTK_BOX (vbox),
599 button,
600 FALSE, FALSE, 0);
601 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
602
603 /*----------------------------------------------------------------*/
604 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
605 /*----------------------------------------------------------------*/
606
607 label = gtk_label_new (NULL);
608 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper &lt;b&gt;Twiddle&lt;/b&gt; requires a system "
609 "administrator to authenticate. Once authenticated, this "
610 "privilege can be retained indefinitely."));
611 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
612 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
613 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
614
615 pk_action = polkit_action_new ();
616 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.twiddle");
617 action = polkit_gnome_action_new_default ("twiddle", pk_action, _("Twiddle!"), NULL);
618 polkit_action_unref (pk_action);
619 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
620 gtk_action_group_add_action (actions, GTK_ACTION (action));
621 button = polkit_gnome_action_create_button (action);
622 gtk_box_pack_start (GTK_BOX (vbox),
623 button,
624 FALSE, FALSE, 0);
625 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
626
627 /*----------------------------------------------------------------*/
628 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
629 /*----------------------------------------------------------------*/
630
631 label = gtk_label_new (NULL);
632 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper &lt;b&gt;Punch&lt;/b&gt; requires the user to "
633 "authenticate. Once authenticated, this privilege can "
634 "be retained for the remainder of the desktop session."));
635 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
636 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
637 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
638
639 pk_action = polkit_action_new ();
640 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.punch");
641 action = polkit_gnome_action_new_default ("punch", pk_action, _("Punch!"), NULL);
642 polkit_action_unref (pk_action);
643 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
644 gtk_action_group_add_action (actions, GTK_ACTION (action));
645 button = polkit_gnome_action_create_button (action);
646 gtk_box_pack_start (GTK_BOX (vbox),
647 polkit_gnome_action_create_button (action),
648 FALSE, FALSE, 0);
649 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
650
651 /*----------------------------------------------------------------*/
652 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
653 /*----------------------------------------------------------------*/
654
655 label = gtk_label_new (NULL);
656 gtk_label_set_markup (GTK_LABEL (label), _("The &lt;b&gt;Toggle&lt;/b&gt; action demonstrates the use of "
657 "PolicyKit to drive a GtkToggleButton; it's an intuitive "
658 "way to ask users to give up authorizations when they "
659 "are done with them. E.g. the button is 'pressed in' exactly"
660 "when the authorization is held. Toggling the button means "
661 "obtaining resp. revoking the authorization in question."));
662 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
663 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
664 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
665
666 pk_action = polkit_action_new ();
667 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.toggle");
668 PolKitGnomeToggleAction *toggle_action;
669 toggle_action = polkit_gnome_toggle_action_new_default ("toggle", pk_action,
670 _("Click to make changes..."),
671 _("Click to prevent changes"));
672 //g_object_set (toggle_action, "target-pid", 24887, NULL);
673 polkit_action_unref (pk_action);
674 g_signal_connect (toggle_action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
675 gtk_action_group_add_action (actions, GTK_ACTION (toggle_action));
676 GtkWidget *toggle_button;
677 toggle_button = polkit_gnome_toggle_action_create_toggle_button (toggle_action);
678 g_signal_connect (toggle_button, "toggled", G_CALLBACK (_button_toggled), toggle_action);
679 gtk_box_pack_start (GTK_BOX (vbox),
680 toggle_button,
681 FALSE, FALSE, 0);
682
683 /*----------------------------------------------------------------*/
684 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
685 /*----------------------------------------------------------------*/
686
687 hbox = gtk_hbox_new (FALSE, 5);
688 gtk_box_pack_start (GTK_BOX (hbox), gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO,
689 GTK_ICON_SIZE_SMALL_TOOLBAR), FALSE, FALSE, 0);
690 label = gtk_label_new (NULL);
691 gtk_label_set_markup (GTK_LABEL (label), _("&lt;i&gt;Tip: try editing /etc/PolicyKit/Policy.conf and see the proxy widgets update in real-time.&lt;/i&gt;."));
692 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
693 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
694 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
695 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
696
697 /*----------------------------------------------------------------*/
698
699 g_object_unref (actions);
700
701 gtk_box_pack_start (GTK_BOX (vbox2),
702 gtk_ui_manager_get_widget (ui, "/MenuBar"),
703 FALSE, FALSE, 0);
704
705 GtkWidget *toolbar;
706 toolbar = gtk_ui_manager_get_widget (ui, "/ToolBar");
707 gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH);
708 gtk_box_pack_start (GTK_BOX (vbox2),
709 toolbar,
710 FALSE, FALSE, 0);
711
712 /*----------------------------------------------------------------*/
713
714 gtk_window_set_default_size (GTK_WINDOW (toplevel_window), 700, 0);
715 gtk_window_set_title (GTK_WINDOW (toplevel_window), _("PolicyKit-gnome demo"));
716 g_signal_connect (toplevel_window, "delete-event", (GCallback) exit, NULL);
717 gtk_widget_show_all (toplevel_window);
718
719 g_main_loop_run (loop);
720 return 0;
721 }
722 </pre>
723 <p>
724 </p>
725 <p>
726 with
727 </p>
728 <p>
729 </p>
730 <pre class="programlisting">gcc -o polkit-gnome-example `pkg-config --cflags --libs polkit-gnome` polkit-gnome-example.c</pre>
731 <p>
732 </p>
733 <p>
734 Then, put the following content
735 </p>
736 <p>
737 </p>
738 <pre class="programlisting">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
739 &lt;!DOCTYPE policyconfig PUBLIC
740 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
741 "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"&gt;
742 &lt;policyconfig&gt;
743
744 &lt;action id="org.gnome.policykit.examples.jump"&gt;
745 &lt;description&gt;Jump&lt;/description&gt;
746 &lt;message&gt;System policy prevents the PolicyKit-gnome example helper from Jumping&lt;/message&gt;
747 &lt;defaults&gt;
748 &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
749 &lt;allow_active&gt;auth_self_one_shot&lt;/allow_active&gt;
750 &lt;/defaults&gt;
751 &lt;/action&gt;
752
753 &lt;action id="org.gnome.policykit.examples.frobnicate"&gt;
754 &lt;description&gt;Frobnicate&lt;/description&gt;
755 &lt;description xml:lang="da"&gt;Frobniker&lt;/description&gt;
756 &lt;message&gt;System policy prevents the PolicyKit-gnome example helper from Frobnicating&lt;/message&gt;
757 &lt;message xml:lang="da"&gt;System indstillinger forhindrer PolicyKit-gnome eksempel hj&#230;lper i at Frobnikere!&lt;/message&gt;
758 &lt;defaults&gt;
759 &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
760 &lt;allow_active&gt;auth_self&lt;/allow_active&gt;
761 &lt;/defaults&gt;
762 &lt;/action&gt;
763
764 &lt;action id="org.gnome.policykit.examples.tweak"&gt;
765 &lt;description&gt;Tweak&lt;/description&gt;
766 &lt;description xml:lang="da"&gt;Tv&#230;k&lt;/description&gt;
767 &lt;message&gt;System policy prevents the PolicyKit-gnome example helper from Tweaking&lt;/message&gt;
768 &lt;message xml:lang="da"&gt;System indstillinger forhindrer PolicyKit-gnome eksempel hj&#230;lper i at Tv&#230;kke!&lt;/message&gt;
769 &lt;defaults&gt;
770 &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
771 &lt;allow_active&gt;auth_admin&lt;/allow_active&gt;
772 &lt;/defaults&gt;
773 &lt;/action&gt;
774
775 &lt;action id="org.gnome.policykit.examples.twiddle"&gt;
776 &lt;description&gt;Twiddle&lt;/description&gt;
777 &lt;description xml:lang="da"&gt;Tvidl&lt;/description&gt;
778 &lt;message&gt;System policy prevents the PolicyKit-gnome example helper from Twiddling&lt;/message&gt;
779 &lt;message xml:lang="da"&gt;System indstillinger forhindrer PolicyKit-gnome eksempel hj&#230;lper i at Tvidle!&lt;/message&gt;
780 &lt;defaults&gt;
781 &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
782 &lt;allow_active&gt;auth_admin_keep_always&lt;/allow_active&gt;
783 &lt;/defaults&gt;
784 &lt;/action&gt;
785
786 &lt;action id="org.gnome.policykit.examples.punch"&gt;
787 &lt;description&gt;Punch&lt;/description&gt;
788 &lt;description xml:lang="da"&gt;Smadre&lt;/description&gt;
789 &lt;message&gt;System policy prevents the PolicyKit-gnome example helper from Punching&lt;/message&gt;
790 &lt;message xml:lang="da"&gt;System indstillinger forhindrer PolicyKit-gnome eksempel hj&#230;lper i at Smadre!&lt;/message&gt;
791 &lt;defaults&gt;
792 &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
793 &lt;allow_active&gt;auth_self_keep_session&lt;/allow_active&gt;
794 &lt;/defaults&gt;
795 &lt;/action&gt;
796
797 &lt;action id="org.gnome.policykit.examples.toggle"&gt;
798 &lt;description&gt;Toggle&lt;/description&gt;
799 &lt;message&gt;System policy prevents the PolicyKit-gnome example helper from Toggling&lt;/message&gt;
800 &lt;defaults&gt;
801 &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
802 &lt;allow_active&gt;auth_admin_keep_always&lt;/allow_active&gt;
803 &lt;/defaults&gt;
804 &lt;/action&gt;
805
806 &lt;action id="org.gnome.policykit.examples.kick-foo"&gt;
807 &lt;description&gt;Kick foo&lt;/description&gt;
808 &lt;message&gt;System policy prevents the PolicyKit-gnome example helper from Kicking foo&lt;/message&gt;
809 &lt;message xml:lang="da"&gt;System indstillinger forhindrer PolicyKit-gnome eksempel hj&#230;lper fra at Sparke foo!&lt;/message&gt;
810 &lt;defaults&gt;
811 &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
812 &lt;allow_active&gt;auth_self&lt;/allow_active&gt;
813 &lt;/defaults&gt;
814 &lt;annotate key="org.gnome.policykit.examples.kick-path"&gt;foo&lt;/annotate&gt;
815 &lt;/action&gt;
816
817 &lt;action id="org.gnome.policykit.examples.kick-bar"&gt;
818 &lt;description&gt;Kick bar&lt;/description&gt;
819 &lt;message&gt;System policy prevents the PolicyKit-gnome example helper from Kicking bar&lt;/message&gt;
820 &lt;message xml:lang="da"&gt;System indstillinger forhindrer PolicyKit-gnome eksempel hj&#230;lper fra at Sparke bar!&lt;/message&gt;
821 &lt;defaults&gt;
822 &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
823 &lt;allow_active&gt;auth_self&lt;/allow_active&gt;
824 &lt;/defaults&gt;
825 &lt;annotate key="org.gnome.policykit.examples.kick-path"&gt;bar&lt;/annotate&gt;
826 &lt;/action&gt;
827
828 &lt;action id="org.gnome.policykit.examples.kick-baz"&gt;
829 &lt;description&gt;Kick baz&lt;/description&gt;
830 &lt;message&gt;System policy prevents the PolicyKit-gnome example helper from Kicking baz&lt;/message&gt;
831 &lt;message xml:lang="da"&gt;System indstillinger forhindrer PolicyKit-gnome eksempel hj&#230;lper fra at Sparke baz!&lt;/message&gt;
832 &lt;defaults&gt;
833 &lt;allow_inactive&gt;no&lt;/allow_inactive&gt;
834 &lt;allow_active&gt;auth_self&lt;/allow_active&gt;
835 &lt;/defaults&gt;
836 &lt;annotate key="org.gnome.policykit.examples.kick-path"&gt;baz&lt;/annotate&gt;
837 &lt;/action&gt;
838
839 &lt;/policyconfig&gt;</pre>
840 <p>
841 </p>
842 <p>
843 into a file
844 <code class="literal">/usr/share/PolicyKit/policy/polkit-gnome-example.policy</code>. Finally,
845 run <code class="literal">polkit-gnome-example</code>. It should display a
846 window like this:
847 </p>
848 <p>
849 <img src="polkit-gnome-example-screenshot.png">
850 </p>
851 <p>
852 If the "Twiddle!" button is pressed, an authentication dialog
853 should pop up
854 </p>
855 <p>
856 <img src="polkit-gnome-example-auth-dialog-twiddle.png">
857 </p>
858 <p>
859 Here is how what the application looks like if the user gains
860 authorization for all the actions:
861 </p>
862 <p>
863 <img src="polkit-gnome-example-screenshot-authorized.png">
864 </p>
865 <p>
866 Regarding how to build an example mechanism that this GTK+
867 application can take advantage of, please refer to the
868 <a
869 href="../polkit/polkit-polkit-context.html#PolKitContext"
870 ><span class="type">PolKitContext</span></a> class for examples.</p>
871 <p>
872
873 </p>
874 </div>
875 <div class="refsect1" lang="en">
876 <a name="id2801651"></a><h2>Details</h2>
877 <div class="refsect2" lang="en">
878 <a name="id2801660"></a><h3>
879 <a name="PolKitGnomeActionPrivate"></a>PolKitGnomeActionPrivate</h3>
880 <a class="indexterm" name="id2801670"></a><pre class="programlisting">typedef struct _PolKitGnomeActionPrivate PolKitGnomeActionPrivate;</pre>
881 <p>
882
883 </p>
884 </div>
885 <hr>
886 <div class="refsect2" lang="en">
887 <a name="id2801685"></a><h3>
888 <a name="PolKitGnomeAction-struct"></a>PolKitGnomeAction</h3>
889 <a class="indexterm" name="id2801696"></a><pre class="programlisting">typedef struct _PolKitGnomeAction PolKitGnomeAction;</pre>
890 <p>
891 The PolKitGnomeAction struct contains only private data members and should not be accessed directly.</p>
892 <p>
893
894 </p>
895 </div>
896 <hr>
897 <div class="refsect2" lang="en">
898 <a name="id2801715"></a><h3>
899 <a name="polkit-gnome-action-new"></a>polkit_gnome_action_new ()</h3>
900 <a class="indexterm" name="id2801726"></a><pre class="programlisting"><a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a>* polkit_gnome_action_new (const <a
901 href="../glib/glib-Basic-Types.html#gchar"
902 >gchar</a> *name);</pre>
903 <p>
904 Creates a new <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> object. The typical use for this
905 function is for specialized use where
906 <a class="link" href="PolKitGnomeAction.html#polkit-gnome-action-new-default"><code class="function">polkit_gnome_action_new_default()</code></a> does not meet the needs of the
907 application. A short example of the usage of this contructor
908 follows.
909 </p>
910 <p>
911 If the 'polkit-action' property is <a
912 href="../glib/glib-Standard-Macros.html#NULL:CAPS"
913 ><span class="type">NULL</span></a> the behavior is similar to
914 as if a <a
915 href="../polkit/polkit-polkit-action.html#PolKitAction"
916 ><span class="type">PolKitAction</span></a> returned <a
917 href="../polkit/polkit-polkit-result.html#POLKIT-RESULT-YES:CAPS"
918 ><span class="type">POLKIT_RESULT_YES</span></a>.
919 </p>
920 <p>
921 One can set the 'polkit-action-sufficient' property to a
922 <a
923 href="../gobject/gobject-Value-arrays.html#GValueArray"
924 ><span class="type">GValueArray</span></a> of pointers to <a
925 href="../polkit/polkit-polkit-action.html#PolKitAction"
926 ><span class="type">PolKitAction</span></a> objects. The semantics of
927 this property is that if the user is authorized for any of the
928 given actions in 'polkit-action-sufficient' then the behavior is
929 the same as if they're authorized for the action denoted by
930 'polkit-action'. This is useful in a setup where you have two
931 similar actions and one implies the other. For example, in
932 gnome-system-monitor there are two actions
933 <code class="literal">org.gnome.system-monitor.increase-own-priority</code>
934 (Increase the priority of a process owned by yourself) and
935 <code class="literal">org.gnome.system-monitor.change-priorty</code> (Change
936 priority of any process). As the latter clearly implies the former,
937 one would set the latter in the 'polkit-action-sufficient'
938 property when constructing a <a
939 href="../polkit/polkit-polkit-action.html#PolKitAction"
940 ><span class="type">PolKitAction</span></a> for the former.
941 </p>
942 <p>
943 </p>
944 <pre class="programlisting">
945 PolKitAction *polkit_action;
946 PolKitGnomeAction *action;
947
948 polkit_action = polkit_action_new ();
949 polkit_action_set_action_id (polkit_action, "org.example.some-policykit-action");
950
951 action = polkit_gnome_action_new ("blabla", NULL);
952 g_object_set (action,
953 "polkit-action", polkit_action,
954 "no-visible", TRUE,
955 "no-sensitive", FALSE,
956 "no-short-label", "The Action no can do!",
957 "no-label", "The Action is not permitted!",
958 "no-tooltip", "The Tooltip (no)",
959 "no-icon-name", GTK_STOCK_NO,
960
961 "auth-visible", TRUE,
962 "auth-sensitive", TRUE,
963 "auth-short-label", "The Action requires auth...",
964 "auth-label", "The Action requires auth...",
965 "auth-tooltip", "The Tooltip (auth)",
966 "auth-icon-name", GTK_STOCK_DIALOG_AUTHENTICATION,
967
968 "yes-visible", TRUE,
969 "yes-sensitive", TRUE,
970 "yes-short-label", "Action!",
971 "yes-label", "Just do the Action!",
972 "yes-tooltip", "The Tooltip (yes)",
973 "yes-icon-name", GTK_STOCK_YES,
974 NULL);
975 </pre>
976 <p>
977
978 </p>
979 <div class="variablelist"><table border="0">
980 <col align="left" valign="top">
981 <tbody>
982 <tr>
983 <td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
984 <td> A unique name for the action
985 </td>
986 </tr>
987 <tr>
988 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
989 <td> a new <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> or <a
990 href="../glib/glib-Standard-Macros.html#NULL:CAPS"
991 ><span class="type">NULL</span></a> if error is set
992 </td>
993 </tr>
994 </tbody>
995 </table></div>
996 </div>
997 <hr>
998 <div class="refsect2" lang="en">
999 <a name="id2801909"></a><h3>
1000 <a name="polkit-gnome-action-new-default"></a>polkit_gnome_action_new_default ()</h3>
1001 <a class="indexterm" name="id2801922"></a><pre class="programlisting"><a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a>* polkit_gnome_action_new_default (const <a
1002 href="../glib/glib-Basic-Types.html#gchar"
1003 >gchar</a> *name,
1004 <a
1005 href="../polkit/polkit-polkit-action.html#PolKitAction"
1006 >PolKitAction</a> *polkit_action,
1007 const <a
1008 href="../glib/glib-Basic-Types.html#gchar"
1009 >gchar</a> *label,
1010 const <a
1011 href="../glib/glib-Basic-Types.html#gchar"
1012 >gchar</a> *tooltip);</pre>
1013 <p>
1014 Creates a new <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> object with the default
1015 behavior for a given <a
1016 href="../polkit/polkit-polkit-action.html#PolKitAction"
1017 ><span class="type">PolKitAction</span></a> object.
1018 </p>
1019 <p>
1020 Default behavior is defined by the label and tooltip being
1021 identical across all three four states, the action being visible in
1022 all four states, and the action being insensitive only in the state
1023 where the result from PolicyKit is no and self-blocked. Only when
1024 PolicyKit returns one of the 'auth*' results, the icon_name
1025 property will be set to <span class="type">GTK_STOCK_DIALOG_AUTHENTICATION</span>.
1026 </p>
1027 <p>
1028 The caller can always modify individual aspects of the action after
1029 creation, e.g. change the tooltip for the self-blocked, no, auth
1030 and yes states.
1031 </p>
1032 <p>
1033 If the given polkit_action is <a
1034 href="../glib/glib-Standard-Macros.html#NULL:CAPS"
1035 ><span class="type">NULL</span></a> the behavior is similar to as
1036 if a <a
1037 href="../polkit/polkit-polkit-action.html#PolKitAction"
1038 ><span class="type">PolKitAction</span></a> returned <a
1039 href="../polkit/polkit-polkit-result.html#POLKIT-RESULT-YES:CAPS"
1040 ><span class="type">POLKIT_RESULT_YES</span></a>.</p>
1041 <p>
1042
1043 </p>
1044 <div class="variablelist"><table border="0">
1045 <col align="left" valign="top">
1046 <tbody>
1047 <tr>
1048 <td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
1049 <td> A unique name for the action
1050 </td>
1051 </tr>
1052 <tr>
1053 <td><p><span class="term"><em class="parameter"><code>polkit_action</code></em>&#160;:</span></p></td>
1054 <td> the <a
1055 href="../polkit/polkit-polkit-action.html#PolKitAction"
1056 ><span class="type">PolKitAction</span></a> to track
1057 </td>
1058 </tr>
1059 <tr>
1060 <td><p><span class="term"><em class="parameter"><code>label</code></em>&#160;:</span></p></td>
1061 <td> the label to use (will also apply to short-label)
1062 </td>
1063 </tr>
1064 <tr>
1065 <td><p><span class="term"><em class="parameter"><code>tooltip</code></em>&#160;:</span></p></td>
1066 <td> the tool tip to use
1067 </td>
1068 </tr>
1069 <tr>
1070 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
1071 <td> a new <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> or <a
1072 href="../glib/glib-Standard-Macros.html#NULL:CAPS"
1073 ><span class="type">NULL</span></a> if error is set
1074 </td>
1075 </tr>
1076 </tbody>
1077 </table></div>
1078 </div>
1079 <hr>
1080 <div class="refsect2" lang="en">
1081 <a name="id2802113"></a><h3>
1082 <a name="polkit-gnome-action-get-polkit-result"></a>polkit_gnome_action_get_polkit_result ()</h3>
1083 <a class="indexterm" name="id2802126"></a><pre class="programlisting"><a
1084 href="../polkit/polkit-polkit-result.html#PolKitResult"
1085 >PolKitResult</a> polkit_gnome_action_get_polkit_result
1086 (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action);</pre>
1087 <p>
1088 Gets the <a
1089 href="../polkit/polkit-polkit-result.html#PolKitResult"
1090 ><span class="type">PolKitResult</span></a> that indicates whether the user is
1091 privileged to do the <a
1092 href="../polkit/polkit-polkit-action.html#PolKitAction"
1093 ><span class="type">PolKitAction</span></a> associated with this
1094 <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> object.</p>
1095 <p>
1096
1097 </p>
1098 <div class="variablelist"><table border="0">
1099 <col align="left" valign="top">
1100 <tbody>
1101 <tr>
1102 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
1103 <td> The <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> object
1104 </td>
1105 </tr>
1106 <tr>
1107 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
1108 <td> The <a
1109 href="../polkit/polkit-polkit-action.html#PolKitAction"
1110 ><span class="type">PolKitAction</span></a> object. The caller shall not unref this object.
1111 </td>
1112 </tr>
1113 </tbody>
1114 </table></div>
1115 </div>
1116 <hr>
1117 <div class="refsect2" lang="en">
1118 <a name="id2802215"></a><h3>
1119 <a name="polkit-gnome-action-get-sensitive"></a>polkit_gnome_action_get_sensitive ()</h3>
1120 <a class="indexterm" name="id2802228"></a><pre class="programlisting"><a
1121 href="../glib/glib-Basic-Types.html#gboolean"
1122 >gboolean</a> polkit_gnome_action_get_sensitive (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action);</pre>
1123 <p>
1124 Get the master sensitivity, see PolKitGnomeAction:master-sensitive:
1125 for details.</p>
1126 <p>
1127
1128 </p>
1129 <div class="variablelist"><table border="0">
1130 <col align="left" valign="top">
1131 <tbody>
1132 <tr>
1133 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
1134 <td> The <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> object
1135 </td>
1136 </tr>
1137 <tr>
1138 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
1139 <td> the master sensitivity
1140 </td>
1141 </tr>
1142 </tbody>
1143 </table></div>
1144 </div>
1145 <hr>
1146 <div class="refsect2" lang="en">
1147 <a name="id2802289"></a><h3>
1148 <a name="polkit-gnome-action-set-sensitive"></a>polkit_gnome_action_set_sensitive ()</h3>
1149 <a class="indexterm" name="id2802302"></a><pre class="programlisting">void polkit_gnome_action_set_sensitive (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action,
1150 <a
1151 href="../glib/glib-Basic-Types.html#gboolean"
1152 >gboolean</a> sensitive);</pre>
1153 <p>
1154 Set the master sensitivity, see PolKitGnomeAction:master-sensitive:
1155 for details.</p>
1156 <p>
1157
1158 </p>
1159 <div class="variablelist"><table border="0">
1160 <col align="left" valign="top">
1161 <tbody>
1162 <tr>
1163 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
1164 <td> The <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> object
1165 </td>
1166 </tr>
1167 <tr>
1168 <td><p><span class="term"><em class="parameter"><code>sensitive</code></em>&#160;:</span></p></td>
1169 <td> master sensitivity
1170 </td>
1171 </tr>
1172 </tbody>
1173 </table></div>
1174 </div>
1175 <hr>
1176 <div class="refsect2" lang="en">
1177 <a name="id2802373"></a><h3>
1178 <a name="polkit-gnome-action-get-visible"></a>polkit_gnome_action_get_visible ()</h3>
1179 <a class="indexterm" name="id2802385"></a><pre class="programlisting"><a
1180 href="../glib/glib-Basic-Types.html#gboolean"
1181 >gboolean</a> polkit_gnome_action_get_visible (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action);</pre>
1182 <p>
1183 Get the master visibility, see PolKitGnomeAction:master-visible:
1184 for details.</p>
1185 <p>
1186
1187 </p>
1188 <div class="variablelist"><table border="0">
1189 <col align="left" valign="top">
1190 <tbody>
1191 <tr>
1192 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
1193 <td> The <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> object
1194 </td>
1195 </tr>
1196 <tr>
1197 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
1198 <td> the master visibility
1199 </td>
1200 </tr>
1201 </tbody>
1202 </table></div>
1203 </div>
1204 <hr>
1205 <div class="refsect2" lang="en">
1206 <a name="id2802447"></a><h3>
1207 <a name="polkit-gnome-action-set-visible"></a>polkit_gnome_action_set_visible ()</h3>
1208 <a class="indexterm" name="id2802460"></a><pre class="programlisting">void polkit_gnome_action_set_visible (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action,
1209 <a
1210 href="../glib/glib-Basic-Types.html#gboolean"
1211 >gboolean</a> visible);</pre>
1212 <p>
1213 Set the master visibility, see PolKitGnomeAction:master-visible:
1214 for details.</p>
1215 <p>
1216
1217 </p>
1218 <div class="variablelist"><table border="0">
1219 <col align="left" valign="top">
1220 <tbody>
1221 <tr>
1222 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
1223 <td> The <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> object
1224 </td>
1225 </tr>
1226 <tr>
1227 <td><p><span class="term"><em class="parameter"><code>visible</code></em>&#160;:</span></p></td>
1228 <td> master visibility
1229 </td>
1230 </tr>
1231 </tbody>
1232 </table></div>
1233 </div>
1234 <hr>
1235 <div class="refsect2" lang="en">
1236 <a name="id2802531"></a><h3>
1237 <a name="polkit-gnome-action-create-button"></a>polkit_gnome_action_create_button ()</h3>
1238 <a class="indexterm" name="id2802544"></a><pre class="programlisting">GtkWidget* polkit_gnome_action_create_button (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action);</pre>
1239 <p>
1240 Create a button for the given action that displays the label,
1241 tooltip and icon_name corresponding to whether the state, according
1242 to PolicyKit, is no, auth or yes.</p>
1243 <p>
1244
1245 </p>
1246 <div class="variablelist"><table border="0">
1247 <col align="left" valign="top">
1248 <tbody>
1249 <tr>
1250 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
1251 <td> The <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> object
1252 </td>
1253 </tr>
1254 <tr>
1255 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
1256 <td> A <span class="type">GtkButton</span> instance connected to the action
1257 </td>
1258 </tr>
1259 </tbody>
1260 </table></div>
1261 </div>
1262 </div>
1263 <div class="refsect1" lang="en">
1264 <a name="id2802615"></a><h2>Property Details</h2>
1265 <div class="refsect2" lang="en">
1266 <a name="id2802624"></a><h3>
1267 <a name="PolKitGnomeAction--auth-icon-name"></a>The <code class="literal">"auth-icon-name"</code> property</h3>
1268 <a class="indexterm" name="id2802639"></a><pre class="programlisting"> "auth-icon-name" <a
1269 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1270 >gchararray</a> : Read / Write</pre>
1271 <p>If PolicyKit evaluates the result as 'auth', use this icon-name.</p>
1272 <p>Default value: NULL</p>
1273 </div>
1274 <hr>
1275 <div class="refsect2" lang="en">
1276 <a name="id2802663"></a><h3>
1277 <a name="PolKitGnomeAction--auth-label"></a>The <code class="literal">"auth-label"</code> property</h3>
1278 <a class="indexterm" name="id2802677"></a><pre class="programlisting"> "auth-label" <a
1279 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1280 >gchararray</a> : Read / Write</pre>
1281 <p>If PolicyKit evaluates the result as 'auth', use this label.</p>
1282 <p>Default value: NULL</p>
1283 </div>
1284 <hr>
1285 <div class="refsect2" lang="en">
1286 <a name="id2802701"></a><h3>
1287 <a name="PolKitGnomeAction--auth-sensitive"></a>The <code class="literal">"auth-sensitive"</code> property</h3>
1288 <a class="indexterm" name="id2802716"></a><pre class="programlisting"> "auth-sensitive" <a
1289 href="../glib/glib-Basic-Types.html#gboolean"
1290 >gboolean</a> : Read / Write</pre>
1291 <p>If PolicyKit evaluates the result as 'auth', whether the action will be sensitive.</p>
1292 <p>Default value: TRUE</p>
1293 </div>
1294 <hr>
1295 <div class="refsect2" lang="en">
1296 <a name="id2802740"></a><h3>
1297 <a name="PolKitGnomeAction--auth-short-label"></a>The <code class="literal">"auth-short-label"</code> property</h3>
1298 <a class="indexterm" name="id2802755"></a><pre class="programlisting"> "auth-short-label" <a
1299 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1300 >gchararray</a> : Read / Write</pre>
1301 <p>If PolicyKit evaluates the result as 'auth', use this short-label.</p>
1302 <p>Default value: NULL</p>
1303 </div>
1304 <hr>
1305 <div class="refsect2" lang="en">
1306 <a name="id2802779"></a><h3>
1307 <a name="PolKitGnomeAction--auth-tooltip"></a>The <code class="literal">"auth-tooltip"</code> property</h3>
1308 <a class="indexterm" name="id2802793"></a><pre class="programlisting"> "auth-tooltip" <a
1309 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1310 >gchararray</a> : Read / Write</pre>
1311 <p>If PolicyKit evaluates the result as 'auth', use this tooltip.</p>
1312 <p>Default value: NULL</p>
1313 </div>
1314 <hr>
1315 <div class="refsect2" lang="en">
1316 <a name="id2802817"></a><h3>
1317 <a name="PolKitGnomeAction--auth-visible"></a>The <code class="literal">"auth-visible"</code> property</h3>
1318 <a class="indexterm" name="id2802832"></a><pre class="programlisting"> "auth-visible" <a
1319 href="../glib/glib-Basic-Types.html#gboolean"
1320 >gboolean</a> : Read / Write</pre>
1321 <p>If PolicyKit evaluates the result as 'auth', whether the action will be visible.</p>
1322 <p>Default value: TRUE</p>
1323 </div>
1324 <hr>
1325 <div class="refsect2" lang="en">
1326 <a name="id2802857"></a><h3>
1327 <a name="PolKitGnomeAction--master-sensitive"></a>The <code class="literal">"master-sensitive"</code> property</h3>
1328 <a class="indexterm" name="id2802871"></a><pre class="programlisting"> "master-sensitive" <a
1329 href="../glib/glib-Basic-Types.html#gboolean"
1330 >gboolean</a> : Read / Write</pre>
1331 <p>Can be set to FALSE to force insensitivity no matter what PolicyKit reports.</p>
1332 <p>Default value: TRUE</p>
1333 </div>
1334 <hr>
1335 <div class="refsect2" lang="en">
1336 <a name="id2802896"></a><h3>
1337 <a name="PolKitGnomeAction--master-visible"></a>The <code class="literal">"master-visible"</code> property</h3>
1338 <a class="indexterm" name="id2802910"></a><pre class="programlisting"> "master-visible" <a
1339 href="../glib/glib-Basic-Types.html#gboolean"
1340 >gboolean</a> : Read / Write</pre>
1341 <p>Can be set to FALSE to force invisibility no matter what PolicyKit reports.</p>
1342 <p>Default value: TRUE</p>
1343 </div>
1344 <hr>
1345 <div class="refsect2" lang="en">
1346 <a name="id2802935"></a><h3>
1347 <a name="PolKitGnomeAction--no-icon-name"></a>The <code class="literal">"no-icon-name"</code> property</h3>
1348 <a class="indexterm" name="id2802950"></a><pre class="programlisting"> "no-icon-name" <a
1349 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1350 >gchararray</a> : Read / Write</pre>
1351 <p>If PolicyKit evaluates the result as 'no', use this icon-name.</p>
1352 <p>Default value: NULL</p>
1353 </div>
1354 <hr>
1355 <div class="refsect2" lang="en">
1356 <a name="id2802974"></a><h3>
1357 <a name="PolKitGnomeAction--no-label"></a>The <code class="literal">"no-label"</code> property</h3>
1358 <a class="indexterm" name="id2802986"></a><pre class="programlisting"> "no-label" <a
1359 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1360 >gchararray</a> : Read / Write</pre>
1361 <p>If PolicyKit evaluates the result as 'no', use this label.</p>
1362 <p>Default value: NULL</p>
1363 </div>
1364 <hr>
1365 <div class="refsect2" lang="en">
1366 <a name="id2803010"></a><h3>
1367 <a name="PolKitGnomeAction--no-sensitive"></a>The <code class="literal">"no-sensitive"</code> property</h3>
1368 <a class="indexterm" name="id2803024"></a><pre class="programlisting"> "no-sensitive" <a
1369 href="../glib/glib-Basic-Types.html#gboolean"
1370 >gboolean</a> : Read / Write</pre>
1371 <p>If PolicyKit evaluates the result as 'no', whether the action will be sensitive.</p>
1372 <p>Default value: FALSE</p>
1373 </div>
1374 <hr>
1375 <div class="refsect2" lang="en">
1376 <a name="id2803049"></a><h3>
1377 <a name="PolKitGnomeAction--no-short-label"></a>The <code class="literal">"no-short-label"</code> property</h3>
1378 <a class="indexterm" name="id2803064"></a><pre class="programlisting"> "no-short-label" <a
1379 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1380 >gchararray</a> : Read / Write</pre>
1381 <p>If PolicyKit evaluates the result as 'no', use this short-label.</p>
1382 <p>Default value: NULL</p>
1383 </div>
1384 <hr>
1385 <div class="refsect2" lang="en">
1386 <a name="id2803088"></a><h3>
1387 <a name="PolKitGnomeAction--no-tooltip"></a>The <code class="literal">"no-tooltip"</code> property</h3>
1388 <a class="indexterm" name="id2803102"></a><pre class="programlisting"> "no-tooltip" <a
1389 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1390 >gchararray</a> : Read / Write</pre>
1391 <p>If PolicyKit evaluates the result as 'no', use this tooltip.</p>
1392 <p>Default value: NULL</p>
1393 </div>
1394 <hr>
1395 <div class="refsect2" lang="en">
1396 <a name="id2803126"></a><h3>
1397 <a name="PolKitGnomeAction--no-visible"></a>The <code class="literal">"no-visible"</code> property</h3>
1398 <a class="indexterm" name="id2803140"></a><pre class="programlisting"> "no-visible" <a
1399 href="../glib/glib-Basic-Types.html#gboolean"
1400 >gboolean</a> : Read / Write</pre>
1401 <p>If PolicyKit evaluates the result as 'no', whether the action will be visible.</p>
1402 <p>Default value: TRUE</p>
1403 </div>
1404 <hr>
1405 <div class="refsect2" lang="en">
1406 <a name="id2803165"></a><h3>
1407 <a name="PolKitGnomeAction--polkit-action"></a>The <code class="literal">"polkit-action"</code> property</h3>
1408 <a class="indexterm" name="id2803180"></a><pre class="programlisting"> "polkit-action" <a
1409 href="../glib/glib-Basic-Types.html#gpointer"
1410 >gpointer</a> : Read / Write / Construct</pre>
1411 <p>The PolKitAction object this GTK+ action is tracking.</p>
1412 </div>
1413 <hr>
1414 <div class="refsect2" lang="en">
1415 <a name="id2803201"></a><h3>
1416 <a name="PolKitGnomeAction--polkit-action-sufficient"></a>The <code class="literal">"polkit-action-sufficient"</code> property</h3>
1417 <a class="indexterm" name="id2803216"></a><pre class="programlisting"> "polkit-action-sufficient" <a
1418 href="../gobject/gobject-Value-arrays.html#GValueArray"
1419 >GValueArray</a> : Read / Write / Construct</pre>
1420 <p>An array of PolKitAction objects that are sufficient to have authorizations for.</p>
1421 </div>
1422 <hr>
1423 <div class="refsect2" lang="en">
1424 <a name="id2803238"></a><h3>
1425 <a name="PolKitGnomeAction--self-blocked-icon-name"></a>The <code class="literal">"self-blocked-icon-name"</code> property</h3>
1426 <a class="indexterm" name="id2803253"></a><pre class="programlisting"> "self-blocked-icon-name" <a
1427 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1428 >gchararray</a> : Read / Write</pre>
1429 <p>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this icon-name.</p>
1430 <p>Default value: NULL</p>
1431 </div>
1432 <hr>
1433 <div class="refsect2" lang="en">
1434 <a name="id2803278"></a><h3>
1435 <a name="PolKitGnomeAction--self-blocked-label"></a>The <code class="literal">"self-blocked-label"</code> property</h3>
1436 <a class="indexterm" name="id2803293"></a><pre class="programlisting"> "self-blocked-label" <a
1437 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1438 >gchararray</a> : Read / Write</pre>
1439 <p>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this label.</p>
1440 <p>Default value: NULL</p>
1441 </div>
1442 <hr>
1443 <div class="refsect2" lang="en">
1444 <a name="id2803318"></a><h3>
1445 <a name="PolKitGnomeAction--self-blocked-sensitive"></a>The <code class="literal">"self-blocked-sensitive"</code> property</h3>
1446 <a class="indexterm" name="id2803333"></a><pre class="programlisting"> "self-blocked-sensitive" <a
1447 href="../glib/glib-Basic-Types.html#gboolean"
1448 >gboolean</a> : Read / Write</pre>
1449 <p>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, whether the action will be sensitive.</p>
1450 <p>Default value: FALSE</p>
1451 </div>
1452 <hr>
1453 <div class="refsect2" lang="en">
1454 <a name="id2803359"></a><h3>
1455 <a name="PolKitGnomeAction--self-blocked-short-label"></a>The <code class="literal">"self-blocked-short-label"</code> property</h3>
1456 <a class="indexterm" name="id2803374"></a><pre class="programlisting"> "self-blocked-short-label" <a
1457 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1458 >gchararray</a> : Read / Write</pre>
1459 <p>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this short-label.</p>
1460 <p>Default value: NULL</p>
1461 </div>
1462 <hr>
1463 <div class="refsect2" lang="en">
1464 <a name="id2803399"></a><h3>
1465 <a name="PolKitGnomeAction--self-blocked-tooltip"></a>The <code class="literal">"self-blocked-tooltip"</code> property</h3>
1466 <a class="indexterm" name="id2803414"></a><pre class="programlisting"> "self-blocked-tooltip" <a
1467 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1468 >gchararray</a> : Read / Write</pre>
1469 <p>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this tooltip.</p>
1470 <p>Default value: NULL</p>
1471 </div>
1472 <hr>
1473 <div class="refsect2" lang="en">
1474 <a name="id2803439"></a><h3>
1475 <a name="PolKitGnomeAction--self-blocked-visible"></a>The <code class="literal">"self-blocked-visible"</code> property</h3>
1476 <a class="indexterm" name="id2803454"></a><pre class="programlisting"> "self-blocked-visible" <a
1477 href="../glib/glib-Basic-Types.html#gboolean"
1478 >gboolean</a> : Read / Write</pre>
1479 <p>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, whether the action will be visible.</p>
1480 <p>Default value: TRUE</p>
1481 </div>
1482 <hr>
1483 <div class="refsect2" lang="en">
1484 <a name="id2803480"></a><h3>
1485 <a name="PolKitGnomeAction--target-pid"></a>The <code class="literal">"target-pid"</code> property</h3>
1486 <a class="indexterm" name="id2803494"></a><pre class="programlisting"> "target-pid" <a
1487 href="../glib/glib-Basic-Types.html#guint"
1488 >guint</a> : Read / Write / Construct</pre>
1489 <p>The target process id to receive the authorization; if 0 it is the current process.</p>
1490 <p>Default value: 0</p>
1491 </div>
1492 <hr>
1493 <div class="refsect2" lang="en">
1494 <a name="id2803519"></a><h3>
1495 <a name="PolKitGnomeAction--yes-icon-name"></a>The <code class="literal">"yes-icon-name"</code> property</h3>
1496 <a class="indexterm" name="id2803534"></a><pre class="programlisting"> "yes-icon-name" <a
1497 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1498 >gchararray</a> : Read / Write</pre>
1499 <p>If PolicyKit evaluates the result as 'yes', use this icon-name.</p>
1500 <p>Default value: NULL</p>
1501 </div>
1502 <hr>
1503 <div class="refsect2" lang="en">
1504 <a name="id2803558"></a><h3>
1505 <a name="PolKitGnomeAction--yes-label"></a>The <code class="literal">"yes-label"</code> property</h3>
1506 <a class="indexterm" name="id2803572"></a><pre class="programlisting"> "yes-label" <a
1507 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1508 >gchararray</a> : Read / Write</pre>
1509 <p>If PolicyKit evaluates the result as 'yes', use this label.</p>
1510 <p>Default value: NULL</p>
1511 </div>
1512 <hr>
1513 <div class="refsect2" lang="en">
1514 <a name="id2803595"></a><h3>
1515 <a name="PolKitGnomeAction--yes-sensitive"></a>The <code class="literal">"yes-sensitive"</code> property</h3>
1516 <a class="indexterm" name="id2803610"></a><pre class="programlisting"> "yes-sensitive" <a
1517 href="../glib/glib-Basic-Types.html#gboolean"
1518 >gboolean</a> : Read / Write</pre>
1519 <p>If PolicyKit evaluates the result as 'yes', whether the action will be sensitive.</p>
1520 <p>Default value: TRUE</p>
1521 </div>
1522 <hr>
1523 <div class="refsect2" lang="en">
1524 <a name="id2803634"></a><h3>
1525 <a name="PolKitGnomeAction--yes-short-label"></a>The <code class="literal">"yes-short-label"</code> property</h3>
1526 <a class="indexterm" name="id2803649"></a><pre class="programlisting"> "yes-short-label" <a
1527 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1528 >gchararray</a> : Read / Write</pre>
1529 <p>If PolicyKit evaluates the result as 'yes', use this short-label.</p>
1530 <p>Default value: NULL</p>
1531 </div>
1532 <hr>
1533 <div class="refsect2" lang="en">
1534 <a name="id2803673"></a><h3>
1535 <a name="PolKitGnomeAction--yes-tooltip"></a>The <code class="literal">"yes-tooltip"</code> property</h3>
1536 <a class="indexterm" name="id2803687"></a><pre class="programlisting"> "yes-tooltip" <a
1537 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
1538 >gchararray</a> : Read / Write</pre>
1539 <p>If PolicyKit evaluates the result as 'yes', use this tooltip.</p>
1540 <p>Default value: NULL</p>
1541 </div>
1542 <hr>
1543 <div class="refsect2" lang="en">
1544 <a name="id2803711"></a><h3>
1545 <a name="PolKitGnomeAction--yes-visible"></a>The <code class="literal">"yes-visible"</code> property</h3>
1546 <a class="indexterm" name="id2803726"></a><pre class="programlisting"> "yes-visible" <a
1547 href="../glib/glib-Basic-Types.html#gboolean"
1548 >gboolean</a> : Read / Write</pre>
1549 <p>If PolicyKit evaluates the result as 'yes', whether the action will be visible.</p>
1550 <p>Default value: TRUE</p>
1551 </div>
1552 </div>
1553 <div class="refsect1" lang="en">
1554 <a name="id2803752"></a><h2>Signal Details</h2>
1555 <div class="refsect2" lang="en">
1556 <a name="id2803761"></a><h3>
1557 <a name="PolKitGnomeAction-auth-end"></a>The <code class="literal">"auth-end"</code> signal</h3>
1558 <a class="indexterm" name="id2803774"></a><pre class="programlisting">void user_function (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action,
1559 <a
1560 href="../glib/glib-Basic-Types.html#gboolean"
1561 >gboolean</a> gained_privilege,
1562 <a
1563 href="../glib/glib-Basic-Types.html#gpointer"
1564 >gpointer</a> user_data) : Run Last</pre>
1565 <p>
1566 The ::auth-end signal is emitted when the an authentication
1567 session ends and carries information about whether the
1568 privilege was obtained or not.</p>
1569 <p>
1570
1571 </p>
1572 <div class="variablelist"><table border="0">
1573 <col align="left" valign="top">
1574 <tbody>
1575 <tr>
1576 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
1577 <td> the object
1578 </td>
1579 </tr>
1580 <tr>
1581 <td><p><span class="term"><em class="parameter"><code>gained_privilege</code></em>&#160;:</span></p></td>
1582 <td> whether the privilege was gained
1583 </td>
1584 </tr>
1585 <tr>
1586 <td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
1587 <td>user data set when the signal handler was connected.</td>
1588 </tr>
1589 </tbody>
1590 </table></div>
1591 </div>
1592 <hr>
1593 <div class="refsect2" lang="en">
1594 <a name="id2803860"></a><h3>
1595 <a name="PolKitGnomeAction-auth-start"></a>The <code class="literal">"auth-start"</code> signal</h3>
1596 <a class="indexterm" name="id2803875"></a><pre class="programlisting">void user_function (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action,
1597 <a
1598 href="../glib/glib-Basic-Types.html#gpointer"
1599 >gpointer</a> user_data) : Run Last</pre>
1600 <p>
1601 The ::auth-start signal is emitted when an authentication
1602 session starts.</p>
1603 <p>
1604
1605 </p>
1606 <div class="variablelist"><table border="0">
1607 <col align="left" valign="top">
1608 <tbody>
1609 <tr>
1610 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
1611 <td> the object
1612 </td>
1613 </tr>
1614 <tr>
1615 <td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
1616 <td>user data set when the signal handler was connected.</td>
1617 </tr>
1618 </tbody>
1619 </table></div>
1620 </div>
1621 <hr>
1622 <div class="refsect2" lang="en">
1623 <a name="id2803940"></a><h3>
1624 <a name="PolKitGnomeAction-polkit-result-changed"></a>The <code class="literal">"polkit-result-changed"</code> signal</h3>
1625 <a class="indexterm" name="id2803955"></a><pre class="programlisting">void user_function (<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a> *action,
1626 <a
1627 href="../glib/glib-Basic-Types.html#gint"
1628 >gint</a> current_result,
1629 <a
1630 href="../glib/glib-Basic-Types.html#gpointer"
1631 >gpointer</a> user_data) : Run Last</pre>
1632 <p>
1633 The ::polkit-result-changed signal is emitted when the
1634 PolicyKit result changes. This can happen when external
1635 factors (config file, ConsoleKit, privilege granted /
1636 revoked) change since the <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a> class listens
1637 for events using the <a class="link" href="PolKitGnomeContext.html" title="PolKitGnomeContext"><span class="type">PolKitGnomeContext</span></a> class.</p>
1638 <p>
1639
1640 </p>
1641 <div class="variablelist"><table border="0">
1642 <col align="left" valign="top">
1643 <tbody>
1644 <tr>
1645 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
1646 <td> the object
1647 </td>
1648 </tr>
1649 <tr>
1650 <td><p><span class="term"><em class="parameter"><code>current_result</code></em>&#160;:</span></p></td>
1651 <td> current <a
1652 href="../polkit/polkit-polkit-result.html#PolKitResult"
1653 ><span class="type">PolKitResult</span></a> from PolicyKit regarding given <a
1654 href="../polkit/polkit-polkit-action.html#PolKitAction"
1655 ><span class="type">PolKitAction</span></a> object
1656 </td>
1657 </tr>
1658 <tr>
1659 <td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
1660 <td>user data set when the signal handler was connected.</td>
1661 </tr>
1662 </tbody>
1663 </table></div>
1664 </div>
1665 </div>
1666 <div class="refsect1" lang="en">
1667 <a name="id2804070"></a><div class="refsect2" lang="en"><a name="id2804071"></a></div>
1668 <hr>
1669 <div class="refsect2" lang="en"><a name="id2804072"></a></div>
1670 </div>
1671 </div>
1672 </body>
1673 </html>
0 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>PolKitGnomeContext</title>
5 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
6 <link rel="start" href="index.html" title="PolicyKit-gnome Library Reference Manual">
7 <link rel="up" href="ref-core.html" title="API Reference">
8 <link rel="prev" href="ref-core.html" title="API Reference">
9 <link rel="next" href="PolKitGnomeAction.html" title="PolKitGnomeAction">
10 <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
11 <link rel="stylesheet" href="style.css" type="text/css">
12 <link rel="reference" href="ref-core.html" title="API Reference">
13 <link rel="reference" href="ref-auth-daemon.html" title="Authentication Agent">
14 <link rel="appendix" href="license.html" title="Appendix&#160;A.&#160;License">
15 </head>
16 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
17 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
18 <tr valign="middle">
19 <td><a accesskey="p" href="ref-core.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
20 <td><a accesskey="u" href="ref-core.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
22 <th width="100%" align="center">PolicyKit-gnome Library Reference Manual</th>
23 <td><a accesskey="n" href="PolKitGnomeAction.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
24 </tr>
25 <tr><td colspan="5" class="shortcuts"><nobr><a href="#id2770703" class="shortcut">Top</a>
26 &#160;|&#160;
27 <a href="#id2732387" class="shortcut">Description</a>
28 &#160;|&#160;
29 <a href="#id2732333" class="shortcut">Object Hierarchy</a>
30 &#160;|&#160;
31 <a href="#id2732357" class="shortcut">Signals</a></nobr></td></tr>
32 </table>
33 <div class="refentry" lang="en">
34 <a name="PolKitGnomeContext"></a><div class="titlepage"></div>
35 <div class="refnamediv"><table width="100%"><tr>
36 <td valign="top">
37 <h2>
38 <a name="id2770703"></a><span class="refentrytitle">PolKitGnomeContext</span>
39 </h2>
40 <p>PolKitGnomeContext &#8212; Convenience functions for using PolicyKit from GTK+ and GNOME applications.</p>
41 </td>
42 <td valign="top" align="right"></td>
43 </tr></table></div>
44 <div class="refsynopsisdiv">
45 <h2>Synopsis</h2>
46 <pre class="synopsis">
47
48
49
50 #define <a class="link" href="PolKitGnomeContext.html#POLKIT-GNOME-CONTEXT:CAPS">POLKIT_GNOME_CONTEXT</a> (obj)
51 #define <a class="link" href="PolKitGnomeContext.html#POLKIT-GNOME-CONTEXT-ERROR:CAPS">POLKIT_GNOME_CONTEXT_ERROR</a>
52 enum <a class="link" href="PolKitGnomeContext.html#PolKitGnomeContextError">PolKitGnomeContextError</a>;
53 <a class="link" href="PolKitGnomeContext.html#PolKitGnomeContextPrivate">PolKitGnomeContextPrivate</a>;
54 <a class="link" href="PolKitGnomeContext.html#PolKitGnomeContext-struct">PolKitGnomeContext</a>;
55 <a class="link" href="PolKitGnomeContext.html" title="PolKitGnomeContext">PolKitGnomeContext</a>* <a class="link" href="PolKitGnomeContext.html#polkit-gnome-context-get">polkit_gnome_context_get</a> (<a
56 href="../glib/glib-Error-Reporting.html#GError"
57 >GError</a> **error);
58 <a
59 href="../glib/glib-Quarks.html#GQuark"
60 >GQuark</a> <a class="link" href="PolKitGnomeContext.html#polkit-gnome-context-error-quark">polkit_gnome_context_error_quark</a> (void);
61
62 </pre>
63 </div>
64 <div class="refsect1" lang="en">
65 <a name="id2732333"></a><h2>Object Hierarchy</h2>
66 <pre class="synopsis">
67
68 <a
69 href="../gobject/gobject-The-Base-Object-Type.html#GObject"
70 >GObject</a>
71 +----PolKitGnomeContext
72 </pre>
73 </div>
74 <div class="refsect1" lang="en">
75 <a name="id2732357"></a><h2>Signals</h2>
76 <pre class="synopsis">
77
78 "<a class="link" href="PolKitGnomeContext.html#PolKitGnomeContext-config-changed">config-changed</a>" : Run Last
79 "<a class="link" href="PolKitGnomeContext.html#PolKitGnomeContext-console-kit-db-changed">console-kit-db-changed</a>" : Run Last
80 </pre>
81 </div>
82 <div class="refsect1" lang="en">
83 <a name="id2732387"></a><h2>Description</h2>
84 <p>
85 This class provides convenience functions for using PolicyKit from
86 GTK+ and GNOME applications including setting up main loop
87 integration and system bus connections. Rather than using
88 callbacks, GObject signals are provided when external factors
89 change (e.g. the PolicyKit.conf configuration file changes or
90 ConsoleKit reports activity changes).
91 </p>
92 <p>
93 Actual usage of PolicyKit is still through the main PolicyKit API
94 through the public pk_context and pk_tracker variables.
95 </p>
96 <p>
97 This class is implemented as a singleton meaning that several
98 callers will share the underlying <a
99 href="../polkit/polkit-polkit-context.html#PolKitContext"
100 ><span class="type">PolKitContext</span></a> and <a
101 href="../polkit/polkit-polkit-dbus.html#PolKitTracker"
102 ><span class="type">PolKitTracker</span></a>
103 objects. Do not use any of the life cycle methods of these objects;
104 only use them to gather information.</p>
105 <p>
106
107 </p>
108 </div>
109 <div class="refsect1" lang="en">
110 <a name="id2715040"></a><h2>Details</h2>
111 <div class="refsect2" lang="en">
112 <a name="id2715051"></a><h3>
113 <a name="POLKIT-GNOME-CONTEXT:CAPS"></a>POLKIT_GNOME_CONTEXT()</h3>
114 <a class="indexterm" name="id2715062"></a><pre class="programlisting">#define POLKIT_GNOME_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POLKIT_GNOME_TYPE_CONTEXT, PolKitGnomeContext))
115 </pre>
116 <p>
117
118 </p>
119 <div class="variablelist"><table border="0">
120 <col align="left" valign="top">
121 <tbody><tr>
122 <td><p><span class="term"><em class="parameter"><code>obj</code></em>&#160;:</span></p></td>
123 <td>
124
125
126 </td>
127 </tr></tbody>
128 </table></div>
129 </div>
130 <hr>
131 <div class="refsect2" lang="en">
132 <a name="id2715098"></a><h3>
133 <a name="POLKIT-GNOME-CONTEXT-ERROR:CAPS"></a>POLKIT_GNOME_CONTEXT_ERROR</h3>
134 <a class="indexterm" name="id2715110"></a><pre class="programlisting">#define POLKIT_GNOME_CONTEXT_ERROR polkit_gnome_context_error_quark ()
135 </pre>
136 <p>
137 Error domain for using the GNOME PolicyKit context. Errors in this
138 domain will be from the <a class="link" href="PolKitGnomeContext.html#PolKitGnomeContextError"><span class="type">PolKitGnomeContextError</span></a> enumeration. See
139 <a
140 href="../glib/glib-Error-Reporting.html#GError"
141 ><span class="type">GError</span></a> for information on error domains.</p>
142 <p>
143
144 </p>
145 </div>
146 <hr>
147 <div class="refsect2" lang="en">
148 <a name="id2715145"></a><h3>
149 <a name="PolKitGnomeContextError"></a>enum PolKitGnomeContextError</h3>
150 <a class="indexterm" name="id2715156"></a><pre class="programlisting">typedef enum
151 {
152 POLKIT_GNOME_CONTEXT_ERROR_FAILED
153 } PolKitGnomeContextError;
154 </pre>
155 <p>
156 Error codes describing how <a class="link" href="PolKitGnomeContext.html" title="PolKitGnomeContext"><span class="type">PolKitGnomeContext</span></a> can fail.</p>
157 <p>
158
159 </p>
160 <div class="variablelist"><table border="0">
161 <col align="left" valign="top">
162 <tbody><tr>
163 <td><p><span class="term"><a name="POLKIT-GNOME-CONTEXT-ERROR-FAILED:CAPS"></a><code class="literal">POLKIT_GNOME_CONTEXT_ERROR_FAILED</code></span></p></td>
164 <td> General error
165 </td>
166 </tr></tbody>
167 </table></div>
168 </div>
169 <hr>
170 <div class="refsect2" lang="en">
171 <a name="id2774248"></a><h3>
172 <a name="PolKitGnomeContextPrivate"></a>PolKitGnomeContextPrivate</h3>
173 <a class="indexterm" name="id2774259"></a><pre class="programlisting">typedef struct _PolKitGnomeContextPrivate PolKitGnomeContextPrivate;</pre>
174 <p>
175
176 </p>
177 </div>
178 <hr>
179 <div class="refsect2" lang="en">
180 <a name="id2774275"></a><h3>
181 <a name="PolKitGnomeContext-struct"></a>PolKitGnomeContext</h3>
182 <a class="indexterm" name="id2774287"></a><pre class="programlisting">typedef struct {
183 PolKitContext *pk_context;
184 PolKitTracker *pk_tracker;
185 } PolKitGnomeContext;
186 </pre>
187 <p>
188 Provide access to <a
189 href="../polkit/polkit-polkit-context.html#PolKitContext"
190 ><span class="type">PolKitContext</span></a> and <a
191 href="../polkit/polkit-polkit-dbus.html#PolKitTracker"
192 ><span class="type">PolKitTracker</span></a> instances
193 shared among many callers.</p>
194 <p>
195
196 </p>
197 <div class="variablelist"><table border="0">
198 <col align="left" valign="top">
199 <tbody>
200 <tr>
201 <td><p><span class="term"><a
202 href="../polkit/polkit-polkit-context.html#PolKitContext"
203 >PolKitContext</a>&#160;*<em class="structfield"><code>pk_context</code></em>;</span></p></td>
204 <td> for interfacing with PolicyKit; e.g. typically <a
205 href="../polkit/polkit-polkit-context.html#polkit-context-can-caller-do-action"
206 ><code class="function">polkit_context_can_caller_do_action()</code></a>
207 </td>
208 </tr>
209 <tr>
210 <td><p><span class="term"><a
211 href="../polkit/polkit-polkit-dbus.html#PolKitTracker"
212 >PolKitTracker</a>&#160;*<em class="structfield"><code>pk_tracker</code></em>;</span></p></td>
213 <td> this is used for effieciently obtaining <a
214 href="../polkit/polkit-polkit-caller.html#PolKitCaller"
215 ><span class="type">PolKitCaller</span></a> objects
216 </td>
217 </tr>
218 </tbody>
219 </table></div>
220 </div>
221 <hr>
222 <div class="refsect2" lang="en">
223 <a name="id2774387"></a><h3>
224 <a name="polkit-gnome-context-get"></a>polkit_gnome_context_get ()</h3>
225 <a class="indexterm" name="id2774398"></a><pre class="programlisting"><a class="link" href="PolKitGnomeContext.html" title="PolKitGnomeContext">PolKitGnomeContext</a>* polkit_gnome_context_get (<a
226 href="../glib/glib-Error-Reporting.html#GError"
227 >GError</a> **error);</pre>
228 <p>
229 Returns a <a class="link" href="PolKitGnomeContext.html" title="PolKitGnomeContext"><span class="type">PolKitGnomeContext</span></a> object. The context is a global
230 singleton that may be shared with other callers of this function.
231 </p>
232 <p>
233 This operation can fail if the system message bus is not available.
234 </p>
235 <p>
236 When done with using this object, call <a
237 href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"
238 ><code class="function">g_object_unref()</code></a>. This is
239 such that resources can be freed when all callers have unreffed it.</p>
240 <p>
241
242 </p>
243 <div class="variablelist"><table border="0">
244 <col align="left" valign="top">
245 <tbody>
246 <tr>
247 <td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
248 <td> return location for error
249 </td>
250 </tr>
251 <tr>
252 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
253 <td> a new <a class="link" href="PolKitGnomeContext.html" title="PolKitGnomeContext"><span class="type">PolKitGnomeContext</span></a> or NULL if error is set
254 </td>
255 </tr>
256 </tbody>
257 </table></div>
258 </div>
259 <hr>
260 <div class="refsect2" lang="en">
261 <a name="id2710862"></a><h3>
262 <a name="polkit-gnome-context-error-quark"></a>polkit_gnome_context_error_quark ()</h3>
263 <a class="indexterm" name="id2710874"></a><pre class="programlisting"><a
264 href="../glib/glib-Quarks.html#GQuark"
265 >GQuark</a> polkit_gnome_context_error_quark (void);</pre>
266 <p>
267
268 </p>
269 <div class="variablelist"><table border="0">
270 <col align="left" valign="top">
271 <tbody><tr>
272 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
273 <td>
274
275
276 </td>
277 </tr></tbody>
278 </table></div>
279 </div>
280 </div>
281 <div class="refsect1" lang="en">
282 <a name="id2710911"></a><h2>Signal Details</h2>
283 <div class="refsect2" lang="en">
284 <a name="id2710922"></a><h3>
285 <a name="PolKitGnomeContext-config-changed"></a>The <code class="literal">"config-changed"</code> signal</h3>
286 <a class="indexterm" name="id2710936"></a><pre class="programlisting">void user_function (<a class="link" href="PolKitGnomeContext.html" title="PolKitGnomeContext">PolKitGnomeContext</a> *context,
287 <a
288 href="../glib/glib-Basic-Types.html#gpointer"
289 >gpointer</a> user_data) : Run Last</pre>
290 <p>
291 The ::config-changed signal is emitted when PolicyKit
292 configuration (e.g. /etc/PolicyKit/PolicyKit.conf or
293 .policy files) changes content.
294 </p>
295 <p>
296 As this is one contributing factor to what answer PolicyKit
297 will return, the caller should act on this signal and query
298 PolicyKit for any actions it cares about.</p>
299 <p>
300
301 </p>
302 <div class="variablelist"><table border="0">
303 <col align="left" valign="top">
304 <tbody>
305 <tr>
306 <td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
307 <td> the object
308 </td>
309 </tr>
310 <tr>
311 <td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
312 <td>user data set when the signal handler was connected.</td>
313 </tr>
314 </tbody>
315 </table></div>
316 </div>
317 <hr>
318 <div class="refsect2" lang="en">
319 <a name="id2711016"></a><h3>
320 <a name="PolKitGnomeContext-console-kit-db-changed"></a>The <code class="literal">"console-kit-db-changed"</code> signal</h3>
321 <a class="indexterm" name="id2711032"></a><pre class="programlisting">void user_function (<a class="link" href="PolKitGnomeContext.html" title="PolKitGnomeContext">PolKitGnomeContext</a> *context,
322 <a
323 href="../glib/glib-Basic-Types.html#gpointer"
324 >gpointer</a> user_data) : Run Last</pre>
325 <p>
326 The ::console-kit-db-changed signal is emitted when
327 ConsoleKit configuration changes; e.g. when a session
328 becomes active or inactive.
329 </p>
330 <p>
331 As this is one contributing factor to what answer PolicyKit
332 will return, the caller should act on this signal and query
333 PolicyKit for any actions it cares about.</p>
334 <p>
335
336 </p>
337 <div class="variablelist"><table border="0">
338 <col align="left" valign="top">
339 <tbody>
340 <tr>
341 <td><p><span class="term"><em class="parameter"><code>context</code></em>&#160;:</span></p></td>
342 <td> the object
343 </td>
344 </tr>
345 <tr>
346 <td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
347 <td>user data set when the signal handler was connected.</td>
348 </tr>
349 </tbody>
350 </table></div>
351 </div>
352 </div>
353 <div class="refsect1" lang="en">
354 <a name="id2711114"></a><div class="refsect2" lang="en"><a name="id2711115"></a></div>
355 <hr>
356 <div class="refsect2" lang="en"><a name="id2711116"></a></div>
357 </div>
358 </div>
359 </body>
360 </html>
0 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>PolKitGnomeToggleAction</title>
5 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
6 <link rel="start" href="index.html" title="PolicyKit-gnome Library Reference Manual">
7 <link rel="up" href="ref-core.html" title="API Reference">
8 <link rel="prev" href="PolKitGnomeAction.html" title="PolKitGnomeAction">
9 <link rel="next" href="polkit-gnome-polkit-gnome-auth.html" title="Authentication Dialogs">
10 <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
11 <link rel="stylesheet" href="style.css" type="text/css">
12 <link rel="reference" href="ref-core.html" title="API Reference">
13 <link rel="reference" href="ref-auth-daemon.html" title="Authentication Agent">
14 <link rel="appendix" href="license.html" title="Appendix&#160;A.&#160;License">
15 </head>
16 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
17 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
18 <tr valign="middle">
19 <td><a accesskey="p" href="PolKitGnomeAction.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
20 <td><a accesskey="u" href="ref-core.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
22 <th width="100%" align="center">PolicyKit-gnome Library Reference Manual</th>
23 <td><a accesskey="n" href="polkit-gnome-polkit-gnome-auth.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
24 </tr>
25 <tr><td colspan="5" class="shortcuts"><nobr><a href="#id2783174" class="shortcut">Top</a>
26 &#160;|&#160;
27 <a href="#id2774593" class="shortcut">Description</a>
28 &#160;|&#160;
29 <a href="#id2765605" class="shortcut">Object Hierarchy</a>
30 &#160;|&#160;
31 <a href="#id2765642" class="shortcut">Implemented Interfaces</a>
32 &#160;|&#160;
33 <a href="#id2765663" class="shortcut">Properties</a>
34 &#160;|&#160;
35 <a href="#id2774567" class="shortcut">Signals</a></nobr></td></tr>
36 </table>
37 <div class="refentry" lang="en">
38 <a name="PolKitGnomeToggleAction"></a><div class="titlepage"></div>
39 <div class="refnamediv"><table width="100%"><tr>
40 <td valign="top">
41 <h2>
42 <a name="id2783174"></a><span class="refentrytitle">PolKitGnomeToggleAction</span>
43 </h2>
44 <p>PolKitGnomeToggleAction &#8212; A GtkAction that can be toggled to
45 obtain and give up PolicyKit authorizations.</p>
46 </td>
47 <td valign="top" align="right"></td>
48 </tr></table></div>
49 <div class="refsynopsisdiv">
50 <h2>Synopsis</h2>
51 <pre class="synopsis">
52
53
54
55 <a class="link" href="PolKitGnomeToggleAction.html#PolKitGnomeToggleActionPrivate">PolKitGnomeToggleActionPrivate</a>;
56 <a class="link" href="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction-struct">PolKitGnomeToggleAction</a>;
57 <a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">PolKitGnomeToggleAction</a>* <a class="link" href="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-new">polkit_gnome_toggle_action_new</a> (const <a
58 href="../glib/glib-Basic-Types.html#gchar"
59 >gchar</a> *name);
60 <a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">PolKitGnomeToggleAction</a>* <a class="link" href="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-new-default">polkit_gnome_toggle_action_new_default</a>
61 (const <a
62 href="../glib/glib-Basic-Types.html#gchar"
63 >gchar</a> *name,
64 <a
65 href="../polkit/polkit-polkit-action.html#PolKitAction"
66 >PolKitAction</a> *polkit_action,
67 const <a
68 href="../glib/glib-Basic-Types.html#gchar"
69 >gchar</a> *locked_label,
70 const <a
71 href="../glib/glib-Basic-Types.html#gchar"
72 >gchar</a> *unlocked_label);
73 GtkWidget* <a class="link" href="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-create-toggle-button">polkit_gnome_toggle_action_create_toggle_button</a>
74 (<a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">PolKitGnomeToggleAction</a> *action);
75
76 </pre>
77 </div>
78 <div class="refsect1" lang="en">
79 <a name="id2765605"></a><h2>Object Hierarchy</h2>
80 <pre class="synopsis">
81
82 <a
83 href="../gobject/gobject-The-Base-Object-Type.html#GObject"
84 >GObject</a>
85 +----GtkAction
86 +----<a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction">PolKitGnomeAction</a>
87 +----PolKitGnomeToggleAction
88 </pre>
89 </div>
90 <div class="refsect1" lang="en">
91 <a name="id2765642"></a><h2>Implemented Interfaces</h2>
92 <p>
93 PolKitGnomeToggleAction implements
94 GtkBuildable.</p>
95 </div>
96 <div class="refsect1" lang="en">
97 <a name="id2765663"></a><h2>Properties</h2>
98 <pre class="synopsis">
99
100 "<a class="link" href="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-icon-name">auth-underway-icon-name</a>" <a
101 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
102 >gchararray</a> : Read / Write
103 "<a class="link" href="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-label">auth-underway-label</a>" <a
104 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
105 >gchararray</a> : Read / Write
106 "<a class="link" href="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-sensitive">auth-underway-sensitive</a>" <a
107 href="../glib/glib-Basic-Types.html#gboolean"
108 >gboolean</a> : Read / Write
109 "<a class="link" href="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-short-label">auth-underway-short-label</a>" <a
110 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
111 >gchararray</a> : Read / Write
112 "<a class="link" href="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-tooltip">auth-underway-tooltip</a>" <a
113 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
114 >gchararray</a> : Read / Write
115 "<a class="link" href="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-visible">auth-underway-visible</a>" <a
116 href="../glib/glib-Basic-Types.html#gboolean"
117 >gboolean</a> : Read / Write
118 </pre>
119 </div>
120 <div class="refsect1" lang="en">
121 <a name="id2774567"></a><h2>Signals</h2>
122 <pre class="synopsis">
123
124 "<a class="link" href="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction-toggled">toggled</a>" : Run Last
125 </pre>
126 </div>
127 <div class="refsect1" lang="en">
128 <a name="id2774593"></a><h2>Description</h2>
129 <p>
130 For an example of how to use this class, see the documentation for
131 <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a>.</p>
132 <p>
133
134 </p>
135 </div>
136 <div class="refsect1" lang="en">
137 <a name="id2774620"></a><h2>Details</h2>
138 <div class="refsect2" lang="en">
139 <a name="id2774631"></a><h3>
140 <a name="PolKitGnomeToggleActionPrivate"></a>PolKitGnomeToggleActionPrivate</h3>
141 <a class="indexterm" name="id2774644"></a><pre class="programlisting">typedef struct _PolKitGnomeToggleActionPrivate PolKitGnomeToggleActionPrivate;</pre>
142 <p>
143
144 </p>
145 </div>
146 <hr>
147 <div class="refsect2" lang="en">
148 <a name="id2761749"></a><h3>
149 <a name="PolKitGnomeToggleAction-struct"></a>PolKitGnomeToggleAction</h3>
150 <a class="indexterm" name="id2761762"></a><pre class="programlisting">typedef struct _PolKitGnomeToggleAction PolKitGnomeToggleAction;</pre>
151 <p>
152 The PolKitGnomeToggleAction struct contains only private data members and should not be accessed directly.</p>
153 <p>
154
155 </p>
156 </div>
157 <hr>
158 <div class="refsect2" lang="en">
159 <a name="id2761784"></a><h3>
160 <a name="polkit-gnome-toggle-action-new"></a>polkit_gnome_toggle_action_new ()</h3>
161 <a class="indexterm" name="id2761796"></a><pre class="programlisting"><a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">PolKitGnomeToggleAction</a>* polkit_gnome_toggle_action_new (const <a
162 href="../glib/glib-Basic-Types.html#gchar"
163 >gchar</a> *name);</pre>
164 <p>
165 Creates a new <a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction"><span class="type">PolKitGnomeToggleAction</span></a> object. The typical use for
166 this function is for specialized use where
167 <a class="link" href="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-new-default"><code class="function">polkit_gnome_toggle_action_new_default()</code></a> does not meet the needs of
168 the application.
169 </p>
170 <p>
171 If the 'polkit-toggle_action' property is <a
172 href="../glib/glib-Standard-Macros.html#NULL:CAPS"
173 ><span class="type">NULL</span></a> the behavior is similar to
174 as if a <a
175 href="../polkit/polkit-polkit-action.html#PolKitAction"
176 ><span class="type">PolKitAction</span></a> returned <a
177 href="../polkit/polkit-polkit-result.html#POLKIT-RESULT-YES:CAPS"
178 ><span class="type">POLKIT_RESULT_YES</span></a>.</p>
179 <p>
180
181 </p>
182 <div class="variablelist"><table border="0">
183 <col align="left" valign="top">
184 <tbody>
185 <tr>
186 <td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
187 <td> A unique name for the toggle_action
188 </td>
189 </tr>
190 <tr>
191 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
192 <td> a new <a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction"><span class="type">PolKitGnomeToggleAction</span></a> or <a
193 href="../glib/glib-Standard-Macros.html#NULL:CAPS"
194 ><span class="type">NULL</span></a> if error is set
195 </td>
196 </tr>
197 </tbody>
198 </table></div>
199 </div>
200 <hr>
201 <div class="refsect2" lang="en">
202 <a name="id2761914"></a><h3>
203 <a name="polkit-gnome-toggle-action-new-default"></a>polkit_gnome_toggle_action_new_default ()</h3>
204 <a class="indexterm" name="id2761928"></a><pre class="programlisting"><a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">PolKitGnomeToggleAction</a>* polkit_gnome_toggle_action_new_default
205 (const <a
206 href="../glib/glib-Basic-Types.html#gchar"
207 >gchar</a> *name,
208 <a
209 href="../polkit/polkit-polkit-action.html#PolKitAction"
210 >PolKitAction</a> *polkit_action,
211 const <a
212 href="../glib/glib-Basic-Types.html#gchar"
213 >gchar</a> *locked_label,
214 const <a
215 href="../glib/glib-Basic-Types.html#gchar"
216 >gchar</a> *unlocked_label);</pre>
217 <p>
218 Creates a new <a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction"><span class="type">PolKitGnomeToggleAction</span></a> object with the default
219 behavior for a given <a
220 href="../polkit/polkit-polkit-action.html#PolKitAction"
221 ><span class="type">PolKitAction</span></a> object. The toggle represents
222 whether the user is authorized for the given <a
223 href="../polkit/polkit-polkit-action.html#PolKitAction"
224 ><span class="type">PolKitAction</span></a>. If the
225 user is not authorized, clicking on a proxy widget (if it's
226 sensitive) will cause an authentication dialog to appear. If the
227 user is authorized, clicking on a proxy widget will cause all
228 authorizations to be given up (aka revoked). The ::toggled signal
229 is only emitted when such transitions occur. Thus, the user of this
230 class will never have to deal with bringing up authentication
231 dialogs; it's all handled behind the scenes.
232 </p>
233 <p>
234 As such, the typical use case for this action is an UI where the
235 user is encouraged to give up authorizations.
236 </p>
237 <p>
238 There's also support for the corner case where the user is
239 authorized because of implicit authorizations. In this case,
240 toggling the action will "grant" a negative authorization for the
241 user. By toggling the action again, the negative authorization will
242 be revoked.
243 </p>
244 <p>
245 Default behavior is defined as having the icon_name be 'stock_lock'
246 by default except for the YES PolicyKit answer where it's set to
247 'stock_lock-open'. No tooltips are set. The label and short-label
248 will be 'locked_label' everywhere except in the YES state where
249 it's set to 'unlocked-label'. When authentication is underway, the
250 label will be "Authenticating..." and icon_name is untouched. If
251 the PolicyKit answer is NO, sensitivity is set to
252 <a
253 href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
254 ><span class="type">FALSE</span></a>. Visibility is always set to <a
255 href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
256 ><span class="type">TRUE</span></a>.
257 </p>
258 <p>
259 The caller can always modify individual aspects of the
260 toggle_action after creation, e.g. change the tooltip for the no,
261 auth and yes states; see the parent class <a class="link" href="PolKitGnomeAction.html" title="PolKitGnomeAction"><span class="type">PolKitGnomeAction</span></a>. In
262 addition to the properties in the parent class, this subclass
263 sports six new properties, "auth-underway-*" to control the look
264 of proxy widgets when authentication is underway.
265 </p>
266 <p>
267 If the given polkit_toggle_action is <a
268 href="../glib/glib-Standard-Macros.html#NULL:CAPS"
269 ><span class="type">NULL</span></a> the behavior is similar to as
270 if a <a
271 href="../polkit/polkit-polkit-action.html#PolKitAction"
272 ><span class="type">PolKitAction</span></a> returned <a
273 href="../polkit/polkit-polkit-result.html#POLKIT-RESULT-YES:CAPS"
274 ><span class="type">POLKIT_RESULT_YES</span></a>.</p>
275 <p>
276
277 </p>
278 <div class="variablelist"><table border="0">
279 <col align="left" valign="top">
280 <tbody>
281 <tr>
282 <td><p><span class="term"><em class="parameter"><code>name</code></em>&#160;:</span></p></td>
283 <td> A unique name for the toggle_action
284 </td>
285 </tr>
286 <tr>
287 <td><p><span class="term"><em class="parameter"><code>polkit_action</code></em>&#160;:</span></p></td>
288 <td> the <a
289 href="../polkit/polkit-polkit-action.html#PolKitAction"
290 ><span class="type">PolKitAction</span></a> to track
291 </td>
292 </tr>
293 <tr>
294 <td><p><span class="term"><em class="parameter"><code>locked_label</code></em>&#160;:</span></p></td>
295 <td> The label to show when the user do not possess the
296 authorization, e.g. "Click to make changes"
297 </td>
298 </tr>
299 <tr>
300 <td><p><span class="term"><em class="parameter"><code>unlocked_label</code></em>&#160;:</span></p></td>
301 <td> The label to show when the user does posses the
302 authorization; e.g. "Click to prevent changes"
303 </td>
304 </tr>
305 <tr>
306 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
307 <td> a new <a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction"><span class="type">PolKitGnomeToggleAction</span></a> or <a
308 href="../glib/glib-Standard-Macros.html#NULL:CAPS"
309 ><span class="type">NULL</span></a> if error is set
310 </td>
311 </tr>
312 </tbody>
313 </table></div>
314 </div>
315 <hr>
316 <div class="refsect2" lang="en">
317 <a name="id2772583"></a><h3>
318 <a name="polkit-gnome-toggle-action-create-toggle-button"></a>polkit_gnome_toggle_action_create_toggle_button ()</h3>
319 <a class="indexterm" name="id2772597"></a><pre class="programlisting">GtkWidget* polkit_gnome_toggle_action_create_toggle_button
320 (<a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">PolKitGnomeToggleAction</a> *action);</pre>
321 <p>
322 Create a toggle button for the given action that displays the
323 label, tooltip and icon_name corresponding to whether the state,
324 according to PolicyKit, is no, auth or yes.</p>
325 <p>
326
327 </p>
328 <div class="variablelist"><table border="0">
329 <col align="left" valign="top">
330 <tbody>
331 <tr>
332 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
333 <td> The <a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction"><span class="type">PolKitGnomeToggleAction</span></a> object
334 </td>
335 </tr>
336 <tr>
337 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
338 <td> A <span class="type">GtkToggleButton</span> instance connected to the action
339 </td>
340 </tr>
341 </tbody>
342 </table></div>
343 </div>
344 </div>
345 <div class="refsect1" lang="en">
346 <a name="id2799414"></a><h2>Property Details</h2>
347 <div class="refsect2" lang="en">
348 <a name="id2799424"></a><h3>
349 <a name="PolKitGnomeToggleAction--auth-underway-icon-name"></a>The <code class="literal">"auth-underway-icon-name"</code> property</h3>
350 <a class="indexterm" name="id2799440"></a><pre class="programlisting"> "auth-underway-icon-name" <a
351 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
352 >gchararray</a> : Read / Write</pre>
353 <p>When authentication is underway, use this icon-name.</p>
354 <p>Default value: NULL</p>
355 </div>
356 <hr>
357 <div class="refsect2" lang="en">
358 <a name="id2799467"></a><h3>
359 <a name="PolKitGnomeToggleAction--auth-underway-label"></a>The <code class="literal">"auth-underway-label"</code> property</h3>
360 <a class="indexterm" name="id2799482"></a><pre class="programlisting"> "auth-underway-label" <a
361 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
362 >gchararray</a> : Read / Write</pre>
363 <p>When authentication is underway, use this label.</p>
364 <p>Default value: NULL</p>
365 </div>
366 <hr>
367 <div class="refsect2" lang="en">
368 <a name="id2799509"></a><h3>
369 <a name="PolKitGnomeToggleAction--auth-underway-sensitive"></a>The <code class="literal">"auth-underway-sensitive"</code> property</h3>
370 <a class="indexterm" name="id2799525"></a><pre class="programlisting"> "auth-underway-sensitive" <a
371 href="../glib/glib-Basic-Types.html#gboolean"
372 >gboolean</a> : Read / Write</pre>
373 <p>When authentication is underway, whether the action will be sensitive.</p>
374 <p>Default value: TRUE</p>
375 </div>
376 <hr>
377 <div class="refsect2" lang="en">
378 <a name="id2799553"></a><h3>
379 <a name="PolKitGnomeToggleAction--auth-underway-short-label"></a>The <code class="literal">"auth-underway-short-label"</code> property</h3>
380 <a class="indexterm" name="id2799568"></a><pre class="programlisting"> "auth-underway-short-label" <a
381 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
382 >gchararray</a> : Read / Write</pre>
383 <p>When authentication is underway, use this short-label.</p>
384 <p>Default value: NULL</p>
385 </div>
386 <hr>
387 <div class="refsect2" lang="en">
388 <a name="id2799595"></a><h3>
389 <a name="PolKitGnomeToggleAction--auth-underway-tooltip"></a>The <code class="literal">"auth-underway-tooltip"</code> property</h3>
390 <a class="indexterm" name="id2799611"></a><pre class="programlisting"> "auth-underway-tooltip" <a
391 href="../gobject/gobject-Standard-Parameter-and-Value-Types.html#gchararray"
392 >gchararray</a> : Read / Write</pre>
393 <p>When authentication is underway, use this tooltip.</p>
394 <p>Default value: NULL</p>
395 </div>
396 <hr>
397 <div class="refsect2" lang="en">
398 <a name="id2799638"></a><h3>
399 <a name="PolKitGnomeToggleAction--auth-underway-visible"></a>The <code class="literal">"auth-underway-visible"</code> property</h3>
400 <a class="indexterm" name="id2799653"></a><pre class="programlisting"> "auth-underway-visible" <a
401 href="../glib/glib-Basic-Types.html#gboolean"
402 >gboolean</a> : Read / Write</pre>
403 <p>When authentication is underway, whether the action will be visible.</p>
404 <p>Default value: TRUE</p>
405 </div>
406 </div>
407 <div class="refsect1" lang="en">
408 <a name="id2799682"></a><h2>Signal Details</h2>
409 <div class="refsect2" lang="en">
410 <a name="id2799693"></a><h3>
411 <a name="PolKitGnomeToggleAction-toggled"></a>The <code class="literal">"toggled"</code> signal</h3>
412 <a class="indexterm" name="id2799709"></a><pre class="programlisting">void user_function (<a class="link" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">PolKitGnomeToggleAction</a> *toggle_action,
413 <a
414 href="../glib/glib-Basic-Types.html#gpointer"
415 >gpointer</a> user_data) : Run Last</pre>
416 <p>
417 The ::toggled signal is emitted when the button is toggled.</p>
418 <p>
419
420 </p>
421 <div class="variablelist"><table border="0">
422 <col align="left" valign="top">
423 <tbody>
424 <tr>
425 <td><p><span class="term"><em class="parameter"><code>toggle_action</code></em>&#160;:</span></p></td>
426 <td> the object
427 </td>
428 </tr>
429 <tr>
430 <td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
431 <td>user data set when the signal handler was connected.</td>
432 </tr>
433 </tbody>
434 </table></div>
435 </div>
436 </div>
437 <div class="refsect1" lang="en">
438 <a name="id2799784"></a><div class="refsect2" lang="en"><a name="id2799785"></a></div>
439 <hr>
440 <div class="refsect2" lang="en"><a name="id2799786"></a></div>
441 </div>
442 </div>
443 </body>
444 </html>
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>PolicyKit-gnome Library Reference Manual</title>
5 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
6 <link rel="start" href="index.html" title="PolicyKit-gnome Library Reference Manual">
7 <link rel="next" href="ref-core.html" title="API Reference">
8 <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
9 <link rel="stylesheet" href="style.css" type="text/css">
10 <link rel="reference" href="ref-core.html" title="API Reference">
11 <link rel="reference" href="ref-auth-daemon.html" title="Authentication Agent">
12 <link rel="appendix" href="license.html" title="Appendix&#160;A.&#160;License">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en">
15 <div class="titlepage">
16 <div>
17 <div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">PolicyKit-gnome Library Reference Manual</p></th></tr></table></div>
18 <div><div class="authorgroup"><div class="author">
19 <h3 class="author">
20 <span class="firstname">David</span> <span class="surname">Zeuthen</span>
21 </h3>
22 <div class="affiliation"><div class="address"><p><br>
23 &#160;&#160;&#160;&#160;<code class="email">&lt;<a class="email" href="mailto:david@fubar.dk">david@fubar.dk</a>&gt;</code><br>
24 &#160;&#160;</p></div></div>
25 </div></div></div>
26 <div><p class="releaseinfo">Version 0.7
27 </p></div>
28 <div><p class="copyright">Copyright &#169; 2007 The PolicyKit-gnome Authors</p></div>
29 <div><div class="legalnotice">
30 <a name="id2715731"></a><p>
31 Permission is granted to copy, distribute and/or modify this
32 document under the terms of the <em class="citetitle">GNU Free
33 Documentation License</em>, Version 1.1 or any later
34 version published by the Free Software Foundation with no
35 Invariant Sections, no Front-Cover Texts, and no Back-Cover
36 Texts. You may obtain a copy of the <em class="citetitle">GNU Free
37 Documentation License</em> from the Free Software
38 Foundation by visiting <a class="ulink" href="http://www.fsf.org" target="_top">their Web site</a> or by writing
39 to:
40
41 </p>
42 <div class="address"><p><br>
43 &#160;&#160;The&#160;Free&#160;Software&#160;Foundation,&#160;Inc.,<br>
44 &#160;&#160;<span class="street">59&#160;Temple&#160;Place</span>&#160;-&#160;Suite&#160;330,<br>
45 &#160;&#160;<span class="city">Boston</span>,&#160;<span class="state">MA</span>&#160;<span class="postcode">02111-1307</span>,<br>
46 &#160;&#160;<span class="country">USA</span><br>
47 </p></div>
48 <p>
49 </p>
50 <p>
51 Many of the names used by companies to distinguish their
52 products and services are claimed as trademarks. Where those
53 names appear in any GNOME documentation, and those trademarks
54 are made aware to the members of the GNOME Documentation
55 Project, the names have been printed in caps or initial caps.
56 </p>
57 </div></div>
58 </div>
59 <hr>
60 </div>
61 <div class="toc"><dl>
62 <dt><span class="reference"><a href="ref-core.html">I. API Reference</a></span></dt>
63 <dd><dl>
64 <dt>
65 <span class="refentrytitle"><a href="PolKitGnomeContext.html">PolKitGnomeContext</a></span><span class="refpurpose"> &#8212; Convenience functions for using PolicyKit from GTK+ and GNOME applications.</span>
66 </dt>
67 <dt>
68 <span class="refentrytitle"><a href="PolKitGnomeAction.html">PolKitGnomeAction</a></span><span class="refpurpose"> &#8212; A GtkAction subclass where instances can be tied to a specific PolicyKit action.</span>
69 </dt>
70 <dt>
71 <span class="refentrytitle"><a href="PolKitGnomeToggleAction.html">PolKitGnomeToggleAction</a></span><span class="refpurpose"> &#8212; A GtkAction that can be toggled to
72 obtain and give up PolicyKit authorizations.</span>
73 </dt>
74 <dt>
75 <span class="refentrytitle"><a href="polkit-gnome-polkit-gnome-auth.html">Authentication Dialogs</a></span><span class="refpurpose"> &#8212; Show authentication dialogs to gain privileges</span>
76 </dt>
77 </dl></dd>
78 <dt><span class="reference"><a href="ref-auth-daemon.html">II. Authentication Agent</a></span></dt>
79 <dt><span class="appendix"><a href="license.html">A. License</a></span></dt>
80 </dl></div>
81 </div></body>
82 </html>
0 <ANCHOR id="PolKitGnomeContext" href="polkit-gnome/PolKitGnomeContext.html">
1 <ANCHOR id="POLKIT-GNOME-CONTEXT:CAPS" href="polkit-gnome/PolKitGnomeContext.html#POLKIT-GNOME-CONTEXT:CAPS">
2 <ANCHOR id="POLKIT-GNOME-CONTEXT-ERROR:CAPS" href="polkit-gnome/PolKitGnomeContext.html#POLKIT-GNOME-CONTEXT-ERROR:CAPS">
3 <ANCHOR id="PolKitGnomeContextError" href="polkit-gnome/PolKitGnomeContext.html#PolKitGnomeContextError">
4 <ANCHOR id="POLKIT-GNOME-CONTEXT-ERROR-FAILED:CAPS" href="polkit-gnome/PolKitGnomeContext.html#POLKIT-GNOME-CONTEXT-ERROR-FAILED:CAPS">
5 <ANCHOR id="PolKitGnomeContextPrivate" href="polkit-gnome/PolKitGnomeContext.html#PolKitGnomeContextPrivate">
6 <ANCHOR id="PolKitGnomeContext-struct" href="polkit-gnome/PolKitGnomeContext.html#PolKitGnomeContext-struct">
7 <ANCHOR id="polkit-gnome-context-get" href="polkit-gnome/PolKitGnomeContext.html#polkit-gnome-context-get">
8 <ANCHOR id="polkit-gnome-context-error-quark" href="polkit-gnome/PolKitGnomeContext.html#polkit-gnome-context-error-quark">
9 <ANCHOR id="PolKitGnomeContext-config-changed" href="polkit-gnome/PolKitGnomeContext.html#PolKitGnomeContext-config-changed">
10 <ANCHOR id="PolKitGnomeContext-console-kit-db-changed" href="polkit-gnome/PolKitGnomeContext.html#PolKitGnomeContext-console-kit-db-changed">
11 <ANCHOR id="PolKitGnomeAction" href="polkit-gnome/PolKitGnomeAction.html">
12 <ANCHOR id="PolKitGnomeActionPrivate" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeActionPrivate">
13 <ANCHOR id="PolKitGnomeAction-struct" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction-struct">
14 <ANCHOR id="polkit-gnome-action-new" href="polkit-gnome/PolKitGnomeAction.html#polkit-gnome-action-new">
15 <ANCHOR id="polkit-gnome-action-new-default" href="polkit-gnome/PolKitGnomeAction.html#polkit-gnome-action-new-default">
16 <ANCHOR id="polkit-gnome-action-get-polkit-result" href="polkit-gnome/PolKitGnomeAction.html#polkit-gnome-action-get-polkit-result">
17 <ANCHOR id="polkit-gnome-action-get-sensitive" href="polkit-gnome/PolKitGnomeAction.html#polkit-gnome-action-get-sensitive">
18 <ANCHOR id="polkit-gnome-action-set-sensitive" href="polkit-gnome/PolKitGnomeAction.html#polkit-gnome-action-set-sensitive">
19 <ANCHOR id="polkit-gnome-action-get-visible" href="polkit-gnome/PolKitGnomeAction.html#polkit-gnome-action-get-visible">
20 <ANCHOR id="polkit-gnome-action-set-visible" href="polkit-gnome/PolKitGnomeAction.html#polkit-gnome-action-set-visible">
21 <ANCHOR id="polkit-gnome-action-create-button" href="polkit-gnome/PolKitGnomeAction.html#polkit-gnome-action-create-button">
22 <ANCHOR id="PolKitGnomeAction--auth-icon-name" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--auth-icon-name">
23 <ANCHOR id="PolKitGnomeAction--auth-label" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--auth-label">
24 <ANCHOR id="PolKitGnomeAction--auth-sensitive" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--auth-sensitive">
25 <ANCHOR id="PolKitGnomeAction--auth-short-label" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--auth-short-label">
26 <ANCHOR id="PolKitGnomeAction--auth-tooltip" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--auth-tooltip">
27 <ANCHOR id="PolKitGnomeAction--auth-visible" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--auth-visible">
28 <ANCHOR id="PolKitGnomeAction--master-sensitive" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--master-sensitive">
29 <ANCHOR id="PolKitGnomeAction--master-visible" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--master-visible">
30 <ANCHOR id="PolKitGnomeAction--no-icon-name" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--no-icon-name">
31 <ANCHOR id="PolKitGnomeAction--no-label" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--no-label">
32 <ANCHOR id="PolKitGnomeAction--no-sensitive" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--no-sensitive">
33 <ANCHOR id="PolKitGnomeAction--no-short-label" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--no-short-label">
34 <ANCHOR id="PolKitGnomeAction--no-tooltip" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--no-tooltip">
35 <ANCHOR id="PolKitGnomeAction--no-visible" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--no-visible">
36 <ANCHOR id="PolKitGnomeAction--polkit-action" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--polkit-action">
37 <ANCHOR id="PolKitGnomeAction--polkit-action-sufficient" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--polkit-action-sufficient">
38 <ANCHOR id="PolKitGnomeAction--self-blocked-icon-name" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-icon-name">
39 <ANCHOR id="PolKitGnomeAction--self-blocked-label" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-label">
40 <ANCHOR id="PolKitGnomeAction--self-blocked-sensitive" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-sensitive">
41 <ANCHOR id="PolKitGnomeAction--self-blocked-short-label" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-short-label">
42 <ANCHOR id="PolKitGnomeAction--self-blocked-tooltip" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-tooltip">
43 <ANCHOR id="PolKitGnomeAction--self-blocked-visible" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-visible">
44 <ANCHOR id="PolKitGnomeAction--target-pid" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--target-pid">
45 <ANCHOR id="PolKitGnomeAction--yes-icon-name" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--yes-icon-name">
46 <ANCHOR id="PolKitGnomeAction--yes-label" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--yes-label">
47 <ANCHOR id="PolKitGnomeAction--yes-sensitive" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--yes-sensitive">
48 <ANCHOR id="PolKitGnomeAction--yes-short-label" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--yes-short-label">
49 <ANCHOR id="PolKitGnomeAction--yes-tooltip" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--yes-tooltip">
50 <ANCHOR id="PolKitGnomeAction--yes-visible" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction--yes-visible">
51 <ANCHOR id="PolKitGnomeAction-auth-end" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction-auth-end">
52 <ANCHOR id="PolKitGnomeAction-auth-start" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction-auth-start">
53 <ANCHOR id="PolKitGnomeAction-polkit-result-changed" href="polkit-gnome/PolKitGnomeAction.html#PolKitGnomeAction-polkit-result-changed">
54 <ANCHOR id="PolKitGnomeToggleAction" href="polkit-gnome/PolKitGnomeToggleAction.html">
55 <ANCHOR id="PolKitGnomeToggleActionPrivate" href="polkit-gnome/PolKitGnomeToggleAction.html#PolKitGnomeToggleActionPrivate">
56 <ANCHOR id="PolKitGnomeToggleAction-struct" href="polkit-gnome/PolKitGnomeToggleAction.html#PolKitGnomeToggleAction-struct">
57 <ANCHOR id="polkit-gnome-toggle-action-new" href="polkit-gnome/PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-new">
58 <ANCHOR id="polkit-gnome-toggle-action-new-default" href="polkit-gnome/PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-new-default">
59 <ANCHOR id="polkit-gnome-toggle-action-create-toggle-button" href="polkit-gnome/PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-create-toggle-button">
60 <ANCHOR id="PolKitGnomeToggleAction--auth-underway-icon-name" href="polkit-gnome/PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-icon-name">
61 <ANCHOR id="PolKitGnomeToggleAction--auth-underway-label" href="polkit-gnome/PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-label">
62 <ANCHOR id="PolKitGnomeToggleAction--auth-underway-sensitive" href="polkit-gnome/PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-sensitive">
63 <ANCHOR id="PolKitGnomeToggleAction--auth-underway-short-label" href="polkit-gnome/PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-short-label">
64 <ANCHOR id="PolKitGnomeToggleAction--auth-underway-tooltip" href="polkit-gnome/PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-tooltip">
65 <ANCHOR id="PolKitGnomeToggleAction--auth-underway-visible" href="polkit-gnome/PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-visible">
66 <ANCHOR id="PolKitGnomeToggleAction-toggled" href="polkit-gnome/PolKitGnomeToggleAction.html#PolKitGnomeToggleAction-toggled">
67 <ANCHOR id="polkit-gnome-polkit-gnome-auth" href="polkit-gnome/polkit-gnome-polkit-gnome-auth.html">
68 <ANCHOR id="PolKitGnomeAuthCB" href="polkit-gnome/polkit-gnome-polkit-gnome-auth.html#PolKitGnomeAuthCB">
69 <ANCHOR id="polkit-gnome-auth-obtain" href="polkit-gnome/polkit-gnome-polkit-gnome-auth.html#polkit-gnome-auth-obtain">
Binary diff not shown
0 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Appendix&#160;A.&#160;License</title>
5 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
6 <link rel="start" href="index.html" title="PolicyKit-gnome Library Reference Manual">
7 <link rel="up" href="index.html" title="PolicyKit-gnome Library Reference Manual">
8 <link rel="prev" href="ref-auth-daemon.html" title="Authentication Agent">
9 <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
10 <link rel="stylesheet" href="style.css" type="text/css">
11 <link rel="reference" href="ref-core.html" title="API Reference">
12 <link rel="reference" href="ref-auth-daemon.html" title="Authentication Agent">
13 <link rel="appendix" href="license.html" title="Appendix&#160;A.&#160;License">
14 </head>
15 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
16 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
17 <td><a accesskey="p" href="ref-auth-daemon.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td>&#160;</td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">PolicyKit-gnome Library Reference Manual</th>
21 <td>&#160;</td>
22 </tr></table>
23 <div class="appendix" lang="en">
24 <div class="titlepage"><div><div><h2 class="title">
25 <a name="license"></a>Appendix&#160;A.&#160;License</h2></div></div></div>
26 <p>
27 The polkit-gnome library (polkit-gnome/*) is licensed to you
28 under the GNU Lesser General Public License version 2 or
29 later.
30 </p>
31 <p>
32 The PolicyKit GNOME authentication D-Bus service (src/*) is
33 licensed to you under the GNU General Public License version 2
34 or later.
35 </p>
36 <p>
37 Both licenses are included here. Some individual source code
38 files and/or binaries may be under the GPL only.
39 </p>
40 <p>
41 Each source code file is marked with the proper copyright
42 information.
43 </p>
44 </div>
45 </body>
46 </html>
0 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Authentication Dialogs</title>
5 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
6 <link rel="start" href="index.html" title="PolicyKit-gnome Library Reference Manual">
7 <link rel="up" href="ref-core.html" title="API Reference">
8 <link rel="prev" href="PolKitGnomeToggleAction.html" title="PolKitGnomeToggleAction">
9 <link rel="next" href="ref-auth-daemon.html" title="Authentication Agent">
10 <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
11 <link rel="stylesheet" href="style.css" type="text/css">
12 <link rel="reference" href="ref-core.html" title="API Reference">
13 <link rel="reference" href="ref-auth-daemon.html" title="Authentication Agent">
14 <link rel="appendix" href="license.html" title="Appendix&#160;A.&#160;License">
15 </head>
16 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
17 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
18 <tr valign="middle">
19 <td><a accesskey="p" href="PolKitGnomeToggleAction.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
20 <td><a accesskey="u" href="ref-core.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
22 <th width="100%" align="center">PolicyKit-gnome Library Reference Manual</th>
23 <td><a accesskey="n" href="ref-auth-daemon.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
24 </tr>
25 <tr><td colspan="5" class="shortcuts"><nobr><a href="#id2768297" class="shortcut">Top</a>
26 &#160;|&#160;
27 <a href="#id2767414" class="shortcut">Description</a></nobr></td></tr>
28 </table>
29 <div class="refentry" lang="en">
30 <a name="polkit-gnome-polkit-gnome-auth"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2>
34 <a name="id2768297"></a><span class="refentrytitle">Authentication Dialogs</span>
35 </h2>
36 <p>Authentication Dialogs &#8212; Show authentication dialogs to gain privileges</p>
37 </td>
38 <td valign="top" align="right"></td>
39 </tr></table></div>
40 <div class="refsynopsisdiv">
41 <h2>Synopsis</h2>
42 <pre class="synopsis">
43
44
45
46 void (<a class="link" href="polkit-gnome-polkit-gnome-auth.html#PolKitGnomeAuthCB">*PolKitGnomeAuthCB</a>) (<a
47 href="../polkit/polkit-polkit-action.html#PolKitAction"
48 >PolKitAction</a> *action,
49 <a
50 href="../glib/glib-Basic-Types.html#gboolean"
51 >gboolean</a> gained_privilege,
52 <a
53 href="../glib/glib-Error-Reporting.html#GError"
54 >GError</a> *error,
55 <a
56 href="../glib/glib-Basic-Types.html#gpointer"
57 >gpointer</a> user_data);
58 <a
59 href="../glib/glib-Basic-Types.html#gboolean"
60 >gboolean</a> <a class="link" href="polkit-gnome-polkit-gnome-auth.html#polkit-gnome-auth-obtain">polkit_gnome_auth_obtain</a> (<a
61 href="../polkit/polkit-polkit-action.html#PolKitAction"
62 >PolKitAction</a> *action,
63 <a
64 href="../glib/glib-Basic-Types.html#guint"
65 >guint</a> xid,
66 pid_t pid,
67 <a class="link" href="polkit-gnome-polkit-gnome-auth.html#PolKitGnomeAuthCB">PolKitGnomeAuthCB</a> callback,
68 <a
69 href="../glib/glib-Basic-Types.html#gpointer"
70 >gpointer</a> user_data,
71 <a
72 href="../glib/glib-Error-Reporting.html#GError"
73 >GError</a> **error);
74 </pre>
75 </div>
76 <div class="refsect1" lang="en">
77 <a name="id2767414"></a><h2>Description</h2>
78 <p>
79 Show authentication dialogs to gain privileges.</p>
80 <p>
81
82 </p>
83 </div>
84 <div class="refsect1" lang="en">
85 <a name="id2767434"></a><h2>Details</h2>
86 <div class="refsect2" lang="en">
87 <a name="id2767445"></a><h3>
88 <a name="PolKitGnomeAuthCB"></a>PolKitGnomeAuthCB ()</h3>
89 <a class="indexterm" name="id2767457"></a><pre class="programlisting">void (*PolKitGnomeAuthCB) (<a
90 href="../polkit/polkit-polkit-action.html#PolKitAction"
91 >PolKitAction</a> *action,
92 <a
93 href="../glib/glib-Basic-Types.html#gboolean"
94 >gboolean</a> gained_privilege,
95 <a
96 href="../glib/glib-Error-Reporting.html#GError"
97 >GError</a> *error,
98 <a
99 href="../glib/glib-Basic-Types.html#gpointer"
100 >gpointer</a> user_data);</pre>
101 <p>
102 The type of the callback function for
103 <code class="function">polkit_gnome_auth_show_dialog()</code>.</p>
104 <p>
105
106 </p>
107 <div class="variablelist"><table border="0">
108 <col align="left" valign="top">
109 <tbody>
110 <tr>
111 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
112 <td> the <a
113 href="../polkit/polkit-polkit-action.html#PolKitAction"
114 ><span class="type">PolKitAction</span></a> passed in <code class="function">polkit_gnome_auth_show_dialog()</code>
115 </td>
116 </tr>
117 <tr>
118 <td><p><span class="term"><em class="parameter"><code>gained_privilege</code></em>&#160;:</span></p></td>
119 <td> whether the user gained the privilege. Set to
120 <a
121 href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
122 ><span class="type">FALSE</span></a> if error is set. If set to <a
123 href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
124 ><span class="type">TRUE</span></a>, error will not be set.
125 </td>
126 </tr>
127 <tr>
128 <td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
129 <td> if the call failed, this parameter will be non-<a
130 href="../glib/glib-Standard-Macros.html#NULL:CAPS"
131 ><span class="type">NULL</span></a>. The
132 callee shall free the error.
133 </td>
134 </tr>
135 <tr>
136 <td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
137 <td> user data
138 </td>
139 </tr>
140 </tbody>
141 </table></div>
142 </div>
143 <hr>
144 <div class="refsect2" lang="en">
145 <a name="id2789336"></a><h3>
146 <a name="polkit-gnome-auth-obtain"></a>polkit_gnome_auth_obtain ()</h3>
147 <a class="indexterm" name="id2789347"></a><pre class="programlisting"><a
148 href="../glib/glib-Basic-Types.html#gboolean"
149 >gboolean</a> polkit_gnome_auth_obtain (<a
150 href="../polkit/polkit-polkit-action.html#PolKitAction"
151 >PolKitAction</a> *action,
152 <a
153 href="../glib/glib-Basic-Types.html#guint"
154 >guint</a> xid,
155 pid_t pid,
156 <a class="link" href="polkit-gnome-polkit-gnome-auth.html#PolKitGnomeAuthCB">PolKitGnomeAuthCB</a> callback,
157 <a
158 href="../glib/glib-Basic-Types.html#gpointer"
159 >gpointer</a> user_data,
160 <a
161 href="../glib/glib-Error-Reporting.html#GError"
162 >GError</a> **error);</pre>
163 <p>
164 Applications can use this function to show a dialog for the user
165 asking her to authenticate in order to gain privileges to do the
166 given action. The authentication, for security reasons, happens in
167 a separate process; this function is merely a wrapper around a
168 D-Bus call across the session message bus to the
169 <code class="literal">org.freedesktop.PolicyKit.AuthenticationAgent</code>
170 service. Depending on the setup, this may be the Authentication
171 Agent shipped with PolicyKit-gnome or it may be another
172 implementation. For example, if the user is in KDE it may be an
173 Authentication Agent using the Qt toolkit.
174 </p>
175 <p>
176 The Authentication Agent shipped with PolicyKit-gnome is described
177 in <a class="link" href="ref-auth-daemon.html" title="Authentication Agent">this section</a>.
178 </p>
179 <p>
180 This function is similar to the <a
181 href="../polkit/polkit-polkit-simple.html#polkit-auth-obtain"
182 ><code class="function">polkit_auth_obtain()</code></a> function
183 supplied in <code class="literal">libpolkit-dbus</code> except that this
184 function is asynchronous.</p>
185 <p>
186
187 </p>
188 <div class="variablelist"><table border="0">
189 <col align="left" valign="top">
190 <tbody>
191 <tr>
192 <td><p><span class="term"><em class="parameter"><code>action</code></em>&#160;:</span></p></td>
193 <td> The <a
194 href="../polkit/polkit-polkit-action.html#PolKitAction"
195 ><span class="type">PolKitAction</span></a> to make the user authenticate for
196 </td>
197 </tr>
198 <tr>
199 <td><p><span class="term"><em class="parameter"><code>xid</code></em>&#160;:</span></p></td>
200 <td> X11 window ID for the window that the dialog will be transient for. If there is no window, pass 0.
201 </td>
202 </tr>
203 <tr>
204 <td><p><span class="term"><em class="parameter"><code>pid</code></em>&#160;:</span></p></td>
205 <td> Process ID of process to grant authorization to. Normally one wants to pass result of <code class="function">getpid()</code>.
206 </td>
207 </tr>
208 <tr>
209 <td><p><span class="term"><em class="parameter"><code>callback</code></em>&#160;:</span></p></td>
210 <td> Function to call when authentication is done
211 </td>
212 </tr>
213 <tr>
214 <td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
215 <td> Data to pass to the callback function
216 </td>
217 </tr>
218 <tr>
219 <td><p><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></p></td>
220 <td> Return location for error
221 </td>
222 </tr>
223 <tr>
224 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
225 <td> <a
226 href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
227 ><span class="type">TRUE</span></a> if the authentication session was scheduled to
228 start. <a
229 href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
230 ><span class="type">FALSE</span></a> if error is set (and no callback will be made).
231 </td>
232 </tr>
233 </tbody>
234 </table></div>
235 </div>
236 </div>
237 <div class="refsect1" lang="en">
238 <a name="id2798995"></a><div class="refsect2" lang="en"><a name="id2798996"></a></div>
239 <hr>
240 <div class="refsect2" lang="en"><a name="id2798997"></a></div>
241 </div>
242 </div>
243 </body>
244 </html>
0 <?xml version="1.0" encoding="utf-8" standalone="no"?>
1 <!DOCTYPE book PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
2 <book xmlns="http://www.devhelp.net/book" title="PolicyKit-gnome Library Reference Manual" link="index.html" author="David Zeuthen" name="polkit-gnome">
3 <chapters>
4 <sub name="API Reference" link="ref-core.html">
5 <sub name="PolKitGnomeContext" link="PolKitGnomeContext.html"/>
6 <sub name="PolKitGnomeAction" link="PolKitGnomeAction.html"/>
7 <sub name="PolKitGnomeToggleAction" link="PolKitGnomeToggleAction.html"/>
8 <sub name="Authentication Dialogs" link="polkit-gnome-polkit-gnome-auth.html"/>
9 </sub>
10 <sub name="Authentication Agent" link="ref-auth-daemon.html"/>
11 <sub name="License" link="license.html"/>
12 </chapters>
13 <functions>
14 <function name="POLKIT_GNOME_CONTEXT()" link="PolKitGnomeContext.html#POLKIT-GNOME-CONTEXT:CAPS"/>
15 <function name="POLKIT_GNOME_CONTEXT_ERROR" link="PolKitGnomeContext.html#POLKIT-GNOME-CONTEXT-ERROR:CAPS"/>
16 <function name="enum PolKitGnomeContextError" link="PolKitGnomeContext.html#PolKitGnomeContextError"/>
17 <function name="PolKitGnomeContextPrivate" link="PolKitGnomeContext.html#PolKitGnomeContextPrivate"/>
18 <function name="PolKitGnomeContext" link="PolKitGnomeContext.html#PolKitGnomeContext-struct"/>
19 <function name="polkit_gnome_context_get ()" link="PolKitGnomeContext.html#polkit-gnome-context-get"/>
20 <function name="polkit_gnome_context_error_quark ()" link="PolKitGnomeContext.html#polkit-gnome-context-error-quark"/>
21 <function name="The &quot;config-changed&quot; signal" link="PolKitGnomeContext.html#PolKitGnomeContext-config-changed"/>
22 <function name="The &quot;console-kit-db-changed&quot; signal" link="PolKitGnomeContext.html#PolKitGnomeContext-console-kit-db-changed"/>
23 <function name="" link="PolKitGnomeContext.html#id2711115"/>
24 <function name="" link="PolKitGnomeContext.html#id2711116"/>
25 <function name="PolKitGnomeActionPrivate" link="PolKitGnomeAction.html#PolKitGnomeActionPrivate"/>
26 <function name="PolKitGnomeAction" link="PolKitGnomeAction.html#PolKitGnomeAction-struct"/>
27 <function name="polkit_gnome_action_new ()" link="PolKitGnomeAction.html#polkit-gnome-action-new"/>
28 <function name="polkit_gnome_action_new_default ()" link="PolKitGnomeAction.html#polkit-gnome-action-new-default"/>
29 <function name="polkit_gnome_action_get_polkit_result ()" link="PolKitGnomeAction.html#polkit-gnome-action-get-polkit-result"/>
30 <function name="polkit_gnome_action_get_sensitive ()" link="PolKitGnomeAction.html#polkit-gnome-action-get-sensitive"/>
31 <function name="polkit_gnome_action_set_sensitive ()" link="PolKitGnomeAction.html#polkit-gnome-action-set-sensitive"/>
32 <function name="polkit_gnome_action_get_visible ()" link="PolKitGnomeAction.html#polkit-gnome-action-get-visible"/>
33 <function name="polkit_gnome_action_set_visible ()" link="PolKitGnomeAction.html#polkit-gnome-action-set-visible"/>
34 <function name="polkit_gnome_action_create_button ()" link="PolKitGnomeAction.html#polkit-gnome-action-create-button"/>
35 <function name="The &quot;auth-icon-name&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-icon-name"/>
36 <function name="The &quot;auth-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-label"/>
37 <function name="The &quot;auth-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-sensitive"/>
38 <function name="The &quot;auth-short-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-short-label"/>
39 <function name="The &quot;auth-tooltip&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-tooltip"/>
40 <function name="The &quot;auth-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-visible"/>
41 <function name="The &quot;master-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--master-sensitive"/>
42 <function name="The &quot;master-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--master-visible"/>
43 <function name="The &quot;no-icon-name&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-icon-name"/>
44 <function name="The &quot;no-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-label"/>
45 <function name="The &quot;no-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-sensitive"/>
46 <function name="The &quot;no-short-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-short-label"/>
47 <function name="The &quot;no-tooltip&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-tooltip"/>
48 <function name="The &quot;no-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-visible"/>
49 <function name="The &quot;polkit-action&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--polkit-action"/>
50 <function name="The &quot;polkit-action-sufficient&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--polkit-action-sufficient"/>
51 <function name="The &quot;self-blocked-icon-name&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-icon-name"/>
52 <function name="The &quot;self-blocked-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-label"/>
53 <function name="The &quot;self-blocked-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-sensitive"/>
54 <function name="The &quot;self-blocked-short-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-short-label"/>
55 <function name="The &quot;self-blocked-tooltip&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-tooltip"/>
56 <function name="The &quot;self-blocked-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-visible"/>
57 <function name="The &quot;target-pid&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--target-pid"/>
58 <function name="The &quot;yes-icon-name&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-icon-name"/>
59 <function name="The &quot;yes-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-label"/>
60 <function name="The &quot;yes-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-sensitive"/>
61 <function name="The &quot;yes-short-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-short-label"/>
62 <function name="The &quot;yes-tooltip&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-tooltip"/>
63 <function name="The &quot;yes-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-visible"/>
64 <function name="The &quot;auth-end&quot; signal" link="PolKitGnomeAction.html#PolKitGnomeAction-auth-end"/>
65 <function name="The &quot;auth-start&quot; signal" link="PolKitGnomeAction.html#PolKitGnomeAction-auth-start"/>
66 <function name="The &quot;polkit-result-changed&quot; signal" link="PolKitGnomeAction.html#PolKitGnomeAction-polkit-result-changed"/>
67 <function name="" link="PolKitGnomeAction.html#id2804071"/>
68 <function name="" link="PolKitGnomeAction.html#id2804072"/>
69 <function name="PolKitGnomeToggleActionPrivate" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleActionPrivate"/>
70 <function name="PolKitGnomeToggleAction" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction-struct"/>
71 <function name="polkit_gnome_toggle_action_new ()" link="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-new"/>
72 <function name="polkit_gnome_toggle_action_new_default ()" link="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-new-default"/>
73 <function name="polkit_gnome_toggle_action_create_toggle_button ()" link="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-create-toggle-button"/>
74 <function name="The &quot;auth-underway-icon-name&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-icon-name"/>
75 <function name="The &quot;auth-underway-label&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-label"/>
76 <function name="The &quot;auth-underway-sensitive&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-sensitive"/>
77 <function name="The &quot;auth-underway-short-label&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-short-label"/>
78 <function name="The &quot;auth-underway-tooltip&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-tooltip"/>
79 <function name="The &quot;auth-underway-visible&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-visible"/>
80 <function name="The &quot;toggled&quot; signal" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction-toggled"/>
81 <function name="" link="PolKitGnomeToggleAction.html#id2799785"/>
82 <function name="" link="PolKitGnomeToggleAction.html#id2799786"/>
83 <function name="PolKitGnomeAuthCB ()" link="polkit-gnome-polkit-gnome-auth.html#PolKitGnomeAuthCB"/>
84 <function name="polkit_gnome_auth_obtain ()" link="polkit-gnome-polkit-gnome-auth.html#polkit-gnome-auth-obtain"/>
85 <function name="" link="polkit-gnome-polkit-gnome-auth.html#id2798996"/>
86 <function name="" link="polkit-gnome-polkit-gnome-auth.html#id2798997"/>
87 </functions>
88 </book>
0 <?xml version="1.0" encoding="utf-8" standalone="no"?>
1 <!DOCTYPE book PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
2 <book xmlns="http://www.devhelp.net/book" title="PolicyKit-gnome Library Reference Manual" link="index.html" author="David Zeuthen" name="polkit-gnome" version="2">
3 <chapters>
4 <sub name="API Reference" link="ref-core.html">
5 <sub name="PolKitGnomeContext" link="PolKitGnomeContext.html"/>
6 <sub name="PolKitGnomeAction" link="PolKitGnomeAction.html"/>
7 <sub name="PolKitGnomeToggleAction" link="PolKitGnomeToggleAction.html"/>
8 <sub name="Authentication Dialogs" link="polkit-gnome-polkit-gnome-auth.html"/>
9 </sub>
10 <sub name="Authentication Agent" link="ref-auth-daemon.html"/>
11 <sub name="License" link="license.html"/>
12 </chapters>
13 <functions>
14 <keyword type="macro" name="POLKIT_GNOME_CONTEXT()" link="PolKitGnomeContext.html#POLKIT-GNOME-CONTEXT:CAPS"/>
15 <keyword type="macro" name="POLKIT_GNOME_CONTEXT_ERROR" link="PolKitGnomeContext.html#POLKIT-GNOME-CONTEXT-ERROR:CAPS"/>
16 <keyword type="enum" name="enum PolKitGnomeContextError" link="PolKitGnomeContext.html#PolKitGnomeContextError"/>
17 <keyword type="struct" name="PolKitGnomeContextPrivate" link="PolKitGnomeContext.html#PolKitGnomeContextPrivate"/>
18 <keyword type="struct" name="PolKitGnomeContext" link="PolKitGnomeContext.html#PolKitGnomeContext-struct"/>
19 <keyword type="function" name="polkit_gnome_context_get ()" link="PolKitGnomeContext.html#polkit-gnome-context-get"/>
20 <keyword type="function" name="polkit_gnome_context_error_quark ()" link="PolKitGnomeContext.html#polkit-gnome-context-error-quark"/>
21 <keyword type="" name="The &quot;config-changed&quot; signal" link="PolKitGnomeContext.html#PolKitGnomeContext-config-changed"/>
22 <keyword type="" name="The &quot;console-kit-db-changed&quot; signal" link="PolKitGnomeContext.html#PolKitGnomeContext-console-kit-db-changed"/>
23 <keyword type="" name="" link="PolKitGnomeContext.html#id2711115"/>
24 <keyword type="" name="" link="PolKitGnomeContext.html#id2711116"/>
25 <keyword type="struct" name="PolKitGnomeActionPrivate" link="PolKitGnomeAction.html#PolKitGnomeActionPrivate"/>
26 <keyword type="struct" name="PolKitGnomeAction" link="PolKitGnomeAction.html#PolKitGnomeAction-struct"/>
27 <keyword type="function" name="polkit_gnome_action_new ()" link="PolKitGnomeAction.html#polkit-gnome-action-new"/>
28 <keyword type="function" name="polkit_gnome_action_new_default ()" link="PolKitGnomeAction.html#polkit-gnome-action-new-default"/>
29 <keyword type="function" name="polkit_gnome_action_get_polkit_result ()" link="PolKitGnomeAction.html#polkit-gnome-action-get-polkit-result"/>
30 <keyword type="function" name="polkit_gnome_action_get_sensitive ()" link="PolKitGnomeAction.html#polkit-gnome-action-get-sensitive"/>
31 <keyword type="function" name="polkit_gnome_action_set_sensitive ()" link="PolKitGnomeAction.html#polkit-gnome-action-set-sensitive"/>
32 <keyword type="function" name="polkit_gnome_action_get_visible ()" link="PolKitGnomeAction.html#polkit-gnome-action-get-visible"/>
33 <keyword type="function" name="polkit_gnome_action_set_visible ()" link="PolKitGnomeAction.html#polkit-gnome-action-set-visible"/>
34 <keyword type="function" name="polkit_gnome_action_create_button ()" link="PolKitGnomeAction.html#polkit-gnome-action-create-button"/>
35 <keyword type="" name="The &quot;auth-icon-name&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-icon-name"/>
36 <keyword type="" name="The &quot;auth-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-label"/>
37 <keyword type="" name="The &quot;auth-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-sensitive"/>
38 <keyword type="" name="The &quot;auth-short-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-short-label"/>
39 <keyword type="" name="The &quot;auth-tooltip&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-tooltip"/>
40 <keyword type="" name="The &quot;auth-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--auth-visible"/>
41 <keyword type="" name="The &quot;master-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--master-sensitive"/>
42 <keyword type="" name="The &quot;master-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--master-visible"/>
43 <keyword type="" name="The &quot;no-icon-name&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-icon-name"/>
44 <keyword type="" name="The &quot;no-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-label"/>
45 <keyword type="" name="The &quot;no-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-sensitive"/>
46 <keyword type="" name="The &quot;no-short-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-short-label"/>
47 <keyword type="" name="The &quot;no-tooltip&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-tooltip"/>
48 <keyword type="" name="The &quot;no-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--no-visible"/>
49 <keyword type="" name="The &quot;polkit-action&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--polkit-action"/>
50 <keyword type="" name="The &quot;polkit-action-sufficient&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--polkit-action-sufficient"/>
51 <keyword type="" name="The &quot;self-blocked-icon-name&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-icon-name"/>
52 <keyword type="" name="The &quot;self-blocked-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-label"/>
53 <keyword type="" name="The &quot;self-blocked-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-sensitive"/>
54 <keyword type="" name="The &quot;self-blocked-short-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-short-label"/>
55 <keyword type="" name="The &quot;self-blocked-tooltip&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-tooltip"/>
56 <keyword type="" name="The &quot;self-blocked-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--self-blocked-visible"/>
57 <keyword type="" name="The &quot;target-pid&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--target-pid"/>
58 <keyword type="" name="The &quot;yes-icon-name&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-icon-name"/>
59 <keyword type="" name="The &quot;yes-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-label"/>
60 <keyword type="" name="The &quot;yes-sensitive&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-sensitive"/>
61 <keyword type="" name="The &quot;yes-short-label&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-short-label"/>
62 <keyword type="" name="The &quot;yes-tooltip&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-tooltip"/>
63 <keyword type="" name="The &quot;yes-visible&quot; property" link="PolKitGnomeAction.html#PolKitGnomeAction--yes-visible"/>
64 <keyword type="" name="The &quot;auth-end&quot; signal" link="PolKitGnomeAction.html#PolKitGnomeAction-auth-end"/>
65 <keyword type="" name="The &quot;auth-start&quot; signal" link="PolKitGnomeAction.html#PolKitGnomeAction-auth-start"/>
66 <keyword type="" name="The &quot;polkit-result-changed&quot; signal" link="PolKitGnomeAction.html#PolKitGnomeAction-polkit-result-changed"/>
67 <keyword type="" name="" link="PolKitGnomeAction.html#id2804071"/>
68 <keyword type="" name="" link="PolKitGnomeAction.html#id2804072"/>
69 <keyword type="struct" name="PolKitGnomeToggleActionPrivate" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleActionPrivate"/>
70 <keyword type="struct" name="PolKitGnomeToggleAction" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction-struct"/>
71 <keyword type="function" name="polkit_gnome_toggle_action_new ()" link="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-new"/>
72 <keyword type="function" name="polkit_gnome_toggle_action_new_default ()" link="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-new-default"/>
73 <keyword type="function" name="polkit_gnome_toggle_action_create_toggle_button ()" link="PolKitGnomeToggleAction.html#polkit-gnome-toggle-action-create-toggle-button"/>
74 <keyword type="" name="The &quot;auth-underway-icon-name&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-icon-name"/>
75 <keyword type="" name="The &quot;auth-underway-label&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-label"/>
76 <keyword type="" name="The &quot;auth-underway-sensitive&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-sensitive"/>
77 <keyword type="" name="The &quot;auth-underway-short-label&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-short-label"/>
78 <keyword type="" name="The &quot;auth-underway-tooltip&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-tooltip"/>
79 <keyword type="" name="The &quot;auth-underway-visible&quot; property" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction--auth-underway-visible"/>
80 <keyword type="" name="The &quot;toggled&quot; signal" link="PolKitGnomeToggleAction.html#PolKitGnomeToggleAction-toggled"/>
81 <keyword type="" name="" link="PolKitGnomeToggleAction.html#id2799785"/>
82 <keyword type="" name="" link="PolKitGnomeToggleAction.html#id2799786"/>
83 <keyword type="function" name="PolKitGnomeAuthCB ()" link="polkit-gnome-polkit-gnome-auth.html#PolKitGnomeAuthCB"/>
84 <keyword type="function" name="polkit_gnome_auth_obtain ()" link="polkit-gnome-polkit-gnome-auth.html#polkit-gnome-auth-obtain"/>
85 <keyword type="" name="" link="polkit-gnome-polkit-gnome-auth.html#id2798996"/>
86 <keyword type="" name="" link="polkit-gnome-polkit-gnome-auth.html#id2798997"/>
87 </functions>
88 </book>
0 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Authentication Agent</title>
5 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
6 <link rel="start" href="index.html" title="PolicyKit-gnome Library Reference Manual">
7 <link rel="up" href="index.html" title="PolicyKit-gnome Library Reference Manual">
8 <link rel="prev" href="polkit-gnome-polkit-gnome-auth.html" title="Authentication Dialogs">
9 <link rel="next" href="license.html" title="Appendix&#160;A.&#160;License">
10 <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
11 <link rel="stylesheet" href="style.css" type="text/css">
12 <link rel="reference" href="ref-core.html" title="API Reference">
13 <link rel="reference" href="ref-auth-daemon.html" title="Authentication Agent">
14 <link rel="appendix" href="license.html" title="Appendix&#160;A.&#160;License">
15 </head>
16 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
17 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
18 <td><a accesskey="p" href="polkit-gnome-polkit-gnome-auth.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
19 <td>&#160;</td>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
21 <th width="100%" align="center">PolicyKit-gnome Library Reference Manual</th>
22 <td><a accesskey="n" href="license.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 </tr></table>
24 <div class="reference" lang="en">
25 <div class="titlepage">
26 <div><div><h1 class="title">
27 <a name="ref-auth-daemon"></a>Authentication Agent</h1></div></div>
28 <hr>
29 </div>
30 <div class="partintro" lang="en">
31 <div></div>
32 <p>
33 This part discusses the GNOME/GTK+ specific Authentication
34 Agent.
35 </p>
36 </div>
37 <div class="refsect1" lang="en">
38 <a name="ref-auth-daemon-overview"></a><h2>Overview</h2>
39 <p>
40 The PolicyKit model provides letting an user authenticate in
41 order to gain the privilege to let a Mechanism carry work out
42 related to a specific Action on the users behalf. In the
43 PolicyKit libraries, this functionality is programmatically
44 exposed in the PolKitGrant class. As it's tedious to use this
45 low-level functionality from a GTK+ or GNOME application, the
46 high-level functionality is wrapped in a D-Bus service
47 available on the session message bus. The way it works is that
48 when an application needs privileges, it can call into this
49 D-Bus service and an authentication dialog will appear. When
50 the user is done with the authentication dialog, the
51 application recieves a reply from the D-Bus containing a
52 boolean indicating whether the user gained the privilege or
53 not.
54 </p>
55 </div>
56 <div class="refsect1" lang="en">
57 <a name="ref-auth-daemon-overview-dbus"></a><h2>D-Bus interface</h2>
58 <p>
59 The D-Bus service is available on the session message bus with
60 the
61 name <code class="literal">org.freedesktop.PolicyKit.AuthenticationAgent</code>
62 and exports a single object <code class="literal">/</code> that
63 implements the
64 interface <code class="literal">org.freedesktop.PolicyKit.AuthenticationAgent</code>. The
65 D-Bus introspection XML looks like this
66 </p>
67 <pre class="programlisting">&lt;!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
68 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"&gt;
69
70 &lt;node name="/"&gt;
71
72 &lt;!-- this interface is deprecated and will be removed in a future release --&gt;
73 &lt;interface name="org.gnome.PolicyKit.Manager"&gt;
74 &lt;method name="ShowDialog"&gt;
75 &lt;annotation name="org.freedesktop.DBus.GLib.Async" value=""/&gt;
76
77 &lt;!-- IN: PolicyKit action identifier; see PolKitAction --&gt;
78 &lt;arg name="action_id" direction="in" type="s"/&gt;
79
80 &lt;!-- IN: X11 window ID for the top-level X11 window the dialog will be transient for. --&gt;
81 &lt;arg name="xid" direction="in" type="u"/&gt;
82
83 &lt;!-- OUT: whether the user gained the authorization --&gt;
84 &lt;arg name="gained_authorization" direction="out" type="b"/&gt;
85
86 &lt;/method&gt;
87 &lt;/interface&gt;
88
89 &lt;interface name="org.freedesktop.PolicyKit.AuthenticationAgent"&gt;
90 &lt;method name="ObtainAuthorization"&gt;
91 &lt;annotation name="org.freedesktop.DBus.GLib.Async" value=""/&gt;
92
93 &lt;!-- IN: PolicyKit action identifier; see PolKitAction --&gt;
94 &lt;arg name="action_id" direction="in" type="s"/&gt;
95
96 &lt;!-- IN: X11 window ID for the top-level X11 window the dialog will be transient for. --&gt;
97 &lt;arg name="xid" direction="in" type="u"/&gt;
98
99 &lt;!-- IN: Process ID to grant authorization to --&gt;
100 &lt;arg name="pid" direction="in" type="u"/&gt;
101
102 &lt;!-- OUT: whether the user gained the authorization --&gt;
103 &lt;arg name="gained_authorization" direction="out" type="b"/&gt;
104
105 &lt;/method&gt;
106 &lt;/interface&gt;
107
108 &lt;/node&gt;
109 </pre>
110 <p>
111 The <code class="literal">ObtainAuthorization()</code> method may throw
112 an exception if another client is currently using the service
113 to show an authentication dialog. In practice this should
114 never happen because the authentication daemon grabs the X11
115 keyboard and pointer thus preventing the user from activating
116 widgets in other applications that would lead to calling into
117 the <code class="literal">ObtainAuthorization</code> method.
118 </p>
119 </div>
120 <div class="refsect1" lang="en">
121 <a name="ref-auth-daemon-operation"></a><h2>Operation</h2>
122 <p>
123 The authentication daemon uses
124 <code class="literal">libpolkit-grant</code> which in turn uses PAM for
125 authentication services (however, other authentication
126 back-ends can be plugged in as required). As such, a wide
127 range of authentication mechanisms are available.
128 </p>
129 <p>
130 The authentication daemon is using D-Bus activation and exits
131 after 30 seconds of inactivity. Thus the code implementing
132 this dialog only runs when necessary.
133 </p>
134 </div>
135 <div class="refsect1" lang="en">
136 <a name="ref-auth-daemon-ui-elements"></a><h2>UI elements</h2>
137 <p>
138 The appearance of the authentication dialog depends on the
139 result from PolicyKit and also whether administrator
140 authentication is defined as "authenticate as the root user"
141 or "authenticate as one of the users from UNIX group wheel" or
142 however the PolicyKit library is configured (see
143 the <code class="literal">PolicyKit.conf(5)</code> manual page for
144 details). Note that some of the screenshots below were made on
145 a system set up to use
146 the <a class="ulink" href="http://thinkfinger.sourceforge.net/" target="_top"><em class="citetitle">ThinkFinger</em></a>
147 PAM module.
148 </p>
149 <p>
150 The text shown in the authentication dialogs stems from the
151 PolicyKit <code class="literal">.policy</code> XML files residing
152 in <code class="literal">/usr/share/PolicyKit/policy</code> and is read
153 by the authentication daemon when an applications uses
154 the <code class="literal">ShowDialog()</code> method. Thus, what the
155 user sees is not under application control (e.g. it's not
156 passed from the application) which rules out a class of
157 attacks where applications are trying to fool the user into
158 gaining a privilege.
159 </p>
160 <p>
161 Authentication dialog where the user is asked to authenticate
162 as herself:
163 </p>
164 <p>
165 <img src="auth-self.png">
166 </p>
167 <p>
168 Authentication dialog where the user is asked to authenticate
169 as an administrative user and PolicyKit is configured to use
170 the root password for this:
171 </p>
172 <p>
173 <img src="auth-root.png">
174 </p>
175 <p>
176 Authentication dialog where the user is asked to authenticate
177 as an administrative user and PolicyKit is configured to use
178 the UNIX wheel group for this:
179 </p>
180 <p>
181 <img src="auth-wheel-group-1.png">
182 </p>
183 <p>
184 Same authentication dialog, showing drop down box where the
185 user can be selected:
186 </p>
187 <p>
188 <img src="auth-wheel-group-2.png">
189 </p>
190 <p>
191 Authentication dialog showing an Action where the privilege
192 can be retained indefinitely:
193 </p>
194 <p>
195 <img src="auth-retain-always.png">
196 </p>
197 <p>
198 Authentication dialog showing an Action where the privilege
199 can be retained only for the remainer of the desktop session:
200 </p>
201 <p>
202 <img src="auth-retain-session.png">
203 </p>
204 <p>
205 The details view detailing what Action is being asked for as
206 well as what application is requesting the authentication:
207 </p>
208 <p>
209 <img src="auth-details.png">
210 </p>
211 </div>
212 </div>
213 </body>
214 </html>
0 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>API Reference</title>
5 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
6 <link rel="start" href="index.html" title="PolicyKit-gnome Library Reference Manual">
7 <link rel="up" href="index.html" title="PolicyKit-gnome Library Reference Manual">
8 <link rel="prev" href="index.html" title="PolicyKit-gnome Library Reference Manual">
9 <link rel="next" href="PolKitGnomeContext.html" title="PolKitGnomeContext">
10 <meta name="generator" content="GTK-Doc V1.9 (XML mode)">
11 <link rel="stylesheet" href="style.css" type="text/css">
12 <link rel="reference" href="ref-core.html" title="API Reference">
13 <link rel="reference" href="ref-auth-daemon.html" title="Authentication Agent">
14 <link rel="appendix" href="license.html" title="Appendix&#160;A.&#160;License">
15 </head>
16 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
17 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
18 <td><a accesskey="p" href="index.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
19 <td>&#160;</td>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
21 <th width="100%" align="center">PolicyKit-gnome Library Reference Manual</th>
22 <td><a accesskey="n" href="PolKitGnomeContext.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 </tr></table>
24 <div class="reference" lang="en">
25 <div class="titlepage">
26 <div><div><h1 class="title">
27 <a name="ref-core"></a>API Reference</h1></div></div>
28 <hr>
29 </div>
30 <div class="partintro" lang="en">
31 <div></div>
32 <p>
33 This part presents the class and function reference for the
34 PolicyKit-gnome library, <code class="literal">libpolkit-gnome</code>.
35 </p>
36 <div class="toc">
37 <p><b>Table of Contents</b></p>
38 <dl>
39 <dt>
40 <span class="refentrytitle"><a href="PolKitGnomeContext.html">PolKitGnomeContext</a></span><span class="refpurpose"> &#8212; Convenience functions for using PolicyKit from GTK+ and GNOME applications.</span>
41 </dt>
42 <dt>
43 <span class="refentrytitle"><a href="PolKitGnomeAction.html">PolKitGnomeAction</a></span><span class="refpurpose"> &#8212; A GtkAction subclass where instances can be tied to a specific PolicyKit action.</span>
44 </dt>
45 <dt>
46 <span class="refentrytitle"><a href="PolKitGnomeToggleAction.html">PolKitGnomeToggleAction</a></span><span class="refpurpose"> &#8212; A GtkAction that can be toggled to
47 obtain and give up PolicyKit authorizations.</span>
48 </dt>
49 <dt>
50 <span class="refentrytitle"><a href="polkit-gnome-polkit-gnome-auth.html">Authentication Dialogs</a></span><span class="refpurpose"> &#8212; Show authentication dialogs to gain privileges</span>
51 </dt>
52 </dl>
53 </div>
54 </div>
55 </div>
56 </body>
57 </html>
Binary diff not shown
0 .synopsis, .classsynopsis
1 {
2 background: #eeeeee;
3 border: solid 1px #aaaaaa;
4 padding: 0.5em;
5 }
6 .programlisting
7 {
8 background: #eeeeff;
9 border: solid 1px #aaaaff;
10 padding: 0.5em;
11 }
12 .variablelist
13 {
14 padding: 4px;
15 margin-left: 3em;
16 }
17 .variablelist td:first-child
18 {
19 vertical-align: top;
20 }
21
22 /* this is needed so that the local anchors are displayed below the naviagtion */
23 @media screen {
24 div.refnamediv a[name], div.refsect1 a[name]
25 {
26 position: relative;
27 top: -4.5em;
28 }
29 table.navigation#top
30 {
31 background: #ffeeee;
32 border: solid 1px #ffaaaa;
33 margin-top: 0;
34 margin-bottom: 0;
35 position: fixed;
36 top: 0;
37 left: 0;
38 height: 2em;
39 z-index: 1;
40 }
41 .navigation a
42 {
43 color: #770000;
44 }
45 .navigation a:visited
46 {
47 color: #550000;
48 }
49 td.shortcuts
50 {
51 color: #770000;
52 font-size: 80%;
53 }
54 div.refentry, div.chapter, div.reference, div.part, div.book, div.index, div.glossary, div.sect1, div.appendix, div.preface
55 {
56 position: relative;
57 top: 3em;
58 z-index: 0;
59 }
60 div.refnamediv
61 {
62 margin-top: 2em;
63 }
64 body
65 {
66 padding-bottom: 20em;
67 }
68 }
69 @media print {
70 table.navigation {
71 visibility: collapse;
72 display: none;
73 }
74 div.titlepage table.navigation {
75 visibility: visible;
76 display: table;
77 background: #ffeeee;
78 border: solid 1px #ffaaaa;
79 margin-top: 0;
80 margin-bottom: 0;
81 top: 0;
82 left: 0;
83 height: 2em;
84 }
85 }
86
87 .navigation .title
88 {
89 font-size: 200%;
90 }
91
92
93 div.gallery-float
94 {
95 float: left;
96 padding: 10px;
97 }
98 div.gallery-float img
99 {
100 border-style: none;
101 }
102 div.gallery-spacer
103 {
104 clear: both;
105 }
106 a
107 {
108 text-decoration: none;
109 }
110 a:hover
111 {
112 text-decoration: underline;
113 color: #FF0000;
114 }
115
116 div.table table
117 {
118 border-collapse: collapse;
119 border-spacing: 0px;
120 border-style: solid;
121 border-color: #777777;
122 border-width: 1px;
123 }
124
125 div.table table td, div.table table th
126 {
127 border-style: solid;
128 border-color: #777777;
129 border-width: 1px;
130 padding: 3px;
131 vertical-align: top;
132 }
133
134 div.table table th
135 {
136 background-color: #eeeeee;
137 }
138
139 hr
140 {
141 color: #888;
142 background: #888;
143 border: 0;
144 height: 1px;
145 clear: both;
146 }
147
Binary diff not shown
0 <?xml version="1.0"?>
1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
2 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
3 <!ENTITY version SYSTEM "version.xml">
4 ]>
5 <book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
6 <bookinfo>
7 <title>PolicyKit-gnome Library Reference Manual</title>
8 <releaseinfo>Version &version;</releaseinfo>
9 <authorgroup>
10 <author>
11 <firstname>David</firstname>
12 <surname>Zeuthen</surname>
13 <affiliation>
14 <address>
15 <email>david@fubar.dk</email>
16 </address>
17 </affiliation>
18 </author>
19 </authorgroup>
20
21 <copyright>
22 <year>2007</year>
23 <holder>The PolicyKit-gnome Authors</holder>
24 </copyright>
25
26 <legalnotice>
27 <para>
28 Permission is granted to copy, distribute and/or modify this
29 document under the terms of the <citetitle>GNU Free
30 Documentation License</citetitle>, Version 1.1 or any later
31 version published by the Free Software Foundation with no
32 Invariant Sections, no Front-Cover Texts, and no Back-Cover
33 Texts. You may obtain a copy of the <citetitle>GNU Free
34 Documentation License</citetitle> from the Free Software
35 Foundation by visiting <ulink type="http"
36 url="http://www.fsf.org">their Web site</ulink> or by writing
37 to:
38
39 <address>
40 The Free Software Foundation, Inc.,
41 <street>59 Temple Place</street> - Suite 330,
42 <city>Boston</city>, <state>MA</state> <postcode>02111-1307</postcode>,
43 <country>USA</country>
44 </address>
45 </para>
46
47 <para>
48 Many of the names used by companies to distinguish their
49 products and services are claimed as trademarks. Where those
50 names appear in any GNOME documentation, and those trademarks
51 are made aware to the members of the GNOME Documentation
52 Project, the names have been printed in caps or initial caps.
53 </para>
54 </legalnotice>
55 </bookinfo>
56
57 <reference id="ref-core">
58 <title>API Reference</title>
59 <partintro>
60 <para>
61 This part presents the class and function reference for the
62 PolicyKit-gnome library, <literal>libpolkit-gnome</literal>.
63 </para>
64 </partintro>
65 <xi:include href="xml/polkit-gnome-context.xml"/>
66 <xi:include href="xml/polkit-gnome-action.xml"/>
67 <xi:include href="xml/polkit-gnome-toggle-action.xml"/>
68 <xi:include href="xml/polkit-gnome-auth.xml"/>
69 </reference>
70
71 <reference id="ref-auth-daemon">
72 <title>Authentication Agent</title>
73 <partintro>
74 <para>
75 This part discusses the GNOME/GTK+ specific Authentication
76 Agent.
77 </para>
78 </partintro>
79
80 <refsect1 id="ref-auth-daemon-overview">
81 <title>Overview</title>
82 <para>
83 The PolicyKit model provides letting an user authenticate in
84 order to gain the privilege to let a Mechanism carry work out
85 related to a specific Action on the users behalf. In the
86 PolicyKit libraries, this functionality is programmatically
87 exposed in the PolKitGrant class. As it's tedious to use this
88 low-level functionality from a GTK+ or GNOME application, the
89 high-level functionality is wrapped in a D-Bus service
90 available on the session message bus. The way it works is that
91 when an application needs privileges, it can call into this
92 D-Bus service and an authentication dialog will appear. When
93 the user is done with the authentication dialog, the
94 application recieves a reply from the D-Bus containing a
95 boolean indicating whether the user gained the privilege or
96 not.
97 </para>
98 </refsect1>
99
100 <refsect1 id="ref-auth-daemon-overview-dbus">
101 <title>D-Bus interface</title>
102 <para>
103 The D-Bus service is available on the session message bus with
104 the
105 name <literal>org.freedesktop.PolicyKit.AuthenticationAgent</literal>
106 and exports a single object <literal>/</literal> that
107 implements the
108 interface <literal>org.freedesktop.PolicyKit.AuthenticationAgent</literal>. The
109 D-Bus introspection XML looks like this
110 </para>
111 <programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../src/polkit-gnome-manager.xml" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
112 <para>
113 The <literal>ObtainAuthorization()</literal> method may throw
114 an exception if another client is currently using the service
115 to show an authentication dialog. In practice this should
116 never happen because the authentication daemon grabs the X11
117 keyboard and pointer thus preventing the user from activating
118 widgets in other applications that would lead to calling into
119 the <literal>ObtainAuthorization</literal> method.
120 </para>
121 </refsect1>
122
123 <refsect1 id="ref-auth-daemon-operation">
124 <title>Operation</title>
125 <para>
126 The authentication daemon uses
127 <literal>libpolkit-grant</literal> which in turn uses PAM for
128 authentication services (however, other authentication
129 back-ends can be plugged in as required). As such, a wide
130 range of authentication mechanisms are available.
131 </para>
132 <para>
133 The authentication daemon is using D-Bus activation and exits
134 after 30 seconds of inactivity. Thus the code implementing
135 this dialog only runs when necessary.
136 </para>
137 </refsect1>
138
139 <refsect1 id="ref-auth-daemon-ui-elements">
140 <title>UI elements</title>
141 <para>
142 The appearance of the authentication dialog depends on the
143 result from PolicyKit and also whether administrator
144 authentication is defined as "authenticate as the root user"
145 or "authenticate as one of the users from UNIX group wheel" or
146 however the PolicyKit library is configured (see
147 the <literal>PolicyKit.conf(5)</literal> manual page for
148 details). Note that some of the screenshots below were made on
149 a system set up to use
150 the <ulink url="http://thinkfinger.sourceforge.net/"><citetitle>ThinkFinger</citetitle></ulink>
151 PAM module.
152 </para>
153
154 <para>
155 The text shown in the authentication dialogs stems from the
156 PolicyKit <literal>.policy</literal> XML files residing
157 in <literal>/usr/share/PolicyKit/policy</literal> and is read
158 by the authentication daemon when an applications uses
159 the <literal>ShowDialog()</literal> method. Thus, what the
160 user sees is not under application control (e.g. it's not
161 passed from the application) which rules out a class of
162 attacks where applications are trying to fool the user into
163 gaining a privilege.
164 </para>
165
166 <para>
167 Authentication dialog where the user is asked to authenticate
168 as herself:
169 </para>
170 <para>
171 <inlinegraphic fileref="auth-self.png" format="PNG"/>
172 </para>
173 <para>
174 Authentication dialog where the user is asked to authenticate
175 as an administrative user and PolicyKit is configured to use
176 the root password for this:
177 </para>
178 <para>
179 <inlinegraphic fileref="auth-root.png" format="PNG"/>
180 </para>
181 <para>
182 Authentication dialog where the user is asked to authenticate
183 as an administrative user and PolicyKit is configured to use
184 the UNIX wheel group for this:
185 </para>
186 <para>
187 <inlinegraphic fileref="auth-wheel-group-1.png" format="PNG"/>
188 </para>
189 <para>
190 Same authentication dialog, showing drop down box where the
191 user can be selected:
192 </para>
193 <para>
194 <inlinegraphic fileref="auth-wheel-group-2.png" format="PNG"/>
195 </para>
196 <para>
197 Authentication dialog showing an Action where the privilege
198 can be retained indefinitely:
199 </para>
200 <para>
201 <inlinegraphic fileref="auth-retain-always.png" format="PNG"/>
202 </para>
203 <para>
204 Authentication dialog showing an Action where the privilege
205 can be retained only for the remainer of the desktop session:
206 </para>
207 <para>
208 <inlinegraphic fileref="auth-retain-session.png" format="PNG"/>
209 </para>
210 <para>
211 The details view detailing what Action is being asked for as
212 well as what application is requesting the authentication:
213 </para>
214 <para>
215 <inlinegraphic fileref="auth-details.png" format="PNG"/>
216 </para>
217 </refsect1>
218
219 </reference>
220
221 <!-- License -->
222
223 <appendix id="license">
224 <title>License</title>
225 <para>
226 The polkit-gnome library (polkit-gnome/*) is licensed to you
227 under the GNU Lesser General Public License version 2 or
228 later.
229 </para>
230 <para>
231 The PolicyKit GNOME authentication D-Bus service (src/*) is
232 licensed to you under the GNU General Public License version 2
233 or later.
234 </para>
235 <para>
236 Both licenses are included here. Some individual source code
237 files and/or binaries may be under the GPL only.
238 </para>
239 <para>
240 Each source code file is marked with the proper copyright
241 information.
242 </para>
243 </appendix>
244 </book>
0 <SECTION>
1 <FILE>polkit-gnome-toggle-action</FILE>
2 PolKitGnomeToggleActionPrivate
3 <TITLE>PolKitGnomeToggleAction</TITLE>
4 PolKitGnomeToggleAction
5 polkit_gnome_toggle_action_new
6 polkit_gnome_toggle_action_new_default
7 polkit_gnome_toggle_action_create_toggle_button
8 <SUBSECTION Standard>
9 POLKIT_GNOME_TOGGLE_ACTION
10 POLKIT_GNOME_IS_TOGGLE_ACTION
11 POLKIT_GNOME_TYPE_TOGGLE_ACTION
12 polkit_gnome_toggle_action_get_type
13 POLKIT_GNOME_TOGGLE_ACTION_CLASS
14 POLKIT_GNOME_IS_TOGGLE_ACTION_CLASS
15 POLKIT_GNOME_TOGGLE_ACTION_GET_CLASS
16 </SECTION>
17
18 <SECTION>
19 <FILE>polkit-gnome-context</FILE>
20 POLKIT_GNOME_CONTEXT
21 POLKIT_GNOME_CONTEXT_ERROR
22 PolKitGnomeContextError
23 PolKitGnomeContextPrivate
24 <TITLE>PolKitGnomeContext</TITLE>
25 PolKitGnomeContext
26 polkit_gnome_context_get
27 polkit_gnome_context_error_quark
28 <SUBSECTION Standard>
29 POLKIT_TYPE_GNOME_CONTEXT
30 POLKIT_GNOME_IS_CONTEXT
31 polkit_gnome_context_get_type
32 POLKIT_GNOME_CONTEXT_CLASS
33 POLKIT_GNOME_IS_CONTEXT_CLASS
34 POLKIT_GNOME_CONTEXT_GET_CLASS
35 </SECTION>
36
37 <SECTION>
38 <FILE>polkit-gnome-action</FILE>
39 PolKitGnomeActionPrivate
40 <TITLE>PolKitGnomeAction</TITLE>
41 PolKitGnomeAction
42 polkit_gnome_action_new
43 polkit_gnome_action_new_default
44 polkit_gnome_action_get_polkit_result
45 polkit_gnome_action_get_sensitive
46 polkit_gnome_action_set_sensitive
47 polkit_gnome_action_get_visible
48 polkit_gnome_action_set_visible
49 polkit_gnome_action_create_button
50 <SUBSECTION Standard>
51 POLKIT_GNOME_ACTION
52 POLKIT_GNOME_IS_ACTION
53 POLKIT_GNOME_TYPE_ACTION
54 polkit_gnome_action_get_type
55 POLKIT_GNOME_ACTION_CLASS
56 POLKIT_GNOME_IS_ACTION_CLASS
57 POLKIT_GNOME_ACTION_GET_CLASS
58 </SECTION>
59
60 <SECTION>
61 <FILE>polkit-gnome</FILE>
62 </SECTION>
63
64 <SECTION>
65 <FILE>polkit-gnome-auth</FILE>
66 PolKitGnomeAuthCB
67 polkit_gnome_auth_obtain
68 </SECTION>
69
0 polkit_gnome_toggle_action_get_type
1 polkit_gnome_context_get_type
2 polkit_gnome_action_get_type
0 <!-- ##### SECTION Title ##### -->
1 PolKitGnomeAction
2
3 <!-- ##### SECTION Short_Description ##### -->
4
5
6 <!-- ##### SECTION Long_Description ##### -->
7 <para>
8
9 </para>
10
11 <!-- ##### SECTION See_Also ##### -->
12 <para>
13
14 </para>
15
16 <!-- ##### SECTION Stability_Level ##### -->
17
18
19 <!-- ##### STRUCT PolKitGnomeActionPrivate ##### -->
20 <para>
21
22 </para>
23
24
25 <!-- ##### STRUCT PolKitGnomeAction ##### -->
26 <para>
27
28 </para>
29
30
31 <!-- ##### SIGNAL PolKitGnomeAction::auth-end ##### -->
32 <para>
33
34 </para>
35
36 @polkitgnomeaction: the object which received the signal.
37 @arg1:
38
39 <!-- ##### SIGNAL PolKitGnomeAction::auth-start ##### -->
40 <para>
41
42 </para>
43
44 @polkitgnomeaction: the object which received the signal.
45
46 <!-- ##### SIGNAL PolKitGnomeAction::polkit-result-changed ##### -->
47 <para>
48
49 </para>
50
51 @polkitgnomeaction: the object which received the signal.
52 @arg1:
53
54 <!-- ##### ARG PolKitGnomeAction:auth-icon-name ##### -->
55 <para>
56
57 </para>
58
59 <!-- ##### ARG PolKitGnomeAction:auth-label ##### -->
60 <para>
61
62 </para>
63
64 <!-- ##### ARG PolKitGnomeAction:auth-sensitive ##### -->
65 <para>
66
67 </para>
68
69 <!-- ##### ARG PolKitGnomeAction:auth-short-label ##### -->
70 <para>
71
72 </para>
73
74 <!-- ##### ARG PolKitGnomeAction:auth-tooltip ##### -->
75 <para>
76
77 </para>
78
79 <!-- ##### ARG PolKitGnomeAction:auth-visible ##### -->
80 <para>
81
82 </para>
83
84 <!-- ##### ARG PolKitGnomeAction:master-sensitive ##### -->
85 <para>
86
87 </para>
88
89 <!-- ##### ARG PolKitGnomeAction:master-visible ##### -->
90 <para>
91
92 </para>
93
94 <!-- ##### ARG PolKitGnomeAction:no-icon-name ##### -->
95 <para>
96
97 </para>
98
99 <!-- ##### ARG PolKitGnomeAction:no-label ##### -->
100 <para>
101
102 </para>
103
104 <!-- ##### ARG PolKitGnomeAction:no-sensitive ##### -->
105 <para>
106
107 </para>
108
109 <!-- ##### ARG PolKitGnomeAction:no-short-label ##### -->
110 <para>
111
112 </para>
113
114 <!-- ##### ARG PolKitGnomeAction:no-tooltip ##### -->
115 <para>
116
117 </para>
118
119 <!-- ##### ARG PolKitGnomeAction:no-visible ##### -->
120 <para>
121
122 </para>
123
124 <!-- ##### ARG PolKitGnomeAction:polkit-action ##### -->
125 <para>
126
127 </para>
128
129 <!-- ##### ARG PolKitGnomeAction:polkit-action-sufficient ##### -->
130 <para>
131
132 </para>
133
134 <!-- ##### ARG PolKitGnomeAction:self-blocked-icon-name ##### -->
135 <para>
136
137 </para>
138
139 <!-- ##### ARG PolKitGnomeAction:self-blocked-label ##### -->
140 <para>
141
142 </para>
143
144 <!-- ##### ARG PolKitGnomeAction:self-blocked-sensitive ##### -->
145 <para>
146
147 </para>
148
149 <!-- ##### ARG PolKitGnomeAction:self-blocked-short-label ##### -->
150 <para>
151
152 </para>
153
154 <!-- ##### ARG PolKitGnomeAction:self-blocked-tooltip ##### -->
155 <para>
156
157 </para>
158
159 <!-- ##### ARG PolKitGnomeAction:self-blocked-visible ##### -->
160 <para>
161
162 </para>
163
164 <!-- ##### ARG PolKitGnomeAction:target-pid ##### -->
165 <para>
166
167 </para>
168
169 <!-- ##### ARG PolKitGnomeAction:yes-icon-name ##### -->
170 <para>
171
172 </para>
173
174 <!-- ##### ARG PolKitGnomeAction:yes-label ##### -->
175 <para>
176
177 </para>
178
179 <!-- ##### ARG PolKitGnomeAction:yes-sensitive ##### -->
180 <para>
181
182 </para>
183
184 <!-- ##### ARG PolKitGnomeAction:yes-short-label ##### -->
185 <para>
186
187 </para>
188
189 <!-- ##### ARG PolKitGnomeAction:yes-tooltip ##### -->
190 <para>
191
192 </para>
193
194 <!-- ##### ARG PolKitGnomeAction:yes-visible ##### -->
195 <para>
196
197 </para>
198
199 <!-- ##### FUNCTION polkit_gnome_action_new ##### -->
200 <para>
201
202 </para>
203
204 @name:
205 @Returns:
206
207
208 <!-- ##### FUNCTION polkit_gnome_action_new_default ##### -->
209 <para>
210
211 </para>
212
213 @name:
214 @polkit_action:
215 @label:
216 @tooltip:
217 @Returns:
218
219
220 <!-- ##### FUNCTION polkit_gnome_action_get_polkit_result ##### -->
221 <para>
222
223 </para>
224
225 @action:
226 @Returns:
227
228
229 <!-- ##### FUNCTION polkit_gnome_action_get_sensitive ##### -->
230 <para>
231
232 </para>
233
234 @action:
235 @Returns:
236
237
238 <!-- ##### FUNCTION polkit_gnome_action_set_sensitive ##### -->
239 <para>
240
241 </para>
242
243 @action:
244 @sensitive:
245
246
247 <!-- ##### FUNCTION polkit_gnome_action_get_visible ##### -->
248 <para>
249
250 </para>
251
252 @action:
253 @Returns:
254
255
256 <!-- ##### FUNCTION polkit_gnome_action_set_visible ##### -->
257 <para>
258
259 </para>
260
261 @action:
262 @visible:
263
264
265 <!-- ##### FUNCTION polkit_gnome_action_create_button ##### -->
266 <para>
267
268 </para>
269
270 @action:
271 @Returns:
272
273
0 <!-- ##### SECTION Title ##### -->
1 polkit-gnome-auth
2
3 <!-- ##### SECTION Short_Description ##### -->
4
5
6 <!-- ##### SECTION Long_Description ##### -->
7 <para>
8
9 </para>
10
11 <!-- ##### SECTION See_Also ##### -->
12 <para>
13
14 </para>
15
16 <!-- ##### SECTION Stability_Level ##### -->
17
18
19 <!-- ##### USER_FUNCTION PolKitGnomeAuthCB ##### -->
20 <para>
21
22 </para>
23
24 @action:
25 @gained_privilege:
26 @error:
27 @user_data:
28
29
30 <!-- ##### FUNCTION polkit_gnome_auth_obtain ##### -->
31 <para>
32
33 </para>
34
35 @action:
36 @xid:
37 @pid:
38 @callback:
39 @user_data:
40 @error:
41 @Returns:
42
43
0 <!-- ##### SECTION Title ##### -->
1 PolKitGnomeContext
2
3 <!-- ##### SECTION Short_Description ##### -->
4
5
6 <!-- ##### SECTION Long_Description ##### -->
7 <para>
8
9 </para>
10
11 <!-- ##### SECTION See_Also ##### -->
12 <para>
13
14 </para>
15
16 <!-- ##### SECTION Stability_Level ##### -->
17
18
19 <!-- ##### MACRO POLKIT_GNOME_CONTEXT ##### -->
20 <para>
21
22 </para>
23
24 @obj:
25
26
27 <!-- ##### MACRO POLKIT_GNOME_CONTEXT_ERROR ##### -->
28 <para>
29
30 </para>
31
32
33
34 <!-- ##### ENUM PolKitGnomeContextError ##### -->
35 <para>
36
37 </para>
38
39 @POLKIT_GNOME_CONTEXT_ERROR_FAILED:
40
41 <!-- ##### STRUCT PolKitGnomeContextPrivate ##### -->
42 <para>
43
44 </para>
45
46
47 <!-- ##### STRUCT PolKitGnomeContext ##### -->
48 <para>
49
50 </para>
51
52 @pk_context:
53 @pk_tracker:
54
55 <!-- ##### SIGNAL PolKitGnomeContext::config-changed ##### -->
56 <para>
57
58 </para>
59
60 @polkitgnomecontext: the object which received the signal.
61
62 <!-- ##### SIGNAL PolKitGnomeContext::console-kit-db-changed ##### -->
63 <para>
64
65 </para>
66
67 @polkitgnomecontext: the object which received the signal.
68
69 <!-- ##### FUNCTION polkit_gnome_context_get ##### -->
70 <para>
71
72 </para>
73
74 @error:
75 @Returns:
76
77
78 <!-- ##### FUNCTION polkit_gnome_context_error_quark ##### -->
79 <para>
80
81 </para>
82
83 @Returns:
84
85
0 <!-- ##### SECTION Title ##### -->
1 PolKitGnomeToggleAction
2
3 <!-- ##### SECTION Short_Description ##### -->
4
5
6 <!-- ##### SECTION Long_Description ##### -->
7 <para>
8
9 </para>
10
11 <!-- ##### SECTION See_Also ##### -->
12 <para>
13
14 </para>
15
16 <!-- ##### SECTION Stability_Level ##### -->
17
18
19 <!-- ##### STRUCT PolKitGnomeToggleActionPrivate ##### -->
20 <para>
21
22 </para>
23
24
25 <!-- ##### STRUCT PolKitGnomeToggleAction ##### -->
26 <para>
27
28 </para>
29
30
31 <!-- ##### SIGNAL PolKitGnomeToggleAction::toggled ##### -->
32 <para>
33
34 </para>
35
36 @polkitgnometoggleaction: the object which received the signal.
37
38 <!-- ##### ARG PolKitGnomeToggleAction:auth-underway-icon-name ##### -->
39 <para>
40
41 </para>
42
43 <!-- ##### ARG PolKitGnomeToggleAction:auth-underway-label ##### -->
44 <para>
45
46 </para>
47
48 <!-- ##### ARG PolKitGnomeToggleAction:auth-underway-sensitive ##### -->
49 <para>
50
51 </para>
52
53 <!-- ##### ARG PolKitGnomeToggleAction:auth-underway-short-label ##### -->
54 <para>
55
56 </para>
57
58 <!-- ##### ARG PolKitGnomeToggleAction:auth-underway-tooltip ##### -->
59 <para>
60
61 </para>
62
63 <!-- ##### ARG PolKitGnomeToggleAction:auth-underway-visible ##### -->
64 <para>
65
66 </para>
67
68 <!-- ##### FUNCTION polkit_gnome_toggle_action_new ##### -->
69 <para>
70
71 </para>
72
73 @name:
74 @Returns:
75
76
77 <!-- ##### FUNCTION polkit_gnome_toggle_action_new_default ##### -->
78 <para>
79
80 </para>
81
82 @name:
83 @polkit_action:
84 @locked_label:
85 @unlocked_label:
86 @Returns:
87
88
89 <!-- ##### FUNCTION polkit_gnome_toggle_action_create_toggle_button ##### -->
90 <para>
91
92 </para>
93
94 @action:
95 @Returns:
96
97
0 <!-- ##### ARG PolKitGnomeAction:polkit-action-union ##### -->
1 <para>
2
3 </para>
4
5
0 <!-- ##### SECTION Title ##### -->
1 polkit-gnome
2
3 <!-- ##### SECTION Short_Description ##### -->
4
5
6 <!-- ##### SECTION Long_Description ##### -->
7 <para>
8
9 </para>
10
11 <!-- ##### SECTION See_Also ##### -->
12 <para>
13
14 </para>
15
16 <!-- ##### SECTION Stability_Level ##### -->
17
18
0 <?xml version="1.0"?>
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
2 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
3 <!ENTITY version SYSTEM "version.xml">
4 ]>
5 <refentry id="PolKitGnomeAction">
6 <refmeta>
7 <refentrytitle role="top_of_page">PolKitGnomeAction</refentrytitle>
8 <manvolnum>3</manvolnum>
9 <refmiscinfo>POLKIT-GNOME Library</refmiscinfo>
10 </refmeta>
11
12 <refnamediv>
13 <refname>PolKitGnomeAction</refname>
14 <refpurpose>A GtkAction subclass where instances can be tied to a specific PolicyKit action.</refpurpose>
15 <!--[<xref linkend="desc" endterm="desc.title"/>]-->
16 </refnamediv>
17
18 <refsynopsisdiv role="synopsis">
19 <title role="synopsis.title">Synopsis</title>
20
21 <synopsis>
22
23
24
25 <link linkend="PolKitGnomeActionPrivate">PolKitGnomeActionPrivate</link>;
26 <link linkend="PolKitGnomeAction-struct">PolKitGnomeAction</link>;
27 <link linkend="PolKitGnomeAction">PolKitGnomeAction</link>* <link linkend="polkit-gnome-action-new">polkit_gnome_action_new</link> (const <link linkend="gchar">gchar</link> *name);
28 <link linkend="PolKitGnomeAction">PolKitGnomeAction</link>* <link linkend="polkit-gnome-action-new-default">polkit_gnome_action_new_default</link> (const <link linkend="gchar">gchar</link> *name,
29 <link linkend="PolKitAction">PolKitAction</link> *polkit_action,
30 const <link linkend="gchar">gchar</link> *label,
31 const <link linkend="gchar">gchar</link> *tooltip);
32 <link linkend="PolKitResult">PolKitResult</link> <link linkend="polkit-gnome-action-get-polkit-result">polkit_gnome_action_get_polkit_result</link>
33 (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action);
34 <link linkend="gboolean">gboolean</link> <link linkend="polkit-gnome-action-get-sensitive">polkit_gnome_action_get_sensitive</link> (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action);
35 <link linkend="void">void</link> <link linkend="polkit-gnome-action-set-sensitive">polkit_gnome_action_set_sensitive</link> (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action,
36 <link linkend="gboolean">gboolean</link> sensitive);
37 <link linkend="gboolean">gboolean</link> <link linkend="polkit-gnome-action-get-visible">polkit_gnome_action_get_visible</link> (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action);
38 <link linkend="void">void</link> <link linkend="polkit-gnome-action-set-visible">polkit_gnome_action_set_visible</link> (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action,
39 <link linkend="gboolean">gboolean</link> visible);
40 <link linkend="GtkWidget">GtkWidget</link>* <link linkend="polkit-gnome-action-create-button">polkit_gnome_action_create_button</link> (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action);
41
42 </synopsis>
43 </refsynopsisdiv>
44
45 <refsect1 role="object_hierarchy">
46 <title role="object_hierarchy.title">Object Hierarchy</title>
47 <synopsis>
48
49 <link linkend="GObject">GObject</link>
50 +----<link linkend="GtkAction">GtkAction</link>
51 +----PolKitGnomeAction
52 +----<link linkend="PolKitGnomeToggleAction">PolKitGnomeToggleAction</link>
53 </synopsis>
54
55 </refsect1>
56
57
58
59 <refsect1 role="impl_interfaces">
60 <title role="impl_interfaces.title">Implemented Interfaces</title>
61 <para>
62 PolKitGnomeAction implements
63 <link linkend="GtkBuildable">GtkBuildable</link>.</para>
64
65 </refsect1>
66
67
68 <refsect1 role="properties">
69 <title role="properties.title">Properties</title>
70 <synopsis>
71
72 &quot;<link linkend="PolKitGnomeAction--auth-icon-name">auth-icon-name</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
73 &quot;<link linkend="PolKitGnomeAction--auth-label">auth-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
74 &quot;<link linkend="PolKitGnomeAction--auth-sensitive">auth-sensitive</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
75 &quot;<link linkend="PolKitGnomeAction--auth-short-label">auth-short-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
76 &quot;<link linkend="PolKitGnomeAction--auth-tooltip">auth-tooltip</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
77 &quot;<link linkend="PolKitGnomeAction--auth-visible">auth-visible</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
78 &quot;<link linkend="PolKitGnomeAction--master-sensitive">master-sensitive</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
79 &quot;<link linkend="PolKitGnomeAction--master-visible">master-visible</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
80 &quot;<link linkend="PolKitGnomeAction--no-icon-name">no-icon-name</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
81 &quot;<link linkend="PolKitGnomeAction--no-label">no-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
82 &quot;<link linkend="PolKitGnomeAction--no-sensitive">no-sensitive</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
83 &quot;<link linkend="PolKitGnomeAction--no-short-label">no-short-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
84 &quot;<link linkend="PolKitGnomeAction--no-tooltip">no-tooltip</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
85 &quot;<link linkend="PolKitGnomeAction--no-visible">no-visible</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
86 &quot;<link linkend="PolKitGnomeAction--polkit-action">polkit-action</link>&quot; <link linkend="gpointer">gpointer</link> : Read / Write / Construct
87 &quot;<link linkend="PolKitGnomeAction--polkit-action-sufficient">polkit-action-sufficient</link>&quot; <link linkend="GValueArray">GValueArray</link> : Read / Write / Construct
88 &quot;<link linkend="PolKitGnomeAction--self-blocked-icon-name">self-blocked-icon-name</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
89 &quot;<link linkend="PolKitGnomeAction--self-blocked-label">self-blocked-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
90 &quot;<link linkend="PolKitGnomeAction--self-blocked-sensitive">self-blocked-sensitive</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
91 &quot;<link linkend="PolKitGnomeAction--self-blocked-short-label">self-blocked-short-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
92 &quot;<link linkend="PolKitGnomeAction--self-blocked-tooltip">self-blocked-tooltip</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
93 &quot;<link linkend="PolKitGnomeAction--self-blocked-visible">self-blocked-visible</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
94 &quot;<link linkend="PolKitGnomeAction--target-pid">target-pid</link>&quot; <link linkend="guint">guint</link> : Read / Write / Construct
95 &quot;<link linkend="PolKitGnomeAction--yes-icon-name">yes-icon-name</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
96 &quot;<link linkend="PolKitGnomeAction--yes-label">yes-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
97 &quot;<link linkend="PolKitGnomeAction--yes-sensitive">yes-sensitive</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
98 &quot;<link linkend="PolKitGnomeAction--yes-short-label">yes-short-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
99 &quot;<link linkend="PolKitGnomeAction--yes-tooltip">yes-tooltip</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
100 &quot;<link linkend="PolKitGnomeAction--yes-visible">yes-visible</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
101 </synopsis>
102 </refsect1>
103
104 <refsect1 role="signal_proto">
105 <title role="signal_proto.title">Signals</title>
106 <synopsis>
107
108 &quot;<link linkend="PolKitGnomeAction-auth-end">auth-end</link>&quot; : Run Last
109 &quot;<link linkend="PolKitGnomeAction-auth-start">auth-start</link>&quot; : Run Last
110 &quot;<link linkend="PolKitGnomeAction-polkit-result-changed">polkit-result-changed</link>&quot; : Run Last
111 </synopsis>
112 </refsect1>
113
114
115 <refsect1 role="desc">
116 <title role="desc.title">Description</title>
117 <para>
118 Actions in GTK+ represent operations that the user can be perform,
119 along with some information how it should be presented in the
120 interface. Each action provides methods to create icons, menu items
121 and toolbar items representing itself. Each action can have one or
122 more proxy menu item, toolbar button or other proxy
123 widgets. Proxies mirror the state of the action (text label,
124 tooltip, icon, visible, sensitive, etc), and should change when the
125 action's state changes. When the proxy is activated, it should
126 activate its action.
127 </para>
128 <para>
129 Instances of <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> class updates the label, tooltip,
130 icon-name, visible and properties of the parent <link linkend="GtkAction"><type>GtkAction</type></link> instance
131 according to what result PolicyKit gives about a given
132 <link linkend="PolKitAction"><type>PolKitAction</type></link> object. The <link linkend="PolKitGnomeContext"><type>PolKitGnomeContext</type></link> class is used
133 internally to track changes. This means that external events (such
134 as the editing of the /etc/PolicyKit/PolicyKit.conf file,
135 ConsoleKit session activity changes or if the user gains a
136 privilege via authentication) will trigger the action, and thus
137 connected proxy widgets, to be updated.
138 </para>
139 <para>
140 In addition, the <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> class intercepts the ::activate
141 signal defined in <link linkend="GtkAction"><type>GtkAction</type></link>. When the result from PolicyKit is
142 yes, the signal is propagated. If the result is auth,
143 <link linkend="polkit-gnome-auth-show-dialog"><function>polkit_gnome_auth_show_dialog()</function></link> will be used to bring up an
144 authentication dialog for the given <link linkend="PolKitAction"><type>PolKitAction</type></link>. If the user
145 succesfully gained the privilege, a ::activate signal will be
146 synthesized. If the result is no, the signal is also propagated.
147 </para>
148 <para>
149 As a result, everything happens under the covers; the application
150 programmer using <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> will only get the ::activate
151 signal when the answer from PolicyKit is yes and as such don't have
152 to worry about bringing up authentication dialogs if the property
153 "no-sensitive" is set to <link linkend="FALSE:CAPS"><type>FALSE</type></link>.
154 </para>
155 <para>
156 When an authentication dialog is show, the <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> class
157 will pass the XID of the top-level window that the proxy widget
158 causing the activation to <link linkend="polkit-gnome-auth-show-dialog"><function>polkit_gnome_auth_show_dialog()</function></link>.
159 </para>
160 <para>
161 An example of how to use <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> follows. First, build
162 the following program
163 </para>
164 <para>
165 <programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../examples/polkit-gnome-example.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
166 </para>
167 <para>
168 with
169 </para>
170 <para>
171 <programlisting>gcc -o polkit-gnome-example `pkg-config --cflags --libs polkit-gnome` polkit-gnome-example.c</programlisting>
172 </para>
173 <para>
174 Then, put the following content
175 </para>
176 <para>
177 <programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../examples/polkit-gnome-example.policy" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
178 </para>
179 <para>
180 into a file
181 <literal>/usr/share/PolicyKit/policy/polkit-gnome-example.policy</literal>. Finally,
182 run <literal>polkit-gnome-example</literal>. It should display a
183 window like this:
184 </para>
185 <para>
186 <inlinegraphic fileref="polkit-gnome-example-screenshot.png" format="PNG"/>
187 </para>
188 <para>
189 If the "Twiddle!" button is pressed, an authentication dialog
190 should pop up
191 </para>
192 <para>
193 <inlinegraphic fileref="polkit-gnome-example-auth-dialog-twiddle.png" format="PNG"/>
194 </para>
195 <para>
196 Here is how what the application looks like if the user gains
197 authorization for all the actions:
198 </para>
199 <para>
200 <inlinegraphic fileref="polkit-gnome-example-screenshot-authorized.png" format="PNG"/>
201 </para>
202 <para>
203 Regarding how to build an example mechanism that this GTK+
204 application can take advantage of, please refer to the
205 <link linkend="PolKitContext"><type>PolKitContext</type></link> class for examples.</para>
206 <para>
207
208 </para>
209 </refsect1>
210
211 <refsect1 role="details">
212 <title role="details.title">Details</title>
213 <refsect2>
214 <title><anchor id="PolKitGnomeActionPrivate" role="struct"/>PolKitGnomeActionPrivate</title>
215 <indexterm><primary>PolKitGnomeActionPrivate</primary></indexterm><programlisting>typedef struct _PolKitGnomeActionPrivate PolKitGnomeActionPrivate;</programlisting>
216 <para>
217
218 </para></refsect2>
219 <refsect2>
220 <title><anchor id="PolKitGnomeAction-struct" role="struct"/>PolKitGnomeAction</title>
221 <indexterm><primary>PolKitGnomeAction</primary></indexterm><programlisting>typedef struct _PolKitGnomeAction PolKitGnomeAction;</programlisting>
222 <para>
223 The PolKitGnomeAction struct contains only private data members and should not be accessed directly.</para>
224 <para>
225
226 </para></refsect2>
227 <refsect2>
228 <title><anchor id="polkit-gnome-action-new" role="function"/>polkit_gnome_action_new ()</title>
229 <indexterm><primary>polkit_gnome_action_new</primary></indexterm><programlisting><link linkend="PolKitGnomeAction">PolKitGnomeAction</link>* polkit_gnome_action_new (const <link linkend="gchar">gchar</link> *name);</programlisting>
230 <para>
231 Creates a new <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> object. The typical use for this
232 function is for specialized use where
233 <link linkend="polkit-gnome-action-new-default"><function>polkit_gnome_action_new_default()</function></link> does not meet the needs of the
234 application. A short example of the usage of this contructor
235 follows.
236 </para>
237 <para>
238 If the 'polkit-action' property is <link linkend="NULL:CAPS"><type>NULL</type></link> the behavior is similar to
239 as if a <link linkend="PolKitAction"><type>PolKitAction</type></link> returned <link linkend="POLKIT-RESULT-YES:CAPS"><type>POLKIT_RESULT_YES</type></link>.
240 </para>
241 <para>
242 One can set the 'polkit-action-sufficient' property to a
243 <link linkend="GValueArray"><type>GValueArray</type></link> of pointers to <link linkend="PolKitAction"><type>PolKitAction</type></link> objects. The semantics of
244 this property is that if the user is authorized for any of the
245 given actions in 'polkit-action-sufficient' then the behavior is
246 the same as if they're authorized for the action denoted by
247 'polkit-action'. This is useful in a setup where you have two
248 similar actions and one implies the other. For example, in
249 gnome-system-monitor there are two actions
250 <literal>org.gnome.system-monitor.increase-own-priority</literal>
251 (Increase the priority of a process owned by yourself) and
252 <literal>org.gnome.system-monitor.change-priorty</literal> (Change
253 priority of any process). As the latter clearly implies the former,
254 one would set the latter in the 'polkit-action-sufficient'
255 property when constructing a <link linkend="PolKitAction"><type>PolKitAction</type></link> for the former.
256 </para>
257 <para>
258 <programlisting>
259 PolKitAction *polkit_action;
260 PolKitGnomeAction *action;
261
262 polkit_action = polkit_action_new ();
263 polkit_action_set_action_id (polkit_action, "org.example.some-policykit-action");
264
265 action = polkit_gnome_action_new ("blabla", NULL);
266 g_object_set (action,
267 "polkit-action", polkit_action,
268 "no-visible", TRUE,
269 "no-sensitive", FALSE,
270 "no-short-label", "The Action no can do!",
271 "no-label", "The Action is not permitted!",
272 "no-tooltip", "The Tooltip (no)",
273 "no-icon-name", GTK_STOCK_NO,
274
275 "auth-visible", TRUE,
276 "auth-sensitive", TRUE,
277 "auth-short-label", "The Action requires auth...",
278 "auth-label", "The Action requires auth...",
279 "auth-tooltip", "The Tooltip (auth)",
280 "auth-icon-name", GTK_STOCK_DIALOG_AUTHENTICATION,
281
282 "yes-visible", TRUE,
283 "yes-sensitive", TRUE,
284 "yes-short-label", "Action!",
285 "yes-label", "Just do the Action!",
286 "yes-tooltip", "The Tooltip (yes)",
287 "yes-icon-name", GTK_STOCK_YES,
288 NULL);
289 </programlisting></para>
290 <para>
291
292 </para><variablelist role="params">
293 <varlistentry><term><parameter>name</parameter>&nbsp;:</term>
294 <listitem><simpara> A unique name for the action
295 </simpara></listitem></varlistentry>
296 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> or <link linkend="NULL:CAPS"><type>NULL</type></link> if error is set
297 </simpara></listitem></varlistentry>
298 </variablelist></refsect2>
299 <refsect2>
300 <title><anchor id="polkit-gnome-action-new-default" role="function"/>polkit_gnome_action_new_default ()</title>
301 <indexterm><primary>polkit_gnome_action_new_default</primary></indexterm><programlisting><link linkend="PolKitGnomeAction">PolKitGnomeAction</link>* polkit_gnome_action_new_default (const <link linkend="gchar">gchar</link> *name,
302 <link linkend="PolKitAction">PolKitAction</link> *polkit_action,
303 const <link linkend="gchar">gchar</link> *label,
304 const <link linkend="gchar">gchar</link> *tooltip);</programlisting>
305 <para>
306 Creates a new <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> object with the default
307 behavior for a given <link linkend="PolKitAction"><type>PolKitAction</type></link> object.
308 </para>
309 <para>
310 Default behavior is defined by the label and tooltip being
311 identical across all three four states, the action being visible in
312 all four states, and the action being insensitive only in the state
313 where the result from PolicyKit is no and self-blocked. Only when
314 PolicyKit returns one of the 'auth*' results, the icon_name
315 property will be set to <link linkend="GTK-STOCK-DIALOG-AUTHENTICATION:CAPS"><type>GTK_STOCK_DIALOG_AUTHENTICATION</type></link>.
316 </para>
317 <para>
318 The caller can always modify individual aspects of the action after
319 creation, e.g. change the tooltip for the self-blocked, no, auth
320 and yes states.
321 </para>
322 <para>
323 If the given polkit_action is <link linkend="NULL:CAPS"><type>NULL</type></link> the behavior is similar to as
324 if a <link linkend="PolKitAction"><type>PolKitAction</type></link> returned <link linkend="POLKIT-RESULT-YES:CAPS"><type>POLKIT_RESULT_YES</type></link>.</para>
325 <para>
326
327 </para><variablelist role="params">
328 <varlistentry><term><parameter>name</parameter>&nbsp;:</term>
329 <listitem><simpara> A unique name for the action
330 </simpara></listitem></varlistentry>
331 <varlistentry><term><parameter>polkit_action</parameter>&nbsp;:</term>
332 <listitem><simpara> the <link linkend="PolKitAction"><type>PolKitAction</type></link> to track
333 </simpara></listitem></varlistentry>
334 <varlistentry><term><parameter>label</parameter>&nbsp;:</term>
335 <listitem><simpara> the label to use (will also apply to short-label)
336 </simpara></listitem></varlistentry>
337 <varlistentry><term><parameter>tooltip</parameter>&nbsp;:</term>
338 <listitem><simpara> the tool tip to use
339 </simpara></listitem></varlistentry>
340 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> or <link linkend="NULL:CAPS"><type>NULL</type></link> if error is set
341 </simpara></listitem></varlistentry>
342 </variablelist></refsect2>
343 <refsect2>
344 <title><anchor id="polkit-gnome-action-get-polkit-result" role="function"/>polkit_gnome_action_get_polkit_result ()</title>
345 <indexterm><primary>polkit_gnome_action_get_polkit_result</primary></indexterm><programlisting><link linkend="PolKitResult">PolKitResult</link> polkit_gnome_action_get_polkit_result
346 (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action);</programlisting>
347 <para>
348 Gets the <link linkend="PolKitResult"><type>PolKitResult</type></link> that indicates whether the user is
349 privileged to do the <link linkend="PolKitAction"><type>PolKitAction</type></link> associated with this
350 <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> object.</para>
351 <para>
352
353 </para><variablelist role="params">
354 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
355 <listitem><simpara> The <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> object
356 </simpara></listitem></varlistentry>
357 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The <link linkend="PolKitAction"><type>PolKitAction</type></link> object. The caller shall not unref this object.
358 </simpara></listitem></varlistentry>
359 </variablelist></refsect2>
360 <refsect2>
361 <title><anchor id="polkit-gnome-action-get-sensitive" role="function"/>polkit_gnome_action_get_sensitive ()</title>
362 <indexterm><primary>polkit_gnome_action_get_sensitive</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> polkit_gnome_action_get_sensitive (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action);</programlisting>
363 <para>
364 Get the master sensitivity, see PolKitGnomeAction:master-sensitive:
365 for details.</para>
366 <para>
367
368 </para><variablelist role="params">
369 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
370 <listitem><simpara> The <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> object
371 </simpara></listitem></varlistentry>
372 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the master sensitivity
373 </simpara></listitem></varlistentry>
374 </variablelist></refsect2>
375 <refsect2>
376 <title><anchor id="polkit-gnome-action-set-sensitive" role="function"/>polkit_gnome_action_set_sensitive ()</title>
377 <indexterm><primary>polkit_gnome_action_set_sensitive</primary></indexterm><programlisting><link linkend="void">void</link> polkit_gnome_action_set_sensitive (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action,
378 <link linkend="gboolean">gboolean</link> sensitive);</programlisting>
379 <para>
380 Set the master sensitivity, see PolKitGnomeAction:master-sensitive:
381 for details.</para>
382 <para>
383
384 </para><variablelist role="params">
385 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
386 <listitem><simpara> The <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> object
387 </simpara></listitem></varlistentry>
388 <varlistentry><term><parameter>sensitive</parameter>&nbsp;:</term>
389 <listitem><simpara> master sensitivity
390 </simpara></listitem></varlistentry>
391 </variablelist></refsect2>
392 <refsect2>
393 <title><anchor id="polkit-gnome-action-get-visible" role="function"/>polkit_gnome_action_get_visible ()</title>
394 <indexterm><primary>polkit_gnome_action_get_visible</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> polkit_gnome_action_get_visible (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action);</programlisting>
395 <para>
396 Get the master visibility, see PolKitGnomeAction:master-visible:
397 for details.</para>
398 <para>
399
400 </para><variablelist role="params">
401 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
402 <listitem><simpara> The <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> object
403 </simpara></listitem></varlistentry>
404 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the master visibility
405 </simpara></listitem></varlistentry>
406 </variablelist></refsect2>
407 <refsect2>
408 <title><anchor id="polkit-gnome-action-set-visible" role="function"/>polkit_gnome_action_set_visible ()</title>
409 <indexterm><primary>polkit_gnome_action_set_visible</primary></indexterm><programlisting><link linkend="void">void</link> polkit_gnome_action_set_visible (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action,
410 <link linkend="gboolean">gboolean</link> visible);</programlisting>
411 <para>
412 Set the master visibility, see PolKitGnomeAction:master-visible:
413 for details.</para>
414 <para>
415
416 </para><variablelist role="params">
417 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
418 <listitem><simpara> The <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> object
419 </simpara></listitem></varlistentry>
420 <varlistentry><term><parameter>visible</parameter>&nbsp;:</term>
421 <listitem><simpara> master visibility
422 </simpara></listitem></varlistentry>
423 </variablelist></refsect2>
424 <refsect2>
425 <title><anchor id="polkit-gnome-action-create-button" role="function"/>polkit_gnome_action_create_button ()</title>
426 <indexterm><primary>polkit_gnome_action_create_button</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* polkit_gnome_action_create_button (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action);</programlisting>
427 <para>
428 Create a button for the given action that displays the label,
429 tooltip and icon_name corresponding to whether the state, according
430 to PolicyKit, is no, auth or yes.</para>
431 <para>
432
433 </para><variablelist role="params">
434 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
435 <listitem><simpara> The <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> object
436 </simpara></listitem></varlistentry>
437 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A <link linkend="GtkButton"><type>GtkButton</type></link> instance connected to the action
438 </simpara></listitem></varlistentry>
439 </variablelist></refsect2>
440
441 </refsect1>
442 <refsect1 role="property_details">
443 <title role="property_details.title">Property Details</title>
444 <refsect2><title><anchor id="PolKitGnomeAction--auth-icon-name"/>The <literal>&quot;auth-icon-name&quot;</literal> property</title>
445 <indexterm><primary>PolKitGnomeAction:auth-icon-name</primary></indexterm><programlisting> &quot;auth-icon-name&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
446 <para>If PolicyKit evaluates the result as 'auth', use this icon-name.</para><para>Default value: NULL</para>
447 </refsect2>
448 <refsect2><title><anchor id="PolKitGnomeAction--auth-label"/>The <literal>&quot;auth-label&quot;</literal> property</title>
449 <indexterm><primary>PolKitGnomeAction:auth-label</primary></indexterm><programlisting> &quot;auth-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
450 <para>If PolicyKit evaluates the result as 'auth', use this label.</para><para>Default value: NULL</para>
451 </refsect2>
452 <refsect2><title><anchor id="PolKitGnomeAction--auth-sensitive"/>The <literal>&quot;auth-sensitive&quot;</literal> property</title>
453 <indexterm><primary>PolKitGnomeAction:auth-sensitive</primary></indexterm><programlisting> &quot;auth-sensitive&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
454 <para>If PolicyKit evaluates the result as 'auth', whether the action will be sensitive.</para><para>Default value: TRUE</para>
455 </refsect2>
456 <refsect2><title><anchor id="PolKitGnomeAction--auth-short-label"/>The <literal>&quot;auth-short-label&quot;</literal> property</title>
457 <indexterm><primary>PolKitGnomeAction:auth-short-label</primary></indexterm><programlisting> &quot;auth-short-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
458 <para>If PolicyKit evaluates the result as 'auth', use this short-label.</para><para>Default value: NULL</para>
459 </refsect2>
460 <refsect2><title><anchor id="PolKitGnomeAction--auth-tooltip"/>The <literal>&quot;auth-tooltip&quot;</literal> property</title>
461 <indexterm><primary>PolKitGnomeAction:auth-tooltip</primary></indexterm><programlisting> &quot;auth-tooltip&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
462 <para>If PolicyKit evaluates the result as 'auth', use this tooltip.</para><para>Default value: NULL</para>
463 </refsect2>
464 <refsect2><title><anchor id="PolKitGnomeAction--auth-visible"/>The <literal>&quot;auth-visible&quot;</literal> property</title>
465 <indexterm><primary>PolKitGnomeAction:auth-visible</primary></indexterm><programlisting> &quot;auth-visible&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
466 <para>If PolicyKit evaluates the result as 'auth', whether the action will be visible.</para><para>Default value: TRUE</para>
467 </refsect2>
468 <refsect2><title><anchor id="PolKitGnomeAction--master-sensitive"/>The <literal>&quot;master-sensitive&quot;</literal> property</title>
469 <indexterm><primary>PolKitGnomeAction:master-sensitive</primary></indexterm><programlisting> &quot;master-sensitive&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
470 <para>Can be set to FALSE to force insensitivity no matter what PolicyKit reports.</para><para>Default value: TRUE</para>
471 </refsect2>
472 <refsect2><title><anchor id="PolKitGnomeAction--master-visible"/>The <literal>&quot;master-visible&quot;</literal> property</title>
473 <indexterm><primary>PolKitGnomeAction:master-visible</primary></indexterm><programlisting> &quot;master-visible&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
474 <para>Can be set to FALSE to force invisibility no matter what PolicyKit reports.</para><para>Default value: TRUE</para>
475 </refsect2>
476 <refsect2><title><anchor id="PolKitGnomeAction--no-icon-name"/>The <literal>&quot;no-icon-name&quot;</literal> property</title>
477 <indexterm><primary>PolKitGnomeAction:no-icon-name</primary></indexterm><programlisting> &quot;no-icon-name&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
478 <para>If PolicyKit evaluates the result as 'no', use this icon-name.</para><para>Default value: NULL</para>
479 </refsect2>
480 <refsect2><title><anchor id="PolKitGnomeAction--no-label"/>The <literal>&quot;no-label&quot;</literal> property</title>
481 <indexterm><primary>PolKitGnomeAction:no-label</primary></indexterm><programlisting> &quot;no-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
482 <para>If PolicyKit evaluates the result as 'no', use this label.</para><para>Default value: NULL</para>
483 </refsect2>
484 <refsect2><title><anchor id="PolKitGnomeAction--no-sensitive"/>The <literal>&quot;no-sensitive&quot;</literal> property</title>
485 <indexterm><primary>PolKitGnomeAction:no-sensitive</primary></indexterm><programlisting> &quot;no-sensitive&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
486 <para>If PolicyKit evaluates the result as 'no', whether the action will be sensitive.</para><para>Default value: FALSE</para>
487 </refsect2>
488 <refsect2><title><anchor id="PolKitGnomeAction--no-short-label"/>The <literal>&quot;no-short-label&quot;</literal> property</title>
489 <indexterm><primary>PolKitGnomeAction:no-short-label</primary></indexterm><programlisting> &quot;no-short-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
490 <para>If PolicyKit evaluates the result as 'no', use this short-label.</para><para>Default value: NULL</para>
491 </refsect2>
492 <refsect2><title><anchor id="PolKitGnomeAction--no-tooltip"/>The <literal>&quot;no-tooltip&quot;</literal> property</title>
493 <indexterm><primary>PolKitGnomeAction:no-tooltip</primary></indexterm><programlisting> &quot;no-tooltip&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
494 <para>If PolicyKit evaluates the result as 'no', use this tooltip.</para><para>Default value: NULL</para>
495 </refsect2>
496 <refsect2><title><anchor id="PolKitGnomeAction--no-visible"/>The <literal>&quot;no-visible&quot;</literal> property</title>
497 <indexterm><primary>PolKitGnomeAction:no-visible</primary></indexterm><programlisting> &quot;no-visible&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
498 <para>If PolicyKit evaluates the result as 'no', whether the action will be visible.</para><para>Default value: TRUE</para>
499 </refsect2>
500 <refsect2><title><anchor id="PolKitGnomeAction--polkit-action"/>The <literal>&quot;polkit-action&quot;</literal> property</title>
501 <indexterm><primary>PolKitGnomeAction:polkit-action</primary></indexterm><programlisting> &quot;polkit-action&quot; <link linkend="gpointer">gpointer</link> : Read / Write / Construct</programlisting>
502 <para>The PolKitAction object this GTK+ action is tracking.</para></refsect2>
503 <refsect2><title><anchor id="PolKitGnomeAction--polkit-action-sufficient"/>The <literal>&quot;polkit-action-sufficient&quot;</literal> property</title>
504 <indexterm><primary>PolKitGnomeAction:polkit-action-sufficient</primary></indexterm><programlisting> &quot;polkit-action-sufficient&quot; <link linkend="GValueArray">GValueArray</link> : Read / Write / Construct</programlisting>
505 <para>An array of PolKitAction objects that are sufficient to have authorizations for.</para></refsect2>
506 <refsect2><title><anchor id="PolKitGnomeAction--self-blocked-icon-name"/>The <literal>&quot;self-blocked-icon-name&quot;</literal> property</title>
507 <indexterm><primary>PolKitGnomeAction:self-blocked-icon-name</primary></indexterm><programlisting> &quot;self-blocked-icon-name&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
508 <para>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this icon-name.</para><para>Default value: NULL</para>
509 </refsect2>
510 <refsect2><title><anchor id="PolKitGnomeAction--self-blocked-label"/>The <literal>&quot;self-blocked-label&quot;</literal> property</title>
511 <indexterm><primary>PolKitGnomeAction:self-blocked-label</primary></indexterm><programlisting> &quot;self-blocked-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
512 <para>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this label.</para><para>Default value: NULL</para>
513 </refsect2>
514 <refsect2><title><anchor id="PolKitGnomeAction--self-blocked-sensitive"/>The <literal>&quot;self-blocked-sensitive&quot;</literal> property</title>
515 <indexterm><primary>PolKitGnomeAction:self-blocked-sensitive</primary></indexterm><programlisting> &quot;self-blocked-sensitive&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
516 <para>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, whether the action will be sensitive.</para><para>Default value: FALSE</para>
517 </refsect2>
518 <refsect2><title><anchor id="PolKitGnomeAction--self-blocked-short-label"/>The <literal>&quot;self-blocked-short-label&quot;</literal> property</title>
519 <indexterm><primary>PolKitGnomeAction:self-blocked-short-label</primary></indexterm><programlisting> &quot;self-blocked-short-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
520 <para>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this short-label.</para><para>Default value: NULL</para>
521 </refsect2>
522 <refsect2><title><anchor id="PolKitGnomeAction--self-blocked-tooltip"/>The <literal>&quot;self-blocked-tooltip&quot;</literal> property</title>
523 <indexterm><primary>PolKitGnomeAction:self-blocked-tooltip</primary></indexterm><programlisting> &quot;self-blocked-tooltip&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
524 <para>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this tooltip.</para><para>Default value: NULL</para>
525 </refsect2>
526 <refsect2><title><anchor id="PolKitGnomeAction--self-blocked-visible"/>The <literal>&quot;self-blocked-visible&quot;</literal> property</title>
527 <indexterm><primary>PolKitGnomeAction:self-blocked-visible</primary></indexterm><programlisting> &quot;self-blocked-visible&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
528 <para>If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, whether the action will be visible.</para><para>Default value: TRUE</para>
529 </refsect2>
530 <refsect2><title><anchor id="PolKitGnomeAction--target-pid"/>The <literal>&quot;target-pid&quot;</literal> property</title>
531 <indexterm><primary>PolKitGnomeAction:target-pid</primary></indexterm><programlisting> &quot;target-pid&quot; <link linkend="guint">guint</link> : Read / Write / Construct</programlisting>
532 <para>The target process id to receive the authorization; if 0 it is the current process.</para><para>Default value: 0</para>
533 </refsect2>
534 <refsect2><title><anchor id="PolKitGnomeAction--yes-icon-name"/>The <literal>&quot;yes-icon-name&quot;</literal> property</title>
535 <indexterm><primary>PolKitGnomeAction:yes-icon-name</primary></indexterm><programlisting> &quot;yes-icon-name&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
536 <para>If PolicyKit evaluates the result as 'yes', use this icon-name.</para><para>Default value: NULL</para>
537 </refsect2>
538 <refsect2><title><anchor id="PolKitGnomeAction--yes-label"/>The <literal>&quot;yes-label&quot;</literal> property</title>
539 <indexterm><primary>PolKitGnomeAction:yes-label</primary></indexterm><programlisting> &quot;yes-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
540 <para>If PolicyKit evaluates the result as 'yes', use this label.</para><para>Default value: NULL</para>
541 </refsect2>
542 <refsect2><title><anchor id="PolKitGnomeAction--yes-sensitive"/>The <literal>&quot;yes-sensitive&quot;</literal> property</title>
543 <indexterm><primary>PolKitGnomeAction:yes-sensitive</primary></indexterm><programlisting> &quot;yes-sensitive&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
544 <para>If PolicyKit evaluates the result as 'yes', whether the action will be sensitive.</para><para>Default value: TRUE</para>
545 </refsect2>
546 <refsect2><title><anchor id="PolKitGnomeAction--yes-short-label"/>The <literal>&quot;yes-short-label&quot;</literal> property</title>
547 <indexterm><primary>PolKitGnomeAction:yes-short-label</primary></indexterm><programlisting> &quot;yes-short-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
548 <para>If PolicyKit evaluates the result as 'yes', use this short-label.</para><para>Default value: NULL</para>
549 </refsect2>
550 <refsect2><title><anchor id="PolKitGnomeAction--yes-tooltip"/>The <literal>&quot;yes-tooltip&quot;</literal> property</title>
551 <indexterm><primary>PolKitGnomeAction:yes-tooltip</primary></indexterm><programlisting> &quot;yes-tooltip&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
552 <para>If PolicyKit evaluates the result as 'yes', use this tooltip.</para><para>Default value: NULL</para>
553 </refsect2>
554 <refsect2><title><anchor id="PolKitGnomeAction--yes-visible"/>The <literal>&quot;yes-visible&quot;</literal> property</title>
555 <indexterm><primary>PolKitGnomeAction:yes-visible</primary></indexterm><programlisting> &quot;yes-visible&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
556 <para>If PolicyKit evaluates the result as 'yes', whether the action will be visible.</para><para>Default value: TRUE</para>
557 </refsect2>
558
559 </refsect1>
560
561 <refsect1 role="signals">
562 <title role="signals.title">Signal Details</title>
563 <refsect2><title><anchor id="PolKitGnomeAction-auth-end"/>The <literal>&quot;auth-end&quot;</literal> signal</title>
564 <indexterm><primary>PolKitGnomeAction::auth-end</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action,
565 <link linkend="gboolean">gboolean</link> gained_privilege,
566 <link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
567 <para>
568 The ::auth-end signal is emitted when the an authentication
569 session ends and carries information about whether the
570 privilege was obtained or not.</para>
571 <para>
572
573 </para><variablelist role="params">
574 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
575 <listitem><simpara> the object
576 </simpara></listitem></varlistentry>
577 <varlistentry><term><parameter>gained_privilege</parameter>&nbsp;:</term>
578 <listitem><simpara> whether the privilege was gained
579 </simpara></listitem></varlistentry>
580 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
581 <listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
582 </variablelist></refsect2><refsect2><title><anchor id="PolKitGnomeAction-auth-start"/>The <literal>&quot;auth-start&quot;</literal> signal</title>
583 <indexterm><primary>PolKitGnomeAction::auth-start</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action,
584 <link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
585 <para>
586 The ::auth-start signal is emitted when an authentication
587 session starts.</para>
588 <para>
589
590 </para><variablelist role="params">
591 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
592 <listitem><simpara> the object
593 </simpara></listitem></varlistentry>
594 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
595 <listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
596 </variablelist></refsect2><refsect2><title><anchor id="PolKitGnomeAction-polkit-result-changed"/>The <literal>&quot;polkit-result-changed&quot;</literal> signal</title>
597 <indexterm><primary>PolKitGnomeAction::polkit-result-changed</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="PolKitGnomeAction">PolKitGnomeAction</link> *action,
598 <link linkend="gint">gint</link> current_result,
599 <link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
600 <para>
601 The ::polkit-result-changed signal is emitted when the
602 PolicyKit result changes. This can happen when external
603 factors (config file, ConsoleKit, privilege granted /
604 revoked) change since the <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link> class listens
605 for events using the <link linkend="PolKitGnomeContext"><type>PolKitGnomeContext</type></link> class.</para>
606 <para>
607
608 </para><variablelist role="params">
609 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
610 <listitem><simpara> the object
611 </simpara></listitem></varlistentry>
612 <varlistentry><term><parameter>current_result</parameter>&nbsp;:</term>
613 <listitem><simpara> current <link linkend="PolKitResult"><type>PolKitResult</type></link> from PolicyKit regarding given <link linkend="PolKitAction"><type>PolKitAction</type></link> object
614 </simpara></listitem></varlistentry>
615 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
616 <listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
617 </variablelist></refsect2>
618 </refsect1>
619
620
621
622
623 <refsect1><refsect2 /><refsect2 /></refsect1>
624 </refentry>
0 <?xml version="1.0"?>
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
2 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
3 <!ENTITY version SYSTEM "version.xml">
4 ]>
5 <refentry id="polkit-gnome-polkit-gnome-auth">
6 <refmeta>
7 <refentrytitle role="top_of_page">Authentication Dialogs</refentrytitle>
8 <manvolnum>3</manvolnum>
9 <refmiscinfo>POLKIT-GNOME Library</refmiscinfo>
10 </refmeta>
11
12 <refnamediv>
13 <refname>Authentication Dialogs</refname>
14 <refpurpose>Show authentication dialogs to gain privileges</refpurpose>
15 <!--[<xref linkend="desc" endterm="desc.title"/>]-->
16 </refnamediv>
17
18 <refsynopsisdiv role="synopsis">
19 <title role="synopsis.title">Synopsis</title>
20
21 <synopsis>
22
23
24
25 <link linkend="void">void</link> (<link linkend="PolKitGnomeAuthCB">*PolKitGnomeAuthCB</link>) (<link linkend="PolKitAction">PolKitAction</link> *action,
26 <link linkend="gboolean">gboolean</link> gained_privilege,
27 <link linkend="GError">GError</link> *error,
28 <link linkend="gpointer">gpointer</link> user_data);
29 <link linkend="gboolean">gboolean</link> <link linkend="polkit-gnome-auth-obtain">polkit_gnome_auth_obtain</link> (<link linkend="PolKitAction">PolKitAction</link> *action,
30 <link linkend="guint">guint</link> xid,
31 <link linkend="pid-t">pid_t</link> pid,
32 <link linkend="PolKitGnomeAuthCB">PolKitGnomeAuthCB</link> callback,
33 <link linkend="gpointer">gpointer</link> user_data,
34 <link linkend="GError">GError</link> **error);
35 </synopsis>
36 </refsynopsisdiv>
37
38
39
40
41
42
43
44
45
46 <refsect1 role="desc">
47 <title role="desc.title">Description</title>
48 <para>
49 Show authentication dialogs to gain privileges.</para>
50 <para>
51
52 </para>
53 </refsect1>
54
55 <refsect1 role="details">
56 <title role="details.title">Details</title>
57 <refsect2>
58 <title><anchor id="PolKitGnomeAuthCB" role="function"/>PolKitGnomeAuthCB ()</title>
59 <indexterm><primary>PolKitGnomeAuthCB</primary></indexterm><programlisting><link linkend="void">void</link> (*PolKitGnomeAuthCB) (<link linkend="PolKitAction">PolKitAction</link> *action,
60 <link linkend="gboolean">gboolean</link> gained_privilege,
61 <link linkend="GError">GError</link> *error,
62 <link linkend="gpointer">gpointer</link> user_data);</programlisting>
63 <para>
64 The type of the callback function for
65 <link linkend="polkit-gnome-auth-show-dialog"><function>polkit_gnome_auth_show_dialog()</function></link>.</para>
66 <para>
67
68 </para><variablelist role="params">
69 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
70 <listitem><simpara> the <link linkend="PolKitAction"><type>PolKitAction</type></link> passed in <link linkend="polkit-gnome-auth-show-dialog"><function>polkit_gnome_auth_show_dialog()</function></link>
71 </simpara></listitem></varlistentry>
72 <varlistentry><term><parameter>gained_privilege</parameter>&nbsp;:</term>
73 <listitem><simpara> whether the user gained the privilege. Set to
74 <link linkend="FALSE:CAPS"><type>FALSE</type></link> if error is set. If set to <link linkend="TRUE:CAPS"><type>TRUE</type></link>, error will not be set.
75 </simpara></listitem></varlistentry>
76 <varlistentry><term><parameter>error</parameter>&nbsp;:</term>
77 <listitem><simpara> if the call failed, this parameter will be non-<link linkend="NULL:CAPS"><type>NULL</type></link>. The
78 callee shall free the error.
79 </simpara></listitem></varlistentry>
80 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
81 <listitem><simpara> user data
82 </simpara></listitem></varlistentry>
83 </variablelist></refsect2>
84 <refsect2>
85 <title><anchor id="polkit-gnome-auth-obtain" role="function"/>polkit_gnome_auth_obtain ()</title>
86 <indexterm><primary>polkit_gnome_auth_obtain</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> polkit_gnome_auth_obtain (<link linkend="PolKitAction">PolKitAction</link> *action,
87 <link linkend="guint">guint</link> xid,
88 <link linkend="pid-t">pid_t</link> pid,
89 <link linkend="PolKitGnomeAuthCB">PolKitGnomeAuthCB</link> callback,
90 <link linkend="gpointer">gpointer</link> user_data,
91 <link linkend="GError">GError</link> **error);</programlisting>
92 <para>
93 Applications can use this function to show a dialog for the user
94 asking her to authenticate in order to gain privileges to do the
95 given action. The authentication, for security reasons, happens in
96 a separate process; this function is merely a wrapper around a
97 D-Bus call across the session message bus to the
98 <literal>org.freedesktop.PolicyKit.AuthenticationAgent</literal>
99 service. Depending on the setup, this may be the Authentication
100 Agent shipped with PolicyKit-gnome or it may be another
101 implementation. For example, if the user is in KDE it may be an
102 Authentication Agent using the Qt toolkit.
103 </para>
104 <para>
105 The Authentication Agent shipped with PolicyKit-gnome is described
106 in <link linkend="ref-auth-daemon">this section</link>.
107 </para>
108 <para>
109 This function is similar to the <link linkend="polkit-auth-obtain"><function>polkit_auth_obtain()</function></link> function
110 supplied in <literal>libpolkit-dbus</literal> except that this
111 function is asynchronous.</para>
112 <para>
113
114 </para><variablelist role="params">
115 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
116 <listitem><simpara> The <link linkend="PolKitAction"><type>PolKitAction</type></link> to make the user authenticate for
117 </simpara></listitem></varlistentry>
118 <varlistentry><term><parameter>xid</parameter>&nbsp;:</term>
119 <listitem><simpara> X11 window ID for the window that the dialog will be transient for. If there is no window, pass 0.
120 </simpara></listitem></varlistentry>
121 <varlistentry><term><parameter>pid</parameter>&nbsp;:</term>
122 <listitem><simpara> Process ID of process to grant authorization to. Normally one wants to pass result of <link linkend="getpid"><function>getpid()</function></link>.
123 </simpara></listitem></varlistentry>
124 <varlistentry><term><parameter>callback</parameter>&nbsp;:</term>
125 <listitem><simpara> Function to call when authentication is done
126 </simpara></listitem></varlistentry>
127 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
128 <listitem><simpara> Data to pass to the callback function
129 </simpara></listitem></varlistentry>
130 <varlistentry><term><parameter>error</parameter>&nbsp;:</term>
131 <listitem><simpara> Return location for error
132 </simpara></listitem></varlistentry>
133 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><type>TRUE</type></link> if the authentication session was scheduled to
134 start. <link linkend="FALSE:CAPS"><type>FALSE</type></link> if error is set (and no callback will be made).
135 </simpara></listitem></varlistentry>
136 </variablelist></refsect2>
137
138 </refsect1>
139
140
141
142
143
144 <refsect1><refsect2 /><refsect2 /></refsect1>
145 </refentry>
0 <?xml version="1.0"?>
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
2 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
3 <!ENTITY version SYSTEM "version.xml">
4 ]>
5 <refentry id="PolKitGnomeContext">
6 <refmeta>
7 <refentrytitle role="top_of_page">PolKitGnomeContext</refentrytitle>
8 <manvolnum>3</manvolnum>
9 <refmiscinfo>POLKIT-GNOME Library</refmiscinfo>
10 </refmeta>
11
12 <refnamediv>
13 <refname>PolKitGnomeContext</refname>
14 <refpurpose>Convenience functions for using PolicyKit from GTK+ and GNOME applications.</refpurpose>
15 <!--[<xref linkend="desc" endterm="desc.title"/>]-->
16 </refnamediv>
17
18 <refsynopsisdiv role="synopsis">
19 <title role="synopsis.title">Synopsis</title>
20
21 <synopsis>
22
23
24
25 #define <link linkend="POLKIT-GNOME-CONTEXT:CAPS">POLKIT_GNOME_CONTEXT</link> (obj)
26 #define <link linkend="POLKIT-GNOME-CONTEXT-ERROR:CAPS">POLKIT_GNOME_CONTEXT_ERROR</link>
27 enum <link linkend="PolKitGnomeContextError">PolKitGnomeContextError</link>;
28 <link linkend="PolKitGnomeContextPrivate">PolKitGnomeContextPrivate</link>;
29 <link linkend="PolKitGnomeContext-struct">PolKitGnomeContext</link>;
30 <link linkend="PolKitGnomeContext">PolKitGnomeContext</link>* <link linkend="polkit-gnome-context-get">polkit_gnome_context_get</link> (<link linkend="GError">GError</link> **error);
31 <link linkend="GQuark">GQuark</link> <link linkend="polkit-gnome-context-error-quark">polkit_gnome_context_error_quark</link> (void);
32
33 </synopsis>
34 </refsynopsisdiv>
35
36 <refsect1 role="object_hierarchy">
37 <title role="object_hierarchy.title">Object Hierarchy</title>
38 <synopsis>
39
40 <link linkend="GObject">GObject</link>
41 +----PolKitGnomeContext
42 </synopsis>
43
44 </refsect1>
45
46
47
48
49
50
51 <refsect1 role="signal_proto">
52 <title role="signal_proto.title">Signals</title>
53 <synopsis>
54
55 &quot;<link linkend="PolKitGnomeContext-config-changed">config-changed</link>&quot; : Run Last
56 &quot;<link linkend="PolKitGnomeContext-console-kit-db-changed">console-kit-db-changed</link>&quot; : Run Last
57 </synopsis>
58 </refsect1>
59
60
61 <refsect1 role="desc">
62 <title role="desc.title">Description</title>
63 <para>
64 This class provides convenience functions for using PolicyKit from
65 GTK+ and GNOME applications including setting up main loop
66 integration and system bus connections. Rather than using
67 callbacks, GObject signals are provided when external factors
68 change (e.g. the PolicyKit.conf configuration file changes or
69 ConsoleKit reports activity changes).
70 </para>
71 <para>
72 Actual usage of PolicyKit is still through the main PolicyKit API
73 through the public pk_context and pk_tracker variables.
74 </para>
75 <para>
76 This class is implemented as a singleton meaning that several
77 callers will share the underlying <link linkend="PolKitContext"><type>PolKitContext</type></link> and <link linkend="PolKitTracker"><type>PolKitTracker</type></link>
78 objects. Do not use any of the life cycle methods of these objects;
79 only use them to gather information.</para>
80 <para>
81
82 </para>
83 </refsect1>
84
85 <refsect1 role="details">
86 <title role="details.title">Details</title>
87 <refsect2>
88 <title><anchor id="POLKIT-GNOME-CONTEXT:CAPS" role="macro"/>POLKIT_GNOME_CONTEXT()</title>
89 <indexterm><primary>POLKIT_GNOME_CONTEXT</primary></indexterm><programlisting>#define POLKIT_GNOME_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POLKIT_GNOME_TYPE_CONTEXT, PolKitGnomeContext))
90 </programlisting>
91 <para>
92
93 </para><variablelist role="params">
94 <varlistentry><term><parameter>obj</parameter>&nbsp;:</term>
95 <listitem><simpara>
96
97
98 </simpara></listitem></varlistentry>
99 </variablelist></refsect2>
100 <refsect2>
101 <title><anchor id="POLKIT-GNOME-CONTEXT-ERROR:CAPS" role="macro"/>POLKIT_GNOME_CONTEXT_ERROR</title>
102 <indexterm><primary>POLKIT_GNOME_CONTEXT_ERROR</primary></indexterm><programlisting>#define POLKIT_GNOME_CONTEXT_ERROR polkit_gnome_context_error_quark ()
103 </programlisting>
104 <para>
105 Error domain for using the GNOME PolicyKit context. Errors in this
106 domain will be from the <link linkend="PolKitGnomeContextError"><type>PolKitGnomeContextError</type></link> enumeration. See
107 <link linkend="GError"><type>GError</type></link> for information on error domains.</para>
108 <para>
109
110 </para></refsect2>
111 <refsect2>
112 <title><anchor id="PolKitGnomeContextError" role="enum"/>enum PolKitGnomeContextError</title>
113 <indexterm><primary>PolKitGnomeContextError</primary></indexterm><programlisting>typedef enum
114 {
115 POLKIT_GNOME_CONTEXT_ERROR_FAILED
116 } PolKitGnomeContextError;
117 </programlisting>
118 <para>
119 Error codes describing how <link linkend="PolKitGnomeContext"><type>PolKitGnomeContext</type></link> can fail.</para>
120 <para>
121
122 </para><variablelist role="enum">
123 <varlistentry>
124 <term><anchor id="POLKIT-GNOME-CONTEXT-ERROR-FAILED:CAPS" role="constant"/><literal>POLKIT_GNOME_CONTEXT_ERROR_FAILED</literal></term>
125 <listitem><simpara> General error
126 </simpara></listitem>
127 </varlistentry>
128 </variablelist></refsect2>
129 <refsect2>
130 <title><anchor id="PolKitGnomeContextPrivate" role="struct"/>PolKitGnomeContextPrivate</title>
131 <indexterm><primary>PolKitGnomeContextPrivate</primary></indexterm><programlisting>typedef struct _PolKitGnomeContextPrivate PolKitGnomeContextPrivate;</programlisting>
132 <para>
133
134 </para></refsect2>
135 <refsect2>
136 <title><anchor id="PolKitGnomeContext-struct" role="struct"/>PolKitGnomeContext</title>
137 <indexterm><primary>PolKitGnomeContext</primary></indexterm><programlisting>typedef struct {
138 PolKitContext *pk_context;
139 PolKitTracker *pk_tracker;
140 } PolKitGnomeContext;
141 </programlisting>
142 <para>
143 Provide access to <link linkend="PolKitContext"><type>PolKitContext</type></link> and <link linkend="PolKitTracker"><type>PolKitTracker</type></link> instances
144 shared among many callers.</para>
145 <para>
146
147 </para><variablelist role="struct">
148 <varlistentry>
149 <term><link linkend="PolKitContext">PolKitContext</link>&nbsp;*<structfield>pk_context</structfield>;</term>
150 <listitem><simpara> for interfacing with PolicyKit; e.g. typically <link linkend="polkit-context-can-caller-do-action"><function>polkit_context_can_caller_do_action()</function></link>
151 </simpara></listitem>
152 </varlistentry>
153 <varlistentry>
154 <term><link linkend="PolKitTracker">PolKitTracker</link>&nbsp;*<structfield>pk_tracker</structfield>;</term>
155 <listitem><simpara> this is used for effieciently obtaining <link linkend="PolKitCaller"><type>PolKitCaller</type></link> objects
156 </simpara></listitem>
157 </varlistentry>
158 </variablelist></refsect2>
159 <refsect2>
160 <title><anchor id="polkit-gnome-context-get" role="function"/>polkit_gnome_context_get ()</title>
161 <indexterm><primary>polkit_gnome_context_get</primary></indexterm><programlisting><link linkend="PolKitGnomeContext">PolKitGnomeContext</link>* polkit_gnome_context_get (<link linkend="GError">GError</link> **error);</programlisting>
162 <para>
163 Returns a <link linkend="PolKitGnomeContext"><type>PolKitGnomeContext</type></link> object. The context is a global
164 singleton that may be shared with other callers of this function.
165 </para>
166 <para>
167 This operation can fail if the system message bus is not available.
168 </para>
169 <para>
170 When done with using this object, call <link linkend="g-object-unref"><function>g_object_unref()</function></link>. This is
171 such that resources can be freed when all callers have unreffed it.</para>
172 <para>
173
174 </para><variablelist role="params">
175 <varlistentry><term><parameter>error</parameter>&nbsp;:</term>
176 <listitem><simpara> return location for error
177 </simpara></listitem></varlistentry>
178 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="PolKitGnomeContext"><type>PolKitGnomeContext</type></link> or NULL if error is set
179 </simpara></listitem></varlistentry>
180 </variablelist></refsect2>
181 <refsect2>
182 <title><anchor id="polkit-gnome-context-error-quark" role="function"/>polkit_gnome_context_error_quark ()</title>
183 <indexterm><primary>polkit_gnome_context_error_quark</primary></indexterm><programlisting><link linkend="GQuark">GQuark</link> polkit_gnome_context_error_quark (void);</programlisting>
184 <para>
185
186 </para><variablelist role="params">
187 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>
188
189
190 </simpara></listitem></varlistentry>
191 </variablelist></refsect2>
192
193 </refsect1>
194
195 <refsect1 role="signals">
196 <title role="signals.title">Signal Details</title>
197 <refsect2><title><anchor id="PolKitGnomeContext-config-changed"/>The <literal>&quot;config-changed&quot;</literal> signal</title>
198 <indexterm><primary>PolKitGnomeContext::config-changed</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="PolKitGnomeContext">PolKitGnomeContext</link> *context,
199 <link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
200 <para>
201 The ::config-changed signal is emitted when PolicyKit
202 configuration (e.g. /etc/PolicyKit/PolicyKit.conf or
203 .policy files) changes content.
204 </para>
205 <para>
206 As this is one contributing factor to what answer PolicyKit
207 will return, the caller should act on this signal and query
208 PolicyKit for any actions it cares about.</para>
209 <para>
210
211 </para><variablelist role="params">
212 <varlistentry><term><parameter>context</parameter>&nbsp;:</term>
213 <listitem><simpara> the object
214 </simpara></listitem></varlistentry>
215 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
216 <listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
217 </variablelist></refsect2><refsect2><title><anchor id="PolKitGnomeContext-console-kit-db-changed"/>The <literal>&quot;console-kit-db-changed&quot;</literal> signal</title>
218 <indexterm><primary>PolKitGnomeContext::console-kit-db-changed</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="PolKitGnomeContext">PolKitGnomeContext</link> *context,
219 <link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
220 <para>
221 The ::console-kit-db-changed signal is emitted when
222 ConsoleKit configuration changes; e.g. when a session
223 becomes active or inactive.
224 </para>
225 <para>
226 As this is one contributing factor to what answer PolicyKit
227 will return, the caller should act on this signal and query
228 PolicyKit for any actions it cares about.</para>
229 <para>
230
231 </para><variablelist role="params">
232 <varlistentry><term><parameter>context</parameter>&nbsp;:</term>
233 <listitem><simpara> the object
234 </simpara></listitem></varlistentry>
235 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
236 <listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
237 </variablelist></refsect2>
238 </refsect1>
239
240
241
242
243 <refsect1><refsect2 /><refsect2 /></refsect1>
244 </refentry>
0 <?xml version="1.0"?>
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
2 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
3 <!ENTITY version SYSTEM "version.xml">
4 ]>
5 <refentry id="PolKitGnomeToggleAction">
6 <refmeta>
7 <refentrytitle role="top_of_page">PolKitGnomeToggleAction</refentrytitle>
8 <manvolnum>3</manvolnum>
9 <refmiscinfo>POLKIT-GNOME Library</refmiscinfo>
10 </refmeta>
11
12 <refnamediv>
13 <refname>PolKitGnomeToggleAction</refname>
14 <refpurpose>A GtkAction that can be toggled to
15 obtain and give up PolicyKit authorizations.</refpurpose>
16 <!--[<xref linkend="desc" endterm="desc.title"/>]-->
17 </refnamediv>
18
19 <refsynopsisdiv role="synopsis">
20 <title role="synopsis.title">Synopsis</title>
21
22 <synopsis>
23
24
25
26 <link linkend="PolKitGnomeToggleActionPrivate">PolKitGnomeToggleActionPrivate</link>;
27 <link linkend="PolKitGnomeToggleAction-struct">PolKitGnomeToggleAction</link>;
28 <link linkend="PolKitGnomeToggleAction">PolKitGnomeToggleAction</link>* <link linkend="polkit-gnome-toggle-action-new">polkit_gnome_toggle_action_new</link> (const <link linkend="gchar">gchar</link> *name);
29 <link linkend="PolKitGnomeToggleAction">PolKitGnomeToggleAction</link>* <link linkend="polkit-gnome-toggle-action-new-default">polkit_gnome_toggle_action_new_default</link>
30 (const <link linkend="gchar">gchar</link> *name,
31 <link linkend="PolKitAction">PolKitAction</link> *polkit_action,
32 const <link linkend="gchar">gchar</link> *locked_label,
33 const <link linkend="gchar">gchar</link> *unlocked_label);
34 <link linkend="GtkWidget">GtkWidget</link>* <link linkend="polkit-gnome-toggle-action-create-toggle-button">polkit_gnome_toggle_action_create_toggle_button</link>
35 (<link linkend="PolKitGnomeToggleAction">PolKitGnomeToggleAction</link> *action);
36
37 </synopsis>
38 </refsynopsisdiv>
39
40 <refsect1 role="object_hierarchy">
41 <title role="object_hierarchy.title">Object Hierarchy</title>
42 <synopsis>
43
44 <link linkend="GObject">GObject</link>
45 +----<link linkend="GtkAction">GtkAction</link>
46 +----<link linkend="PolKitGnomeAction">PolKitGnomeAction</link>
47 +----PolKitGnomeToggleAction
48 </synopsis>
49
50 </refsect1>
51
52
53
54 <refsect1 role="impl_interfaces">
55 <title role="impl_interfaces.title">Implemented Interfaces</title>
56 <para>
57 PolKitGnomeToggleAction implements
58 <link linkend="GtkBuildable">GtkBuildable</link>.</para>
59
60 </refsect1>
61
62
63 <refsect1 role="properties">
64 <title role="properties.title">Properties</title>
65 <synopsis>
66
67 &quot;<link linkend="PolKitGnomeToggleAction--auth-underway-icon-name">auth-underway-icon-name</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
68 &quot;<link linkend="PolKitGnomeToggleAction--auth-underway-label">auth-underway-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
69 &quot;<link linkend="PolKitGnomeToggleAction--auth-underway-sensitive">auth-underway-sensitive</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
70 &quot;<link linkend="PolKitGnomeToggleAction--auth-underway-short-label">auth-underway-short-label</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
71 &quot;<link linkend="PolKitGnomeToggleAction--auth-underway-tooltip">auth-underway-tooltip</link>&quot; <link linkend="gchararray">gchararray</link> : Read / Write
72 &quot;<link linkend="PolKitGnomeToggleAction--auth-underway-visible">auth-underway-visible</link>&quot; <link linkend="gboolean">gboolean</link> : Read / Write
73 </synopsis>
74 </refsect1>
75
76 <refsect1 role="signal_proto">
77 <title role="signal_proto.title">Signals</title>
78 <synopsis>
79
80 &quot;<link linkend="PolKitGnomeToggleAction-toggled">toggled</link>&quot; : Run Last
81 </synopsis>
82 </refsect1>
83
84
85 <refsect1 role="desc">
86 <title role="desc.title">Description</title>
87 <para>
88 For an example of how to use this class, see the documentation for
89 <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link>.</para>
90 <para>
91
92 </para>
93 </refsect1>
94
95 <refsect1 role="details">
96 <title role="details.title">Details</title>
97 <refsect2>
98 <title><anchor id="PolKitGnomeToggleActionPrivate" role="struct"/>PolKitGnomeToggleActionPrivate</title>
99 <indexterm><primary>PolKitGnomeToggleActionPrivate</primary></indexterm><programlisting>typedef struct _PolKitGnomeToggleActionPrivate PolKitGnomeToggleActionPrivate;</programlisting>
100 <para>
101
102 </para></refsect2>
103 <refsect2>
104 <title><anchor id="PolKitGnomeToggleAction-struct" role="struct"/>PolKitGnomeToggleAction</title>
105 <indexterm><primary>PolKitGnomeToggleAction</primary></indexterm><programlisting>typedef struct _PolKitGnomeToggleAction PolKitGnomeToggleAction;</programlisting>
106 <para>
107 The PolKitGnomeToggleAction struct contains only private data members and should not be accessed directly.</para>
108 <para>
109
110 </para></refsect2>
111 <refsect2>
112 <title><anchor id="polkit-gnome-toggle-action-new" role="function"/>polkit_gnome_toggle_action_new ()</title>
113 <indexterm><primary>polkit_gnome_toggle_action_new</primary></indexterm><programlisting><link linkend="PolKitGnomeToggleAction">PolKitGnomeToggleAction</link>* polkit_gnome_toggle_action_new (const <link linkend="gchar">gchar</link> *name);</programlisting>
114 <para>
115 Creates a new <link linkend="PolKitGnomeToggleAction"><type>PolKitGnomeToggleAction</type></link> object. The typical use for
116 this function is for specialized use where
117 <link linkend="polkit-gnome-toggle-action-new-default"><function>polkit_gnome_toggle_action_new_default()</function></link> does not meet the needs of
118 the application.
119 </para>
120 <para>
121 If the 'polkit-toggle_action' property is <link linkend="NULL:CAPS"><type>NULL</type></link> the behavior is similar to
122 as if a <link linkend="PolKitAction"><type>PolKitAction</type></link> returned <link linkend="POLKIT-RESULT-YES:CAPS"><type>POLKIT_RESULT_YES</type></link>.</para>
123 <para>
124
125 </para><variablelist role="params">
126 <varlistentry><term><parameter>name</parameter>&nbsp;:</term>
127 <listitem><simpara> A unique name for the toggle_action
128 </simpara></listitem></varlistentry>
129 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="PolKitGnomeToggleAction"><type>PolKitGnomeToggleAction</type></link> or <link linkend="NULL:CAPS"><type>NULL</type></link> if error is set
130 </simpara></listitem></varlistentry>
131 </variablelist></refsect2>
132 <refsect2>
133 <title><anchor id="polkit-gnome-toggle-action-new-default" role="function"/>polkit_gnome_toggle_action_new_default ()</title>
134 <indexterm><primary>polkit_gnome_toggle_action_new_default</primary></indexterm><programlisting><link linkend="PolKitGnomeToggleAction">PolKitGnomeToggleAction</link>* polkit_gnome_toggle_action_new_default
135 (const <link linkend="gchar">gchar</link> *name,
136 <link linkend="PolKitAction">PolKitAction</link> *polkit_action,
137 const <link linkend="gchar">gchar</link> *locked_label,
138 const <link linkend="gchar">gchar</link> *unlocked_label);</programlisting>
139 <para>
140 Creates a new <link linkend="PolKitGnomeToggleAction"><type>PolKitGnomeToggleAction</type></link> object with the default
141 behavior for a given <link linkend="PolKitAction"><type>PolKitAction</type></link> object. The toggle represents
142 whether the user is authorized for the given <link linkend="PolKitAction"><type>PolKitAction</type></link>. If the
143 user is not authorized, clicking on a proxy widget (if it's
144 sensitive) will cause an authentication dialog to appear. If the
145 user is authorized, clicking on a proxy widget will cause all
146 authorizations to be given up (aka revoked). The ::toggled signal
147 is only emitted when such transitions occur. Thus, the user of this
148 class will never have to deal with bringing up authentication
149 dialogs; it's all handled behind the scenes.
150 </para>
151 <para>
152 As such, the typical use case for this action is an UI where the
153 user is encouraged to give up authorizations.
154 </para>
155 <para>
156 There's also support for the corner case where the user is
157 authorized because of implicit authorizations. In this case,
158 toggling the action will "grant" a negative authorization for the
159 user. By toggling the action again, the negative authorization will
160 be revoked.
161 </para>
162 <para>
163 Default behavior is defined as having the icon_name be 'stock_lock'
164 by default except for the YES PolicyKit answer where it's set to
165 'stock_lock-open'. No tooltips are set. The label and short-label
166 will be 'locked_label' everywhere except in the YES state where
167 it's set to 'unlocked-label'. When authentication is underway, the
168 label will be "Authenticating..." and icon_name is untouched. If
169 the PolicyKit answer is NO, sensitivity is set to
170 <link linkend="FALSE:CAPS"><type>FALSE</type></link>. Visibility is always set to <link linkend="TRUE:CAPS"><type>TRUE</type></link>.
171 </para>
172 <para>
173 The caller can always modify individual aspects of the
174 toggle_action after creation, e.g. change the tooltip for the no,
175 auth and yes states; see the parent class <link linkend="PolKitGnomeAction"><type>PolKitGnomeAction</type></link>. In
176 addition to the properties in the parent class, this subclass
177 sports six new properties, "auth-underway-*" to control the look
178 of proxy widgets when authentication is underway.
179 </para>
180 <para>
181 If the given polkit_toggle_action is <link linkend="NULL:CAPS"><type>NULL</type></link> the behavior is similar to as
182 if a <link linkend="PolKitAction"><type>PolKitAction</type></link> returned <link linkend="POLKIT-RESULT-YES:CAPS"><type>POLKIT_RESULT_YES</type></link>.</para>
183 <para>
184
185 </para><variablelist role="params">
186 <varlistentry><term><parameter>name</parameter>&nbsp;:</term>
187 <listitem><simpara> A unique name for the toggle_action
188 </simpara></listitem></varlistentry>
189 <varlistentry><term><parameter>polkit_action</parameter>&nbsp;:</term>
190 <listitem><simpara> the <link linkend="PolKitAction"><type>PolKitAction</type></link> to track
191 </simpara></listitem></varlistentry>
192 <varlistentry><term><parameter>locked_label</parameter>&nbsp;:</term>
193 <listitem><simpara> The label to show when the user do not possess the
194 authorization, e.g. "Click to make changes"
195 </simpara></listitem></varlistentry>
196 <varlistentry><term><parameter>unlocked_label</parameter>&nbsp;:</term>
197 <listitem><simpara> The label to show when the user does posses the
198 authorization; e.g. "Click to prevent changes"
199 </simpara></listitem></varlistentry>
200 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a new <link linkend="PolKitGnomeToggleAction"><type>PolKitGnomeToggleAction</type></link> or <link linkend="NULL:CAPS"><type>NULL</type></link> if error is set
201 </simpara></listitem></varlistentry>
202 </variablelist></refsect2>
203 <refsect2>
204 <title><anchor id="polkit-gnome-toggle-action-create-toggle-button" role="function"/>polkit_gnome_toggle_action_create_toggle_button ()</title>
205 <indexterm><primary>polkit_gnome_toggle_action_create_toggle_button</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* polkit_gnome_toggle_action_create_toggle_button
206 (<link linkend="PolKitGnomeToggleAction">PolKitGnomeToggleAction</link> *action);</programlisting>
207 <para>
208 Create a toggle button for the given action that displays the
209 label, tooltip and icon_name corresponding to whether the state,
210 according to PolicyKit, is no, auth or yes.</para>
211 <para>
212
213 </para><variablelist role="params">
214 <varlistentry><term><parameter>action</parameter>&nbsp;:</term>
215 <listitem><simpara> The <link linkend="PolKitGnomeToggleAction"><type>PolKitGnomeToggleAction</type></link> object
216 </simpara></listitem></varlistentry>
217 <varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> A <link linkend="GtkToggleButton"><type>GtkToggleButton</type></link> instance connected to the action
218 </simpara></listitem></varlistentry>
219 </variablelist></refsect2>
220
221 </refsect1>
222 <refsect1 role="property_details">
223 <title role="property_details.title">Property Details</title>
224 <refsect2><title><anchor id="PolKitGnomeToggleAction--auth-underway-icon-name"/>The <literal>&quot;auth-underway-icon-name&quot;</literal> property</title>
225 <indexterm><primary>PolKitGnomeToggleAction:auth-underway-icon-name</primary></indexterm><programlisting> &quot;auth-underway-icon-name&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
226 <para>When authentication is underway, use this icon-name.</para><para>Default value: NULL</para>
227 </refsect2>
228 <refsect2><title><anchor id="PolKitGnomeToggleAction--auth-underway-label"/>The <literal>&quot;auth-underway-label&quot;</literal> property</title>
229 <indexterm><primary>PolKitGnomeToggleAction:auth-underway-label</primary></indexterm><programlisting> &quot;auth-underway-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
230 <para>When authentication is underway, use this label.</para><para>Default value: NULL</para>
231 </refsect2>
232 <refsect2><title><anchor id="PolKitGnomeToggleAction--auth-underway-sensitive"/>The <literal>&quot;auth-underway-sensitive&quot;</literal> property</title>
233 <indexterm><primary>PolKitGnomeToggleAction:auth-underway-sensitive</primary></indexterm><programlisting> &quot;auth-underway-sensitive&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
234 <para>When authentication is underway, whether the action will be sensitive.</para><para>Default value: TRUE</para>
235 </refsect2>
236 <refsect2><title><anchor id="PolKitGnomeToggleAction--auth-underway-short-label"/>The <literal>&quot;auth-underway-short-label&quot;</literal> property</title>
237 <indexterm><primary>PolKitGnomeToggleAction:auth-underway-short-label</primary></indexterm><programlisting> &quot;auth-underway-short-label&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
238 <para>When authentication is underway, use this short-label.</para><para>Default value: NULL</para>
239 </refsect2>
240 <refsect2><title><anchor id="PolKitGnomeToggleAction--auth-underway-tooltip"/>The <literal>&quot;auth-underway-tooltip&quot;</literal> property</title>
241 <indexterm><primary>PolKitGnomeToggleAction:auth-underway-tooltip</primary></indexterm><programlisting> &quot;auth-underway-tooltip&quot; <link linkend="gchararray">gchararray</link> : Read / Write</programlisting>
242 <para>When authentication is underway, use this tooltip.</para><para>Default value: NULL</para>
243 </refsect2>
244 <refsect2><title><anchor id="PolKitGnomeToggleAction--auth-underway-visible"/>The <literal>&quot;auth-underway-visible&quot;</literal> property</title>
245 <indexterm><primary>PolKitGnomeToggleAction:auth-underway-visible</primary></indexterm><programlisting> &quot;auth-underway-visible&quot; <link linkend="gboolean">gboolean</link> : Read / Write</programlisting>
246 <para>When authentication is underway, whether the action will be visible.</para><para>Default value: TRUE</para>
247 </refsect2>
248
249 </refsect1>
250
251 <refsect1 role="signals">
252 <title role="signals.title">Signal Details</title>
253 <refsect2><title><anchor id="PolKitGnomeToggleAction-toggled"/>The <literal>&quot;toggled&quot;</literal> signal</title>
254 <indexterm><primary>PolKitGnomeToggleAction::toggled</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="PolKitGnomeToggleAction">PolKitGnomeToggleAction</link> *toggle_action,
255 <link linkend="gpointer">gpointer</link> user_data) : Run Last</programlisting>
256 <para>
257 The ::toggled signal is emitted when the button is toggled.</para>
258 <para>
259
260 </para><variablelist role="params">
261 <varlistentry><term><parameter>toggle_action</parameter>&nbsp;:</term>
262 <listitem><simpara> the object
263 </simpara></listitem></varlistentry>
264 <varlistentry><term><parameter>user_data</parameter>&nbsp;:</term>
265 <listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
266 </variablelist></refsect2>
267 </refsect1>
268
269
270
271
272 <refsect1><refsect2 /><refsect2 /></refsect1>
273 </refentry>
00
11 bin_PROGRAMS = polkit-gnome-example
22
3 polkit_gnome_example_SOURCES = \
3 polkit_gnome_example_SOURCES = \
44 polkit-gnome-example.c
55
66 polkit_gnome_example_CPPFLAGS = \
1212 $(AM_CPPFLAGS)
1313
1414 polkit_gnome_example_CFLAGS = \
15 $(POLKIT_GNOME_CFLAGS) \
15 $(GTK_CFLAGS) \
16 $(DBUS_GLIB_CFLAGS) \
17 $(POLKIT_DBUS_CFLAGS) \
1618 $(WARN_CFLAGS) \
1719 $(AM_CFLAGS)
1820
1921 polkit_gnome_example_LDFLAGS = \
2022 $(AM_LDFLAGS)
2123
22 polkit_gnome_example_LDADD = \
23 $(POLKIT_GNOME_LIBS) \
24 $(INTLLIBS)
25
26 ## Helper
27
28 libexec_PROGRAMS = polkit-gnome-example-helper
29
30 polkit_gnome_example_helper_SOURCES = \
31 polkit-gnome-example-helper.c
32
33 polkit_gnome_example_helper_CPPFLAGS = \
34 -I$(top_srcdir) \
35 -DLIBEXECDIR=\""$(libexecdir)"\" \
36 -DDATADIR=\""$(pkgdatadir)"\" \
37 -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
38 $(DISABLE_DEPRECATED) \
39 $(AM_CPPFLAGS)
40
41
42 polkit_gnome_example_helper_CFLAGS = \
43 $(POLKIT_GNOME_CFLAGS) \
44 $(WARN_CFLAGS) \
45 $(AM_CFLAGS)
46
47 polkit_gnome_example_helper_LDADD = \
48 $(POLKIT_GNOME_LIBS) \
49 $(INTLLIBS)
24 polkit_gnome_example_LDADD = \
25 $(GTK_LIBS) \
26 $(DBUS_GLIB_LIBS) \
27 $(POLKIT_DBUS_LIBS) \
28 $(POLKIT_GRANT_LIBS) \
29 $(INTLLIBS) \
30 $(top_builddir)/polkit-gnome/libpolkit-gnome.la
5031
5132 # PolicyKit action definitions for this example
5233 #
5738 # http://bugzilla.gnome.org/show_bug.cgi?id=462312
5839 @INTLTOOL_POLICY_RULE@
5940
60 # TODO: FIXME: this breaks 'make distcheck'
6141 check:
6242 $(POLKIT_POLICY_FILE_VALIDATE) $(dist_polkit_policy_DATA)
6343
3333 build_triplet = @build@
3434 host_triplet = @host@
3535 bin_PROGRAMS = polkit-gnome-example$(EXEEXT)
36 libexec_PROGRAMS = polkit-gnome-example-helper$(EXEEXT)
3736 subdir = examples
3837 DIST_COMMON = $(dist_polkit_policy_DATA) $(srcdir)/Makefile.am \
3938 $(srcdir)/Makefile.in
4443 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
4544 CONFIG_HEADER = $(top_builddir)/config.h
4645 CONFIG_CLEAN_FILES =
47 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
46 am__installdirs = "$(DESTDIR)$(bindir)" \
4847 "$(DESTDIR)$(polkit_policydir)"
4948 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
50 libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
51 PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS)
49 PROGRAMS = $(bin_PROGRAMS)
5250 am_polkit_gnome_example_OBJECTS = \
5351 polkit_gnome_example-polkit-gnome-example.$(OBJEXT)
5452 polkit_gnome_example_OBJECTS = $(am_polkit_gnome_example_OBJECTS)
5553 am__DEPENDENCIES_1 =
5654 polkit_gnome_example_DEPENDENCIES = $(am__DEPENDENCIES_1) \
57 $(am__DEPENDENCIES_1)
55 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
56 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
57 $(top_builddir)/polkit-gnome/libpolkit-gnome.la
5858 polkit_gnome_example_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
5959 $(LIBTOOLFLAGS) --mode=link $(CCLD) \
6060 $(polkit_gnome_example_CFLAGS) $(CFLAGS) \
6161 $(polkit_gnome_example_LDFLAGS) $(LDFLAGS) -o $@
62 am_polkit_gnome_example_helper_OBJECTS = polkit_gnome_example_helper-polkit-gnome-example-helper.$(OBJEXT)
63 polkit_gnome_example_helper_OBJECTS = \
64 $(am_polkit_gnome_example_helper_OBJECTS)
65 polkit_gnome_example_helper_DEPENDENCIES = $(am__DEPENDENCIES_1) \
66 $(am__DEPENDENCIES_1)
67 polkit_gnome_example_helper_LINK = $(LIBTOOL) --tag=CC \
68 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
69 $(polkit_gnome_example_helper_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
70 $(LDFLAGS) -o $@
7162 DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
7263 depcomp = $(SHELL) $(top_srcdir)/depcomp
7364 am__depfiles_maybe = depfiles
8071 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
8172 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
8273 $(LDFLAGS) -o $@
83 SOURCES = $(polkit_gnome_example_SOURCES) \
84 $(polkit_gnome_example_helper_SOURCES)
85 DIST_SOURCES = $(polkit_gnome_example_SOURCES) \
86 $(polkit_gnome_example_helper_SOURCES)
74 SOURCES = $(polkit_gnome_example_SOURCES)
75 DIST_SOURCES = $(polkit_gnome_example_SOURCES)
8776 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
8877 am__vpath_adj = case $$p in \
8978 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
121110 CXXFLAGS = @CXXFLAGS@
122111 CYGPATH_W = @CYGPATH_W@
123112 DATADIRNAME = @DATADIRNAME@
113 DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
114 DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
124115 DEFS = @DEFS@
125116 DEPDIR = @DEPDIR@
126117 DISABLE_DEPRECATED = @DISABLE_DEPRECATED@
136127 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
137128 GMOFILES = @GMOFILES@
138129 GMSGFMT = @GMSGFMT@
130 GNOME_VFS_CFLAGS = @GNOME_VFS_CFLAGS@
131 GNOME_VFS_LIBS = @GNOME_VFS_LIBS@
139132 GREP = @GREP@
133 GTKDOC_CHECK = @GTKDOC_CHECK@
134 GTK_CFLAGS = @GTK_CFLAGS@
135 GTK_LIBS = @GTK_LIBS@
140136 HELP_DIR = @HELP_DIR@
137 HTML_DIR = @HTML_DIR@
141138 INSTALL = @INSTALL@
142139 INSTALL_DATA = @INSTALL_DATA@
143140 INSTALL_PROGRAM = @INSTALL_PROGRAM@
174171 LIBTOOL = @LIBTOOL@
175172 LN_S = @LN_S@
176173 LTLIBOBJS = @LTLIBOBJS@
174 LT_AGE = @LT_AGE@
175 LT_CURRENT = @LT_CURRENT@
176 LT_REVISION = @LT_REVISION@
177177 MAINT = @MAINT@
178178 MAKEINFO = @MAKEINFO@
179179 MKDIR_P = @MKDIR_P@
191191 PATH_SEPARATOR = @PATH_SEPARATOR@
192192 PKG_CONFIG = @PKG_CONFIG@
193193 POFILES = @POFILES@
194 POLKIT_GNOME_CFLAGS = @POLKIT_GNOME_CFLAGS@
195 POLKIT_GNOME_LIBS = @POLKIT_GNOME_LIBS@
194 POLKIT_DBUS_CFLAGS = @POLKIT_DBUS_CFLAGS@
195 POLKIT_DBUS_LIBS = @POLKIT_DBUS_LIBS@
196 POLKIT_GRANT_CFLAGS = @POLKIT_GRANT_CFLAGS@
197 POLKIT_GRANT_LIBS = @POLKIT_GRANT_LIBS@
196198 POLKIT_POLICY_FILE_VALIDATE = @POLKIT_POLICY_FILE_VALIDATE@
197199 POSUB = @POSUB@
198200 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
200202 RANLIB = @RANLIB@
201203 SED = @SED@
202204 SET_MAKE = @SET_MAKE@
205 SEXY_CFLAGS = @SEXY_CFLAGS@
206 SEXY_LIBS = @SEXY_LIBS@
203207 SHELL = @SHELL@
204208 STRIP = @STRIP@
205209 USE_NLS = @USE_NLS@
269273 $(AM_CPPFLAGS)
270274
271275 polkit_gnome_example_CFLAGS = \
272 $(POLKIT_GNOME_CFLAGS) \
276 $(GTK_CFLAGS) \
277 $(DBUS_GLIB_CFLAGS) \
278 $(POLKIT_DBUS_CFLAGS) \
273279 $(WARN_CFLAGS) \
274280 $(AM_CFLAGS)
275281
277283 $(AM_LDFLAGS)
278284
279285 polkit_gnome_example_LDADD = \
280 $(POLKIT_GNOME_LIBS) \
281 $(INTLLIBS)
282
283 polkit_gnome_example_helper_SOURCES = \
284 polkit-gnome-example-helper.c
285
286 polkit_gnome_example_helper_CPPFLAGS = \
287 -I$(top_srcdir) \
288 -DLIBEXECDIR=\""$(libexecdir)"\" \
289 -DDATADIR=\""$(pkgdatadir)"\" \
290 -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
291 $(DISABLE_DEPRECATED) \
292 $(AM_CPPFLAGS)
293
294 polkit_gnome_example_helper_CFLAGS = \
295 $(POLKIT_GNOME_CFLAGS) \
296 $(WARN_CFLAGS) \
297 $(AM_CFLAGS)
298
299 polkit_gnome_example_helper_LDADD = \
300 $(POLKIT_GNOME_LIBS) \
301 $(INTLLIBS)
286 $(GTK_LIBS) \
287 $(DBUS_GLIB_LIBS) \
288 $(POLKIT_DBUS_LIBS) \
289 $(POLKIT_GRANT_LIBS) \
290 $(INTLLIBS) \
291 $(top_builddir)/polkit-gnome/libpolkit-gnome.la
302292
303293
304294 # PolicyKit action definitions for this example
369359 echo " rm -f $$p $$f"; \
370360 rm -f $$p $$f ; \
371361 done
372 install-libexecPROGRAMS: $(libexec_PROGRAMS)
373 @$(NORMAL_INSTALL)
374 test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
375 @list='$(libexec_PROGRAMS)'; for p in $$list; do \
376 p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
377 if test -f $$p \
378 || test -f $$p1 \
379 ; then \
380 f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
381 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
382 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
383 else :; fi; \
384 done
385
386 uninstall-libexecPROGRAMS:
387 @$(NORMAL_UNINSTALL)
388 @list='$(libexec_PROGRAMS)'; for p in $$list; do \
389 f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
390 echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
391 rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
392 done
393
394 clean-libexecPROGRAMS:
395 @list='$(libexec_PROGRAMS)'; for p in $$list; do \
396 f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
397 echo " rm -f $$p $$f"; \
398 rm -f $$p $$f ; \
399 done
400362 polkit-gnome-example$(EXEEXT): $(polkit_gnome_example_OBJECTS) $(polkit_gnome_example_DEPENDENCIES)
401363 @rm -f polkit-gnome-example$(EXEEXT)
402364 $(polkit_gnome_example_LINK) $(polkit_gnome_example_OBJECTS) $(polkit_gnome_example_LDADD) $(LIBS)
403 polkit-gnome-example-helper$(EXEEXT): $(polkit_gnome_example_helper_OBJECTS) $(polkit_gnome_example_helper_DEPENDENCIES)
404 @rm -f polkit-gnome-example-helper$(EXEEXT)
405 $(polkit_gnome_example_helper_LINK) $(polkit_gnome_example_helper_OBJECTS) $(polkit_gnome_example_helper_LDADD) $(LIBS)
406365
407366 mostlyclean-compile:
408367 -rm -f *.$(OBJEXT)
411370 -rm -f *.tab.c
412371
413372 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polkit_gnome_example-polkit-gnome-example.Po@am__quote@
414 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polkit_gnome_example_helper-polkit-gnome-example-helper.Po@am__quote@
415373
416374 .c.o:
417375 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
447405 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='polkit-gnome-example.c' object='polkit_gnome_example-polkit-gnome-example.obj' libtool=no @AMDEPBACKSLASH@
448406 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
449407 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(polkit_gnome_example_CPPFLAGS) $(CPPFLAGS) $(polkit_gnome_example_CFLAGS) $(CFLAGS) -c -o polkit_gnome_example-polkit-gnome-example.obj `if test -f 'polkit-gnome-example.c'; then $(CYGPATH_W) 'polkit-gnome-example.c'; else $(CYGPATH_W) '$(srcdir)/polkit-gnome-example.c'; fi`
450
451 polkit_gnome_example_helper-polkit-gnome-example-helper.o: polkit-gnome-example-helper.c
452 @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(polkit_gnome_example_helper_CPPFLAGS) $(CPPFLAGS) $(polkit_gnome_example_helper_CFLAGS) $(CFLAGS) -MT polkit_gnome_example_helper-polkit-gnome-example-helper.o -MD -MP -MF $(DEPDIR)/polkit_gnome_example_helper-polkit-gnome-example-helper.Tpo -c -o polkit_gnome_example_helper-polkit-gnome-example-helper.o `test -f 'polkit-gnome-example-helper.c' || echo '$(srcdir)/'`polkit-gnome-example-helper.c
453 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/polkit_gnome_example_helper-polkit-gnome-example-helper.Tpo $(DEPDIR)/polkit_gnome_example_helper-polkit-gnome-example-helper.Po
454 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='polkit-gnome-example-helper.c' object='polkit_gnome_example_helper-polkit-gnome-example-helper.o' libtool=no @AMDEPBACKSLASH@
455 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
456 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(polkit_gnome_example_helper_CPPFLAGS) $(CPPFLAGS) $(polkit_gnome_example_helper_CFLAGS) $(CFLAGS) -c -o polkit_gnome_example_helper-polkit-gnome-example-helper.o `test -f 'polkit-gnome-example-helper.c' || echo '$(srcdir)/'`polkit-gnome-example-helper.c
457
458 polkit_gnome_example_helper-polkit-gnome-example-helper.obj: polkit-gnome-example-helper.c
459 @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(polkit_gnome_example_helper_CPPFLAGS) $(CPPFLAGS) $(polkit_gnome_example_helper_CFLAGS) $(CFLAGS) -MT polkit_gnome_example_helper-polkit-gnome-example-helper.obj -MD -MP -MF $(DEPDIR)/polkit_gnome_example_helper-polkit-gnome-example-helper.Tpo -c -o polkit_gnome_example_helper-polkit-gnome-example-helper.obj `if test -f 'polkit-gnome-example-helper.c'; then $(CYGPATH_W) 'polkit-gnome-example-helper.c'; else $(CYGPATH_W) '$(srcdir)/polkit-gnome-example-helper.c'; fi`
460 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/polkit_gnome_example_helper-polkit-gnome-example-helper.Tpo $(DEPDIR)/polkit_gnome_example_helper-polkit-gnome-example-helper.Po
461 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='polkit-gnome-example-helper.c' object='polkit_gnome_example_helper-polkit-gnome-example-helper.obj' libtool=no @AMDEPBACKSLASH@
462 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
463 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(polkit_gnome_example_helper_CPPFLAGS) $(CPPFLAGS) $(polkit_gnome_example_helper_CFLAGS) $(CFLAGS) -c -o polkit_gnome_example_helper-polkit-gnome-example-helper.obj `if test -f 'polkit-gnome-example-helper.c'; then $(CYGPATH_W) 'polkit-gnome-example-helper.c'; else $(CYGPATH_W) '$(srcdir)/polkit-gnome-example-helper.c'; fi`
464408
465409 mostlyclean-libtool:
466410 -rm -f *.lo
563507 check: check-am
564508 all-am: Makefile $(PROGRAMS) $(DATA)
565509 installdirs:
566 for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(polkit_policydir)"; do \
510 for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(polkit_policydir)"; do \
567511 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
568512 done
569513 install: install-am
594538 @echo "it deletes files that may require special tools to rebuild."
595539 clean: clean-am
596540
597 clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
598 clean-libtool clean-local mostlyclean-am
541 clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
542 mostlyclean-am
599543
600544 distclean: distclean-am
601545 -rm -rf ./$(DEPDIR)
617561
618562 install-dvi: install-dvi-am
619563
620 install-exec-am: install-binPROGRAMS install-libexecPROGRAMS
564 install-exec-am: install-binPROGRAMS
621565
622566 install-html: install-html-am
623567
649593
650594 ps-am:
651595
652 uninstall-am: uninstall-binPROGRAMS uninstall-dist_polkit_policyDATA \
653 uninstall-libexecPROGRAMS
596 uninstall-am: uninstall-binPROGRAMS uninstall-dist_polkit_policyDATA
654597
655598 .MAKE: install-am install-strip
656599
657600 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
658 clean-generic clean-libexecPROGRAMS clean-libtool clean-local \
659 ctags distclean distclean-compile distclean-generic \
660 distclean-libtool distclean-tags distdir dvi dvi-am html \
661 html-am info info-am install install-am install-binPROGRAMS \
662 install-data install-data-am install-dist_polkit_policyDATA \
663 install-dvi install-dvi-am install-exec install-exec-am \
664 install-html install-html-am install-info install-info-am \
665 install-libexecPROGRAMS install-man install-pdf install-pdf-am \
666 install-ps install-ps-am install-strip installcheck \
667 installcheck-am installdirs maintainer-clean \
668 maintainer-clean-generic mostlyclean mostlyclean-compile \
669 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
670 tags uninstall uninstall-am uninstall-binPROGRAMS \
671 uninstall-dist_polkit_policyDATA uninstall-libexecPROGRAMS
601 clean-generic clean-libtool clean-local ctags distclean \
602 distclean-compile distclean-generic distclean-libtool \
603 distclean-tags distdir dvi dvi-am html html-am info info-am \
604 install install-am install-binPROGRAMS install-data \
605 install-data-am install-dist_polkit_policyDATA install-dvi \
606 install-dvi-am install-exec install-exec-am install-html \
607 install-html-am install-info install-info-am install-man \
608 install-pdf install-pdf-am install-ps install-ps-am \
609 install-strip installcheck installcheck-am installdirs \
610 maintainer-clean maintainer-clean-generic mostlyclean \
611 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
612 pdf pdf-am ps ps-am tags uninstall uninstall-am \
613 uninstall-binPROGRAMS uninstall-dist_polkit_policyDATA
672614
673615
674616 # You will need a recent intltool or the patch from this bug
675617 # http://bugzilla.gnome.org/show_bug.cgi?id=462312
676618 @INTLTOOL_POLICY_RULE@
677619
678 # TODO: FIXME: this breaks 'make distcheck'
679620 check:
680621 $(POLKIT_POLICY_FILE_VALIDATE) $(dist_polkit_policy_DATA)
681622
+0
-212
examples/polkit-gnome-example-helper.c less more
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
1 *
2 * Copyright (C) 2007 David Zeuthen <david@fubar.dk>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 */
19
20 #ifdef HAVE_CONFIG_H
21 # include "config.h"
22 #endif
23
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include <unistd.h>
27 #include <signal.h>
28 #include <errno.h>
29 #include <string.h>
30 #include <sys/types.h>
31 #include <sys/stat.h>
32 #include <fcntl.h>
33
34 #include <glib.h>
35 #include <polkit/polkit.h>
36 #include <polkit-dbus/polkit-dbus.h>
37
38 static gboolean
39 io_watch_have_data (GIOChannel *channel, GIOCondition condition, gpointer user_data)
40 {
41 int fd;
42 PolKitContext *pk_context = user_data;
43 fd = g_io_channel_unix_get_fd (channel);
44 polkit_context_io_func (pk_context, fd);
45 return TRUE;
46 }
47
48 static int
49 io_add_watch (PolKitContext *pk_context, int fd)
50 {
51 guint id = 0;
52 GIOChannel *channel;
53 channel = g_io_channel_unix_new (fd);
54 if (channel == NULL)
55 goto out;
56 id = g_io_add_watch (channel, G_IO_IN, io_watch_have_data, pk_context);
57 if (id == 0) {
58 g_io_channel_unref (channel);
59 goto out;
60 }
61 g_io_channel_unref (channel);
62 out:
63 return id;
64 }
65
66 static void
67 io_remove_watch (PolKitContext *pk_context, int watch_id)
68 {
69 g_source_remove (watch_id);
70 }
71
72
73 static void
74 exit_not_privileged (PolKitResult pk_result, const char *pk_action)
75 {
76 const char *pk_result_as_str;
77 pk_result_as_str = polkit_result_to_string_representation (pk_result);
78 fprintf (stderr, "%s %s", pk_result_as_str, pk_action);
79 exit(1);
80 }
81
82 static gboolean
83 check_privileged (PolKitContext *pol_ctx,
84 pid_t caller_pid,
85 const char *pk_action,
86 PolKitResult *pk_result)
87 {
88 DBusError error;
89 DBusConnection *bus;
90 PolKitCaller *caller;
91 PolKitAction *action;
92
93 dbus_error_init (&error);
94 bus = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
95 if (bus == NULL) {
96 fprintf (stderr, "cannot connect to system bus: %s: %s\n", error.name, error.message);
97 dbus_error_free (&error);
98 goto out;
99 }
100
101 action = polkit_action_new ();
102 polkit_action_set_action_id (action, pk_action);
103
104 caller = polkit_caller_new_from_pid (bus, caller_pid, &error);
105 if (caller == NULL) {
106 fprintf (stderr, "cannot get caller from dbus name\n");
107 goto out;
108 }
109
110 *pk_result = polkit_context_can_caller_do_action (pol_ctx, action, caller);
111 return TRUE;
112 out:
113 return FALSE;
114 }
115
116 static void
117 usage (void)
118 {
119 fprintf (stderr, "usage: polkit-gnome-example-helper --frobnicate | --tweak\n");
120 exit (2);
121 }
122
123 static char *kick_type = NULL;
124
125 static void
126 _cb (PolKitPolicyCache *policy_cache,
127 PolKitPolicyFileEntry *entry,
128 void *user_data)
129 {
130 const char *value;
131 char **target_action = (char **) user_data;
132
133 /* have we already found one Action? */
134 if (*target_action != NULL)
135 return;
136
137 value = polkit_policy_file_entry_get_annotation (entry, "org.gnome.policykit.examples.kick-path");
138 if (value == NULL)
139 return;
140
141 if (strcmp (value, kick_type) != 0)
142 return;
143
144 *target_action = strdup (polkit_policy_file_entry_get_id (entry));
145 }
146
147 int
148 main (int argc, char *argv[])
149 {
150 pid_t parent_pid;
151 char *pk_action;
152 PolKitResult pk_result = POLKIT_RESULT_NO;
153 PolKitContext *pol_ctx;
154
155 printf ("In polkit-gnome-example-helper\n");
156
157
158 if (argc < 2) {
159 usage ();
160 }
161
162 pol_ctx = polkit_context_new ();
163 polkit_context_set_io_watch_functions (pol_ctx, io_add_watch, io_remove_watch);
164 if (!polkit_context_init (pol_ctx, NULL)) {
165 fprintf (stderr, "cannot init polkit\n");
166 exit_not_privileged (POLKIT_RESULT_NO, pk_action);
167 }
168
169 if (strcmp (argv[1], "--frobnicate") == 0 && argc == 2) {
170 pk_action = "org.gnome.policykit.examples.frobnicate";
171 } else if (strcmp (argv[1], "--tweak") == 0 && argc == 2) {
172 pk_action = "org.gnome.policykit.examples.tweak";
173 } else if (strcmp (argv[1], "--twiddle") == 0 && argc == 2) {
174 pk_action = "org.gnome.policykit.examples.twiddle";
175 } else if (strcmp (argv[1], "--punch") == 0 && argc == 2) {
176 pk_action = "org.gnome.policykit.examples.punch";
177 } else if (strcmp (argv[1], "--kick") == 0 && argc == 3) {
178 PolKitPolicyCache *policy_cache;
179 policy_cache = polkit_context_get_policy_cache (pol_ctx);
180 pk_action = NULL;
181 kick_type = argv[2];
182 polkit_policy_cache_foreach (policy_cache, _cb, &pk_action);
183 if (pk_action == NULL) {
184 printf ("cannot find action for kick type '%s'\n", kick_type);
185 exit_not_privileged (POLKIT_RESULT_NO, pk_action);
186 }
187 } else {
188 usage ();
189 }
190
191 /* check if parent is privileged */
192 parent_pid = getppid ();
193 if (!check_privileged (pol_ctx, parent_pid, pk_action, &pk_result)) {
194 /* PolicyKit don't know - just return 'NO' for now */
195 printf ("we're not privileged: PK inquiry failed\n");
196 exit_not_privileged (POLKIT_RESULT_NO, pk_action);
197 }
198
199 if (pk_result != POLKIT_RESULT_YES) {
200 /* Caller is not privileged */
201 printf ("we're not privileged: pk_result='%s'\n", polkit_result_to_string_representation (pk_result));
202 exit_not_privileged (pk_result, pk_action);
203 }
204
205 /* caller is indeed privileged; carry out the deed.. */
206 printf ("we're privileged - yeay!\n");
207
208 /* TODO: now either: "frobnicate", "tweak" or "twiddle", "punch", "kick", "poke" */
209
210 return 0;
211 }
00 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
1 *
2 * polkit-gnome-example: Simple example showing how a GTK+ application
3 * can use PolicyKit.
14 *
25 * Copyright (C) 2007 David Zeuthen <david@fubar.dk>
36 *
2124 # include "config.h"
2225 #endif
2326
27 #include <sys/types.h>
28 #include <unistd.h>
2429 #include <stdlib.h>
25 #include <stdio.h>
26 #include <unistd.h>
27 #include <signal.h>
28 #include <errno.h>
2930 #include <string.h>
30 #include <sys/types.h>
31 #include <sys/stat.h>
32 #include <sys/wait.h>
33 #include <fcntl.h>
34
35 #include <glib.h>
36 #include <glib/gi18n-lib.h>
37 #include <glib-object.h>
38
39 #include <gtk/gtk.h>
40 #include <gdk/gdkx.h>
41
42 #define DBUS_API_SUBJECT_TO_CHANGE
43 #include <dbus/dbus-glib.h>
44 #include <dbus/dbus-glib-lowlevel.h>
45
46 #include <polkit/polkit.h>
47 #include <polkit-dbus/polkit-dbus.h>
48
49 static DBusConnection *system_bus;
50 static PolKitContext *pk_context;
51
52
53 static DBusGProxy *polkit_gnome_proxy;
54
55 static DBusGConnection *
56 get_session_bus (void)
31 #include <glib/gi18n.h>
32 #include <polkit-gnome/polkit-gnome.h>
33
34 static GtkWidget *toplevel_window;
35 static PolKitGnomeContext *pkgc;
36
37 static void
38 _button_toggled (GtkToggleButton *toggle_button, PolKitGnomeAction *action)
5739 {
58 GError *error;
59 DBusGConnection *bus;
60 DBusConnection *connection;
61
62 error = NULL;
63 bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
64 if (bus == NULL) {
65 g_warning ("Couldn't connect to session bus: %s", error->message);
66 g_error_free (error);
67 goto out;
68 }
69
70 connection = dbus_g_connection_get_connection (bus);
71 out:
72 return bus;
40 g_debug ("in _button_toggled for action '%s'", gtk_action_get_name (GTK_ACTION (action)));
7341 }
7442
75 static GtkWidget *toplevel_window;
76 static GtkWidget *button_frobnicate;
77 static GtkWidget *button_tweak;
78 static GtkWidget *button_twiddle;
79 static GtkWidget *button_punch;
80 static GtkWidget *kick_combo_box;
81 static GtkWidget *button_kick;
82
43 static void
44 _button_clicked (GtkToggleButton *toggle_button, PolKitGnomeAction *action)
45 {
46 g_debug ("in _button_clicked for '%s'", gtk_action_get_name (GTK_ACTION (action)));
47 }
48
49 /* This function is called when the following two conditions are true
50 *
51 * - the user clicks one of the buttons created via the method
52 * polkit_gnome_action_create_button() (see main() below)
53 *
54 * - For the PolKitAction associated with the button, PolicyKit
55 * reports either 'no' or 'yes'.
56 *
57 * In the event the user clicks a button and he is not privileged
58 * (e.g. PolicyKit returns one of the 'auth' results) he will be
59 * asked to authenticate; this all happens behind the scenes; the
60 * application _only_ gets the ::activate signal on PolKitGnomeAction
61 * instances when PolicyKit reports that the user is privileged.
62 *
63 * Note that for action org.gnome.policykit.examples.tweak, the
64 * corresponding PolKitGnomeAction is configured to be sensitive (see
65 * main() below) even when PolicyKit reports 'no'. Hence we need to
66 * handle that case too and we do that by popping up a dialog. Note
67 * that this can only be triggered by adding a stanza like
68 *
69 * <match action="org.gnome.policykit.examples.tweak">
70 * <return result="no"/>
71 * </match>
72 *
73 * to the /etc/PolicyKit/PolicyKit.conf file.
74 */
8375 static void
84 simple_button_cb (GtkButton *button, gpointer user_data)
85 {
86 int status;
87 int return_code;
88 char *helper_stderr = NULL;
89 GError *error = NULL;
90 gboolean gained_privilege;
91 char *helper_cmdline;
92 char *cmdline;
93
94 /* gross hack - but it works */
95 if (button == GTK_BUTTON (button_frobnicate)) {
96 helper_cmdline = g_strdup ("polkit-gnome-example-helper --frobnicate");
97 } else if (button == GTK_BUTTON (button_tweak)) {
98 helper_cmdline = g_strdup ("polkit-gnome-example-helper --tweak");
99 } else if (button == GTK_BUTTON (button_twiddle)) {
100 helper_cmdline = g_strdup ("polkit-gnome-example-helper --twiddle");
101 } else if (button == GTK_BUTTON (button_punch)) {
102 helper_cmdline = g_strdup ("polkit-gnome-example-helper --punch");
103 } else if (button == GTK_BUTTON (button_kick)) {
104 helper_cmdline = g_strdup_printf ("polkit-gnome-example-helper --kick %s",
105 gtk_combo_box_get_active_text (GTK_COMBO_BOX (kick_combo_box)));
106 } else {
107 g_warning ("Unknown button pressed");
108 goto out;
109 }
110
111 cmdline = g_strdup_printf (LIBEXECDIR /* "." */ "/%s", helper_cmdline);
112 g_free (helper_cmdline);
113 g_debug ("launching '%s'", cmdline);
114 g_spawn_command_line_sync (cmdline,
115 NULL,
116 &helper_stderr,
117 &status,
118 NULL);
119 g_free (cmdline);
120
121 return_code = WEXITSTATUS (status);
122 g_debug ("helper return code was %d", return_code);
123
124 if (return_code == 1) {
125 char **tokens;
126 PolKitResult polkit_result;
127 char *polkit_result_textual;
128 char *polkit_action;
129 guint32 xid;
130
131 tokens = g_strsplit (helper_stderr, " ", 2);
132 if (g_strv_length (tokens) != 2) {
133 g_warning ("helper return string '%s' malformed", helper_stderr);
134 g_strfreev (tokens);
135 goto out;
136 }
137
138 polkit_result_textual = tokens[0];
139 polkit_action = tokens[1];
140
141 if (!polkit_result_from_string_representation (polkit_result_textual, &polkit_result)) {
142 g_warning ("polkit_result_textual '%s' malformed", polkit_result_textual);
143 g_strfreev (tokens);
144 goto out;
145 }
146
147 g_debug ("helper refused; returned polkit_result='%s' (%d) and polkit_action='%s'",
148 polkit_result_textual, polkit_result, polkit_action);
149
150 xid = gdk_x11_drawable_get_xid (GDK_DRAWABLE (toplevel_window->window));
151
152 /* now use PolicyKit-gnome to bring up an auth dialog */
153 if (!dbus_g_proxy_call_with_timeout (polkit_gnome_proxy,
154 "ShowDialog",
155 INT_MAX,
156 &error,
157 /* parameters: */
158 G_TYPE_STRING, polkit_action, /* action_id */
159 G_TYPE_UINT, xid, /* X11 window ID */
160 G_TYPE_INVALID,
161 /* return values: */
162 G_TYPE_BOOLEAN, &gained_privilege,
163 G_TYPE_INVALID)) {
164 g_warning ("Caught exception '%s'", error->message);
165 g_error_free (error);
166 g_strfreev (tokens);
167 goto out;
168 }
169
170 g_debug ("gained privilege = %d", gained_privilege);
171
172 g_strfreev (tokens);
173 }
174
175 out:
176 g_free (helper_stderr);
177 }
178
179
180 static void
181 update_one_button (GtkWidget *button, const char *pk_action_id)
76 activate_polkit_gnome_action (PolKitGnomeAction *action, gpointer user_data)
18277 {
18378 PolKitCaller *pk_caller;
18479 PolKitAction *pk_action;
18580 PolKitResult pk_result;
18681 DBusError dbus_error;
187 char *s;
188
189 pk_caller = NULL;
190 pk_action = NULL;
191
192 pk_action = polkit_action_new ();
193 polkit_action_set_action_id (pk_action, pk_action_id);
194
195 dbus_error_init (&dbus_error);
196 pk_caller = polkit_caller_new_from_pid (system_bus, getpid (), &dbus_error);
82
83 if (strcmp (gtk_action_get_name (GTK_ACTION (action)), "toggle") == 0) {
84 /* we're not supposed to run actions when the
85 * authorization is flipped.. we're supposed to make
86 * some UI sensitive and de-sensitive.. (one use at least) */
87 g_debug ("toggled for '%s'", gtk_action_get_name (GTK_ACTION (action)));
88 return;
89 }
90
91 g_debug ("pretending to be the mechanism for action '%s'", gtk_action_get_name (GTK_ACTION (action)));
92
93 g_object_get (action, "polkit-action", &pk_action, NULL);
94
95 dbus_error_init (&dbus_error);
96 pk_caller = polkit_tracker_get_caller_from_pid (pkgc->pk_tracker,
97 getpid (),
98 &dbus_error);
19799 if (pk_caller == NULL) {
198 fprintf (stderr, "cannot get caller from dbus name\n");
199 goto out;
100 g_warning ("Cannot get PolKitCaller object for ourselves (pid=%d): %s: %s",
101 getpid (), dbus_error.name, dbus_error.message);
102 dbus_error_free (&dbus_error);
103 } else {
104 /* note how we pass #TRUE to revoke_if_one_shot - this is because we're
105 * pretending to be the mechanism
106 */
107 pk_result = polkit_context_is_caller_authorized (pkgc->pk_context,
108 pk_action,
109 pk_caller,
110 TRUE,
111 NULL);
112
113 polkit_caller_unref (pk_caller);
200114 }
201115
202 pk_result = polkit_context_can_caller_do_action (pk_context, pk_action, pk_caller);
203
204 g_debug ("for '%s' we got '%s'", pk_action_id, polkit_result_to_string_representation (pk_result));
205
206 switch (pk_result) {
207 default:
208 case POLKIT_RESULT_UNKNOWN:
209 case POLKIT_RESULT_NO:
210 gtk_button_set_image (GTK_BUTTON (button),
211 gtk_image_new_from_stock (GTK_STOCK_STOP, GTK_ICON_SIZE_SMALL_TOOLBAR));
212 gtk_widget_set_tooltip_markup (button, _("This action is not permitted"));
213 break;
214
215 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
216 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION:
217 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS:
218 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
219 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
220 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
221 gtk_button_set_image (GTK_BUTTON (button),
222 gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_SMALL_TOOLBAR));
223
224 s = g_strdup_printf (_("This action requires authentication (%s)"),
225 polkit_result_to_string_representation (pk_result));
226 gtk_widget_set_tooltip_markup (button, s);
227 g_free (s);
228 break;
229
230 case POLKIT_RESULT_YES:
231 gtk_button_set_image (GTK_BUTTON (button),
232 gtk_image_new_from_stock (GTK_STOCK_OK, GTK_ICON_SIZE_SMALL_TOOLBAR));
233 gtk_widget_set_tooltip_markup (button, _("This action is permitted"));
234 break;
116 polkit_action_unref (pk_action);
117
118 }
119
120 static void
121 activate_action (GtkAction *action, gpointer user_data)
122 {
123 if (g_ascii_strcasecmp (gtk_action_get_name (action), "Quit") == 0) {
124 exit (0);
125 } else if (g_ascii_strcasecmp (gtk_action_get_name (action), "About") == 0) {
126 const char *authors[] = {
127 "David Zeuthen <david@fubar.dk>",
128 NULL};
129 const char *documenters[] = {
130 "David Zeuthen <david@fubar.dk>",
131 NULL};
132
133
134 gtk_show_about_dialog (NULL,
135 "version", VERSION,
136 "copyright", _("Copyright © 2007 David Zeuthen"),
137 "website-label", _("PolicyKit-gnome Website"),
138 "website", "http://hal.freedesktop.org/docs/PolicyKit-gnome/",
139 "program-name", _("PolicyKit-gnome demo"),
140 "comments", _("PolicyKit for the GNOME desktop"),
141 "logo-icon-name", GTK_STOCK_DIALOG_AUTHENTICATION,
142 "authors", authors,
143 "documenters", documenters,
144 NULL);
145
235146 }
236
237 out:
238 if (pk_action != NULL)
239 polkit_action_unref (pk_action);
240 if (pk_caller != NULL)
241 polkit_caller_unref (pk_caller);
242147 }
243148
244 static void
245 update_buttons (void)
246 {
247 update_one_button (button_frobnicate, "org.gnome.policykit.examples.frobnicate");
248 update_one_button (button_tweak, "org.gnome.policykit.examples.tweak");
249 update_one_button (button_twiddle, "org.gnome.policykit.examples.twiddle");
250 update_one_button (button_punch, "org.gnome.policykit.examples.punch");
251 }
252
253 static gboolean
254 io_watch_have_data (GIOChannel *channel, GIOCondition condition, gpointer user_data)
255 {
256 int fd;
257 PolKitContext *pk_context = user_data;
258 fd = g_io_channel_unix_get_fd (channel);
259 polkit_context_io_func (pk_context, fd);
260 return TRUE;
261 }
262
263 static int
264 io_add_watch (PolKitContext *pk_context, int fd)
265 {
266 guint id = 0;
267 GIOChannel *channel;
268 channel = g_io_channel_unix_new (fd);
269 if (channel == NULL)
270 goto out;
271 id = g_io_add_watch (channel, G_IO_IN, io_watch_have_data, pk_context);
272 if (id == 0) {
273 g_io_channel_unref (channel);
274 goto out;
275 }
276 g_io_channel_unref (channel);
277 out:
278 return id;
279 }
280
281 static void
282 io_remove_watch (PolKitContext *pk_context, int watch_id)
283 {
284 g_source_remove (watch_id);
285 }
286
287
288 static void
289 pk_config_changed (PolKitContext *pk_context, void *user_data)
290 {
291 g_debug ("PolicyKit config changed");
292 update_buttons ();
293 }
149 static GtkActionEntry entries[] = {
150 { "FileMenu", NULL, N_("_File") }, /* name, stock id, label */
151 { "ActionsMenu", NULL, N_("_Actions") }, /* name, stock id, label */
152 { "HelpMenu", NULL, N_("_Help") }, /* name, stock id, label */
153
154 { "Quit", GTK_STOCK_QUIT, /* name, stock id */
155 N_("_Quit"), "<control>Q", /* label, accelerator */
156 N_("Quit"), /* tooltip */
157 G_CALLBACK (activate_action) },
158
159 { "About", GTK_STOCK_ABOUT, /* name, stock id */
160 N_("_About"), "<control>A", /* label, accelerator */
161 N_("About"), /* tooltip */
162 G_CALLBACK (activate_action) },
163 };
164 static guint n_entries = G_N_ELEMENTS (entries);
165
166 static const gchar *ui_info =
167 "<ui>"
168 " <menubar name='MenuBar'>"
169 " <menu action='FileMenu'>"
170 " <menuitem action='Quit'/>"
171 " </menu>"
172 " <menu action='ActionsMenu'>"
173 " <menuitem action='frobnicate'/>"
174 " <menuitem action='jump'/>"
175 " <menuitem action='tweak'/>"
176 " <menuitem action='twiddle'/>"
177 " <menuitem action='punch'/>"
178 " <menuitem action='toggle'/>"
179 " </menu>"
180 " <menu action='HelpMenu'>"
181 " <menuitem action='About'/>"
182 " </menu>"
183 " </menubar>"
184 " <toolbar name='ToolBar'>"
185 " <toolitem action='Quit'/>"
186 " <toolitem action='About'/>"
187 " <separator action='Sep1'/>"
188 " <toolitem action='frobnicate'/>"
189 " <toolitem action='jump'/>"
190 " <toolitem action='tweak'/>"
191 " <toolitem action='twiddle'/>"
192 " <toolitem action='punch'/>"
193 " <toolitem action='toggle'/>"
194 " </toolbar>"
195 "</ui>";
294196
295197 int
296198 main (int argc, char **argv)
297199 {
298 GMainLoop *loop;
299 DBusGConnection *session_bus;
300 int ret;
301 DBusError dbus_error;
302
303 ret = 1;
304
305 if (!g_thread_supported ()) {
306 g_thread_init (NULL);
307 }
308 dbus_g_thread_init ();
309 g_type_init ();
200 GtkWidget *hbox;
201 GtkWidget *vbox;
202 GtkWidget *vbox2;
203 GtkWidget *label;
204 GMainLoop*loop;
205 PolKitAction *pk_action;
206 PolKitGnomeAction *action;
207 GtkWidget *button;
208 GtkUIManager *ui;
209 GtkActionGroup *actions;
210
310211 gtk_init (&argc, &argv);
311212
213 pkgc = polkit_gnome_context_get (NULL);
214
312215 loop = g_main_loop_new (NULL, FALSE);
313
314
315 session_bus = get_session_bus ();
316 if (session_bus == NULL) {
317 goto out;
318 }
319
320 dbus_error_init (&dbus_error);
321 system_bus = dbus_bus_get (DBUS_BUS_SYSTEM, &dbus_error);
322 if (system_bus == NULL) {
323 goto out;
324 }
325
326 pk_context = polkit_context_new ();
327 polkit_context_set_io_watch_functions (pk_context, io_add_watch, io_remove_watch);
328 polkit_context_set_config_changed (pk_context, pk_config_changed, NULL);
329 if (!polkit_context_init (pk_context, NULL)) {
330 goto out;
331 }
332216
333
334 polkit_gnome_proxy = dbus_g_proxy_new_for_name (session_bus,
335 "org.gnome.PolicyKit", /* bus name */
336 "/org/gnome/PolicyKit/Manager", /* object */
337 "org.gnome.PolicyKit.Manager"); /* interface */
338
339 GtkWidget *vbox;
340 GtkWidget *label;
341 GtkWidget *separator;
342
343
344
345217 toplevel_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
346218
219 actions = gtk_action_group_new ("Actions");
220 gtk_action_group_add_actions (actions, entries, n_entries, NULL);
221
222 ui = gtk_ui_manager_new ();
223 gtk_ui_manager_insert_action_group (ui, actions, 0);
224
225 gtk_window_add_accel_group (GTK_WINDOW (toplevel_window),
226 gtk_ui_manager_get_accel_group (ui));
227
228
229 gtk_ui_manager_add_ui_from_string (ui, ui_info, -1, NULL);
230
231 /*----------------------------------------------------------------*/
347232
348233 vbox = gtk_vbox_new (FALSE, 10);
349234 gtk_container_add (GTK_CONTAINER (toplevel_window), vbox);
350235
351 /*----------------------------------------------------------------*/
352
353 label = gtk_label_new (NULL);
354 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Frobnicate</b> requires the user to authenticate."));
355 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
356 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
357 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
358 button_frobnicate = gtk_button_new_with_label (_("Frobnicate!"));
359 g_signal_connect (button_frobnicate, "clicked", G_CALLBACK (simple_button_cb), NULL);
360 gtk_box_pack_start (GTK_BOX (vbox), button_frobnicate, FALSE, FALSE, 0);
361
362
363 /*----------------------------------------------------------------*/
364 separator = gtk_hseparator_new ();
365 gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
366 /*----------------------------------------------------------------*/
367
368 label = gtk_label_new (NULL);
369 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Tweak</b> requires a system administrator to authenticate."));
370 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
371 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
372 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
373 button_tweak = gtk_button_new_with_label (_("Tweak!"));
374 g_signal_connect (button_tweak, "clicked", G_CALLBACK (simple_button_cb), NULL);
375 gtk_box_pack_start (GTK_BOX (vbox), button_tweak, FALSE, FALSE, 0);
376
377 /*----------------------------------------------------------------*/
378 separator = gtk_hseparator_new ();
379 gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
380 /*----------------------------------------------------------------*/
381
382 label = gtk_label_new (NULL);
383 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Twiddle</b> requires a system administrator to authenticate. Once authenticated, this privilege can be retained indefinitely."));
384 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
385 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
386 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
387 button_twiddle = gtk_button_new_with_label (_("Twiddle!"));
388 g_signal_connect (button_twiddle, "clicked", G_CALLBACK (simple_button_cb), NULL);
389 gtk_box_pack_start (GTK_BOX (vbox), button_twiddle, FALSE, FALSE, 0);
390
391 /*----------------------------------------------------------------*/
392 separator = gtk_hseparator_new ();
393 gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
394 /*----------------------------------------------------------------*/
395
396 label = gtk_label_new (NULL);
397 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Punch</b> requires the user to authenticate. Once authenticated, this privilege can be retained for the remainder of the desktop session."));
398 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
399 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
400 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
401 button_punch = gtk_button_new_with_label (_("Punch!"));
402 g_signal_connect (button_punch, "clicked", G_CALLBACK (simple_button_cb), NULL);
403 gtk_box_pack_start (GTK_BOX (vbox), button_punch, FALSE, FALSE, 0);
404
405 /*----------------------------------------------------------------*/
406 separator = gtk_hseparator_new ();
407 gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, FALSE, 0);
408 /*----------------------------------------------------------------*/
409
410 label = gtk_label_new (NULL);
411 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Kick</b> can be done in different ways (this demonstrates <i>annotations</i>). Select what to kick below and then press the Kick button.."));
412 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
413 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
414 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
415 button_kick = gtk_button_new_with_label (_("Kick!"));
416 g_signal_connect (button_kick, "clicked", G_CALLBACK (simple_button_cb), NULL);
417 kick_combo_box = gtk_combo_box_new_text();
418 gtk_combo_box_append_text (GTK_COMBO_BOX (kick_combo_box), "foo");
419 gtk_combo_box_append_text (GTK_COMBO_BOX (kick_combo_box), "bar");
420 gtk_combo_box_append_text (GTK_COMBO_BOX (kick_combo_box), "baz");
421 gtk_combo_box_set_active (GTK_COMBO_BOX (kick_combo_box), 0);
422 gtk_box_pack_start (GTK_BOX (vbox), kick_combo_box, FALSE, FALSE, 0);
423 gtk_box_pack_start (GTK_BOX (vbox), button_kick, FALSE, FALSE, 0);
424
425 /*----------------------------------------------------------------*/
426
427 update_buttons ();
428
236 vbox2 = gtk_vbox_new (FALSE, 0);
237 gtk_box_pack_start (GTK_BOX (vbox), vbox2, FALSE, FALSE, 0);
238
239 /*----------------------------------------------------------------*/
240
241 label = gtk_label_new (NULL);
242 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Frobnicate</b> requires the "
243 "user to authenticate. The authorization is kept for "
244 "the life time of the process"));
245 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
246 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
247 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
248
249 pk_action = polkit_action_new ();
250 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.frobnicate");
251 action = polkit_gnome_action_new_default ("frobnicate", pk_action, _("Frobnicate!"), NULL);
252 polkit_action_unref (pk_action);
253 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
254 gtk_action_group_add_action (actions, GTK_ACTION (action));
255 button = polkit_gnome_action_create_button (action);
256 gtk_box_pack_start (GTK_BOX (vbox),
257 button,
258 FALSE, FALSE, 0);
259 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
260
261 /*----------------------------------------------------------------*/
262 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
263 /*----------------------------------------------------------------*/
264
265 label = gtk_label_new (NULL);
266 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Jump</b> requires the "
267 "user to authenticate. This is a one-shot authorization."));
268 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
269 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
270 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
271
272 pk_action = polkit_action_new ();
273 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.jump");
274 action = polkit_gnome_action_new_default ("jump", pk_action, _("Jump!"), NULL);
275 polkit_action_unref (pk_action);
276 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
277 gtk_action_group_add_action (actions, GTK_ACTION (action));
278 button = polkit_gnome_action_create_button (action);
279 gtk_box_pack_start (GTK_BOX (vbox),
280 button,
281 FALSE, FALSE, 0);
282 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
283
284 /*----------------------------------------------------------------*/
285 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
286 /*----------------------------------------------------------------*/
287
288 label = gtk_label_new (NULL);
289 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Tweak</b> requires a system "
290 "administrator to authenticate. This instance "
291 "overrides the defaults set in polkit_gnome_action_new()."));
292 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
293 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
294 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
295
296 pk_action = polkit_action_new ();
297 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.tweak");
298 action = polkit_gnome_action_new_default ("tweak", pk_action, _("Tweak!"), NULL);
299 polkit_action_unref (pk_action);
300
301 /* For this particular GtkAction instance, we want to customize the appearence */
302 g_object_set (action,
303 "no-visible", TRUE,
304 "no-sensitive", TRUE,
305 "no-short-label", _("Tweak"),
306 "no-label", _("Tweak (long)"),
307 "no-tooltip", _("If your admin wasn't annoying, you could do this"),
308 "no-icon-name", GTK_STOCK_NO,
309
310 "auth-visible", TRUE,
311 "auth-sensitive", TRUE,
312 "auth-short-label", _("Tweak..."),
313 "auth-label", _("Tweak... (long)"),
314 "auth-tooltip", _("Only card carrying tweakers can do this!"),
315 "auth-icon-name", GTK_STOCK_DIALOG_AUTHENTICATION,
316
317 "yes-visible", TRUE,
318 "yes-sensitive", TRUE,
319 "yes-short-label", _("Tweak!"),
320 "yes-label", _("Tweak! (long)"),
321 "yes-tooltip", _("Go ahead, tweak tweak tweak!"),
322 "yes-icon-name", GTK_STOCK_YES,
323 NULL);
324
325 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
326 gtk_action_group_add_action (actions, GTK_ACTION (action));
327 button = polkit_gnome_action_create_button (action);
328 gtk_box_pack_start (GTK_BOX (vbox),
329 button,
330 FALSE, FALSE, 0);
331 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
332
333 /*----------------------------------------------------------------*/
334 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
335 /*----------------------------------------------------------------*/
336
337 label = gtk_label_new (NULL);
338 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Twiddle</b> requires a system "
339 "administrator to authenticate. Once authenticated, this "
340 "privilege can be retained indefinitely."));
341 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
342 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
343 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
344
345 pk_action = polkit_action_new ();
346 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.twiddle");
347 action = polkit_gnome_action_new_default ("twiddle", pk_action, _("Twiddle!"), NULL);
348 polkit_action_unref (pk_action);
349 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
350 gtk_action_group_add_action (actions, GTK_ACTION (action));
351 button = polkit_gnome_action_create_button (action);
352 gtk_box_pack_start (GTK_BOX (vbox),
353 button,
354 FALSE, FALSE, 0);
355 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
356
357 /*----------------------------------------------------------------*/
358 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
359 /*----------------------------------------------------------------*/
360
361 label = gtk_label_new (NULL);
362 gtk_label_set_markup (GTK_LABEL (label), _("Making the helper <b>Punch</b> requires the user to "
363 "authenticate. Once authenticated, this privilege can "
364 "be retained for the remainder of the desktop session."));
365 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
366 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
367 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
368
369 pk_action = polkit_action_new ();
370 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.punch");
371 action = polkit_gnome_action_new_default ("punch", pk_action, _("Punch!"), NULL);
372 polkit_action_unref (pk_action);
373 g_signal_connect (action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
374 gtk_action_group_add_action (actions, GTK_ACTION (action));
375 button = polkit_gnome_action_create_button (action);
376 gtk_box_pack_start (GTK_BOX (vbox),
377 polkit_gnome_action_create_button (action),
378 FALSE, FALSE, 0);
379 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
380
381 /*----------------------------------------------------------------*/
382 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
383 /*----------------------------------------------------------------*/
384
385 label = gtk_label_new (NULL);
386 gtk_label_set_markup (GTK_LABEL (label), _("The <b>Toggle</b> action demonstrates the use of "
387 "PolicyKit to drive a GtkToggleButton; it's an intuitive "
388 "way to ask users to give up authorizations when they "
389 "are done with them. E.g. the button is 'pressed in' exactly"
390 "when the authorization is held. Toggling the button means "
391 "obtaining resp. revoking the authorization in question."));
392 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
393 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
394 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
395
396 pk_action = polkit_action_new ();
397 polkit_action_set_action_id (pk_action, "org.gnome.policykit.examples.toggle");
398 PolKitGnomeToggleAction *toggle_action;
399 toggle_action = polkit_gnome_toggle_action_new_default ("toggle", pk_action,
400 _("Click to make changes..."),
401 _("Click to prevent changes"));
402 //g_object_set (toggle_action, "target-pid", 24887, NULL);
403 polkit_action_unref (pk_action);
404 g_signal_connect (toggle_action, "activate", G_CALLBACK (activate_polkit_gnome_action), NULL);
405 gtk_action_group_add_action (actions, GTK_ACTION (toggle_action));
406 GtkWidget *toggle_button;
407 toggle_button = polkit_gnome_toggle_action_create_toggle_button (toggle_action);
408 g_signal_connect (toggle_button, "toggled", G_CALLBACK (_button_toggled), toggle_action);
409 gtk_box_pack_start (GTK_BOX (vbox),
410 toggle_button,
411 FALSE, FALSE, 0);
412
413 /*----------------------------------------------------------------*/
414 gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 0);
415 /*----------------------------------------------------------------*/
416
417 hbox = gtk_hbox_new (FALSE, 5);
418 gtk_box_pack_start (GTK_BOX (hbox), gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO,
419 GTK_ICON_SIZE_SMALL_TOOLBAR), FALSE, FALSE, 0);
420 label = gtk_label_new (NULL);
421 gtk_label_set_markup (GTK_LABEL (label), _("<i>Tip: try editing /etc/PolicyKit/Policy.conf and see the proxy widgets update in real-time.</i>."));
422 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
423 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
424 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
425 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
426
427 /*----------------------------------------------------------------*/
428
429 g_object_unref (actions);
430
431 gtk_box_pack_start (GTK_BOX (vbox2),
432 gtk_ui_manager_get_widget (ui, "/MenuBar"),
433 FALSE, FALSE, 0);
434
435 GtkWidget *toolbar;
436 toolbar = gtk_ui_manager_get_widget (ui, "/ToolBar");
437 gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH);
438 gtk_box_pack_start (GTK_BOX (vbox2),
439 toolbar,
440 FALSE, FALSE, 0);
441
442 /*----------------------------------------------------------------*/
443
444 gtk_window_set_default_size (GTK_WINDOW (toplevel_window), 700, 0);
429445 gtk_window_set_title (GTK_WINDOW (toplevel_window), _("PolicyKit-gnome demo"));
430 g_signal_connect (toplevel_window, "delete-event", exit, NULL);
446 g_signal_connect (toplevel_window, "delete-event", (GCallback) exit, NULL);
431447 gtk_widget_show_all (toplevel_window);
432448
433449 g_main_loop_run (loop);
434
435 g_main_loop_unref (loop);
436 ret = 0;
437 out:
438 return ret;
450 return 0;
439451 }
22 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
33 "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
44 <policyconfig>
5
6 <action id="org.gnome.policykit.examples.jump">
7 <description>Jump</description>
8 <message>System policy prevents the PolicyKit-gnome example helper from Jumping</message>
9 <defaults>
10 <allow_inactive>no</allow_inactive>
11 <allow_active>auth_self_one_shot</allow_active>
12 </defaults>
13 </action>
514
615 <action id="org.gnome.policykit.examples.frobnicate">
716 <description>Frobnicate</description>
4756 </defaults>
4857 </action>
4958
59 <action id="org.gnome.policykit.examples.toggle">
60 <description>Toggle</description>
61 <message>System policy prevents the PolicyKit-gnome example helper from Toggling</message>
62 <defaults>
63 <allow_inactive>no</allow_inactive>
64 <allow_active>auth_admin_keep_always</allow_active>
65 </defaults>
66 </action>
67
5068 <action id="org.gnome.policykit.examples.kick-foo">
51 <description>Punch</description>
52 <description xml:lang="da">Smadre</description>
69 <description>Kick foo</description>
5370 <message>System policy prevents the PolicyKit-gnome example helper from Kicking foo</message>
5471 <message xml:lang="da">System indstillinger forhindrer PolicyKit-gnome eksempel hjælper fra at Sparke foo!</message>
5572 <defaults>
6077 </action>
6178
6279 <action id="org.gnome.policykit.examples.kick-bar">
63 <description>Punch</description>
64 <description xml:lang="da">Smadre</description>
80 <description>Kick bar</description>
6581 <message>System policy prevents the PolicyKit-gnome example helper from Kicking bar</message>
6682 <message xml:lang="da">System indstillinger forhindrer PolicyKit-gnome eksempel hjælper fra at Sparke bar!</message>
6783 <defaults>
7288 </action>
7389
7490 <action id="org.gnome.policykit.examples.kick-baz">
75 <description>Punch</description>
76 <description xml:lang="da">Smadre</description>
91 <description>Kick baz</description>
7792 <message>System policy prevents the PolicyKit-gnome example helper from Kicking baz</message>
7893 <message xml:lang="da">System indstillinger forhindrer PolicyKit-gnome eksempel hjælper fra at Sparke baz!</message>
7994 <defaults>
1414 -->
1515
1616 <policyconfig>
17
18 <action id="org.gnome.policykit.examples.jump">
19 <_description>Jump</_description>
20 <_message>System policy prevents the PolicyKit-gnome example helper from Jumping</_message>
21 <defaults>
22 <allow_inactive>no</allow_inactive>
23 <allow_active>auth_self_one_shot</allow_active>
24 </defaults>
25 </action>
1726
1827 <action id="org.gnome.policykit.examples.frobnicate">
1928 <_description>Frobnicate</_description>
5160 </defaults>
5261 </action>
5362
63 <action id="org.gnome.policykit.examples.toggle">
64 <_description>Toggle</_description>
65 <_message>System policy prevents the PolicyKit-gnome example helper from Toggling</_message>
66 <defaults>
67 <allow_inactive>no</allow_inactive>
68 <allow_active>auth_admin_keep_always</allow_active>
69 </defaults>
70 </action>
71
5472 <action id="org.gnome.policykit.examples.kick-foo">
55 <_description>Punch</_description>
73 <_description>Kick foo</_description>
5674 <_message>System policy prevents the PolicyKit-gnome example helper from Kicking foo</_message>
5775 <defaults>
5876 <allow_inactive>no</allow_inactive>
6280 </action>
6381
6482 <action id="org.gnome.policykit.examples.kick-bar">
65 <_description>Punch</_description>
83 <_description>Kick bar</_description>
6684 <_message>System policy prevents the PolicyKit-gnome example helper from Kicking bar</_message>
6785 <defaults>
6886 <allow_inactive>no</allow_inactive>
7290 </action>
7391
7492 <action id="org.gnome.policykit.examples.kick-baz">
75 <_description>Punch</_description>
93 <_description>Kick baz</_description>
7694 <_message>System policy prevents the PolicyKit-gnome example helper from Kicking baz</_message>
7795 <defaults>
7896 <allow_inactive>no</allow_inactive>
0 # -*- mode: makefile -*-
1
2 ####################################
3 # Everything below here is generic #
4 ####################################
5
6 if GTK_DOC_USE_LIBTOOL
7 GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
8 GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
9 else
10 GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS)
11 GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS)
12 endif
13
14 # We set GPATH here; this gives us semantics for GNU make
15 # which are more like other make's VPATH, when it comes to
16 # whether a source that is a target of one rule is then
17 # searched for in VPATH/GPATH.
18 #
19 GPATH = $(srcdir)
20
21 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
22
23 EXTRA_DIST = \
24 $(content_files) \
25 $(HTML_IMAGES) \
26 $(DOC_MAIN_SGML_FILE) \
27 $(DOC_MODULE)-sections.txt \
28 $(DOC_MODULE)-overrides.txt
29
30 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
31 $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
32
33 SCANOBJ_FILES = \
34 $(DOC_MODULE).args \
35 $(DOC_MODULE).hierarchy \
36 $(DOC_MODULE).interfaces \
37 $(DOC_MODULE).prerequisites \
38 $(DOC_MODULE).signals
39
40 CLEANFILES = $(SCANOBJ_FILES) $(DOC_MODULE)-unused.txt $(DOC_STAMPS)
41
42 if ENABLE_GTK_DOC
43 all-local: html-build.stamp
44 else
45 all-local:
46 endif
47
48 docs: html-build.stamp
49
50 #### scan ####
51
52 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
53 @echo 'gtk-doc: Scanning header files'
54 @-chmod -R u+w $(srcdir)
55 cd $(srcdir) && \
56 gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
57 if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
58 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
59 else \
60 cd $(srcdir) ; \
61 for i in $(SCANOBJ_FILES) ; do \
62 test -f $$i || touch $$i ; \
63 done \
64 fi
65 touch scan-build.stamp
66
67 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
68 @true
69
70 #### templates ####
71
72 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
73 @echo 'gtk-doc: Rebuilding template files'
74 @-chmod -R u+w $(srcdir)
75 cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
76 touch tmpl-build.stamp
77
78 tmpl.stamp: tmpl-build.stamp
79 @true
80
81 tmpl/*.sgml:
82 @true
83
84
85 #### xml ####
86
87 sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
88 @echo 'gtk-doc: Building XML'
89 @-chmod -R u+w $(srcdir)
90 cd $(srcdir) && \
91 gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
92 touch sgml-build.stamp
93
94 sgml.stamp: sgml-build.stamp
95 @true
96
97 #### html ####
98
99 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
100 @echo 'gtk-doc: Building HTML'
101 @-chmod -R u+w $(srcdir)
102 rm -rf $(srcdir)/html
103 mkdir $(srcdir)/html
104 cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
105 test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
106 @echo 'gtk-doc: Fixing cross-references'
107 cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
108 touch html-build.stamp
109
110 ##############
111
112 clean-local:
113 rm -f *~ *.bak
114 rm -rf .libs
115
116 maintainer-clean-local: clean
117 cd $(srcdir) && rm -rf xml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
118
119 install-data-local:
120 installfiles=`echo $(srcdir)/html/*`; \
121 if test "$$installfiles" = '$(srcdir)/html/*'; \
122 then echo '-- Nothing to install' ; \
123 else \
124 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \
125 for i in $$installfiles; do \
126 echo '-- Installing '$$i ; \
127 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
128 done; \
129 echo '-- Installing $(srcdir)/html/index.sgml' ; \
130 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \
131 fi
132
133 uninstall-local:
134 rm -f $(DESTDIR)$(TARGET_DIR)/*
135
136 #
137 # Require gtk-doc when making dist
138 #
139 if ENABLE_GTK_DOC
140 dist-check-gtkdoc:
141 else
142 dist-check-gtkdoc:
143 @echo "*** gtk-doc must be installed and enabled in order to make dist"
144 @false
145 endif
146
147 dist-hook: dist-check-gtkdoc dist-hook-local
148 mkdir $(distdir)/tmpl
149 mkdir $(distdir)/xml
150 mkdir $(distdir)/html
151 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
152 -cp $(srcdir)/xml/*.xml $(distdir)/xml
153 cp $(srcdir)/html/* $(distdir)/html
154 if test -f $(srcdir)/$(DOC_MODULE).types; then \
155 cp $(srcdir)/$(DOC_MODULE).types $(distdir)/$(DOC_MODULE).types; \
156 fi
157
158 .PHONY : dist-hook-local docs
3131 ## Release information
3232 my $PROGRAM = "intltool-extract";
3333 my $PACKAGE = "intltool";
34 my $VERSION = "0.36.1";
34 my $VERSION = "0.36.2";
3535
3636 ## Loaded modules
3737 use strict;
3434 ## Release information
3535 my $PROGRAM = "intltool-merge";
3636 my $PACKAGE = "intltool";
37 my $VERSION = "0.36.1";
37 my $VERSION = "0.36.2";
3838
3939 ## Loaded modules
4040 use strict;
9999 {
100100 my ($file) = @_;
101101 # If either a file exists, or when run it returns 0 exit status
102 return 1 if ((-x $file) or (system("$file --version >$devnull") == 0));
102 return 1 if ((-x $file) or (system("$file -l >$devnull") == 0));
103103 return 0;
104104 }
105105
274274
275275 sub gather_po_files
276276 {
277 for my $po_file (glob "$PO_DIR/*.po") {
278 $po_files_by_lang{po_file2lang($po_file)} = $po_file;
277 if (my $linguas = $ENV{"LINGUAS"})
278 {
279 for my $lang (split / /, $linguas) {
280 my $po_file = $PO_DIR . "/" . $lang . ".po";
281 if (-e $po_file) {
282 $po_files_by_lang{$lang} = $po_file;
283 }
284 }
285 }
286 else
287 {
288 if (open LINGUAS_FILE, "$PO_DIR/LINGUAS")
289 {
290 while (<LINGUAS_FILE>)
291 {
292 next if /^#/;
293
294 if (/([-a-zA-Z_@.]+)\n/)
295 {
296 my $lang = $1;
297
298 my $po_file = $PO_DIR . "/" . $lang . ".po";
299 if (-e $po_file) {
300 $po_files_by_lang{$lang} = $po_file;
301 }
302 }
303 }
304
305 close LINGUAS_FILE;
306 }
307 else
308 {
309 for my $po_file (glob "$PO_DIR/*.po") {
310 $po_files_by_lang{po_file2lang($po_file)} = $po_file;
311 }
312 }
279313 }
280314 }
281315
2929
3030 ## Release information
3131 my $PROGRAM = "intltool-update";
32 my $VERSION = "0.36.1";
32 my $VERSION = "0.36.2";
3333 my $PACKAGE = "intltool";
3434
3535 ## Loaded modules
00 # List of source files containing translatable strings.
11 # Please keep this file sorted alphabetically.
2 [encoding: UTF-8]
3 data/polkit-gnome-authorization.desktop.in
24 examples/polkit-gnome-example.c
35 examples/polkit-gnome-example.policy.in
6 polkit-gnome/polkit-gnome-action.c
7 polkit-gnome/polkit-gnome-auth.c
8 polkit-gnome/polkit-gnome-context.c
9 polkit-gnome/polkit-gnome-toggle-action.c
410 src/main.c
511 src/polkit-gnome-auth-dialog.c
612 src/polkit-gnome-manager.c
13 tools/polkit-gnome-authorization.c
77 msgstr ""
88 "Project-Id-Version: PolicyKit-gnome\n"
99 "Report-Msgid-Bugs-To: \n"
10 "POT-Creation-Date: 2007-09-28 14:03-0400\n"
10 "POT-Creation-Date: 2007-11-18 16:30-0500\n"
1111 "PO-Revision-Date: 2007-07-31 17:43-0400\n"
1212 "Last-Translator: David Zeuthen <davidz@redhat.com>\n"
1313 "Language-Team: LANGUAGE <LL@li.org>\n"
1515 "Content-Type: text/plain; charset=UTF-8\n"
1616 "Content-Transfer-Encoding: 8bit\n"
1717
18 #: ../examples/polkit-gnome-example.c:213
19 msgid "This action is not permitted"
20 msgstr "Denne handling er ikke tilladt"
21
22 #: ../examples/polkit-gnome-example.c:225
23 #, c-format
24 msgid "This action requires authentication (%s)"
25 msgstr "Denne handling kræver autorisering"
26
27 #: ../examples/polkit-gnome-example.c:234
28 msgid "This action is permitted"
29 msgstr "Denne handling er tilladt"
30
31 #: ../examples/polkit-gnome-example.c:355
32 msgid "Making the helper <b>Frobnicate</b> requires the user to authenticate."
18 #: ../data/polkit-gnome-authorization.desktop.in.h:1
19 #: ../tools/polkit-gnome-authorization.c:2267
20 #, fuzzy
21 msgid "Authorizations"
22 msgstr "_Husk autorisation"
23
24 #: ../data/polkit-gnome-authorization.desktop.in.h:2
25 #, fuzzy
26 msgid "Configure authorizations"
27 msgstr "_Husk autorisation"
28
29 #: ../examples/polkit-gnome-example.c:137
30 msgid "Copyright © 2007 David Zeuthen"
31 msgstr ""
32
33 #: ../examples/polkit-gnome-example.c:138
34 #, fuzzy
35 msgid "PolicyKit-gnome Website"
36 msgstr "PolicyKit-gnome demonstrations program"
37
38 #: ../examples/polkit-gnome-example.c:140
39 #: ../examples/polkit-gnome-example.c:445
40 msgid "PolicyKit-gnome demo"
41 msgstr "PolicyKit-gnome demonstrations program"
42
43 #: ../examples/polkit-gnome-example.c:141
44 #, fuzzy
45 msgid "PolicyKit for the GNOME desktop"
46 msgstr "PolicyKit GNOME session dæmon"
47
48 #: ../examples/polkit-gnome-example.c:151
49 msgid "_File"
50 msgstr ""
51
52 #. name, stock id, label
53 #: ../examples/polkit-gnome-example.c:152
54 msgid "_Actions"
55 msgstr ""
56
57 #. name, stock id, label
58 #: ../examples/polkit-gnome-example.c:153
59 msgid "_Help"
60 msgstr ""
61
62 #. name, stock id, label
63 #. name, stock id
64 #: ../examples/polkit-gnome-example.c:156
65 msgid "_Quit"
66 msgstr ""
67
68 #. label, accelerator
69 #: ../examples/polkit-gnome-example.c:157
70 msgid "Quit"
71 msgstr ""
72
73 #. name, stock id
74 #: ../examples/polkit-gnome-example.c:161
75 msgid "_About"
76 msgstr ""
77
78 #. label, accelerator
79 #: ../examples/polkit-gnome-example.c:162
80 msgid "About"
81 msgstr ""
82
83 #: ../examples/polkit-gnome-example.c:243
84 #, fuzzy
85 msgid ""
86 "Making the helper <b>Frobnicate</b> requires the user to authenticate. The "
87 "authorization is kept for the life time of the process"
88 msgstr ""
89 "Brugeren er påkrævet at indtaste et kodeord for at få hjælpe-programmet til "
90 "at <b>Smadre</b>. Dette privilegie kan blive husket indtil log ud."
91
92 #: ../examples/polkit-gnome-example.c:252
93 msgid "Frobnicate!"
94 msgstr "Frobniker!"
95
96 #: ../examples/polkit-gnome-example.c:267
97 #, fuzzy
98 msgid ""
99 "Making the helper <b>Jump</b> requires the user to authenticate. This is a "
100 "one-shot authorization."
33101 msgstr ""
34102 "Brugeren er påkrævet at indtaste sit kodeord for at få hjælpe-programmet til "
35103 "at <b>Frobnikere</b>"
36104
37 #: ../examples/polkit-gnome-example.c:359
38 msgid "Frobnicate!"
39 msgstr "Frobniker!"
40
41 #: ../examples/polkit-gnome-example.c:370
105 #: ../examples/polkit-gnome-example.c:275
106 msgid "Jump!"
107 msgstr ""
108
109 #: ../examples/polkit-gnome-example.c:290
110 #, fuzzy
42111 msgid ""
43112 "Making the helper <b>Tweak</b> requires a system administrator to "
44 "authenticate."
113 "authenticate. This instance overrides the defaults set in "
114 "polkit_gnome_action_new()."
45115 msgstr ""
46116 "Brugeren er påkrævet at indtaste et administrativt kodeord for at få hjælpe-"
47 "programmet til at <b>Tvække</b>"
48
49 #: ../examples/polkit-gnome-example.c:374
117 "programmet til at <b>Tviddle</b>. Dette privilegie kan blive husket for "
118 "evigt."
119
120 #: ../examples/polkit-gnome-example.c:299
121 #: ../examples/polkit-gnome-example.c:320
50122 msgid "Tweak!"
51123 msgstr "Tvæk!"
52124
53 #: ../examples/polkit-gnome-example.c:384
125 #: ../examples/polkit-gnome-example.c:306
126 #: ../examples/polkit-gnome-example.policy.in.h:17
127 msgid "Tweak"
128 msgstr "Tvæk"
129
130 #: ../examples/polkit-gnome-example.c:307
131 msgid "Tweak (long)"
132 msgstr ""
133
134 #: ../examples/polkit-gnome-example.c:308
135 msgid "If your admin wasn't annoying, you could do this"
136 msgstr ""
137
138 #: ../examples/polkit-gnome-example.c:313
139 #, fuzzy
140 msgid "Tweak..."
141 msgstr "Tvæk"
142
143 #: ../examples/polkit-gnome-example.c:314
144 msgid "Tweak... (long)"
145 msgstr ""
146
147 #: ../examples/polkit-gnome-example.c:315
148 msgid "Only card carrying tweakers can do this!"
149 msgstr ""
150
151 #: ../examples/polkit-gnome-example.c:321
152 #, fuzzy
153 msgid "Tweak! (long)"
154 msgstr "Tvæk!"
155
156 #: ../examples/polkit-gnome-example.c:322
157 msgid "Go ahead, tweak tweak tweak!"
158 msgstr ""
159
160 #: ../examples/polkit-gnome-example.c:339
54161 msgid ""
55162 "Making the helper <b>Twiddle</b> requires a system administrator to "
56163 "authenticate. Once authenticated, this privilege can be retained "
60167 "programmet til at <b>Tviddle</b>. Dette privilegie kan blive husket for "
61168 "evigt."
62169
63 #: ../examples/polkit-gnome-example.c:388
170 #: ../examples/polkit-gnome-example.c:348
64171 msgid "Twiddle!"
65172 msgstr "Tvidl!"
66173
67 #: ../examples/polkit-gnome-example.c:398
174 #: ../examples/polkit-gnome-example.c:363
68175 msgid ""
69176 "Making the helper <b>Punch</b> requires the user to authenticate. Once "
70177 "authenticated, this privilege can be retained for the remainder of the "
73180 "Brugeren er påkrævet at indtaste et kodeord for at få hjælpe-programmet til "
74181 "at <b>Smadre</b>. Dette privilegie kan blive husket indtil log ud."
75182
76 #: ../examples/polkit-gnome-example.c:402
183 #: ../examples/polkit-gnome-example.c:372
77184 msgid "Punch!"
78185 msgstr "Smadre!"
79186
80 #: ../examples/polkit-gnome-example.c:412
81 msgid ""
82 "Making the helper <b>Kick</b> can be done in different ways (this "
83 "demonstrates <i>annotations</i>). Select what to kick below and then press "
84 "the Kick button.."
85 msgstr ""
86 "Hjælpe-programmet kan <b>Sparke</b> på forskellige måder (dette "
87 "demonstrerer<i>annoteringer</i>. Vælg hvad du vil sparke nedenfor og tryk "
88 "derefter på Spark knappen.."
89
90 #: ../examples/polkit-gnome-example.c:416
91 msgid "Kick!"
92 msgstr "Spark!"
93
94 #: ../examples/polkit-gnome-example.c:430
95 msgid "PolicyKit-gnome demo"
96 msgstr "PolicyKit-gnome demonstrations program"
187 #: ../examples/polkit-gnome-example.c:387
188 msgid ""
189 "The <b>Toggle</b> action demonstrates the use of PolicyKit to drive a "
190 "GtkToggleButton; it's an intuitive way to ask users to give up "
191 "authorizations when they are done with them. E.g. the button is 'pressed in' "
192 "exactlywhen the authorization is held. Toggling the button means obtaining "
193 "resp. revoking the authorization in question."
194 msgstr ""
195
196 #: ../examples/polkit-gnome-example.c:401
197 msgid "Click to make changes..."
198 msgstr ""
199
200 #: ../examples/polkit-gnome-example.c:402
201 msgid "Click to prevent changes"
202 msgstr ""
203
204 #: ../examples/polkit-gnome-example.c:421
205 msgid ""
206 "<i>Tip: try editing /etc/PolicyKit/Policy.conf and see the proxy widgets "
207 "update in real-time.</i>."
208 msgstr ""
97209
98210 #: ../examples/polkit-gnome-example.policy.in.h:1
99211 msgid "Frobnicate"
100212 msgstr "Frobniker"
101213
102214 #: ../examples/polkit-gnome-example.policy.in.h:2
215 msgid "Jump"
216 msgstr ""
217
218 #: ../examples/polkit-gnome-example.policy.in.h:3
219 #, fuzzy
220 msgid "Kick bar"
221 msgstr "Spark!"
222
223 #: ../examples/polkit-gnome-example.policy.in.h:4
224 #, fuzzy
225 msgid "Kick baz"
226 msgstr "Spark!"
227
228 #: ../examples/polkit-gnome-example.policy.in.h:5
229 #, fuzzy
230 msgid "Kick foo"
231 msgstr "Spark!"
232
233 #: ../examples/polkit-gnome-example.policy.in.h:6
103234 msgid "Punch"
104235 msgstr "Smadre"
105236
106 #: ../examples/polkit-gnome-example.policy.in.h:3
237 #: ../examples/polkit-gnome-example.policy.in.h:7
107238 msgid ""
108239 "System policy prevents the PolicyKit-gnome example helper from Frobnicating"
109240 msgstr ""
110241 "System indstillinger forhindrer PolicyKit-gnome eksempel hjælper i at "
111242 "Frobnikere!"
112243
113 #: ../examples/polkit-gnome-example.policy.in.h:4
244 #: ../examples/polkit-gnome-example.policy.in.h:8
245 #, fuzzy
246 msgid "System policy prevents the PolicyKit-gnome example helper from Jumping"
247 msgstr ""
248 "System indstillinger forhindrer PolicyKit-gnome eksempel hjælper i at Smadre!"
249
250 #: ../examples/polkit-gnome-example.policy.in.h:9
114251 msgid ""
115252 "System policy prevents the PolicyKit-gnome example helper from Kicking bar"
116253 msgstr ""
117254 "System indstillinger forhindrer PolicyKit-gnome eksempel hjælper fra at "
118255 "Sparke bar!"
119256
120 #: ../examples/polkit-gnome-example.policy.in.h:5
257 #: ../examples/polkit-gnome-example.policy.in.h:10
121258 msgid ""
122259 "System policy prevents the PolicyKit-gnome example helper from Kicking baz"
123260 msgstr ""
124261 "System indstillinger forhindrer PolicyKit-gnome eksempel hjælper fra at "
125262 "Sparke baz!"
126263
127 #: ../examples/polkit-gnome-example.policy.in.h:6
264 #: ../examples/polkit-gnome-example.policy.in.h:11
128265 msgid ""
129266 "System policy prevents the PolicyKit-gnome example helper from Kicking foo"
130267 msgstr ""
131268 "System indstillinger forhindrer PolicyKit-gnome eksempel hjælper fra at "
132269 "Sparke foo!"
133270
134 #: ../examples/polkit-gnome-example.policy.in.h:7
271 #: ../examples/polkit-gnome-example.policy.in.h:12
135272 msgid "System policy prevents the PolicyKit-gnome example helper from Punching"
136273 msgstr ""
137274 "System indstillinger forhindrer PolicyKit-gnome eksempel hjælper i at Smadre!"
138275
139 #: ../examples/polkit-gnome-example.policy.in.h:8
276 #: ../examples/polkit-gnome-example.policy.in.h:13
277 #, fuzzy
278 msgid "System policy prevents the PolicyKit-gnome example helper from Toggling"
279 msgstr ""
280 "System indstillinger forhindrer PolicyKit-gnome eksempel hjælper i at Tvidle!"
281
282 #: ../examples/polkit-gnome-example.policy.in.h:14
140283 msgid "System policy prevents the PolicyKit-gnome example helper from Tweaking"
141284 msgstr ""
142285 "System indstillinger forhindrer PolicyKit-gnome eksempel hjælper i at Tvække!"
143286
144 #: ../examples/polkit-gnome-example.policy.in.h:9
287 #: ../examples/polkit-gnome-example.policy.in.h:15
145288 msgid ""
146289 "System policy prevents the PolicyKit-gnome example helper from Twiddling"
147290 msgstr ""
148291 "System indstillinger forhindrer PolicyKit-gnome eksempel hjælper i at Tvidle!"
149292
150 #: ../examples/polkit-gnome-example.policy.in.h:10
151 msgid "Tweak"
152 msgstr "Tvæk"
153
154 #: ../examples/polkit-gnome-example.policy.in.h:11
293 #: ../examples/polkit-gnome-example.policy.in.h:16
294 msgid "Toggle"
295 msgstr ""
296
297 #: ../examples/polkit-gnome-example.policy.in.h:18
155298 msgid "Twiddle"
156299 msgstr "Tvidl"
157300
158 #: ../src/main.c:143
159 msgid "Enable debugging code"
160 msgstr "Slå debug kode til"
161
162 #: ../src/main.c:144
163 msgid "Don't become a daemon"
164 msgstr "Unlad at dæmonisere"
165
166 #: ../src/main.c:157
301 #: ../polkit-gnome/polkit-gnome-toggle-action.c:387
302 #: ../polkit-gnome/polkit-gnome-toggle-action.c:388
303 #, fuzzy
304 msgid "Authenticating..."
305 msgstr "Autorisering"
306
307 #: ../src/main.c:141
308 msgid "Don't exit after 30 seconds of inactivity"
309 msgstr ""
310
311 #: ../src/main.c:150
167312 msgid "PolicyKit GNOME session daemon"
168313 msgstr "PolicyKit GNOME session dæmon"
169314
170 #: ../src/main.c:178
315 #: ../src/main.c:171
171316 #, c-format
172317 msgid "Starting PolicyKit GNOME session daemon version %s"
173318 msgstr "Starter PolicyKit GNOME session dæmon version %s"
174319
175 #: ../src/polkit-gnome-auth-dialog.c:178
320 #: ../src/polkit-gnome-auth-dialog.c:190
321 #: ../tools/polkit-gnome-authorization.c:555
176322 msgid "Select user..."
177323 msgstr "Vælg bruger..."
178324
179 #: ../src/polkit-gnome-auth-dialog.c:199
325 #: ../src/polkit-gnome-auth-dialog.c:211
326 #: ../tools/polkit-gnome-authorization.c:571
180327 #, c-format
181328 msgid "%s (%s)"
182329 msgstr "%s (%s)"
183330
184 #: ../src/polkit-gnome-auth-dialog.c:280
331 #: ../src/polkit-gnome-auth-dialog.c:292
185332 msgid "_Remember authorization for this session"
186333 msgstr "Husk autorisation indtil _log ud"
187334
188 #: ../src/polkit-gnome-auth-dialog.c:286
335 #: ../src/polkit-gnome-auth-dialog.c:298
189336 msgid "_Remember authorization"
190337 msgstr "_Husk autorisation"
191338
192 #: ../src/polkit-gnome-auth-dialog.c:301
339 #: ../src/polkit-gnome-auth-dialog.c:313
193340 msgid ""
194341 "An application is attempting to perform an action that requires privileges. "
195342 "Authentication as one of the users below is required to perform this action."
197344 "Et program forsøger at udføre en handling der kræver privilegier. "
198345 "Autorisering som en af brugerne nedenfor er påkrævet."
199346
200 #: ../src/polkit-gnome-auth-dialog.c:308
347 #: ../src/polkit-gnome-auth-dialog.c:320
201348 msgid ""
202349 "An application is attempting to perform an action that requires privileges. "
203350 "Authentication as the super user is required to perform this action."
205352 "Et program forsøger at udføre en handling der kræver privilegier. "
206353 "Autorisering som super bruger er påkrævet."
207354
208 #: ../src/polkit-gnome-auth-dialog.c:312
355 #: ../src/polkit-gnome-auth-dialog.c:324
209356 msgid ""
210357 "An application is attempting to perform an action that requires privileges. "
211358 "Authentication is required to perform this action."
213360 "Et program forsøger at udføre en handling der kræver privilegier. "
214361 "Autorisering er påkrævet."
215362
216 #: ../src/polkit-gnome-auth-dialog.c:446
363 #: ../src/polkit-gnome-auth-dialog.c:348
364 #, c-format
365 msgid "Click to edit %s"
366 msgstr ""
367
368 #: ../src/polkit-gnome-auth-dialog.c:371
369 #: ../tools/polkit-gnome-authorization.c:1247
370 #, c-format
371 msgid "Click to open %s"
372 msgstr ""
373
374 #: ../src/polkit-gnome-auth-dialog.c:600
217375 msgid "_Authenticate"
218376 msgstr "Aut_orisering"
219377
220 #: ../src/polkit-gnome-auth-dialog.c:505 ../src/polkit-gnome-manager.c:587
221 #: ../src/polkit-gnome-manager.c:635
378 #: ../src/polkit-gnome-auth-dialog.c:659 ../src/polkit-gnome-manager.c:657
379 #: ../src/polkit-gnome-manager.c:705
222380 msgid "_Password:"
223381 msgstr "_Kodeord:"
224382
225 #: ../src/polkit-gnome-auth-dialog.c:527
383 #: ../src/polkit-gnome-auth-dialog.c:681
226384 msgid "For this _session only"
227385 msgstr "_Indtil log ud"
228386
229 #: ../src/polkit-gnome-auth-dialog.c:535
387 #: ../src/polkit-gnome-auth-dialog.c:689
230388 msgid "<small><b>_Details</b></small>"
231389 msgstr "<small><b>_Detaljer</b></small>"
232390
233 #: ../src/polkit-gnome-auth-dialog.c:556
391 #: ../src/polkit-gnome-auth-dialog.c:710
234392 msgid "<small><b>Application:</b></small>"
235393 msgstr "<small><b>Program:</b></small>"
236394
237 #: ../src/polkit-gnome-auth-dialog.c:560
395 #: ../src/polkit-gnome-auth-dialog.c:714
238396 msgid "<small><b>Action:</b></small>"
239397 msgstr "<small><b>Handling:</b></small>"
240398
241 #: ../src/polkit-gnome-auth-dialog.c:654
399 #: ../src/polkit-gnome-auth-dialog.c:719
400 #, fuzzy
401 msgid "<small><b>Vendor:</b></small>"
402 msgstr "<small><b>Handling:</b></small>"
403
404 #: ../src/polkit-gnome-auth-dialog.c:848
242405 msgid "Authenticate"
243406 msgstr "Autorisering"
244407
245 #: ../src/polkit-gnome-manager.c:630
408 #: ../src/polkit-gnome-manager.c:700
246409 #, c-format
247410 msgid "_Password for %s:"
248411 msgstr "_Kodeord for %s:"
249412
250 #: ../src/polkit-gnome-manager.c:632
413 #: ../src/polkit-gnome-manager.c:702
251414 msgid "_Password for root:"
252415 msgstr "_Kodeord for root:"
253416
254 #: ../src/polkit-gnome-manager.c:640
417 #: ../src/polkit-gnome-manager.c:710
255418 #, c-format
256419 msgid "_Password or swipe finger for %s:"
257420 msgstr "_Kodeord eller finger for %s:"
258421
259 #: ../src/polkit-gnome-manager.c:643
422 #: ../src/polkit-gnome-manager.c:713
260423 msgid "_Password or swipe finger for root:"
261424 msgstr "_Kodeord eller finger for root:"
262425
263 #: ../src/polkit-gnome-manager.c:646
426 #: ../src/polkit-gnome-manager.c:716
264427 msgid "_Password or swipe finger:"
265428 msgstr "_Kodeord eller finger:"
429
430 #: ../tools/polkit-gnome-authorization.c:115
431 msgid "No"
432 msgstr ""
433
434 #: ../tools/polkit-gnome-authorization.c:117
435 msgid "Admin Authentication (one shot)"
436 msgstr ""
437
438 #: ../tools/polkit-gnome-authorization.c:118
439 #, fuzzy
440 msgid "Admin Authentication"
441 msgstr "Autorisering"
442
443 #: ../tools/polkit-gnome-authorization.c:119
444 msgid "Admin Authentication (keep session)"
445 msgstr ""
446
447 #: ../tools/polkit-gnome-authorization.c:120
448 msgid "Admin Authentication (keep indefinitely)"
449 msgstr ""
450
451 #: ../tools/polkit-gnome-authorization.c:122
452 #, fuzzy
453 msgid "Authentication (one shot)"
454 msgstr "Autorisering"
455
456 #: ../tools/polkit-gnome-authorization.c:123
457 #, fuzzy
458 msgid "Authentication"
459 msgstr "Autorisering"
460
461 #: ../tools/polkit-gnome-authorization.c:124
462 msgid "Authentication (keep session)"
463 msgstr ""
464
465 #: ../tools/polkit-gnome-authorization.c:125
466 msgid "Authentication (keep indefinitely)"
467 msgstr ""
468
469 #: ../tools/polkit-gnome-authorization.c:127
470 msgid "Yes"
471 msgstr ""
472
473 #: ../tools/polkit-gnome-authorization.c:306
474 msgid "A moment ago"
475 msgstr ""
476
477 #: ../tools/polkit-gnome-authorization.c:310
478 msgid "1 minute ago"
479 msgstr ""
480
481 #: ../tools/polkit-gnome-authorization.c:312
482 #, c-format
483 msgid "%d minutes ago"
484 msgstr ""
485
486 #: ../tools/polkit-gnome-authorization.c:316
487 msgid "1 hour ago"
488 msgstr ""
489
490 #: ../tools/polkit-gnome-authorization.c:318
491 #, c-format
492 msgid "%d hours ago"
493 msgstr ""
494
495 #: ../tools/polkit-gnome-authorization.c:322
496 msgid "1 day ago"
497 msgstr ""
498
499 #: ../tools/polkit-gnome-authorization.c:324
500 #, c-format
501 msgid "%d days ago"
502 msgstr ""
503
504 #: ../tools/polkit-gnome-authorization.c:341
505 #, c-format
506 msgid "Auth as %s (uid %d)"
507 msgstr ""
508
509 #: ../tools/polkit-gnome-authorization.c:343
510 #, c-format
511 msgid "Auth as uid %d"
512 msgstr ""
513
514 #: ../tools/polkit-gnome-authorization.c:348
515 #, c-format
516 msgid "Granted by %s (uid %d)"
517 msgstr ""
518
519 #: ../tools/polkit-gnome-authorization.c:350
520 #, c-format
521 msgid "Granted by uid %d"
522 msgstr ""
523
524 #: ../tools/polkit-gnome-authorization.c:364
525 #, c-format
526 msgid "Single shot pid %d (%s)"
527 msgstr ""
528
529 #: ../tools/polkit-gnome-authorization.c:370
530 #, fuzzy, c-format
531 msgid "pid %d (%s)"
532 msgstr "%s (%s)"
533
534 #: ../tools/polkit-gnome-authorization.c:373
535 #, fuzzy
536 msgid "This session"
537 msgstr "_Indtil log ud"
538
539 #: ../tools/polkit-gnome-authorization.c:376
540 msgid "Always"
541 msgstr ""
542
543 #: ../tools/polkit-gnome-authorization.c:387
544 msgid "Must be on console"
545 msgstr ""
546
547 #: ../tools/polkit-gnome-authorization.c:389
548 msgid "Must be in active session"
549 msgstr ""
550
551 #: ../tools/polkit-gnome-authorization.c:391
552 msgid "Must be on active console"
553 msgstr ""
554
555 #: ../tools/polkit-gnome-authorization.c:396
556 msgid "None"
557 msgstr ""
558
559 #: ../tools/polkit-gnome-authorization.c:725
560 msgid "Grant"
561 msgstr ""
562
563 #: ../tools/polkit-gnome-authorization.c:747
564 #, c-format
565 msgid ""
566 "<b><big>Granting authorization for the <i>%s</i> action requires more "
567 "information</big></b>"
568 msgstr ""
569
570 #: ../tools/polkit-gnome-authorization.c:757
571 msgid ""
572 "Select the beneficiary and, optionally, how to constrain the authorization "
573 "that you are about to grant."
574 msgstr ""
575
576 #: ../tools/polkit-gnome-authorization.c:768
577 msgid "<b>Beneficiary</b>"
578 msgstr ""
579
580 #: ../tools/polkit-gnome-authorization.c:779
581 msgid "Select the user that will receive the authorization."
582 msgstr ""
583
584 #: ../tools/polkit-gnome-authorization.c:788
585 msgid "_Show system users"
586 msgstr ""
587
588 #: ../tools/polkit-gnome-authorization.c:803
589 msgid "<b>Constraints</b>"
590 msgstr ""
591
592 #: ../tools/polkit-gnome-authorization.c:814
593 msgid ""
594 "Constraints limits the authorization such that it only applies under certain "
595 "circumstances."
596 msgstr ""
597
598 #: ../tools/polkit-gnome-authorization.c:820
599 msgid "_None"
600 msgstr ""
601
602 #: ../tools/polkit-gnome-authorization.c:822
603 msgid "Must be _in active session"
604 msgstr ""
605
606 #: ../tools/polkit-gnome-authorization.c:824
607 msgid "Must be on _local console"
608 msgstr ""
609
610 #: ../tools/polkit-gnome-authorization.c:826
611 msgid "Must be in _active session on local console"
612 msgstr ""
613
614 #: ../tools/polkit-gnome-authorization.c:846
615 #: ../tools/polkit-gnome-authorization.c:1978
616 msgid "_Grant..."
617 msgstr ""
618
619 #: ../tools/polkit-gnome-authorization.c:1011
620 msgid "Edit Implicit Authorizations"
621 msgstr ""
622
623 #: ../tools/polkit-gnome-authorization.c:1032
624 msgid "<b><big>Choose new implicit authorizations</big></b>"
625 msgstr ""
626
627 #: ../tools/polkit-gnome-authorization.c:1046
628 #, c-format
629 msgid ""
630 "Implicit authorizations are authorizations that are granted automatically to "
631 "users under certain circumstances. Choose what is required for the action <i>"
632 "%s</i>."
633 msgstr ""
634
635 #: ../tools/polkit-gnome-authorization.c:1071
636 #: ../tools/polkit-gnome-authorization.c:1826
637 msgid "<i>Anyone:</i>"
638 msgstr ""
639
640 #: ../tools/polkit-gnome-authorization.c:1078
641 #: ../tools/polkit-gnome-authorization.c:1830
642 msgid "<i>Console:</i>"
643 msgstr ""
644
645 #: ../tools/polkit-gnome-authorization.c:1085
646 #: ../tools/polkit-gnome-authorization.c:1834
647 msgid "<i>Active Console:</i>"
648 msgstr ""
649
650 #: ../tools/polkit-gnome-authorization.c:1114
651 msgid "_Modify..."
652 msgstr ""
653
654 #: ../tools/polkit-gnome-authorization.c:1742
655 #, fuzzy
656 msgid "<b>Action</b>"
657 msgstr "<small><b>Handling:</b></small>"
658
659 #: ../tools/polkit-gnome-authorization.c:1757
660 msgid "<i>Identifier:</i>"
661 msgstr ""
662
663 #: ../tools/polkit-gnome-authorization.c:1767
664 msgid "<i>Description:</i>"
665 msgstr ""
666
667 #: ../tools/polkit-gnome-authorization.c:1777
668 msgid "<i>Vendor:</i>"
669 msgstr ""
670
671 #: ../tools/polkit-gnome-authorization.c:1803
672 msgid "<b>Implicit Authorizations</b>"
673 msgstr ""
674
675 #: ../tools/polkit-gnome-authorization.c:1811
676 msgid ""
677 "Implicit authorizations are authorizations automatically given to users "
678 "based on certain criteria such as if they are on the local console."
679 msgstr ""
680
681 #: ../tools/polkit-gnome-authorization.c:1854
682 msgid "_Edit..."
683 msgstr ""
684
685 #: ../tools/polkit-gnome-authorization.c:1861
686 msgid "Revert To _Defaults..."
687 msgstr ""
688
689 #: ../tools/polkit-gnome-authorization.c:1884
690 msgid "<b>Explicit Authorizations</b>"
691 msgstr ""
692
693 #: ../tools/polkit-gnome-authorization.c:1895
694 msgid ""
695 "This list displays authorizations that are either obtained through "
696 "authentication or specifically given to the entity in question."
697 msgstr ""
698
699 #: ../tools/polkit-gnome-authorization.c:1925
700 msgid "Entity"
701 msgstr ""
702
703 #: ../tools/polkit-gnome-authorization.c:1933
704 msgid "Scope"
705 msgstr ""
706
707 #: ../tools/polkit-gnome-authorization.c:1941
708 msgid "Obtained"
709 msgstr ""
710
711 #: ../tools/polkit-gnome-authorization.c:1949
712 msgid "How"
713 msgstr ""
714
715 #: ../tools/polkit-gnome-authorization.c:1957
716 msgid "Constraints"
717 msgstr ""
718
719 #: ../tools/polkit-gnome-authorization.c:1992
720 #: ../tools/polkit-gnome-authorization.c:2006
721 msgid "_Revoke"
722 msgstr ""
723
724 #: ../tools/polkit-gnome-authorization.c:1999
725 msgid "_Revoke..."
726 msgstr ""
727
728 #: ../tools/polkit-gnome-authorization.c:2019
729 msgid "_Show authorizations from all users..."
730 msgstr ""
731
732 #: ../tools/polkit-gnome-authorization.c:2020
733 #, fuzzy
734 msgid "_Show authorizations from all users"
735 msgstr "Husk autorisation indtil _log ud"
736
737 #: ../tools/polkit-gnome-authorization.c:2241
738 msgid "Select an action"
739 msgstr ""
740
741 #~ msgid ""
742 #~ "Making the helper <b>Tweak</b> requires a system administrator to "
743 #~ "authenticate."
744 #~ msgstr ""
745 #~ "Brugeren er påkrævet at indtaste et administrativt kodeord for at få "
746 #~ "hjælpe-programmet til at <b>Tvække</b>"
747
748 #~ msgid "This action is not permitted"
749 #~ msgstr "Denne handling er ikke tilladt"
750
751 #~ msgid "This action requires authentication (%s)"
752 #~ msgstr "Denne handling kræver autorisering"
753
754 #~ msgid "This action is permitted"
755 #~ msgstr "Denne handling er tilladt"
756
757 #~ msgid ""
758 #~ "Making the helper <b>Kick</b> can be done in different ways (this "
759 #~ "demonstrates <i>annotations</i>). Select what to kick below and then "
760 #~ "press the Kick button.."
761 #~ msgstr ""
762 #~ "Hjælpe-programmet kan <b>Sparke</b> på forskellige måder (dette "
763 #~ "demonstrerer<i>annoteringer</i>. Vælg hvad du vil sparke nedenfor og tryk "
764 #~ "derefter på Spark knappen.."
765
766 #~ msgid "Enable debugging code"
767 #~ msgstr "Slå debug kode til"
768
769 #~ msgid "Don't become a daemon"
770 #~ msgstr "Unlad at dæmonisere"
0 ## Process this file with automake to produce Makefile.in
1
2 INCLUDES = \
3 -I$(top_builddir) -I$(top_srcdir) \
4 -DPACKAGE_LIBEXECDIR=\""$(libexecdir)"\" \
5 -DPACKAGE_SYSCONFDIR=\""$(sysconfdir)"\" \
6 -DPACKAGE_DATADIR=\""$(datadir)"\" \
7 -DPACKAGE_BINDIR=\""$(bindir)"\" \
8 -DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
9 -DPACKAGE_LOCALEDIR=\""$(localedir)"\" \
10 -DPACKAGE_LIBDIR=\""$(libdir)"\" \
11 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
12 -DPOLKIT_GNOME_COMPILATION
13
14 lib_LTLIBRARIES=libpolkit-gnome.la
15
16 libpolkit_gnomeincludedir=$(includedir)/PolicyKit/polkit-gnome
17
18 libpolkit_gnomeinclude_HEADERS = \
19 polkit-gnome.h \
20 polkit-gnome-context.h \
21 polkit-gnome-action.h \
22 polkit-gnome-toggle-action.h \
23 polkit-gnome-auth.h
24
25 libpolkit_gnome_la_SOURCES = \
26 polkit-gnome-context.h polkit-gnome-context.c \
27 polkit-gnome-action.h polkit-gnome-action.c \
28 polkit-gnome-toggle-action.h polkit-gnome-toggle-action.c \
29 polkit-gnome-auth.h polkit-gnome-auth.c
30
31 libpolkit_gnome_la_CFLAGS = \
32 $(GTK_CFLAGS) \
33 $(DBUS_GLIB_CFLAGS) \
34 $(POLKIT_DBUS_CFLAGS) \
35 $(POLKIT_GRANT_CFLAGS) \
36 $(WARN_CFLAGS) \
37 $(AM_CFLAGS)
38
39 libpolkit_gnome_la_LIBADD = \
40 $(GTK_LIBS) \
41 $(DBUS_GLIB_LIBS) \
42 $(POLKIT_DBUS_LIBS) \
43 $(INTLLIBS)
44
45 libpolkit_gnome_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
46
47 clean-local :
48 rm -f *~ $(BUILT_SOURCES)
49
0 # Makefile.in generated by automake 1.10 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16
17 VPATH = @srcdir@
18 pkgdatadir = $(datadir)/@PACKAGE@
19 pkglibdir = $(libdir)/@PACKAGE@
20 pkgincludedir = $(includedir)/@PACKAGE@
21 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
22 install_sh_DATA = $(install_sh) -c -m 644
23 install_sh_PROGRAM = $(install_sh) -c
24 install_sh_SCRIPT = $(install_sh) -c
25 INSTALL_HEADER = $(INSTALL_DATA)
26 transform = $(program_transform_name)
27 NORMAL_INSTALL = :
28 PRE_INSTALL = :
29 POST_INSTALL = :
30 NORMAL_UNINSTALL = :
31 PRE_UNINSTALL = :
32 POST_UNINSTALL = :
33 build_triplet = @build@
34 host_triplet = @host@
35 subdir = polkit-gnome
36 DIST_COMMON = $(libpolkit_gnomeinclude_HEADERS) $(srcdir)/Makefile.am \
37 $(srcdir)/Makefile.in
38 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
40 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
41 $(ACLOCAL_M4)
42 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
43 CONFIG_HEADER = $(top_builddir)/config.h
44 CONFIG_CLEAN_FILES =
45 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
46 am__vpath_adj = case $$p in \
47 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
48 *) f=$$p;; \
49 esac;
50 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
51 am__installdirs = "$(DESTDIR)$(libdir)" \
52 "$(DESTDIR)$(libpolkit_gnomeincludedir)"
53 libLTLIBRARIES_INSTALL = $(INSTALL)
54 LTLIBRARIES = $(lib_LTLIBRARIES)
55 am__DEPENDENCIES_1 =
56 libpolkit_gnome_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
57 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
58 $(am__DEPENDENCIES_1)
59 am_libpolkit_gnome_la_OBJECTS = \
60 libpolkit_gnome_la-polkit-gnome-context.lo \
61 libpolkit_gnome_la-polkit-gnome-action.lo \
62 libpolkit_gnome_la-polkit-gnome-toggle-action.lo \
63 libpolkit_gnome_la-polkit-gnome-auth.lo
64 libpolkit_gnome_la_OBJECTS = $(am_libpolkit_gnome_la_OBJECTS)
65 libpolkit_gnome_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
66 $(LIBTOOLFLAGS) --mode=link $(CCLD) \
67 $(libpolkit_gnome_la_CFLAGS) $(CFLAGS) \
68 $(libpolkit_gnome_la_LDFLAGS) $(LDFLAGS) -o $@
69 DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
70 depcomp = $(SHELL) $(top_srcdir)/depcomp
71 am__depfiles_maybe = depfiles
72 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
73 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
74 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
75 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
76 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
77 CCLD = $(CC)
78 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
79 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
80 $(LDFLAGS) -o $@
81 SOURCES = $(libpolkit_gnome_la_SOURCES)
82 DIST_SOURCES = $(libpolkit_gnome_la_SOURCES)
83 libpolkit_gnomeincludeHEADERS_INSTALL = $(INSTALL_HEADER)
84 HEADERS = $(libpolkit_gnomeinclude_HEADERS)
85 ETAGS = etags
86 CTAGS = ctags
87 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
88 ACLOCAL = @ACLOCAL@
89 ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
90 ALL_LINGUAS = @ALL_LINGUAS@
91 AMTAR = @AMTAR@
92 AM_CFLAGS = @AM_CFLAGS@
93 AM_CPPFLAGS = @AM_CPPFLAGS@
94 AM_CXXFLAGS = @AM_CXXFLAGS@
95 AM_LDFLAGS = @AM_LDFLAGS@
96 AR = @AR@
97 AUTOCONF = @AUTOCONF@
98 AUTOHEADER = @AUTOHEADER@
99 AUTOMAKE = @AUTOMAKE@
100 AWK = @AWK@
101 CATALOGS = @CATALOGS@
102 CATOBJEXT = @CATOBJEXT@
103 CC = @CC@
104 CCDEPMODE = @CCDEPMODE@
105 CFLAGS = @CFLAGS@
106 CPP = @CPP@
107 CPPFLAGS = @CPPFLAGS@
108 CXX = @CXX@
109 CXXCPP = @CXXCPP@
110 CXXDEPMODE = @CXXDEPMODE@
111 CXXFLAGS = @CXXFLAGS@
112 CYGPATH_W = @CYGPATH_W@
113 DATADIRNAME = @DATADIRNAME@
114 DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
115 DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
116 DEFS = @DEFS@
117 DEPDIR = @DEPDIR@
118 DISABLE_DEPRECATED = @DISABLE_DEPRECATED@
119 DOC_USER_FORMATS = @DOC_USER_FORMATS@
120 ECHO = @ECHO@
121 ECHO_C = @ECHO_C@
122 ECHO_N = @ECHO_N@
123 ECHO_T = @ECHO_T@
124 EGREP = @EGREP@
125 EXEEXT = @EXEEXT@
126 F77 = @F77@
127 FFLAGS = @FFLAGS@
128 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
129 GMOFILES = @GMOFILES@
130 GMSGFMT = @GMSGFMT@
131 GNOME_VFS_CFLAGS = @GNOME_VFS_CFLAGS@
132 GNOME_VFS_LIBS = @GNOME_VFS_LIBS@
133 GREP = @GREP@
134 GTKDOC_CHECK = @GTKDOC_CHECK@
135 GTK_CFLAGS = @GTK_CFLAGS@
136 GTK_LIBS = @GTK_LIBS@
137 HELP_DIR = @HELP_DIR@
138 HTML_DIR = @HTML_DIR@
139 INSTALL = @INSTALL@
140 INSTALL_DATA = @INSTALL_DATA@
141 INSTALL_PROGRAM = @INSTALL_PROGRAM@
142 INSTALL_SCRIPT = @INSTALL_SCRIPT@
143 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
144 INSTOBJEXT = @INSTOBJEXT@
145 INTLLIBS = @INTLLIBS@
146 INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
147 INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
148 INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
149 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
150 INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
151 INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
152 INTLTOOL_MERGE = @INTLTOOL_MERGE@
153 INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
154 INTLTOOL_PERL = @INTLTOOL_PERL@
155 INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@
156 INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
157 INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
158 INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
159 INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
160 INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
161 INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
162 INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
163 INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
164 INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
165 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
166 INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
167 INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
168 INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
169 LDFLAGS = @LDFLAGS@
170 LIBOBJS = @LIBOBJS@
171 LIBS = @LIBS@
172 LIBTOOL = @LIBTOOL@
173 LN_S = @LN_S@
174 LTLIBOBJS = @LTLIBOBJS@
175 LT_AGE = @LT_AGE@
176 LT_CURRENT = @LT_CURRENT@
177 LT_REVISION = @LT_REVISION@
178 MAINT = @MAINT@
179 MAKEINFO = @MAKEINFO@
180 MKDIR_P = @MKDIR_P@
181 MKINSTALLDIRS = @MKINSTALLDIRS@
182 MSGFMT = @MSGFMT@
183 MSGFMT_OPTS = @MSGFMT_OPTS@
184 OBJEXT = @OBJEXT@
185 OMF_DIR = @OMF_DIR@
186 PACKAGE = @PACKAGE@
187 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
188 PACKAGE_NAME = @PACKAGE_NAME@
189 PACKAGE_STRING = @PACKAGE_STRING@
190 PACKAGE_TARNAME = @PACKAGE_TARNAME@
191 PACKAGE_VERSION = @PACKAGE_VERSION@
192 PATH_SEPARATOR = @PATH_SEPARATOR@
193 PKG_CONFIG = @PKG_CONFIG@
194 POFILES = @POFILES@
195 POLKIT_DBUS_CFLAGS = @POLKIT_DBUS_CFLAGS@
196 POLKIT_DBUS_LIBS = @POLKIT_DBUS_LIBS@
197 POLKIT_GRANT_CFLAGS = @POLKIT_GRANT_CFLAGS@
198 POLKIT_GRANT_LIBS = @POLKIT_GRANT_LIBS@
199 POLKIT_POLICY_FILE_VALIDATE = @POLKIT_POLICY_FILE_VALIDATE@
200 POSUB = @POSUB@
201 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
202 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
203 RANLIB = @RANLIB@
204 SED = @SED@
205 SET_MAKE = @SET_MAKE@
206 SEXY_CFLAGS = @SEXY_CFLAGS@
207 SEXY_LIBS = @SEXY_LIBS@
208 SHELL = @SHELL@
209 STRIP = @STRIP@
210 USE_NLS = @USE_NLS@
211 VERSION = @VERSION@
212 WARN_CFLAGS = @WARN_CFLAGS@
213 XGETTEXT = @XGETTEXT@
214 abs_builddir = @abs_builddir@
215 abs_srcdir = @abs_srcdir@
216 abs_top_builddir = @abs_top_builddir@
217 abs_top_srcdir = @abs_top_srcdir@
218 ac_ct_CC = @ac_ct_CC@
219 ac_ct_CXX = @ac_ct_CXX@
220 ac_ct_F77 = @ac_ct_F77@
221 am__include = @am__include@
222 am__leading_dot = @am__leading_dot@
223 am__quote = @am__quote@
224 am__tar = @am__tar@
225 am__untar = @am__untar@
226 bindir = @bindir@
227 build = @build@
228 build_alias = @build_alias@
229 build_cpu = @build_cpu@
230 build_os = @build_os@
231 build_vendor = @build_vendor@
232 builddir = @builddir@
233 datadir = @datadir@
234 datarootdir = @datarootdir@
235 docdir = @docdir@
236 dvidir = @dvidir@
237 exec_prefix = @exec_prefix@
238 host = @host@
239 host_alias = @host_alias@
240 host_cpu = @host_cpu@
241 host_os = @host_os@
242 host_vendor = @host_vendor@
243 htmldir = @htmldir@
244 includedir = @includedir@
245 infodir = @infodir@
246 install_sh = @install_sh@
247 libdir = @libdir@
248 libexecdir = @libexecdir@
249 localedir = @localedir@
250 localstatedir = @localstatedir@
251 mandir = @mandir@
252 mkdir_p = @mkdir_p@
253 oldincludedir = @oldincludedir@
254 pdfdir = @pdfdir@
255 prefix = @prefix@
256 program_transform_name = @program_transform_name@
257 psdir = @psdir@
258 sbindir = @sbindir@
259 sharedstatedir = @sharedstatedir@
260 srcdir = @srcdir@
261 sysconfdir = @sysconfdir@
262 target_alias = @target_alias@
263 top_builddir = @top_builddir@
264 top_srcdir = @top_srcdir@
265 INCLUDES = \
266 -I$(top_builddir) -I$(top_srcdir) \
267 -DPACKAGE_LIBEXECDIR=\""$(libexecdir)"\" \
268 -DPACKAGE_SYSCONFDIR=\""$(sysconfdir)"\" \
269 -DPACKAGE_DATADIR=\""$(datadir)"\" \
270 -DPACKAGE_BINDIR=\""$(bindir)"\" \
271 -DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
272 -DPACKAGE_LOCALEDIR=\""$(localedir)"\" \
273 -DPACKAGE_LIBDIR=\""$(libdir)"\" \
274 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
275 -DPOLKIT_GNOME_COMPILATION
276
277 lib_LTLIBRARIES = libpolkit-gnome.la
278 libpolkit_gnomeincludedir = $(includedir)/PolicyKit/polkit-gnome
279 libpolkit_gnomeinclude_HEADERS = \
280 polkit-gnome.h \
281 polkit-gnome-context.h \
282 polkit-gnome-action.h \
283 polkit-gnome-toggle-action.h \
284 polkit-gnome-auth.h
285
286 libpolkit_gnome_la_SOURCES = \
287 polkit-gnome-context.h polkit-gnome-context.c \
288 polkit-gnome-action.h polkit-gnome-action.c \
289 polkit-gnome-toggle-action.h polkit-gnome-toggle-action.c \
290 polkit-gnome-auth.h polkit-gnome-auth.c
291
292 libpolkit_gnome_la_CFLAGS = \
293 $(GTK_CFLAGS) \
294 $(DBUS_GLIB_CFLAGS) \
295 $(POLKIT_DBUS_CFLAGS) \
296 $(POLKIT_GRANT_CFLAGS) \
297 $(WARN_CFLAGS) \
298 $(AM_CFLAGS)
299
300 libpolkit_gnome_la_LIBADD = \
301 $(GTK_LIBS) \
302 $(DBUS_GLIB_LIBS) \
303 $(POLKIT_DBUS_LIBS) \
304 $(INTLLIBS)
305
306 libpolkit_gnome_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
307 all: all-am
308
309 .SUFFIXES:
310 .SUFFIXES: .c .lo .o .obj
311 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
312 @for dep in $?; do \
313 case '$(am__configure_deps)' in \
314 *$$dep*) \
315 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
316 && exit 0; \
317 exit 1;; \
318 esac; \
319 done; \
320 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign polkit-gnome/Makefile'; \
321 cd $(top_srcdir) && \
322 $(AUTOMAKE) --foreign polkit-gnome/Makefile
323 .PRECIOUS: Makefile
324 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
325 @case '$?' in \
326 *config.status*) \
327 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
328 *) \
329 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
330 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
331 esac;
332
333 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
334 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
335
336 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
337 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
338 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
339 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
340 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
341 @$(NORMAL_INSTALL)
342 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
343 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
344 if test -f $$p; then \
345 f=$(am__strip_dir) \
346 echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
347 $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
348 else :; fi; \
349 done
350
351 uninstall-libLTLIBRARIES:
352 @$(NORMAL_UNINSTALL)
353 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
354 p=$(am__strip_dir) \
355 echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
356 $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
357 done
358
359 clean-libLTLIBRARIES:
360 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
361 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
362 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
363 test "$$dir" != "$$p" || dir=.; \
364 echo "rm -f \"$${dir}/so_locations\""; \
365 rm -f "$${dir}/so_locations"; \
366 done
367 libpolkit-gnome.la: $(libpolkit_gnome_la_OBJECTS) $(libpolkit_gnome_la_DEPENDENCIES)
368 $(libpolkit_gnome_la_LINK) -rpath $(libdir) $(libpolkit_gnome_la_OBJECTS) $(libpolkit_gnome_la_LIBADD) $(LIBS)
369
370 mostlyclean-compile:
371 -rm -f *.$(OBJEXT)
372
373 distclean-compile:
374 -rm -f *.tab.c
375
376 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpolkit_gnome_la-polkit-gnome-action.Plo@am__quote@
377 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpolkit_gnome_la-polkit-gnome-auth.Plo@am__quote@
378 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpolkit_gnome_la-polkit-gnome-context.Plo@am__quote@
379 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpolkit_gnome_la-polkit-gnome-toggle-action.Plo@am__quote@
380
381 .c.o:
382 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
383 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
384 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
385 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
386 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
387
388 .c.obj:
389 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
390 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
391 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
392 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
393 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
394
395 .c.lo:
396 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
397 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
398 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
399 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
400 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
401
402 libpolkit_gnome_la-polkit-gnome-context.lo: polkit-gnome-context.c
403 @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpolkit_gnome_la_CFLAGS) $(CFLAGS) -MT libpolkit_gnome_la-polkit-gnome-context.lo -MD -MP -MF $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-context.Tpo -c -o libpolkit_gnome_la-polkit-gnome-context.lo `test -f 'polkit-gnome-context.c' || echo '$(srcdir)/'`polkit-gnome-context.c
404 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-context.Tpo $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-context.Plo
405 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='polkit-gnome-context.c' object='libpolkit_gnome_la-polkit-gnome-context.lo' libtool=yes @AMDEPBACKSLASH@
406 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
407 @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpolkit_gnome_la_CFLAGS) $(CFLAGS) -c -o libpolkit_gnome_la-polkit-gnome-context.lo `test -f 'polkit-gnome-context.c' || echo '$(srcdir)/'`polkit-gnome-context.c
408
409 libpolkit_gnome_la-polkit-gnome-action.lo: polkit-gnome-action.c
410 @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpolkit_gnome_la_CFLAGS) $(CFLAGS) -MT libpolkit_gnome_la-polkit-gnome-action.lo -MD -MP -MF $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-action.Tpo -c -o libpolkit_gnome_la-polkit-gnome-action.lo `test -f 'polkit-gnome-action.c' || echo '$(srcdir)/'`polkit-gnome-action.c
411 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-action.Tpo $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-action.Plo
412 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='polkit-gnome-action.c' object='libpolkit_gnome_la-polkit-gnome-action.lo' libtool=yes @AMDEPBACKSLASH@
413 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
414 @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpolkit_gnome_la_CFLAGS) $(CFLAGS) -c -o libpolkit_gnome_la-polkit-gnome-action.lo `test -f 'polkit-gnome-action.c' || echo '$(srcdir)/'`polkit-gnome-action.c
415
416 libpolkit_gnome_la-polkit-gnome-toggle-action.lo: polkit-gnome-toggle-action.c
417 @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpolkit_gnome_la_CFLAGS) $(CFLAGS) -MT libpolkit_gnome_la-polkit-gnome-toggle-action.lo -MD -MP -MF $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-toggle-action.Tpo -c -o libpolkit_gnome_la-polkit-gnome-toggle-action.lo `test -f 'polkit-gnome-toggle-action.c' || echo '$(srcdir)/'`polkit-gnome-toggle-action.c
418 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-toggle-action.Tpo $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-toggle-action.Plo
419 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='polkit-gnome-toggle-action.c' object='libpolkit_gnome_la-polkit-gnome-toggle-action.lo' libtool=yes @AMDEPBACKSLASH@
420 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
421 @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpolkit_gnome_la_CFLAGS) $(CFLAGS) -c -o libpolkit_gnome_la-polkit-gnome-toggle-action.lo `test -f 'polkit-gnome-toggle-action.c' || echo '$(srcdir)/'`polkit-gnome-toggle-action.c
422
423 libpolkit_gnome_la-polkit-gnome-auth.lo: polkit-gnome-auth.c
424 @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpolkit_gnome_la_CFLAGS) $(CFLAGS) -MT libpolkit_gnome_la-polkit-gnome-auth.lo -MD -MP -MF $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-auth.Tpo -c -o libpolkit_gnome_la-polkit-gnome-auth.lo `test -f 'polkit-gnome-auth.c' || echo '$(srcdir)/'`polkit-gnome-auth.c
425 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-auth.Tpo $(DEPDIR)/libpolkit_gnome_la-polkit-gnome-auth.Plo
426 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='polkit-gnome-auth.c' object='libpolkit_gnome_la-polkit-gnome-auth.lo' libtool=yes @AMDEPBACKSLASH@
427 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
428 @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpolkit_gnome_la_CFLAGS) $(CFLAGS) -c -o libpolkit_gnome_la-polkit-gnome-auth.lo `test -f 'polkit-gnome-auth.c' || echo '$(srcdir)/'`polkit-gnome-auth.c
429
430 mostlyclean-libtool:
431 -rm -f *.lo
432
433 clean-libtool:
434 -rm -rf .libs _libs
435 install-libpolkit_gnomeincludeHEADERS: $(libpolkit_gnomeinclude_HEADERS)
436 @$(NORMAL_INSTALL)
437 test -z "$(libpolkit_gnomeincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libpolkit_gnomeincludedir)"
438 @list='$(libpolkit_gnomeinclude_HEADERS)'; for p in $$list; do \
439 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
440 f=$(am__strip_dir) \
441 echo " $(libpolkit_gnomeincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libpolkit_gnomeincludedir)/$$f'"; \
442 $(libpolkit_gnomeincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libpolkit_gnomeincludedir)/$$f"; \
443 done
444
445 uninstall-libpolkit_gnomeincludeHEADERS:
446 @$(NORMAL_UNINSTALL)
447 @list='$(libpolkit_gnomeinclude_HEADERS)'; for p in $$list; do \
448 f=$(am__strip_dir) \
449 echo " rm -f '$(DESTDIR)$(libpolkit_gnomeincludedir)/$$f'"; \
450 rm -f "$(DESTDIR)$(libpolkit_gnomeincludedir)/$$f"; \
451 done
452
453 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
454 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
455 unique=`for i in $$list; do \
456 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
457 done | \
458 $(AWK) ' { files[$$0] = 1; } \
459 END { for (i in files) print i; }'`; \
460 mkid -fID $$unique
461 tags: TAGS
462
463 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
464 $(TAGS_FILES) $(LISP)
465 tags=; \
466 here=`pwd`; \
467 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
468 unique=`for i in $$list; do \
469 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
470 done | \
471 $(AWK) ' { files[$$0] = 1; } \
472 END { for (i in files) print i; }'`; \
473 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
474 test -n "$$unique" || unique=$$empty_fix; \
475 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
476 $$tags $$unique; \
477 fi
478 ctags: CTAGS
479 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
480 $(TAGS_FILES) $(LISP)
481 tags=; \
482 here=`pwd`; \
483 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
484 unique=`for i in $$list; do \
485 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
486 done | \
487 $(AWK) ' { files[$$0] = 1; } \
488 END { for (i in files) print i; }'`; \
489 test -z "$(CTAGS_ARGS)$$tags$$unique" \
490 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
491 $$tags $$unique
492
493 GTAGS:
494 here=`$(am__cd) $(top_builddir) && pwd` \
495 && cd $(top_srcdir) \
496 && gtags -i $(GTAGS_ARGS) $$here
497
498 distclean-tags:
499 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
500
501 distdir: $(DISTFILES)
502 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
503 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
504 list='$(DISTFILES)'; \
505 dist_files=`for file in $$list; do echo $$file; done | \
506 sed -e "s|^$$srcdirstrip/||;t" \
507 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
508 case $$dist_files in \
509 */*) $(MKDIR_P) `echo "$$dist_files" | \
510 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
511 sort -u` ;; \
512 esac; \
513 for file in $$dist_files; do \
514 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
515 if test -d $$d/$$file; then \
516 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
517 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
518 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
519 fi; \
520 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
521 else \
522 test -f $(distdir)/$$file \
523 || cp -p $$d/$$file $(distdir)/$$file \
524 || exit 1; \
525 fi; \
526 done
527 check-am: all-am
528 check: check-am
529 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
530 installdirs:
531 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libpolkit_gnomeincludedir)"; do \
532 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
533 done
534 install: install-am
535 install-exec: install-exec-am
536 install-data: install-data-am
537 uninstall: uninstall-am
538
539 install-am: all-am
540 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
541
542 installcheck: installcheck-am
543 install-strip:
544 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
545 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
546 `test -z '$(STRIP)' || \
547 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
548 mostlyclean-generic:
549
550 clean-generic:
551
552 distclean-generic:
553 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
554
555 maintainer-clean-generic:
556 @echo "This command is intended for maintainers to use"
557 @echo "it deletes files that may require special tools to rebuild."
558 clean: clean-am
559
560 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
561 mostlyclean-am
562
563 distclean: distclean-am
564 -rm -rf ./$(DEPDIR)
565 -rm -f Makefile
566 distclean-am: clean-am distclean-compile distclean-generic \
567 distclean-tags
568
569 dvi: dvi-am
570
571 dvi-am:
572
573 html: html-am
574
575 info: info-am
576
577 info-am:
578
579 install-data-am: install-libpolkit_gnomeincludeHEADERS
580
581 install-dvi: install-dvi-am
582
583 install-exec-am: install-libLTLIBRARIES
584
585 install-html: install-html-am
586
587 install-info: install-info-am
588
589 install-man:
590
591 install-pdf: install-pdf-am
592
593 install-ps: install-ps-am
594
595 installcheck-am:
596
597 maintainer-clean: maintainer-clean-am
598 -rm -rf ./$(DEPDIR)
599 -rm -f Makefile
600 maintainer-clean-am: distclean-am maintainer-clean-generic
601
602 mostlyclean: mostlyclean-am
603
604 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
605 mostlyclean-libtool
606
607 pdf: pdf-am
608
609 pdf-am:
610
611 ps: ps-am
612
613 ps-am:
614
615 uninstall-am: uninstall-libLTLIBRARIES \
616 uninstall-libpolkit_gnomeincludeHEADERS
617
618 .MAKE: install-am install-strip
619
620 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
621 clean-libLTLIBRARIES clean-libtool clean-local ctags distclean \
622 distclean-compile distclean-generic distclean-libtool \
623 distclean-tags distdir dvi dvi-am html html-am info info-am \
624 install install-am install-data install-data-am install-dvi \
625 install-dvi-am install-exec install-exec-am install-html \
626 install-html-am install-info install-info-am \
627 install-libLTLIBRARIES install-libpolkit_gnomeincludeHEADERS \
628 install-man install-pdf install-pdf-am install-ps \
629 install-ps-am install-strip installcheck installcheck-am \
630 installdirs maintainer-clean maintainer-clean-generic \
631 mostlyclean mostlyclean-compile mostlyclean-generic \
632 mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
633 uninstall-am uninstall-libLTLIBRARIES \
634 uninstall-libpolkit_gnomeincludeHEADERS
635
636
637 clean-local :
638 rm -f *~ $(BUILT_SOURCES)
639 # Tell versions [3.59,3.63) of GNU make to not export all variables.
640 # Otherwise a system limit (for SysV at least) may be exceeded.
641 .NOEXPORT:
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
1 /***************************************************************************
2 *
3 * polkit-gnome-action.c :
4 *
5 * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 *
22 **************************************************************************/
23
24 #ifdef HAVE_CONFIG_H
25 # include "config.h"
26 #endif
27
28 #include <stdlib.h>
29 #include <stdio.h>
30 #include <unistd.h>
31 #include <signal.h>
32 #include <errno.h>
33 #include <string.h>
34 #include <sys/types.h>
35 #include <sys/stat.h>
36 #include <sys/wait.h>
37 #include <fcntl.h>
38
39 #include <glib.h>
40 #include <glib/gi18n-lib.h>
41 #include <glib-object.h>
42
43 #include <gtk/gtk.h>
44 #include <gdk/gdkx.h>
45
46 #define DBUS_API_SUBJECT_TO_CHANGE
47 #include <dbus/dbus-glib.h>
48 #include <dbus/dbus-glib-lowlevel.h>
49
50 #include <polkit/polkit.h>
51 #include <polkit-dbus/polkit-dbus.h>
52
53 #include "polkit-gnome-context.h"
54 #include "polkit-gnome-action.h"
55 #include "polkit-gnome-auth.h"
56
57 /**
58 * SECTION:polkit-gnome-action
59 * @short_description: A GtkAction subclass where instances can be tied to a specific PolicyKit action.
60 *
61 * Actions in GTK+ represent operations that the user can be perform,
62 * along with some information how it should be presented in the
63 * interface. Each action provides methods to create icons, menu items
64 * and toolbar items representing itself. Each action can have one or
65 * more proxy menu item, toolbar button or other proxy
66 * widgets. Proxies mirror the state of the action (text label,
67 * tooltip, icon, visible, sensitive, etc), and should change when the
68 * action's state changes. When the proxy is activated, it should
69 * activate its action.
70 *
71 * Instances of #PolKitGnomeAction class updates the label, tooltip,
72 * icon-name, visible and properties of the parent #GtkAction instance
73 * according to what result PolicyKit gives about a given
74 * #PolKitAction object. The #PolKitGnomeContext class is used
75 * internally to track changes. This means that external events (such
76 * as the editing of the /etc/PolicyKit/PolicyKit.conf file,
77 * ConsoleKit session activity changes or if the user gains a
78 * privilege via authentication) will trigger the action, and thus
79 * connected proxy widgets, to be updated.
80 *
81 * In addition, the #PolKitGnomeAction class intercepts the ::activate
82 * signal defined in #GtkAction. When the result from PolicyKit is
83 * yes, the signal is propagated. If the result is auth,
84 * polkit_gnome_auth_show_dialog() will be used to bring up an
85 * authentication dialog for the given #PolKitAction. If the user
86 * succesfully gained the privilege, a ::activate signal will be
87 * synthesized. If the result is no, the signal is also propagated.
88 *
89 * As a result, everything happens under the covers; the application
90 * programmer using #PolKitGnomeAction will only get the ::activate
91 * signal when the answer from PolicyKit is yes and as such don't have
92 * to worry about bringing up authentication dialogs if the property
93 * "no-sensitive" is set to #FALSE.
94 *
95 * When an authentication dialog is show, the #PolKitGnomeAction class
96 * will pass the XID of the top-level window that the proxy widget
97 * causing the activation to polkit_gnome_auth_show_dialog().
98 *
99 * An example of how to use #PolKitGnomeAction follows. First, build
100 * the following program
101 *
102 * <programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../examples/polkit-gnome-example.c" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
103 *
104 * with
105 *
106 * <programlisting>gcc -o polkit-gnome-example `pkg-config --cflags --libs polkit-gnome` polkit-gnome-example.c</programlisting>
107 *
108 * Then, put the following content
109 *
110 * <programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../examples/polkit-gnome-example.policy" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
111 *
112 * into a file
113 * <literal>/usr/share/PolicyKit/policy/polkit-gnome-example.policy</literal>. Finally,
114 * run <literal>polkit-gnome-example</literal>. It should display a
115 * window like this:
116 *
117 * <inlinegraphic fileref="polkit-gnome-example-screenshot.png" format="PNG"/>
118 *
119 * If the "Twiddle!" button is pressed, an authentication dialog
120 * should pop up
121 *
122 * <inlinegraphic fileref="polkit-gnome-example-auth-dialog-twiddle.png" format="PNG"/>
123 *
124 * Here is how what the application looks like if the user gains
125 * authorization for all the actions:
126 *
127 * <inlinegraphic fileref="polkit-gnome-example-screenshot-authorized.png" format="PNG"/>
128 *
129 * Regarding how to build an example mechanism that this GTK+
130 * application can take advantage of, please refer to the
131 * #PolKitContext class for examples.
132 **/
133
134 #define POLKIT_GNOME_ACTION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), POLKIT_GNOME_TYPE_ACTION, PolKitGnomeActionPrivate))
135
136 static void polkit_gnome_action_activate (PolKitGnomeAction *action);
137 static void _auth_start (PolKitGnomeAction *action);
138
139 static void polkit_gnome_action_set_polkit_action (PolKitGnomeAction *action, PolKitAction *pk_action);
140 static void polkit_gnome_action_set_polkit_action_sufficient (PolKitGnomeAction *action, const GValue *pk_action_array);
141
142 static void polkit_gnome_action_set_self_blocked_visible (PolKitGnomeAction *action, gboolean visible);
143 static void polkit_gnome_action_set_self_blocked_sensitive (PolKitGnomeAction *action, gboolean sensitive);
144 static void polkit_gnome_action_set_self_blocked_short_label (PolKitGnomeAction *action, const gchar *short_label);
145 static void polkit_gnome_action_set_self_blocked_label (PolKitGnomeAction *action, const gchar *label);
146 static void polkit_gnome_action_set_self_blocked_tooltip (PolKitGnomeAction *action, const gchar *tooltip);
147 static void polkit_gnome_action_set_self_blocked_icon_name (PolKitGnomeAction *action, const gchar *icon_name);
148
149 static void polkit_gnome_action_set_no_visible (PolKitGnomeAction *action, gboolean visible);
150 static void polkit_gnome_action_set_no_sensitive (PolKitGnomeAction *action, gboolean sensitive);
151 static void polkit_gnome_action_set_no_short_label (PolKitGnomeAction *action, const gchar *short_label);
152 static void polkit_gnome_action_set_no_label (PolKitGnomeAction *action, const gchar *label);
153 static void polkit_gnome_action_set_no_tooltip (PolKitGnomeAction *action, const gchar *tooltip);
154 static void polkit_gnome_action_set_no_icon_name (PolKitGnomeAction *action, const gchar *icon_name);
155
156 static void polkit_gnome_action_set_auth_visible (PolKitGnomeAction *action, gboolean visible);
157 static void polkit_gnome_action_set_auth_sensitive (PolKitGnomeAction *action, gboolean sensitive);
158 static void polkit_gnome_action_set_auth_short_label (PolKitGnomeAction *action, const gchar *short_label);
159 static void polkit_gnome_action_set_auth_label (PolKitGnomeAction *action, const gchar *label);
160 static void polkit_gnome_action_set_auth_tooltip (PolKitGnomeAction *action, const gchar *tooltip);
161 static void polkit_gnome_action_set_auth_icon_name (PolKitGnomeAction *action, const gchar *icon_name);
162
163 static void polkit_gnome_action_set_yes_visible (PolKitGnomeAction *action, gboolean visible);
164 static void polkit_gnome_action_set_yes_sensitive (PolKitGnomeAction *action, gboolean sensitive);
165 static void polkit_gnome_action_set_yes_short_label (PolKitGnomeAction *action, const gchar *short_label);
166 static void polkit_gnome_action_set_yes_label (PolKitGnomeAction *action, const gchar *label);
167 static void polkit_gnome_action_set_yes_tooltip (PolKitGnomeAction *action, const gchar *tooltip);
168 static void polkit_gnome_action_set_yes_icon_name (PolKitGnomeAction *action, const gchar *icon_name);
169
170 static void polkit_gnome_action_set_target_pid (PolKitGnomeAction *action, guint target_pid);
171
172 static void _pk_config_changed (PolKitGnomeContext *pk_g_context, PolKitGnomeAction *action);
173 static void _pk_console_kit_db_changed (PolKitGnomeContext *pk_g_context, PolKitGnomeAction *action);
174
175 struct _PolKitGnomeActionPrivate
176 {
177 gboolean self_blocked_visible;
178 gboolean self_blocked_sensitive;
179 gchar *self_blocked_short_label;
180 gchar *self_blocked_label;
181 gchar *self_blocked_tooltip;
182 gchar *self_blocked_icon_name;
183
184 gboolean no_visible;
185 gboolean no_sensitive;
186 gchar *no_short_label;
187 gchar *no_label;
188 gchar *no_tooltip;
189 gchar *no_icon_name;
190
191 gboolean auth_visible;
192 gboolean auth_sensitive;
193 gchar *auth_short_label;
194 gchar *auth_label;
195 gchar *auth_tooltip;
196 gchar *auth_icon_name;
197
198 gboolean yes_visible;
199 gboolean yes_sensitive;
200 gchar *yes_short_label;
201 gchar *yes_label;
202 gchar *yes_tooltip;
203 gchar *yes_icon_name;
204
205 gboolean master_visible;
206 gboolean master_sensitive;
207
208 PolKitAction *polkit_action;
209 GSList *polkit_action_sufficient;
210
211 gboolean polkit_action_set_once;
212
213 guint target_pid;
214
215 /* the current PolicyKit result for the given polkit_action_id */
216 PolKitResult pk_result;
217
218 PolKitGnomeContext *pk_g_context;
219
220 gulong config_changed_handler_id;
221 gulong console_kit_db_changed_handler_id;
222 };
223
224 enum
225 {
226 AUTH_START_SIGNAL,
227 AUTH_END_SIGNAL,
228 POLKIT_RESULT_CHANGED_SIGNAL,
229 LAST_SIGNAL
230 };
231
232 enum
233 {
234 PROP_0,
235 PROP_POLKIT_ACTION_OBJ,
236 PROP_POLKIT_ACTION_OBJ_SUFFICIENT,
237
238 PROP_POLKIT_SELF_BLOCKED_VISIBLE,
239 PROP_POLKIT_SELF_BLOCKED_SENSITIVE,
240 PROP_POLKIT_SELF_BLOCKED_SHORT_LABEL,
241 PROP_POLKIT_SELF_BLOCKED_LABEL,
242 PROP_POLKIT_SELF_BLOCKED_TOOLTIP,
243 PROP_POLKIT_SELF_BLOCKED_ICON_NAME,
244
245 PROP_POLKIT_NO_VISIBLE,
246 PROP_POLKIT_NO_SENSITIVE,
247 PROP_POLKIT_NO_SHORT_LABEL,
248 PROP_POLKIT_NO_LABEL,
249 PROP_POLKIT_NO_TOOLTIP,
250 PROP_POLKIT_NO_ICON_NAME,
251
252 PROP_POLKIT_AUTH_VISIBLE,
253 PROP_POLKIT_AUTH_SENSITIVE,
254 PROP_POLKIT_AUTH_SHORT_LABEL,
255 PROP_POLKIT_AUTH_LABEL,
256 PROP_POLKIT_AUTH_TOOLTIP,
257 PROP_POLKIT_AUTH_ICON_NAME,
258
259 PROP_POLKIT_YES_VISIBLE,
260 PROP_POLKIT_YES_SENSITIVE,
261 PROP_POLKIT_YES_SHORT_LABEL,
262 PROP_POLKIT_YES_LABEL,
263 PROP_POLKIT_YES_TOOLTIP,
264 PROP_POLKIT_YES_ICON_NAME,
265
266 PROP_POLKIT_MASTER_VISIBLE,
267 PROP_POLKIT_MASTER_SENSITIVE,
268
269 PROP_POLKIT_TARGET_PID,
270 };
271
272 G_DEFINE_TYPE (PolKitGnomeAction, polkit_gnome_action, GTK_TYPE_ACTION)
273
274 static void set_property (GObject *object,
275 guint prop_id,
276 const GValue *value,
277 GParamSpec *pspec);
278 static void get_property (GObject *object,
279 guint prop_id,
280 GValue *value,
281 GParamSpec *pspec);
282
283 static GObjectClass *parent_class = NULL;
284 static guint signals[LAST_SIGNAL] = { 0 };
285
286 static void
287 polkit_gnome_action_init (PolKitGnomeAction *action)
288 {
289 action->priv = POLKIT_GNOME_ACTION_GET_PRIVATE (action);
290
291
292 }
293
294
295 static void
296 free_pk_action_sufficient (PolKitGnomeAction *action)
297 {
298 if (action->priv->polkit_action_sufficient != NULL) {
299 GSList *l;
300
301 for (l = action->priv->polkit_action_sufficient; l != NULL; l = g_slist_next (l)) {
302 polkit_action_unref ((PolKitAction *) l->data);
303 }
304 g_slist_free (action->priv->polkit_action_sufficient);
305 action->priv->polkit_action_sufficient = NULL;
306 }
307 }
308
309 static void
310 polkit_gnome_action_finalize (GObject *object)
311 {
312 PolKitGnomeAction *action;
313
314 action = POLKIT_GNOME_ACTION (object);
315
316 if (action->priv->polkit_action != NULL)
317 polkit_action_unref (action->priv->polkit_action);
318
319 g_free (action->priv->self_blocked_short_label);
320 g_free (action->priv->self_blocked_label);
321 g_free (action->priv->self_blocked_tooltip);
322 g_free (action->priv->self_blocked_icon_name);
323
324 g_free (action->priv->no_short_label);
325 g_free (action->priv->no_label);
326 g_free (action->priv->no_tooltip);
327 g_free (action->priv->no_icon_name);
328
329 g_free (action->priv->auth_short_label);
330 g_free (action->priv->auth_label);
331 g_free (action->priv->auth_tooltip);
332 g_free (action->priv->auth_icon_name);
333
334 g_free (action->priv->yes_short_label);
335 g_free (action->priv->yes_label);
336 g_free (action->priv->yes_tooltip);
337 g_free (action->priv->yes_icon_name);
338
339 free_pk_action_sufficient (action);
340
341 if (action->priv->pk_g_context != NULL) {
342 g_signal_handler_disconnect (action->priv->pk_g_context, action->priv->config_changed_handler_id);
343 g_signal_handler_disconnect (action->priv->pk_g_context, action->priv->console_kit_db_changed_handler_id);
344 g_object_unref (action->priv->pk_g_context);
345 }
346
347 G_OBJECT_CLASS (polkit_gnome_action_parent_class)->finalize (object);
348 }
349
350 static void
351 _ensure_pk_g_context (PolKitGnomeAction *action)
352 {
353 if (action->priv->pk_g_context == NULL) {
354 action->priv->pk_g_context = polkit_gnome_context_get (NULL);
355
356 action->priv->config_changed_handler_id = g_signal_connect (
357 action->priv->pk_g_context,
358 "config-changed",
359 G_CALLBACK (_pk_config_changed),
360 action);
361
362 action->priv->console_kit_db_changed_handler_id = g_signal_connect (
363 action->priv->pk_g_context,
364 "console-kit-db-changed",
365 G_CALLBACK (_pk_console_kit_db_changed),
366 action);
367 }
368 }
369
370 static GObject *
371 polkit_gnome_action_constructor (GType type,
372 guint n_construct_properties,
373 GObjectConstructParam *construct_properties)
374 {
375 PolKitGnomeAction *action;
376 PolKitGnomeActionClass *klass;
377
378 klass = POLKIT_GNOME_ACTION_CLASS (g_type_class_peek (POLKIT_GNOME_TYPE_ACTION));
379
380 action = POLKIT_GNOME_ACTION (G_OBJECT_CLASS (parent_class)->constructor (type,
381 n_construct_properties,
382 construct_properties));
383
384 action->priv->master_visible = TRUE;
385 action->priv->master_sensitive = TRUE;
386
387 return G_OBJECT (action);
388 }
389
390
391 static void
392 polkit_gnome_action_class_init (PolKitGnomeActionClass *klass)
393 {
394 GObjectClass *gobject_class;
395 GtkActionClass *action_class;
396
397 parent_class = g_type_class_peek_parent (klass);
398 gobject_class = G_OBJECT_CLASS (klass);
399 action_class = GTK_ACTION_CLASS (klass);
400
401 gobject_class->constructor = polkit_gnome_action_constructor;
402 gobject_class->set_property = set_property;
403 gobject_class->get_property = get_property;
404 gobject_class->finalize = polkit_gnome_action_finalize;
405
406 action_class->activate = (void (*)(GtkAction*)) polkit_gnome_action_activate;
407
408 klass->auth_start = _auth_start;
409
410 g_object_class_install_property (gobject_class,
411 PROP_POLKIT_ACTION_OBJ,
412 g_param_spec_pointer ("polkit-action",
413 "The PolKitAction object this GTK+ action is tracking",
414 "The PolKitAction object this GTK+ action is tracking",
415 G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
416
417 g_object_class_install_property (gobject_class,
418 PROP_POLKIT_ACTION_OBJ_SUFFICIENT,
419 g_param_spec_value_array (
420 "polkit-action-sufficient",
421 "An array of PolKitAction objects that are sufficient to have authorizations for.",
422 "An array of PolKitAction objects that are sufficient to have authorizations for.",
423 g_param_spec_pointer (
424 "polkit-action-sufficient-member",
425 "PolKitAction member of polkit-action-sufficient",
426 "PolKitAction member of polkit-action-sufficient",
427 G_PARAM_READWRITE | G_PARAM_CONSTRUCT),
428 G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
429
430 /*------------------------------*/
431
432 g_object_class_install_property (
433 gobject_class,
434 PROP_POLKIT_SELF_BLOCKED_VISIBLE,
435 g_param_spec_boolean (
436 "self-blocked-visible",
437 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, whether the action will be visible",
438 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, whether the action will be visible",
439 TRUE,
440 G_PARAM_READWRITE));
441
442 g_object_class_install_property (
443 gobject_class,
444 PROP_POLKIT_SELF_BLOCKED_SENSITIVE,
445 g_param_spec_boolean (
446 "self-blocked-sensitive",
447 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, whether the action will be sensitive",
448 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, whether the action will be sensitive",
449 FALSE,
450 G_PARAM_READWRITE));
451
452 g_object_class_install_property (
453 gobject_class,
454 PROP_POLKIT_SELF_BLOCKED_SHORT_LABEL,
455 g_param_spec_string (
456 "self-blocked-short-label",
457 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this short-label",
458 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this short-label",
459 NULL,
460 G_PARAM_READWRITE));
461
462 g_object_class_install_property (
463 gobject_class,
464 PROP_POLKIT_SELF_BLOCKED_LABEL,
465 g_param_spec_string (
466 "self-blocked-label",
467 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this label",
468 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this label",
469 NULL,
470 G_PARAM_READWRITE));
471
472 g_object_class_install_property (
473 gobject_class,
474 PROP_POLKIT_SELF_BLOCKED_TOOLTIP,
475 g_param_spec_string (
476 "self-blocked-tooltip",
477 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this tooltip",
478 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this tooltip",
479 NULL,
480 G_PARAM_READWRITE));
481
482 g_object_class_install_property (
483 gobject_class,
484 PROP_POLKIT_SELF_BLOCKED_ICON_NAME,
485 g_param_spec_string (
486 "self-blocked-icon-name",
487 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this icon-name",
488 "If PolicyKit evaluates the result as 'no' and the reason is that the user has a self-granted negative authorization, use this icon-name",
489 NULL,
490 G_PARAM_READWRITE));
491
492 /*------------------------------*/
493
494 g_object_class_install_property (
495 gobject_class,
496 PROP_POLKIT_NO_VISIBLE,
497 g_param_spec_boolean (
498 "no-visible",
499 "If PolicyKit evaluates the result as 'no', whether the action will be visible",
500 "If PolicyKit evaluates the result as 'no', whether the action will be visible",
501 TRUE,
502 G_PARAM_READWRITE));
503
504 g_object_class_install_property (
505 gobject_class,
506 PROP_POLKIT_NO_SENSITIVE,
507 g_param_spec_boolean (
508 "no-sensitive",
509 "If PolicyKit evaluates the result as 'no', whether the action will be sensitive",
510 "If PolicyKit evaluates the result as 'no', whether the action will be sensitive",
511 FALSE,
512 G_PARAM_READWRITE));
513
514 g_object_class_install_property (
515 gobject_class,
516 PROP_POLKIT_NO_SHORT_LABEL,
517 g_param_spec_string (
518 "no-short-label",
519 "If PolicyKit evaluates the result as 'no', use this short-label",
520 "If PolicyKit evaluates the result as 'no', use this short-label",
521 NULL,
522 G_PARAM_READWRITE));
523
524 g_object_class_install_property (
525 gobject_class,
526 PROP_POLKIT_NO_LABEL,
527 g_param_spec_string (
528 "no-label",
529 "If PolicyKit evaluates the result as 'no', use this label",
530 "If PolicyKit evaluates the result as 'no', use this label",
531 NULL,
532 G_PARAM_READWRITE));
533
534 g_object_class_install_property (
535 gobject_class,
536 PROP_POLKIT_NO_TOOLTIP,
537 g_param_spec_string (
538 "no-tooltip",
539 "If PolicyKit evaluates the result as 'no', use this tooltip",
540 "If PolicyKit evaluates the result as 'no', use this tooltip",
541 NULL,
542 G_PARAM_READWRITE));
543
544 g_object_class_install_property (
545 gobject_class,
546 PROP_POLKIT_NO_ICON_NAME,
547 g_param_spec_string (
548 "no-icon-name",
549 "If PolicyKit evaluates the result as 'no', use this icon-name",
550 "If PolicyKit evaluates the result as 'no', use this icon-name",
551 NULL,
552 G_PARAM_READWRITE));
553
554 /*------------------------------*/
555
556 g_object_class_install_property (
557 gobject_class,
558 PROP_POLKIT_AUTH_VISIBLE,
559 g_param_spec_boolean (
560 "auth-visible",
561 "If PolicyKit evaluates the result as 'auth', whether the action will be visible",
562 "If PolicyKit evaluates the result as 'auth', whether the action will be visible",
563 TRUE,
564 G_PARAM_READWRITE));
565
566 g_object_class_install_property (
567 gobject_class,
568 PROP_POLKIT_AUTH_SENSITIVE,
569 g_param_spec_boolean (
570 "auth-sensitive",
571 "If PolicyKit evaluates the result as 'auth', whether the action will be sensitive",
572 "If PolicyKit evaluates the result as 'auth', whether the action will be sensitive",
573 TRUE,
574 G_PARAM_READWRITE));
575
576 g_object_class_install_property (
577 gobject_class,
578 PROP_POLKIT_AUTH_SHORT_LABEL,
579 g_param_spec_string (
580 "auth-short-label",
581 "If PolicyKit evaluates the result as 'auth', use this short-label",
582 "If PolicyKit evaluates the result as 'auth', use this short-label",
583 NULL,
584 G_PARAM_READWRITE));
585
586 g_object_class_install_property (
587 gobject_class,
588 PROP_POLKIT_AUTH_LABEL,
589 g_param_spec_string (
590 "auth-label",
591 "If PolicyKit evaluates the result as 'auth', use this label",
592 "If PolicyKit evaluates the result as 'auth', use this label",
593 NULL,
594 G_PARAM_READWRITE));
595
596 g_object_class_install_property (
597 gobject_class,
598 PROP_POLKIT_AUTH_TOOLTIP,
599 g_param_spec_string (
600 "auth-tooltip",
601 "If PolicyKit evaluates the result as 'auth', use this tooltip",
602 "If PolicyKit evaluates the result as 'auth', use this tooltip",
603 NULL,
604 G_PARAM_READWRITE));
605
606 g_object_class_install_property (
607 gobject_class,
608 PROP_POLKIT_AUTH_ICON_NAME,
609 g_param_spec_string (
610 "auth-icon-name",
611 "If PolicyKit evaluates the result as 'auth', use this icon-name",
612 "If PolicyKit evaluates the result as 'auth', use this icon-name",
613 NULL,
614 G_PARAM_READWRITE));
615
616 /*------------------------------*/
617
618 g_object_class_install_property (
619 gobject_class,
620 PROP_POLKIT_YES_VISIBLE,
621 g_param_spec_boolean (
622 "yes-visible",
623 "If PolicyKit evaluates the result as 'yes', whether the action will be visible",
624 "If PolicyKit evaluates the result as 'yes', whether the action will be visible",
625 TRUE,
626 G_PARAM_READWRITE));
627
628 g_object_class_install_property (
629 gobject_class,
630 PROP_POLKIT_YES_SENSITIVE,
631 g_param_spec_boolean (
632 "yes-sensitive",
633 "If PolicyKit evaluates the result as 'yes', whether the action will be sensitive",
634 "If PolicyKit evaluates the result as 'yes', whether the action will be sensitive",
635 TRUE,
636 G_PARAM_READWRITE));
637
638 g_object_class_install_property (
639 gobject_class,
640 PROP_POLKIT_YES_SHORT_LABEL,
641 g_param_spec_string (
642 "yes-short-label",
643 "If PolicyKit evaluates the result as 'yes', use this short-label",
644 "If PolicyKit evaluates the result as 'yes', use this short-label",
645 NULL,
646 G_PARAM_READWRITE));
647
648 g_object_class_install_property (
649 gobject_class,
650 PROP_POLKIT_YES_LABEL,
651 g_param_spec_string (
652 "yes-label",
653 "If PolicyKit evaluates the result as 'yes', use this label",
654 "If PolicyKit evaluates the result as 'yes', use this label",
655 NULL,
656 G_PARAM_READWRITE));
657
658 g_object_class_install_property (
659 gobject_class,
660 PROP_POLKIT_YES_TOOLTIP,
661 g_param_spec_string (
662 "yes-tooltip",
663 "If PolicyKit evaluates the result as 'yes', use this tooltip",
664 "If PolicyKit evaluates the result as 'yes', use this tooltip",
665 NULL,
666 G_PARAM_READWRITE));
667
668 g_object_class_install_property (
669 gobject_class,
670 PROP_POLKIT_YES_ICON_NAME,
671 g_param_spec_string (
672 "yes-icon-name",
673 "If PolicyKit evaluates the result as 'yes', use this icon-name",
674 "If PolicyKit evaluates the result as 'yes', use this icon-name",
675 NULL,
676 G_PARAM_READWRITE));
677
678 /*------------------------------*/
679
680 g_object_class_install_property (
681 gobject_class,
682 PROP_POLKIT_MASTER_VISIBLE,
683 g_param_spec_boolean (
684 "master-visible",
685 "Can be set to FALSE to force invisibility no matter what PolicyKit reports",
686 "Can be set to FALSE to force invisibility no matter what PolicyKit reports",
687 TRUE,
688 G_PARAM_READWRITE));
689
690 g_object_class_install_property (
691 gobject_class,
692 PROP_POLKIT_MASTER_SENSITIVE,
693 g_param_spec_boolean (
694 "master-sensitive",
695 "Can be set to FALSE to force insensitivity no matter what PolicyKit reports",
696 "Can be set to FALSE to force insensitivity no matter what PolicyKit reports",
697 TRUE,
698 G_PARAM_READWRITE));
699
700 g_object_class_install_property (
701 gobject_class,
702 PROP_POLKIT_TARGET_PID,
703 g_param_spec_uint (
704 "target-pid",
705 "The target process id to receive the authorization; if 0 it is the current process",
706 "The target process id to receive the authorization; if 0 it is the current process",
707 0,
708 G_MAXUINT,
709 0,
710 G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
711
712 /**
713 * PolKitGnomeAction::auth-start:
714 * @action: the object
715 *
716 * The ::auth-start signal is emitted when an authentication
717 * session starts.
718 **/
719 signals [AUTH_START_SIGNAL] =
720 g_signal_new ("auth-start",
721 G_TYPE_FROM_CLASS (gobject_class),
722 G_SIGNAL_RUN_LAST,
723 G_STRUCT_OFFSET (PolKitGnomeActionClass, auth_start),
724 NULL,
725 NULL,
726 g_cclosure_marshal_VOID__VOID,
727 G_TYPE_NONE,
728 0);
729
730 /**
731 * PolKitGnomeAction::auth-end:
732 * @action: the object
733 * @gained_privilege: whether the privilege was gained
734 *
735 * The ::auth-end signal is emitted when the an authentication
736 * session ends and carries information about whether the
737 * privilege was obtained or not.
738 **/
739 signals [AUTH_END_SIGNAL] =
740 g_signal_new ("auth-end",
741 G_TYPE_FROM_CLASS (gobject_class),
742 G_SIGNAL_RUN_LAST,
743 G_STRUCT_OFFSET (PolKitGnomeActionClass, auth_end),
744 NULL,
745 NULL,
746 g_cclosure_marshal_VOID__BOOLEAN,
747 G_TYPE_NONE,
748 1, G_TYPE_BOOLEAN);
749
750 /**
751 * PolKitGnomeAction::polkit-result-changed:
752 * @action: the object
753 * @current_result: current #PolKitResult from PolicyKit regarding given #PolKitAction object
754 *
755 * The ::polkit-result-changed signal is emitted when the
756 * PolicyKit result changes. This can happen when external
757 * factors (config file, ConsoleKit, privilege granted /
758 * revoked) change since the #PolKitGnomeAction class listens
759 * for events using the #PolKitGnomeContext class.
760 **/
761 signals [POLKIT_RESULT_CHANGED_SIGNAL] =
762 g_signal_new ("polkit-result-changed",
763 G_TYPE_FROM_CLASS (gobject_class),
764 G_SIGNAL_RUN_LAST,
765 G_STRUCT_OFFSET (PolKitGnomeActionClass, polkit_result_changed),
766 NULL,
767 NULL,
768 g_cclosure_marshal_VOID__INT,
769 G_TYPE_NONE,
770 1, G_TYPE_INT);
771
772
773 g_type_class_add_private (gobject_class, sizeof (PolKitGnomeActionPrivate));
774 }
775
776 static pid_t
777 _get_target_pid (PolKitGnomeAction *action)
778 {
779 pid_t pid;
780
781 if (action != NULL && action->priv->target_pid != 0)
782 pid = action->priv->target_pid;
783 else
784 pid = getpid ();
785
786 return pid;
787 }
788
789 static PolKitResult
790 _compute_polkit_result_direct (PolKitGnomeAction *action)
791 {
792 PolKitCaller *pk_caller;
793 PolKitResult pk_result;
794 DBusError dbus_error;
795
796 _ensure_pk_g_context (action);
797
798 dbus_error_init (&dbus_error);
799 pk_caller = polkit_tracker_get_caller_from_pid (action->priv->pk_g_context->pk_tracker,
800 _get_target_pid (action),
801 &dbus_error);
802 if (pk_caller == NULL) {
803 g_warning ("Cannot get PolKitCaller object for target (pid=%d): %s: %s",
804 _get_target_pid (action), dbus_error.name, dbus_error.message);
805 dbus_error_free (&dbus_error);
806
807 /* this is bad so cop-out to UKNOWN */
808 pk_result = POLKIT_RESULT_UNKNOWN;
809 } else {
810 pk_result = polkit_context_is_caller_authorized (action->priv->pk_g_context->pk_context,
811 action->priv->polkit_action,
812 pk_caller,
813 FALSE,
814 NULL);
815 if (pk_result != POLKIT_RESULT_YES) {
816 GSList *i;
817
818 /* no dice.. see if one if the sufficient actions, if any, yields a YES */
819 for (i = action->priv->polkit_action_sufficient; i != NULL; i = g_slist_next (i)) {
820 PolKitResult r;
821 PolKitAction *a = (PolKitAction *) i->data;
822
823 r = polkit_context_is_caller_authorized (action->priv->pk_g_context->pk_context,
824 a,
825 pk_caller,
826 FALSE,
827 NULL);
828
829 if (r == POLKIT_RESULT_YES) {
830 pk_result = r;
831 break;
832 }
833 }
834 }
835 }
836
837 if (pk_caller != NULL)
838 polkit_caller_unref (pk_caller);
839
840 return pk_result;
841 }
842
843 /* returns TRUE if the result changed */
844 static gboolean
845 _compute_polkit_result (PolKitGnomeAction *action)
846 {
847 PolKitResult old_result;
848
849 old_result = action->priv->pk_result;
850 action->priv->pk_result = POLKIT_RESULT_UNKNOWN;
851
852 if (action->priv->polkit_action == NULL) {
853 action->priv->pk_result = POLKIT_RESULT_YES;
854 } else {
855 action->priv->pk_result = _compute_polkit_result_direct (action);
856 }
857
858 return old_result != action->priv->pk_result;
859 }
860
861 static void
862 _update_action (PolKitGnomeAction *action)
863 {
864 PolKitGnomeContext *pkgc;
865 PolKitAuthorizationDB *authdb;
866
867 pkgc = polkit_gnome_context_get (NULL);
868 authdb = polkit_context_get_authorization_db (pkgc->pk_context);
869
870 switch (action->priv->pk_result) {
871 default:
872 case POLKIT_RESULT_UNKNOWN:
873 case POLKIT_RESULT_NO:
874 /* TODO: see if we're self-blocked */
875
876 if (action->priv->polkit_action != NULL &&
877 polkit_authorization_db_is_uid_blocked_by_self (authdb,
878 action->priv->polkit_action,
879 getuid (),
880 NULL)) {
881 g_object_set (action,
882 "visible", action->priv->self_blocked_visible && action->priv->master_visible,
883 "sensitive", action->priv->self_blocked_sensitive && action->priv->master_sensitive,
884 "short-label", action->priv->self_blocked_short_label,
885 "label", action->priv->self_blocked_label,
886 "tooltip", action->priv->self_blocked_tooltip,
887 "icon-name", action->priv->self_blocked_icon_name,
888 NULL);
889 } else {
890 g_object_set (action,
891 "visible", action->priv->no_visible && action->priv->master_visible,
892 "sensitive", action->priv->no_sensitive && action->priv->master_sensitive,
893 "short-label", action->priv->no_short_label,
894 "label", action->priv->no_label,
895 "tooltip", action->priv->no_tooltip,
896 "icon-name", action->priv->no_icon_name,
897 NULL);
898 }
899 break;
900
901 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT:
902 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
903 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION:
904 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS:
905 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT:
906 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
907 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
908 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
909 g_object_set (action,
910 "visible", action->priv->auth_visible && action->priv->master_visible,
911 "sensitive", action->priv->auth_sensitive && action->priv->master_sensitive,
912 "short-label", action->priv->auth_short_label,
913 "label", action->priv->auth_label,
914 "tooltip", action->priv->auth_tooltip,
915 "icon-name", action->priv->auth_icon_name,
916 NULL);
917 break;
918
919 case POLKIT_RESULT_YES:
920 g_object_set (action,
921 "visible", action->priv->yes_visible && action->priv->master_visible,
922 "sensitive", action->priv->yes_sensitive && action->priv->master_sensitive,
923 "short-label", action->priv->yes_short_label,
924 "label", action->priv->yes_label,
925 "tooltip", action->priv->yes_tooltip,
926 "icon-name", action->priv->yes_icon_name,
927 NULL);
928 break;
929 }
930 }
931
932 static void
933 _pk_config_changed (PolKitGnomeContext *pk_g_context, PolKitGnomeAction *action)
934 {
935 gboolean result_changed;
936 result_changed = _compute_polkit_result (action);
937 _update_action (action);
938 if (result_changed) {
939 g_signal_emit (action, signals [POLKIT_RESULT_CHANGED_SIGNAL], 0, action->priv->pk_result);
940 }
941 }
942
943 static void
944 _pk_console_kit_db_changed (PolKitGnomeContext *pk_g_context, PolKitGnomeAction *action)
945 {
946 /* for now, just use the same code as above... */
947 _pk_config_changed (pk_g_context, action);
948 }
949
950
951 /**
952 * polkit_gnome_action_new:
953 * @name: A unique name for the action
954 *
955 * Creates a new #PolKitGnomeAction object. The typical use for this
956 * function is for specialized use where
957 * polkit_gnome_action_new_default() does not meet the needs of the
958 * application. A short example of the usage of this contructor
959 * follows.
960 *
961 * If the 'polkit-action' property is #NULL the behavior is similar to
962 * as if a #PolKitAction returned #POLKIT_RESULT_YES.
963 *
964 * One can set the 'polkit-action-sufficient' property to a
965 * #GValueArray of pointers to #PolKitAction objects. The semantics of
966 * this property is that if the user is authorized for any of the
967 * given actions in 'polkit-action-sufficient' then the behavior is
968 * the same as if they're authorized for the action denoted by
969 * 'polkit-action'. This is useful in a setup where you have two
970 * similar actions and one implies the other. For example, in
971 * gnome-system-monitor there are two actions
972 * <literal>org.gnome.system-monitor.increase-own-priority</literal>
973 * (Increase the priority of a process owned by yourself) and
974 * <literal>org.gnome.system-monitor.change-priorty</literal> (Change
975 * priority of any process). As the latter clearly implies the former,
976 * one would set the latter in the 'polkit-action-sufficient'
977 * property when constructing a #PolKitAction for the former.
978 *
979 * <programlisting>
980 * PolKitAction *polkit_action;
981 * PolKitGnomeAction *action;
982 *
983 * polkit_action = polkit_action_new ();
984 * polkit_action_set_action_id (polkit_action, "org.example.some-policykit-action");
985 *
986 * action = polkit_gnome_action_new ("blabla", NULL);
987 * g_object_set (action,
988 * "polkit-action", polkit_action,
989 * "no-visible", TRUE,
990 * "no-sensitive", FALSE,
991 * "no-short-label", "The Action no can do!",
992 * "no-label", "The Action is not permitted!",
993 * "no-tooltip", "The Tooltip (no)",
994 * "no-icon-name", GTK_STOCK_NO,
995 *
996 * "auth-visible", TRUE,
997 * "auth-sensitive", TRUE,
998 * "auth-short-label", "The Action requires auth...",
999 * "auth-label", "The Action requires auth...",
1000 * "auth-tooltip", "The Tooltip (auth)",
1001 * "auth-icon-name", GTK_STOCK_DIALOG_AUTHENTICATION,
1002 *
1003 * "yes-visible", TRUE,
1004 * "yes-sensitive", TRUE,
1005 * "yes-short-label", "Action!",
1006 * "yes-label", "Just do the Action!",
1007 * "yes-tooltip", "The Tooltip (yes)",
1008 * "yes-icon-name", GTK_STOCK_YES,
1009 * NULL);
1010 * </programlisting>
1011 *
1012 * Returns: a new #PolKitGnomeAction or #NULL if error is set
1013 */
1014 PolKitGnomeAction *
1015 polkit_gnome_action_new (const gchar *name)
1016 {
1017 PolKitGnomeAction *action = NULL;
1018
1019 action = g_object_new (POLKIT_GNOME_TYPE_ACTION,
1020 "name", name,
1021 NULL);
1022
1023 return action;
1024 }
1025
1026 /**
1027 * polkit_gnome_action_new_default:
1028 * @name: A unique name for the action
1029 * @polkit_action: the #PolKitAction to track
1030 * @label: the label to use (will also apply to short-label)
1031 * @tooltip: the tool tip to use
1032 *
1033 * Creates a new #PolKitGnomeAction object with the default
1034 * behavior for a given #PolKitAction object.
1035 *
1036 * Default behavior is defined by the label and tooltip being
1037 * identical across all three four states, the action being visible in
1038 * all four states, and the action being insensitive only in the state
1039 * where the result from PolicyKit is no and self-blocked. Only when
1040 * PolicyKit returns one of the 'auth*' results, the icon_name
1041 * property will be set to #GTK_STOCK_DIALOG_AUTHENTICATION.
1042 *
1043 * The caller can always modify individual aspects of the action after
1044 * creation, e.g. change the tooltip for the self-blocked, no, auth
1045 * and yes states.
1046 *
1047 * If the given polkit_action is #NULL the behavior is similar to as
1048 * if a #PolKitAction returned #POLKIT_RESULT_YES.
1049 *
1050 * Returns: a new #PolKitGnomeAction or #NULL if error is set
1051 */
1052 PolKitGnomeAction *
1053 polkit_gnome_action_new_default (const gchar *name,
1054 PolKitAction *polkit_action,
1055 const gchar *label,
1056 const gchar *tooltip)
1057 {
1058 PolKitGnomeAction *action;
1059
1060 action = g_object_new (POLKIT_GNOME_TYPE_ACTION,
1061 "name", name,
1062 "polkit-action", polkit_action,
1063
1064 "self-blocked-visible", TRUE,
1065 "self-blocked-sensitive", FALSE,
1066 "self-blocked-short-label", label,
1067 "self-blocked-label", label,
1068 "self-blocked-tooltip", tooltip,
1069 "self-blocked-icon-name", NULL,
1070
1071 "no-visible", TRUE,
1072 "no-sensitive", FALSE,
1073 "no-short-label", label,
1074 "no-label", label,
1075 "no-tooltip", tooltip,
1076 "no-icon-name", NULL,
1077
1078 "auth-visible", TRUE,
1079 "auth-sensitive", TRUE,
1080 "auth-short-label", label,
1081 "auth-label", label,
1082 "auth-tooltip", tooltip,
1083 "auth-icon-name", GTK_STOCK_DIALOG_AUTHENTICATION,
1084
1085 "yes-visible", TRUE,
1086 "yes-sensitive", TRUE,
1087 "yes-short-label", label,
1088 "yes-label", label,
1089 "yes-tooltip", tooltip,
1090 "yes-icon-name", NULL,
1091
1092 "master-visible", TRUE,
1093 "master-sensitive", TRUE,
1094 NULL);
1095
1096 return action;
1097 }
1098
1099 /*----------------------------------------------------------------------------------------------------*/
1100
1101 /**
1102 * polkit_gnome_action_set_polkit_action:
1103 * @action: The #PolKitGnomeAction object
1104 * @pk_action: The #PolKitAction object
1105 *
1106 * Sets the #PolKitAction object to track for updating the GTK+ action.
1107 */
1108 static void
1109 polkit_gnome_action_set_polkit_action (PolKitGnomeAction *action, PolKitAction *pk_action)
1110 {
1111
1112 /* Don't bother updating polkit_action if it's the same
1113 * value.. it will just cause a lot of unnecessary work as
1114 * we'll recompute the answer via PolicyKit..
1115 *
1116 * unless it's on the initial call (where priv->polkit_action
1117 * is alread NULL) because we need that initial update;
1118 */
1119 if (!action->priv->polkit_action_set_once || action->priv->polkit_action != pk_action) {
1120
1121 action->priv->polkit_action_set_once = TRUE;
1122
1123 if (action->priv->polkit_action != NULL)
1124 polkit_action_unref (action->priv->polkit_action);
1125
1126 action->priv->polkit_action = pk_action != NULL ? polkit_action_ref (pk_action) : NULL;
1127
1128 _compute_polkit_result (action);
1129 _update_action (action);
1130 }
1131 }
1132
1133 static void
1134 polkit_gnome_action_set_polkit_action_sufficient (PolKitGnomeAction *action, const GValue *pk_action_array)
1135 {
1136 unsigned int n;
1137 GValueArray *value_array;
1138
1139 free_pk_action_sufficient (action);
1140
1141 if (pk_action_array == NULL)
1142 goto out;
1143
1144 value_array = g_value_get_boxed (pk_action_array);
1145 if (value_array == NULL)
1146 goto out;
1147
1148 for (n = 0; n < value_array->n_values; n++) {
1149 PolKitAction *pk_action;
1150
1151 pk_action = (PolKitAction *) g_value_get_pointer (& (value_array->values[n]));
1152 action->priv->polkit_action_sufficient = g_slist_prepend (action->priv->polkit_action_sufficient,
1153 polkit_action_ref (pk_action));
1154 char *s;
1155 polkit_action_get_action_id (pk_action, &s);
1156 g_warning ("Setting sufficient %d: %s", n, s);
1157 }
1158
1159 out:
1160 _compute_polkit_result (action);
1161 _update_action (action);
1162 }
1163
1164
1165 /**
1166 * polkit_gnome_action_get_polkit_result:
1167 * @action: The #PolKitGnomeAction object
1168 *
1169 * Gets the #PolKitResult that indicates whether the user is
1170 * privileged to do the #PolKitAction associated with this
1171 * #PolKitGnomeAction object.
1172 *
1173 * Returns: The #PolKitAction object. The caller shall not unref this object.
1174 */
1175 PolKitResult
1176 polkit_gnome_action_get_polkit_result (PolKitGnomeAction *action)
1177 {
1178 _compute_polkit_result (action);
1179 _update_action (action);
1180 return action->priv->pk_result;
1181 }
1182
1183 /**
1184 * polkit_gnome_action_get_sensitive:
1185 * @action: The #PolKitGnomeAction object
1186 *
1187 * Get the master sensitivity, see PolKitGnomeAction:master-sensitive:
1188 * for details.
1189 *
1190 * Returns: the master sensitivity
1191 */
1192 gboolean
1193 polkit_gnome_action_get_sensitive (PolKitGnomeAction *action)
1194 {
1195 return action->priv->master_sensitive;
1196 }
1197
1198 /**
1199 * polkit_gnome_action_set_sensitive:
1200 * @action: The #PolKitGnomeAction object
1201 * @sensitive: master sensitivity
1202 *
1203 * Set the master sensitivity, see PolKitGnomeAction:master-sensitive:
1204 * for details.
1205 */
1206 void
1207 polkit_gnome_action_set_sensitive (PolKitGnomeAction *action, gboolean sensitive)
1208 {
1209 if (action->priv->master_sensitive == sensitive)
1210 return;
1211 action->priv->master_sensitive = sensitive;
1212 _update_action (action);
1213 }
1214
1215 static void
1216 polkit_gnome_action_set_target_pid (PolKitGnomeAction *action, guint target_pid)
1217 {
1218 action->priv->target_pid = target_pid;
1219 _compute_polkit_result (action);
1220 _update_action (action);
1221 }
1222
1223 /**
1224 * polkit_gnome_action_get_visible:
1225 * @action: The #PolKitGnomeAction object
1226 *
1227 * Get the master visibility, see PolKitGnomeAction:master-visible:
1228 * for details.
1229 *
1230 * Returns: the master visibility
1231 */
1232 gboolean
1233 polkit_gnome_action_get_visible (PolKitGnomeAction *action)
1234 {
1235 return action->priv->master_visible;
1236 }
1237
1238 /**
1239 * polkit_gnome_action_set_visible:
1240 * @action: The #PolKitGnomeAction object
1241 * @visible: master visibility
1242 *
1243 * Set the master visibility, see PolKitGnomeAction:master-visible:
1244 * for details.
1245 */
1246 void
1247 polkit_gnome_action_set_visible (PolKitGnomeAction *action, gboolean visible)
1248 {
1249 if (action->priv->master_visible == visible)
1250 return;
1251 action->priv->master_visible = visible;
1252 _update_action (action);
1253 }
1254
1255 /*----------------------------------------------------------------------------------------------------*/
1256
1257 /**
1258 * polkit_gnome_action_set_self_blocked_visible:
1259 * @action: The #PolKitGnomeAction object
1260 * @visible: new value
1261 *
1262 * Sets the value of visible to use when PolicyKit returns the answer
1263 * no (and the reason is that the user has a self-granted negative
1264 * authorization) for the current #PolKitAction being tracked.
1265 */
1266 static void
1267 polkit_gnome_action_set_self_blocked_visible (PolKitGnomeAction *action, gboolean visible)
1268 {
1269 action->priv->self_blocked_visible = visible;
1270 _update_action (action);
1271 }
1272
1273 /**
1274 * polkit_gnome_action_set_self_blocked_sensitive:
1275 * @action: The #PolKitGnomeAction object
1276 * @sensitive: new value
1277 *
1278 * Sets the value of sensitive to use when PolicyKit returns the
1279 * answer no (and the reason is that the user has a self-granted
1280 * negative authorization) for the current #PolKitAction being
1281 * tracked.
1282 */
1283 static void
1284 polkit_gnome_action_set_self_blocked_sensitive (PolKitGnomeAction *action, gboolean sensitive)
1285 {
1286 action->priv->self_blocked_sensitive = sensitive;
1287 _update_action (action);
1288 }
1289
1290 /**
1291 * polkit_gnome_action_set_self_blocked_short_label:
1292 * @action: The #PolKitGnomeAction object
1293 * @short_label: new value
1294 *
1295 * Sets the value of short-label to use when PolicyKit returns the
1296 * answer no (and the reason is that the user has a self-granted
1297 * negative authorization) for the current #PolKitAction being
1298 * tracked.
1299 */
1300 static void
1301 polkit_gnome_action_set_self_blocked_short_label (PolKitGnomeAction *action, const gchar *short_label)
1302 {
1303 g_free (action->priv->self_blocked_short_label);
1304 action->priv->self_blocked_short_label = g_strdup (short_label);
1305 _update_action (action);
1306 }
1307
1308 /**
1309 * polkit_gnome_action_set_self_blocked_label:
1310 * @action: The #PolKitGnomeAction object
1311 * @label: new value
1312 *
1313 * Sets the value of label to use when PolicyKit returns the answer
1314 * no (and the reason is that the user has a self-granted
1315 * negative authorization) for the current #PolKitAction being
1316 * tracked.
1317 */
1318 static void
1319 polkit_gnome_action_set_self_blocked_label (PolKitGnomeAction *action, const gchar *label)
1320 {
1321 g_free (action->priv->self_blocked_label);
1322 action->priv->self_blocked_label = g_strdup (label);
1323 _update_action (action);
1324 }
1325
1326 /**
1327 * polkit_gnome_action_set_self_blocked_tooltip:
1328 * @action: The #PolKitGnomeAction object
1329 * @tooltip: new value
1330 *
1331 * Sets the value of tooltip to use when PolicyKit returns the answer
1332 * no (and the reason is that the user has a self-granted negative
1333 * authorization) for the current #PolKitAction being tracked.
1334 */
1335 static void
1336 polkit_gnome_action_set_self_blocked_tooltip (PolKitGnomeAction *action, const gchar *tooltip)
1337 {
1338 g_free (action->priv->self_blocked_tooltip);
1339 action->priv->self_blocked_tooltip = g_strdup (tooltip);
1340 _update_action (action);
1341 }
1342
1343 /**
1344 * polkit_gnome_action_set_self_blocked_icon_name:
1345 * @action: The #PolKitGnomeAction object
1346 * @icon_name: new value
1347 *
1348 * Sets the value of icon_name to use when PolicyKit returns the
1349 * answer no (and the reason is that the user has a self-granted
1350 * negative authorization) for the current #PolKitAction being
1351 * tracked.
1352 */
1353 static void
1354 polkit_gnome_action_set_self_blocked_icon_name (PolKitGnomeAction *action, const gchar *icon_name)
1355 {
1356 g_free (action->priv->self_blocked_icon_name);
1357 action->priv->self_blocked_icon_name = g_strdup (icon_name);
1358 _update_action (action);
1359 }
1360
1361 /*----------------------------------------------------------------------------------------------------*/
1362
1363 /**
1364 * polkit_gnome_action_set_no_visible:
1365 * @action: The #PolKitGnomeAction object
1366 * @visible: new value
1367 *
1368 * Sets the value of visible to use when PolicyKit returns the answer
1369 * no for the current #PolKitAction being tracked.
1370 */
1371 static void
1372 polkit_gnome_action_set_no_visible (PolKitGnomeAction *action, gboolean visible)
1373 {
1374 action->priv->no_visible = visible;
1375 _update_action (action);
1376 }
1377
1378 /**
1379 * polkit_gnome_action_set_no_sensitive:
1380 * @action: The #PolKitGnomeAction object
1381 * @sensitive: new value
1382 *
1383 * Sets the value of sensitive to use when PolicyKit returns the answer
1384 * no for the current #PolKitAction being tracked.
1385 */
1386 static void
1387 polkit_gnome_action_set_no_sensitive (PolKitGnomeAction *action, gboolean sensitive)
1388 {
1389 action->priv->no_sensitive = sensitive;
1390 _update_action (action);
1391 }
1392
1393 /**
1394 * polkit_gnome_action_set_no_short_label:
1395 * @action: The #PolKitGnomeAction object
1396 * @short_label: new value
1397 *
1398 * Sets the value of short-label to use when PolicyKit returns the
1399 * answer no for the current #PolKitAction being tracked.
1400 */
1401 static void
1402 polkit_gnome_action_set_no_short_label (PolKitGnomeAction *action, const gchar *short_label)
1403 {
1404 g_free (action->priv->no_short_label);
1405 action->priv->no_short_label = g_strdup (short_label);
1406 _update_action (action);
1407 }
1408
1409 /**
1410 * polkit_gnome_action_set_no_label:
1411 * @action: The #PolKitGnomeAction object
1412 * @label: new value
1413 *
1414 * Sets the value of label to use when PolicyKit returns the answer no
1415 * for the current #PolKitAction being tracked.
1416 */
1417 static void
1418 polkit_gnome_action_set_no_label (PolKitGnomeAction *action, const gchar *label)
1419 {
1420 g_free (action->priv->no_label);
1421 action->priv->no_label = g_strdup (label);
1422 _update_action (action);
1423 }
1424
1425 /**
1426 * polkit_gnome_action_set_no_tooltip:
1427 * @action: The #PolKitGnomeAction object
1428 * @tooltip: new value
1429 *
1430 * Sets the value of tooltip to use when PolicyKit returns the answer
1431 * no for the current #PolKitAction being tracked.
1432 */
1433 static void
1434 polkit_gnome_action_set_no_tooltip (PolKitGnomeAction *action, const gchar *tooltip)
1435 {
1436 g_free (action->priv->no_tooltip);
1437 action->priv->no_tooltip = g_strdup (tooltip);
1438 _update_action (action);
1439 }
1440
1441 /**
1442 * polkit_gnome_action_set_no_icon_name:
1443 * @action: The #PolKitGnomeAction object
1444 * @icon_name: new value
1445 *
1446 * Sets the value of icon_name to use when PolicyKit returns the
1447 * answer no for the current #PolKitAction being tracked.
1448 */
1449 static void
1450 polkit_gnome_action_set_no_icon_name (PolKitGnomeAction *action, const gchar *icon_name)
1451 {
1452 g_free (action->priv->no_icon_name);
1453 action->priv->no_icon_name = g_strdup (icon_name);
1454 _update_action (action);
1455 }
1456
1457 /*----------------------------------------------------------------------------------------------------*/
1458
1459 /**
1460 * polkit_gnome_action_set_auth_visible:
1461 * @action: The #PolKitGnomeAction object
1462 * @visible: new value
1463 *
1464 * Sets the value of visible to use when PolicyKit returns the answer
1465 * auth* for the current #PolKitAction being tracked.
1466 */
1467 static void
1468 polkit_gnome_action_set_auth_visible (PolKitGnomeAction *action, gboolean visible)
1469 {
1470 action->priv->auth_visible = visible;
1471 _update_action (action);
1472 }
1473
1474 /**
1475 * polkit_gnome_action_set_auth_sensitive:
1476 * @action: The #PolKitGnomeAction object
1477 * @sensitive: new value
1478 *
1479 * Sets the value of sensitive to use when PolicyKit returns the answer
1480 * auth* for the current #PolKitAction being tracked.
1481 */
1482 static void
1483 polkit_gnome_action_set_auth_sensitive (PolKitGnomeAction *action, gboolean sensitive)
1484 {
1485 action->priv->auth_sensitive = sensitive;
1486 _update_action (action);
1487 }
1488
1489 /**
1490 * polkit_gnome_action_set_auth_short_label:
1491 * @action: The #PolKitGnomeAction object
1492 * @short_label: new value
1493 *
1494 * Sets the value of short-label to use when PolicyKit returns the
1495 * answer auth for the current #PolKitAction being tracked.
1496 */
1497 static void
1498 polkit_gnome_action_set_auth_short_label (PolKitGnomeAction *action, const gchar *short_label)
1499 {
1500 g_free (action->priv->auth_short_label);
1501 action->priv->auth_short_label = g_strdup (short_label);
1502 _update_action (action);
1503 }
1504
1505 /**
1506 * polkit_gnome_action_set_auth_label:
1507 * @action: The #PolKitGnomeAction object
1508 * @label: new value
1509 *
1510 * Sets the value of label to use when PolicyKit returns the answer auth*
1511 * for the current #PolKitAction being tracked.
1512 */
1513 static void
1514 polkit_gnome_action_set_auth_label (PolKitGnomeAction *action, const gchar *label)
1515 {
1516 g_free (action->priv->auth_label);
1517 action->priv->auth_label = g_strdup (label);
1518 _update_action (action);
1519 }
1520
1521 /**
1522 * polkit_gnome_action_set_auth_tooltip:
1523 * @action: The #PolKitGnomeAction object
1524 * @tooltip: new value
1525 *
1526 * Sets the value of tooltip to use when PolicyKit returns the answer
1527 * auth* for the current #PolKitAction being tracked.
1528 */
1529 static void
1530 polkit_gnome_action_set_auth_tooltip (PolKitGnomeAction *action, const gchar *tooltip)
1531 {
1532 g_free (action->priv->auth_tooltip);
1533 action->priv->auth_tooltip = g_strdup (tooltip);
1534 _update_action (action);
1535 }
1536
1537 /**
1538 * polkit_gnome_action_set_auth_icon_name:
1539 * @action: The #PolKitGnomeAction object
1540 * @icon_name: new value
1541 *
1542 * Sets the value of icon_name to use when PolicyKit returns the
1543 * answer auth* for the current #PolKitAction being tracked.
1544 */
1545 static void
1546 polkit_gnome_action_set_auth_icon_name (PolKitGnomeAction *action, const gchar *icon_name)
1547 {
1548 g_free (action->priv->auth_icon_name);
1549 action->priv->auth_icon_name = g_strdup (icon_name);
1550 _update_action (action);
1551 }
1552
1553 /*----------------------------------------------------------------------------------------------------*/
1554
1555 /**
1556 * polkit_gnome_action_set_yes_visible:
1557 * @action: The #PolKitGnomeAction object
1558 * @visible: new value
1559 *
1560 * Sets the value of visible to use when PolicyKit returns the answer
1561 * yes for the current #PolKitAction being tracked.
1562 */
1563 static void
1564 polkit_gnome_action_set_yes_visible (PolKitGnomeAction *action, gboolean visible)
1565 {
1566 action->priv->yes_visible = visible;
1567 _update_action (action);
1568 }
1569
1570 /**
1571 * polkit_gnome_action_set_yes_sensitive:
1572 * @action: The #PolKitGnomeAction object
1573 * @sensitive: new value
1574 *
1575 * Sets the value of sensitive to use when PolicyKit returns the answer
1576 * yes for the current #PolKitAction being tracked.
1577 */
1578 static void
1579 polkit_gnome_action_set_yes_sensitive (PolKitGnomeAction *action, gboolean sensitive)
1580 {
1581 action->priv->yes_sensitive = sensitive;
1582 _update_action (action);
1583 }
1584
1585 /**
1586 * polkit_gnome_action_set_yes_short_label:
1587 * @action: The #PolKitGnomeAction object
1588 * @short_label: new value
1589 *
1590 * Sets the value of short-label to use when PolicyKit returns the
1591 * answer yes for the current #PolKitAction being tracked.
1592 */
1593 static void
1594 polkit_gnome_action_set_yes_short_label (PolKitGnomeAction *action, const gchar *short_label)
1595 {
1596 g_free (action->priv->yes_short_label);
1597 action->priv->yes_short_label = g_strdup (short_label);
1598 _update_action (action);
1599 }
1600
1601 /**
1602 * polkit_gnome_action_set_yes_label:
1603 * @action: The #PolKitGnomeAction object
1604 * @label: new value
1605 *
1606 * Sets the value of label to use when PolicyKit returns the answer yes
1607 * for the current #PolKitAction being tracked.
1608 */
1609 static void
1610 polkit_gnome_action_set_yes_label (PolKitGnomeAction *action, const gchar *label)
1611 {
1612 g_free (action->priv->yes_label);
1613 action->priv->yes_label = g_strdup (label);
1614 _update_action (action);
1615 }
1616
1617 /**
1618 * polkit_gnome_action_set_yes_tooltip:
1619 * @action: The #PolKitGnomeAction object
1620 * @tooltip: new value
1621 *
1622 * Sets the value of tooltip to use when PolicyKit returns the answer
1623 * yes for the current #PolKitAction being tracked.
1624 */
1625 static void
1626 polkit_gnome_action_set_yes_tooltip (PolKitGnomeAction *action, const gchar *tooltip)
1627 {
1628 g_free (action->priv->yes_tooltip);
1629 action->priv->yes_tooltip = g_strdup (tooltip);
1630 _update_action (action);
1631 }
1632
1633 /**
1634 * polkit_gnome_action_set_yes_icon_name:
1635 * @action: The #PolKitGnomeAction object
1636 * @icon_name: new value
1637 *
1638 * Sets the value of icon_name to use when PolicyKit returns the
1639 * answer yes for the current #PolKitAction being tracked.
1640 */
1641 static void
1642 polkit_gnome_action_set_yes_icon_name (PolKitGnomeAction *action, const gchar *icon_name)
1643 {
1644 g_free (action->priv->yes_icon_name);
1645 action->priv->yes_icon_name = g_strdup (icon_name);
1646 _update_action (action);
1647 }
1648
1649 /*----------------------------------------------------------------------------------------------------*/
1650
1651 static void
1652 get_property (GObject *object,
1653 guint prop_id,
1654 GValue *value,
1655 GParamSpec *pspec)
1656 {
1657 PolKitGnomeAction *action = POLKIT_GNOME_ACTION (object);
1658
1659 switch (prop_id)
1660 {
1661 case PROP_POLKIT_ACTION_OBJ:
1662 g_value_set_pointer (value, action->priv->polkit_action != NULL ? polkit_action_ref (action->priv->polkit_action) : NULL);
1663 break;
1664
1665 case PROP_POLKIT_ACTION_OBJ_SUFFICIENT:
1666 //TODO: g_value_set_pointer (value, action->priv->polkit_action != NULL ? polkit_action_ref (action->priv->polkit_action) : NULL);
1667 break;
1668
1669 case PROP_POLKIT_SELF_BLOCKED_VISIBLE:
1670 g_value_set_boolean (value, action->priv->self_blocked_visible);
1671 break;
1672 case PROP_POLKIT_SELF_BLOCKED_SENSITIVE:
1673 g_value_set_boolean (value, action->priv->self_blocked_sensitive);
1674 break;
1675 case PROP_POLKIT_SELF_BLOCKED_SHORT_LABEL:
1676 g_value_set_string (value, action->priv->self_blocked_short_label);
1677 break;
1678 case PROP_POLKIT_SELF_BLOCKED_LABEL:
1679 g_value_set_string (value, action->priv->self_blocked_label);
1680 break;
1681 case PROP_POLKIT_SELF_BLOCKED_TOOLTIP:
1682 g_value_set_string (value, action->priv->self_blocked_tooltip);
1683 break;
1684 case PROP_POLKIT_SELF_BLOCKED_ICON_NAME:
1685 g_value_set_string (value, action->priv->self_blocked_icon_name);
1686 break;
1687
1688 case PROP_POLKIT_NO_VISIBLE:
1689 g_value_set_boolean (value, action->priv->no_visible);
1690 break;
1691 case PROP_POLKIT_NO_SENSITIVE:
1692 g_value_set_boolean (value, action->priv->no_sensitive);
1693 break;
1694 case PROP_POLKIT_NO_SHORT_LABEL:
1695 g_value_set_string (value, action->priv->no_short_label);
1696 break;
1697 case PROP_POLKIT_NO_LABEL:
1698 g_value_set_string (value, action->priv->no_label);
1699 break;
1700 case PROP_POLKIT_NO_TOOLTIP:
1701 g_value_set_string (value, action->priv->no_tooltip);
1702 break;
1703 case PROP_POLKIT_NO_ICON_NAME:
1704 g_value_set_string (value, action->priv->no_icon_name);
1705 break;
1706
1707 case PROP_POLKIT_AUTH_VISIBLE:
1708 g_value_set_boolean (value, action->priv->auth_visible);
1709 break;
1710 case PROP_POLKIT_AUTH_SENSITIVE:
1711 g_value_set_boolean (value, action->priv->auth_sensitive);
1712 break;
1713 case PROP_POLKIT_AUTH_SHORT_LABEL:
1714 g_value_set_string (value, action->priv->auth_short_label);
1715 break;
1716 case PROP_POLKIT_AUTH_LABEL:
1717 g_value_set_string (value, action->priv->auth_label);
1718 break;
1719 case PROP_POLKIT_AUTH_TOOLTIP:
1720 g_value_set_string (value, action->priv->auth_tooltip);
1721 break;
1722 case PROP_POLKIT_AUTH_ICON_NAME:
1723 g_value_set_string (value, action->priv->auth_icon_name);
1724 break;
1725
1726 case PROP_POLKIT_YES_VISIBLE:
1727 g_value_set_boolean (value, action->priv->yes_visible);
1728 break;
1729 case PROP_POLKIT_YES_SENSITIVE:
1730 g_value_set_boolean (value, action->priv->yes_sensitive);
1731 break;
1732 case PROP_POLKIT_YES_SHORT_LABEL:
1733 g_value_set_string (value, action->priv->yes_short_label);
1734 break;
1735 case PROP_POLKIT_YES_LABEL:
1736 g_value_set_string (value, action->priv->yes_label);
1737 break;
1738 case PROP_POLKIT_YES_TOOLTIP:
1739 g_value_set_string (value, action->priv->yes_tooltip);
1740 break;
1741 case PROP_POLKIT_YES_ICON_NAME:
1742 g_value_set_string (value, action->priv->yes_icon_name);
1743 break;
1744
1745 case PROP_POLKIT_MASTER_VISIBLE:
1746 g_value_set_boolean (value, action->priv->master_visible);
1747 break;
1748 case PROP_POLKIT_MASTER_SENSITIVE:
1749 g_value_set_boolean (value, action->priv->master_sensitive);
1750 break;
1751
1752 case PROP_POLKIT_TARGET_PID:
1753 g_value_set_uint (value, action->priv->target_pid);
1754 break;
1755
1756 default:
1757 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
1758 break;
1759 }
1760 }
1761
1762 static void
1763 set_property (GObject *object,
1764 guint prop_id,
1765 const GValue *value,
1766 GParamSpec *pspec)
1767 {
1768 PolKitGnomeAction *action = POLKIT_GNOME_ACTION (object);
1769
1770 switch (prop_id)
1771 {
1772 case PROP_POLKIT_ACTION_OBJ:
1773 polkit_gnome_action_set_polkit_action (action, g_value_get_pointer (value));
1774 break;
1775
1776 case PROP_POLKIT_ACTION_OBJ_SUFFICIENT:
1777 polkit_gnome_action_set_polkit_action_sufficient (action, value);
1778 break;
1779
1780 case PROP_POLKIT_SELF_BLOCKED_VISIBLE:
1781 polkit_gnome_action_set_self_blocked_visible (action, g_value_get_boolean (value));
1782 break;
1783 case PROP_POLKIT_SELF_BLOCKED_SENSITIVE:
1784 polkit_gnome_action_set_self_blocked_sensitive (action, g_value_get_boolean (value));
1785 break;
1786 case PROP_POLKIT_SELF_BLOCKED_SHORT_LABEL:
1787 polkit_gnome_action_set_self_blocked_short_label (action, g_value_get_string (value));
1788 break;
1789 case PROP_POLKIT_SELF_BLOCKED_LABEL:
1790 polkit_gnome_action_set_self_blocked_label (action, g_value_get_string (value));
1791 break;
1792 case PROP_POLKIT_SELF_BLOCKED_TOOLTIP:
1793 polkit_gnome_action_set_self_blocked_tooltip (action, g_value_get_string (value));
1794 break;
1795 case PROP_POLKIT_SELF_BLOCKED_ICON_NAME:
1796 polkit_gnome_action_set_self_blocked_icon_name (action, g_value_get_string (value));
1797 break;
1798
1799 case PROP_POLKIT_NO_VISIBLE:
1800 polkit_gnome_action_set_no_visible (action, g_value_get_boolean (value));
1801 break;
1802 case PROP_POLKIT_NO_SENSITIVE:
1803 polkit_gnome_action_set_no_sensitive (action, g_value_get_boolean (value));
1804 break;
1805 case PROP_POLKIT_NO_SHORT_LABEL:
1806 polkit_gnome_action_set_no_short_label (action, g_value_get_string (value));
1807 break;
1808 case PROP_POLKIT_NO_LABEL:
1809 polkit_gnome_action_set_no_label (action, g_value_get_string (value));
1810 break;
1811 case PROP_POLKIT_NO_TOOLTIP:
1812 polkit_gnome_action_set_no_tooltip (action, g_value_get_string (value));
1813 break;
1814 case PROP_POLKIT_NO_ICON_NAME:
1815 polkit_gnome_action_set_no_icon_name (action, g_value_get_string (value));
1816 break;
1817
1818 case PROP_POLKIT_AUTH_VISIBLE:
1819 polkit_gnome_action_set_auth_visible (action, g_value_get_boolean (value));
1820 break;
1821 case PROP_POLKIT_AUTH_SENSITIVE:
1822 polkit_gnome_action_set_auth_sensitive (action, g_value_get_boolean (value));
1823 break;
1824 case PROP_POLKIT_AUTH_SHORT_LABEL:
1825 polkit_gnome_action_set_auth_short_label (action, g_value_get_string (value));
1826 break;
1827 case PROP_POLKIT_AUTH_LABEL:
1828 polkit_gnome_action_set_auth_label (action, g_value_get_string (value));
1829 break;
1830 case PROP_POLKIT_AUTH_TOOLTIP:
1831 polkit_gnome_action_set_auth_tooltip (action, g_value_get_string (value));
1832 break;
1833 case PROP_POLKIT_AUTH_ICON_NAME:
1834 polkit_gnome_action_set_auth_icon_name (action, g_value_get_string (value));
1835 break;
1836
1837 case PROP_POLKIT_YES_VISIBLE:
1838 polkit_gnome_action_set_yes_visible (action, g_value_get_boolean (value));
1839 break;
1840 case PROP_POLKIT_YES_SENSITIVE:
1841 polkit_gnome_action_set_yes_sensitive (action, g_value_get_boolean (value));
1842 break;
1843 case PROP_POLKIT_YES_SHORT_LABEL:
1844 polkit_gnome_action_set_yes_short_label (action, g_value_get_string (value));
1845 break;
1846 case PROP_POLKIT_YES_LABEL:
1847 polkit_gnome_action_set_yes_label (action, g_value_get_string (value));
1848 break;
1849 case PROP_POLKIT_YES_TOOLTIP:
1850 polkit_gnome_action_set_yes_tooltip (action, g_value_get_string (value));
1851 break;
1852 case PROP_POLKIT_YES_ICON_NAME:
1853 polkit_gnome_action_set_yes_icon_name (action, g_value_get_string (value));
1854 break;
1855
1856 case PROP_POLKIT_MASTER_VISIBLE:
1857 polkit_gnome_action_set_visible (action, g_value_get_boolean (value));
1858 break;
1859 case PROP_POLKIT_MASTER_SENSITIVE:
1860 polkit_gnome_action_set_sensitive (action, g_value_get_boolean (value));
1861 break;
1862
1863 case PROP_POLKIT_TARGET_PID:
1864 polkit_gnome_action_set_target_pid (action, g_value_get_uint (value));
1865 break;
1866
1867 default:
1868 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
1869 break;
1870 }
1871 }
1872
1873 static XID
1874 _get_xid_from_proxy_widgets (PolKitGnomeAction *action)
1875 {
1876 XID xid;
1877 GSList *i;
1878 GSList *proxies;
1879
1880 /* unfortunately there's no way to get the proxy that caused
1881 * the ::activate signal.. so go through proxies and pick the
1882 * first one.. */
1883
1884 /* TODO: this won't work for menus (mclasen) */
1885
1886 xid = 0;
1887
1888 proxies = gtk_action_get_proxies (GTK_ACTION (action));
1889
1890 for (i = proxies; i != NULL; i = i->next) {
1891 GtkWidget *top_level;
1892 GtkWidget *proxy = i->data;
1893
1894 top_level = gtk_widget_get_toplevel (proxy);
1895
1896 if (top_level == NULL)
1897 continue;
1898
1899 if (! (GTK_WIDGET_TOPLEVEL (top_level) && GTK_IS_WINDOW (top_level)))
1900 continue;
1901
1902 if (top_level->window == NULL)
1903 continue;
1904
1905 xid = gdk_x11_drawable_get_xid (GDK_WINDOW (top_level->window));
1906
1907 if (xid != 0)
1908 break;
1909 }
1910
1911 return xid;
1912 }
1913
1914 static void
1915 _show_dialog_cb (PolKitAction *pk_action,
1916 gboolean gained_privilege,
1917 GError *error,
1918 gpointer user_data)
1919 {
1920 PolKitGnomeAction *action = POLKIT_GNOME_ACTION (user_data);
1921
1922 if (gained_privilege) {
1923 /* better make sure our local pk_result is up-to-date.. */
1924 _compute_polkit_result (action);
1925
1926 //g_debug ("end auth, obtained it");
1927
1928 /* now emit the 'activate' signal again.. */
1929 gtk_action_activate (GTK_ACTION (action));
1930
1931 } else {
1932 //g_debug ("end auth, didn't obtain it");
1933
1934 if (error != NULL) {
1935 g_warning ("Caught error: %s", error->message);
1936 g_error_free (error);
1937 }
1938 }
1939
1940 g_signal_emit (action, signals [AUTH_END_SIGNAL], 0, gained_privilege);
1941 }
1942
1943 static void
1944 _auth_start (PolKitGnomeAction *action)
1945 {
1946 GError *error = NULL;
1947
1948 //g_debug ("starting auth");
1949 if (!polkit_gnome_auth_obtain (action->priv->polkit_action,
1950 (guint) _get_xid_from_proxy_widgets (action),
1951 (guint) _get_target_pid (action),
1952 _show_dialog_cb,
1953 action,
1954 &error)) {
1955 g_warning ("Caught error: %s", error->message);
1956 g_error_free (error);
1957 }
1958 }
1959
1960 static void
1961 polkit_gnome_action_activate (PolKitGnomeAction *action)
1962 {
1963 switch (action->priv->pk_result) {
1964 case POLKIT_RESULT_YES:
1965 /* If PolicyKit says yes.. then let 'activate' signal
1966 * propagate
1967 */
1968 break;
1969
1970 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT:
1971 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
1972 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION:
1973 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS:
1974 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT:
1975 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
1976 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
1977 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
1978 /* Otherwise, if the action needs auth.. stop the emission
1979 * and start auth process..
1980 */
1981
1982 g_signal_stop_emission_by_name (action, "activate");
1983
1984 if (action->priv->polkit_action != NULL) {
1985 g_signal_emit (action, signals [AUTH_START_SIGNAL], 0);
1986 }
1987 break;
1988
1989 default:
1990 case POLKIT_RESULT_NO:
1991 /* If PolicyKit says no... and we got here.. it means
1992 * that the user set the property "no-sensitive" to
1993 * TRUE.. Otherwise we couldn't be handling this signal.
1994 *
1995 * Hence, they probably have a good reason for doing
1996 * this so do let the 'activate' signal propagate..
1997 */
1998 break;
1999 }
2000 }
2001
2002 static void
2003 _update_tooltips (PolKitGnomeAction *action, GParamSpec *arg1, GtkWidget *widget)
2004 {
2005 GtkTooltips *tips;
2006 GtkTooltipsData *ttd;
2007 gchar *tip_str;
2008
2009 ttd = gtk_tooltips_data_get (widget);
2010
2011 if (ttd == NULL) {
2012 tips = gtk_tooltips_new ();
2013 } else {
2014 tips = ttd->tooltips;
2015 }
2016
2017 tip_str = NULL;
2018 g_object_get (action, "tooltip", &tip_str, NULL);
2019
2020 /* TODO: if there is no tooltip the tip_str is NULL.
2021 * Unfortunately it seems that the tooltip isn't
2022 * cleared.. mmm.. gtk+ bug?
2023 */
2024 gtk_tooltips_set_tip (tips, widget, tip_str, tip_str);
2025 g_free (tip_str);
2026 }
2027
2028 static void
2029 _update_label (PolKitGnomeAction *action, GParamSpec *arg1, GtkWidget *widget)
2030 {
2031 char *label;
2032
2033 label = NULL;
2034 g_object_get (action, "label", &label, NULL);
2035 gtk_button_set_label (GTK_BUTTON (widget), label);
2036 g_free (label);
2037 }
2038
2039 static void
2040 _update_icon_name (PolKitGnomeAction *action, GParamSpec *arg1, GtkWidget *widget)
2041 {
2042 gtk_button_set_image (GTK_BUTTON (widget), gtk_action_create_icon (GTK_ACTION (action), GTK_ICON_SIZE_BUTTON));
2043 }
2044
2045 static void
2046 _button_clicked (GtkButton *button, PolKitGnomeAction *action)
2047 {
2048 /* g_debug ("in _button_clicked"); */
2049
2050 switch (action->priv->pk_result) {
2051 case POLKIT_RESULT_YES:
2052 break;
2053
2054 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT:
2055 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
2056 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION:
2057 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS:
2058 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT:
2059 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
2060 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
2061 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
2062 /* g_debug ("blocking clicked"); */
2063 g_signal_stop_emission_by_name (button, "clicked");
2064 break;
2065
2066 default:
2067 case POLKIT_RESULT_NO:
2068 break;
2069 }
2070 }
2071
2072 static void
2073 _button_auth_end (PolKitGnomeAction *action, gboolean gained_privilege, GtkWidget *button)
2074 {
2075 /* g_debug ("in _button_auth_end gained_privilege=%d", gained_privilege); */
2076 if (gained_privilege) {
2077 /* g_debug ("emitting clicked"); */
2078 gtk_action_block_activate_from (GTK_ACTION (action), button);
2079 g_signal_emit_by_name (button, "clicked");
2080 gtk_action_unblock_activate_from (GTK_ACTION (action), button);
2081 }
2082 }
2083
2084 /**
2085 * polkit_gnome_action_create_button:
2086 * @action: The #PolKitGnomeAction object
2087 *
2088 * Create a button for the given action that displays the label,
2089 * tooltip and icon_name corresponding to whether the state, according
2090 * to PolicyKit, is no, auth or yes.
2091 *
2092 * Returns: A #GtkButton instance connected to the action
2093 */
2094 GtkWidget *
2095 polkit_gnome_action_create_button (PolKitGnomeAction *action)
2096 {
2097 GtkWidget *button;
2098
2099 button = gtk_button_new ();
2100
2101 gtk_action_connect_proxy (GTK_ACTION (action), button);
2102
2103 _update_label (action, NULL, button);
2104 _update_tooltips (action, NULL, button);
2105 _update_icon_name (action, NULL, button);
2106
2107 g_signal_connect (action, "notify::tooltip", G_CALLBACK (_update_tooltips), button);
2108 g_signal_connect (action, "notify::label", G_CALLBACK (_update_label), button);
2109 g_signal_connect (action, "notify::icon-name", G_CALLBACK (_update_icon_name), button);
2110
2111 /* hook into the ::clicked signal and block it unless
2112 * PolicyKit says it's good to go. This is necessary when the
2113 * button is embedded in e.g. a GtkDialog since that class
2114 * hooks in ::clicked signals from GtkButton instances...
2115 *
2116 * Also, hook into ::auth_end signal from the
2117 * PolKitGnomeAction and synthesize ::clicked the signal if
2118 * the privilege was gained..
2119 */
2120 g_signal_connect (button, "clicked", G_CALLBACK (_button_clicked), action);
2121 g_signal_connect (action, "auth-end", G_CALLBACK (_button_auth_end), button);
2122
2123 return button;
2124 }
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
1 /***************************************************************************
2 *
3 * polkit-gnome-action.h :
4 *
5 * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 *
22 **************************************************************************/
23
24 #if !defined (POLKIT_GNOME_COMPILATION) && !defined(_POLKIT_GNOME_INSIDE_POLKIT_GNOME_H)
25 #error "Only <polkit-gnome/polkit-gnome.h> can be included directly, this file may disappear or change contents."
26 #endif
27
28 #ifndef __POLKIT_GNOME_ACTION_H__
29 #define __POLKIT_GNOME_ACTION_H__
30
31 #include <gtk/gtk.h>
32 #include <polkit/polkit.h>
33
34 G_BEGIN_DECLS
35
36 #define POLKIT_GNOME_TYPE_ACTION (polkit_gnome_action_get_type ())
37 #define POLKIT_GNOME_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POLKIT_GNOME_TYPE_ACTION, PolKitGnomeAction))
38 #define POLKIT_GNOME_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), POLKIT_GNOME_TYPE_ACTION, PolKitGnomeActionClass))
39 #define POLKIT_GNOME_IS_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POLKIT_GNOME_TYPE_ACTION))
40 #define POLKIT_GNOME_IS_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), POLKIT_GNOME_TYPE_ACTION))
41 #define POLKIT_GNOME_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), POLKIT_GNOME_TYPE_ACTION, PolKitGnomeActionClass))
42
43 typedef struct _PolKitGnomeAction PolKitGnomeAction;
44 typedef struct _PolKitGnomeActionPrivate PolKitGnomeActionPrivate;
45 typedef struct _PolKitGnomeActionClass PolKitGnomeActionClass;
46
47 /**
48 * PolKitGnomeAction:
49 *
50 * The PolKitGnomeAction struct contains only private data members and should not be accessed directly.
51 */
52 struct _PolKitGnomeAction
53 {
54 /*< private >*/
55 GtkAction parent;
56 PolKitGnomeActionPrivate *priv;
57 };
58
59 struct _PolKitGnomeActionClass
60 {
61 GtkActionClass parent_class;
62
63 /* Signals */
64 void (* auth_start) (PolKitGnomeAction *action);
65 void (* auth_end) (PolKitGnomeAction *action, gboolean gained_privilege);
66 void (* polkit_result_changed) (PolKitGnomeAction *action, PolKitResult current_result);
67
68 /* Padding for future expansion */
69 void (*_reserved1) (void);
70 void (*_reserved2) (void);
71 void (*_reserved3) (void);
72 void (*_reserved4) (void);
73 };
74
75 GType polkit_gnome_action_get_type (void) G_GNUC_CONST;
76 PolKitGnomeAction *polkit_gnome_action_new (const gchar *name);
77 PolKitGnomeAction *polkit_gnome_action_new_default (const gchar *name,
78 PolKitAction *polkit_action,
79 const gchar *label,
80 const gchar *tooltip);
81 PolKitResult polkit_gnome_action_get_polkit_result (PolKitGnomeAction *action);
82
83 gboolean polkit_gnome_action_get_sensitive (PolKitGnomeAction *action);
84 void polkit_gnome_action_set_sensitive (PolKitGnomeAction *action,
85 gboolean sensitive);
86
87 gboolean polkit_gnome_action_get_visible (PolKitGnomeAction *action);
88 void polkit_gnome_action_set_visible (PolKitGnomeAction *action,
89 gboolean visible);
90
91 GtkWidget *polkit_gnome_action_create_button (PolKitGnomeAction *action);
92
93 G_END_DECLS
94
95 #endif /* __POLKIT_GNOME_ACTION_H__ */
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
1 /***************************************************************************
2 *
3 * polkit-gnome-auth.c : Show authentication dialogs to gain privileges
4 *
5 * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 *
22 **************************************************************************/
23
24 #ifdef HAVE_CONFIG_H
25 # include "config.h"
26 #endif
27
28 #include <stdlib.h>
29 #include <stdio.h>
30 #include <unistd.h>
31 #include <signal.h>
32 #include <errno.h>
33 #include <string.h>
34 #include <sys/types.h>
35 #include <sys/stat.h>
36 #include <sys/wait.h>
37 #include <fcntl.h>
38
39 #include <glib.h>
40 #include <glib/gi18n-lib.h>
41 #include <glib-object.h>
42
43 #include <gtk/gtk.h>
44 #include <gdk/gdkx.h>
45
46 #define DBUS_API_SUBJECT_TO_CHANGE
47 #include <dbus/dbus-glib.h>
48 #include <dbus/dbus-glib-lowlevel.h>
49
50 #include "polkit-gnome-auth.h"
51
52 /**
53 * SECTION:polkit-gnome-auth
54 * @title: Authentication Dialogs
55 * @short_description: Show authentication dialogs to gain privileges
56 *
57 * Show authentication dialogs to gain privileges.
58 *
59 **/
60
61
62 typedef struct {
63 PolKitAction *action;
64 PolKitGnomeAuthCB callback;
65 gpointer user_data;
66 } CallClosure;
67
68 static void
69 _notify_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
70 {
71 GError *error;
72 CallClosure *c = (CallClosure *) user_data;
73 gboolean gained_privilege;
74
75 error = NULL;
76 if (!dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_BOOLEAN, &gained_privilege, G_TYPE_INVALID)) {
77 gained_privilege = FALSE;
78 }
79
80 /* perform the callback */
81 c->callback (c->action, gained_privilege, error, c->user_data);
82
83 g_object_unref (proxy);
84 polkit_action_unref (c->action);
85 }
86
87 /**
88 * polkit_gnome_auth_obtain:
89 * @action: The #PolKitAction to make the user authenticate for
90 * @xid: X11 window ID for the window that the dialog will be transient for. If there is no window, pass 0.
91 * @pid: Process ID of process to grant authorization to. Normally one wants to pass result of getpid().
92 * @callback: Function to call when authentication is done
93 * @user_data: Data to pass to the callback function
94 * @error: Return location for error
95 *
96 * Applications can use this function to show a dialog for the user
97 * asking her to authenticate in order to gain privileges to do the
98 * given action. The authentication, for security reasons, happens in
99 * a separate process; this function is merely a wrapper around a
100 * D-Bus call across the session message bus to the
101 * <literal>org.freedesktop.PolicyKit.AuthenticationAgent</literal>
102 * service. Depending on the setup, this may be the Authentication
103 * Agent shipped with PolicyKit-gnome or it may be another
104 * implementation. For example, if the user is in KDE it may be an
105 * Authentication Agent using the Qt toolkit.
106 *
107 * The Authentication Agent shipped with PolicyKit-gnome is described
108 * in <link linkend="ref-auth-daemon">this section</link>.
109 *
110 * This function is similar to the polkit_auth_obtain() function
111 * supplied in <literal>libpolkit-dbus</literal> except that this
112 * function is asynchronous.
113 *
114 * Returns: #TRUE if the authentication session was scheduled to
115 * start. #FALSE if error is set (and no callback will be made).
116 */
117 gboolean
118 polkit_gnome_auth_obtain (PolKitAction *action,
119 guint xid,
120 pid_t pid,
121 PolKitGnomeAuthCB callback,
122 gpointer user_data,
123 GError **error)
124 {
125 char *polkit_action_id;
126 gboolean ret;
127 CallClosure *c;
128 DBusGConnection *session_bus;
129 DBusGProxy *polkit_gnome_proxy;
130
131 ret = FALSE;
132
133 if ((session_bus = dbus_g_bus_get (DBUS_BUS_SESSION, error)) == NULL) {
134 goto error;
135 }
136
137 /* TODO: this can fail.. */
138 polkit_action_get_action_id (action, &polkit_action_id);
139
140 polkit_gnome_proxy = dbus_g_proxy_new_for_name (session_bus,
141 "org.freedesktop.PolicyKit.AuthenticationAgent", /* bus name */
142 "/", /* object */
143 "org.freedesktop.PolicyKit.AuthenticationAgent");/* interface */
144
145 c = g_new0 (CallClosure, 1);
146 c->action = polkit_action_ref (action);
147 c->callback = callback;
148 c->user_data = user_data;
149
150 dbus_g_proxy_begin_call_with_timeout (polkit_gnome_proxy,
151 "ObtainAuthorization",
152 _notify_callback,
153 c,
154 g_free,
155 INT_MAX,
156 /* parameters: */
157 G_TYPE_STRING, polkit_action_id, /* action_id */
158 G_TYPE_UINT, xid, /* X11 window ID */
159 G_TYPE_UINT, pid, /* process id */
160 G_TYPE_INVALID);
161
162 ret = TRUE;
163 error:
164 return ret;
165 }
166
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
1 /***************************************************************************
2 *
3 * polkit-gnome-auth.h : Show authentication dialogs to gain privileges
4 *
5 * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 *
22 **************************************************************************/
23
24 #if !defined (POLKIT_GNOME_COMPILATION) && !defined(_POLKIT_GNOME_INSIDE_POLKIT_GNOME_H)
25 #error "Only <polkit-gnome/polkit-gnome.h> can be included directly, this file may disappear or change contents."
26 #endif
27
28 #ifndef __POLKIT_GNOME_AUTH_H
29 #define __POLKIT_GNOME_AUTH_H
30
31 #include <polkit/polkit.h>
32
33 /**
34 * PolKitGnomeAuthCB:
35 * @action: the #PolKitAction passed in polkit_gnome_auth_show_dialog()
36 * @gained_privilege: whether the user gained the privilege. Set to
37 * #FALSE if error is set. If set to #TRUE, error will not be set.
38 * @error: if the call failed, this parameter will be non-#NULL. The
39 * callee shall free the error.
40 * @user_data: user data
41 *
42 * The type of the callback function for
43 * polkit_gnome_auth_show_dialog().
44 */
45 typedef void (*PolKitGnomeAuthCB) (PolKitAction *action, gboolean gained_privilege, GError *error, gpointer user_data);
46
47 gboolean polkit_gnome_auth_obtain (PolKitAction *action,
48 guint xid,
49 pid_t pid,
50 PolKitGnomeAuthCB callback,
51 gpointer user_data,
52 GError **error);
53
54 #endif /* __POLKIT_GNOME_AUTH_H */
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
1 /***************************************************************************
2 *
3 * polkit-gnome-context.c : Convenience functions for using PolicyKit
4 * from GTK+ and GNOME applications.
5 *
6 * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 * 02111-1307, USA.
22 *
23 **************************************************************************/
24
25 #ifdef HAVE_CONFIG_H
26 # include "config.h"
27 #endif
28
29 #include <stdlib.h>
30 #include <stdio.h>
31 #include <unistd.h>
32 #include <signal.h>
33 #include <errno.h>
34 #include <string.h>
35 #include <sys/types.h>
36 #include <sys/stat.h>
37 #include <sys/wait.h>
38 #include <fcntl.h>
39
40 #include <glib.h>
41 #include <glib/gi18n-lib.h>
42 #include <glib-object.h>
43
44 #include <gtk/gtk.h>
45 #include <gdk/gdkx.h>
46
47 #define DBUS_API_SUBJECT_TO_CHANGE
48 #include <dbus/dbus-glib.h>
49 #include <dbus/dbus-glib-lowlevel.h>
50
51 #include <polkit/polkit.h>
52 #include <polkit-dbus/polkit-dbus.h>
53
54 #include "polkit-gnome-context.h"
55
56 /**
57 * SECTION:polkit-gnome-context
58 * @short_description: Convenience functions for using PolicyKit from GTK+ and GNOME applications.
59 *
60 * This class provides convenience functions for using PolicyKit from
61 * GTK+ and GNOME applications including setting up main loop
62 * integration and system bus connections. Rather than using
63 * callbacks, GObject signals are provided when external factors
64 * change (e.g. the PolicyKit.conf configuration file changes or
65 * ConsoleKit reports activity changes).
66 *
67 * Actual usage of PolicyKit is still through the main PolicyKit API
68 * through the public pk_context and pk_tracker variables.
69 *
70 * This class is implemented as a singleton meaning that several
71 * callers will share the underlying #PolKitContext and #PolKitTracker
72 * objects. Do not use any of the life cycle methods of these objects;
73 * only use them to gather information.
74 **/
75
76 #define POLKIT_GNOME_CONTEXT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), POLKIT_GNOME_TYPE_CONTEXT, PolKitGnomeContextPrivate))
77
78 struct _PolKitGnomeContextPrivate
79 {
80 DBusGConnection *system_bus;
81 };
82
83 enum
84 {
85 CONFIG_CHANGED,
86 CONSOLE_KIT_DB_CHANGED,
87 LAST_SIGNAL
88 };
89
90 /* our static singleton instance */
91 static PolKitGnomeContext *_singleton = NULL;
92
93 G_DEFINE_TYPE (PolKitGnomeContext, polkit_gnome_context, G_TYPE_OBJECT)
94
95 static GObjectClass *parent_class = NULL;
96 static guint signals[LAST_SIGNAL] = { 0 };
97
98 static void
99 polkit_gnome_context_init (PolKitGnomeContext *context)
100 {
101 context->priv = POLKIT_GNOME_CONTEXT_GET_PRIVATE (context);
102 }
103
104 static void
105 polkit_gnome_context_finalize (GObject *object)
106 {
107 PolKitGnomeContext *context;
108
109 context = POLKIT_GNOME_CONTEXT (object);
110
111 /* Remove the match rules we added; pass NULL for error so we
112 * don't block; we can't really properly handle the error
113 * anyway...
114 */
115 dbus_bus_remove_match (dbus_g_connection_get_connection (_singleton->priv->system_bus),
116 "type='signal'"
117 ",interface='"DBUS_INTERFACE_DBUS"'"
118 ",sender='"DBUS_SERVICE_DBUS"'"
119 ",member='NameOwnerChanged'",
120 NULL);
121 dbus_bus_remove_match (dbus_g_connection_get_connection (_singleton->priv->system_bus),
122 "type='signal',sender='org.freedesktop.ConsoleKit'",
123 NULL);
124
125 if (context->pk_context != NULL) {
126 polkit_context_unref (context->pk_context);
127 }
128
129 if (context->pk_tracker != NULL) {
130 polkit_tracker_unref (context->pk_tracker);
131 }
132
133 _singleton = NULL;
134
135 G_OBJECT_CLASS (polkit_gnome_context_parent_class)->finalize (object);
136 }
137
138 static void
139 polkit_gnome_context_class_init (PolKitGnomeContextClass *klass)
140 {
141 GObjectClass *gobject_class;
142
143 parent_class = g_type_class_peek_parent (klass);
144 gobject_class = G_OBJECT_CLASS (klass);
145
146 gobject_class->finalize = polkit_gnome_context_finalize;
147
148 /**
149 * PolKitGnomeContext::config-changed:
150 * @context: the object
151 *
152 * The ::config-changed signal is emitted when PolicyKit
153 * configuration (e.g. /etc/PolicyKit/PolicyKit.conf or
154 * .policy files) changes content.
155 *
156 * As this is one contributing factor to what answer PolicyKit
157 * will return, the caller should act on this signal and query
158 * PolicyKit for any actions it cares about.
159 **/
160 signals [CONFIG_CHANGED] =
161 g_signal_new ("config-changed",
162 G_TYPE_FROM_CLASS (gobject_class),
163 G_SIGNAL_RUN_LAST,
164 G_STRUCT_OFFSET (PolKitGnomeContextClass, config_changed),
165 NULL,
166 NULL,
167 g_cclosure_marshal_VOID__VOID,
168 G_TYPE_NONE,
169 0);
170
171 /**
172 * PolKitGnomeContext::console-kit-db-changed:
173 * @context: the object
174 *
175 * The ::console-kit-db-changed signal is emitted when
176 * ConsoleKit configuration changes; e.g. when a session
177 * becomes active or inactive.
178 *
179 * As this is one contributing factor to what answer PolicyKit
180 * will return, the caller should act on this signal and query
181 * PolicyKit for any actions it cares about.
182 **/
183 signals [CONSOLE_KIT_DB_CHANGED] =
184 g_signal_new ("console-kit-db-changed",
185 G_TYPE_FROM_CLASS (gobject_class),
186 G_SIGNAL_RUN_LAST,
187 G_STRUCT_OFFSET (PolKitGnomeContextClass, console_kit_db_changed),
188 NULL,
189 NULL,
190 g_cclosure_marshal_VOID__VOID,
191 G_TYPE_NONE,
192 0);
193
194 g_type_class_add_private (gobject_class, sizeof (PolKitGnomeContextPrivate));
195 }
196
197
198 static gboolean
199 io_watch_have_data (GIOChannel *channel, GIOCondition condition, gpointer user_data)
200 {
201 int fd;
202 PolKitContext *pk_context = user_data;
203 fd = g_io_channel_unix_get_fd (channel);
204 polkit_context_io_func (pk_context, fd);
205 return TRUE;
206 }
207
208 static int
209 io_add_watch (PolKitContext *pk_context, int fd)
210 {
211 guint id = 0;
212 GIOChannel *channel;
213 channel = g_io_channel_unix_new (fd);
214 if (channel == NULL)
215 goto out;
216 id = g_io_add_watch (channel, G_IO_IN, io_watch_have_data, pk_context);
217 if (id == 0) {
218 g_io_channel_unref (channel);
219 goto out;
220 }
221 g_io_channel_unref (channel);
222 out:
223 return id;
224 }
225
226 static void
227 io_remove_watch (PolKitContext *pk_context, int watch_id)
228 {
229 g_source_remove (watch_id);
230 }
231
232
233 static void
234 pk_config_changed (PolKitContext *pk_context, void *user_data)
235 {
236 PolKitGnomeContext *context = POLKIT_GNOME_CONTEXT (user_data);
237
238 /* g_debug ("ggg PolicyKit config changed"); */
239 g_signal_emit (context, signals [CONFIG_CHANGED], 0);
240 }
241
242
243 static DBusHandlerResult
244 _filter (DBusConnection *connection, DBusMessage *message, void *user_data)
245 {
246 PolKitGnomeContext *context = POLKIT_GNOME_CONTEXT (user_data);
247
248 /* pass NameOwnerChanged signals from the bus and ConsoleKit to PolKitTracker */
249 if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged") ||
250 (dbus_message_get_interface (message) != NULL &&
251 g_str_has_prefix (dbus_message_get_interface (message), "org.freedesktop.ConsoleKit"))) {
252 if (polkit_tracker_dbus_func (context->pk_tracker, message)) {
253 /* The ConsoleKit database has changed */
254 /* g_debug ("ggg ConsoleKit database changed"); */
255 g_signal_emit (context, signals [CONSOLE_KIT_DB_CHANGED], 0);
256 }
257 }
258
259 /* other filters might want to process this message too */
260 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
261 }
262
263 /**
264 * polkit_gnome_context_get:
265 * @error: return location for error
266 *
267 * Returns a #PolKitGnomeContext object. The context is a global
268 * singleton that may be shared with other callers of this function.
269 *
270 * This operation can fail if the system message bus is not available.
271 *
272 * When done with using this object, call g_object_unref(). This is
273 * such that resources can be freed when all callers have unreffed it.
274 *
275 * Returns: a new #PolKitGnomeContext or NULL if error is set
276 */
277 PolKitGnomeContext *
278 polkit_gnome_context_get (GError **error)
279 {
280 DBusError dbus_error;
281 PolKitError *pk_error;
282
283 if (_singleton != NULL)
284 return g_object_ref (_singleton);
285
286 /* g_debug ("Constructing singleton"); */
287
288 _singleton = g_object_new (POLKIT_GNOME_TYPE_CONTEXT, NULL);
289
290 if ((_singleton->priv->system_bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, error)) == NULL) {
291 goto error;
292 }
293
294 _singleton->pk_context = polkit_context_new ();
295 polkit_context_set_io_watch_functions (_singleton->pk_context, io_add_watch, io_remove_watch);
296 polkit_context_set_config_changed (_singleton->pk_context, pk_config_changed, _singleton);
297
298 pk_error = NULL;
299 if (!polkit_context_init (_singleton->pk_context, &pk_error)) {
300 g_warning ("Failed to initialize PolicyKit context: %s", polkit_error_get_error_message (pk_error));
301 if (error != NULL) {
302 *error = g_error_new_literal (POLKIT_GNOME_CONTEXT_ERROR,
303 POLKIT_GNOME_CONTEXT_ERROR_FAILED,
304 polkit_error_get_error_message (pk_error));
305 }
306 polkit_error_free (pk_error);
307 goto error;
308 }
309
310 /* TODO FIXME: I'm pretty sure dbus-glib blows in a way that
311 * we can't say we're interested in all signals from all
312 * members on all interfaces for a given service... So we do
313 * this..
314 */
315
316 dbus_error_init (&dbus_error);
317
318 /* need to listen to NameOwnerChanged */
319 dbus_bus_add_match (dbus_g_connection_get_connection (_singleton->priv->system_bus),
320 "type='signal'"
321 ",interface='"DBUS_INTERFACE_DBUS"'"
322 ",sender='"DBUS_SERVICE_DBUS"'"
323 ",member='NameOwnerChanged'",
324 &dbus_error);
325
326 if (dbus_error_is_set (&dbus_error)) {
327 dbus_set_g_error (error, &dbus_error);
328 dbus_error_free (&dbus_error);
329 goto error;
330 }
331
332 /* need to listen to ConsoleKit signals */
333 dbus_bus_add_match (dbus_g_connection_get_connection (_singleton->priv->system_bus),
334 "type='signal',sender='org.freedesktop.ConsoleKit'",
335 &dbus_error);
336
337 if (dbus_error_is_set (&dbus_error)) {
338 dbus_set_g_error (error, &dbus_error);
339 dbus_error_free (&dbus_error);
340 goto error;
341 }
342
343 if (!dbus_connection_add_filter (dbus_g_connection_get_connection (_singleton->priv->system_bus),
344 _filter,
345 _singleton,
346 NULL)) {
347 *error = g_error_new_literal (POLKIT_GNOME_CONTEXT_ERROR,
348 POLKIT_GNOME_CONTEXT_ERROR_FAILED,
349 "Cannot add D-Bus filter");
350 goto error;
351 }
352
353 _singleton->pk_tracker = polkit_tracker_new ();
354 polkit_tracker_set_system_bus_connection (_singleton->pk_tracker,
355 dbus_g_connection_get_connection (_singleton->priv->system_bus));
356 polkit_tracker_init (_singleton->pk_tracker);
357
358 return _singleton;
359
360 error:
361 g_object_unref (_singleton);
362 return NULL;
363 }
364
365 GQuark
366 polkit_gnome_context_error_quark (void)
367 {
368 return g_quark_from_static_string ("polkit-gnome-context-error-quark");
369 }
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
1 /***************************************************************************
2 *
3 * polkit-gnome-context.h : Convenience functions for using PolicyKit
4 * from GTK+ and GNOME applications.
5 *
6 * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 * 02111-1307, USA.
22 *
23 **************************************************************************/
24
25 #if !defined (POLKIT_GNOME_COMPILATION) && !defined(_POLKIT_GNOME_INSIDE_POLKIT_GNOME_H)
26 #error "Only <polkit-gnome/polkit-gnome.h> can be included directly, this file may disappear or change contents."
27 #endif
28
29 #ifndef __POLKIT_GNOME_CONTEXT_H__
30 #define __POLKIT_GNOME_CONTEXT_H__
31
32 #include <glib-object.h>
33 #include <polkit-dbus/polkit-dbus.h>
34
35 G_BEGIN_DECLS
36
37 #define POLKIT_GNOME_TYPE_CONTEXT (polkit_gnome_context_get_type ())
38 #define POLKIT_GNOME_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POLKIT_GNOME_TYPE_CONTEXT, PolKitGnomeContext))
39 #define POLKIT_GNOME_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), POLKIT_GNOME_TYPE_CONTEXT, PolKitGnomeContextClass))
40 #define POLKIT_GNOME_IS_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POLKIT_GNOME_TYPE_CONTEXT))
41 #define POLKIT_GNOME_IS_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), POLKIT_GNOME_TYPE_CONTEXT))
42 #define POLKIT_GNOME_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), POLKIT_GNOME_TYPE_CONTEXT, PolKitGnomeContextClass))
43
44 /**
45 * POLKIT_GNOME_CONTEXT_ERROR:
46 *
47 * Error domain for using the GNOME PolicyKit context. Errors in this
48 * domain will be from the #PolKitGnomeContextError enumeration. See
49 * #GError for information on error domains.
50 */
51 #define POLKIT_GNOME_CONTEXT_ERROR polkit_gnome_context_error_quark ()
52
53 /**
54 * PolKitGnomeContextError:
55 * @POLKIT_GNOME_CONTEXT_ERROR_FAILED: General error
56 *
57 * Error codes describing how #PolKitGnomeContext can fail.
58 */
59 typedef enum
60 {
61 POLKIT_GNOME_CONTEXT_ERROR_FAILED
62 } PolKitGnomeContextError;
63
64
65 typedef struct _PolKitGnomeContext PolKitGnomeContext;
66 typedef struct _PolKitGnomeContextPrivate PolKitGnomeContextPrivate;
67 typedef struct _PolKitGnomeContextClass PolKitGnomeContextClass;
68
69 /**
70 * PolKitGnomeContext:
71 * @pk_context: for interfacing with PolicyKit; e.g. typically polkit_context_can_caller_do_action()
72 * @pk_tracker: this is used for effieciently obtaining #PolKitCaller objects
73 *
74 * Provide access to #PolKitContext and #PolKitTracker instances
75 * shared among many callers.
76 */
77 struct _PolKitGnomeContext
78 {
79 /*< private >*/
80 GObject parent;
81
82 PolKitGnomeContextPrivate *priv;
83
84 /*< public >*/
85 PolKitContext *pk_context;
86 PolKitTracker *pk_tracker;
87 };
88
89 struct _PolKitGnomeContextClass
90 {
91 GObjectClass parent_class;
92
93 void (* config_changed) (PolKitGnomeContext *context);
94 void (* console_kit_db_changed) (PolKitGnomeContext *context);
95
96 /* Padding for future expansion */
97 void (*_reserved1) (void);
98 void (*_reserved2) (void);
99 void (*_reserved3) (void);
100 void (*_reserved4) (void);
101 };
102
103 GType polkit_gnome_context_get_type (void) G_GNUC_CONST;
104 PolKitGnomeContext *polkit_gnome_context_get (GError **error);
105
106 GQuark polkit_gnome_context_error_quark (void);
107
108 G_END_DECLS
109
110 #endif /* __POLKIT_GNOME_CONTEXT_H__ */
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
1 /***************************************************************************
2 *
3 * polkit-gnome-toggle-action.c :
4 *
5 * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
6 *
7 * Based loosely on gtk/gtktoggleaction.c from GTK+ written by James
8 * Henstridge <james@daa.com.au>.
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public License
12 * as published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 * 02111-1307, USA.
24 *
25 **************************************************************************/
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <stdlib.h>
32 #include <stdio.h>
33 #include <unistd.h>
34 #include <signal.h>
35 #include <errno.h>
36 #include <string.h>
37 #include <sys/types.h>
38 #include <sys/stat.h>
39 #include <sys/wait.h>
40 #include <fcntl.h>
41
42 #include <glib.h>
43 #include <glib/gi18n-lib.h>
44 #include <glib-object.h>
45
46 #include <gtk/gtk.h>
47 #include <gdk/gdkx.h>
48
49 #define DBUS_API_SUBJECT_TO_CHANGE
50 #include <dbus/dbus-glib.h>
51 #include <dbus/dbus-glib-lowlevel.h>
52
53 #include <polkit/polkit.h>
54 #include <polkit-dbus/polkit-dbus.h>
55
56 #include "polkit-gnome-toggle-action.h"
57
58 /**
59 * SECTION:polkit-gnome-toggle-action
60 * @short_description: A GtkAction that can be toggled to
61 * obtain and give up PolicyKit authorizations.
62 *
63 * For an example of how to use this class, see the documentation for
64 * #PolKitGnomeAction.
65 **/
66
67 #define POLKIT_GNOME_TOGGLE_ACTION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), POLKIT_GNOME_TYPE_TOGGLE_ACTION, PolKitGnomeToggleActionPrivate))
68
69 struct _PolKitGnomeToggleActionPrivate
70 {
71 gboolean active;
72 gboolean am_authenticating;
73
74 gboolean auth_underway_visible;
75 gboolean auth_underway_sensitive;
76 gchar *auth_underway_short_label;
77 gchar *auth_underway_label;
78 gchar *auth_underway_tooltip;
79 gchar *auth_underway_icon_name;
80 };
81
82 enum
83 {
84 TOGGLED_SIGNAL,
85 LAST_SIGNAL
86 };
87
88 enum
89 {
90 PROP_0,
91 PROP_POLKIT_AUTH_UNDERWAY_VISIBLE,
92 PROP_POLKIT_AUTH_UNDERWAY_SENSITIVE,
93 PROP_POLKIT_AUTH_UNDERWAY_SHORT_LABEL,
94 PROP_POLKIT_AUTH_UNDERWAY_LABEL,
95 PROP_POLKIT_AUTH_UNDERWAY_TOOLTIP,
96 PROP_POLKIT_AUTH_UNDERWAY_ICON_NAME,
97 };
98
99 G_DEFINE_TYPE (PolKitGnomeToggleAction, polkit_gnome_toggle_action, POLKIT_GNOME_TYPE_ACTION)
100
101 static void set_property (GObject *object,
102 guint prop_id,
103 const GValue *value,
104 GParamSpec *pspec);
105 static void get_property (GObject *object,
106 guint prop_id,
107 GValue *value,
108 GParamSpec *pspec);
109
110 static GObjectClass *parent_class = NULL;
111 static guint signals[LAST_SIGNAL] = { 0 };
112
113 static void
114 polkit_gnome_toggle_action_init (PolKitGnomeToggleAction *toggle_action)
115 {
116 toggle_action->priv = POLKIT_GNOME_TOGGLE_ACTION_GET_PRIVATE (toggle_action);
117
118 }
119
120 static void
121 polkit_gnome_toggle_action_finalize (GObject *object)
122 {
123 PolKitGnomeToggleAction *toggle_action;
124
125 toggle_action = POLKIT_GNOME_TOGGLE_ACTION (object);
126
127 G_OBJECT_CLASS (polkit_gnome_toggle_action_parent_class)->finalize (object);
128 }
129
130 static GObject *
131 polkit_gnome_toggle_action_constructor (GType type,
132 guint n_construct_properties,
133 GObjectConstructParam *construct_properties)
134 {
135 PolKitGnomeToggleAction *toggle_action;
136 PolKitGnomeToggleActionClass *klass;
137
138 klass = POLKIT_GNOME_TOGGLE_ACTION_CLASS (g_type_class_peek (POLKIT_GNOME_TYPE_TOGGLE_ACTION));
139
140 toggle_action = POLKIT_GNOME_TOGGLE_ACTION (G_OBJECT_CLASS (parent_class)->constructor (type,
141 n_construct_properties,
142 construct_properties));
143
144 if (polkit_gnome_action_get_polkit_result (POLKIT_GNOME_ACTION (toggle_action)) == POLKIT_RESULT_YES)
145 toggle_action->priv->active = TRUE;
146 else
147 toggle_action->priv->active = FALSE;
148
149 return G_OBJECT (toggle_action);
150 }
151
152 static void polkit_gnome_toggle_action_auth_end (PolKitGnomeToggleAction *toggle_action, gboolean gained_privilege);
153 static void polkit_gnome_toggle_polkit_result_changed (PolKitGnomeToggleAction *toggle_action, PolKitResult current_result);
154 static void polkit_gnome_toggle_action_activate (PolKitGnomeToggleAction *toggle_action);
155 static void polkit_gnome_toggle_action_real_toggled (PolKitGnomeToggleAction *action);
156 static void connect_proxy (GtkAction *action,
157 GtkWidget *proxy);
158 static void disconnect_proxy (GtkAction *action,
159 GtkWidget *proxy);
160
161
162 static void
163 polkit_gnome_toggle_action_class_init (PolKitGnomeToggleActionClass *klass)
164 {
165 GObjectClass *gobject_class;
166 GtkActionClass *action_class;
167 PolKitGnomeActionClass *polkit_gnome_action_class;
168
169 parent_class = g_type_class_peek_parent (klass);
170 gobject_class = G_OBJECT_CLASS (klass);
171 action_class = GTK_ACTION_CLASS (klass);
172 polkit_gnome_action_class = POLKIT_GNOME_ACTION_CLASS (klass);
173
174 gobject_class->constructor = polkit_gnome_toggle_action_constructor;
175 gobject_class->set_property = set_property;
176 gobject_class->get_property = get_property;
177 gobject_class->finalize = polkit_gnome_toggle_action_finalize;
178
179 action_class->menu_item_type = GTK_TYPE_CHECK_MENU_ITEM;
180 action_class->toolbar_item_type = GTK_TYPE_TOGGLE_TOOL_BUTTON;
181
182 action_class->connect_proxy = connect_proxy;
183 action_class->disconnect_proxy = disconnect_proxy;
184
185 klass->toggled = polkit_gnome_toggle_action_real_toggled;
186
187 action_class->activate = (void (*)(GtkAction*)) polkit_gnome_toggle_action_activate;
188
189 polkit_gnome_action_class->auth_end =
190 (void (*)(PolKitGnomeAction *, gboolean)) polkit_gnome_toggle_action_auth_end;
191
192 polkit_gnome_action_class->polkit_result_changed =
193 (void (*) (PolKitGnomeAction *, PolKitResult)) polkit_gnome_toggle_polkit_result_changed;
194
195 /*------------------------------*/
196
197 g_object_class_install_property (
198 gobject_class,
199 PROP_POLKIT_AUTH_UNDERWAY_VISIBLE,
200 g_param_spec_boolean (
201 "auth-underway-visible",
202 "When authentication is underway, whether the action will be visible",
203 "When authentication is underway, whether the action will be visible",
204 TRUE,
205 G_PARAM_READWRITE));
206
207 g_object_class_install_property (
208 gobject_class,
209 PROP_POLKIT_AUTH_UNDERWAY_SENSITIVE,
210 g_param_spec_boolean (
211 "auth-underway-sensitive",
212 "When authentication is underway, whether the action will be sensitive",
213 "When authentication is underway, whether the action will be sensitive",
214 TRUE,
215 G_PARAM_READWRITE));
216
217 g_object_class_install_property (
218 gobject_class,
219 PROP_POLKIT_AUTH_UNDERWAY_SHORT_LABEL,
220 g_param_spec_string (
221 "auth-underway-short-label",
222 "When authentication is underway, use this short-label",
223 "When authentication is underway, use this short-label",
224 NULL,
225 G_PARAM_READWRITE));
226
227 g_object_class_install_property (
228 gobject_class,
229 PROP_POLKIT_AUTH_UNDERWAY_LABEL,
230 g_param_spec_string (
231 "auth-underway-label",
232 "When authentication is underway, use this label",
233 "When authentication is underway, use this label",
234 NULL,
235 G_PARAM_READWRITE));
236
237 g_object_class_install_property (
238 gobject_class,
239 PROP_POLKIT_AUTH_UNDERWAY_TOOLTIP,
240 g_param_spec_string (
241 "auth-underway-tooltip",
242 "When authentication is underway, use this tooltip",
243 "When authentication is underway, use this tooltip",
244 NULL,
245 G_PARAM_READWRITE));
246
247 g_object_class_install_property (
248 gobject_class,
249 PROP_POLKIT_AUTH_UNDERWAY_ICON_NAME,
250 g_param_spec_string (
251 "auth-underway-icon-name",
252 "When authentication is underway, use this icon-name",
253 "When authentication is underway, use this icon-name",
254 NULL,
255 G_PARAM_READWRITE));
256
257 /*------------------------------*/
258
259
260 /**
261 * PolKitGnomeToggleAction::toggled:
262 * @toggle_action: the object
263 *
264 * The ::toggled signal is emitted when the button is toggled.
265 **/
266 signals [TOGGLED_SIGNAL] =
267 g_signal_new ("toggled",
268 G_TYPE_FROM_CLASS (gobject_class),
269 G_SIGNAL_RUN_LAST,
270 G_STRUCT_OFFSET (PolKitGnomeToggleActionClass, toggled),
271 NULL,
272 NULL,
273 g_cclosure_marshal_VOID__VOID,
274 G_TYPE_NONE,
275 0);
276
277 g_type_class_add_private (gobject_class, sizeof (PolKitGnomeToggleActionPrivate));
278 }
279
280
281 /**
282 * polkit_gnome_toggle_action_new:
283 * @name: A unique name for the toggle_action
284 * @error: Return location for error
285 *
286 * Creates a new #PolKitGnomeToggleAction object. The typical use for
287 * this function is for specialized use where
288 * polkit_gnome_toggle_action_new_default() does not meet the needs of
289 * the application.
290 *
291 * If the 'polkit-toggle_action' property is #NULL the behavior is similar to
292 * as if a #PolKitAction returned #POLKIT_RESULT_YES.
293 *
294 * Returns: a new #PolKitGnomeToggleAction or #NULL if error is set
295 */
296 PolKitGnomeToggleAction *
297 polkit_gnome_toggle_action_new (const gchar *name)
298 {
299 PolKitGnomeToggleAction *toggle_action = NULL;
300
301 toggle_action = g_object_new (POLKIT_GNOME_TYPE_TOGGLE_ACTION,
302 "name", name,
303 NULL);
304 return toggle_action;
305 }
306
307 /**
308 * polkit_gnome_toggle_action_new_default:
309 * @name: A unique name for the toggle_action
310 * @polkit_action: the #PolKitAction to track
311 * @locked_label: The label to show when the user do not possess the
312 * authorization, e.g. "Click to make changes"
313 * @unlocked_label: The label to show when the user does posses the
314 * authorization; e.g. "Click to prevent changes"
315 *
316 * Creates a new #PolKitGnomeToggleAction object with the default
317 * behavior for a given #PolKitAction object. The toggle represents
318 * whether the user is authorized for the given #PolKitAction. If the
319 * user is not authorized, clicking on a proxy widget (if it's
320 * sensitive) will cause an authentication dialog to appear. If the
321 * user is authorized, clicking on a proxy widget will cause all
322 * authorizations to be given up (aka revoked). The ::toggled signal
323 * is only emitted when such transitions occur. Thus, the user of this
324 * class will never have to deal with bringing up authentication
325 * dialogs; it's all handled behind the scenes.
326 *
327 * As such, the typical use case for this action is an UI where the
328 * user is encouraged to give up authorizations.
329 *
330 * There's also support for the corner case where the user is
331 * authorized because of implicit authorizations. In this case,
332 * toggling the action will "grant" a negative authorization for the
333 * user. By toggling the action again, the negative authorization will
334 * be revoked.
335 *
336 * Default behavior is defined as having the icon_name be 'stock_lock'
337 * by default except for the YES PolicyKit answer where it's set to
338 * 'stock_lock-open'. No tooltips are set. The label and short-label
339 * will be 'locked_label' everywhere except in the YES state where
340 * it's set to 'unlocked-label'. When authentication is underway, the
341 * label will be "Authenticating..." and icon_name is untouched. If
342 * the PolicyKit answer is NO, sensitivity is set to
343 * #FALSE. Visibility is always set to #TRUE.
344 *
345 * The caller can always modify individual aspects of the
346 * toggle_action after creation, e.g. change the tooltip for the no,
347 * auth and yes states; see the parent class #PolKitGnomeAction. In
348 * addition to the properties in the parent class, this subclass
349 * sports six new properties, "auth-underway-*" to control the look
350 * of proxy widgets when authentication is underway.
351 *
352 * If the given polkit_toggle_action is #NULL the behavior is similar to as
353 * if a #PolKitAction returned #POLKIT_RESULT_YES.
354 *
355 * Returns: a new #PolKitGnomeToggleAction or #NULL if error is set
356 */
357 PolKitGnomeToggleAction *
358 polkit_gnome_toggle_action_new_default (const gchar *name,
359 PolKitAction *polkit_action,
360 const gchar *locked_label,
361 const gchar *unlocked_label)
362 {
363 PolKitGnomeToggleAction *toggle_action;
364
365 toggle_action = g_object_new (POLKIT_GNOME_TYPE_TOGGLE_ACTION,
366 "name", name,
367 "polkit-action", polkit_action,
368
369 "self-blocked-visible", TRUE,
370 "self-blocked-sensitive", TRUE,
371 "self-blocked-short-label", locked_label,
372 "self-blocked-label", locked_label,
373 "self-blocked-tooltip", NULL,
374 "self-blocked-icon-name", "stock_lock",
375
376 "no-visible", TRUE,
377 "no-sensitive", FALSE,
378 "no-short-label", locked_label,
379 "no-label", locked_label,
380 "no-tooltip", NULL,
381 "no-icon-name", "stock_lock",
382
383 "auth-visible", TRUE,
384 "auth-sensitive", TRUE,
385 "auth-short-label", locked_label,
386 "auth-label", locked_label,
387 "auth-tooltip", NULL,
388 "auth-icon-name", "stock_lock",
389
390 "yes-visible", TRUE,
391 "yes-sensitive", TRUE,
392 "yes-short-label", unlocked_label,
393 "yes-label", unlocked_label,
394 "yes-tooltip", NULL,
395 "yes-icon-name", "stock_lock-open",
396
397 "auth-underway-visible", TRUE,
398 "auth-underway-sensitive", TRUE,
399 "auth-underway-short-label", _("Authenticating..."),
400 "auth-underway-label", _("Authenticating..."),
401 "auth-underway-tooltip", NULL,
402 "auth-underway-icon-name", "stock_lock",
403
404 "master-visible", TRUE,
405 "master-sensitive", TRUE,
406 NULL);
407 return toggle_action;
408 }
409
410 /*----------------------------------------------------------------------------------------------------*/
411
412 static void
413 polkit_gnome_toggle_action_set_auth_underway_visible (PolKitGnomeToggleAction *action, gboolean visible)
414 {
415 action->priv->auth_underway_visible = visible;
416 }
417
418 static void
419 polkit_gnome_toggle_action_set_auth_underway_sensitive (PolKitGnomeToggleAction *action, gboolean sensitive)
420 {
421 action->priv->auth_underway_sensitive = sensitive;
422 }
423
424 static void
425 polkit_gnome_toggle_action_set_auth_underway_short_label (PolKitGnomeToggleAction *action, const gchar *short_label)
426 {
427 g_free (action->priv->auth_underway_short_label);
428 action->priv->auth_underway_short_label = g_strdup (short_label);
429 }
430
431 static void
432 polkit_gnome_toggle_action_set_auth_underway_label (PolKitGnomeToggleAction *action, const gchar *label)
433 {
434 g_free (action->priv->auth_underway_label);
435 action->priv->auth_underway_label = g_strdup (label);
436 }
437
438 static void
439 polkit_gnome_toggle_action_set_auth_underway_tooltip (PolKitGnomeToggleAction *action, const gchar *tooltip)
440 {
441 g_free (action->priv->auth_underway_tooltip);
442 action->priv->auth_underway_tooltip = g_strdup (tooltip);
443 }
444
445 static void
446 polkit_gnome_toggle_action_set_auth_underway_icon_name (PolKitGnomeToggleAction *action, const gchar *icon_name)
447 {
448 g_free (action->priv->auth_underway_icon_name);
449 action->priv->auth_underway_icon_name = g_strdup (icon_name);
450 }
451
452 static void
453 get_property (GObject *object,
454 guint prop_id,
455 GValue *value,
456 GParamSpec *pspec)
457 {
458 PolKitGnomeToggleAction *action = POLKIT_GNOME_TOGGLE_ACTION (object);
459
460 switch (prop_id)
461 {
462
463 case PROP_POLKIT_AUTH_UNDERWAY_VISIBLE:
464 g_value_set_boolean (value, action->priv->auth_underway_visible);
465 break;
466 case PROP_POLKIT_AUTH_UNDERWAY_SENSITIVE:
467 g_value_set_boolean (value, action->priv->auth_underway_sensitive);
468 break;
469 case PROP_POLKIT_AUTH_UNDERWAY_SHORT_LABEL:
470 g_value_set_string (value, action->priv->auth_underway_short_label);
471 break;
472 case PROP_POLKIT_AUTH_UNDERWAY_LABEL:
473 g_value_set_string (value, action->priv->auth_underway_label);
474 break;
475 case PROP_POLKIT_AUTH_UNDERWAY_TOOLTIP:
476 g_value_set_string (value, action->priv->auth_underway_tooltip);
477 break;
478 case PROP_POLKIT_AUTH_UNDERWAY_ICON_NAME:
479 g_value_set_string (value, action->priv->auth_underway_icon_name);
480 break;
481
482 default:
483 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
484 break;
485 }
486 }
487
488 static void
489 set_property (GObject *object,
490 guint prop_id,
491 const GValue *value,
492 GParamSpec *pspec)
493 {
494 PolKitGnomeToggleAction *action = POLKIT_GNOME_TOGGLE_ACTION (object);
495
496 switch (prop_id)
497 {
498
499 case PROP_POLKIT_AUTH_UNDERWAY_VISIBLE:
500 polkit_gnome_toggle_action_set_auth_underway_visible (action, g_value_get_boolean (value));
501 break;
502 case PROP_POLKIT_AUTH_UNDERWAY_SENSITIVE:
503 polkit_gnome_toggle_action_set_auth_underway_sensitive (action, g_value_get_boolean (value));
504 break;
505 case PROP_POLKIT_AUTH_UNDERWAY_SHORT_LABEL:
506 polkit_gnome_toggle_action_set_auth_underway_short_label (action, g_value_get_string (value));
507 break;
508 case PROP_POLKIT_AUTH_UNDERWAY_LABEL:
509 polkit_gnome_toggle_action_set_auth_underway_label (action, g_value_get_string (value));
510 break;
511 case PROP_POLKIT_AUTH_UNDERWAY_TOOLTIP:
512 polkit_gnome_toggle_action_set_auth_underway_tooltip (action, g_value_get_string (value));
513 break;
514 case PROP_POLKIT_AUTH_UNDERWAY_ICON_NAME:
515 polkit_gnome_toggle_action_set_auth_underway_icon_name (action, g_value_get_string (value));
516 break;
517
518 default:
519 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
520 break;
521 }
522 }
523
524 static void
525 _set_proxy_state (PolKitGnomeToggleAction *toggle_action)
526 {
527 GSList *i;
528
529 for (i = gtk_action_get_proxies (GTK_ACTION (toggle_action)); i; i = i->next) {
530 GtkWidget *proxy = i->data;
531
532 gtk_action_block_activate_from (GTK_ACTION (toggle_action), proxy);
533 if (GTK_IS_CHECK_MENU_ITEM (proxy))
534 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (proxy),
535 toggle_action->priv->active);
536 else if (GTK_IS_TOGGLE_TOOL_BUTTON (proxy))
537 gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (proxy),
538 toggle_action->priv->active);
539 else if (GTK_IS_TOGGLE_BUTTON (proxy))
540 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (proxy),
541 toggle_action->priv->active);
542 else {
543 g_warning ("Don't know how to toggle `%s' widgets",
544 G_OBJECT_TYPE_NAME (proxy));
545 }
546 gtk_action_unblock_activate_from (GTK_ACTION (toggle_action), proxy);
547 }
548 }
549
550 static void
551 _update_toggled (PolKitGnomeToggleAction *toggle_action)
552 {
553 gboolean is_active;
554
555 g_return_if_fail (POLKIT_GNOME_IS_TOGGLE_ACTION (toggle_action));
556
557 if (polkit_gnome_action_get_polkit_result (POLKIT_GNOME_ACTION (toggle_action)) == POLKIT_RESULT_YES)
558 is_active = TRUE;
559 else
560 is_active = FALSE;
561
562 if (toggle_action->priv->active != is_active) {
563 toggle_action->priv->active = is_active;
564
565 _set_proxy_state (toggle_action);
566
567 g_signal_emit (toggle_action, signals[TOGGLED_SIGNAL], 0);
568 }
569 }
570
571 static void
572 polkit_gnome_toggle_polkit_result_changed (PolKitGnomeToggleAction *toggle_action, PolKitResult current_result)
573 {
574 _update_toggled (toggle_action);
575 }
576
577 static void
578 polkit_gnome_toggle_action_auth_end (PolKitGnomeToggleAction *toggle_action, gboolean gained_privilege)
579 {
580 _update_toggled (toggle_action);
581 toggle_action->priv->am_authenticating = FALSE;
582 }
583
584 static polkit_bool_t
585 _auth_foreach_revoke (PolKitAuthorizationDB *authdb,
586 PolKitAuthorization *auth,
587 void *user_data)
588 {
589 PolKitError *pk_error;
590 int *num_auths_revoked = (int *) user_data;
591
592 pk_error = NULL;
593 if (!polkit_authorization_db_revoke_entry (authdb, auth, &pk_error)) {
594 g_warning ("Error revoking authorization: %s: %s\n",
595 polkit_error_get_error_name (pk_error),
596 polkit_error_get_error_message (pk_error));
597 polkit_error_free (pk_error);
598 }
599
600 if (num_auths_revoked != NULL)
601 *num_auths_revoked += 1;
602
603 return FALSE;
604 }
605
606 static void
607 polkit_gnome_toggle_action_activate (PolKitGnomeToggleAction *toggle_action)
608 {
609 PolKitError *pk_error;
610 PolKitAction *pk_action;
611 PolKitGnomeContext *pkgc;
612 PolKitAuthorizationDB *authdb;
613 PolKitResult pk_result;
614 polkit_bool_t do_not_grant_negative;
615
616 pkgc = polkit_gnome_context_get (NULL);
617 authdb = polkit_context_get_authorization_db (pkgc->pk_context);
618
619 pk_action = NULL;
620 g_object_get (toggle_action, "polkit-action", &pk_action, NULL);
621
622 g_return_if_fail (POLKIT_GNOME_IS_TOGGLE_ACTION (toggle_action));
623
624 pk_result = polkit_gnome_action_get_polkit_result (POLKIT_GNOME_ACTION (toggle_action));
625
626 do_not_grant_negative = FALSE;
627 reevaluate:
628
629 switch (pk_result) {
630 case POLKIT_RESULT_YES:
631
632 if (!toggle_action->priv->am_authenticating) {
633 /* If we already got the authorization.. revoke it! */
634
635 if (pk_action != NULL && authdb != NULL) {
636 int num_auths_revoked;
637
638 pk_error = NULL;
639 num_auths_revoked = 0;
640 polkit_authorization_db_foreach_for_action_for_uid (authdb,
641 pk_action,
642 getuid (),
643 _auth_foreach_revoke,
644 &num_auths_revoked,
645 &pk_error);
646 if (pk_error != NULL) {
647 g_warning ("Error removing authorizations: code=%d: %s",
648 polkit_error_get_error_code (pk_error),
649 polkit_error_get_error_message (pk_error));
650 polkit_error_free (pk_error);
651 }
652
653 if (pk_error == NULL && num_auths_revoked == 0 && !do_not_grant_negative) {
654 /* no authorizations, yet we are authorized.. "grant" a
655 * negative authorization...
656 */
657
658 if (!polkit_authorization_db_grant_negative_to_uid (
659 authdb,
660 pk_action,
661 getuid (),
662 NULL, /* no constraints */
663 &pk_error)) {
664 g_warning ("Error granting negative auth: %s: %s\n",
665 polkit_error_get_error_name (pk_error),
666 polkit_error_get_error_message (pk_error));
667 polkit_error_free (pk_error);
668 }
669 }
670
671 }
672
673 _update_toggled (toggle_action);
674 }
675 break;
676
677 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT:
678 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
679 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION:
680 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS:
681 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT:
682 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
683 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
684 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
685
686 g_signal_stop_emission_by_name (toggle_action, "activate");
687
688 if (pk_action != NULL) {
689 toggle_action->priv->am_authenticating = TRUE;
690
691 g_object_set (
692 toggle_action,
693 "visible", toggle_action->priv->auth_underway_visible &&
694 polkit_gnome_action_get_visible (POLKIT_GNOME_ACTION (toggle_action)),
695 "sensitive", toggle_action->priv->auth_underway_sensitive &&
696 polkit_gnome_action_get_sensitive (POLKIT_GNOME_ACTION (toggle_action)),
697 "short-label", toggle_action->priv->auth_underway_short_label,
698 "label", toggle_action->priv->auth_underway_label,
699 "tooltip", toggle_action->priv->auth_underway_tooltip,
700 "icon-name", toggle_action->priv->auth_underway_icon_name,
701 NULL);
702
703 g_signal_emit_by_name (toggle_action, "auth-start", 0);
704 }
705 break;
706
707 default:
708 case POLKIT_RESULT_NO:
709 if (pk_action != NULL && authdb != NULL) {
710 if (polkit_authorization_db_is_uid_blocked_by_self (authdb,
711 pk_action,
712 getuid (),
713 NULL)) {
714 int num_auths_revoked;
715
716 /* block granted by self.. revoke it then.. */
717 pk_error = NULL;
718 num_auths_revoked = 0;
719 polkit_authorization_db_foreach_for_action_for_uid (authdb,
720 pk_action,
721 getuid (),
722 _auth_foreach_revoke,
723 &num_auths_revoked,
724 &pk_error);
725 if (pk_error != NULL) {
726 g_warning ("Error removing authorizations: code=%d: %s",
727 polkit_error_get_error_code (pk_error),
728 polkit_error_get_error_message (pk_error));
729 polkit_error_free (pk_error);
730 }
731
732 if (pk_error == NULL && num_auths_revoked > 0) {
733 PolKitResult pk_result_new;
734
735 /* we managed to revoke something... so with this change the
736 * result should now change to AUTH_*... so go ahead and just
737 * reevaluate the result... also remember to avoid granting
738 * another negative auth!
739 */
740
741 polkit_context_force_reload (pkgc->pk_context);
742 pk_result_new = polkit_gnome_action_get_polkit_result (POLKIT_GNOME_ACTION (toggle_action));
743 if (pk_result_new != pk_result) {
744 pk_result = pk_result_new;
745 do_not_grant_negative = TRUE;
746 goto reevaluate;
747 }
748
749 }
750
751 }
752 }
753
754 /* If PolicyKit says no... and we got here.. it means
755 * that the user set the property "no-sensitive" to
756 * TRUE.. Otherwise we couldn't be handling this signal.
757 *
758 * Hence, they probably have a good reason for doing
759 * this so do let the 'activate' signal propagate..
760 */
761 break;
762 }
763
764 _set_proxy_state (toggle_action);
765
766 if (pk_action != NULL)
767 polkit_action_unref (pk_action);
768 }
769
770 static void
771 polkit_gnome_toggle_action_real_toggled (PolKitGnomeToggleAction *action)
772 {
773 GSList *i;
774
775 g_return_if_fail (POLKIT_GNOME_IS_TOGGLE_ACTION (action));
776
777 for (i = gtk_action_get_proxies (GTK_ACTION (action)); i; i = i->next) {
778 GtkWidget *proxy = i->data;
779
780 gtk_action_block_activate_from (GTK_ACTION (action), proxy);
781 if (GTK_IS_CHECK_MENU_ITEM (proxy))
782 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (proxy),
783 action->priv->active);
784 else if (GTK_IS_TOGGLE_TOOL_BUTTON (proxy))
785 gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (proxy),
786 action->priv->active);
787 else if (GTK_IS_TOGGLE_BUTTON (proxy))
788 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (proxy),
789 action->priv->active);
790 else {
791 g_warning ("Don't know how to toggle `%s' widgets",
792 G_OBJECT_TYPE_NAME (proxy));
793 }
794 gtk_action_unblock_activate_from (GTK_ACTION (action), proxy);
795 }
796 }
797
798 static void
799 connect_proxy (GtkAction *action, GtkWidget *proxy)
800 {
801 PolKitGnomeToggleAction *toggle_action;
802
803 toggle_action = POLKIT_GNOME_TOGGLE_ACTION (action);
804
805 /* do this before hand, so that we don't call the "activate" handler */
806 if (GTK_IS_CHECK_MENU_ITEM (proxy))
807 gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (proxy),
808 toggle_action->priv->active);
809 else if (GTK_IS_TOGGLE_TOOL_BUTTON (proxy))
810 gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (proxy),
811 toggle_action->priv->active);
812 else if (GTK_IS_TOGGLE_BUTTON (proxy))
813 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (proxy),
814 toggle_action->priv->active);
815
816 (* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy);
817 }
818
819 static void
820 disconnect_proxy (GtkAction *action, GtkWidget *proxy)
821 {
822 (* GTK_ACTION_CLASS (parent_class)->disconnect_proxy) (action, proxy);
823 }
824
825 static void
826 _update_tooltips (PolKitGnomeToggleAction *action, GParamSpec *arg1, GtkWidget *widget)
827 {
828 GtkTooltips *tips;
829 GtkTooltipsData *ttd;
830 gchar *tip_str;
831
832 ttd = gtk_tooltips_data_get (widget);
833
834 if (ttd == NULL) {
835 tips = gtk_tooltips_new ();
836 } else {
837 tips = ttd->tooltips;
838 }
839
840 tip_str = NULL;
841 g_object_get (action, "tooltip", &tip_str, NULL);
842
843 /* TODO: if there is no tooltip the tip_str is NULL.
844 * Unfortunately it seems that the tooltip isn't
845 * cleared.. mmm.. gtk+ bug?
846 */
847 gtk_tooltips_set_tip (tips, widget, tip_str, tip_str);
848 g_free (tip_str);
849 }
850
851 static void
852 _update_label (PolKitGnomeToggleAction *action, GParamSpec *arg1, GtkWidget *widget)
853 {
854 char *label;
855
856 label = NULL;
857 g_object_get (action, "label", &label, NULL);
858 gtk_button_set_label (GTK_BUTTON (widget), label);
859 g_free (label);
860 }
861
862 static void
863 _update_icon_name (PolKitGnomeToggleAction *action, GParamSpec *arg1, GtkWidget *widget)
864 {
865 gtk_button_set_image (GTK_BUTTON (widget), gtk_action_create_icon (GTK_ACTION (action), GTK_ICON_SIZE_BUTTON));
866 }
867
868 static void
869 _button_toggled (GtkToggleButton *button, PolKitGnomeToggleAction *action)
870 {
871 /* g_debug ("in _button_toggled"); */
872
873 switch (polkit_gnome_action_get_polkit_result (POLKIT_GNOME_ACTION (action))) {
874 case POLKIT_RESULT_YES:
875 break;
876
877 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT:
878 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
879 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION:
880 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS:
881 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT:
882 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
883 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
884 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
885 /* g_debug ("blocking toggled"); */
886 g_signal_stop_emission_by_name (button, "toggled");
887 break;
888
889 default:
890 case POLKIT_RESULT_NO:
891 break;
892 }
893 }
894
895 /**
896 * polkit_gnome_toggle_action_create_toggle_button:
897 * @action: The #PolKitGnomeToggleAction object
898 *
899 * Create a toggle button for the given action that displays the
900 * label, tooltip and icon_name corresponding to whether the state,
901 * according to PolicyKit, is no, auth or yes.
902 *
903 * Returns: A #GtkToggleButton instance connected to the action
904 */
905 GtkWidget *
906 polkit_gnome_toggle_action_create_toggle_button (PolKitGnomeToggleAction *action)
907 {
908 GtkWidget *button;
909
910 button = gtk_toggle_button_new ();
911
912 gtk_action_connect_proxy (GTK_ACTION (action), button);
913
914 _update_label (action, NULL, button);
915 _update_tooltips (action, NULL, button);
916 _update_icon_name (action, NULL, button);
917
918 g_signal_connect (action, "notify::tooltip", G_CALLBACK (_update_tooltips), button);
919 g_signal_connect (action, "notify::label", G_CALLBACK (_update_label), button);
920 g_signal_connect (action, "notify::icon-name", G_CALLBACK (_update_icon_name), button);
921
922 /* hook into the ::toggled signal and block it unless
923 * PolicyKit says it's good to go.
924 */
925 g_signal_connect (button, "toggled", G_CALLBACK (_button_toggled), action);
926
927 return button;
928 }
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
1 /***************************************************************************
2 *
3 * polkit-gnome-action.h :
4 *
5 * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public License
9 * as published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 *
22 **************************************************************************/
23
24 #if !defined (POLKIT_GNOME_COMPILATION) && !defined(_POLKIT_GNOME_INSIDE_POLKIT_GNOME_H)
25 #error "Only <polkit-gnome/polkit-gnome.h> can be included directly, this file may disappear or change contents."
26 #endif
27
28 #ifndef __POLKIT_GNOME_TOGGLE_ACTION_H__
29 #define __POLKIT_GNOME_TOGGLE_ACTION_H__
30
31 #include <gtk/gtk.h>
32 #include <polkit/polkit.h>
33 #include <polkit-gnome/polkit-gnome.h>
34
35 G_BEGIN_DECLS
36
37 #define POLKIT_GNOME_TYPE_TOGGLE_ACTION (polkit_gnome_toggle_action_get_type ())
38 #define POLKIT_GNOME_TOGGLE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POLKIT_GNOME_TYPE_TOGGLE_ACTION, PolKitGnomeToggleAction))
39 #define POLKIT_GNOME_TOGGLE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), POLKIT_GNOME_TYPE_TOGGLE_ACTION, PolKitGnomeToggleActionClass))
40 #define POLKIT_GNOME_IS_TOGGLE_ACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POLKIT_GNOME_TYPE_TOGGLE_ACTION))
41 #define POLKIT_GNOME_IS_TOGGLE_ACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), POLKIT_GNOME_TYPE_TOGGLE_ACTION))
42 #define POLKIT_GNOME_TOGGLE_ACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), POLKIT_GNOME_TYPE_TOGGLE_ACTION, PolKitGnomeToggleActionClass))
43
44 typedef struct _PolKitGnomeToggleAction PolKitGnomeToggleAction;
45 typedef struct _PolKitGnomeToggleActionPrivate PolKitGnomeToggleActionPrivate;
46 typedef struct _PolKitGnomeToggleActionClass PolKitGnomeToggleActionClass;
47
48 /**
49 * PolKitGnomeToggleAction:
50 *
51 * The PolKitGnomeToggleAction struct contains only private data members and should not be accessed directly.
52 */
53 struct _PolKitGnomeToggleAction
54 {
55 /*< private >*/
56 PolKitGnomeAction parent;
57 PolKitGnomeToggleActionPrivate *priv;
58 };
59
60 struct _PolKitGnomeToggleActionClass
61 {
62 PolKitGnomeActionClass parent_class;
63
64 void (* toggled) (PolKitGnomeToggleAction *toggle_action);
65
66 /* Padding for future expansion */
67 void (*_reserved1) (void);
68 void (*_reserved2) (void);
69 void (*_reserved3) (void);
70 void (*_reserved4) (void);
71 };
72
73 GType polkit_gnome_toggle_action_get_type (void) G_GNUC_CONST;
74 PolKitGnomeToggleAction *polkit_gnome_toggle_action_new (const gchar *name);
75 PolKitGnomeToggleAction *polkit_gnome_toggle_action_new_default (const gchar *name,
76 PolKitAction *polkit_action,
77 const gchar *locked_label,
78 const gchar *unlocked_label);
79
80 GtkWidget *polkit_gnome_toggle_action_create_toggle_button (PolKitGnomeToggleAction *action);
81
82 G_END_DECLS
83
84 #endif /* __POLKIT_GNOME_TOGGLE_ACTION_H__ */
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
1 /***************************************************************************
2 *
3 * polkit-gnome.h : PolicyKit add-on library to make it easy to use
4 * PolicyKit from GNOME and GTK+ applications.
5 *
6 * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 * 02111-1307, USA.
22 *
23 **************************************************************************/
24
25 #ifndef __POLKIT_GNOME_H
26 #define __POLKIT_GNOME_H
27
28 #define _POLKIT_GNOME_INSIDE_POLKIT_GNOME_H 1
29 #include <polkit-gnome/polkit-gnome-context.h>
30 #include <polkit-gnome/polkit-gnome-action.h>
31 #include <polkit-gnome/polkit-gnome-toggle-action.h>
32 #include <polkit-gnome/polkit-gnome-auth.h>
33 #undef _POLKIT_GNOME_INSIDE_POLKIT_GNOME_H
34
35
36 #endif /* __POLKIT_GNOME_H */
2121 $(AM_CPPFLAGS)
2222
2323 polkit_gnome_manager_CFLAGS = \
24 $(POLKIT_GNOME_CFLAGS) \
24 $(GTK_CFLAGS) \
25 $(SEXY_CFLAGS) \
26 $(GNOME_VFS_CFLAGS) \
27 $(DBUS_GLIB_CFLAGS) \
28 $(POLKIT_DBUS_CFLAGS) \
29 $(POLKIT_GRANT_CFLAGS) \
2530 $(WARN_CFLAGS) \
2631 $(AM_CFLAGS)
2732
2934 $(AM_LDFLAGS)
3035
3136 polkit_gnome_manager_LDADD = \
32 $(POLKIT_GNOME_LIBS) \
37 $(GTK_LIBS) \
38 $(SEXY_LIBS) \
39 $(GNOME_VFS_LIBS) \
40 $(DBUS_GLIB_LIBS) \
41 $(POLKIT_DBUS_LIBS) \
42 $(POLKIT_GRANT_LIBS) \
3343 $(INTLLIBS)
3444
3545 CLEANFILES = $(BUILT_SOURCES)
5252 polkit_gnome_manager_OBJECTS = $(am_polkit_gnome_manager_OBJECTS)
5353 am__DEPENDENCIES_1 =
5454 polkit_gnome_manager_DEPENDENCIES = $(am__DEPENDENCIES_1) \
55 $(am__DEPENDENCIES_1)
55 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
56 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
57 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
5658 polkit_gnome_manager_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
5759 $(LIBTOOLFLAGS) --mode=link $(CCLD) \
5860 $(polkit_gnome_manager_CFLAGS) $(CFLAGS) \
100102 CXXFLAGS = @CXXFLAGS@
101103 CYGPATH_W = @CYGPATH_W@
102104 DATADIRNAME = @DATADIRNAME@
105 DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
106 DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
103107 DEFS = @DEFS@
104108 DEPDIR = @DEPDIR@
105109 DISABLE_DEPRECATED = @DISABLE_DEPRECATED@
115119 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
116120 GMOFILES = @GMOFILES@
117121 GMSGFMT = @GMSGFMT@
122 GNOME_VFS_CFLAGS = @GNOME_VFS_CFLAGS@
123 GNOME_VFS_LIBS = @GNOME_VFS_LIBS@
118124 GREP = @GREP@
125 GTKDOC_CHECK = @GTKDOC_CHECK@
126 GTK_CFLAGS = @GTK_CFLAGS@
127 GTK_LIBS = @GTK_LIBS@
119128 HELP_DIR = @HELP_DIR@
129 HTML_DIR = @HTML_DIR@
120130 INSTALL = @INSTALL@
121131 INSTALL_DATA = @INSTALL_DATA@
122132 INSTALL_PROGRAM = @INSTALL_PROGRAM@
153163 LIBTOOL = @LIBTOOL@
154164 LN_S = @LN_S@
155165 LTLIBOBJS = @LTLIBOBJS@
166 LT_AGE = @LT_AGE@
167 LT_CURRENT = @LT_CURRENT@
168 LT_REVISION = @LT_REVISION@
156169 MAINT = @MAINT@
157170 MAKEINFO = @MAKEINFO@
158171 MKDIR_P = @MKDIR_P@
170183 PATH_SEPARATOR = @PATH_SEPARATOR@
171184 PKG_CONFIG = @PKG_CONFIG@
172185 POFILES = @POFILES@
173 POLKIT_GNOME_CFLAGS = @POLKIT_GNOME_CFLAGS@
174 POLKIT_GNOME_LIBS = @POLKIT_GNOME_LIBS@
186 POLKIT_DBUS_CFLAGS = @POLKIT_DBUS_CFLAGS@
187 POLKIT_DBUS_LIBS = @POLKIT_DBUS_LIBS@
188 POLKIT_GRANT_CFLAGS = @POLKIT_GRANT_CFLAGS@
189 POLKIT_GRANT_LIBS = @POLKIT_GRANT_LIBS@
175190 POLKIT_POLICY_FILE_VALIDATE = @POLKIT_POLICY_FILE_VALIDATE@
176191 POSUB = @POSUB@
177192 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
179194 RANLIB = @RANLIB@
180195 SED = @SED@
181196 SET_MAKE = @SET_MAKE@
197 SEXY_CFLAGS = @SEXY_CFLAGS@
198 SEXY_LIBS = @SEXY_LIBS@
182199 SHELL = @SHELL@
183200 STRIP = @STRIP@
184201 USE_NLS = @USE_NLS@
254271 $(AM_CPPFLAGS)
255272
256273 polkit_gnome_manager_CFLAGS = \
257 $(POLKIT_GNOME_CFLAGS) \
274 $(GTK_CFLAGS) \
275 $(SEXY_CFLAGS) \
276 $(GNOME_VFS_CFLAGS) \
277 $(DBUS_GLIB_CFLAGS) \
278 $(POLKIT_DBUS_CFLAGS) \
279 $(POLKIT_GRANT_CFLAGS) \
258280 $(WARN_CFLAGS) \
259281 $(AM_CFLAGS)
260282
262284 $(AM_LDFLAGS)
263285
264286 polkit_gnome_manager_LDADD = \
265 $(POLKIT_GNOME_LIBS) \
287 $(GTK_LIBS) \
288 $(SEXY_LIBS) \
289 $(GNOME_VFS_LIBS) \
290 $(DBUS_GLIB_LIBS) \
291 $(POLKIT_DBUS_LIBS) \
292 $(POLKIT_GRANT_LIBS) \
266293 $(INTLLIBS)
267294
268295 CLEANFILES = $(BUILT_SOURCES)
4343
4444 #include "polkit-gnome-manager.h"
4545
46 #define POLKIT_GNOME_DBUS_NAME "org.gnome.PolicyKit"
47
4846 static DBusGProxy *
4947 get_bus_proxy (DBusGConnection *connection)
5048 {
5856 }
5957
6058 static gboolean
61 acquire_name_on_proxy (DBusGProxy *bus_proxy)
59 acquire_name_on_proxy (DBusGProxy *bus_proxy, const char *name)
6260 {
6361 GError *error;
6462 guint result;
7573 res = dbus_g_proxy_call (bus_proxy,
7674 "RequestName",
7775 &error,
78 G_TYPE_STRING, POLKIT_GNOME_DBUS_NAME,
76 G_TYPE_STRING, name,
7977 G_TYPE_UINT, 0,
8078 G_TYPE_INVALID,
8179 G_TYPE_UINT, &result,
8280 G_TYPE_INVALID);
8381 if (! res) {
8482 if (error != NULL) {
85 g_warning ("Failed to acquire %s: %s", POLKIT_GNOME_DBUS_NAME, error->message);
83 g_warning ("Failed to acquire %s: %s", name, error->message);
8684 g_error_free (error);
8785 } else {
88 g_warning ("Failed to acquire %s", POLKIT_GNOME_DBUS_NAME);
86 g_warning ("Failed to acquire %s", name);
8987 }
9088 goto out;
9189 }
9290
9391 if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
9492 if (error != NULL) {
95 g_warning ("Failed to acquire %s: %s", POLKIT_GNOME_DBUS_NAME, error->message);
93 g_warning ("Failed to acquire %s: %s", name, error->message);
9694 g_error_free (error);
9795 } else {
98 g_warning ("Failed to acquire %s", POLKIT_GNOME_DBUS_NAME);
96 g_warning ("Failed to acquire %s", name);
9997 }
10098 goto out;
10199 }
143141
144142 ret = 1;
145143
146 if (! g_thread_supported ()) {
147 g_thread_init (NULL);
148 }
149 dbus_g_thread_init ();
150144 g_type_init ();
151145 gtk_init (&argc, &argv);
152146
166160 goto out;
167161 }
168162
169 if (!acquire_name_on_proxy (bus_proxy) ) {
163 if (!acquire_name_on_proxy (bus_proxy, "org.gnome.PolicyKit") ) {
164 g_warning ("Could not acquire name; bailing out");
165 goto out;
166 }
167
168 if (!acquire_name_on_proxy (bus_proxy, "org.freedesktop.PolicyKit.AuthenticationAgent") ) {
170169 g_warning ("Could not acquire name; bailing out");
171170 goto out;
172171 }
3131 #include <stdlib.h>
3232 #include <pwd.h>
3333 #include <errno.h>
34 #include <libsexy/sexy.h>
35 #include <libgnomevfs/gnome-vfs-utils.h>
3436
3537 #include <glib/gi18n-lib.h>
3638 #include <gtk/gtk.h>
39 #include <dbus/dbus-glib.h>
40 #include <dbus/dbus-glib-lowlevel.h>
3741
3842 #include "polkit-gnome-auth-dialog.h"
3943
4650 GtkWidget *user_combobox;
4751 GtkWidget *app_desc_label;
4852 GtkWidget *privilege_desc_label;
53 GtkWidget *privilege_vendor_label;
4954 GtkWidget *prompt_label;
5055 GtkWidget *password_entry;
56 GtkWidget *icon;
5157 char *message;
58
59 char *vendor;
60 char *vendor_url;
5261
5362 gboolean can_do_always;
5463 gboolean can_do_session;
6978 PROP_0,
7079 PROP_PROGRAM,
7180 PROP_ACTION_ID,
81 PROP_VENDOR,
82 PROP_VENDOR_URL,
83 PROP_ICON_NAME,
7284 PROP_MESSAGE,
7385 };
7486
194206 }
195207
196208 /* Real name */
197 if (passwd->pw_gecos != NULL)
209 if (passwd->pw_gecos != NULL && strlen (passwd->pw_gecos) > 0)
198210 real_name = g_strdup_printf (_("%s (%s)"), passwd->pw_gecos, admin_users[n]);
199211 else
200212 real_name = g_strdup (admin_users[n]);
326338 polkit_gnome_auth_dialog_set_action_id (PolkitGnomeAuthDialog *auth_dialog, const char *action_id)
327339 {
328340 char *str;
329 str = g_strdup_printf ("<small>%s</small>", action_id);
330 gtk_label_set_markup (GTK_LABEL (auth_dialog->priv->privilege_desc_label), str);
341 str = g_strdup_printf ("<small><a href=\"%s\">%s</a></small>",
342 action_id,
343 action_id);
344 sexy_url_label_set_markup (SEXY_URL_LABEL (auth_dialog->priv->privilege_desc_label), str);
331345 g_free (str);
346
347 str = g_strdup_printf (_("Click to edit %s"), action_id);
348 gtk_widget_set_tooltip_markup (auth_dialog->priv->privilege_desc_label, str);
349 g_free (str);
350 }
351
352 static void
353 update_vendor (PolkitGnomeAuthDialog *auth_dialog)
354 {
355 char *str;
356
357 if (auth_dialog->priv->vendor == NULL)
358 return;
359
360 if (auth_dialog->priv->vendor_url == NULL) {
361 str = g_strdup_printf ("<small>%s</small>", auth_dialog->priv->vendor);
362 gtk_widget_set_tooltip_markup (auth_dialog->priv->privilege_vendor_label, NULL);
363 } else {
364 char *s2;
365
366 str = g_strdup_printf ("<small><a href=\"%s\">%s</a></small>",
367 auth_dialog->priv->vendor_url,
368 auth_dialog->priv->vendor);
369
370 s2 = g_strdup_printf (_("Click to open %s"), auth_dialog->priv->vendor_url);
371 gtk_widget_set_tooltip_markup (auth_dialog->priv->privilege_vendor_label, s2);
372 g_free (s2);
373 }
374 sexy_url_label_set_markup (SEXY_URL_LABEL (auth_dialog->priv->privilege_vendor_label), str);
375 g_free (str);
376 }
377
378 static void
379 polkit_gnome_auth_dialog_set_icon_name (PolkitGnomeAuthDialog *auth_dialog, const char *icon_name)
380 {
381 GdkPixbuf *pixbuf;
382 GdkPixbuf *vendor_pixbuf;
383
384 pixbuf = NULL;
385 vendor_pixbuf = NULL;
386
387 vendor_pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
388 icon_name,
389 48,
390 0,
391 NULL);
392 if (vendor_pixbuf == NULL)
393 goto out;
394
395 pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
396 GTK_STOCK_DIALOG_AUTHENTICATION,
397 48,
398 0,
399 NULL);
400 if (pixbuf == NULL)
401 goto out;
402
403 /* blend the vendor icon in the bottom right quarter */
404 gdk_pixbuf_composite (vendor_pixbuf,
405 pixbuf,
406 24, 24, 24, 24,
407 24, 24, 0.5, 0.5,
408 GDK_INTERP_BILINEAR,
409 255);
410
411 gtk_image_set_from_pixbuf (GTK_IMAGE (auth_dialog->priv->icon),
412 pixbuf);
413
414 out:
415
416 if (pixbuf != NULL)
417 g_object_unref (pixbuf);
418 if (vendor_pixbuf != NULL)
419 g_object_unref (vendor_pixbuf);
332420 }
333421
334422 static void
367455
368456 case PROP_ACTION_ID:
369457 polkit_gnome_auth_dialog_set_action_id (auth_dialog, g_value_get_string (value));
458 break;
459
460 case PROP_VENDOR:
461 g_free (auth_dialog->priv->vendor);
462 auth_dialog->priv->vendor = g_strdup (g_value_get_string (value));
463 update_vendor (auth_dialog);
464 break;
465
466 case PROP_VENDOR_URL:
467 g_free (auth_dialog->priv->vendor_url);
468 auth_dialog->priv->vendor_url = g_strdup (g_value_get_string (value));
469 update_vendor (auth_dialog);
470 break;
471
472 case PROP_ICON_NAME:
473 polkit_gnome_auth_dialog_set_icon_name (auth_dialog, g_value_get_string (value));
370474 break;
371475
372476 case PROP_MESSAGE:
434538 }
435539
436540 static void
541 vendor_url_activated (SexyUrlLabel *url_label, char *url, gpointer user_data)
542 {
543 if (url != NULL) {
544 gnome_vfs_url_show (url);
545 }
546 }
547
548 static void
549 action_id_activated (SexyUrlLabel *url_label, char *url, gpointer user_data)
550 {
551 GError *error;
552 DBusGConnection *bus;
553 DBusGProxy *manager_proxy;
554
555 error = NULL;
556 bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
557 if (bus == NULL) {
558 g_warning ("Couldn't connect to session bus: %s", error->message);
559 g_error_free (error);
560 goto out;
561 }
562
563 manager_proxy = dbus_g_proxy_new_for_name (bus,
564 "org.gnome.PolicyKit.AuthorizationManager",
565 "/",
566 "org.gnome.PolicyKit.AuthorizationManager.SingleInstance");
567 if (manager_proxy == NULL) {
568 g_warning ("Could not construct manager_proxy object; bailing out");
569 goto out;
570 }
571
572 if (!dbus_g_proxy_call (manager_proxy,
573 "ShowAction",
574 &error,
575 G_TYPE_STRING, url,
576 G_TYPE_INVALID,
577 G_TYPE_INVALID)) {
578 if (error != NULL) {
579 g_warning ("Failed to call into manager: %s", error->message);
580 g_error_free (error);
581 } else {
582 g_warning ("Failed to call into manager");
583 }
584 goto out;
585 }
586 out:
587 ;
588 }
589
590 static void
437591 polkit_gnome_auth_dialog_init (PolkitGnomeAuthDialog *auth_dialog)
438592 {
439593 GtkDialog *dialog = GTK_DIALOG (auth_dialog);
453607 gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
454608 gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_DIALOG_AUTHENTICATION);
455609
456 GtkWidget *hbox, *main_vbox, *vbox, *icon;
610 GtkWidget *hbox, *main_vbox, *vbox;
457611
458612 hbox = gtk_hbox_new (FALSE, 12);
459613 gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
460614 gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, TRUE, TRUE, 0);
461615
462 icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_DIALOG);
463 gtk_misc_set_alignment (GTK_MISC (icon), 0.5, 0.0);
464 gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
616 priv->icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_DIALOG);
617 gtk_misc_set_alignment (GTK_MISC (priv->icon), 0.5, 0.0);
618 gtk_box_pack_start (GTK_BOX (hbox), priv->icon, FALSE, FALSE, 0);
465619
466620 main_vbox = gtk_vbox_new (FALSE, 10);
467621 gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0);
544698 //GtkWidget *table;
545699 table_alignment = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
546700 gtk_box_pack_start (GTK_BOX (details_vbox), table_alignment, FALSE, FALSE, 0);
547 table = gtk_table_new (1, 2, FALSE);
701 table = gtk_table_new (1, 3, FALSE);
548702 gtk_table_set_col_spacings (GTK_TABLE (table), 12);
549703 gtk_table_set_row_spacings (GTK_TABLE (table), 6);
550704 gtk_container_add (GTK_CONTAINER (table_alignment), table);
554708 gtk_misc_set_alignment (GTK_MISC (priv->app_desc_label), 0, 1.0);
555709 add_row (table, 0, _("<small><b>Application:</b></small>"), priv->app_desc_label);
556710
557 priv->privilege_desc_label = gtk_label_new (NULL);
711 priv->privilege_desc_label = sexy_url_label_new ();
558712 gtk_misc_set_alignment (GTK_MISC (priv->privilege_desc_label), 0, 1.0);
559713 add_row (table, 1, _("<small><b>Action:</b></small>"), priv->privilege_desc_label);
714 g_signal_connect (priv->privilege_desc_label, "url-activated", (GCallback) action_id_activated, NULL);
715
716 priv->privilege_vendor_label = sexy_url_label_new ();
717 gtk_misc_set_alignment (GTK_MISC (priv->privilege_vendor_label), 0, 1.0);
718 add_row (table, 2, _("<small><b>Vendor:</b></small>"), priv->privilege_vendor_label);
719 g_signal_connect (priv->privilege_vendor_label, "url-activated", (GCallback) vendor_url_activated, NULL);
560720 }
561721
562722 static void
599759 "action-id",
600760 NULL,
601761 G_PARAM_READWRITE | PARAM_STATIC));
762
763 g_object_class_install_property
764 (gobject_class,
765 PROP_VENDOR,
766 g_param_spec_string ("vendor",
767 "vendor",
768 "vendor",
769 NULL,
770 G_PARAM_READWRITE | PARAM_STATIC));
771
772 g_object_class_install_property
773 (gobject_class,
774 PROP_VENDOR_URL,
775 g_param_spec_string ("vendor-url",
776 "vendor-url",
777 "vendor-url",
778 NULL,
779 G_PARAM_READWRITE | PARAM_STATIC));
780
781 g_object_class_install_property
782 (gobject_class,
783 PROP_ICON_NAME,
784 g_param_spec_string ("icon-name",
785 "icon-name",
786 "icon-name",
787 NULL,
788 G_PARAM_READWRITE | PARAM_STATIC));
789
602790
603791 g_object_class_install_property
604792 (gobject_class,
633821 GtkWidget *
634822 polkit_gnome_auth_dialog_new (const char *path_to_program,
635823 const char *action_id,
824 const char *vendor,
825 const char *vendor_url,
826 const char *icon_name,
636827 const char *message_markup)
637828 {
638829 PolkitGnomeAuthDialog *auth_dialog;
641832 auth_dialog = g_object_new (POLKIT_GNOME_TYPE_AUTH_DIALOG,
642833 "program", path_to_program,
643834 "action-id", action_id,
835 "vendor", vendor,
836 "vendor-url", vendor_url,
837 "icon-name", icon_name,
644838 "message", message_markup,
645839 NULL);
646840
5252 GtkType polkit_gnome_auth_dialog_get_type (void);
5353 GtkWidget *polkit_gnome_auth_dialog_new (const char *path_to_program,
5454 const char *action_id,
55 const char *vendor,
56 const char *vendor_url,
57 const char *icon_name,
5558 const char *message_markup);
5659
5760 void polkit_gnome_auth_dialog_set_prompt (PolkitGnomeAuthDialog *auth_dialog,
5252 #endif /* !G_ENABLE_DEBUG */
5353
5454
55 /* NONE:STRING,UINT,POINTER (/tmp/dbus-binding-tool-c-marshallers.JI9WYT:1) */
55 /* NONE:STRING,UINT,POINTER (/tmp/dbus-binding-tool-c-marshallers.ZSM72T:1) */
5656 extern void dbus_glib_marshal_polkit_gnome_manager_VOID__STRING_UINT_POINTER (GClosure *closure,
5757 GValue *return_value,
5858 guint n_param_values,
6161 gpointer marshal_data);
6262 void
6363 dbus_glib_marshal_polkit_gnome_manager_VOID__STRING_UINT_POINTER (GClosure *closure,
64 GValue *return_value,
64 GValue *return_value G_GNUC_UNUSED,
6565 guint n_param_values,
6666 const GValue *param_values,
67 gpointer invocation_hint,
67 gpointer invocation_hint G_GNUC_UNUSED,
6868 gpointer marshal_data)
6969 {
7070 typedef void (*GMarshalFunc_VOID__STRING_UINT_POINTER) (gpointer data1,
9898 }
9999 #define dbus_glib_marshal_polkit_gnome_manager_NONE__STRING_UINT_POINTER dbus_glib_marshal_polkit_gnome_manager_VOID__STRING_UINT_POINTER
100100
101 /* NONE:STRING,UINT,UINT,POINTER (/tmp/dbus-binding-tool-c-marshallers.ZSM72T:2) */
102 extern void dbus_glib_marshal_polkit_gnome_manager_VOID__STRING_UINT_UINT_POINTER (GClosure *closure,
103 GValue *return_value,
104 guint n_param_values,
105 const GValue *param_values,
106 gpointer invocation_hint,
107 gpointer marshal_data);
108 void
109 dbus_glib_marshal_polkit_gnome_manager_VOID__STRING_UINT_UINT_POINTER (GClosure *closure,
110 GValue *return_value G_GNUC_UNUSED,
111 guint n_param_values,
112 const GValue *param_values,
113 gpointer invocation_hint G_GNUC_UNUSED,
114 gpointer marshal_data)
115 {
116 typedef void (*GMarshalFunc_VOID__STRING_UINT_UINT_POINTER) (gpointer data1,
117 gpointer arg_1,
118 guint arg_2,
119 guint arg_3,
120 gpointer arg_4,
121 gpointer data2);
122 register GMarshalFunc_VOID__STRING_UINT_UINT_POINTER callback;
123 register GCClosure *cc = (GCClosure*) closure;
124 register gpointer data1, data2;
125
126 g_return_if_fail (n_param_values == 5);
127
128 if (G_CCLOSURE_SWAP_DATA (closure))
129 {
130 data1 = closure->data;
131 data2 = g_value_peek_pointer (param_values + 0);
132 }
133 else
134 {
135 data1 = g_value_peek_pointer (param_values + 0);
136 data2 = closure->data;
137 }
138 callback = (GMarshalFunc_VOID__STRING_UINT_UINT_POINTER) (marshal_data ? marshal_data : cc->callback);
139
140 callback (data1,
141 g_marshal_value_peek_string (param_values + 1),
142 g_marshal_value_peek_uint (param_values + 2),
143 g_marshal_value_peek_uint (param_values + 3),
144 g_marshal_value_peek_pointer (param_values + 4),
145 data2);
146 }
147 #define dbus_glib_marshal_polkit_gnome_manager_NONE__STRING_UINT_UINT_POINTER dbus_glib_marshal_polkit_gnome_manager_VOID__STRING_UINT_UINT_POINTER
148
101149 G_END_DECLS
102150
103151 #endif /* __dbus_glib_marshal_polkit_gnome_manager_MARSHAL_H__ */
105153 #include <dbus/dbus-glib.h>
106154 static const DBusGMethodInfo dbus_glib_polkit_gnome_manager_methods[] = {
107155 { (GCallback) polkit_gnome_manager_show_dialog, dbus_glib_marshal_polkit_gnome_manager_NONE__STRING_UINT_POINTER, 0 },
156 { (GCallback) polkit_gnome_manager_obtain_authorization, dbus_glib_marshal_polkit_gnome_manager_NONE__STRING_UINT_UINT_POINTER, 93 },
108157 };
109158
110159 const DBusGObjectInfo dbus_glib_polkit_gnome_manager_object_info = {
111160 0,
112161 dbus_glib_polkit_gnome_manager_methods,
113 1,
114 "org.gnome.PolicyKit.Manager\0ShowDialog\0A\0action_id\0I\0s\0xid\0I\0u\0gained_privilege\0O\0F\0N\0b\0\0\0",
162 2,
163 "org.gnome.PolicyKit.Manager\0ShowDialog\0A\0action_id\0I\0s\0xid\0I\0u\0gained_authorization\0O\0F\0N\0b\0\0org.freedesktop.PolicyKit.AuthenticationAgent\0ObtainAuthorization\0A\0action_id\0I\0s\0xid\0I\0u\0pid\0I\0u\0gained_authorization\0O\0F\0N\0b\0\0\0",
115164 "\0",
116165 "\0"
117166 };
4545
4646 #include "polkit-gnome-auth-dialog.h"
4747
48 #define POLKIT_GNOME_MANAGER_DBUS_PATH "/org/gnome/PolicyKit/Manager"
49
5048 static void do_cancel_auth (void);
5149
5250
283281 goto error;
284282 }
285283
286 dbus_g_connection_register_g_object (manager->priv->session_bus_connection, POLKIT_GNOME_MANAGER_DBUS_PATH,
284 dbus_g_connection_register_g_object (manager->priv->session_bus_connection,
285 "/org/gnome/PolicyKit/Manager",
286 G_OBJECT (manager));
287
288 dbus_g_connection_register_g_object (manager->priv->session_bus_connection,
289 "/",
287290 G_OBJECT (manager));
288291
289292 manager->priv->session_bus_proxy = dbus_g_proxy_new_for_name (manager->priv->session_bus_connection,
378381 PolKitGnomeManager *manager;
379382 char *action_id;
380383 guint32 xid;
384 pid_t pid;
381385 DBusGMethodInvocation *context;
382386 } WorkClosure;
383387
406410
407411 sender = dbus_g_method_get_sender (wc->context);
408412
409 error = NULL;
410 if (! dbus_g_proxy_call (wc->manager->priv->session_bus_proxy, "GetConnectionUnixProcessID", &error,
411 G_TYPE_STRING, sender,
412 G_TYPE_INVALID,
413 G_TYPE_UINT, &caller_pid,
414 G_TYPE_INVALID)) {
415 g_debug ("GetConnectionUnixProcessID() failed: %s", error->message);
416 g_error_free (error);
417
418 error = g_error_new (POLKIT_GNOME_MANAGER_ERROR,
419 POLKIT_GNOME_MANAGER_ERROR_GENERAL,
420 "Unable to lookup process ID for caller");
421 dbus_g_method_return_error (wc->context, error);
422 g_error_free (error);
423 goto out;
413 if (wc->pid == -1) {
414 error = NULL;
415 if (! dbus_g_proxy_call (wc->manager->priv->session_bus_proxy, "GetConnectionUnixProcessID", &error,
416 G_TYPE_STRING, sender,
417 G_TYPE_INVALID,
418 G_TYPE_UINT, &caller_pid,
419 G_TYPE_INVALID)) {
420 g_debug ("GetConnectionUnixProcessID() failed: %s", error->message);
421 g_error_free (error);
422
423 error = g_error_new (POLKIT_GNOME_MANAGER_ERROR,
424 POLKIT_GNOME_MANAGER_ERROR_GENERAL,
425 "Unable to lookup process ID for caller");
426 dbus_g_method_return_error (wc->context, error);
427 g_error_free (error);
428 goto out;
429 }
430 } else {
431 caller_pid = wc->pid;
424432 }
425433
426434 g_debug ("process id = %d", caller_pid);
427435
428436 caller_exe = get_exe_for_pid (caller_pid);
429437 if (caller_exe == NULL) {
438 caller_exe = g_strdup ("(unknown)");
439 #if 0
430440 error = g_error_new (POLKIT_GNOME_MANAGER_ERROR,
431441 POLKIT_GNOME_MANAGER_ERROR_GENERAL,
432442 "Unable to lookup exe for caller");
433443 dbus_g_method_return_error (wc->context, error);
434444 g_error_free (error);
435445 goto out;
446 #endif
436447 }
437448
438449 g_debug ("exe = '%s'", caller_exe);
463474
464475 /* exported methods */
465476
477
478 gboolean
479 polkit_gnome_manager_obtain_authorization (PolKitGnomeManager *manager,
480 const char *action_id,
481 guint32 xid,
482 guint32 pid,
483 DBusGMethodInvocation *context)
484 {
485 WorkClosure *wc;
486
487 wc = g_new0 (WorkClosure, 1);
488 wc->manager = manager;
489 wc->action_id = g_strdup (action_id);
490 wc->xid = xid;
491 wc->context = context;
492 wc->pid = pid;
493
494 g_idle_add (do_auth, wc);
495 return TRUE;
496 }
497
466498 gboolean
467499 polkit_gnome_manager_show_dialog (PolKitGnomeManager *manager,
468500 const char *action_id,
469501 guint32 xid,
470502 DBusGMethodInvocation *context)
471503 {
472 WorkClosure *wc;
473
474 wc = g_new0 (WorkClosure, 1);
475 wc->manager = manager;
476 wc->action_id = g_strdup (action_id);
477 wc->xid = xid;
478 wc->context = context;
479
480 g_idle_add (do_auth, wc);
481 return TRUE;
504 return polkit_gnome_manager_obtain_authorization (manager, action_id, xid, -1, context);
482505 }
483506
484507
512535 ud->requires_admin = FALSE;
513536
514537 switch (auth_type) {
538 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT:
515539 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
516540 ud->requires_admin = TRUE;
517541 break;
526550 ud->remember_always = TRUE;
527551 break;
528552
553 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT:
529554 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
530555 break;
531556
546571 ud->remember_always,
547572 ud->requires_admin,
548573 ud->admin_users);
574 }
575
576 /*--------------------------------------------------------------------------------------------------------------*/
577
578 static void
579 _do_grab (GtkWidget *widget, GdkEvent *event, gpointer user_data)
580 {
581 GdkGrabStatus ret;
582
583 ret = gdk_pointer_grab (widget->window,
584 TRUE,
585 GDK_POINTER_MOTION_MASK|GDK_BUTTON_MOTION_MASK,
586 NULL,
587 NULL,
588 GDK_CURRENT_TIME);
589 if (ret != GDK_GRAB_SUCCESS) {
590 g_warning ("Couldn't grab the pointer; ret = %d", ret);
591 }
592
593 ret = gdk_keyboard_grab (widget->window,
594 FALSE,
595 GDK_CURRENT_TIME);
596 if (ret != GDK_GRAB_SUCCESS) {
597 g_warning ("Couldn't grab the pointer; ret = %d", ret);
598 }
599
600 g_debug ("Grabbed pointer and keyboard");
549601 }
550602
551603 /*--------------------------------------------------------------------------------------------------------------*/
692744 polkit_gnome_auth_dialog_set_prompt (POLKIT_GNOME_AUTH_DIALOG (ud->dialog), request2, echo_on);
693745 g_free (request2);
694746
695 gtk_widget_show_all (ud->dialog);
747 gtk_widget_show_all (ud->dialog);
696748
697749 response = gtk_dialog_run (GTK_DIALOG (ud->dialog));
698750
741793 UserData *ud = user_data;
742794
743795 switch (auth_type) {
796 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT:
797 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT:
798 break;
744799 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
745800 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
746801 break;
764819 g_debug ("keep_session = %d", keep_session);
765820
766821 switch (auth_type) {
822 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT:
823 overridden_auth_type = POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT;
824 break;
767825 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH:
768826 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION:
769827 case POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS:
774832 overridden_auth_type = POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS;
775833 break;
776834
835 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT:
836 overridden_auth_type = POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT;
837 break;
777838 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH:
778839 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION:
779840 case POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS:
880941 PolKitPolicyCache *pk_cache;
881942 PolKitPolicyFileEntry *pfe;
882943 const char *message_markup;
944 const char *vendor;
945 const char *vendor_url;
946 const char *icon_name;
883947
884948 ret = FALSE;
885949
922986 g_warning ("No message markup for given action");
923987 goto error;
924988 }
989
990 vendor = polkit_policy_file_entry_get_action_vendor (pfe);
991 vendor_url = polkit_policy_file_entry_get_action_vendor_url (pfe);
992 icon_name = polkit_policy_file_entry_get_action_icon_name (pfe);
925993
926994 ud->dialog = polkit_gnome_auth_dialog_new (
927995 caller_exe_name,
928996 action_id,
997 vendor,
998 vendor_url,
999 icon_name,
9291000 message_markup);
9301001
9311002 /* XID zero is used to mean "universal null resource or null atom" ... so if the
9411012 }
9421013 }
9431014
944
9451015 g_signal_connect (GTK_WIDGET (ud->dialog), "user-selected", G_CALLBACK (user_selected), ud);
1016
1017 /* grab the pointer and keyboard as soon as we are mapped */
1018 g_signal_connect(ud->dialog, "map_event", G_CALLBACK(_do_grab), ud);
9461019
9471020 num_tries = 0;
9481021 try_again:
10031076 ret = ud->gained_privilege;
10041077
10051078 error:
1079
1080 /* Ungrab keyboard and pointer */
1081 gdk_keyboard_ungrab (GDK_CURRENT_TIME);
1082 gdk_pointer_ungrab (GDK_CURRENT_TIME);
1083 g_debug ("Ungrabbed pointer and keyboard");
1084
10061085 if (ud->dialog != NULL) {
10071086 gtk_widget_destroy (ud->dialog);
10081087 ud->dialog = NULL;
6363 guint32 xid,
6464 DBusGMethodInvocation *context);
6565
66 gboolean polkit_gnome_manager_obtain_authorization (PolKitGnomeManager *manager,
67 const char *action_id,
68 guint32 xid,
69 guint32 pid,
70 DBusGMethodInvocation *context);
71
6672 G_END_DECLS
6773
6874 #endif /* POLKIT_GNOME_MANAGER_H */
0 <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
1 <node name="/org/gnome/PolicyKit/Manager">
0 <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
1 "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
2
3 <node name="/">
4
5 <!-- this interface is deprecated and will be removed in a future release -->
26 <interface name="org.gnome.PolicyKit.Manager">
37 <method name="ShowDialog">
48 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
9
10 <!-- IN: PolicyKit action identifier; see PolKitAction -->
511 <arg name="action_id" direction="in" type="s"/>
12
13 <!-- IN: X11 window ID for the top-level X11 window the dialog will be transient for. -->
614 <arg name="xid" direction="in" type="u"/>
7 <arg name="gained_privilege" direction="out" type="b"/>
15
16 <!-- OUT: whether the user gained the authorization -->
17 <arg name="gained_authorization" direction="out" type="b"/>
18
819 </method>
920 </interface>
21
22 <interface name="org.freedesktop.PolicyKit.AuthenticationAgent">
23 <method name="ObtainAuthorization">
24 <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
25
26 <!-- IN: PolicyKit action identifier; see PolKitAction -->
27 <arg name="action_id" direction="in" type="s"/>
28
29 <!-- IN: X11 window ID for the top-level X11 window the dialog will be transient for. -->
30 <arg name="xid" direction="in" type="u"/>
31
32 <!-- IN: Process ID to grant authorization to -->
33 <arg name="pid" direction="in" type="u"/>
34
35 <!-- OUT: whether the user gained the authorization -->
36 <arg name="gained_authorization" direction="out" type="b"/>
37
38 </method>
39 </interface>
40
1041 </node>
0
1 bin_PROGRAMS = polkit-gnome-authorization
2
3 polkit_gnome_authorization_SOURCES = \
4 polkit-gnome-authorization.c
5
6 polkit_gnome_authorization_CPPFLAGS = \
7 -I$(top_srcdir) \
8 -DLIBEXECDIR=\""$(libexecdir)"\" \
9 -DDATADIR=\""$(pkgdatadir)"\" \
10 -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
11 $(DISABLE_DEPRECATED) \
12 $(AM_CPPFLAGS)
13
14 polkit_gnome_authorization_CFLAGS = \
15 $(GTK_CFLAGS) \
16 $(SEXY_CFLAGS) \
17 $(GNOME_VFS_CFLAGS) \
18 $(DBUS_GLIB_CFLAGS) \
19 $(POLKIT_DBUS_CFLAGS) \
20 $(POLKIT_GRANT_CFLAGS) \
21 $(WARN_CFLAGS) \
22 $(AM_CFLAGS)
23
24 polkit_gnome_authorization_LDFLAGS = \
25 $(AM_LDFLAGS)
26
27 polkit_gnome_authorization_LDADD = \
28 $(GTK_LIBS) \
29 $(SEXY_LIBS) \
30 $(GNOME_VFS_LIBS) \
31 $(DBUS_GLIB_LIBS) \
32 $(POLKIT_DBUS_LIBS) \
33 $(POLKIT_GRANT_LIBS) \
34 $(INTLLIBS) \
35 $(top_builddir)/polkit-gnome/libpolkit-gnome.la
36
37 BUILT_SOURCES = \
38 single-instance-glue.h
39
40 single-instance-glue.h: single-instance.xml Makefile.am
41 dbus-binding-tool --prefix=single_instance --mode=glib-server --output=single-instance-glue.h $(top_srcdir)/tools/single-instance.xml
42
43 CLEANFILES = $(BUILT_SOURCES)
44
45 EXTRA_DIST = single-instance.xml
46
47 clean-local :
48 rm -f *~
0 # Makefile.in generated by automake 1.10 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 VPATH = @srcdir@
17 pkgdatadir = $(datadir)/@PACKAGE@
18 pkglibdir = $(libdir)/@PACKAGE@
19 pkgincludedir = $(includedir)/@PACKAGE@
20 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
21 install_sh_DATA = $(install_sh) -c -m 644
22 install_sh_PROGRAM = $(install_sh) -c
23 install_sh_SCRIPT = $(install_sh) -c
24 INSTALL_HEADER = $(INSTALL_DATA)
25 transform = $(program_transform_name)
26 NORMAL_INSTALL = :
27 PRE_INSTALL = :
28 POST_INSTALL = :
29 NORMAL_UNINSTALL = :
30 PRE_UNINSTALL = :
31 POST_UNINSTALL = :
32 build_triplet = @build@
33 host_triplet = @host@
34 bin_PROGRAMS = polkit-gnome-authorization$(EXEEXT)
35 subdir = tools
36 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
37 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
38 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
39 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
40 $(ACLOCAL_M4)
41 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
42 CONFIG_HEADER = $(top_builddir)/config.h
43 CONFIG_CLEAN_FILES =
44 am__installdirs = "$(DESTDIR)$(bindir)"
45 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
46 PROGRAMS = $(bin_PROGRAMS)
47 am_polkit_gnome_authorization_OBJECTS = polkit_gnome_authorization-polkit-gnome-authorization.$(OBJEXT)
48 polkit_gnome_authorization_OBJECTS = \
49 $(am_polkit_gnome_authorization_OBJECTS)
50 am__DEPENDENCIES_1 =
51 polkit_gnome_authorization_DEPENDENCIES = $(am__DEPENDENCIES_1) \
52 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
53 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
54 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
55 $(top_builddir)/polkit-gnome/libpolkit-gnome.la
56 polkit_gnome_authorization_LINK = $(LIBTOOL) --tag=CC \
57 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
58 $(polkit_gnome_authorization_CFLAGS) $(CFLAGS) \
59 $(polkit_gnome_authorization_LDFLAGS) $(LDFLAGS) -o $@
60 DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
61 depcomp = $(SHELL) $(top_srcdir)/depcomp
62 am__depfiles_maybe = depfiles
63 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
64 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
65 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
66 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
67 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
68 CCLD = $(CC)
69 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
70 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
71 $(LDFLAGS) -o $@
72 SOURCES = $(polkit_gnome_authorization_SOURCES)
73 DIST_SOURCES = $(polkit_gnome_authorization_SOURCES)
74 ETAGS = etags
75 CTAGS = ctags
76 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
77 ACLOCAL = @ACLOCAL@
78 ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
79 ALL_LINGUAS = @ALL_LINGUAS@
80 AMTAR = @AMTAR@
81 AM_CFLAGS = @AM_CFLAGS@
82 AM_CPPFLAGS = @AM_CPPFLAGS@
83 AM_CXXFLAGS = @AM_CXXFLAGS@
84 AM_LDFLAGS = @AM_LDFLAGS@
85 AR = @AR@
86 AUTOCONF = @AUTOCONF@
87 AUTOHEADER = @AUTOHEADER@
88 AUTOMAKE = @AUTOMAKE@
89 AWK = @AWK@
90 CATALOGS = @CATALOGS@
91 CATOBJEXT = @CATOBJEXT@
92 CC = @CC@
93 CCDEPMODE = @CCDEPMODE@
94 CFLAGS = @CFLAGS@
95 CPP = @CPP@
96 CPPFLAGS = @CPPFLAGS@
97 CXX = @CXX@
98 CXXCPP = @CXXCPP@
99 CXXDEPMODE = @CXXDEPMODE@
100 CXXFLAGS = @CXXFLAGS@
101 CYGPATH_W = @CYGPATH_W@
102 DATADIRNAME = @DATADIRNAME@
103 DBUS_GLIB_CFLAGS = @DBUS_GLIB_CFLAGS@
104 DBUS_GLIB_LIBS = @DBUS_GLIB_LIBS@
105 DEFS = @DEFS@
106 DEPDIR = @DEPDIR@
107 DISABLE_DEPRECATED = @DISABLE_DEPRECATED@
108 DOC_USER_FORMATS = @DOC_USER_FORMATS@
109 ECHO = @ECHO@
110 ECHO_C = @ECHO_C@
111 ECHO_N = @ECHO_N@
112 ECHO_T = @ECHO_T@
113 EGREP = @EGREP@
114 EXEEXT = @EXEEXT@
115 F77 = @F77@
116 FFLAGS = @FFLAGS@
117 GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
118 GMOFILES = @GMOFILES@
119 GMSGFMT = @GMSGFMT@
120 GNOME_VFS_CFLAGS = @GNOME_VFS_CFLAGS@
121 GNOME_VFS_LIBS = @GNOME_VFS_LIBS@
122 GREP = @GREP@
123 GTKDOC_CHECK = @GTKDOC_CHECK@
124 GTK_CFLAGS = @GTK_CFLAGS@
125 GTK_LIBS = @GTK_LIBS@
126 HELP_DIR = @HELP_DIR@
127 HTML_DIR = @HTML_DIR@
128 INSTALL = @INSTALL@
129 INSTALL_DATA = @INSTALL_DATA@
130 INSTALL_PROGRAM = @INSTALL_PROGRAM@
131 INSTALL_SCRIPT = @INSTALL_SCRIPT@
132 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
133 INSTOBJEXT = @INSTOBJEXT@
134 INTLLIBS = @INTLLIBS@
135 INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
136 INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
137 INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
138 INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
139 INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
140 INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
141 INTLTOOL_MERGE = @INTLTOOL_MERGE@
142 INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
143 INTLTOOL_PERL = @INTLTOOL_PERL@
144 INTLTOOL_POLICY_RULE = @INTLTOOL_POLICY_RULE@
145 INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
146 INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
147 INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
148 INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
149 INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
150 INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
151 INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
152 INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
153 INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
154 INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
155 INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
156 INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
157 INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
158 LDFLAGS = @LDFLAGS@
159 LIBOBJS = @LIBOBJS@
160 LIBS = @LIBS@
161 LIBTOOL = @LIBTOOL@
162 LN_S = @LN_S@
163 LTLIBOBJS = @LTLIBOBJS@
164 LT_AGE = @LT_AGE@
165 LT_CURRENT = @LT_CURRENT@
166 LT_REVISION = @LT_REVISION@
167 MAINT = @MAINT@
168 MAKEINFO = @MAKEINFO@
169 MKDIR_P = @MKDIR_P@
170 MKINSTALLDIRS = @MKINSTALLDIRS@
171 MSGFMT = @MSGFMT@
172 MSGFMT_OPTS = @MSGFMT_OPTS@
173 OBJEXT = @OBJEXT@
174 OMF_DIR = @OMF_DIR@
175 PACKAGE = @PACKAGE@
176 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
177 PACKAGE_NAME = @PACKAGE_NAME@
178 PACKAGE_STRING = @PACKAGE_STRING@
179 PACKAGE_TARNAME = @PACKAGE_TARNAME@
180 PACKAGE_VERSION = @PACKAGE_VERSION@
181 PATH_SEPARATOR = @PATH_SEPARATOR@
182 PKG_CONFIG = @PKG_CONFIG@
183 POFILES = @POFILES@
184 POLKIT_DBUS_CFLAGS = @POLKIT_DBUS_CFLAGS@
185 POLKIT_DBUS_LIBS = @POLKIT_DBUS_LIBS@
186 POLKIT_GRANT_CFLAGS = @POLKIT_GRANT_CFLAGS@
187 POLKIT_GRANT_LIBS = @POLKIT_GRANT_LIBS@
188 POLKIT_POLICY_FILE_VALIDATE = @POLKIT_POLICY_FILE_VALIDATE@
189 POSUB = @POSUB@
190 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
191 PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
192 RANLIB = @RANLIB@
193 SED = @SED@
194 SET_MAKE = @SET_MAKE@
195 SEXY_CFLAGS = @SEXY_CFLAGS@
196 SEXY_LIBS = @SEXY_LIBS@
197 SHELL = @SHELL@
198 STRIP = @STRIP@
199 USE_NLS = @USE_NLS@
200 VERSION = @VERSION@
201 WARN_CFLAGS = @WARN_CFLAGS@
202 XGETTEXT = @XGETTEXT@
203 abs_builddir = @abs_builddir@
204 abs_srcdir = @abs_srcdir@
205 abs_top_builddir = @abs_top_builddir@
206 abs_top_srcdir = @abs_top_srcdir@
207 ac_ct_CC = @ac_ct_CC@
208 ac_ct_CXX = @ac_ct_CXX@
209 ac_ct_F77 = @ac_ct_F77@
210 am__include = @am__include@
211 am__leading_dot = @am__leading_dot@
212 am__quote = @am__quote@
213 am__tar = @am__tar@
214 am__untar = @am__untar@
215 bindir = @bindir@
216 build = @build@
217 build_alias = @build_alias@
218 build_cpu = @build_cpu@
219 build_os = @build_os@
220 build_vendor = @build_vendor@
221 builddir = @builddir@
222 datadir = @datadir@
223 datarootdir = @datarootdir@
224 docdir = @docdir@
225 dvidir = @dvidir@
226 exec_prefix = @exec_prefix@
227 host = @host@
228 host_alias = @host_alias@
229 host_cpu = @host_cpu@
230 host_os = @host_os@
231 host_vendor = @host_vendor@
232 htmldir = @htmldir@
233 includedir = @includedir@
234 infodir = @infodir@
235 install_sh = @install_sh@
236 libdir = @libdir@
237 libexecdir = @libexecdir@
238 localedir = @localedir@
239 localstatedir = @localstatedir@
240 mandir = @mandir@
241 mkdir_p = @mkdir_p@
242 oldincludedir = @oldincludedir@
243 pdfdir = @pdfdir@
244 prefix = @prefix@
245 program_transform_name = @program_transform_name@
246 psdir = @psdir@
247 sbindir = @sbindir@
248 sharedstatedir = @sharedstatedir@
249 srcdir = @srcdir@
250 sysconfdir = @sysconfdir@
251 target_alias = @target_alias@
252 top_builddir = @top_builddir@
253 top_srcdir = @top_srcdir@
254 polkit_gnome_authorization_SOURCES = \
255 polkit-gnome-authorization.c
256
257 polkit_gnome_authorization_CPPFLAGS = \
258 -I$(top_srcdir) \
259 -DLIBEXECDIR=\""$(libexecdir)"\" \
260 -DDATADIR=\""$(pkgdatadir)"\" \
261 -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
262 $(DISABLE_DEPRECATED) \
263 $(AM_CPPFLAGS)
264
265 polkit_gnome_authorization_CFLAGS = \
266 $(GTK_CFLAGS) \
267 $(SEXY_CFLAGS) \
268 $(GNOME_VFS_CFLAGS) \
269 $(DBUS_GLIB_CFLAGS) \
270 $(POLKIT_DBUS_CFLAGS) \
271 $(POLKIT_GRANT_CFLAGS) \
272 $(WARN_CFLAGS) \
273 $(AM_CFLAGS)
274
275 polkit_gnome_authorization_LDFLAGS = \
276 $(AM_LDFLAGS)
277
278 polkit_gnome_authorization_LDADD = \
279 $(GTK_LIBS) \
280 $(SEXY_LIBS) \
281 $(GNOME_VFS_LIBS) \
282 $(DBUS_GLIB_LIBS) \
283 $(POLKIT_DBUS_LIBS) \
284 $(POLKIT_GRANT_LIBS) \
285 $(INTLLIBS) \
286 $(top_builddir)/polkit-gnome/libpolkit-gnome.la
287
288 BUILT_SOURCES = \
289 single-instance-glue.h
290
291 CLEANFILES = $(BUILT_SOURCES)
292 EXTRA_DIST = single-instance.xml
293 all: $(BUILT_SOURCES)
294 $(MAKE) $(AM_MAKEFLAGS) all-am
295
296 .SUFFIXES:
297 .SUFFIXES: .c .lo .o .obj
298 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
299 @for dep in $?; do \
300 case '$(am__configure_deps)' in \
301 *$$dep*) \
302 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
303 && exit 0; \
304 exit 1;; \
305 esac; \
306 done; \
307 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \
308 cd $(top_srcdir) && \
309 $(AUTOMAKE) --foreign tools/Makefile
310 .PRECIOUS: Makefile
311 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
312 @case '$?' in \
313 *config.status*) \
314 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
315 *) \
316 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
317 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
318 esac;
319
320 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
321 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
322
323 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
324 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
325 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
326 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
327 install-binPROGRAMS: $(bin_PROGRAMS)
328 @$(NORMAL_INSTALL)
329 test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
330 @list='$(bin_PROGRAMS)'; for p in $$list; do \
331 p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
332 if test -f $$p \
333 || test -f $$p1 \
334 ; then \
335 f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
336 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
337 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
338 else :; fi; \
339 done
340
341 uninstall-binPROGRAMS:
342 @$(NORMAL_UNINSTALL)
343 @list='$(bin_PROGRAMS)'; for p in $$list; do \
344 f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
345 echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
346 rm -f "$(DESTDIR)$(bindir)/$$f"; \
347 done
348
349 clean-binPROGRAMS:
350 @list='$(bin_PROGRAMS)'; for p in $$list; do \
351 f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
352 echo " rm -f $$p $$f"; \
353 rm -f $$p $$f ; \
354 done
355 polkit-gnome-authorization$(EXEEXT): $(polkit_gnome_authorization_OBJECTS) $(polkit_gnome_authorization_DEPENDENCIES)
356 @rm -f polkit-gnome-authorization$(EXEEXT)
357 $(polkit_gnome_authorization_LINK) $(polkit_gnome_authorization_OBJECTS) $(polkit_gnome_authorization_LDADD) $(LIBS)
358
359 mostlyclean-compile:
360 -rm -f *.$(OBJEXT)
361
362 distclean-compile:
363 -rm -f *.tab.c
364
365 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polkit_gnome_authorization-polkit-gnome-authorization.Po@am__quote@
366
367 .c.o:
368 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
369 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
370 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
371 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
372 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
373
374 .c.obj:
375 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
376 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
377 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
378 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
379 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
380
381 .c.lo:
382 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
383 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
384 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
385 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
386 @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
387
388 polkit_gnome_authorization-polkit-gnome-authorization.o: polkit-gnome-authorization.c
389 @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(polkit_gnome_authorization_CPPFLAGS) $(CPPFLAGS) $(polkit_gnome_authorization_CFLAGS) $(CFLAGS) -MT polkit_gnome_authorization-polkit-gnome-authorization.o -MD -MP -MF $(DEPDIR)/polkit_gnome_authorization-polkit-gnome-authorization.Tpo -c -o polkit_gnome_authorization-polkit-gnome-authorization.o `test -f 'polkit-gnome-authorization.c' || echo '$(srcdir)/'`polkit-gnome-authorization.c
390 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/polkit_gnome_authorization-polkit-gnome-authorization.Tpo $(DEPDIR)/polkit_gnome_authorization-polkit-gnome-authorization.Po
391 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='polkit-gnome-authorization.c' object='polkit_gnome_authorization-polkit-gnome-authorization.o' libtool=no @AMDEPBACKSLASH@
392 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
393 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(polkit_gnome_authorization_CPPFLAGS) $(CPPFLAGS) $(polkit_gnome_authorization_CFLAGS) $(CFLAGS) -c -o polkit_gnome_authorization-polkit-gnome-authorization.o `test -f 'polkit-gnome-authorization.c' || echo '$(srcdir)/'`polkit-gnome-authorization.c
394
395 polkit_gnome_authorization-polkit-gnome-authorization.obj: polkit-gnome-authorization.c
396 @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(polkit_gnome_authorization_CPPFLAGS) $(CPPFLAGS) $(polkit_gnome_authorization_CFLAGS) $(CFLAGS) -MT polkit_gnome_authorization-polkit-gnome-authorization.obj -MD -MP -MF $(DEPDIR)/polkit_gnome_authorization-polkit-gnome-authorization.Tpo -c -o polkit_gnome_authorization-polkit-gnome-authorization.obj `if test -f 'polkit-gnome-authorization.c'; then $(CYGPATH_W) 'polkit-gnome-authorization.c'; else $(CYGPATH_W) '$(srcdir)/polkit-gnome-authorization.c'; fi`
397 @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/polkit_gnome_authorization-polkit-gnome-authorization.Tpo $(DEPDIR)/polkit_gnome_authorization-polkit-gnome-authorization.Po
398 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='polkit-gnome-authorization.c' object='polkit_gnome_authorization-polkit-gnome-authorization.obj' libtool=no @AMDEPBACKSLASH@
399 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
400 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(polkit_gnome_authorization_CPPFLAGS) $(CPPFLAGS) $(polkit_gnome_authorization_CFLAGS) $(CFLAGS) -c -o polkit_gnome_authorization-polkit-gnome-authorization.obj `if test -f 'polkit-gnome-authorization.c'; then $(CYGPATH_W) 'polkit-gnome-authorization.c'; else $(CYGPATH_W) '$(srcdir)/polkit-gnome-authorization.c'; fi`
401
402 mostlyclean-libtool:
403 -rm -f *.lo
404
405 clean-libtool:
406 -rm -rf .libs _libs
407
408 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
409 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
410 unique=`for i in $$list; do \
411 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
412 done | \
413 $(AWK) ' { files[$$0] = 1; } \
414 END { for (i in files) print i; }'`; \
415 mkid -fID $$unique
416 tags: TAGS
417
418 TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
419 $(TAGS_FILES) $(LISP)
420 tags=; \
421 here=`pwd`; \
422 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
423 unique=`for i in $$list; do \
424 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
425 done | \
426 $(AWK) ' { files[$$0] = 1; } \
427 END { for (i in files) print i; }'`; \
428 if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
429 test -n "$$unique" || unique=$$empty_fix; \
430 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
431 $$tags $$unique; \
432 fi
433 ctags: CTAGS
434 CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
435 $(TAGS_FILES) $(LISP)
436 tags=; \
437 here=`pwd`; \
438 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
439 unique=`for i in $$list; do \
440 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
441 done | \
442 $(AWK) ' { files[$$0] = 1; } \
443 END { for (i in files) print i; }'`; \
444 test -z "$(CTAGS_ARGS)$$tags$$unique" \
445 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
446 $$tags $$unique
447
448 GTAGS:
449 here=`$(am__cd) $(top_builddir) && pwd` \
450 && cd $(top_srcdir) \
451 && gtags -i $(GTAGS_ARGS) $$here
452
453 distclean-tags:
454 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
455
456 distdir: $(DISTFILES)
457 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
458 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
459 list='$(DISTFILES)'; \
460 dist_files=`for file in $$list; do echo $$file; done | \
461 sed -e "s|^$$srcdirstrip/||;t" \
462 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
463 case $$dist_files in \
464 */*) $(MKDIR_P) `echo "$$dist_files" | \
465 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
466 sort -u` ;; \
467 esac; \
468 for file in $$dist_files; do \
469 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
470 if test -d $$d/$$file; then \
471 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
472 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
473 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
474 fi; \
475 cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
476 else \
477 test -f $(distdir)/$$file \
478 || cp -p $$d/$$file $(distdir)/$$file \
479 || exit 1; \
480 fi; \
481 done
482 check-am: all-am
483 check: $(BUILT_SOURCES)
484 $(MAKE) $(AM_MAKEFLAGS) check-am
485 all-am: Makefile $(PROGRAMS)
486 installdirs:
487 for dir in "$(DESTDIR)$(bindir)"; do \
488 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
489 done
490 install: $(BUILT_SOURCES)
491 $(MAKE) $(AM_MAKEFLAGS) install-am
492 install-exec: install-exec-am
493 install-data: install-data-am
494 uninstall: uninstall-am
495
496 install-am: all-am
497 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
498
499 installcheck: installcheck-am
500 install-strip:
501 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
502 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
503 `test -z '$(STRIP)' || \
504 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
505 mostlyclean-generic:
506
507 clean-generic:
508 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
509
510 distclean-generic:
511 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
512
513 maintainer-clean-generic:
514 @echo "This command is intended for maintainers to use"
515 @echo "it deletes files that may require special tools to rebuild."
516 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
517 clean: clean-am
518
519 clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
520 mostlyclean-am
521
522 distclean: distclean-am
523 -rm -rf ./$(DEPDIR)
524 -rm -f Makefile
525 distclean-am: clean-am distclean-compile distclean-generic \
526 distclean-tags
527
528 dvi: dvi-am
529
530 dvi-am:
531
532 html: html-am
533
534 info: info-am
535
536 info-am:
537
538 install-data-am:
539
540 install-dvi: install-dvi-am
541
542 install-exec-am: install-binPROGRAMS
543
544 install-html: install-html-am
545
546 install-info: install-info-am
547
548 install-man:
549
550 install-pdf: install-pdf-am
551
552 install-ps: install-ps-am
553
554 installcheck-am:
555
556 maintainer-clean: maintainer-clean-am
557 -rm -rf ./$(DEPDIR)
558 -rm -f Makefile
559 maintainer-clean-am: distclean-am maintainer-clean-generic
560
561 mostlyclean: mostlyclean-am
562
563 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
564 mostlyclean-libtool
565
566 pdf: pdf-am
567
568 pdf-am:
569
570 ps: ps-am
571
572 ps-am:
573
574 uninstall-am: uninstall-binPROGRAMS
575
576 .MAKE: install-am install-strip
577
578 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
579 clean-generic clean-libtool clean-local ctags distclean \
580 distclean-compile distclean-generic distclean-libtool \
581 distclean-tags distdir dvi dvi-am html html-am info info-am \
582 install install-am install-binPROGRAMS install-data \
583 install-data-am install-dvi install-dvi-am install-exec \
584 install-exec-am install-html install-html-am install-info \
585 install-info-am install-man install-pdf install-pdf-am \
586 install-ps install-ps-am install-strip installcheck \
587 installcheck-am installdirs maintainer-clean \
588 maintainer-clean-generic mostlyclean mostlyclean-compile \
589 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
590 tags uninstall uninstall-am uninstall-binPROGRAMS
591
592
593 single-instance-glue.h: single-instance.xml Makefile.am
594 dbus-binding-tool --prefix=single_instance --mode=glib-server --output=single-instance-glue.h $(top_srcdir)/tools/single-instance.xml
595
596 clean-local :
597 rm -f *~
598 # Tell versions [3.59,3.63) of GNU make to not export all variables.
599 # Otherwise a system limit (for SysV at least) may be exceeded.
600 .NOEXPORT:
0 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
1 *
2 * polkit-gnome-authorization: View and manage authorizations
3 *
4 * Copyright (C) 2007 David Zeuthen <david@fubar.dk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 *
20 */
21
22 #ifdef HAVE_CONFIG_H
23 # include "config.h"
24 #endif
25
26 #include <stdlib.h>
27 #include <sys/types.h>
28 #include <sys/time.h>
29 #include <unistd.h>
30 #include <string.h>
31 #include <pwd.h>
32 #include <errno.h>
33
34 #include <glib/gi18n.h>
35 #include <dbus/dbus-glib.h>
36 #include <dbus/dbus-glib-lowlevel.h>
37 #include <polkit-gnome/polkit-gnome.h>
38 #include <libsexy/sexy.h>
39 #include <libgnomevfs/gnome-vfs-utils.h>
40
41 static GType boxed_pfe_type;
42
43 enum
44 {
45 ICON_COLUMN,
46 ACTION_ID_COLUMN,
47 ACTION_NAME_COLUMN,
48 PFE_COLUMN,
49 N_COLUMNS
50 };
51
52 enum
53 {
54 EXPLICIT_ICON_COLUMN,
55 EXPLICIT_ENTITY_NAME_COLUMN,
56 EXPLICIT_SCOPE_COLUMN,
57 EXPLICIT_CONSTRAINTS_COLUMN,
58 EXPLICIT_OBTAINED_COLUMN,
59 EXPLICIT_OBTAINED_HOW_COLUMN,
60 EXPLICIT_AUTH_OBJECT_COLUMN,
61 EXPLICIT_N_COLUMNS
62 };
63
64 static GdkPixbuf *person_pixbuf;
65 static GdkPixbuf *action_pixbuf;
66 static GdkPixbuf *namespace_pixbuf;
67 static GdkPixbuf *stop_pixbuf;
68
69 static GtkWidget *toplevel_window = NULL;
70 static GtkWidget *notebook;
71 static GtkTreeStore *action_store;
72 static GtkWidget *action_treeview = NULL;
73 static PolKitGnomeContext *pkgc;
74
75 static GtkListStore *authlist_store;
76 static GtkWidget *summary_box;
77
78 static GtkWidget *summary_action_icon;
79 static GtkWidget *summary_action_id_label;
80 static GtkWidget *summary_action_desc_label;
81 static GtkWidget *summary_label_any;
82 static GtkWidget *summary_label_inactive;
83 static GtkWidget *summary_label_active;
84 static GtkWidget *summary_action_vendor_label;
85
86 static PolKitAction *pk_read_action;
87 static PolKitAction *pk_revoke_action;
88 static PolKitAction *pk_grant_action;
89 static PolKitAction *pk_modify_defaults_action;
90
91 static PolKitGnomeToggleAction *read_action;
92 static PolKitGnomeAction *revoke_action;
93 static PolKitGnomeAction *revert_to_defaults_action;
94
95 static GtkWidget *authlist_treeview;
96
97 static GtkTreeSelection *action_treeselect;
98 static GtkTreeSelection *authlist_treeselect;
99
100 static GtkWidget *grant_button;
101 static GtkWidget *block_button;
102
103 static GSList *reffed_auths = NULL;
104
105 static GtkWidget *edit_impl_button;
106 static GtkWidget *revert_impl_button;
107
108
109 typedef struct {
110 PolKitResult result;
111 char *text;
112 } EditImplResult;
113
114 static EditImplResult edit_impl_result_options[POLKIT_RESULT_N_RESULTS - 1] = {
115
116 {POLKIT_RESULT_NO, N_("No")},
117
118 {POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_ONE_SHOT, N_("Admin Authentication (one shot)")},
119 {POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH, N_("Admin Authentication")},
120 {POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_SESSION, N_("Admin Authentication (keep session)")},
121 {POLKIT_RESULT_ONLY_VIA_ADMIN_AUTH_KEEP_ALWAYS, N_("Admin Authentication (keep indefinitely)")},
122
123 {POLKIT_RESULT_ONLY_VIA_SELF_AUTH_ONE_SHOT, N_("Authentication (one shot)")},
124 {POLKIT_RESULT_ONLY_VIA_SELF_AUTH, N_("Authentication")},
125 {POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_SESSION, N_("Authentication (keep session)")},
126 {POLKIT_RESULT_ONLY_VIA_SELF_AUTH_KEEP_ALWAYS, N_("Authentication (keep indefinitely)")},
127
128 {POLKIT_RESULT_YES, N_("Yes")},
129
130 };
131
132 static char *
133 _get_string_for_polkit_result (PolKitResult result)
134 {
135 int n;
136 for (n = 0; n < POLKIT_RESULT_N_RESULTS - 1; n++) {
137 if (edit_impl_result_options[n].result == result)
138 return edit_impl_result_options[n].text;
139 }
140
141 return NULL;
142 }
143
144 static char *
145 make_breakable (const char *string, char break_char)
146 {
147 int n;
148 char **tokens;
149 GString *str;
150 char break_str[] = {break_char, '\0'};
151
152 tokens = g_strsplit (string, break_str, 0);
153 str = g_string_new ("");
154 for (n = 0; tokens[n] != NULL; n++) {
155 g_string_append (str, tokens[n]);
156 if (tokens[n+1] != NULL) {
157 g_string_append_c (str, '.');
158 /* U+200B ZERO WIDTH SPACE (this character is intended for line break control; it has no
159 * width, but its presence between two characters does not prevent increased letter
160 * spacing in justification)
161 */
162 g_string_append_unichar (str, 0x200b);
163 }
164 }
165 g_strfreev (tokens);
166
167 return g_string_free (str, FALSE);
168 }
169
170 static GdkPixbuf *
171 get_face_for_pw (struct passwd *pw)
172 {
173 GdkPixbuf *pixbuf;
174
175 pixbuf = NULL;
176 if (pw != NULL && pw->pw_dir != NULL) {
177 char *path;
178 path = g_strdup_printf ("%s/.face", pw->pw_dir);
179 pixbuf = gdk_pixbuf_new_from_file_at_scale (path, 24, 24, TRUE, NULL);
180 g_free (path);
181 }
182
183 /* fall back to stock_person icon */
184 if (pixbuf == NULL)
185 pixbuf = g_object_ref (person_pixbuf);
186
187 return pixbuf;
188 }
189
190 static GdkPixbuf *
191 get_face_for_uid (uid_t uid)
192 {
193 return get_face_for_pw (getpwuid (uid));
194 }
195
196 typedef struct
197 {
198 GtkWidget *vbox;
199 const char *action_id;
200 PolKitCaller *self;
201 PolKitSession *self_session;
202 char *self_session_objpath;
203 polkit_bool_t self_is_local;
204 polkit_bool_t self_is_active;
205 int num_entries;
206 } AuthClosure;
207
208 static PolKitPolicyFileEntry *
209 get_selected_pfe (GtkTreeView *treeview)
210 {
211 PolKitPolicyFileEntry *pfe;
212 GtkTreePath *path;
213 GtkTreeModel *treemodel;
214
215 pfe = NULL;
216
217 treemodel = gtk_tree_view_get_model (treeview);
218 gtk_tree_view_get_cursor (treeview, &path, NULL);
219 if (path != NULL) {
220 GtkTreeIter iter;
221
222 if (gtk_tree_model_get_iter (treemodel, &iter, path)) {
223
224 gtk_tree_model_get (treemodel, &iter,
225 PFE_COLUMN,
226 &pfe,
227 -1);
228 }
229 gtk_tree_path_free (path);
230 }
231
232 return pfe;
233 }
234
235 #if 0
236 static char *
237 get_selected_action_id (GtkTreeView *treeview)
238 {
239 char *action_id;
240 GtkTreePath *path;
241 GtkTreeModel *treemodel;
242
243 action_id = NULL;
244
245 treemodel = gtk_tree_view_get_model (treeview);
246 gtk_tree_view_get_cursor (treeview, &path, NULL);
247 if (path != NULL) {
248 GtkTreeIter iter;
249
250 if (gtk_tree_model_get_iter (treemodel, &iter, path)) {
251
252 gtk_tree_model_get (treemodel, &iter,
253 ACTION_ID_COLUMN,
254 &action_id,
255 -1);
256 }
257 gtk_tree_path_free (path);
258 }
259
260 return action_id;
261 }
262 #endif
263
264 static polkit_bool_t
265 _build_constraint_string (PolKitAuthorization *auth, PolKitAuthorizationConstraint *authc, void *user_data)
266 {
267 char buf[128];
268 GString *str = (GString *) user_data;
269
270 if (str->len > 0)
271 g_string_append (str, _(", "));
272
273 switch (polkit_authorization_constraint_type (authc)) {
274 case POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_LOCAL:
275 g_string_append (str, _("Must be on console"));
276 break;
277 case POLKIT_AUTHORIZATION_CONSTRAINT_TYPE_REQUIRE_ACTIVE:
278 g_string_append (str, _("Must be in active session"));
279 break;
280 default:
281 buf[sizeof (buf) - 1] = '\0';
282 polkit_authorization_constraint_to_string (authc, buf, sizeof (buf) - 1);
283 g_string_append (str, buf);
284 break;
285 }
286
287 return FALSE;
288 }
289
290 static polkit_bool_t
291 add_authorization (PolKitAuthorizationDB *authdb,
292 PolKitAuthorization *auth,
293 void *user_data)
294 {
295 time_t time_granted;
296 struct timeval now;
297 uid_t for_uid;
298 char *for_user;
299 pid_t pid;
300 polkit_uint64_t pid_start_time;
301 AuthClosure *ac = (AuthClosure *) user_data;
302 struct passwd *pw;
303 DBusError dbus_error;
304 char *scope;
305 uid_t auth_uid, pimp_uid;
306 polkit_bool_t is_negative;
307 char *how;
308 char *time_string;
309 gint64 delta;
310 char *constraint_string;
311 char exe[512];
312 GString *str;
313
314 is_negative = FALSE;
315
316 if (strcmp (polkit_authorization_get_action_id (auth), ac->action_id) != 0)
317 goto out;
318
319 dbus_error_init (&dbus_error);
320 if (!polkit_tracker_is_authorization_relevant (pkgc->pk_tracker, auth, &dbus_error)) {
321 if (dbus_error_is_set (&dbus_error)) {
322 g_warning ("Cannot determine if authorization is relevant: %s: %s",
323 dbus_error.name,
324 dbus_error.message);
325 dbus_error_free (&dbus_error);
326 } else {
327 goto out;
328 }
329 }
330
331 time_granted = polkit_authorization_get_time_of_grant (auth);
332 gettimeofday (&now, NULL);
333 delta = (gint64) (now.tv_sec - time_granted);
334 if (delta < 60)
335 time_string = g_strdup (_("A moment ago"));
336 else if (delta < (60 * 60)) {
337 int minutes = (int) (delta / 60);
338 if (minutes == 1)
339 time_string = g_strdup (_("1 minute ago"));
340 else
341 time_string = g_strdup_printf (_("%d minutes ago"), minutes);
342 } else if (delta < (24 * 60 * 60)) {
343 int hours = (int) (delta / (60 * 60));
344 if (hours == 1)
345 time_string = g_strdup (_("1 hour ago"));
346 else
347 time_string = g_strdup_printf (_("%d hours ago"), hours);
348 } else {
349 int days = (int) (delta / (24 * 60 * 60));
350 if (days == 1)
351 time_string = g_strdup (_("1 day ago"));
352 else
353 time_string = g_strdup_printf (_("%d days ago"), days);
354 }
355
356 for_uid = polkit_authorization_get_uid (auth);
357 pw = getpwuid (for_uid);
358 if (pw != NULL)
359 if (pw->pw_gecos != NULL && strlen (pw->pw_gecos) > 0)
360 for_user = g_strdup_printf ("%s (%s)", pw->pw_gecos, pw->pw_name);
361 else
362 for_user = g_strdup_printf ("%s", pw->pw_name);
363 else
364 for_user = g_strdup_printf ("uid %d", for_uid);
365
366 how = NULL;
367 if (polkit_authorization_was_granted_via_defaults (auth, &auth_uid)) {
368 pw = getpwuid (auth_uid);
369 if (pw != NULL)
370 how = g_strdup_printf (_("Auth as %s (uid %d)"), pw->pw_name, auth_uid);
371 else
372 how = g_strdup_printf (_("Auth as uid %d"), auth_uid);
373
374 } else if (polkit_authorization_was_granted_explicitly (auth, &pimp_uid, &is_negative)) {
375 pw = getpwuid (pimp_uid);
376 if (is_negative) {
377 if (pw != NULL)
378 how = g_strdup_printf (_("Blocked by %s (uid %d)"), pw->pw_name, pimp_uid);
379 else
380 how = g_strdup_printf (_("Blocked by uid %d"), pimp_uid);
381 } else {
382 if (pw != NULL)
383 how = g_strdup_printf (_("Granted by %s (uid %d)"), pw->pw_name, pimp_uid);
384 else
385 how = g_strdup_printf (_("Granted by uid %d"), pimp_uid);
386 }
387
388 }
389
390 if (how == NULL)
391 how = g_strdup ("");
392
393
394 scope = NULL;
395 switch (polkit_authorization_get_scope (auth)) {
396 case POLKIT_AUTHORIZATION_SCOPE_PROCESS_ONE_SHOT:
397 polkit_authorization_scope_process_get_pid (auth, &pid, &pid_start_time);
398 exe[sizeof (exe) - 1] = '\0';
399 polkit_sysdeps_get_exe_for_pid (pid, exe, sizeof (exe) - 1);
400 scope = g_strdup_printf (_("Single shot pid %d (%s)"), pid, exe);
401 break;
402 case POLKIT_AUTHORIZATION_SCOPE_PROCESS:
403 polkit_authorization_scope_process_get_pid (auth, &pid, &pid_start_time);
404 exe[sizeof (exe) - 1] = '\0';
405 polkit_sysdeps_get_exe_for_pid (pid, exe, sizeof (exe) - 1);
406 scope = g_strdup_printf (_("pid %d (%s)"), pid, exe);
407 break;
408 case POLKIT_AUTHORIZATION_SCOPE_SESSION:
409 scope = g_strdup (_("This session"));
410 break;
411 case POLKIT_AUTHORIZATION_SCOPE_ALWAYS:
412 scope = g_strdup (_("Always"));
413 break;
414 }
415
416 str = g_string_new (NULL);
417 polkit_authorization_constraints_foreach (auth, _build_constraint_string, str);
418 if (str->len > 0) {
419 constraint_string = g_string_free (str, FALSE);
420 } else {
421 g_string_free (str, TRUE);
422 constraint_string = g_strdup (_("None"));
423 }
424
425 GdkPixbuf *pixbuf;
426 pixbuf = get_face_for_uid (for_uid);
427
428 if (is_negative) {
429
430 /* turn black and white */
431 gdk_pixbuf_saturate_and_pixelate (pixbuf,
432 pixbuf,
433 0.0,
434 FALSE);
435
436 /* blend the STOP icon on top */
437 gdk_pixbuf_composite (stop_pixbuf,
438 pixbuf,
439 12, 12, 12, 12,
440 12.0, 12.0, 0.5, 0.5,
441 GDK_INTERP_BILINEAR,
442 255);
443
444 }
445
446 GtkTreeIter iter;
447 gtk_list_store_append (authlist_store, &iter);
448 gtk_list_store_set (authlist_store, &iter,
449 EXPLICIT_ICON_COLUMN, pixbuf,
450 EXPLICIT_ENTITY_NAME_COLUMN, for_user,
451 EXPLICIT_SCOPE_COLUMN, scope,
452 EXPLICIT_CONSTRAINTS_COLUMN, constraint_string,
453 EXPLICIT_OBTAINED_COLUMN, time_string,
454 EXPLICIT_OBTAINED_HOW_COLUMN, how,
455 EXPLICIT_AUTH_OBJECT_COLUMN, auth,
456 -1);
457
458 /* ref the authorization */
459 reffed_auths = g_slist_prepend (reffed_auths, polkit_authorization_ref (auth));
460
461 g_object_unref (pixbuf);
462 g_free (for_user);
463 g_free (scope);
464 g_free (how);
465 g_free (time_string);
466 g_free (constraint_string);
467
468 out:
469 return FALSE;
470 }
471
472
473 static PolKitAuthorization *
474 get_selected_auth (GtkTreeView *treeview)
475 {
476 PolKitAuthorization *auth;
477 GtkTreePath *path;
478 GtkTreeModel *treemodel;
479
480 auth = NULL;
481
482 treemodel = gtk_tree_view_get_model (treeview);
483 gtk_tree_view_get_cursor (treeview, &path, NULL);
484 if (path != NULL) {
485 GtkTreeIter iter;
486
487 if (gtk_tree_model_get_iter (treemodel, &iter, path)) {
488
489 gtk_tree_model_get (treemodel, &iter,
490 EXPLICIT_AUTH_OBJECT_COLUMN,
491 &auth,
492 -1);
493 }
494 gtk_tree_path_free (path);
495 }
496
497 return auth;
498 }
499
500 static void
501 update_authlist (void)
502 {
503 GtkTreeView *treeview;
504 PolKitAuthorization *auth;
505
506 treeview = gtk_tree_selection_get_tree_view (authlist_treeselect);
507 auth = get_selected_auth (treeview);
508
509 if (auth != NULL) {
510 uid_t our_uid;
511 uid_t for_uid;
512 uid_t pimp_uid;
513 gboolean need_revoke;
514 polkit_bool_t is_negative;
515
516 polkit_gnome_action_set_sensitive (revoke_action, TRUE);
517
518 our_uid = getuid ();
519
520 for_uid = polkit_authorization_get_uid (auth);
521
522 /* we need org.fd.polkit.revoke if:
523 * 1) the auth is for another user than us
524 * 2) the auth was granted by someone else than us
525 */
526 need_revoke = FALSE;
527 if (for_uid != our_uid) {
528 need_revoke = TRUE;
529 } else if (polkit_authorization_was_granted_explicitly (auth, &pimp_uid, &is_negative)) {
530 if (pimp_uid != our_uid) {
531 need_revoke = TRUE;
532 }
533 }
534
535 if (need_revoke) {
536 g_object_set (revoke_action,
537 "polkit_action", pk_revoke_action,
538 NULL);
539 } else {
540 g_object_set (revoke_action,
541 "polkit_action", NULL,
542 NULL);
543 }
544
545 } else {
546 polkit_gnome_action_set_sensitive (revoke_action, FALSE);
547 }
548
549
550 }
551
552 static void
553 authlist_changed (GtkTreeSelection *selection, gpointer user_data)
554 {
555 update_authlist ();
556 }
557
558 static void
559 revoke_action_activate (PolKitGnomeAction *action, gpointer user_data)
560 {
561 GtkTreeView *treeview;
562 PolKitAuthorization *auth;
563
564 treeview = gtk_tree_selection_get_tree_view (authlist_treeselect);
565 auth = get_selected_auth (treeview);
566
567 if (auth != NULL) {
568 PolKitAuthorizationDB *authdb;
569 PolKitError *pk_error;
570
571 authdb = polkit_context_get_authorization_db (pkgc->pk_context);
572
573 pk_error = NULL;
574 if (!polkit_authorization_db_revoke_entry (authdb, auth, &pk_error)) {
575 g_warning ("Error doing revoke: %s: %s",
576 polkit_error_get_error_name (pk_error),
577 polkit_error_get_error_message (pk_error));
578 polkit_error_free (pk_error);
579 }
580 }
581 }
582
583
584 static void
585 _entity_combobox_set_sensitive (GtkCellLayout *cell_layout,
586 GtkCellRenderer *cell,
587 GtkTreeModel *tree_model,
588 GtkTreeIter *iter,
589 gpointer user_data)
590 {
591 GtkTreePath *path;
592 gint *indices;
593 gboolean sensitive;
594
595 path = gtk_tree_model_get_path (tree_model, iter);
596 indices = gtk_tree_path_get_indices (path);
597 if (indices[0] == 0)
598 sensitive = FALSE;
599 else
600 sensitive = TRUE;
601 gtk_tree_path_free (path);
602
603 g_object_set (cell, "sensitive", sensitive, NULL);
604 }
605
606 static gboolean
607 _real_user (struct passwd *pw)
608 {
609 gboolean ret;
610
611 ret = FALSE;
612
613 /* TODO: there's probably better heuristic / tests than theses... */
614
615 if (pw->pw_uid < 500)
616 goto out;
617
618 if (pw->pw_shell == NULL || strcmp (pw->pw_shell, "/sbin/nologin") == 0)
619 goto out;
620
621 ret = TRUE;
622 out:
623 return ret;
624 }
625
626 static void
627 _create_entity_combobox_populate (GtkListStore *store, gboolean show_system_users)
628 {
629 GtkTreeIter iter;
630 struct passwd *pw;
631
632 gtk_list_store_clear (store);
633 gtk_list_store_append (store, &iter);
634 gtk_list_store_set (store, &iter,
635 0, NULL,
636 1, _("Select user..."),
637 2, NULL,
638 -1);
639
640 /* we're single threaded so this is a fine way to iterate over all users */
641 for (setpwent(); (pw = getpwent ()) != NULL; ) {
642 char *real_name;
643 GdkPixbuf *pixbuf;
644
645 errno = 0;
646
647 if (!show_system_users && !_real_user (pw))
648 continue;
649
650 /* Real name */
651 if (pw->pw_gecos != NULL && strlen (pw->pw_gecos) > 0)
652 real_name = g_strdup_printf (_("%s (%s)"), pw->pw_gecos, pw->pw_name);
653 else
654 real_name = g_strdup (pw->pw_name);
655
656 /* Load users face */
657 pixbuf = get_face_for_pw (pw);
658
659 gtk_list_store_append (store, &iter);
660 gtk_list_store_set (store, &iter,
661 0, pixbuf,
662 1, real_name,
663 2, pw->pw_name,
664 3, pw->pw_uid,
665 -1);
666
667 g_free (real_name);
668 g_object_unref (pixbuf);
669 }
670 }
671
672 static GtkWidget *
673 _create_entity_combobox (void)
674 {
675 GtkComboBox *combo;
676 GtkCellRenderer *renderer;
677 GtkListStore *store;
678
679 combo = GTK_COMBO_BOX (gtk_combo_box_new ());
680 store = gtk_list_store_new (4, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT);
681
682 /* sort on uid */
683 gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), 3, GTK_SORT_ASCENDING);
684
685 _create_entity_combobox_populate (store, FALSE);
686
687 gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store));
688 g_object_unref (store);
689
690 renderer = gtk_cell_renderer_pixbuf_new ();
691 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE);
692 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
693 "pixbuf", 0,
694 NULL);
695 gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo),
696 renderer,
697 _entity_combobox_set_sensitive,
698 NULL, NULL);
699
700 renderer = gtk_cell_renderer_text_new ();
701 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
702 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
703 "text", 1,
704 NULL);
705 gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo),
706 renderer,
707 _entity_combobox_set_sensitive,
708 NULL, NULL);
709
710 /* Initially select the "Select user..." ... */
711 gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
712
713 return GTK_WIDGET (combo);
714 }
715
716 typedef struct {
717 gboolean is_block;
718
719 uid_t uid;
720 PolKitGnomeAction *grant_action;
721 GtkWidget *combo;
722 gboolean constraint_none;
723 gboolean constraint_active;
724 gboolean constraint_console;
725 gboolean constraint_active_console;
726 } EntitySelected;
727
728 static void
729 _entity_combobox_update_sensitivity (EntitySelected *entity_selected)
730 {
731 polkit_gnome_action_set_sensitive (entity_selected->grant_action, (int) entity_selected->uid != -1);
732
733 if (entity_selected->is_block) {
734 g_object_set (entity_selected->grant_action,
735 "polkit-action", (entity_selected->uid == getuid ()) ? NULL : pk_grant_action,
736 NULL);
737 }
738 }
739
740 static void
741 _entity_combobox_changed (GtkComboBox *widget, gpointer user_data)
742 {
743 GtkTreeIter iter;
744 EntitySelected *entity_selected = (EntitySelected *) user_data;
745
746 if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) {
747 gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (widget)), &iter,
748 3, &(entity_selected->uid), -1);
749 _entity_combobox_update_sensitivity (entity_selected);
750 }
751 }
752
753 static void
754 _entity_radio_toggled (GtkToggleButton *toggle_button, gpointer user_data)
755 {
756 gboolean *value = (gboolean *) user_data;
757
758 *value = gtk_toggle_button_get_active (toggle_button);
759 }
760
761 static void
762 _entity_show_system_users_toggled (GtkToggleButton *toggle_button, gpointer user_data)
763 {
764 GtkListStore *list_store;
765 gboolean show_system_users;
766 EntitySelected *entity_selected = (EntitySelected *) user_data;
767
768 show_system_users = gtk_toggle_button_get_active (toggle_button);
769
770 list_store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (entity_selected->combo)));
771 _create_entity_combobox_populate (list_store, show_system_users);
772
773 /* Initially select the "Select user..." ... */
774 gtk_combo_box_set_active (GTK_COMBO_BOX (entity_selected->combo), 0);
775 entity_selected->uid = -1;
776
777 _entity_combobox_update_sensitivity (entity_selected);
778 }
779
780 static void
781 block_grant_do (gboolean is_block)
782 {
783 gint response;
784 GtkWidget *label;
785 GtkWidget *dialog;
786 GtkWidget *grant_button;
787 GtkWidget *combo;
788 GtkTreeView *treeview;
789 PolKitPolicyFileEntry *pfe;
790 char *s;
791 char *s2;
792 const char *action_id;
793 EntitySelected entity_selected;
794 GtkWidget *show_system_entities;
795 GtkWidget *hbox;
796 GtkWidget *vbox;
797 GtkWidget *main_vbox;
798 GtkWidget *icon;
799 PolKitGnomeAction *grant_action;
800 GtkWidget *radio1;
801 GtkWidget *radio2;
802 GtkWidget *radio3;
803 GtkWidget *radio4;
804 GtkWidget *align;
805 GtkWidget *section_vbox;
806
807 treeview = gtk_tree_selection_get_tree_view (action_treeselect);
808 pfe = get_selected_pfe (treeview);
809 if (pfe == NULL)
810 goto out;
811
812 action_id = polkit_policy_file_entry_get_id (pfe);
813
814 dialog = gtk_dialog_new_with_buttons (is_block ? _("Grant Negative Authorization"): _("Grant Authorization"),
815 GTK_WINDOW (toplevel_window),
816 GTK_DIALOG_MODAL,
817 GTK_STOCK_CANCEL,
818 GTK_RESPONSE_CANCEL,
819 NULL);
820 gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
821 gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_ADD);
822
823 hbox = gtk_hbox_new (FALSE, 12);
824 gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
825 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
826
827 icon = gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_DIALOG);
828 gtk_misc_set_alignment (GTK_MISC (icon), 0.5, 0.0);
829 gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
830
831 main_vbox = gtk_vbox_new (FALSE, 8);
832 gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0);
833
834 s2 = make_breakable (action_id, '.');
835 s = g_strdup_printf (
836 is_block ?
837 _("<b><big>Granting a negative authorization for the <i>%s</i> action requires more information</big></b>") :
838 _("<b><big>Granting an authorization for the <i>%s</i> action requires more information</big></b>"),
839 s2);
840 g_free (s2);
841 label = gtk_label_new (NULL);
842 gtk_label_set_markup (GTK_LABEL (label), s);
843 g_free (s);
844 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
845 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
846 gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, TRUE, 0);
847
848 if (is_block)
849 label = gtk_label_new (_("Select the user to block for the action and, optionally, any constraints on the negative authorization that you are about to grant."));
850 else
851 label = gtk_label_new (_("Select the beneficiary and, optionally, how to constrain the authorization that you are about to grant."));
852 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
853 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
854 gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, TRUE, 0);
855
856 /* --------------------------------- */
857 /* Select user/group/selinux context */
858 /* --------------------------------- */
859 section_vbox = gtk_vbox_new (FALSE, 0);
860
861 label = gtk_label_new (NULL);
862 gtk_label_set_markup (GTK_LABEL (label), _("<b>Beneficiary</b>"));
863 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
864 gtk_box_pack_start (GTK_BOX (section_vbox), label, FALSE, TRUE, 0);
865
866 vbox = gtk_vbox_new (FALSE, 4);
867 hbox = gtk_hbox_new (FALSE, 6);
868
869 align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
870 gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, 0, 0);
871 gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, TRUE, 6);
872
873 if (is_block)
874 label = gtk_label_new (_("Select the user that will receive the negative authorization."));
875 else
876 label = gtk_label_new (_("Select the user that will receive the authorization."));
877 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
878 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
879 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
880
881 combo = _create_entity_combobox ();
882 gtk_box_pack_start (GTK_BOX (vbox), combo, TRUE, TRUE, 0);
883 g_signal_connect (combo, "changed", G_CALLBACK (_entity_combobox_changed), &entity_selected);
884
885 show_system_entities = gtk_check_button_new_with_mnemonic (_("_Show system users"));
886 gtk_box_pack_start (GTK_BOX (vbox), show_system_entities, FALSE, TRUE, 0);
887 g_signal_connect (show_system_entities, "toggled", G_CALLBACK (_entity_show_system_users_toggled), &entity_selected);
888
889 gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
890 gtk_box_pack_start (GTK_BOX (section_vbox), hbox, FALSE, TRUE, 0);
891
892 gtk_box_pack_start (GTK_BOX (main_vbox), section_vbox, FALSE, TRUE, 0);
893
894 /* -------------------- */
895 /* Physical constraints */
896 /* -------------------- */
897 section_vbox = gtk_vbox_new (FALSE, 0);
898
899 label = gtk_label_new (NULL);
900 gtk_label_set_markup (GTK_LABEL (label), _("<b>Constraints</b>"));
901 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
902 gtk_box_pack_start (GTK_BOX (section_vbox), label, FALSE, TRUE, 0);
903
904 vbox = gtk_vbox_new (FALSE, 2);
905 hbox = gtk_hbox_new (FALSE, 6);
906
907 align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
908 gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, 0, 0);
909 gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, TRUE, 6);
910
911 label = gtk_label_new (_("Constraints limits the authorization such that it only applies under certain circumstances."));
912 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
913 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
914 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
915
916 radio1 = gtk_radio_button_new_with_mnemonic (NULL,
917 _("_None"));
918 radio2 = gtk_radio_button_new_with_mnemonic (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio1)),
919 _("Must be _in active session"));
920 radio3 = gtk_radio_button_new_with_mnemonic (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio1)),
921 _("Must be on _local console"));
922 radio4 = gtk_radio_button_new_with_mnemonic (gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio1)),
923 _("Must be in _active session on local console"));
924 gtk_box_pack_start (GTK_BOX (vbox), radio1, FALSE, TRUE, 0);
925 gtk_box_pack_start (GTK_BOX (vbox), radio2, FALSE, TRUE, 0);
926 gtk_box_pack_start (GTK_BOX (vbox), radio3, FALSE, TRUE, 0);
927 gtk_box_pack_start (GTK_BOX (vbox), radio4, FALSE, TRUE, 0);
928 g_signal_connect (radio1, "toggled", G_CALLBACK (_entity_radio_toggled), &(entity_selected.constraint_none));
929 g_signal_connect (radio2, "toggled", G_CALLBACK (_entity_radio_toggled), &(entity_selected.constraint_active));
930 g_signal_connect (radio3, "toggled", G_CALLBACK (_entity_radio_toggled), &(entity_selected.constraint_console));
931 g_signal_connect (radio4, "toggled", G_CALLBACK (_entity_radio_toggled), &(entity_selected.constraint_active_console));
932
933 gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
934 gtk_box_pack_start (GTK_BOX (section_vbox), hbox, FALSE, TRUE, 0);
935
936 gtk_box_pack_start (GTK_BOX (main_vbox), section_vbox, FALSE, TRUE, 0);
937
938 /* ------- */
939 /* Buttons */
940 /* ------- */
941
942 if (is_block)
943 grant_action = polkit_gnome_action_new_default ("grant", pk_grant_action,
944 _("_Block..."),
945 NULL);
946 else
947 grant_action = polkit_gnome_action_new_default ("grant", pk_grant_action,
948 _("_Grant..."),
949 NULL);
950 polkit_gnome_action_set_sensitive (grant_action, FALSE);
951 grant_button = polkit_gnome_action_create_button (grant_action);
952 g_object_unref (grant_action);
953 gtk_dialog_add_action_widget (GTK_DIALOG (dialog), grant_button, GTK_RESPONSE_OK);
954
955 /* Listen when a new user is selected */
956 entity_selected.is_block = is_block;
957 entity_selected.uid = -1;
958 entity_selected.combo = combo;
959 entity_selected.grant_action = grant_action;
960 entity_selected.constraint_none = TRUE;
961 entity_selected.constraint_active = FALSE;
962 entity_selected.constraint_console = FALSE;
963 entity_selected.constraint_active_console = FALSE;
964
965 gtk_widget_show_all (dialog);
966 response = gtk_dialog_run (GTK_DIALOG (dialog));
967 gtk_widget_destroy (dialog);
968
969 if (response == GTK_RESPONSE_OK) {
970 PolKitAction *action;
971 PolKitAuthorizationDB *authdb;
972 PolKitError *pk_error;
973 unsigned int num_constraints;
974 PolKitAuthorizationConstraint *constraints[3];
975
976 action = polkit_action_new ();
977 polkit_action_set_action_id (action, action_id);
978
979 authdb = polkit_context_get_authorization_db (pkgc->pk_context);
980
981 num_constraints = 0;
982
983 if (entity_selected.constraint_none) {
984 ;
985 } else if (entity_selected.constraint_active) {
986 constraints[num_constraints++] = polkit_authorization_constraint_get_require_active ();
987 } else if (entity_selected.constraint_console) {
988 constraints[num_constraints++] = polkit_authorization_constraint_get_require_local ();
989 } else {
990 g_assert (entity_selected.constraint_active_console);
991 constraints[num_constraints++] = polkit_authorization_constraint_get_require_local ();
992 constraints[num_constraints++] = polkit_authorization_constraint_get_require_active ();
993 }
994 constraints[num_constraints] = NULL;
995
996 if ((int) entity_selected.uid != -1) {
997 polkit_bool_t res;
998 pk_error = NULL;
999
1000 if (is_block)
1001 res = polkit_authorization_db_grant_negative_to_uid (authdb,
1002 action,
1003 entity_selected.uid,
1004 constraints,
1005 &pk_error);
1006 else
1007 res = polkit_authorization_db_grant_to_uid (authdb,
1008 action,
1009 entity_selected.uid,
1010 constraints,
1011 &pk_error);
1012
1013 if (!res) {
1014 g_warning ("Error granting auth: %s: %s\n",
1015 polkit_error_get_error_name (pk_error),
1016 polkit_error_get_error_message (pk_error));
1017 polkit_error_free (pk_error);
1018 }
1019 }
1020 }
1021
1022 out:
1023 if (pfe != NULL) {
1024 polkit_policy_file_entry_unref (pfe);
1025 }
1026 }
1027
1028 static void
1029 block_clicked (GtkButton *button, gpointer user_data)
1030 {
1031 block_grant_do (TRUE);
1032 }
1033
1034 static void
1035 grant_clicked (GtkButton *button, gpointer user_data)
1036 {
1037 block_grant_do (FALSE);
1038 }
1039
1040 typedef struct {
1041 PolKitGnomeAction *modify_defaults_action;
1042
1043 PolKitResult any_orig;
1044 PolKitResult inactive_orig;
1045 PolKitResult active_orig;
1046
1047 PolKitResult any;
1048 PolKitResult inactive;
1049 PolKitResult active;
1050 } EditImplData;
1051
1052
1053 static void
1054 edit_impl_update_sensitive (EditImplData *data)
1055 {
1056 gboolean sensitive;
1057
1058 if (data->any != data->any_orig ||
1059 data->inactive != data->inactive_orig ||
1060 data->active != data->active_orig) {
1061 sensitive = TRUE;
1062 } else {
1063 sensitive = FALSE;
1064 }
1065 polkit_gnome_action_set_sensitive (data->modify_defaults_action, sensitive);
1066 }
1067
1068 static void
1069 edit_impl_combo_any_changed (GtkComboBox *combo, gpointer user_data)
1070 {
1071 int active;
1072 PolKitResult result;
1073 EditImplData *data = (EditImplData *) user_data;
1074
1075 active = gtk_combo_box_get_active (combo);
1076 g_assert (active >= 0 && active < POLKIT_RESULT_N_RESULTS - 1);
1077 result = edit_impl_result_options[active].result;
1078 data->any = result;
1079
1080 edit_impl_update_sensitive (data);
1081 }
1082
1083 static void
1084 edit_impl_combo_inactive_changed (GtkComboBox *combo, gpointer user_data)
1085 {
1086 int active;
1087 PolKitResult result;
1088 EditImplData *data = (EditImplData *) user_data;
1089
1090 active = gtk_combo_box_get_active (combo);
1091 g_assert (active >= 0 && active < POLKIT_RESULT_N_RESULTS - 1);
1092 result = edit_impl_result_options[active].result;
1093 data->inactive = result;
1094
1095 edit_impl_update_sensitive (data);
1096 }
1097
1098 static void
1099 edit_impl_combo_active_changed (GtkComboBox *combo, gpointer user_data)
1100 {
1101 int active;
1102 PolKitResult result;
1103 EditImplData *data = (EditImplData *) user_data;
1104
1105 active = gtk_combo_box_get_active (combo);
1106 g_assert (active >= 0 && active < POLKIT_RESULT_N_RESULTS - 1);
1107 result = edit_impl_result_options[active].result;
1108 data->active = result;
1109
1110 edit_impl_update_sensitive (data);
1111 }
1112
1113 static void
1114 edit_impl_clicked (GtkButton *button, gpointer user_data)
1115 {
1116 char *s;
1117 char *s2;
1118 const char *action_id;
1119 const char *action_desc;
1120 GtkTreeView *treeview;
1121 PolKitPolicyFileEntry *pfe;
1122 PolKitPolicyDefault *defaults;
1123 GtkWidget *label;
1124 GtkWidget *dialog;
1125 GtkWidget *hbox;
1126 GtkWidget *main_vbox;
1127 GtkWidget *icon;
1128 int response;
1129 EditImplData data;
1130 GtkWidget *modify_defaults_button;
1131
1132 treeview = gtk_tree_selection_get_tree_view (action_treeselect);
1133 pfe = get_selected_pfe (treeview);
1134 if (pfe == NULL)
1135 goto out;
1136
1137 defaults = polkit_policy_file_entry_get_default (pfe);
1138
1139 action_id = polkit_policy_file_entry_get_id (pfe);
1140 action_desc = polkit_policy_file_entry_get_action_description (pfe);
1141
1142 dialog = gtk_dialog_new_with_buttons (_("Edit Implicit Authorizations"),
1143 GTK_WINDOW (toplevel_window),
1144 GTK_DIALOG_MODAL,
1145 GTK_STOCK_CANCEL,
1146 GTK_RESPONSE_CANCEL,
1147 NULL);
1148 gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
1149
1150 hbox = gtk_hbox_new (FALSE, 12);
1151 gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
1152 gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
1153
1154 icon = gtk_image_new_from_stock (GTK_STOCK_PROPERTIES, GTK_ICON_SIZE_DIALOG);
1155 gtk_window_set_icon_name (GTK_WINDOW (dialog), GTK_STOCK_PROPERTIES);
1156 gtk_misc_set_alignment (GTK_MISC (icon), 0.5, 0.0);
1157 gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
1158
1159 main_vbox = gtk_vbox_new (FALSE, 8);
1160 gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0);
1161
1162 label = gtk_label_new (NULL);
1163 gtk_label_set_markup (GTK_LABEL (label), _("<b><big>Choose new implicit authorizations</big></b>"));
1164 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1165 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
1166 gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, TRUE, 0);
1167
1168 int n;
1169 GtkWidget *table;
1170 GtkWidget *edit_impl_combo_any;
1171 GtkWidget *edit_impl_combo_inactive;
1172 GtkWidget *edit_impl_combo_active;
1173
1174
1175 label = gtk_label_new (NULL);
1176 s2 = make_breakable (action_id, '.');
1177 s = g_strdup_printf (_("Implicit authorizations are authorizations that are granted "
1178 "automatically to users under certain circumstances. Choose "
1179 "what is required for the action <i>%s</i>."),
1180 s2);
1181 gtk_label_set_markup (GTK_LABEL (label), s);
1182 g_free (s);
1183 g_free (s2);
1184 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
1185 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1186 gtk_box_pack_start (GTK_BOX (main_vbox), label, FALSE, TRUE, 0);
1187
1188
1189 table = gtk_table_new (3, 2, FALSE);
1190 gtk_table_set_col_spacings (GTK_TABLE (table), 8);
1191 gtk_table_set_row_spacings (GTK_TABLE (table), 4);
1192 for (n = 0; n < 3; n++) {
1193 int m;
1194 const char *s;
1195 GtkWidget **combo;
1196 PolKitResult *allow;
1197 GCallback callback;
1198
1199 switch (n) {
1200 default:
1201 case 0:
1202 s = _("<i>Anyone:</i>");
1203 combo = &edit_impl_combo_any;
1204 allow = &data.any;
1205 data.any_orig = data.any = polkit_policy_default_get_allow_any (defaults);
1206 callback = (GCallback) edit_impl_combo_any_changed;
1207 break;
1208 case 1:
1209 s = _("<i>Console:</i>");
1210 combo = &edit_impl_combo_inactive;
1211 allow = &data.inactive;
1212 data.inactive_orig = data.inactive = polkit_policy_default_get_allow_inactive (defaults);
1213 callback = (GCallback) edit_impl_combo_inactive_changed;
1214 break;
1215 case 2:
1216 s = _("<i>Active Console:</i>");
1217 combo = &edit_impl_combo_active;
1218 allow = &data.active;
1219 data.active_orig = data.active = polkit_policy_default_get_allow_active (defaults);
1220 callback = (GCallback) edit_impl_combo_active_changed;
1221 break;
1222 }
1223
1224 label = gtk_label_new (NULL);
1225 gtk_label_set_markup (GTK_LABEL (label), s);
1226 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1227 gtk_table_attach (GTK_TABLE (table), label, 0, 1, n, n + 1, GTK_FILL, GTK_FILL, 0, 0);
1228
1229 *combo = gtk_combo_box_new_text ();
1230 for (m = 0; m < POLKIT_RESULT_N_RESULTS - 1; m++) {
1231 gtk_combo_box_append_text (GTK_COMBO_BOX (*combo), (edit_impl_result_options[m]).text);
1232 if ((edit_impl_result_options[m]).result == *allow) {
1233 gtk_combo_box_set_active (GTK_COMBO_BOX (*combo), m);
1234 }
1235 }
1236 g_signal_connect (*combo, "changed", callback, &data);
1237
1238 gtk_table_attach (GTK_TABLE (table), *combo, 1, 2, n, n + 1, GTK_FILL, GTK_FILL, 0, 0);
1239 }
1240 gtk_box_pack_start (GTK_BOX (main_vbox), table, TRUE, TRUE, 0);
1241
1242
1243 data.modify_defaults_action = polkit_gnome_action_new_default ("ModifyDefaults",
1244 pk_modify_defaults_action,
1245 _("_Modify..."),
1246 NULL);
1247 polkit_gnome_action_set_sensitive (data.modify_defaults_action, FALSE);
1248 modify_defaults_button = polkit_gnome_action_create_button (data.modify_defaults_action);
1249 g_object_unref (data.modify_defaults_action);
1250 gtk_dialog_add_action_widget (GTK_DIALOG (dialog), modify_defaults_button, GTK_RESPONSE_OK);
1251
1252 gtk_widget_show_all (dialog);
1253 response = gtk_dialog_run (GTK_DIALOG (dialog));
1254 gtk_widget_destroy (dialog);
1255
1256 if (response == GTK_RESPONSE_OK) {
1257 PolKitError *pk_error;
1258 PolKitPolicyDefault *new_defaults;
1259
1260 new_defaults = polkit_policy_default_new ();
1261 polkit_policy_default_set_allow_any (new_defaults, data.any);
1262 polkit_policy_default_set_allow_inactive (new_defaults, data.inactive);
1263 polkit_policy_default_set_allow_active (new_defaults, data.active);
1264
1265 pk_error = NULL;
1266 polkit_policy_file_entry_debug (pfe);
1267 if (!polkit_policy_file_entry_set_default (pfe, new_defaults, &pk_error)) {
1268 g_warning ("Error: code=%d: %s: %s",
1269 polkit_error_get_error_code (pk_error),
1270 polkit_error_get_error_name (pk_error),
1271 polkit_error_get_error_message (pk_error));
1272 polkit_error_free (pk_error);
1273 }
1274
1275 polkit_policy_default_unref (new_defaults);
1276 }
1277 out:
1278 if (pfe != NULL) {
1279 polkit_policy_file_entry_unref (pfe);
1280 }
1281 }
1282
1283 static void
1284 revert_impl_activate (PolKitGnomeAction *action, gpointer user_data)
1285 {
1286 GtkTreeView *treeview;
1287 PolKitPolicyFileEntry *pfe;
1288 PolKitPolicyDefault *factory_defaults;
1289 PolKitError *pk_error;
1290
1291 treeview = gtk_tree_selection_get_tree_view (action_treeselect);
1292 pfe = get_selected_pfe (treeview);
1293 if (pfe == NULL)
1294 goto out;
1295
1296 factory_defaults = polkit_policy_file_entry_get_default_factory (pfe);
1297
1298 pk_error = NULL;
1299 if (!polkit_policy_file_entry_set_default (pfe, factory_defaults, &pk_error)) {
1300 g_warning ("Error: code=%d: %s: %s",
1301 polkit_error_get_error_code (pk_error),
1302 polkit_error_get_error_name (pk_error),
1303 polkit_error_get_error_message (pk_error));
1304 polkit_error_free (pk_error);
1305 }
1306
1307 out:
1308 if (pfe != NULL) {
1309 polkit_policy_file_entry_unref (pfe);
1310 }
1311 }
1312
1313 static void
1314 summary_action_vendor_url_activated (SexyUrlLabel *url_label, char *url, gpointer user_data)
1315 {
1316 if (url != NULL) {
1317 gnome_vfs_url_show (url);
1318 }
1319 }
1320
1321 static void
1322 update_summary (void)
1323 {
1324 const char *action_id;
1325 const char *description;
1326 PolKitPolicyFileEntry *pfe;
1327 PolKitResult allow_any;
1328 PolKitResult allow_inactive;
1329 PolKitResult allow_active;
1330 PolKitPolicyDefault *defaults;
1331 GtkTreeView *treeview;
1332
1333 treeview = gtk_tree_selection_get_tree_view (action_treeselect);
1334 pfe = get_selected_pfe (treeview);
1335
1336 gtk_list_store_clear (authlist_store);
1337
1338 /* unref all reffed auths */
1339 g_slist_foreach (reffed_auths, (GFunc) polkit_authorization_unref, NULL);
1340 g_slist_free (reffed_auths);
1341 reffed_auths = NULL;
1342
1343
1344 if (pfe != NULL) {
1345 const char *vendor;
1346 const char *vendor_url;
1347 const char *icon_name;
1348
1349 action_id = polkit_policy_file_entry_get_id (pfe);
1350 description = polkit_policy_file_entry_get_action_description (pfe);
1351 vendor = polkit_policy_file_entry_get_action_vendor (pfe);
1352 vendor_url = polkit_policy_file_entry_get_action_vendor_url (pfe);
1353 icon_name = polkit_policy_file_entry_get_action_icon_name (pfe);
1354
1355 defaults = polkit_policy_file_entry_get_default (pfe);
1356 allow_any = polkit_policy_default_get_allow_any (defaults);
1357 allow_inactive = polkit_policy_default_get_allow_inactive (defaults);
1358 allow_active = polkit_policy_default_get_allow_active (defaults);
1359
1360 gtk_widget_set_sensitive (edit_impl_button, TRUE);
1361 gtk_widget_set_sensitive (grant_button, TRUE);
1362
1363 if (polkit_policy_default_equals (defaults, polkit_policy_file_entry_get_default_factory (pfe)))
1364 polkit_gnome_action_set_sensitive (revert_to_defaults_action, FALSE);
1365 else
1366 polkit_gnome_action_set_sensitive (revert_to_defaults_action, TRUE);
1367
1368 gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0);
1369
1370
1371 if (vendor_url != NULL) {
1372 char *s;
1373
1374 s = g_strdup_printf ("<a href=\"%s\">%s</a>", vendor_url, vendor);
1375 sexy_url_label_set_markup (SEXY_URL_LABEL (summary_action_vendor_label), s);
1376 g_free (s);
1377
1378 s = g_strdup_printf (_("Click to open %s"), vendor_url);
1379 gtk_widget_set_tooltip_markup (summary_action_vendor_label, s);
1380 g_free (s);
1381
1382 } else {
1383 sexy_url_label_set_markup (SEXY_URL_LABEL (summary_action_vendor_label), vendor);
1384 gtk_widget_set_tooltip_markup (summary_action_vendor_label, NULL);
1385 }
1386
1387 if (icon_name != NULL) {
1388 GdkPixbuf *pixbuf;
1389
1390 pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
1391 icon_name,
1392 48,
1393 0,
1394 NULL);
1395 gtk_image_set_from_pixbuf (GTK_IMAGE (summary_action_icon), pixbuf);
1396 g_object_unref (pixbuf);
1397 } else {
1398 gtk_image_clear (GTK_IMAGE (summary_action_icon));
1399 }
1400
1401 } else {
1402 action_id = "";
1403 description = "";
1404
1405 /* no active item */
1406 allow_any = -1;
1407 allow_inactive = -1;
1408 allow_active = -1;
1409
1410 gtk_widget_set_sensitive (edit_impl_button, FALSE);
1411 gtk_widget_set_sensitive (grant_button, FALSE);
1412
1413 polkit_gnome_action_set_sensitive (revert_to_defaults_action, FALSE);
1414
1415 gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1);
1416 }
1417
1418 /* ---- Action ---- */
1419 gtk_label_set_markup (GTK_LABEL (summary_action_id_label), action_id);
1420 gtk_label_set_markup (GTK_LABEL (summary_action_desc_label), description);
1421
1422 /* ---- Implicit Authorizations ---- */
1423 gtk_label_set_markup (GTK_LABEL (summary_label_any), _get_string_for_polkit_result (allow_any));
1424 gtk_label_set_markup (GTK_LABEL (summary_label_inactive), _get_string_for_polkit_result (allow_inactive));
1425 gtk_label_set_markup (GTK_LABEL (summary_label_active), _get_string_for_polkit_result (allow_active));
1426
1427 /* ---- Explicit Authorizations ---- */
1428 PolKitCaller *self;
1429 DBusError dbus_error;
1430 dbus_error_init (&dbus_error);
1431 self = polkit_tracker_get_caller_from_pid (pkgc->pk_tracker, getpid (), &dbus_error);
1432
1433 PolKitAuthorizationDB *authdb;
1434 authdb = polkit_context_get_authorization_db (pkgc->pk_context);
1435 if (authdb != NULL && strlen (action_id) > 0 && self != NULL) {
1436 AuthClosure ac;
1437
1438 ac.action_id = action_id;
1439 ac.self = self;
1440 ac.self_session = NULL;
1441 ac.self_session_objpath = NULL;
1442 ac.self_is_local = FALSE;
1443 ac.self_is_active = FALSE;
1444 ac.num_entries = 0;
1445
1446 polkit_caller_get_ck_session (self, &ac.self_session);
1447 polkit_session_get_ck_objref (ac.self_session, &ac.self_session_objpath);
1448 polkit_session_get_ck_is_local (ac.self_session, &ac.self_is_local);
1449 polkit_session_get_ck_is_active (ac.self_session, &ac.self_is_active);
1450
1451 PolKitAction *action;
1452 action = polkit_action_new ();
1453 polkit_action_set_action_id (action, action_id);
1454 PolKitError *pk_error = NULL;
1455 gboolean ret;
1456
1457 if (polkit_gnome_action_get_polkit_result (POLKIT_GNOME_ACTION (read_action)) == POLKIT_RESULT_YES) {
1458 ret = polkit_authorization_db_foreach_for_action (authdb,
1459 action,
1460 add_authorization,
1461 &ac,
1462 &pk_error);
1463 } else {
1464 ret = polkit_authorization_db_foreach_for_action_for_uid (authdb,
1465 action,
1466 getuid (),
1467 add_authorization,
1468 &ac,
1469 &pk_error);
1470 }
1471
1472 if (!ret) {
1473 if (pk_error != NULL) {
1474 g_warning ("Error: code=%d: %s",
1475 polkit_error_get_error_code (pk_error),
1476 polkit_error_get_error_message (pk_error));
1477 polkit_error_free (pk_error);
1478 }
1479 }
1480 polkit_action_unref (action);
1481
1482 GtkTreePath *path;
1483 path = gtk_tree_path_new_first ();
1484
1485 /* select the first entry in the authlist */
1486 gtk_tree_view_set_cursor (GTK_TREE_VIEW (authlist_treeview),
1487 path,
1488 NULL,
1489 FALSE);
1490 }
1491
1492 update_authlist ();
1493
1494 if (pfe != NULL) {
1495 polkit_policy_file_entry_unref (pfe);
1496 }
1497 }
1498
1499
1500 static void
1501 action_tree_changed (GtkTreeSelection *selection, gpointer user_data)
1502 {
1503 update_summary ();
1504 }
1505
1506 #if 0
1507 static gboolean
1508 is_authorized_from_pfe (PolKitPolicyFileEntry *pfe)
1509 {
1510 PolKitResult pk_result;
1511 PolKitAction *pk_action;
1512 gboolean is_authorized;
1513 static PolKitCaller *pk_caller = NULL;
1514
1515 if (pk_caller == NULL) {
1516 DBusError dbus_error;
1517 dbus_error_init (&dbus_error);
1518 pk_caller = polkit_tracker_get_caller_from_pid (pkgc->pk_tracker, getpid (), &dbus_error);
1519 }
1520
1521 pk_action = polkit_action_new ();
1522 polkit_action_set_action_id (pk_action, polkit_policy_file_entry_get_id (pfe));
1523 pk_result = polkit_context_is_caller_authorized (pkgc->pk_context, pk_action, pk_caller, FALSE, NULL);
1524 polkit_action_unref (pk_action);
1525
1526 is_authorized = (pk_result == POLKIT_RESULT_YES);
1527
1528 return is_authorized;
1529 }
1530 #endif
1531
1532 static polkit_bool_t
1533 build_action_list_pfe_iterator (PolKitPolicyCache *policy_cache, PolKitPolicyFileEntry *pfe, void *user_data)
1534 {
1535 GSList **pfe_list = (GSList **) user_data;
1536
1537 *pfe_list = g_slist_append (*pfe_list, pfe);
1538
1539 /* keep iterating */
1540 return FALSE;
1541 }
1542
1543 static gint
1544 pfe_compare (gconstpointer a, gconstpointer b)
1545 {
1546 PolKitPolicyFileEntry *pfe_a = (PolKitPolicyFileEntry *) a;
1547 PolKitPolicyFileEntry *pfe_b = (PolKitPolicyFileEntry *) b;
1548
1549 return - g_ascii_strcasecmp (polkit_policy_file_entry_get_id (pfe_a),
1550 polkit_policy_file_entry_get_id (pfe_b));
1551 }
1552
1553 typedef struct {
1554 const char *action_id;
1555 gboolean found;
1556 GtkTreeIter iter;
1557 } FIBAData;
1558
1559 static gboolean
1560 find_iter_by_action_id_foreach (GtkTreeModel *model,
1561 GtkTreePath *path,
1562 GtkTreeIter *iter,
1563 gpointer data)
1564 {
1565 gboolean ret;
1566 char *action_id = NULL;
1567 FIBAData *fiba_data = (FIBAData *) data;
1568
1569 ret = FALSE;
1570 gtk_tree_model_get (model, iter, ACTION_ID_COLUMN, &action_id, -1);
1571 if (strcmp (action_id, fiba_data->action_id) == 0) {
1572 fiba_data->found = TRUE;
1573 fiba_data->iter = *iter;
1574 ret = TRUE;
1575 }
1576 if (action_id != NULL)
1577 g_free (action_id);
1578
1579 return ret;
1580 }
1581
1582
1583 static gboolean
1584 find_iter_by_action_id (const char *action_id, GtkTreeIter *out_iter)
1585 {
1586 FIBAData fiba_data;
1587 gboolean ret;
1588
1589 fiba_data.action_id = action_id;
1590 fiba_data.found = FALSE;
1591 gtk_tree_model_foreach (GTK_TREE_MODEL (action_store), find_iter_by_action_id_foreach, &fiba_data);
1592 if (fiba_data.found) {
1593 if (out_iter != NULL)
1594 *out_iter = fiba_data.iter;
1595 ret = TRUE;
1596 } else {
1597 ret = FALSE;
1598 }
1599
1600 return ret;
1601 }
1602
1603 static void
1604 get_namespace_iter (const char *action_id, GtkTreeIter *out_iter)
1605 {
1606 int n;
1607 int len;
1608 char *namespace;
1609 char *pretty_name;
1610 GtkTreeIter parent_iter;
1611 gboolean got_parent;
1612
1613 got_parent = FALSE;
1614
1615 namespace = g_strdup (action_id);
1616 len = strlen (namespace);
1617 if (namespace[len - 1] == '.')
1618 len--;
1619 for (n = len - 1; n >= 0; n--) {
1620 if (namespace[n] == '.') {
1621 //namespace[n] = '\0';
1622 break;
1623 }
1624 namespace[n] = '\0';
1625 }
1626
1627 /* see if we have an element for namespace already */
1628 if (find_iter_by_action_id (namespace, out_iter))
1629 return;
1630
1631 /* get a parent */
1632 len = strlen (namespace);
1633 for (n = 0; n < len - 1; n++) {
1634 if (namespace[n] == '.') {
1635 get_namespace_iter (namespace, &parent_iter);
1636 got_parent = TRUE;
1637 }
1638 }
1639
1640 pretty_name = g_strdup (namespace);
1641 len = strlen (pretty_name);
1642 if (len > 0) {
1643 pretty_name[len - 1] = '\0';
1644 len--;
1645 }
1646 for (n = len - 1; n >= 0; n--) {
1647 if (pretty_name[n] == '.') {
1648 char *tmp;
1649 tmp = g_strdup (pretty_name + n + 1);
1650 g_free (pretty_name);
1651 pretty_name = tmp;
1652 break;
1653 }
1654 }
1655
1656 gtk_tree_store_append (action_store, out_iter, got_parent ? &parent_iter : NULL);
1657 gtk_tree_store_set (action_store, out_iter,
1658 ICON_COLUMN, namespace_pixbuf,
1659 ACTION_ID_COLUMN, namespace,
1660 ACTION_NAME_COLUMN, pretty_name,
1661 -1);
1662
1663 if (action_treeview != NULL && got_parent) {
1664 GtkTreePath *path;
1665 path = gtk_tree_model_get_path (GTK_TREE_MODEL (action_store), &parent_iter);
1666 gtk_tree_view_expand_row (GTK_TREE_VIEW (action_treeview),
1667 path,
1668 FALSE);
1669 gtk_tree_path_free (path);
1670 }
1671
1672 g_free (namespace);
1673 g_free (pretty_name);
1674 }
1675
1676 static GSList *to_remove = NULL;
1677
1678 static gboolean
1679 update_action_tree_cull (GtkTreeModel *model,
1680 GtkTreePath *path,
1681 GtkTreeIter *iter,
1682 gpointer user_data)
1683 {
1684 char *action_id;
1685 GSList *pfe_list = (GSList *) user_data;
1686 GSList *l;
1687 PolKitPolicyFileEntry *pfe;
1688
1689 gtk_tree_model_get (model, iter,
1690 ACTION_ID_COLUMN,
1691 &action_id,
1692 PFE_COLUMN,
1693 &pfe,
1694 -1);
1695 if (pfe != NULL) {
1696 polkit_policy_file_entry_unref (pfe);
1697 }
1698 if (action_id == NULL)
1699 goto out;
1700
1701 /* I'm sure one could use a better data structure that is O(log n) instead of this O(n) */
1702
1703 if (pfe == NULL) {
1704 /* this is a name space */
1705 for (l = pfe_list; l != NULL; l = l->next) {
1706 const char *action_id_l;
1707 PolKitPolicyFileEntry *pfe_l = l->data;
1708
1709 action_id_l = polkit_policy_file_entry_get_id (pfe_l);
1710 if (g_str_has_prefix (action_id_l, action_id))
1711 goto found;
1712 }
1713 } else {
1714 /* this is an action */
1715 for (l = pfe_list; l != NULL; l = l->next) {
1716 const char *action_id_l;
1717 PolKitPolicyFileEntry *pfe_l = l->data;
1718
1719 action_id_l = polkit_policy_file_entry_get_id (pfe_l);
1720 if (strcmp (action_id, action_id_l) == 0)
1721 goto found;
1722 }
1723 }
1724
1725 to_remove = g_slist_prepend (to_remove, gtk_tree_iter_copy (iter));
1726
1727 found:
1728 g_free (action_id);
1729
1730 out:
1731 return FALSE;
1732 }
1733
1734
1735 static void
1736 update_action_tree (void)
1737 {
1738 PolKitPolicyCache *pc;
1739 GSList *pfe_list;
1740 GSList *l;
1741
1742 pfe_list = NULL;
1743 pc = polkit_context_get_policy_cache (pkgc->pk_context);
1744 polkit_policy_cache_foreach (pc, build_action_list_pfe_iterator, &pfe_list);
1745 pfe_list = g_slist_sort (pfe_list, pfe_compare);
1746
1747 /* first insert new items from list into the tree... */
1748 for (l = pfe_list; l != NULL; l = l->next) {
1749 GtkTreeIter iter;
1750 const char *action_id;
1751 const char *description;
1752 const char *icon_name;
1753 PolKitPolicyFileEntry *pfe = l->data;
1754 GtkTreeIter name_space_iter;
1755
1756 action_id = polkit_policy_file_entry_get_id (pfe);
1757 description = polkit_policy_file_entry_get_action_description (pfe);
1758 icon_name = polkit_policy_file_entry_get_action_icon_name (pfe);
1759
1760 /* see if we have this one already */
1761 if (find_iter_by_action_id (action_id, &iter)) {
1762 /* we do; update the pfe */
1763 gtk_tree_store_set (action_store, &iter,
1764 PFE_COLUMN, pfe,
1765 -1);
1766 continue;
1767 }
1768
1769 get_namespace_iter (action_id, &name_space_iter);
1770
1771 gtk_tree_store_append (action_store, &iter, &name_space_iter);
1772 gtk_tree_store_set (action_store, &iter,
1773 ICON_COLUMN, action_pixbuf,
1774 ACTION_ID_COLUMN, action_id,
1775 ACTION_NAME_COLUMN, description,
1776 PFE_COLUMN, pfe,
1777 -1);
1778
1779 if (action_treeview != NULL) {
1780 GtkTreePath *path;
1781 path = gtk_tree_model_get_path (GTK_TREE_MODEL (action_store), &name_space_iter);
1782 gtk_tree_view_expand_row (GTK_TREE_VIEW (action_treeview),
1783 path,
1784 FALSE);
1785 gtk_tree_path_free (path);
1786 }
1787 }
1788
1789 /* ... then run through the tree and cull items no longer in the list */
1790 to_remove = NULL;
1791 gtk_tree_model_foreach (GTK_TREE_MODEL (action_store), update_action_tree_cull, pfe_list);
1792 for (l = to_remove; l != NULL; l = l->next) {
1793 GtkTreeIter *iter = l->data;
1794 gtk_tree_store_remove (action_store, iter);
1795 gtk_tree_iter_free (iter);
1796 }
1797 g_slist_free (to_remove);
1798 to_remove = NULL;
1799
1800 g_slist_free (pfe_list);
1801 }
1802
1803 static GtkWidget *
1804 action_list_new (void)
1805 {
1806 GtkCellRenderer *renderer;
1807 GtkTreeViewColumn *column;
1808 GtkWidget *treeview;
1809
1810 action_store = gtk_tree_store_new (N_COLUMNS,
1811 GDK_TYPE_PIXBUF,
1812 G_TYPE_STRING,
1813 G_TYPE_STRING,
1814 boxed_pfe_type);
1815
1816 treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (action_store));
1817
1818 column = gtk_tree_view_column_new ();
1819 renderer = gtk_cell_renderer_pixbuf_new ();
1820 gtk_tree_view_column_pack_start (column, renderer, FALSE);
1821 gtk_tree_view_column_set_attributes (column, renderer, "pixbuf", ICON_COLUMN, NULL);
1822
1823 renderer = gtk_cell_renderer_text_new ();
1824 gtk_tree_view_column_pack_start (column, renderer, FALSE);
1825 gtk_tree_view_column_set_attributes (column, renderer, "markup", ACTION_NAME_COLUMN, NULL);
1826 gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
1827
1828 gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
1829
1830 action_treeselect = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
1831 gtk_tree_selection_set_mode (action_treeselect, GTK_SELECTION_SINGLE);
1832 g_signal_connect (action_treeselect, "changed", (GCallback) action_tree_changed, NULL);
1833
1834 update_action_tree ();
1835
1836 gtk_tree_view_expand_all (GTK_TREE_VIEW (treeview));
1837
1838 return treeview;
1839 }
1840
1841 static void
1842 _pk_config_changed (PolKitGnomeContext *pk_g_context, gpointer user_data)
1843 {
1844 update_action_tree ();
1845 update_summary ();
1846 }
1847
1848 static void
1849 _pk_console_kit_db_changed (PolKitGnomeContext *pk_g_context, gpointer user_data)
1850 {
1851 /* for now, just use the same code as above... */
1852 _pk_config_changed (pk_g_context, user_data);
1853 }
1854
1855
1856 static GtkWidget *
1857 build_summary_box (void)
1858 {
1859 int n;
1860 GtkWidget *summary_box;
1861 GtkWidget *hbox;
1862 GtkWidget *vbox;
1863 GtkWidget *align;
1864 GtkWidget *label;
1865 GtkWidget *table;
1866 GtkWidget *button_box;
1867
1868 summary_box = gtk_vbox_new (FALSE, 4);
1869
1870 /* ---- Action ---- */
1871
1872 label = gtk_label_new (NULL);
1873 gtk_label_set_markup (GTK_LABEL (label), _("<b>Action</b>"));
1874 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1875 gtk_box_pack_start (GTK_BOX (summary_box), label, FALSE, FALSE, 0);
1876
1877 hbox = gtk_hbox_new (FALSE, 0);
1878 align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
1879 gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 0, 0, 0);
1880 gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, TRUE, 12);
1881
1882 table = gtk_table_new (3, 2, FALSE);
1883 gtk_table_set_col_spacings (GTK_TABLE (table), 8);
1884 gtk_table_set_row_spacings (GTK_TABLE (table), 4);
1885
1886 n = 0;
1887 label = gtk_label_new (NULL);
1888 gtk_label_set_markup (GTK_LABEL (label), _("<i>Identifier:</i>"));
1889 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1890 summary_action_id_label = gtk_label_new (NULL);
1891 gtk_misc_set_alignment (GTK_MISC (summary_action_id_label), 0.0, 0.5);
1892 gtk_label_set_ellipsize (GTK_LABEL (summary_action_id_label), PANGO_ELLIPSIZE_END);
1893 gtk_table_attach (GTK_TABLE (table), label, 0, 1, n, n + 1, GTK_FILL, GTK_FILL, 0, 0);
1894 gtk_table_attach (GTK_TABLE (table), summary_action_id_label, 1, 2, n, n + 1, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0);
1895 n++;
1896
1897 label = gtk_label_new (NULL);
1898 gtk_label_set_markup (GTK_LABEL (label), _("<i>Description:</i>"));
1899 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1900 summary_action_desc_label = gtk_label_new (NULL);
1901 gtk_misc_set_alignment (GTK_MISC (summary_action_desc_label), 0.0, 0.5);
1902 gtk_label_set_ellipsize (GTK_LABEL (summary_action_desc_label), PANGO_ELLIPSIZE_END);
1903 gtk_table_attach (GTK_TABLE (table), label, 0, 1, n, n + 1, GTK_FILL, GTK_FILL, 0, 0);
1904 gtk_table_attach (GTK_TABLE (table), summary_action_desc_label, 1, 2, n, n + 1, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0);
1905 n++;
1906
1907 label = gtk_label_new (NULL);
1908 gtk_label_set_markup (GTK_LABEL (label), _("<i>Vendor:</i>"));
1909 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1910 summary_action_vendor_label = sexy_url_label_new ();
1911 g_signal_connect (summary_action_vendor_label, "url-activated",
1912 (GCallback) summary_action_vendor_url_activated, NULL);
1913 gtk_misc_set_alignment (GTK_MISC (summary_action_vendor_label), 0.0, 0.5);
1914 gtk_label_set_ellipsize (GTK_LABEL (summary_action_vendor_label), PANGO_ELLIPSIZE_END);
1915 gtk_table_attach (GTK_TABLE (table), label, 0, 1, n, n + 1, GTK_FILL, GTK_FILL, 0, 0);
1916 gtk_table_attach (GTK_TABLE (table), summary_action_vendor_label, 1, 2, n, n + 1, GTK_EXPAND|GTK_FILL, GTK_FILL, 0, 0);
1917 n++;
1918
1919 gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0);
1920
1921 summary_action_icon = gtk_image_new ();
1922 gtk_misc_set_padding (GTK_MISC (summary_action_icon), 0, 0);
1923 gtk_box_pack_end (GTK_BOX (hbox), summary_action_icon, FALSE, TRUE, 0);
1924
1925 gtk_box_pack_start (GTK_BOX (summary_box), hbox, FALSE, TRUE, 0);
1926
1927 /* ---- Space ---- */
1928 align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
1929 gtk_box_pack_start (GTK_BOX (summary_box), align, FALSE, TRUE, 9);
1930
1931 /* ---- Implicit Authorizations ---- */
1932
1933 label = gtk_label_new (NULL);
1934 gtk_label_set_markup (GTK_LABEL (label), _("<b>Implicit Authorizations</b>"));
1935 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1936 gtk_box_pack_start (GTK_BOX (summary_box), label, FALSE, FALSE, 0);
1937
1938 hbox = gtk_hbox_new (FALSE, 24);
1939 vbox = gtk_vbox_new (FALSE, 6);
1940
1941 label = gtk_label_new (NULL);
1942 gtk_label_set_markup (GTK_LABEL (label), _("Implicit authorizations are authorizations automatically given to users based on certain criteria such as if they are on the local console."));
1943 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
1944 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1945 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
1946
1947 table = gtk_table_new (3, 2, FALSE);
1948 gtk_table_set_col_spacings (GTK_TABLE (table), 8);
1949 gtk_table_set_row_spacings (GTK_TABLE (table), 4);
1950 for (n = 0; n < 3; n++) {
1951 const char *s;
1952 GtkWidget **slabel;
1953
1954 switch (n) {
1955 default:
1956 case 0:
1957 s = _("<i>Anyone:</i>");
1958 slabel = &summary_label_any;
1959 break;
1960 case 1:
1961 s = _("<i>Console:</i>");
1962 slabel = &summary_label_inactive;
1963 break;
1964 case 2:
1965 s = _("<i>Active Console:</i>");
1966 slabel = &summary_label_active;
1967 break;
1968 }
1969 label = gtk_label_new (NULL);
1970 gtk_label_set_markup (GTK_LABEL (label), s);
1971 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1972 gtk_table_attach (GTK_TABLE (table), label, 0, 1, n, n + 1, GTK_FILL, GTK_FILL, 0, 0);
1973
1974
1975 *slabel = gtk_label_new (NULL);
1976 gtk_misc_set_alignment (GTK_MISC (*slabel), 0.0, 0.5);
1977 gtk_table_attach (GTK_TABLE (table), *slabel, 1, 2, n, n + 1, GTK_FILL, GTK_FILL, 0, 0);
1978 }
1979 gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0);
1980
1981 button_box = gtk_hbutton_box_new ();
1982 gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_START);
1983 gtk_box_set_spacing (GTK_BOX (button_box), 6);
1984
1985 edit_impl_button = gtk_button_new_with_mnemonic (_("_Edit..."));
1986 gtk_container_add (GTK_CONTAINER (button_box), edit_impl_button);
1987 g_signal_connect (edit_impl_button, "clicked", (GCallback) edit_impl_clicked, NULL);
1988
1989
1990 revert_to_defaults_action = polkit_gnome_action_new_default ("RevertToDefaults",
1991 pk_modify_defaults_action,
1992 _("Revert To _Defaults..."),
1993 NULL);
1994 g_signal_connect (revert_to_defaults_action, "activate", G_CALLBACK (revert_impl_activate), NULL);
1995 revert_impl_button = polkit_gnome_action_create_button (revert_to_defaults_action);
1996 gtk_container_add (GTK_CONTAINER (button_box), revert_impl_button);
1997
1998 gtk_box_pack_start (GTK_BOX (vbox), button_box, TRUE, TRUE, 0);
1999
2000
2001 align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
2002 gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, TRUE, 0);
2003 gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
2004
2005
2006 gtk_box_pack_start (GTK_BOX (summary_box), hbox, FALSE, TRUE, 0);
2007
2008 /* ---- Space ---- */
2009 align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
2010 gtk_box_pack_start (GTK_BOX (summary_box), align, FALSE, TRUE, 9);
2011
2012 /* ---- Explicit Authorizations ---- */
2013
2014 label = gtk_label_new (NULL);
2015 gtk_label_set_markup (GTK_LABEL (label), _("<b>Explicit Authorizations</b>"));
2016 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
2017 gtk_box_pack_start (GTK_BOX (summary_box), label, FALSE, FALSE, 0);
2018
2019 GtkWidget *hbox2;
2020
2021 hbox = gtk_hbox_new (FALSE, 24);
2022 vbox = gtk_vbox_new (FALSE, 6);
2023 hbox2 = gtk_hbox_new (FALSE, 6);
2024
2025 label = gtk_label_new (NULL);
2026 gtk_label_set_markup (GTK_LABEL (label), _("This list displays authorizations that are either obtained through authentication or specifically given to the entity in question. Blocked authorizations are marked with a STOP sign."));
2027 gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
2028 gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
2029 gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
2030
2031 GtkWidget *authlist_scrolled_window;
2032
2033 authlist_store = gtk_list_store_new (EXPLICIT_N_COLUMNS,
2034 GDK_TYPE_PIXBUF,
2035 G_TYPE_STRING,
2036 G_TYPE_STRING,
2037 G_TYPE_STRING,
2038 G_TYPE_STRING,
2039 G_TYPE_STRING,
2040 G_TYPE_POINTER);
2041
2042 authlist_treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (authlist_store));
2043
2044 GtkCellRenderer *renderer;
2045 GtkTreeViewColumn *column;
2046
2047 column = gtk_tree_view_column_new ();
2048 gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
2049 renderer = gtk_cell_renderer_pixbuf_new ();
2050 gtk_tree_view_column_pack_start (column, renderer, FALSE);
2051 gtk_tree_view_column_set_attributes (column, renderer, "pixbuf", EXPLICIT_ICON_COLUMN, NULL);
2052
2053 renderer = gtk_cell_renderer_text_new ();
2054 gtk_tree_view_column_pack_start (column, renderer, FALSE);
2055 gtk_tree_view_column_set_attributes (column, renderer, "markup", EXPLICIT_ENTITY_NAME_COLUMN, NULL);
2056 gtk_tree_view_column_set_title (column, _("Entity"));
2057 gtk_tree_view_append_column (GTK_TREE_VIEW (authlist_treeview), column);
2058
2059 column = gtk_tree_view_column_new ();
2060 gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
2061 renderer = gtk_cell_renderer_text_new ();
2062 gtk_tree_view_column_pack_start (column, renderer, FALSE);
2063 gtk_tree_view_column_set_attributes (column, renderer, "markup", EXPLICIT_SCOPE_COLUMN, NULL);
2064 gtk_tree_view_column_set_title (column, _("Scope"));
2065 gtk_tree_view_append_column (GTK_TREE_VIEW (authlist_treeview), column);
2066
2067 column = gtk_tree_view_column_new ();
2068 gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
2069 renderer = gtk_cell_renderer_text_new ();
2070 gtk_tree_view_column_pack_start (column, renderer, FALSE);
2071 gtk_tree_view_column_set_attributes (column, renderer, "markup", EXPLICIT_OBTAINED_COLUMN, NULL);
2072 gtk_tree_view_column_set_title (column, _("Obtained"));
2073 gtk_tree_view_append_column (GTK_TREE_VIEW (authlist_treeview), column);
2074
2075 column = gtk_tree_view_column_new ();
2076 gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
2077 renderer = gtk_cell_renderer_text_new ();
2078 gtk_tree_view_column_pack_start (column, renderer, FALSE);
2079 gtk_tree_view_column_set_attributes (column, renderer, "markup", EXPLICIT_OBTAINED_HOW_COLUMN, NULL);
2080 gtk_tree_view_column_set_title (column, _("How"));
2081 gtk_tree_view_append_column (GTK_TREE_VIEW (authlist_treeview), column);
2082
2083 column = gtk_tree_view_column_new ();
2084 gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
2085 renderer = gtk_cell_renderer_text_new ();
2086 gtk_tree_view_column_pack_start (column, renderer, FALSE);
2087 gtk_tree_view_column_set_attributes (column, renderer, "markup", EXPLICIT_CONSTRAINTS_COLUMN, NULL);
2088 gtk_tree_view_column_set_title (column, _("Constraints"));
2089 gtk_tree_view_append_column (GTK_TREE_VIEW (authlist_treeview), column);
2090
2091
2092 authlist_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
2093 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (authlist_scrolled_window),
2094 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
2095 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (authlist_scrolled_window),
2096 GTK_SHADOW_IN);
2097 gtk_container_add (GTK_CONTAINER (authlist_scrolled_window), authlist_treeview);
2098
2099 authlist_treeselect = gtk_tree_view_get_selection (GTK_TREE_VIEW (authlist_treeview));
2100 gtk_tree_selection_set_mode (authlist_treeselect, GTK_SELECTION_SINGLE);
2101 g_signal_connect (authlist_treeselect, "changed", (GCallback) authlist_changed, NULL);
2102
2103 GtkWidget *button;
2104
2105 button_box = gtk_vbutton_box_new ();
2106 gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_START);
2107 gtk_box_set_spacing (GTK_BOX (button_box), 6);
2108
2109 grant_button = gtk_button_new_with_mnemonic (_("_Grant..."));
2110 gtk_button_set_image (GTK_BUTTON (grant_button),
2111 gtk_image_new_from_stock (GTK_STOCK_ADD,
2112 GTK_ICON_SIZE_SMALL_TOOLBAR));
2113 g_signal_connect (grant_button, "clicked", (GCallback) grant_clicked, NULL);
2114 gtk_container_add (GTK_CONTAINER (button_box), grant_button);
2115
2116 block_button = gtk_button_new_with_mnemonic (_("_Block..."));
2117 gtk_button_set_image (GTK_BUTTON (block_button),
2118 gtk_image_new_from_stock (GTK_STOCK_STOP,
2119 GTK_ICON_SIZE_SMALL_TOOLBAR));
2120 g_signal_connect (block_button, "clicked", (GCallback) block_clicked, NULL);
2121 gtk_container_add (GTK_CONTAINER (button_box), block_button);
2122
2123
2124 revoke_action = polkit_gnome_action_new ("RevokeAction");
2125 g_object_set (revoke_action,
2126 "polkit-action", pk_revoke_action,
2127 "no-visible", TRUE,
2128 "no-sensitive", FALSE,
2129 "no-short-label", NULL,
2130 "no-label", _("_Revoke"),
2131 "no-tooltip", NULL,
2132 "no-icon-name", GTK_STOCK_CLEAR,
2133
2134 "auth-visible", TRUE,
2135 "auth-sensitive", TRUE,
2136 "auth-short-label", NULL,
2137 "auth-label", _("_Revoke..."),
2138 "auth-tooltip", NULL,
2139 "auth-icon-name", GTK_STOCK_CLEAR,
2140
2141 "yes-visible", TRUE,
2142 "yes-sensitive", TRUE,
2143 "yes-short-label", NULL,
2144 "yes-label", _("_Revoke"),
2145 "yes-tooltip", NULL,
2146 "yes-icon-name", GTK_STOCK_CLEAR,
2147 NULL);
2148
2149 g_signal_connect (revoke_action, "activate", G_CALLBACK (revoke_action_activate), NULL);
2150 button = polkit_gnome_action_create_button (revoke_action);
2151 gtk_container_add (GTK_CONTAINER (button_box), button);
2152
2153
2154 GtkWidget *read_all_auths;
2155
2156 read_action = polkit_gnome_toggle_action_new_default ("read", pk_read_action,
2157 _("_Show authorizations from all users..."),
2158 _("_Show authorizations from all users"));
2159 read_all_auths = gtk_check_button_new ();
2160 gtk_action_connect_proxy (GTK_ACTION (read_action), read_all_auths);
2161
2162 align = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
2163 gtk_box_pack_start (GTK_BOX (hbox2), authlist_scrolled_window, TRUE, TRUE, 0);
2164 gtk_box_pack_start (GTK_BOX (hbox2), button_box, FALSE, TRUE, 0);
2165
2166 gtk_box_pack_start (GTK_BOX (vbox), hbox2, TRUE, TRUE, 0);
2167 gtk_box_pack_start (GTK_BOX (vbox), read_all_auths, FALSE, FALSE, 0);
2168
2169 gtk_box_pack_start (GTK_BOX (hbox), align, FALSE, TRUE, 0);
2170 gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
2171
2172 gtk_box_pack_start (GTK_BOX (summary_box), hbox, TRUE, TRUE, 0);
2173
2174 return summary_box;
2175 }
2176
2177 typedef struct SingleInstance SingleInstance;
2178 typedef struct SingleInstanceClass SingleInstanceClass;
2179
2180 GType single_instance_get_type (void);
2181
2182 struct SingleInstance
2183 {
2184 GObject parent;
2185 };
2186
2187 struct SingleInstanceClass
2188 {
2189 GObjectClass parent;
2190 };
2191
2192 #define TYPE_SINGLE_INSTANCE (single_instance_get_type ())
2193 #define SINGLE_INSTANCE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), TYPE_SINGLE_INSTANCE, SingleInstance))
2194 #define SINGLE_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SINGLE_INSTANCE, SingleInstanceClass))
2195 #define IS_SINGLE_INSTANCE_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), TYPE_SINGLE_INSTANCE))
2196 #define IS_SINGLE_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SINGLE_INSTANCE))
2197 #define SINGLE_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SINGLE_INSTANCE, SingleInstanceClass))
2198
2199 G_DEFINE_TYPE(SingleInstance, single_instance, G_TYPE_OBJECT)
2200
2201 gboolean single_instance_show_action (SingleInstance *obj, const char *action_id, GError **error);
2202
2203 #include "single-instance-glue.h"
2204
2205 static void
2206 single_instance_init (SingleInstance *obj)
2207 {
2208 }
2209
2210 static void
2211 single_instance_class_init (SingleInstanceClass *klass)
2212 {
2213 }
2214
2215 gboolean
2216 single_instance_show_action (SingleInstance *obj, const char *action_id, GError **error)
2217 {
2218 GtkTreeIter iter;
2219
2220 if (find_iter_by_action_id (action_id, &iter)) {
2221 GtkTreePath *path;
2222
2223 path = gtk_tree_model_get_path (GTK_TREE_MODEL (action_store), &iter);
2224 if (path != NULL) {
2225 gtk_tree_view_set_cursor (GTK_TREE_VIEW (action_treeview),
2226 path,
2227 NULL,
2228 FALSE);
2229 gtk_tree_path_free (path);
2230
2231 /* bring top level window to front */
2232 if (toplevel_window != NULL)
2233 gtk_window_present (GTK_WINDOW (toplevel_window));
2234 }
2235 }
2236
2237 return TRUE;
2238 }
2239
2240
2241 static gboolean
2242 setup_single_instance (void)
2243 {
2244 gboolean ret;
2245 GObject *single_instance;
2246 GError *error;
2247 DBusGConnection *bus;
2248 DBusGProxy *bus_proxy;
2249 guint result;
2250 const char bus_name[] = "org.gnome.PolicyKit.AuthorizationManager";
2251
2252 ret = FALSE;
2253
2254 error = NULL;
2255 bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
2256 if (bus == NULL) {
2257 g_warning ("Couldn't connect to session bus: %s", error->message);
2258 g_error_free (error);
2259 goto out;
2260 }
2261
2262 bus_proxy = dbus_g_proxy_new_for_name (bus,
2263 DBUS_SERVICE_DBUS,
2264 DBUS_PATH_DBUS,
2265 DBUS_INTERFACE_DBUS);
2266 if (bus_proxy == NULL) {
2267 g_warning ("Could not construct bus_proxy object; bailing out");
2268 goto out;
2269 }
2270
2271 if (!dbus_g_proxy_call (bus_proxy,
2272 "RequestName",
2273 &error,
2274 G_TYPE_STRING, bus_name,
2275 G_TYPE_UINT, 0,
2276 G_TYPE_INVALID,
2277 G_TYPE_UINT, &result,
2278 G_TYPE_INVALID)) {
2279 if (error != NULL) {
2280 g_warning ("Failed to acquire %s: %s", bus_name, error->message);
2281 g_error_free (error);
2282 } else {
2283 g_warning ("Failed to acquire %s", bus_name);
2284 }
2285 goto out;
2286 }
2287
2288 if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
2289 if (error != NULL) {
2290 g_warning ("Failed to acquire %s: %s", bus_name, error->message);
2291 g_error_free (error);
2292 } else {
2293 g_warning ("Failed to acquire %s", bus_name);
2294 }
2295 goto out;
2296 }
2297
2298 dbus_g_object_type_install_info (TYPE_SINGLE_INSTANCE, &dbus_glib_single_instance_object_info);
2299
2300 single_instance = g_object_new (TYPE_SINGLE_INSTANCE, NULL);
2301
2302 dbus_g_connection_register_g_object (bus, "/", G_OBJECT (single_instance));
2303
2304 ret = TRUE;
2305
2306 out:
2307 return ret;
2308 }
2309
2310 int
2311 main (int argc, char **argv)
2312 {
2313 GtkWidget *vbox;
2314 GtkWidget *treeview_scrolled_window;
2315 GtkWidget *button;
2316 GtkWidget *hbutton_box;
2317 GMainLoop*loop;
2318 GtkWidget *pane;
2319
2320 gtk_init (&argc, &argv);
2321
2322 if (!setup_single_instance ()) {
2323 g_debug ("Already running");
2324 return 1;
2325 }
2326
2327 boxed_pfe_type = g_boxed_type_register_static ("GBoxedPolKitPolicyFileEntry",
2328 (GBoxedCopyFunc) polkit_policy_file_entry_ref,
2329 (GBoxedFreeFunc) polkit_policy_file_entry_unref);
2330
2331 loop = g_main_loop_new (NULL, FALSE);
2332
2333 pkgc = polkit_gnome_context_get (NULL);
2334 polkit_context_set_load_descriptions (pkgc->pk_context);
2335
2336 pk_revoke_action = polkit_action_new ();
2337 polkit_action_set_action_id (pk_revoke_action, "org.freedesktop.policykit.revoke");
2338
2339 pk_read_action = polkit_action_new ();
2340 polkit_action_set_action_id (pk_read_action, "org.freedesktop.policykit.read");
2341
2342 pk_grant_action = polkit_action_new ();
2343 polkit_action_set_action_id (pk_grant_action, "org.freedesktop.policykit.grant");
2344
2345 pk_modify_defaults_action = polkit_action_new ();
2346 polkit_action_set_action_id (pk_modify_defaults_action, "org.freedesktop.policykit.modify-defaults");
2347
2348 action_pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
2349 "application-x-executable",
2350 24,
2351 0,
2352 NULL);
2353
2354 person_pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
2355 "stock_person",
2356 24,
2357 0,
2358 NULL);
2359
2360 namespace_pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
2361 "gnome-mime-application-x-archive",
2362 24,
2363 0,
2364 NULL);
2365
2366 stop_pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
2367 GTK_STOCK_STOP,
2368 24,
2369 0,
2370 NULL);
2371
2372
2373 toplevel_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
2374
2375 vbox = gtk_vbox_new (FALSE, 6);
2376 gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
2377 gtk_container_add (GTK_CONTAINER (toplevel_window), vbox);
2378
2379 summary_box = build_summary_box ();
2380 gtk_container_set_border_width (GTK_CONTAINER (summary_box), 8);
2381
2382 action_treeview = action_list_new ();
2383 treeview_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
2384 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (treeview_scrolled_window),
2385 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
2386 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (treeview_scrolled_window),
2387 GTK_SHADOW_IN);
2388 gtk_container_add (GTK_CONTAINER (treeview_scrolled_window), action_treeview);
2389
2390 pane = gtk_hpaned_new ();
2391 gtk_paned_add1 (GTK_PANED (pane), treeview_scrolled_window);
2392
2393 notebook = gtk_notebook_new ();
2394
2395 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), summary_box, NULL);
2396 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), gtk_label_new (_("Select an action")), NULL);
2397 gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
2398 gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
2399
2400 gtk_paned_add2 (GTK_PANED (pane), notebook);
2401 gtk_paned_set_position (GTK_PANED (pane), 300);
2402 gtk_box_pack_start (GTK_BOX (vbox), pane, TRUE, TRUE, 0);
2403
2404 //gtk_box_pack_start (GTK_BOX (vbox), treeview_scrolled_window, TRUE, TRUE, 0);
2405 //gtk_box_pack_start (GTK_BOX (vbox), summary_box, FALSE, TRUE, 0);
2406
2407 /* button box */
2408
2409 hbutton_box = gtk_hbutton_box_new ();
2410 gtk_button_box_set_layout (GTK_BUTTON_BOX (hbutton_box), GTK_BUTTONBOX_END);
2411 gtk_box_set_spacing (GTK_BOX (hbutton_box), 6);
2412
2413 button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
2414 g_signal_connect (button, "clicked", (GCallback) exit, NULL);
2415 gtk_container_add (GTK_CONTAINER (hbutton_box), button);
2416
2417
2418 gtk_box_pack_start (GTK_BOX (vbox), hbutton_box, FALSE, TRUE, 0);
2419
2420 gtk_window_set_icon_name (GTK_WINDOW (toplevel_window), "gtk-dialog-authentication");
2421 gtk_window_set_default_size (GTK_WINDOW (toplevel_window), 800, 700);
2422 gtk_window_set_title (GTK_WINDOW (toplevel_window), _("Authorizations"));
2423 g_signal_connect (toplevel_window, "delete-event", (GCallback) exit, NULL);
2424 gtk_widget_show_all (toplevel_window);
2425
2426 g_signal_connect (pkgc,
2427 "config-changed",
2428 G_CALLBACK (_pk_config_changed),
2429 NULL);
2430
2431 g_signal_connect (pkgc,
2432 "console-kit-db-changed",
2433 G_CALLBACK (_pk_console_kit_db_changed),
2434 NULL);
2435
2436 update_summary ();
2437
2438 g_main_loop_run (loop);
2439 return 0;
2440 }
0 <?xml version="1.0" encoding="UTF-8" ?>
1
2 <node name="/">
3 <interface name="org.gnome.PolicyKit.AuthorizationManager.SingleInstance">
4 <method name="ShowAction">
5 <arg name="action_id" type="s"/>
6 </method>
7 </interface>
8 </node>