Author: coolo
Date: Wed Dec 5 21:48:44 2007
New Revision: 42748
URL: http://svn.opensuse.org/viewcvs/yast?rev=42748&view=rev
Log:
Duncan, for you
Added:
branches/tmp/coolo/qt4-port/src/YQMainWinDock.cc
- copied unchanged from r42747, trunk/qt/src/YQMainWinDock.cc
branches/tmp/coolo/qt4-port/src/YQMainWinDock.h
- copied unchanged from r42747, trunk/qt/src/YQMainWinDock.h
Removed:
branches/tmp/coolo/qt4-port/src/YQEBunny.cc
branches/tmp/coolo/qt4-port/src/YQEBunny.h
Modified:
branches/tmp/coolo/qt4-port/ (props changed)
branches/tmp/coolo/qt4-port/VERSION.cmake
branches/tmp/coolo/qt4-port/src/CMakeLists.txt
branches/tmp/coolo/qt4-port/src/YQDialog.cc
branches/tmp/coolo/qt4-port/src/YQDialog.h
branches/tmp/coolo/qt4-port/src/YQUI.h
branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc
branches/tmp/coolo/qt4-port/src/YQUI_core.cc
branches/tmp/coolo/qt4-port/src/YQUI_x11.cc
branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.h
branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorHelp.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h
Modified: branches/tmp/coolo/qt4-port/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/VERSION.cmake?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/VERSION.cmake (original)
+++ branches/tmp/coolo/qt4-port/VERSION.cmake Wed Dec 5 21:48:44 2007
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "16")
-SET(VERSION_PATCH "6")
+SET(VERSION_PATCH "7")
Modified: branches/tmp/coolo/qt4-port/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/CMakeLists.txt?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/CMakeLists.txt (original)
+++ branches/tmp/coolo/qt4-port/src/CMakeLists.txt Wed Dec 5 21:48:44 2007
@@ -15,7 +15,7 @@
QY2ListView.cc QY2Settings.cc Y2CCQt.cc
YFrameBuffer.cc YQAlignment.cc YQApplication.cc YQBarGraph.cc
YQCheckBox.cc YQCheckBoxFrame.cc YQComboBox.cc YQDateField.cc
- YQDialog.cc YQDownloadProgress.cc YQDumbTab.cc YQEBunny.cc
+ YQDialog.cc YQDownloadProgress.cc YQDumbTab.cc YQMainWinDock.cc
YQEmpty.cc YQFrame.cc YQGenericButton.cc YQIconPool.cc
YQImage.cc YQInputField.cc YQIntField.cc YQLabel.cc YQLayoutBox.cc
YQLogView.cc YQMenuButton.cc YQMultiLineEdit.cc
Modified: branches/tmp/coolo/qt4-port/src/YQDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDialog.cc?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDialog.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQDialog.cc Wed Dec 5 21:48:44 2007
@@ -22,7 +22,6 @@
#define y2log_component "qt-ui"
#include
#include
-#include
#include
#include <QDesktopWidget>
@@ -33,6 +32,7 @@
#include "YQGenericButton.h"
#include "YQWizardButton.h"
#include "YQWizard.h"
+#include "YQMainWinDock.h"
// Include low-level X headers AFTER Qt headers:
// X.h pollutes the global namespace (!!!) with pretty useless #defines
@@ -43,10 +43,19 @@
#define YQPopupDialogWFlags Qt::Widget
-YQDialog::YQDialog( QWidget * qParent,
- YDialogType dialogType,
+/* FIXME
+#define YQPopupDialogWFlags \
+ ( Qt::WStyle_Customize | \
+ Qt::WStyle_Dialog | \
+ Qt::WShowModal | \
+ Qt::WType_Modal | \
+ Qt::WStyle_DialogBorder )
+*/
+
+
+YQDialog::YQDialog( YDialogType dialogType,
YDialogColorMode colorMode )
- : QWidget( qParent,
+ : QWidget( chooseParent( dialogType ),
dialogType == YMainDialog ? YQMainDialogWFlags : YQPopupDialogWFlags )
, YDialog( dialogType, colorMode )
{
@@ -55,7 +64,7 @@
_defaultButton = 0;
setWidgetRep( this );
- setWindowTitle( dialogType == YMainDialog ? "YaST2" : "" );
+ setWindowTitle( "YaST2" );
setFocusPolicy( Qt::StrongFocus );
if ( colorMode != YDialogNormalColor )
@@ -76,15 +85,42 @@
warnPalette.setCurrentColorGroup(QPalette::Active);
setPalette( warnPalette );
}
+
+ if ( dialogType == YMainDialog &&
+ QWidget::parent() != YQMainWinDock::mainWinDock() )
+ {
+ setWindowFlags( YQPopupDialogWFlags );
+ }
}
YQDialog::~YQDialog()
{
+ if ( dialogType() == YMainDialog )
+ {
+ YQMainWinDock::mainWinDock()->remove( (QWidget *) widgetRep() );
+ }
}
-int YQDialog::preferredWidth()
+QWidget *
+YQDialog::chooseParent( YDialogType dialogType )
+{
+ QWidget * parent = 0;
+
+ if ( dialogType == YMainDialog &&
+ YQMainWinDock::mainWinDock()->couldDock() )
+ {
+ y2debug( "Adding dialog to mainWinDock" );
+ parent = YQMainWinDock::mainWinDock();
+ }
+
+ return parent;
+}
+
+
+int
+YQDialog::preferredWidth()
{
int preferredWidth;
@@ -112,7 +148,8 @@
}
-int YQDialog::preferredHeight()
+int
+YQDialog::preferredHeight()
{
int preferredHeight;
@@ -140,15 +177,19 @@
}
-void YQDialog::setEnabled( bool enabled )
+void
+YQDialog::setEnabled( bool enabled )
{
QWidget::setEnabled( enabled );
YDialog::setEnabled( enabled );
}
-void YQDialog::setSize( int newWidth, int newHeight )
+void
+YQDialog::setSize( int newWidth, int newHeight )
{
+ // y2debug( "Resizing dialog to %d x %d", newWidth, newHeight );
+
if ( newWidth > qApp->desktop()->width() )
newWidth = qApp->desktop()->width();
@@ -164,19 +205,11 @@
}
-
-void YQDialog::activate( bool active )
+void
+YQDialog::activate( bool active )
{
if ( active )
{
- if ( ! YQUI::ui()->haveWM() )
- {
- if ( YQUI::ui()->autoActivateDialogs() )
- activateWindow();
- else
- y2milestone( "Auto-activating dialog window turned off" );
- }
-
ensureOnlyOneDefaultButton();
}
}
@@ -187,9 +220,12 @@
{
if ( event )
{
+ // y2debug( "Resize event: %d x %d", event->size().width(), event->size().height() );
setSize ( event->size().width(), event->size().height() );
- _userSize = event->size();
- _userResized = true;
+ _userSize = event->size();
+
+ if ( QWidget::parent() )
+ _userResized = true;
}
}
@@ -317,7 +353,7 @@
YDialog::setDefaultButton( _defaultButton );
}
-
+
YQGenericButton * def = _focusButton ? _focusButton : _defaultButton;
if ( def )
@@ -335,7 +371,6 @@
YQWizard *
YQDialog::findWizard( YWidgetListConstIterator begin,
YWidgetListConstIterator end ) const
-
{
for ( YWidgetListConstIterator it = begin; it != end; ++it )
{
@@ -427,7 +462,7 @@
_defaultButton->showAsDefault( true );
}
-
+
YDialog::setDefaultButton( 0 ); // prevent complaints about multiple default buttons
YDialog::setDefaultButton( _defaultButton );
}
@@ -514,11 +549,6 @@
YQUI::ui()->makeScreenShot( "" );
return;
}
- else if ( event->key() == Qt::Key_F5 ) // No matter if Ctrl/Alt/Shift pressed
- {
- YQUI::ui()->easterEgg();
- return;
- }
else if ( event->key() == Qt::Key_F4 && // Shift-F4: toggle colors for vision impaired users
event->modifiers() & Qt::ShiftModifier )
{
@@ -592,23 +622,25 @@
}
-void YQDialog::closeEvent( QCloseEvent * event )
+void
+YQDialog::closeEvent( QCloseEvent * event )
{
// The window manager "close window" button (and WM menu, e.g. Alt-F4) will be
// handled just like the user had clicked on the `id`( `cancel ) button in
// that dialog. It's up to the YCP application to handle this (if desired).
- y2debug( "Ignoring window manager close button." );
+ y2milestone( "Caught window manager close event - returning with YCancelEvent" );
event->ignore();
YQUI::ui()->sendEvent( new YCancelEvent() );
}
-void YQDialog::focusInEvent( QFocusEvent * event )
+void
+YQDialog::focusInEvent( QFocusEvent * event )
{
// The dialog itself doesn't need or want the keyboard focus, but obviously
- // ( since Qt 2.3? ) it needs QFocusPolicy::StrongFocus for the default
+ // (since Qt 2.3?) it needs QFocusPolicy::StrongFocus for the default
// button mechanism to work. So let's accept the focus and give it to some
// child widget.
@@ -627,39 +659,11 @@
void
-YQDialog::show()
-{
-#if FIXME
- if ( ! dialogType() == YMainDialog && qApp->mainWidget()->isVisible() )
- center( this, qApp->mainWidget() );
-#endif
-
- QWidget::show();
-}
-
-
-void
YQDialog::center( QWidget * dialog, QWidget * parent )
{
- if ( ! dialog )
+ if ( ! dialog || ! parent )
return;
- if ( ! parent )
- {
- //FIXME if not toplevel window
- // align with top level widget
- foreach (QWidget *widget, QApplication::topLevelWidgets())
- {
- // if it is a top level widget, center with desktop
- if (dialog == widget) parent = qApp->desktop(); break;
- }
-
- if ( QApplication::topLevelWidgets().empty() )
- return;
-
- parent = QApplication::topLevelWidgets().first();
- }
-
QPoint pos( ( parent->width() - dialog->width() ) / 2,
( parent->height() - dialog->height() ) / 2 );
Modified: branches/tmp/coolo/qt4-port/src/YQDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDialog.h?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDialog.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQDialog.h Wed Dec 5 21:48:44 2007
@@ -43,8 +43,7 @@
* colors or YDialogInfoColor to use more prominent, yet not quite as
* bright as "warning" colors. Use both only very rarely.
**/
- YQDialog( QWidget * qParent,
- YDialogType dialogType,
+ YQDialog( YDialogType dialogType,
YDialogColorMode colorMode = YDialogNormalColor );
protected:
@@ -101,7 +100,7 @@
YQGenericButton * findDefaultButton();
/**
- * Returns whether or not the user has resized this dialog.
+ * Return 'true' if the user resized this dialog.
**/
bool userResized() { return _userResized; }
@@ -176,6 +175,13 @@
protected:
/**
+ * Choose a parent widget for a dialog of the specified type:
+ * Either the main window dock (if this is a YMainDialog and the dock
+ * currently accepts child dialogs) or 0.
+ **/
+ static QWidget * chooseParent( YDialogType dialogType );
+
+ /**
* Return the (first) default button between 'begin' and 'end'
* or 0 if there is none.
**/
@@ -199,44 +205,24 @@
YWidgetListConstIterator end );
/**
- * Event handler for keyboard input.
- * Only very special keys are processed here.
- *
- * Inherited from QWidget.
- **/
- void keyPressEvent( QKeyEvent * e );
-
-
- /**
- * Event handler for focusIn event.
+ * Qt event handlers.
*
- * Inherited from QWidget.
- **/
- void focusInEvent( QFocusEvent * event );
-
- /**
- * Event handler for window resize.
- *
- * Inherited from QWidget.
- **/
- void resizeEvent ( QResizeEvent * ev );
-
-
- /**
- * Inherited from QWidget: Called when the dialog is shown.
+ * All reimplemented from QWidget.
**/
- void show();
+ virtual void keyPressEvent ( QKeyEvent * event );
+ virtual void focusInEvent ( QFocusEvent * event );
+ virtual void resizeEvent ( QResizeEvent * event );
//
// Data members
//
- bool _userResized;
- QSize _userSize;
+ bool _userResized;
+ QSize _userSize;
- YQGenericButton * _focusButton;
- YQGenericButton * _defaultButton;
+ YQGenericButton * _focusButton;
+ YQGenericButton * _defaultButton;
};
Modified: branches/tmp/coolo/qt4-port/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI.h?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI.h Wed Dec 5 21:48:44 2007
@@ -133,23 +133,15 @@
YEvent * pendingEvent() const { return _event_handler.pendingEvent(); }
/**
- * Returns 'false" if the "--no-wm" was specified on the command line, i.e.
- * we should assume no window manager is running.
- **/
- bool haveWM() const { return _have_wm; }
-
- /**
- * Returns 'true' if defaultsize windows should use the full screen.
+ * Return 'true' if defaultsize windows should use the full screen.
**/
bool fullscreen() const { return _fullscreen; }
/**
- * Returns 'false' if toplevel (defaultsize) windows should not get window
- * manager decorations, i.e. "--noborder" was specified on the command
- * line.
+ * Return 'true' if defaultsize windows should not get window manager
+ * borders / frames.
**/
- bool decorateToplevelWindow() const { return _decorate_toplevel_window; }
-
+ bool noBorder() const { return _noborder; }
/**
* Returns 'true' if the UI had a fatal error that requires the application
* to abort.
@@ -203,28 +195,6 @@
**/
void internalError( const char * msg );
-
- /**
- * Block WM_CLOSE events for the main window.
- **/
- void blockWmClose() { _wm_close_blocked = true; }
-
- /**
- * Unblock WM_CLOSE events for the main window.
- **/
- void unblockWmClose() { _wm_close_blocked = false; }
-
- /**
- * Check if dialogs are to be activated automatically
- **/
- bool autoActivateDialogs() const { return _auto_activate_dialogs; }
-
- /**
- * Change automatic dialog activation
- **/
- void setAutoActivateDialogs( bool activate )
- { _auto_activate_dialogs = activate; }
-
/**
* Block (or unblock) events. If events are blocked, any event sent
* should be ignored until events are unblocked again.
@@ -284,11 +254,6 @@
void askConfigureLogging();
/**
- * Fun stuff (release dependent)
- **/
- void easterEgg();
-
- /**
* A mouse click with the wrong mouse button was detected - e.g., a right
* click on a push button. The user might be left-handed, but his mouse
* might not (yet) be configured for left-handed use - e.g., during
@@ -300,13 +265,6 @@
void maybeLeftHandedUser();
-signals:
- /**
- * Emitted upon WM_CLOSE
- **/
- void wmClose();
-
-
protected:
/**
@@ -353,21 +311,6 @@
**/
void closeDialog( YDialog * dialog );
- /**
- * Grab show events and work around QWidgetStack bug.
- *
- * Reimplemented from QObject.
- **/
- bool eventFilter( QObject * obj, QEvent * ev );
-
- /**
- * Make all UI windows usable without a mouse - even predefined Qt dialogs
- * that don't know the UI's dialogs' activate() magic.
- *
- * Reimplemented from QObject.
- **/
- bool showEventFilter( QObject * obj, QEvent * ev );
-
public:
@@ -433,11 +376,6 @@
const QString & headline );
/**
- * main widget
- **/
- QWidget* mainWidget();
-
- /**
* Initialize and set a textdomain for gettext()
**/
static void setTextdomain( const char * domain );
@@ -545,19 +483,14 @@
//
/**
- * Assume presence of a window manager
- **/
- bool _have_wm;
-
- /**
* Use the entire available screen
**/
bool _fullscreen;
/**
- * Decorate the toplevel window
+ * No window border for the main window
**/
- bool _decorate_toplevel_window;
+ bool _noborder;
/**
* Container for the widget stack. QWidgetStack cannot handle a WFlags
@@ -567,16 +500,6 @@
QWidget * _main_win;
/**
- * Stack for the Qt widgets inside the main window.
- **/
- QStackedWidget * _widget_stack;
-
- /**
- * Stack to keep track of the stacking order of popup dialogs.
- **/
- vector _popup_stack;
-
- /**
* Size for `opt(`defaultsize) dialogs.
**/
QSize _default_size;
@@ -594,18 +517,7 @@
**/
QEventLoop * _eventLoop;
- /**
- * Window manager close events blocked?
- **/
- bool _wm_close_blocked;
-
- /**
- * Force new dialogs to the foreground and grab the keyboard focus?
- * (Only if running without a window manager)
- **/
- bool _auto_activate_dialogs;
-
- /**
+ /*
* Global reference to the UI
**/
static YQUI * _ui;
Modified: branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc Wed Dec 5 21:48:44 2007
@@ -78,9 +78,6 @@
YCPValue YQUI::runPkgSelection( YWidget * packageSelector )
{
y2milestone( "Running package selection..." );
- _wm_close_blocked = true;
- _auto_activate_dialogs = false;
-
YCPValue input = YCPVoid();
try
@@ -98,8 +95,6 @@
y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
}
- _auto_activate_dialogs = true;
- _wm_close_blocked = false;
y2milestone( "Package selection done - returning %s", input->toString().c_str() );
return input;
Modified: branches/tmp/coolo/qt4-port/src/YQUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI_core.cc?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI_core.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI_core.cc Wed Dec 5 21:48:44 2007
@@ -41,7 +41,6 @@
#include "YQOptionalWidgetFactory.h"
#include "YEvent.h"
#include "YUISymbols.h"
-#include "YQEBunny.h"
#include "utf8.h"
#include "YQDialog.h"
@@ -57,17 +56,14 @@
: QObject()
, YUI( with_threads )
, _main_win( NULL )
+ , _do_exit_loop( false )
, _eventLoop( 0 )
- , _wm_close_blocked( false )
- , _auto_activate_dialogs( true )
{
y2milestone( "YQUI constructor start" );
_ui = this;
_fatal_error = false;
- _have_wm = true;
_fullscreen = false;
- _decorate_toplevel_window = true;
_usingVisionImpairedPalette = false;
_leftHandedMouse = false;
_askedForLeftHandedMouse = false;
@@ -115,7 +111,6 @@
// Qt keeps track to a global QApplication in qApp.
Q_CHECK_PTR( qApp );
- qApp->installEventFilter( this );
processCommandLineArgs( _ui_argc, _ui_argv );
calcDefaultSize();
@@ -132,34 +127,14 @@
// We have to use something else than QWidgetStack since QWidgetStack
// doesn't accept a WFlags arg which we badly need here.
- Qt::WFlags wflags = Qt::Window;
-
- if ( ! _decorate_toplevel_window )
- {
- y2debug( "Suppressing WM decorations for toplevel window" );
- wflags |= Qt::FramelessWindowHint;
- }
-
- _main_win = new QWidget( 0, wflags ); // parent, wflags
+ _main_win = new QWidget( 0, Qt::Window ); // parent, wflags
_main_win->setFocusPolicy( Qt::StrongFocus );
_main_win->setObjectName( "main_window" );
_styler->registerWidget( _main_win );
- // Create widget stack for `opt(`defaultsize) dialogs
- QVBoxLayout *vbox = new QVBoxLayout( _main_win );
- vbox->setSpacing( 0 );
- vbox->setMargin( 0 );
-
- _widget_stack = new QStackedWidget( _main_win );
- _widget_stack->setFocusPolicy( Qt::StrongFocus );
- vbox->addWidget( _widget_stack );
-#if 0
- _main_win->installEventFilter( this );
-#endif
-
_main_win->resize( _default_size );
- if ( _fullscreen || ! _have_wm )
+ if ( _fullscreen )
_main_win->move( 0, 0 );
@@ -258,9 +233,8 @@
if ( opt.startsWith( "--" ) )
opt.remove(0, 1);
- if ( opt == QString( "-no-wm" ) ) _have_wm = false;
- else if ( opt == QString( "-fullscreen" ) ) _fullscreen = true;
- else if ( opt == QString( "-noborder" ) ) _decorate_toplevel_window = false;
+ if ( opt == QString( "-fullscreen" ) ) _fullscreen = true;
+ else if ( opt == QString( "-noborder" ) ) _noborder = true;
else if ( opt == QString( "-auto-font" ) ) yqApp()->setAutoFonts( true );
else if ( opt == QString( "-auto-fonts" ) ) yqApp()->setAutoFonts( true );
// --macro is handled by YUI_component
@@ -270,7 +244,6 @@
"Command line options for the YaST2 Qt UI:\n"
"\n"
"--nothreads run without additional UI threads\n"
- "--no-wm assume no window manager is running\n"
"--fullscreen use full screen for `opt(`defaultsize) dialogs\n"
"--noborder no window manager border for `opt(`defaultsize) dialogs\n"
"--auto-fonts automatically pick fonts, disregard Qt standard settings\n"
@@ -348,7 +321,7 @@
y2milestone( "-fullscreen: using %dx%d for `opt(`defaultsize)",
_default_size.width(), _default_size.height() );
}
- else if ( _have_wm )
+ else
{
// Get _default_size via -geometry command line option (if set)
@@ -358,7 +331,6 @@
// qApp->setMainWidget( dummy );
// _default_size = dummy->size();
-
// Set min defaultsize or figure one out if -geometry was not used
if ( _default_size.width() < 800 ||
@@ -382,11 +354,6 @@
_default_size.width(), _default_size.height() );
}
}
- else // ! _have_wm
- {
- _default_size = primaryScreenSize;
- }
-
y2milestone( "Default size: %dx%d", _default_size.width(), _default_size.height() );
}
@@ -465,8 +432,6 @@
if ( timeout_millisec > 0 )
_user_input_timer.start( timeout_millisec ); // single shot
- dialog->activate( true );
-
if ( qApp->focusWidget() )
qApp->focusWidget()->setFocus();
@@ -476,7 +441,6 @@
_do_exit_loop = false;
event = _event_handler.consumePendingEvent();
- dialog->activate( false );
// Display a busy cursor, but only if there is no other activity within
// BUSY_CURSOR_TIMEOUT milliseconds (avoid cursor flicker)
@@ -504,10 +468,8 @@
if ( dialog )
{
- dialog->activate( true );
//qApp->processEvents();
event = _event_handler.consumePendingEvent();
- dialog->activate( false );
}
}
@@ -525,62 +487,16 @@
}
-#warning obsolete
-#if 0
-YDialog * YQUI::createDialog( YWidgetOpt & opt )
-{
- init_ui();
-
- y2milestone( "createDialog %ld", QThread::currentThreadId () );
- bool has_defaultsize = opt.hasDefaultSize.value();
- QWidget * qt_parent =
- has_defaultsize ? _widget_stack : _main_win;
-
- // FIXME: Probably obsolete
- if ( ! has_defaultsize && ! _popup_stack.empty() )
- qt_parent = _popup_stack.back();
-
- YQDialog * dialog = new YQDialog( opt, qt_parent, has_defaultsize );
- Q_CHECK_PTR( dialog );
-
- if ( ! has_defaultsize )
- _popup_stack.push_back( (QWidget *) dialog->widgetRep() );
-
- return dialog;
-}
-#endif
-
-
+#warning FIXME Move this to Y(Q)Dialog (and rename it to ::finalize()?)
void YQUI::showDialog( YDialog * dialog )
{
QWidget * qw = (QWidget *) dialog->widgetRep();
-
- if ( ! qw )
- {
- y2error( "No widgetRep() for dialog" );
- return;
- }
-
- if ( dialog->dialogType() == YMainDialog )
- {
- _widget_stack->addWidget ( qw );
- _widget_stack->setCurrentWidget( qw );
-
- if ( ! _main_win->isVisible() )
- {
- // y2milestone( "Showing main window" );
- _main_win->resize( _default_size );
-
- if ( ! _have_wm )
- _main_win->move( 0, 0 );
-
- _main_win->show();
- qw->setFocus();
- }
- }
- else // non-defaultsize dialog
+
+ if ( qw )
{
qw->show();
+ qw->raise();
+ qw->update();
}
( (YQDialog *) dialog)->ensureOnlyOneDefaultButton();
@@ -591,49 +507,6 @@
void YQUI::closeDialog( YDialog * dialog )
{
- QWidget * qw = (QWidget *) dialog->widgetRep();
-
- if ( ! qw )
- {
- y2error( "No widgetRep() for dialog" );
- return;
- }
-
- if ( dialog->dialogType() == YMainDialog )
- {
- _widget_stack->removeWidget( qw );
- }
- else // non-defaultsize dialog
- {
- qw->hide();
-
-#warning FIXME
-#if 0
- // Clean up the popup stack. libyui guarantees that a dialog will be
- // deleted after closeDialog() so it is safe to pop that dialog from
- // the popup stack here.
-
- if ( ! _popup_stack.empty() && _popup_stack.back() == qw )
- _popup_stack.pop_back();
- else
- y2error( "Popup dialog stack corrupted!" );
-#endif
- }
-}
-
-
-void YQUI::easterEgg()
-{
- y2milestone( "Starting easter egg..." );
-
-
- YQEasterBunny::layEgg();
- y2milestone( "Done." );
-
-#if 0
- // desktop()->repaint() has no effect - we need to do it the hard way.
- system( "/usr/X11R6/bin/xrefresh" );
-#endif
}
Modified: branches/tmp/coolo/qt4-port/src/YQUI_x11.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI_x11.cc?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI_x11.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI_x11.cc Wed Dec 5 21:48:44 2007
@@ -82,19 +82,10 @@
int YQUI::defaultSize(YUIDimension dim) const
{
- if ( haveWM() )
- return dim == YD_HORIZ ? _default_size.width() : _default_size.height();
- else
- return dim == YD_HORIZ ? qApp->desktop()->width() : qApp->desktop()->height();
+ return dim == YD_HORIZ ? _default_size.width() : _default_size.height();
}
-QWidget* YQUI::mainWidget()
-{
- return _main_win;
-};
-
-
void YQUI::beep()
{
qApp->beep();
@@ -178,82 +169,6 @@
}
-bool YQUI::eventFilter( QObject * obj, QEvent * ev )
-{
- if ( ev->type() == QEvent::Close )
- {
- // Handle WM_CLOSE - but only if it comes from a dialog that is managed by the UI,
- // not from an independent Qt dialog (such as the package selector popups)
-
- QWidget * objDialog = 0;
-
- if ( obj && obj->isWidgetType() )
- {
- objDialog = (QWidget *) obj;
- objDialog = objDialog->topLevelWidget();
- }
-
- if ( objDialog &&
- ( objDialog == mainWidget() ||
- objDialog == (QObject *) YDialog::currentDialog()->widgetRep() ) )
- {
- emit wmClose();
-
- if ( ! _wm_close_blocked )
- {
- // Don't simply close the application window, return from UserInput()
- // with `id(`cancel) and let the YCP application decide how to handle
- // that (e.g., ask for confirmation).
-
- y2debug( "Caught window close event - returning with `cancel" );
- sendEvent( new YCancelEvent() );
- }
-
- return true; // Event processed
- }
- }
- else if ( ev->type() == QEvent::Show )
- {
- if ( obj == _main_win )
- {
-#ifdef FIXME_PROBABLY_OBSOLETE
- if ( _widget_stack->count() > 0 )
- {
- // Work around QWidgetStack bug: The last raiseWidget() call
- // (from closeDialog() ) might have failed if the widget was
- // invisible at that time, e.g., because the user had switched to
- // some other virtual desktop (bugzilla bug #11310)
-
- _widget_stack->setCurrentWidget( whatever );
- }
-#endif
- }
- else
- {
- return showEventFilter( obj, ev );
- }
- }
- return QObject::eventFilter( obj, ev );
-}
-
-
-bool YQUI::showEventFilter( QObject * obj, QEvent * ev )
-{
- if ( ! haveWM() )
- {
- // Make sure newly opened windows get the keyboard focus even without a
- // window manager. Otherwise the app might be unusable without a mouse.
-
- QWidget * widget = dynamic_cast (obj);
-
- if ( widget )
- widget->activateWindow();
- }
-
- return false; // Don't stop event processing
-}
-
-
/**
* UI-specific conversion from logical layout spacing units (80x25)
* to device dependent units (640x480).
Modified: branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc Wed Dec 5 21:48:44 2007
@@ -17,10 +17,14 @@
/-*/
#include <QColorGroup>
+#define y2log_component "qt-ui"
+#include
+
#include "YQWidgetFactory.h"
#include "YQUI.h"
#include "YUIException.h"
#include "YQPackageSelectorPlugin.h"
+#include "YQMainWinDock.h"
#include <string>
@@ -47,8 +51,7 @@
YQDialog *
YQWidgetFactory::createDialog( YDialogType dialogType, YDialogColorMode colorMode )
{
- QWidget * qParent = 0;
- YQDialog * dialog = new YQDialog( qParent, dialogType, colorMode );
+ YQDialog * dialog = new YQDialog( dialogType, colorMode );
YUI_CHECK_NEW( dialog );
return dialog;
@@ -279,8 +282,6 @@
YQPackageSelector *
YQWidgetFactory::createPackageSelector( YWidget * parent, long modeFlags )
{
- YQUI::ui()->setAutoActivateDialogs( false );
-
YQPackageSelectorPlugin * plugin = YQUI::ui()->packageSelectorPlugin();
if ( plugin )
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc Wed Dec 5 21:48:44 2007
@@ -66,7 +66,6 @@
YQUI::setTextdomain( "packages-qt" );
setFont( YQUI::yqApp()->currentFont() );
- YQUI::ui()->blockWmClose(); // Automatically undone after UI::RunPkgSelection()
_pkgConflictDialog = new YQPkgConflictDialog( this );
Q_CHECK_PTR( _pkgConflictDialog );
@@ -87,12 +86,8 @@
zyppPool().saveState();
- //
- // Handle WM_CLOSE like "Cancel"
- //
-
- connect( YQUI::ui(), SIGNAL( wmClose() ),
- this, SLOT ( reject() ) );
+ // Install event handler to handle WM_CLOSE like "Cancel"
+ topLevelWidget()->installEventFilter( this );
y2milestone( "PackageSelectorBase init done" );
}
@@ -390,17 +385,26 @@
return;
}
}
- else if ( event->key() == Qt::Key_F5 ) // No matter if Ctrl/Alt/Shift pressed
- {
- YQUI::ui()->easterEgg();
- return;
- }
}
QWidget::keyPressEvent( event );
}
+bool YQPackageSelectorBase::eventFilter( QObject * obj, QEvent * event )
+{
+ if ( event->type() == QEvent::Close )
+ {
+ // Handle WM_CLOSE like "Cancel"
+ reject();
+
+ return true; // Stop processing this event
+ }
+
+ return false; // Don't stop processing this event
+}
+
+
int YQPackageSelectorBase::preferredWidth()
{
return max( 640, sizeHint().width() );
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.h?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.h (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.h Wed Dec 5 21:48:44 2007
@@ -91,7 +91,14 @@
**/
virtual bool setKeyboardFocus();
+ /**
+ * Event filter to handle WM_CLOSE like "Cancel"
+ *
+ * Reimplemented from QObject.
+ **/
+ virtual bool eventFilter( QObject * obj, QEvent * event );
+
public slots:
/**
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorHelp.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorHelp.cc?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorHelp.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorHelp.cc Wed Dec 5 21:48:44 2007
@@ -139,38 +139,38 @@
html += "<table border=1>";
html += symHelp( "noinst.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Do not install" ),
// Translators: Automatic word-wrapping.
_( "This package is not installed and it will not be installed." ) );
html += symHelp( "install.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Install" ),
// Translators: Automatic word-wrapping.
_( "This package will be installed. It is not installed yet." ) );
html += symHelp( "keepinstalled.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Keep" ),
// Translators: Automatic word-wrapping.
_( "This package is already installed. Leave it untouched." ) );
html += symHelp( "update.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Update" ),
// Translators: Automatic word-wrapping.
_( "This package is already installed. Update it or reinstall it"
" (if the versions are the same)." ) );
html += symHelp( "del.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Delete" ),
// Translators: Automatic word-wrapping.
_( "This package is already installed. Delete it." ) );
html += symHelp( "taboo.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Taboo" ),
// Translators: Automatic word-wrapping.
_( "This package is not installed and should not be installed under any circumstances, "
@@ -180,7 +180,7 @@
+ _( "Packages set to \"taboo\" are treated as if they did not exist on any installation media." ) );
html += symHelp( "protected.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Protected" ),
// Translators: Automatic word-wrapping.
_( "This package is installed and should not be modified, "
@@ -191,7 +191,7 @@
" that may come with the distribution." ) );
html += symHelp( "autoinstall.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Autoinstall" ),
// Translators: Automatic word-wrapping.
_( "This package will be installed automatically because some other package needs it." )
@@ -199,14 +199,14 @@
+ _( "<b>Hint:</b> You may have to use \"taboo\" to get rid of such a package." ) );
html += symHelp( "autoupdate.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Autoupdate" ),
// Translators: Automatic word-wrapping.
_( "This package is already installed, but some other package"
" needs a newer version, so it will automatically be updated." ) );
html += symHelp( "autodel.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Autodelete" ),
// Translators: Automatic word-wrapping.
_( "This package is already installed, but package dependencies require that it is deleted." )
@@ -218,14 +218,14 @@
QString bySelection = " " + _( "(by selection)" );
html += symHelp( "sel_autoinstall.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Autoinstall" ) + bySelection,
// Translators: Automatic word-wrapping.
_( "This package will be installed automatically because it is contained in a"
" predefined software selection (e.g., \"Multimedia\", \"Development\")." ) );
html += symHelp( "sel_autoupdate.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Autoupdate" ) + bySelection,
// Translators: Automatic word-wrapping.
_( "This package is already installed, but there is a newer version."
@@ -234,7 +234,7 @@
" automatically be updated." ) );
html += symHelp( "sel_autodel.xpm",
- // Translators: Package status short ( ! ) description
+ // Translators: Package status short (!) description
_( "Autodelete" ) + bySelection,
// Translators: Automatic word-wrapping.
_( "This package is already installed, but some predefined software selection"
@@ -276,7 +276,7 @@
html += "<table border=1>";
html += keyHelp( "+",
- // Translators: Keyboard action short ( ! ) description
+ // Translators: Keyboard action short (!) description
_( "Add" ),
// Translators: Automatic word-wrapping.
_( "Get this package. Install it if it is not installed yet."
@@ -285,7 +285,7 @@
+ goto_next );
html += keyHelp( "-",
- // Translators: Keyboard action short ( ! ) description
+ // Translators: Keyboard action short (!) description
_( "Remove" ),
// Translators: Automatic word-wrapping.
_( "Get rid of this package. Mark it as \"do not install\" "
@@ -293,7 +293,7 @@
+ goto_next );
html += keyHelp( ">",
- // Translators: Keyboard action short ( ! ) description
+ // Translators: Keyboard action short (!) description
_( "Update" ),
// Translators: Automatic word-wrapping.
_( "Update this package if it is installed and there is a newer version."
@@ -302,7 +302,7 @@
html += keyHelp( "<",
- // Translators: Keyboard action short ( ! ) description
+ // Translators: Keyboard action short (!) description
_( "Undo Update" ),
// Translators: Automatic word-wrapping.
_( "Undo the effect of \">\" above: Set package to \"keep\""
@@ -310,7 +310,7 @@
+ goto_next );
html += keyHelp( "!",
- // Translators: Keyboard action short ( ! ) description
+ // Translators: Keyboard action short (!) description
_( "Taboo" ),
// Translators: Automatic word-wrapping.
_( "Set this package to \"taboo\" if it is not installed:"
@@ -322,7 +322,7 @@
+ goto_next );
html += keyHelp( "*",
- // Translators: Keyboard action short ( ! ) description
+ // Translators: Keyboard action short (!) description
_( "Protect" ),
// Translators: Automatic word-wrapping.
_( "Set this package to \"protected\" if it is installed:"
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc Wed Dec 5 21:48:44 2007
@@ -148,7 +148,7 @@
_busyPopup = new QLabel( " " + _( "Checking Dependencies..." ) + " ", parent, 0
#ifdef FIXME
- , WType_Dialog
+ , WStyle_Customize | WStyle_DialogBorder | WStyle_Dialog | WStyle_Title
#endif
);
Q_CHECK_PTR( _busyPopup );
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc Wed Dec 5 21:48:44 2007
@@ -352,7 +352,10 @@
while ( it != solutions.end() )
{
- new YQPkgConflictResolution( _resolutionsHeader, *it );
+ YQPkgConflictResolution * solution = new YQPkgConflictResolution( _resolutionsHeader, *it );
+ Q_CHECK_PTR( solution );
+ //FIXME solution->setOpen(true);
+
++it;
}
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h?rev=42748&r1=42747&r2=42748&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h Wed Dec 5 21:48:44 2007
@@ -111,7 +111,7 @@
static void dumpList( QTreeWidgetItem * parent,
const QString & longText,
const QString & header = QString::null,
- int splitThreshold = 5 );
+ int splitThreshold = 3 );
protected:
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org