当前位置: 首页>>代码示例>>C++>>正文


C++ KMPrinter::isSpecial方法代码示例

本文整理汇总了C++中KMPrinter::isSpecial方法的典型用法代码示例。如果您正苦于以下问题:C++ KMPrinter::isSpecial方法的具体用法?C++ KMPrinter::isSpecial怎么用?C++ KMPrinter::isSpecial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KMPrinter的用法示例。


在下文中一共展示了KMPrinter::isSpecial方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: slotPrinterSelected

void KMMainView::slotPrinterSelected(const QString &prname)
{
    KMPrinter *p = KMManager::self()->findPrinter(prname);
    m_current = p;
    if(p && !p->isSpecial())
        KMFactory::self()->manager()->completePrinter(p);
    m_printerpages->setPrinter(p);

    // update actions state (only if toolbar enabled, workaround for toolbar
    // problem).
    // if (m_toolbar->isEnabled())
    //{
    int mask = (m_manager->hasManagement() ? m_manager->printerOperationMask() : 0);
    bool sp = !(p && p->isSpecial());
    m_actions->action("printer_remove")->setEnabled(!sp || ((mask & KMManager::PrinterRemoval) && p && p->isLocal() && !p->isImplicit()));
    m_actions->action("printer_configure")->setEnabled(!sp || ((mask & KMManager::PrinterConfigure) && p && !p->isClass(true) /*&& p->isLocal()*/));
    m_actions->action("printer_hard_default")
        ->setEnabled((sp && (mask & KMManager::PrinterDefault) && p && !p->isClass(true) && !p->isHardDefault() && p->isLocal()));
    m_actions->action("printer_soft_default")->setEnabled((p && !p->isSoftDefault()));
    m_actions->action("printer_test")->setEnabled((sp && (mask & KMManager::PrinterTesting) && p && !p->isClass(true)));
    bool stmask = (sp && (mask & KMManager::PrinterEnabling) && p);
    m_actions->action("printer_state_change")->setEnabled(stmask && p->isLocal());
    m_actions->action("printer_spool_change")->setEnabled(stmask);
    m_actions->action("printer_start")->setEnabled((stmask && p->state() == KMPrinter::Stopped));
    m_actions->action("printer_stop")->setEnabled((stmask && p->state() != KMPrinter::Stopped));
    m_actions->action("printer_enable")->setEnabled((stmask && !p->acceptJobs()));
    m_actions->action("printer_disable")->setEnabled((stmask && p->acceptJobs()));

    m_actions->action("printer_add")->setEnabled((mask & KMManager::PrinterCreation));
    mask = m_manager->serverOperationMask();
    m_actions->action("server_restart")->setEnabled((mask & KMManager::ServerRestarting));
    m_actions->action("server_configure")->setEnabled((mask & KMManager::ServerConfigure));

    KMFactory::self()->manager()->validatePluginActions(m_actions, p);
    //}
    m_actions->action("printer_tool")->setEnabled(p && !p->isClass(true) && !p->isRemote() && !p->isSpecial());
}
开发者ID:,项目名称:,代码行数:37,代码来源:

示例2: addToManager

