From b10a61b1fd2fe561ba61a384d4a344bae2a4aa29 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 01:04:58 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- ksirc/CMakeLists.txt | 2 +- ksirc/FilterRuleEditor.cpp | 2 +- ksirc/KSOpenkSirc/open_ksirc.cpp | 2 +- ksirc/KSPrefs/page_autoconnect.cpp | 2 +- ksirc/KSPrefs/page_colors.cpp | 2 +- ksirc/KSPrefs/page_irccolors.cpp | 2 +- ksirc/KSPrefs/page_looknfeel.cpp | 2 +- ksirc/KSPrefs/page_servchan.cpp | 2 +- ksirc/KSPrefs/page_startup.cpp | 2 +- ksirc/KSTicker/ksticker.cpp | 2 +- ksirc/KSTicker/ksttest.cpp | 2 +- ksirc/NewWindowDialog.cpp | 2 +- ksirc/dccNew.cpp | 2 +- ksirc/iocontroller.cpp | 2 +- ksirc/ksirc.cpp | 2 +- ksirc/ksircprocess.cpp | 2 +- ksirc/ksopts.cpp | 2 +- ksirc/ksview.cpp | 4 +- ksirc/mditoplevel.cpp | 2 +- ksirc/puke/Makefile.am | 4 +- ksirc/puke/controller.cpp | 2 +- ksirc/puke/dcc_status.pm | 2 +- ksirc/puke/load_all.pm | 2 +- ksirc/puke/pkfiledialog-cmd.h | 56 ----------------- ksirc/puke/pkfiledialog.cpp | 123 ------------------------------------- ksirc/puke/pkfiledialog.h | 32 ---------- ksirc/puke/pkfiledialog.pm | 76 ----------------------- ksirc/puke/ptdefiledialog-cmd.h | 56 +++++++++++++++++ ksirc/puke/ptdefiledialog.cpp | 123 +++++++++++++++++++++++++++++++++++++ ksirc/puke/ptdefiledialog.h | 32 ++++++++++ ksirc/puke/ptdefiledialog.pm | 76 +++++++++++++++++++++++ ksirc/servercontroller.cpp | 2 +- ksirc/topic.cpp | 4 +- ksirc/toplevel.cpp | 4 +- ksirc/usercontrolmenu.cpp | 2 +- 35 files changed, 318 insertions(+), 318 deletions(-) delete mode 100644 ksirc/puke/pkfiledialog-cmd.h delete mode 100644 ksirc/puke/pkfiledialog.cpp delete mode 100644 ksirc/puke/pkfiledialog.h delete mode 100644 ksirc/puke/pkfiledialog.pm create mode 100644 ksirc/puke/ptdefiledialog-cmd.h create mode 100644 ksirc/puke/ptdefiledialog.cpp create mode 100644 ksirc/puke/ptdefiledialog.h create mode 100644 ksirc/puke/ptdefiledialog.pm (limited to 'ksirc') diff --git a/ksirc/CMakeLists.txt b/ksirc/CMakeLists.txt index 6c6a1bf8..15dbf624 100644 --- a/ksirc/CMakeLists.txt +++ b/ksirc/CMakeLists.txt @@ -68,5 +68,5 @@ tde_add_tdeinit_executable( ksirc AUTOMOC dccNewbase.ui dccNew.cpp LINK ksprefs-static ksprogress-static ksopenksirc-static ksticker-static - kio-shared + tdeio-shared ) diff --git a/ksirc/FilterRuleEditor.cpp b/ksirc/FilterRuleEditor.cpp index 46819832..b4260829 100644 --- a/ksirc/FilterRuleEditor.cpp +++ b/ksirc/FilterRuleEditor.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/KSOpenkSirc/open_ksirc.cpp b/ksirc/KSOpenkSirc/open_ksirc.cpp index 41e13323..f562b2af 100644 --- a/ksirc/KSOpenkSirc/open_ksirc.cpp +++ b/ksirc/KSOpenkSirc/open_ksirc.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/ksirc/KSPrefs/page_autoconnect.cpp b/ksirc/KSPrefs/page_autoconnect.cpp index 2c868841..964a4acd 100644 --- a/ksirc/KSPrefs/page_autoconnect.cpp +++ b/ksirc/KSPrefs/page_autoconnect.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/ksirc/KSPrefs/page_colors.cpp b/ksirc/KSPrefs/page_colors.cpp index ae5c25fa..cf4f04d8 100644 --- a/ksirc/KSPrefs/page_colors.cpp +++ b/ksirc/KSPrefs/page_colors.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/KSPrefs/page_irccolors.cpp b/ksirc/KSPrefs/page_irccolors.cpp index 5ed96054..89de8231 100644 --- a/ksirc/KSPrefs/page_irccolors.cpp +++ b/ksirc/KSPrefs/page_irccolors.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include PageIRCColors::PageIRCColors( TQWidget *parent, const char *name ) : PageIRCColorsBase( parent, name) diff --git a/ksirc/KSPrefs/page_looknfeel.cpp b/ksirc/KSPrefs/page_looknfeel.cpp index 29608e04..82244bb7 100644 --- a/ksirc/KSPrefs/page_looknfeel.cpp +++ b/ksirc/KSPrefs/page_looknfeel.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include "page_looknfeel.h" PageLooknFeel::PageLooknFeel( TQWidget *parent, const char *name ) : PageLooknFeelBase( parent, name) diff --git a/ksirc/KSPrefs/page_servchan.cpp b/ksirc/KSPrefs/page_servchan.cpp index 24e36938..6be5ef5b 100644 --- a/ksirc/KSPrefs/page_servchan.cpp +++ b/ksirc/KSPrefs/page_servchan.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include PageServChan::PageServChan( TQWidget *parent, const char *name ) : PageServChanBase( parent, name) { diff --git a/ksirc/KSPrefs/page_startup.cpp b/ksirc/KSPrefs/page_startup.cpp index e2ddfdc1..691b8cc2 100644 --- a/ksirc/KSPrefs/page_startup.cpp +++ b/ksirc/KSPrefs/page_startup.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/ksirc/KSTicker/ksticker.cpp b/ksirc/KSTicker/ksticker.cpp index 5187489a..f2d77e39 100644 --- a/ksirc/KSTicker/ksticker.cpp +++ b/ksirc/KSTicker/ksticker.cpp @@ -17,7 +17,7 @@ #include "../ksopts.h" #include "../nickColourMaker.h" -#include +#include #include #include diff --git a/ksirc/KSTicker/ksttest.cpp b/ksirc/KSTicker/ksttest.cpp index ad8c3864..6c4bd80e 100644 --- a/ksirc/KSTicker/ksttest.cpp +++ b/ksirc/KSTicker/ksttest.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/ksirc/NewWindowDialog.cpp b/ksirc/NewWindowDialog.cpp index ce8309cc..9ec1136a 100644 --- a/ksirc/NewWindowDialog.cpp +++ b/ksirc/NewWindowDialog.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/ksirc/dccNew.cpp b/ksirc/dccNew.cpp index 5d345cc2..9174d4a7 100644 --- a/ksirc/dccNew.cpp +++ b/ksirc/dccNew.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/ksirc/iocontroller.cpp b/ksirc/iocontroller.cpp index 0545b189..db0615a4 100644 --- a/ksirc/iocontroller.cpp +++ b/ksirc/iocontroller.cpp @@ -84,7 +84,7 @@ #include #include #include -#include +#include int KSircIOController::counter = 0; diff --git a/ksirc/ksirc.cpp b/ksirc/ksirc.cpp index cd6018bb..ba9dbcda 100644 --- a/ksirc/ksirc.cpp +++ b/ksirc/ksirc.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include //#include "cdate.h" diff --git a/ksirc/ksircprocess.cpp b/ksirc/ksircprocess.cpp index 47e36c52..2aefe7d1 100644 --- a/ksirc/ksircprocess.cpp +++ b/ksirc/ksircprocess.cpp @@ -107,7 +107,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/ksopts.cpp b/ksirc/ksopts.cpp index 4b3517a4..d9035f19 100644 --- a/ksirc/ksopts.cpp +++ b/ksirc/ksopts.cpp @@ -1,6 +1,6 @@ #include -#include +#include #if KDE_IS_VERSION(3,1,92) #include diff --git a/ksirc/ksview.cpp b/ksirc/ksview.cpp index 81177b13..3d895513 100644 --- a/ksirc/ksview.cpp +++ b/ksirc/ksview.cpp @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #include #include "ksopts.h" diff --git a/ksirc/mditoplevel.cpp b/ksirc/mditoplevel.cpp index 510b40e8..c6047674 100644 --- a/ksirc/mditoplevel.cpp +++ b/ksirc/mditoplevel.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/puke/Makefile.am b/ksirc/puke/Makefile.am index de25d641..4fbf90d2 100644 --- a/ksirc/puke/Makefile.am +++ b/ksirc/puke/Makefile.am @@ -12,7 +12,7 @@ libpuke_la_SOURCES = pwidget.cpp pobject.cpp \ pprogress.cpp ptablevw.cpp plistbox.cpp \ plabel.cpp pmenudta.cpp ppopmenu.cpp \ palistbox.cpp ptabdialog.cpp \ - pkfiledialog.cpp pobjfinder.cpp + ptdefiledialog.cpp pobjfinder.cpp $(srcdir)/HOWTO-PUKE.txt: HOWTO-PUKE.pod pod2text $(srcdir)/HOWTO-PUKE.pod > HOWTO-PUKE.txt @@ -34,7 +34,7 @@ perl_DATA = commands-handler.pl commands-perl.pl convert_commands.pl \ puke.pl small.pl test.pl tester.pl \ dcc_progress.pm dcc_status.pm load_all.pm \ palistbox.pm pbase.pm pboxlayout.pm pbutton.pm pframe.pm \ - pkfiledialog.pm plabel.pm plined.pm plistbox.pm pmenudta.pm \ + ptdefiledialog.pm plabel.pm plined.pm plistbox.pm pmenudta.pm \ ppopmenu.pm pprogress.pm ppushbt.pm ptabdialog.pm ptablevw.pm \ pwidget.pm pobjfinder.pm diff --git a/ksirc/puke/controller.cpp b/ksirc/puke/controller.cpp index a7c95091..7d5e85e3 100644 --- a/ksirc/puke/controller.cpp +++ b/ksirc/puke/controller.cpp @@ -30,7 +30,7 @@ using namespace std; // iostream.h include cstring which puts strlen into #include "palistbox.h" #include "pbutton.h" #include "pframe.h" -#include "pkfiledialog.h" +#include "ptdefiledialog.h" #include "plabel.h" #include "ptqlayout.h" #include "plined.h" diff --git a/ksirc/puke/dcc_status.pm b/ksirc/puke/dcc_status.pm index 65bc1b07..149219d2 100644 --- a/ksirc/puke/dcc_status.pm +++ b/ksirc/puke/dcc_status.pm @@ -11,7 +11,7 @@ &docommand("/load pbutton.pm"); &docommand("/load ppushbt.pm"); &docommand("/load plined.pm"); -&docommand("/load pkfiledialog.pm"); +&docommand("/load ptdefiledialog.pm"); &docommand("/load ppopmenu.pm"); &docommand("/load dcc_progress.pm"); diff --git a/ksirc/puke/load_all.pm b/ksirc/puke/load_all.pm index 26594c0f..b54a7dc7 100644 --- a/ksirc/puke/load_all.pm +++ b/ksirc/puke/load_all.pm @@ -10,5 +10,5 @@ &docommand("/load plistbox.pm"); &docommand("/load ppopmenu.pm"); &docommand("/load ptabdialog.pm"); -&docommand("/load pkfiledialog.pm"); +&docommand("/load ptdefiledialog.pm"); &docommand("/load pobjfinder.pm"); diff --git a/ksirc/puke/pkfiledialog-cmd.h b/ksirc/puke/pkfiledialog-cmd.h deleted file mode 100644 index 6aebd59e..00000000 --- a/ksirc/puke/pkfiledialog-cmd.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef PKFILEDIALOG_CMD_H -#define PKFILEDIALOG_CMD_H - -/* - * We get 2200 - */ - -// Desc: sets the current directory -// iWinId: widget -// iArg: not defined -// cArg: path -#define PUKE_KBFD_SET_PATH 2200 - -// Desc: ack for the set -// iWinId: widget -// iArg: not defined -// cArg: actual path -#define PUKE_BFD_SET_PATH_ACK -2200 - -// Desc: sets the current filter -// iWinId: widget -// iArg: not defined -// cArg: filter, as defined in KFileBaseDialog::setFilter -#define PUKE_KBFD_SET_FILTER 2201 - -// Desc: ack for the set -// iWinId: widget -// iArg: not defined -// cArg: not define -#define PUKE_KBFD_SET_FILTER_ACK -2201 - -// Desc: sets the current file -// iWinId: widget -// iArg: not defined -// cArg: filename (does it need the full path?) -#define PUKE_KBFD_SET_SELECTION 2202 - -// Desc: ack for the set -// iWinId: widget -// iArg: not defined -// cArg: not define -#define PUKE_KBFD_SET_SELECTION_ACK -2202 - -// Desc: ack for current file select -// iWinId: not defined -// iArg: not defined -// cArg: not defined -#define PUKE_KBFD_FILE_SELECTED 2203 - -// Desc: ack for current file select -// iWinId: widget -// iArg: not defined -// cArg: filename -#define PUKE_KBFD_FILE_SELECTED_ACK -2203 - -#endif diff --git a/ksirc/puke/pkfiledialog.cpp b/ksirc/puke/pkfiledialog.cpp deleted file mode 100644 index 53d37aa7..00000000 --- a/ksirc/puke/pkfiledialog.cpp +++ /dev/null @@ -1,123 +0,0 @@ -#include - - -#include - -#include "pkfiledialog.h" -#include "pkfiledialog-cmd.h" - -PObject * -PKFileDialog::createWidget(CreateArgs &ca) -{ - PKFileDialog *pw = new PKFileDialog(ca.parent); - KFileDialog *kfbd; - if(ca.fetchedObj != 0 && ca.fetchedObj->inherits("KFileDialog") == TRUE){ - kfbd = (KFileDialog *) ca.fetchedObj; - pw->setDeleteAble(FALSE); - } - else // Never takes a parent in Puke - kfbd = new KFileDialog("/", TQString(), 0L, "PukeKFileDialog", TRUE); - pw->setWidget(kfbd); - pw->setWidgetId(ca.pwI); - return pw; -} - - -PKFileDialog::PKFileDialog(PObject *parent) - : PWidget(parent) -{ - kfbd = 0; - setWidget(kfbd); -} - -PKFileDialog::~PKFileDialog() -{ - // kdDebug(5008) << "PLineEdit: in destructor" << endl; - /* - delete widget(); // Delete the frame - kfbd=0; // Set it to 0 - setWidget(kfbd); // Now set all widget() calls to 0. - */ -} - -void PKFileDialog::messageHandler(int fd, PukeMessage *pm) -{ - TQString selFile; - PukeMessage pmRet; - if(widget() == 0){ - kdDebug(5008) << "PKFileDialog: No Widget set" << endl; - return; - } - switch(pm->iCommand){ - case PUKE_KBFD_SET_PATH: - ((KFileDialog*)widget())->setURL(KURL(pm->cArg)); - - pmRet.iCommand = - pm->iCommand; - pmRet.iWinId = pm->iWinId; - pmRet.iArg = 0; - pmRet.iTextSize = widget()->baseURL().path().length(); -#warning check if the cast is okay - pmRet.cArg = (char*) widget()->baseURL().path().ascii(); - emit outputMessage(fd, &pmRet); - break; - case PUKE_KBFD_SET_FILTER: - widget()->setFilter(pm->cArg); - - pmRet.iCommand = - pm->iCommand; - pmRet.iWinId = pm->iWinId; - pmRet.iArg = 0; - pmRet.iTextSize = 0; - pmRet.cArg = 0; - emit outputMessage(fd, &pmRet); - break; - case PUKE_KBFD_SET_SELECTION: - widget()->setSelection(pm->cArg); - - pmRet.iCommand = - pm->iCommand; - pmRet.iWinId = pm->iWinId; - pmRet.iArg = 0; - selFile = widget()->selectedURL().path(); - pmRet.iTextSize = selFile.length(); -#warning check if the cast is okay - pmRet.cArg = (char*) selFile.ascii(); - emit outputMessage(fd, &pmRet); - break; - case PUKE_WIDGET_SHOW: - widget()->exec(); - pmRet.iCommand = PUKE_KBFD_FILE_SELECTED_ACK; - pmRet.iWinId = pm->iWinId; - pmRet.iArg = 0; - pmRet.cArg = new char[selFile.length()]; - selFile = widget()->selectedURL().path(); - // #### HPB: using strlen() 'cause we want the length of the .ascii() - // string. We should probably replace in the future. - memcpy(pmRet.cArg, selFile.ascii(), strlen(selFile.ascii())); - pmRet.iTextSize = selFile.length(); - emit outputMessage(widgetIden().fd, &pmRet); - delete pmRet.cArg; - break; - - default: - PWidget::messageHandler(fd, pm); - } -} - -void PKFileDialog::setWidget(TQObject *_kbfd) -{ - if(_kbfd != 0 && _kbfd->inherits("KFileBaseDialog") == FALSE) - { - errorInvalidSet(_kbfd); - return; - } - - kfbd = (KFileDialog *) _kbfd; - PWidget::setWidget(kfbd); -} - - -KFileDialog *PKFileDialog::widget() -{ - return kfbd; -} - -#include "pkfiledialog.moc" diff --git a/ksirc/puke/pkfiledialog.h b/ksirc/puke/pkfiledialog.h deleted file mode 100644 index 403f8493..00000000 --- a/ksirc/puke/pkfiledialog.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef PKFILEDIALOG_H -#define PKFILEDIALOG_H - -class PKFileDialog; - -#include -#include "pmessage.h" -#include "pwidget.h" -#include "controller.h" - -class PKFileDialog : public PWidget -{ - Q_OBJECT - -public: - static PObject *createWidget(CreateArgs &ca); - - PKFileDialog ( PObject * parent ); - virtual ~PKFileDialog (); - - virtual void messageHandler(int fd, PukeMessage *pm); - - virtual void setWidget(TQObject *_f = 0x0); - virtual KFileDialog *widget(); - -public slots: - -private: - KFileDialog *kfbd; -}; - -#endif diff --git a/ksirc/puke/pkfiledialog.pm b/ksirc/puke/pkfiledialog.pm deleted file mode 100644 index 6da8c229..00000000 --- a/ksirc/puke/pkfiledialog.pm +++ /dev/null @@ -1,76 +0,0 @@ - -&::PukeSendMessage($PUKE_WIDGET_LOAD, - $::PUKE_CONTROLLER, - $PWIDGET_KFILEDIALOG, - "pkfiledialog.so", - sub { my %ARG = %{shift()}; - if($ARG{'iArg'} == 1){ - print "*E* PKFileDialog Load failed!\n"; - } - } - ); - -use strict; - -package PKFileDialog; -use vars qw(@ISA); -@ISA = qw(PWidget); - -sub new { - my $class = shift; - my $self = $class->SUPER::new($class, @_); - - $self->{widgetType} = $::PWIDGET_KFILEDIALOG; - - if($class eq 'PKFileDialog'){ - $self->create(); - } - - $self->installHandler($::PUKE_KBFD_FILE_SELECTED_ACK, sub{$self->fileSelected(shift())}); - - return $self; - -} - -sub setDir { - my $self = shift; - - my $dir = shift; - - $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_PATH, - 'cArg' => $dir, - 'CallBack' => sub{}); - -} - -sub setFilter { - my $self = shift; - - my $filter = shift; - - $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_FILTER, - 'cArg' => $filter, - 'CallBack' => sub{}); - -} - -sub setSelected { - my $self = shift; - - my $sel = shift; - - $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_SELECTION, - 'cArg' => $sel, - 'CallBack' => sub{}); - -} - -sub fileSelected { - my $self = shift; - my $rargs = shift; - - &::print("*I* File Selected: " . $rargs->{'cArg'}); - -} - -package main; diff --git a/ksirc/puke/ptdefiledialog-cmd.h b/ksirc/puke/ptdefiledialog-cmd.h new file mode 100644 index 00000000..6aebd59e --- /dev/null +++ b/ksirc/puke/ptdefiledialog-cmd.h @@ -0,0 +1,56 @@ +#ifndef PKFILEDIALOG_CMD_H +#define PKFILEDIALOG_CMD_H + +/* + * We get 2200 + */ + +// Desc: sets the current directory +// iWinId: widget +// iArg: not defined +// cArg: path +#define PUKE_KBFD_SET_PATH 2200 + +// Desc: ack for the set +// iWinId: widget +// iArg: not defined +// cArg: actual path +#define PUKE_BFD_SET_PATH_ACK -2200 + +// Desc: sets the current filter +// iWinId: widget +// iArg: not defined +// cArg: filter, as defined in KFileBaseDialog::setFilter +#define PUKE_KBFD_SET_FILTER 2201 + +// Desc: ack for the set +// iWinId: widget +// iArg: not defined +// cArg: not define +#define PUKE_KBFD_SET_FILTER_ACK -2201 + +// Desc: sets the current file +// iWinId: widget +// iArg: not defined +// cArg: filename (does it need the full path?) +#define PUKE_KBFD_SET_SELECTION 2202 + +// Desc: ack for the set +// iWinId: widget +// iArg: not defined +// cArg: not define +#define PUKE_KBFD_SET_SELECTION_ACK -2202 + +// Desc: ack for current file select +// iWinId: not defined +// iArg: not defined +// cArg: not defined +#define PUKE_KBFD_FILE_SELECTED 2203 + +// Desc: ack for current file select +// iWinId: widget +// iArg: not defined +// cArg: filename +#define PUKE_KBFD_FILE_SELECTED_ACK -2203 + +#endif diff --git a/ksirc/puke/ptdefiledialog.cpp b/ksirc/puke/ptdefiledialog.cpp new file mode 100644 index 00000000..d60b47d5 --- /dev/null +++ b/ksirc/puke/ptdefiledialog.cpp @@ -0,0 +1,123 @@ +#include + + +#include + +#include "ptdefiledialog.h" +#include "ptdefiledialog-cmd.h" + +PObject * +PKFileDialog::createWidget(CreateArgs &ca) +{ + PKFileDialog *pw = new PKFileDialog(ca.parent); + KFileDialog *kfbd; + if(ca.fetchedObj != 0 && ca.fetchedObj->inherits("KFileDialog") == TRUE){ + kfbd = (KFileDialog *) ca.fetchedObj; + pw->setDeleteAble(FALSE); + } + else // Never takes a parent in Puke + kfbd = new KFileDialog("/", TQString(), 0L, "PukeKFileDialog", TRUE); + pw->setWidget(kfbd); + pw->setWidgetId(ca.pwI); + return pw; +} + + +PKFileDialog::PKFileDialog(PObject *parent) + : PWidget(parent) +{ + kfbd = 0; + setWidget(kfbd); +} + +PKFileDialog::~PKFileDialog() +{ + // kdDebug(5008) << "PLineEdit: in destructor" << endl; + /* + delete widget(); // Delete the frame + kfbd=0; // Set it to 0 + setWidget(kfbd); // Now set all widget() calls to 0. + */ +} + +void PKFileDialog::messageHandler(int fd, PukeMessage *pm) +{ + TQString selFile; + PukeMessage pmRet; + if(widget() == 0){ + kdDebug(5008) << "PKFileDialog: No Widget set" << endl; + return; + } + switch(pm->iCommand){ + case PUKE_KBFD_SET_PATH: + ((KFileDialog*)widget())->setURL(KURL(pm->cArg)); + + pmRet.iCommand = - pm->iCommand; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = 0; + pmRet.iTextSize = widget()->baseURL().path().length(); +#warning check if the cast is okay + pmRet.cArg = (char*) widget()->baseURL().path().ascii(); + emit outputMessage(fd, &pmRet); + break; + case PUKE_KBFD_SET_FILTER: + widget()->setFilter(pm->cArg); + + pmRet.iCommand = - pm->iCommand; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = 0; + pmRet.iTextSize = 0; + pmRet.cArg = 0; + emit outputMessage(fd, &pmRet); + break; + case PUKE_KBFD_SET_SELECTION: + widget()->setSelection(pm->cArg); + + pmRet.iCommand = - pm->iCommand; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = 0; + selFile = widget()->selectedURL().path(); + pmRet.iTextSize = selFile.length(); +#warning check if the cast is okay + pmRet.cArg = (char*) selFile.ascii(); + emit outputMessage(fd, &pmRet); + break; + case PUKE_WIDGET_SHOW: + widget()->exec(); + pmRet.iCommand = PUKE_KBFD_FILE_SELECTED_ACK; + pmRet.iWinId = pm->iWinId; + pmRet.iArg = 0; + pmRet.cArg = new char[selFile.length()]; + selFile = widget()->selectedURL().path(); + // #### HPB: using strlen() 'cause we want the length of the .ascii() + // string. We should probably replace in the future. + memcpy(pmRet.cArg, selFile.ascii(), strlen(selFile.ascii())); + pmRet.iTextSize = selFile.length(); + emit outputMessage(widgetIden().fd, &pmRet); + delete pmRet.cArg; + break; + + default: + PWidget::messageHandler(fd, pm); + } +} + +void PKFileDialog::setWidget(TQObject *_kbfd) +{ + if(_kbfd != 0 && _kbfd->inherits("KFileBaseDialog") == FALSE) + { + errorInvalidSet(_kbfd); + return; + } + + kfbd = (KFileDialog *) _kbfd; + PWidget::setWidget(kfbd); +} + + +KFileDialog *PKFileDialog::widget() +{ + return kfbd; +} + +#include "ptdefiledialog.moc" diff --git a/ksirc/puke/ptdefiledialog.h b/ksirc/puke/ptdefiledialog.h new file mode 100644 index 00000000..cdf940a8 --- /dev/null +++ b/ksirc/puke/ptdefiledialog.h @@ -0,0 +1,32 @@ +#ifndef PKFILEDIALOG_H +#define PKFILEDIALOG_H + +class PKFileDialog; + +#include +#include "pmessage.h" +#include "pwidget.h" +#include "controller.h" + +class PKFileDialog : public PWidget +{ + Q_OBJECT + +public: + static PObject *createWidget(CreateArgs &ca); + + PKFileDialog ( PObject * parent ); + virtual ~PKFileDialog (); + + virtual void messageHandler(int fd, PukeMessage *pm); + + virtual void setWidget(TQObject *_f = 0x0); + virtual KFileDialog *widget(); + +public slots: + +private: + KFileDialog *kfbd; +}; + +#endif diff --git a/ksirc/puke/ptdefiledialog.pm b/ksirc/puke/ptdefiledialog.pm new file mode 100644 index 00000000..d91fedca --- /dev/null +++ b/ksirc/puke/ptdefiledialog.pm @@ -0,0 +1,76 @@ + +&::PukeSendMessage($PUKE_WIDGET_LOAD, + $::PUKE_CONTROLLER, + $PWIDGET_KFILEDIALOG, + "ptdefiledialog.so", + sub { my %ARG = %{shift()}; + if($ARG{'iArg'} == 1){ + print "*E* PKFileDialog Load failed!\n"; + } + } + ); + +use strict; + +package PKFileDialog; +use vars qw(@ISA); +@ISA = qw(PWidget); + +sub new { + my $class = shift; + my $self = $class->SUPER::new($class, @_); + + $self->{widgetType} = $::PWIDGET_KFILEDIALOG; + + if($class eq 'PKFileDialog'){ + $self->create(); + } + + $self->installHandler($::PUKE_KBFD_FILE_SELECTED_ACK, sub{$self->fileSelected(shift())}); + + return $self; + +} + +sub setDir { + my $self = shift; + + my $dir = shift; + + $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_PATH, + 'cArg' => $dir, + 'CallBack' => sub{}); + +} + +sub setFilter { + my $self = shift; + + my $filter = shift; + + $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_FILTER, + 'cArg' => $filter, + 'CallBack' => sub{}); + +} + +sub setSelected { + my $self = shift; + + my $sel = shift; + + $self->sendMessage('iCommand' => $::PUKE_KBFD_SET_SELECTION, + 'cArg' => $sel, + 'CallBack' => sub{}); + +} + +sub fileSelected { + my $self = shift; + my $rargs = shift; + + &::print("*I* File Selected: " . $rargs->{'cArg'}); + +} + +package main; diff --git a/ksirc/servercontroller.cpp b/ksirc/servercontroller.cpp index 61495815..4eea7003 100644 --- a/ksirc/servercontroller.cpp +++ b/ksirc/servercontroller.cpp @@ -82,7 +82,7 @@ #include #include -#include +#include #include #include #include diff --git a/ksirc/topic.cpp b/ksirc/topic.cpp index e1623a3c..92066916 100644 --- a/ksirc/topic.cpp +++ b/ksirc/topic.cpp @@ -21,8 +21,8 @@ #include #include #include -#include -#include +#include +#include #include "ksopts.h" #include "ksparser.h" diff --git a/ksirc/toplevel.cpp b/ksirc/toplevel.cpp index de75ee5f..3d502a52 100644 --- a/ksirc/toplevel.cpp +++ b/ksirc/toplevel.cpp @@ -67,9 +67,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/ksirc/usercontrolmenu.cpp b/ksirc/usercontrolmenu.cpp index 6fddff90..522a5ada 100644 --- a/ksirc/usercontrolmenu.cpp +++ b/ksirc/usercontrolmenu.cpp @@ -1,7 +1,7 @@ #include "usercontrolmenu.h" #include -#include +#include #include TQPtrList UserControlMenu::UserMenu; -- cgit v1.2.1