Пример #1
0
dialogAnalog::dialogAnalog( int nbbits,QWidget * parent, Qt::WFlags f) : QDialog(parent, f)
{
	setupUi(this);

    connect(chkBCapture, SIGNAL(stateChanged(int)), this, SLOT(updatecapture(int))); 
    connect(pbZoomIn, SIGNAL(clicked()), this, SLOT(zoomin())); 
    connect(pbZoomOut, SIGNAL(clicked()), this, SLOT(zoomout())); 
    connect(pbFit, SIGNAL(clicked()), this, SLOT(fitmarkers())); 
    connect(hlScrollBar, SIGNAL(valueChanged(int)), this, SLOT(scroll(int))); 
    connect(pbSave, SIGNAL(clicked()), this, SLOT(slotSave())); 
    connect(pbLoad, SIGNAL(clicked()), this, SLOT(slotLoad())); 
    connect(pbMarker, SIGNAL(clicked()), this, SLOT(slotMarker())); 
    connect(twWatchPoint, SIGNAL(currentItemChanged ( QTreeWidgetItem * , QTreeWidgetItem * )), this, SLOT(slotChangeWatchPoint( QTreeWidgetItem * , QTreeWidgetItem * ))); 

    connect(mainwindow,SIGNAL(DestroySignal(CPObject*)),this,SLOT(DestroySlot(CPObject*)));

	Capture = false; 
    NbBits = nbbits;
    m_zoom = 1.0;
    pPC = 0;
    currentWatchPoint = 0;
    currentWatchPointSize=8;
    fill_twWatchPoint();
    twWatchPoint->expandAll();
}
Пример #2
0
//=============================================================================
// Constructor of the class CPhoto.
//=============================================================================
CPhoto::CPhoto (QString text, QWidget *parent, const char *name)
	: QLabel (text, parent,name)
{
  mMenu = new QPopupMenu (this);
  mMenu->insertItem (tr ("&Load"),   this, SLOT (slotLoad()));
  mMenu->insertItem (tr ("&Delete"), this, SLOT (slotDelete()));

  mContentChanged = false;
}
Пример #3
0
void imageViewer::slotEdit()
{
  if(imageFileName.isEmpty())
  {
    slotLoad();
    if (imageFileName.isEmpty()) return;
  }
  callEditorEvent *ce = new callEditorEvent( this,imageFileName );
  QApplication::postEvent(dispatcherPtr, ce );  // Qt will delete it when done
}
Пример #4
0
QucsEdit::QucsEdit(const QString& FileName_, bool readOnly)
{
  // set application icon
  setIcon (QPixmap(QucsSettings.BitmapDir + "big.qucs.xpm"));
  setCaption("Qucs Editor " PACKAGE_VERSION " - " + tr("File: "));

  QVBoxLayout *v = new QVBoxLayout(this);

  QHBox *h = new QHBox(this);
  v->addWidget(h);

  QToolButton *ButtLoad = new QToolButton(h);
  ButtLoad->setIconSet(
	    QIconSet(QImage(QucsSettings.BitmapDir + "fileopen.png")));
  connect(ButtLoad, SIGNAL(clicked()), SLOT(slotLoad()));

  QToolButton *ButtSave = new QToolButton(h);
  ButtSave->setIconSet(
            QIconSet(QImage(QucsSettings.BitmapDir + "filesave.png")));
  connect(ButtSave, SIGNAL(clicked()), SLOT(slotSave()));
  ButtSave->setDisabled(readOnly);

  h->setStretchFactor(new QWidget(h),5); // stretchable placeholder
  PosText = new QLabel(tr("Line: %1  -  Column: %2").arg(1).arg(1), h);
  h->setStretchFactor(new QWidget(h),5); // stretchable placeholder

  QPushButton *ButtAbout = new QPushButton(tr("About"),h);
  connect(ButtAbout, SIGNAL(clicked()), SLOT(slotAbout()));

  QPushButton *ButtOK = new QPushButton(tr("Quit"),h);
  connect(ButtOK, SIGNAL(clicked()), SLOT(slotQuit()));
  ButtOK->setFocus();

  // try using same-sized mono-spaced font in the textarea
  QFont fedit = QFont("Courier New");
  fedit.setPointSize(QucsSettings.font.pointSize()-1);
  fedit.setStyleHint(QFont::Courier);
  fedit.setFixedPitch(true);

  text = new QTextEdit(this);
  text->setTextFormat(Qt::PlainText);
  text->setReadOnly(readOnly);
  text->setWordWrap(QTextEdit::NoWrap);
  text->setMinimumSize(300,200);
  text->setFont(fedit);
  text->setCurrentFont(fedit);
  v->addWidget(text);
  connect(text, SIGNAL(cursorPositionChanged(int, int)),
          SLOT(slotPrintCursorPosition(int, int)));

  // .................................................
  loadFile(FileName_);
}
Пример #5
0
CMonitorProcesses::CMonitorProcesses( QWidget* pwidgetParent )
	: QTableWidget( pwidgetParent )
{
    setToolTip( tr( "list of processes currently owning one or more ODBC handles" ) );
    setWhatsThis( tr( "This shows a list of processes currently owning one or more ODBC handles. The number of handles are shown. This is revised frequently while in view. This is useful for debugging and monitoring performance." ) );

    // lets assume, for the moment, that we can get monitoring info from DM...
    bEnabled = true;

    // setup table...
    {
        // we remember rows from last load so we can optimize next load...
        nRowsWithValues = 0;

        // we use a fixed number of row/cols so init here...
        setRowCount( MAXPROCESSES );
        setColumnCount( 5 );

        // init headers and decorations...
        {
            QStringList stringlist;
            setHorizontalHeaderLabels( stringlist << "PID" << "Environments" << "Connections" << "Statements" << "Descriptors" );
            setSelectionBehavior( QAbstractItemView::SelectRows );
            setSelectionMode( QAbstractItemView::SingleSelection );
            verticalHeader()->setVisible( false );
        }
        
        // preload table with item objects...
        for ( int nRow = 0; nRow < rowCount(); nRow++ )
        {
            for ( int nCol = 0; nCol < columnCount(); nCol++ )
            {
                setItem( nRow, nCol, new QTableWidgetItem( "" ) );
            }
        }
    }

    // init timer...
    {
        hStats = 0;
        pTimer = new QTimer( this );
        connect( pTimer, SIGNAL(timeout()), SLOT(slotLoad()) );
        pTimer->start( 2000 ); // 1000 = 1second
    }
}
Пример #6
0
int CDriverList::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QTableWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: signalChanged(); break;
        case 1: slotAdd(); break;
        case 2: slotEdit(); break;
        case 3: slotDelete(); break;
        case 4: slotLoad(); break;
        case 5: slotDoubleClick((*reinterpret_cast< QTableWidgetItem*(*)>(_a[1]))); break;
        }
        _id -= 6;
    }
    return _id;
}
Пример #7
0
NaughtyApplet::NaughtyApplet
(
 const TQString & configFile,
 Type t,
 int actions,
 TQWidget * parent,
 const char * name
)
  : KPanelApplet(configFile, t, actions, parent, name)
{
  TDEGlobal::iconLoader()->addAppDir("naughtyapplet");
  setBackgroundOrigin( AncestorOrigin );

  button_ = new SimpleButton(this);
  button_->setFixedSize(20, 20);

  TQVBoxLayout * layout = new TQVBoxLayout(this);
  layout->addWidget(button_);

  monitor_ = new NaughtyProcessMonitor(2, 20, TQT_TQOBJECT(this));

  connect
    (
     button_,   TQT_SIGNAL(clicked()),
     this,      TQT_SLOT(slotPreferences())
    );

  connect
    (
     monitor_,  TQT_SIGNAL(runawayProcess(ulong, const TQString &)),
     this,      TQT_SLOT(slotWarn(ulong, const TQString &))
    );

  connect
    (
     monitor_,  TQT_SIGNAL(load(uint)),
     this,      TQT_SLOT(slotLoad(uint))
    );

  loadSettings();

  monitor_->start();
}
Пример #8
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;
  //
}
Пример #9
0
ClsQSAList::ClsQSAList ( QWidget * parent, ClsQGroupStateManip* _clsQGroupStateManip, const char * name, WFlags f) : 
    QFrame ( parent, name, f ), clsQGroupStateManip(_clsQGroupStateManip)  {


    strFilename = "";///home/ulysses/STATESEQ";
    
    QVBoxLayout* layoutMain = new QVBoxLayout( this, 5, -1, "mainL");


/* ------------------------------- */
    qlbox = new QListBox( this );
    qlbox->setVScrollBarMode(QScrollView::AlwaysOn);
//    qlbox->setHScrollBarMode(QScrollView::AlwaysOff);
//    qlbox->setColumnMode ( QListBox::FitToWidth );
//    qlbox->setColumnMode ( QListBox::FixedNumber );
    qlbox->setFixedWidth ( 150 );
//    qlbox->setResizePolicy(QScrollView::AutoOne);

    qlbox->setSelectionMode(QListBox::Extended);

    cQListBoxToolTip = new GQListBoxToolTip(qlbox);
   
    connect(qlbox, SIGNAL(doubleClicked(QListBoxItem*)), this, SLOT(slotDoubleClicked(QListBoxItem*)));
    layoutMain->addWidget(qlbox,10);
//    layoutMain->addMultiCellWidget(qlbox, 0, 0,0,3);


    QGridLayout* layoutButtons = new QGridLayout( 2, 6, -1, "layoutButtons");
    layoutButtons->setColStretch ( 0, 50 );

/* ------------------------------- */	
//--    QHBoxLayout* qlayoutEdit = new QHBoxLayout( layoutMain);

    QPushButton* qpbtnMoveUp = new QPushButton (QIconSet(QPixmap(up)), "",this);
    qpbtnMoveUp->setFlat(TRUE);
    connect(qpbtnMoveUp, SIGNAL(clicked()), this, SLOT(slotMoveUp()));
//--    qlayoutEdit->addWidget(qpbtnMoveUp);
    layoutButtons->addWidget(qpbtnMoveUp,0,1);
	
    QPushButton* qpbtnMoveDown = new QPushButton (QIconSet(QPixmap(down)), "",this);
    qpbtnMoveDown->setFlat(TRUE);
    connect(qpbtnMoveDown, SIGNAL(clicked()), this, SLOT(slotMoveDown()));
//--    qlayoutEdit->addWidget(qpbtnMoveDown);
    layoutButtons->addWidget(qpbtnMoveDown,0,2);

    QPushButton* qpbtnInvert = new QPushButton (QIconSet(QPixmap(invert2)), "",this);
    qpbtnInvert->setFlat(TRUE);
    connect(qpbtnInvert, SIGNAL(clicked()), this, SLOT(slotInvert()));
//--    qlayoutEdit->addWidget(qpbtnInvert);
    layoutButtons->addWidget(qpbtnInvert,0,3);

    QPushButton* qpbtnDelete = new QPushButton (QIconSet(QPixmap(trash2)), "",this);
    connect(qpbtnDelete, SIGNAL(clicked()), this, SLOT(slotDeleteItem()));
    qpbtnDelete->setFlat(TRUE);
//--    qlayoutEdit->addWidget(qpbtnDelete);
    layoutButtons->addWidget(qpbtnDelete,0,4);

/* ------------------------------- */
//--    QHBoxLayout* qlayout2 = new QHBoxLayout( layoutMain);

    QPushButton* qpbtnSave = new QPushButton (QIconSet(QPixmap(filesave)), "",this);
    connect(qpbtnSave, SIGNAL(clicked()), this, SLOT(slotSave()));
    qpbtnSave->setFlat(TRUE);
//--    qlayout2->addWidget(qpbtnSave);
    layoutButtons->addWidget(qpbtnSave,1,1);

    QPushButton* qpbtnSaveAs = new QPushButton (QIconSet(QPixmap(filesaveas)), "",this);
    connect(qpbtnSaveAs, SIGNAL(clicked()), this, SLOT(slotSaveAs()));
    qpbtnSaveAs->setFlat(TRUE);
//--    qlayout2->addWidget(qpbtnSaveAs);
    layoutButtons->addWidget(qpbtnSaveAs,1,2);

    QPushButton* qpbtnLoad = new QPushButton (QIconSet(QPixmap(fileopen)), "",this);
    connect(qpbtnLoad, SIGNAL(clicked()), this, SLOT(slotLoad()));
    qpbtnLoad->setFlat(TRUE);
//--    qlayout2->addWidget(qpbtnLoad);
    layoutButtons->addWidget(qpbtnLoad,1,4);
    
    layoutButtons->setColStretch ( 5, 50 );
    
    QToolTip::add(qpbtnMoveUp, "Move up");
    QToolTip::add(qpbtnMoveDown, "Move down");
    QToolTip::add(qpbtnInvert, "Invert order");
    QToolTip::add(qpbtnDelete, "Delete");
    QToolTip::add(qpbtnSave, "Save Sequence");
    QToolTip::add(qpbtnSaveAs, "Save Sequence under new name");
    QToolTip::add(qpbtnLoad, "Load Sequence");

    qpbtnMoveUp->setMaximumSize (QSize(22,22));
    qpbtnMoveDown->setMaximumSize (QSize(22,22));
    qpbtnInvert->setMaximumSize (QSize(22,22));
    qpbtnDelete->setMaximumSize (QSize(22,22));
    qpbtnSave->setMaximumSize (QSize(22,22));
    qpbtnSaveAs->setMaximumSize (QSize(22,22));
    qpbtnLoad->setMaximumSize (QSize(22,22));
    

//    layoutMain->setResizeMode (QLayout::Fixed);

    layoutMain->addLayout(layoutButtons);
//    this->setFixedWidth(this->sizeHint().width());
//    cout << "qlbox->visibleWidth (): " << qlbox->visibleWidth () << endl;
    iListViewVisibleWidth = qlbox->visibleWidth () + 5;//- qlbox->verticalScrollBar()->width();
}
Пример #10
0
DvdWizard::DvdWizard(MonitorManager *manager, const QString &url, QWidget *parent) :
        QWizard(parent)
        , m_dvdauthor(NULL)
        , m_mkiso(NULL)
        , m_vobitem(NULL)
        , m_burnMenu(new QMenu(this))
{
    setWindowTitle(i18n("DVD Wizard"));
    //setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png")));
    m_pageVob = new DvdWizardVob(this);
    m_pageVob->setTitle(i18n("Select Files For Your DVD"));
    addPage(m_pageVob);

    m_pageChapters = new DvdWizardChapters(manager, m_pageVob->dvdFormat(), this);
    m_pageChapters->setTitle(i18n("DVD Chapters"));
    addPage(m_pageChapters);
    
    if (!url.isEmpty()) m_pageVob->setUrl(url);
    connect(m_pageVob, SIGNAL(prepareMonitor()), this, SLOT(slotprepareMonitor()));



    m_pageMenu = new DvdWizardMenu(m_pageVob->dvdFormat(), this);
    m_pageMenu->setTitle(i18n("Create DVD Menu"));
    addPage(m_pageMenu);

    QWizardPage *page4 = new QWizardPage;
    page4->setTitle(i18n("Creating DVD Image"));
    m_status.setupUi(page4);
    m_status.error_box->setHidden(true);
    m_status.error_box->setTabBarHidden(true);
    m_status.tmp_folder->setUrl(KUrl(KdenliveSettings::currenttmpfolder()));
    m_status.tmp_folder->setMode(KFile::Directory | KFile::ExistingOnly);
    m_status.iso_image->setUrl(KUrl(QDir::homePath() + "/untitled.iso"));
    m_status.iso_image->setFilter("*.iso");
    m_status.iso_image->setMode(KFile::File);
    m_status.iso_image->fileDialog()->setOperationMode(KFileDialog::Saving);

#if KDE_IS_VERSION(4,7,0)
    m_isoMessage = new KMessageWidget;
    QGridLayout *s =  static_cast <QGridLayout*> (page4->layout());
    s->addWidget(m_isoMessage, 5, 0, 1, -1);
    m_isoMessage->hide();
#endif

    addPage(page4);

    connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotPageChanged(int)));
    connect(m_status.button_start, SIGNAL(clicked()), this, SLOT(slotGenerate()));
    connect(m_status.button_abort, SIGNAL(clicked()), this, SLOT(slotAbort()));
    connect(m_status.button_preview, SIGNAL(clicked()), this, SLOT(slotPreview()));

    QString programName("k3b");
    QString exec = KStandardDirs::findExe(programName);
    if (!exec.isEmpty()) {
        //Add K3b action
        QAction *k3b = m_burnMenu->addAction(KIcon(programName), i18n("Burn with %1", programName), this, SLOT(slotBurn()));
        k3b->setData(exec);
    }
    programName = "brasero";
    exec = KStandardDirs::findExe(programName);
    if (!exec.isEmpty()) {
        //Add Brasero action
        QAction *brasero = m_burnMenu->addAction(KIcon(programName), i18n("Burn with %1", programName), this, SLOT(slotBurn()));
        brasero->setData(exec);
    }
    if (m_burnMenu->isEmpty()) m_burnMenu->addAction(i18n("No burning program found (K3b, Brasero)"));
    m_status.button_burn->setMenu(m_burnMenu);
    m_status.button_burn->setIcon(KIcon("tools-media-optical-burn"));
    m_status.button_burn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    m_status.button_preview->setIcon(KIcon("media-playback-start"));

    setButtonText(QWizard::CustomButton1, i18n("Load"));
    setButtonText(QWizard::CustomButton2, i18n("Save"));
    button(QWizard::CustomButton1)->setIcon(KIcon("document-open"));
    button(QWizard::CustomButton2)->setIcon(KIcon("document-save"));
    connect(button(QWizard::CustomButton1), SIGNAL(clicked()), this, SLOT(slotLoad()));
    connect(button(QWizard::CustomButton2), SIGNAL(clicked()), this, SLOT(slotSave()));
    setOption(QWizard::HaveCustomButton1, true);
    setOption(QWizard::HaveCustomButton2, true);
    QList<QWizard::WizardButton> layout;
    layout << QWizard::CustomButton1 << QWizard::CustomButton2 << QWizard::Stretch << QWizard::BackButton << QWizard::NextButton << QWizard::CancelButton << QWizard::FinishButton;
    setButtonLayout(layout);
}
Пример #11
0
// decoupled from resetActions in toplevel.cpp
// as resetActions simply uses the action groups
// specified in the ui.rc file
void KEBApp::createActions() {

    m_actionsImpl = new ActionsImpl(this, GlobalBookmarkManager::self()->model());

    connect(m_actionsImpl->testLinkHolder(), SIGNAL(setCancelEnabled(bool)),
            this, SLOT(setCancelTestsEnabled(bool)));
    connect(m_actionsImpl->favIconHolder(), SIGNAL(setCancelEnabled(bool)),
            this, SLOT(setCancelFavIconUpdatesEnabled(bool)));

    // save and quit should probably not be in the toplevel???
    (void) KStandardAction::quit(
        this, SLOT( close() ), actionCollection());
    KStandardAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection());
    (void) KStandardAction::configureToolbars(
        this, SLOT( slotConfigureToolbars() ), actionCollection());

    if (m_browser) {
        (void) KStandardAction::open(
            m_actionsImpl, SLOT( slotLoad() ), actionCollection());
        (void) KStandardAction::saveAs(
            m_actionsImpl, SLOT( slotSaveAs() ), actionCollection());
    }

    (void) KStandardAction::cut(m_actionsImpl, SLOT( slotCut() ), actionCollection());
    (void) KStandardAction::copy(m_actionsImpl, SLOT( slotCopy() ), actionCollection());
    (void) KStandardAction::paste(m_actionsImpl, SLOT( slotPaste() ), actionCollection());

    // actions
    KAction* m_actionsImplDelete = actionCollection()->addAction("delete");
    m_actionsImplDelete->setIcon(KIcon("edit-delete"));
    m_actionsImplDelete->setText(i18n("&Delete"));
    m_actionsImplDelete->setShortcut(Qt::Key_Delete);
    connect(m_actionsImplDelete, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotDelete() ));

    KAction* m_actionsImplRename = actionCollection()->addAction("rename");
    m_actionsImplRename->setIcon(KIcon("edit-rename"));
    m_actionsImplRename->setText(i18n("Rename"));
    m_actionsImplRename->setShortcut(Qt::Key_F2);
    connect(m_actionsImplRename, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotRename() ));

    KAction* m_actionsImplChangeURL = actionCollection()->addAction("changeurl");
    m_actionsImplChangeURL->setIcon(KIcon("edit-rename"));
    m_actionsImplChangeURL->setText(i18n("C&hange Location"));
    m_actionsImplChangeURL->setShortcut(Qt::Key_F3);
    connect(m_actionsImplChangeURL, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotChangeURL() ));

    KAction* m_actionsImplChangeComment = actionCollection()->addAction("changecomment");
    m_actionsImplChangeComment->setIcon(KIcon("edit-rename"));
    m_actionsImplChangeComment->setText(i18n("C&hange Comment"));
    m_actionsImplChangeComment->setShortcut(Qt::Key_F4);
    connect(m_actionsImplChangeComment, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotChangeComment() ));

    KAction* m_actionsImplChangeIcon = actionCollection()->addAction("changeicon");
    m_actionsImplChangeIcon->setIcon(KIcon("preferences-desktop-icons"));
    m_actionsImplChangeIcon->setText(i18n("Chan&ge Icon..."));
    connect(m_actionsImplChangeIcon, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotChangeIcon() ));

    KAction* m_actionsImplUpdateFavIcon = actionCollection()->addAction("updatefavicon");
    m_actionsImplUpdateFavIcon->setText(i18n("Update Favicon"));
    connect(m_actionsImplUpdateFavIcon, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotUpdateFavIcon() ));

    KAction* m_actionsImplRecursiveSort = actionCollection()->addAction("recursivesort");
    m_actionsImplRecursiveSort->setText(i18n("Recursive Sort"));
    connect(m_actionsImplRecursiveSort, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotRecursiveSort() ));

    KAction* m_actionsImplNewFolder = actionCollection()->addAction("newfolder");
    m_actionsImplNewFolder->setIcon(KIcon("folder-new"));
    m_actionsImplNewFolder->setText(i18n("&New Folder..."));
    m_actionsImplNewFolder->setShortcut(Qt::CTRL+Qt::Key_N);
    connect(m_actionsImplNewFolder, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotNewFolder() ));

    KAction* m_actionsImplNewBookmark = actionCollection()->addAction("newbookmark");
    m_actionsImplNewBookmark->setIcon(KIcon("bookmark-new"));
    m_actionsImplNewBookmark->setText(i18n("&New Bookmark"));
    connect(m_actionsImplNewBookmark, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotNewBookmark() ));

    KAction* m_actionsImplInsertSeparator = actionCollection()->addAction("insertseparator");
    m_actionsImplInsertSeparator->setText(i18n("&Insert Separator"));
    m_actionsImplInsertSeparator->setShortcut(Qt::CTRL+Qt::Key_I);
    connect(m_actionsImplInsertSeparator, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotInsertSeparator() ));

    KAction* m_actionsImplSort = actionCollection()->addAction("sort");
    m_actionsImplSort->setText(i18n("&Sort Alphabetically"));
    connect(m_actionsImplSort, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotSort() ));

    KAction* m_actionsImplSetAsToolbar = actionCollection()->addAction("setastoolbar");
    m_actionsImplSetAsToolbar->setIcon(KIcon("bookmark-toolbar"));
    m_actionsImplSetAsToolbar->setText(i18n("Set as T&oolbar Folder"));
    connect(m_actionsImplSetAsToolbar, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotSetAsToolbar() ));

    KAction* m_actionsImplExpandAll = actionCollection()->addAction("expandall");
    m_actionsImplExpandAll->setText(i18n("&Expand All Folders"));
    connect(m_actionsImplExpandAll, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExpandAll() ));

    KAction* m_actionsImplCollapseAll = actionCollection()->addAction("collapseall");
    m_actionsImplCollapseAll->setText(i18n("Collapse &All Folders"));
    connect(m_actionsImplCollapseAll, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotCollapseAll() ));

    KAction* m_actionsImplOpenLink = actionCollection()->addAction("openlink");
    m_actionsImplOpenLink->setIcon(KIcon("document-open"));
    m_actionsImplOpenLink->setText(i18n("&Open in Konqueror"));
    connect(m_actionsImplOpenLink, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotOpenLink() ));

    KAction* m_actionsImplTestSelection = actionCollection()->addAction("testlink");
    m_actionsImplTestSelection->setIcon(KIcon("bookmarks"));
    m_actionsImplTestSelection->setText(i18n("Check &Status"));
    connect(m_actionsImplTestSelection, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotTestSelection() ));

    KAction* m_actionsImplTestAll = actionCollection()->addAction("testall");
    m_actionsImplTestAll->setText(i18n("Check Status: &All"));
    connect(m_actionsImplTestAll, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotTestAll() ));

    KAction* m_actionsImplUpdateAllFavIcons = actionCollection()->addAction("updateallfavicons");
    m_actionsImplUpdateAllFavIcons->setText(i18n("Update All &Favicons"));
    connect(m_actionsImplUpdateAllFavIcons, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotUpdateAllFavIcons() ));

    KAction* m_actionsImplCancelAllTests = actionCollection()->addAction("canceltests");
    m_actionsImplCancelAllTests->setText(i18n("Cancel &Checks"));
    connect(m_actionsImplCancelAllTests, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotCancelAllTests() ));

    KAction* m_actionsImplCancelFavIconUpdates = actionCollection()->addAction("cancelfaviconupdates");
    m_actionsImplCancelFavIconUpdates->setText(i18n("Cancel &Favicon Updates"));
    connect(m_actionsImplCancelFavIconUpdates, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotCancelFavIconUpdates() ));

    KAction* m_actionsImplImportNS = actionCollection()->addAction("importNS");
    m_actionsImplImportNS->setObjectName( QLatin1String("NS" ));
    m_actionsImplImportNS->setIcon(KIcon("netscape"));
    m_actionsImplImportNS->setText(i18n("Import &Netscape Bookmarks..."));
    connect(m_actionsImplImportNS, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() ));

    KAction* m_actionsImplImportOpera = actionCollection()->addAction("importOpera");
    m_actionsImplImportOpera->setObjectName( QLatin1String("Opera" ));
    m_actionsImplImportOpera->setIcon(KIcon("opera"));
    m_actionsImplImportOpera->setText(i18n("Import &Opera Bookmarks..."));
    connect(m_actionsImplImportOpera, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() ));
