YaST Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
June 2007
- 27 participants
- 490 discussions
[yast-commit] r39031 - in /branches/tmp/sh/mod-ui/ncurses/src: ./ pkg/
by gs@svn.opensuse.org 26 Jun '07
by gs@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: gs
Date: Tue Jun 26 13:13:12 2007
New Revision: 39031
URL: http://svn.opensuse.org/viewcvs/yast?rev=39031&view=rev
Log:
use YStringWidgetID to set IDs manually,
use YCPDialogParser to parse the layout files and
YCPDialogParser::findWidgetWithId to find Ids from layout
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h
branches/tmp/sh/mod-ui/ncurses/src/NCurses.h
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCZypp.h
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc Tue Jun 26 13:13:12 2007
@@ -31,6 +31,7 @@
#include <ycp/YCPVoid.h>
#include <ycp/Parser.h>
+#include "YCPDialogParser.h"
///////////////////////////////////////////////////////////////////
//
@@ -77,14 +78,17 @@
YWidgetOpt childrenOpt( opt );
widgetRoot = (YContainerWidget *)ui->createWidgetTree( dynamic_cast<YWidget *>(parent),
childrenOpt, 0, pkgLayout );
+ YCPDialogParser::parseWidgetTreeTerm(dynamic_cast<YWidget *>(parent), childrenOpt, pkgLayout );
}
// create the PackageSelector (creation with 'new' is required because initialization
// in the list of member variables causes problems with untranslated messages)
- packager = new NCPackageSelector( ui, opt );
+ // packager = new NCPackageSelector( ui, opt );
if ( widgetRoot )
{
+ packager = new NCPackageSelector( ui, widgetRoot, opt );
+
this->addChild( widgetRoot );
widgetRoot->setParent( this );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc Tue Jun 26 13:13:12 2007
@@ -221,6 +221,40 @@
///////////////////////////////////////////////////////////////////
//
//
+// METHOD NAME : NCTextEntry::setValue
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+void NCTextEntry::setValue( const std::string & ntext )
+{
+ buffer = NCstring( ntext ).str();
+ if ( maxInputLength && buffer.length() > maxInputLength ) {
+ buffer = buffer.erase( maxInputLength );
+ }
+ fldstart = 0;
+ curpos = buffer.length();
+ tUpdate();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
+// METHOD NAME : NCTextEntry::value
+// METHOD TYPE : void
+//
+// DESCRIPTION :
+//
+string NCTextEntry::value( )
+{
+ NCstring text ( buffer );
+
+ return text.Str();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
// METHOD NAME : NCTextEntry::getText
// METHOD TYPE : YCPString
//
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h Tue Jun 26 13:13:12 2007
@@ -108,6 +108,9 @@
virtual void setText( const YCPString & ntext );
virtual YCPString getText();
+ virtual void setValue( const std::string & ntext ); // new for setText()
+ virtual string value(); // new for getText()
+
virtual void setValidChars( const YCPString & validchars );
virtual NCursesEvent wHandleInput( wint_t key );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCurses.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCu…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCurses.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCurses.h Tue Jun 26 13:13:12 2007
@@ -27,6 +27,7 @@
#include <YCP.h>
#include "YEvent.h"
+#include "YWidget.h"
#include <curses.h> /* curses.h: #define NCURSES_CH_T cchar_t */
#include <wchar.h>
@@ -87,7 +88,8 @@
Type type;
NCWidget * widget;
- YCPValue selection; // used for MenuEvent (the menu selection)
+ YWidgetID * selection; // used for MenuEvent (the menu selection)
+ //YCPValue selection;
YCPValue result; // can be used for any result
@@ -100,7 +102,7 @@
NCursesEvent( Type t = none, YEvent::EventReason r = YEvent::UnknownReason )
: type ( t )
, widget ( 0 )
- , selection( YCPNull() )
+ , selection( 0 )
, result ( YCPNull() )
, detail ( NODETAIL )
, reason ( r )
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Tue Jun 26 13:13:12 2007
@@ -137,7 +137,7 @@
/**
* Creates a radio button group.
*/
- virtual YContainerWidget * createRadioButtonGroup( YWidget * parent, YWidgetOpt & opt );
+ // virtual YContainerWidget * createRadioButtonGroup( YWidget * parent, YWidgetOpt & opt );
/**
* Creates a frame widget
@@ -222,7 +222,7 @@
* @param rbg the radio button group the new button will belong to
*/
virtual YWidget * createRadioButton( YWidget * parent, YWidgetOpt & opt,
- YRadioButtonGroup * rbg,
+ //YRadioButtonGroup * rbg,
const YCPString & label,
bool checked );
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc Tue Jun 26 13:13:12 2007
@@ -48,6 +48,9 @@
#include <zypp/ui/PatchContents.h>
#include <zypp/SysContent.h>
+#include "YWidgetID.h"
+#include "YCPDialogParser.h"
+
typedef zypp::ui::PatchContents ZyppPatchContents;
typedef zypp::ui::PatchContents::const_iterator ZyppPatchContentsIterator;
typedef zypp::syscontent::Reader::Entry ZyppReaderEntry;
@@ -96,9 +99,10 @@
//
// Constructor
//
-NCPackageSelector::NCPackageSelector( YNCursesUI * ui, const YWidgetOpt & opt )
+NCPackageSelector::NCPackageSelector( YNCursesUI * ui, YWidget * wRoot, const YWidgetOpt & opt )
: y2ui( ui )
- , visibleInfo( YCPNull() )
+ , widgetRoot ( wRoot )
+ , visibleInfo( 0 )
, filterPopup( 0 )
, depsPopup( 0 )
, selectionPopup( 0 )
@@ -437,7 +441,8 @@
bool NCPackageSelector::handleEvent ( const NCursesEvent& event )
{
bool retVal = false;
- YCPValue currentId = YCPNull();
+ YWidgetID * currentId = 0;
+ //YCPValue currentId = YCPNull();
if ( event == NCursesEvent::handled )
return false;
@@ -453,14 +458,16 @@
}
// Find the handler-function for the given widget-nameId
- if ( ! currentId.isNull() )
+ if ( currentId )
{
UIMIL << "Selected widget id: " << currentId->toString() << endl;
// hyperlink
- if ( currentId->isString()
- && currentId->asString()->value().substr(0, 4) == "pkg:" )
+ //if ( currentId->isString()
+ // && currentId->asString()->value().substr(0, 4) == "pkg:" )
+ if ( currentId->toString().substr(0,4) == "pkg:" )
{
- LinkHandler( currentId->asString()->value() );
+ //LinkHandler( currentId->asString()->value() );
+ LinkHandler( currentId->toString() );
return true;
}
@@ -494,7 +501,7 @@
//
// currently displayed package information
//
-void NCPackageSelector::setVisibleInfo( const YCPValue & info )
+void NCPackageSelector::setVisibleInfo( YWidgetID * info )
{
visibleInfo = info;
}
@@ -624,7 +631,8 @@
NCDBG << "Filter: " << label->toString() << endl;
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ // YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast<NCLabel *>(filterLabel)->setLabel( label );
@@ -719,7 +727,8 @@
packageList->drawList();
// set filter label to 'Search'
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ // YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast<NCLabel *>(filterLabel)->setLabel( YCPString(NCPkgNames::SearchResults()) );
@@ -769,7 +778,9 @@
packageList->drawList();
// set filter label to 'Search'
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ //YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
+
if ( filterLabel )
{
static_cast<NCLabel *>(filterLabel)->setLabel( YCPString(NCPkgNames::SearchResults()) );
@@ -824,7 +835,8 @@
packageList->drawList();
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
+
if ( filterLabel )
{
if ( filter == "installable" )
@@ -890,7 +902,7 @@
packageList->drawList();
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast<NCLabel *>(filterLabel)->setLabel( YCPString(NCPkgNames::UpdateProblem()) );
@@ -935,7 +947,7 @@
if ( sel )
{
- if ( contains( patchSelectables, sel ) )
+ if ( inContainer( patchSelectables, sel ) )
{
NCMIL << "Suppressing duplicate selectable: " << (*it)->name().c_str() << "-" <<
(*it)->edition().asString().c_str() << " " <<
@@ -1071,7 +1083,7 @@
packageList->drawList();
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast<NCLabel *>(filterLabel)->setLabel( NCPkgNames::InstSummary() );
@@ -1141,7 +1153,7 @@
if ( !label.isNull() )
{
// show the selected filter label
- YWidget * filterLabel = y2ui->widgetWithId( NCPkgNames::Filter(), true );
+ YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
static_cast<NCLabel *>(filterLabel)->setLabel( label );
@@ -1442,14 +1454,14 @@
NCPkgTable * packageList = getPackageList();
if ( !packageList
- || event.selection.isNull()
- || visibleInfo.isNull() )
+ || !event.selection
+ || !visibleInfo )
{
NCERR << "*** InformationHandler RETURN false ***" << endl;
return false;
}
- if ( visibleInfo->compare( event.selection ) == YO_EQUAL )
+ if ( visibleInfo->isEqual( event.selection ) )
{
// information selection has not changed
return true;
@@ -1458,7 +1470,8 @@
// set visibleInfo
visibleInfo = event.selection;
- if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
+ //if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
+ if ( visibleInfo->toString() == "versions" )
{
// show the package table
const char * tableLayout = "`PkgSpecial( `id(\"availpkgs\"), `opt(`notify), \"pkgTable\" )";
@@ -1470,7 +1483,7 @@
if (!layout.isNull() )
y2ui->evaluateReplaceWidget( YCPSymbol("replaceinfo"), layout->asTerm() );
- NCPkgTable * pkgAvail = dynamic_cast<NCPkgTable *>(y2ui->widgetWithId(NCPkgNames::AvailPkgs(), true));
+ NCPkgTable * pkgAvail = dynamic_cast<NCPkgTable *>(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::AvailPkgs()));
if ( pkgAvail )
{
@@ -1485,7 +1498,8 @@
}
}
// patches
- else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
+ //else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "patchpackages" )
{
// show the package table
const char * tableLayout = "`PkgSpecial( `id(\"patchpkgs\"), `opt(`notify), \"pkgTable\" )";
@@ -1497,7 +1511,7 @@
if (!layout.isNull())
y2ui->evaluateReplaceWidget( YCPSymbol ("replaceinfo"), layout->asTerm() );
- NCPkgTable * patchPkgs = dynamic_cast<NCPkgTable *>(y2ui->widgetWithId(NCPkgNames::PatchPkgs(), true));
+ NCPkgTable * patchPkgs = dynamic_cast<NCPkgTable *>(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::PatchPkgs() ));
if ( patchPkgs )
{
@@ -1511,7 +1525,8 @@
fillPatchPackages( patchPkgs, packageList->getDataPointer( packageList->getCurrentItem() ) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::PatchPackagesVersions() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::PatchPackagesVersions() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "patchpackages" )
{
// show the package table
const char * tableLayout = "`PkgSpecial( `id(\"pkgsversions\"), `opt(`notify), \"pkgTable\" )";
@@ -1523,7 +1538,7 @@
if (!layout.isNull())
y2ui->evaluateReplaceWidget( YCPSymbol ("replaceinfo"), layout->asTerm() );
- NCPkgTable * patchPkgsVersions = dynamic_cast<NCPkgTable *>(y2ui->widgetWithId(NCPkgNames::PatchPkgsVersions(), true));
+ NCPkgTable * patchPkgsVersions = dynamic_cast<NCPkgTable *>(YCPDialogParser::findWidgetWithId(widgetRoot, NCPkgNames::PatchPkgsVersions()) );
if ( patchPkgsVersions )
{
@@ -1565,7 +1580,7 @@
//
bool NCPackageSelector::DependencyHandler( const NCursesEvent& event )
{
- if ( event.selection.isNull() )
+ if ( !event.selection )
{
return false;
}
@@ -1575,7 +1590,8 @@
NCPkgNames::OKLabel() );
info.setNiceSize( 35, 5 );
- if ( event.selection->compare( NCPkgNames::ShowDeps() ) == YO_EQUAL )
+ // ( event.selection->compare( NCPkgNames::ShowDeps() ) == YO_EQUAL )
+ if ( event.selection->toString() == "showdeps" )
{
bool ok = false;
@@ -1592,13 +1608,15 @@
updatePackageList();
showDiskSpace();
}
- else if ( event.selection->compare( NCPkgNames::VerifySystem() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::VerifySystem() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "verifysystem" )
{
verifyPackageDependencies();
updatePackageList();
showDiskSpace();
}
- else if ( event.selection->compare( NCPkgNames::AutoDeps() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::AutoDeps() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "autodeps" )
{
char menu[2000];
@@ -1695,12 +1713,13 @@
NCPkgTable * packageList = getPackageList();
if ( !packageList
- || event.selection.isNull() )
+ || !event.selection )
{
return false;
}
- if ( event.selection->compare( NCPkgNames::RpmGroups() ) == YO_EQUAL )
+ // if ( event.selection->compare( NCPkgNames::RpmGroups() ) == YO_EQUAL )
+ if ( event.selection->toString() == "groups" )
{
if ( filterPopup )
{
@@ -1708,7 +1727,8 @@
retEvent = filterPopup->showFilterPopup( );
}
}
- else if ( event.selection->compare( NCPkgNames::Selections() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Selections() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "selections" )
{
if ( selectionPopup )
{
@@ -1716,7 +1736,8 @@
retEvent = selectionPopup->showSelectionPopup( );
}
}
- else if ( event.selection->compare( NCPkgNames::Patterns() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Patterns() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "patterns" )
{
if ( patternPopup )
{
@@ -1724,7 +1745,8 @@
retEvent = patternPopup->showSelectionPopup( );
}
}
- else if ( event.selection->compare( NCPkgNames::Languages() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Languages() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "languages" )
{
if ( languagePopup )
{
@@ -1733,47 +1755,58 @@
}
}
// patches
- else if ( event.selection->compare( NCPkgNames::Recommended() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Recommended() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "recommended" )
{
fillPatchList( "recommended" ); // patch kind
}
- else if ( event.selection->compare( NCPkgNames::Security() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Security() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "security" )
{
fillPatchList( "security" ); // patch kind
}
- else if ( event.selection->compare( NCPkgNames::Optional() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Optional() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "optional" )
{
fillPatchList( "optional" ); // patch kind
}
- else if ( event.selection->compare( NCPkgNames::YaST2Patches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::YaST2Patches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "yast2" )
{
fillPatchList( "YaST2" ); // patch kind
}
- else if ( event.selection->compare( NCPkgNames::AllPatches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::AllPatches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "allpatches" )
{
fillPatchList( "all" ); // show all patches
}
- else if ( event.selection->compare( NCPkgNames::InstalledPatches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::InstalledPatches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "instpatches" )
{
fillPatchList( "installed" ); // show installed patches
}
- else if ( event.selection->compare( NCPkgNames::InstallablePatches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::InstallablePatches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "installablepatches" )
{
fillPatchList( "installable" ); // show installed patches
}
- else if ( event.selection->compare( NCPkgNames::NewPatches() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::NewPatches() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "newpatches" )
{
fillPatchList( "new" ); // show new patches
}
- else if ( event.selection->compare( NCPkgNames::UpdateList() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::UpdateList() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "updatelist" )
{
fillUpdateList();
}
- else if ( event.selection->compare( NCPkgNames::Whatif() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Whatif() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "whatif" )
{
fillSummaryList( NCPkgTable::L_Changes );
}
- else if ( event.selection->compare( NCPkgNames::Installed() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Installed() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "installed" )
{
fillSummaryList( NCPkgTable::L_Installed );
}
@@ -1796,7 +1829,7 @@
NCPkgTable * packageList = getPackageList();
if ( !packageList
- || event.selection.isNull() )
+ || !event.selection )
{
return false;
}
@@ -1808,76 +1841,91 @@
}
// call the corresponding method of NCPkgTable
- if ( event.selection->compare( NCPkgNames::Toggle() ) == YO_EQUAL )
+ // if ( event.selection->compare( NCPkgNames::Toggle() ) == YO_EQUAL )
+ if ( event.selection->toString() == "toggle" )
{
packageList->toggleObjStatus( );
}
- else if ( event.selection->compare( NCPkgNames::Select() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Select() ) == YO_EQUAL )
+ else if ( event.selection->toString() =="select" )
{
if ( testMode )
diskspacePopup->setDiskSpace( '+' );
else
packageList->changeObjStatus( '+' );
}
- else if ( event.selection->compare( NCPkgNames::Delete() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Delete() ) == YO_EQUAL )
+ else if (event.selection->toString() == "delete" )
{
if ( testMode )
diskspacePopup->setDiskSpace( '-' );
else
packageList->changeObjStatus( '-' );
}
- else if ( event.selection->compare( NCPkgNames::Update() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::Update() ) == YO_EQUAL )
+ else if (event.selection->toString() == "update" )
{
if ( testMode )
diskspacePopup->checkDiskSpaceRange();
else
packageList->changeObjStatus( '>' );
}
- else if ( event.selection->compare( NCPkgNames::TabooOn() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::TabooOn() ) == YO_EQUAL )
+ else if (event.selection->toString() == "tabooOn" )
{
packageList->changeObjStatus( '!' );
}
- else if ( event.selection->compare( NCPkgNames::TabooOff() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::TabooOff() ) == YO_EQUAL )
+ else if (event.selection->toString() == "tabooOff" )
{
packageList->changeObjStatus( '%' );
}
- else if ( event.selection->compare( NCPkgNames::SourceYes() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::SourceYes() ) == YO_EQUAL )
+ else if (event.selection->toString() == "sourceYes" )
{
#ifdef FIXME
packageList->SourceInstall( true );
#endif
}
- else if ( event.selection->compare( NCPkgNames::SourceNo() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::SourceNo() ) == YO_EQUAL )
+ else if (event.selection->toString() == "sourceNo" )
{
#ifdef FIXME
packageList->SourceInstall( false );
#endif
}
- else if ( event.selection->compare( NCPkgNames::InstallAll() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::InstallAll() ) == YO_EQUAL )
+ else if (event.selection->toString() == "selall" )
{
packageList->changeListObjStatus( NCPkgTable::A_Install );
}
- else if ( event.selection->compare( NCPkgNames::DontInstall() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::DontInstall() ) == YO_EQUAL )
+ else if (event.selection->toString() == "deselall" )
{
packageList->changeListObjStatus( NCPkgTable::A_DontInstall );
}
- else if ( event.selection->compare( NCPkgNames::DeleteAll() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::DeleteAll() ) == YO_EQUAL )
+ else if (event.selection->toString() == "delall" )
{
packageList->changeListObjStatus( NCPkgTable::A_Delete );
}
- else if ( event.selection->compare( NCPkgNames::DontDelete() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::DontDelete() ) == YO_EQUAL )
+ else if (event.selection->toString() == "dontdel" )
{
packageList->changeListObjStatus( NCPkgTable::A_DontDelete );
}
- else if ( event.selection->compare( NCPkgNames::UpdateNewer() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::UpdateNewer() ) == YO_EQUAL )
+ else if (event.selection->toString() == "updnewer" )
{
packageList->changeListObjStatus( NCPkgTable::A_UpdateNewer );
}
- else if ( event.selection->compare( NCPkgNames::UpdateAll() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::UpdateAll() ) == YO_EQUAL )
+ else if (event.selection->toString() == "updall" )
{
packageList->changeListObjStatus( NCPkgTable::A_Update );
}
- else if ( event.selection->compare( NCPkgNames::DontUpdate() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::DontUpdate() ) == YO_EQUAL )
+ else if (event.selection->toString() == "dontupd" )
{
packageList->changeListObjStatus( NCPkgTable::A_DontUpdate );
}
@@ -1991,13 +2039,14 @@
//
bool NCPackageSelector::FileHandler( const NCursesEvent& event )
{
- if ( event.selection.isNull() )
+ if ( !event.selection )
{
return false;
}
//Export package list into file
- if ( event.selection->compare( NCPkgNames::ExportToFile() ) == YO_EQUAL )
+ // if ( event.selection->compare( NCPkgNames::ExportToFile() ) == YO_EQUAL )
+ if ( event.selection->toString() =="export" )
{
//Ask for file to save into
YCPValue filename = YNCursesUI::ui()->askForSaveFileName( YCPString(DEFAULT_EXPORT_FILE_NAME),
@@ -2048,7 +2097,8 @@
}
//Import package list from file
- else if ( event.selection->compare( NCPkgNames::ImportFromFile() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::ImportFromFile() ) == YO_EQUAL )
+ else if ( event.selection->toString() =="import" )
{
//ask for file to open
YCPValue filename = YNCursesUI::ui()->askForExistingFile( YCPString(DEFAULT_EXPORT_FILE_NAME),
@@ -2141,12 +2191,13 @@
string text = "";
YCPString headline = YCPString(NCPkgNames::PackageHelp());
- if ( event.selection.isNull() )
+ if ( !event.selection )
{
return false;
}
- if ( event.selection->compare( NCPkgNames::GeneralHelp() ) == YO_EQUAL )
+ // if ( event.selection->compare( NCPkgNames::GeneralHelp() ) == YO_EQUAL )
+ if ( event.selection->toString() == "help_general" )
{
text += NCPkgNames::HelpPkgInst1();
text += NCPkgNames::HelpPkgInst12();
@@ -2157,7 +2208,8 @@
text += NCPkgNames::HelpPkgInst5();
text += NCPkgNames::HelpPkgInst6();
}
- else if ( event.selection->compare( NCPkgNames::StatusHelp() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::StatusHelp() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "help_status" )
{
text += NCPkgNames::HelpOnStatus1();
text += NCPkgNames::HelpOnStatus2();
@@ -2167,11 +2219,13 @@
text += NCPkgNames::HelpOnStatus6();
text += NCPkgNames::HelpOnStatus7();
}
- else if ( event.selection->compare( NCPkgNames::UpdateHelp() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::UpdateHelp() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "help_update" )
{
text += NCPkgNames::HelpOnUpdate();
}
- else if ( event.selection->compare( NCPkgNames::SearchHelp() ) == YO_EQUAL )
+ // else if ( event.selection->compare( NCPkgNames::SearchHelp() ) == YO_EQUAL )
+ else if ( event.selection->toString() == "help_search" )
{
headline = YCPString(NCPkgNames::SearchHeadline());
text += NCPkgNames::HelpOnSearch();
@@ -2460,13 +2514,14 @@
return false;
}
- if ( visibleInfo.isNull() )
+ if ( !visibleInfo )
{
NCERR << "Visible package information NOT set" << endl;
return false;
}
- if ( visibleInfo->compare( NCPkgNames::PatchDescr() ) == YO_EQUAL )
+ // if ( visibleInfo->compare( NCPkgNames::PatchDescr() ) == YO_EQUAL )
+ if ( visibleInfo->toString() == "patchdescr" )
{
string descr;
@@ -2496,24 +2551,26 @@
descr += createDescrText( value );
// show the description
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
static_cast<NCRichText *>(descrInfo)->setText( YCPString( descr ) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::PatchPackages() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "patchpackages" )
{
- NCPkgTable *patchPkgList = dynamic_cast<NCPkgTable *>(y2ui->widgetWithId(NCPkgNames::PatchPkgs(), true));
+ NCPkgTable *patchPkgList = dynamic_cast<NCPkgTable *>(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::PatchPkgs()));
if ( patchPkgList )
{
fillPatchPackages ( patchPkgList, objPtr);
}
}
- else if ( visibleInfo->compare( NCPkgNames::PatchPackagesVersions() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::PatchPackagesVersions() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "packagesversions" )
{
- NCPkgTable *patchPkgsVersions = dynamic_cast<NCPkgTable *>(y2ui->widgetWithId(NCPkgNames::PatchPkgsVersions(), true));
+ NCPkgTable *patchPkgsVersions = dynamic_cast<NCPkgTable *>(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::PatchPkgsVersions()));
if ( patchPkgsVersions )
{
fillPatchPackages ( patchPkgsVersions, objPtr, true);
@@ -2611,27 +2668,29 @@
return false;
}
- if ( visibleInfo.isNull() )
+ if ( !visibleInfo )
{
NCERR << "Visible package information NOT set" << endl;
return false;
}
- if ( visibleInfo->compare( NCPkgNames::LongDescr() ) == YO_EQUAL )
+ // if ( visibleInfo->compare( NCPkgNames::LongDescr() ) == YO_EQUAL )
+ if ( visibleInfo->toString() == "longdescr" )
{
// ask the package manager for the description of this package
zypp::Text value = pkgPtr->description();
string descr = createDescrText( value );
// show the description
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
static_cast<NCRichText *>(descrInfo)->setText( YCPString(descr) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::Files() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::Files() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "files" )
{
string text = NCPkgNames::ListOfFiles();
// the file list is available only for installed packages
@@ -2645,13 +2704,14 @@
}
// get the widget id
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
static_cast<NCRichText *>(descrInfo)->setText( YCPString(text) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::PkgInfo() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::PkgInfo() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "pkginfo" )
{
string instVersion = "";
string version = "";
@@ -2734,22 +2794,24 @@
}
// show the description
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
static_cast<NCRichText *>(descrInfo)->setText( YCPString(text) );
}
}
- else if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::Versions() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "versions" )
{
- NCPkgTable * pkgAvail = dynamic_cast<NCPkgTable *>(y2ui->widgetWithId(NCPkgNames::AvailPkgs(), true));
+ NCPkgTable * pkgAvail = dynamic_cast<NCPkgTable *>(YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::AvailPkgs()));
if ( pkgAvail )
{
fillAvailableList( pkgAvail, slbPtr );
}
}
- else if ( visibleInfo->compare( NCPkgNames::Relations() ) == YO_EQUAL )
+ // else if ( visibleInfo->compare( NCPkgNames::Relations() ) == YO_EQUAL )
+ else if ( visibleInfo->toString() == "relations" )
{
string text = "";
text += slbPtr->name();
@@ -2784,7 +2846,7 @@
}
// show the package relations
- YWidget * descrInfo = y2ui->widgetWithId( NCPkgNames::Description(), true );
+ YWidget * descrInfo = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Description() );
if ( descrInfo )
{
@@ -2993,7 +3055,7 @@
YCPString label( diff.asString () );
// show the required diskspace
- YWidget * diskSpace = y2ui->widgetWithId( NCPkgNames::Diskspace(), true );
+ YWidget * diskSpace = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Diskspace() );
if ( diskSpace )
{
static_cast<NCLabel *>(diskSpace)->setLabel( label );
@@ -3082,7 +3144,7 @@
YCPString label( totalSize.asString() );
// show the download size
- YWidget * diskSpace = y2ui->widgetWithId( NCPkgNames::Diskspace(), true );
+ YWidget * diskSpace = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Diskspace() );
if ( diskSpace )
{
static_cast<NCLabel *>(diskSpace)->setLabel( label );
@@ -3096,7 +3158,7 @@
//
NCPkgTable * NCPackageSelector::getPackageList()
{
- YWidget * packages = y2ui->widgetWithId( NCPkgNames::Packages(), true );
+ YWidget * packages = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Packages() );
return ( dynamic_cast<NCPkgTable *>(packages) );
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.h Tue Jun 26 13:13:12 2007
@@ -30,6 +30,7 @@
#include <utility> // for STL pair
#include <y2util/YRpmGroupsTree.h>
+#include "YWidgetID.h"
#include <zypp/ResObject.h>
#include <zypp/ui/Selectable.h>
@@ -73,7 +74,9 @@
YNCursesUI * y2ui; // the UI
- YCPValue visibleInfo; // visible package info (description, file list, ...)
+ YWidget * widgetRoot; // the root of the widget tree of the layout
+
+ YWidgetID * visibleInfo; // visible package info (description, file list, ...)
NCPkgPopupTree * filterPopup; // the rpm group tags popup
@@ -119,7 +122,7 @@
* @param ui The NCurses UI
* @param opt The widget options
*/
- NCPackageSelector( YNCursesUI * ui, const YWidgetOpt & opt );
+ NCPackageSelector( YNCursesUI * ui, YWidget * wRoot, const YWidgetOpt & opt );
/**
* Destructor
@@ -345,7 +348,7 @@
* Sets the member variable to the currently visible information
* @param info
*/
- void setVisibleInfo( const YCPValue & info );
+ void setVisibleInfo( YWidgetID * info );
/**
* Fills the package table
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc Tue Jun 26 13:13:12 2007
@@ -30,6 +30,8 @@
#include "NCPopupInfo.h"
#include "NCTextEntry.h"
+#include "YWidgetID.h"
+
#include "NCi18n.h"
/*
@@ -171,7 +173,9 @@
// add the solve button
opt.key_Fxx.setValue( 10 );
solveButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::SolveLabel()) );
- solveButton->setId( NCPkgNames::Solve () );
+ //solveButton->setId( NCPkgNames::Solve () );
+ YStringWidgetID * solveID = new YStringWidgetID("solve");
+ solveButton->setId( solveID );
hSplit->addChild( solveButton );
hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
@@ -179,7 +183,9 @@
// add the cancel button
opt.key_Fxx.setValue( 9 );
cancelButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::CancelLabel()) );
- cancelButton->setId( NCPkgNames::Cancel () );
+ // cancelButton->setId( NCPkgNames::Cancel () );
+ YStringWidgetID * cancelID = new YStringWidgetID("cancel");
+ cancelButton->setId( cancelID );
hSplit->addChild( cancelButton );
}
@@ -386,17 +392,17 @@
if ( ! postevent.widget )
return false;
- YCPValue currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
-
- if ( currentId.isNull() )
+ // YCPValue currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
+ if ( !currentId )
return false;
- if ( currentId->compare( NCPkgNames::Cancel () ) == YO_EQUAL )
+ if ( currentId->toString() == "cancel" )
{
// close the dialog
postevent = NCursesEvent::cancel;
}
- else if ( currentId->compare( NCPkgNames::Solve () ) == YO_EQUAL )
+ else if ( currentId->toString() == "solve" )
{
// apply the solution here
zypp::Resolver_Ptr resolver = zypp::getZYpp()->resolver();
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc Tue Jun 26 13:13:12 2007
@@ -21,6 +21,8 @@
#include "YMenuButton.h"
#include "YDialog.h"
+#include "YWidgetID.h"
+
#include "NCSplit.h"
#include "NCSpacing.h"
#include "NCPkgNames.h"
@@ -115,7 +117,8 @@
// add the OK button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( split, opt, YCPString(NCPkgNames::OKLabel()) );
- okButton->setId( NCPkgNames::OkButton() );
+ YStringWidgetID * okID = new YStringWidgetID( "ok" );
+ okButton->setId( okID );
split->addChild( okButton );
@@ -217,16 +220,17 @@
// METHOD TYPE : bool
//
// DESCRIPTION :
-//
+//x
bool NCPkgPopupDescr::postAgain()
{
if ( ! postevent.widget )
return false;
- YCPValue currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
+ // YCPValue currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
- if ( !currentId.isNull()
- && currentId->compare( NCPkgNames::Cancel() ) == YO_EQUAL )
+ if ( currentId
+ && currentId->toString() == "cancel" )
{
// close the dialog
postevent = NCursesEvent::cancel;
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc Tue Jun 26 13:13:12 2007
@@ -21,6 +21,8 @@
#include "YMenuButton.h"
#include "YDialog.h"
+#include "YWidgetID.h"
+
#include "NCSplit.h"
#include "NCSpacing.h"
#include "NCPkgNames.h"
@@ -124,7 +126,8 @@
// add the ok button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( split, opt, YCPString(NCPkgNames::OKLabel()) );
- okButton->setId( NCPkgNames::OkButton () );
+ YStringWidgetID * okID = new YStringWidgetID( "ok" );
+ okButton->setId( okID );
split->addChild( okButton );
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc Tue Jun 26 13:13:12 2007
@@ -107,7 +107,8 @@
opt.isEditable.setValue( true );
searchExpr = new NCComboBox( frame0, opt, YCPString(NCPkgNames::SearchPhrase()) );
frame0->addChild( searchExpr );
- searchExpr->setId( NCPkgNames::SearchBox() );
+ YStringWidgetID * searchID = new YStringWidgetID ("search_box" );
+ searchExpr->setId( searchID );
searchExpr->itemAdded( YCPString( "" ), // set initial value
0, // index
false ); // not selected
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc Tue Jun 26 13:13:12 2007
@@ -20,6 +20,8 @@
#include "YMenuButton.h"
#include "YDialog.h"
+#include "YWidgetID.h"
+
#include "NCSplit.h"
#include "NCSpacing.h"
#include "NCPkgNames.h"
@@ -115,7 +117,8 @@
// add the OK button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::OKLabel()) );
- okButton->setId( NCPkgNames::OkButton() );
+ YStringWidgetID * okID = new YStringWidgetID( "ok" );
+ okButton->setId( okID );
hSplit->addChild( okButton );
hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
@@ -123,7 +126,8 @@
// add the Cancel button
opt.key_Fxx.setValue( 9 );
cancelButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::CancelLabel()) );
- cancelButton->setId( NCPkgNames::Cancel() );
+ YStringWidgetID * cancelID = new YStringWidgetID( "cancel" );
+ cancelButton->setId( cancelID );
hSplit->addChild( cancelButton );
hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
@@ -180,7 +184,7 @@
// show all packages which are automatically selected for installation
if ( slb->toModify() && slb->modifiedBy () != zypp::ResStatus::USER )
{
- if ( ! contains( ignoredNames, slb->name() ) )
+ if ( ! inContainer( ignoredNames, slb->name() ) )
{
ZyppPkg pkgPtr = tryCastToZyppPkg (slb->theObj());
if ( pkgPtr )
@@ -280,10 +284,10 @@
if ( ! postevent.widget )
return false;
- YCPValue currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
-
- if ( !currentId.isNull()
- && currentId->compare( NCPkgNames::Cancel() ) == YO_EQUAL )
+ // YCPValue currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
+ if ( currentId
+ && currentId->toString() == "cancel" )
{
//user hit cancel - discard set of changes (if not empty)
packager->clearVerifiedPkgs();
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCZypp.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCZypp.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCZypp.h Tue Jun 26 13:13:12 2007
@@ -110,7 +110,7 @@
}
-template<typename T> bool contains( const std::set<T> & container, T search )
+template<typename T> bool inContainer( const std::set<T> & container, T search )
{
return container.find( search ) != container.end();
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39030 - in /branches/tmp/sh/mod-ui: core/libyui/doc/ core/libyui/src/ qt/src/
by sh-sh-sh@svn.opensuse.org 26 Jun '07
by sh-sh-sh@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: sh-sh-sh
Date: Tue Jun 26 12:57:31 2007
New Revision: 39030
URL: http://svn.opensuse.org/viewcvs/yast?rev=39030&view=rev
Log:
cleaned up YWidget
Modified:
branches/tmp/sh/mod-ui/core/libyui/doc/Makefile.am
branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.cc
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc
branches/tmp/sh/mod-ui/core/libyui/src/YDumbTab.h
branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc
branches/tmp/sh/mod-ui/core/libyui/src/YLabel.cc
branches/tmp/sh/mod-ui/core/libyui/src/YLayoutBox.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h
branches/tmp/sh/mod-ui/qt/src/YQCheckBox.cc
branches/tmp/sh/mod-ui/qt/src/YQCheckBoxFrame.cc
branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc
branches/tmp/sh/mod-ui/qt/src/YQImage.cc
branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
branches/tmp/sh/mod-ui/qt/src/YQIntField.cc
branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.cc
branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc
branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.cc
branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc
branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc
branches/tmp/sh/mod-ui/qt/src/YQSlider.cc
branches/tmp/sh/mod-ui/qt/src/YQTable.cc
branches/tmp/sh/mod-ui/qt/src/YQTree.cc
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/doc/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/Makefile.am Tue Jun 26 12:57:31 2007
@@ -5,8 +5,7 @@
SUBDIRS = events examples FAQs
htmldir = $(docdir)/libyui
-builtin = $(srcdir)/../src/YUI_builtins.cc $(srcdir)/../src/YUI_widgets.cc \
- $(srcdir)/../src/YUI_special_widgets.cc
+builtin = $(srcdir)/../src/YUI_builtins.cc $(srcdir)/../src/YCPDialogParser.cc
builtinxml := $(builtin:%.cc=%.xml)
xmlfiles := $(foreach xml,$(builtinxml),$(notdir $(xml)))
htmlfiles = $(wildcard html/*.html)
@@ -39,8 +38,8 @@
html/yast2docs.css: html/index.html
cp @STYLESHEET_CSS@ html
cp -a `pkg-config --variable=yast2dir yast2-devtools`/data/docbook/images html
- cp -a $(srcdir)/examples html
- -find html -name .svn -type d -exec rm -rf '{}' \;
+ cp -a $(srcdir)/examples html
+ -find html -name .svn -type d -exec rm -rf '{}' \;
CLEANFILES = $(xmlfiles) output.xml
@@ -51,4 +50,4 @@
mkdir -p $(DESTDIR)$(htmldir)
cp -a $(srcdir)/html/images $(DESTDIR)$(htmldir)
cp -a $(srcdir)/examples $(DESTDIR)$(htmldir)
- -find $(DESTDIR)$(htmldir) -name .svn -type d -exec rm -rf '{}' \;
+ -find $(DESTDIR)$(htmldir) -name .svn -type d -exec rm -rf '{}' \;
Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Tue Jun 26 12:57:31 2007
@@ -36,7 +36,7 @@
The rationale for splitting up nicesize() (and giving it an English name, no
longer German_en) was that in 95% of all cases the first thing an
- implementation does is something like
+ implementation does is something like
if ( dim == YD_HORIZ )
// calculate width
@@ -71,8 +71,8 @@
* All widgets:
- Most 'long' function parameters and return values are now 'int',
- including (but not restricted to):
+ Most 'long' function parameters and return values are now 'int',
+ including (but not restricted to):
* widget sizes
* widget positions
@@ -127,7 +127,7 @@
* virtual void setValue( YCPBoolean ) -> virtual void setValue( bool )
* new method: useBoldFont() (instead of YWidgetOpt::boldFont() )
- * new method: boldFont()
+ * new method: boldFont()
* YTextEntry:
@@ -208,7 +208,7 @@
* changed nicesize() to preferredWidth() and preferredHeight(), both returning int, not long
see longer explanations on top
-
+
* virtual YWidget::setSize() now has int params, no longer long
see longer explanations on top
@@ -219,3 +219,24 @@
For YCP, TextEntry is (and will remain) still a valid widget name.
`InputField is the new default name, though.
+
+
+2007-06-26 12:00 sh(a)suse.de
+
+* Renamed YWidget::getNotify() -> YWidget::notify()
+ Replace with:
+
+ perl -p -i -e 's/getNotify/notify/g' *.cc pkg/*.c
+
+
+* Added function key methods for NCurses F-key support:
+
+ - YWidget::functionKey()
+ - YWidget::hasFunctionKey()
+ - virtual YWidget::setFunctionKey
+
+ Since YWidgetOpt is no longer passed to constructors, NCurses should use
+ those new functions instead.
+ YWidget::setFunctionKey() is called from YCPDialogParser after the widget is
+ created, so either use the new function in the keyboard handlers or overwrite
+ YWidget::setFunctionKey().
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.cc Tue Jun 26 12:57:31 2007
@@ -20,6 +20,7 @@
#define y2log_component "ui"
#include <ycp/y2log.h>
#include "YAlignment.h"
+#include "YBothDim.h"
using std::min;
@@ -29,8 +30,8 @@
/**
* Constructor.
**/
- YAlignmentPrivate( YAlignmentType hAlign,
- YAlignmentType vAlign )
+ YAlignmentPrivate( YAlignmentType horAlign,
+ YAlignmentType vertAlign )
: leftMargin(0)
, rightMargin(0)
, topMargin(0)
@@ -38,15 +39,14 @@
, minWidth(0)
, minHeight(0)
{
- alignment[ YD_HORIZ ] = hAlign;
- alignment[ YD_VERT ] = vAlign;
+ alignment.hor = horAlign;
+ alignment.vert = vertAlign;
}
//
// Data Members
//
-
int leftMargin;
int rightMargin;
int topMargin;
@@ -57,7 +57,7 @@
string backgroundPixmap;
- YAlignmentType alignment[ YUIAllDimensions ];
+ YBothDim<YAlignmentType> alignment;
};
@@ -213,20 +213,20 @@
}
- int newSize[ YUIAllDimensions ];
- newSize[ YD_HORIZ ] = newWidth;
- newSize[ YD_VERT ] = newHeight;
-
- int offset[ YUIAllDimensions ];
- offset[ YD_HORIZ ] = leftMargin();
- offset[ YD_VERT ] = topMargin();
-
- int totalMargin[ YUIAllDimensions ];
- totalMargin[ YD_HORIZ ] = leftMargin() + rightMargin();
- totalMargin[ YD_VERT ] = topMargin() + bottomMargin();
+ YBothDim<int> newSize;
+ newSize.hor = newWidth;
+ newSize.vert = newHeight;
+
+ YBothDim<int> offset;
+ offset.hor = leftMargin();
+ offset.vert = topMargin();
+
+ YBothDim<int> totalMargin;
+ totalMargin.hor = leftMargin() + rightMargin();
+ totalMargin.vert = topMargin() + bottomMargin();
- int newChildSize[ YUIAllDimensions ];
- int newChildPos [ YUIAllDimensions ];
+ YBothDim<int> newChildSize;
+ YBothDim<int> newChildPos;
for ( YUIDimension dim = YD_HORIZ; dim <= YD_VERT; dim = (YUIDimension) (dim+1) )
@@ -239,7 +239,7 @@
{
if ( firstChild()->stretchable( dim ) &&
( alignment( dim ) == YAlignUnchanged ||
- _stretch[ dim ] ) ) // special case: promote child stretchability if `opt(`?stretch) set
+ stretchable( dim ) ) ) // special case: promote child stretchability if `opt(`?stretch) set
{
newChildSize[ dim ] = newSize[ dim ] - totalMargin[ dim ];
}
@@ -293,13 +293,13 @@
newChildPos[ dim ] += offset[ dim ];
}
- firstChild()->setSize( newChildSize[ YD_HORIZ ], newChildSize[ YD_VERT ] );
- moveChild( firstChild(), newChildPos[ YD_HORIZ ], newChildPos[ YD_VERT ] );
+ firstChild()->setSize( newChildSize.hor, newChildSize.vert );
+ moveChild( firstChild(), newChildPos.hor, newChildPos.vert );
#if 0
- y2debug( "setSize( alignment, %ld, %ld )", newWidth, newHeight );
- y2debug( "setSize( child, %ld, %ld )", newChildSize[ YD_HORIZ ], newChildSize[ YD_VERT ] );
- y2debug( "moveChild( %ld, %ld) ", newChildPos[ YD_HORIZ ], newChildPos[ YD_VERT ] );
+ y2debug( "setSize( alignment, %d, %d )", newWidth, newHeight );
+ y2debug( "setSize( child, %d, %d )", newChildSize.hor, newChildSize.vert );
+ y2debug( "moveChild( %d, %d) ", newChildPos.hor, newChildPos.vert );
#endif
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Tue Jun 26 12:57:31 2007
@@ -36,6 +36,8 @@
#include "YUI_util.h"
#include "YWidgetFactory.h"
#include "YOptionalWidgetFactory.h"
+#include "YBothDim.h"
+
#include "YAlignment.h"
#include "YBarGraph.h"
@@ -143,7 +145,6 @@
else if ( sym == YUIOpt_vstretch ) opt.isVStretchable.setValue( true );
else if ( sym == YUIOpt_hvstretch ) { opt.isHStretchable.setValue( true ); opt.isVStretchable.setValue( true ); }
else if ( sym == YUIOpt_autoShortcut ) opt.autoShortcut.setValue( true );
- else if ( sym == YUIOpt_easterEgg ) opt.easterEgg.setValue( true );
else if ( sym == YUIOpt_testMode ) opt.testMode.setValue( true );
else if ( sym == YUIOpt_boldFont ) opt.boldFont.setValue( true );
else if ( sym == YUIOpt_keyEvents ) opt.keyEvents.setValue( true );
@@ -277,18 +278,25 @@
/*
* Note: Don't set the ID if it is already set!
- * This is important for createXy() functions that don't really create
+ * This is important for parseXy() functions that don't really create
* anything immediately but recursively call parseWidgetTreeTerm()
- * internally - e.g. createWeight(). In this case, the widget might
+ * internally - e.g. parseWeight(). In this case, the widget might
* already have an ID, so leave it alone.
+ *
+ * Otherwise, the ID that was specified for the Weight would be set
+ * on the Weight's child, which is not what the application
+ * programmer expects.
*/
}
- if ( opt.isDisabled.value() )
- w->setDisabled();
+ if ( opt.isDisabled.value() ) w->setDisabled();
+ if ( opt.notifyMode.value() ) w->setNotify( true );
+ if ( opt.keyEvents.value() ) w->setSendKeyEvents( true );
+ if ( opt.autoShortcut.value() ) w->setAutoShortcut( true );
+ if ( opt.isHStretchable.value() ) w->setStretchable( YD_HORIZ, true );
+ if ( opt.isVStretchable.value() ) w->setStretchable( YD_VERT, true );
+ if ( opt.key_Fxx.value() > 0 ) w->setFunctionKey( opt.key_Fxx.value() );
- if ( opt.notifyMode.value() )
- w->setNotify( true );
w->setParent(p);
}
@@ -393,9 +401,9 @@
term->name().c_str(),term->toString().c_str() );
return 0;
}
-
+
rejectAllOptions( term,optList );
-
+
return YUI::widgetFactory()->createEmpty( parent );
}
@@ -826,7 +834,7 @@
rejectAllOptions( term,optList );
YSquash * squash = YUI::widgetFactory()->createSquash( parent, horSquash, vertSquash );
parseWidgetTreeTerm( squash, term->value( argnr )->asTerm() );
-
+
return squash;
}
@@ -878,20 +886,20 @@
return 0;
}
rejectAllOptions( term,optList );
- int weightValue = term->value( argnr )->asInteger()->value();
+
+ // Create child widget tree
+ YWidget * child = parseWidgetTreeTerm( parent, term->value( argnr+1 )->asTerm() );
/*
* This is an exception from the general rule: No YWeight widget is created,
- * just the weight is passed as widget options to a newly created child widget.
+ * the weight is just set on the child widget.
* The YWeight widget is plain superfluos - YWidget can handle everything itself.
*/
- YWidgetOpt childOpt;
-
- if ( dim == YD_HORIZ ) childOpt.hWeight.setValue( weightValue );
- else childOpt.vWeight.setValue( weightValue );
+ int weight = term->value( argnr )->asInteger()->value();
+ child->setWeight( dim, weight );
- return parseWidgetTreeTerm( parent, childOpt, term->value( argnr+1 )->asTerm() );
+ return child;
}
@@ -1637,7 +1645,7 @@
}
string label = term->value( argnr )->asString()->value();
-
+
string initialValue;
if ( term->size() >= argnr + 2 )
initialValue = term->value( argnr+1 )->asString()->value();
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YComboBox.cc Tue Jun 26 12:57:31 2007
@@ -82,7 +82,7 @@
}
}
- /**
+ /**
* @property id_list Items
* The items that are displayed
*/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDumbTab.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDumbTab.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDumbTab.h Tue Jun 26 12:57:31 2007
@@ -41,12 +41,12 @@
virtual const char * widgetClass() { return "YDumbTab"; }
/**
- * Implements the UI::ChangeWidget()
+ * Implements UI::ChangeWidget()
**/
YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue );
/**
- * Implements the UI::QueryWidget()
+ * Implements UI::QueryWidget()
**/
YCPValue queryWidget( const YCPSymbol & property );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc Tue Jun 26 12:57:31 2007
@@ -132,9 +132,9 @@
if ( propSet.isEmpty() )
{
/*
- * @property string Value the field's contents (the user input)
- * @property string Label caption above the field
- * @property string ValidChars set of valid input characters
+ * @property string Value the input field's contents (the user input)
+ * @property string Label caption above the input field
+ * @property string ValidChars set of valid input characters
* @property integer InputMaxLength maximum number of input characters
*/
propSet.add( YProperty( YUIProperty_Value, YStringProperty ) );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YLabel.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YLabel.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YLabel.cc Tue Jun 26 12:57:31 2007
@@ -108,9 +108,9 @@
if ( propSet.isEmpty() )
{
/*
- * @property string Label the label text
- * @property boolean Value the label text (alias for Label)
- * @property boolean Text the label text (alias for Label)
+ * @property string Label the label text
+ * @property string Value the label text (alias for Label)
+ * @property string Text the label text (alias for Label)
*/
propSet.add( YProperty( YUIProperty_Label, YStringProperty ) );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YLayoutBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YLayoutBox.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YLayoutBox.cc Tue Jun 26 12:57:31 2007
@@ -513,11 +513,11 @@
* among them as fair as possible.
*/
- int tooSmall = -distributableSize;
- int loserCount = 0;
- int totalMargins = 0L;
- int remainingMargins = 0L;
- double marginScale = 0.0;
+ int tooSmall = -distributableSize;
+ int loserCount = 0;
+ int totalMargins = 0L;
+ int remainingMargins = 0L;
+ double marginScale = 0.0;
y2debug ( "Not enough space - %d too small - check the layout!", tooSmall );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc Tue Jun 26 12:57:31 2007
@@ -869,7 +869,7 @@
YPropertySet propSet = widget->propertySet();
- if ( propSet.size() == 6 ) // unchanged from YWidget, no properties supported
+ if ( propSet.size() == 5 ) // unchanged from YWidget, no properties supported
{
// FIXME: Get rid of this
// FIXME: Get rid of this
@@ -984,7 +984,7 @@
YPropertySet propSet = widget->propertySet();
YCPSymbol sym = property->asSymbol();
- if ( propSet.size() == 6 ) // unchanged from YWidget, no properties supported
+ if ( propSet.size() == 5 ) // unchanged from YWidget, no properties supported
{
// FIXME: Get rid of this
// FIXME: Get rid of this
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc Tue Jun 26 12:57:31 2007
@@ -35,6 +35,7 @@
#include "YDialog.h"
#include "YUIException.h"
#include "YWidgetID.h"
+#include "YBothDim.h"
#include "YChildrenManager.h"
@@ -56,9 +57,17 @@
, beingDestroyed( false )
, enabled( true )
, notify( false )
+ , sendKeyEvents( false )
+ , autoShortcut( false )
, toolkitWidgetRep( 0 )
, id( 0 )
- {}
+ , functionKey( 0 )
+ {
+ stretch.hor = false;
+ stretch.vert = false;
+ weight.hor = 0;
+ weight.vert = 0;
+ }
//
// Data members
@@ -70,35 +79,24 @@
bool beingDestroyed;
bool enabled;
bool notify;
+ bool sendKeyEvents;
+ bool autoShortcut;
void * toolkitWidgetRep;
YWidgetID * id;
+ YBothDim<bool> stretch;
+ YBothDim<int> weight;
+ int functionKey;
};
-int YWidget::next_internal_widget_id = 0;
-
// FIXME: Obsolete
// FIXME: Obsolete
// FIXME: Obsolete
YWidget::YWidget( const YWidgetOpt & opt )
: priv( new YWidgetPrivate( new YWidgetChildrenRejector( this ) ) )
- , user_widget_id( YCPNull() )
- , windowID( -1 )
{
- internal_widget_id = next_internal_widget_id++;
- enabled = ! opt.isDisabled.value();
- notify = opt.notifyMode.value();
- _sendKeyEvents = opt.keyEvents.value();
- _autoShortcut = opt.autoShortcut.value();
- _stretch[ YD_HORIZ ] = opt.isHStretchable.value();
- _stretch[ YD_VERT ] = opt.isVStretchable.value();
- _weight[ YD_HORIZ ] = opt.hWeight.value();
- _weight[ YD_VERT ] = opt.vWeight.value();
-
- if ( ! enabled ) setDisabled();
- if ( notify ) setNotify( notify );
}
// FIXME: Obsolete
// FIXME: Obsolete
@@ -108,23 +106,10 @@
YWidget::YWidget( YWidget * parent )
: priv( new YWidgetPrivate( new YWidgetChildrenRejector( this ), parent ) )
- , user_widget_id( YCPNull() )
- , windowID( -1 )
{
YUI_CHECK_NEW( priv );
YUI_CHECK_NEW( priv->childrenManager );
- internal_widget_id = next_internal_widget_id++;
-
- enabled = true;
- notify = false;
- _sendKeyEvents = false;
- _autoShortcut = false;
- _stretch[ YD_HORIZ ] = false;
- _stretch[ YD_VERT ] = false;
- _weight [ YD_HORIZ ] = 0;
- _weight [ YD_VERT ] = 0;
-
if ( parent )
parent->addChild( this );
}
@@ -262,6 +247,48 @@
}
+bool YWidget::sendKeyEvents() const
+{
+ return priv->sendKeyEvents;
+}
+
+
+void YWidget::setSendKeyEvents( bool doSend )
+{
+ priv->sendKeyEvents = doSend;
+}
+
+
+bool YWidget::autoShortcut() const
+{
+ return priv->autoShortcut;
+}
+
+
+void YWidget::setAutoShortcut( bool newAutoShortcut )
+{
+ priv->autoShortcut = newAutoShortcut;
+}
+
+
+int YWidget::functionKey() const
+{
+ return priv->functionKey;
+}
+
+
+bool YWidget::hasFunctionKey() const
+{
+ return priv->functionKey > 0;
+}
+
+
+void YWidget::setFunctionKey( int fkey_no )
+{
+ priv->functionKey = fkey_no;
+}
+
+
YWidgetID *
YWidget::id() const
{
@@ -311,9 +338,16 @@
if ( propSet.isEmpty() )
{
+ /**
+ * @property boolean Enabled enabled/disabled state of this widget
+ * @property boolean Notify the current notify state (see also `opt( `notify ))
+ * @property string WidgetClass the widget class of this widget (YLabel, YPushButton, ...)
+ * @property string DebugLabel (possibly translated) text describing this widget for debugging
+ * @property string DialogDebugLabel (possibly translated) text describing this dialog for debugging
+ **/
+
propSet.add( YProperty( YUIProperty_Enabled, YBoolProperty ) );
propSet.add( YProperty( YUIProperty_Notify, YBoolProperty ) );
- propSet.add( YProperty( YUIProperty_WindowID, YIntegerProperty) );
propSet.add( YProperty( YUIProperty_WidgetClass, YStringProperty, true ) ); // read-only
propSet.add( YProperty( YUIProperty_DebugLabel, YStringProperty, true ) ); // read-only
propSet.add( YProperty( YUIProperty_DialogDebugLabel, YStringProperty, true ) ); // read-only
@@ -355,7 +389,7 @@
}
if ( propertyName == YUIProperty_Enabled ) return YPropertyValue( isEnabled() );
- if ( propertyName == YUIProperty_Notify ) return YPropertyValue( getNotify() );
+ if ( propertyName == YUIProperty_Notify ) return YPropertyValue( notify() );
if ( propertyName == YUIProperty_WidgetClass ) return YPropertyValue( widgetClass() );
if ( propertyName == YUIProperty_DebugLabel ) return YPropertyValue( debugLabel() );
if ( propertyName == YUIProperty_DialogDebugLabel )
@@ -409,13 +443,13 @@
void YWidget::setNotify( bool notify )
{
- this->notify = notify;
+ priv->notify = notify;
}
-bool YWidget::getNotify() const
+bool YWidget::notify() const
{
- return notify;
+ return priv->notify;
}
@@ -435,31 +469,37 @@
void YWidget::setStretchable( YUIDimension dim, bool newStretch )
{
- _stretch[ dim ] = newStretch;
+ priv->stretch[ dim ] = newStretch;
}
void YWidget::setDefaultStretchable( YUIDimension dim, bool newStretch )
{
- _stretch[ dim ] |= newStretch;
+ priv->stretch[ dim ] |= newStretch;
}
bool YWidget::stretchable( YUIDimension dim ) const
{
- return _stretch[ dim ];
+ return priv->stretch[ dim ];
}
int YWidget::weight( YUIDimension dim )
{
- return _weight[ dim ];
+ return priv->weight[ dim ];
+}
+
+
+void YWidget::setWeight( YUIDimension dim, int weight )
+{
+ priv->weight[ dim ] = weight;
}
bool YWidget::hasWeight( YUIDimension dim )
{
- // DO NOT simply return _weight[ dim ] here
+ // DO NOT simply return priv->weight[ dim ] here
// since weight() might be overwritten in derived classes!
return weight( dim ) > 0;
@@ -700,25 +740,19 @@
return YCPBoolean( false ); // Error
}
- /*
- * @property boolean Enabled the current enabled/disabled state
- */
if ( symbol == YUIProperty_Enabled )
{
if ( newvalue->isBoolean() )
{
bool e = newvalue->asBoolean()->value();
setEnabled(e);
- enabled = e;
+ priv->enabled = e;
return YCPBoolean( true );
}
else y2error( "Wrong argument %s for widget property `Enabled - boolean expected.",
newvalue->toString().c_str() );
}
- /*
- * @property boolean Notify the current notify state (see also `opt( `notify ))
- */
if ( symbol == YUIProperty_Notify )
{
if ( newvalue->isBoolean() )
@@ -745,21 +779,11 @@
YCPValue YWidget::queryWidget( const YCPSymbol & property )
{
string symbol = property->symbol();
-
+
if ( symbol == YUIProperty_Enabled ) return YCPBoolean( isEnabled() );
- if ( symbol == YUIProperty_Notify ) return YCPBoolean( getNotify() );
- if ( symbol == YUIProperty_WindowID ) return YCPInteger( windowID );
- /**
- * @property string WidgetClass the widget class of this widget (YLabel, YPushButton, ...)
- */
+ if ( symbol == YUIProperty_Notify ) return YCPBoolean( notify() );
if ( symbol == YUIProperty_WidgetClass ) return YCPString( widgetClass() );
- /**
- * @property string DebugLabel a (possibly translated) text describing this widget for debugging
- */
if ( symbol == YUIProperty_DebugLabel ) return YCPString( debugLabel() );
- /**
- * @property string DialogDebugLabel a (possibly translated) text describing this dialog for debugging
- */
if ( symbol == YUIProperty_DialogDebugLabel )
{
return YDialog::currentDialog()->queryWidget( property );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h Tue Jun 26 12:57:31 2007
@@ -296,7 +296,7 @@
* The sizes passed here are not meant to affect any future
* preferredWidth() or preferredHeight() calls; they are just the outcome
* of all kinds of compromises (too little screen space or too much) for
- * the current geometry management calculation.
+ * the current geometry management calculation.
*
* Derived classes are required to implement this function.
**/
@@ -370,27 +370,13 @@
virtual bool isEnabled() const;
-
-
-
-
-
-
-
- /**
- * Return the widget serial number (the internal widget ID).
- **/
- int internalId() const { return internal_widget_id; }
-
/**
* This is a boolean value that determines whether the widget is resizable
* beyond its nice size in the specified dimension. A selection box is
* stretchable in both dimensions, a push button is not stretchable by
* default, a frame is stretchable if its contents are stretchable. Most
- * widgets accept a `hstretch or `vstretch option to become stretchable even
- * when they are not by default.
- *
- * @param dim Dimension, either YD_HORIZ or YD_VERT
+ * widgets accept a `hstretch or `vstretch option to become stretchable
+ * even when by default they are not.
**/
virtual bool stretchable( YUIDimension dim ) const;
@@ -406,22 +392,28 @@
**/
void setDefaultStretchable( YUIDimension dim, bool newStretch );
-
/**
* The weight is used in situations where all widgets can get there nice
* size and yet space is available. The remaining space will be devided
- * between all stretchable widgets according to their weights. A widget with
- * greater weight will get more space. The default weight for all widgets
- * is 0.
+ * between all stretchable widgets according to their weights. A widget
+ * with greater weight will get more space. The default weight for all
+ * widgets is 0.
*
- * @param dim Dimension, either YD_HORIZ or YD_VERT
+ * Derived classes can overwrite this function, but they should call this
+ * base class function in the new function.
**/
virtual int weight( YUIDimension dim );
/**
- * Return whether or not the widget has a weight.
+ * Return whether or not the widget has a weight in the specified
+ * dimension.
+ **/
+ bool hasWeight( YUIDimension dim );
+
+ /**
+ * Set a weight in the specified dimension.
**/
- virtual bool hasWeight( YUIDimension dim );
+ void setWeight( YUIDimension dim, int weight );
/**
* Sets the Notify property
@@ -432,62 +424,67 @@
* Returns whether the widget will notify, i.e. will case UserInput to
* return.
**/
- bool getNotify() const;
+ bool notify() const;
/**
* Returns 'true' if this widget should send key events, i.e. if it has
* `opt(`keyEvent) set.
**/
- bool sendKeyEvents() const { return _sendKeyEvents; }
+ bool sendKeyEvents() const;
/**
* Specify whether or not this widget should send key events.
**/
- void setSendKeyEvents( bool doSend ) { _sendKeyEvents = doSend; }
+ void setSendKeyEvents( bool doSend );
/**
* Returns 'true' if a keyboard shortcut should automatically be assigned
* to this widget - without complaints in the log file.
**/
- bool autoShortcut() const { return _autoShortcut; }
+ bool autoShortcut() const;
/**
* Sets the 'autoShortcut' flag.
**/
- void setAutoShortcut( bool _newAutoShortcut ) { _autoShortcut = _newAutoShortcut; }
+ void setAutoShortcut( bool _newAutoShortcut );
/**
- * Implements the ui command ChangeWidget. Implement this method in your
- * widget subclass and handle their all properties special to that widget.
- * If you encounter an unknown property, call YWidget::changeWidget
+ * Return a function key number that is assigned to this widget.
+ * (1 for F1, 2 for F2, etc.; 0 for none)
**/
- virtual YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue );
+ int functionKey() const;
/**
- * Implements the ui command ChangeWidget in the incarnation, where the
- * property is given in form of a term rather than a symbol. Implement this
- * method in your widget subclass and handle their all properties special to
- * that widget.
+ * Check if a function key is assigned to this widget.
+ **/
+ bool hasFunctionKey() const;
+
+ /**
+ * Assign a function key to this widget
+ * (1 for F1, 2 for F2, etc.; 0 for none)
*
- * If you encounter an unknown property, call YWidget::changeWidget
+ * Derived classes may want to overwrite this function, but they should
+ * call this base class function in the new function.
**/
+ virtual void setFunctionKey( int fkey_no );
+
+
+
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ virtual YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue );
+
virtual YCPValue changeWidgetTerm( const YCPTerm & property, const YCPValue & newvalue );
- /**
- * Implements the ui command QueryWidget. Implement this method in your
- * widget subclass and handle their all properties special to that widget.
- * If you encounter an unknown property, call YWidget::queryWidget
- **/
virtual YCPValue queryWidget( const YCPSymbol & property );
- /**
- * Implements the ui command QueryWidget in the incarnation, where the property
- * is given in form of a term rather than a symbol. Implement this method in your
- * widget subclass and handle their all properties special to that widget.
- * If you encounter an unknown property, call YWidget::queryWidget
- **/
virtual YCPValue queryWidgetTerm( const YCPTerm & property );
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+ // FIXME: Obsolete
+
/**
* Set the keyboard focus to this widget.
* The default implementation just emits a warning message.
@@ -569,18 +566,11 @@
/**
* In some UIs updating the screen content is an expensive operation. Use
- * startMultipleChanges() to tell the ui that you're going to perform multiple
- * chages to the widget.
- * The UI may delay any screen updates until doneMultipleChanges() is called.
+ * startMultipleChanges() to tell the ui that you're going to perform
+ * multiple chages to the widget. The UI may delay any screen updates
+ * until doneMultipleChanges() is called.
**/
virtual void startMultipleChanges() {}
-
- /**
- * In some UIs updating the screen content is an expensive operation. Use
- * startMultipleChanges() to tell the ui that you're going to perform multiple
- * chages to the widget.
- * The UI may delay any screen updates until doneMultipleChanges() is called.
- **/
virtual void doneMultipleChanges() {}
@@ -639,74 +629,6 @@
-protected:
-
- /**
- * The user provided widget id of this widget -
- * strictly for user purposes. May or may not be set.
- * May or may not be unique.
- **/
- YCPValue user_widget_id;
-
- /**
- * The internal unique widget id of this widget.
- * Used to compare widget identity.
- **/
- int internal_widget_id;
-
- /**
- * The next internal widget id to be used for the next object of
- * this class. Initialized in YWidget.cc.
- **/
- static int next_internal_widget_id;
-
- /**
- * Flag: Can this widget currently receive user input?
- **/
- bool enabled;
-
- /**
- * Flag: Make UserInput() return on detailed events?
- **/
- bool notify;
-
- /**
- * Flag: Make UserInput() return on single key events?
- **/
- bool _sendKeyEvents;
-
- /**
- * Flag: Automatically assign a keyboard shortcut without complaints in the
- * log file?
- **/
- bool _autoShortcut;
-
- /**
- * Stretchability in both dimensions.
- **/
- bool _stretch [ YUIAllDimensions ];
-
- /**
- * Weight in both dimensions.
- **/
- int _weight [ YUIAllDimensions ];
-
- /**
- * window ID of the current widget
- **/
- long windowID;
-
-
-
-
-
-
-
-
-
-
-
-
// FIXME: Get this stuff out of here - it is utterly out of place
// FIXME: Get this stuff out of here - it is utterly out of place
// FIXME: Get this stuff out of here - it is utterly out of place
@@ -720,8 +642,8 @@
class OptimizeChanges
{
public:
- OptimizeChanges( YWidget & w ) : yw(w) { yw.startMultipleChanges(); }
- ~OptimizeChanges() { yw.doneMultipleChanges(); }
+ OptimizeChanges( YWidget & w ) : yw(w) { yw.startMultipleChanges(); }
+ ~OptimizeChanges() { yw.doneMultipleChanges(); }
private:
OptimizeChanges( const OptimizeChanges & ); // no copy
void operator=( const OptimizeChanges & ); // no assign
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h Tue Jun 26 12:57:31 2007
@@ -126,13 +126,9 @@
YBoolOpt autoShortcut;
YBoolOpt autoAdvance;
YBoolOpt keyEvents;
- YBoolOpt easterEgg;
YBoolOpt testMode;
YBoolOpt boldFont; // YCheckBox, YRadioButton, YLabel
- YLongOpt hWeight; // from YUIInterpreter::createWeight()
- YLongOpt vWeight; // from YUIInterpreter::createWeight()
-
// Widget-specific options
//
Modified: branches/tmp/sh/mod-ui/qt/src/YQCheckBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQCheckB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQCheckBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQCheckBox.cc Tue Jun 26 12:57:31 2007
@@ -152,7 +152,7 @@
{
// y2milestone( "new state: %d", newState );
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQCheckBoxFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQCheckB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQCheckBoxFrame.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQCheckBoxFrame.cc Tue Jun 26 12:57:31 2007
@@ -138,7 +138,7 @@
y2debug( "new state: %d", newState );
handleChildrenEnablement( newState );
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQComboB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQComboBox.cc Tue Jun 26 12:57:31 2007
@@ -219,7 +219,7 @@
void YQComboBox::slotSelected( int i )
{
- if ( getNotify() )
+ if ( notify() )
{
if ( ! YQUI::ui()->eventPendingFor( this ) )
{
@@ -233,7 +233,7 @@
void YQComboBox::textChanged( const QString & new_text )
{
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQImage.…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQImage.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQImage.cc Tue Jun 26 12:57:31 2007
@@ -101,7 +101,6 @@
_animated = opt.animated.value();
_tiled = opt.tiled.value();
setScaledContents( opt.scaleToFit.value() );
- windowID = winId();
_pixmapHeight = 0;
_pixmapWidth = 0;
Modified: branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQInputF…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQInputField.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQInputField.cc Tue Jun 26 12:57:31 2007
@@ -203,7 +203,7 @@
void YQInputField::changed( const QString & )
{
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQIntField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQIntFie…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQIntField.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQIntField.cc Tue Jun 26 12:57:31 2007
@@ -113,7 +113,7 @@
{
setValue( newValue );
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMultiL…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.cc Tue Jun 26 12:57:31 2007
@@ -175,7 +175,7 @@
_qt_textedit->setCursorPosition( para, index-1 );
}
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMultiS…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMultiSelectionBox.cc Tue Jun 26 12:57:31 2007
@@ -257,7 +257,7 @@
void
YQMultiSelectionBox::slotSelected()
{
- if ( getNotify() )
+ if ( notify() )
{
if ( ! YQUI::ui()->eventPendingFor( this ) )
{
@@ -272,7 +272,7 @@
void
YQMultiSelectionBox::slotValueChanged()
{
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQPartit…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQPartitionSplitter.cc Tue Jun 26 12:57:31 2007
@@ -208,7 +208,7 @@
setValue( newPartSize );
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
@@ -221,7 +221,7 @@
else
setValue( newPartSize );
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQRadioB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc Tue Jun 26 12:57:31 2007
@@ -146,7 +146,7 @@
void YQRadioButton::changed( bool newState )
{
- if ( getNotify() && newState )
+ if ( notify() && newState )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSelect…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSelectionBox.cc Tue Jun 26 12:57:31 2007
@@ -67,7 +67,7 @@
_shrinkable = opt.isShrinkable.value();
_immediateMode = opt.immediateMode.value();
- if ( getNotify() )
+ if ( notify() )
{
connect( _qt_listbox, SIGNAL( highlighted ( int ) ),
this, SLOT ( slotSelected( int ) ) );
Modified: branches/tmp/sh/mod-ui/qt/src/YQSlider.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSlider…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSlider.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSlider.cc Tue Jun 26 12:57:31 2007
@@ -124,7 +124,7 @@
{
setValue( newValue );
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQTable.…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQTable.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQTable.cc Tue Jun 26 12:57:31 2007
@@ -269,7 +269,7 @@
void YQTable::slotSelected( QListViewItem * )
{
- if ( getNotify() )
+ if ( notify() )
{
if ( ! YQUI::ui()->eventPendingFor( this ) )
{
@@ -283,7 +283,7 @@
void YQTable::slotActivated( QListViewItem * )
{
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::Activated ) );
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQTree.c…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQTree.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQTree.cc Tue Jun 26 12:57:31 2007
@@ -196,13 +196,13 @@
void YQTree::slotSelected( void )
{
- if ( getNotify() && ! YQUI::ui()->eventPendingFor( this ) )
+ if ( notify() && ! YQUI::ui()->eventPendingFor( this ) )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::SelectionChanged ) );
}
void YQTree::slotActivated( void )
{
- if ( getNotify() )
+ if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::Activated ) );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39029 - in /trunk/storage: package/yast2-storage.changes storage/src/include/do_proposal_flexible.ycp
by fehr@svn.opensuse.org 26 Jun '07
by fehr@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: fehr
Date: Tue Jun 26 10:58:49 2007
New Revision: 39029
URL: http://svn.opensuse.org/viewcvs/yast?rev=39029&view=rev
Log:
add windows default mount points also in VM proposal (#262417)
Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/do_proposal_flexible.ycp
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.ch…
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Tue Jun 26 10:58:49 2007
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Jun 26 10:57:56 CEST 2007 - fehr(a)suse.de
+
+- add windows default mount points also in VM proposal (#262417)
+
+-------------------------------------------------------------------
Mon Jun 25 17:41:27 CEST 2007 - fehr(a)suse.de
- fixed problem mounting filesystem in inst-sys (#286686)
Modified: trunk/storage/storage/src/include/do_proposal_flexible.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/do_p…
==============================================================================
--- trunk/storage/storage/src/include/do_proposal_flexible.ycp (original)
+++ trunk/storage/storage/src/include/do_proposal_flexible.ycp Tue Jun 26 10:58:49 2007
@@ -3043,7 +3043,16 @@
{
foreach( string s, map disk, target,
``{
- target[s,"partitions"] = remove_keys( target[s,"partitions"]:[],
+ target[s,"partitions"] =
+ maplist( map p, target[s,"partitions"]:[],
+ ``{
+ if( haskey( p, "mount" ) &&
+ search( p["mount"]:"", "/windows/" )!=0 &&
+ search( p["mount"]:"", "/dos/" )!=0 )
+ p = remove( p, "mount" );
+ return( p );
+ });
+ remove_keys( target[s,"partitions"]:[],
[ "mount" ] );
});
return( target );
@@ -3786,6 +3795,7 @@
Storage::ActivateEvms();
target = Storage::GetTargetMap();
}
+ y2milestone( "target:%1", target );
ret = get_inst_prop_vm( target, vg );
}
return( ret );
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
26 Jun '07
Author: kkaempf
Date: Tue Jun 26 09:37:50 2007
New Revision: 39028
URL: http://svn.opensuse.org/viewcvs/yast?rev=39028&view=rev
Log:
install WFM.h so workflow manager can be properly instantiated
when linking to other code.
Modified:
trunk/core/wfm/src/Makefile.am
Modified: trunk/core/wfm/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/wfm/src/Makefile.am?rev=390…
==============================================================================
--- trunk/core/wfm/src/Makefile.am (original)
+++ trunk/core/wfm/src/Makefile.am Tue Jun 26 09:37:50 2007
@@ -42,6 +42,5 @@
wfminclude_HEADERS = \
Y2WFMComponent.h \
- WFMSubAgent.h
-
-
+ WFMSubAgent.h \
+ WFM.h
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39027 - /branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h
by sh-sh-sh@svn.opensuse.org 25 Jun '07
by sh-sh-sh@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: sh-sh-sh
Date: Mon Jun 25 19:33:17 2007
New Revision: 39027
URL: http://svn.opensuse.org/viewcvs/yast?rev=39027&view=rev
Log:
fixed doc
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h Mon Jun 25 19:33:17 2007
@@ -168,7 +168,7 @@
// YDialog-specific options
//
// These are multiplexed into YWidgetOpt since YDialog inherits
- // YContainerWidget which in turn inherits YWidget.
+ // YSingleChildContainerWidget which in turn inherits YWidget.
YBoolOpt hasDefaultSize;
YBoolOpt hasWarnColor;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39026 - in /branches/tmp/sh/mod-ui: core/libyui/src/ qt/src/
by sh-sh-sh@svn.opensuse.org 25 Jun '07
by sh-sh-sh@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: sh-sh-sh
Date: Mon Jun 25 19:31:30 2007
New Revision: 39026
URL: http://svn.opensuse.org/viewcvs/yast?rev=39026&view=rev
Log:
ported squash
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YBothDim.h
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YSquash.cc
branches/tmp/sh/mod-ui/core/libyui/src/YSquash.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/YQSquash.cc
branches/tmp/sh/mod-ui/qt/src/YQSquash.h
branches/tmp/sh/mod-ui/qt/src/YQUI.h
branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YBothDim.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YBothDim.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YBothDim.h Mon Jun 25 19:31:30 2007
@@ -71,6 +71,22 @@
// never reached (but gcc will complain otherwise)
return hor;
}
+
+ /**
+ * Same as above for const objects
+ **/
+ const T & operator[]( YUIDimension dim ) const
+ {
+ switch ( dim )
+ {
+ case YD_HORIZ: return hor;
+ case YD_VERT: return vert;
+ default: YUI_THROW( YUIInvalidDimensionException() );
+ }
+
+ // never reached (but gcc will complain otherwise)
+ return hor;
+ }
};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Mon Jun 25 19:31:30 2007
@@ -38,10 +38,13 @@
#include "YOptionalWidgetFactory.h"
#include "YAlignment.h"
+#include "YBarGraph.h"
#include "YCheckBoxFrame.h"
#include "YComboBox.h"
+#include "YDumbTab.h"
#include "YEmpty.h"
#include "YFrame.h"
+#include "YInputField.h"
#include "YLabel.h"
#include "YLayoutBox.h"
#include "YMenuButton.h"
@@ -52,10 +55,8 @@
#include "YReplacePoint.h"
#include "YSelectionBox.h"
#include "YSpacing.h"
-#include "YDumbTab.h"
-#include "YBarGraph.h"
+#include "YSquash.h"
#include "YTable.h"
-#include "YInputField.h"
#include "YTree.h"
using std::string;
@@ -802,7 +803,7 @@
* You can used this for example to reverse the effect of
* <tt>`Left</tt> making a widget stretchable. If you want to make a VBox
* containing for left aligned CheckBoxes, but want the VBox itself to be
- * nonstretchable and centered, than you enclose each CheckBox with a
+ * non-stretchable and centered, than you enclose each CheckBox with a
* <tt>`Left( .. )</tt> and the whole VBox with a <tt>HSquash( ... )</tt>.
*
*
@@ -811,7 +812,7 @@
YWidget *
YCPDialogParser::parseSquash( YWidget * parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
- bool hSquash, bool vSquash )
+ bool horSquash, bool vertSquash )
{
if ( term->size() != argnr+1 ||
term->value( argnr ).isNull() ||
@@ -823,18 +824,9 @@
}
rejectAllOptions( term,optList );
- YContainerWidget *squash = YUI::ui()->createSquash( parent, opt, hSquash, vSquash );
-
- if ( squash )
- {
- squash->setParent( parent );
- YWidget *child = parseWidgetTreeTerm( squash, term->value( argnr )->asTerm() );
- if ( ! child )
- {
- delete squash;
- return 0;
- }
- }
+ YSquash * squash = YUI::widgetFactory()->createSquash( parent, horSquash, vertSquash );
+ parseWidgetTreeTerm( squash, term->value( argnr )->asTerm() );
+
return squash;
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSquash.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSquash.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSquash.cc Mon Jun 25 19:31:30 2007
@@ -17,16 +17,51 @@
/-*/
#include "YSquash.h"
+#include "YBothDim.h"
-YSquash::YSquash( const YWidgetOpt & opt, bool hsquash, bool vsquash )
- : YContainerWidget( opt )
+
+struct YSquashPrivate
+{
+ /**
+ * Constructor.
+ **/
+ YSquashPrivate( bool horSquash, bool vertSquash )
+ {
+ squash.hor = horSquash;
+ squash.vert = vertSquash;
+ }
+
+ YBothDim<bool> squash;
+};
+
+
+YSquash::YSquash( YWidget * parent, bool horSquash, bool vertSquash )
+ : YSingleChildContainerWidget( parent )
+ , priv( new YSquashPrivate( horSquash, vertSquash ) )
+{
+}
+
+
+YSquash::~YSquash()
+{
+ // NOP
+}
+
+
+bool YSquash::horSquash() const
+{
+ return priv->squash.hor;
+}
+
+
+bool YSquash::vertSquash() const
{
- squash[ YD_HORIZ ] = hsquash;
- squash[ YD_VERT ] = vsquash;
+ return priv->squash.vert;
}
+
bool YSquash::stretchable( YUIDimension dim ) const
{
- return ! squash[ dim ] && firstChild()->stretchable( dim );
+ return ! priv->squash[ dim ] && firstChild()->stretchable( dim );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSquash.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSquash.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSquash.h Mon Jun 25 19:31:30 2007
@@ -19,19 +19,35 @@
#ifndef YSquash_h
#define YSquash_h
-#include "YContainerWidget.h"
+#include "YSingleChildContainerWidget.h"
+#include "ImplPtr.h"
+
+
+class YSquashPrivate;
/**
- * @short Implementation of the HSquash, VSquash and HVSquash widgets
+ * HSquash, VSquash HVSquash:
+ *
+ * Squash is a widget that "squashes" its one child during layout, i.e., it
+ * reduces it in size down to its preferred size. It may squash vertically,
+ * horizontally or in both dimensions.
**/
-class YSquash : public YContainerWidget
+class YSquash : public YSingleChildContainerWidget
{
public:
/**
- * Constructor
+ * Constructor.
+ *
+ * Squashes horizontally if 'horSquash' is 'true',
+ * vertically if 'vertSquash' is 'true'.
**/
- YSquash( const YWidgetOpt & opt, bool hsquash, bool vsquash );
+ YSquash( YWidget * parent, bool horSquash, bool vertSquash );
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YSquash();
/**
* Returns a descriptive name of this widget class for logging,
@@ -40,18 +56,26 @@
virtual const char * widgetClass() { return "YSquash"; }
/**
+ * Returns 'true' if this widget squashes horizontally.
+ **/
+ bool horSquash() const;
+
+ /**
+ * Returns 'true' if this widget squashes vertically.
+ **/
+ bool vertSquash() const;
+
+
+ /**
* In a squashed dimension the widget NOT stretchable.
* In an unsquashed dimension the widget is stretchable if the
* child is stretchable.
**/
bool stretchable( YUIDimension dim ) const;
+private:
-protected:
- /**
- * In which dimensions to squash the contained widget.
- **/
- bool squash[ YUIAllDimensions ];
+ ImplPtr<YSquashPrivate> priv;
};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Mon Jun 25 19:31:30 2007
@@ -439,7 +439,6 @@
// FIXME: Obsolete
public:
virtual YDialog *createDialog( YWidgetOpt & opt ) = 0;
- virtual YContainerWidget *createSquash( YWidget *parent, YWidgetOpt & opt, bool hsquash, bool vsquash ) = 0;
virtual YWidget *createRichText( YWidget *parent, YWidgetOpt & opt, const YCPString & text ) = 0;
virtual YWidget *createLogView( YWidget *parent, YWidgetOpt & opt, const YCPString & label, int visibleLines, int maxLines ) = 0;
virtual YWidget *createMenuButton( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h Mon Jun 25 19:31:30 2007
@@ -152,7 +152,7 @@
YSquash * createHSquash ( YWidget * parent );
YSquash * createVSquash ( YWidget * parent );
YSquash * createHVSquash ( YWidget * parent );
- virtual YSquash * createSquash ( YWidget * parent, bool hSquash, bool vSquash ) = 0;
+ virtual YSquash * createSquash ( YWidget * parent, bool horSquash, bool vertSquash ) = 0;
//
// Visual Grouping
Modified: branches/tmp/sh/mod-ui/qt/src/YQSquash.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSquash…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSquash.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSquash.cc Mon Jun 25 19:31:30 2007
@@ -19,17 +19,23 @@
#include "YQSquash.h"
-YQSquash::YQSquash( QWidget * parent,
- const YWidgetOpt & opt,
- bool horSquash,
- bool vertSquash )
- : QWidget( parent )
- , YSquash( opt, horSquash, vertSquash )
+
+YQSquash::YQSquash( YWidget * parent,
+ bool horSquash,
+ bool vertSquash )
+ : QWidget( (QWidget *) parent->widgetRep() )
+ , YSquash( parent, horSquash, vertSquash )
{
setWidgetRep( this );
}
+YQSquash::~YQSquash()
+{
+ // NOP
+}
+
+
void YQSquash::setEnabled( bool enabled )
{
QWidget::setEnabled( enabled );
Modified: branches/tmp/sh/mod-ui/qt/src/YQSquash.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSquash…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSquash.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSquash.h Mon Jun 25 19:31:30 2007
@@ -35,14 +35,19 @@
/**
* Constructor.
**/
- YQSquash( QWidget * parent, const YWidgetOpt & opt, bool horSquash, bool vertSquash );
+ YQSquash( YWidget * parent, bool horSquash, bool vertSquash );
/**
- * Inherited from YWidget: Sets the enabled state of the
- * widget. All new widgets are enabled per definition. Only
- * enabled widgets can take user input.
+ * Destructor.
**/
- void setEnabled( bool enabled );
+ virtual ~YQSquash();
+
+ /**
+ * Set enabled/disabled state.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setEnabled( bool enabled );
/**
* Set the new size of the widget.
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI.h?r…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Mon Jun 25 19:31:30 2007
@@ -444,7 +444,6 @@
/*** Widget creation methods, all reimplemented from YUI ***/
- YContainerWidget * createSquash ( YWidget * parent, YWidgetOpt & opt, bool horSquash, bool vertSquash);
YContainerWidget * createWeight ( YWidget * parent, YWidgetOpt & opt, YUIDimension dim, long weight);
YWidget * createCheckBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, bool checked);
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI_wid…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Mon Jun 25 19:31:30 2007
@@ -54,15 +54,6 @@
-YContainerWidget * YQUI::createSquash ( YWidget * parent,
- YWidgetOpt & opt,
- bool hsquash,
- bool vsquash )
-{
- return new YQSquash( ( (QWidget *)parent->widgetRep() ), opt, hsquash, vsquash);
-}
-
-
bool YQUI::hasDate()
{
return true;
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidget…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc Mon Jun 25 19:31:30 2007
@@ -298,9 +298,12 @@
YQSquash *
-YQWidgetFactory::createSquash( YWidget * parent, bool hSquash, bool vSquash )
+YQWidgetFactory::createSquash( YWidget * parent, bool horSquash, bool vertSquash )
{
- return 0; // FIXME: TO DO
+ YQSquash * squash = new YQSquash( parent, horSquash, vertSquash );
+ YUI_CHECK_NEW( squash );
+
+ return squash;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidget…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h Mon Jun 25 19:31:30 2007
@@ -115,7 +115,7 @@
virtual YQSpacing * createSpacing ( YWidget * parent, YUIDimension dim, bool stretchable = false, YLayoutSize_t size = 0.0 );
virtual YQEmpty * createEmpty ( YWidget * parent );
virtual YQAlignment * createAlignment ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment );
- virtual YQSquash * createSquash ( YWidget * parent, bool hSquash, bool vSquash );
+ virtual YQSquash * createSquash ( YWidget * parent, bool horSquash, bool vertSquash );
//
// Visual Grouping
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39025 - in /branches/tmp/sh/mod-ui/qt/src: YQDialog.cc YQInputField.cc YQMenuButton.cc YQUI_x11.cc
by sh-sh-sh@svn.opensuse.org 25 Jun '07
by sh-sh-sh@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: sh-sh-sh
Date: Mon Jun 25 18:58:14 2007
New Revision: 39025
URL: http://svn.opensuse.org/viewcvs/yast?rev=39025&view=rev
Log:
comments
Modified:
branches/tmp/sh/mod-ui/qt/src/YQDialog.cc
branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
branches/tmp/sh/mod-ui/qt/src/YQMenuButton.cc
branches/tmp/sh/mod-ui/qt/src/YQUI_x11.cc
Modified: branches/tmp/sh/mod-ui/qt/src/YQDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQDialog…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQDialog.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQDialog.cc Mon Jun 25 18:58:14 2007
@@ -35,7 +35,7 @@
// Include low-level X headers AFTER Qt headers:
// X.h pollutes the global namespace (!!!) with pretty useless #defines
-// like "Above", "Below" etc.
+// like "Above", "Below" etc. that clash with some Qt headers.
#include <X11/Xlib.h>
Modified: branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQInputF…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQInputField.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQInputField.cc Mon Jun 25 18:58:14 2007
@@ -35,7 +35,7 @@
// Include low-level X headers AFTER Qt headers:
// X.h pollutes the global namespace (!!!) with pretty useless #defines
-// like "Above", "Below" etc.
+// like "Above", "Below" etc. that clash with some Qt headers.
#include <X11/X.h> // CapsLock detection
#include <X11/Xlib.h> // CapsLock detection
#include <X11/keysym.h> // CapsLock detection
Modified: branches/tmp/sh/mod-ui/qt/src/YQMenuButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMenuBu…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMenuButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMenuButton.cc Mon Jun 25 18:58:14 2007
@@ -31,7 +31,7 @@
// Include low-level X headers AFTER Qt headers:
// X.h pollutes the global namespace (!!!) with pretty useless #defines
-// like "Above", "Below" etc.
+// like "Above", "Below" etc. that clash with some Qt headers.
#include "YEvent.h"
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI_x11.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI_x11…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_x11.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_x11.cc Mon Jun 25 18:58:14 2007
@@ -40,7 +40,7 @@
// Include low-level X headers AFTER Qt headers:
// X.h pollutes the global namespace (!!!) with pretty useless #defines
-// like "Above", "Below" etc.
+// like "Above", "Below" etc. that clash with some Qt headers.
#include <X11/Xlib.h>
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39024 - /branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
by sh-sh-sh@svn.opensuse.org 25 Jun '07
by sh-sh-sh@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: sh-sh-sh
Date: Mon Jun 25 18:56:43 2007
New Revision: 39024
URL: http://svn.opensuse.org/viewcvs/yast?rev=39024&view=rev
Log:
less verbose logging
Modified:
branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
Modified: branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQInputF…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQInputField.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQInputField.cc Mon Jun 25 18:56:43 2007
@@ -124,8 +124,6 @@
if ( _qt_label->text().isEmpty() )
hintWidth = 0;
- y2warning( "width: %d hintWidth: %d", max( minSize, hintWidth ), hintWidth );
-
return max( minSize, hintWidth );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39023 - /branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField5.ycp
by sh-sh-sh@svn.opensuse.org 25 Jun '07
by sh-sh-sh@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: sh-sh-sh
Date: Mon Jun 25 18:56:16 2007
New Revision: 39023
URL: http://svn.opensuse.org/viewcvs/yast?rev=39023&view=rev
Log:
test case
Modified:
branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField5.ycp
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField5.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField5.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField5.ycp Mon Jun 25 18:56:16 2007
@@ -5,7 +5,7 @@
`HBox(
`InputField(`opt(`shrinkable), "1"),
`InputField(`opt(`shrinkable), "2"),
- `InputField(`opt(`shrinkable), "3"),
+ `InputField(`opt(`shrinkable), "321"),
`InputField(`opt(`shrinkable), "4")
)
),
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39022 - /branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
by sh-sh-sh@svn.opensuse.org 25 Jun '07
by sh-sh-sh@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: sh-sh-sh
Date: Mon Jun 25 18:55:59 2007
New Revision: 39022
URL: http://svn.opensuse.org/viewcvs/yast?rev=39022&view=rev
Log:
fixed shrinkable
Modified:
branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
Modified: branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQInputF…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQInputField.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQInputField.cc Mon Jun 25 18:55:59 2007
@@ -118,12 +118,14 @@
int YQInputField::preferredWidth()
{
- int minSize = shrinkable() ? 15 : 200;
- int hintWidth = sizeHint().width();
+ int minSize = shrinkable() ? 20 : 200;
+ int hintWidth = _qt_label->sizeHint().width();
if ( _qt_label->text().isEmpty() )
hintWidth = 0;
+ y2warning( "width: %d hintWidth: %d", max( minSize, hintWidth ), hintWidth );
+
return max( minSize, hintWidth );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0