Browse Source

TQt conversion


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
tags/v3.5.13
tpearson 9 years ago
parent
commit
eba47f8f06
100 changed files with 1824 additions and 1824 deletions
  1. 46
    46
      kamera/kcontrol/kamera.cpp
  2. 18
    18
      kamera/kcontrol/kamera.h
  3. 50
    50
      kamera/kcontrol/kameraconfigdialog.cpp
  4. 6
    6
      kamera/kcontrol/kameraconfigdialog.h
  5. 61
    61
      kamera/kcontrol/kameradevice.cpp
  6. 36
    36
      kamera/kcontrol/kameradevice.h
  7. 28
    28
      kamera/kioslave/kamera.cpp
  8. 10
    10
      kamera/kioslave/kamera.h
  9. 3
    3
      kcoloredit/color.cpp
  10. 4
    4
      kcoloredit/color.h
  11. 35
    35
      kcoloredit/colorselector.cpp
  12. 8
    8
      kcoloredit/colorselector.h
  13. 26
    26
      kcoloredit/gradientselection.cpp
  14. 9
    9
      kcoloredit/gradientselection.h
  15. 1
    1
      kcoloredit/imageselection.cpp
  16. 3
    3
      kcoloredit/imageselection.h
  17. 2
    2
      kcoloredit/kcolorchooser.cpp
  18. 32
    32
      kcoloredit/kcoloredit.cpp
  19. 3
    3
      kcoloredit/kcoloredit.h
  20. 21
    21
      kcoloredit/kcoloreditdoc.cpp
  21. 16
    16
      kcoloredit/kcoloreditdoc.h
  22. 55
    55
      kcoloredit/kcoloreditview.cpp
  23. 18
    18
      kcoloredit/kcoloreditview.h
  24. 18
    18
      kcoloredit/kxycolorselector.cpp
  25. 9
    9
      kcoloredit/kxycolorselector.h
  26. 15
    15
      kcoloredit/kzcolorselector.cpp
  27. 10
    10
      kcoloredit/kzcolorselector.h
  28. 21
    21
      kcoloredit/loadpalettedlg.cpp
  29. 7
    7
      kcoloredit/loadpalettedlg.h
  30. 5
    5
      kcoloredit/main.h
  31. 31
    31
      kcoloredit/palette.cpp
  32. 14
    14
      kcoloredit/palette.h
  33. 12
    12
      kcoloredit/paletteview.cpp
  34. 6
    6
      kcoloredit/paletteview.h
  35. 37
    37
      kcoloredit/paletteviewscrolledarea.cpp
  36. 17
    17
      kcoloredit/paletteviewscrolledarea.h
  37. 40
    40
      kcoloredit/texteditselection.cpp
  38. 9
    9
      kcoloredit/texteditselection.h
  39. 1
    1
      kcoloredit/textselection.cpp
  40. 3
    3
      kdvi/TeXFont.h
  41. 12
    12
      kdvi/TeXFontDefinition.cpp
  42. 15
    15
      kdvi/TeXFontDefinition.h
  43. 14
    14
      kdvi/TeXFont_PFB.cpp
  44. 1
    1
      kdvi/TeXFont_PFB.h
  45. 14
    14
      kdvi/TeXFont_PK.cpp
  46. 1
    1
      kdvi/TeXFont_PK.h
  47. 5
    5
      kdvi/TeXFont_TFM.cpp
  48. 1
    1
      kdvi/TeXFont_TFM.h
  49. 1
    1
      kdvi/bigEndianByteReader.h
  50. 17
    17
      kdvi/dviFile.cpp
  51. 18
    18
      kdvi/dviFile.h
  52. 79
    79
      kdvi/dviRenderer.cpp
  53. 51
    51
      kdvi/dviRenderer.h
  54. 10
    10
      kdvi/dviRenderer_draw.cpp
  55. 42
    42
      kdvi/dviRenderer_export.cpp
  56. 62
    62
      kdvi/dviRenderer_prescan.cpp
  57. 5
    5
      kdvi/dviWidget.cpp
  58. 7
    7
      kdvi/dviWidget.h
  59. 7
    7
      kdvi/dvisourcesplitter.cpp
  60. 6
    6
      kdvi/dvisourcesplitter.h
  61. 12
    12
      kdvi/fontEncoding.cpp
  62. 4
    4
      kdvi/fontEncoding.h
  63. 1
    1
      kdvi/fontEncodingPool.cpp
  64. 4
    4
      kdvi/fontEncodingPool.h
  65. 24
    24
      kdvi/fontMap.cpp
  66. 13
    13
      kdvi/fontMap.h
  67. 50
    50
      kdvi/fontpool.cpp
  68. 16
    16
      kdvi/fontpool.h
  69. 23
    23
      kdvi/fontprogress.cpp
  70. 8
    8
      kdvi/fontprogress.h
  71. 4
    4
      kdvi/glyph.h
  72. 42
    42
      kdvi/infodialog.cpp
  73. 11
    11
      kdvi/infodialog.h
  74. 29
    29
      kdvi/kdvi_multipage.cpp
  75. 4
    4
      kdvi/kdvi_multipage.h
  76. 2
    2
      kdvi/kdvi_multipage_texthandling.cpp
  77. 1
    1
      kdvi/kprinterwrapper.h
  78. 12
    12
      kdvi/main.cpp
  79. 7
    7
      kdvi/optionDialogFontsWidget.cpp
  80. 1
    1
      kdvi/optionDialogFontsWidget.h
  81. 10
    10
      kdvi/optionDialogSpecialWidget.cpp
  82. 6
    6
      kdvi/optionDialogSpecialWidget.h
  83. 2
    2
      kdvi/performanceMeasurement.h
  84. 5
    5
      kdvi/prebookmark.h
  85. 35
    35
      kdvi/psgs.cpp
  86. 23
    23
      kdvi/psgs.h
  87. 2
    2
      kdvi/renderedDviPagePixmap.h
  88. 131
    131
      kdvi/special.cpp
  89. 1
    1
      kdvi/util.cpp
  90. 1
    1
      kdvi/vf.cpp
  91. 11
    11
      kfax/faxinput.cpp
  92. 77
    77
      kfax/kfax.cpp
  93. 21
    21
      kfax/kfax.h
  94. 16
    16
      kfax/kfax_printsettings.cpp
  95. 4
    4
      kfax/kfax_printsettings.h
  96. 52
    52
      kfax/options.cpp
  97. 33
    33
      kfax/options.h
  98. 8
    8
      kfax/viewfax.cpp
  99. 4
    4
      kfaxview/faxmultipage.cpp
  100. 0
    0
      kfaxview/faxmultipage.h

+ 46
- 46
kamera/kcontrol/kamera.cpp View File

@@ -20,8 +20,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

*/
#include <qlabel.h>
#include <qlayout.h>
#include <tqlabel.h>
#include <tqlayout.h>

#include <kgenericfactory.h>
#include <ksimpleconfig.h>
@@ -41,14 +41,14 @@
#include "kamera.h"
#include "kamera.moc"

typedef KGenericFactory<KKameraConfig, QWidget> KKameraConfigFactory;
typedef KGenericFactory<KKameraConfig, TQWidget> KKameraConfigFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_kamera, KKameraConfigFactory( "kcmkamera" ) )

// --------------- Camera control center module widget ---

KKameraConfig *KKameraConfig::m_instance = NULL;

KKameraConfig::KKameraConfig(QWidget *parent, const char *name, const QStringList &)
KKameraConfig::KKameraConfig(TQWidget *parent, const char *name, const TQStringList &)
: KCModule(KKameraConfigFactory::instance(), parent, name)
{
m_devicePopup = new KPopupMenu(this);
@@ -88,7 +88,7 @@ void KKameraConfig::defaults()

void KKameraConfig::displayGPFailureDialogue(void)
{
new QLabel(i18n("Unable to initialize the gPhoto2 libraries."), this);
new TQLabel(i18n("Unable to initialize the gPhoto2 libraries."), this);
}

void KKameraConfig::displayGPSuccessDialogue(void)
@@ -97,7 +97,7 @@ void KKameraConfig::displayGPSuccessDialogue(void)
setButtons(Help | Apply | Cancel | Ok);

// create a layout with two vertical boxes
QVBoxLayout *topLayout = new QVBoxLayout(this, 0, 0);
TQVBoxLayout *topLayout = new TQVBoxLayout(this, 0, 0);
topLayout->setAutoAdd(true);
m_toolbar = new KToolBar(this, "ToolBar");
@@ -106,36 +106,36 @@ void KKameraConfig::displayGPSuccessDialogue(void)
// create list of devices
m_deviceSel = new KIconView(this);

connect(m_deviceSel, SIGNAL(rightButtonClicked(QIconViewItem *, const QPoint &)),
SLOT(slot_deviceMenu(QIconViewItem *, const QPoint &)));
connect(m_deviceSel, SIGNAL(doubleClicked(QIconViewItem *)),
SLOT(slot_configureCamera()));
connect(m_deviceSel, SIGNAL(selectionChanged(QIconViewItem *)),
SLOT(slot_deviceSelected(QIconViewItem *)));
connect(m_deviceSel, TQT_SIGNAL(rightButtonClicked(TQIconViewItem *, const TQPoint &)),
TQT_SLOT(slot_deviceMenu(TQIconViewItem *, const TQPoint &)));
connect(m_deviceSel, TQT_SIGNAL(doubleClicked(TQIconViewItem *)),
TQT_SLOT(slot_configureCamera()));
connect(m_deviceSel, TQT_SIGNAL(selectionChanged(TQIconViewItem *)),
TQT_SLOT(slot_deviceSelected(TQIconViewItem *)));

m_deviceSel->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
m_deviceSel->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding));
// create actions
KAction *act;
act = new KAction(i18n("Add"), "camera", 0, this, SLOT(slot_addCamera()), m_actions, "camera_add");
act = new KAction(i18n("Add"), "camera", 0, this, TQT_SLOT(slot_addCamera()), m_actions, "camera_add");
act->setWhatsThis(i18n("Click this button to add a new camera."));
act->plug(m_toolbar);
m_toolbar->insertLineSeparator();
act = new KAction(i18n("Test"), "camera_test", 0, this, SLOT(slot_testCamera()), m_actions, "camera_test");
act = new KAction(i18n("Test"), "camera_test", 0, this, TQT_SLOT(slot_testCamera()), m_actions, "camera_test");
act->setWhatsThis(i18n("Click this button to remove the selected camera from the list."));
act->plug(m_toolbar);
act = new KAction(i18n("Remove"), "edittrash", 0, this, SLOT(slot_removeCamera()), m_actions, "camera_remove");
act = new KAction(i18n("Remove"), "edittrash", 0, this, TQT_SLOT(slot_removeCamera()), m_actions, "camera_remove");
act->setWhatsThis(i18n("Click this button to remove the selected camera from the list."));
act->plug(m_toolbar);
act = new KAction(i18n("Configure..."), "configure", 0, this, SLOT(slot_configureCamera()), m_actions, "camera_configure");
act = new KAction(i18n("Configure..."), "configure", 0, this, TQT_SLOT(slot_configureCamera()), m_actions, "camera_configure");
act->setWhatsThis(i18n("Click this button to change the configuration of the selected camera.<br><br>The availability of this feature and the contents of the Configuration dialog depend on the camera model."));
act->plug(m_toolbar);
act = new KAction(i18n("Information"), "hwinfo", 0, this, SLOT(slot_cameraSummary()), m_actions, "camera_summary");
act = new KAction(i18n("Information"), "hwinfo", 0, this, TQT_SLOT(slot_cameraSummary()), m_actions, "camera_summary");
act->setWhatsThis(i18n("Click this button to view a summary of the current status of the selected camera.<br><br>The availability of this feature and the contents of the Configuration dialog depend on the camera model."));
act->plug(m_toolbar);
m_toolbar->insertLineSeparator();
act = new KAction(i18n("Cancel"), "stop", 0, this, SLOT(slot_cancelOperation()), m_actions, "camera_cancel");
act = new KAction(i18n("Cancel"), "stop", 0, this, TQT_SLOT(slot_cancelOperation()), m_actions, "camera_cancel");
act->setWhatsThis(i18n("Click this button to cancel the current camera operation."));
act->setEnabled(false);
act->plug(m_toolbar);
@@ -147,7 +147,7 @@ void KKameraConfig::populateDeviceListView(void)
CameraDevicesMap::Iterator it;
for (it = m_devices.begin(); it != m_devices.end(); it++) {
if (it.data()) {
new QIconViewItem(m_deviceSel, it.key(), DesktopIcon("camera"));
new TQIconViewItem(m_deviceSel, it.key(), DesktopIcon("camera"));
}
}
slot_deviceSelected(m_deviceSel->currentItem());
@@ -172,8 +172,8 @@ void KKameraConfig::load(void)
void KKameraConfig::load(bool useDefaults )
{
m_config->setReadDefaults( useDefaults );
QStringList groupList = m_config->groupList();
QStringList::Iterator it;
TQStringList groupList = m_config->groupList();
TQStringList::Iterator it;
int i, count;
CameraList *list;
CameraAbilitiesList *al;
@@ -188,8 +188,8 @@ void KKameraConfig::load(bool useDefaults )
continue;

kcamera = new KCamera(*it,m_config->readEntry("Path"));
connect(kcamera, SIGNAL(error(const QString &)), SLOT(slot_error(const QString &)));
connect(kcamera, SIGNAL(error(const QString &, const QString &)), SLOT(slot_error(const QString &, const QString &)));
connect(kcamera, TQT_SIGNAL(error(const TQString &)), TQT_SLOT(slot_error(const TQString &)));
connect(kcamera, TQT_SIGNAL(error(const TQString &, const TQString &)), TQT_SLOT(slot_error(const TQString &, const TQString &)));
kcamera->load(m_config);
m_devices[*it] = kcamera;
}
@@ -208,7 +208,7 @@ void KKameraConfig::load(bool useDefaults )

