|
|
|
@ -102,7 +102,7 @@ static const char * getAppName(bool useTQt=true)
|
|
|
|
|
const char *a=useTQt && tqApp ? tqApp->argv()[0] : getAppNameFromPid(getpid());
|
|
|
|
|
const char *slash;
|
|
|
|
|
|
|
|
|
|
// Was the cmdline app java? if so, try to use its tqparent name - just in case
|
|
|
|
|
// Was the cmdline app java? if so, try to use its parent name - just in case
|
|
|
|
|
// its run from a shell script, etc. - e.g. as eclipse does
|
|
|
|
|
if(a && 0==strcmp(a, "java"))
|
|
|
|
|
a=getAppNameFromPid(getppid());
|
|
|
|
@ -309,7 +309,7 @@ class KTQtDialog : public TQDialog
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
KTQtDialog(TQWidget *tqparent) : TQDialog(tqparent, "kqt", true, WStyle_NoBorder|WX11BypassWM)
|
|
|
|
|
KTQtDialog(TQWidget *parent) : TQDialog(parent, "kqt", true, WStyle_NoBorder|WX11BypassWM)
|
|
|
|
|
{
|
|
|
|
|
resize(1, 1);
|
|
|
|
|
setWindowOpacity(0.0);
|
|
|
|
@ -391,13 +391,13 @@ class KTQtThread : public TQThread
|
|
|
|
|
int fd;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static bool sendMessage(TQWidget *tqparent, Operation op, TQStringList &res, TQString &selFilter,
|
|
|
|
|
static bool sendMessage(TQWidget *parent, Operation op, TQStringList &res, TQString &selFilter,
|
|
|
|
|
const TQString &title, const TQString &p1, const TQString *p2, bool ow)
|
|
|
|
|
{
|
|
|
|
|
if(connectToKDialogD(getAppName()))
|
|
|
|
|
{
|
|
|
|
|
char o=(char)op;
|
|
|
|
|
int xid=tqparent ? tqparent->tqtopLevelWidget()->winId() : tqApp->activeWindow()->winId();
|
|
|
|
|
int xid=parent ? parent->tqtopLevelWidget()->winId() : tqApp->activeWindow()->winId();
|
|
|
|
|
|
|
|
|
|
if(writeBlock(kdialogdSocket, &o, 1) &&
|
|
|
|
|
writeBlock(kdialogdSocket, (char *)&xid, 4) &&
|
|
|
|
@ -406,7 +406,7 @@ static bool sendMessage(TQWidget *tqparent, Operation op, TQStringList &res, TQS
|
|
|
|
|
(p2? writeString(kdialogdSocket, *p2) : true) &&
|
|
|
|
|
(OP_FILE_SAVE==op ? writeBool(kdialogdSocket, ow) : true))
|
|
|
|
|
{
|
|
|
|
|
KTQtDialog dlg(tqparent);
|
|
|
|
|
KTQtDialog dlg(parent);
|
|
|
|
|
KTQtThread thread(res, selFilter, kdialogdSocket, &dlg);
|
|
|
|
|
|
|
|
|
|
thread.start();
|
|
|
|
@ -486,14 +486,14 @@ static const TQString & startDir(const TQString &d)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString TQFileDialog::getOpenFileName(const TQString &initially, const TQString &filter,
|
|
|
|
|
TQWidget *tqparent, const char *name, const TQString &caption,
|
|
|
|
|
TQWidget *parent, const char *name, const TQString &caption,
|
|
|
|
|
TQString *selectedFilter, bool resolveSymlinks)
|
|
|
|
|
{
|
|
|
|
|
TQStringList res;
|
|
|
|
|
TQString f(qt2KdeFilter(filter));
|
|
|
|
|
kqtInit();
|
|
|
|
|
|
|
|
|
|
if(openKdeDialog(tqparent, caption, startDir(initially), &f, OP_FILE_OPEN, res, selectedFilter))
|
|
|
|
|
if(openKdeDialog(parent, caption, startDir(initially), &f, OP_FILE_OPEN, res, selectedFilter))
|
|
|
|
|
{
|
|
|
|
|
kde2TQtFilter(filter, selectedFilter);
|
|
|
|
|
TQString fn(res.first());
|
|
|
|
@ -504,7 +504,7 @@ TQString TQFileDialog::getOpenFileName(const TQString &initially, const TQString
|
|
|
|
|
return TQString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString TQFileDialog::getSaveFileName(const TQString &initially, const TQString &filter, TQWidget *tqparent,
|
|
|
|
|
TQString TQFileDialog::getSaveFileName(const TQString &initially, const TQString &filter, TQWidget *parent,
|
|
|
|
|
const char *name, const TQString &caption,
|
|
|
|
|
TQString *selectedFilter, bool resolveSymlinks)
|
|
|
|
|
{
|
|
|
|
@ -512,7 +512,7 @@ TQString TQFileDialog::getSaveFileName(const TQString &initially, const TQString
|
|
|
|
|
TQString f(qt2KdeFilter(filter));
|
|
|
|
|
kqtInit();
|
|
|
|
|
|
|
|
|
|
if (openKdeDialog(tqparent, caption, startDir(initially), &f, OP_FILE_SAVE, res, selectedFilter))
|
|
|
|
|
if (openKdeDialog(parent, caption, startDir(initially), &f, OP_FILE_SAVE, res, selectedFilter))
|
|
|
|
|
{
|
|
|
|
|
kde2TQtFilter(filter, selectedFilter);
|
|
|
|
|
TQString fn(res.first());
|
|
|
|
@ -523,7 +523,7 @@ TQString TQFileDialog::getSaveFileName(const TQString &initially, const TQString
|
|
|
|
|
return TQString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQString TQFileDialog::getExistingDirectory(const TQString &dir, TQWidget *tqparent, const char *name,
|
|
|
|
|
TQString TQFileDialog::getExistingDirectory(const TQString &dir, TQWidget *parent, const char *name,
|
|
|
|
|
const TQString &caption, bool dirOnly, bool resolveSymlinks)
|
|
|
|
|
{
|
|
|
|
|
TQStringList res;
|
|
|
|
@ -531,12 +531,12 @@ TQString TQFileDialog::getExistingDirectory(const TQString &dir, TQWidget *tqpar
|
|
|
|
|
|
|
|
|
|
kqtInit();
|
|
|
|
|
|
|
|
|
|
return openKdeDialog(tqparent, caption, dir, NULL, OP_FOLDER, res, &dummy)
|
|
|
|
|
return openKdeDialog(parent, caption, dir, NULL, OP_FOLDER, res, &dummy)
|
|
|
|
|
? res.first()
|
|
|
|
|
: TQString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQStringList TQFileDialog::getOpenFileNames(const TQString &filter, const TQString &dir, TQWidget *tqparent,
|
|
|
|
|
TQStringList TQFileDialog::getOpenFileNames(const TQString &filter, const TQString &dir, TQWidget *parent,
|
|
|
|
|
const char *name, const TQString &caption,
|
|
|
|
|
TQString *selectedFilter, bool resolveSymlinks)
|
|
|
|
|
{
|
|
|
|
@ -544,7 +544,7 @@ TQStringList TQFileDialog::getOpenFileNames(const TQString &filter, const TQStri
|
|
|
|
|
TQString f(qt2KdeFilter(filter));
|
|
|
|
|
kqtInit();
|
|
|
|
|
|
|
|
|
|
openKdeDialog(tqparent, caption, startDir(dir), &f, OP_FILE_OPEN_MULTIPLE, res, selectedFilter);
|
|
|
|
|
openKdeDialog(parent, caption, startDir(dir), &f, OP_FILE_OPEN_MULTIPLE, res, selectedFilter);
|
|
|
|
|
|
|
|
|
|
if(res.count())
|
|
|
|
|
{
|
|
|
|
|