void KMJobViewer::addToManager()
{
    if (m_prname == i18n("All Printers"))
    {
        loadPrinters();
        QPtrListIterator<KMPrinter>	it(m_printers);
        for (; it.current(); ++it)
            m_manager->addPrinter(it.current()->printerName(), (KMJobManager::JobType)m_type, it.current()->isSpecial());
    }
    else if (!m_prname.isEmpty())
    {
        KMPrinter *prt = KMManager::self()->findPrinter( m_prname );
        bool isSpecial = ( prt ? prt->isSpecial() : false );
        m_manager->addPrinter(m_prname, (KMJobManager::JobType)m_type, isSpecial);
    }
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例3: initialize

void PrintMenu::initialize()
{
    if (initialized()) clear();
    setInitialized(true);

    int ID = PRINTER_LIST_ID;
    // just to be sure the plugin is loaded -> icons are available
    KMManager::self();

    if ((KMManager::self()->printerOperationMask() & KMManager::PrinterCreation) && KMManager::self()->hasManagement())
        insertItem(KIcon("wizard"), i18n("Add Printer..."), ADD_PRINTER_ID);
    insertItem(KIcon("kdeprint-configmgr"), i18n("KDE Print Settings"), KDEPRINT_SETTINGS_ID);
    if (KMManager::self()->serverOperationMask() & KMManager::ServerConfigure)
        insertItem(KIcon("kdeprint-configsrv"), i18n("Configure Server"), CONFIG_SERVER_ID);
    addSeparator();
    insertItem(KIcon("kcontrol"), i18n("Print Manager"), PRINT_MANAGER_ID);
    insertItem(KIcon("konqueror"), i18n("Print Browser (Konqueror)"), PRINT_BROWSER_ID);
    addSeparator();
    insertItem(KIcon("document-print"), i18n("Print File..."), KPRINTER_ID);

    // printer list
    QList<KMPrinter*>    l = KMManager::self()->printerList();
    if (!l.isEmpty())
    {
        bool separatorInserted = false;
		QListIterator<KMPrinter*>       it(l);
		while (it.hasNext())
        {
			KMPrinter *itprt = it.next();
            // no special, implicit or pure instances
            if (itprt->isSpecial() || itprt->isVirtual())
                continue;
            if (!separatorInserted)
            {
                // we insert a separator only when we find the first
                // printer
                addSeparator();
                separatorInserted = true;
            }
            insertItem(KIcon(itprt->pixmap()),
                       itprt->printerName(), ID++);
        }
    }
}
开发者ID:jschwartzenberg,项目名称:kicker,代码行数:44,代码来源:print_mnu.cpp

示例4: slotSettings

void KMInstancePage::slotSettings()
{
    KMTimer::self()->hold();

    QString src = m_view->currentText();
    if(!src.isEmpty())
    {
        if(src == i18n("(Default)"))
            src = QString::null;
        KMPrinter *pr = KMFactory::self()->virtualManager()->findInstance(m_printer, src);
        if(!pr)
            KMessageBox::error(this, i18n("Unable to find instance %1.").arg(m_view->currentText()));
        else if(!pr->isSpecial() && !KMFactory::self()->manager()->completePrinterShort(pr))
            KMessageBox::error(
                this,
                i18n("Unable to retrieve printer information. Message from printing system: %1.").arg(KMFactory::self()->manager()->errorMsg()));
        else
        {
            int oldAppType = KMFactory::self()->settings()->application;
            KMFactory::self()->settings()->application = -1;
            KPrinterPropertyDialog::setupPrinter(pr, this);
            KMFactory::self()->settings()->application = oldAppType;
            if(pr->isEdited())
            { // printer edited, need to save changes
                pr->setDefaultOptions(pr->editedOptions());
                pr->setEditedOptions(QMap< QString, QString >());
                pr->setEdited(false);
                KMFactory::self()->virtualManager()->triggerSave();
            }
        }
    }
    else
        KMessageBox::error(this, i18n("The instance name is empty. Please select an instance."));

    KMTimer::self()->release();
}
开发者ID:,项目名称:,代码行数:36,代码来源:

示例5: slotRightButtonClicked

void KMMainView::slotRightButtonClicked(const QString &prname, const QPoint &p)
{
    KMPrinter *printer = KMManager::self()->findPrinter(prname);
    // construct popup menu
    m_pop->clear();
    if(printer)
    {
        m_current = printer;
        if(!printer->isSpecial())
        {
            if(printer->isLocal())
                m_actions->action((printer->state() == KMPrinter::Stopped ? "printer_start" : "printer_stop"))->plug(m_pop);
            m_actions->action((printer->acceptJobs() ? "printer_disable" : "printer_enable"))->plug(m_pop);
            m_pop->insertSeparator();
        }
        if(!printer->isSoftDefault())
            m_actions->action("printer_soft_default")->plug(m_pop);
        if(printer->isLocal() && !printer->isImplicit())
        {
            if(!printer->isHardDefault())
                m_actions->action("printer_hard_default")->plug(m_pop);
            m_actions->action("printer_remove")->plug(m_pop);
            m_pop->insertSeparator();
            if(!printer->isClass(true))
            {
                m_actions->action("printer_configure")->plug(m_pop);
                m_actions->action("printer_test")->plug(m_pop);
                m_actions->action("printer_tool")->plug(m_pop);
                m_pop->insertSeparator();
            }
        }
        else
        {
            if(!printer->isClass(true))
            {
                m_actions->action("printer_configure")->plug(m_pop);
                m_actions->action("printer_test")->plug(m_pop);
            }
            m_pop->insertSeparator();
        }
        if(!printer->isSpecial())
        {
            QValueList< KAction * > pactions = m_actions->actions("plugin");
            for(QValueList< KAction * >::Iterator it = pactions.begin(); it != pactions.end(); ++it)
                (*it)->plug(m_pop);
            if(pactions.count() > 0)
                m_pop->insertSeparator();
        }
    }
    else
    {
        m_actions->action("printer_add")->plug(m_pop);
        m_actions->action("printer_add_special")->plug(m_pop);
        m_pop->insertSeparator();
        m_actions->action("server_restart")->plug(m_pop);
        m_actions->action("server_configure")->plug(m_pop);
        m_pop->insertSeparator();
        m_actions->action("manager_configure")->plug(m_pop);
        m_actions->action("view_refresh")->plug(m_pop);
        m_pop->insertSeparator();
    }
    m_actions->action("view_printerinfos")->plug(m_pop);
    m_actions->action("view_change")->plug(m_pop);
    m_actions->action("orientation_change")->plug(m_pop);
    m_actions->action("view_toolbar")->plug(m_pop);
    m_actions->action("view_menubar")->plug(m_pop);
    m_pop->insertSeparator();
    m_actions->action("view_pfilter")->plug(m_pop);

    // pop the menu
    m_pop->popup(p);
}
开发者ID:,项目名称:,代码行数:72,代码来源:


注:本文中的KMPrinter::isSpecial方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。