|
|
@ -145,32 +145,32 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application",
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
// this signal is emitted when the user click on the action,
|
|
|
|
// this signal is emitted when the user click on the action,
|
|
|
|
// it will only happen if it was inserted in a TQMenu or a TQToolBar
|
|
|
|
// it will only happen if it was inserted in a TQMenu or a TQToolBar
|
|
|
|
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
|
|
|
|
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
|
|
|
|
// This signal was propagated from the TQButton just for
|
|
|
|
// This signal was propagated from the TQButton just for
|
|
|
|
// convenience in this case we don't have any benefit but the code
|
|
|
|
// convenience in this case we don't have any benefit but the code
|
|
|
|
// look cleaner
|
|
|
|
// look cleaner
|
|
|
|
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
|
|
|
|
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
|
|
|
|
// this is the Action activated signal, it is always emmited whenever
|
|
|
|
// this is the Action activated signal, it is always emmited whenever
|
|
|
|
// someone click and get authorized to do the action
|
|
|
|
// someone click and get authorized to do the action
|
|
|
|
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
|
|
|
|
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
|
|
|
|
|
|
|
|
|
|
|
|
bt = new ActionButton(cryPB, "org.tqt.policykit.examples.cry", this);
|
|
|
|
bt = new ActionButton(cryPB, "org.tqt.policykit.examples.cry", this);
|
|
|
|
bt->setText("Cry!");
|
|
|
|
bt->setText("Cry!");
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"));
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"));
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
|
|
|
|
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
|
|
|
|
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
|
|
|
|
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
|
|
|
|
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
|
|
|
|
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
|
|
|
|
|
|
|
|
|
|
|
|
bt = new ActionButton(bleedPB, "org.tqt.policykit.examples.bleed", this);
|
|
|
|
bt = new ActionButton(bleedPB, "org.tqt.policykit.examples.bleed", this);
|
|
|
|
bt->setText("Bleed!");
|
|
|
|
bt->setText("Bleed!");
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/action-locked-default.png"));
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/action-locked-default.png"));
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
|
|
|
|
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
|
|
|
|
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
|
|
|
|
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
|
|
|
|
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
|
|
|
|
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
|
|
|
|
|
|
|
|
|
|
|
|
// This action is more customized
|
|
|
|
// This action is more customized
|
|
|
|
bt = new ActionButton(playPB, "org.tqt.policykit.examples.play", this);
|
|
|
|
bt = new ActionButton(playPB, "org.tqt.policykit.examples.play", this);
|
|
|
@ -191,9 +191,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application",
|
|
|
|
bt->setToolTip("Go ahead, play!", Action::Yes);
|
|
|
|
bt->setToolTip("Go ahead, play!", Action::Yes);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
|
|
|
|
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
|
|
|
|
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
|
|
|
|
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
|
|
|
|
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
|
|
|
|
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
|
|
|
|
|
|
|
|
|
|
|
|
bt = new ActionButton(listenPB, "org.tqt.policykit.examples.listen", this);
|
|
|
|
bt = new ActionButton(listenPB, "org.tqt.policykit.examples.listen", this);
|
|
|
|
bt->setText("Listen!");
|
|
|
|
bt->setText("Listen!");
|
|
|
@ -202,9 +202,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application",
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"), Action::Yes);
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"), Action::Yes);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
|
|
|
|
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
|
|
|
|
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
|
|
|
|
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
|
|
|
|
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
|
|
|
|
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
|
|
|
|
|
|
|
|
|
|
|
|
bt = new ActionButton(deletePB, "org.tqt.policykit.examples.delete", this);
|
|
|
|
bt = new ActionButton(deletePB, "org.tqt.policykit.examples.delete", this);
|
|
|
|
bt->setText("Delete!");
|
|
|
|
bt->setText("Delete!");
|
|
|
@ -213,9 +213,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application",
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"), Action::Yes);
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"), Action::Yes);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
|
|
|
|
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
|
|
|
|
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
|
|
|
|
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
|
|
|
|
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
|
|
|
|
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
|
|
|
|
|
|
|
|
|
|
|
|
bt = new ActionButton(setPB, "org.tqt.policykit.examples.set", this);
|
|
|
|
bt = new ActionButton(setPB, "org.tqt.policykit.examples.set", this);
|
|
|
|
bt->setText("Set!");
|
|
|
|
bt->setText("Set!");
|
|
|
@ -224,9 +224,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application",
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"), Action::Yes);
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"), Action::Yes);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
|
|
|
|
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
|
|
|
|
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
|
|
|
|
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
|
|
|
|
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
|
|
|
|
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
|
|
|
|
|
|
|
|
|
|
|
|
bt = new ActionButton(shoutPB, "org.tqt.policykit.examples.shout", this);
|
|
|
|
bt = new ActionButton(shoutPB, "org.tqt.policykit.examples.shout", this);
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-no.png"), Action::No);
|
|
|
|
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-no.png"), Action::No);
|
|
|
@ -237,9 +237,9 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application",
|
|
|
|
bt->setText("Shout!", Action::Yes);
|
|
|
|
bt->setText("Shout!", Action::Yes);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
|
|
|
|
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
|
|
|
|
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
|
|
|
|
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
|
|
|
|
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
|
|
|
|
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
|
|
|
|
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void PkExample::languageChange()
|
|
|
|
void PkExample::languageChange()
|
|
|
|