/*
    KAction* m_actionsImplImportCrashes = actionCollection()->addAction("importCrashes");
    m_actionsImplImportCrashes->setObjectName( QLatin1String("Crashes" ));
    m_actionsImplImportCrashes->setText(i18n("Import All &Crash Sessions as Bookmarks..."));
    connect(m_actionsImplImportCrashes, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() ));
*/
    KAction* m_actionsImplImportGaleon = actionCollection()->addAction("importGaleon");
    m_actionsImplImportGaleon->setObjectName( QLatin1String("Galeon" ));
    m_actionsImplImportGaleon->setText(i18n("Import &Galeon Bookmarks..."));
    connect(m_actionsImplImportGaleon, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() ));

    KAction* m_actionsImplImportKDE2 = actionCollection()->addAction("importKDE2");
    m_actionsImplImportKDE2->setObjectName( QLatin1String("KDE2" ));
    m_actionsImplImportKDE2->setIcon(KIcon("kde"));
    m_actionsImplImportKDE2->setText(i18n("Import &KDE 2 or KDE 3 Bookmarks..."));

    connect(m_actionsImplImportKDE2, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() ));

    KAction* m_actionsImplImportIE = actionCollection()->addAction("importIE");
    m_actionsImplImportIE->setObjectName( QLatin1String("IE" ));
    m_actionsImplImportIE->setText(i18n("Import &Internet Explorer Bookmarks..."));
    connect(m_actionsImplImportIE, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() ));

    KAction* m_actionsImplImportMoz = actionCollection()->addAction("importMoz");
    m_actionsImplImportMoz->setObjectName( QLatin1String("Moz" ));
    m_actionsImplImportMoz->setIcon(KIcon("mozilla"));
    m_actionsImplImportMoz->setText(i18n("Import &Mozilla Bookmarks..."));
    connect(m_actionsImplImportMoz, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotImport() ));

    KAction* m_actionsImplExportNS = actionCollection()->addAction("exportNS");
    m_actionsImplExportNS->setIcon(KIcon("netscape"));
    m_actionsImplExportNS->setText(i18n("Export &Netscape Bookmarks"));
    connect(m_actionsImplExportNS, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportNS() ));

    KAction* m_actionsImplExportOpera = actionCollection()->addAction("exportOpera");
    m_actionsImplExportOpera->setIcon(KIcon("opera"));
    m_actionsImplExportOpera->setText(i18n("Export &Opera Bookmarks..."));
    connect(m_actionsImplExportOpera, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportOpera() ));

    KAction* m_actionsImplExportHTML = actionCollection()->addAction("exportHTML");
    m_actionsImplExportHTML->setIcon(KIcon("text-html"));
    m_actionsImplExportHTML->setText(i18n("Export &HTML Bookmarks..."));
    connect(m_actionsImplExportHTML, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportHTML() ));

    KAction* m_actionsImplExportIE = actionCollection()->addAction("exportIE");
    m_actionsImplExportIE->setText(i18n("Export &Internet Explorer Bookmarks..."));
    connect(m_actionsImplExportIE, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportIE() ));

    KAction* m_actionsImplExportMoz = actionCollection()->addAction("exportMoz");
    m_actionsImplExportMoz->setIcon(KIcon("mozilla"));
    m_actionsImplExportMoz->setText(i18n("Export &Mozilla Bookmarks..."));
    connect(m_actionsImplExportMoz, SIGNAL( triggered() ), m_actionsImpl, SLOT( slotExportMoz() ));
}
PolicyEditorClass::PolicyEditorClass(int argc, char** argv, Miro::Client& _client) :
  QMainWindow(NULL, "PolicyEditor"),
  client_(_client),
  miroRoot_(getenv("MIRO_ROOT")),
  policyFileName_("_"),
  robot_(getenv("HOST"))
{
  resize(600, 500);

  //-----------//
  // init menu //
  //-----------//

  // file menu
  QPopupMenu* MenuFile = new QPopupMenu();
  menuBar()->insertItem("&File", MenuFile);

  MenuFile->insertItem("New",         this, SLOT(slotNew()));
  MenuFile->insertItem("Open ...",    this, SLOT(slotLoad()));
  MenuFile->insertItem("Save",        this, SLOT(slotSave())); 
  MenuFile->insertItem("Save As ...", this, SLOT(slotSaveAs()));
  MenuFile->insertSeparator();
  MenuFile->insertItem("Send to ...", this, SLOT(slotSendTo()));
  MenuFile->insertSeparator();
  MenuFile->insertItem("Quit",        this, SLOT(quit()));

  // options menue
  QPopupMenu* MenuOptions = new QPopupMenu();
  menuBar()->insertItem("&Options", MenuOptions);

  //MenuOptions->insertItem("&Configuration ..",  this, SLOT(slotConfiguration()));
  //  MenuEdit->insertItem("Add Basic Behaviour ..", this, NULL);
  MenuOptions->insertItem("&Behaviour-Description-Filename..", this, SLOT(getBehaviourDescriptionFileName()));
  MenuOptions->insertItem("&Load Behaviour-Description-Filename..", this, SLOT(setBehaviourDescriptionFileName()));


  // help menu
  QPopupMenu* MenuHelp = new QPopupMenu();
  menuBar()->insertSeparator();
  menuBar()->insertItem("&Help", MenuHelp);
  
  MenuHelp->insertItem("About PolicyEditor", this, SLOT(slotAbout()));
  MenuHelp->insertItem("About Qt",           this, SLOT(slotAboutQt()));
  

  //---------------//
  // init document //
  //---------------//

  // load database file
  document_.loadDatabase("behaviours.dat");
  document_.setModified(false);

  // if given -> load policy file
  if (argc > 1) {
    document_.loadXML(argv[1]);
    policyFileName_=argv[1];
    statusBar()->message(policyFileName_+" geladen!", 1000);
  }
  else {
    document_.loadXML(miroRoot_ + "/etc/PolicyEditorNewFile.xml");
    document_.setModified(false);

    setCaption("new document");
    policyFileName_="_";
    QString message;
    message.sprintf("New document opend");
    statusBar()->message(message, 3000);
  }

  //-----------//
  // init view //
  //-----------//
  view_ = new PolicyViewClass(this, document_);
  setCentralWidget(view_);

#ifdef ASDF
  // load pattern database //
  QMessageBox::information(this, "Policy Editor", "Hallo,\n\nfirst, you have to select your\nbehaviour database ...");
  QString filename = QFileDialog::getOpenFileName(0, "*.dat", this);
  if (filename.isNull()) 
  { 
    std::cout << "database must be chosen !" << std::endl; 
    exit(0); 
  }
  document_.LoadDatabase(string(filename));
#endif
 
}
Пример #13
0
void MainWindow::on_actionLoad_2_triggered()
{
    slotLoad();
}
Пример #14
0
ClsQSAList::ClsQSAList ( QWidget * parent, ClsQGroupStateManip* _clsQGroupStateManip, const char * name, Qt::WindowFlags f) :
    QFrame ( parent, name, f ), clsQGroupStateManip(_clsQGroupStateManip)  {


    strFilename = "";

    QVBoxLayout* layoutMain = new QVBoxLayout( this, 5, -1, "mainL");


    /* ------------------------------- */
    qlbox = new QListWidget ( this );
    qlbox->setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOn );
