summaryrefslogtreecommitdiff
authorbipolar <bipolar>2002-03-08 00:11:17 (UTC)
committer bipolar <bipolar>2002-03-08 00:11:17 (UTC)
commit50f8f55346f369787063f42c571d2dc832eb58aa (patch) (side-by-side diff)
tree88a6e75395e9101ae8826d1aeb181dea459fcef5
parent69d2df15c2dbd280f6ed99d5eecf487345f1de08 (diff)
downloadopie-50f8f55346f369787063f42c571d2dc832eb58aa.zip
opie-50f8f55346f369787063f42c571d2dc832eb58aa.tar.gz
opie-50f8f55346f369787063f42c571d2dc832eb58aa.tar.bz2
ljp: added control file and changed default to 1
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/screenshotapplet/opie-screenshotapplet.control9
-rw-r--r--core/applets/screenshotapplet/screenshot.cpp1
2 files changed, 10 insertions, 0 deletions
diff --git a/core/applets/screenshotapplet/opie-screenshotapplet.control b/core/applets/screenshotapplet/opie-screenshotapplet.control
new file mode 100644
index 0000000..4a06a5a
--- a/dev/null
+++ b/core/applets/screenshotapplet/opie-screenshotapplet.control
@@ -0,0 +1,9 @@
+Files: plugins/applets/libscreenshotapplet.so*
+Priority: optional
+Section: opie/system
+Maintainer: L. J. Potter <ljp@llornkcor.com>
+Architecture: arm
+Version: $QPE_VERSION-$SUB_VERSION.1
+Depends: opie-base ($QPE_VERSION)
+Description: Screenshot Applet
+ A screenshot taskbar applet for the Opie environment
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp
index 20e8554..16d5588 100644
--- a/core/applets/screenshotapplet/screenshot.cpp
+++ b/core/applets/screenshotapplet/screenshot.cpp
@@ -56,96 +56,97 @@ static char * snapshot_xpm[] = {
" ... ",
" ..+++..@#. ",
" .$++++++.#. ",
" .%$$++++++. ",
" .&%%$$++@***. ",
" .$&$++$=**@+. ",
" .+$$+++@*$%%. ",
" .+++++%+++%%. ",
" .%%++++..+%%. ",
" ..%%+++++%%. ",
" ..%%+++%%. ",
" ..%%+%%. ",
" ..%%.. ",
" .. ",
" "};
ScreenshotControl::ScreenshotControl( QWidget *parent, const char *name )
: QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup )
{
setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
// qDebug("screenshot control");
QVBoxLayout *vbox = new QVBoxLayout( this );
// qDebug("new layout");
delaySpin = new QSpinBox( 0,60,1, this, "Spinner" );
// qDebug("new spinbox");
delaySpin->setFocusPolicy( QWidget::NoFocus );
grabItButton= new QPushButton( this, "GrabButton" );
// qDebug("new pushbutton");
grabItButton ->setFocusPolicy( QWidget::TabFocus );
grabItButton->setText("Snaphot");
vbox->setMargin( 6 );
vbox->setSpacing( 3 );
vbox->addWidget( delaySpin);
vbox->setMargin( 6 );
vbox->setSpacing( 3 );
vbox->addWidget( grabItButton);
setFixedHeight( 100 );
setFixedWidth( sizeHint().width() );
setFocusPolicy(QWidget::NoFocus);
grabTimer= new QTimer(this,"grab timer");
// qDebug("newTimer");
connect( grabTimer, SIGNAL( timeout() ), this, SLOT( grabTimerDone() ) );
// Config cfg("Snapshot");
// cfg.setGroup("General");
+ delaySpin->setValue(1);
// delaySpin->setValue(cfg.readNumEntry("delay",0));
connect( grabItButton, SIGNAL(released()), SLOT(slotGrab()) );
}
void ScreenshotControl::slotGrab()
{
// qDebug("SlotGrab");
hide();
if ( delaySpin->value() ) {
grabTimer->start( delaySpin->value() * 1000, true );
} else {
show();
}
}
void ScreenshotControl::grabTimerDone()
{
performGrab();
}
void ScreenshotControl::savePixmap()
{
DocLnk lnk;
QString fileName = "sc_"+TimeString::dateString( QDateTime::currentDateTime(),false,true);
fileName.replace(QRegExp("'"),""); fileName.replace(QRegExp(" "),"_"); fileName.replace(QRegExp(":"),"."); fileName.replace(QRegExp(","),"");
QString dirName = QDir::homeDirPath()+"/Documents/image/png/";
if( !QDir( dirName).exists() ) {
qDebug("making dir "+dirName);
QString msg = "mkdir -p "+dirName;
system(msg.latin1());
}
fileName=dirName+fileName+".png";
lnk.setFile(fileName); //sets File property
snapshot.save( fileName,"PNG");
qDebug("saving file "+fileName);
QFileInfo fi( fileName);
lnk.setName( fi.fileName()); //sets file name
if(!lnk.writeLink())
qDebug("Writing doclink did not work");
QPEApplication::beep();
}
void ScreenshotControl::performGrab()