#101710# add: error messages for failed driver removal

This commit is contained in:
Philipp Lohmann 2002-08-27 10:24:04 +00:00
parent d476fe8c2d
commit cd570e40ab
3 changed files with 46 additions and 15 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: adddlg.cxx,v $
*
* $Revision: 1.11 $
* $Revision: 1.12 $
*
* last change: $Author: pl $ $Date: 2002-07-24 18:49:09 $
* last change: $Author: pl $ $Date: 2002-08-27 11:24:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -246,11 +246,19 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton )
{
int nSelect = m_aDriverBox.GetSelectEntryPos(i);
String aDriver( *(String*)m_aDriverBox.GetEntryData( nSelect ) );
// never delete the default driver
if( aDriver.EqualsIgnoreCaseAscii( "SGENPRT" ) )
continue;
if( aDriver.Len() )
{
// never delete the default driver
if( aDriver.EqualsIgnoreCaseAscii( "SGENPRT" ) )
{
String aText( PaResId( RID_ERR_REMOVESGENPRT ) );
aText.SearchAndReplace( String::CreateFromAscii( "%s" ), m_aDriverBox.GetSelectEntry( i ) );
ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK, aText );
aErrorBox.SetText( m_aRemStr );
aErrorBox.Execute();
continue;
}
PrinterInfo aDefInfo( rPIManager.getPrinterInfo( rPIManager.getDefaultPrinter() ) );
// for comparisons convert to a OUString
OUString aPPD( aDriver );
@ -328,7 +336,15 @@ IMPL_LINK( APChooseDriverPage, ClickBtnHdl, PushButton*, pButton )
if( file->Copy( 0, nPos ) == String( aPPD ) )
{
ByteString aSysPath( aFile, aEncoding );
unlink( aSysPath.GetBuffer() );
if( unlink( aSysPath.GetBuffer() ) )
{
String aText( PaResId( RID_ERR_REMOVEDRIVERFAILED ) );
aText.SearchAndReplace( String::CreateFromAscii( "%s1" ), m_aDriverBox.GetSelectEntry( i ) );
aText.SearchAndReplace( String::CreateFromAscii( "%s2" ), aFile );
ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK, aText );
aErrorBox.SetText( m_aRemStr );
aErrorBox.Execute();
}
}
}
}

View file

@ -2,9 +2,9 @@
*
* $RCSfile: padialog.hrc,v $
*
* $Revision: 1.7 $
* $Revision: 1.8 $
*
* last change: $Author: pl $ $Date: 2001-06-27 16:03:31 $
* last change: $Author: pl $ $Date: 2002-08-27 11:24:03 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -140,17 +140,20 @@
#define RID_FNTNM_STR_TTCRENAME 8
#define RID_FNTNM_STR_NOTRENAMABLE 9
#define RID_TXT_REFETCH 1031
#define RID_TXT_REFETCH 1031
#define RID_BXT_TESTPAGE 1034
#define RID_BXT_ENVIRONMENT 1035
#define RID_BXT_TESTPAGE 1034
#define RID_BXT_ENVIRONMENT 1035
#define RID_YOU_SURE 1040
#define RID_YOU_SURE 1040
#define RID_BUTTERFLY 1047
#define RID_ERR_REMOVEDRIVERFAILED 1041
#define RID_BUTTERFLY 1047
#define RID_COMMAND_TXT_MODIFY 1049
#define RID_COMMAND_TXT_ADDENTRY 1050
#define RID_ERR_REMOVESGENPRT 1051
#define RID_PA_TXT_NOWRITE 1052
#define RID_DOUBLEFONTFILE 1053
#define RID_INVALIDFONTPATH 1054

View file

@ -2,9 +2,9 @@
*
* $RCSfile: padialog.src,v $
*
* $Revision: 1.36 $
* $Revision: 1.37 $
*
* last change: $Author: rt $ $Date: 2002-06-10 15:24:38 $
* last change: $Author: pl $ $Date: 2002-08-27 11:24:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -2295,6 +2295,18 @@ String RID_QUERY_DRIVERUSED
Text[ thai ] = "มีเครื่องพิมพ์ที่ใช้ไดร้ฟ์เวอร์ \"%s\"อยู่ คุณต้องการเอาออกหรือไม่? จะเอาเครื่องพิมพ์ที่มีลักษณะเช่นเดียวกันออกด้วย";
};
String RID_ERR_REMOVESGENPRT
{
Text = "Der Treiber \"%s\" wird immer gebraucht und kann daher nicht entfernt werden.";
Text [ English ] = "The driver \"%s\" is always needed and can therefore not be removed.";
};
String RID_ERR_REMOVEDRIVERFAILED
{
Text = "Der Treiber \"%s1\" konnte nicht entfernt werden. Das Löschen der Datei\n\n%s2\n\nist fehlgeschlagen.";
Text [ English ] = "The driver \"%s1\" could not be removed. Removing the file\n\n%s2\n\nwas not possible.";
};
String RID_ERR_REMOVEDEFAULTDRIVER
{
Text = "Der Treiber \"%s\" wird von Ihrem Standarddrucker verwendet. Deshalb kann er nicht entfernt werden.";