Exemplo n.º 1
0
void
WVDialer::pppStatusSLOT( bool up )
{
  if (up != pppUp)
  {
    if (up)
    {
      setIconText( tr( "PPP UP" ) );
      upTimer = startTimer( 1000 );
      
      if (configDlg->startProcess())
      {
        delayTimer = startTimer( configDlg->startProcessDelay() );
      }
    }
    else
    {
      setIconText( tr( "PPP DOWN" ) );
      killTimer( upTimer );
      upTimer = -1;
    }
  }
  
  pppUp = up;
}
Exemplo n.º 2
0
void MyAction::change(const QString & text ) {
	setText( text );

	QString accel_text = shortcut().toString();

	QString s = text;
	s.replace("&","");
	if (!accel_text.isEmpty()) {
		setToolTip( s + " ("+ accel_text +")");
		setIconText( s );
	}

	/*
	if (text.isEmpty()) {
		QString s = menuText;
		s = s.replace("&","");
		setText( s );

		if (!accel_text.isEmpty())
			setToolTip( s + " ("+ accel_text +")");
	} else {
		setText( text );
		if (!accel_text.isEmpty())
			setToolTip( text + " ("+ accel_text +")");
	}
	*/
}
Exemplo n.º 3
0
BackupOptDlg::BackupOptDlg( BackupProfile* backupProfile, QWidget* parent, const char* name )
        : QDialog( parent, name, TRUE )
{
    setIconText( i18n( "KDat: Backup Options" ) );
    setCaption( i18n( "KDat: Backup Options" ) );

    resize( 400, 300 );

    _profile = new BackupProfileWidget( this );
    _profile->setBackupProfile( backupProfile );

    QPushButton* ok = new QPushButton( i18n( "OK" ), this );
    ok->setFixedSize( 80, ok->sizeHint().height() );
    connect( ok, SIGNAL( clicked() ), this, SLOT( accept() ) );
    QPushButton* cancel = new QPushButton( i18n( "Cancel" ), this );
    cancel->setFixedSize( 80, ok->sizeHint().height() );
    connect( cancel, SIGNAL( clicked() ), this, SLOT( reject() ) );

    QVBoxLayout* l1 = new QVBoxLayout( this, 8, 4 );
    l1->addWidget( _profile, 1 );

    QHBoxLayout* l1_1 = new QHBoxLayout();
    l1->addLayout( l1_1 );
    l1_1->addStretch( 1 );
    l1_1->addWidget( ok );
    l1_1->addWidget( cancel );
}
Exemplo n.º 4
0
KBookmarkActionMenu::KBookmarkActionMenu(const KBookmark &bm, QObject *parent)
    : KActionMenu(QIcon::fromTheme(bm.icon()), bm.text().replace('&', QLatin1String("&&")), parent),
      KBookmarkActionInterface(bm)
{
    setToolTip(bm.description());
    setIconText(text());
}
Exemplo n.º 5
0
 void retranslateUi()
 {
     setIconText(QApplication::translate("UIActionPool", "Discard"));
     setName(QApplication::translate("UIActionPool", "D&iscard saved state..."));
     setStatusTip(QApplication::translate("UIActionPool", "Discard the saved state of the selected virtual machines"));
     setToolTip(text().remove('&').remove('.') +
                (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
 }
Exemplo n.º 6
0
WVDialer::WVDialer( QWidget *parent, const char *name ) :
  WVDialerDlg( parent, name ),
  exitFlag( false ),
  upTimer( -1 ),
  delayTimer( -1 ),
  upTime( 0 ),
  pppUp( false ),
  trayIcon(NULL),
  tray(NULL)
{  
  checkOldConfiguration();

  if (QFile::exists("/usr/share/icons/hicolor/32x32/qtwvdialer.png"))
  {
    trayIcon = new QIcon("/usr/share/icons/hicolor/32x32/qtwvdialer.png");
    this->setWindowIcon(*trayIcon);
    initializeTray();
  }
  
  QString fname = QDir::homeDirPath();
  fname += "/.qtwvdialer/settings";  
  cfg = new SimpleCfg( fname );
    
  configDlg = new WVConfigDlg( this );
  configDlg->hide();
  configDlg->load();
  
  loadConfig();
  
  wvdial = new Q3Process( this );
  startProcess = new Q3Process( this );
  
  stats = new PPPStats();
  
  errPix = QPixmap( (const char **)error_xpm );
  
  connect( connectBut, SIGNAL( clicked() ), this, SLOT( connectSLOT() ));
  connect( quitBut, SIGNAL( clicked() ), this, SLOT( quitSLOT() ));
  connect( helpBut, SIGNAL( clicked() ), this, SLOT( helpSLOT() ));
  connect( configBut, SIGNAL( clicked() ), this, SLOT( configSLOT() ));
  connect( wvdial, SIGNAL( readyReadStdout() ),
           this, SLOT( readStdoutSLOT()));
  connect( wvdial, SIGNAL( readyReadStderr() ),
           this, SLOT( readStderrSLOT()));
  connect( wvdial, SIGNAL( processExited() ),
           this, SLOT( exitedSLOT() ));
  connect( startProcess, SIGNAL( processExited() ),
           this, SLOT( exitedSLOT() ));
  connect( stats, SIGNAL( status( unsigned, unsigned, unsigned, unsigned )),
           this, SLOT( statsSLOT( unsigned, unsigned, unsigned, unsigned )));
  connect( stats, SIGNAL( remoteAddr( const QString & )),
           ipLabel, SLOT( setText( const QString & )));
  connect( stats, SIGNAL( pppStatus( bool ) ),
           this, SLOT( pppStatusSLOT( bool ) ));
  
  setIconText( tr( "PPP DOWN" ) );
}
Exemplo n.º 7
0
/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SQDFrame::languageChange()
{
  setCaption( tr( "Effective-mass simulation of a spherical quantum dot" ) );
  setIconText( tr( "sqd" ) );
  potLabel->setText( tr( "<font size=\"+1\">Radial potential</font>" ) );
  wfsLabel->setText( tr( "<font size=\"+1\">Solutions of a radial Schrodinger Eq. <fon size=\"+2\"><i>u<sub>l</sub></i></font></font>" ) );
  quitButton->setText( tr( "Quit" ) );
  saveButton->setText( tr( "Save" ) );
  QToolTip::add(quitButton, "Leave the application");
  QToolTip::add(saveButton, "Save the results of the application");
}
Exemplo n.º 8
0
Verzeichnis::Verzeichnis (IString const &n)
{
        Path = n;
        IString name = n;
        HPOINTER p = WinLoadFileIcon (n, FALSE);
        if ( p )
                setIcon (IPointerHandle (p));
        else
                setIcon (ISystemPointerHandle (ISystemPointerHandle::folder));
        setIconText (name.remove (1, Path.lastIndexOf ('\\')));
}
Exemplo n.º 9
0
bool QWidget::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: setEnabled((bool)static_QUType_bool.get(_o+1)); break;
    case 1: setDisabled((bool)static_QUType_bool.get(_o+1)); break;
    case 2: setCaption((const QString&)static_QUType_QString.get(_o+1)); break;
    case 3: setIcon((const QPixmap&)*((const QPixmap*)static_QUType_ptr.get(_o+1))); break;
    case 4: setIconText((const QString&)static_QUType_QString.get(_o+1)); break;
    case 5: setMouseTracking((bool)static_QUType_bool.get(_o+1)); break;
    case 6: setFocus(); break;
    case 7: clearFocus(); break;
    case 8: setUpdatesEnabled((bool)static_QUType_bool.get(_o+1)); break;
    case 9: update(); break;
    case 10: update((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(int)static_QUType_int.get(_o+4)); break;
    case 11: update((const QRect&)*((const QRect*)static_QUType_ptr.get(_o+1))); break;
    case 12: repaint(); break;
    case 13: repaint((bool)static_QUType_bool.get(_o+1)); break;
    case 14: repaint((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(int)static_QUType_int.get(_o+4)); break;
    case 15: repaint((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(int)static_QUType_int.get(_o+4),(bool)static_QUType_bool.get(_o+5)); break;
    case 16: repaint((const QRect&)*((const QRect*)static_QUType_ptr.get(_o+1))); break;
    case 17: repaint((const QRect&)*((const QRect*)static_QUType_ptr.get(_o+1)),(bool)static_QUType_bool.get(_o+2)); break;
    case 18: repaint((const QRegion&)*((const QRegion*)static_QUType_ptr.get(_o+1))); break;
    case 19: repaint((const QRegion&)*((const QRegion*)static_QUType_ptr.get(_o+1)),(bool)static_QUType_bool.get(_o+2)); break;
    case 20: show(); break;
    case 21: hide(); break;
    case 22: setShown((bool)static_QUType_bool.get(_o+1)); break;
    case 23: setHidden((bool)static_QUType_bool.get(_o+1)); break;
    case 24: iconify(); break;
    case 25: showMinimized(); break;
    case 26: showMaximized(); break;
    case 27: showFullScreen(); break;
    case 28: showNormal(); break;
    case 29: polish(); break;
    case 30: constPolish(); break;
    case 31: static_QUType_bool.set(_o,close()); break;
    case 32: raise(); break;
    case 33: lower(); break;
    case 34: stackUnder((QWidget*)static_QUType_ptr.get(_o+1)); break;
    case 35: move((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 36: move((const QPoint&)*((const QPoint*)static_QUType_ptr.get(_o+1))); break;
    case 37: resize((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 38: resize((const QSize&)*((const QSize*)static_QUType_ptr.get(_o+1))); break;
    case 39: setGeometry((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(int)static_QUType_int.get(_o+4)); break;
    case 40: setGeometry((const QRect&)*((const QRect*)static_QUType_ptr.get(_o+1))); break;
    case 41: adjustSize(); break;
    case 42: focusProxyDestroyed(); break;
    default:
	return QObject::qt_invoke( _id, _o );
    }
    return TRUE;
}
Exemplo n.º 10
0
ButtonList::ButtonList(QWidget *parent, const char *nm ,WFlags f = WType_TopLevel) :
#else
ButtonList::ButtonList(QWidget *parent, const char *nm ) :
#endif
    QFrame(parent, nm)
    // QWidget(parent, nm) 
{
  setPalette( QPalette( Qt::lightGray ) );

  setCaption("Control Panel");
  setIconText("Control Panel");

  // setGeometry(3, 70, 190, 250);
  setGeometry(3, 3, 190, 250);

  topLayout = new QVBoxLayout( this, 5 );
  // (default )topLayout = new QVBoxLayout( this );
  CHECK_PTR( topLayout );

  menuBar = new QMenuBar(this);
  CHECK_PTR( menuBar );

  file = new QPopupMenu();
  CHECK_PTR( file );
  file->setPalette( QPalette( Qt::lightGray ) );

  // This should perhaps be replaced by a popup asking
  // if we are sure we want to quit
  file->insertItem( "&Quit", this, SLOT( quit() ) );

  // Put the submenus in the main menu
  menuBar->insertItem( "&File", file );

  // Put the menuBar on the layout
  topLayout->setMenuBar( menuBar );


  // Add a second layout to hold added buttons
  // Activate the layout
  layout = new QVBoxLayout();
  CHECK_PTR( layout );

  topLayout->addLayout( layout );

}
Exemplo n.º 11
0
Datei::Datei (IString const &n)
{
        FILESTATUS3 s;
        DosQueryPathInfo (n, FIL_STANDARD, &s, sizeof (s));
        FTIME t = s.ftimeLastWrite;
        FDATE d = s.fdateLastWrite;
        MD.day = d.day;
        MD.month = d.month;
        MD.year = d.year + 1980;
        MT.hours = t.hours;
        MT.minutes = t.minutes;
        MT.seconds = t.twosecs * 2;
        Groesse = s.cbFile;
        Dir = s.attrFile & FILE_DIRECTORY;

        setIcon (IPointerHandle (WinLoadFileIcon (n, FALSE)));
        Name = n;
        Name.remove (1, Name.lastIndexOf ('\\'));
        setIconText (Name);
}
Exemplo n.º 12
0
VerifyDlg::VerifyDlg( const char* workingDir, int fileno, const RangeList& ranges,
                      bool restore, QWidget* parent, const char* name )
        : QDialog( parent, name, TRUE ),
          _restore( restore ),
          _proc( NULL ),
          _workingDir( workingDir ),
          _fileno( fileno ),
          _ranges( ranges ),
          _totalKBytes( 0.0 ),
          _fileCount( 0 ),
          _wroteStdin( TRUE ),
          _aborted( FALSE ),
          _done( FALSE )
{
    // Calculate size of verify.
    QListIterator<Range> i( _ranges.getRanges() );
    _archiveSize = 0;
    for ( ; i.current(); ++i ) {
        _archiveSize += i.current()->getEnd() - i.current()->getStart();
    }
    _archiveSize = ( _archiveSize + 1 ) / 2;
    
    if ( _restore ) {
        setCaption( i18n( "KDat: Restore" ) );
        setIconText( i18n( "KDat: Restore" ) );
    } else {
        setCaption( i18n( "KDat: Verify" ) );
        setIconText( i18n( "KDat: Verify" ) );
    }

    resize( 500, 300 );

    const int labelWidth = 96;

    QFrame* f1 = new QFrame( this );
    f1->setFrameStyle( QFrame::Panel | QFrame::Sunken );

    QFrame* f2 = new QFrame( this );
    f2->setFrameStyle( QFrame::Panel | QFrame::Sunken );

    QLabel* lbl1 = new QLabel( i18n( "Elapsed time:" ), f1 );
    lbl1->setFixedSize( labelWidth, lbl1->sizeHint().height() );

    _elapsedTime = new QLabel( i18n( "00:00:00" ), f1 );
    _elapsedTime->setFixedHeight( _elapsedTime->sizeHint().height() );

    QLabel* lbl2 = new QLabel( i18n( "Time remaining:" ), f2 );
    lbl2->setFixedSize( labelWidth, lbl2->sizeHint().height() );

    _timeRemaining = new QLabel( i18n( "00:00:00" ), f2 );
    _timeRemaining->setFixedHeight( _timeRemaining->sizeHint().height() );

    QLabel* lbl3 = new QLabel( i18n( "Total kbytes:" ), f1 );
    lbl3->setFixedSize( labelWidth, lbl3->sizeHint().height() );

    QLabel* totalKbytes = new QLabel( Util::kbytesToString( _archiveSize ), f1 );
    totalKbytes->setFixedHeight( totalKbytes->sizeHint().height() );

    QLabel* lbl4 = new QLabel( i18n( "Kbytes read:" ), f2 );
    lbl4->setFixedSize( labelWidth, lbl4->sizeHint().height() );

    _kbytesRead = new QLabel( i18n( "0k" ), f2 );
    _kbytesRead->setFixedHeight( _kbytesRead->sizeHint().height() );

    QLabel* lbl5 = new QLabel( i18n( "Transfer rate:" ), f1 );
    lbl5->setFixedSize( labelWidth, lbl5->sizeHint().height() );

    _transferRate = new QLabel( i18n( "0k/min" ), f1 );
    _transferRate->setFixedHeight( _transferRate->sizeHint().height() );

    QLabel* lbl6;
    if ( _restore ) {
        lbl6 = new QLabel( i18n( "Files:" ), f2 );
        lbl6->setFixedSize( labelWidth, lbl6->sizeHint().height() );
    } else {
        lbl6 = new QLabel( i18n( "Differences:" ), f2 );
        lbl6->setFixedSize( labelWidth, lbl6->sizeHint().height() );
    }

    _files = new QLabel( "0", f2 );
    _files->setFixedHeight( _files->sizeHint().height() );

    if ( _restore ) {
        _log = new LoggerWidget( i18n( "Restore log:" ), this );
    } else {
        _log = new LoggerWidget( i18n( "Verify log:" ), this );
    }

    _ok = new QPushButton( i18n( "OK" ), this );
    _ok->setFixedSize( 80, _ok->sizeHint().height() );
    connect( _ok, SIGNAL( clicked() ), this, SLOT( slotOK() ) );
    _ok->setEnabled( FALSE );

    _save = new QPushButton( i18n( "Save Log..." ), this );
    _save->setFixedSize( 80, _save->sizeHint().height() );
    connect( _save, SIGNAL( clicked() ), _log, SLOT( save() ) );
    _save->setEnabled( FALSE );

    _abort = new QPushButton( i18n( "Abort" ), this );
    _abort->setFixedSize( 80, _abort->sizeHint().height() );
    connect( _abort, SIGNAL( clicked() ), this, SLOT( slotAbort() ) );

    QVBoxLayout* l1 = new QVBoxLayout( this, 8, 4 );

    QHBoxLayout* l1_1 = new QHBoxLayout();
    l1->addLayout( l1_1 );
    l1_1->addStrut( 3 * lbl1->height() + 16 );
    l1_1->addWidget( f1 );
    l1_1->addWidget( f2 );
    
    QVBoxLayout* l1_1_1 = new QVBoxLayout( f1, 4, 4 );

    QHBoxLayout* l1_1_1_1 = new QHBoxLayout();
    l1_1_1->addLayout( l1_1_1_1 );
    l1_1_1_1->addWidget( lbl1 );
    l1_1_1_1->addWidget( _elapsedTime, 1 );

    QHBoxLayout* l1_1_1_2 = new QHBoxLayout();
    l1_1_1->addLayout( l1_1_1_2 );
    l1_1_1_2->addWidget( lbl3 );
    l1_1_1_2->addWidget( totalKbytes, 1 );

    QHBoxLayout* l1_1_1_3 = new QHBoxLayout();
    l1_1_1->addLayout( l1_1_1_3 );
    l1_1_1_3->addWidget( lbl5 );
    l1_1_1_3->addWidget( _transferRate, 1 );

    QVBoxLayout* l1_1_2 = new QVBoxLayout( f2, 4, 4 );

    QHBoxLayout* l1_1_2_1 = new QHBoxLayout();
    l1_1_2->addLayout( l1_1_2_1 );
    l1_1_2_1->addWidget( lbl2 );
    l1_1_2_1->addWidget( _timeRemaining, 1 );

    QHBoxLayout* l1_1_2_2 = new QHBoxLayout();
    l1_1_2->addLayout( l1_1_2_2 );
    l1_1_2_2->addWidget( lbl4 );
    l1_1_2_2->addWidget( _kbytesRead, 1 );

    QHBoxLayout* l1_1_2_3 = new QHBoxLayout();
    l1_1_2->addLayout( l1_1_2_3 );
    l1_1_2_3->addWidget( lbl6 );
    l1_1_2_3->addWidget( _files, 1 );

    l1->addWidget( _log, 1 );

    QHBoxLayout* l1_2 = new QHBoxLayout();
    l1->addLayout( l1_2 );
    l1_2->addStretch( 1 );
    l1_2->addWidget( _ok );
    l1_2->addWidget( _save );
    l1_2->addWidget( _abort );
}
Exemplo n.º 13
0
void VCFrame::createContents(QPtrList <QString> &list)
{
  QRect rect(30, 30, 30, 30);

  for (QString* s = list.next(); s != NULL; s = list.next())
    {
      if (*s == QString("Entry"))
	{
	  s = list.prev();
	  break;
	}
      else if (*s == QString("ID"))
	{
	  setID(list.next()->toInt());
	}
      else if (*s == QString("ButtonBehaviour"))
	{
	  setButtonBehaviour(static_cast<ButtonBehaviour>
			     (list.next()->toInt()));
	}
      else if (*s == QString("Parent"))
	{
	  if (m_bottomFrame == false)
	    {
	      VCFrame* parent = 
		_app->virtualConsole()->getFrame(list.next()->toInt());

	      if (parent != NULL)
		{
		  reparent((QWidget*) parent, 0, QPoint(0, 0), true);
		}
	    }
	  else
	    {
	      list.next();
	    }
	}
      else if (*s == QString("Textcolor"))
	{
	  QColor qc;
	  qc.setRgb(list.next()->toUInt());
	  setPaletteForegroundColor(qc);
	}
      else if (*s == QString("Backgroundcolor"))
	{
	  QColor qc;
	  qc.setRgb(list.next()->toUInt());
	  setPaletteBackgroundColor(qc);
	}
      else if (*s == QString("Color"))
	{
	  // Backwards compatibility for frame background color
	  QString t = *(list.next());
	  int i = t.find(QString(","));
	  int r = t.left(i).toInt();
	  int j = t.find(QString(","), i + 1);
	  int g = t.mid(i+1, j-i-1).toInt();
	  int b = t.mid(j+1).toInt();
	  QColor qc(r, g, b);
	  setPaletteBackgroundColor(qc);
	}
      else if (*s == QString("Pixmap"))
	{
	  QString t;
	  t = *(list.next());
	  
	  QPixmap pm(t);
	  if (pm.isNull() == false)
	    {
	      setIconText(t);
	      setPaletteBackgroundPixmap(pm);
	    }
	}
      else if (*s == QString("Font"))
	{
	  QFont f = font();
	  QString q = *(list.next());
	  f.fromString(q);
	  setFont(f);
	}
      else if (*s == QString("X"))
	{
	  rect.setX(list.next()->toInt());
	}
      else if (*s == QString("Y"))
	{
	  rect.setY(list.next()->toInt());
	}
      else if (*s == QString("Width"))
	{
	  rect.setWidth(list.next()->toInt());
	}
      else if (*s == QString("Height"))
	{
	  rect.setHeight(list.next()->toInt());
	}
      else
	{
	  // Unknown keyword, ignore
	  *list.next();
	}
    }

  if (m_bottomFrame == false)
    {
      setGeometry(rect);
    }
}
Exemplo n.º 14
0
//
// Create this slider's contents from list
//
void VCDockSlider::createContents(QPtrList <QString> &list)
{
  QRect rect(0, 0, 60, 200);

  for (QString* s = list.next(); s != NULL; s = list.next())
    {
      if (*s == QString("Entry"))
	{
	  s = list.prev();
	  break;
	}
      else if (*s == QString("Name"))
	{
	  setCaption(*(list.next()));
	}
      else if (*s == QString("Parent"))
	{
	  VCFrame* parent =
	    _app->virtualConsole()->getFrame(list.next()->toInt());

	  if (parent != NULL)
	    {
	      reparent((QFrame*)parent, 0, QPoint(0, 0), true);
	    }
	}
      else if (*s == QString("X"))
	{
	  rect.setX(list.next()->toInt());
	}
      else if (*s == QString("Y"))
	{
	  rect.setY(list.next()->toInt());
	}
      else if (*s == QString("Width"))
	{
	  rect.setWidth(list.next()->toInt());
	}
      else if (*s == QString("Height"))
	{
	  rect.setHeight(list.next()->toInt());
	}
      else if (*s == QString("Textcolor"))
	{
	  QColor qc;
	  qc.setRgb(list.next()->toUInt());
	  setPaletteForegroundColor(qc);
	}
      else if (*s == QString("Backgroundcolor"))
	{
	  QColor qc;
	  qc.setRgb(list.next()->toUInt());
	  setPaletteBackgroundColor(qc);
	}
      else if (*s == QString("Color"))
	{
	  // Backwards compatibility for slider background color
	  QString t = *(list.next());
	  int i = t.find(QString(","));
	  int r = t.left(i).toInt();
	  int j = t.find(QString(","), i + 1);
	  int g = t.mid(i+1, j-i-1).toInt();
	  int b = t.mid(j+1).toInt();
	  QColor qc(r, g, b);
	  setPaletteBackgroundColor(qc);
	}
      else if (*s == QString("Pixmap"))
	{
	  QString t;
	  t = *(list.next());
	  
	  QPixmap pm(t);
	  if (pm.isNull() == false)
	    {
	      setIconText(t);
	      unsetPalette();
	      setPaletteBackgroundPixmap(pm);
	      m_valueLabel->setBackgroundOrigin(ParentOrigin);
	      m_slider->setBackgroundOrigin(ParentOrigin);
	    }
	}
      else if (*s == QString("Frame"))
	{
	  if (*(list.next()) == Settings::trueValue())
	    {
	      setFrameStyle(KFrameStyle);
	    }
	  else
	    {
	      setFrameStyle(NoFrame);
	    }
	}
      else if (*s == QString("Font"))
	{
	  QFont f = font();
	  QString q = *(list.next());
	  f.fromString(q);
	  setFont(f);
	}
      else if (*s == QString("Bus"))
	{
	  QString t = *(list.next());
	  t_bus_value value;
	  if (Bus::value(t.toInt(), value))
	    {
	      setBusID(t.toInt());
	    }
	}
      else if (*s == QString("BusLowLimit"))
	{
	  m_busLowLimit = list.next()->toInt();
	}
      else if (*s == QString("BusHighLimit"))
	{
	  m_busHighLimit = list.next()->toInt();
	}
      else if (*s == QString("Channels"))
	{
	  QString t;

	  unsigned int i = 0;
	  int j = 0;

	  s = list.next();

	  while (i < s->length())
	    {
	      j = s->find(QChar(' '), i, false);
	      if (j == -1)
		{
		  j = s->length();
		}

	      t = s->mid(i, j-i);
	      
	      // Check for duplicates
	      if (m_channels.find(t.toInt()) == m_channels.end())
		{
		  m_channels.append(t.toInt());
		}
	      
	      i = j + 1;
	    }
	}
      else if (*s == QString("LevelLowLimit"))
	{
	  m_levelLowLimit = list.next()->toInt();
	}
      else if (*s == QString("LevelHighLimit"))
	{
	  m_levelHighLimit = list.next()->toInt();
	}
      else if (*s == QString("Mode"))
	{
	  QString t = *list.next();
	  if (t == modeString(Speed))
	    {
	      m_mode = Speed;
	    }
	  else if (t == modeString(Level))
	    {
	      m_mode = Level;
	    }
	  else
	    {
	      m_mode = Submaster;
	    }
	}
      else if (*s == QString("Value"))
	{
	  m_slider->setValue(list.next()->toInt());
	}
      else
	{
	  // Unknown keyword, ignore
	  *list.next();
	}
    }

  setLevelRange(m_levelLowLimit, m_levelHighLimit);
  setBusRange(m_busLowLimit, m_busHighLimit);
  setGeometry(rect);

  if (m_mode == Submaster)
    {
      assignSubmasters(true);
    }

  setMode(m_mode);
}
Exemplo n.º 15
0
bool QWidget::qt_property( int id, int f, QVariant* v)
{
    switch ( id - staticMetaObject()->propertyOffset() ) {
    case 0: switch( f ) {
	case 1: *v = QVariant( this->isTopLevel(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 1: switch( f ) {
	case 1: *v = QVariant( this->isDialog(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 2: switch( f ) {
	case 1: *v = QVariant( this->isModal(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 3: switch( f ) {
	case 1: *v = QVariant( this->isPopup(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 4: switch( f ) {
	case 1: *v = QVariant( this->isDesktop(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 5: switch( f ) {
	case 0: setEnabled(v->asBool()); break;
	case 1: *v = QVariant( this->isEnabled(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 6: switch( f ) {
	case 0: setGeometry(v->asRect()); break;
	case 1: *v = QVariant( this->geometry() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 7: switch( f ) {
	case 1: *v = QVariant( this->frameGeometry() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 8: switch( f ) {
	case 1: *v = QVariant( this->x() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 9: switch( f ) {
	case 1: *v = QVariant( this->y() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 10: switch( f ) {
	case 0: move(v->asPoint()); break;
	case 1: *v = QVariant( this->pos() ); break;
	case 4: break;
	default: return FALSE;
    } break;
    case 11: switch( f ) {
	case 1: *v = QVariant( this->frameSize() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 12: switch( f ) {
	case 0: resize(v->asSize()); break;
	case 1: *v = QVariant( this->size() ); break;
	case 4: break;
	default: return FALSE;
    } break;
    case 13: switch( f ) {
	case 1: *v = QVariant( this->width() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 14: switch( f ) {
	case 1: *v = QVariant( this->height() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 15: switch( f ) {
	case 1: *v = QVariant( this->rect() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 16: switch( f ) {
	case 1: *v = QVariant( this->childrenRect() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 17: switch( f ) {
	case 1: *v = QVariant( this->childrenRegion() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 18: switch( f ) {
	case 0: setSizePolicy(v->asSizePolicy()); break;
	case 1: *v = QVariant( this->sizePolicy() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 19: switch( f ) {
	case 0: setMinimumSize(v->asSize()); break;
	case 1: *v = QVariant( this->minimumSize() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 20: switch( f ) {
	case 0: setMaximumSize(v->asSize()); break;
	case 1: *v = QVariant( this->maximumSize() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 21: switch( f ) {
	case 0: setMinimumWidth(v->asInt()); break;
	case 1: *v = QVariant( this->minimumWidth() ); break;
	case 4: break;
	default: return FALSE;
    } break;
    case 22: switch( f ) {
	case 0: setMinimumHeight(v->asInt()); break;
	case 1: *v = QVariant( this->minimumHeight() ); break;
	case 4: break;
	default: return FALSE;
    } break;
    case 23: switch( f ) {
	case 0: setMaximumWidth(v->asInt()); break;
	case 1: *v = QVariant( this->maximumWidth() ); break;
	case 4: break;
	default: return FALSE;
    } break;
    case 24: switch( f ) {
	case 0: setMaximumHeight(v->asInt()); break;
	case 1: *v = QVariant( this->maximumHeight() ); break;
	case 4: break;
	default: return FALSE;
    } break;
    case 25: switch( f ) {
	case 0: setSizeIncrement(v->asSize()); break;
	case 1: *v = QVariant( this->sizeIncrement() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 26: switch( f ) {
	case 0: setBaseSize(v->asSize()); break;
	case 1: *v = QVariant( this->baseSize() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 27: switch( f ) {
	case 0: setBackgroundMode((BackgroundMode&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->backgroundMode() ); break;
	case 4: case 5: break;
	default: return FALSE;
    } break;
    case 28: switch( f ) {
	case 0: setPaletteForegroundColor(v->asColor()); break;
	case 1: *v = QVariant( this->paletteForegroundColor() ); break;
	case 2: this->unsetPalette(); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 29: switch( f ) {
	case 0: setPaletteBackgroundColor(v->asColor()); break;
	case 1: *v = QVariant( this->paletteBackgroundColor() ); break;
	case 2: this->unsetPalette(); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 30: switch( f ) {
	case 0: setPaletteBackgroundPixmap(v->asPixmap()); break;
	case 1: if ( this->paletteBackgroundPixmap() ) *v = QVariant( *paletteBackgroundPixmap() ); break;
	case 2: this->unsetPalette(); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 31: switch( f ) {
	case 1: *v = QVariant( this->backgroundBrush() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 32: switch( f ) {
	case 1: *v = QVariant( this->colorGroup() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 33: switch( f ) {
	case 0: setPalette(v->asPalette()); break;
	case 1: *v = QVariant( this->palette() ); break;
	case 2: this->unsetPalette(); break;
	case 5: return this->ownPalette();
	case 3: case 4: break;
	default: return FALSE;
    } break;
    case 34: switch( f ) {
	case 0: setBackgroundOrigin((BackgroundOrigin&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->backgroundOrigin() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 35: switch( f ) {
	case 1: *v = QVariant( this->ownPalette(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 36: switch( f ) {
	case 0: setFont(v->asFont()); break;
	case 1: *v = QVariant( this->font() ); break;
	case 2: this->unsetFont(); break;
	case 5: return this->ownFont();
	case 3: case 4: break;
	default: return FALSE;
    } break;
    case 37: switch( f ) {
	case 1: *v = QVariant( this->ownFont(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 38: switch( f ) {
	case 0: setCursor(v->asCursor()); break;
	case 1: *v = QVariant( this->cursor() ); break;
	case 2: this->unsetCursor(); break;
	case 5: return this->ownCursor();
	case 3: case 4: break;
	default: return FALSE;
    } break;
    case 39: switch( f ) {
	case 1: *v = QVariant( this->ownCursor(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 40: switch( f ) {
	case 0: setCaption(v->asString()); break;
	case 1: *v = QVariant( this->caption() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 41: switch( f ) {
	case 0: setIcon(v->asPixmap()); break;
	case 1: if ( this->icon() ) *v = QVariant( *icon() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 42: switch( f ) {
	case 0: setIconText(v->asString()); break;
	case 1: *v = QVariant( this->iconText() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 43: switch( f ) {
	case 0: setMouseTracking(v->asBool()); break;
	case 1: *v = QVariant( this->hasMouseTracking(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 44: switch( f ) {
	case 1: *v = QVariant( this->hasMouse(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 45: switch( f ) {
	case 1: *v = QVariant( this->isActiveWindow(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 46: switch( f ) {
	case 1: *v = QVariant( this->isFocusEnabled(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 47: switch( f ) {
	case 0: setFocusPolicy((FocusPolicy&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->focusPolicy() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 48: switch( f ) {
	case 1: *v = QVariant( this->hasFocus(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 49: switch( f ) {
	case 0: setUpdatesEnabled(v->asBool()); break;
	case 1: *v = QVariant( this->isUpdatesEnabled(), 0 ); break;
	case 4: case 5: break;
	default: return FALSE;
    } break;
    case 50: switch( f ) {
	case 1: *v = QVariant( this->isVisible(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 51: switch( f ) {
	case 1: *v = QVariant( this->visibleRect() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 52: switch( f ) {
	case 0: setHidden(v->asBool()); break;
	case 1: *v = QVariant( this->isHidden(), 0 ); break;
	case 5: break;
	default: return FALSE;
    } break;
    case 53: switch( f ) {
	case 0: setShown(v->asBool()); break;
	case 1: *v = QVariant( this->isShown(), 0 ); break;
	case 5: break;
	default: return FALSE;
    } break;
    case 54: switch( f ) {
	case 1: *v = QVariant( this->isMinimized(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 55: switch( f ) {
	case 1: *v = QVariant( this->isMaximized(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 56: switch( f ) {
	case 1: *v = QVariant( this->isFullScreen(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 57: switch( f ) {
	case 1: *v = QVariant( this->sizeHint() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 58: switch( f ) {
	case 1: *v = QVariant( this->minimumSizeHint() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 59: switch( f ) {
	case 1: *v = QVariant( this->microFocusHint() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 60: switch( f ) {
	case 0: setAcceptDrops(v->asBool()); break;
	case 1: *v = QVariant( this->acceptDrops(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 61: switch( f ) {
	case 0: setAutoMask(v->asBool()); break;
	case 1: *v = QVariant( this->autoMask(), 0 ); break;
	case 5: break;
	default: return FALSE;
    } break;
    case 62: switch( f ) {
	case 1: *v = QVariant( this->customWhatsThis(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 63: switch( f ) {
	case 0: setInputMethodEnabled(v->asBool()); break;
	case 1: *v = QVariant( this->isInputMethodEnabled(), 0 ); break;
	case 5: break;
	default: return FALSE;
    } break;
    case 64: switch( f ) {
	case 0: setWindowOpacity(v->asDouble()); break;
	case 1: *v = QVariant( this->windowOpacity() ); break;
	case 4: case 5: break;
	default: return FALSE;
    } break;
    default:
	return QObject::qt_property( id, f, v );
    }
    return TRUE;
}
Exemplo n.º 16
0
void VCButton::createContents(QPtrList <QString> &list)
{
  QRect rect(30, 30, 30, 30);

  for (QString* s = list.next(); s != NULL; s = list.next())
    {
      if (*s == QString("Entry"))
	{
	  s = list.prev();
	  break;
	}
      else if (*s == QString("Name"))
	{
	  setCaption(*(list.next()));
	}
      else if (*s == QString("Parent"))
	{
	  VCFrame* parent =
	    _app->virtualConsole()->getFrame(list.next()->toInt());
	  if (parent != NULL)
	    {
	      reparent((QWidget*)parent, 0, QPoint(0, 0), true);
	    }

	  // each Button should set
	  if (parent->buttonBehaviour() == VCFrame::Exclusive)
	    {
	      setExclusive(true);
	    }
	  else
	    {
	      setExclusive(false);
	    }
	}
      else if (*s == QString("X"))
	{
	  rect.setX(list.next()->toInt());
	}
      else if (*s == QString("Y"))
	{
	  rect.setY(list.next()->toInt());
	}
      else if (*s == QString("Width"))
	{
	  rect.setWidth(list.next()->toInt());
	}
      else if (*s == QString("Height"))
	{
	  rect.setHeight(list.next()->toInt());
	}
      else if (*s == QString("Textcolor"))
	{
	  QColor qc;
	  qc.setRgb(list.next()->toUInt());
	  setPaletteForegroundColor(qc);
	}
      else if (*s == QString("Backgroundcolor"))
	{
	  QColor qc;
	  qc.setRgb(list.next()->toUInt());
	  setPaletteBackgroundColor(qc);
	}
      else if (*s == QString("Color"))
	{
	  // Backwards compatibility for button background color
	  QString t = *(list.next());
	  int i = t.find(QString(","));
	  int r = t.left(i).toInt();
	  int j = t.find(QString(","), i + 1);
	  int g = t.mid(i+1, j-i-1).toInt();
	  int b = t.mid(j+1).toInt();
	  QColor qc(r, g, b);
	  setPaletteBackgroundColor(qc);
	}
      else if (*s == QString("Pixmap"))
	{
	  QString t;
	  t = *(list.next());
	  
	  QPixmap pm(t);
	  if (pm.isNull() == false)
	    {
	      setIconText(t);
	      setPaletteBackgroundPixmap(pm);
	    }
	}
      else if (*s == QString("Font"))
	{
	  QFont f = font();
	  QString q = *(list.next());
	  f.fromString(q);
	  setFont(f);
	}
      else if (*s == QString("Function"))
	{
	  attachFunction(list.next()->toInt());
	}
      else if (*s == QString("BindKey"))
	{
	  assert(m_keyBind);
	  QString t = *(list.next());
	  m_keyBind->setKey(t.toInt());
	}
      else if (*s == QString("BindMod"))
	{
	  assert(m_keyBind);
	  QString t = *(list.next());
	  m_keyBind->setMod(t.toInt());
	}
      else if (*s == QString("BindPress"))
	{
	  assert(m_keyBind);
	  QString t = *(list.next());
	  m_keyBind->setPressAction((KeyBind::PressAction) t.toInt());
	}
      else if (*s == QString("BindRelease"))
	{
	  assert(m_keyBind);
	  QString t = *(list.next());
	  m_keyBind->setReleaseAction((KeyBind::ReleaseAction) t.toInt());
	}
      else
	{
	  // Unknown keyword, ignore
	  *list.next();
	}
    }

  setGeometry(rect);
}
Exemplo n.º 17
0
BackupDlg::BackupDlg( const QString & archiveName, const QString & workingDir, const QStringList& files, bool oneFilesystem, bool incremental,
                      const QString & snapshot, bool removeSnapshot, int archiveSize, Tape* tape,
                      QWidget* parent, const char* name )
        : QDialog( parent, name, TRUE ),
          _proc( NULL ),
          _tarParser( NULL ),
          _archiveName( archiveName ),
          _workingDir( workingDir ),
          _files(files),
          _oneFilesystem( oneFilesystem ),
          _incremental( incremental ),
          _snapshot( snapshot ),
          _removeSnapshot( removeSnapshot ),
          _archiveSize( archiveSize ),
          _tape( tape ),
          _totalKBytes( 0.0 ),
          _totalRecords( 0 ),
          _startTime( 0 ),
          _archive( NULL ),
          _aborted( FALSE ),
          _numFiles( 0 ),
          _fileSize( -1 ),
          _fileMTime( -1 ),
          _fileStartRecord( -1 )
{
    // Copy the list of files to archive.

    setCaption( i18n( "KDat: Backup" ) );
    setIconText( i18n( "KDat: Backup" ) );

    resize( 515, 300 );

    /* 2002-01-26 LEW: "Time remaining" was cut off in mid-"g" 
       so we'll provide that plus some space beyond it. */
    // const int labelWidth = 96;
    const int labelWidth = 110;

    QFrame* f1 = new QFrame( this );
    f1->setFrameStyle( QFrame::Panel | QFrame::Sunken );

    QFrame* f2 = new QFrame( this );
    f2->setFrameStyle( QFrame::Panel | QFrame::Sunken );

    QLabel* lbl1 = new QLabel( i18n( "Elapsed time:" ), f1 );
    lbl1->setFixedSize( labelWidth, lbl1->sizeHint().height() );

    _elapsedTime = new QLabel( i18n( "00:00:00" ), f1 );
    _elapsedTime->setFixedHeight( _elapsedTime->sizeHint().height() );

    QLabel* lbl2 = new QLabel( i18n( "Time remaining:" ), f2 );
    lbl2->setFixedSize( labelWidth, lbl2->sizeHint().height() );

    _timeRemaining = new QLabel( i18n( "00:00:00" ), f2 );
    _timeRemaining->setFixedHeight( _timeRemaining->sizeHint().height() );

    QLabel* lbl3 = new QLabel( i18n( "Total KB:" ), f1 );
    lbl3->setFixedSize( labelWidth, lbl3->sizeHint().height() );

    QLabel* totalKbytes = new QLabel( Util::kbytesToString( archiveSize ), f1 );
    totalKbytes->setFixedHeight( totalKbytes->sizeHint().height() );

    QLabel* lbl4 = new QLabel( i18n( "KB written:" ), f2 );
    lbl4->setFixedSize( labelWidth, lbl4->sizeHint().height() );

    _kbytesWritten = new QLabel( i18n( "0KB" ), f2 );
    _kbytesWritten->setFixedHeight( _kbytesWritten->sizeHint().height() );

    QLabel* lbl5 = new QLabel( i18n( "Transfer rate:" ), f1 );
    lbl5->setFixedSize( labelWidth, lbl5->sizeHint().height() );

    _transferRate = new QLabel( i18n( "0KB/min" ), f1 );
    _transferRate->setFixedHeight( _transferRate->sizeHint().height() );

    QLabel* lbl6 = new QLabel( i18n( "Files:" ), f2 );
    lbl6->setFixedSize( labelWidth, lbl6->sizeHint().height() );

    _fileCount = new QLabel( i18n( "0" ), f2 );
    _fileCount->setFixedHeight( _fileCount->sizeHint().height() );

    _log = new LoggerWidget( i18n( "Backup log:" ), this );

    _ok = new KPushButton( KStdGuiItem::ok(), this );
    _ok->setFixedSize( 80, _ok->sizeHint().height() );
    connect( _ok, SIGNAL( clicked() ), this, SLOT( slotOK() ) );
    _ok->setEnabled( FALSE );

    _save = new QPushButton( i18n( "Save Log..." ), this );
    _save->setFixedSize( 80, _save->sizeHint().height() );
    connect( _save, SIGNAL( clicked() ), _log, SLOT( save() ) );
    _save->setEnabled( FALSE );

    _abort = new KPushButton( KStdGuiItem::cancel(), this );
    _abort->setFixedSize( 80, _abort->sizeHint().height() );
    connect( _abort, SIGNAL( clicked() ), this, SLOT( slotAbort() ) );

    QVBoxLayout* l1 = new QVBoxLayout( this, 8, 4 );

    QHBoxLayout* l1_1 = new QHBoxLayout();
    l1->addLayout( l1_1 );
    l1_1->addStrut( 3 * lbl1->height() + 16 );
    l1_1->addWidget( f1 );
    l1_1->addWidget( f2 );

    QVBoxLayout* l1_1_1 = new QVBoxLayout( f1, 4, 4 );

    QHBoxLayout* l1_1_1_1 = new QHBoxLayout();
    l1_1_1->addLayout( l1_1_1_1 );
    l1_1_1_1->addWidget( lbl1 );
    l1_1_1_1->addWidget( _elapsedTime, 1 );

    QHBoxLayout* l1_1_1_2 = new QHBoxLayout();
    l1_1_1->addLayout( l1_1_1_2 );
    l1_1_1_2->addWidget( lbl3 );
    l1_1_1_2->addWidget( totalKbytes, 1 );

    QHBoxLayout* l1_1_1_3 = new QHBoxLayout();
    l1_1_1->addLayout( l1_1_1_3 );
    l1_1_1_3->addWidget( lbl5 );
    l1_1_1_3->addWidget( _transferRate, 1 );

    QVBoxLayout* l1_1_2 = new QVBoxLayout( f2, 4, 4 );

    QHBoxLayout* l1_1_2_1 = new QHBoxLayout();
    l1_1_2->addLayout( l1_1_2_1 );
    l1_1_2_1->addWidget( lbl2 );
    l1_1_2_1->addWidget( _timeRemaining, 1 );

    QHBoxLayout* l1_1_2_2 = new QHBoxLayout();
    l1_1_2->addLayout( l1_1_2_2 );
    l1_1_2_2->addWidget( lbl4 );
    l1_1_2_2->addWidget( _kbytesWritten, 1 );

    QHBoxLayout* l1_1_2_3 = new QHBoxLayout();
    l1_1_2->addLayout( l1_1_2_3 );
    l1_1_2_3->addWidget( lbl6 );
    l1_1_2_3->addWidget( _fileCount, 1 );

    l1->addWidget( _log, 1 );

    QHBoxLayout* l1_2 = new QHBoxLayout();
    l1->addLayout( l1_2 );
    l1_2->addStretch( 1 );
    l1_2->addWidget( _ok );
    l1_2->addWidget( _save );
    l1_2->addWidget( _abort );
}
Exemplo n.º 18
0
int QAction::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 15)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 15;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = isCheckable(); break;
        case 1: *reinterpret_cast< bool*>(_v) = isChecked(); break;
        case 2: *reinterpret_cast< bool*>(_v) = isEnabled(); break;
        case 3: *reinterpret_cast< QIcon*>(_v) = icon(); break;
        case 4: *reinterpret_cast< QString*>(_v) = text(); break;
        case 5: *reinterpret_cast< QString*>(_v) = iconText(); break;
        case 6: *reinterpret_cast< QString*>(_v) = toolTip(); break;
        case 7: *reinterpret_cast< QString*>(_v) = statusTip(); break;
        case 8: *reinterpret_cast< QString*>(_v) = whatsThis(); break;
        case 9: *reinterpret_cast< QFont*>(_v) = font(); break;
        case 10: *reinterpret_cast< QKeySequence*>(_v) = shortcut(); break;
        case 11: *reinterpret_cast< Qt::ShortcutContext*>(_v) = shortcutContext(); break;
        case 12: *reinterpret_cast< bool*>(_v) = autoRepeat(); break;
        case 13: *reinterpret_cast< bool*>(_v) = isVisible(); break;
        case 14: *reinterpret_cast< MenuRole*>(_v) = menuRole(); break;
        case 15: *reinterpret_cast< SoftKeyRole*>(_v) = softKeyRole(); break;
        case 16: *reinterpret_cast< bool*>(_v) = isIconVisibleInMenu(); break;
        case 17: *reinterpret_cast< Priority*>(_v) = priority(); break;
        }
        _id -= 18;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setCheckable(*reinterpret_cast< bool*>(_v)); break;
        case 1: setChecked(*reinterpret_cast< bool*>(_v)); break;
        case 2: setEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 3: setIcon(*reinterpret_cast< QIcon*>(_v)); break;
        case 4: setText(*reinterpret_cast< QString*>(_v)); break;
        case 5: setIconText(*reinterpret_cast< QString*>(_v)); break;
        case 6: setToolTip(*reinterpret_cast< QString*>(_v)); break;
        case 7: setStatusTip(*reinterpret_cast< QString*>(_v)); break;
        case 8: setWhatsThis(*reinterpret_cast< QString*>(_v)); break;
        case 9: setFont(*reinterpret_cast< QFont*>(_v)); break;
        case 10: setShortcut(*reinterpret_cast< QKeySequence*>(_v)); break;
        case 11: setShortcutContext(*reinterpret_cast< Qt::ShortcutContext*>(_v)); break;
        case 12: setAutoRepeat(*reinterpret_cast< bool*>(_v)); break;
        case 13: setVisible(*reinterpret_cast< bool*>(_v)); break;
        case 14: setMenuRole(*reinterpret_cast< MenuRole*>(_v)); break;
        case 15: setSoftKeyRole(*reinterpret_cast< SoftKeyRole*>(_v)); break;
        case 16: setIconVisibleInMenu(*reinterpret_cast< bool*>(_v)); break;
        case 17: setPriority(*reinterpret_cast< Priority*>(_v)); break;
        }
        _id -= 18;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 18;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        bool *_b = reinterpret_cast<bool*>(_a[0]);
        switch (_id) {
        case 1: *_b = isCheckable(); break;
        }
        _id -= 18;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 18;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 18;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 18;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 18;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Exemplo n.º 19
0
TxqPlot3DWindow::TxqPlot3DWindow( char *thisLabel, WindowType myWindow )
    : QWidget( )
{

    // set thisWindow so that all class members may access
    thisWindow = myWindow;

    // Set the title
    setPalette( QPalette( Qt::lightGray ) );
    setCaption(thisLabel);
    setIconText(thisLabel);

    // Create top-level layout manager
    QHBoxLayout* hlayout = new QHBoxLayout( this, 20, 20, "hlayout");

    // Create a popup menu containing Close
    QPopupMenu *file = new QPopupMenu();
    file->setPalette( QPalette( Qt::lightGray ) );
    file->insertItem( "Close",  this, SLOT( close() ), CTRL+Key_Q );

    // Create a menu bar
    QMenuBar *m = new QMenuBar( this );
    m->setSeparator( QMenuBar::InWindowsStyle );
    m->insertItem("&File", file );
    hlayout->setMenuBar( m );

    // Create a layout manager for the sliders
    QVBoxLayout* vlayout = new QVBoxLayout( 20, "vlayout");
    hlayout->addLayout( vlayout );

    // Create a nice frame tp put around the openGL widget
    QFrame* f = new QFrame( this, "frame" );
    f->setFrameStyle( QFrame::Sunken | QFrame::Panel );
    f->setLineWidth( 2 );
    hlayout->addWidget( f, 1 );

    // Create a layout manager for the openGL widget
    QHBoxLayout* flayout = new QHBoxLayout( f, 2, 2, "flayout");

    // Create an openGL widget
    plot3D = new GLPlot3D( f, "glbox");
    plot3D->setData(thisLabel, myWindow);
    plot3D->setMinimumSize( 50, 50 );
    flayout->addWidget( plot3D, 1 );
    flayout->activate();

    // Create the three sliders; one for each rotation axis
    QSlider* x = new QSlider ( 0, 360, 60, 0, QSlider::Vertical, this, "xsl" );
    x->setTickmarks( QSlider::Left );
    x->setMinimumSize( x->sizeHint() );
    vlayout->addWidget( x );
    QObject::connect( x, SIGNAL(valueChanged(int)),plot3D,SLOT(setXRotation(int)) );

    QSlider* y = new QSlider ( 0, 360, 60, 0, QSlider::Vertical, this, "ysl" );
    y->setTickmarks( QSlider::Left );
    y->setMinimumSize( y->sizeHint() );
    vlayout->addWidget( y );
    QObject::connect( y, SIGNAL(valueChanged(int)),plot3D,SLOT(setYRotation(int)) );

    QSlider* z = new QSlider ( 0, 360, 60, 0, QSlider::Vertical, this, "zsl" );
    z->setTickmarks( QSlider::Left );
    z->setMinimumSize( z->sizeHint() );
    vlayout->addWidget( z );
    QObject::connect( z, SIGNAL(valueChanged(int)),plot3D,SLOT(setZRotation(int)) );

    // create the slider for the eye translation
    QSlider* t = new QSlider ( -15, -5, 1, -15, QSlider::Vertical, this, "tsl" );
    t->setTickmarks( QSlider::Left );
    t->setMinimumSize( x->sizeHint() );
    vlayout->addWidget( t );
    QObject::connect( t, SIGNAL(valueChanged(int)),plot3D,SLOT(setTranslation(int)) );

    // Start the geometry management
    hlayout->activate();
}
Exemplo n.º 20
0
DiagnosticList::DiagnosticList(QWidget *parent, const char *nm , WFlags f = WType_TopLevel) :
#else
DiagnosticList::DiagnosticList(QWidget *parent, const char *nm ) :
#endif
    QFrame(parent, nm) 
{
}
DiagnosticList::DiagnosticList(MainButtons *ml) :
    QFrame() 
{
  btns = ml;
  diagFlag = FALSE;

  setPalette( QPalette( Qt::lightGray ) );
  setCaption("Diagnostics");
  setIconText("Diagnostics");
  // setGeometry(3, 350, 190, 250);
  setGeometry(3, 278, 190, 250);

  topLayout = new QVBoxLayout( this, 5 );
  CHECK_PTR( topLayout );

  menuBar = new QMenuBar(this);
  CHECK_PTR( menuBar );

  file = new QPopupMenu();
  CHECK_PTR( file );
  file->setPalette( QPalette( Qt::lightGray ) );

  file->insertItem( "&Close", this, SLOT( close() ) );

  // Put the submenus in the main menu
  menuBar->insertItem( "&File", file );

  // Put the menuBar on the layout
  topLayout->setMenuBar( menuBar );


  // Add a second layout to hold added buttons
  // Activate the layout
  layout = new QVBoxLayout();
  CHECK_PTR( layout );

  topLayout->addLayout( layout );

  // Add a third layout for the open buttons
  // activate
  hozlayout = new QHBoxLayout();
  CHECK_PTR( hozlayout );
  topLayout->addLayout( hozlayout );

}

/*!
  This method adds the QWidget \a w to the list of child widgets
managed by the DiagnosticList.  The arguments \a s and \a a are passed
onto the \link QBoxLayout addWidget \endlink method of the layout member.
*/
void DiagnosticList::addWidget(QWidget *w, int stretch, int align )
{
  // Put the given widget in the row/column area
     layout->addWidget( w, stretch, align );
}