new project started

svn path=/trunk/kdenetwork/krfb/; revision=126083
This commit is contained in:
Tim Jansen
2001-12-08 02:23:04 +00:00
parent a2d6aefcb5
commit 10d3c70cd7
7 changed files with 116 additions and 187 deletions

View File

@@ -19,7 +19,7 @@ type=DATA
[Config for BinMakefileAm]
bin_program=krfb
cxxflags=-O0 -g3 -Wall
ldadd=\s$(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)
ldadd=\s$(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI)\s
ldflags=\s
[General]
@@ -30,7 +30,7 @@ email=tim@tjansen.de
kdevprj_version=1.3
makefiles=Makefile.am,krfb/Makefile.am,doc/Makefile.am,doc/en/Makefile.am,po/Makefile.am
project_name=Krfb
project_type=kicker_app
project_type=mini_kde2
sgml_file=/home/tim/work/krfb/doc/en/index.docbook
sub_dir=krfb/
version=0.1
@@ -86,7 +86,7 @@ type=normal
[doc/en/index.docbook]
dist=true
install=false
install_location=$$(kde_icondir)/locolor/32x32/apps/krfb.png
install_location=$$(kde_icondir)/locolor/16x16/apps/krfb.png
type=DATA
[krfb.kdevprj]
@@ -102,9 +102,9 @@ install_location=
type=DATA
[krfb/Makefile.am]
files=krfb/krfb.cpp,krfb/krfb.h,krfb/myview.ui,krfb/krfb.desktop,krfb/lo32-app-krfb.png
files=krfb/main.cpp,krfb/krfb.cpp,krfb/krfb.h,krfb/krfb.desktop,krfb/lo32-app-krfb.png,krfb/lo16-app-krfb.png
sub_dirs=
type=shared_library
type=prog_main
[krfb/krfb.cpp]
dist=true
@@ -115,7 +115,7 @@ type=SOURCE
[krfb/krfb.desktop]
dist=true
install=true
install_location=$$(kde_datadir)/kicker/applets/krfb.desktop
install_location=$$(kde_appsdir)/Applications/krfb.desktop
type=DATA
[krfb/krfb.h]
@@ -124,13 +124,19 @@ install=false
install_location=
type=HEADER
[krfb/lo16-app-krfb.png]
dist=true
install=true
install_location=$$(kde_icondir)/locolor/16x16/apps/krfb.png
type=DATA
[krfb/lo32-app-krfb.png]
dist=true
install=true
install_location=$$(kde_icondir)/locolor/32x32/apps/krfb.png
type=DATA
[krfb/myview.ui]
[krfb/main.cpp]
dist=true
install=false
install_location=

View File

