[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/utils/rsibreak/src
From: Tom Albers <toma () kde ! org>
Date: 2010-09-30 0:23:30
Message-ID: 20100930002330.965BDAC88E () svn ! kde ! org
[Download RAW message or body]
SVN commit 1181092 by toma:
Remove the screenshot, as the experts say this code path will fail in several \
circumstances. BUG=203654
M +5 -4 main.cpp
M +0 -2 org.rsibreak.rsiwidget.xml
M +1 -31 rsiwidget.cpp
M +0 -3 rsiwidget.h
--- trunk/extragear/utils/rsibreak/src/main.cpp #1181091:1181092
@@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <QDBusInterface>
+#include <kmessagebox.h>
#include <kuniqueapplication.h>
#include <kstartupinfo.h>
#include <kcmdlineargs.h>
@@ -45,9 +45,10 @@
int newInstance() {
static bool secondMe = false;
if ( secondMe ) {
- QDBusInterface dbus( "org.rsibreak.rsibreak", "/rsibreak",
- "org.rsibreak.rsiwidget" );
- dbus.call( "showWhereIAm" );
+ KMessageBox::information(0, i18n("RSIBreak is already running in "
+ "your system tray. If you can not "
+ "find it, it might be behind the "
+ "arrow."));
} else {
secondMe = true;
}
--- trunk/extragear/utils/rsibreak/src/org.rsibreak.rsiwidget.xml #1181091:1181092
@@ -1,8 +1,6 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" \
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> <node>
<interface name="org.rsibreak.rsiwidget">
- <method name="showWhereIAm">
- </method>
<method name="doBigBreak">
</method>
<method name="doTinyBreak">
--- trunk/extragear/utils/rsibreak/src/rsiwidget.cpp #1181091:1181092
@@ -144,10 +144,8 @@
void RSIObject::slotWelcome()
{
if ( KMessageBox::shouldBeShownContinue( "dont_show_welcome_again_for_001" ) ) {
- QString tempfile = takeScreenshotOfTrayIcon();
KMessageBox::information( 0, i18n( "<p>Welcome to RSIBreak</p>\n<p>"
- "In your tray you can now see \
RSIBreak:</p>\n" )
- + "<p><center><img source=\"" + tempfile + \
"\"></center></p>\n" + "In your tray you \
can now see RSIBreak.</p>\n" )
+ i18n( "<p>When you right-click on that you will \
see a menu, from which "
"you can go to the configuration for \
example.</p>\n<p>When you want to "
"know when the next break is, hover over \
the icon.</p>\n<p>Use RSIBreak " @@ -155,34 +153,6 @@
}
}
-void RSIObject::showWhereIAm()
-{
- QString tempfile = takeScreenshotOfTrayIcon();
- KMessageBox::information( 0,
- i18n( "<p>RSIBreak is already running</p><p>It is \
located here:</p>" )
- + "<p><center><img source=\"" + tempfile + \
"\"></center></p><p>",
- i18n( "Already Running" ) );
-}
-
-QString RSIObject::takeScreenshotOfTrayIcon()
-{
- // Process the events else the icon will not be there and the screenie will \
fail!
- kapp->processEvents();
-
- //TODO: find the tray window.
- QPixmap screenshot = takeScreenshot( m_tray );
-
- QString filename;
- KTemporaryFile* tmpfile = new KTemporaryFile;
- tmpfile->setAutoRemove( false );
- if ( tmpfile->open() ) {
- filename = tmpfile->fileName();
- screenshot.save( tmpfile, "png" );
- tmpfile->close();
- }
- return filename;
-}
-
void RSIObject::minimize()
{
m_effect->deactivate();
--- trunk/extragear/utils/rsibreak/src/rsiwidget.h #1181091:1181092
@@ -80,7 +80,6 @@
void setIcon( int );
private:
- QString takeScreenshotOfTrayIcon();
void findImagesInFolder( const QString& folder );
void loadImage();
void startTimer( bool idle );
@@ -107,8 +106,6 @@
/* Available through D-Bus */
public Q_SLOTS:
- void showWhereIAm();
-
void doBigBreak() {
timer()->slotRequestBigBreak();
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic