Compare commits

...

12 Commits

Author SHA1 Message Date
Michele Calgaro e896e34d43
Replace TRUE/FALSE with boolean values true/false
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 months ago
Michele Calgaro 0b1a1ab899
Make sure TQ_EXPORT is defined before it is used
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
10 months ago
Michele Calgaro b2e6bdba6c
Use centralized cmake version
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
1 year ago
Michele Calgaro 7c53a87adc
Use new TQ_METHOD, TQ_SIGNAL, TQ_SLOT defines
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
2 years ago
Slávek Banko 7e4828f14a
Raise the minimum required version of CMake to 3.5.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
2 years ago
Michele Calgaro 5b62278a4b
Replace Q_OBJECT with TQ_OBJECT
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
2 years ago
Michele Calgaro 511a1ddc0f
Use TDE cmake macro to set version
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
3 years ago
aneejit1 0ba61b9a6b 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>
3 years ago
aneejit1 89acf6a1fd 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>
3 years ago
Michele Calgaro fc35cfac16
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>
4 years ago
Slávek Banko 2f98b15156
Use TQT_CMAKE_DIR for installation of exported CMake targets.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
4 years ago
Michele Calgaro 2ab8863eea
Added project version for r14.1.x branch.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
4 years ago

@ -9,9 +9,21 @@
#
#################################################
## Polkit TQt Library
##### set project version ########################
include( TDEVersion )
cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
tde_set_project_version( )
##### general package setup #####################
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)
@ -21,8 +33,6 @@ set(POLKIT-TQT_VERSION_STRING
##### cmake setup ###############################
cmake_minimum_required( VERSION 3.1 )
include( FindPkgConfig )
include( CheckCXXSourceCompiles )
include( CheckSymbolExists )
@ -31,16 +41,6 @@ include( TDEMacros )
enable_testing( )
##### setup install paths #######################
if( CMAKE_INSTALL_LIBDIR )
tde_setup_install_path( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" )
endif( )
include( TDESetupPaths )
tde_setup_paths( )
##### optional stuff
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
@ -59,6 +59,17 @@ option( BUILD_TESTS "Builds unit tests" ${BUILD_ALL} )
include( ConfigureChecks.cmake )
##### setup install paths #######################
tde_setup_install_path( CMAKE_INSTALL_DIR "${TQT_CMAKE_DIR}" )
if( CMAKE_INSTALL_LIBDIR )
tde_setup_install_path( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" )
endif( )
include( TDESetupPaths )
tde_setup_paths( )
##### write pkgconfig file ######################
string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} )

@ -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, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
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()));
\endcode
Those three signals are all you need to control the action and the activation. Action::activated()

@ -21,6 +21,7 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
${POLKIT_GOBJECT_LIBRARY_DIRS}
)
@ -43,7 +44,6 @@ tde_add_library( polkit-tqt-agent SHARED AUTOMOC
listeneradapter.cpp
polkit-tqt-listener.cpp
VERSION 0.0.0
CXX_FEATURES cxx_nullptr
LINK polkit-tqt-core-shared
LINK_PRIVATE ${POLKIT_GOBJECT_LIBRARIES} ${POLKIT_AGENT_LIBRARIES}
DESTINATION ${LIB_INSTALL_DIR}

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

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

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

@ -19,6 +19,7 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
${POLKIT_GOBJECT_LIBRARY_DIRS}
)
@ -47,7 +48,6 @@ tde_add_library( polkit-tqt-core SHARED AUTOMOC
polkit-tqt-subject.cpp
polkit-tqt-temporaryauthorization.cpp
VERSION 0.0.0
CXX_FEATURES cxx_nullptr
LINK ${TQT_LIBRARIES}
LINK_PRIVATE ${POLKIT_GOBJECT_LIBRARIES}
DESTINATION ${LIB_INSTALL_DIR}

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

@ -22,6 +22,7 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
${DBUS_TQT_LIBRARY_DIRS}
)

@ -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, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, TQ_SIGNAL(activated()), this, TQ_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, 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
// 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->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, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
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()));
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, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
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()));
// 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, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
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()));
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, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
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()));
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, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
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()));
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, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
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()));
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, SIGNAL(activated()), this, SLOT(activateAction()));
connect(bt, SIGNAL(clicked(TQButton*, bool)), bt, SLOT(activate()));
connect(bt, SIGNAL(authorized()), this, SLOT(actionActivated()));
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()));
}
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, TQT_SLOT(quit()));
TQTimer::singleShot(600000, this, TQ_SLOT(quit()));
tqDebug("Register successful");
}

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

@ -32,7 +32,7 @@ class TQSessionManager;
class PkAgentExample : public TQApplication
{
Q_OBJECT
TQ_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, 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&)));
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&)));
session->initiate();
}
}

@ -37,7 +37,7 @@ namespace Agent
class TQtListener : public PolkitTQt::Agent::Listener
{
Q_OBJECT
TQ_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, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
app.connect(&app, TQ_SIGNAL(lastWindowClosed()), &app, TQ_SLOT(quit()));
return app.exec();
}

@ -20,6 +20,7 @@ include_directories(
link_directories(
${TQT_LIBRARY_DIRS}
${POLKIT_GOBJECT_LIBRARY_DIRS}
)
@ -42,7 +43,6 @@ tde_add_library( polkit-tqt-gui SHARED AUTOMOC
polkit-tqt-gui-actionbutton.cpp
polkit-tqt-gui-actionbuttons.cpp
VERSION 0.0.0
CXX_FEATURES cxx_nullptr
LINK polkit-tqt-core-shared
LINK_PRIVATE ${POLKIT_GOBJECT_LIBRARIES}
DESTINATION ${LIB_INSTALL_DIR}

@ -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(), SIGNAL(configChanged()), this, SLOT(slotConfigChanged()));
connect(Authority::instance(), TQ_SIGNAL(configChanged()), this, TQ_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
{
Q_OBJECT
TQ_OBJECT
public:
enum States

@ -40,8 +40,8 @@ namespace Gui
void ActionButtonPrivate::addButton(TQButton *button)
{
buttons.append(button);
TQObject::connect(button, TQT_SIGNAL(clicked()), q, TQT_SLOT(streamClicked()));
TQObject::connect(q, TQT_SIGNAL(toggled(bool)), button, TQT_SLOT(toggle()));
TQObject::connect(button, TQ_SIGNAL(clicked()), q, TQ_SLOT(streamClicked()));
TQObject::connect(q, TQ_SIGNAL(toggled(bool)), button, TQ_SLOT(toggle()));
q->updateButton();
}
@ -49,8 +49,8 @@ void ActionButtonPrivate::removeButton(TQButton *button)
{
if (buttons.contains(button))
{
TQObject::disconnect(button, SIGNAL(clicked(bool)), q, SLOT(streamClicked()));
TQObject::disconnect(q, SIGNAL(toggled(bool)), button, SLOT(toggle()));
TQObject::disconnect(button, TQ_SIGNAL(clicked(bool)), q, TQ_SLOT(streamClicked()));
TQObject::disconnect(q, TQ_SIGNAL(toggled(bool)), button, TQ_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, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(updateButton()));
connect(this, TQ_SIGNAL(dataChanged()), this, TQ_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, TQT_SIGNAL(dataChanged()), this, TQT_SLOT(updateButton()));
connect(this, TQ_SIGNAL(dataChanged()), this, TQ_SLOT(updateButton()));
}
ActionButton::~ActionButton()

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

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

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

Loading…
Cancel
Save