1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <kdemodalityfilter.hxx>
23 #include <kdefilepicker.hxx>
24 #include <kdecommandthread.hxx>
27 #include <tqeventloop.h>
28 #include <tdeaboutdata.h>
29 #include <tdeapplication.h>
30 #include <tdecmdlineargs.h>
32 #include <kaboutdata.h>
33 #include <kapplication.h>
34 #include <kcmdlineargs.h>
40 #include <config_vclplug.h>
43 #define THIS_DESKENV_NAME_CAP "TDE"
44 #define THIS_DESKENV_NAME_LOW "tde"
46 #define THIS_DESKENV_NAME_CAP "KDE"
47 #define THIS_DESKENV_NAME_LOW "kde"
51 #define KAboutData TDEAboutData
52 #define KCmdLineArgs TDECmdLineArgs
53 #define KCmdLineOptions TDECmdLineOptions
54 #define KCmdLineLastOption TDECmdLineLastOption
55 #define KApplication TDEApplication
56 #define KLocale TDELocale
61 static const KCmdLineOptions sOptions
[] =
63 { "winid <argument>", I18N_NOOP("Window ID to which is the fpicker modal"), "0" },
67 int main( int argc
, char* argv
[] )
69 // we fake the name of the application to have "LibreOffice" in the
71 KAboutData
qAboutData( "kdefilepicker", I18N_NOOP( "LibreOffice" ),
72 "0.1", I18N_NOOP( "kdefilepicker is an implementation of the " THIS_DESKENV_NAME_CAP
" file dialog for LibreOffice." ),
73 KAboutData::License_LGPL
,
74 "(c) 2004, Jan Holesovsky" );
75 qAboutData
.addAuthor( "Jan Holesovsky", I18N_NOOP("Original author and current maintainer"), "kendy@openoffice.org" );
77 // Let the user see that this does something...
78 ::std::cerr
<< "kdefilepicker, an implementation of a " THIS_DESKENV_NAME_CAP
" file dialog for OOo." << ::std::endl
79 << "Type 'exit' and press Enter to finish." << ::std::endl
;
81 KCmdLineArgs::addCmdLineOptions( sOptions
);
82 KCmdLineArgs::init( argc
, argv
, &qAboutData
);
84 KLocale::setMainCatalogue( "kdialog" );
86 KApplication kApplication
;
89 KCmdLineArgs
*pArgs
= KCmdLineArgs::parsedArgs();
90 long nWinId
= atol( pArgs
->getOption( "winid" ) );
93 KDEModalityFilter
qModalityFilter( nWinId
);
95 KDEFileDialog
aFileDialog( NULL
, QString(), NULL
, THIS_DESKENV_NAME_LOW
"filedialog" );
97 KDECommandThread
qCommandThread( &aFileDialog
);
98 qCommandThread
.start();
102 qCommandThread
.wait();
104 ::std::cout
<< "exited" << ::std::endl
;
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */