Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Only in kgmailnotifier-0.5.1/src/: CMakeLists.txt.user
- diff -crB kgmailnotifier-0.5.1-orig/kgmailnotifier-0.5.1/src//kgmailnotifier.cpp kgmailnotifier-0.5.1/src//kgmailnotifier.cpp
- *** kgmailnotifier-0.5.1-orig/kgmailnotifier-0.5.1/src//kgmailnotifier.cpp Thu Dec 3 21:32:29 2009
- --- kgmailnotifier-0.5.1/src//kgmailnotifier.cpp Sun Jun 19 18:09:42 2011
- ***************
- *** 35,40 ****
- --- 35,43 ----
- #include <QMenu>
- #include <QTextStream>
- + #include <signal.h>
- + #include <unistd.h>
- +
- static QTextStream cout(stdout, QIODevice::WriteOnly);
- #include <cstdlib>
- ***************
- *** 48,53 ****
- --- 51,58 ----
- : KUniqueApplication(),
- m_configurationDialog(0)
- {
- + signal(SIGSEGV, SIG_IGN);
- +
- cout << endl;
- cout << "Welcome to KGmailNotifier." << endl;
- cout << "(C) 2007-2009 Marcel Hasler (mahasler@gmail.com)" << endl << endl;
- ***************
- *** 86,92 ****
- m_actionCollection = new KActionCollection(this);
- m_trayIcon = new TrayIcon(0);
- ! m_trayIcon->setIcon(m_redIcon, false, 0);
- // Add tray icon menu items
- KAction *action;
- --- 91,97 ----
- m_actionCollection = new KActionCollection(this);
- m_trayIcon = new TrayIcon(0);
- ! m_trayIcon->setIcon(m_redIcon, false, 0, false);
- // Add tray icon menu items
- KAction *action;
- ***************
- *** 172,177 ****
- --- 177,184 ----
- if (m_ledHandler)
- delete m_ledHandler;
- +
- + //exit();
- }
- ***************
- *** 223,229 ****
- if (msgCount > 0)
- {
- ! m_trayIcon->setIcon(m_blueIcon, Configuration::config()->numberOnSystray(), msgCount);
- m_trayIcon->setToolTip(i18np("1 new message", "%1 new messages", msgCount));
- m_popupWindow->setMessageCount(msgCount);
- m_popupWindow->setSender(m_account->lastSender());
- --- 230,236 ----
- if (msgCount > 0)
- {
- ! m_trayIcon->setIcon(m_blueIcon, Configuration::config()->numberOnSystray(), msgCount, false);
- m_trayIcon->setToolTip(i18np("1 new message", "%1 new messages", msgCount));
- m_popupWindow->setMessageCount(msgCount);
- m_popupWindow->setSender(m_account->lastSender());
- ***************
- *** 246,252 ****
- else
- {
- ! m_trayIcon->setIcon(m_redIcon, false, msgCount);
- m_trayIcon->setToolTip(i18n("No new messages"));
- m_popupWindow->setMessageCount(0);
- --- 253,259 ----
- else
- {
- ! m_trayIcon->setIcon(m_redIcon, false, msgCount, false);
- m_trayIcon->setToolTip(i18n("No new messages"));
- m_popupWindow->setMessageCount(0);
- ***************
- *** 269,275 ****
- else
- errorMessage = i18n("Connection failed!");
- ! m_trayIcon->setIcon(m_alertIcon, false, 0);
- m_trayIcon->setToolTip(errorMessage);
- m_popupWindow->setConnectionFailed();
- --- 276,282 ----
- else
- errorMessage = i18n("Connection failed!");
- ! m_trayIcon->setIcon(m_alertIcon, Configuration::config()->numberOnSystray(), 0, true);
- m_trayIcon->setToolTip(errorMessage);
- m_popupWindow->setConnectionFailed();
- diff -crB kgmailnotifier-0.5.1-orig/kgmailnotifier-0.5.1/src//main.cpp kgmailnotifier-0.5.1/src//main.cpp
- *** kgmailnotifier-0.5.1-orig/kgmailnotifier-0.5.1/src//main.cpp Thu Dec 3 21:32:29 2009
- --- kgmailnotifier-0.5.1/src//main.cpp Fri Jun 17 14:40:14 2011
- ***************
- *** 41,47 ****
- if (!KUniqueApplication::start())
- exit(0);
- ! KGmailNotifier *kgmailnotifier = new KGmailNotifier();
- ! return kgmailnotifier->exec();
- }
- --- 41,47 ----
- if (!KUniqueApplication::start())
- exit(0);
- ! KGmailNotifier kgmailnotifier;
- ! return kgmailnotifier.exec();
- }
- diff -crB kgmailnotifier-0.5.1-orig/kgmailnotifier-0.5.1/src//trayicon.cpp kgmailnotifier-0.5.1/src//trayicon.cpp
- *** kgmailnotifier-0.5.1-orig/kgmailnotifier-0.5.1/src//trayicon.cpp Thu Dec 3 21:32:29 2009
- --- kgmailnotifier-0.5.1/src//trayicon.cpp Sun Jun 19 18:10:15 2011
- ***************
- *** 33,38 ****
- --- 33,39 ----
- TrayIcon::TrayIcon(QWidget *parent)
- : KSystemTrayIcon(parent)
- {
- + m_number = 0;
- connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(slotActivated(QSystemTrayIcon::ActivationReason)));
- }
- ***************
- *** 47,55 ****
- // Public methods //
- // ------------------------------------------------------------------------------------------------------------------- //
- ! void TrayIcon::setIcon(const QPixmap &icon, const bool showNumber, const unsigned int number)
- {
- ! if (showNumber && number > 0) // Display number on systray
- {
- // The following code is inspired by Akregator's tray icon code
- // and used in order to provide a more consistent systray look
- --- 48,61 ----
- // Public methods //
- // ------------------------------------------------------------------------------------------------------------------- //
- ! void TrayIcon::setIcon(const QPixmap &icon, bool showNumber, unsigned int number, bool connectionProblem)
- {
- ! if (!connectionProblem)
- ! {
- ! m_number = number;
- ! }
- !
- ! if ((showNumber && number > 0) || (connectionProblem && showNumber && m_number > 0)) // Display number on systray
- {
- // The following code is inspired by Akregator's tray icon code
- // and used in order to provide a more consistent systray look
- ***************
- *** 57,63 ****
- if (iconWidth == 0)
- return;
- ! QString numberStr = QString::number(number);
- QFont f = KGlobalSettings::generalFont();
- f.setBold(true);
- --- 63,74 ----
- if (iconWidth == 0)
- return;
- ! QString numberStr;
- ! if (!connectionProblem)
- ! numberStr = QString::number(number);
- ! else
- ! numberStr = QString::number(m_number);
- !
- QFont f = KGlobalSettings::generalFont();
- f.setBold(true);
- ***************
- *** 86,92 ****
- (iconWidth - boundingRect.height()) / 2);
- // Draw the frame
- ! p.setOpacity(0.7f);
- p.setBrush(scheme.background(KColorScheme::LinkBackground));
- p.setPen(Qt::NoPen);
- p.drawRoundedRect(boundingRect, 2.0, 2.0);
- --- 97,103 ----
- (iconWidth - boundingRect.height()) / 2);
- // Draw the frame
- ! p.setOpacity(0.5f);
- p.setBrush(scheme.background(KColorScheme::LinkBackground));
- p.setPen(Qt::NoPen);
- p.drawRoundedRect(boundingRect, 2.0, 2.0);
- ***************
- *** 94,100 ****
- // Draw the number
- p.setOpacity(1.0f);
- p.setBrush(Qt::NoBrush);
- ! p.setPen(Qt::darkBlue);
- p.drawText(finalIcon.rect(), Qt::AlignCenter, numberStr);
- // Diplay the final icon
- --- 105,114 ----
- // Draw the number
- p.setOpacity(1.0f);
- p.setBrush(Qt::NoBrush);
- ! if (connectionProblem)
- ! p.setPen(Qt::red);
- ! else
- ! p.setPen(Qt::darkBlue);
- p.drawText(finalIcon.rect(), Qt::AlignCenter, numberStr);
- // Diplay the final icon
- diff -crB kgmailnotifier-0.5.1-orig/kgmailnotifier-0.5.1/src//trayicon.h kgmailnotifier-0.5.1/src//trayicon.h
- *** kgmailnotifier-0.5.1-orig/kgmailnotifier-0.5.1/src//trayicon.h Thu Dec 3 21:32:29 2009
- --- kgmailnotifier-0.5.1/src//trayicon.h Sun Jun 19 17:57:02 2011
- ***************
- *** 30,41 ****
- TrayIcon(QWidget *parent);
- ~TrayIcon();
- ! void setIcon(const QPixmap &icon, const bool showNumber, const unsigned int number);
- private:
- TrayIcon(const TrayIcon&);
- TrayIcon& operator=(const TrayIcon&);
- private slots:
- void slotActivated(QSystemTrayIcon::ActivationReason reason);
- --- 30,42 ----
- TrayIcon(QWidget *parent);
- ~TrayIcon();
- ! void setIcon(const QPixmap &icon, const bool showNumber, const unsigned int number, bool connectionProblem);
- private:
- TrayIcon(const TrayIcon&);
- TrayIcon& operator=(const TrayIcon&);
- + int m_number;
- private slots:
- void slotActivated(QSystemTrayIcon::ActivationReason reason);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement