Compare commits

..

7 Commits

Author SHA1 Message Date
Michele Calgaro d1fcf13acd
Use TDE cmake macro to set version
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 511a1ddc0f)
3 years ago
aneejit1 b7557352a9
Add DBUS_TQT_LIBRARY_DIRS to the link_directories
Add the library paths for the dbus-1-tqt library to the list of
link_directories in the CMakeLists.txt files for the examples
subdirectory to cater for the library not being in /usr.

Signed-off-by: aneejit1 <aneejit1@gmail.com>
(cherry picked from commit 0ba61b9a6b)
3 years ago
aneejit1 6c3c07ec7c
Add POLKIT_GOBJECT_LIBRARY_DIRS to the link_directories
Add the library paths for the glib/gobject libraries to the list of
link_directories in the CMakeLists.txt files for core, gui, and
agent subdirectories to cater for glib not being in /usr.

Signed-off-by: aneejit1 <aneejit1@gmail.com>
(cherry picked from commit 89acf6a1fd)
3 years ago
Slávek Banko 371a1fed23
Update version number to the upcoming R14.0.13.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
3 years ago
Michele Calgaro 905c36bbd2
Removed setting of CXX_FEATURES at module level since CXX_FEATURES are now enabled at TDE project level.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit fc35cfac16)
4 years ago
Slávek Banko 7ccbd3b0cd
Use TQT_CMAKE_DIR for installation of exported CMake targets.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 2f98b15156)
4 years ago
Michele Calgaro fe5767ba0a
Added project version for r14.0.x branch.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago

@ -9,21 +9,9 @@
#
#################################################
##### set project version ########################
include( TDEVersion )
cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
tde_set_project_version( )
##### general package setup #####################
## Polkit TQt Library
project("polkit-tqt")
##### include essential cmake modules ###########
set(POLKIT-TQT_VERSION_MAJOR 0)
set(POLKIT-TQT_VERSION_MINOR 103)
set(POLKIT-TQT_VERSION_PATCH 0)
@ -33,6 +21,8 @@ set(POLKIT-TQT_VERSION_STRING
##### cmake setup ###############################
cmake_minimum_required( VERSION 3.1 )
include( FindPkgConfig )
include( CheckCXXSourceCompiles )
include( CheckSymbolExists )
@ -41,6 +31,11 @@ include( TDEMacros )
enable_testing( )
##### set version number ########################
tde_set_project_version( )
##### optional stuff
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )

@ -74,9 +74,9 @@ This demonstrates the use of ActionButtons, that lets you associate multiple but
single action with extreme ease. \c listenPB and \c listenCB are kept in sync with the action.
\code
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
\endcode
Those three signals are all you need to control the action and the activation. Action::activated()