count = gp_list_count (list);

QMap<QString,QString> ports, names;
TQMap<TQString,TQString> ports, names;
for (i = 0 ; i<count ; i++) {
gp_list_get_name (list, i, &model);
@@ -221,14 +221,14 @@ void KKameraConfig::load(bool useDefaults )
if (ports.contains("usb:") && names[ports["usb:"]]!="usb:")
ports.remove("usb:");

QMap<QString,QString>::iterator portit;
TQMap<TQString,TQString>::iterator portit;

for (portit = ports.begin() ; portit != ports.end(); portit++) {
/* kdDebug() << "Adding USB camera: " << portit.data() << " at " << portit.key() << endl; */

kcamera = new KCamera(portit.data(),portit.key());
connect(kcamera, SIGNAL(error(const QString &)), SLOT(slot_error(const QString &)));
connect(kcamera, SIGNAL(error(const QString &, const QString &)), SLOT(slot_error(const QString &, const QString &)));
connect(kcamera, TQT_SIGNAL(error(const TQString &)), TQT_SLOT(slot_error(const TQString &)));
connect(kcamera, TQT_SIGNAL(error(const TQString &, const TQString &)), TQT_SLOT(slot_error(const TQString &, const TQString &)));
m_devices[portit.data()] = kcamera;
}
populateDeviceListView();
@@ -265,9 +265,9 @@ void KKameraConfig::afterCameraOperation(void)
slot_deviceSelected(m_deviceSel->currentItem());
}

QString KKameraConfig::suggestName(const QString &name)
TQString KKameraConfig::suggestName(const TQString &name)
{
QString new_name = name;
TQString new_name = name;
new_name.replace("/", ""); // we cannot have a slash in a URI's host

if (!m_devices.contains(new_name)) return new_name;
@@ -275,20 +275,20 @@ QString KKameraConfig::suggestName(const QString &name)
// try new names with a number appended until we find a free one
int i = 1;
while (i++ < 0xffff) {
new_name = name + " (" + QString::number(i) + ")";
new_name = name + " (" + TQString::number(i) + ")";
if (!m_devices.contains(new_name)) return new_name;
}

return QString::null;
return TQString::null;
}

