summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Nicoletti <dantti85-pk@yahoo.com.br>2008-07-24 23:50:38 -0300
committerDaniel Nicoletti <dantti85-pk@yahoo.com.br>2008-07-24 23:50:38 -0300
commit2cbd2b57193b1166c7d6dc656f375f4dfd553b2e (patch)
tree032f0bea503a24f6a6d8f326547c15b0d54ee5cc
parent9ac0ad7fa8e872426ffb2f5d6e59993567732728 (diff)
err... i Forgot the ingo file..
-rw-r--r--gui/KPackageKit/kpk.cpp60
-rw-r--r--gui/KPackageKit/kpk.h3
-rwxr-xr-xgui/KPackageKit/main.cpp4
-rw-r--r--lib/Info.h51
4 files changed, 75 insertions, 43 deletions
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 <QStringList>
#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 <KUniqueApplication>
#include <ksystemtrayicon.h>
+#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 <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 <madcat@mymadcat.com>
+* Copyright (C) 2008 Daniel Nicoletti <dantti85-pk@yahoo.com.br>
+*
+* 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 <QtCore>
+
+#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