@@ -1,28 +1,23 @@
####### kdevelop will overwrite this part!!! (begin)##########
lib_LTLIBRARIES = libkrfb.la
bin_PROGRAMS = krfb
krfb_SOURCES = krfb.cpp main.cpp
krfb_LDADD = $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) $(LIBSOCKET)
INCLUDES = $(all_includes)
LDFLAGS =
libkrfb_la_METASOURCES = AUTO
libkrfb_la_SOURCES = myview.ui krfb.cpp
EXTRA_DIST = krfb.cpp krfb.h myview.ui krfb.desktop lo32-app-krfb.png
EXTRA_DIST = main.cpp krfb.cpp krfb.h krfb.desktop lo32-app-krfb.png lo16-app-krfb.png
install-data-local:
$(mkinstalldirs) $(kde_datadir)/kicker/applets/
$(INSTALL_DATA) $(srcdir)/krfb.desktop $(kde_datadir)/kicker/applets/krfb.desktop
$(mkinstalldirs) $(kde_appsdir)/Applications/
$(INSTALL_DATA) $(srcdir)/krfb.desktop $(kde_appsdir)/Applications/krfb.desktop
$(mkinstalldirs) $(kde_icondir)/locolor/32x32/apps/
$(INSTALL_DATA) $(srcdir)/lo32-app-krfb.png $(kde_icondir)/locolor/32x32/apps/krfb.png
$(mkinstalldirs) $(kde_icondir)/locolor/16x16/apps/
$(INSTALL_DATA) $(srcdir)/lo16-app-krfb.png $(kde_icondir)/locolor/16x16/apps/krfb.png
uninstall-local:
-rm -f $(kde_datadir)/kicker/applets/krfb.desktop
-rm -f $(kde_appsdir)/Applications/krfb.desktop
-rm -f $(kde_icondir)/locolor/32x32/apps/krfb.png
-rm -f $(kde_icondir)/locolor/16x16/apps/krfb.png
####### kdevelop will overwrite this part!!! (end)############
# this 10 paths are KDE specific. Use them:
@@ -39,26 +34,29 @@ uninstall-local:
# kde_wallpaperdir Where general wallpapers should go to.
# set the include path for X, qt and KDE
INCLUDES= $(all_includes)
METASOURCES = AUTO
# them while "make clean", use CLEANFILES
DISTCLEANFILES = $(METASOURCES)
# the library search path.
krfb_LDFLAGS = $(all_libraries) $(KDE_RPATH)
SOMAJOR = 1
SOMINOR = 0
SOSUBMINOR = 0
# Uncomment the following two lines if you add a ui.rc file for your application to make use of
# KDE´s XML GUI builing
#rcdir = $(kde_datadir)/krfb
#rc_DATA = krfbui.rc
# Linker flags
libkrfb_la_LDFLAGS = $(all_libraries) -version-info $(SOMAJOR):$(SOMINOR):$(SOSUBMINOR) $(LDFLAGS) -module
# Extra libraries
libkrfb_la_LIBADD = $(LIB_KDEUI)
#WARNING: if you use a ui.rc file above, use:
# make messages.po. Move this one to ../po/ and "make merge" in po
# the -x is for skipping messages already translated in kdelibs
messages:
# messages: rc.cpp
# instead of
# messages:
messages:
LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
if test -n "$$LIST"; then \
$(XGETTEXT) -C -ki18n -x $(kde_includes)/kde.pot $$LIST -o ../po/krfb.pot; \
$(XGETTEXT) $$LIST -o $(podir)/krfb.pot; \
fi

View File

@@ -1,7 +1,7 @@
/***************************************************************************
krfb.cpp - description
-------------------
begin : Thu Dec 6 22:00:25 CET 2001
begin : Sat Dec 8 03:23:02 CET 2001
copyright : (C) 2001 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
@@ -14,64 +14,13 @@
* (at your option) any later version. *
* *
***************************************************************************/
#include <kglobal.h>
#include <klocale.h>
#include <kconfig.h>
#include <kapp.h>
#include <kmessagebox.h>
#include "krfb.h"
extern "C"
Krfb::Krfb(QWidget *parent, const char *name) : QWidget(parent, name)
{
KPanelApplet* init( QWidget *parent, const QString configFile)
{
KGlobal::locale()->insertCatalogue("krfb");
return new Krfb(configFile, KPanelApplet::Normal,
KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences,
parent, "krfb");
}
}
Krfb::Krfb(const QString& configFile, Type type, int actions, QWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name)
{
// Get the current application configuration handle
ksConfig = config();
mainView = new myview(this);
mainView->show();
}
Krfb::~Krfb()
{
}
void Krfb::about()
{
KMessageBox::information(0, i18n("This is an about box"));
}
void Krfb::help()
{
KMessageBox::information(0, i18n("This is a help box"));
}
void Krfb::preferences()
{
KMessageBox::information(0, i18n("This is a preferences box"));
}
int Krfb::widthForHeight( int height ) const
{
return width();
}
int Krfb::heightForWidth( int width ) const
{
return height();
}
void Krfb::resizeEvent( QResizeEvent *_Event)
{
}

View File

@@ -1,4 +1,12 @@
# KDE Config File
[Desktop Entry]
Comment=A panel applet called Krfb
Name=krfb
X-KDE-Library=libkrfb
Type=Application
Exec=krfb -caption "%c" %i %m
Icon=krfb.png
MiniIcon=krfb.png
DocPath=krfb/index.html
Comment=
Comment[de]=
Terminal=0
Name=Krfb
Name[de]=Krfb

View File

