[rkward-cvs] SF.net SVN: rkward: [2213] branches/KDE4_port/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Tue Nov 13 00:06:16 UTC 2007
Revision: 2213
http://rkward.svn.sourceforge.net/rkward/?rev=2213&view=rev
Author: tfry
Date: 2007-11-12 16:06:16 -0800 (Mon, 12 Nov 2007)
Log Message:
-----------
Trivial Qt3 support code removals, and a slight simplification of ShowEditTextFileAgent
Modified Paths:
--------------
branches/KDE4_port/rkward/agents/showedittextfileagent.cpp
branches/KDE4_port/rkward/agents/showedittextfileagent.h
branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp
branches/KDE4_port/rkward/windows/rkwindowcatcher.h
Modified: branches/KDE4_port/rkward/agents/showedittextfileagent.cpp
===================================================================
--- branches/KDE4_port/rkward/agents/showedittextfileagent.cpp 2007-11-12 23:26:12 UTC (rev 2212)
+++ branches/KDE4_port/rkward/agents/showedittextfileagent.cpp 2007-11-13 00:06:16 UTC (rev 2213)
@@ -18,12 +18,12 @@
#include "showedittextfileagent.h"
#include <klocale.h>
+#include <kdialog.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qfile.h>
-//Added by qt3to4:
-#include <Q3VBoxLayout>
+#include <QVBoxLayout>
#include "../windows/rkcommandeditorwindow.h"
#include "../rbackend/rinterface.h"
@@ -39,9 +39,26 @@
ShowEditTextFileAgent::args = args;
- dialog = new ShowEditTextFileDialog (text, caption);
+ dialog = new KDialog (0);
+
+ // dialog setup
+ dialog->setCaption (caption);
+ dialog->setButtons (KDialog::Ok);
+ dialog->setModal (false);
+
+ QWidget *page = new QWidget (dialog);
+ dialog->setMainWidget (page);
+ QVBoxLayout *layout = new QVBoxLayout (page);
+ layout->setContentsMargins (0, 0, 0, 0);
+ QLabel *label = new QLabel (text, page);
+ label->setWordWrap (true);
+ layout->addWidget (label);
+
+ dialog->setButtonText (KDialog::Ok, i18n ("Done"));
+
connect (dialog, SIGNAL (finished ()), this, SLOT (done ()));
+ // do it
dialog->show ();
}
@@ -122,28 +139,4 @@
deleteLater ();
}
-///################# END ShowEditTextFileAgent ##################
-///################# BEGIN ShowEditTextFileDialog #################
-
-ShowEditTextFileDialog::ShowEditTextFileDialog (const QString &text, const QString &caption) : KDialog ((QWidget*) 0) {
- RK_TRACE (APP);
-
- setCaption (caption);
- setButtons (KDialog::Ok);
- setModal (false);
-
- QWidget *page = new QWidget (this);
- setMainWidget (page);
- Q3VBoxLayout *layout = new Q3VBoxLayout (page, 0, spacingHint ());
- QLabel *label = new QLabel (text, page);
- label->setWordWrap (true);
- layout->addWidget (label);
-
- setButtonText (KDialog::Ok, i18n ("Done"));
-}
-
-ShowEditTextFileDialog::~ShowEditTextFileDialog () {
- RK_TRACE (APP);
-}
-
#include "showedittextfileagent.moc"
Modified: branches/KDE4_port/rkward/agents/showedittextfileagent.h
===================================================================
--- branches/KDE4_port/rkward/agents/showedittextfileagent.h 2007-11-12 23:26:12 UTC (rev 2212)
+++ branches/KDE4_port/rkward/agents/showedittextfileagent.h 2007-11-13 00:06:16 UTC (rev 2213)
@@ -21,7 +21,7 @@
#include <qobject.h>
struct RCallbackArgs;
-class ShowEditTextFileDialog;
+class KDialog;
/** The purpose of this agent is to display text files for showing and/or editing on request of the R backend. Technically speaking, it gets invoked, whenever the standard R callbacks (ptr_)R_ShowFiles, (ptr_)R_EditFiles, or (ptr_)R_EditFile are called. While the task of simply opening such files for display/editing is rather simple, there is one slightly more difficult issue involved (and hence this class to handle it): In standard R, all these calls are blocking further processing, until the user has closed the shown/edited files. In some cases this may be necessary (for instance if R wants to use with the edited files immediately), in some cases this is an unnecessary nuisance (such as when R simply wants to display a help page or some other purely informational text).
@@ -50,22 +50,7 @@
void done ();
private:
RCallbackArgs *args;
- ShowEditTextFileDialog *dialog;
+ KDialog *dialog;
};
-#include <kdialog.h>
-
-/** Mini helper class of ShowEditTextFileAgent. Do not use outside of ShowEditTextFileAgent.
-
-TODO: might be renamed / reused as a more generic non-modal information dialog */
-
-class ShowEditTextFileDialog : public KDialog {
- public:
-/** constructor
- at param text: Text to display in the dialog */
- ShowEditTextFileDialog (const QString &text, const QString &caption);
-/** destructor */
- ~ShowEditTextFileDialog ();
-};
-
#endif
Modified: branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp
===================================================================
--- branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp 2007-11-12 23:26:12 UTC (rev 2212)
+++ branches/KDE4_port/rkward/windows/rkwindowcatcher.cpp 2007-11-13 00:06:16 UTC (rev 2213)
@@ -20,10 +20,6 @@
#ifndef DISABLE_RKWINDOWCATCHER
#include <qlayout.h>
-#include <q3vbox.h>
-//Added by qt3to4:
-#include <Q3Frame>
-#include <Q3VBoxLayout>
#include <kmessagebox.h>
#include <klocale.h>
@@ -69,15 +65,13 @@
//////////////////////////////// BEGIN RKCaughtX11Window //////////////////////////////
-#include <q3scrollview.h>
-#include <q3vbox.h>
+#include <QScrollArea>
#include <qlabel.h>
#include <QX11EmbedContainer>
#include <ktoggleaction.h>
#include <kdialog.h>
#include <knuminput.h>
-#include <kiconloader.h>
#include <kvbox.h>
#include <kwindowsystem.h>
#include <kactioncollection.h>
@@ -104,12 +98,11 @@
layout->setContentsMargins (0, 0, 0, 0);
box_widget = new KVBox (this);
layout->addWidget (box_widget);
- scroll_widget = new Q3ScrollView (this);
- scroll_widget->setFrameStyle (Q3Frame::NoFrame);
+ scroll_widget = new QScrollArea (this);
scroll_widget->hide ();
layout->addWidget (scroll_widget);
- //KDE4 TODO: workaround below still needed?
- xembed_container = new KVBox (box_widget); // QXEmbed can not be reparented (between the box_widget, and the scroll_widget) directly. Therefore we place it into a container, and reparent that instead
+
+ xembed_container = new KVBox (box_widget); // QX11EmbedContainer can not be reparented (between the box_widget, and the scroll_widget) directly. Therefore we place it into a container, and reparent that instead
dynamic_size = true;
dynamic_size_action->setChecked (true);
@@ -154,7 +147,7 @@
dynamic_size = dynamic_size_action->isChecked ();
if (dynamic_size_action->isChecked ()) {
- scroll_widget->removeChild (xembed_container);
+ scroll_widget->takeWidget ();
xembed_container->reparent (box_widget, QPoint (0, 0), true);
scroll_widget->hide ();
box_widget->show ();
@@ -162,8 +155,7 @@
xembed_container->setMaximumSize (32767, 32767);
} else {
xembed_container->setFixedSize (xembed_container->size ());
- xembed_container->reparent (scroll_widget->viewport (), QPoint (0, 0), true);
- scroll_widget->addChild (xembed_container);
+ scroll_widget->setWidget (xembed_container);
box_widget->hide ();
scroll_widget->show ();
}
Modified: branches/KDE4_port/rkward/windows/rkwindowcatcher.h
===================================================================
--- branches/KDE4_port/rkward/windows/rkwindowcatcher.h 2007-11-12 23:26:12 UTC (rev 2212)
+++ branches/KDE4_port/rkward/windows/rkwindowcatcher.h 2007-11-13 00:06:16 UTC (rev 2213)
@@ -78,7 +78,7 @@
class RKCaughtX11WindowPart;
class KToggleAction;
class QXEmbedCopy;
-class Q3ScrollView;
+class QScrollArea;
class KVBox;
class RKProgressControl;
class QX11EmbedContainer;
@@ -124,7 +124,7 @@
int device_number;
WId embedded;
KVBox *xembed_container;
- Q3ScrollView *scroll_widget;
+ QScrollArea *scroll_widget;
KVBox *box_widget;
RKProgressControl *error_dialog;
QX11EmbedContainer *capture;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list