Mailinglist Archive: opensuse-commit (1059 mails)

< Previous Next >
commit yast2-ncurses
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Mon, 07 Jan 2008 12:54:00 +0100
  • Message-id: <20080107115400.7B7BA678336@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package yast2-ncurses
checked in at Mon Jan 7 12:54:00 CET 2008.

--------
--- yast2-ncurses/yast2-ncurses.changes 2007-12-17 13:16:49.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-ncurses/yast2-ncurses.changes
2008-01-07 12:48:49.665797000 +0100
@@ -1,0 +2,8 @@
+Mon Jan 7 12:32:14 CET 2008 - kmachalkova@xxxxxxx
+
+- Status line support added ( all quick access Fxx keys are now
+ shown in the bottom status line ), help popup not removed yet
+- Fixed adding and indexing of combo-box items (#346862 related)
+- 2.16.8
+
+-------------------------------------------------------------------

Old:
----
yast2-ncurses-2.16.7.tar.bz2

New:
----
yast2-ncurses-2.16.8.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-ncurses.spec ++++++
--- /var/tmp/diff_new_pack.I22410/_old 2008-01-07 12:53:49.000000000 +0100
+++ /var/tmp/diff_new_pack.I22410/_new 2008-01-07 12:53:49.000000000 +0100
@@ -1,7 +1,7 @@
#
-# spec file for package yast2-ncurses (Version 2.16.7)
+# spec file for package yast2-ncurses (Version 2.16.8)
#
-# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@@ -11,12 +11,12 @@
# norootforbuild

Name: yast2-ncurses
-Version: 2.16.7
+Version: 2.16.8
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-ncurses-2.16.7.tar.bz2
+Source0: yast2-ncurses-2.16.8.tar.bz2
Prefix: /usr
BuildRequires: dejagnu doxygen gcc-c++ libzypp-devel yast2-core-devel
yast2-devtools
BuildRequires: blocxx-devel libxcrypt-devel ncurses-devel
@@ -46,7 +46,7 @@


%prep
-%setup -n yast2-ncurses-2.16.7
+%setup -n yast2-ncurses-2.16.8

%build
%{prefix}/bin/y2tool y2autoconf
@@ -81,6 +81,11 @@
/usr/share/YaST2/data/you_layout.ycp
%doc %{prefix}/share/doc/packages/yast2-ncurses
%changelog
+* Mon Jan 07 2008 - kmachalkova@xxxxxxx
+- Status line support added ( all quick access Fxx keys are now
+ shown in the bottom status line ), help popup not removed yet
+- Fixed adding and indexing of combo-box items (#346862 related)
+- 2.16.8
* Mon Dec 17 2007 - kmachalkova@xxxxxxx
- Reworked repositories filter: added pref. width/height methods,
adding items adapted to new NCTable, treat RepoTag as dummy table cell

++++++ yast2-ncurses-2.16.7.tar.bz2 -> yast2-ncurses-2.16.8.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-ncurses-2.16.7/src/NCComboBox.cc
new/yast2-ncurses-2.16.8/src/NCComboBox.cc
--- old/yast2-ncurses-2.16.7/src/NCComboBox.cc 2007-11-19 18:09:02.000000000
+0100
+++ new/yast2-ncurses-2.16.8/src/NCComboBox.cc 2008-01-07 12:32:05.000000000
+0100
@@ -200,8 +200,9 @@
YComboBox::addItem( item );

deflist.push_back( item->label() );
- if ( item->selected() || index == -1 )
+ if ( item->selected() )
{
+ index = item->index();
setText( item->label() );
}
}
@@ -220,13 +221,8 @@
YItem * newItem = new YItem( label, selected );
YUI_CHECK_NEW( newItem );

- YComboBox::addItem( newItem );
+ addItem(newItem);

- deflist.push_back( label );
- if ( selected || index == -1 )
- {
- setText( label );
- }
}

