[Kde-perl] A matter of QiconViewItem clicking...
Gary Greene
greeneg at phoenuxos.com
Fri Sep 23 02:27:36 CEST 2005
I'm trying to get the item that was clicked from a QIconView so I can extract
the text from it to allow the installer I'm writing to know which drive to
install PhoeNUX OS on. The drivePopulate sub looks like this:
sub drivePopulate {
$MainWidget::driveView->clear();
my $drvIcon = &Pixmap( "/usr/share/pixmaps/installer/hdd.png" );
our @ideHarddisks = Detect::detectEide();
our @scsiHarddisks = Detect::detectScsi();
our %driveInfo = %{ Detect::detectStrgSize() };
our @drives = [];
for ( my $i = 0; $i < @ideHarddisks; $i++ ) {
my $temp = $ideHarddisks[ $i ];
chomp( $temp );
my $driveName = $temp;
$temp = substr( $temp, 6 );
my $roundedSize = sprintf( "%.2f", $driveInfo{ $temp } );
# we can asssume that having drives less than 3 Gig will not install
if ( ! $roundedSize lt 3 ) {
$drives[ $i ] = Qt::IconViewItem( $MainWidget::driveView,
&tr( "$driveName\n$roundedSize GB" ),
$drvIcon );
$MainWidget::driveView->connect( $MainWidget::driveView,
SIGNAL "clicked(QIconViewItem*)",
this,
SLOT
"driveSelected(QIconViewItem*)" );
}
}
}
The slot that gets connected after the driveView is clicked on the item looks
like this so far:
sub driveSelected {
&enableDriveActionGrp();
}
what I need as well is that slot to export the $drive[$i] so I can pass that
info to the takeOverDrive sub. Any suggestions are welcome.
--
Gary L. Greene, Jr.
Sent from uriel.tolharadys.net
20:19:31 up 3 days, 12:47, 6 users, load average: 2.20, 2.32, 2.11
============================================================
Developer and Project Lead for PhoeNUX OS.
check out http://www.phoenuxos.com/ for more info.
EMAIL : greeneg at phoenuxos.com
============================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-perl/attachments/20050923/1f292d4f/attachment.pgp
More information about the Kde-perl
mailing list