//    qlbox->setViewMode(QListView::IconMode);
    qlbox->setIconSize(QSize(60, 60));
    qlbox->setSpacing(10);


    qlbox->setSelectionMode(QAbstractItemView::ExtendedSelection);

    connect(qlbox, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotDoubleClicked(const QModelIndex &)));
    layoutMain->addWidget(qlbox,10);


    QGridLayout* layoutButtons = new QGridLayout( 2, 6, -1, "layoutButtons");
    layoutButtons->setColStretch ( 0, 50 );

    /* ------------------------------- */

    QPushButton* qpbtnMoveUp = new QPushButton (QIconSet(QPixmap(up)), "",this);
    qpbtnMoveUp->setFlat(TRUE);
    connect(qpbtnMoveUp, SIGNAL(clicked()), this, SLOT(slotMoveUp()));
    layoutButtons->addWidget(qpbtnMoveUp,0,1);

    QPushButton* qpbtnMoveDown = new QPushButton (QIconSet(QPixmap(down)), "",this);
    qpbtnMoveDown->setFlat(TRUE);
    connect(qpbtnMoveDown, SIGNAL(clicked()), this, SLOT(slotMoveDown()));
    layoutButtons->addWidget(qpbtnMoveDown,0,2);

    QPushButton* qpbtnInvert = new QPushButton (QIconSet(QPixmap(invert2)), "",this);
    qpbtnInvert->setFlat(TRUE);
    connect(qpbtnInvert, SIGNAL(clicked()), this, SLOT(slotInvert()));
    layoutButtons->addWidget(qpbtnInvert,0,3);

    QPushButton* qpbtnDelete = new QPushButton (QIconSet(QPixmap(trash2)), "",this);
    connect(qpbtnDelete, SIGNAL(clicked()), this, SLOT(slotDeleteItem()));
    qpbtnDelete->setFlat(TRUE);
    layoutButtons->addWidget(qpbtnDelete,0,4);

    /* ------------------------------- */

    QPushButton* qpbtnSave = new QPushButton (QIconSet(QPixmap(fileSave_xpm)), "",this);
    connect(qpbtnSave, SIGNAL(clicked()), this, SLOT(slotSave()));
    qpbtnSave->setFlat(TRUE);
    layoutButtons->addWidget(qpbtnSave,1,1);

    QPushButton* qpbtnSaveAs = new QPushButton (QIconSet(QPixmap(fileSaveAs_xpm)), "",this);
    connect(qpbtnSaveAs, SIGNAL(clicked()), this, SLOT(slotSaveAs()));
    qpbtnSaveAs->setFlat(TRUE);
    layoutButtons->addWidget(qpbtnSaveAs,1,2);

    QPushButton* qpbtnLoad = new QPushButton (QIconSet(QPixmap(fileOpen_xpm)), "",this);
    connect(qpbtnLoad, SIGNAL(clicked()), this, SLOT(slotLoad()));
    qpbtnLoad->setFlat(TRUE);
    layoutButtons->addWidget(qpbtnLoad,1,4);

    layoutButtons->setColStretch ( 5, 50 );

    QToolTip::add(qpbtnMoveUp, "Move up");
    QToolTip::add(qpbtnMoveDown, "Move down");
    QToolTip::add(qpbtnInvert, "Invert order");
    QToolTip::add(qpbtnDelete, "Delete");
    QToolTip::add(qpbtnSave, "Save Sequence");
    QToolTip::add(qpbtnSaveAs, "Save Sequence under new name");
    QToolTip::add(qpbtnLoad, "Load Sequence");

    qpbtnMoveUp->setMaximumSize (QSize(22,22));
    qpbtnMoveDown->setMaximumSize (QSize(22,22));
    qpbtnInvert->setMaximumSize (QSize(22,22));
    qpbtnDelete->setMaximumSize (QSize(22,22));
    qpbtnSave->setMaximumSize (QSize(22,22));
    qpbtnSaveAs->setMaximumSize (QSize(22,22));
    qpbtnLoad->setMaximumSize (QSize(22,22));

    layoutMain->addLayout(layoutButtons);
}
Пример #15
0
//=============================================================================
// Show the context menu if the photo is clicked with the right mouse button.
//=============================================================================
void CPhoto::mouseDoubleClickEvent (QMouseEvent* e)
{
  if (!mReadOnly)
    slotLoad();
}
Пример #16
0
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastFormatPage::KMPlayerPrefBroadcastFormatPage (QWidget *parent, FFServerSettingList & ffs) : QFrame (parent, "BroadcastPage"), profiles (ffs)
{
    QHBoxLayout *layout = new QHBoxLayout (this, 5);
    QGridLayout *formatlayout = new QGridLayout (11, 2, 2);
    formatlayout->setAlignment (Qt::AlignTop);
    QVBoxLayout *leftlayout = new QVBoxLayout (15);
    QHBoxLayout *ledlayout = new QHBoxLayout (5);
    format = new QComboBox (this);
    QLabel * label = new QLabel (format, i18n ("Format:"), this);
    format->clear ();
    format->insertItem (QString ("asf"));
    format->insertItem (QString ("avi"));
    format->insertItem (QString ("mpjpeg"));
    format->insertItem (QString ("mpeg"));
    format->insertItem (QString ("rm"));
    format->insertItem (QString ("swf"));
    QWhatsThis::add (format, i18n ("Only avi, mpeg and rm work for mplayer playback"));
    formatlayout->addWidget (label, 0, 0);
    formatlayout->addWidget (format, 0, 1);
    ADDPROPERTY (i18n ("Audio codec:"), audiocodec, formatlayout, 1, this);
    ADDPROPERTY (i18n ("Audio bit rate (kbit):"), audiobitrate, formatlayout, 2, this);
    ADDPROPERTY (i18n ("Audio sample rate (Hz):"), audiosamplerate, formatlayout, 3, this);
    ADDPROPERTY (i18n ("Video codec:"), videocodec, formatlayout, 4, this);
    ADDPROPERTY (i18n ("Video bit rate (kbit):"), videobitrate, formatlayout, 5, this);
    ADDPROPERTY (i18n ("Quality (1-31):"), quality, formatlayout, 6, this);
    ADDPROPERTY (i18n ("Frame rate (Hz):"), framerate, formatlayout, 7, this);
    ADDPROPERTY (i18n ("Gop size:"), gopsize, formatlayout, 8, this);
    ADDPROPERTY (i18n ("Width (pixels):"), moviewidth, formatlayout, 9, this);
    ADDPROPERTY (i18n ("Height (pixels):"), movieheight, formatlayout, 10, this);
    label = new QLabel (i18n ("Allow access from:"), this);
    accesslist = new QTable (40, 1, this);
    accesslist->verticalHeader ()->hide ();
    accesslist->setLeftMargin (0);
    accesslist->setColumnWidth (0, 250);
    QWhatsThis::add (accesslist, i18n ("'Single IP' or 'start-IP end-IP' for IP ranges"));
    QHeader *header = accesslist->horizontalHeader ();
    header->setLabel (0, i18n ("Host/IP or IP Range"));
    QFrame *profileframe = new QFrame (this);
    QGridLayout *profileslayout = new QGridLayout (profileframe, 5, 2, 2);
    profile = new QLineEdit ("", profileframe);
    connect (profile, SIGNAL(textChanged (const QString &)),
             this, SLOT (slotTextChanged (const QString &)));
    profilelist = new QListBox (profileframe);
    for (int i = 0; i < (int) profiles.size (); i++)
        profilelist->insertItem (profiles[i]->name, i);
    connect (profilelist, SIGNAL (selected (int)),
             this, SLOT (slotIndexChanged (int)));
    connect (profilelist, SIGNAL (highlighted (int)),
             this, SLOT (slotItemHighlighted (int)));
    load = new QPushButton (i18n ("Load"), profileframe);
    save = new QPushButton (i18n ("Save"), profileframe);
    del = new QPushButton (i18n ("Delete"), profileframe);
    load->setEnabled (false);
    save->setEnabled (false);
    del->setEnabled (false);
    connect (load, SIGNAL (clicked ()), this, SLOT (slotLoad ()));
    connect (save, SIGNAL (clicked ()), this, SLOT (slotSave ()));
    connect (del, SIGNAL (clicked ()), this, SLOT (slotDelete ()));
    profileslayout->addWidget (profile, 0, 0);
#if (QT_VERSION < 0x030200)
    profileslayout->addRowSpacing (4, 60);
#else
    profileslayout->setRowSpacing (4, 60);
#endif
    profileslayout->addMultiCellWidget (profilelist, 1, 4, 0, 0);
    profileslayout->addWidget (load, 1, 1);
    profileslayout->addWidget (save, 2, 1);
    profileslayout->addWidget (del, 3, 1);
    leftlayout->addWidget (profileframe);
    startbutton = new QPushButton (i18n ("Start"), this);
    serverled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
    feedled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
    ledlayout->addWidget (startbutton);
    ledlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
    ledlayout->addWidget (serverled);
    ledlayout->addWidget (feedled);
    leftlayout->addLayout (ledlayout);
    QFrame * line = new QFrame (this);
    line->setFrameShape (QFrame::HLine);
    leftlayout->addWidget (line);
    leftlayout->addWidget (label);
    leftlayout->addWidget (accesslist);
    leftlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
    layout->addLayout (leftlayout);
    line = new QFrame (this);
    line->setFrameShape (QFrame::VLine);
    layout->addWidget (line);
    layout->addLayout (formatlayout);
    layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
}