///////////////////////////////////////////////////////////////////
@@ -302,7 +298,6 @@
modified = false;
fldstart = 0;
curpos = mayedit ? buffer.length() : 0;
- index = -1;
setDefsze();
tUpdate();
Redraw();
@@ -319,17 +314,16 @@
string NCComboBox::text()
{
if ( modified )
- return NCstring( buffer ).Str();
-
- if ( index != -1 ) {
- int idx = 0;
- list<string>::const_iterator entry;
- for ( entry = deflist.begin(); entry != deflist.end(); ++entry, ++idx )
{
- if ( idx == index ) {
- return *entry;
- }
- }
- }
+ return NCstring( buffer ).Str();
+ //if ( index != -1 ) {
+ // int idx = 0;
+ // list<string>::const_iterator entry;
+ // for ( entry = deflist.begin(); entry != deflist.end(); ++entry,
++idx ) {
+ // if ( idx == index ) {
+ // return *entry;
+ // }
+ // }
+ //}

return privText.Str();
}
@@ -640,7 +634,7 @@
wpos at( ScreenPos() + wpos( win->height(), -1 ) );
NCPopupList * dialog = new NCPopupList( at, "", deflist, index );
YUI_CHECK_NEW( dialog );
- int idx = dialog->post();
+ int idx = dialog->post();
if ( idx != -1 )
setCurrentItem( idx );
YDialog::deleteTopmostDialog();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-ncurses-2.16.7/src/NCDialog.cc
new/yast2-ncurses-2.16.8/src/NCDialog.cc
--- old/yast2-ncurses-2.16.7/src/NCDialog.cc 2007-12-17 09:32:48.000000000
+0100
+++ new/yast2-ncurses-2.16.8/src/NCDialog.cc 2007-12-20 10:40:44.000000000
+0100
@@ -267,6 +267,7 @@
getVisible();
doUpdate();
DumpOn( NCDBG, " " );
+
}
else if ( !pan )
{
@@ -531,6 +532,9 @@
--inMultiDraw_i;
} else {
inMultiDraw_i = 0;
+ string text = "";
+ describeFunctionKeys( text );
+ NCurses::SetStatusLine( text );
Update();
}
}
@@ -1417,8 +1421,8 @@

for ( it = fkeys.begin(); it != fkeys.end(); ++it )
{
- sprintf( key, "F%-2d: ", (*it).first );
- text += key + (*it).second + "<br>";
+ sprintf( key, "F%d: ", (*it).first );
+ text += key + (*it).second + " ";
}

helpText = text;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-ncurses-2.16.7/src/NCurses.cc
new/yast2-ncurses-2.16.8/src/NCurses.cc
--- old/yast2-ncurses-2.16.7/src/NCurses.cc 2007-11-26 14:23:49.000000000
+0100
+++ new/yast2-ncurses-2.16.8/src/NCurses.cc 2008-01-07 12:32:05.000000000
+0100
@@ -147,6 +147,7 @@
NCurses::NCurses()
: theTerm ( 0 )
, title_w ( 0 )
+ , status_w( 0 )
, styleset( 0 )
, stdpan ( 0 )
{
@@ -174,6 +175,8 @@
delete stdpan;
if ( title_w )
::delwin( title_w );
+ if ( status_w)
+ ::delwin( status_w );
::endwin();
if ( theTerm )
::delscreen( theTerm );
@@ -188,14 +191,23 @@
//
// DESCRIPTION :
//
-WINDOW * NCurses::ripped_w = 0;
+WINDOW * NCurses::ripped_w_top = 0;
+WINDOW * NCurses::ripped_w_bottom = 0;

-int NCurses::ripinit( WINDOW * w, int c )
+int NCurses::ripinit_top( WINDOW * w, int c )
{
- ripped_w = w;
+ ripped_w_top = w;
return OK;
}

+
+int NCurses::ripinit_bottom( WINDOW * w, int c )
+{
+ ripped_w_bottom = w;
+ return OK;
+}
+
+
void NCurses::init()
{
UIMIL << "Launch NCurses..."
@@ -206,8 +218,12 @@
UIMIL << "TERM=" << envTerm << endl;

signal( SIGINT, SIG_IGN ); // ignore Ctrl C
-
- if ( title_line() && ::ripoffline( 1, ripinit ) != OK )
+
+ //rip off the top line
+ if ( title_line() && ::ripoffline( 1, ripinit_top ) != OK )
+ throw NCursesError( "ripoffline() failed" );
+ //and bottom line (-1 means 1st from the bottom)
+ if ( ::ripoffline( -1, ripinit_bottom) != OK )
throw NCursesError( "ripoffline() failed" );

UIMIL << "isatty(stdin)" << (isatty(0) ? "yes" : "no") << endl;
@@ -277,11 +293,15 @@
}

if ( title_line() ) {
- if ( !ripped_w )
- throw NCursesError( "ripinit() failed" );
- title_w = ripped_w;
+ if ( !ripped_w_top )
+ throw NCursesError( "ripinit_top() failed" );
+ title_w = ripped_w_top;
}

+ if ( !ripped_w_bottom )
+ throw NCursesError( "ripinit_bottom() failed" );
+ status_w = ripped_w_bottom;
+
setup_screen();

UIMIL << form( "screen size %d x %d\n", lines(), cols() );
@@ -334,6 +354,8 @@
{
::wbkgd( title_w, style()(NCstyle::AppTitle) );
::wnoutrefresh( title_w );
+ ::wbkgd( status_w, style()(NCstyle::AppTitle) );
+ ::wnoutrefresh( status_w );
}

///////////////////////////////////////////////////////////////////
@@ -448,6 +470,7 @@
if ( myself && myself->initialized() ) {
UIMIL << "start refresh ..." << endl;
SetTitle( myself->title_t );
+ SetStatusLine( myself->status_line );
::clearok( ::stdscr, true );
myself->stdpan->refresh();
UIMIL << "done refresh ..." << endl;
@@ -520,6 +543,20 @@
::mvwaddstr( myself->title_w, 0, 1, myself->title_t.c_str() );
::wnoutrefresh( myself->title_w );
}
+
+}
+
+void NCurses::SetStatusLine( const string & str )
+{
+
+ if ( myself && myself->status_w ) {
+ myself->status_line = str;
+ ::wbkgd( myself->status_w, myself->style()(NCstyle::AppTitle) );
+ ::werase( myself->status_w );
+
+ ::mvwaddstr( myself->status_w, 0, 1, myself->status_line.c_str() );
+ ::wnoutrefresh( myself->status_w );
+ }
}

