Skip to content

Commit

Permalink
YCP Killer: Apply changes needed for Ruby translation
Browse files Browse the repository at this point in the history
This module needed few changes before it was possible to translate its
YCP files into Ruby. This commit performs them.

The commit is a result of running YCP Killer's "patch" command. The
history of the applied patch is available here:

  https://github.com/yast/ycp-killer/commits/master/patches/printer.patch

See also:

  https://github.com/yast/ycp-killer
  • Loading branch information
yast-bot committed Jul 30, 2013
1 parent 194f791 commit 8de5181
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
28 changes: 18 additions & 10 deletions src/include/printer/connectionwizard.ycp
Expand Up @@ -590,9 +590,9 @@ void changeSettingsDialog( symbol selected )
( _("The RPM package hplip is not installed.") )
)
);
break;
}
content = getContentFromBackend("hp");
else
{ content = getContentFromBackend("hp"); }
break;
case(`serial):
current_device_uri = getCurrentDeviceURI();
Expand Down Expand Up @@ -986,9 +986,10 @@ void changeSettingsDialog( symbol selected )
( _("The RPM package bluez-cups is not installed.") )
)
);
break;
}
}
else
{
// Fallback message what the user may run manually when it fails
// to generate a valid list of bluetooth device IDs:
string bluetooth_device_list = _("It seems there are no bluetooth device IDs.\nRun 'hcitool scan' to get the bluetooth device IDs.\nEnter the ID without colons like '1A2B3C4D5E6F'.");
Expand Down Expand Up @@ -1098,6 +1099,7 @@ void changeSettingsDialog( symbol selected )
),
model_content
);
}
break;
// Access network printer or printserver box via
case(`tcp):
Expand Down Expand Up @@ -1264,9 +1266,10 @@ void changeSettingsDialog( symbol selected )
( _("The RPM package samba-client is not installed.") )
)
);
break;
}
}
else
{
hostname = "";
domain = "";
printer = "";
Expand Down Expand Up @@ -1433,6 +1436,7 @@ void changeSettingsDialog( symbol selected )
),
model_content
);
}
break;
case(`lpr):
hostname = "";
Expand Down Expand Up @@ -1616,9 +1620,10 @@ void changeSettingsDialog( symbol selected )
( _("The RPM package ncpfs is not installed.") )
)
);
break;
}
}
else
{
hostname = "";
queue = "";
user = "";
Expand Down Expand Up @@ -1702,6 +1707,7 @@ void changeSettingsDialog( symbol selected )
),
model_content
);
}
break;
// Special
case(`uri):
Expand Down Expand Up @@ -1783,9 +1789,10 @@ void changeSettingsDialog( symbol selected )
( _("The RPM package cups-backends is not installed.") )
)
);
break;
}
}
else
{
uri = "";
current_device_uri = getCurrentDeviceURI();
if( "pipe:/" == substring( current_device_uri, 0, size( "pipe:/" ) ) )
Expand All @@ -1809,6 +1816,7 @@ void changeSettingsDialog( symbol selected )
),
model_content
);
}
break;
case(`beh):
uri = "";
Expand Down Expand Up @@ -2166,22 +2174,22 @@ boolean validateAndMakeURI( symbol selected )
// because there is no connection available to be selected:
_("If no connection is shown here, it is not possible\nto access the device via this type of connection.\nWas the printer connected and switched on all the time?")
);
break;
}
if( selected_connection_index < 0 )
} else if ( selected_connection_index < 0 )
{ Popup::AnyMessage( // Header of a Popup::AnyMessage when an invalid connection was selected:
_("Select a valid connection"),
// Body of a Popup::AnyMessage when an invalid connection was selected
// because the current connection is no longer valid:
_("When the current connection is no longer valid,\nit does no longer work to access the device via this connection.\nIs the printer still connected and switched on?")
);
break;
}
else
{
connection_uri = Printer::connections[selected_connection_index,"uri"]:"";
connection_model = Printer::connections[selected_connection_index,"model"]:"Unknown";
if( "" != connection_uri )
{ valid = true;
}
}
break;
case(`serial):
string serial_device_node = (string)UI::QueryWidget( `serial_device_node, `Value );
Expand Down
2 changes: 1 addition & 1 deletion testsuite/Makefile.am
Expand Up @@ -5,7 +5,7 @@
#

AUTOMAKE_OPTIONS = dejagnu
EXTRA_DIST = $(wildcard tests/*.out) $(wildcard tests/*.err) $(wildcard tests/*.ycp) $(wildcard tests/*.yh)
EXTRA_DIST = $(wildcard tests/*.out) $(wildcard tests/*.err) $(wildcard tests/*.rb)

testsuite_prepare = @ydatadir@/testsuite/Makefile.testsuite

Expand Down
4 changes: 3 additions & 1 deletion yast2-printer.spec.in
Expand Up @@ -18,6 +18,8 @@ Requires: yast2 >= 2.16.12
# which are pulled in by Autoreqprov because of the basicadd_displaytest tool:
%define my_requires /tmp/my-requires

Requires: yast2-ruby-bindings >= 1.0.0

Summary: YaST2 - Printer Configuration
License: GPL-2.0
Group: Documentation/SUSE
Expand Down Expand Up @@ -55,7 +57,7 @@ chmod 755 %{my_requires}
%defattr(-,root,root)
%dir @yncludedir@/printer
@desktopdir@/printer.desktop
@moduledir@/*.y*
@moduledir@/*.rb
@clientdir@/printer*
@yncludedir@/printer/*
@schemadir@/autoyast/rnc/printer.rnc
Expand Down

0 comments on commit 8de5181

Please sign in to comment.