@@ -1,7 +1,7 @@
/***************************************************************************
krfb.h - description
-------------------
begin : Thu Dec 6 22:00:25 CET 2001
begin : Sat Dec 8 03:23:02 CET 2001
copyright : (C) 2001 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
@@ -19,104 +19,21 @@
#define KRFB_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#include <config.h>
#endif
#include <kpanelapplet.h>
#include <qstring.h>
#include <kconfig.h>
#include "myview.h"
#include <kapp.h>
#include <qwidget.h>
class Krfb : public KPanelApplet
/** Krfb is the base class of the project */
class Krfb : public QWidget
{
Q_OBJECT
public:
/**
* Construct a @ref KPanelApplet just like any other widget.
*
* @param configFile The configFile handed over in the factory function.
* @param Type The applet @ref type().
* @param actions Standard RMB menu actions supported by the applet (see @ref action() ).
* @param parent The pointer to the parent widget handed over in the factory function.
* @param name A Qt object name for your applet.
**/
Krfb(const QString& configFile, Type t = Normal, int actions = 0,
QWidget *parent = 0, const char *name = 0);
/** destructor */
~Krfb();
/**
* Retrieve a suggested width for a given height.
*
* Every applet should reimplement this function.
*
* Depending on the panel orientation the height (horizontal panel) or the
* width (vertical panel) of the applets is fixed.
* The exact values of the fixed size component depend on the panel size.
*
* On a horizontal panel the applet height is fixed, the panel will
* call @ref widthForHeight(int height) with @p height
* equal to 'the fixed applet height'
* when laying out the applets.
*
* The applet can now choose the other size component (width)
* based on the given height.
*
* The width you return is granted.
**/
int widthForHeight( int height ) const;
/**
* @return A suggested height for a given width.
*
* Every applet should reimplement this function.
*
* Depending on the panel orientation the height (horizontal panel) or the
* width (vertical panel) of the applets is fixed.
* The exact values of the fixed size component depend on the panel size.
*
* On a vertical panel the applet width is fixed, the panel will
* call @ref heightForWidth(int width) with @p width
* equal to 'the fixed applet width'
* when laying out the applets.
*
* The applet can now choose the other size component (height)
* based on the given width.
*
* The height you return is granted.
**/
int heightForWidth( int width) const;
/**
* Is called when the user selects "About" from the applets RMB menu.
* Reimplement this function to launch a about dialog.
*
* Note that this is called only when your applet supports the About action.
* See @ref Action and @ref KPanelApplet().
**/
void about();
/**
* Is called when the user selects "Help" from the applets RMB menu.
* Reimplement this function to launch a manual or help page.
*
* Note that this is called only when your applet supports the Help action.
* See @ref Action and @ref KPanelApplet().
**/
void help();
/**
* Is called when the user selects "Preferences" from the applets RMB menu.
* Reimplement this function to launch a preferences dialog or kcontrol module.
*
* Note that this is called only when your applet supports the preferences action.
* See @ref Action and @ref KPanelApplet().
**/
void preferences();
protected:
void resizeEvent( QResizeEvent* );
private:
KConfig *ksConfig;
myview *mainView;
Q_OBJECT
public:
/** construtor */
Krfb(QWidget* parent=0, const char *name=0);
/** destructor */
~Krfb();
};
#endif

BIN
krfb/lo16-app-krfb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

51
krfb/main.cpp Normal file
View File

@@ -0,0 +1,51 @@
/***************************************************************************
main.cpp - description
-------------------
begin : Sat Dec 8 03:23:02 CET 2001
copyright : (C) 2001 by Tim Jansen
email : tim@tjansen.de
***************************************************************************/
/***************************************************************************
* *
* 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 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <klocale.h>
#include "krfb.h"
static const char *description =
I18N_NOOP("Krfb");
// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
static KCmdLineOptions options[] =
{
{ 0, 0, 0 }
// INSERT YOUR COMMANDLINE OPTIONS HERE
};
int main(int argc, char *argv[])
{
KAboutData aboutData( "krfb", I18N_NOOP("Krfb"),
VERSION, description, KAboutData::License_GPL,
"(c) 2001, Tim Jansen", 0, 0, "tim@tjansen.de");
aboutData.addAuthor("Tim Jansen",0, "tim@tjansen.de");
KCmdLineArgs::init( argc, argv, &aboutData );
KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
KApplication a;
Krfb *krfb = new Krfb();
a.setMainWidget(krfb);
krfb->show();
return a.exec();
}