DiskInfoWidget::DiskInfoWidget(QWidget *parent, const char *name, ConfigDialogImpl *config, bool init) : QWidget(parent, name) { _config = config; connect(&mDiskList , SIGNAL(readDFDone() ), this, SLOT (updateDFDone()) ); connect(&mDiskList , SIGNAL(criticallyFull(DiskEntry*)), this, SLOT (criticallyFull(DiskEntry*)) ); mTabProp.resize(8); mTabProp[0] = new CTabEntry( "Icon", i18n("Icon"), false, 0); mTabProp[1] = new CTabEntry( "Device", i18n("Device"), false, 0); mTabProp[2] = new CTabEntry( "Type", i18n("Type"), false, 0); mTabProp[3] = new CTabEntry( "Size", i18n("Size"), false, 0); mTabProp[4] = new CTabEntry( "MountPoint", i18n("Mount Point"), true, 90 ); mTabProp[5] = new CTabEntry( "Free", i18n("Free"), false, 0); // xgettext:no-c-format mTabProp[6] = new CTabEntry( "Full%", i18n("Full %"), false, 0); mTabProp[7] = new CTabEntry( "UsageBar", i18n("Usage"), true, 100); GUI = !init; if( GUI ) { QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 0 ); mList = new CListView( this, "list" ); topLayout->addWidget( mList ); mList->setAllColumnsShowFocus( true ); mList->setFrameStyle( QFrame::WinPanel + QFrame::Sunken ); mList->setShowSortIndicator(true); QPalette pal; QColorGroup cg; cg.setColor( QColorGroup::Button, BACKGROUND ); cg.setColor( QColorGroup::ButtonText, TEXTCOLOR ); cg.setColor( QColorGroup::Base, BACKGROUND ); pal.setActive( cg ); cg.setColor( QColorGroup::Button, BACKGROUND ); cg.setColor( QColorGroup::ButtonText, TEXTCOLOR ); cg.setColor( QColorGroup::Base, BACKGROUND ); pal.setInactive( cg ); cg.setColor( QColorGroup::Button, BACKGROUND ); cg.setColor( QColorGroup::ButtonText, TEXTCOLOR ); cg.setColor( QColorGroup::Base, BACKGROUND ); pal.setDisabled( cg ); mList->setPalette( pal ); // connect( mList, // SIGNAL( pressed( QListViewItem *, const QPoint &, int )), // this, SLOT( rightButtonPressed( QListViewItem *, const QPoint &, int ))); // connect( mList, // SIGNAL( clicked( QListViewItem *, const QPoint &, int )), // this, SLOT( rightButtonClicked( QListViewItem *, const QPoint &, int ))); connect( mList->header(), SIGNAL(sizeChange(int, int, int)), this, SLOT(columnSizeChanged(int, int, int)) ); makeColumns(); } updateDF(); setUpdateFrequency(60); }
KDFWidget::KDFWidget( TQWidget *parent, const char *name, bool init ) : TQWidget(parent, name), mOptionDialog(0), mPopup(0), mTimer(0) { connect(&mDiskList , TQT_SIGNAL(readDFDone() ), this, TQT_SLOT (updateDFDone()) ); connect(&mDiskList , TQT_SIGNAL(criticallyFull(DiskEntry*)), this, TQT_SLOT (criticallyFull(DiskEntry*)) ); mTabProp.resize(8); mTabProp[0] = new CTabEntry( "Icon", i18n("Icon"), true, 32); mTabProp[1] = new CTabEntry( "Device", i18n("Device"), true, 80); mTabProp[2] = new CTabEntry( "Type", i18n("Type"), true, 50); mTabProp[3] = new CTabEntry( "Size", i18n("Size"), true, 72); mTabProp[4] = new CTabEntry( "MountPoint", i18n("Mount Point"), true, 90 ); mTabProp[5] = new CTabEntry( "Free", i18n("Free"), true, 55); // xgettext:no-c-format mTabProp[6] = new CTabEntry( "Full%", i18n("Full %"), true, 70); mTabProp[7] = new CTabEntry( "UsageBar", i18n("Usage"), true, 100); GUI = !init; if( GUI ) { TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, 0 ); mList = new CListView( this, "list" ); topLayout->addWidget( mList ); mList->setAllColumnsShowFocus( true ); mList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken ); mList->setShowSortIndicator(true); connect( mList, TQT_SIGNAL( rightButtonPressed( TQListViewItem *, const TQPoint &, int )), this, TQT_SLOT( rightButtonPressed( TQListViewItem *, const TQPoint &, int ))); connect( mList, TQT_SIGNAL( rightButtonClicked( TQListViewItem *, const TQPoint &, int )), this, TQT_SLOT( rightButtonClicked( TQListViewItem *, const TQPoint &, int ))); connect( mList->header(), TQT_SIGNAL(sizeChange(int, int, int)), this, TQT_SLOT(columnSizeChanged(int, int, int)) ); makeColumns(); mIsTopLevel = TQString(parent->className()) == "KDFTopLevel" ? true : false; } loadSettings(); if( init == true ) { applySettings(); } }
KwikDisk::KwikDisk() : KSystemTray() , m_readingDF(FALSE) , m_dirty(TRUE) , m_menuVisible(FALSE) , m_inside(FALSE) , m_optionDialog(0) { kdDebug() << k_funcinfo << endl; setPixmap(KSystemTray::loadIcon("kdf")); show(); connect( &m_diskList, TQT_SIGNAL(readDFDone()), this, TQT_SLOT(updateDFDone()) ); connect( &m_diskList, TQT_SIGNAL(criticallyFull(DiskEntry*)), this, TQT_SLOT(criticallyFull(DiskEntry*)) ); connect( contextMenu(), TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(aboutToHide()) ); loadSettings(); updateDF(); }
MntConfigWidget::MntConfigWidget(TQWidget *parent, const char *name, bool init) : TQWidget(parent, name) { mInitializing = false; GUI = !init; if (GUI) { //tabList fillup waits until disklist.readDF() is done... mDiskList.readFSTAB(); mDiskList.readDF(); mInitializing = true; connect( &mDiskList,TQT_SIGNAL(readDFDone()),this,TQT_SLOT(readDFDone())); TQString text; TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint()); mList = new CListView( this, "list", 8 ); mList->setAllColumnsShowFocus( true ); mList->addColumn( i18n("Icon") ); mList->addColumn( i18n("Device") ); mList->addColumn( i18n("Mount Point") ); mList->addColumn( i18n("Mount Command") ); mList->addColumn( i18n("Unmount Command") ); mList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken ); connect( mList, TQT_SIGNAL(selectionChanged(TQListViewItem *)), this, TQT_SLOT(clicked(TQListViewItem *))); topLayout->addWidget( mList ); text = TQString("%1: %2 %3: %4"). arg(mList->header()->label(DEVCOL)). arg(i18n("None")). arg(mList->header()->label(MNTPNTCOL)). arg(i18n("None")); mGroupBox = new TQGroupBox( text, this ); TQ_CHECK_PTR(mGroupBox); topLayout->addWidget(mGroupBox); TQGridLayout *gl = new TQGridLayout(mGroupBox, 3, 4, KDialog::spacingHint()); if( gl == 0 ) { return; } gl->addRowSpacing( 0, fontMetrics().lineSpacing() ); mIconLineEdit = new TQLineEdit(mGroupBox); TQ_CHECK_PTR(mIconLineEdit); mIconLineEdit->setMinimumWidth( fontMetrics().maxWidth()*10 ); connect( mIconLineEdit, TQT_SIGNAL(textChanged(const TQString&)), this,TQT_SLOT(iconChanged(const TQString&))); connect( mIconLineEdit, TQT_SIGNAL(textChanged(const TQString&)), this,TQT_SLOT(slotChanged())); gl->addWidget( mIconLineEdit, 2, 0 ); mIconButton = new TDEIconButton(mGroupBox); mIconButton->setIconType(TDEIcon::Small, TDEIcon::Device); TQ_CHECK_PTR(mIconButton); mIconButton->setFixedWidth( mIconButton->sizeHint().height() ); connect(mIconButton,TQT_SIGNAL(iconChanged(TQString)),this,TQT_SLOT(iconChangedButton(TQString))); gl->addWidget( mIconButton, 2, 1 ); //Mount mMountButton = new TQPushButton( i18n("Get Mount Command"), mGroupBox ); TQ_CHECK_PTR(mMountButton); connect(mMountButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(selectMntFile())); gl->addWidget( mMountButton, 1, 2 ); mMountLineEdit = new TQLineEdit(mGroupBox); TQ_CHECK_PTR(mMountLineEdit); mMountLineEdit->setMinimumWidth( fontMetrics().maxWidth()*10 ); connect(mMountLineEdit,TQT_SIGNAL(textChanged(const TQString&)), this,TQT_SLOT(mntCmdChanged(const TQString&))); connect( mMountLineEdit, TQT_SIGNAL(textChanged(const TQString&)), this,TQT_SLOT(slotChanged())); gl->addWidget( mMountLineEdit, 1, 3 ); //Umount mUmountButton = new TQPushButton(i18n("Get Unmount Command"), mGroupBox ); TQ_CHECK_PTR( mUmountButton ); connect(mUmountButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(selectUmntFile())); gl->addWidget( mUmountButton, 2, 2 ); mUmountLineEdit=new TQLineEdit(mGroupBox); TQ_CHECK_PTR(mUmountLineEdit); mUmountLineEdit->setMinimumWidth( fontMetrics().maxWidth()*10 ); connect(mUmountLineEdit,TQT_SIGNAL(textChanged(const TQString&)), this,TQT_SLOT(umntCmdChanged(const TQString&))); connect( mUmountLineEdit, TQT_SIGNAL(textChanged(const TQString&)), this,TQT_SLOT(slotChanged())); gl->addWidget( mUmountLineEdit, 2, 3 ); } loadSettings(); if(init) { applySettings(); mDiskLookup.resize(0); } mGroupBox->setEnabled( false ); }