Skip to content

Commit

Permalink
Merge pull request #115 from shundhammer/huha-item-selector
Browse files Browse the repository at this point in the history
New ItemSelector Widget (SingleItemSelector, MultiItemSelector) - libyui-qt part
  • Loading branch information
shundhammer committed Sep 19, 2019
2 parents c6c7d00 + 7ff6ae3 commit 0455aaa
Show file tree
Hide file tree
Showing 81 changed files with 1,438 additions and 694 deletions.
2 changes: 2 additions & 0 deletions SOURCECONF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ SET( ${TARGETLIB}_SOURCES
YQImage.cc
YQInputField.cc
YQIntField.cc
YQItemSelector.cc
YQLabel.cc
YQLayoutBox.cc
YQLogView.cc
Expand Down Expand Up @@ -99,6 +100,7 @@ SET( ${TARGETLIB}_HEADERS
YQImage.h
YQInputField.h
YQIntField.h
YQItemSelector.h
YQLabel.h
YQLayoutBox.h
YQLogView.h
Expand Down
4 changes: 2 additions & 2 deletions VERSION.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "50")
SET(VERSION_PATCH "6")
SET(VERSION_MINOR "51")
SET(VERSION_PATCH "0")
SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${GIT_SHA1_VERSION}" )

##### This is needed for the libyui-qt core ONLY.
Expand Down
4 changes: 2 additions & 2 deletions package/libyui-qt-doc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

Name: %{parent}-doc
# DO NOT manually bump the version here; instead, use rake version:bump
Version: 2.50.6
Version: 2.51.0
Release: 0
Source: %{parent}-%{version}.tar.bz2

Expand All @@ -33,7 +33,7 @@ BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: graphviz-gnome
BuildRequires: texlive-latex
BuildRequires: libyui-devel >= 3.5.0
BuildRequires: libyui-devel >= 3.8.0

Url: http://github.com/libyui/
Summary: Libyui-qt documentation
Expand Down
6 changes: 6 additions & 0 deletions package/libyui-qt.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Sep 18 15:37:28 UTC 2019 - Stefan Hundhammer <shundhammer@suse.com>

- Implemented ItemSelector widget (bsc#1084674)
- 2.50.7

-------------------------------------------------------------------
Thu Sep 12 12:10:56 CEST 2019 - aschnell@suse.com

Expand Down
6 changes: 3 additions & 3 deletions package/libyui-qt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

Name: libyui-qt
# DO NOT manually bump the version here; instead, use rake version:bump
Version: 2.50.6
Version: 2.51.0
Release: 0
Source: %{name}-%{version}.tar.bz2

Expand All @@ -30,7 +30,7 @@ BuildRequires: cmake >= 2.8
BuildRequires: gcc-c++
BuildRequires: pkg-config

%define libyui_devel_version libyui-devel >= 3.5.0
%define libyui_devel_version libyui-devel >= 3.8.0
BuildRequires: %{libyui_devel_version}
BuildRequires: fontconfig-devel
BuildRequires: pkgconfig(Qt5Core)
Expand All @@ -56,7 +56,7 @@ component for libYUI.
Requires: libyui%{so_version}
Provides: %{name} = %{version}
Provides: yast2-qt = %{version}
Obsoletes: yast2-qt < 2.42.0
Obsoletes: yast2-qt < 2.51.0

Url: http://github.com/libyui/
Summary: Libyui - Qt User Interface
Expand Down
4 changes: 3 additions & 1 deletion src/QY2ComboTabWidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#define SPACING 6 // between subwidgets
#define MARGIN 4 // around the widget

using std::string;



QY2ComboTabWidget::QY2ComboTabWidget( const QString & label,
Expand Down Expand Up @@ -108,7 +110,7 @@ QY2ComboTabWidget::showPageIndex( int index )
{
QWidget * page = pages[ index ];
widget_stack->setCurrentWidget( page );
// yuiDebug() << "Changing current page" << std::endl;
// yuiDebug() << "Changing current page" << endl;
emit currentChanged( page );
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/QY2ComboTabWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class QWidget;

/**
* This widget is very much like a QTabWidget, but it uses a combo box above
* the tab pages rather than a ( scrolled ) one-line row of tabs.
* the tab pages rather than a (scrolled) one-line row of tabs.
**/
class QY2ComboTabWidget : public QWidget
{
Expand Down
8 changes: 4 additions & 4 deletions src/QY2ListView.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ QY2ListView::saveColumnWidths()
for ( int i = 0; i < columnCount(); i++ )
{
int size = header()->sectionSize(i);
// yuiMilestone() << "Saving size " << size << " for section " << i << std::endl;
// yuiMilestone() << "Saving size " << size << " for section " << i << endl;
_savedColumnWidth.push_back( size );
}
}
Expand All @@ -201,7 +201,7 @@ QY2ListView::restoreColumnWidths()
yuiDebug() << "Restoring size " << _savedColumnWidth[i]
<< " for section " << i
<< " now " << header()->sectionSize(i)
<< std::endl;
<< endl;
#endif
}
}
Expand Down Expand Up @@ -435,9 +435,9 @@ QY2ListViewItem::operator< ( const QTreeWidgetItem & otherListViewItem ) const
if (ok1 && ok2 )
return retval; // int < int
else if (ok1 && !ok2)
return true; // int < std::string
return true; // int < string
else if (!ok1 && ok2)
return false; // std::string > int
return false; // string > int

// and finally non-numeric sorting is done by the base class
return QTreeWidgetItem::operator<(otherListViewItem);
Expand Down
15 changes: 8 additions & 7 deletions src/QY2RelNotesDialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,18 @@ QY2RelNotesDialog::QY2RelNotesDialog( QWidget *parent )
textBrowser->document()->setDefaultStyleSheet( QY2Styler::styler()->textStyle() );
}

void QY2RelNotesDialog::setRelNotes( const std::map<std::string,std::string>& relnotes )

void QY2RelNotesDialog::setRelNotes( const std::map<string,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 = std::vector<string>();
for ( std::map<string,string>::const_iterator it = relnotes.begin(); it != relnotes.end(); ++it )
{
_tab_keys.push_back(it->first);
tabBar->addTab( it->first.c_str() );
}
Expand All @@ -114,11 +116,13 @@ void QY2RelNotesDialog::setRelNotes( const std::map<std::string,std::string>& re
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())
Expand All @@ -128,12 +132,9 @@ void QY2RelNotesDialog::tabChanged( int index )
textBrowser->setText( _relnotes[_tab_keys[index]].c_str() );
}


void QY2RelNotesDialog::retranslate()
{
setWindowTitle( _( "Release Notes" ) );
closeButton->setText( _( "&Close" ) );
}




Loading

0 comments on commit 0455aaa

Please sign in to comment.