@ -50,7 +50,7 @@ class Listener;
class ListenerAdapter : public TQObject
{
TQ_OBJECT
Q_OBJECT
public:
static ListenerAdapter* instance();

@ -57,7 +57,7 @@ class ListenerPrivate;
*/
class POLKIT_TQT_EXPORT Listener : public TQObject
{
TQ_OBJECT
Q_OBJECT
public:
/**

@ -84,7 +84,7 @@ class POLKIT_TQT_EXPORT AsyncResult
*/
class POLKIT_TQT_EXPORT Session : public TQObject
{
TQ_OBJECT
Q_OBJECT
public:
/**

@ -66,7 +66,7 @@ namespace PolkitTQt
*/
class POLKIT_TQT_EXPORT Authority : public TQObject
{
TQ_OBJECT
Q_OBJECT
public:
enum Result

@ -88,7 +88,7 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application",
grid->addWidget(deletePB, 5, 1);
deleteL_2 = new TQLabel(privateLayoutWidget, "deleteL_2");
setCB = new TQComboBox(false, privateLayoutWidget, "setCB");
setCB = new TQComboBox(FALSE, privateLayoutWidget, "setCB");
grid->addMultiCellWidget(deleteL_2, 6, 7, 0, 0);
grid->addWidget(setCB, 6, 1);
@ -145,32 +145,32 @@ PkExample::PkExample() : TQMainWindow(nullptr, "Polkit tqt example application",
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
// 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
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
// This signal was propagated from the TQButton just for
// convenience in this case we don't have any benefit but the code
// look cleaner
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
// this is the Action activated signal, it is always emmited whenever
// someone click and get authorized to do the action
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
bt = new ActionButton(cryPB, "org.tqt.policykit.examples.cry", this);
bt->setText("Cry!");
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/custom-yes.png"));
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
bt = new ActionButton(bleedPB, "org.tqt.policykit.examples.bleed", this);
bt->setText("Bleed!");
bt->setIconSet(TQPixmap("/usr/share/apps/polkit-tqt/icons/action-locked-default.png"));
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
// This action is more customized
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);
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
bt = new ActionButton(listenPB, "org.tqt.policykit.examples.listen", this);
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);
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
bt = new ActionButton(deletePB, "org.tqt.policykit.examples.delete", this);
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);
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
bt = new ActionButton(setPB, "org.tqt.policykit.examples.set", this);
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);
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
bt = new ActionButton(shoutPB, "org.tqt.policykit.examples.shout", this);
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);
::tqt_cast<TQAction*>(bt)->addTo(menuActions);
::tqt_cast<TQAction*>(bt)->addTo(toolBar);
connect(bt, TQ_SIGNAL(activated()), this, TQ_SLOT(activateAction()));
connect(bt, TQ_SIGNAL(clicked(TQButton*, bool)), bt, TQ_SLOT(activate()));
connect(bt, TQ_SIGNAL(authorized()), this, TQ_SLOT(actionActivated()));
connect(bt, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
}
void PkExample::languageChange()

@ -52,7 +52,7 @@ PkExampleHelper::PkExampleHelper(int argc, char **argv) : TQApplication(argc, ar
return;
}
// Exit if not used for 10 minutes
TQTimer::singleShot(600000, this, TQ_SLOT(quit()));
TQTimer::singleShot(600000, this, TQT_SLOT(quit()));
tqDebug("Register successful");
}

