Exemple #1
0
KHBoxTest::KHBoxTest( QWidget* parentWidget )
    : KHBox( parentWidget )
{
    pbAdd = new QPushButton( "Add a button", this );
    connect( pbAdd, SIGNAL( clicked() ), this, SLOT( slotAdd() ) );
    pbRemove = 0;
}
Exemple #2
0
CollectionEditor::CollectionEditor(QWidget* parent, Collection* fc)
	: QDialog(parent)
{
	Q_ASSERT(fc != NULL);
	m_original = fc;

	setupUi(this);

	m_add->setIcon(QIcon(":/edit_add.png"));
	m_remove->setIcon(QIcon(":/edit_remove.png"));

	connect(m_nameEdit, SIGNAL(textEdited(const QString&)),
		this, SLOT(slotNameEdited(const QString&)));
	connect(m_add, SIGNAL(clicked()), this, SLOT(slotAdd()));
	connect(m_remove, SIGNAL(clicked()), this, SLOT(slotRemove()));

	m_fc = new Collection(this);
	m_fc->copyFrom(fc);
	Q_ASSERT(m_fc != NULL);

	m_nameEdit->setText(m_fc->name());
	slotNameEdited(m_fc->name());

	updateFunctionList();
}
Exemple #3
0
//
// Listview item popup menu callback
//
void DeviceManagerView::slotMenuCallBack(int item)
{
  switch (item)
    {
    case KMenuItemAdd:
      slotAdd();
      break;

    case KMenuItemRemove:
      slotRemove();
      break;

    case KMenuItemClone:
      slotClone();
      break;

    case KMenuItemProperties:
      slotProperties();
      break;

    case KMenuItemConsole:
      slotConsole();
      break;

    case KMenuItemMonitor:
      slotMonitor();
      break;

    default:
      break;
    }
}
Exemple #4
0
KOEditorAlarms::KOEditorAlarms( KCal::Alarm::List *alarms, QWidget *parent,
                                const char *name )
    : KDialogBase( parent, name, true, i18n("Edit Reminders"), Ok | Cancel ), mAlarms( alarms ),mCurrentItem(0L)
{
    setMainWidget( mWidget = new KOEditorAlarms_base( this ) );
    mWidget->mAlarmList->setColumnWidthMode( 0, QListView::Maximum );
    mWidget->mAlarmList->setColumnWidthMode( 1, QListView::Maximum );
    connect( mWidget->mAlarmList, SIGNAL( selectionChanged( QListViewItem * ) ),
             SLOT( selectionChanged( QListViewItem * ) ) );
    connect( mWidget->mAddButton, SIGNAL( clicked() ), SLOT( slotAdd() ) );
    connect( mWidget->mRemoveButton, SIGNAL( clicked() ), SLOT( slotRemove() ) );
    connect( mWidget->mDuplicateButton, SIGNAL( clicked() ), SLOT( slotDuplicate() ) );

    connect( mWidget->mAlarmOffset, SIGNAL( valueChanged( int ) ), SLOT( changed() ) );
    connect( mWidget->mOffsetUnit, SIGNAL( activated( int ) ), SLOT( changed() ) );
    connect( mWidget->mBeforeAfter, SIGNAL( activated( int ) ), SLOT( changed() ) );
    connect( mWidget->mRepeats, SIGNAL( toggled( bool ) ), SLOT( changed() ) );
    connect( mWidget->mRepeatCount, SIGNAL( valueChanged( int ) ), SLOT( changed() ) );
    connect( mWidget->mRepeatInterval, SIGNAL( valueChanged( int ) ), SLOT( changed() ) );
    connect( mWidget->mAlarmType, SIGNAL(clicked(int)), SLOT( changed() ) );
    connect( mWidget->mDisplayText, SIGNAL( textChanged() ), SLOT( changed() ) );
    connect( mWidget->mSoundFile, SIGNAL( textChanged( const QString & ) ), SLOT( changed() ) );
    connect( mWidget->mApplication, SIGNAL( textChanged( const QString & ) ), SLOT( changed() ) );
    connect( mWidget->mAppArguments, SIGNAL( textChanged( const QString & ) ), SLOT( changed() ) );
    connect( mWidget->mEmailAddress, SIGNAL( textChanged( const QString & ) ), SLOT( changed() ) );
    connect( mWidget->mEmailText, SIGNAL( textChanged() ), SLOT( changed() ) );

    init();
}
/*!
    \fn SnippetWidget::showPopupMenu( QListViewItem * item, const QPoint & p, int )
    Shows the Popup-Menu depending item is a valid pointer
*/
void SnippetWidget::showPopupMenu( QListViewItem * item, const QPoint & p, int )
{
	KPopupMenu popup;

	SnippetItem * selectedItem = static_cast<SnippetItem *>(item);
	if ( item ) {
		popup.insertTitle( selectedItem->getName() );

		popup.insertItem( i18n("Add Item..."), this, SLOT( slotAdd() ) );
		popup.insertItem( i18n("Add Group..."), this, SLOT( slotAddGroup() ) );
        if (dynamic_cast<SnippetGroup*>(item)) {
            popup.insertItem( i18n("Edit..."), this, SLOT( slotEditGroup() ) );
        } else {
            popup.insertItem( i18n("Edit..."), this, SLOT( slotEdit() ) );
        }
		popup.insertItem( i18n("Remove"), this, SLOT( slotRemove() ) );

	} else {
		popup.insertTitle(i18n("Code Snippets"));

		popup.insertItem( i18n("Add Group..."), this, SLOT( slotAddGroup() ) );
	}

	popup.exec(p);
}
int CollectionEditor::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0:
            slotNameEdited((*reinterpret_cast< const QString(*)>(_a[1])));
            break;
        case 1:
            slotAdd();
            break;
        case 2:
            slotRemove();
            break;
        case 3:
            accept();
            break;
        default:
            ;
        }
        _id -= 4;
    }
    return _id;
}
Exemple #7
0
DialogFindFriends::DialogFindFriends(QWidget *parent) :
    QDialog(parent)
{
    setWindowTitle("Find a friend");
    inftext = new QLabel(this);
    QVBoxLayout *lyt = new QVBoxLayout();
    QHBoxLayout *lytBut = new QHBoxLayout();
    lyt->addWidget(inftext);

    QLabel *lblUserLogin = new QLabel("Enter a login of a friend:", this);
    leFriendLogin = new QLineEdit(this);
    lyt->addWidget(lblUserLogin);
    lyt->addWidget(leFriendLogin);

    butFind = new QPushButton("Find", this);
    butAdd = new QPushButton("Add", this);
    butWrite = new QPushButton("Write", this);

    lytBut->addWidget(butFind);
    lytBut->addWidget(butAdd);
    lytBut->addWidget(butWrite);
    lyt->addLayout(lytBut);
    setLayout(lyt);

    connect(butFind, SIGNAL(clicked()), this, SLOT(slotFindFr()));
    connect(butAdd, SIGNAL(clicked()), this, SLOT(slotAdd()));
    connect(butWrite, SIGNAL(clicked()), this, SLOT(slotWrite()));
    //connect(butNo, SIGNAL(clicked()), this, SLOT(slotNoAddFriend()));
    butAdd->setEnabled(false);
    butWrite->setEnabled(false);

    //inftext->setText("<font size = 14 color = \"red\" >Lalay, saska!</font>");
}
void ClassMainWindow::slotRightClick( QListViewItem *, const QPoint &pos, int )
{
	QPopupMenu *menu = new QPopupMenu( this );
	menu->insertItem( i18n( "&Add" ), this, SLOT(slotAdd()) );
	menu->insertItem( i18n( "&Remove" ), this, SLOT(slotRemove()) );
	menu->popup( pos );
}
CDlgEditMapLevel::CDlgEditMapLevel(QTreeWidgetItem * item,  const QString& path, QWidget * parent)
: QDialog(parent)
, item(item)
, mapPath(path)
{
    setupUi(this);

    spinZoom->setValue(item->data(0,CCreateMapQMAP::eZoom).toInt());
    listFiles->addItems(item->text(CCreateMapQMAP::eFiles).split("; ",QString::SkipEmptyParts));

    toolFiles->setIcon(QPixmap(":/icons/iconFileLoad16x16.png"));
    connect(toolFiles, SIGNAL(clicked()), this, SLOT(slotSelectFiles()));

    toolAdd->setIcon(QPixmap(":/icons/iconFileAdd16x16.png"));
    connect(toolAdd, SIGNAL(clicked()), this, SLOT(slotAdd()));

    toolDel->setIcon(QPixmap(":/icons/iconFileDel16x16.png"));
    connect(toolDel, SIGNAL(clicked()), this, SLOT(slotDel()));

    toolUp->setIcon(QPixmap(":/icons/iconUpload16x16.png"));
    connect(toolUp, SIGNAL(clicked()), this, SLOT(slotUp()));

    toolDown->setIcon(QPixmap(":/icons/iconDownload16x16.png"));
    connect(toolDown, SIGNAL(clicked()), this, SLOT(slotDown()));

    connect(listFiles, SIGNAL(itemSelectionChanged()), this, SLOT(slotListChanged()));
}
forwardingPage::forwardingPage(QString text, QString newText, QWidget* parent) : QFrame(parent)
{
    m_newForwardDialog = new newForwardDialog(newText, this);
    connect(m_newForwardDialog, SIGNAL(okClicked()), this, SLOT(slotAdd()));

    QGridLayout *layout = new QGridLayout(this, 4, 2);
    layout->setSpacing(KDialogBase::spacingHint());

    QLabel *label = new QLabel(text, this);
    label->show();
    layout->addMultiCellWidget(label, 0, 0, 0, 1);

    m_forwards = new KListView(this);
    m_forwards->addColumn(i18n("In/Out"));
    m_forwards->addColumn(i18n("Port"));
    m_forwards->addColumn(i18n("Destination"));
    m_forwards->show();
    layout->addMultiCellWidget(m_forwards, 1, 3, 0, 0);
    connect(m_forwards, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));

    m_add = new KPushButton(i18n("Add Port"), this);
    m_add->show();
    layout->addWidget(m_add, 1, 1);
    connect(m_add, SIGNAL(clicked()), m_newForwardDialog, SLOT(show()));

    m_del = new KPushButton(i18n("Remove Port"), this);
    m_del->show();
    m_del->setEnabled(false);
    layout->addWidget(m_del, 2, 1);
    connect(m_del, SIGNAL(clicked()), this, SLOT(slotDel()));

    layout->setColStretch(0, 1);
}
void PropertiesAndStyleWidget::createConnect()
{
    connect(mToolBar,SIGNAL(sigAddParamter()),mPropTableWidget,SLOT(slotAdd()));
    connect(mToolBar,SIGNAL(sigRemoveParamter()),mPropTableWidget,SLOT(slotRemove()));
    connect(mToolBar,SIGNAL(sigClearParameter()),mPropTableWidget,SLOT(slotClear()));
    connect(mToolBar,SIGNAL(sigSubumit()),mPropTableWidget,SLOT(slotSubmit()));

    connect(mPropTableWidget,SIGNAL(sigAddDeleteEnable(bool,bool)),mToolBar,SLOT(slotSetBtnsEnable(bool,bool)));
}
DirMappingWidget::DirMappingWidget(QWidget* parent, const char* name)
  : QWidget(parent, name)
{
  QVBoxLayout* mainLayout = new QVBoxLayout(this, 10, 10);

  m_listView = new KListView(this);
  mainLayout->addWidget(m_listView);

  QGridLayout* grid = new QGridLayout(0, 2, 2, 3, 5);

  QLabel* label = new QLabel(this);
  label->setText(i18n("Local dir:"));
  grid->addWidget(label, 0, 0);

  m_edLocalDir = new KURLRequester(this);
  m_edLocalDir->setMode(KFile::Directory);
  grid->addWidget(m_edLocalDir, 0, 1);

  label = new QLabel(this);
  label->setText(i18n("Remote dir:"));
  grid->addWidget(label, 1, 0);

  m_edRemoteDir = new KLineEdit(this);
  grid->addWidget(m_edRemoteDir, 1, 1);


  mainLayout->addLayout(grid);

  QHBoxLayout* hbox = new QHBoxLayout(this, 0, 3);

  m_btAdd = new QPushButton(this);
  m_btAdd->setText(i18n("Add"));
  hbox->addWidget(m_btAdd);

  m_btUpdate = new QPushButton(this);
  m_btUpdate->setText(i18n("Update"));
  hbox->addWidget(m_btUpdate);

  m_btRemove = new QPushButton(this);
  m_btRemove->setText(i18n("Remove"));
  hbox->addWidget(m_btRemove);

  mainLayout->addLayout(hbox);

  initListView();

  connect(m_btAdd, SIGNAL(clicked()), this, SLOT(slotAdd()));
  connect(m_btUpdate, SIGNAL(clicked()), this, SLOT(slotUpdate()));
  connect(m_btRemove, SIGNAL(clicked()), this, SLOT(slotRemove()));
  
  connect(m_listView, SIGNAL(selectionChanged()), this, 
      SLOT(slotSelectionChanged()));

  m_btRemove->setEnabled(false);
  m_btUpdate->setEnabled(false);
}
ViewDepartments::ViewDepartments(QWidget * parent): ui(new Ui::ViewDepartments) // ??
{
	ui->setupUi(this);
	setupModel();

	QObject::connect(ui->action_New, SIGNAL(triggered()), this, SLOT(slotAdd()));
	QObject::connect(ui->action_Delete, SIGNAL(triggered()), this, SLOT(slotDelete()));
	QObject::connect(ui->action_Edit, SIGNAL(triggered()), this, SLOT(slotEdit()));
	QObject::connect(ui->action_Yes, SIGNAL(triggered()), this, SLOT(slotSave()));
	QObject::connect(ui->action_No, SIGNAL(triggered()), this, SLOT(slotCancel()));
	
}
KoVersionDialog::KoVersionDialog(QWidget* parent, KoDocument *doc)
        : KoDialog(parent)
{
    setCaption(i18n("Version"));
    setButtons(Close);
    setDefaultButton(Close);
    m_doc = doc;

    QWidget* page = new QWidget(this);
    setMainWidget(page);
    setModal(true);

    QGridLayout* grid1 = new QGridLayout(page);

    list = new QTreeWidget(page);
    list->setColumnCount(3);
    QStringList h;
    h.append(i18n("Date & Time"));
    h.append(i18n("Saved By"));
    h.append(i18n("Comment"));
    list->setHeaderLabels(h);

    updateVersionList();

    grid1->addWidget(list, 0, 0, 9, 1);

    m_pAdd = new QPushButton(i18n("&Add"), page);
    grid1->addWidget(m_pAdd, 1, 2);

    m_pRemove = new QPushButton(i18n("&Remove"), page);
    grid1->addWidget(m_pRemove, 2, 2);

    m_pModify = new QPushButton(i18n("&Modify"), page);
    grid1->addWidget(m_pModify, 3, 2);

    m_pOpen = new QPushButton(i18n("&Open"), page);
    grid1->addWidget(m_pOpen, 4, 2);


    connect(m_pRemove, SIGNAL(clicked()), this, SLOT(slotRemove()));
    connect(m_pAdd, SIGNAL(clicked()), this, SLOT(slotAdd()));
    connect(m_pOpen, SIGNAL(clicked()), this, SLOT(slotOpen()));
    connect(m_pModify, SIGNAL(clicked()), this, SLOT(slotModify()));
    connect(list, SIGNAL(itemActivated(QTreeWidgetItem *, int)), this, SLOT(slotOpen()));

    updateButton();

    resize(600, 250);

}
PathListEditor::PathListEditor(QWidget *parent) :
        QWidget(parent),
        d(new PathListEditorPrivate)
{
    setLayout(d->layout);
    d->toolButton->setPopupMode(QToolButton::MenuButtonPopup);
    d->toolButton->setText(tr("Insert..."));
    d->toolButton->setMenu(d->buttonMenu);
    connect(d->toolButton, SIGNAL(clicked()), this, SLOT(slotInsert()));

    addAction(tr("Add..."), this, SLOT(slotAdd()));
    addAction(tr("Delete Line"), this, SLOT(deletePathAtCursor()));
    addAction(tr("Clear"), this, SLOT(clear()));
}
IMEditorWidget::IMEditorWidget( QWidget *parent, const QString &preferredIM )
  : KDialog( parent ), mReadOnly( false )
{
  setCaption( i18n( "Edit Instant Messaging Address" ) );
  setButtons( Help | Ok | Cancel );
  setDefaultButton( Ok );
  QWidget *w = new QWidget(this);
  mWidget = new Ui_IMEditorBase();
  mWidget->setupUi( w );
  setMainWidget(w);
  connect( mWidget->btnAdd, SIGNAL( clicked() ), SLOT( slotAdd() ) );
  connect( mWidget->btnEdit, SIGNAL( clicked() ), SLOT( slotEdit() ) );
  connect( mWidget->btnDelete, SIGNAL( clicked() ), SLOT( slotDelete() ) );
  connect( mWidget->btnSetStandard, SIGNAL( clicked()), SLOT( slotSetStandard() ) );
  connect( mWidget->lvAddresses, SIGNAL( itemSelectionChanged() ), SLOT( slotUpdateButtons() ) );

  connect( mWidget->lvAddresses, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ),
           SLOT( slotEdit() ) );

  setHelp( "managing-contacts-im-addresses", "kaddressbook" );

  mWidget->btnEdit->setEnabled( false );
  mWidget->btnDelete->setEnabled( false );
  mWidget->btnSetStandard->setEnabled( false );
  // Disabled pending implementation
  //mWidget->btnUp->setEnabled( false );
  //mWidget->btnDown->setEnabled( false );
  mPreferred = preferredIM;
  mPreferred = mPreferred.replace( " on ", QString( QChar( 0xE120 ) ), Qt::CaseSensitive );
  mProtocols = KPluginInfo::fromServices(
    KServiceTypeTrader::self()->query( QString::fromLatin1( "KABC/IMProtocol" ) ) );

  // order the protocols by putting them in a qmap, then sorting
  // the set of keys and recreating the list
  QMap<QString, KPluginInfo> protocolMap;
  QList<KPluginInfo>::ConstIterator it;
  QList<KPluginInfo> sorted;
  for ( it = mProtocols.constBegin(); it != mProtocols.constEnd(); ++it ) {
    protocolMap.insert( it->name(), (*it) );
  }

  QStringList keys = protocolMap.keys();
  keys.sort();
  QStringList::ConstIterator keyIt = keys.constBegin();
  QStringList::ConstIterator end = keys.constEnd();
  for ( ; keyIt != end; ++keyIt ) {
    sorted.append( protocolMap[*keyIt] );
  }
  mProtocols = sorted;
}
JavaDocs::JavaDocs(QWidget* parent, ScribusDoc *doc, ScribusView* vie) : QDialog( parent )
{
	setModal(true);
	setWindowTitle( tr( "Edit JavaScripts" ) );
	setWindowIcon(loadIcon("AppIcon.png"));
	Doc = doc;
	View = vie;
	JavaDocsLayout = new QHBoxLayout(this);
	JavaDocsLayout->setMargin(10);
	JavaDocsLayout->setSpacing(5);

	Scripts = new QListWidget( this );
	Scripts->setMinimumSize( QSize( 150, 200 ) );
	QMap<QString,QString>::Iterator it;
	for (it = Doc->JavaScripts.begin(); it != Doc->JavaScripts.end(); ++it)
		Scripts->addItem(it.key());
	JavaDocsLayout->addWidget( Scripts );

	Layout1 = new QVBoxLayout;
	Layout1->setMargin(0);
	Layout1->setSpacing(5);

	EditScript = new QPushButton( tr( "&Edit..." ), this);
	Layout1->addWidget( EditScript );

	AddScript = new QPushButton( tr( "&Add..." ), this);
	Layout1->addWidget( AddScript );

	DeleteScript = new QPushButton( tr( "&Delete" ), this);
	Layout1->addWidget( DeleteScript );
	QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
	Layout1->addItem( spacer );

	ExitDia = new QPushButton( tr( "&Close" ), this);
	ExitDia->setDefault( true );
	Layout1->addWidget( ExitDia );
	if (Doc->JavaScripts.count() == 0)
	{
		EditScript->setEnabled(false);
		DeleteScript->setEnabled(false);
	}
	JavaDocsLayout->addLayout( Layout1 );
	connect(AddScript, SIGNAL(clicked()), this, SLOT(slotAdd()));
	connect(EditScript, SIGNAL(clicked()), this, SLOT(slotEdit()));
	connect(DeleteScript, SIGNAL(clicked()), this, SLOT(slotDelete()));
	connect(ExitDia, SIGNAL(clicked()), this, SLOT(accept()));
	connect(Scripts, SIGNAL(itemActivated (QListWidgetItem *)), this, SLOT(slotEdit()));
	AddScript->setToolTip( "<qt>" + tr( "Adds a new Script, predefines a function with the same name. If you want to use this script as an \"Open Action\" script be sure not to change the name of the function." ) + "</qt>" );
}
Exemple #18
0
BGAdvancedDialog::BGAdvancedDialog(KBackgroundRenderer *_r,
                                   QWidget *parent,
                                   bool m_multidesktop)
    : KDialogBase(parent, "BGAdvancedDialog",
                  true, i18n("Advanced Background Settings"),
                  Ok | Cancel, Ok, true),
      r(_r)
{
   dlg = new BGAdvancedBase(this);
   setMainWidget(dlg);

   dlg->m_listPrograms->header()->setStretchEnabled ( true, 1 );
   dlg->m_listPrograms->setAllColumnsShowFocus(true);

   connect(dlg->m_listPrograms, SIGNAL(clicked(QListViewItem *)),
         SLOT(slotProgramItemClicked(QListViewItem *)));

   // Load programs
   QStringList lst = KBackgroundProgram::list();
   QStringList::Iterator it;
   for (it=lst.begin(); it != lst.end(); ++it)
      addProgram(*it);

   if (m_multidesktop)
   {
      KConfig cfg(desktopConfigname(), false, false);
      cfg.setGroup( "General" );
      if (!cfg.readBoolEntry( "Enabled", true ))
      {
         dlg->m_groupIconText->hide();
      }

      dlg->m_spinCache->setSteps(512, 1024);
      dlg->m_spinCache->setRange(0, 40960);
      dlg->m_spinCache->setSpecialValueText(i18n("Unlimited"));
      dlg->m_spinCache->setSuffix(i18n(" KB"));

      connect(dlg->m_buttonAdd, SIGNAL(clicked()),
         SLOT(slotAdd()));
      connect(dlg->m_buttonRemove, SIGNAL(clicked()),
         SLOT(slotRemove()));
      connect(dlg->m_buttonModify, SIGNAL(clicked()),
         SLOT(slotModify()));

      connect(dlg->m_listPrograms, SIGNAL(doubleClicked(QListViewItem *)),
         SLOT(slotProgramItemDoubleClicked(QListViewItem *)));
   }
   else
   {
Exemple #19
0
TreeRegions::TreeRegions(QWidget * parent): ui(new Ui::TreeRegions) // ??
{
	ui->setupUi(this);
	setupModel();
	QObject::connect(ui->action_New, SIGNAL(triggered()), this, SLOT(slotAdd()));
	QObject::connect(ui->action_NewRoot, SIGNAL(triggered()), this, SLOT(slotAddRoot()));
	QObject::connect(ui->action_Delete, SIGNAL(triggered()), this, SLOT(slotDelete()));
	QObject::connect(ui->action_Edit, SIGNAL(triggered()), this, SLOT(slotEdit()));
	QObject::connect(ui->action_Yes, SIGNAL(triggered()), this, SLOT(slotSave()));
	QObject::connect(ui->action_No, SIGNAL(triggered()), this, SLOT(slotCancel()));
	QObject::connect(ui->treeView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
		this, SLOT(slotEnableButtons(const QItemSelection &, const QItemSelection &)));
	QObject::connect(this, SIGNAL(signalChangeEditMode()), this, SLOT(slotEnableButtons()));
	slotEnableButtons(QItemSelection(), QItemSelection());
}
Exemple #20
0
void CVSService::slotAdd()
{
  QStringList files;
  if (!m_defaultFile.isEmpty())
  {
    if (m_defaultFile.startsWith(m_repositoryPath))
    {
      files += m_defaultFile.remove(m_repositoryPath);
      slotAdd(files);
    } else
    {
      notInRepository();
    }
  }
}
Exemple #21
0
ConfFilters::ConfFilters(TQWidget *parent, const char *name)
: TQWidget(parent, name)
{
	m_filters = new TDEListView(this);
	m_filters->addColumn(i18n("Mime Type"));
	m_filters->addColumn(i18n("Command"));
	m_filters->setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken);
	m_filters->setLineWidth(1);
	m_filters->setSorting(-1);
	m_filters->header()->setStretchEnabled(true, 1);
	connect(m_filters, TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_SLOT(slotChange()));

	m_add = new TQPushButton(this);
	m_add->setPixmap(BarIcon("document-new"));
	m_remove = new TQPushButton(this);
	m_remove->setIconSet(BarIconSet("remove"));
	m_change = new TQPushButton(this);
	m_change->setIconSet(BarIconSet("filter"));
	m_up = new TQPushButton(this);
	m_up->setIconSet(BarIconSet("go-up"));
	m_down = new TQPushButton(this);
	m_down->setIconSet(BarIconSet("go-down"));
	connect(m_add, TQT_SIGNAL(clicked()), TQT_SLOT(slotAdd()));
	connect(m_change, TQT_SIGNAL(clicked()), TQT_SLOT(slotChange()));
	connect(m_remove, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemove()));
	connect(m_up, TQT_SIGNAL(clicked()), TQT_SLOT(slotUp()));
	connect(m_down, TQT_SIGNAL(clicked()), TQT_SLOT(slotDown()));
	TQToolTip::add(m_add, i18n("Add filter"));
	TQToolTip::add(m_change, i18n("Modify filter"));
	TQToolTip::add(m_remove, i18n("Remove filter"));
	TQToolTip::add(m_up, i18n("Move filter up"));
	TQToolTip::add(m_down, i18n("Move filter down"));

	TQHBoxLayout	*l0 = new TQHBoxLayout(this, 10, 10);
	TQVBoxLayout	*l1 = new TQVBoxLayout(0, 0, 0);
	l0->addWidget(m_filters, 1);
	l0->addLayout(l1, 0);
	l1->addWidget(m_add);
	l1->addWidget(m_change);
	l1->addWidget(m_remove);
	l1->addSpacing(10);
	l1->addWidget(m_up);
	l1->addWidget(m_down);
	l1->addStretch(1);
	updateButton();
	connect(m_filters, TQT_SIGNAL(selectionChanged ()),TQT_SLOT(updateButton()));
}
Exemple #22
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;
}
YahooInviteListImpl::YahooInviteListImpl(QWidget *parent) : KDialog(parent)
{
	setButtons( KDialog::Cancel | KDialog::User1 );
	setEscapeButton( KDialog::Cancel );
	setButtonText( KDialog::User1, i18n("Invite") );

	QWidget* w = new QWidget( this );
	m_inviteWidget = new Ui::YahooInviteListBase();
	m_inviteWidget->setupUi( w );
	setMainWidget( w );	
	QObject::connect( this, SIGNAL(user1Clicked()), this, SLOT(slotInvite()) );
	QObject::connect( m_inviteWidget->btn_Add, SIGNAL(clicked()), this, SLOT(slotAdd()) );
	QObject::connect( m_inviteWidget->btn_Remove, SIGNAL(clicked()), this, SLOT(slotRemove()) );
	QObject::connect( m_inviteWidget->btnCustomAdd, SIGNAL(clicked()), this, SLOT(slotAddCustom()) );
        connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel()));
	m_inviteWidget->listFriends->setSelectionMode( QAbstractItemView::ExtendedSelection );
	m_inviteWidget->listInvited->setSelectionMode( QAbstractItemView::ExtendedSelection );

	show();
}
// ------ SignaturePanel
SignaturePanel::SignaturePanel(QObject *parent, QListView *listView, QToolButton *addButton, QToolButton *removeButton, const QString &newPrefix) :
    QObject(parent),
    m_newPrefix(newPrefix),
    m_model(new SignatureModel(this)),
    m_listView(listView),
    m_removeButton(removeButton)
{
    m_removeButton->setEnabled(false);

    connect(addButton, SIGNAL(clicked()), this, SLOT(slotAdd()));
    connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemove()));

    m_listView->setModel(m_model);
    SignatureDelegate *delegate = new SignatureDelegate(this);
    m_listView->setItemDelegate(delegate);
    connect(m_model, SIGNAL(checkSignature(QString,bool*)), this, SIGNAL(checkSignature(QString,bool*)));

    connect(m_listView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
            this, SLOT(slotSelectionChanged(QItemSelection,QItemSelection)));
}
Exemple #25
0
KURLListRequester::KURLListRequester(Mode requestMode, QWidget *parent)
    : QWidget(parent), mode(requestMode)
{
    // Creating the widget

    QGridLayout *urlListRequesterGrid = new QGridLayout(this);
    urlListRequesterGrid->setSpacing(0);
    urlListRequesterGrid->setContentsMargins(0, 0, 0, 0);

    urlLineEdit = new KLineEdit(this);
    urlListRequesterGrid->addWidget(urlLineEdit, 0, 0);

    urlListBox = new KrListWidget(this);
    urlListBox->setSelectionMode(QAbstractItemView::ExtendedSelection);
    urlListRequesterGrid->addWidget(urlListBox, 1, 0, 1, 3);

    urlAddBtn = new QToolButton(this);
    urlAddBtn->setText("");
    urlAddBtn->setIcon(QIcon::fromTheme("arrow-down"));
    urlListRequesterGrid->addWidget(urlAddBtn, 0, 1);

    urlBrowseBtn = new QToolButton(this);
    urlBrowseBtn->setText("");
    urlBrowseBtn->setIcon(QIcon::fromTheme("folder"));
    urlListRequesterGrid->addWidget(urlBrowseBtn, 0, 2);

    // add shell completion

    completion.setMode(KUrlCompletion::FileCompletion);
    urlLineEdit->setCompletionObject(&completion);

    // connection table

    connect(urlAddBtn, SIGNAL(clicked()), this, SLOT(slotAdd()));
    connect(urlBrowseBtn, SIGNAL(clicked()), this, SLOT(slotBrowse()));
    connect(urlLineEdit, SIGNAL(returnPressed(const QString&)), this, SLOT(slotAdd()));
    connect(urlListBox, SIGNAL(itemRightClicked(QListWidgetItem *, const QPoint &)), this,
            SLOT(slotRightClicked(QListWidgetItem *, const QPoint &)));
    connect(urlLineEdit, SIGNAL(textChanged(const QString &)), this, SIGNAL(changed()));
}
int FixtureManager::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotFixtureAdded((*reinterpret_cast< quint32(*)>(_a[1]))); break;
        case 1: slotFixtureRemoved((*reinterpret_cast< quint32(*)>(_a[1]))); break;
        case 2: slotModeChanged((*reinterpret_cast< Doc::Mode(*)>(_a[1]))); break;
        case 3: slotSelectionChanged(); break;
        case 4: slotDoubleClicked((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1]))); break;
        case 5: slotAdd(); break;
        case 6: slotRemove(); break;
        case 7: slotProperties(); break;
        case 8: slotContextMenuRequested((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 9;
    }
    return _id;
}
Exemple #27
0
CollectionEditor::CollectionEditor(QWidget* parent, Collection* fc, Doc* doc)
    : QWidget(parent)
    , m_doc(doc)
    , m_fc(fc)
{
    Q_ASSERT(doc != NULL);
    Q_ASSERT(fc != NULL);

    setupUi(this);

    connect(m_nameEdit, SIGNAL(textEdited(const QString&)),
            this, SLOT(slotNameEdited(const QString&)));
    connect(m_add, SIGNAL(clicked()), this, SLOT(slotAdd()));
    connect(m_remove, SIGNAL(clicked()), this, SLOT(slotRemove()));

    m_nameEdit->setText(m_fc->name());
    m_nameEdit->setSelection(0, m_nameEdit->text().length());

    updateFunctionList();

    // Set focus to the editor
    m_nameEdit->setFocus();
}
CManageDrivers::CManageDrivers( QWidget* pwidgetParent )
    : QWidget( pwidgetParent )
{
    QPushButton *ppushbuttonAdd = new QPushButton( tr( "A&dd..." ) );
    ppushbuttonAdd->setToolTip( tr( "click to add/register a driver" ) );
    ppushbuttonAdd->setWhatsThis( tr( "Click this to register a driver. Registering a driver informs the Driver Manager about its location and allows some driver-level options to be set. A well behaved driver installer will automatically register a driver but there are times when this needs to be done manually here. You will need to have elevated (root) privileges to do this." ) );

    QPushButton *ppushbuttonConfigure = new QPushButton( tr( "&Configure..." ) );
    ppushbuttonConfigure->setToolTip( tr( "click to configure the selected driver" ) );
    ppushbuttonConfigure->setWhatsThis( tr( "Click this to edit driver options. You will need to have elevated (root) privileges to do this." ) );

    QPushButton *ppushbuttonRemove = new QPushButton( tr( "&Remove" ) );
    ppushbuttonRemove->setToolTip( tr( "click to remove the selected driver" ) );
    ppushbuttonRemove->setWhatsThis( tr( "Click this to deregister the selected driver. This does not remove any files from the system. You will need to have elevated (root) privileges to do this." ) );

    QHBoxLayout *playout                = new QHBoxLayout;
    QVBoxLayout *playoutButtons         = new QVBoxLayout;
    CDriverList *pDriverList            = new CDriverList;

    playoutButtons->addWidget( ppushbuttonAdd );
    playoutButtons->addWidget( ppushbuttonConfigure );
    playoutButtons->addWidget( ppushbuttonRemove );
    playoutButtons->addStretch( 10 );

    playout->addWidget( pDriverList );
    playout->addLayout( playoutButtons );

    setLayout( playout );

    connect( ppushbuttonAdd, SIGNAL(clicked()), pDriverList, SLOT(slotAdd()) );
    connect( ppushbuttonConfigure, SIGNAL(clicked()), pDriverList, SLOT(slotEdit()) );
    connect( ppushbuttonRemove, SIGNAL(clicked()), pDriverList, SLOT(slotDelete()) );
    connect( pDriverList, SIGNAL(signalChanged()), this, SIGNAL(signalChanged()) );

    setWindowIcon( QPixmap( xpmDriver48 ) );
    setWindowTitle( tr( "Drivers" ) );
}
Exemple #29
0
CVSService::CVSService(KActionCollection *ac)
{
  m_menu = new KPopupMenu();
  KAction *action = new KAction(i18n("&Commit..."), "vcs_commit", 0, this, SLOT(slotCommit()), ac, "vcs_commit");
  action->plug(m_menu);
  action = new KAction(i18n("&Update"), "vcs_update", 0, this, SLOT(slotUpdate()), ac, "vcs_update");
  action->plug(m_menu);
  KPopupMenu *updateToMenu = new KPopupMenu(m_menu);
  m_menu->insertItem(SmallIconSet("vcs_update"), i18n("Update &To"), updateToMenu);
  action = new KAction(i18n("&Tag/Date..."), "vcs_update", 0, this, SLOT(slotUpdateToTag()), ac, "vcs_update_tag_date");
  action->plug(updateToMenu);
  action = new KAction(i18n("&HEAD"), "vcs_update", 0, this, SLOT(slotUpdateToHead()), ac, "vcs_update_head");
  action->plug(updateToMenu);
  action = new KAction(i18n("Re&vert"), "reload", 0, this, SLOT(slotRevert()), ac, "vcs_revert");
  action->plug(m_menu);
  m_menu->insertSeparator();
  action = new KAction(i18n("&Add to Repository..."), "vcs_add", 0, this, SLOT(slotAdd()), ac, "vcs_add");
  action->plug(m_menu);
  action = new KAction(i18n("&Remove From Repository..."), "vcs_remove", 0, this, SLOT(slotRemove()), ac, "vcs_remove");
  action->plug(m_menu);
  action = new KAction(i18n("&Ignore in CVS Operations"), 0, this, SLOT(slotAddToCVSIgnore()), ac);
  action->plug(m_menu);
  action = new KAction(i18n("Do &Not Ignore in CVS Operations"), 0, this, SLOT(slotRemoveFromCVSIgnore()), ac);
  action->plug(m_menu);
  
  m_menu->insertSeparator();
  action = new KAction(i18n("Show &Log Messages"), 0, this, SLOT(slotBrowseLog()), ac);
  action->plug(m_menu);
    
  m_cvsJob = 0L;
  m_repository = 0L;
  m_cvsService =0L;
  m_commitDlg = new CVSCommitDlgS();
  m_updateToDlg = new CVSUpdateToDlgS();
  m_timer = new QTimer(this);
  connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
}
void PerforcePart::contextMenu(QPopupMenu *popup, const Context *context)
{
    if (context->hasType( Context::FileContext )) {
        const FileContext *fcontext = static_cast<const FileContext*>(context);
        popupfile = fcontext->urls().first().path();
        QFileInfo fi( popupfile );
        popup->insertSeparator();

        KPopupMenu *sub = new KPopupMenu(popup);
        QString name = fi.fileName();
        sub->insertTitle( i18n("Actions for %1").arg(name) );

        int id = sub->insertItem( i18n("Edit"),
                           this, SLOT(slotEdit()) );
        sub->setWhatsThis(id, i18n("<b>Edit</b><p>Opens file(s) in a client workspace for edit."));
        id = sub->insertItem( i18n("Revert"),
                           this, SLOT(slotRevert()) );
        sub->setWhatsThis(id, i18n("<b>Revert</b><p>Discards changes made to open files."));
        id = sub->insertItem( i18n("Submit"),
                           this, SLOT(slotCommit()) );
        sub->setWhatsThis(id, i18n("<b>Submit</b><p>Sends changes made to open files to the depot."));
        id = sub->insertItem( i18n("Sync"),
                           this, SLOT(slotUpdate()) );
        sub->setWhatsThis(id, i18n("<b>Sync</b><p>Copies files from the depot into the workspace."));
        sub->insertSeparator();
        id = sub->insertItem( i18n("Diff Against Repository"),
                          this, SLOT(slotDiff()) );
        sub->setWhatsThis(id, i18n("<b>Diff against repository</b><p>Compares a client workspace file to a revision in the depot."));
        id = sub->insertItem( i18n("Add to Repository"),
                           this, SLOT(slotAdd()) );
        sub->setWhatsThis(id, i18n("<b>Add to repository</b><p>Open file(s) in a client workspace for addition to the depot."));
        id = sub->insertItem( i18n("Remove From Repository"),
                           this, SLOT(slotRemove()) );
        sub->setWhatsThis(id, i18n("<b>Remove from repository</b><p>Open file(s) in a client workspace for deletion from the depot."));
        id = popup->insertItem(i18n("Perforce"), sub);
    }
}