示例#1
0
LinkerTab::LinkerTab( QWidget * parent, const char * name )
    : QWidget(parent, name), radioController(new FlagRadioButtonController()),
      pathController(new FlagPathEditController()),
      editController(new FlagEditController())
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    QVButtonGroup *map_group = new QVButtonGroup(i18n("Map File"), this);
    QRadioButton *m_defaultMap = new QRadioButton(i18n("Off"), map_group);
    m_defaultMap->setChecked(true);
    new FlagRadioButton(map_group, radioController,
                        "-GS", i18n("Segments"));
    new FlagRadioButton(map_group, radioController,
                        "-GP", i18n("Publics"));
    new FlagRadioButton(map_group, radioController,
                        "-GD", i18n("Detailed"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagPathEdit(this, "", pathController,
                     "--dynamicloader=", i18n("Default dynamic loader:"), KFile::File);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagSpinEdit(this, 0, 2147483647, 1024, 1048576, editController,
                     "-$M", i18n("Reserved address space:"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    layout->addStretch();
}
示例#2
0
FilesAndDirectoriesTab2::FilesAndDirectoriesTab2( QWidget * parent, const char * name )
    :QWidget(parent, name), controller(new FlagCheckBoxController()),
    pathController(new FlagPathEditController())
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    new FlagPathEdit(this, "", pathController,
                     "-FE", i18n("Write executables and units in:"));
    new FlagPathEdit(this, "", pathController,
                     "-FU", i18n("Write units in:"));
    new FlagPathEdit(this, "", pathController,
                     "-o", i18n("Executable name:"), KFile::File);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(20);

    new FlagPathEdit(this, "", pathController,
                     "-e", i18n("Location of as and ld programs:"));
    new FlagPathEdit(this, "", pathController,
                     "-FL", i18n("Dynamic linker executable:"), KFile::File);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(20);

    new FlagPathEdit(this, "", pathController,
                     "-Fr", i18n("Compiler messages file:"), KFile::File);
    new FlagPathEdit(this, "", pathController,
                     "-Fe", i18n("Write compiler messages to file:"), KFile::File);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addStretch();
}
示例#3
0
VidaliaExitWidget::VidaliaExitWidget(VidaliaConfigManager *vc, QWidget *parent)
    : QWidget(parent), vidaliaConfig(vc)
{
    QBoxLayout *layout = new QVBoxLayout(this);

    QLabel *title = new QLabel(tr("To continue, you must exit Vidalia"));
    title->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
    title->setStyleSheet(QLatin1String("font-size:13pt"));
    layout->addWidget(title);

    layout->addSpacing(20);

    QLabel *desc = new QLabel(tr("Look for the vidalia icon (<img src=':/graphics/vidalia-tray.png'>) in "
                                 "the system tray and choose to exit.<br>Anything currently using Tor (such "
                                 "as web downloads) will be interrupted."));
    desc->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
    layout->addWidget(desc);
    layout->addSpacing(30);

    QLabel *desc2 = new QLabel(tr("Configuration will continue automatically when Vidalia is closed."));
    desc2->setAlignment(Qt::AlignBottom | Qt::AlignHCenter);
    layout->addWidget(desc2);
    layout->addStretch();

    exitTimer = new QTimer(this);
    connect(exitTimer, SIGNAL(timeout()), SLOT(checkVidalia()));
    exitTimer->start(5000);
}
示例#4
0
//-----------------------------------------------------------------------------
About::About (QWidget * aParent, const char *aName, bool aInit)
  : AboutInherited(aParent, aName)
{
  QBoxLayout* box;
  QLabel* lbl;
  QFrame* frm;
  QString str;
  QFont fnt;

  if (aInit) return;

  box = new QVBoxLayout(this, 20, 6);

  lblTheme = new QLabel(" ", this);
  fnt = lblTheme->font();
  fnt.setPointSize(fnt.pointSize() * 1.2);
  lblTheme->setFont(fnt);
  lblTheme->setMinimumSize(lblTheme->sizeHint());
  lblTheme->setAutoResize(true);
  box->addWidget(lblTheme);

  lblVersion = new QLabel(" ", this);
  lblVersion->setMinimumSize(lblVersion->sizeHint());
  lblVersion->setAutoResize(true);
  box->addWidget(lblVersion);

  lblAuthor = new QLabel(" ", this);
  lblAuthor->setMinimumSize(lblAuthor->sizeHint());
  lblAuthor->setAutoResize(true);
  box->addWidget(lblAuthor);

  lblHomepage = new QLabel(" ", this);
  lblHomepage->setMinimumSize(lblHomepage->sizeHint());
  lblHomepage->setAutoResize(true);
  box->addWidget(lblHomepage);

  frm = new QFrame(this);
  frm->setFrameStyle(QFrame::HLine|QFrame::Raised);
  box->addSpacing(5);
  box->addWidget(frm);
  box->addSpacing(5);

  lbl = new QLabel(i18n("KDE Theme Manager"), this);
  lbl->setFont(fnt);
  lbl->setMinimumSize(lbl->sizeHint());
  box->addWidget(lbl);

  str.sprintf(i18n("Version %s\n\n"
		   "Copyright (C) 1998 by\n%s\n\n"
		   "Gnu Public License (GPL)"),
	           KTHEME_VERSION, 
                   "Stefan Taferner <*****@*****.**>\n"
                   "Waldo Bastian <*****@*****.**>");
  lbl = new QLabel(str, this);
  lbl->setMinimumSize(lbl->sizeHint());
  box->addWidget(lbl);

  box->addStretch(1000);
  box->activate();
}
示例#5
0
//TODO Add a drop down list of the avaialable protocols
//     that a user may be added for
AddUserDlg::AddUserDlg(CICQDaemon *s, const char* szId, unsigned long PPID,
                       QWidget *parent)
   : LicqDialog(parent, "AddUserDialog")
{
	server = s;

        QBoxLayout *lay = new QBoxLayout(this, QBoxLayout::Down, 8);
        QFrame *frmProtocol = new QFrame(this);
        QFrame *frmUin = new QFrame(this);
	QFrame *frmBtn = new QFrame(this);
        lay->addWidget(frmProtocol);
        lay->addWidget(frmUin);
	lay->addSpacing(5);
	lay->addStretch();
	lay->addWidget(frmBtn);

        QBoxLayout *layProtocol = new QBoxLayout(frmProtocol, QBoxLayout::LeftToRight);
        lblProtocol = new QLabel(tr("Protocol:"), frmProtocol);
        cmbProtocol = new QComboBox(frmProtocol);
        layProtocol->addWidget(lblProtocol);
        layProtocol->addWidget(cmbProtocol);
        
        // Fill the combo list now
        ProtoPluginsList pl;
        ProtoPluginsListIter it;
        server->ProtoPluginList(pl);
        uint index = 0;
        uint ppidIndex = 0;
        for (it = pl.begin(); it != pl.end(); it++, ++index)
        {
          cmbProtocol->insertItem((*it)->Name());
          if ((*it)->PPID() == PPID) ppidIndex = index;
        }
        cmbProtocol->setCurrentItem(ppidIndex);
        
        QBoxLayout *layUin = new QBoxLayout(frmUin, QBoxLayout::LeftToRight);
	lblUin = new QLabel(tr("New User ID:"), frmUin);
	edtUin = new QLineEdit(frmUin);
	layUin->addWidget(lblUin);
	layUin->addWidget(edtUin);

    if (szId != 0) edtUin->setText(szId);
    
	QBoxLayout *layBtn = new QBoxLayout(frmBtn, QBoxLayout::LeftToRight);
	btnOk = new QPushButton(tr("&Ok"), frmBtn);
	btnCancel = new QPushButton(tr("&Cancel"), frmBtn);
	layBtn->addStretch();
	layBtn->addWidget(btnOk);
	layBtn->addSpacing(20);
	layBtn->addWidget(btnCancel);

	setCaption(tr("Licq - Add User"));
	connect (btnOk, SIGNAL(clicked()), SLOT(ok()) );
	connect (edtUin, SIGNAL(returnPressed()), SLOT(ok()) );
	connect (btnCancel, SIGNAL(clicked()), SLOT(reject()) );

	// Set Tab Order
	setTabOrder(edtUin, btnOk);
	setTabOrder(btnOk, btnCancel);
}
示例#6
0
GTrans::GTrans() {
    QLayout *mainLayout = new QVBoxLayout;

    // The input section
    QLayout *top = new QHBoxLayout;
    QBoxLayout *tl = new QVBoxLayout;
    QLabel *inLabel = new QLabel(tr("Input:"));
    fromLang = new QComboBox;
    tl->addWidget(inLabel);
    tl->addSpacing(10);
    tl->addWidget(fromLang);
    tl->addStretch();
    top->addItem(tl);
    inputTxt = new QTextEdit;

    top->addWidget(inputTxt);

    // The output section
    QLayout *bottom = new QHBoxLayout;
    QBoxLayout *bl = new QVBoxLayout;
    QLabel *outLabel = new QLabel(tr("Output:"));
    toLang = new QComboBox;
    bl->addWidget(outLabel);
    bl->addSpacing(10);
    bl->addWidget(toLang);
    bl->addStretch();
    bottom->addItem(bl);
    outputTxt = new QTextEdit;
    outputTxt->setReadOnly(true);
    bottom->addWidget(outputTxt);

    mainLayout->addItem(top);
    mainLayout->addItem(bottom);

    // Translate button
    trans_b = new QPushButton(tr("Translate"));
    mainLayout->addWidget(trans_b);

    fillInLanguages();

    setLayout(mainLayout);
    setWindowTitle(tr("Translate"));
    
    trans_b->setDefault(true);
    connect(trans_b, SIGNAL(clicked()), this, SLOT(doTrans()));

    // Setup foxus and tab order.
    inputTxt->setTabChangesFocus(true);
    inputTxt->setFocus(Qt::ActiveWindowFocusReason);
    setTabOrder(inputTxt, toLang);
    setTabOrder(toLang, trans_b);
    setTabOrder(trans_b, fromLang);
    setTabOrder(fromLang, inputTxt);
    outputTxt->setFocusProxy(trans_b);
}
示例#7
0
DebugOptimTab::DebugOptimTab( QWidget * parent, const char * name )
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
      radioController(new FlagRadioButtonController)
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
//    layout->setAutoAdd(true);

    QVButtonGroup *optim_group = new QVButtonGroup(i18n("Optimization"), this);
    new FlagCheckBox(optim_group, controller,
                     "'-$O+'", i18n("Enable optimizations"), "'-$O-'", "'-$O+'");
    layout->addWidget(optim_group);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());

    QVButtonGroup *debug_group = new QVButtonGroup(i18n("Debugging"), this);
    new FlagCheckBox(debug_group, controller,
                     "'-$D+'", i18n("Debug information"), "'-$D-'", "'-$D+'");
    new FlagCheckBox(debug_group, controller,
                     "'-$L+'", i18n("Local symbol information"), "'-$L-'", "'-$L+'");
    gdb = new FlagCheckBox(debug_group, controller,
                           "-V", i18n("Debug information for GDB"));
    namespacedb = new FlagCheckBox(debug_group, controller,
                                   "-VN", i18n("Namespace debug info"));
    symboldb = new FlagCheckBox(debug_group, controller,
                                "-VR", i18n("Write symbol info in an .rsm file"));
    layout2->addWidget(debug_group);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    QVButtonGroup *debug_add = new QVButtonGroup(i18n("Symbol Reference Information"), this);
    QRadioButton *m_default = new QRadioButton(i18n("Default (-$YD)"), debug_add);
    m_default->setChecked(true);
    new FlagRadioButton(debug_add, radioController,
                        "'-$Y-'", i18n("No information"));
    new FlagRadioButton(debug_add, radioController,
                        "'-$YD'", i18n("Definition information"));
    new FlagRadioButton(debug_add, radioController,
                        "'-$Y+'", i18n("Full reference information"));
    layout2->addWidget(debug_add);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QHBoxLayout *layout3 = new QHBoxLayout(layout, KDialog::spacingHint());
    QPushButton *release = new QPushButton(i18n("Release"), this);
    QPushButton *debug = new QPushButton(i18n("Debug"), this);
    layout3->addWidget(release);
    layout3->addWidget(debug);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    connect(release, SIGNAL(clicked()), this, SLOT(setReleaseOptions()));
    connect(debug, SIGNAL(clicked()), this, SLOT(setDebugOptions()));

    layout->addStretch();
}
示例#8
0
FeedbackTab::FeedbackTab(QWidget *parent, const char *name)
    : QWidget(parent, name), controller(new FlagCheckBoxController(QStringList::split(",","-v")))
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    QVButtonGroup *output_group = new QVButtonGroup(i18n("Output"), this);
    new FlagCheckBox(output_group, controller,
                     "-vr", i18n("Format errors like GCC does"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QVButtonGroup *verbose_group = new QVButtonGroup(i18n("Verbose"), this);
    new FlagCheckBox(verbose_group, controller,
                     "-va", i18n("Write all possible info"));
    new FlagCheckBox(verbose_group, controller,
                     "-v0", i18n("Write no messages"));
    new FlagCheckBox(verbose_group, controller,
                     "-ve", i18n("Show only errors"));
    new FlagCheckBox(verbose_group, controller,
                     "-vi", i18n("Show some general information"));
    new FlagCheckBox(verbose_group, controller,
                     "-vw", i18n("Issue warnings"));
    new FlagCheckBox(verbose_group, controller,
                     "-vn", i18n("Issue notes"));
    new FlagCheckBox(verbose_group, controller,
                     "-vh", i18n("Issue hints"));
    new FlagCheckBox(verbose_group, controller,
                     "-vd", i18n("Write other debugging info"));

    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QVButtonGroup *other_group = new QVButtonGroup(i18n("Other Information"), this);
    new FlagCheckBox(other_group, controller,
                     "-vl", i18n("Show line numbers when processing files"));
    new FlagCheckBox(other_group, controller,
                     "-vu", i18n("Print information on loaded units"));
    new FlagCheckBox(other_group, controller,
                     "-vt", i18n("Print the names of loaded files"));
    new FlagCheckBox(other_group, controller,
                     "-vm", i18n("Write which macros are defined"));
    new FlagCheckBox(other_group, controller,
                     "-vc", i18n("Warn when processing a conditional"));
    new FlagCheckBox(other_group, controller,
                     "-vp", i18n("Print the names of procedures and functions"));
    new FlagCheckBox(other_group, controller,
                     "-vb", i18n("Show all procedure declarations if an overloaded function error occurs"));

    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addStretch();
}
示例#9
0
MiscTab::MiscTab( QWidget * parent, const char * name )
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
    radioController(new FlagRadioButtonController()),
    pathController(new FlagPathEditController()),
    editController(new FlagEditController())
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    new FlagCheckBox(this, controller,
                     "-B", i18n("Recompile all used units"));
    new FlagCheckBox(this, controller,
                     "-n", i18n("Do not read default configuration file"));
    new FlagPathEdit(this, "", pathController,
                     "@", i18n("Compiler configuration file:"), KFile::File);
    new FlagSpinEdit(this, 1, 1000, 1, 50, editController,
                    "-Se", i18n("Stop after the error:"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QVButtonGroup *browser_group = new QVButtonGroup(i18n("Browser Info"), this);
    QRadioButton *m_defaultBrowser = new QRadioButton(i18n("No browser info"), browser_group);
    m_defaultBrowser->setChecked(true);
    new FlagRadioButton(browser_group, radioController,
                     "-b", i18n("Global browser info"));
    new FlagRadioButton(browser_group, radioController,
                     "-bl", i18n("Global and local browser info"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QVButtonGroup *target_group = new QVButtonGroup(i18n("Target OS"), this);
    QRadioButton *m_defaultTarget = new QRadioButton(i18n("Default"), target_group);
    m_defaultTarget->setChecked(true);
    new FlagRadioButton(target_group, radioController,
                     "-TGO32V1", i18n("DOS and version 1 of the DJ DELORIE extender"));
    new FlagRadioButton(target_group, radioController,
                     "-TGO32V2", i18n("DOS and version 2 of the DJ DELORIE extender"));
    new FlagRadioButton(target_group, radioController,
                     "-TLINUX",  i18n("Linux"));
    new FlagRadioButton(target_group, radioController,
                     "-TOS2", i18n("OS/2 (2.x) using the EMX extender"));
    new FlagRadioButton(target_group, radioController,
                     "-TWIN32", i18n("WINDOWS 32 bit"));
    new FlagRadioButton(target_group, radioController,
                     "-TSUNOS", i18n("SunOS/Solaris"));
    new FlagRadioButton(target_group, radioController,
                     "-TBEOS", i18n("BeOS"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    layout->addStretch();
}
示例#10
0
/*!
  Changes the status bar's appearance to account for item
  changes. Special subclasses may need this, but normally
  geometry management will take care of any necessary
  rearrangements.
*/
void QStatusBar::reformat()
{
    if ( d->box )
	delete d->box;

    QBoxLayout *vbox;
    if ( isSizeGripEnabled() ) {
	d->box = new QHBoxLayout( this );
	vbox = new QVBoxLayout( d->box );
    } else {
	vbox = d->box = new QVBoxLayout( this );
    }
    vbox->addSpacing( 3 );
    QBoxLayout* l = new QHBoxLayout( vbox );
    l->addSpacing( 3 );

    int maxH = fontMetrics().height();

    QStatusBarPrivate::SBItem* item = d->items.first();
    while ( item && !item->p ) {
	l->addWidget( item->w, item->s );
	l->addSpacing( 4 );
	int itemH = item->w->sizeHint().height();
	maxH = QMAX( maxH, itemH );
	item = d->items.next();
    }

    l->addStretch( 0 );

    while ( item ) {
	l->addWidget( item->w, item->s );
	l->addSpacing( 4 );
	int itemH = item->w->sizeHint().height();
	maxH = QMAX( maxH, itemH );
	item = d->items.next();
    }
#ifndef QT_NO_SIZEGRIP
    if ( d->resizer ) {
	maxH = QMAX( maxH, d->resizer->sizeHint().height() );
	d->box->addSpacing( 2 );
	d->box->addWidget( d->resizer, 0, AlignBottom );
    }
#endif
    l->addStrut( maxH );
    vbox->addSpacing( 2 );
    d->box->activate();
    repaint();
}
示例#11
0
// =============================================================================
void ProgressDlg::CreateLayout()
{
    mStatusLabel = new QLabel( tr( "" ) );
    mStatusLabel->setAlignment( Qt::AlignTop | Qt::AlignLeft );
    mStatusLabel->setWordWrap( true );

    QVBoxLayout *lLayout = new QVBoxLayout;
    QBoxLayout *lBoxLayout = new QBoxLayout(QBoxLayout::LeftToRight);
    lBoxLayout->addSpacing(30);
    lBoxLayout->addWidget( mStatusLabel);
    lLayout->addLayout(lBoxLayout);

    setLayout( lLayout );
    setFixedSize( 400, 120 );

    Qt::WindowFlags lFlags = windowFlags();
    lFlags |= Qt::CustomizeWindowHint;
    lFlags &= ~Qt::WindowContextHelpButtonHint;
    lFlags &= ~Qt::WindowSystemMenuHint;
    lFlags &= ~Qt::WindowCloseButtonHint;
    setWindowFlags( lFlags );

    mWheel = new QPixmap (":GEVPlayer/res/wheel.bmp");
    mWheel->setMask(mWheel->createMaskFromColor(QColor(0xFF, 0xFF, 0xFF)));

    setWindowTitle( tr( "Connection Progress" ) );
}
示例#12
0
文件: cdrv.cpp 项目: weigj/loongide
int drv_boxlayout(int drvid, void *a0, void* a1, void* a2, void* a3, void* a4, void* a5, void* a6, void* a7, void* a8, void* a9)
{
    handle_head* head = (handle_head*)a0;
    QBoxLayout *self = (QBoxLayout*)head->native;
    switch (drvid) {
    case BOXLAYOUT_ADDLAYOUTWITH: {
        self->addLayout((QLayout*)drvGetNative(a1),drvGetInt(a2));
        break;
    }
    case BOXLAYOUT_ADDWIDGETWITH: {
        self->addWidget((QWidget*)drvGetNative(a1),drvGetInt(a2),Qt::Alignment(drvGetInt(a3)));
        break;
    }
    case BOXLAYOUT_ADDSPACING: {
        self->addSpacing(drvGetInt(a1));
        break;
    }
    case BOXLAYOUT_ADDSTRETCH: {
        self->addStretch(drvGetInt(a1));
        break;
    }
    default:
        return 0;
    }
    return 1;
}
示例#13
0
SynCELocalKonnectorConfig::SynCELocalKonnectorConfig( QWidget *parent, const char *name )
        : SynCEKonnectorConfigBase( parent, name )
{
    QBoxLayout * topLayout = new QVBoxLayout( this );

    topLayout->addWidget( new QLabel( i18n( "Calendar file:" ), this ) );

    mCalendarFile = new KURLRequester( this );
    mCalendarFile->setMode( KFile::File | KFile::LocalOnly );
    topLayout->addWidget( mCalendarFile );

    QPushButton *button =
        new QPushButton( i18n( "Select From Existing Calendars..." ), this );
    connect( button, SIGNAL( clicked() ), SLOT( selectCalendarResource() ) );
    topLayout->addWidget( button );

    topLayout->addSpacing( 4 );

    topLayout->addWidget( new QLabel( i18n( "Address book file:" ), this ) );

    mAddressBookFile = new KURLRequester( this );
    mAddressBookFile->setMode( KFile::File | KFile::LocalOnly );
    topLayout->addWidget( mAddressBookFile );

    button = new QPushButton( i18n( "Select From Existing Address Books..." ), this );
    connect( button, SIGNAL( clicked() ), SLOT( selectAddressBookResource() ) );
    topLayout->addWidget( button );
}
示例#14
0
ShowAwayMsgDlg::ShowAwayMsgDlg(CICQDaemon *_server, CSignalManager* _sigman,
  const char *szId, unsigned long nPPID, QWidget *parent)
  : LicqDialog(parent, "ShowAwayMessageDialog")
{
  m_szId = szId ? strdup(szId) : 0;
  m_nPPID = nPPID;
  sigman = _sigman;
  server = _server;

  QBoxLayout* top_lay = new QVBoxLayout(this, 10);
  mleAwayMsg = new MLEditWrap(true, this);
  // ICQ99b allows 37 chars per line, so we do the same
  //mleAwayMsg->setWordWrap(QMultiLineEditNew::FixedColumnWidth);
  //mleAwayMsg->setWrapColumnOrWidth(37);
  mleAwayMsg->setReadOnly(true);
  mleAwayMsg->setMinimumSize(230, 110);
  connect(mleAwayMsg, SIGNAL(signal_CtrlEnterPressed()), SLOT(accept()));
  top_lay->addWidget(mleAwayMsg);

  QBoxLayout* lay = new QHBoxLayout(top_lay, 10);

  chkShowAgain = new QCheckBox(tr("&Show Again"), this);
  lay->addWidget(chkShowAgain);

  lay->addStretch(1);
  lay->addSpacing(30);

  ICQUser *u = gUserManager.FetchUser(m_szId, m_nPPID, LOCK_R);
  QTextCodec * codec = UserCodec::codecForICQUser(u);
//  chkShowAgain->setChecked(u->ShowAwayMsg());

  setCaption(QString(tr("%1 Response for %2")).arg(u->StatusStr()).arg(QString::fromUtf8(u->GetAlias())));

  btnOk = new QPushButton(tr("&Ok"), this);
  btnOk->setMinimumWidth(75);
  btnOk->setDefault(true);
  btnOk->setFocus();
  connect(btnOk, SIGNAL(clicked()), SLOT(accept()));
  lay->addWidget(btnOk);

  // Check if this is an active request or not
  if (sigman == NULL || server == NULL)
  {
    mleAwayMsg->setText(codec->toUnicode(u->AutoResponse()));
    gUserManager.DropUser(u);
    icqEventTag = 0;
  }
  else
  {
    bool bSendServer = (u->SocketDesc(ICQ_CHNxNONE) <= 0 && u->Version() > 6);
    gUserManager.DropUser(u);
    mleAwayMsg->setEnabled(false);
    mleAwayMsg->setBackgroundMode(PaletteBackground);
    connect (sigman, SIGNAL(signal_doneUserFcn(ICQEvent *)), this, SLOT(doneEvent(ICQEvent *)));
    icqEventTag = server->icqFetchAutoResponse(szId, nPPID, bSendServer);
  }

  show();
}
示例#15
0
CodegenTab::CodegenTab( QWidget * parent, const char * name )
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
    listController(new FlagEditController())
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    QVButtonGroup *compile_group = new QVButtonGroup(i18n("Compile Time Checks"), this);
    new FlagCheckBox(compile_group, controller,
                     "-Sa", i18n("Include assert statements in compiled code"));
    new FlagCheckBox(compile_group, controller,
                     "-Un", i18n("Do not check the unit name for being the same as the file name"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QVButtonGroup *run_group = new QVButtonGroup(i18n("Run Time Checks"), this);
    new FlagCheckBox(run_group, controller,
                     "-Cr", i18n("Range checking"));
    new FlagCheckBox(run_group, controller,
                     "-Ct", i18n("Stack checking"));
    new FlagCheckBox(run_group, controller,
                     "-Ci", i18n("Input/Output checking"));
    new FlagCheckBox(run_group, controller,
                     "-Co", i18n("Integer overflow checking"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagListEdit(this, ":", listController, "-d", i18n("Conditional defines (delimited by \":\"):"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    new FlagListEdit(this, ":", listController, "-u", i18n("Undefine conditional defines (delimited by \":\"):"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    new FlagSpinEdit(this, 1024, 67107840, 1, 131072, listController,
                    "-Cs", i18n("Stack size:"));
    new FlagSpinEdit(this, 1024, 67107840, 1, 2097152, listController,
                    "-Ch", i18n("Heap size:"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addStretch();
}
示例#16
0
GeneralTab::GeneralTab( QWidget * parent, const char * name )
    :QWidget(parent, name), controller(new FlagCheckBoxController()),
     editController(new FlagEditController())
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    QVButtonGroup *build_group = new QVButtonGroup(i18n("Build"), this);
    new FlagCheckBox(build_group, controller,
                     "-B", i18n("Build all units"));
    new FlagCheckBox(build_group, controller,
                     "-M", i18n("Make modified units"));
    new FlagCheckBox(build_group, controller,
                     "-Q", i18n("Quiet compile"));
    new FlagCheckBox(build_group, controller,
                     "-Z", i18n("Disable implicit package compilation"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addSpacing(10);

    new FlagListEdit(this, ":", editController, "-D", i18n("Conditional defines (delimited by \":\"):"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    new FlagListEdit(this, ":", editController, "-A", i18n("Unit aliases in form unit=alias (delimited by \":\"):"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addSpacing(10);

    QVButtonGroup *message_group = new QVButtonGroup(i18n("Messages"), this);
    new FlagCheckBox(message_group, controller,
                     "-H", i18n("Output hint messages"));
    new FlagCheckBox(message_group, controller,
                     "-W", i18n("Output warning messages"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addSpacing(10);
    QVButtonGroup *package_group = new QVButtonGroup(i18n("Packages"), this);
    new FlagListEdit(package_group, ":", editController, "-LU", i18n("Build with packages (delimited by \":\"):"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addStretch();
}
示例#17
0
LanguageTab::LanguageTab( QWidget * parent, const char * name )
    : QWidget(parent, name), controller(new FlagCheckBoxController(QStringList::split(",","-v")))
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
    layout->setAutoAdd(true);

    QVButtonGroup *compat_group = new QVButtonGroup(i18n("Pascal Compatibility"), this);
    new FlagCheckBox(compat_group, controller,
                     "-S2", i18n("Switch on Delphi 2 extensions"));
    new FlagCheckBox(compat_group, controller,
                     "-Sd", i18n("Strict Delphi compatibility mode"));
    new FlagCheckBox(compat_group, controller,
                     "-So", i18n("Borland TP 7.0 compatibility mode"));
    new FlagCheckBox(compat_group, controller,
                     "-Sp", i18n("GNU Pascal compatibility mode"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QVButtonGroup *ccompat_group = new QVButtonGroup(i18n("C/C++ Compatibility"), this);
    new FlagCheckBox(ccompat_group, controller,
                     "-Sc", i18n("Support C style operators *=, +=, /=, -="));
    new FlagCheckBox(ccompat_group, controller,
                     "-Si", i18n("Support C++ style INLINE"));
    new FlagCheckBox(ccompat_group, controller,
                     "-Sm", i18n("Support C style macros"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    QVButtonGroup *lang_group = new QVButtonGroup(i18n("Language"), this);
    new FlagCheckBox(lang_group, controller,
                     "-Sg", i18n("Support the label and goto commands"));
    new FlagCheckBox(lang_group, controller,
                     "-Sh", i18n("Use ansistrings by default for strings"));
    new FlagCheckBox(lang_group, controller,
                     "-Ss", i18n("Require the name of constructors to be init\n and the name of destructors to be done"));
    new FlagCheckBox(lang_group, controller,
                     "-St", i18n("Allow the static keyword in objects"));
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addStretch();
}
示例#18
0
static void addToolBarToLayout( QMainWindowPrivate::ToolBarDock * dock,
				QBoxLayout * tl,
				QBoxLayout::Direction direction,
				QBoxLayout::Direction dockDirection,
				bool mayNeedDockLayout,
				bool justify,
				GUIStyle style )
{
    if ( !dock || dock->isEmpty() )
	return;

    bool moreThanOneRow = FALSE;
    bool anyToolBars = FALSE;

    dock->first();
    while ( dock->next() ) {
	if ( dock->current()->nl ) {
	    moreThanOneRow = TRUE;
	    break;
	}
    }

    QBoxLayout * dockLayout;
    if ( mayNeedDockLayout && moreThanOneRow ) {
	dockLayout = new QBoxLayout( dockDirection );
	tl->addLayout( dockLayout );
    } else {
	dockLayout = tl;
    }

    QBoxLayout * toolBarRowLayout = 0;
    QMainWindowPrivate::ToolBar * t = dock->first();
    do {
	if ( !toolBarRowLayout || t->nl ) {
	    if ( toolBarRowLayout ) {
		if ( !justify )
		    toolBarRowLayout->addStretch( 1 );
	    }
	    toolBarRowLayout = new QBoxLayout( direction );
	    dockLayout->addLayout( toolBarRowLayout, 0 );
	}
	if ( t->t->isVisible() && !t->t->testWFlags( WState_DoHide ) ) {
	    toolBarRowLayout->addWidget( t->t, 0 );
	    anyToolBars = TRUE;
	}
    } while ( (t=dock->next()) != 0 );

    if ( anyToolBars && style == MotifStyle )
	dockLayout->addSpacing( 2 );

    if ( toolBarRowLayout && (!justify || !anyToolBars) )
	toolBarRowLayout->addStretch( 1 );
}
TitleBarWidget::TitleBarWidget(ToolWindow *window) :
    QWidget(window), collapsed_icon(":/images/ic_unfold_more_48px.svg"), expanded_icon(":/images/ic_unfold_less_48px.svg"), tool_window(window)
{
    QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight);
    layout->setContentsMargins(4, 4, 20, 4);
    layout->setAlignment(Qt::AlignLeft);
    setLayout(layout);
    addButton(layout, ":/images/ic_close_48px.svg", (ToolWindowSlot)&ToolWindow::close);
    layout->addSpacing(3);
    expand_button = addButton(layout, NULL, (ToolWindowSlot)&ToolWindow::slot_toggleExpand);
    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
}
示例#20
0
LateCancelSelector::LateCancelSelector(bool allowHourMinute, QWidget* parent, const char* name)
	: QFrame(parent, name),
	  mDateOnly(false),
	  mReadOnly(false),
	  mAutoCloseShown(false)
{
	QString whatsThis = i18n("If checked, the alarm will be canceled if it cannot be triggered within the "
	                         "specified period after its scheduled time. Possible reasons for not triggering "
	                         "include your being logged off, X not running, or the alarm daemon not running.\n\n"
	                         "If unchecked, the alarm will be triggered at the first opportunity after "
	                         "its scheduled time, regardless of how late it is.");

	setFrameStyle(QFrame::NoFrame);
	mLayout = new QVBoxLayout(this, 0, KDialog::spacingHint());

	mStack = new QWidgetStack(this);
	mCheckboxFrame = new QFrame(mStack);
	mCheckboxFrame->setFrameStyle(QFrame::NoFrame);
	mStack->addWidget(mCheckboxFrame, 1);
	QBoxLayout* layout = new QVBoxLayout(mCheckboxFrame, 0, 0);
	mCheckbox = new CheckBox(i18n_n_CancelIfLate(), mCheckboxFrame);
	mCheckbox->setFixedSize(mCheckbox->sizeHint());
	connect(mCheckbox, SIGNAL(toggled(bool)), SLOT(slotToggled(bool)));
	QWhatsThis::add(mCheckbox, whatsThis);
	layout->addWidget(mCheckbox, 0, Qt::AlignAuto);

	mTimeSelectorFrame = new QFrame(mStack);
	mTimeSelectorFrame->setFrameStyle(QFrame::NoFrame);
	mStack->addWidget(mTimeSelectorFrame, 2);
	layout = new QVBoxLayout(mTimeSelectorFrame, 0, 0);
	mTimeSelector = new TimeSelector(i18n("Cancel if late by 10 minutes", "Ca&ncel if late by"), QString::null,
	                                 whatsThis, i18n("Enter how late will cause the alarm to be canceled"),
	                                 allowHourMinute, mTimeSelectorFrame);
	connect(mTimeSelector, SIGNAL(toggled(bool)), SLOT(slotToggled(bool)));
	layout->addWidget(mTimeSelector);
	mLayout->addWidget(mStack);

	layout = new QHBoxLayout(mLayout, KDialog::spacingHint());
	layout->addSpacing(3*KDialog::spacingHint());
	mAutoClose = new CheckBox(i18n_AutoCloseWin(), this);
	mAutoClose->setFixedSize(mAutoClose->sizeHint());
	QWhatsThis::add(mAutoClose, i18n("Automatically close the alarm window after the expiry of the late-cancelation period"));
	layout->addWidget(mAutoClose);
	layout->addStretch();

	mAutoClose->hide();
	mAutoClose->setEnabled(false);
}
示例#21
0
LifeControlsWidget::LifeControlsWidget(SimOptions *opts, SimController *ctrlr, LifeScrollWidget &scroll) : displayWidget(scroll)  {
	options = opts;
	controller = ctrlr;
	delay = 100;
	play = false;

	QLabel *gridLabel = new QLabel("Grid Size:");
	QLabel *delayLabel = new QLabel("Delay:");
	genLabel = new QLabel("Generation:\t 1");
	refreshGenLabel();

	QSpinBox *gridSizeSpin = new QSpinBox();
	gridSizeSpin->setMinimum(1);
	gridSizeSpin->setMaximum(1000);
	gridSizeSpin->setValue(opts->getBlockSize());

	QSpinBox *delaySpin = new QSpinBox();
	delaySpin->setMinimum(10);
	delaySpin->setMaximum(10000);
	delaySpin->setValue(delay);
	
	QPushButton *quitBtn = new QPushButton("Quit");
	QPushButton *restartBtn = new QPushButton("Restart");
	playBtn = new QPushButton("Play");
	QPushButton *stepBtn = new QPushButton("Step");
	
	QBoxLayout *box = new QBoxLayout(QBoxLayout::TopToBottom, this);
	
	box->addWidget(gridLabel);
	box->addWidget(gridSizeSpin);
	box->addWidget(delayLabel);
	box->addWidget(delaySpin);
	box->addWidget(genLabel);
	box->addWidget(quitBtn);
	box->addWidget(restartBtn);
	box->addWidget(playBtn);
	box->addWidget(stepBtn);
	box->addStretch(1);
	box->addSpacing(12);
	setLayout(box);

	connect(quitBtn, SIGNAL(clicked()), this, SLOT(onQuit()));
	connect(restartBtn, SIGNAL(clicked()), this, SLOT(onRestart()));
	connect(playBtn, SIGNAL(clicked()), this, SLOT(onPlay()));
	connect(stepBtn, SIGNAL(clicked()), this, SLOT(onStep()));
	connect(gridSizeSpin, SIGNAL(valueChanged(int)), this, SLOT(onSizeChange(int)));
	connect(delaySpin, SIGNAL(valueChanged(int)), this, SLOT(onDelayChange(int)));
}
示例#22
0
QBoxLayout *NewGameView::createRowChecks( QValueList<QCheckBox *> &checks )
{
  QBoxLayout *layout = new QHBoxLayout;

  layout->addSpacing( 10 );

  for( int i = 1; i <= 10; ++i ){
    QCheckBox *check = new QCheckBox( QString::number( i ), this );
    layout->addWidget( check );
    checks.append( check );
  }
  
  layout->addStretch( 1 );
  
  return layout;
}
示例#23
0
Slider::Slider(int minValue, int maxValue, int pageStep, int tickStep,
        int value, Qt::Orientation orientation, const QString& label,
        QWidget * parent): QWidget(parent)
{
    slider = new QSlider(orientation, parent);
    slider->setTickInterval(tickStep);
    slider->setTickPosition(QSlider::TicksLeft);
    slider->setRange(minValue, maxValue);
    slider->setSingleStep(pageStep);
    slider->setValue(value);
    if (orientation == Qt::Vertical) {
        slider->setMinimumHeight(150);
    }
    else {
        slider->setMinimumWidth(150);
    }
    connect(slider, SIGNAL(valueChanged(int)), this, SLOT(updateSpinBox(int)));
    connect(slider, SIGNAL(sliderMoved(int)), this, SLOT(fillSpinBox(int)));

    sliderSpin = new QSpinBox(this);
    sliderSpin->setRange(minValue, maxValue);
    sliderSpin->setValue(value);
    sliderSpin->setKeyboardTracking(false);
    connect(sliderSpin, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int)));
    connect(sliderSpin, SIGNAL(editingFinished()), this, SLOT(emitAsMoved()));

    QLabel* sliderLabel = new QLabel(this);
    sliderLabel->setText(label);
    sliderLabel->setBuddy(sliderSpin);
    sliderLabel->setMinimumWidth(5*sliderLabel->fontMetrics().maxWidth());
    QBoxLayout *sliderLayout = new QBoxLayout(QBoxLayout::LeftToRight,this);
    sliderLayout->setMargin(0);
    sliderLayout->addWidget(sliderLabel);
    sliderLayout->addWidget(slider);
    sliderLayout->addSpacing(2);
    sliderLayout->addWidget(sliderSpin);
    if (orientation == Qt::Vertical) {
        sliderLayout->setDirection(QBoxLayout::TopToBottom);
        sliderLayout->setAlignment(Qt::AlignHCenter);
    }
    else {
        sliderLayout->setDirection(QBoxLayout::LeftToRight);
        sliderLayout->setAlignment(Qt::AlignTop);
    }
    setMinimumWidth(155 + sliderLabel->width() + sliderLabel->fontMetrics().maxWidth() * 3);
    setLayout(sliderLayout);
}
示例#24
0
LinkerTab::LinkerTab( QWidget * parent, const char * name )
    : QWidget(parent, name), controller(new FlagCheckBoxController()),
    listController(new FlagEditController())
{
    QBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());

    QBoxLayout *layout2 = new QHBoxLayout(layout, KDialog::spacingHint());

    QVButtonGroup *link_group = new QVButtonGroup(i18n("Linking Stage"), this);
    new FlagCheckBox(link_group, controller,
                     "-CD", i18n("Create dynamic library"));
    new FlagCheckBox(link_group, controller,
                     "-CX", i18n("Create smartlinked units"));
    new FlagCheckBox(link_group, controller,
                     "-Ur", i18n("Generate release units"));
    new FlagCheckBox(link_group, controller,
                     "-Cn", i18n("Omit the linking stage"));
    new FlagCheckBox(link_group, controller,
                     "-s",  i18n("Create assembling and linking script"));
    layout2->addWidget(link_group);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    QVButtonGroup *exec_group = new QVButtonGroup(i18n("Executable Generation"), this);
    new FlagCheckBox(exec_group, controller,
                     "-Xs",  i18n("Strip the symbols from the executable"));
    new FlagCheckBox(exec_group, controller,
                     "-XS",  i18n("Link with static units"));
    new FlagCheckBox(exec_group, controller,
                     "-XX",  i18n("Link with smartlinked units"));
    new FlagCheckBox(exec_group, controller,
                     "-XD",  i18n("Link with dynamic libraries"));
    new FlagCheckBox(exec_group, controller,
                     "-Xc",  i18n("Link with the C library"));
    layout2->addWidget(exec_group);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);
    layout->addSpacing(10);

    FlagListEdit *led = new FlagListEdit(this, ":", listController, "-k", i18n("Options passed to the linker (delimited by \":\"):"));
    layout->addWidget(led);
    QApplication::sendPostedEvents(this, QEvent::ChildInserted);

    layout->addStretch();
}
示例#25
0
ChoicePage::ChoicePage( QWidget* parent )
    : QWidget( parent )
    , m_choice( NoChoice )
    , m_nextEnabled( false )
    , m_core( nullptr )
{
    QBoxLayout* mainLayout = new QVBoxLayout;
    setLayout( mainLayout );

    m_messageLabel = new QLabel;
    m_messageLabel->setWordWrap( true );

    m_itemsLayout = new QVBoxLayout;
    CalamaresUtils::unmarginLayout( m_itemsLayout );

    mainLayout->addSpacing( CalamaresUtils::defaultFontHeight() );
    mainLayout->addWidget( m_messageLabel );
    mainLayout->addLayout( m_itemsLayout );
    mainLayout->addStretch();
}
示例#26
0
MessageLayer::MessageLayer(const char* iconName, const QString& defaultText) {
    QBoxLayout* layout = new QHBoxLayout(this);

    layout->addStretch(1);

    int iconSize = QApplication::style()->pixelMetric(
        QStyle::PM_MessageBoxIconSize);

    QLabel* icon = new QLabel(this);
    icon->setPixmap(ReginaSupport::themeIcon(iconName).pixmap(
        iconSize, iconSize));
    layout->addWidget(icon, 0);

    layout->addSpacing(iconSize / 2 + 2 /* shrug */);

    text = new QLabel(defaultText, this);
    text->setWordWrap(true);
    text->setTextInteractionFlags(Qt::TextBrowserInteraction);
    text->setOpenExternalLinks(true);
    layout->addWidget(text, 4);

    layout->addStretch(1);
}
示例#27
0
void TabBarDockWidget::setup(QMenu *closedWindowsMenu)
{
	QWidget *widget = new QWidget(this);

	m_tabBar = new TabBarWidget(widget);

	m_trashButton = new QToolButton(widget);
	m_trashButton->setAutoRaise(true);
	m_trashButton->setEnabled(false);
	m_trashButton->setIcon(Utils::getIcon(QLatin1String("user-trash")));
	m_trashButton->setToolTip(tr("Closed Tabs"));
	m_trashButton->setMenu(closedWindowsMenu);
	m_trashButton->setPopupMode(QToolButton::InstantPopup);

	QBoxLayout *tabsLayout = new QBoxLayout(QBoxLayout::LeftToRight, widget);
	tabsLayout->addWidget(m_tabBar);
	tabsLayout->addSpacing(32);
	tabsLayout->addWidget(m_trashButton);
	tabsLayout->setContentsMargins(0, 0, 0, 0);
	tabsLayout->setSpacing(0);

	widget->setLayout(tabsLayout);

	setTitleBarWidget(NULL);
	setWidget(widget);

	m_newTabButton->setAutoRaise(true);
	m_newTabButton->setDefaultAction(ActionsManager::getAction(QLatin1String("NewTab"), this));
	m_newTabButton->setFixedSize(32, 32);
	m_newTabButton->show();
	m_newTabButton->raise();
	m_newTabButton->move(m_tabBar->geometry().topRight());

	connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), m_tabBar, SLOT(setOrientation(Qt::DockWidgetArea)));
	connect(m_tabBar, SIGNAL(moveNewTabButton(int)), this, SLOT(moveNewTabButton(int)));
}
示例#28
0
NSurfaceCoordinateUI::NSurfaceCoordinateUI(regina::NNormalSurfaceList* packet,
        PacketTabbedUI* useParentUI, bool readWrite) :
        PacketEditorTab(useParentUI), surfaces(packet), appliedFilter(0),
        isReadWrite(readWrite), currentlyResizing(false) {
    // Set up the UI.
    ui = new QWidget();
    QBoxLayout* uiLayout = new QVBoxLayout(ui);
    uiLayout->setContentsMargins(0, 0, 0, 0);
    uiLayout->addSpacing(5);

    QBoxLayout* hdrLayout = new QHBoxLayout();
    uiLayout->addLayout(hdrLayout);

    // Set up the coordinate selector.
    QLabel* label = new QLabel(tr("Display coordinates:"));
    hdrLayout->addWidget(label);
    coords = new CoordinateChooser();
    coords->insertAllViewers(surfaces);
    coords->setCurrentSystem(surfaces->coords());
    connect(coords, SIGNAL(activated(int)), this, SLOT(refresh()));
    hdrLayout->addWidget(coords);
    QString msg = tr("Allows you to view these normal surfaces in a "
        "different coordinate system.");
    label->setWhatsThis(msg);
    coords->setWhatsThis(msg);

    hdrLayout->addStretch(1);

    // Set up the filter selector.
    label = new QLabel(tr("Apply filter:"));
    hdrLayout->addWidget(label);
    filter = new PacketChooser(surfaces->root(),
        new SingleTypeFilter<regina::NSurfaceFilter>(),
        PacketChooser::ROOT_AS_PACKET, true, 0, ui);
    filter->setAutoUpdate(true);
    connect(filter, SIGNAL(activated(int)), this, SLOT(refresh()));
    hdrLayout->addWidget(filter);
    msg = tr("<qt>Allows you to filter this list so that only normal "
        "surfaces satisfying particular properties are displayed.<p>"
        "To use this feature you need a separate surface filter.  You "
        "can create new surface filters through the <i>Packet Tree</i> "
        "menu.</qt>");
    label->setWhatsThis(msg);
    filter->setWhatsThis(msg);

    // Set up the coordinate table.
    model = new SurfaceModel(surfaces, readWrite);

    table = new QTreeView();
    table->setItemsExpandable(false);
    table->setRootIsDecorated(false);
    table->setAlternatingRowColors(true);
    table->header()->setStretchLastSection(false);
    table->setSelectionMode(QTreeView::SingleSelection);
    table->setWhatsThis(tr("Displays details of the individual normal "
        "surfaces in this list.<p>"
        "Each row represents a single normal (or almost normal) surface.  "
        "As well as various properties of the surface, each row contains "
        "a detailed representation of the surface in the currently selected "
        "coordinate system.<p>"
        "For details on what each property means or what each coordinate "
        "represents, hover the mouse over the column header (or refer "
        "to the users' handbook).</qt>"));
    // Add grid lines:
    // For some reason, when we set cell borders, the selection
    // background changes to white (-> white on white, which is unreadable).
    // So reluctantly we also break the native system style and explicitly
    // set a background ourselves.  I would love a better way of dealing
    // with this. :/
    table->setStyleSheet("QTreeView::item:selected { "
                            "background: qlineargradient(x1: 0, y1: 0, "
                                "x2: 0, y2: 1, stop: 0 #6ea1f1, "
                                "stop: 1 #567dbc); "
                         "} "
                         "QTreeView::item { "
                            "border: 1px solid #d9d9d9; "
                            "border-top-color: transparent; "
                            "border-left-color: transparent; "
                         "}");
    table->setModel(model);
    table->header()->resizeSections(QHeaderView::ResizeToContents);
    uiLayout->addWidget(table, 1);

    connect(table->header(), SIGNAL(sectionResized(int, int, int)),
        this, SLOT(columnResized(int, int, int)));

    actCutAlong = new QAction(this);
    actCutAlong->setText(tr("Cu&t Along Surface"));
    actCutAlong->setToolTip(tr("Cut the triangulation along the "
        "selected surface"));
    actCutAlong->setEnabled(false);
    actCutAlong->setWhatsThis(tr("<qt>Cuts open the surround triangulation "
        "along the selected surface.  This triangulation will not "
        "be changed; instead a new cut-open triangulation will be created.<p>"
        "This operation will never change the topology of the underlying "
        "3-manifold beyond just cutting along the surface (as opposed to "
        "the related <i>crushing</i> operation, which might).  However, "
        "because the new surface boundaries are created from real "
        "boundary triangles, the resulting number of tetrahedra might be very "
        "large.</qt>"));
    connect(actCutAlong, SIGNAL(triggered()), this, SLOT(cutAlong()));
    surfaceActionList.append(actCutAlong);

    actCrush = new QAction(this);
    actCrush->setText("Crus&h Surface");
    actCrush->setToolTip(tr("Crush the selected surface to a point"));
    actCrush->setEnabled(false);
    actCrush->setWhatsThis(tr("<qt>Crushes the selected surface to a point "
        "within the surrounding triangulation.  This triangulation will not "
        "be changed; instead a new crushed triangulation will be created.<p>"
        "<b>Warning:</b> This routine simply removes all tetrahedra "
        "containing quadrilateral discs and rejoins the others "
        "appropriately.  In some circumstances this might change the "
        "topology of the underlying 3-manifold beyond just slicing along "
        "the surface and shrinking the resulting boundary/boundaries "
        "to points.</qt>"));
    surfaceActionList.append(actCrush);
    connect(actCrush, SIGNAL(triggered()), this, SLOT(crush()));

    connect(table->selectionModel(),
        SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
        this, SLOT(updateActionStates()));

    connect(&ReginaPrefSet::global(), SIGNAL(preferencesChanged()),
        this, SLOT(updatePreferences()));
}
示例#29
0
KKeyChooser::KKeyChooser( QDict<KKeyEntry> *aKeyDict, QWidget *parent )
    : QWidget( parent )
{
	
	bKeyIntercept = FALSE;
	kbMode = NoKey;
	
	aKeyIt = new QDictIterator<KKeyEntry> ( *aKeyDict );
	
	// TOP LAYOUT MANAGER
	
	// The following layout is used for the dialog
	// 		LIST LABELS LAYOUT
	//		SPLIT LIST BOX WIDGET
	//		CHOOSE KEY GROUP BOX WIDGET
	//		BUTTONS LAYOUT
	// Items are added to topLayout as they are created.
	
	QBoxLayout *topLayout = new QVBoxLayout( this, 0, 10 ); 
	
	// CREATE LIST LABELS
	
	QGridLayout *stackLayout = new QGridLayout( 2, 2, 2);
	topLayout->addLayout( stackLayout, 50 );
	
	stackLayout->setRowStretch(1,10);

	keyLabel = new QLabel(this);
	stackLayout->addWidget(keyLabel, 0, 1);
	keyLabel->setText( i18n("Current key") );
	keyLabel->setFixedHeight( keyLabel->sizeHint().height() );
	
	// CREATE SPLIT LIST BOX
	
	// Copy all currentKeyCodes to configKeyCodes
	// and fill up the split list box with the action/key pairs.
	
	wList = new KSplitList( this );
	stackLayout->addMultiCellWidget( wList, 1, 1, 0, 1 );
	
	actLabel = new QLabel( wList, i18n("&Action"), this );
	stackLayout->addWidget( actLabel, 0, 0 );
	actLabel->setFixedHeight( actLabel->sizeHint().height() );
	
	wList->setAutoUpdate(FALSE);
	wList->setFocus();
	
	aIt = aKeyIt;
	aIt->toFirst();
	while ( aIt->current() ) {
		aIt->current()->aConfigKeyCode = aIt->current()->aCurrentKeyCode;
		
		KSplitListItem *sli = new KSplitListItem(
		 	item( aIt->current()->aConfigKeyCode, aIt->currentKey() )
		);
		
		connect( wList, SIGNAL( newWidth( int ) ),
				 sli, SLOT( setWidth( int ) ) );
		wList->insertItem( sli );
		
		++ ( *aIt );
	}

	if ( wList->count() == 0 ) wList->setEnabled( FALSE );
	//connect( wList, SIGNAL( selected( int ) ), SLOT( toChange( int ) ) );
	connect( wList, SIGNAL( highlighted( int ) ), SLOT( updateAction( int ) ) );
	
	// CREATE CHOOSE KEY GROUP
	
	fCArea = new QGroupBox( this );
	topLayout->addWidget( fCArea, 1 );
	
	fCArea->setTitle( i18n("Choose a key for the selected action") );
	fCArea->setFrameStyle( QFrame::Box | QFrame::Sunken );
	
	// CHOOSE KEY GROUP LAYOUT MANAGER
	
	QGridLayout *grid = new QGridLayout( fCArea, 6, 4, 5 );
	
	grid->setRowStretch(0,10);
	grid->setRowStretch(1,10);
	grid->setRowStretch(2,10);
	grid->setRowStretch(3,10);
	grid->setRowStretch(4,10);
	grid->setRowStretch(5,10);

	grid->setColStretch(0,0);
	grid->setColStretch(1,10);
	grid->setColStretch(2,90);
	grid->setColStretch(3,0);
	
	grid->addRowSpacing(0,15);
	grid->addRowSpacing(5,1);
	
	
	kbGroup = new QButtonGroup( fCArea );
    kbGroup->hide();
    kbGroup->setExclusive( true );
	
	QRadioButton *rb = new QRadioButton( i18n("&No key"), fCArea );
    rb->adjustSize();
    rb->setFixedHeight( rb->height() );
    rb->setMinimumWidth( rb->width() );
    kbGroup->insert( rb, NoKey );
	
	grid->addMultiCellWidget( rb, 1, 1, 1, 2 );
	
	rb = new QRadioButton( i18n("&Default key"), fCArea );
    rb->adjustSize();
    rb->setFixedHeight( rb->height() );
    rb->setMinimumWidth( rb->width() );
    kbGroup->insert( rb, DefaultKey );
	
	grid->addMultiCellWidget( rb, 2, 2, 1, 2 );
	
	rb = new QRadioButton( i18n("&Custom key"), fCArea );
    rb->adjustSize();
    rb->setFixedHeight( rb->height() );
    rb->setMinimumWidth( rb->width() );
    kbGroup->insert( rb, CustomKey );
	
	connect( kbGroup, SIGNAL( clicked( int ) ), SLOT( keyMode( int ) ) );
	
	grid->addMultiCellWidget( rb, 3, 3, 1, 2 );
	
	QBoxLayout *pushLayout = new QHBoxLayout( 2 );
	grid->addLayout( pushLayout, 4, 2 );
	
	cShift = new QCheckBox( fCArea );
	cShift->setText( "SHIFT" );
	cShift->setEnabled( FALSE );
	connect( cShift, SIGNAL( clicked() ), SLOT( shiftClicked() ) );
	
	cCtrl = new QCheckBox( fCArea );
	cCtrl->setText( "CTRL" );
	cCtrl->setEnabled( FALSE );
	connect( cCtrl, SIGNAL( clicked() ), SLOT( ctrlClicked() ) );
	
	cAlt = new QCheckBox( fCArea );
	cAlt->setText( "ALT" );
	cAlt->setEnabled( FALSE );
	connect( cAlt, SIGNAL( clicked() ), SLOT( altClicked() ) );
	
	bChange = new KKeyButton("key", fCArea);
	bChange->setEnabled( FALSE );
	connect( bChange, SIGNAL( clicked() ), SLOT( changeKey() ) );
	
	// Set height of checkboxes to basic key button height.
	// Basic key button height = push button height.
	cAlt->adjustSize();
	cAlt->setFixedHeight( bChange->sizeHint().height() );
	cAlt->setMinimumWidth( cAlt->width() );
	cShift->adjustSize();
	cShift->setFixedHeight( bChange->sizeHint().height() );
	cShift->setMinimumWidth( cShift->width() );
	cCtrl->adjustSize();
	cCtrl->setFixedHeight( bChange->sizeHint().height() );
	cCtrl->setMinimumWidth( cCtrl->width() );
	fCArea->setMinimumHeight( bChange->sizeHint().height() + 20 +
		3*rb->height() + 4*10);
	
	// Add widgets to the geometry manager
	
	pushLayout->addWidget( cShift );
	pushLayout->addSpacing( 8 );
	pushLayout->addWidget( cCtrl );
	pushLayout->addSpacing( 8 );
	pushLayout->addWidget( cAlt );
	pushLayout->addSpacing( 18 );
	pushLayout->addWidget( bChange );
	pushLayout->addStretch( 10 );
	
	lNotConfig = new QLabel(fCArea);
	lNotConfig->resize(0,0);
	lNotConfig->setFont( QFont("Helvetica", 14, QFont::Bold) );
	lNotConfig->setAlignment( AlignCenter );
	lNotConfig->setFrameStyle( QFrame::Panel | QFrame::Sunken );
	if ( wList->count()==0 )
		lNotConfig->setText(i18n("No keys defined"));
	else {
		lNotConfig->setText(i18n("Not configurable"));
		lNotConfig->hide();
	}
	lNotConfig->hide();

	lInfo = new QLabel(fCArea);
	resize(0,0);
	lInfo->setAlignment( AlignCenter );
	lInfo->setEnabled( FALSE );
	lInfo->hide();
	
	wList->setAutoUpdate(TRUE);
	wList->update();
	
	globalDict = new QDict<int> ( 37, false );
	globalDict->setAutoDelete( true );
	readGlobalKeys();
	
	topLayout->activate();
}
ColumnViewPreviewWidget::ColumnViewPreviewWidget( ColumnView* parent )
    : QWidget( parent )
{
    QWidget::setVisible( false );

    QBoxLayout* mainLayout = new QVBoxLayout;
    setLayout( mainLayout );

#ifndef Q_OS_MAC //we don't need to scale on OSX anyway
    mainLayout->addSpacing( TomahawkUtils::DpiScaler::scaledY( this, 8 ) );
#else
    mainLayout->addSpacing( 8 );
#endif

    QBoxLayout* coverCenterLayout = new QHBoxLayout;
    mainLayout->addLayout( coverCenterLayout );

    m_cover = new PlayableCover( this );
    m_cover->setShowText( false );
    m_cover->setFixedSize( 260, 260 );
    m_cover->setAlignment( Qt::AlignCenter );

    coverCenterLayout->addStretch();
    coverCenterLayout->addWidget( m_cover );
    coverCenterLayout->addStretch();

#ifndef Q_OS_MAC //we don't need to scale on OSX anyway
    mainLayout->addSpacing( TomahawkUtils::DpiScaler::scaledY( this, 16 ) );
#else
    mainLayout->addSpacing( 16 );
#endif

    m_trackLabel = new ScrollingLabel( this );
    QFont font;
    font.setPointSize( TomahawkUtils::defaultFontSize() + 9 );
    font.setBold( true );
    m_trackLabel->setFont( font );
    m_trackLabel->setFixedHeight( QFontMetrics( font ).height() + 6 );
    m_trackLabel->setAlignment( Qt::AlignCenter );
    QHBoxLayout* trackLayout = new QHBoxLayout;
    trackLayout->addSpacing( 3 );
    trackLayout->addWidget( m_trackLabel );
    trackLayout->addSpacing( 3 );
    mainLayout->addLayout( trackLayout );

    m_artistLabel = new QueryLabel( this );
    m_artistLabel->setContentsMargins( 6, 2, 6, 2 );
    m_artistLabel->setType( QueryLabel::Artist );
    m_artistLabel->setAlignment( Qt::AlignCenter );
    font.setPointSize( TomahawkUtils::defaultFontSize() + 5 );
    m_artistLabel->setFont( font );
    QHBoxLayout* artistLayout = new QHBoxLayout;
    artistLayout->addStretch();
    artistLayout->addWidget( m_artistLabel );
    m_artistLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred );
    artistLayout->addStretch();
    mainLayout->addLayout( artistLayout );

#ifndef Q_OS_MAC //we don't need to scale on OSX anyway
    mainLayout->addSpacing( TomahawkUtils::DpiScaler::scaledY( this, 16 ) );
#else
    mainLayout->addSpacing( 16 );
#endif

    QGridLayout* gridLayout = new QGridLayout;
    mainLayout->addLayout( gridLayout );

    font.setPointSize( TomahawkUtils::defaultFontSize() + 3 );

    m_composerLabel = new QLabel( this );
    m_composerLabel->setEnabled( false );
    m_composerLabel->setFont( font );
    m_composerLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    m_composerLabel->setText( tr( "Composer:" ) );
    gridLayout->addWidget( m_composerLabel, 0, 0 );

    m_durationLabel = new QLabel( this );
    m_durationLabel->setEnabled( false );
    m_durationLabel->setFont( font );
    m_durationLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    m_durationLabel->setText( tr( "Duration:" ) );
    gridLayout->addWidget( m_durationLabel, 1, 0 );

    m_bitrateLabel = new QLabel( this );
    m_bitrateLabel->setEnabled( false );
    m_bitrateLabel->setFont( font );
    m_bitrateLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    m_bitrateLabel->setText( tr( "Bitrate:" ) );
    gridLayout->addWidget( m_bitrateLabel, 2, 0 );

    m_yearLabel = new QLabel( this );
    m_yearLabel->setEnabled( false );
    m_yearLabel->setFont( font );
    m_yearLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    m_yearLabel->setText( tr( "Year:" ) );
    gridLayout->addWidget( m_yearLabel, 3, 0 );

    m_ageLabel = new QLabel( this );
    m_ageLabel->setEnabled( false );
    m_ageLabel->setFont( font );
    m_ageLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
    m_ageLabel->setText( tr( "Age:" ) );
    gridLayout->addWidget( m_ageLabel, 4, 0 );

    m_composerValue = new QLabel( this );
    m_composerValue->setFont( font );
    m_composerValue->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
    gridLayout->addWidget( m_composerValue, 0, 1 );

    m_durationValue = new QLabel( this );
    m_durationValue->setFont( font );
    m_durationValue->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
    gridLayout->addWidget( m_durationValue, 1, 1 );

    m_bitrateValue = new QLabel( this );
    m_bitrateValue->setFont( font );
    m_bitrateValue->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
    gridLayout->addWidget( m_bitrateValue, 2, 1 );

    m_yearValue = new QLabel( this );
    m_yearValue->setFont( font );
    m_yearValue->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
    gridLayout->addWidget( m_yearValue, 3, 1 );

    m_ageValue = new QLabel( this );
    m_ageValue->setFont( font );
    m_ageValue->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
    gridLayout->addWidget( m_ageValue, 4, 1 );

    mainLayout->addStretch();

    TomahawkUtils::unmarginLayout( mainLayout );

#ifndef Q_OS_MAC //we don't need to scale on OSX anyway
    gridLayout->setSpacing( TomahawkUtils::DpiScaler::scaledX( this, 4 ) );
#else
    gridLayout->setSpacing( 4 );
#endif
}