void KKameraConfig::slot_addCamera()
{
KCamera *m_device = new KCamera(QString::null,QString::null);
connect(m_device, SIGNAL(error(const QString &)), SLOT(slot_error(const QString &)));
connect(m_device, SIGNAL(error(const QString &, const QString &)), SLOT(slot_error(const QString &, const QString &)));
KCamera *m_device = new KCamera(TQString::null,TQString::null);
connect(m_device, TQT_SIGNAL(error(const TQString &)), TQT_SLOT(slot_error(const TQString &)));
connect(m_device, TQT_SIGNAL(error(const TQString &, const TQString &)), TQT_SLOT(slot_error(const TQString &, const TQString &)));
KameraDeviceSelectDialog dialog(this, m_device);
if (dialog.exec() == QDialog::Accepted) {
if (dialog.exec() == TQDialog::Accepted) {
dialog.save();
m_device->setName(suggestName(m_device->model()));
m_devices.insert(m_device->name(), m_device);
@@ -301,7 +301,7 @@ void KKameraConfig::slot_addCamera()

void KKameraConfig::slot_removeCamera()
{
QString name = m_deviceSel->currentItem()->text();
TQString name = m_deviceSel->currentItem()->text();
if (m_devices.contains(name)) {
KCamera *m_device = m_devices[name];
m_devices.remove(name);
@@ -316,7 +316,7 @@ void KKameraConfig::slot_testCamera()
{
beforeCameraOperation();

QString name = m_deviceSel->currentItem()->text();
TQString name = m_deviceSel->currentItem()->text();
if (m_devices.contains(name)) {
KCamera *m_device = m_devices[name];
if (m_device->test())
@@ -328,7 +328,7 @@ void KKameraConfig::slot_testCamera()

void KKameraConfig::slot_configureCamera()
{
QString name = m_deviceSel->currentItem()->text();
TQString name = m_deviceSel->currentItem()->text();
if (m_devices.contains(name)) {
KCamera *m_device = m_devices[name];
m_device->configure();
@@ -337,8 +337,8 @@ void KKameraConfig::slot_configureCamera()

void KKameraConfig::slot_cameraSummary()
{
QString summary;
QString name = m_deviceSel->currentItem()->text();
TQString summary;
TQString name = m_deviceSel->currentItem()->text();
if (m_devices.contains(name)) {
KCamera *m_device = m_devices[name];
summary = m_device->summary();
@@ -357,7 +357,7 @@ void KKameraConfig::slot_cancelOperation()
qApp->setOverrideCursor(Qt::WaitCursor);
}

void KKameraConfig::slot_deviceMenu(QIconViewItem *item, const QPoint &point)
void KKameraConfig::slot_deviceMenu(TQIconViewItem *item, const TQPoint &point)
{
if (item) {
m_devicePopup->clear();
@@ -369,7 +369,7 @@ void KKameraConfig::slot_deviceMenu(QIconViewItem *item, const QPoint &point)
}
}

void KKameraConfig::slot_deviceSelected(QIconViewItem *item)
void KKameraConfig::slot_deviceSelected(TQIconViewItem *item)
{
m_actions->action("camera_test")->setEnabled(item);
m_actions->action("camera_remove")->setEnabled(item);
@@ -399,7 +399,7 @@ GPContextFeedback KKameraConfig::cbGPCancel(GPContext * /*context*/, void *data)
return GP_CONTEXT_FEEDBACK_OK;
}

QString KKameraConfig::quickHelp() const
TQString KKameraConfig::quickHelp() const
{
return i18n("<h1>Digital Camera</h1>\n"
"This module allows you to configure support for your digital camera.\n"
@@ -411,12 +411,12 @@ QString KKameraConfig::quickHelp() const
"<a href=\"camera:/\">camera:/</a> in Konqueror and other KDE applications.");
}

void KKameraConfig::slot_error(const QString &message)
void KKameraConfig::slot_error(const TQString &message)
{
KMessageBox::error(this, message);
}

void KKameraConfig::slot_error(const QString &message, const QString &details)
void KKameraConfig::slot_error(const TQString &message, const TQString &details)
{
KMessageBox::detailedError(this, message, details);
}

+ 18
- 18
kamera/kcontrol/kamera.h View File

@@ -26,15 +26,15 @@
#include <kcmodule.h>
#include <gphoto2.h>

class QWidget;
class QRadioButton;
class QPushButton;
class QComboBox;
class QVButtonGroup;
class QLineEdit;
class QWidgetStack;
class QCheckBox;
class QIconViewItem;
class TQWidget;
class TQRadioButton;
class TQPushButton;
class TQComboBox;
class TQVButtonGroup;
class TQLineEdit;
class TQWidgetStack;
class TQCheckBox;
class TQIconViewItem;

class KCamera;
class KameraDeviceSelectDialog;
@@ -50,7 +50,7 @@ class KKameraConfig : public KCModule
friend class KameraDeviceSelectDialog;

public:
KKameraConfig(QWidget *parent, const char *name, const QStringList &);
KKameraConfig(TQWidget *parent, const char *name, const TQStringList &);
virtual ~KKameraConfig();

// KCModule interface methods
@@ -59,22 +59,22 @@ public:
void save();
void defaults();
int buttons();
QString quickHelp() const;
TQString quickHelp() const;

protected:
QString suggestName(const QString &name);
TQString suggestName(const TQString &name);

protected slots:
void slot_deviceMenu(QIconViewItem *item, const QPoint &point);
void slot_deviceSelected(QIconViewItem *item);
void slot_deviceMenu(TQIconViewItem *item, const TQPoint &point);
void slot_deviceSelected(TQIconViewItem *item);
void slot_addCamera();
void slot_removeCamera();
void slot_configureCamera();
void slot_cameraSummary();
void slot_testCamera();
void slot_cancelOperation();
void slot_error(const QString &message);
void slot_error(const QString &message, const QString &details);
void slot_error(const TQString &message);
void slot_error(const TQString &message, const TQString &details);

private:
void displayGPFailureDialogue(void);
@@ -89,7 +89,7 @@ private:
static GPContextFeedback cbGPCancel(GPContext *context, void *data);

private:
typedef QMap<QString, KCamera *> CameraDevicesMap;
typedef TQMap<TQString, KCamera *> CameraDevicesMap;
KSimpleConfig *m_config;
CameraDevicesMap m_devices;
@@ -101,7 +101,7 @@ private:
// widgets for the cameras listview
KIconView *m_deviceSel;
KActionCollection *m_actions;
QPushButton *m_addCamera, *m_removeCamera, *m_testCamera, *m_configureCamera;
TQPushButton *m_addCamera, *m_removeCamera, *m_testCamera, *m_configureCamera;
KToolBar *m_toolbar;
KPopupMenu *m_devicePopup;


+ 50
- 50
kamera/kcontrol/kameraconfigdialog.cpp View File

@@ -20,20 +20,20 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

*/
#include <qlayout.h>
#include <qgrid.h>
#include <qlabel.h>
#include <qvgroupbox.h>
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qslider.h>
#include <qvbuttongroup.h>
#include <qhbuttongroup.h>
#include <qvbox.h>
#include <qtabwidget.h>
#include <qwhatsthis.h>
#include <tqlayout.h>
#include <tqgrid.h>
#include <tqlabel.h>
#include <tqvgroupbox.h>
#include <tqcheckbox.h>
#include <tqradiobutton.h>
#include <tqlineedit.h>
#include <tqcombobox.h>
#include <tqslider.h>
#include <tqvbuttongroup.h>
#include <tqhbuttongroup.h>
#include <tqvbox.h>
#include <tqtabwidget.h>
#include <tqwhatsthis.h>

#include <klocale.h>

@@ -42,13 +42,13 @@

KameraConfigDialog::KameraConfigDialog(Camera */*camera*/,
CameraWidget *widget,
QWidget *parent,
TQWidget *parent,
const char *name) :
KDialogBase(parent, name, true, QString::null, Ok|Cancel, Ok ),
KDialogBase(parent, name, true, TQString::null, Ok|Cancel, Ok ),
m_widgetRoot(widget)
{
QFrame *main = makeMainWidget();
QVBoxLayout *topLayout = new QVBoxLayout(main, 0, spacingHint());
TQFrame *main = makeMainWidget();
TQVBoxLayout *topLayout = new TQVBoxLayout(main, 0, spacingHint());
topLayout->setAutoAdd(true);

m_tabWidget = 0;
@@ -56,9 +56,9 @@ m_widgetRoot(widget)
appendWidget(main, widget);
}

void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
void KameraConfigDialog::appendWidget(TQWidget *parent, CameraWidget *widget)
{
QWidget *newParent = parent;
TQWidget *newParent = parent;
CameraWidgetType widget_type;
const char *widget_name;
@@ -72,7 +72,7 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
gp_widget_get_info(widget, &widget_info);
gp_widget_get_name(widget, &widget_name);
QString whats_this = QString::fromLocal8Bit(widget_info); // gphoto2 doesn't seem to have any standard for i18n
TQString whats_this = TQString::fromLocal8Bit(widget_info); // gphoto2 doesn't seem to have any standard for i18n

// Add this widget to parent
switch(widget_type) {
@@ -85,13 +85,13 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
case GP_WIDGET_SECTION:
{
if (!m_tabWidget)
m_tabWidget = new QTabWidget(parent);
QWidget *tab = new QWidget(m_tabWidget);
m_tabWidget = new TQTabWidget(parent);
TQWidget *tab = new TQWidget(m_tabWidget);
// widgets are to be aligned vertically in the tab
QVBoxLayout *tabLayout = new QVBoxLayout(tab, marginHint(),
TQVBoxLayout *tabLayout = new TQVBoxLayout(tab, marginHint(),
spacingHint());
m_tabWidget->insertTab(tab, widget_label);
QVBox *tabContainer = new QVBox(tab);
TQVBox *tabContainer = new TQVBox(tab);
tabContainer->setSpacing(spacingHint());
tabLayout->addWidget(tabContainer);
newParent = tabContainer;
@@ -104,14 +104,14 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
{
gp_widget_get_value(widget, &widget_value_string);

QGrid *grid = new QGrid(2, Horizontal, parent);
TQGrid *grid = new TQGrid(2, Horizontal, parent);
grid->setSpacing(spacingHint());
new QLabel(QString::fromLocal8Bit( widget_label )+":", grid);
QLineEdit *lineEdit = new QLineEdit(widget_value_string, grid);
new TQLabel(TQString::fromLocal8Bit( widget_label )+":", grid);
TQLineEdit *lineEdit = new TQLineEdit(widget_value_string, grid);
m_wmap.insert(widget, lineEdit);

if (!whats_this.isEmpty())
QWhatsThis::add(grid, whats_this);
TQWhatsThis::add(grid, whats_this);

break;
}
@@ -123,18 +123,18 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
gp_widget_get_range(widget, &widget_low, &widget_high, &widget_increment);
gp_widget_get_value(widget, &widget_value_float);
QGroupBox *groupBox = new QVGroupBox(widget_label, parent);
QSlider *slider = new QSlider(
TQGroupBox *groupBox = new TQVGroupBox(widget_label, parent);
TQSlider *slider = new TQSlider(
( int )widget_low,
( int )widget_high,
( int )widget_increment,
( int )widget_value_float,
QSlider::Horizontal,
TQSlider::Horizontal,
groupBox );
m_wmap.insert(widget, slider);
if (!whats_this.isEmpty())
QWhatsThis::add(groupBox, whats_this);
TQWhatsThis::add(groupBox, whats_this);
break;
}
@@ -142,12 +142,12 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
{
gp_widget_get_value(widget, &widget_value_int);
QCheckBox *checkBox = new QCheckBox(widget_label, parent);
TQCheckBox *checkBox = new TQCheckBox(widget_label, parent);
checkBox->setChecked(widget_value_int);
m_wmap.insert(widget, checkBox);

if (!whats_this.isEmpty())
QWhatsThis::add(checkBox, whats_this);
TQWhatsThis::add(checkBox, whats_this);

break;
}
@@ -158,24 +158,24 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
int count = gp_widget_count_choices(widget);

// for less than 5 options, align them horizontally
QButtonGroup *buttonGroup;
TQButtonGroup *buttonGroup;
if (count > 4)
buttonGroup = new QVButtonGroup(widget_label, parent);
buttonGroup = new TQVButtonGroup(widget_label, parent);
else
buttonGroup = new QHButtonGroup(widget_label, parent);
buttonGroup = new TQHButtonGroup(widget_label, parent);
for(int i = 0; i < count; ++i) {
const char *widget_choice;
gp_widget_get_choice(widget, i, &widget_choice);

new QRadioButton(widget_choice, buttonGroup);
new TQRadioButton(widget_choice, buttonGroup);
if(!strcmp(widget_value_string, widget_choice))
buttonGroup->setButton(i);
}
m_wmap.insert(widget, buttonGroup);

if (!whats_this.isEmpty())
QWhatsThis::add(buttonGroup, whats_this);
TQWhatsThis::add(buttonGroup, whats_this);

break;
}
@@ -183,7 +183,7 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
{
gp_widget_get_value(widget, &widget_value_string);
QComboBox *comboBox = new QComboBox(FALSE, parent);
TQComboBox *comboBox = new TQComboBox(FALSE, parent);
comboBox->clear();
for(int i = 0; i < gp_widget_count_choices(widget); ++i) {
const char *widget_choice;
@@ -196,7 +196,7 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
m_wmap.insert(widget, comboBox);

if (!whats_this.isEmpty())
QWhatsThis::add(comboBox, whats_this);
TQWhatsThis::add(comboBox, whats_this);

break;
}
@@ -206,14 +206,14 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
// I can't see a way of implementing this. Since there is
// no way of telling which button sent you a signal, we
// can't map to the appropriate widget->callback
new QLabel(i18n("Button (not supported by KControl)"), parent);
new TQLabel(i18n("Button (not supported by KControl)"), parent);
break;
}
case GP_WIDGET_DATE:
{
// TODO
new QLabel(i18n("Date (not supported by KControl)"), parent);
new TQLabel(i18n("Date (not supported by KControl)"), parent);

break;
}
@@ -233,7 +233,7 @@ void KameraConfigDialog::appendWidget(QWidget *parent, CameraWidget *widget)
switch (widget_type) {
case GP_WIDGET_SECTION:
{
tabLayout->addItem( new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding) );
tabLayout->addItem( new TQSpacerItem(0, 0, TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding) );
break;
}
}
@@ -254,14 +254,14 @@ void KameraConfigDialog::updateWidgetValue(CameraWidget *widget)
break;
case GP_WIDGET_TEXT:
{
QLineEdit *lineEdit = static_cast<QLineEdit *>(m_wmap[widget]);
TQLineEdit *lineEdit = static_cast<TQLineEdit *>(m_wmap[widget]);
gp_widget_set_value(widget, (void *)lineEdit->text().local8Bit().data());
break;
}
case GP_WIDGET_RANGE:
{
QSlider *slider = static_cast<QSlider *>(m_wmap[widget]);
TQSlider *slider = static_cast<TQSlider *>(m_wmap[widget]);
float value_float = slider->value();
gp_widget_set_value(widget, (void *)&value_float);
@@ -269,7 +269,7 @@ void KameraConfigDialog::updateWidgetValue(CameraWidget *widget)
}
case GP_WIDGET_TOGGLE:
{
QCheckBox *checkBox = static_cast<QCheckBox *>(m_wmap[widget]);
TQCheckBox *checkBox = static_cast<TQCheckBox *>(m_wmap[widget]);
int value_int = checkBox->isChecked() ? 1 : 0;
gp_widget_set_value(widget, (void *)&value_int);
@@ -277,14 +277,14 @@ void KameraConfigDialog::updateWidgetValue(CameraWidget *widget)
}
case GP_WIDGET_RADIO:
{
QButtonGroup *buttonGroup = static_cast<QVButtonGroup *>(m_wmap[widget]);
TQButtonGroup *buttonGroup = static_cast<TQVButtonGroup *>(m_wmap[widget]);
gp_widget_set_value(widget, (void *)buttonGroup->selected()->text().local8Bit().data());

break;
}
case GP_WIDGET_MENU:
{
QComboBox *comboBox = static_cast<QComboBox *>(m_wmap[widget]);
TQComboBox *comboBox = static_cast<TQComboBox *>(m_wmap[widget]);
gp_widget_set_value(widget, (void *)comboBox->currentText().local8Bit().data());
break;

+ 6
- 6
kamera/kcontrol/kameraconfigdialog.h View File

@@ -23,9 +23,9 @@
#ifndef __kameraconfigdialog_h__
#define __kameraconfigdialog_h__

#include <qmap.h>
#include <tqmap.h>
#include <kdialogbase.h>
#include <qtabwidget.h>
#include <tqtabwidget.h>

extern "C" {
#include <gphoto2.h>
@@ -36,18 +36,18 @@ class KameraConfigDialog : public KDialogBase
Q_OBJECT
public:
KameraConfigDialog(Camera *camera, CameraWidget *widget,
QWidget *parent = 0, const char *name = 0);
TQWidget *parent = 0, const char *name = 0);

private slots:
void slotOk();

private:
void appendWidget(QWidget *parent, CameraWidget *widget);
void appendWidget(TQWidget *parent, CameraWidget *widget);
void updateWidgetValue(CameraWidget *widget);
QMap<CameraWidget *, QWidget *> m_wmap;
TQMap<CameraWidget *, TQWidget *> m_wmap;
CameraWidget *m_widgetRoot;
QTabWidget *m_tabWidget;
TQTabWidget *m_tabWidget;
};

#endif

+ 61
- 61
kamera/kcontrol/kameradevice.cpp View File

@@ -20,16 +20,16 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

*/
#include <qlayout.h>
#include <qwidgetstack.h>
#include <qvbuttongroup.h>
#include <qvgroupbox.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qradiobutton.h>
#include <qwhatsthis.h>
#include <qlabel.h>
#include <qgrid.h>
#include <tqlayout.h>
#include <tqwidgetstack.h>
#include <tqvbuttongroup.h>
#include <tqvgroupbox.h>
#include <tqcombobox.h>
#include <tqlineedit.h>
#include <tqradiobutton.h>
#include <tqwhatsthis.h>
#include <tqlabel.h>
#include <tqgrid.h>

#include <klocale.h>
#include <kconfig.h>
@@ -54,7 +54,7 @@ static const int INDEX_SERIAL = 1;
static const int INDEX_USB= 3;
static GPContext *glob_context = 0;

KCamera::KCamera(const QString &name, const QString &path)
KCamera::KCamera(const TQString &name, const TQString &path)
{
m_name = name;
m_model = name;
@@ -143,7 +143,7 @@ Camera* KCamera::camera()
return m_camera;
}

QString KCamera::summary()
TQString KCamera::summary()
{
int result;
CameraText summary;
@@ -153,7 +153,7 @@ QString KCamera::summary()
result = gp_camera_get_summary(m_camera, &summary, glob_context);
if (result != GP_OK)
return i18n("No camera summary information is available.\n");
return QString(summary.text);
return TQString(summary.text);
}

bool KCamera::configure()
@@ -207,27 +207,27 @@ void KCamera::save(KConfig *config)
config->writeEntry("Path", m_path);
}

QString KCamera::portName()
TQString KCamera::portName()
{
QString port = m_path.left(m_path.find(":")).lower();
TQString port = m_path.left(m_path.find(":")).lower();
if (port == "serial") return i18n("Serial");
if (port == "usb") return i18n("USB");
return i18n("Unknown port");
}

void KCamera::setName(const QString &name)
void KCamera::setName(const TQString &name)
{
m_name = name;
}

void KCamera::setModel(const QString &model)
void KCamera::setModel(const TQString &model)
{
m_model = model;
invalidateCamera();
initInformation();
}

void KCamera::setPath(const QString &path)
void KCamera::setPath(const TQString &path)
{
m_path = path;
invalidateCamera();
@@ -252,10 +252,10 @@ bool KCamera::isConfigurable()
return m_abilities.operations & GP_OPERATION_CONFIG;
}

QStringList KCamera::supportedPorts()
TQStringList KCamera::supportedPorts()
{
initInformation();
QStringList ports;
TQStringList ports;
if (m_abilities.port & GP_PORT_SERIAL)
ports.append("serial");
if (m_abilities.port & GP_PORT_USB)
@@ -270,70 +270,70 @@ CameraAbilities KCamera::abilities()

// ---------- KameraSelectCamera ------------

KameraDeviceSelectDialog::KameraDeviceSelectDialog(QWidget *parent, KCamera *device)
KameraDeviceSelectDialog::KameraDeviceSelectDialog(TQWidget *parent, KCamera *device)
: KDialogBase(parent, "kkameradeviceselect", true, i18n("Select Camera Device"), Ok | Cancel, Ok, true)
{
m_device = device;
connect(m_device, SIGNAL(error(const QString &)),
SLOT(slot_error(const QString &)));
connect(m_device, SIGNAL(error(const QString &, const QString &)),
SLOT(slot_error(const QString &, const QString &)));
connect(m_device, TQT_SIGNAL(error(const TQString &)),
TQT_SLOT(slot_error(const TQString &)));
connect(m_device, TQT_SIGNAL(error(const TQString &, const TQString &)),
TQT_SLOT(slot_error(const TQString &, const TQString &)));

QWidget *page = new QWidget( this );
TQWidget *page = new TQWidget( this );
setMainWidget(page);

// a layout with vertical boxes
QHBoxLayout *topLayout = new QHBoxLayout(page, 0, KDialog::spacingHint());
TQHBoxLayout *topLayout = new TQHBoxLayout(page, 0, KDialog::spacingHint());

// the models list
m_modelSel = new KListView(page);
topLayout->addWidget( m_modelSel );
m_modelSel->addColumn(i18n("Supported Cameras"));
m_modelSel->setColumnWidthMode(0, QListView::Maximum);
connect(m_modelSel, SIGNAL(selectionChanged(QListViewItem *)),
SLOT(slot_setModel(QListViewItem *)));
m_modelSel->setColumnWidthMode(0, TQListView::Maximum);
connect(m_modelSel, TQT_SIGNAL(selectionChanged(TQListViewItem *)),
TQT_SLOT(slot_setModel(TQListViewItem *)));
// make sure listview only as wide as it needs to be
m_modelSel->setSizePolicy(QSizePolicy(QSizePolicy::Maximum,
QSizePolicy::Preferred));
m_modelSel->setSizePolicy(TQSizePolicy(TQSizePolicy::Maximum,
TQSizePolicy::Preferred));

QVBoxLayout *rightLayout = new QVBoxLayout(0L, 0, KDialog::spacingHint());
TQVBoxLayout *rightLayout = new TQVBoxLayout(0L, 0, KDialog::spacingHint());
topLayout->addLayout( rightLayout );

m_portSelectGroup = new QVButtonGroup(i18n("Port"), page);
m_portSelectGroup = new TQVButtonGroup(i18n("Port"), page);
rightLayout->addWidget(m_portSelectGroup);
m_portSettingsGroup = new QVGroupBox(i18n("Port Settings"), page);
m_portSettingsGroup = new TQVGroupBox(i18n("Port Settings"), page);
rightLayout->addWidget(m_portSettingsGroup);

// Create port type selection radiobuttons.
m_serialRB = new QRadioButton(i18n("Serial"), m_portSelectGroup);
m_serialRB = new TQRadioButton(i18n("Serial"), m_portSelectGroup);
m_portSelectGroup->insert(m_serialRB, INDEX_SERIAL);
QWhatsThis::add(m_serialRB, i18n("If this option is checked, the camera would have to be connected one of the serial ports (known as COM in Microsoft Windows) in your computer."));
m_USBRB = new QRadioButton(i18n("USB"), m_portSelectGroup);
TQWhatsThis::add(m_serialRB, i18n("If this option is checked, the camera would have to be connected one of the serial ports (known as COM in Microsoft Windows) in your computer."));
m_USBRB = new TQRadioButton(i18n("USB"), m_portSelectGroup);
m_portSelectGroup->insert(m_USBRB, INDEX_USB);
QWhatsThis::add(m_USBRB, i18n("If this option is checked, the camera would have to be connected to one of the USB slots in your computer or USB hub."));
TQWhatsThis::add(m_USBRB, i18n("If this option is checked, the camera would have to be connected to one of the USB slots in your computer or USB hub."));
// Create port settings widget stack
m_settingsStack = new QWidgetStack(m_portSettingsGroup);
connect(m_portSelectGroup, SIGNAL(clicked(int)),
m_settingsStack, SLOT(raiseWidget(int)));
m_settingsStack = new TQWidgetStack(m_portSettingsGroup);
connect(m_portSelectGroup, TQT_SIGNAL(clicked(int)),
m_settingsStack, TQT_SLOT(raiseWidget(int)));

// none tab
m_settingsStack->addWidget(new QLabel(i18n("No port type selected."),
m_settingsStack->addWidget(new TQLabel(i18n("No port type selected."),
m_settingsStack), INDEX_NONE);

// serial tab
QGrid *grid = new QGrid(2, m_settingsStack);
TQGrid *grid = new TQGrid(2, m_settingsStack);
grid->setSpacing(KDialog::spacingHint());
new QLabel(i18n("Port:"), grid);
m_serialPortCombo = new QComboBox(TRUE, grid);
QWhatsThis::add(m_serialPortCombo, i18n("Here you should choose the serial port you connect the camera to."));
new TQLabel(i18n("Port:"), grid);
m_serialPortCombo = new TQComboBox(TRUE, grid);
TQWhatsThis::add(m_serialPortCombo, i18n("Here you should choose the serial port you connect the camera to."));
m_settingsStack->addWidget(grid, INDEX_SERIAL);

grid = new QGrid(2, m_settingsStack);
grid = new TQGrid(2, m_settingsStack);
grid->setSpacing(KDialog::spacingHint());
new QLabel(i18n("Port"), grid);
new TQLabel(i18n("Port"), grid);

m_settingsStack->addWidget(new
QLabel(i18n("No further configuration is required for USB."),
TQLabel(i18n("No further configuration is required for USB."),
m_settingsStack), INDEX_USB);

// query gphoto2 for existing serial ports
@@ -347,7 +347,7 @@ KameraDeviceSelectDialog::KameraDeviceSelectDialog(QWidget *parent, KCamera *dev
for (int i = 0; i < gphoto_ports; i++) {
if (gp_port_info_list_get_info(list, i, &info) >= 0) {
if (strncmp(info.path, "serial:", 7) == 0)
m_serialPortCombo->insertItem(QString::fromLatin1(info.path).mid(7));
m_serialPortCombo->insertItem(TQString::fromLatin1(info.path).mid(7));
}
}
gp_port_info_list_free(list);
@@ -376,7 +376,7 @@ bool KameraDeviceSelectDialog::populateCameraListView()
} else {
for(int x = 0; x < numCams; ++x) {
if(gp_abilities_list_get_abilities(m_device->m_abilitylist, x, &a) == GP_OK) {
new QListViewItem(m_modelSel, a.model);
new TQListViewItem(m_modelSel, a.model);
}
}
return true;
@@ -388,7 +388,7 @@ void KameraDeviceSelectDialog::save()
m_device->setModel(m_modelSel->currentItem()->text(0));

if (m_portSelectGroup->selected()) {
QString type = m_portSelectGroup->selected()->text();
TQString type = m_portSelectGroup->selected()->text();

if(type == i18n("Serial"))
m_device->setPath("serial:" + m_serialPortCombo->currentText());
@@ -402,13 +402,13 @@ void KameraDeviceSelectDialog::save()

void KameraDeviceSelectDialog::load()
{
QString path = m_device->path();
QString port = path.left(path.find(":")).lower();
TQString path = m_device->path();
TQString port = path.left(path.find(":")).lower();

if (port == "serial") setPortType(INDEX_SERIAL);
if (port == "usb") setPortType(INDEX_USB);

QListViewItem *modelItem = m_modelSel->firstChild();
TQListViewItem *modelItem = m_modelSel->firstChild();
if( modelItem)
{
do {
@@ -420,13 +420,13 @@ void KameraDeviceSelectDialog::load()
}
}

void KameraDeviceSelectDialog::slot_setModel(QListViewItem *item)
void KameraDeviceSelectDialog::slot_setModel(TQListViewItem *item)
{
enableButtonOK(true);
m_portSelectGroup->setEnabled(true);
m_portSettingsGroup->setEnabled(true);

QString model = item->text(0);
TQString model = item->text(0);

CameraAbilities abilities;
int index = gp_abilities_list_lookup_model(m_device->m_abilitylist, model.local8Bit().data());
@@ -441,7 +441,7 @@ void KameraDeviceSelectDialog::slot_setModel(QListViewItem *item)
m_USBRB->setEnabled(abilities.port & GP_PORT_USB);

// turn off any selected port
QButton *selected = m_portSelectGroup->selected();
TQButton *selected = m_portSelectGroup->selected();
if(selected != NULL)
selected->toggle();

@@ -465,12 +465,12 @@ void KameraDeviceSelectDialog::setPortType(int type)
m_settingsStack->raiseWidget(type);
}

void KameraDeviceSelectDialog::slot_error(const QString &message)
void KameraDeviceSelectDialog::slot_error(const TQString &message)
{
KMessageBox::error(this, message);
}

void KameraDeviceSelectDialog::slot_error(const QString &message, const QString &details)
void KameraDeviceSelectDialog::slot_error(const TQString &message, const TQString &details)
{
KMessageBox::detailedError(this, message, details);
}

+ 36
- 36
kamera/kcontrol/kameradevice.h View File

@@ -23,52 +23,52 @@
#ifndef __kameradevice_h__
#define __kameradevice_h__

#include <qmap.h>
#include <tqmap.h>
#include <kdialogbase.h>
#include <config.h>

class KConfig;
class QString;
class TQString;
class KListView;
class QWidgetStack;
class QVButtonGroup;
class QVGroupBox;
class QComboBox;
class QLineEdit;
class QRadioButton;
class KCamera : public QObject {
class TQWidgetStack;
class TQVButtonGroup;
class TQVGroupBox;
class TQComboBox;
class TQLineEdit;
class TQRadioButton;
class KCamera : public TQObject {
friend class KameraDeviceSelectDialog;
Q_OBJECT
public:
KCamera(const QString &name, const QString &path);
KCamera(const TQString &name, const TQString &path);
~KCamera();
void invalidateCamera();
bool configure();
void load(KConfig *m_config);
void save(KConfig *m_config);
bool test();
QStringList supportedPorts();
TQStringList supportedPorts();

Camera* camera();
QString name() const { return m_name ; }
QString model() const { return m_model; }
QString path() const { return m_path; }
QString portName();
TQString name() const { return m_name ; }
TQString model() const { return m_model; }
TQString path() const { return m_path; }
TQString portName();

QString summary();
TQString summary();
CameraAbilities abilities();

void setName(const QString &name);
void setModel(const QString &model);
void setPath(const QString &path);
void setName(const TQString &name);
void setModel(const TQString &model);
void setPath(const TQString &path);

bool isTestable() const;
bool isConfigurable();

signals:
void error(const QString &message);
void error(const QString &message, const QString &details);
void error(const TQString &message);
void error(const TQString &message, const TQString &details);
protected:
bool initInformation();
@@ -78,9 +78,9 @@ protected:

Camera *m_camera;
// KConfig *m_config;
QString m_name; // the camera's real name
QString m_model;
QString m_path;
TQString m_name; // the camera's real name
TQString m_model;
TQString m_path;
CameraAbilities m_abilities;
CameraAbilitiesList *m_abilitylist;
};
@@ -89,13 +89,13 @@ class KameraDeviceSelectDialog : public KDialogBase
{
Q_OBJECT
public:
KameraDeviceSelectDialog(QWidget *parent, KCamera *device);
KameraDeviceSelectDialog(TQWidget *parent, KCamera *device);
void save();
void load();
protected slots:
void slot_setModel(QListViewItem *item);
void slot_error(const QString &message);
void slot_error(const QString &message, const QString &details);
void slot_setModel(TQListViewItem *item);
void slot_error(const TQString &message);
void slot_error(const TQString &message, const TQString &details);
protected:
KCamera *m_device;
@@ -104,14 +104,14 @@ protected:

// port settings widgets
KListView *m_modelSel;
QLineEdit *m_nameEdit;
QWidgetStack *m_settingsStack;
QVButtonGroup *m_portSelectGroup;
QVGroupBox *m_portSettingsGroup;
QComboBox *m_serialPortCombo;
TQLineEdit *m_nameEdit;
TQWidgetStack *m_settingsStack;
TQVButtonGroup *m_portSelectGroup;
TQVGroupBox *m_portSettingsGroup;
TQComboBox *m_serialPortCombo;
// port selection radio buttons
QRadioButton *m_serialRB;
QRadioButton *m_USBRB;
TQRadioButton *m_serialRB;
TQRadioButton *m_USBRB;
};

#endif

+ 28
- 28
kamera/kioslave/kamera.cpp View File

@@ -29,8 +29,8 @@
#include <signal.h>
#include <errno.h>

#include <qfile.h>
#include <qtextstream.h>
#include <tqfile.h>
#include <tqtextstream.h>

#include <kdebug.h>
#include <kinstance.h>
@@ -79,7 +79,7 @@ int kdemain(int argc, char **argv)
return 0;
}

KameraProtocol::KameraProtocol(const QCString &pool, const QCString &app)
KameraProtocol::KameraProtocol(const TQCString &pool, const TQCString &app)
: SlaveBase("camera", pool, app),
m_camera(NULL)
{
@@ -104,7 +104,7 @@ m_camera(NULL)
//
// The existance of a lockfile is used to signify "please give up camera".
//
void KameraProtocol::special(const QByteArray&) {
void KameraProtocol::special(const TQByteArray&) {
kdDebug(7123) << "KameraProtocol::special() at " << getpid() << endl;

if (!actiondone && cameraopen) {
@@ -136,7 +136,7 @@ KameraProtocol::~KameraProtocol()
}

// initializes the camera for usage - should be done before operations over the wire
bool KameraProtocol::openCamera(QString &str) {
bool KameraProtocol::openCamera(TQString &str) {
idletime = 0;
actiondone = true;
if (!m_camera) {
@@ -188,8 +188,8 @@ void KameraProtocol::closeCamera(void)
return;
}

static QString fix_foldername(QString ofolder) {
QString folder = ofolder;
static TQString fix_foldername(TQString ofolder) {
TQString folder = ofolder;
if (folder.length() > 1) {
while ((folder.length()>1) && (folder.right(1) == "/"))
folder = folder.left(folder.length()-1);
@@ -227,7 +227,7 @@ void KameraProtocol::get(const KURL &url)
error(KIO::ERR_DOES_NOT_EXIST, url.path()); \
return; \
} \
QByteArray chunkDataBuffer; \
TQByteArray chunkDataBuffer; \
chunkDataBuffer.setRawData(xx.text, strlen(xx.text)); \
data(chunkDataBuffer); \
processedSize(strlen(xx.text)); \
@@ -329,7 +329,7 @@ void KameraProtocol::get(const KURL &url)
// already.
if ((fileSize > 0) && (fileSize - m_fileSize)>0) {
unsigned long written = 0;
QByteArray chunkDataBuffer;
TQByteArray chunkDataBuffer;

// We need to split it up here. Someone considered it funny
// to discard any data() larger than 16MB.
@@ -518,9 +518,9 @@ void KameraProtocol::listDir(const KURL &url)
if (url.host().isEmpty()) {
KURL xurl;
// List the available cameras
QStringList groupList = m_config->groupList();
TQStringList groupList = m_config->groupList();
kdDebug(7123) << "Found cameras: " << groupList.join(", ") << endl;
QStringList::Iterator it;
TQStringList::Iterator it;
UDSEntry entry;
UDSAtom atom;

@@ -531,8 +531,8 @@ void KameraProtocol::listDir(const KURL &url)
* - List all saved and possible offline cameras.
* - List all autodetected and not yet printed cameras.
*/
QMap<QString,QString> ports, names;
QMap<QString,int> modelcnt;
TQMap<TQString,TQString> ports, names;
TQMap<TQString,int> modelcnt;

/* Autodetect USB cameras ... */
GPContext *glob_context = NULL;
@@ -578,7 +578,7 @@ void KameraProtocol::listDir(const KURL &url)
ports.remove("usb:");

for (it = groupList.begin(); it != groupList.end(); it++) {
QString m_cfgPath;
TQString m_cfgPath;
if (*it == "<default>")
continue;

@@ -619,7 +619,7 @@ void KameraProtocol::listDir(const KURL &url)
listEntry(entry, false);
}
QMap<QString,QString>::iterator portsit;
TQMap<TQString,TQString>::iterator portsit;

for (portsit = ports.begin(); portsit != ports.end(); portsit++) {
entry.clear();
@@ -699,7 +699,7 @@ void KameraProtocol::listDir(const KURL &url)

for(int i = 0; i < gp_list_count(dirList); ++i) {
gp_list_get_name(dirList, i, &name);
translateDirectoryToUDS(entry, QString::fromLocal8Bit(name));
translateDirectoryToUDS(entry, TQString::fromLocal8Bit(name));
listEntry(entry, false);
}

@@ -709,7 +709,7 @@ void KameraProtocol::listDir(const KURL &url)
gp_list_get_name(fileList, i, &name);
// we want to know more info about files (size, type...)
gp_camera_file_get_info(m_camera, tocstr(url.path()), name, &info, m_context);
translateFileToUDS(entry, info, QString::fromLocal8Bit(name));
translateFileToUDS(entry, info, TQString::fromLocal8Bit(name));
listEntry(entry, false);
}
if (!url.path().compare("/")) {
@@ -737,7 +737,7 @@ void KameraProtocol::listDir(const KURL &url)
finished();
}

void KameraProtocol::setHost(const QString& host, int port, const QString& user, const QString& pass )
void KameraProtocol::setHost(const TQString& host, int port, const TQString& user, const TQString& pass )
{
kdDebug(7123) << "KameraProtocol::setHost(" << host << ", " << port << ", " << user << ", " << pass << ")" << endl;
int gpr, idx;
@@ -805,7 +805,7 @@ void KameraProtocol::setHost(const QString& host, int port, const QString& user,
gp_camera_set_port_speed(m_camera, 0); // TODO: the value needs to be configurable
kdDebug(7123) << "Opening camera model " << user << " at " << host << endl;

QString errstr;
TQString errstr;
if (!openCamera(errstr)) {
kdDebug(7123) << "Unable to init camera: " << gp_result_as_string(gpr) << endl;
error(KIO::ERR_SERVICE_NOT_AVAILABLE, errstr);
@@ -821,7 +821,7 @@ void KameraProtocol::reparseConfiguration(void)
}

// translate a simple text to a UDS entry
void KameraProtocol::translateTextToUDS(UDSEntry &udsEntry, const QString &fn,
void KameraProtocol::translateTextToUDS(UDSEntry &udsEntry, const TQString &fn,
const char *text
) {
UDSAtom atom;
@@ -846,7 +846,7 @@ void KameraProtocol::translateTextToUDS(UDSEntry &udsEntry, const QString &fn,
}

// translate a CameraFileInfo to a UDSEntry which we can return as a directory listing entry
void KameraProtocol::translateFileToUDS(UDSEntry &udsEntry, const CameraFileInfo &info, QString name)
void KameraProtocol::translateFileToUDS(UDSEntry &udsEntry, const CameraFileInfo &info, TQString name)
{
UDSAtom atom;

@@ -858,7 +858,7 @@ void KameraProtocol::translateFileToUDS(UDSEntry &udsEntry, const CameraFileInfo

atom.m_uds = UDS_NAME;
if (info.file.fields & GP_FILE_INFO_NAME)
atom.m_str = QString::fromLocal8Bit(info.file.name);
atom.m_str = TQString::fromLocal8Bit(info.file.name);
else
atom.m_str = name;
udsEntry.append(atom);
@@ -881,7 +881,7 @@ void KameraProtocol::translateFileToUDS(UDSEntry &udsEntry, const CameraFileInfo

if (info.file.fields & GP_FILE_INFO_TYPE) {
atom.m_uds = UDS_MIME_TYPE;
atom.m_str = QString::fromLatin1(info.file.type);
atom.m_str = TQString::fromLatin1(info.file.type);
udsEntry.append(atom);
}

@@ -903,7 +903,7 @@ void KameraProtocol::translateFileToUDS(UDSEntry &udsEntry, const CameraFileInfo
}

// translate a directory name to a UDSEntry which we can return as a directory listing entry
void KameraProtocol::translateDirectoryToUDS(UDSEntry &udsEntry, const QString &dirname)
void KameraProtocol::translateDirectoryToUDS(UDSEntry &udsEntry, const TQString &dirname)
{
UDSAtom atom;

@@ -942,7 +942,7 @@ bool KameraProtocol::cameraSupportsPreview(void)
return (m_abilities.file_operations & GP_FILE_OPERATION_PREVIEW);
}

int KameraProtocol::readCameraFolder(const QString &folder, CameraList *dirList, CameraList *fileList)
int KameraProtocol::readCameraFolder(const TQString &folder, CameraList *dirList, CameraList *fileList)
{
kdDebug(7123) << "KameraProtocol::readCameraFolder(" << folder << ")" << endl;

@@ -975,7 +975,7 @@ void frontendProgressUpdate(
if (fileSize > 0) {
// XXX using assign() here causes segfault, prolly because
// gp_file_free is called before chunkData goes out of scope
QByteArray chunkDataBuffer;
TQByteArray chunkDataBuffer;
chunkDataBuffer.setRawData(fileData + object->getFileSize(), fileSize - object->getFileSize());
// Note: this will fail with sizes > 16MB ...
object->data(chunkDataBuffer);
@@ -1021,7 +1021,7 @@ unsigned int frontendProgressStart(
vsnprintf(status, 300, format, args);
#endif

object->infoMessage(QString::fromLocal8Bit(status));
object->infoMessage(TQString::fromLocal8Bit(status));
delete [] status;
object->totalSize((int)totalsize); // hack: call slot directly
return GP_OK;
@@ -1061,6 +1061,6 @@ static void frontendCameraStatus(GPContext * /*context*/, const char *format, va
status=new char[300];
vsnprintf(status, 300, format, args);
#endif
object->infoMessage(QString::fromLocal8Bit(status));
object->infoMessage(TQString::fromLocal8Bit(status));
delete [] status;
}

+ 10
- 10
kamera/kioslave/kamera.h View File

@@ -32,15 +32,15 @@ class KSimpleConfig;
class KameraProtocol : public KIO::SlaveBase
{
public:
KameraProtocol(const QCString &pool, const QCString &app);
KameraProtocol(const TQCString &pool, const TQCString &app);
virtual ~KameraProtocol();

virtual void get(const KURL &url);
virtual void stat(const KURL &url);
virtual void del(const KURL &url, bool isFile);
virtual void setHost(const QString& host, int port, const QString& user, const QString& pass );
virtual void setHost(const TQString& host, int port, const TQString& user, const TQString& pass );
virtual void listDir(const KURL &url);
virtual void special(const QByteArray &data);
virtual void special(const TQByteArray &data);

CameraFile *getFile() { return m_file; }
int getFileSize() { return m_fileSize; }
@@ -54,24 +54,24 @@ private:
GPContext *m_context;

void reparseConfiguration(void);
bool openCamera(QString& str);
bool openCamera(TQString& str);
bool openCamera(void ) {
QString errstr;
TQString errstr;
return openCamera(errstr);
}
void closeCamera(void);

void statRoot(void);
void statRegular(const KURL &url);
void translateTextToUDS(KIO::UDSEntry &udsEntry, const QString &info, const char *txt);
void translateFileToUDS(KIO::UDSEntry &udsEntry, const CameraFileInfo &info, QString name);
void translateDirectoryToUDS(KIO::UDSEntry &udsEntry, const QString &dirname);
void translateTextToUDS(KIO::UDSEntry &udsEntry, const TQString &info, const char *txt);
void translateFileToUDS(KIO::UDSEntry &udsEntry, const CameraFileInfo &info, TQString name);
void translateDirectoryToUDS(KIO::UDSEntry &udsEntry, const TQString &dirname);
bool cameraSupportsPreview(void);
bool cameraSupportsDel(void);
bool cameraSupportsPut(void);
int readCameraFolder(const QString &folder, CameraList *dirList, CameraList *fileList);
int readCameraFolder(const TQString &folder, CameraList *dirList, CameraList *fileList);

QString m_lockfile;
TQString m_lockfile;
int idletime;

int m_fileSize;

+ 3
- 3
kcoloredit/color.cpp View File

@@ -21,7 +21,7 @@ Color::Color(){
setComponents(0, 0, 0);
setName("");
}
Color::Color(const int red, const int green, const int blue, const QString& name) {
Color::Color(const int red, const int green, const int blue, const TQString& name) {
setComponents(red, green, blue);
setName(name);
}
@@ -38,7 +38,7 @@ void Color::setComponents(const int red, const int green, const int blue) {
setComponent(BLUE_INDEX, blue);
}

void Color::setName(const QString& name) {
void Color::setName(const TQString& name) {
m_name = name;
}

@@ -50,7 +50,7 @@ const int* Color::components() const{
return m_components;
}

const QString& Color::name() const {
const TQString& Color::name() const {
return m_name;
}


+ 4
- 4
kcoloredit/color.h View File

@@ -39,7 +39,7 @@ class Color {
Color();
/** constructs a color with given components and a name
*/
Color(const int red, const int green, const int blue, const QString& name);
Color(const int red, const int green, const int blue, const TQString& name);
~Color();
/** sets a component
*/
@@ -49,7 +49,7 @@ class Color {
void setComponents(const int red, const int green, const int blue);
/** sets a name
*/
void setName(const QString& name);
void setName(const TQString& name);
/** @return a component
*/
int component(const int index) const;
@@ -58,7 +58,7 @@ class Color {
const int* components() const;
/** @return a color name
*/
const QString& name() const;
const TQString& name() const;
/** @return if is equal to color
*/
bool equals(const Color& color);
@@ -75,7 +75,7 @@ class Color {
int m_components[COMPONENTS_NUM];
/** a color name
*/
QString m_name;
TQString m_name;
};

#endif

+ 35
- 35
kcoloredit/colorselector.cpp View File

@@ -17,11 +17,11 @@

#include <math.h>

#include <qlayout.h>
/* #include <qtabwidget.h> */
#include <qradiobutton.h>
#include <qlabel.h>
#include <qslider.h>
#include <tqlayout.h>
/* #include <tqtabwidget.h> */
#include <tqradiobutton.h>
#include <tqlabel.h>
#include <tqslider.h>
#include <kseparator.h>
#include <klocale.h>

@@ -30,59 +30,59 @@
#include "texteditselection.h"
#include "colorselector.h"

ColorSelector::ColorSelector(QWidget *parent, const char *name ) : QWidget(parent, name) {
ColorSelector::ColorSelector(TQWidget *parent, const char *name ) : TQWidget(parent, name) {
fComponentsMode = false;
QVBoxLayout* topLayout = new QVBoxLayout(this, 4);
TQVBoxLayout* topLayout = new TQVBoxLayout(this, 4);
/*
QTabWidget* pages = new QTabWidget(this);
TQTabWidget* pages = new TQTabWidget(this);
*/
gradientSelection = new GradientSelection(this);
connect(gradientSelection, SIGNAL( valueChanged(Color*) ),
SLOT( slotGradientSelectionChangeColor(Color*) ));
connect(gradientSelection, SIGNAL( synchronizeColor() ),
SLOT( slotGradientSelectionSynchronizeColor() ));
connect(this, SIGNAL( valueChanged(Color*) ), gradientSelection, SLOT( slotSetValue(Color*) ));
connect(gradientSelection, TQT_SIGNAL( valueChanged(Color*) ),
TQT_SLOT( slotGradientSelectionChangeColor(Color*) ));
connect(gradientSelection, TQT_SIGNAL( synchronizeColor() ),
TQT_SLOT( slotGradientSelectionSynchronizeColor() ));
connect(this, TQT_SIGNAL( valueChanged(Color*) ), gradientSelection, TQT_SLOT( slotSetValue(Color*) ));
/*
pages->addTab(gradientSelection, i18n( "Gradient" ));
ImageSelection* imageSelection = new ImageSelection(this);
connect(imageSelection, SIGNAL( valueChanged(Color*) ), SLOT( slotSetColor(Color*) ));
connect(this, SIGNAL( valueChanged(Color*) ), imageSelection, SLOT( slotSetValue(Color*) ));
connect(imageSelection, TQT_SIGNAL( valueChanged(Color*) ), TQT_SLOT( slotSetColor(Color*) ));
connect(this, TQT_SIGNAL( valueChanged(Color*) ), imageSelection, TQT_SLOT( slotSetValue(Color*) ));
pages->addTab(imageSelection, i18n( "Image" ));
topLayout->addWidget(pages, 10);
*/
topLayout->addWidget(gradientSelection, 10);
KSeparator* hLine = new KSeparator(KSeparator::HLine, this);
topLayout->addWidget(hLine);
QHBoxLayout* layout = new QHBoxLayout();
TQHBoxLayout* layout = new TQHBoxLayout();
TextEditSelection* textEditSelection = new TextEditSelection(this);
connect(textEditSelection, SIGNAL( valueChanged(Color*) ), SLOT( slotSetColor(Color*) ));
connect(this, SIGNAL( valueChanged(Color*) ), textEditSelection, SLOT( slotSetValue(Color*) ));
QVBoxLayout* colorChangeLayout = new QVBoxLayout();
connect(textEditSelection, TQT_SIGNAL( valueChanged(Color*) ), TQT_SLOT( slotSetColor(Color*) ));
connect(this, TQT_SIGNAL( valueChanged(Color*) ), textEditSelection, TQT_SLOT( slotSetValue(Color*) ));
TQVBoxLayout* colorChangeLayout = new TQVBoxLayout();
colorChangeLayout->setMargin(2);
QRadioButton* replaceButton = new QRadioButton(i18n( "Replace" ), this);
connect(replaceButton, SIGNAL( clicked() ), SLOT( slotColorReplace() ));
TQRadioButton* replaceButton = new TQRadioButton(i18n( "Replace" ), this);
connect(replaceButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotColorReplace() ));
replaceButton->setChecked(true);
colorChangeButtons.insert(replaceButton);
colorChangeLayout->addWidget(replaceButton);
QRadioButton* changeButton = new QRadioButton(i18n( "Change" ) + ":", this);
connect(changeButton, SIGNAL( clicked() ), SLOT( slotColorChange() ));
TQRadioButton* changeButton = new TQRadioButton(i18n( "Change" ) + ":", this);
connect(changeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotColorChange() ));
colorChangeButtons.insert(changeButton);
colorChangeLayout->addWidget(changeButton);
colorChangeValue = 0;
colorChangeSliderWidget = new QWidget(this);
QVBoxLayout* colorChangeSliderLayout = new QVBoxLayout(colorChangeSliderWidget, 1);
colorChangeSliderWidget = new TQWidget(this);
TQVBoxLayout* colorChangeSliderLayout = new TQVBoxLayout(colorChangeSliderWidget, 1);
colorChangeSliderLayout->setMargin(0);
QSlider* colorChangeSlider = new QSlider(0, MAX_COLOR_CHANGE_VALUE,
MAX_COLOR_CHANGE_VALUE/4, colorChangeValue, QSlider::Horizontal, colorChangeSliderWidget);
TQSlider* colorChangeSlider = new TQSlider(0, MAX_COLOR_CHANGE_VALUE,
MAX_COLOR_CHANGE_VALUE/4, colorChangeValue, TQSlider::Horizontal, colorChangeSliderWidget);
colorChangeSlider->setTickInterval(colorChangeSlider->pageStep());
colorChangeSlider->setTickmarks(QSlider::Above);
connect(colorChangeSlider, SIGNAL( valueChanged(int) ), SLOT( slotColorChangeValueChanged(int) ));
colorChangeSlider->setTickmarks(TQSlider::Above);
connect(colorChangeSlider, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( slotColorChangeValueChanged(int) ));
colorChangeSliderLayout->addWidget(colorChangeSlider);
QHBoxLayout* colorChangeSliderLabelsLayout = new QHBoxLayout(0);
QLabel* subtractLabel = new QLabel(i18n( "0" ), colorChangeSliderWidget);
TQHBoxLayout* colorChangeSliderLabelsLayout = new TQHBoxLayout(0);
TQLabel* subtractLabel = new TQLabel(i18n( "0" ), colorChangeSliderWidget);
colorChangeSliderLabelsLayout->addWidget(subtractLabel);
colorChangeSliderLabelsLayout->addStretch(10);
QLabel* addLabel = new QLabel(" " + i18n( "Replace" ), colorChangeSliderWidget);
TQLabel* addLabel = new TQLabel(" " + i18n( "Replace" ), colorChangeSliderWidget);
colorChangeSliderLabelsLayout->addWidget(addLabel);
colorChangeSliderLayout->addLayout(colorChangeSliderLabelsLayout);
colorChangeLayout->addStretch(10);
@@ -95,7 +95,7 @@ ColorSelector::ColorSelector(QWidget *parent, const char *name ) : QWidget(paren
layout->addWidget(vLine);
layout->addWidget(textEditSelection, 1);
colorPatch = new KColorPatch(this);
connect(colorPatch, SIGNAL( colorChanged(const QColor&) ), SLOT( slotSetColor(const QColor&) ));
connect(colorPatch, TQT_SIGNAL( colorChanged(const TQColor&) ), TQT_SLOT( slotSetColor(const TQColor&) ));
colorPatch->setMinimumSize(80, 64);
layout->addWidget(colorPatch, 10);
topLayout->addLayout(layout);
@@ -105,7 +105,7 @@ ColorSelector::~ColorSelector() {

void ColorSelector::slotSetColor(Color color) {
m_color = color;
colorPatch->setColor(QColor( m_color.component(Color::RED_INDEX),
colorPatch->setColor(TQColor( m_color.component(Color::RED_INDEX),
m_color.component(Color::GREEN_INDEX),
m_color.component(Color::BLUE_INDEX) ));
fComponentsMode = false;
@@ -116,7 +116,7 @@ void ColorSelector::slotSetColor(Color* color) {
slotSetColor(*color);
}

void ColorSelector::slotSetColor(const QColor& color) {
void ColorSelector::slotSetColor(const TQColor& color) {
m_color.setComponent(Color::RED_INDEX, color.red());
m_color.setComponent(Color::GREEN_INDEX, color.green());
m_color.setComponent(Color::BLUE_INDEX, color.blue());

+ 8
- 8
kcoloredit/colorselector.h View File

@@ -18,9 +18,9 @@
#ifndef COLORSELECTOR_H
#define COLORSELECTOR_H

#include <qwidget.h>
#include <qcolor.h>
#include <qbuttongroup.h>
#include <tqwidget.h>
#include <tqcolor.h>
#include <tqbuttongroup.h>
#include <kcolordialog.h>

#include "color.h"
@@ -29,12 +29,12 @@
/** Color selector widget
* @author Artur Rataj
*/
class ColorSelector : public QWidget {
class ColorSelector : public TQWidget {
Q_OBJECT

public:
/** constructs a color selector widget */
ColorSelector(QWidget *parent=0, const char *name=0);
ColorSelector(TQWidget *parent=0, const char *name=0);
~ColorSelector();
/** @return the selected color */
const Color& color();
@@ -49,7 +49,7 @@ public slots:
/** Called if a color changed */
void slotSetColor(Color* color);
/** called if a color changed in the color patch */
void slotSetColor(const QColor& color);
void slotSetColor(const TQColor& color);
/** Called by the gradient selection, to replace or modify a color */
void slotGradientSelectionChangeColor(Color* gradientSelectionColor);
/** Called by the gradient selection, to synchronize its color */
@@ -69,9 +69,9 @@ private:
MAX_COLOR_CHANGE_VALUE = 16 };
/** A color change slider widget */
QWidget* colorChangeSliderWidget;
TQWidget* colorChangeSliderWidget;
/** Color change buttons button group widget */
QButtonGroup colorChangeButtons;
TQButtonGroup colorChangeButtons;
/** A color patch widget */
KColorPatch* colorPatch;
/** A gradient selection widget */

+ 26
- 26
kcoloredit/gradientselection.cpp View File

@@ -15,39 +15,39 @@
* *
***************************************************************************/

#include <qlayout.h>
#include <qframe.h>
#include <qradiobutton.h>
#include <qcolor.h>
#include <tqlayout.h>
#include <tqframe.h>
#include <tqradiobutton.h>
#include <tqcolor.h>
#include <klocale.h>

#include "main.h"
#include "gradientselection.h"

GradientSelection::GradientSelection(QWidget *parent, const char *name ) : QWidget(parent,name) {
QGridLayout* topLayout = new QGridLayout(this, 2, 2, 0);
QHBoxLayout* layout = new QHBoxLayout(0);
GradientSelection::GradientSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) {
TQGridLayout* topLayout = new TQGridLayout(this, 2, 2, 0);
TQHBoxLayout* layout = new TQHBoxLayout(0);
layout->setMargin(3);
xyColorSelector = new KXYColorSelector(this);
connect(xyColorSelector, SIGNAL( valueChanged(int, int) ),
SLOT( slotXyColorSelectorPosChanged(int, int) ));
connect(xyColorSelector, TQT_SIGNAL( valueChanged(int, int) ),
TQT_SLOT( slotXyColorSelectorPosChanged(int, int) ));
layout->addWidget(xyColorSelector);
topLayout->addLayout(layout, 0, 0);
topLayout->setRowStretch(0, 10);
topLayout->setRowStretch(1, 0);
QVBoxLayout* xyColorSelectorLayout = new QVBoxLayout();
QHBoxLayout* checkBoxLayout = new QHBoxLayout();
TQVBoxLayout* xyColorSelectorLayout = new TQVBoxLayout();
TQHBoxLayout* checkBoxLayout = new TQHBoxLayout();
checkBoxLayout->setMargin(0);
variableCheckBox = new QCheckBox(i18n( "Variable" ), this);
variableCheckBox = new TQCheckBox(i18n( "Variable" ), this);
variableGlobalComponent = false;
connect(variableCheckBox, SIGNAL( toggled(bool) ), SLOT( slotSetVariableGlobalComponent(bool) ));
connect(variableCheckBox, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( slotSetVariableGlobalComponent(bool) ));
checkBoxLayout->addSpacing(2);
checkBoxLayout->addWidget(variableCheckBox);
xyColorSelectorLayout->addLayout(checkBoxLayout);
xyColorSelectorLayout->addStretch(10);
QHBoxLayout* buttonsLayout = new QHBoxLayout();
synchronizeColorButton = new QPushButton(i18n( "Synchronize" ), this);
connect(synchronizeColorButton, SIGNAL( clicked() ), SLOT( slotSynchronizeColor() ));
TQHBoxLayout* buttonsLayout = new TQHBoxLayout();
synchronizeColorButton = new TQPushButton(i18n( "Synchronize" ), this);
connect(synchronizeColorButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotSynchronizeColor() ));
buttonsLayout->addSpacing(2);
buttonsLayout->addWidget(synchronizeColorButton);
buttonsLayout->addStretch(10);
@@ -55,19 +55,19 @@ GradientSelection::GradientSelection(QWidget *parent, const char *name ) : QWidg
xyColorSelectorLayout->addSpacing(2);
topLayout->addLayout(xyColorSelectorLayout, 1, 0);
zColorSelector = new KZColorSelector(KZColorSelector::Vertical, this);
connect(zColorSelector, SIGNAL( valueChanged(int) ),
SLOT( slotZColorSelectorPosChanged(int) ));
connect(zColorSelector, TQT_SIGNAL( valueChanged(int) ),
TQT_SLOT( slotZColorSelectorPosChanged(int) ));
zColorSelector->setFixedWidth(36);
topLayout->addWidget(zColorSelector, 0, 1);
QVBoxLayout* zColorSelectorLayout = new QVBoxLayout(0);
connect(&hsvButtons, SIGNAL( clicked(int) ), SLOT( slotSetColorSelectionMode(int) ));
QRadioButton* hRadioButton = new QRadioButton("H", this);
TQVBoxLayout* zColorSelectorLayout = new TQVBoxLayout(0);
connect(&hsvButtons, TQT_SIGNAL( clicked(int) ), TQT_SLOT( slotSetColorSelectionMode(int) ));
TQRadioButton* hRadioButton = new TQRadioButton("H", this);
hsvButtons.insert(hRadioButton, H_COMPONENT);
zColorSelectorLayout->addWidget(hRadioButton);
QRadioButton* sRadioButton = new QRadioButton("S", this);
TQRadioButton* sRadioButton = new TQRadioButton("S", this);
hsvButtons.insert(sRadioButton, S_COMPONENT);
zColorSelectorLayout->addWidget(sRadioButton);
QRadioButton* vRadioButton = new QRadioButton("V", this);
TQRadioButton* vRadioButton = new TQRadioButton("V", this);
hsvButtons.insert(vRadioButton, V_COMPONENT);
vRadioButton->toggle();
zColorSelectorLayout->addWidget(vRadioButton);
@@ -88,7 +88,7 @@ void GradientSelection::slotSetValue(Color* color) {
int newHComponent;
int newSComponent;
int newVComponent;
QColor hsvColor(this->color.component(Color::RED_INDEX),
TQColor hsvColor(this->color.component(Color::RED_INDEX),
this->color.component(Color::GREEN_INDEX),
this->color.component(Color::BLUE_INDEX));
hsvColor.hsv(&newHComponent, &newSComponent, &newVComponent);
@@ -210,7 +210,7 @@ void GradientSelection::slotXyColorSelectorPosChanged(int x, int y) {
break;
}
QColor rgbColor;
TQColor rgbColor;
rgbColor.setHsv(hComponent, sComponent, vComponent);
color.setComponents(rgbColor.red(), rgbColor.green(), rgbColor.blue());
updateZColorSelector();
@@ -233,7 +233,7 @@ void GradientSelection::slotZColorSelectorPosChanged(int y) {
break;
}
QColor rgbColor;
TQColor rgbColor;
rgbColor.setHsv(hComponent, sComponent, vComponent);
color.setComponents(rgbColor.red(), rgbColor.green(), rgbColor.blue());
updateXyColorSelector(false);

+ 9
- 9
kcoloredit/gradientselection.h View File

@@ -18,10 +18,10 @@
#ifndef GRADIENTSELECTION_H
#define GRADIENTSELECTION_H

#include <qwidget.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qbuttongroup.h>
#include <tqwidget.h>
#include <tqcheckbox.h>
#include <tqpushbutton.h>
#include <tqbuttongroup.h>

#include "kxycolorselector.h"
#include "kzcolorselector.h"
@@ -30,12 +30,12 @@
/** A widget for selecting colors from gradients
* @author Artur Rataj
*/
class GradientSelection : public QWidget {
class GradientSelection : public TQWidget {
Q_OBJECT

public:
/** Constructs the widget */
GradientSelection(QWidget *parent=0, const char *name=0);
GradientSelection(TQWidget *parent=0, const char *name=0);
~GradientSelection();
/** Enables or disables the color synchronize button */
void enableSynchronizeColorButton(bool enable);
@@ -62,11 +62,11 @@ protected:
V_COMPONENT = KXYColorSelector::TYPE_HS };
/** Variable global component checkbox */
QCheckBox* variableCheckBox;
TQCheckBox* variableCheckBox;
/** Synchronize color button */
QPushButton* synchronizeColorButton;
TQPushButton* synchronizeColorButton;
/** HSV buttons button group widget */
QButtonGroup hsvButtons;
TQButtonGroup hsvButtons;
/** The two components selector */
KXYColorSelector* xyColorSelector;
/** The gradient selector */

+ 1
- 1
kcoloredit/imageselection.cpp View File

@@ -17,7 +17,7 @@

#include "imageselection.h"

ImageSelection::ImageSelection(QWidget *parent, const char *name ) : QWidget(parent,name) {
ImageSelection::ImageSelection(TQWidget *parent, const char *name ) : TQWidget(parent,name) {
}
ImageSelection::~ImageSelection(){
}

+ 3
- 3
kcoloredit/imageselection.h View File

@@ -18,19 +18,19 @@
#ifndef IMAGESELECTION_H
#define IMAGESELECTION_H

#include <qwidget.h>
#include <tqwidget.h>

#include "color.h"

/** This is a widget for selecting colors from an image
* @author Artur Rataj
*/
class ImageSelection : public QWidget {
class ImageSelection : public TQWidget {
Q_OBJECT

public:
/** constructs the widget */
ImageSelection(QWidget *parent=0, const char *name=0);
ImageSelection(TQWidget *parent=0, const char *name=0);
~ImageSelection();
signals:

+ 2
- 2
kcoloredit/kcolorchooser.cpp View File

@@ -57,13 +57,13 @@ int main(int argc, char *argv[])

dlg.setColor(Qt::blue); // Just a color

app.connect(&dlg, SIGNAL(finished()), SLOT(quit()));
app.connect(&dlg, TQT_SIGNAL(finished()), TQT_SLOT(quit()));

dlg.show();
app.exec();

KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
const QColor c = dlg.color();
const TQColor c = dlg.color();
if ( args->isSet("print") && c.isValid() ) {
std::cout << c.name().utf8().data() << std::endl;
}

+ 32
- 32
kcoloredit/kcoloredit.cpp View File

@@ -16,9 +16,9 @@
***************************************************************************/

// include files for QT
#include <qdir.h>
#include <qprinter.h>
#include <qpainter.h>
#include <tqdir.h>
#include <tqprinter.h>
#include <tqpainter.h>

// include files for KDE
#include <kiconloader.h>
@@ -64,40 +64,40 @@ KColorEditApp::~KColorEditApp() {
void KColorEditApp::initActions()
{
// File actiojns
KStdAction::openNew( this, SLOT( slotFileNew() ), actionCollection() );
KStdAction::open( this, SLOT( slotFileOpen() ), actionCollection() );
KStdAction::saveAs( this, SLOT( slotFileSaveAs() ), actionCollection() );
KStdAction::close( this, SLOT( slotClose() ), actionCollection() );
KStdAction::quit( this, SLOT( slotQuit() ), actionCollection() );
m_actSave = KStdAction::save( this, SLOT( slotFileSave() ),
KStdAction::openNew( this, TQT_SLOT( slotFileNew() ), actionCollection() );
KStdAction::open( this, TQT_SLOT( slotFileOpen() ), actionCollection() );
KStdAction::saveAs( this, TQT_SLOT( slotFileSaveAs() ), actionCollection() );
KStdAction::close( this, TQT_SLOT( slotClose() ), actionCollection() );
KStdAction::quit( this, TQT_SLOT( slotQuit() ), actionCollection() );
m_actSave = KStdAction::save( this, TQT_SLOT( slotFileSave() ),
actionCollection() );
m_actRecent = KStdAction::openRecent( this,
SLOT( slotFileOpenRecent( const KURL& ) ), actionCollection() );
TQT_SLOT( slotFileOpenRecent( const KURL& ) ), actionCollection() );

( void ) new KAction( i18n("New &Window"), kapp->miniIcon(), KShortcut(),
this, SLOT( slotFileNewWindow() ), actionCollection(),
this, TQT_SLOT( slotFileNewWindow() ), actionCollection(),
"file_new_window" );

// Edit actions
m_actCut = KStdAction::cut( this, SLOT( slotEditCut() ),
m_actCut = KStdAction::cut( this, TQT_SLOT( slotEditCut() ),
actionCollection() );
m_actCopy = KStdAction::copy( this, SLOT( slotEditCopy() ),
m_actCopy = KStdAction::copy( this, TQT_SLOT( slotEditCopy() ),
actionCollection() );
m_actPaste = KStdAction::paste( this, SLOT( slotEditPaste() ),
m_actPaste = KStdAction::paste( this, TQT_SLOT( slotEditPaste() ),
actionCollection() );

m_actPaste->setEnabled( false );

// Color Menu
m_actNames = new KToggleAction( i18n("Show &Color Names"), KShortcut(), this,
SLOT( slotViewColorNames() ), actionCollection(),
TQT_SLOT( slotViewColorNames() ), actionCollection(),
"color_view_names" );
m_actNames->setCheckedState(i18n("Hide &Color Names"));
m_actPalette = new KAction( i18n("From &Palette"), KShortcut(), this,
SLOT( slotColorFromPalette() ), actionCollection(),
TQT_SLOT( slotColorFromPalette() ), actionCollection(),
"color_from_palette" );
( void ) new KAction( i18n("From &Screen"), KShortcut(), this,
SLOT( slotColorFromScreen() ), actionCollection(),
TQT_SLOT( slotColorFromScreen() ), actionCollection(),
"color_from_screen" );
}

@@ -112,14 +112,14 @@ void KColorEditApp::initDocument()
doc = new KColorEditDoc(this);
doc->newDocument();

connect( doc, SIGNAL( selectionChanged( int, int ) ),
SLOT( slotSelectionChanged( int, int ) ) );
connect( doc, SIGNAL( clipboardChanged() ),
SLOT( slotClipboardChanged() ) );
connect( doc, SIGNAL( modified( bool ) ),
SLOT( slotModified( bool ) ) );
connect( doc, SIGNAL( paletteAvailable( bool ) ),
SLOT( slotPaletteAvailable( bool ) ) );
connect( doc, TQT_SIGNAL( selectionChanged( int, int ) ),
TQT_SLOT( slotSelectionChanged( int, int ) ) );
connect( doc, TQT_SIGNAL( clipboardChanged() ),
TQT_SLOT( slotClipboardChanged() ) );
connect( doc, TQT_SIGNAL( modified( bool ) ),
TQT_SLOT( slotModified( bool ) ) );
connect( doc, TQT_SIGNAL( paletteAvailable( bool ) ),
TQT_SLOT( slotPaletteAvailable( bool ) ) );
}

void KColorEditApp::initView()
@@ -178,7 +178,7 @@ bool KColorEditApp::queryExit()
}

/////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATION
// TQT_SLOT IMPLEMENTATION
/////////////////////////////////////////////////////////////////////

void KColorEditApp::slotSelectionChanged( int begin, int end )
@@ -221,7 +221,7 @@ void KColorEditApp::slotFileOpen() {
if(doc->saveModified()) {
LoadPaletteDlg dialog(this);
if(dialog.exec()) {
QString fileToOpen = dialog.getFileName();
TQString fileToOpen = dialog.getFileName();
if(!fileToOpen.isEmpty())
{
if(!doc->openDocument( fileToOpen )) {
@@ -255,12 +255,12 @@ bool KColorEditApp::slotFileSaveAs()
bool result = true;

while(result) {
QString newName=KFileDialog::getSaveFileName(lastSavePaletteAsFileDir,
TQString newName=KFileDialog::getSaveFileName(lastSavePaletteAsFileDir,
"*|" + i18n("All Files"), this, i18n("Save As"));
if(newName.isEmpty())
result = false;
else {
QFileInfo saveAsInfo(newName);
TQFileInfo saveAsInfo(newName);
if(!saveAsInfo.exists() ||
KMessageBox::questionYesNo( this,
i18n("A Document with this name already exists.\n"
@@ -291,7 +291,7 @@ void KColorEditApp::slotClose()

void KColorEditApp::slotFilePrint()
{
QPrinter printer;
TQPrinter printer;
if (printer.setup(this))
{
view->print(&printer);
@@ -348,12 +348,12 @@ void KColorEditApp::slotViewColorNames()