///////////////////////////////////////////////////////////////////
@@ -623,13 +660,21 @@
(*it)->resizeEvent();
}

- // recreate stack of visible dialogs
- for ( list<NCDialog*>::iterator it = dlgStack.begin(); it !=
dlgStack.end(); ++it ) {
- (*it)->getVisible();
- }
- Update();
+ // recreate stack of visible dialogs
+ for ( list<NCDialog*>::iterator it = dlgStack.begin(); it !=
dlgStack.end(); ++it ) {
+ (*it)->getVisible();
+ }
+ Update();
+
+ //FIXME: remove this once libncurses is upgraded to 20080105 patchlevel
+ //after the resize, status line window needs to be moved to the new pos.
+ ::mvwin(myself->status_w, NCurses::lines(), 0);
+ SetStatusLine(myself->status_line);
+ //update the screen
+ ::touchwin(myself->status_w);
+ ::doupdate();

- UIMIL << "done resize ..." << endl;
+ UIMIL << "done resize ..." << endl;
}
}

diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-ncurses-2.16.7/src/NCurses.h
new/yast2-ncurses-2.16.8/src/NCurses.h
--- old/yast2-ncurses-2.16.7/src/NCurses.h 2007-11-19 18:09:02.000000000
+0100
+++ new/yast2-ncurses-2.16.8/src/NCurses.h 2007-12-20 10:40:44.000000000
+0100
@@ -147,8 +147,10 @@

static NCurses * myself;

- static WINDOW * ripped_w;
- static int ripinit( WINDOW * , int );
+ static WINDOW * ripped_w_top;
+ static WINDOW * ripped_w_bottom;
+ static int ripinit_top( WINDOW * , int );
+ static int ripinit_bottom( WINDOW * , int );

protected:

@@ -156,7 +158,9 @@
string myTerm;
string envTerm;
WINDOW * title_w;
+ WINDOW * status_w;
string title_t;
+ string status_line;

NCstyle * styleset;
NCursesPanel * stdpan;
@@ -192,6 +196,7 @@
static void Redraw();
static void Refresh();
static void SetTitle( const string & str );
+ static void SetStatusLine( const string & str );
static void ScreenShot( const string & name = "screen.shot" );

static void drawTitle();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/yast2-ncurses-2.16.7/VERSION
new/yast2-ncurses-2.16.8/VERSION
--- old/yast2-ncurses-2.16.7/VERSION 2007-12-17 13:15:24.000000000 +0100
+++ new/yast2-ncurses-2.16.8/VERSION 2008-01-07 12:44:11.000000000 +0100
@@ -1 +1 @@
-2.16.7
+2.16.8


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread