示例#1
0
PlayList::PlayList(QWidget *parent) : QWidget(parent),
        m_listView(new PlayListView(this)),
        m_buttonBar(new QFrame(this)),
        m_barLayout(new QHBoxLayout(m_buttonBar)),
        m_playButton(0),
        m_moveUpButton(0),
        m_moveDownButton(0),
        m_deleteButton(0),
        m_clearButton(0)
{
    QVBoxLayout *vLayout = new QVBoxLayout;
    vLayout->addWidget(m_listView);
    vLayout->addWidget(m_buttonBar);
    setLayout(vLayout);

    m_openButton = new QPushButton(m_buttonBar);
    m_playButton = new QPushButton(m_buttonBar);
    m_moveUpButton = new QPushButton(m_buttonBar);
    m_moveDownButton = new QPushButton(m_buttonBar);
    m_deleteButton = new QPushButton(m_buttonBar);
    m_clearButton = new QPushButton(m_buttonBar);
    m_barLayout->addWidget(m_openButton);
    m_barLayout->addWidget(m_playButton);
    m_barLayout->addWidget(m_moveUpButton);
    m_barLayout->addWidget(m_moveDownButton);
    m_barLayout->addWidget(m_deleteButton);
    m_barLayout->addWidget(m_clearButton);
    m_barLayout->addStretch();


    m_openButton ->setText(tr("Add..."));
    m_playButton ->setText(tr("Play"));
    m_moveUpButton ->setText(tr("Move Up"));
    m_moveDownButton->setText(tr("Move Down"));
    m_deleteButton ->setText(tr("Remove"));
    m_clearButton ->setText(tr("Clear whole List"));

    connect(m_openButton, SIGNAL(clicked()), SLOT(slotOpenFiles()));
    connect(m_playButton, SIGNAL(clicked()),SLOT(slotPlay()));
    connect(m_deleteButton, SIGNAL(clicked()), SLOT(slotDeleteCurrent()));
    connect(m_clearButton, SIGNAL(clicked()), SLOT(slotClear()));
    connect(m_moveUpButton, SIGNAL(clicked()), SLOT(slotMoveUp()));
    connect(m_moveDownButton, SIGNAL(clicked()), SLOT(slotMoveDown()));
    
    connect(m_listView, SIGNAL(droppedURIs(QDropEvent*, QTreeWidget*, QStringList)),
            SLOT(slotDroppedURIs(QDropEvent*, QTreeWidget*, QStringList)));
    
    connect(m_listView, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
                this, SLOT(slotCurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
    
//     connect(m_listView, SIGNAL(currentChanged(QTreeWidgetItem*)),
//             SLOT(slotCurrentItemChanged(QTreeWidgetItem*)));
//     connect(m_listView, SIGNAL(dropped(QDropEvent*, QTreeWidgetItem*)),
//             SLOT(slotDropped(QDropEvent*, QTreeWidgetItem*)));

    restore();

    enableButtons(0);

}
示例#2
0
KSettingsHome::KSettingsHome(QWidget* parent) :
    KSettingsHomeDecl(parent),
    m_noNeedToUpdateList(false)
{
  m_homePageList->setSortingEnabled(false);

  KIconLoader* il = KIconLoader::global();
  KGuiItem upButtonItem(i18nc("Move item up",  "&Up"),
                        il->loadIcon("go-up", KIconLoader::Small, KIconLoader::SizeSmall),
                        i18n("Move selected item up"),
                        i18n("Use this to move the selected item up by one position in the list."));
  KGuiItem downButtonItem(i18n("&Down"),
                          il->loadIcon("go-down", KIconLoader::Small, KIconLoader::SizeSmall),
                          i18n("Move selected item down"),
                          i18n("Use this to move the selected item down by one position in the list."));

  KGuiItem::assign(m_upButton, upButtonItem);
  m_upButton->setEnabled(false);
  KGuiItem::assign(m_downButton, downButtonItem);
  m_downButton->setEnabled(false);

  // connect this, so that the list gets loaded once the edit field is filled
  connect(kcfg_ItemList, SIGNAL(textChanged(QString)), this, SLOT(slotLoadItems()));

  connect(m_homePageList, SIGNAL(itemSelectionChanged()),
          this, SLOT(slotSelectHomePageItem()));
  connect(m_homePageList, SIGNAL(clicked(QModelIndex)), this, SLOT(slotUpdateItemList()));

  connect(m_upButton, SIGNAL(clicked()), this, SLOT(slotMoveUp()));
  connect(m_downButton, SIGNAL(clicked()), this, SLOT(slotMoveDown()));

  // Don't show it to the user, we only need it to load and save the settings
  kcfg_ItemList->hide();
}
示例#3
0
DlgPresence::DlgPresence(QWidget *parent) : QWidget(parent),m_Changed(false)
{
   setupUi(this);
   m_pView->setModel(PresenceStatusModel::instance());
   m_pUp->setIcon     ( KIcon( "go-up"       ) );
   m_pDown->setIcon   ( KIcon( "go-down"     ) );
   m_pAdd->setIcon    ( KIcon( "list-add"    ) );
   m_pRemove->setIcon ( KIcon( "list-remove" ) );
   connect(m_pAdd   , SIGNAL(clicked()),PresenceStatusModel::instance() ,SLOT(addRow())       );
   connect(m_pUp    , SIGNAL(clicked()),this                            ,SLOT(slotMoveUp())   );
   connect(m_pDown  , SIGNAL(clicked()),this                            ,SLOT(slotMoveDown()) );
   connect(m_pRemove, SIGNAL(clicked()),this                            ,SLOT(slotRemoveRow()));
   connect(this     , SIGNAL(updateButtons()) , parent                  ,SLOT(updateButtons()));
   connect(PresenceStatusModel::instance(),SIGNAL(dataChanged(QModelIndex,QModelIndex)),this,SLOT(slotChanged()));

   m_pView->horizontalHeader()->setResizeMode(0,QHeaderView::ResizeToContents);
   m_pView->horizontalHeader()->setResizeMode(1,QHeaderView::Stretch);
   for (int i=2;i<PresenceStatusModel::instance()->columnCount();i++) {
      m_pView->horizontalHeader()->setResizeMode(i,QHeaderView::ResizeToContents);
   }

   //Add an info tip in the account list
   m_pTipManager = new TipManager(m_pView);
   m_pTip = new Tip(i18n("In this table, it is possible to manage different presence states. "
   "The \"Message\" and \"Present\" values will be exported to the server for every accounts that support it. "
   "The other fields are designed to make presence status management easier. Please note that some SIP registrar "
   "have incomplete presence status (publishing) support."),this);
   m_pTip->setMaximumWidth(510);
   m_pTipManager->setCurrentTip(m_pTip);
}
void BedItemModel::slotMoveCurrentBedDown() {
    if (!hasCurrentBed()) {
        return;
    }
    QModelIndex idx = findIndexForBed(getCurrentBed());
    if (!idx.isValid()) {
        return;
    }

    slotMoveDown(idx);
}
示例#5
0
void DTScheduleWidget::setupActions()
{
    connect(ui->acDelReception, SIGNAL(triggered()), this, SLOT(slotDelReception()));
    connect(ui->acClientInfo, SIGNAL(triggered()), this, SLOT(slotClientInfo()));

    connect(ui->mCalendar, SIGNAL(activated(QDate)), this, SLOT(slotChangeDate(QDate)));
    connect(ui->mCalendar, SIGNAL(clicked(QDate)), this, SLOT(slotChangeDate(QDate)));
    connect(ui->mDeReceptionDate, SIGNAL(dateChanged(QDate)), this, SLOT(slotChangeMoveDate(QDate)));
    connect(ui->mScheduleView, SIGNAL(eventAddReception(QString,QDateTime,QDateTime)), this, SLOT(slotAddReception(QString,QDateTime,QDateTime)));
    connect(ui->mScheduleView, SIGNAL(contextMenuRequested(QModelIndex,QPoint)), this, SLOT(slotContextMenuRequested(QModelIndex,QPoint)));

    connect(ui->mTbSplit, SIGNAL(clicked(bool)), this, SLOT(slotSplitView(bool)));
    connect(ui->mPbClose, SIGNAL(clicked()), this, SLOT(slotClose()));
    connect(ui->mTbUp, SIGNAL(clicked()), this, SLOT(slotMoveUp()));
    connect(ui->mTbDown, SIGNAL(clicked()), this, SLOT(slotMoveDown()));
}
示例#6
0
KCustomMenuEditor::KCustomMenuEditor(QWidget *parent)
  : KDialogBase(parent, "custommenueditor", true, i18n("Menu Editor"), Ok|Cancel, Ok, true),
    m_listView(0)
{
    d = new KCustomMenuEditorPrivate;
   QHBox *page = makeHBoxMainWidget();
   m_listView = new KListView(page);
   m_listView->addColumn(i18n("Menu"));
   m_listView->setFullWidth(true);
   m_listView->setSorting(-1);
   KButtonBox *buttonBox = new KButtonBox(page, Vertical);
   buttonBox->addButton(i18n("New..."), this, SLOT(slotNewItem()));
   d->pbRemove=buttonBox->addButton(i18n("Remove"), this, SLOT(slotRemoveItem()));
   d->pbMoveUp=buttonBox->addButton(i18n("Move Up"), this, SLOT(slotMoveUp()));
   d->pbMoveDown=buttonBox->addButton(i18n("Move Down"), this, SLOT(slotMoveDown()));
   buttonBox->layout();
   connect( m_listView, SIGNAL( selectionChanged () ), this, SLOT( refreshButton() ) );
   refreshButton();
}
示例#7
0
BGMultiWallpaperDialog::BGMultiWallpaperDialog(KBackgroundSettings *settings,
	QWidget *parent, const char *name)
	: KDialog( parent ), m_pSettings(settings)
{
   setObjectName( name );
   setModal( true );
   setCaption( i18n("Setup Slide Show") );
   setButtons( Ok | Cancel );
   showButtonSeparator( true );

   dlg = new BGMultiWallpaperBase(this);
   setMainWidget(dlg);

   dlg->m_spinInterval->setRange(1, 99999);
   dlg->m_spinInterval->setSingleStep(15);
   dlg->m_spinInterval->setSuffix(i18n(" min"));

   // Load
   dlg->m_spinInterval->setValue(qMax(1,m_pSettings->wallpaperChangeInterval()));

   dlg->m_listImages->addItems(m_pSettings->wallpaperList());

   if (m_pSettings->multiWallpaperMode() == KBackgroundSettings::Random)
      dlg->m_cbRandom->setChecked(true);

   connect(dlg->m_buttonAdd, SIGNAL(clicked()), SLOT(slotAdd()));
   connect(dlg->m_buttonRemove, SIGNAL(clicked()), SLOT(slotRemove()));
   connect(dlg->m_buttonMoveUp, SIGNAL(clicked()), SLOT(slotMoveUp()));
   connect(dlg->m_buttonMoveDown, SIGNAL(clicked()), SLOT(slotMoveDown()));
   connect(dlg->m_listImages, SIGNAL(itemClicked ( QListWidgetItem * )), SLOT(slotItemSelected( QListWidgetItem *)));
   connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
   dlg->m_buttonRemove->setEnabled( false );
   dlg->m_buttonMoveUp->setEnabled( false );
   dlg->m_buttonMoveDown->setEnabled( false );

}
示例#8
0
文件: ClsQSAList.cpp 项目: jeez/iqr
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();
}
CompletionOrderEditor::CompletionOrderEditor(KPIM::LdapSearch *ldapSearch,
        QWidget *parent, const char *name)
    : KDialogBase(parent, name, true, i18n("Edit Completion Order"), Ok | Cancel, Ok, true),
      mConfig("kpimcompletionorder"), mDirty(false)
{
    mItems.setAutoDelete(true);
    // The first step is to gather all the data, creating CompletionItem objects
    QValueList< LdapClient * > ldapClients = ldapSearch->clients();
    for(QValueList<LdapClient *>::const_iterator it = ldapClients.begin(); it != ldapClients.end(); ++it)
    {
        //kdDebug(5300) << "LDAP: host " << (*it)->host() << " weight " << (*it)->completionWeight() << endl;
        mItems.append(new LDAPCompletionItem(*it));
    }
    KABC::AddressBook *addressBook = KABC::StdAddressBook::self(true);
    QPtrList<KABC::Resource> resources = addressBook->resources();
    for(QPtrListIterator<KABC::Resource> resit(resources); *resit; ++resit)
    {
        //kdDebug(5300) << "KABC Resource: " << (*resit)->className() << endl;
        ResourceABC *res = dynamic_cast<ResourceABC *>(*resit);
        if(res)      // IMAP KABC resource
        {
            const QStringList subresources = res->subresources();
            for(QStringList::const_iterator it = subresources.begin(); it != subresources.end(); ++it)
            {
                mItems.append(new KABCImapSubResCompletionItem(res, *it));
            }
        }
        else     // non-IMAP KABC resource
        {
            mItems.append(new SimpleCompletionItem(this, (*resit)->resourceName(),
                                                   (*resit)->identifier()));
        }
    }

#ifndef KDEPIM_NEW_DISTRLISTS // new distr lists are normal contact, so no separate item if using them
    // Add an item for distribution lists
    mItems.append(new SimpleCompletionItem(this, i18n("Distribution Lists"), "DistributionLists"));
#endif

    // Now sort the items, then create the GUI
    mItems.sort();

    QHBox *page = makeHBoxMainWidget();
    mListView = new KListView(page);
    mListView->setSorting(-1);
    mListView->addColumn(QString::null);
    mListView->header()->hide();

    for(QPtrListIterator<CompletionItem> compit(mItems); *compit; ++compit)
    {
        new CompletionViewItem(mListView, *compit);
        kdDebug(5300) << "  " << (*compit)->label() << " " << (*compit)->completionWeight() << endl;
    }

    QVBox *upDownBox = new QVBox(page);
    mUpButton = new KPushButton(upDownBox, "mUpButton");
    mUpButton->setIconSet(BarIconSet("up", KIcon::SizeSmall));
    mUpButton->setEnabled(false);   // b/c no item is selected yet
    mUpButton->setFocusPolicy(StrongFocus);

    mDownButton = new KPushButton(upDownBox, "mDownButton");
    mDownButton->setIconSet(BarIconSet("down", KIcon::SizeSmall));
    mDownButton->setEnabled(false);   // b/c no item is selected yet
    mDownButton->setFocusPolicy(StrongFocus);

    QWidget *spacer = new QWidget(upDownBox);
    upDownBox->setStretchFactor(spacer, 100);

    connect(mListView, SIGNAL(selectionChanged(QListViewItem *)),
            SLOT(slotSelectionChanged(QListViewItem *)));
    connect(mUpButton, SIGNAL(clicked()), this, SLOT(slotMoveUp()));
    connect(mDownButton, SIGNAL(clicked()), this, SLOT(slotMoveDown()));
}
示例#10
0
KXmlCommandAdvancedDlg::KXmlCommandAdvancedDlg(TQWidget *parent, const char *name)
: TQWidget(parent, name)
{
	m_xmlcmd = 0;

	m_command = new TQLineEdit(this);
	m_view = new TDEListView(this);
	m_view->addColumn("");
	m_view->header()->hide();
	m_view->setSorting(-1);
	m_apply = new TQToolButton(this);
	m_apply->setIconSet( TQApplication::reverseLayout()? SmallIconSet( "forward" ) : SmallIconSet("back"));
	m_addgrp = new TQToolButton(this);
	m_addgrp->setIconSet(SmallIconSet("folder"));
	m_addopt = new TQToolButton(this);
	m_addopt->setIconSet(SmallIconSet("document"));
	m_delopt = new TQToolButton(this);
	m_delopt->setIconSet(SmallIconSet("editdelete"));
	m_up = new TQToolButton(this);
	m_up->setIconSet(SmallIconSet("up"));
	m_down = new TQToolButton(this);
	m_down->setIconSet(SmallIconSet("down"));
	m_dummy = new TQWidget(this);
	m_desc = new TQLineEdit(m_dummy);
	m_name = new TQLineEdit(m_dummy);
	m_type = new TQComboBox(m_dummy);
	m_type->insertItem(i18n("String"));
	m_type->insertItem(i18n("Integer"));
	m_type->insertItem(i18n("Float"));
	m_type->insertItem(i18n("List"));
	m_type->insertItem(i18n("Boolean"));
	m_format = new TQLineEdit(m_dummy);
	m_default = new TQLineEdit(m_dummy);
	TQLabel	*m_namelab = new TQLabel(i18n("&Name:"), m_dummy);
	TQLabel	*m_desclab = new TQLabel(i18n("&Description:"), m_dummy);
	TQLabel	*m_formatlab = new TQLabel(i18n("&Format:"), m_dummy);
	TQLabel	*m_typelab = new TQLabel(i18n("&Type:"), m_dummy);
	TQLabel	*m_defaultlab = new TQLabel(i18n("Default &value:"), m_dummy);
	TQLabel	*m_commandlab = new TQLabel(i18n("Co&mmand:"), this);
	m_namelab->setBuddy(m_name);
	m_desclab->setBuddy(m_desc);
	m_formatlab->setBuddy(m_format);
	m_typelab->setBuddy(m_type);
	m_defaultlab->setBuddy(m_default);
	m_commandlab->setBuddy(m_command);
	m_persistent = new TQCheckBox( i18n( "&Persistent option" ), m_dummy );

	TQGroupBox	*gb = new TQGroupBox(0, Qt::Horizontal, i18n("Va&lues"), m_dummy);
	m_stack = new TQWidgetStack(gb);
	TQWidget	*w1 = new TQWidget(m_stack), *w2 = new TQWidget(m_stack), *w3 = new TQWidget(m_stack);
	m_stack->addWidget(w1, 1);
	m_stack->addWidget(w2, 2);
	m_stack->addWidget(w3, 3);
	m_edit1 = new TQLineEdit(w1);
	m_edit2 = new TQLineEdit(w1);
	TQLabel	*m_editlab1 = new TQLabel(i18n("Minimum v&alue:"), w1);
	TQLabel	*m_editlab2 = new TQLabel(i18n("Ma&ximum value:"), w1);
	m_editlab1->setBuddy(m_edit1);
	m_editlab2->setBuddy(m_edit2);
	m_values = new TDEListView(w2);
	m_values->addColumn(i18n("Name"));
	m_values->addColumn(i18n("Description"));
	m_values->setAllColumnsShowFocus(true);
	m_values->setSorting(-1);
	m_values->setMaximumHeight(110);
	m_addval = new TQToolButton(w2);
	m_addval->setIconSet(SmallIconSet("editcopy"));
	m_delval = new TQToolButton(w2);
	m_delval->setIconSet(SmallIconSet("editdelete"));
	TQToolTip::add(m_addval, i18n("Add value"));
	TQToolTip::add(m_delval, i18n("Delete value"));

	TQToolTip::add(m_apply, i18n("Apply changes"));
	TQToolTip::add(m_addgrp, i18n("Add group"));
	TQToolTip::add(m_addopt, i18n("Add option"));
	TQToolTip::add(m_delopt, i18n("Delete item"));
	TQToolTip::add(m_up, i18n("Move up"));
	TQToolTip::add(m_down, i18n("Move down"));

	KSeparator	*sep1 = new KSeparator(KSeparator::HLine, m_dummy);

	TQGroupBox	*gb_input = new TQGroupBox(0, Qt::Horizontal, i18n("&Input From"), this);
	TQGroupBox	*gb_output = new TQGroupBox(0, Qt::Horizontal, i18n("O&utput To"), this);
	TQLabel	*m_inputfilelab = new TQLabel(i18n("File:"), gb_input);
	TQLabel	*m_inputpipelab = new TQLabel(i18n("Pipe:"), gb_input);
	TQLabel	*m_outputfilelab = new TQLabel(i18n("File:"), gb_output);
	TQLabel	*m_outputpipelab = new TQLabel(i18n("Pipe:"), gb_output);
	m_inputfile = new TQLineEdit(gb_input);
	m_inputpipe = new TQLineEdit(gb_input);
	m_outputfile = new TQLineEdit(gb_output);
	m_outputpipe = new TQLineEdit(gb_output);

	m_comment = new KTextEdit( this );
	m_comment->setTextFormat(TQt::RichText );
	m_comment->setReadOnly(true);
	TQLabel *m_commentlab = new TQLabel( i18n( "Comment:" ), this );

	TQVBoxLayout	*l2 = new TQVBoxLayout(this, 0, KDialog::spacingHint());
	TQHBoxLayout	*l3 = new TQHBoxLayout(0, 0, KDialog::spacingHint());
	TQVBoxLayout	*l7 = new TQVBoxLayout(0, 0, 0);
	l2->addLayout(l3, 0);
	l3->addWidget(m_commandlab);
	l3->addWidget(m_command);
	TQHBoxLayout	*l0 = new TQHBoxLayout(0, 0, KDialog::spacingHint());
	TQGridLayout	*l10 = new TQGridLayout(0, 2, 2, 0, KDialog::spacingHint());
	l2->addLayout(l0, 1);
	l0->addLayout(TQT_TQLAYOUT(l10));
	l10->addMultiCellWidget(m_view, 0, 0, 0, 1);
	l10->addWidget(gb_input, 1, 0);
	l10->addWidget(gb_output, 1, 1);
	l10->setRowStretch(0, 1);
	l0->addLayout(l7);
	l7->addWidget(m_apply);
	l7->addSpacing(5);
	l7->addWidget(m_addgrp);
	l7->addWidget(m_addopt);
	l7->addWidget(m_delopt);
	l7->addSpacing(5);
	l7->addWidget(m_up);
	l7->addWidget(m_down);
	l7->addStretch(1);
	l0->addWidget(m_dummy, 1);
	TQGridLayout	*l1 = new TQGridLayout(m_dummy, 9, 2, 0, KDialog::spacingHint());
	l1->addWidget(m_desclab, 0, 0, Qt::AlignRight|Qt::AlignVCenter);
	l1->addWidget(m_desc, 0, 1);
	l1->addMultiCellWidget(sep1, 1, 1, 0, 1);
	l1->addWidget(m_namelab, 2, 0, Qt::AlignRight|Qt::AlignVCenter);
	l1->addWidget(m_name, 2, 1);
	l1->addWidget(m_typelab, 3, 0, Qt::AlignRight|Qt::AlignVCenter);
	l1->addWidget(m_type, 3, 1);
	l1->addWidget(m_formatlab, 4, 0, Qt::AlignRight|Qt::AlignVCenter);
	l1->addWidget(m_format, 4, 1);
	l1->addWidget(m_defaultlab, 5, 0, Qt::AlignRight|Qt::AlignVCenter);
	l1->addWidget(m_default, 5, 1);
	l1->addWidget( m_persistent, 6, 1 );
	l1->addMultiCellWidget(gb, 7, 7, 0, 1);
	l1->setRowStretch(8, 1);

	TQHBoxLayout	*l4 = new TQHBoxLayout(w2, 0, KDialog::spacingHint());
	l4->addWidget(m_values);
	TQVBoxLayout	*l6 = new TQVBoxLayout(0, 0, 0);
	l4->addLayout(l6);
	l6->addWidget(m_addval);
	l6->addWidget(m_delval);
	l6->addStretch(1);
	TQGridLayout	*l5 = new TQGridLayout(w1, 3, 2, 0, KDialog::spacingHint());
	l5->setRowStretch(2, 1);
	l5->addWidget(m_editlab1, 0, 0, Qt::AlignRight|Qt::AlignVCenter);
	l5->addWidget(m_editlab2, 1, 0, Qt::AlignRight|Qt::AlignVCenter);
	l5->addWidget(m_edit1, 0, 1);
	l5->addWidget(m_edit2, 1, 1);

	TQGridLayout	*l8 = new TQGridLayout(gb_input->layout(), 2, 2,
		KDialog::spacingHint());
	TQGridLayout	*l9 = new TQGridLayout(gb_output->layout(), 2, 2,
		KDialog::spacingHint());
	l8->addWidget(m_inputfilelab, 0, 0);
	l8->addWidget(m_inputpipelab, 1, 0);
	l8->addWidget(m_inputfile, 0, 1);
	l8->addWidget(m_inputpipe, 1, 1);
	l9->addWidget(m_outputfilelab, 0, 0);
	l9->addWidget(m_outputpipelab, 1, 0);
	l9->addWidget(m_outputfile, 0, 1);
	l9->addWidget(m_outputpipe, 1, 1);

	TQVBoxLayout	*l11 = new TQVBoxLayout(TQT_TQLAYOUT(gb->layout()));
	l11->addWidget(m_stack);

	TQVBoxLayout *l12 = new TQVBoxLayout( 0, 0, 0 );
	l2->addSpacing( 10 );
	l2->addLayout( l12 );
	l12->addWidget( m_commentlab );
	l12->addWidget( m_comment );

	connect(m_view, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(slotSelectionChanged(TQListViewItem*)));
	connect(m_values, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(slotValueSelected(TQListViewItem*)));
	connect(m_type, TQT_SIGNAL(activated(int)), TQT_SLOT(slotTypeChanged(int)));
	connect(m_addval, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddValue()));
	connect(m_delval, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemoveValue()));
	connect(m_apply, TQT_SIGNAL(clicked()), TQT_SLOT(slotApplyChanges()));
	connect(m_addgrp, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddGroup()));
	connect(m_addopt, TQT_SIGNAL(clicked()), TQT_SLOT(slotAddOption()));
	connect(m_delopt, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemoveItem()));
	connect(m_up, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveUp()));
	connect(m_down, TQT_SIGNAL(clicked()), TQT_SLOT(slotMoveDown()));
	connect(m_command, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotCommandChanged(const TQString&)));
	connect(m_view, TQT_SIGNAL(itemRenamed(TQListViewItem*,int)), TQT_SLOT(slotOptionRenamed(TQListViewItem*,int)));
	connect(m_desc, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged()));
	connect(m_name, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged()));
	connect(m_format, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged()));
	connect(m_default, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged()));
	connect(m_edit1, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged()));
	connect(m_edit2, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotChanged()));
	connect(m_type, TQT_SIGNAL(activated(int)), TQT_SLOT(slotChanged()));
	connect(m_addval, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged()));
	connect(m_delval, TQT_SIGNAL(clicked()), TQT_SLOT(slotChanged()));
	connect( m_persistent, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( slotChanged() ) );
	m_dummy->setEnabled(false);
	viewItem(0);

	/**
	 * Add some short help for the normal (non expert) user
	 */
	TQWhatsThis::add( m_name, i18n(
				"An identification string. Use only alphanumeric characters except spaces. "
				"The string <b>__root__</b> is reserved for internal use." ) );
	TQWhatsThis::add( m_namelab, TQWhatsThis::textFor( m_name ) );
	TQWhatsThis::add( m_desc, i18n(
				"A description string. This string is shown in the interface, and should "
				"be explicit enough about the role of the corresponding option." ) );
	TQWhatsThis::add( m_desclab, TQWhatsThis::textFor( m_desc ) );
	TQWhatsThis::add( m_type, i18n(
				"The type of the option. This determines how the option is presented "
				"graphically to the user." ) );
	TQWhatsThis::add( m_typelab, TQWhatsThis::textFor( m_type ) );
	TQWhatsThis::add( m_format, i18n(
				"The format of the option. This determines how the option is formatted "
				"for inclusion in the global command line. The tag <b>%value</b> can be used "
				"to represent the user selection. This tag will be replaced at run-time by a "
				"string representation of the option value." ) );
	TQWhatsThis::add( m_formatlab, TQWhatsThis::textFor( m_format ) );
	TQWhatsThis::add( m_default, i18n(
				"The default value of the option. For non persistent options, nothing is "
				"added to the command line if the option has that default value. If this "
				"value does not correspond to the actual default value of the underlying "
				"utility, make the option persistent to avoid unwanted effects." ) );
	TQWhatsThis::add( m_defaultlab, TQWhatsThis::textFor( m_default ) );
	TQWhatsThis::add( m_persistent, i18n(
				"Make the option persistent. A persistent option is always written to the "
				"command line, whatever its value. This is useful when the chosen default "
				"value does not match with the actual default value of the underlying utility." ) );
	TQWhatsThis::add( m_command, i18n(
				"The full command line to execute the associated underlying utility. This "
				"command line is based on a mechanism of tags that are replaced at run-time. "
				"The supported tags are:<ul>"
				"<li><b>%filterargs</b>: command options</li>"
				"<li><b>%filterinput</b>: input specification</li>"
				"<li><b>%filteroutput</b>: output specification</li>"
				"<li><b>%psu</b>: the page size in upper case</li>"
				"<li><b>%psl</b>: the page size in lower case</li></ul>" ) );
	TQWhatsThis::add( m_commandlab, TQWhatsThis::textFor( m_command ) );
	TQWhatsThis::add( m_inputfile, i18n(
				"Input specification when the underlying utility reads input data from a file. Use "
				"the tag <b>%in</b> to represent the input filename." ) );
	TQWhatsThis::add( m_inputfilelab, TQWhatsThis::textFor( m_inputfile ) );
	TQWhatsThis::add( m_outputfile, i18n(
				"Output specification when the underlying utility writes output data to a file. Use "
				"the tag <b>%out</b> to represent the output filename." ) );
	TQWhatsThis::add( m_outputfilelab, TQWhatsThis::textFor( m_outputfile ) );
	TQWhatsThis::add( m_inputpipe, i18n(
				"Input specification when the underlying utility reads input data from its "
				"standard input." ) );
	TQWhatsThis::add( m_inputpipelab, TQWhatsThis::textFor( m_inputpipe ) );
	TQWhatsThis::add( m_outputpipe, i18n(
				"Output specification when the underlying utility writes output data to its "
				"standard output." ) );
	TQWhatsThis::add( m_outputpipelab, TQWhatsThis::textFor( m_outputpipe ) );
	TQWhatsThis::add( m_comment, i18n(
				"A comment about the underlying utility, which can be viewed by the user "
				"from the interface. This comment string supports basic HTML tags like "
				"&lt;a&gt;, &lt;b&gt; or &lt;i&gt;." ) );
	TQWhatsThis::add( m_commentlab, TQWhatsThis::textFor( m_comment ) );

	resize(660, 200);
}
示例#11
0
文件: ClsQSAList.cpp 项目: jeez/iqr
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);
}