Hello community, here is the log from the commit of package libyui-qt for openSUSE:Factory checked in at 2015-02-01 12:27:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libyui-qt (Old) and /work/SRC/openSUSE:Factory/.libyui-qt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libyui-qt" Changes: -------- --- /work/SRC/openSUSE:Factory/libyui-qt/libyui-qt.changes 2015-01-21 21:52:16.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libyui-qt.new/libyui-qt.changes 2015-02-01 12:27:57.000000000 +0100 @@ -1,0 +2,12 @@ +Fri Jan 30 13:52:57 UTC 2015 - jsrain@suse.cz + +- added keyboard shortcuts to Help and Release Notes buttons + (bnc#880983) +- 2.46.15 + +------------------------------------------------------------------- +Wed Jan 21 12:04:17 UTC 2015 - jsrain@suse.cz + +- added QT-specific dialog for displaying release notes + +------------------------------------------------------------------- Old: ---- libyui-qt-2.46.14.tar.bz2 New: ---- libyui-qt-2.46.15.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libyui-qt-doc.spec ++++++ --- /var/tmp/diff_new_pack.LDJN2N/_old 2015-02-01 12:27:59.000000000 +0100 +++ /var/tmp/diff_new_pack.LDJN2N/_new 2015-02-01 12:27:59.000000000 +0100 @@ -17,7 +17,7 @@ Name: libyui-qt-doc -Version: 2.46.14 +Version: 2.46.15 Release: 0 Source: libyui-qt-%{version}.tar.bz2 ++++++ libyui-qt.spec ++++++ --- /var/tmp/diff_new_pack.LDJN2N/_old 2015-02-01 12:27:59.000000000 +0100 +++ /var/tmp/diff_new_pack.LDJN2N/_new 2015-02-01 12:27:59.000000000 +0100 @@ -17,7 +17,7 @@ Name: libyui-qt -Version: 2.46.14 +Version: 2.46.15 Release: 0 Source: libyui-qt-%{version}.tar.bz2 ++++++ libyui-qt-2.46.14.tar.bz2 -> libyui-qt-2.46.15.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.14/ChangeLog new/libyui-qt-2.46.15/ChangeLog --- old/libyui-qt-2.46.14/ChangeLog 2015-01-20 17:19:59.000000000 +0100 +++ new/libyui-qt-2.46.15/ChangeLog 2015-01-30 14:34:12.000000000 +0100 @@ -1,4 +1,16 @@ ------------------------------------------------------------------- +Fri Jan 30 13:52:57 UTC 2015 - jsrain@suse.cz + +- added keyboard shortcuts to Help and Release Notes buttons + (bnc#880983) +- 2.46.15 + +------------------------------------------------------------------- +Wed Jan 21 12:04:17 UTC 2015 - jsrain@suse.cz + +- added QT-specific dialog for displaying release notes + +------------------------------------------------------------------- Tue Jan 20 16:15:49 UTC 2015 - mvidner@suse.com - Fixed building with cmake 3.1 (PREFIX in spec, boo#911875). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.14/SOURCECONF.cmake new/libyui-qt-2.46.15/SOURCECONF.cmake --- old/libyui-qt-2.46.14/SOURCECONF.cmake 2014-02-21 15:05:58.000000000 +0100 +++ new/libyui-qt-2.46.15/SOURCECONF.cmake 2015-01-30 14:34:12.000000000 +0100 @@ -8,6 +8,7 @@ QY2ComboTabWidget.cc QY2DiskUsageList.cc QY2HelpDialog.cc + QY2RelNotesDialog.cc QY2ListView.cc QY2Styler.cc YQAlignment.cc @@ -72,6 +73,7 @@ QY2ComboTabWidget.h QY2DiskUsageList.h QY2HelpDialog.h + QY2RelNotesDialog.h QY2ListView.h QY2Styler.h YQi18n.h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.14/VERSION.cmake new/libyui-qt-2.46.15/VERSION.cmake --- old/libyui-qt-2.46.14/VERSION.cmake 2015-01-20 17:19:59.000000000 +0100 +++ new/libyui-qt-2.46.15/VERSION.cmake 2015-01-30 14:34:12.000000000 +0100 @@ -1,6 +1,6 @@ SET(VERSION_MAJOR "2") SET(VERSION_MINOR "46") -SET(VERSION_PATCH "14") +SET(VERSION_PATCH "15") SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" ) ##### This is need for the libyui core, ONLY. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.14/src/QY2RelNotesDialog.cc new/libyui-qt-2.46.15/src/QY2RelNotesDialog.cc --- old/libyui-qt-2.46.14/src/QY2RelNotesDialog.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libyui-qt-2.46.15/src/QY2RelNotesDialog.cc 2015-01-30 14:34:12.000000000 +0100 @@ -0,0 +1,137 @@ +/* + Copyright (C) 2000-2012 Novell, Inc + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) version 3.0 of the License. This library + is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. You should have received a copy of the GNU + Lesser General Public License along with this library; if not, write + to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + Floor, Boston, MA 02110-1301 USA +*/ + + +/*-/ + + File: QY2RelNotesDialog.cc + + Author: Jiri Srain <jsrain@suse.de> + + Textdomain "qt" + +/-*/ + +#include "QY2RelNotesDialog.h" +#include <QDebug> +#include <QTextObject> +#include "YQi18n.h" +#include "YQUI.h" +#include "QY2Styler.h" +#define YUILogComponent "qt-ui" +#include <yui/YUILog.h> + + +#ifdef TEXTDOMAIN +# undef TEXTDOMAIN +#endif + +#define TEXTDOMAIN "qt" + + +QY2RelNotesDialog::QY2RelNotesDialog( QWidget *parent ) + : QDialog( parent ) +{ + if (this->objectName().isEmpty()) + this->setObjectName(QStringLiteral("QRelNotesDialog")); + this->resize(581, 388); // same size as help pop-up, proven over time + vboxLayout = new QVBoxLayout(this); + vboxLayout->setObjectName(QStringLiteral("vboxLayout")); + + tabBar = new QTabBar( this ); + Q_CHECK_PTR( tabBar ); + + tabBar->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); // hor/vert + setFocusProxy( tabBar ); + setFocusPolicy( Qt::TabFocus ); + + QObject::connect( tabBar, SIGNAL(currentChanged(int)), this, SLOT(tabChanged( int ))); + + vboxLayout->addWidget(tabBar); + + textBrowser = new QTextBrowser(this); + textBrowser->setObjectName(QStringLiteral("textBrowser")); + + vboxLayout->addWidget(textBrowser); + + hboxLayout = new QHBoxLayout(); + closeButton = new QPushButton(this); + closeButton->setObjectName(QStringLiteral("closeButton")); + hboxLayout->addStretch(); + hboxLayout->addWidget(closeButton); + hboxLayout->addStretch(); + + vboxLayout->addLayout(hboxLayout); + + QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(accept())); + + YQUI::setTextdomain( TEXTDOMAIN ); + + // Window title for help wizard window + setWindowTitle( _( "Release Notes" ) ); + + // Close button for wizard help window + closeButton->setText( _( "&Close" ) ); + + QY2Styler::styler()->registerWidget( this ); +} + +void QY2RelNotesDialog::setRelNotes( const std::map<std::string,std::string>& relnotes ) +{ + while (tabBar->count() > 0) + { + tabBar->removeTab( 0 ); + } + + _relnotes = relnotes; + _tab_keys = std::vector<std::string>(); + for(std::map<std::string,std::string>::const_iterator it = relnotes.begin(); it != relnotes.end(); ++it) { + _tab_keys.push_back(it->first); + tabBar->addTab( it->first.c_str() ); + } + if (_relnotes.size() > 1) + { + tabBar->show(); + } + else + { + tabBar->hide(); + } + textBrowser->setText( relnotes.begin()->second.c_str() ); +} + +QY2RelNotesDialog::~QY2RelNotesDialog() +{ + QY2Styler::styler()->unregisterWidget( this ); +} + +void QY2RelNotesDialog::tabChanged( int index ) +{ + if (index < 0 || _tab_keys.empty() || _relnotes.empty()) + { + return; + } + textBrowser->setText( _relnotes[_tab_keys[index]].c_str() ); +} + +void QY2RelNotesDialog::retranslate() +{ + setWindowTitle( _( "Release Notes" ) ); + closeButton->setText( _( "&Close" ) ); +} + + + +#include "QY2RelNotesDialog.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.14/src/QY2RelNotesDialog.h new/libyui-qt-2.46.15/src/QY2RelNotesDialog.h --- old/libyui-qt-2.46.14/src/QY2RelNotesDialog.h 1970-01-01 01:00:00.000000000 +0100 +++ new/libyui-qt-2.46.15/src/QY2RelNotesDialog.h 2015-01-30 14:34:12.000000000 +0100 @@ -0,0 +1,68 @@ +/* + Copyright (C) 2000-2012 Novell, Inc + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) version 3.0 of the License. This library + is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. You should have received a copy of the GNU + Lesser General Public License along with this library; if not, write + to the Free Software Foundation, Inc., 51 Franklin Street, Fifth + Floor, Boston, MA 02110-1301 USA +*/ + + +/*-/ + + File: QY2RelNotesDialog.h + + Author: Jiri Srain <jsrain@suse.de> + + Textdomain "qt" + +/-*/ + +#ifndef _QY2RelNotesDialog_h +#define _QY2RelNotesDialog_h + +#include <QDialog> +#include <QtWidgets/QTextBrowser> +#include <QtWidgets/QPushButton> +#include <QtWidgets/QHBoxLayout> +#include <QtWidgets/QVBoxLayout> +#include <QtWidgets/QTabBar> + +class QTextCursor; + +class QY2RelNotesDialog : public QDialog +{ + Q_OBJECT + +public: + QY2RelNotesDialog( QWidget *parent ); + ~QY2RelNotesDialog(); + void setRelNotes( const std::map<std::string,std::string>& relnotes ); + void retranslate(); + +public slots: + void tabChanged( int index ); + +protected: + QVBoxLayout *vboxLayout; + QTabBar *tabBar; + QTextBrowser *textBrowser; + QHBoxLayout *hboxLayout; + QPushButton *closeButton; + + +private: + QList<QTextCursor> _marks; + std::map<std::string,std::string> _relnotes; + std::vector<std::string> _tab_keys; + +}; + +#endif + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.14/src/YQWizard.cc new/libyui-qt-2.46.15/src/YQWizard.cc --- old/libyui-qt-2.46.14/src/YQWizard.cc 2014-05-12 14:30:44.000000000 +0200 +++ new/libyui-qt-2.46.15/src/YQWizard.cc 2015-01-30 14:34:12.000000000 +0100 @@ -50,6 +50,7 @@ #include "QY2ListView.h" #include "QY2Styler.h" #include "QY2HelpDialog.h" +#include "QY2RelNotesDialog.h" #include <QGridLayout> #include <QHeaderView> #include <qevent.h> @@ -100,6 +101,7 @@ , _abortButtonLabel( abortButtonLabel ) , _nextButtonLabel( nextButtonLabel ) , _helpDlg ( NULL ) + , _relNotesDlg ( NULL ) { setObjectName( "wizard" ); setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); @@ -191,6 +193,7 @@ } delete _helpDlg; + delete _relNotesDlg; QY2Styler::styler()->unregisterWidget( this ); topLevelWidget()->setWindowIcon( _previousWindowIcon ); @@ -849,8 +852,9 @@ hbox->setSpacing( 0 ); hbox->setMargin( 0 ); - // Help button - intentionally without keyboard shortcut - _helpButton = new QPushButton( _( "Help" ), parent ); + // Help button + // QT handles duplicate shortcuts, it can be kept (bnc#880983) + _helpButton = new QPushButton( _( "&Help" ), parent ); YUI_CHECK_NEW( _helpButton ); _helpButton->setShortcut( Qt::Key_F1 ); @@ -865,8 +869,9 @@ // "Release Notes" button // - // Help button - intentionally without keyboard shortcut - _releaseNotesButton = new QPushButton( _( "Release Notes" ), parent ); + // Release Notes button + // QT handles duplicate shortcuts, it can be kept (bnc#880983) + _releaseNotesButton = new QPushButton( _( "&Release Notes" ), parent ); YUI_CHECK_NEW( _releaseNotesButton ); hbox->addWidget( _releaseNotesButton ); connect( _releaseNotesButton, &pclass(_releaseNotesButton)::clicked, @@ -1084,8 +1089,22 @@ void YQWizard::showReleaseNotes() { - // TODO: QT-specific implementation if necessary from UX POV - YDialog::showRelNotesText(); + if (!_relNotesDlg) + _relNotesDlg = new QY2RelNotesDialog ( NULL ); + else + { + _relNotesDlg->hide(); // workaround for icewm (see: bnc #397083) + } + + std::map<std::string,std::string> relnotes = YUI::application()->releaseNotes(); + if ( relnotes.size() == 0) + { + return; + } + _relNotesDlg->setRelNotes( relnotes ); + _relNotesDlg->show(); + _relNotesDlg->raise(); + _relNotesDlg->activateWindow(); } @@ -1291,8 +1310,8 @@ return; } - // no way to check the shortcut, so strip it - _releaseNotesButton->setText( fromUTF8( YShortcut::cleanShortcutString( label ) ) ); + // QT handles duplicate shortcuts, it can be kept + _releaseNotesButton->setText( fromUTF8( label ) ); _releaseNotesButtonId = id; _releaseNotesButtonLabel = label; @@ -1316,20 +1335,31 @@ YQUI::setTextdomain( TEXTDOMAIN ); if ( _helpButton ) - // "Help" button - intentionally without keyboard shortcut - _helpButton->setText( _( "Help" ) ); + // "Help" button + // QT handles duplicate shortcuts, it can be kept (bnc#880983) + _helpButton->setText( _( "&Help" ) ); if ( _stepsButton ) - // "Steps" button - intentionally without keyboard shortcut - _stepsButton->setText( _( "Steps" ) ); + // "Steps" button + // QT handles duplicate shortcuts, it can be kept (bnc#880983) + _stepsButton->setText( _( "&Steps" ) ); if ( _treeButton ) - // "Tree" button - intentionally without keyboard shortcut - _treeButton->setText( _( "Tree" ) ); + // "Tree" button + // QT handles duplicate shortcuts, it can be kept (bnc#880983) + _treeButton->setText( _( "&Tree" ) ); + + if ( _releaseNotesButton ) + // "Release Notes" button + // QT handles duplicate shortcuts, it can be kept (bnc#880983) + _releaseNotesButton->setText( _( "&Release Notes" ) ); if ( _helpDlg ) _helpDlg->retranslate(); + if ( _relNotesDlg ) + _relNotesDlg->retranslate(); + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libyui-qt-2.46.14/src/YQWizard.h new/libyui-qt-2.46.15/src/YQWizard.h --- old/libyui-qt-2.46.14/src/YQWizard.h 2014-05-12 14:30:44.000000000 +0200 +++ new/libyui-qt-2.46.15/src/YQWizard.h 2015-01-30 14:34:12.000000000 +0100 @@ -57,6 +57,7 @@ class YQReplacePoint; class QY2ListView; class QY2HelpDialog; +class QY2RelNotesDialog; class YQWizard : public QSplitter, public YWizard @@ -570,6 +571,7 @@ QString _qHelpText; QY2HelpDialog * _helpDlg; + QY2RelNotesDialog * _relNotesDlg; QStackedWidget * _sideBar; QWidget * _stepsPanel; -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org