[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-pim
Subject: [Kde-pim] I'm new and I have a patch
From: "Mischael Schill" <me () mschill ! ch>
Date: 2008-02-02 20:56:30
Message-ID: 200802022156.43287.me () mschill ! ch
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
Hello
I'm new to KDE development. I started today by creating a little
patch that addresses the following "issues" in kontact:
- Sets the initial size of the AboutDialog to 640x400
- Saves the size of the AboutDialog on closing
It's not much but my first few lines of KDE code.
About me:
I'm an IT student from Switzerland and a KDE user since 2000.
This blogentry:
http://people.fruitsalad.org/adridg/bobulate/index.php?/archives/517-Shoutouts-to-PIM.html
made me think that i could do something in return. I don't have
much experience in C++ and less in Qt. But since I am proficient
in C and in Java/Swing, its not that difficult.
I would be glad if someone could point me to a
not-so-complex-but-interesting task.
Cheers,
Mischael Schill
["mypatch" (text/x-diff)]
Index: kdepim/kontact/src/aboutdialog.h
===================================================================
--- kdepim/kontact/src/aboutdialog.h (Revision 769933)
+++ kdepim/kontact/src/aboutdialog.h (Arbeitskopie)
@@ -38,6 +38,12 @@
public:
AboutDialog( Kontact::Core *core );
+ public slots:
+ /**
+ Saves the current window size to KConfig
+ */
+ void saveSize();
+
protected:
void addAboutPlugin( Kontact::Plugin *plugin );
Index: kdepim/kontact/src/aboutdialog.cpp
===================================================================
--- kdepim/kontact/src/aboutdialog.cpp (Revision 769933)
+++ kdepim/kontact/src/aboutdialog.cpp (Arbeitskopie)
@@ -59,8 +59,27 @@
addAboutPlugin( *it );
addLicenseText( KGlobal::mainComponent().aboutData() );
+
+ KSharedConfigPtr config = KSharedConfig::openConfig();
+ KConfigGroup group(config, "AboutDialog");
+ int iwidth = group.readEntry("width").toInt();
+ int iheight = group.readEntry("height").toInt();
+ if(iwidth <=0) iwidth = 640;
+ if(iheight <=0) iheight = 400;
+ resize(iwidth, iheight);
+ connect(this, SIGNAL(finished(int)), this, SLOT(saveSize()));
}
+void AboutDialog::saveSize()
+{
+ KSharedConfigPtr config = KSharedConfig::openConfig();
+ KConfigGroup group(config, "AboutDialog");
+ group.writeEntry("width", size().width());
+ group.writeEntry("height", size().height());
+ group.sync();
+ config->sync();
+}
+
void AboutDialog::addAboutPlugin( Kontact::Plugin *plugin )
{
addAboutData( plugin->title(), plugin->icon(), plugin->aboutData() );
["signature.asc" (application/pgp-signature)]
_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic