Logo Search packages:      
Sourcecode: icemc version File versions  Download package

IceMainWidget::IceMainWidget ( QWidget *  parent = 0,
const char *  name = 0,
WFlags  f = 0 
)

IceMC - a menu editor for IceWM Copyright (c) 2000 Georg Mittendorfer

Definition at line 39 of file IceMainWidget.cpp.

References newExec(), and newIcon().

                                                                          : QWidget (parent,name,f)
{
  // constructor: QWidget ( QWidget * parent=0, const char * name=0, WFlags f=0 )

  homeDir = std::getenv("HOME");
  setDefaultPaths();

  /* 3 textediting fields + labels */
  applEdit = new QLineEdit(this);
  iconEdit = new QLineEdit(this);
  execEdit = new QLineEdit(this);
  applEdit->setMinimumSize(180,25);
  iconEdit->setMinimumSize(180,25);
  execEdit->setMinimumSize(180,25);
  QLabel* applLabel = new QLabel(applEdit,"&Name",this);
  QLabel* iconLabel = new QLabel(iconEdit,"&Icon",this);
  QLabel* execLabel = new QLabel(execEdit,"&Exec",this);

  QPushButton* execPb = new QPushButton(this);
  QPushButton* iconPb = new QPushButton(this);
  execPb->setPixmap(fileopen);
  execPb->setMinimumSize(25,25);
  execPb->setMaximumWidth(25); 
  iconPb->setPixmap(fileopen);
  iconPb->setMinimumSize(25,25);
  execPb->setMaximumWidth(25);

  infoCombo = new QComboBox(false,this);
  infoCombo->setMinimumSize(85,25);
  infoCombo->setMaximumHeight(25);
  infoCombo->insertItem("menu");
  infoCombo->insertItem("prog");
  infoCombo->insertItem("separator");
  infoCombo->insertItem("restart");
  infoCombo->insertItem("menufile");
  infoCombo->insertItem("menuprog");

  mainview = new IceListView(this);
  mainview->addColumn("Application Name",120);
  mainview->addColumn("Icon",120);
  mainview->addColumn("Executable",250);
  mainview->setColumnWidthMode(0,IceListView::Maximum);
  mainview->setColumnWidthMode(2,IceListView::Maximum);
  mainview->setSorting(-1);
  mainview->setRootIsDecorated(true);
  mainview->setAllColumnsShowFocus(true);
  mainview->setSelectionMode(IceListView::Single);
  mainview->setMouseTracking(false);
  
  connect(mainview, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(displayListItem(QListViewItem*)));
  connect(applEdit, SIGNAL(textChanged(const QString&)), this, SLOT(updateListAppl(const QString&)));
  connect(iconEdit, SIGNAL(textChanged(const QString&)), this, SLOT(updateListIcon(const QString&)));
  connect(execEdit, SIGNAL(textChanged(const QString&)), this, SLOT(updateListExec(const QString&)));
  connect(infoCombo, SIGNAL(activated(const QString&)), this, SLOT(updateInfoStr(const QString&)));
  connect(execPb, SIGNAL(clicked()), this, SLOT(newExec()));
  connect(iconPb, SIGNAL(clicked()), this, SLOT(newIcon()));

  /* layout */
  QVBoxLayout* mainLayout = new QVBoxLayout(this,2);
  QGridLayout* editLayout = new QGridLayout(5,6,10); // 5 rows 6 coloumns 10pix spacing

  editLayout->addWidget(applLabel,2,1,Qt::AlignRight);
  editLayout->addWidget(iconLabel,3,1,Qt::AlignRight);
  editLayout->addWidget(execLabel,4,1,Qt::AlignRight);
  editLayout->addWidget(applEdit,2,2);
  editLayout->addWidget(iconEdit,3,2);
  editLayout->addWidget(execEdit,4,2);
  editLayout->addMultiCellWidget(infoCombo,2,2,4,5);
  editLayout->addWidget(iconPb,3,4,Qt::AlignLeft);
  editLayout->addWidget(execPb,4,4,Qt::AlignLeft);
  editLayout->addColSpacing(3,10);
  editLayout->addColSpacing(6,20);
  editLayout->addRowSpacing(1,8);
  editLayout->addRowSpacing(5,2);

  mainLayout->addWidget(mainview);
  mainLayout->addLayout(editLayout,0);
  
  //  QPalette temp = new QPalette
  p = new QPainter(mainview); // or 'this'?
  cg = &((mainview->palette()).active()); // maybe this doesn't work => check
}


Generated by  Doxygen 1.6.0   Back to index