diff --git a/Makefile.am b/Makefile.am index c15dca8947..fd8c615c0b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ INCLUDES = -I$(srcdir)/lib $(all_includes) -SUBDIRS = lib . killer dialog kcmkwin pics clients oldheaders +SUBDIRS = lib . killer kcmkwin pics clients oldheaders bin_PROGRAMS = lib_LTLIBRARIES = diff --git a/dialog/Makefile.am b/dialog/Makefile.am deleted file mode 100644 index 4c5a853a9f..0000000000 --- a/dialog/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -INCLUDES = $(all_includes) - -bin_PROGRAMS = kwin_dialog_helper - -kwin_dialog_helper_SOURCES = dialog.cpp -kwin_dialog_helper_LDADD = $(LIB_KDEUI) -kwin_dialog_helper_LDFLAGS = $(all_libraries) $(KDE_RPATH) - -METASOURCES = AUTO diff --git a/dialog/dialog.cpp b/dialog/dialog.cpp deleted file mode 100644 index 241fdc93c4..0000000000 --- a/dialog/dialog.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - - Copyright (C) 2003 Lubos Lunak - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -static const KCmdLineOptions options[] = -{ // no need for I18N_NOOP(), this is not supposed to be used directly - { "message ", "Type of dialog message.", 0 }, - { "type ", "Dont show again type of dialog message.", 0 }, - { "window ", "Window for which the dialog is shown.", 0 }, - { "+[data]", "Additional data.", 0 }, - KCmdLineLastOption -}; - -int main( int argc, char* argv[] ) -{ - KCmdLineArgs::init( argc, argv, "kwin_dialog_helper", I18N_NOOP( "KWin" ), - I18N_NOOP( "KWin helper utility" ), "1.0" ); - KCmdLineArgs::addCmdLineOptions( options ); - KApplication app; - KGlobal::locale()->insertCatalogue( "kwin" ); // the messages are in kwin's .po file - KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); - QString message = args->getOption( "message" ); - QString type = args->getOption( "type" ); - QString text; - WId window = args->getOption( "window" ).toULong(); - if( message == "noborderaltf3" && args->count() == 1 ) - text = i18n( "You have selected to show a window without its border.\n" - "Without the border, you won't be able to enable the border " - "again using the mouse. Use the window operations menu instead, " - "activated using the %1 keyboard shortcut." ).arg( args->arg( 0 )); - else if( message == "fullscreenaltf3" && args->count() == 1 ) - text = i18n( "You have selected to show a window in fullscreen mode.\n" - "If the application itself doesn't have an option to turn the fullscreen " - "mode off, you won't be able to disable it " - "again using the mouse. Use the window operations menu instead, " - "activated using the %1 keyboard shortcut." ).arg( args->arg( 0 )); - else - { - KCmdLineArgs::usage( i18n( "This helper utility is not supposed to be called directly!" )); - return 1; - } - if( window != 0 ) - KMessageBox::informationWId( window, text, "", type ); - else - KMessageBox::information( NULL, text, "", type ); -} diff --git a/workspace.cpp b/workspace.cpp index 178592c3af..bd28af786a 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1858,26 +1858,41 @@ void Workspace::helperDialog( const QString& message, const Client* c ) { QStringList args; QString type; - if( message == "noborderaltf3" || message == "fullscreenaltf3" ) + if( message == "noborderaltf3" ) { - args.append( "\'" + keys->shortcut( "Window Operations Menu" ).seq( 0 ).toString() + "\'" ); + args << "--msgbox" << ( "\'" + + i18n( "You have selected to show a window without its border.\n" + "Without the border, you won't be able to enable the border " + "again using the mouse. Use the window operations menu instead, " + "activated using the %1 keyboard shortcut." ) + .arg( keys->shortcut( "Window Operations Menu" ).seq( 0 ).toString()) + "\'" ); + type = "altf3warning"; + } + else if( message == "fullscreenaltf3" ) + { + args << "--msgbox" << ( "\'" + + i18n( "You have selected to show a window in fullscreen mode.\n" + "If the application itself doesn't have an option to turn the fullscreen " + "mode off, you won't be able to disable it " + "again using the mouse. Use the window operations menu instead, " + "activated using the %1 keyboard shortcut." ) + .arg( keys->shortcut( "Window Operations Menu" ).seq( 0 ).toString()) + "\'" ); type = "altf3warning"; } else - return; + assert( false ); KProcess proc; - proc << "kwin_dialog_helper" << "--message" << message; + proc << "kdialog" << args; if( !type.isEmpty()) { - KConfig cfg( "kwin_dialog_helperrc" ); + KConfig cfg( "kwin_dialogsrc" ); cfg.setGroup( "Notification Messages" ); // this depends on KMessageBox if( !cfg.readBoolEntry( type, true )) // has don't show again checked - return; - proc << "--type" << type; + return; // save launching kdialog + proc << "--dontagain" << "kwin_dialogsrc:" + type; } if( c != NULL ) - proc << "--window" << QString::number( c->window()); - proc << "--" << args; + proc << "--embed" << QString::number( c->window()); proc.start( KProcess::DontCare ); }