void BoxContainerItem::fillKPopupMenu(KPopupMenu *popupMenu, KActionCollection *actions) const
{
    /*popupMenu->insertItem( i18n( "&Configure" ), this, SLOT( slotConfigure() ) );
    popupMenu->insertItem( i18n( "&Recheck" ), this, SLOT( slotRecheck() ) );
    popupMenu->insertItem( i18n( "R&eset Counter" ), this, SLOT( slotReset() ) );
    popupMenu->insertItem( i18n( "&View Emails" ), this, SLOT( slotView() ) );
    popupMenu->insertItem( i18n( "R&un Command" ), this, SLOT( slotRunCommand() ) );*/

    (new KAction(i18n("&Configure"),     KShortcut(), this, SLOT(slotConfigure()), actions))->plug(popupMenu);
    (new KAction(i18n("&Recheck"),       KShortcut(), this, SLOT(slotRecheck()), actions))->plug(popupMenu);
    (new KAction(i18n("R&eset Counter"), KShortcut(), this, SLOT(slotReset()), actions))->plug(popupMenu);
    (new KAction(i18n("&View Emails"),   KShortcut(), this, SLOT(slotView()), actions))->plug(popupMenu);
    (new KAction(i18n("R&un Command"),   KShortcut(), this, SLOT(slotRunCommand()), actions))->plug(popupMenu);
    popupMenu->insertSeparator();
    KStdAction::help(this, SLOT(help()), actions)->plug(popupMenu);
    KStdAction::reportBug(this, SLOT(reportBug()), actions)->plug(popupMenu);
    KStdAction::aboutApp(this, SLOT(about()), actions)->plug(popupMenu);
}
Beispiel #2
0
void KMMimePartTree::itemRightClicked( QListViewItem* item,
                                       const QPoint& point )
{
    // TODO: remove this member var?
    mCurrentContextMenuItem = dynamic_cast<KMMimePartTreeItem*>( item );
    if ( 0 == mCurrentContextMenuItem ) {
        kdDebug(5006) << "Item was not a KMMimePartTreeItem!" << endl;
    }
    else {
        kdDebug(5006) << "\n**\n** KMMimePartTree::itemRightClicked() **\n**" << endl;

        QPopupMenu* popup = new QPopupMenu;
        if ( mCurrentContextMenuItem->node()->nodeId() > 2 &&
             mCurrentContextMenuItem->node()->typeString() != "Multipart" ) {
          popup->insertItem( SmallIcon("fileopen"), i18n("to open", "Open"), this, SLOT(slotOpen()) );
          popup->insertItem( i18n("Open With..."), this, SLOT(slotOpenWith()) );
          popup->insertItem( i18n("to view something", "View"), this, SLOT(slotView()) );
        }
        popup->insertItem( SmallIcon("filesaveas"),i18n( "Save &As..." ), this, SLOT( slotSaveAs() ) );
        /*
         * FIXME mkae optional?
        popup->insertItem( i18n( "Save as &Encoded..." ), this,
                           SLOT( slotSaveAsEncoded() ) );
        */
        popup->insertItem( i18n( "Save All Attachments..." ), this,
                           SLOT( slotSaveAll() ) );
        // edit + delete only for attachments
        if ( mCurrentContextMenuItem->node()->nodeId() > 2 &&
             mCurrentContextMenuItem->node()->typeString() != "Multipart" ) {
          popup->insertItem( SmallIcon("editcopy"), i18n("Copy"), this, SLOT(slotCopy()) );
          if ( GlobalSettings::self()->allowAttachmentDeletion() )
            popup->insertItem( SmallIcon("editdelete"), i18n( "Delete Attachment" ),
                               this, SLOT( slotDelete() ) );
          if ( GlobalSettings::self()->allowAttachmentEditing() )
            popup->insertItem( SmallIcon( "edit" ), i18n( "Edit Attachment" ),
                               this, SLOT( slotEdit() ) );
        }
        if ( mCurrentContextMenuItem->node()->nodeId() > 0 )
          popup->insertItem( i18n("Properties"), this, SLOT(slotProperties()) );
        popup->exec( point );
        delete popup;
        mCurrentContextMenuItem = 0;
    }
}
Beispiel #3
0
imageViewer::imageViewer(QWidget *parent): QLabel(parent)
{
  addToLog("image creation",LOGIMAG);
  validImage=false;
  setFrameStyle(QFrame::Sunken | QFrame::Panel);
  QBrush b;
  QPalette palette;
  b.setTexture(QPixmap::fromImage(QImage(":/icons/transparency.png")));
  palette.setBrush(QPalette::Active,QPalette::Base,b);
  palette.setBrush(QPalette::Inactive,QPalette::Base,b);
  palette.setBrush(QPalette::Disabled,QPalette::Base,b);
  setPalette(palette);
  setBackgroundRole(QPalette::Base);
  setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);

  setBackgroundRole(QPalette::Dark);

  popup=new QMenu (this);
  newAct = new QAction(tr("&New"),this);
  connect(newAct, SIGNAL(triggered()), this, SLOT(slotNew()));
  loadAct = new QAction(tr("&Load"), this);
  connect(loadAct, SIGNAL(triggered()), this, SLOT(slotLoad()));
  toTXAct = new QAction(tr("&To TX"), this);
  connect(toTXAct, SIGNAL(triggered()), this, SLOT(slotToTX()));
  editAct = new QAction(tr("&Edit"), this);
  connect(editAct, SIGNAL(triggered()), this, SLOT(slotEdit()));
  printAct = new QAction(tr("&Print"), this);
  connect(printAct, SIGNAL(triggered()), this, SLOT(slotPrint()));
  deleteAct = new QAction(tr("&Delete"), this);
  connect(deleteAct, SIGNAL(triggered()), this, SLOT(slotDelete()));
  viewAct = new QAction(tr("&View"), this);
  connect(viewAct, SIGNAL(triggered()), this, SLOT(slotView()));
  propertiesAct = new QAction(tr("Propert&ies"), this);
  connect(propertiesAct, SIGNAL(triggered()), this, SLOT(slotProperties()));
  connect(configDialogPtr,SIGNAL(bgColorChanged()), SLOT(slotBGColorChanged()));

  init(RXIMG);
  activeMovie=false;
  //
}
Beispiel #4
0
ReportList::ReportList(MainWindow* main)
    : QuasarWindow(main, "ReportList")
{
    _helpSource = "report_list.html";

    QVBox* frame = new QVBox(this);
    QSplitter* split = new QSplitter(frame);
    QFrame* buttons = new QFrame(frame);

    _module = new ListView(split);
    _module->addTextColumn(tr("Module"), 20);
    _module->setSorting(-1);
    connect(_module, SIGNAL(selectionChanged()), SLOT(slotModuleChange()));

    _stack = new QWidgetStack(split);

    QPushButton* refresh = new QPushButton(tr("Refresh"), buttons);
    QPushButton* view = new QPushButton(tr("View"), buttons);
    QPushButton* close = new QPushButton(tr("Close"), buttons);

    connect(refresh, SIGNAL(clicked()), SLOT(slotRefresh()));
    connect(view, SIGNAL(clicked()), SLOT(slotView()));
    connect(close, SIGNAL(clicked()), SLOT(close()));

    QGridLayout* buttonGrid = new QGridLayout(buttons);
    buttonGrid->setMargin(3);
    buttonGrid->setSpacing(3);
    buttonGrid->setColStretch(1, 1);
    buttonGrid->addWidget(refresh, 0, 0);
    buttonGrid->addWidget(view, 0, 2);
    buttonGrid->addWidget(close, 0, 3);

    setCaption(tr("Report List"));
    setCentralWidget(frame);

    clearData();
    finalize();

    slotRefresh();
}
bool GeneralSetupWizard::Create()
{
    bool foundtheme = false;

    // Load the theme for this screen
    foundtheme = LoadWindowFromXML("config-ui.xml", "generalwizard", this);

    if (!foundtheme)
        return false;

    m_submitButton = dynamic_cast<MythUIButton *> (GetChild("submit"));
    m_viewButton = dynamic_cast<MythUIButton *> (GetChild("view"));
    m_deleteButton = dynamic_cast<MythUIButton *> (GetChild("delete"));

    m_nextButton = dynamic_cast<MythUIButton *> (GetChild("next"));
    m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel"));

    m_profileLocation = dynamic_cast<MythUIText *> (GetChild("profiletext"));
    m_adminPassword = dynamic_cast<MythUIText *> (GetChild("profilepassword"));

    if (!m_submitButton || !m_viewButton || !m_deleteButton ||
        !m_nextButton || !m_cancelButton)
    {
        LOG(VB_GENERAL, LOG_ERR, "Theme is missing critical theme elements.");
        return false;
    }

    m_submitButton->SetHelpText( tr("Anonymously submit a profile of your hardware. "
                                    "This helps the developers to determine where "
                                    "to focus their efforts.") );
    m_viewButton->SetHelpText( tr("Visit your online hardware profile. (This requires "
                                  "that you have the MythBrowser plugin installed)") );
    m_deleteButton->SetHelpText( tr("Delete your online hardware profile.") );

    m_nextButton->SetHelpText( tr("Save these changes and move on to the "
                                  "next configuration step.") );
    m_cancelButton->SetHelpText( tr("Exit this wizard, save no changes.") );

    connect(m_submitButton, SIGNAL(Clicked()), this, SLOT(slotSubmit()));
    connect(m_viewButton, SIGNAL(Clicked()), this, SLOT(slotView()));
    connect(m_deleteButton, SIGNAL(Clicked()), this, SLOT(slotDelete()));

    connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(slotNext()));
    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close()));

    BuildFocusList();
    loadData();

#ifndef __linux__
#ifndef CONFIG_BINDINGS_PYTHON
    // The hardware profiler only works on linux.
    // Make the widgets invisible on other platforms.

    m_submitButton->Hide();
    m_viewButton->Hide();
    m_deleteButton->Hide();

    if (m_profileLocation)
        m_profileLocation->Hide();

    if (m_adminPassword)
        m_adminPassword->Hide();
#endif
#endif

    return true;
}