##option(USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR"Prefer to install the <package>Config.cmake files to lib/cmake/<package> instead of lib/<package>/cmake"TRUE)
kickL->setText(tr("Making the helper <b>Kick</b> is not allowed. Action cannot be activated."));
kickPB->setText(tr("Kick!"));
cryL->setText(tr("Making the helper <b>Cry</b> is always allowed. Action can be activated without authentication."));
cryPB->setText(tr("Cry!"));
bleedL->setText(tr("Making the helper <b>Bleed</b> requires the user to authenticate. This is a one-shot authorization."));
bleedPB->setText(tr("Bleed!"));
playL->setText(tr("Making the helper <b>Play</b> requires a system administrator to authenticate. This is a one-shot authorization."));
playPB->setText(tr("Play!"));
listenL->setText(tr("Making the helper <b>Listen</b> requires the user to authenticate. The authorization will be kept for a brief period."));
listenPB->setText(tr("Listen!"));
deleteL->setText(tr("Making the helper <b>Delete</b> requires a system administrator to authenticate. The authorization will be kept for a brief period."));
deletePB->setText(tr("Delete!"));
deleteL_2->setText(tr("<b>Set</b> is special action. It sets the permissions for the <b>Shout</b> action by actually using the helper application to change the implicit authorization."));
setCB->clear();
setCB->insertItem(tr("no"));
setCB->insertItem(tr("yes"));
setCB->insertItem(tr("auth_self"));
setCB->insertItem(tr("auth_admin"));
setCB->insertItem(tr("auth_self_keep"));
setCB->insertItem(tr("auth_admin_keep"));
setPB->setText(tr("Set!"));
deleteL_3->setText(tr("The implicit authorization for the <b>Shout</b> action is set by the <b>Set</b> action. You can watch how different options can change behaviour of this action."));
shoutPB->setText(tr("Shout!"));
toolBar->setCaption(tr("toolBar"));
if(menubar->findItem(2))
{
menubar->findItem(2)->setText(tr("&Actions"));
}
}
voidPkExample::activateAction()
{
// Here we cast the sender() to an Action and call activate()
// on it.
// Be careful in doing the same for ActionButton won't work as expected
// as action->activate() is calling Action::activate() and
// not ActionButton::activate which are different.
// You can cast then to ActionButton but be carefull
// an Action casted to ActionButton may crash you app
Action*action=qobject_cast<Action*>(sender());
// calling activate with winId() makes the auth dialog
// be correct parented with your application.
action->activate();
// Here we cast the sender() to an Action and call activate() on it.
// Be careful in doing the same for ActionButton won't work as expected
// as action->activate() is calling Action::activate() and
// not ActionButton::activate which are different.
// You can cast then to ActionButton but be carefull
// an Action casted to ActionButton may crash you app
Action*action=::tqt_cast<Action*>(sender());
// calling activate with winId() makes the auth dialog
// be correct parented with your application.
action->activate();
}
voidPkExample::actionActivated()
{
// This slot is called whenever an action is allowed
// here you will do your dirt job by calling a helper application
// that might erase your hardrive ;)
Action*action=qobject_cast<Action*>(sender());
// this is our Special Action that after allowed will call the helper
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Making the helper <span style=" font-weight:600;">Cry</span> is always allowed. Action can be triggered without authentication.</p></body></html></string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="TQPushButton" name="cryPB">
<property name="text">
<string>Cry!</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="TQLabel" name="bleedL">
<property name="text">
<string>Making the helper <b>Bleed</b> requires the user to authenticate. This is a one-shot authorization.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="TQPushButton" name="bleedPB">
<property name="text">
<string>Bleed!</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="TQLabel" name="playL">
<property name="text">
<string>Making the helper <b>Play</b> requires a system administrator to authenticate. This is a one-shot authorization.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="TQPushButton" name="playPB">
<property name="text">
<string>Play!</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="TQLabel" name="listenL">
<property name="text">
<string>Making the helper <b>Listen</b> requires the user to authenticate. The authorization will be kept for a brief period.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="TQPushButton" name="listenPB">
<property name="text">
<string>Listen!</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="TQLabel" name="deleteL">
<property name="text">
<string>Making the helper <b>Delete</b> requires a system administrator to authenticate. The authorization will be kept for a brief period.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="TQPushButton" name="deletePB">
<property name="text">
<string>Delete!</string>
</property>
</widget>
</item>
<item row="6" column="0" rowspan="2">
<widget class="TQLabel" name="deleteL_2">
<property name="text">
<string><b>Set</b> is special action. It sets the permissions for the <b>Shout</b> action by actually using the helper application to change the implicit authorization.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="TQComboBox" name="setCB">
<item>
<property name="text">
<string>no</string>
</property>
</item>
<item>
<property name="text">
<string>yes</string>
</property>
</item>
<item>
<property name="text">
<string>auth_self</string>
</property>
</item>
<item>
<property name="text">
<string>auth_admin</string>
</property>
</item>
<item>
<property name="text">
<string>auth_self_keep</string>
</property>
</item>
<item>
<property name="text">
<string>auth_admin_keep</string>
</property>
</item>
</widget>
</item>
<item row="7" column="1">
<widget class="TQPushButton" name="setPB">
<property name="text">
<string>Set!</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="TQLabel" name="deleteL_3">
<property name="text">
<string>The implicit authorization for the <b>Shout</b> action is set by the <b>Set</b> action. You can watch how different options can change behaviour of this action.</string>