@ -30,7 +30,7 @@ class TQSessionManager;
class PkExampleHelper : public TQApplication, public TQT_DBusObjectBase
{
TQ_OBJECT
Q_OBJECT
public:
PkExampleHelper(int argc, char **argv);

@ -32,7 +32,7 @@ class TQSessionManager;
class PkAgentExample : public TQApplication
{
TQ_OBJECT
Q_OBJECT
public:
PkAgentExample(int argc, char **argv);

@ -52,13 +52,13 @@ void TQtListener::initiateAuthentication(const TQString &actionId, const TQStrin
{
tqDebug(identity.toString());
Session *session = new Session(identity, cookie, result);
connect(session, TQ_SIGNAL(request(const TQString&, bool)), this,
TQ_SLOT(request(const TQString&, bool)));
connect(session, TQ_SIGNAL(completed(bool)), this, TQ_SLOT(completed(bool)));
connect(session, TQ_SIGNAL(showError(const TQString&)), this,
TQ_SLOT(showError(const TQString&)));
connect(session, TQ_SIGNAL(showInfo(const TQString&)), this,
TQ_SLOT(showInfo(const TQString&)));
connect(session, TQT_SIGNAL(request(const TQString&, bool)), this,
TQT_SLOT(request(const TQString&, bool)));
connect(session, TQT_SIGNAL(completed(bool)), this, TQT_SLOT(completed(bool)));
connect(session, TQT_SIGNAL(showError(const TQString&)), this,
TQT_SLOT(showError(const TQString&)));
connect(session, TQT_SIGNAL(showInfo(const TQString&)), this,
TQT_SLOT(showInfo(const TQString&)));
session->initiate();
}
}

@ -37,7 +37,7 @@ namespace Agent
class TQtListener : public PolkitTQt::Agent::Listener
{
TQ_OBJECT
Q_OBJECT
public:
TQtListener(TQObject *parent = nullptr);

@ -28,6 +28,6 @@ int main(int argc, char *argv[])
TQApplication app(argc, argv);
PkExample *example = new PkExample;
example->show();
app.connect(&app, TQ_SIGNAL(lastWindowClosed()), &app, TQ_SLOT(quit()));
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
return app.exec();
}

@ -191,7 +191,7 @@ Action::Action(const TQString &actionId, TQObject *parent) : TQAction(parent), d
setPolkitAction(actionId);
// track the config changes to update the action
connect(Authority::instance(), TQ_SIGNAL(configChanged()), this, TQ_SLOT(slotConfigChanged()));
connect(Authority::instance(), SIGNAL(configChanged()), this, SLOT(slotConfigChanged()));
}
Action::~Action()
@ -216,7 +216,7 @@ bool Action::activate()
if (d->noEnabled)
{
/* If PolicyKit says no... and we got here.. it means
* that the user set the property "no-enabled" to true..
* that the user set the property "no-enabled" to TRUE..
* Hence, they probably have a good reason for doing
* this so do let the 'activate' signal propagate..
*/

@ -53,7 +53,7 @@ namespace Gui
*/
class POLKIT_TQT_EXPORT Action : public TQAction
{
TQ_OBJECT
Q_OBJECT
public:
enum States

@ -40,8 +40,8 @@ namespace Gui
void ActionButtonPrivate::addButton(TQButton *button)
{
buttons.append(button);
TQObject::connect(button, TQ_SIGNAL(clicked()), q, TQ_SLOT(streamClicked()));
TQObject::connect(q, TQ_SIGNAL(toggled(bool)), button, TQ_SLOT(toggle()));
TQObject::connect(button, TQT_SIGNAL(clicked()), q, TQT_SLOT(streamClicked()));
TQObject::connect(q, TQT_SIGNAL(toggled(bool)), button, TQT_SLOT(toggle()));
q->updateButton();
}
@ -49,8 +49,8 @@ void ActionButtonPrivate::removeButton(TQButton *button)
{
if (buttons.contains(button))
{
TQObject::disconnect(button, TQ_SIGNAL(clicked(bool)), q, TQ_SLOT(streamClicked()));
TQObject::disconnect(q, TQ_SIGNAL(toggled(bool)), button, TQ_SLOT(toggle()));
TQObject::disconnect(button, SIGNAL(clicked(bool)), q, SLOT(streamClicked()));
TQObject::disconnect(q, SIGNAL(toggled(bool)), button, SLOT(toggle()));
TQValueList<TQButton*>::iterator butIt = buttons.find(button);
if (butIt != buttons.end())
{
@ -67,7 +67,7 @@ ActionButton::ActionButton(ActionButtonPrivate &dd, const TQString &actionId, TQ
: Action(actionId, parent), d(&dd)
{
d->q = this;
connect(this, TQ_SIGNAL(dataChanged()), this, TQ_SLOT(updateButton()));
connect(this, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(updateButton()));
}
ActionButton::ActionButton(TQButton *button, const TQString &actionId, TQObject *parent)
@ -77,7 +77,7 @@ ActionButton::ActionButton(TQButton *button, const TQString &actionId, TQObject
d->buttons.append(button);
setButton(button);
connect(this, TQ_SIGNAL(dataChanged()), this, TQ_SLOT(updateButton()));
connect(this, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(updateButton()));
}
ActionButton::~ActionButton()

@ -55,7 +55,7 @@ class ActionButtonPrivate;
*/
class POLKIT_TQT_EXPORT ActionButton : public Action
{
TQ_OBJECT
Q_OBJECT
public:
/**

@ -46,7 +46,7 @@ class ActionButtonsPrivate;
*/
class ActionButtons : public ActionButton
{
TQ_OBJECT
Q_OBJECT
public:
/**

@ -22,8 +22,6 @@
#ifndef POLKIT_TQT_EXPORT_H
#define POLKIT_TQT_EXPORT_H
#include <tqglobal.h>
#define POLKIT_TQT_EXPORT TQ_EXPORT
#endif

Loading…
Cancel
Save