author | bipolar <bipolar> | 2002-03-08 00:11:17 (UTC) |
---|---|---|
committer | bipolar <bipolar> | 2002-03-08 00:11:17 (UTC) |
commit | 50f8f55346f369787063f42c571d2dc832eb58aa (patch) (unidiff) | |
tree | 88a6e75395e9101ae8826d1aeb181dea459fcef5 | |
parent | 69d2df15c2dbd280f6ed99d5eecf487345f1de08 (diff) | |
download | opie-50f8f55346f369787063f42c571d2dc832eb58aa.zip opie-50f8f55346f369787063f42c571d2dc832eb58aa.tar.gz opie-50f8f55346f369787063f42c571d2dc832eb58aa.tar.bz2 |
ljp: added control file and changed default to 1
-rw-r--r-- | core/applets/screenshotapplet/opie-screenshotapplet.control | 9 | ||||
-rw-r--r-- | core/applets/screenshotapplet/screenshot.cpp | 1 |
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 @@ | |||
1 | Files: plugins/applets/libscreenshotapplet.so* | ||
2 | Priority: optional | ||
3 | Section: opie/system | ||
4 | Maintainer: L. J. Potter <ljp@llornkcor.com> | ||
5 | Architecture: arm | ||
6 | Version: $QPE_VERSION-$SUB_VERSION.1 | ||
7 | Depends: opie-base ($QPE_VERSION) | ||
8 | Description: Screenshot Applet | ||
9 | 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 | |||
@@ -72,64 +72,65 @@ static char * snapshot_xpm[] = { | |||
72 | 72 | ||
73 | ScreenshotControl::ScreenshotControl( QWidget *parent, const char *name ) | 73 | ScreenshotControl::ScreenshotControl( QWidget *parent, const char *name ) |
74 | : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) | 74 | : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) |
75 | { | 75 | { |
76 | setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); | 76 | setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); |
77 | // qDebug("screenshot control"); | 77 | // qDebug("screenshot control"); |
78 | QVBoxLayout *vbox = new QVBoxLayout( this ); | 78 | QVBoxLayout *vbox = new QVBoxLayout( this ); |
79 | // qDebug("new layout"); | 79 | // qDebug("new layout"); |
80 | delaySpin = new QSpinBox( 0,60,1, this, "Spinner" ); | 80 | delaySpin = new QSpinBox( 0,60,1, this, "Spinner" ); |
81 | // qDebug("new spinbox"); | 81 | // qDebug("new spinbox"); |
82 | delaySpin->setFocusPolicy( QWidget::NoFocus ); | 82 | delaySpin->setFocusPolicy( QWidget::NoFocus ); |
83 | grabItButton= new QPushButton( this, "GrabButton" ); | 83 | grabItButton= new QPushButton( this, "GrabButton" ); |
84 | // qDebug("new pushbutton"); | 84 | // qDebug("new pushbutton"); |
85 | grabItButton ->setFocusPolicy( QWidget::TabFocus ); | 85 | grabItButton ->setFocusPolicy( QWidget::TabFocus ); |
86 | grabItButton->setText("Snaphot"); | 86 | grabItButton->setText("Snaphot"); |
87 | vbox->setMargin( 6 ); | 87 | vbox->setMargin( 6 ); |
88 | vbox->setSpacing( 3 ); | 88 | vbox->setSpacing( 3 ); |
89 | vbox->addWidget( delaySpin); | 89 | vbox->addWidget( delaySpin); |
90 | vbox->setMargin( 6 ); | 90 | vbox->setMargin( 6 ); |
91 | vbox->setSpacing( 3 ); | 91 | vbox->setSpacing( 3 ); |
92 | vbox->addWidget( grabItButton); | 92 | vbox->addWidget( grabItButton); |
93 | 93 | ||
94 | setFixedHeight( 100 ); | 94 | setFixedHeight( 100 ); |
95 | setFixedWidth( sizeHint().width() ); | 95 | setFixedWidth( sizeHint().width() ); |
96 | setFocusPolicy(QWidget::NoFocus); | 96 | setFocusPolicy(QWidget::NoFocus); |
97 | 97 | ||
98 | grabTimer= new QTimer(this,"grab timer"); | 98 | grabTimer= new QTimer(this,"grab timer"); |
99 | // qDebug("newTimer"); | 99 | // qDebug("newTimer"); |
100 | connect( grabTimer, SIGNAL( timeout() ), this, SLOT( grabTimerDone() ) ); | 100 | connect( grabTimer, SIGNAL( timeout() ), this, SLOT( grabTimerDone() ) ); |
101 | 101 | ||
102 | // Config cfg("Snapshot"); | 102 | // Config cfg("Snapshot"); |
103 | // cfg.setGroup("General"); | 103 | // cfg.setGroup("General"); |
104 | delaySpin->setValue(1); | ||
104 | // delaySpin->setValue(cfg.readNumEntry("delay",0)); | 105 | // delaySpin->setValue(cfg.readNumEntry("delay",0)); |
105 | connect( grabItButton, SIGNAL(released()), SLOT(slotGrab()) ); | 106 | connect( grabItButton, SIGNAL(released()), SLOT(slotGrab()) ); |
106 | 107 | ||
107 | } | 108 | } |
108 | 109 | ||
109 | void ScreenshotControl::slotGrab() | 110 | void ScreenshotControl::slotGrab() |
110 | { | 111 | { |
111 | // qDebug("SlotGrab"); | 112 | // qDebug("SlotGrab"); |
112 | hide(); | 113 | hide(); |
113 | if ( delaySpin->value() ) { | 114 | if ( delaySpin->value() ) { |
114 | grabTimer->start( delaySpin->value() * 1000, true ); | 115 | grabTimer->start( delaySpin->value() * 1000, true ); |
115 | } else { | 116 | } else { |
116 | show(); | 117 | show(); |
117 | } | 118 | } |
118 | } | 119 | } |
119 | 120 | ||
120 | 121 | ||
121 | void ScreenshotControl::grabTimerDone() | 122 | void ScreenshotControl::grabTimerDone() |
122 | { | 123 | { |
123 | performGrab(); | 124 | performGrab(); |
124 | } | 125 | } |
125 | 126 | ||
126 | void ScreenshotControl::savePixmap() | 127 | void ScreenshotControl::savePixmap() |
127 | { | 128 | { |
128 | DocLnk lnk; | 129 | DocLnk lnk; |
129 | QString fileName = "sc_"+TimeString::dateString( QDateTime::currentDateTime(),false,true); | 130 | QString fileName = "sc_"+TimeString::dateString( QDateTime::currentDateTime(),false,true); |
130 | fileName.replace(QRegExp("'"),""); fileName.replace(QRegExp(" "),"_"); fileName.replace(QRegExp(":"),"."); fileName.replace(QRegExp(","),""); | 131 | fileName.replace(QRegExp("'"),""); fileName.replace(QRegExp(" "),"_"); fileName.replace(QRegExp(":"),"."); fileName.replace(QRegExp(","),""); |
131 | 132 | ||
132 | QString dirName = QDir::homeDirPath()+"/Documents/image/png/"; | 133 | QString dirName = QDir::homeDirPath()+"/Documents/image/png/"; |
133 | if( !QDir( dirName).exists() ) { | 134 | if( !QDir( dirName).exists() ) { |
134 | qDebug("making dir "+dirName); | 135 | qDebug("making dir "+dirName); |
135 | QString msg = "mkdir -p "+dirName; | 136 | QString msg = "mkdir -p "+dirName; |