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
October 2007
- 25 participants
- 535 discussions
[yast-commit] r41632 - in /branches/tmp/sh/mod-ui/ncurses/src: NCMenuButton.cc NCPopupMenu.cc NCPopupMenu.h
by gs@svn.opensuse.org 30 Oct '07
by gs@svn.opensuse.org 30 Oct '07
30 Oct '07
Author: gs
Date: Tue Oct 30 11:25:19 2007
New Revision: 41632
URL: http://svn.opensuse.org/viewcvs/yast?rev=41632&view=rev
Log:
add map to store table/menu item
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.h
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCM…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc Tue Oct 30 11:25:19 2007
@@ -189,7 +189,6 @@
{
wpos at( ScreenPos() + wpos( win->height(), 0 ) );
NCPopupMenu * dialog = new NCPopupMenu( at,
- this,
itemsBegin(),
itemsEnd() );
YUI_CHECK_NEW( dialog );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.cc Tue Oct 30 11:25:19 2007
@@ -30,25 +30,28 @@
//
// DESCRIPTION :
//
-NCPopupMenu::NCPopupMenu( const wpos at, NCMenuButton * menuButton, YItemIterator begin, YItemIterator end )
+NCPopupMenu::NCPopupMenu( const wpos at, YItemIterator begin, YItemIterator end )
: NCPopupTable( at )
- , menu( menuButton )
- , startIndex( 0 )
+ , itemsMap()
{
vector<string> row( 2 );
createList( row );
YMenuItem * startItem = dynamic_cast<YMenuItem *> (*begin);
YUI_CHECK_PTR( startItem );
- startIndex = startItem->index();
for ( YItemIterator it = begin; it != end; ++it )
{
YMenuItem * item = dynamic_cast<YMenuItem *> (*it);
YUI_CHECK_PTR( item );
+
row[0] = item->label();
row[1] = item->hasChildren() ? "..." : "";
- YItem *tableItem = new YTableItem( row[0], row[1] );
+
+ YTableItem *tableItem = new YTableItem( row[0], row[1] );
+ NCMIL << "Add to map: TableItem: " << tableItem << " Menu item: " << item << endl;
+
addItem( tableItem );
+ itemsMap[tableItem] = item;
}
stripHotkeys();
}
@@ -63,6 +66,7 @@
//
NCPopupMenu::~NCPopupMenu()
{
+ itemsMap.clear();
}
///////////////////////////////////////////////////////////////////
@@ -79,7 +83,11 @@
switch ( ch ) {
case KEY_RIGHT:
{
- YMenuItem * item = menu->findItem( startIndex + getCurrentItem() );
+ NCMIL << "CurrentItem: " << getCurrentItem() << endl;
+ YTableItem * tableItem = dynamic_cast<YTableItem *>( getCurrentItemPointer() );
+ NCMIL << "TableItem: " << tableItem << endl;
+ YMenuItem * item = itemsMap[ tableItem ];
+ NCMIL << "MenuItem: " << item << endl;
if ( item && item->hasChildren() )
ret = NCursesEvent::button;
break;
@@ -109,18 +117,21 @@
bool again = false;
int selection = ( postevent == NCursesEvent::button ) ? getCurrentItem()
: -1;
- YMenuItem * item = menu->findItem( startIndex + selection );
-
+ NCMIL << "Index: " << selection << endl;
+ YTableItem * tableItem = dynamic_cast<YTableItem *>( getCurrentItemPointer() );
+ if ( tableItem )
+ NCMIL << "Table item: " << tableItem->label() << endl;
+ YMenuItem * item = itemsMap[ tableItem ];
+
if ( !item )
- return again;
-
+ return true;
+ NCMIL << "Menu item: " << item->label() << endl;
if ( selection != -1 )
{
if ( item->hasChildren() ) {
// post submenu
wpos at( ScreenPos() + wpos( selection, inparent.Sze.W - 1 ) );
NCPopupMenu * dialog = new NCPopupMenu( at,
- menu,
item->childrenBegin(),
item->childrenEnd() );
YUI_CHECK_NEW( dialog );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPopupMenu.h Tue Oct 30 11:25:19 2007
@@ -40,8 +40,7 @@
private:
- NCMenuButton * menu;
- int startIndex;
+ std::map<YTableItem *, YMenuItem *> itemsMap;
protected:
@@ -51,7 +50,6 @@
public:
NCPopupMenu( const wpos at,
- NCMenuButton * menu,
YItemIterator begin,
YItemIterator 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] r41631 - in /branches/tmp/sh/mod-ui/ncurses/src: NCTable.cc NCTable.h NCWidgetFactory.cc NCWidgetFactory.h
by gs@svn.opensuse.org 30 Oct '07
by gs@svn.opensuse.org 30 Oct '07
30 Oct '07
Author: gs
Date: Tue Oct 30 11:24:13 2007
New Revision: 41631
URL: http://svn.opensuse.org/viewcvs/yast?rev=41631&view=rev
Log:
adapt to new YTable API
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTable.h
branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc
branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc Tue Oct 30 11:24:13 2007
@@ -20,6 +20,7 @@
#include "NCTable.h"
#include "NCPopupMenu.h"
#include <yui/YMenuButton.h>
+#include "YTypes.h"
#if 0
#undef DBG_CLASS
@@ -34,8 +35,8 @@
//
// DESCRIPTION :
//
-NCTable::NCTable( YWidget * parent, int columns )
- : YTable( parent, columns )
+NCTable::NCTable( YWidget * parent, YTableHeader *tableHeader )
+ : YTable( parent, tableHeader )
, NCPadWidget( parent )
, biglist( false )
{
@@ -43,8 +44,17 @@
immediate = immediateMode();
InitPad();
- // !!! head is UTF8 encoded, thus should be vector<YCPstring>
- header.assign( columns, NCstring("") );
+ // !!! head is UTF8 encoded, thus should be vector<NCstring>
+ _header.assign( columns(), NCstring("") );
+
+ for ( int col = 0; col < columns(); col++ )
+ {
+ if ( hasColumn( col ) )
+ {
+ _header[ col ] += NCstring( header( col ) ) ;
+ }
+ }
+ hasHeadline = myPad()->SetHeadline( _header );
}
/////////////////////////////////////////////////////////////////
@@ -130,13 +140,13 @@
void NCTable::setHeader( int col, const string & text )
{
- YTable::setHeader( col, text );
+ //YTable::setHeader( col, text );
if ( hasColumn( col ))
{
- header[ col ] += NCstring( text ) ;
+ _header[ col ] += NCstring( text ) ;
}
- hasHeadline = myPad()->SetHeadline( header );
+ hasHeadline = myPad()->SetHeadline( _header );
}
///////////////////////////////////////////////////////////////////
@@ -167,18 +177,18 @@
// letter - setHeader will append the rest
//
-void NCTable::setAlignment ( int col, YTable::Alignment al )
+void NCTable::setAlignment ( int col, YAlignmentType al )
{
string s;
switch ( al )
{
- case YTable::Left: s = 'L' ; break;
- case YTable::Center: s = 'C' ; break;
- case YTable::Right: s = 'R' ; break;
+ case YAlignBegin: s = 'L' ; break;
+ case YAlignCenter: s = 'C' ; break;
+ case YAlignEnd: s = 'R' ; break;
}
- header[ col ] = NCstring( s );
- YTable::setAlignment( col, al );
+ _header[ col ] = NCstring( s );
+ //YTable::setAlignment( col, al );
}
///////////////////////////////////////////////////////////////////
@@ -264,6 +274,21 @@
///////////////////////////////////////////////////////////////////
//
//
+// METHOD NAME : NCTable::getCurrentItemPointer
+// METHOD TYPE : YItem *
+//
+// DESCRIPTION : Return origin pointer of currently selected table item
+//
+
+YItem * NCTable::getCurrentItemPointer()
+{
+ const NCTableLine *cline = myPad()->GetLine( myPad()->CurPos().L );
+ return cline->origItem();
+}
+
+///////////////////////////////////////////////////////////////////
+//
+//
// METHOD NAME : NCTable::setCurrentItem
// METHOD TYPE : void
//
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTable.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTable.h Tue Oct 30 11:24:13 2007
@@ -46,7 +46,7 @@
bool immediate;
bool sortable;
- vector<NCstring> header;
+ vector<NCstring> _header;
protected:
@@ -74,7 +74,7 @@
public:
- NCTable( YWidget * parent, int columns );
+ NCTable( YWidget * parent, YTableHeader *header );
virtual ~NCTable();
@@ -85,7 +85,7 @@
void setHeader( int col, const string & text ); // added by gs
void setHeader ( vector<string> header );
- virtual void setAlignment ( int col, YTable::Alignment al );
+ virtual void setAlignment ( int col, YAlignmentType al );
void setBigList( const bool big ) { biglist = big; }
void SetSepChar( const chtype colSepchar ) { myPad()->SetSepChar( colSepchar ); }
@@ -96,6 +96,8 @@
virtual void deleteAllItems( );
virtual int getCurrentItem();
+ YItem * getCurrentItemPointer();
+
virtual void setCurrentItem( int index );
virtual void selectItem( YItem *yitem, bool selected );
void selectCurrentItem();
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCW…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.cc Tue Oct 30 11:24:13 2007
@@ -165,9 +165,9 @@
NCTable *
-NCWidgetFactory::createTable( YWidget * parent, int columns )
+NCWidgetFactory::createTable( YWidget * parent, YTableHeader * tableHeader )
{
- NCTable *table = new NCTable( parent, columns );
+ NCTable *table = new NCTable( parent, tableHeader );
YUI_CHECK_NEW( table );
return table;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCW…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWidgetFactory.h Tue Oct 30 11:24:13 2007
@@ -117,7 +117,7 @@
const string & label );
virtual NCTable * createTable ( YWidget * parent,
- int columns );
+ YTableHeader * tableHeader );
virtual NCProgressBar * createProgressBar ( YWidget * parent,
const string & label,
--
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] r41630 - in /trunk/backup: VERSION package/yast2-backup.changes src/backup_get_packages.ycp src/functions.ycp src/scripts/backup_archive.pl src/scripts/backup_search.pl src/ui.ycp
by locilka@svn.opensuse.org 30 Oct '07
by locilka@svn.opensuse.org 30 Oct '07
30 Oct '07
Author: locilka
Date: Tue Oct 30 09:53:19 2007
New Revision: 41630
URL: http://svn.opensuse.org/viewcvs/yast?rev=41630&view=rev
Log:
- Fixed several issues around creating the archive (#332663).
- 2.16.0
Modified:
trunk/backup/VERSION
trunk/backup/package/yast2-backup.changes
trunk/backup/src/backup_get_packages.ycp
trunk/backup/src/functions.ycp
trunk/backup/src/scripts/backup_archive.pl
trunk/backup/src/scripts/backup_search.pl
trunk/backup/src/ui.ycp
Modified: trunk/backup/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/VERSION?rev=41630&r1=4162…
==============================================================================
--- trunk/backup/VERSION (original)
+++ trunk/backup/VERSION Tue Oct 30 09:53:19 2007
@@ -1 +1 @@
-2.15.4
+2.16.0
Modified: trunk/backup/package/yast2-backup.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/package/yast2-backup.chan…
==============================================================================
--- trunk/backup/package/yast2-backup.changes (original)
+++ trunk/backup/package/yast2-backup.changes Tue Oct 30 09:53:19 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Oct 30 09:51:56 CET 2007 - locilka(a)suse.cz
+
+- Fixed several issues around creating the archive (#332663).
+- 2.16.0
+
+-------------------------------------------------------------------
Wed Jul 4 11:13:22 CEST 2007 - locilka(a)suse.cz
- Restart and/or enable cron service if needed for changed/added
Modified: trunk/backup/src/backup_get_packages.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/src/backup_get_packages.y…
==============================================================================
--- trunk/backup/src/backup_get_packages.ycp (original)
+++ trunk/backup/src/backup_get_packages.ycp Tue Oct 30 09:53:19 2007
@@ -30,7 +30,7 @@
string filename = nil;
if (is(WFM::Args(0), string)) {
- string filename = (string) WFM::Args (0);
+ filename = (string) WFM::Args (0);
} else {
y2error ("Wrong parameter for script");
return false;
@@ -67,7 +67,7 @@
y2debug("Source %1 description: %2", source_id, source_description);
// TODO: really compare whole maps? Have they same keys?
- if (contains(installed_products, source_description))
+ if (source_description != nil && source_description != $[] && contains(installed_products, source_description))
{
product_sources = add(product_sources, source_id);
}
Modified: trunk/backup/src/functions.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/src/functions.ycp?rev=416…
==============================================================================
--- trunk/backup/src/functions.ycp (original)
+++ trunk/backup/src/functions.ycp Tue Oct 30 09:53:19 2007
@@ -722,22 +722,25 @@
return [];
}
- string cmd = sformat("%1 backup_get_packages %2", yastbin, temporary_file);
+ string cmd = sformat("%1 backup_get_packages %2 1>/dev/null 2>/dev/null", yastbin, temporary_file);
y2milestone ("Running command: '%1'", cmd);
map command = (map) SCR::Execute(.target.bash_output, cmd);
- list <string> ret = nil;
+ list <string> ret = [];
if (command["exit"]:nil != 0) {
y2error ("Unexpected error: %1", command);
- return [];
+ ret = [];
} else {
if (FileUtils::Exists (temporary_file)) {
ret = (list <string>) SCR::Read (.target.ycp, temporary_file);
SCR::Execute (.target.remove, temporary_file);
+
if (ret == nil) {
- return [];
+ ret = [];
y2error ("Error while reading %1", temporary_file);
+ } else {
+ y2milestone ("backup_get_packages found %1 packages", ret);
}
}
}
Modified: trunk/backup/src/scripts/backup_archive.pl
URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/src/scripts/backup_archiv…
==============================================================================
--- trunk/backup/src/scripts/backup_archive.pl (original)
+++ trunk/backup/src/scripts/backup_archive.pl Tue Oct 30 09:53:19 2007
@@ -23,6 +23,19 @@
use File::Temp qw( tempdir );
use POSIX qw( strftime );
+# command line options
+my $archive_name = '';
+my $archive_type = '';
+my $help = '0';
+my $store_pt = '0';
+my @ext2_parts = ();
+my $verbose = '0';
+my $files_info = '';
+my $comment_file = '';
+my $complete_backup = '';
+my $multi_volume = undef;
+my $temp_dir = '/tmp';
+
# return all harddisks present in system
sub harddisks($)
{
@@ -61,6 +74,9 @@
if ($ix > 0)
{
my $dirs = substr($f, 0, $ix);
+ if ($verbose) {
+ print "Running: /bin/mkdir -p $dirs 2> /dev/null\n";
+ }
system("/bin/mkdir -p $dirs 2> /dev/null"); # create directory with parents
}
}
@@ -115,20 +131,6 @@
return $result;
}
-
-# command line options
-my $archive_name = '';
-my $archive_type = '';
-my $help = '0';
-my $store_pt = '0';
-my @ext2_parts = ();
-my $verbose = '0';
-my $files_info = '';
-my $comment_file = '';
-my $complete_backup = '';
-my $multi_volume = undef;
-my $temp_dir = '/tmp';
-
# parse command line options
GetOptions('archive-name=s' => \$archive_name,
'archive-type=s' => \$archive_type, 'help' => \$help,
@@ -210,9 +212,16 @@
}
# create parent temporary directory
-system("/bin/mkdir -p $temp_dir");
+system("/bin/mkdir -p '$temp_dir'");
+if (! -d $temp_dir) {
+ die "Cannot create directory $temp_dir: ".$!;
+}
my $tmp_dir_root = tempdir($temp_dir."/backup_tmp_XXXXXXXX", CLEANUP => 1); # remove directory content at exit
+system("/bin/mkdir -p '$tmp_dir_root'");
+if (! -d $tmp_dir_root) {
+ die "Cannot create directory $tmp_dir_root: ".$!;
+}
my $tmp_dir = $tmp_dir_root."/tmp";
if (!mkdir($tmp_dir))
@@ -244,7 +253,6 @@
print OUT "info/packages_info.gz\n";
$files_num++;
-
# store host name
use Sys::Hostname;
my $host = hostname();
@@ -490,9 +498,11 @@
if ($line =~ /^\/.+/)
{
- if (-r remove_escape($line) or -l remove_escape($line)) # output only readable files from files-info
- # symlinked files need not to be readable
- {
+ my $esc_line = remove_escape($line);
+
+# if (-r $esc_line or -l $esc_line) # output only readable files from files-info
+# # symlinked files need not to be readable
+# {
print FILES_INFO $line."\n";
if (defined $opened)
@@ -504,14 +514,14 @@
else
{
# star doesn't use escape sequences
- print PKGLIST remove_escape($line)."\n";
+ print PKGLIST $esc_line."\n";
}
}
- }
- else
- {
- print "/File not readable: $line\n";
- }
+# }
+# else
+# {
+# print "/File not readable: $line\n";
+# }
}
else
{
@@ -639,10 +649,20 @@
close(FILES_INFO);
# compress file packages_info (avg. ratio is ~10:1)
-while (!-e $tmp_dir.'/packages_info.gz') {
+my $wait_sec = 60;
+if (-e "$tmp_dir/packages_info") {
+ print "Gzipping $tmp_dir/packages_info\n";
system("/usr/bin/gzip -9 $tmp_dir/packages_info");
- warn 'Cannot create '.$tmp_dir.'/packages_info.gz: '.$!."\n";
- sleep(15);
+ while ($wait_sec > 0 && ! -e "$tmp_dir/packages_info.gz") {
+ --$wait_sec;
+ sleep(1);
+ }
+} elsif (! -e "$tmp_dir/packages_info.gz") {
+ print ("No such file : $tmp_dir/packages_info");
+}
+
+if (! -e "$tmp_dir/packages_info.gz") {
+ print 'Cannot create '.$tmp_dir.'/packages_info.gz: '.$!."\n";
}
close(OUT);
@@ -671,7 +691,7 @@
# -L <size> volume size in kiB
# -V <str> volume prefix label
-my $tar_command = "(export LC_ALL=C; tar -c --files-from $tmp_dir/files --ignore-failed-read -C $tmp_dir_root/tmp -S";
+my $tar_command = "(export LC_ALL=C; cd $tmp_dir_root/tmp; tar -c --files-from $tmp_dir/files --ignore-failed-read -C $tmp_dir_root/tmp -S";
if ($verbose)
{
@@ -781,6 +801,7 @@
# create standard (no multi volume) archive
$tar_command .= " -f $archive_name 2> /dev/null)";
+ print "Tar command: $tar_command\n";
system($tar_command);
}
Modified: trunk/backup/src/scripts/backup_search.pl
URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/src/scripts/backup_search…
==============================================================================
--- trunk/backup/src/scripts/backup_search.pl (original)
+++ trunk/backup/src/scripts/backup_search.pl Tue Oct 30 09:53:19 2007
@@ -346,6 +346,7 @@
# uses global variable exclude_reg_comp (precompiled regular expressions)
sub PrintFoundFile($$$$$)
{
+ my ($package_name, $file_for_ycp);
my ($file, $ref_package, $widget_file, $output_files, $start_directory) = @_;
# $widget_index <-> using the global one
@@ -394,9 +395,17 @@
# escaping newline characters is needed because each file
# is reported on separate line
+
+ $file_for_ycp = $file;
- $file =~ s/\\/\\\\/g;
- $file =~ s/\n/\\n/g;
+ $file_for_ycp =~ s/\\/\\\\/g;
+ $file_for_ycp =~ s/\n/\\n/g;
+ $file_for_ycp =~ s/\"/\\"/g;
+
+ $package_name = $$ref_package;
+ $package_name =~ s/\\/\\\\/g;
+ $package_name =~ s/\n/\\n/g;
+ $package_name =~ s/\"/\\"/g;
if (!$output_files) {
my $size = 0;
@@ -410,12 +419,12 @@
if ($widget_file ne "")
{
- print WIDGETFILE '`item(`id('.$widget_index.'), "X", "'.$file.'", "'.$$ref_package.'"),'."\n";
- print WIDGETFILE2 '`item(`id('.$widget_index.'), " ", "'.$file.'", "'.$$ref_package.'"),'."\n";
+ print WIDGETFILE '`item(`id('.$widget_index.'), "X", "'.$file_for_ycp.'", "'.$package_name.'"),'."\n";
+ print WIDGETFILE2 '`item(`id('.$widget_index.'), " ", "'.$file_for_ycp.'", "'.$package_name.'"),'."\n";
}
if ($list_items_file ne "") {
- print LISTITEMSFILE '['.$widget_index.', "'.$file.'"],'."\n";
+ print LISTITEMSFILE '['.$widget_index.', "'.$file_for_ycp.'"],'."\n";
}
}
}
Modified: trunk/backup/src/ui.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/backup/src/ui.ycp?rev=41630&r1=4…
==============================================================================
--- trunk/backup/src/ui.ycp (original)
+++ trunk/backup/src/ui.ycp Tue Oct 30 09:53:19 2007
@@ -2002,7 +2002,7 @@
string size_str = substring(line, 0, findfirstof(line, " "));
integer size_line = nil;
- if (size_str != nil) {
+ if (size_str != nil && size_str != "") {
size_line = tointeger(size_str);
if (size_line != nil) nopkg_size = nopkg_size + size_line;
}
@@ -2171,7 +2171,15 @@
integer t1 = time();
- list< list<any> > items = (list< list<any> >) SCR::Read(.target.ycp, (string) SCR::Read(.target.tmpdir) + "/items-list.ycp");
+ list< list<any> > items = [];
+ string items_filename = Directory::tmpdir + "/items-list.ycp";
+
+ if (FileUtils::Exists (items_filename)) {
+ y2milestone ("Reading %1", items_filename);
+ items = (list< list<any> >) SCR::Read(.target.ycp, items_filename);
+ } else {
+ y2error ("File %1 doesn't exist!", items_filename);
+ }
// dialog header
Wizard::SetContents( _("File Selection"),
@@ -2179,12 +2187,12 @@
`VSpacing(0.5),
// label text
`Left(`Label(_("Files to Back Up"))),
- `Table(`id(`table),
+ `Table (
+ `id(`table),
`opt(`notify),
// table header
`header(" ", _("Filename"), _("Package")),
- // Items are pre-defined in the file
- (list<term>) SCR::Read(.target.ycp, (string) SCR::Read(.target.tmpdir) + "/items.ycp")
+ []
),
`HBox(
// push button label
@@ -2199,6 +2207,16 @@
backup_help_file_selection(), true, true
);
+ // Items are pre-defined in the file
+ string items_filename_show = Directory::tmpdir + "/items.ycp";
+ UI::ChangeWidget (`id (`table), `Items,
+ (FileUtils::Exists (items_filename_show) ?
+ (list<term>) SCR::Read (.target.ycp, items_filename_show)
+ :
+ [`item (`id("none"), ["", _("Internal error"), ""])]
+ )
+ );
+
integer t2 = time();
y2milestone("UI finished after %1 seconds", t2 - t1);
--
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] r41629 - in /trunk/packager: package/yast2-packager.changes src/clients/inst_rpmcopy.ycp src/modules/Packages.ycp src/modules/SlideShow.ycp
by locilka@svn.opensuse.org 30 Oct '07
by locilka@svn.opensuse.org 30 Oct '07
30 Oct '07
Author: locilka
Date: Tue Oct 30 09:36:25 2007
New Revision: 41629
URL: http://svn.opensuse.org/viewcvs/yast?rev=41629&view=rev
Log:
- Downloading only one localized slideshow (with 'en' localization
as a fallback) instead of downloading the whole directory with
slides (#326327).
Modified:
trunk/packager/package/yast2-packager.changes
trunk/packager/src/clients/inst_rpmcopy.ycp
trunk/packager/src/modules/Packages.ycp
trunk/packager/src/modules/SlideShow.ycp
Modified: trunk/packager/package/yast2-packager.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.…
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Tue Oct 30 09:36:25 2007
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Tue Oct 30 09:29:39 CET 2007 - locilka(a)suse.cz
+
+- Downloading only one localized slideshow (with 'en' localization
+ as a fallback) instead of downloading the whole directory with
+ slides (#326327).
+
+-------------------------------------------------------------------
Fri Oct 26 12:52:12 CEST 2007 - lslezak(a)suse.cz
- package kernel-bigsmp has been renamed to kernel-pae
Modified: trunk/packager/src/clients/inst_rpmcopy.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/inst_rpmcop…
==============================================================================
--- trunk/packager/src/clients/inst_rpmcopy.ycp (original)
+++ trunk/packager/src/clients/inst_rpmcopy.ycp Tue Oct 30 09:36:25 2007
@@ -846,6 +846,9 @@
// bugzilla #208222
ReleaseHDDUsedAsInstallationSource();
+ // bugzilla #326327
+ Packages::SlideShowSetUp (Language::language);
+
Pkg::SetTextLocale (Language::language);
SlideShow::SetLanguage (Language::language);
Modified: trunk/packager/src/modules/Packages.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/Packages.yc…
==============================================================================
--- trunk/packager/src/modules/Packages.ycp (original)
+++ trunk/packager/src/modules/Packages.ycp Tue Oct 30 09:36:25 2007
@@ -804,39 +804,135 @@
return (string)SCR::Read (.content.LABEL);
}
-void SlideShowSetUp (integer source) {
+integer base_source_id = nil;
+
+boolean FindAndCopySlideDir (string our_slidedir, integer source, string search_for_dir,
+ string lang_long, string lang_short, string fallback_lang) {
+ // directory used as a source of texts
+ string providedir = nil;
+
+ // one of the localizations (long or short)
+ string used_loc_dir = "";
+
+ foreach (string try_this_lang, [lang_long, lang_short, fallback_lang], {
+ if (try_this_lang == nil || try_this_lang == "")
+ return;
+
+ string test_dir = sformat ("%1/txt/%2", search_for_dir, try_this_lang);
+ y2milestone ("Checking '%1'", test_dir);
+ providedir = Pkg::SourceProvideDirectory (source, 1, test_dir, true, true);
+
+ if (providedir != nil) {
+ y2milestone ("%1 lang found", try_this_lang);
+ used_loc_dir = try_this_lang;
+ // don't check for other langs
+ break;
+ }
+ });
+
+ // no wanted localization found
+ if (providedir == nil) {
+ y2milestone ("Neither %1 nor %2 localization found", lang_long, lang_short);
+ return false;
+ }
+
+ // where texts are stored later
+ string loc_slidedir = sformat ("%1/txt/%2/", our_slidedir, used_loc_dir);
+ WFM::Execute (.local.bash, sformat ("mkdir -p '%1'", String::Quote (loc_slidedir)));
+
+ // copy all files to our own cache
+ y2milestone ("Copying %1/* to %2", providedir, String::Quote (loc_slidedir));
+ WFM::Execute (.local.bash, sformat ("cp -r %1/* '%2'", providedir, String::Quote (loc_slidedir)));
+
+ // where images are stored
+ string imagesdir = sformat ("%1/pic", search_for_dir);
+
+ imagesdir = Pkg::SourceProvideDirectory (source, 1, imagesdir, true, true);
+
+ if (imagesdir != nil) {
+ // where images should be cached
+ string our_imagesdir = sformat ("%1/pic/", our_slidedir);
+ WFM::Execute (.local.bash, sformat ("mkdir -p '%1'", String::Quote (our_imagesdir)));
+
+ y2milestone ("Copying %1/* to '%2'", imagesdir, String::Quote (our_imagesdir));
+ WFM::Execute (.local.bash, sformat ("cp -r %1/* '%2'", imagesdir, String::Quote (our_imagesdir)));
+ } else {
+ y2error ("No such dir: %1", imagesdir);
+ }
+
+ return true;
+}
+
+global void SlideShowSetUp (string wanted_language) {
+ integer source = base_source_id;
+
+ string lang_long = "";
+ string lang_short = "";
+
+ // de_DE.UTF-8 -> de_DE
+ // es_ES -> es_ES
+ // blah -> ""
+ if (wanted_language != nil && wanted_language != "") {
+ y2milestone ("Selected language: %1", wanted_language);
+
+ if (regexpmatch (wanted_language, "^.+_.+$")) {
+ lang_long = wanted_language;
+ } else if (wanted_language != nil && wanted_language != "" && regexpmatch (wanted_language, "^.+_.+\..*$")) {
+ lang_long = regexpsub (wanted_language, "^(.+)_(.+)\..*", "\\1_\\2");
+ }
+
+ if (lang_long != nil && lang_long != "" && regexpmatch (lang_long, ".*_.*")) {
+ lang_short = regexpsub (lang_long, "(.*)_.*", "\\1");
+ } else if (wanted_language != nil && wanted_language != "") {
+ lang_short = wanted_language;
+ }
+
+ y2milestone ("Slide Show lang_long: %1, lang_short: %2", lang_long, lang_short);
+ } else {
+ y2error ("Wrong language definition: %1", wanted_language);
+ }
+
// setup slidedir
map productmap = Pkg::SourceProductData (source);
string datadir = productmap["datadir"]:"suse";
+ // target slideshow directory
+ string our_slidedir = sformat ("%1/slidedir/", (string) WFM::Read (.local.tmpdir, ""));
+ WFM::Execute (.local.bash, sformat ("mkdir -p '%1'", our_slidedir));
+
// media directory
// bugzilla #305097
+ //
+ // bugzilla #326327
+ // try to download only slides that are needed (by selected language)
+ // no images are cached
string search_for_dir = sformat ("/%1/setup/slide/", datadir);
- string slidedir = Pkg::SourceProvideDirectory (source, 1, search_for_dir, true, true);
-
- // target slideshow directory
- string our_slidedir = (string) WFM::Read (.local.tmpdir, "");
+ boolean success = FindAndCopySlideDir (our_slidedir, source, search_for_dir, lang_long, lang_short, SlideShow::fallback_lang);
- if (slidedir == nil) {
- y2milestone ("No slide directory '%1' found in repository '%2'.",
- search_for_dir, source);
- } else {
- // copy all files to our own copy
- y2milestone ("Copying %1/* to %2/", slidedir, our_slidedir);
-
- WFM::Execute (.local.bash,
- sformat ("cp -r %1/* %2/", slidedir, our_slidedir)) ;
+ // fallback solution disabled
+/*
+ if (success != true) {
+ y2milestone ("Using fallback solution, language is not supported");
+ string fallback_slidedir = Pkg::SourceProvideDirectory (source, 1, search_for_dir, true, true);
+
+ if (fallback_slidedir == nil) {
+ y2milestone ("No slide directory '%1' found in repository '%2'.",
+ search_for_dir, source);
+ } else {
+ // copy all files to our own cache
+ y2milestone ("Copying %1/* to %2/", fallback_slidedir, String::Quote (our_slidedir));
+ WFM::Execute (.local.bash, sformat ("cp -r %1/* '%2/'", fallback_slidedir, String::Quote (our_slidedir)));
+ }
}
- y2milestone ("Setting up the slide directory local copy: %1",
- our_slidedir);
+*/
+ y2milestone ("Setting up the slide directory local copy: %1", our_slidedir);
SlideShow::SetSlideDir (our_slidedir);
if (load_release_notes (source))
{
SlideShow::relnotes = media_prefix + media_text;
}
-
}
integer IntegrateServicePack (boolean show_popup, string base_url) {
@@ -974,7 +1070,8 @@
}
}
- SlideShowSetUp (initial_source);
+ base_source_id = initial_source;
+ y2milestone ("Base source ID: %1", base_source_id);
// Set the product before setting up add-on products
// In the autoyast mode it could be that the proposal
@@ -1224,7 +1321,7 @@
y2milestone ("XEN Selected: %1", xen_selected);
if (xen_selected)
{
- if (contains (Kernel::GetPackages (), "kernel-pae"))
+ if (contains (Kernel::GetPackages (), "kernel-bigsmp"))
{
y2milestone("Selected Xen kernel: kernel-xenpae");
// install PAE Xen
Modified: trunk/packager/src/modules/SlideShow.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/SlideShow.y…
==============================================================================
--- trunk/packager/src/modules/SlideShow.ycp (original)
+++ trunk/packager/src/modules/SlideShow.ycp Tue Oct 30 09:36:25 2007
@@ -19,6 +19,7 @@
import "Stage";
import "String";
import "Wizard";
+ import "FileUtils";
global list<list<integer> > total_sizes_per_cd_per_src = []; // total sizes per inst-src: [ [42, 43, 44], [12, 13, 14] ]
global list<list<integer> > remaining_sizes_per_cd_per_src = []; // remaining sizes
@@ -58,6 +59,7 @@
global string slide_txt_path = "";
global string slide_pic_path = "";
+ global string fallback_lang = "en";
global integer slide_interval = slide_min_interval;
global list<string> slides = [];
global string language = Language::language;
@@ -399,8 +401,12 @@
**/
list<string> GetSlideList( string lang )
{
+ list<string> slide_list = nil;
+
string txt_path = sformat( "%1/txt/%2", slide_base_path, lang );
- list<string> slide_list = (list<string>) SCR::Read (.target.dir, txt_path );
+ if (FileUtils::Exists (txt_path)) {
+ slide_list = (list<string>) SCR::Read (.target.dir, txt_path );
+ }
if ( slide_list == nil )
{
@@ -409,7 +415,10 @@
{
lang = substring( lang, 0, 2 );
txt_path = sformat( "%1/txt/%2", slide_base_path, lang );
- slide_list = (list<string>) SCR::Read (.target.dir, txt_path );
+
+ if (FileUtils::Exists (txt_path)) {
+ slide_list = (list<string>) SCR::Read (.target.dir, txt_path );
+ }
}
}
@@ -419,6 +428,8 @@
}
else
{
+ y2milestone ("Using slides from '%1' (%2 slides)", txt_path, size (slide_list));
+
slide_list = sort( filter( string filename, slide_list, ``{
// Check for valid extensions - ignore editor save files and other leftover stuff
return regexpmatch( filename, ".*\.(rtf|RTF|html|HTML|htm|HTM)$" );
@@ -431,15 +442,18 @@
{
slide_txt_path = txt_path;
slide_pic_path = slide_base_path + "/pic";
+
+ y2milestone ("Using TXT: %1, PIC: %2", slide_txt_path, slide_pic_path);
}
else // No slide texts found
{
y2debug( "No slides found at %1", txt_path );
- if ( lang != "en" )
+ // function calls itself!
+ if ( lang != fallback_lang )
{
- y2debug( "Trying to load slides from fallback: en" );
- slide_list = GetSlideList( "en" );
+ y2debug( "Trying to load slides from fallback: %1", fallback_lang );
+ slide_list = GetSlideList( fallback_lang );
}
}
--
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] r41628 - in /branches/tmp/sh/mod-ui: core/libyui/src/ qt/src/
by sh-sh-sh@svn.opensuse.org 29 Oct '07
by sh-sh-sh@svn.opensuse.org 29 Oct '07
29 Oct '07
Author: sh-sh-sh
Date: Mon Oct 29 18:55:42 2007
New Revision: 41628
URL: http://svn.opensuse.org/viewcvs/yast?rev=41628&view=rev
Log:
Got rid of outdated methods
removed YCP types
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YDialog.cc
branches/tmp/sh/mod-ui/core/libyui/src/YDialog.h
branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.cc
branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.h
branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.cc
branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.h
branches/tmp/sh/mod-ui/qt/src/YQDialog.cc
branches/tmp/sh/mod-ui/qt/src/YQDialog.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDialog.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDialog.cc Mon Oct 29 18:55:42 2007
@@ -146,34 +146,6 @@
}
-YWidgetList YDialog::widgets() const
-{
- YWidgetList widgetList;
- fillWidgetList( widgetList, this );
-
- return widgetList;
-}
-
-
-void YDialog::fillWidgetList( YWidgetList & widgetList,
- const YWidget * parent ) const
-{
- if ( ! parent )
- return;
-
- for ( YWidgetListConstIterator it = parent->childrenBegin();
- it != parent->childrenEnd();
- ++it )
- {
- YWidget * child = *it;
- widgetList.push_back( child );
-
- if ( child->hasChildren() )
- fillWidgetList( widgetList, child );
- }
-}
-
-
string YDialog::dialogDebugLabel()
{
#if 0
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YDialog.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YDialog.h Mon Oct 29 18:55:42 2007
@@ -148,11 +148,6 @@
YCPValue queryWidget( const YCPSymbol & property );
/**
- * Return a list of all widgets that belong to this dialog.
- **/
- YWidgetList widgets() const;
-
- /**
* Returns a (possibly translated) text describing this dialog for
* debugging.
**/
@@ -167,13 +162,6 @@
protected:
/**
- * Recursively fill a widgets list with all children and grandchildren of
- * 'parent' that are in the same dialog.
- **/
- void fillWidgetList( YWidgetList & widgetList,
- const YWidget * parent ) const;
-
- /**
* Format a debug label.
**/
string formatDebugLabel( YWidget * widget, const string & debLabel );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.cc Mon Oct 29 18:55:42 2007
@@ -20,8 +20,6 @@
#define y2log_component "ui-shortcuts"
#include <ycp/y2log.h>
-#include <ycp/YCPString.h>
-#include <ycp/YCPSymbol.h>
#include "YShortcut.h"
#include "YPushButton.h"
#include <ctype.h> // toupper(), tolower()
@@ -31,22 +29,22 @@
#define DIM( ARRAY ) ( (int) ( sizeof( ARRAY)/( sizeof( ARRAY[0] ) ) ) )
-YShortcut::YShortcut( YWidget *shortcut_widget )
- : _widget( shortcut_widget )
+YShortcut::YShortcut( YWidget * shortcutWidget )
+ : _widget( shortcutWidget )
{
- _preferred = -1;
- _shortcut = -1;
- _distinctShortcutChars = -1;
- _conflict = false;
- _shortcut_string_chached = false;
- _clean_shortcut_string_chached = false;
+ _preferred = -1;
+ _shortcut = -1;
+ _distinctShortcutChars = -1;
+ _conflict = false;
+ _shortcutStringCached = false;
+ _cleanShortcutStringCached = false;
- YPushButton * button = dynamic_cast<YPushButton *>( shortcut_widget);
+ YPushButton * button = dynamic_cast<YPushButton *>( shortcutWidget);
_isButton = ( button != 0 );
if ( _isButton )
{
- _isWizardButton = strstr( shortcut_widget->widgetClass(), "WizardButton" );
+ _isWizardButton = strstr( shortcutWidget->widgetClass(), "WizardButton" );
// y2debug( "%s %s is %sa wizard button", widgetClass(), cleanShortcutString().c_str(), _isWizardButton ? "" : "not " );
}
@@ -67,42 +65,42 @@
string
YShortcut::shortcutString()
{
- if ( ! _shortcut_string_chached )
+ if ( ! _shortcutStringCached )
{
- _shortcut_string = getShortcutString();
- _shortcut_string_chached = true;
+ _shortcutString = getShortcutString();
+ _shortcutStringCached = true;
// Note: We really need a separate variable here - an empty string
// might be a valid value!
}
- return _shortcut_string;
+ return _shortcutString;
}
string
YShortcut::cleanShortcutString()
{
- if ( ! _clean_shortcut_string_chached )
+ if ( ! _cleanShortcutStringCached )
{
- _clean_shortcut_string = cleanShortcutString( shortcutString() );
+ _cleanShortcutString = cleanShortcutString( shortcutString() );
}
- return _clean_shortcut_string;
+ return _cleanShortcutString;
}
string
-YShortcut::cleanShortcutString( string shortcut_string )
+YShortcut::cleanShortcutString( string shortcutString )
{
string::size_type pos = 0;
- while ( ( pos = findShortcutPos( shortcut_string, pos ) ) != string::npos )
+ while ( ( pos = findShortcutPos( shortcutString, pos ) ) != string::npos )
{
- shortcut_string.erase( pos, ( string::size_type ) 1 );
+ shortcutString.erase( pos, ( string::size_type ) 1 );
}
- return shortcut_string;
+ return shortcutString;
}
@@ -131,19 +129,19 @@
void
-YShortcut::setShortcut( char new_shortcut )
+YShortcut::setShortcut( char newShortcut )
{
string str = cleanShortcutString();
- if ( new_shortcut != YShortcut::None )
+ if ( newShortcut != YShortcut::None )
{
- char findme[] = { tolower( new_shortcut ), toupper( new_shortcut ), 0 };
+ char findme[] = { tolower( newShortcut ), toupper( newShortcut ), 0 };
string::size_type pos = str.find_first_of( findme );
if ( pos == string::npos )
{
y2error( "Can't find '%c' in %s \"%s\"",
- new_shortcut, widgetClass(), cleanShortcutString().c_str() );
+ newShortcut, widgetClass(), cleanShortcutString().c_str() );
return;
}
@@ -154,9 +152,9 @@
widget()->setShortcutString( str );
- _shortcut_string_chached = false;
- _clean_shortcut_string_chached = false;
- _shortcut = new_shortcut;
+ _shortcutStringCached = false;
+ _cleanShortcutStringCached = false;
+ _shortcut = newShortcut;
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YShortcut.h Mon Oct 29 18:55:42 2007
@@ -42,7 +42,7 @@
virtual ~YShortcut();
/**
- *
+ * Marker for "no shortcut"
**/
enum { None = 0 };
@@ -55,7 +55,7 @@
* Returns the textual representation of the widget class of the widget
* this shortcut data belongs to.
**/
- const char *widgetClass() const { return widget()->widgetClass(); }
+ const char * widgetClass() const { return widget()->widgetClass(); }
/**
* Returns 'true' if the widget that is associated with this shortcut is a
@@ -107,7 +107,7 @@
/**
* Set (override) the shortcut character.
**/
- void setShortcut( char new_shortcut );
+ void setShortcut( char newShortcut );
/**
* Clear the shortcut: Override the shortcut character with nothing.
@@ -185,11 +185,11 @@
// Data members
YWidget * _widget;
- string _shortcut_string;
- bool _shortcut_string_chached;
+ string _shortcutString;
+ bool _shortcutStringCached;
- string _clean_shortcut_string;
- bool _clean_shortcut_string_chached;
+ string _cleanShortcutString;
+ bool _cleanShortcutStringCached;
int _preferred; // int to enable initializing with invalid char ( -1 )
int _shortcut; // int to enable initializing with invalid char ( -1 )
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.cc Mon Oct 29 18:55:42 2007
@@ -19,8 +19,9 @@
#define y2log_component "ui-shortcuts"
#include <ycp/y2log.h>
-#include <ycp/YCPString.h>
#include "YShortcutManager.h"
+#include "YDialog.h"
+
// Return the number of elements of an array of any type
#define DIM( ARRAY ) ( (int) ( sizeof( ARRAY)/( sizeof( ARRAY[0] ) ) ) )
@@ -28,9 +29,10 @@
YShortcutManager::YShortcutManager( YDialog *dialog )
: _dialog( dialog )
+ , _conflictCount( 0 )
+ , _didCheck( false )
{
- _conflictCount = 0;
- _did_check = false;
+ YUI_CHECK_PTR( _dialog );
}
@@ -46,7 +48,7 @@
y2debug( "Checking keyboard shortcuts" );
clearShortcutList();
- findShortcutWidgets();
+ findShortcutWidgets( _dialog->childrenBegin(), _dialog->childrenEnd() );
// Initialize wanted character counters
@@ -104,7 +106,7 @@
}
}
- _did_check = true;
+ _didCheck = true;
if ( _conflictCount > 0 )
{
@@ -138,7 +140,7 @@
{
y2debug( "Resolving shortcut conflicts" );
- if ( ! _did_check )
+ if ( ! _didCheck )
{
y2milestone( "Call checkShortcuts() first!" );
return;
@@ -147,18 +149,18 @@
// Make a list of all shortcuts with conflicts
- YShortcutList conflictList;
- YShortcutListIterator it( _shortcutList.begin() );
+ YShortcutList conflictList;
_conflictCount = 0;
- while ( it != _shortcutList.end() )
+ for ( YShortcutListIterator it = _shortcutList.begin();
+ it != _shortcutList.end();
+ ++it )
{
if ( ( *it )->conflict() )
{
conflictList.push_back( *it );
_conflictCount++;
}
- ++it;
}
@@ -171,15 +173,15 @@
//
// Wizard buttons have priority - check any of them first.
- int prio_index = findShortestWizardButton( conflictList );
+ int prioIndex = findShortestWizardButton( conflictList );
- if ( prio_index < 0 )
- prio_index = findShortestWidget( conflictList); // Find the shortest widget. Buttons have priority.
+ if ( prioIndex < 0 )
+ prioIndex = findShortestWidget( conflictList); // Find the shortest widget. Buttons have priority.
// Pick a new shortcut for this widget.
- YShortcut * shortcut = conflictList[ prio_index ];
+ YShortcut * shortcut = conflictList[ prioIndex ];
resolveConflict( shortcut );
if ( shortcut->conflict() )
@@ -192,7 +194,7 @@
// Mark this particular conflict as resolved.
- conflictList.erase( conflictList.begin() + prio_index );
+ conflictList.erase( conflictList.begin() + prioIndex );
}
if ( _conflictCount > 0 )
@@ -277,24 +279,24 @@
int
YShortcutManager::findShortestWizardButton( const YShortcutList & conflictList )
{
- int shortest_index = -1;
- int shortest_len = -1;
+ int shortestIndex = -1;
+ int shortestLen = -1;
for ( unsigned i=1; i < conflictList.size(); i++ )
{
if ( conflictList[i]->isWizardButton() )
{
- if ( shortest_len < 0 ||
- conflictList[i]->distinctShortcutChars() < shortest_len )
+ if ( shortestLen < 0 ||
+ conflictList[i]->distinctShortcutChars() < shortestLen )
{
- shortest_index = i;
- shortest_len = conflictList[i]->distinctShortcutChars();
+ shortestIndex = i;
+ shortestLen = conflictList[i]->distinctShortcutChars();
}
}
}
- return shortest_index;
+ return shortestIndex;
}
@@ -302,34 +304,34 @@
unsigned
YShortcutManager::findShortestWidget( const YShortcutList & conflictList )
{
- unsigned shortest_index = 0;
- int shortest_len = conflictList[ shortest_index ]->distinctShortcutChars();
+ unsigned shortestIndex = 0;
+ int shortestLen = conflictList[ shortestIndex ]->distinctShortcutChars();
for ( unsigned i=1; i < conflictList.size(); i++ )
{
- int this_len = conflictList[i]->distinctShortcutChars();
+ int currentLen = conflictList[i]->distinctShortcutChars();
- if ( this_len < shortest_len )
+ if ( currentLen < shortestLen )
{
// Found an even shorter one
- shortest_index = i;
- shortest_len = this_len;
+ shortestIndex = i;
+ shortestLen = currentLen;
}
- else if ( this_len == shortest_len )
+ else if ( currentLen == shortestLen )
{
if ( conflictList[i]->isButton() &&
- ! conflictList[ shortest_index ]->isButton() )
+ ! conflictList[ shortestIndex ]->isButton() )
{
// Prefer a button over another widget with the same length
- shortest_index = i;
- shortest_len = this_len;
+ shortestIndex = i;
+ shortestLen = currentLen;
}
}
}
- return shortest_index;
+ return shortestIndex;
}
@@ -347,24 +349,26 @@
void
-YShortcutManager::findShortcutWidgets()
+YShortcutManager::findShortcutWidgets( YWidgetListConstIterator begin,
+ YWidgetListConstIterator end )
{
- if ( ! _dialog )
- {
- y2error( "NULL YDialog" );
- return;
- }
-
- YWidgetList widgetList = _dialog->widgets();
-
- for ( YWidgetListIterator it = widgetList.begin(); it != widgetList.end(); ++it )
+ for ( YWidgetListConstIterator it = begin; it != end; ++it )
{
- if ( ! (*it)->shortcutString().empty() )
+ YWidget * widget = *it;
+
+ if ( ! widget->shortcutString().empty() )
{
YShortcut * shortcut = new YShortcut( *it );
_shortcutList.push_back( shortcut );
}
+
+ if ( widget->hasChildren() )
+ {
+ findShortcutWidgets( widget->childrenBegin(),
+ widget->childrenEnd() );
+ }
}
}
+
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YShortcutManager.h Mon Oct 29 18:55:42 2007
@@ -20,19 +20,20 @@
#ifndef YShortcutManager_h
#define YShortcutManager_h
-#include "YDialog.h"
+#include "YWidget.h"
#include "YShortcut.h"
+class YDialog;
/**
- * @short Helper class to manage keyboard shortcuts within one dialog and
- * resolve keyboard shortcut conflicts
+ * Helper class to manage keyboard shortcuts within one dialog and resolve
+ * keyboard shortcut conflicts.
**/
class YShortcutManager
{
public:
/**
- * Constructor
+ * Constructor.
**/
YShortcutManager( YDialog *dialog );
@@ -41,23 +42,20 @@
**/
virtual ~YShortcutManager();
-
/**
- * Checks the keyboard shortcuts of all children of this dialog
- * ( not for sub-dialogs! ).
+ * Check the keyboard shortcuts of all children of this dialog
+ * (not for sub-dialogs!).
*
- * Runs resolveAllConflicts() if 'autoResolve' is 'true'.
+ * Call resolveAllConflicts() if 'autoResolve' is 'true'.
**/
void checkShortcuts( bool autoResolve = true );
-
/**
* Returns the number of shortcut conflicts.
* Valid only after checkShortcuts() or resolveAllConflicts().
**/
int conflictCount();
-
/**
* Resolve shortcut conflicts. Requires checkShortcuts() to be called first.
*
@@ -94,13 +92,11 @@
**/
void resolveAllConflicts();
-
/**
* Returns the dialog this shortcut manager works on.
**/
YDialog *dialog() { return _dialog; }
-
protected:
/**
@@ -109,11 +105,12 @@
void clearShortcutList();
/**
- * Search all children of _dialog (not those of any sub-dialogs!) for child
- * widgets that could accept a keyboard shortcut and add these to
- * _shortcutList.
+ * Recursively search all widgets between iterators 'begin' and 'end' (not
+ * those of any sub-dialogs!) for child widgets that could accept a
+ * keyboard shortcut and add these to _shortcutList.
**/
- void findShortcutWidgets();
+ void findShortcutWidgets( YWidgetListConstIterator begin,
+ YWidgetListConstIterator end );
/**
* Pick a new shortcut character for 'shortcut' - one that isn't marked as
@@ -165,7 +162,7 @@
private:
- bool _did_check;
+ bool _didCheck;
};
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 Oct 29 18:55:42 2007
@@ -13,7 +13,7 @@
File: YQDialog.cc
Author: Stefan Hundhammer <sh(a)suse.de>
-
+
Textdomain "packages-qt"
/-*/
@@ -77,12 +77,12 @@
_qFrame = new QFrame ( this );
bool decorate = ! hasDefaultSize() && ! YQUI::ui()->haveWM();
-
+
#if 0
if ( hasSmallDecorations() )
{
// None of this works (yet). :-((
-
+
clearWFlags( getWFlags() );
setWFlags( WStyle_Customize | WStyle_DialogBorder | WStyle_StaysOnTop );
// decorate = true;
@@ -195,7 +195,7 @@
QWidget * qChild = (QWidget *) firstChild()->widgetRep();
qChild->move( decorationWidth(), decorationWidth() );
}
-
+
if ( _qFrame )
_qFrame->resize( newWidth, newHeight );
@@ -238,39 +238,62 @@
{
if ( _defaultButton )
return _defaultButton;
-
- YWidgetList widgetList = YDialog::widgets();
- for ( YWidgetListIterator it = widgetList.begin(); it != widgetList.end(); ++it )
+ _defaultButton = findDefaultButton( childrenBegin(), childrenEnd() );
+
+ return _defaultButton;
+}
+
+
+YQGenericButton *
+YQDialog::findDefaultButton( YWidgetListConstIterator begin,
+ YWidgetListConstIterator end ) const
+
+{
+ for ( YWidgetListConstIterator it = begin; it != end; ++it )
{
- YQGenericButton * button = dynamic_cast<YQGenericButton *> ( *it );
+ YWidget * widget = *it;
+
+ //
+ // Check this widget
+ //
+
+ YQGenericButton * button = dynamic_cast<YQGenericButton *> (widget);
if ( button && button->isDefaultButton() )
{
- _defaultButton = button;
-
- return _defaultButton;
+ return button;
+ }
+
+
+ //
+ // Recurse over the children of this widget
+ //
+
+ if ( widget->hasChildren() )
+ {
+ button = findDefaultButton( widget->childrenBegin(),
+ widget->childrenEnd() );
+ if ( button )
+ return button;
}
}
- _defaultButton = 0;
-
- return _defaultButton;
+ return 0;
}
-void
-YQDialog::ensureOnlyOneDefaultButton()
+YQWizard *
+YQDialog::ensureOnlyOneDefaultButton( YWidgetListConstIterator begin,
+ YWidgetListConstIterator end )
{
YQGenericButton * def = _focusButton ? _focusButton : _defaultButton;
- YWidgetList widgetList = YDialog::widgets();
- _defaultButton = 0;
YQWizard * wizard = 0;
- for ( YWidgetListIterator it = widgetList.begin(); it != widgetList.end(); ++it )
+ for ( YWidgetListConstIterator it = begin; it != end; ++it )
{
- YQGenericButton * button = dynamic_cast<YQGenericButton *> (*it);
- YQWizardButton * wizardButton = dynamic_cast<YQWizardButton *> (*it);
+ YQGenericButton * button = dynamic_cast<YQGenericButton *> (*it);
+ YQWizardButton * wizardButton = dynamic_cast<YQWizardButton * > (*it);
if ( ! wizard )
wizard = dynamic_cast<YQWizard *> (*it);
@@ -285,7 +308,7 @@
{
if ( _defaultButton && button != _defaultButton )
{
- y2error( "Too many `opt( `default ) PushButtons: [%s]",
+ y2error( "Too many default buttons: [%s]",
(const char *) button->text() );
y2error( "Using old default button: [%s]",
(const char *) _defaultButton->text() );
@@ -295,19 +318,37 @@
_defaultButton = button;
}
}
-
+
if ( button->isShownAsDefault() && button != def )
button->showAsDefault( false );
}
+
+ if ( (*it)->hasChildren() )
+ {
+ YQWizard * wiz = ensureOnlyOneDefaultButton( (*it)->childrenBegin(),
+ (*it)->childrenEnd() );
+ if ( wiz )
+ wizard = wiz;
+ }
}
-
- if ( ! _defaultButton && wizard )
+
+ return wizard;
+}
+
+
+void
+YQDialog::ensureOnlyOneDefaultButton()
+{
+ _defaultButton = 0;
+ YQWizard * wizard = ensureOnlyOneDefaultButton( childrenBegin(), childrenEnd() );
+
+ if ( ! _defaultButton && wizard )
{
_defaultButton = wizardDefaultButton( wizard );
}
-
- def = _focusButton ? _focusButton : _defaultButton;
-
+
+ YQGenericButton * def = _focusButton ? _focusButton : _defaultButton;
+
if ( def )
def->showAsDefault();
}
@@ -316,15 +357,30 @@
YQWizard *
YQDialog::findWizard() const
{
- YWidgetList widgetList = YDialog::widgets();
- YQWizard * wizard = 0;
+ return findWizard( childrenBegin(), childrenEnd() );
+}
+
- for ( YWidgetListIterator it = widgetList.begin(); it != widgetList.end(); ++it )
+YQWizard *
+YQDialog::findWizard( YWidgetListConstIterator begin,
+ YWidgetListConstIterator end ) const
+
+{
+ for ( YWidgetListConstIterator it = begin; it != end; ++it )
{
- wizard = dynamic_cast<YQWizard *> (*it);
+ YWidget * widget = *it;
+ YQWizard * wizard = dynamic_cast<YQWizard *> (widget);
if ( wizard )
return wizard;
+
+ if ( widget->hasChildren() )
+ {
+ wizard = findWizard( widget->childrenBegin(),
+ widget->childrenEnd() );
+ if ( wizard )
+ return wizard;
+ }
}
return 0;
@@ -335,7 +391,7 @@
YQDialog::wizardDefaultButton( YQWizard * wizard ) const
{
YQGenericButton * def = 0;
-
+
if ( ! wizard )
wizard = findWizard();
@@ -395,7 +451,7 @@
{
_defaultButton->setDefaultButton( true );
y2debug( "New default button: [%s]", (const char *) _defaultButton->text() );
-
+
if ( _defaultButton && ! _focusButton )
_defaultButton->showAsDefault( true );
}
@@ -406,7 +462,7 @@
YQDialog::activateDefaultButton( bool warn )
{
// Try the focus button first, if there is any.
-
+
if ( _focusButton &&
_focusButton->isEnabled() &&
_focusButton->isShownAsDefault() )
@@ -416,9 +472,9 @@
return true;
}
-
+
// No focus button - try the default button, if there is any.
-
+
_defaultButton = findDefaultButton();
if ( _defaultButton &&
@@ -441,7 +497,8 @@
}
-void YQDialog::losingFocus( YQGenericButton * button )
+void
+YQDialog::losingFocus( YQGenericButton * button )
{
if ( button == _focusButton )
{
@@ -456,7 +513,8 @@
}
-void YQDialog::gettingFocus( YQGenericButton * button )
+void
+YQDialog::gettingFocus( YQGenericButton * button )
{
if ( _focusButton && _focusButton != button )
_focusButton->showAsDefault( false );
@@ -600,7 +658,7 @@
center( this, qApp->mainWidget() );
else if ( isCentered() )
center( this, qApp->desktop() );
-
+
QWidget::show();
}
@@ -610,7 +668,7 @@
{
if ( ! dialog )
return;
-
+
if ( ! parent )
{
if ( dialog == qApp->mainWidget() )
Modified: branches/tmp/sh/mod-ui/qt/src/YQDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQDialog…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQDialog.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQDialog.h Mon Oct 29 18:55:42 2007
@@ -77,7 +77,7 @@
* Reimplemented from YWidget.
**/
virtual void setSize( int newWidth, int newHeight );
-
+
/**
* Returns the size of (artificial) window manager decorations, depending
* on the value of YDialog::isDecorated().
@@ -120,7 +120,7 @@
* the dialog can keep track of its focusButton.
**/
void losingFocus( YQGenericButton * button );
-
+
/**
* Notification that a button gets the keyboard focus.
*
@@ -140,7 +140,7 @@
* Ensure presence of no more than one single default button.
**/
void ensureOnlyOneDefaultButton();
-
+
/**
* Activate ( i.e. click ) this dialog's default button, if there is any.
* Issue a warning to the log file if 'warn' is true.
@@ -155,7 +155,7 @@
/**
* Find a wizard button that would make sense as a default button.
- * Returns 0 if none can be found.
+ * Return 0 if none can be found.
**/
YQGenericButton * wizardDefaultButton( YQWizard * wizard ) const;
@@ -168,10 +168,33 @@
**/
static void center( QWidget * dialog, QWidget * parent = 0 );
-
+
protected:
/**
+ * Return the (first) default button between 'begin' and 'end'
+ * or 0 if there is none.
+ **/
+ YQGenericButton * findDefaultButton( YWidgetListConstIterator begin,
+ YWidgetListConstIterator end ) const;
+
+ /**
+ * Return the (first) wizard widget between 'begin' and 'end'
+ * or 0 if there is none.
+ **/
+ YQWizard * findWizard( YWidgetListConstIterator begin,
+ YWidgetListConstIterator end ) const;
+
+ /**
+ * Helper function for ensureOnlyOneDefaultButton():
+ * Recursively find all normal and wizard buttons between 'begin' and 'end'
+ * and make sure that no more than one button is marked as default.
+ * Return (the first) wizard widget found on the way.
+ **/
+ YQWizard * ensureOnlyOneDefaultButton( YWidgetListConstIterator begin,
+ YWidgetListConstIterator end );
+
+ /**
* Event handler for keyboard input.
* Only very special keys are processed here.
*
--
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] r41627 - /trunk/ca-management/package/yast2-ca-management.changes
by mcalmer@svn.opensuse.org 29 Oct '07
by mcalmer@svn.opensuse.org 29 Oct '07
29 Oct '07
Author: mcalmer
Date: Mon Oct 29 18:10:50 2007
New Revision: 41627
URL: http://svn.opensuse.org/viewcvs/yast?rev=41627&view=rev
Log:
update changes
Modified:
trunk/ca-management/package/yast2-ca-management.changes
Modified: trunk/ca-management/package/yast2-ca-management.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ca-management/package/yast2-ca-m…
==============================================================================
--- trunk/ca-management/package/yast2-ca-management.changes (original)
+++ trunk/ca-management/package/yast2-ca-management.changes Mon Oct 29 18:10:50 2007
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Oct 29 18:10:12 CET 2007 - mc(a)suse.de
+
+- merge SP1 changes to trunk
+ * detect existing default Root CA during installation (#238754)
+- popup password dialog if root password cannot be read
+
+-------------------------------------------------------------------
Mon Oct 29 16:12:36 CET 2007 - mc(a)suse.de
- version 2.16.2
--
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] r41626 - /trunk/ca-management/src/ca_mgm_proposal.ycp
by mcalmer@svn.opensuse.org 29 Oct '07
by mcalmer@svn.opensuse.org 29 Oct '07
29 Oct '07
Author: mcalmer
Date: Mon Oct 29 18:10:02 2007
New Revision: 41626
URL: http://svn.opensuse.org/viewcvs/yast?rev=41626&view=rev
Log:
- merge SP1 changes to trunk
* detect existing default Root CA during installation (#238754)
- popup password dialog if root password cannot be read
Modified:
trunk/ca-management/src/ca_mgm_proposal.ycp
Modified: trunk/ca-management/src/ca_mgm_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ca-management/src/ca_mgm_proposa…
==============================================================================
--- trunk/ca-management/src/ca_mgm_proposal.ycp (original)
+++ trunk/ca-management/src/ca_mgm_proposal.ycp Mon Oct 29 18:10:02 2007
@@ -26,6 +26,7 @@
import "DNS";
import "Timezone";
import "Users";
+ import "String";
include "ca-management/new_cert_read_write.ycp";
@@ -36,203 +37,306 @@
if (func == "MakeProposal")
{
- boolean force_reset = param["force_reset"]:false;
- string proposal = "";
- string warning = nil;
- symbol warning_level = nil;
-
- map retmap = (map) SCR::Execute (.target.bash_output,
- "/bin/hostname --long",
- $[] );
- y2milestone("Hostname :%1", retmap);
- if (retmap["exit"]:0 != 0
- && CaMgm::prop_selection == `def
- && (!CaMgm::prop_server_commonNameChanged
- || !CaMgm::prop_emailChanged
- || force_reset))
- {
- ret = add( ret, "warning", _("Cannot evaluate the name of the local machine. Change the values of Server Name and E-Mail."));
- ret = add( ret, "warning_level", `blocker );
- }
-
- string longhostname = strip(retmap["stdout"]:"linux.site");
- if(size(longhostname) <= 0)
- {
- longhostname = "linux.site";
- }
- string hostname = ((list<string>) splitstring (longhostname, "."))[0]:"";
- string domain = substring (longhostname, findfirstof(longhostname,".")+1);
-
- if (size (domain) <= 0)
- {
- domain = longhostname;
- }
-
- if (!CaMgm::prop_ca_commonNameChanged)
- {
- CaMgm::prop_ca_commonName = "YaST Default CA (" + hostname + ")";
- }
- if (!CaMgm::prop_server_commonNameChanged)
- {
- CaMgm::prop_server_commonName = longhostname;
- }
- if (!CaMgm::prop_CANameChanged)
- {
- CaMgm::prop_CAName = "YaST_Default_CA";
- }
- if (!CaMgm::prop_countryChanged)
- {
- CaMgm::prop_country = Timezone::GetCountryForTimezone("");
- }
- if (!CaMgm::prop_passwordChanged)
- {
- CaMgm::prop_password = Users::GetRootPassword();
- }
- if (!CaMgm::prop_emailChanged)
- {
- CaMgm::prop_email = "postmaster@" + domain;
- }
-
- if(ret["warning"]:"" != "")
- {
- return ret;
- }
-
- if (force_reset)
- {
- y2milestone("FORCE RESET");
- if (CaMgm::prop_settingsWritten)
- {
- if( !Popup::YesNo(_("CA Management") + "\n" +
- _("Settings have already been written.") + "\n" +
- _("Delete the old settings?")))
- {
- ret = $[ "workflow_sequence" : `auto ];
- }
- else
- {
- YaPI::CaManagement::DeleteCA ($[ "caName":CaMgm::currentCA,
- "caPasswd":getPassword(CaMgm::currentCA),
- "force": true]);
- CaMgm::prop_settingsWritten = false;
- }
- }
- else
- {
- CaMgm::prop_selection = `def;
- CaMgm::prop_ca_commonName = "YaST Default CA (" + hostname + ")";
- CaMgm::prop_CAName = "YaST_Default_CA";
- CaMgm::prop_country = Timezone::GetCountryForTimezone("");
- CaMgm::prop_password = Users::GetRootPassword();
- CaMgm::prop_email = "postmaster@" + domain;
- CaMgm::prop_server_commonName = longhostname;
- }
- }
-
- if (!check_mail_address(CaMgm::prop_email))
- {
- ret = add( ret, "warning", _("Invalid e-mail format."));
- ret = add( ret, "warning_level", `blocker );
- }
+ boolean force_reset = param["force_reset"]:false;
+ string proposal = "";
+ string warning = nil;
+ symbol warning_level = nil;
+
+ map retmap = (map) SCR::Execute (.target.bash_output,
+ "/bin/hostname --long",
+ $[] );
+ y2milestone("Hostname :%1", retmap);
+ if (retmap["exit"]:0 != 0
+ && CaMgm::prop_selection == `def
+ && (!CaMgm::prop_server_commonNameChanged
+ || !CaMgm::prop_emailChanged
+ || force_reset))
+ {
+ ret = add( ret, "warning", _("Cannot evaluate the name of the local machine. Change the values of Server Name and E-Mail."));
+ ret = add( ret, "warning_level", `blocker );
+ }
+
+ string longhostname = strip(retmap["stdout"]:"linux.site");
+ if(size(longhostname) <= 0)
+ {
+ longhostname = "linux.site";
+ }
+ string hostname = ((list<string>) splitstring (longhostname, "."))[0]:"";
+ string domain = substring (longhostname, findfirstof(longhostname,".")+1);
+
+ if (size (domain) <= 0)
+ {
+ domain = longhostname;
+ }
+
+ if (!CaMgm::prop_ca_commonNameChanged)
+ {
+ CaMgm::prop_ca_commonName = "YaST Default CA (" + hostname + ")";
+ }
+ if (!CaMgm::prop_server_commonNameChanged)
+ {
+ CaMgm::prop_server_commonName = longhostname;
+ }
+ if (!CaMgm::prop_CANameChanged)
+ {
+ CaMgm::prop_CAName = "YaST_Default_CA";
+ }
+ if (!CaMgm::prop_countryChanged)
+ {
+ CaMgm::prop_country = Timezone::GetCountryForTimezone("");
+ }
+ if (!CaMgm::prop_passwordChanged)
+ {
+ CaMgm::prop_password = Users::GetRootPassword();
+ }
+ if (!CaMgm::prop_emailChanged)
+ {
+ CaMgm::prop_email = "postmaster@" + domain;
+ }
+
+ if(ret["warning"]:"" != "")
+ {
+ return ret;
+ }
+
- if (CaMgm::prop_selection == `def)
- {
- if (!CaMgm::prop_passwordChanged)
- {
- proposal = HTML::Para(_("Creating default CA and certificate.")
- + HTML::Newline()
- + _("With higher security requirements, you should change the password."));
- }
- else
- {
- proposal = HTML::Para(_("Creating default CA and certificate.")
- + HTML::Newline());
- }
- string passwordString = (string) (CaMgm::prop_passwordChanged ? _("[manually set]") : _("[root password]"));
- proposal = proposal+ HTML::List( [ _("CA Name: ") + CaMgm::prop_CAName,
- _("Common Name: ") + CaMgm::prop_ca_commonName,
- _("Server Name: ") + CaMgm::prop_server_commonName,
- _("Country: ") + CaMgm::prop_country,
- _("Password: ") + passwordString,
- _("E-Mail: ") + CaMgm::prop_email
- ] );
- if ( Users::GetRootPassword() == "" && size(CaMgm::prop_password) == 0)
- {
- ret = add( ret, "warning", _("Unable to retrieve the system root password. Set a CA password to continue."));
- ret = add( ret, "warning_level", `blocker );
- }
- else if ( size(CaMgm::prop_password) < 4)
- {
- ret = add( ret, "warning", _("The root password is too short for use as the password for the certificates.
+ // new handling of force reset because of (#238754)
+ if (force_reset)
+ {
+ y2milestone("FORCE RESET");
+ if (CaMgm::prop_settingsWritten)
+ {
+ if( !Popup::YesNo(_("CA Management") + "\n" +
+ _("Settings have already been written.") + "\n" +
+ _("Delete the old settings?")))
+ {
+ ret = $[ "workflow_sequence" : `auto ];
+ }
+ else
+ {
+ YaPI::CaManagement::DeleteCA ($[ "caName":CaMgm::currentCA,
+ "caPasswd":getPassword(CaMgm::currentCA),
+ "force": true]);
+ CaMgm::prop_settingsWritten = false;
+ }
+ }
+ else
+ {
+ CaMgm::prop_selection = `def;
+ CaMgm::prop_ca_commonName = "YaST Default CA (" + hostname + ")";
+ CaMgm::prop_CAName = "YaST_Default_CA";
+ CaMgm::prop_country = Timezone::GetCountryForTimezone("");
+ CaMgm::prop_password = Users::GetRootPassword();
+ CaMgm::prop_email = "postmaster@" + domain;
+ CaMgm::prop_server_commonName = longhostname;
+ }
+ }
+ else // NO FORCE RESET
+ { // Try to read default Root CA and ask if it should be reused or deleted
+ map defaultRootCA = nil;
+ defaultRootCA = (map) YaPI::CaManagement::ReadFile( $["inFile":"/var/lib/CAM/" + CaMgm::prop_CAName + "/cacert.pem",
+ "type":"parsed",
+ "datatype":"CERTIFICATE",
+ "inForm":"PEM"
+ ]);
+ CaMgm::prop_settingsWritten = defaultRootCA != nil ? true:false;
+
+
+ if (CaMgm::prop_settingsWritten)
+ {
+ if( !Popup::YesNo(_("CA Management") + "\n" +
+ _("Settings have already been written.") + "\n" +
+ _("Delete the old settings?")))
+ {
+ // read the details directly from the server certificate
+ map defaultServerCert = (map) YaPI::CaManagement::ReadFile( $[
+ "inFile":"/etc/ssl/servercerts/servercert.pem",
+ "type":"parsed",
+ "datatype":"CERTIFICATE",
+ "inForm":"PEM" ]);
+
+ map defaultServerCertIssuer = defaultServerCert["ISSUER_HASH"]:$[];
+ // CaMgm::prop_selection = `def;
+ CaMgm::prop_ca_commonName = ((list)defaultServerCertIssuer["CN"]:[])[0]:"";
+ CaMgm::prop_country = ((list)defaultServerCertIssuer["C"]:[])[0]:"";
+ CaMgm::prop_email = ((list)defaultServerCertIssuer["emailAddress"]:[])[0]:"";
+ CaMgm::prop_CAName = CaMgm::prop_CAName;
+ CaMgm::prop_password = Users::GetRootPassword();
+
+
+ map defaultSCmap = defaultServerCert["DN_HASH"]:$[];
+
+ CaMgm::prop_server_commonName = ((list)defaultSCmap["CN"]:[])[0]:"";
+
+
+ ret = $[ "workflow_sequence" : `auto ];
+ }
+ else
+ { // delete the default Root CA manually because the root PW may be different in a repeated run of second-Stage
+ SCR::Execute(.target.bash, sformat(" rm -rf /var/lib/CAM/%1 ", CaMgm::prop_CAName ));
+ CaMgm::prop_settingsWritten = false;
+ }
+ }
+ }
+
+ if (!check_mail_address(CaMgm::prop_email))
+ {
+ ret = add( ret, "warning", _("Invalid e-mail format."));
+ ret = add( ret, "warning_level", `blocker );
+ }
+
+ if (CaMgm::prop_selection == `def)
+ {
+
+ if ( Users::GetRootPassword() == "" && size(CaMgm::prop_password) == 0)
+ {
+
+ UI::OpenDialog (`opt(`decorated ),
+ `HBox(`VSpacing(10),
+ `VBox (
+ `Label("Unable to retrieve the system root password. Set a CA password to continue."),
+ `HSpacing(10),
+ `Password(`id(`pw1), _("&Password:"), ""),
+ `Password(`id(`pw2), _("Co&nfirm Password"), ""),
+ `HSpacing(10),
+ `HBox(`PushButton (`id(`cancel), `opt(`key_F9), Label::CancelButton()),
+ `HStretch(),
+ `PushButton (`id(`ok), `opt(`default, `key_F10), Label::OKButton())
+ )
+ ),
+ `VSpacing(10)
+ )
+ );
+ UI::SetFocus (`id(`ok));
+ while (true)
+ {
+ any rt = UI::UserInput();
+ if (rt == `ok)
+ {
+ string pw1 = (string) UI::QueryWidget(`id(`pw1), `Value);
+ string pw2 = (string) UI::QueryWidget(`id(`pw2), `Value);
+ if(pw1 != pw2)
+ {
+ Popup::Error( _("New passwords do not match.") );
+ continue;
+ }
+ if ( size(pw1) < 4)
+ {
+ Popup::Error(_("The password is too short for use as the password for the certificates.
Enter a valid password for the certificates or disable certificate creation.
"));
- ret = add( ret, "warning_level", `blocker );
- }
- }
- else if (CaMgm::prop_selection == `none)
- {
- proposal = HTML::Para(_("Not creating a CA and certificate."));
- }
- else if (CaMgm::prop_selection == `disk)
- {
- proposal = HTML::Para(_("Importing a CA and certificate from file"));
- }
-
- ret = add (ret, "preformatted_proposal", proposal);
- if ( ((list<string>) splitstring (CaMgm::prop_server_commonName, "."))[0]:"" == "linux")
- {
- ret = add (ret, "warning" ,
- _("<p>Is the default hostname <b>linux</b> really unique? The certificate is only valid if the hostname is correct.</p>"));
- }
+ continue;
+ }
+ CaMgm::prop_password = pw1;
+ CaMgm::prop_passwordChanged = true;
+ break;
+ }
+ else if (rt == `cancel)
+ {
+ ret = add( ret, "warning", _("Unable to retrieve the system root password. Set a CA password to continue."));
+ ret = add( ret, "warning_level", `blocker );
+ break;
+ }
+ }
+
+ UI::CloseDialog ();
+ }
+
+ if (!CaMgm::prop_passwordChanged)
+ {
+ proposal = HTML::Para(_("Creating default CA and certificate.")
+ + HTML::Newline()
+ + _("With higher security requirements, you should change the password."));
+ }
+ else
+ {
+ proposal = HTML::Para(_("Creating default CA and certificate.")
+ + HTML::Newline());
+ }
+
+ string passwordString = (string) (CaMgm::prop_passwordChanged ? _("[manually set]") : _("[root password]"));
+ proposal = proposal+ HTML::List( [ _("CA Name: ") + CaMgm::prop_CAName,
+ _("Common Name: ") + CaMgm::prop_ca_commonName,
+ _("Server Name: ") + CaMgm::prop_server_commonName,
+ _("Country: ") + CaMgm::prop_country,
+ _("Password: ") + passwordString,
+ _("E-Mail: ") + CaMgm::prop_email
+ ] );
+
+
+ if ( size(CaMgm::prop_password) < 4)
+ {
+ ret = add( ret, "warning", _("The root password is too short for use as the password for the certificates.
+ Enter a valid password for the certificates or disable certificate creation.
+"));
+ ret = add( ret, "warning_level", `blocker );
+ }
+ }
+ else if (CaMgm::prop_selection == `none)
+ {
+ proposal = HTML::Para(_("Not creating a CA and certificate."));
+ }
+ else if (CaMgm::prop_selection == `disk)
+ {
+ proposal = HTML::Para(_("Importing a CA and certificate from file"));
+ }
+
+ ret = add (ret, "preformatted_proposal", proposal);
+ if ( ((list<string>) splitstring (CaMgm::prop_server_commonName, "."))[0]:"" == "linux")
+ {
+ ret = add (ret, "warning" ,
+ _("<p>Is the default hostname <b>linux</b> really unique? The certificate is only valid if the hostname is correct.</p>"));
+ }
}
else if (func == "AskUser")
{
- any sequence = WFM::CallFunction ( "ca_select_proposal", [] );
- if (CaMgm::prop_settingsWritten)
- {
- if( !Popup::YesNo(_("CA Management") + "\n" +
- _("Settings have already been written.") + "\n" +
- _("Delete the old settings?")))
- {
- ret = $[ "workflow_sequence" : `auto ];
- }
- else
- {
- YaPI::CaManagement::DeleteCA ($[ "caName":CaMgm::currentCA,
- "caPasswd":getPassword(CaMgm::currentCA),
- "force": true]);
- CaMgm::prop_settingsWritten = false;
- }
- }
+ any sequence = WFM::CallFunction ( "ca_select_proposal", [] );
+ if (CaMgm::prop_settingsWritten)
+ {
+ if( !Popup::YesNo(_("CA Management") + "\n" +
+ _("Settings have already been written.") + "\n" +
+ _("Delete the old settings?")))
+ {
+ ret = $[ "workflow_sequence" : `auto ];
+ }
+ else
+ {
+ YaPI::CaManagement::DeleteCA ($["caName":CaMgm::currentCA,
+ "caPasswd":getPassword(CaMgm::currentCA),
+ "force": true]);
+ CaMgm::prop_settingsWritten = false;
+ }
+ }
}
else if (func == "Description")
{
- // richtext label
- ret = $[ "rich_text_title" : _("CA Management"),
- // menu title
- "menu_title" : _("&CA Management"),
- "id" : "ca_mgm",
- ];
+ // richtext label
+ ret = $[ "rich_text_title" : _("CA Management"),
+ // menu title
+ "menu_title" : _("&CA Management"),
+ "id" : "ca_mgm",
+ ];
}
else if (func == "Write")
{
- boolean success = true;
-
- if (!CaMgm::prop_settingsWritten)
- {
- if (CaMgm::prop_selection == `def)
- {
- success = create_default_CA_certificate();
- }
- else if (CaMgm::prop_selection == `disk)
- {
- success = importCertificateFromDisk ();
- }
- if( success ) {
- CaMgm::prop_settingsWritten = true;
- }
- }
-
+ boolean success = true;
+
+ if (!CaMgm::prop_settingsWritten)
+ {
+ if (CaMgm::prop_selection == `def)
+ {
+ success = create_default_CA_certificate();
+ }
+ else if (CaMgm::prop_selection == `disk)
+ {
+ success = importCertificateFromDisk ();
+ }
+ if( success )
+ {
+ CaMgm::prop_settingsWritten = true;
+ }
+ }
+
ret = $[ "success" : success ];
}
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
[yast-commit] r41625 - in /trunk/mail/src: MailServer.ycp mail-advanced.ycp mail-server_dialogs.ycp mail-server_ldap-setup.ycp mail.ycp
by varkoly@svn.opensuse.org 29 Oct '07
by varkoly@svn.opensuse.org 29 Oct '07
29 Oct '07
Author: varkoly
Date: Mon Oct 29 17:49:55 2007
New Revision: 41625
URL: http://svn.opensuse.org/viewcvs/yast?rev=41625&view=rev
Log:
#335524 Advanced Mail Transfer Agent cannot access LDAP server
Modified:
trunk/mail/src/MailServer.ycp
trunk/mail/src/mail-advanced.ycp
trunk/mail/src/mail-server_dialogs.ycp
trunk/mail/src/mail-server_ldap-setup.ycp
trunk/mail/src/mail.ycp
Modified: trunk/mail/src/MailServer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/MailServer.ycp?rev=4162…
==============================================================================
--- trunk/mail/src/MailServer.ycp (original)
+++ trunk/mail/src/MailServer.ycp Mon Oct 29 17:49:55 2007
@@ -216,7 +216,7 @@
if(! is_main_domain )
{
y2milestone("no main mail domain");
- LDAPSettings["bind_pw"] = MailServer::AdminPassword;
+ LDAPSettings["bind_pw"] = AdminPassword;
SCR::Execute (.ldap.bind,LDAPSettings);
integer counter = 0;
map lastDomain = $[];
Modified: trunk/mail/src/mail-advanced.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/mail-advanced.ycp?rev=4…
==============================================================================
--- trunk/mail/src/mail-advanced.ycp (original)
+++ trunk/mail/src/mail-advanced.ycp Mon Oct 29 17:49:55 2007
@@ -36,13 +36,14 @@
* @param options map of options from command line
* @return boolean true on success
*/
-boolean SetupMailServer(map<string,string> options)
+boolean SetupMailServer()
{
any ret = SetupSequence();
return true;
}
-map cmdline_description = $[
+map cmdline_description =
+$[
"id" : "mail-server",
/* Command line help text for the mail-server module */
"help" : _("Configuration of mail server"),
@@ -85,6 +86,10 @@
{
ret = MailServerAutoSequence();
}
+else if(setup)
+{
+ ret = SetupSequence();
+}
else
{
ret = CommandLine::Run(cmdline_description);
Modified: trunk/mail/src/mail-server_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/mail-server_dialogs.ycp…
==============================================================================
--- trunk/mail/src/mail-server_dialogs.ycp (original)
+++ trunk/mail/src/mail-server_dialogs.ycp Mon Oct 29 17:49:55 2007
@@ -32,6 +32,7 @@
*/
define any CheckLDAPDialog ()
{
+ y2milestone("--Start CheckLDAPDialog ---");
boolean ca_mgm = false;
boolean conf_ldap_server = false;
boolean setup_ldap_server = false;
@@ -44,6 +45,7 @@
{ //No LDAP-Client configuration
setup_ldap_server = true;
ca_mgm = true;
+ conf_ldap_server = true;
comment = _("Your computer is not configured as LDAP-client.") + "<br>" +
_("We suggest to setup a local LDAP-server for the mail server.") + "<br>" +
_("To secure your system we suggest to create certificates for the LDAP and Mail Server.") + "<br>";
@@ -52,14 +54,14 @@
{ //The computer is configured as LDAP-Client
if( LDAPSettings["ldap_server"]:"" == "127.0.0.1" )
{ // The LDAP-Server is local
- comment = _("Your computer is configured as LDAP-client and the LDAP-Server is local.") + "<br>" +
+ comment = _("Your computer is configured as LDAP-client and the LDAP-Server is local.") + "<br>" +
_("We suggest to adapt the LDAP-server configuration for the mail server.") + "<br>" +
_("For this reason you have to know the password of the LDAP-administrator account:") + "<br>" +
"<B>" + LDAPSettings["bind_dn"]:"" + ".</B><BR>";
}
else
{ // The LDAP-Server is not local
- comment = _("Your computer is configured as LDAP-client and the LDAP-Server is not local.") + "<br>" +
+ comment = _("Your computer is configured as LDAP-client and the LDAP-Server is not local.") + "<br>" +
_("We suggest to configure the LDAP-server for the mail server.") + "<br>" +
_("For this reason you have to know the password of the LDAP-administrator account:") + "<br>" +
"<B>" + LDAPSettings["bind_dn"]:"" + ".</B><BR>" +
@@ -108,12 +110,30 @@
Ldap::LDAPInit();
LDAPSettings = (map <string, any>) Ldap::Export();
}
- string adminpw = Ldap::LDAPAskAndBind(false);
- if( adminpw != nil )
+ MailServer::AdminPassword = Ldap::LDAPAskAndBind(false);
+ if( MailServer::AdminPassword != nil )
{
- YaPI::MailServer::ResetMailServer(adminpw,LDAPSettings);
+ block<boolean> abort = ``{
+ if (UI::PollInput () == `abort &&
+ // popup text
+ Popup::YesNo (_("Really abort the writing process?")))
+ return true;
+ return false;
+ };
+
+ //tell Ldap module to create the default objects:
+ LDAPSettings [ "create_ldap" ] = true;
+ Ldap::Import(LDAPSettings);
+ //write the settings:
+ Ldap::Write(abort);
+ //create default mail-server configuration
+ YaPI::MailServer::ResetMailServer(MailServer::AdminPassword,LDAPSettings);
+ return `next;
+ }
+ else
+ {
+ return `abort;
}
- return `ok;
}
/**
@@ -124,6 +144,7 @@
define any AuthorizingDialog ()
{
+ y2milestone("--Start AuthorizingDialog ---");
Ldap::Read();
map LDAPSettings = Ldap::Export();
if(LDAPSettings["bind_dn"]:"" == "" )
@@ -140,6 +161,7 @@
}
Ldap::Read();
}
+ Ldap::LDAPInit();
integer size1 = (integer)SCR::Read(.target.size, "/etc/ssl/servercerts/servercert.pem");
integer size2 = (integer)SCR::Read(.target.size, "/etc/ssl/servercerts/serverkey.pem");
@@ -152,11 +174,16 @@
MailServer::CertExist = true;
}
- return Ldap::LDAPAskAndBind(false);
-
+ MailServer::AdminPassword = Ldap::LDAPAskAndBind(false);
+ if( MailServer::AdminPassword == nil )
+ {
+ return `abort;
+ }
+ return `next;
}
-list<map> GenerateTree(list<map> Tree, string parent, list<list> input) {
+list<map> GenerateTree(list<map> Tree, string parent, list<list> input)
+{
foreach(list i, input, ``{
string title = i[0]:"";
@@ -170,7 +197,9 @@
return Tree;
}
-term GlobalSettingsDialog() {
+term GlobalSettingsDialog()
+{
+ y2milestone("--Start GlobalSettingsDialog ---");
boolean limit = ((string)MailServer::GlobalSettings["MaximumMailSize"]:"0" != "0");
boolean is_DNS = ((string)MailServer::GlobalSettings["SendingMail","Type"]:"" == "DNS");
boolean is_NONE = ((string)MailServer::GlobalSettings["SendingMail","Type"]:"" == "NONE");
@@ -302,7 +331,8 @@
return content;
}
-list<term> MakeSelectedList(list<string> items, string value ) {
+list<term> MakeSelectedList(list<string> items, string value )
+{
list<term> SelectedList = [];
foreach(string i, items, ``{
if( i == value ) {
@@ -314,7 +344,9 @@
return SelectedList;
}
-void ShowMailTransport(string CID, string ACTION) {
+void ShowMailTransport(string CID, string ACTION)
+{
+ y2milestone("--Start ShowMailTransport ---");
list<map<string,string> > Transports = (list<map<string,string> >) MailServer::MailTransports["Transports"]:[];
map<string,string> TLSSites = (map<string,string>) MailServer::MailTransports["TLSSites"]:$[];
map<string,list> SASLAccounts = (map<string,list>) MailServer::MailTransports["SASLAccounts"]:$[];
@@ -549,7 +581,9 @@
return;
}
-term MailTransportsDialog() {
+term MailTransportsDialog()
+{
+ y2milestone("--Start MailTransportsDialog ---");
list<map<string,string> > Transports = (list<map<string,string> >) MailServer::MailTransports["Transports"]:[];
map<string,string> TLSSites = (map<string,string>) MailServer::MailTransports["TLSSites"]:$[];
list Transport_items = [];
@@ -595,7 +629,9 @@
return content;
}
-term MailPreventionDialog(string CID, string CIDRBL) {
+term MailPreventionDialog(string CID, string CIDRBL)
+{
+ y2milestone("--Start MailTransportsDialog ---");
list<term> AccessItems= [];
list<term> RBLItems = [];
string BasicProtection = (string)MailServer::MailPrevention["BasicProtection"]:"";
@@ -678,7 +714,8 @@
return content;
}
-string RBLAdd () {
+string RBLAdd ()
+{
UI::OpenDialog(`opt(`decorated ), `Frame(_("Add New RBL Server"),
`VBox(
`TextEntry(`id(`server), "", ""),
@@ -703,7 +740,8 @@
return server;
}
-map AccessAdd () {
+map AccessAdd ()
+{
UI::OpenDialog(`opt(`decorated ), `Frame(_("Add New Sender Restriction"),
`VBox(
`TextEntry(`id(`NewSender), _("Sender Address"), ""),
@@ -737,7 +775,9 @@
return SenderRestriction;
}
-term MailRelayingDialog() {
+term MailRelayingDialog()
+{
+ y2milestone("--Start MailRelayingDialog ---");
// boolean UserRestriction = ((string)MailServer::MailRelaying["UserRestriction"]:"0" == "1");
boolean RequireSASL = ((string)MailServer::MailRelaying["RequireSASL"]:"0" == "1");
boolean SMTPDTLSnone = ((string)MailServer::MailRelaying["SMTPDTLSMode"]:"none" == "none");
@@ -795,7 +835,9 @@
return content;
}
-term MailLocalDeliveryDialog() {
+term MailLocalDeliveryDialog()
+{
+ y2milestone("--Start MailLocalDeliveryDialog ---");
boolean TypeCYRUS = ((string)MailServer::MailLocalDelivery["Type"]:"" == "cyrus");
boolean TypePROCMAIL = ((string)MailServer::MailLocalDelivery["Type"]:"" == "procmail");
boolean TypeLOCAL = ((string)MailServer::MailLocalDelivery["Type"]:"" == "local");
@@ -933,7 +975,9 @@
return content;
}
-term FetchingMailDialog() {
+term FetchingMailDialog()
+{
+ y2milestone("--Start FetchingMailDialog ---");
list<term> table_items = [];
integer IID = 0;
list<map<string,string> > entries = (list<map<string,string> >) MailServer::FetchingMail["Items"]:[];
@@ -1017,7 +1061,9 @@
return content;
}
-map FetchmailAddItem(){
+map FetchmailAddItem()
+{
+ y2milestone("--Start FetchmailAddItem ---");
UI::OpenDialog(`opt(`decorated ), `Frame(_("Add New Fetchmail Job"),
`VBox(
`TextEntry(`id(`server), _("Server Address"), ""),
@@ -1070,7 +1116,9 @@
}
-term MailLocalDomainsDialog(string CID) {
+term MailLocalDomainsDialog(string CID)
+{
+ y2milestone("--Start MailLocalDomainsDialog ---");
list<term> Domains = [];
boolean NoLocalDelivery = ((string)MailServer::MailLocalDelivery["Type"]:"" == "none");
if(NoLocalDelivery) {
@@ -1122,8 +1170,9 @@
return content;
}
-void ShowMailLocalDomain(string CID, string ACTION) {
-
+void ShowMailLocalDomain(string CID, string ACTION)
+{
+ y2milestone("--Start ShowMailLocalDomain ---");
string Name = "";
string Type = "local";
boolean Masquerading = true;
@@ -1198,6 +1247,7 @@
boolean CheckMainDomain()
{
+ y2milestone("--Start CheckMainDomain ---");
integer maindomain = 0;
integer domains = 0;
@@ -1226,7 +1276,7 @@
any ComplexDialog()
{
-
+ y2milestone("--Start ComplexDialog ---");
Wizard::CreateTreeDialog();
list<map> Tree = GenerateTree([], "", MailServer::ModulesTreeContent) ;
Wizard::CreateTree(Tree, _("Mail Server Configuration"));
Modified: trunk/mail/src/mail-server_ldap-setup.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/mail-server_ldap-setup.…
==============================================================================
--- trunk/mail/src/mail-server_ldap-setup.ycp (original)
+++ trunk/mail/src/mail-server_ldap-setup.ycp Mon Oct 29 17:49:55 2007
@@ -33,7 +33,7 @@
y2milestone("--- mail-server-ldap-setup ---");
// First we check if all requested modules are installed
- if( !Package::Installed ( "ldap-server" ) )
+ if( !Package::Installed ( "yast2-ldap-server" ) )
{
l_to_install = add( l_to_install, "yast2-ldap-server" );
to_install = to_install + "yast2-ldap-server\n";
@@ -75,18 +75,5 @@
{
WFM::CallFunction("ldap",[]);
}
- Ldap::Read();
- Ldap::LDAPInit();
- map<string, any> LDAPSettings = (map<string, any>)Ldap::Export();
- string adminpw = Ldap::LDAPAskAndBind(false);
- MailServerLDAP::ConfigureLDAPServer(LDAPSettings);
- if( adminpw != nil )
- {
- YaPI::MailServer::ResetMailServer(adminpw,LDAPSettings);
- }
- else
- {
- return false;
- }
return true;
}
Modified: trunk/mail/src/mail.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/mail/src/mail.ycp?rev=41625&r1=4…
==============================================================================
--- trunk/mail/src/mail.ycp (original)
+++ trunk/mail/src/mail.ycp Mon Oct 29 17:49:55 2007
@@ -139,7 +139,6 @@
Popup::Error(_("You have to select a configuration type"));
continue;
}
- SCR::Write (.sysconfig.mail.CONFIG_TYPE, sret);
y2milestone ("Mail configuration type %1", sret);
break;
}
@@ -205,7 +204,10 @@
{
ret = WFM::CallFunction("mail-standard",args);
}
-
+ if( ret != nil && ret != `cancel && ret != `abort )
+ {
+ SCR::Write (.sysconfig.mail.CONFIG_TYPE, conf_type);
+ }
}
define boolean Setup (map<string, string> options) ``{
--
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] r41624 - /trunk/printer/testsuite/tests/storePrinter.out
by mzugec@svn.opensuse.org 29 Oct '07
by mzugec@svn.opensuse.org 29 Oct '07
29 Oct '07
Author: mzugec
Date: Mon Oct 29 16:33:04 2007
New Revision: 41624
URL: http://svn.opensuse.org/viewcvs/yast?rev=41624&view=rev
Log:
fixed testsuite
Modified:
trunk/printer/testsuite/tests/storePrinter.out
Modified: trunk/printer/testsuite/tests/storePrinter.out
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/testsuite/tests/storePri…
==============================================================================
--- trunk/printer/testsuite/tests/storePrinter.out (original)
+++ trunk/printer/testsuite/tests/storePrinter.out Mon Oct 29 16:33:04 2007
@@ -6,8 +6,8 @@
Dump [$["changed":true, "database":"foomatic", "name":"zzz", "ppd_info":$["filter":"foomatic-rip"], "uri":"lpd://unknown.suse.de/lp_rem", "valid":true]]
Dump zzz
Return nil
-Dump [$["changed":true, "database":"foomatic", "name":"zzz", "ppd_info":$["filter":"foomatic-rip"], "uri":"lpd://unknown.suse.de/lp_rem", "valid":true], $["changed":true, "database":"foomatic", "name":"lp", "ppd_info":$["filter":"foomatic-rip"], "uri":"filtering://localhost/zzz", "valid":false]]
+Dump [$["changed":true, "database":"foomatic", "name":"zzz", "ppd_info":$["filter":"foomatic-rip"], "uri":"lpd://unknown.suse.de/lp_rem", "valid":true]]
Dump lp
Return nil
-Dump [$["changed":true, "database":"foomatic", "name":"zzz", "ppd_info":$["filter":"foomatic-rip"], "uri":"lpd://known.suse.de/lp", "valid":true], $["changed":true, "database":"foomatic", "name":"lp", "ppd_info":$["filter":"foomatic-rip"], "uri":"filtering://localhost/zzz", "valid":false]]
+Dump [$["changed":true, "database":"foomatic", "name":"zzz", "ppd_info":$["filter":"foomatic-rip"], "uri":"lpd://known.suse.de/lp", "valid":true]]
Dump zzz
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
29 Oct '07
Author: mcalmer
Date: Mon Oct 29 16:19:17 2007
New Revision: 41623
URL: http://svn.opensuse.org/viewcvs/yast?rev=41623&view=rev
Log:
Created tag stable-2_16_2 for ca-management
Added:
tags/stable-2_16_2/ca-management/
- copied from r41622, trunk/ca-management/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0