-/*
+/* -*- Mode: C; tab-width: 4 -*-
+ *
* Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
*
- * @APPLE_LICENSE_HEADER_START@
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
Change History (most recent first):
$Log: PrinterSetupWizardSheet.cpp,v $
+Revision 1.35 2006/08/14 23:24:09 cheshire
+Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
+
+Revision 1.34 2005/10/05 17:32:51 herscher
+<rdar://problem/4141221> Use a case insensitive compare operation to check whether a printer with the same name has already been installed.
+
+Revision 1.33 2005/07/11 20:17:15 shersche
+<rdar://problem/4124524> UI fixes associated with CUPS printer workaround fix.
+
+Revision 1.32 2005/07/07 17:53:20 shersche
+Fix problems associated with the CUPS printer workaround fix.
+
+Revision 1.31 2005/06/30 18:02:54 shersche
+<rdar://problem/4124524> Workaround for Mac OS X Printer Sharing bug
+
Revision 1.30 2005/04/13 17:46:22 shersche
<rdar://problem/4082122> Generic PCL not selected when printers advertise multiple text records
m_driverThreadFinished( false ),
m_pdlBrowser( NULL ),
m_ippBrowser( NULL ),
- m_lprBrowser( NULL )
+ m_lprBrowser( NULL ),
+ m_lastPage( NULL )
{
m_arrow = LoadCursor(0, IDC_ARROW);
m_wait = LoadCursor(0, IDC_APPSTARTING);
{
PRINTER_INFO_4 * lppi4 = (PRINTER_INFO_4*) (buffer + index * sizeof(PRINTER_INFO_4));
- m_printerNames[lppi4->pPrinterName] = lppi4->pPrinterName;
+ m_printerNames.push_back( lppi4->pPrinterName );
}
}
//
// if the driver isn't installed, then install it
//
+
if ( !printer->driverInstalled )
{
DWORD dwResult;
ok = OpenPrinter(L",XcvMonitor Standard TCP/IP Port", &hXcv, &printerDefaults);
err = translate_errno( ok, errno_compat(), kUnknownErr );
require_noerr( err, exit );
-
+
//
// BUGBUG: MSDN said this is not required, but my experience shows it is required
//
wcscpy(portData.sztQueue, q->name);
wcscpy(portData.sztIPAddress, service->hostname);
wcscpy(portData.sztHostAddress, service->hostname);
-
+
ok = XcvData(hXcv, L"AddPort", (PBYTE) &portData, sizeof(PORT_DATA_1), pOutputData, cbInputData, &cbOutputNeeded, &dwStatus);
err = translate_errno( ok, errno_compat(), kUnknownErr );
require_noerr( err, exit );
for (;;)
{
- CPrinterSetupWizardSheet::PrinterNameMap::iterator it;
+ CPrinterSetupWizardSheet::PrinterNames::iterator it;
+
+ // <rdar://problem/4141221> Don't use find to do comparisons because we need to
+ // do a case insensitive string comparison
- it = m_printerNames.find(printer->actualName);
+ for ( it = m_printerNames.begin(); it != m_printerNames.end(); it++ )
+ {
+ if ( (*it).CompareNoCase( printer->actualName ) == 0 )
+ {
+ break;
+ }
+ }
if (it != m_printerNames.end())
{
{
// Make sure that the active page is page 2
- check( GetActivePage() == &m_pgSecond );
+ require_quiet( GetActivePage() == &m_pgSecond, exit );
if ( !--service->printer->resolving )
{
m_pgSecond.OnResolveService( service );
}
+
+exit:
+
+ return;
}
q->priority = atoi( buf );
}
+ // <rdar://problem/4124524> Was this printer discovered via OS X Printer Sharing?
+
+ if ( TXTRecordContainsKey( inTXTSize, inTXT, "printer-state" ) || TXTRecordContainsKey( inTXTSize, inTXT, "printer-type" ) )
+ {
+ service->printer->isSharedFromOSX = true;
+ }
+
exit:
// The following code is to fix a problem with older HP