[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: new_kcm_code: kdelibs/kcmshell
From: Frans Englich <frans.englich () telia ! com>
Date: 2004-11-10 18:26:26
Message-ID: 20041110182626.2A65B16C9E () office ! kde ! org
[Download RAW message or body]
CVS commit by englich:
Add support for --embed-proxy; embeds KCModuleProxy instead of the dialog in the host \
application. The former does not include the buttons.
M +4 -4 Makefile.am 1.2.2.4
M +45 -19 main.cpp 1.75.2.6
--- kdelibs/kcmshell/Makefile.am #1.2.2.3:1.2.2.4
@@ -24,9 +24,9 @@
lib_LTLIBRARIES =
bin_PROGRAMS =
-kdeinit_LTLIBRARIES = kcmshell2.la
+kdeinit_LTLIBRARIES = kcmshell.la
-kcmshell2_la_SOURCES = main.cpp
-kcmshell2_la_LIBADD = $(LIB_KDEUI) $(LIB_KUTILS)
-kcmshell2_la_LDFLAGS = $(all_libraries) -module -avoid-version
+kcmshell_la_SOURCES = main.cpp
+kcmshell_la_LIBADD = $(LIB_KDEUI) $(LIB_KUTILS)
+kcmshell_la_LDFLAGS = $(all_libraries) -module -avoid-version
noinst_HEADERS=main.h
--- kdelibs/kcmshell/main.cpp #1.75.2.5:1.75.2.6
@@ -32,4 +32,5 @@
#include <kcmoduleinfo.h>
#include <kcmoduleloader.h>
+#include <kcmoduleproxy.h>
#include <kcmultidialog.h>
#include <kdebug.h>
@@ -53,5 +54,6 @@ static KCmdLineOptions options[] =
{ "+module", I18N_NOOP("Configuration module to open."), 0 },
{ "lang <language>", I18N_NOOP("Specify a particular language."), 0 },
- { "embed <id>", I18N_NOOP("Window ID to embed into."), 0 },
+ { "embed <id>", I18N_NOOP("Embeds the module with buttons in window with id \
<id>."), 0 }, + { "embed-proxy <id>", I18N_NOOP("Embeds the module without buttons \
in window with id <id>."), 0 }, { "silent", I18N_NOOP("Do not display main \
window."), 0 }, KCmdLineLastOption
@@ -180,5 +182,5 @@ extern "C" int kdemain(int _argc, char *
{
KService::Ptr service = locateModule(args->arg(i));
- if (service)
+ if( service )
modules.append(service);
}
@@ -191,6 +193,38 @@ extern "C" int kdemain(int _argc, char *
dtype = KDialogBase::IconList;
- KCMultiDialog* dlg = new KCMultiDialog( dtype, i18n("Configure - \
%1").arg(kapp->caption()), 0, "", true ); + bool idValid;
+ int id;
+
+ if ( args->isSet( "embed-proxy" ))
+ {
+ id = args->getOption( "embed-proxy" ).toInt(&idValid);
+ if( idValid )
+ {
+ KCModuleProxy module( modules.first()->desktopEntryName() );
+ QXEmbed::embedClientIntoWindow( &module, id);
+ app.exec();
+ }
+ else
+ kdDebug(780) << "Supplied id '" << id << "' is not valid." << endl;
+
+ }
+
+ KCMultiDialog *dlg = new KCMultiDialog( dtype, i18n("Configure - \
%1").arg(kapp->caption()), 0, "", true ); +
+ if ( args->isSet( "embed" ))
+ {
+ id = args->getOption( "embed" ).toInt(&idValid);
+ if( idValid )
+ {
+ QXEmbed::embedClientIntoWindow( dlg, id );
+ dlg->exec();
+ delete dlg;
+ }
+ else
+ kdDebug(780) << "Supplied id '" << id << "' is not valid." << endl;
+ }
+ else
+ {
for (KService::List::ConstIterator it = modules.begin(); it != modules.end(); \
++it) dlg->addModule(KCModuleInfo(*it));
@@ -202,16 +236,8 @@ extern "C" int kdemain(int _argc, char *
setIcon(dlg, KCModuleInfo( modules.first()).icon());
- /* Should we embed? */
- const QCString embed = args->getOption( "embed" );
- if ( !embed.isEmpty() ) /* Yes */
- {
- bool ok;
- const int id = embed.toInt(&ok);
- if( ok )
- QXEmbed::embedClientIntoWindow(dlg, id);
- }
-
dlg->exec();
delete dlg;
+ }
+
return 0;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic