From 2cbd2b57193b1166c7d6dc656f375f4dfd553b2e Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Thu, 24 Jul 2008 23:50:38 -0300 Subject: err... i Forgot the ingo file.. --- gui/KPackageKit/kpk.cpp | 60 +++++++++++++++--------------------------------- gui/KPackageKit/kpk.h | 3 +++ gui/KPackageKit/main.cpp | 4 ++-- lib/Info.h | 51 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 43 deletions(-) create mode 100644 lib/Info.h diff --git a/gui/KPackageKit/kpk.cpp b/gui/KPackageKit/kpk.cpp index f6c68cd..eb47ea4 100644 --- a/gui/KPackageKit/kpk.cpp +++ b/gui/KPackageKit/kpk.cpp @@ -26,14 +26,14 @@ #include #include "kpk.h" -#include "PkNotify.h" namespace kpackagekit { -Kpk::Kpk() : KUniqueApplication() +Kpk::Kpk() + : KUniqueApplication(), m_pkNotify(0) { -kDebug() << "abriu"; -m_smartSTI = new KSystemTrayIcon("applications-other"); + kDebug() << "abriu"; + m_smartSTI = new KSystemTrayIcon("applications-other"); } Kpk::~Kpk() @@ -42,44 +42,22 @@ Kpk::~Kpk() int Kpk::newInstance() { - KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); -// kt::GUI *widget = 0; -// if (!main_widget) -// { -// bt::InitLog(kt::DataDir() + "log",true); -// setQuitOnLastWindowClosed(false); -// widget = new kt::GUI(); -// setTopWidget(widget); -// main_widget = widget; -// } -// else -// { -// widget = main_widget; -// widget->show(); -// } -// -// if (widget) + KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); -// { - -// KNotify no; -// QStringList a; -// a << "one" << "two"; - for (int i = 0; i < args->count(); i++) - { - if ( args->isSet("silent") ) - kDebug() << "Hello"; - else if ( args->isSet("show-updates") ) { - kDebug() << "Hi mostra!"; - PkNotify *a = new PkNotify(this); - a->displayUpdates(); - } - else { -// kDebug() << "Hi something!"; - } - - } -// } + if ( args->isSet("smart-icon") ) { + kDebug() << "smart-icon"; + m_smartSTI->show(); + } + if ( args->isSet("show-updates") ) { + kDebug() << "Show Updates!"; + if (!m_pkNotify) + m_pkNotify = new PkNotify(this); + m_pkNotify->displayUpdates(); + } + if ( args->isSet("find-file") ) { + kDebug() << "Hello"; + kDebug() << args->getOption("find-file"); + } args->clear(); return 0; } diff --git a/gui/KPackageKit/kpk.h b/gui/KPackageKit/kpk.h index 1ca3bc8..1168029 100644 --- a/gui/KPackageKit/kpk.h +++ b/gui/KPackageKit/kpk.h @@ -22,6 +22,8 @@ #include #include +#include "PkNotify.h" + namespace kpackagekit { class Kpk : public KUniqueApplication @@ -35,6 +37,7 @@ public: virtual int newInstance(); private: KSystemTrayIcon *m_smartSTI; + PkNotify *m_pkNotify; }; } diff --git a/gui/KPackageKit/main.cpp b/gui/KPackageKit/main.cpp index 09af3d9..2ece30c 100755 --- a/gui/KPackageKit/main.cpp +++ b/gui/KPackageKit/main.cpp @@ -51,8 +51,8 @@ int main(int argc, char **argv) KCmdLineArgs::init(argc, argv, &about); KCmdLineOptions options; - options.add( "+[Url]", ki18n("Document to open") ); - options.add( "silent", ki18n("Silently open torrent given on URL") ); + options.add( "find-file ", ki18n("Finds the Package Containing the file") ); + options.add( "smart-icon", ki18n("Shows the Smart Icon Transactions") ); options.add( "show-updates", ki18n("Displays Updates") ); KCmdLineArgs::addCmdLineOptions(options); diff --git a/lib/Info.h b/lib/Info.h new file mode 100644 index 0000000..8bb228b --- /dev/null +++ b/lib/Info.h @@ -0,0 +1,51 @@ +/* +* Copyright (C) 2007 Adrien Bustany +* Copyright (C) 2008 Daniel Nicoletti +* +* Licensed under the GNU General Public License Version 2 +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 See MA 02111-1307, USA. +* +*/ + +#ifndef INFO_H +#define INFO_H + +#include + +#include "Enum.h" + +namespace PackageKit { + +class Info : public QObject { + + Q_OBJECT + Q_ENUMS(Value) + +public: +typedef enum { + Installed, + Available, + Low, + Normal, + Important, + Security, + Bugfix, + Enhancement, + Blocked, + Downloading, + Updating, + Installing, + Removing, + Cleanup, + Obsoleting, + Unknown +} Value; + +}; + +} // End namespace PackageKit + +#endif -- cgit v1.2.3