summaryrefslogtreecommitdiff
authorzecke <zecke>2004-04-07 23:47:43 (UTC)
committer zecke <zecke>2004-04-07 23:47:43 (UTC)
commit10ec13c9068e7e4ca0acf75e5843ebd91e4e8566 (patch) (side-by-side diff)
tree9889be205ecb8d65aeca3b280d1db7ed0f07791c
parent61cb9c9ad238e5aec6aaa1384549e0aab99d14bf (diff)
downloadopie-10ec13c9068e7e4ca0acf75e5843ebd91e4e8566.zip
opie-10ec13c9068e7e4ca0acf75e5843ebd91e4e8566.tar.gz
opie-10ec13c9068e7e4ca0acf75e5843ebd91e4e8566.tar.bz2
Implement setDocument so now we could start replacing showimg
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp10
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 21a668a..3650493 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -1,47 +1,48 @@
/*
* GPLv2 zecke@handhelds.org
* No WArranty...
*/
#include "mainwindow.h"
#include "iconview.h"
#include "filesystem.h"
#include "imageinfoui.h"
#include "imageview.h"
#include <iface/ifaceinfo.h>
#include <iface/dirview.h>
#include <opie2/odebug.h>
#include <opie2/owidgetstack.h>
#include <opie2/oapplicationfactory.h>
#include <opie2/otabwidget.h>
#include <opie2/okeyconfigwidget.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qpe/ir.h>
+#include <qpe/applnk.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qlayout.h>
#include <qdialog.h>
#include <qmap.h>
#include <qtimer.h>
OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" )
PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
: QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 )
{
setCaption( QObject::tr("Opie Eye Caramba" ) );
m_cfg = new Opie::Core::OConfig("phunkview");
m_cfg->setGroup("Zecke_view" );
// qDebug( "Process-wide OApplication object @ %0x", oApp );
/*
* Initialize ToolBar and IconView
* And Connect Them
*/
@@ -260,24 +261,33 @@ void PMainWindow::slotDisplay( const QString& inf ) {
void PMainWindow::slotReturn() {
raiseIconView();
}
void PMainWindow::closeEvent( QCloseEvent* ev ) {
/*
* return from view
* or properly quit
*/
if ( m_stack->visibleWidget() == m_info ||
m_stack->visibleWidget() == m_disp ) {
raiseIconView();
ev->ignore();
return;
}
ev->accept();
QTimer::singleShot(0, qApp, SLOT(closeAllWindows()));
}
void PMainWindow::raiseIconView() {
m_stack->raiseWidget( IconView );
}
+
+void PMainWindow::setDocument( const QString& showImg ) {
+ QString file = showImg;
+ DocLnk lnk(showImg);
+ if (lnk.isValid() )
+ file = lnk.file();
+
+ slotDisplay( file );
+}
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h
index 5de2f42..042d568 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.h
+++ b/noncore/graphics/opie-eye/gui/mainwindow.h
@@ -18,48 +18,49 @@ namespace Ui{
class OWidgetStack;
}
}
class PIconView;
class imageinfo;
class ImageView;
class PMainWindow : public QMainWindow {
Q_OBJECT
enum Views { IconView, ImageInfo, ImageDisplay };
public:
static QString appName() { return QString::fromLatin1("opie-eye" ); }
PMainWindow(QWidget*, const char*, WFlags );
~PMainWindow();
signals:
void configChanged();
public slots:
void slotShowInfo( const QString& inf );
void slotDisplay( const QString& inf );
void slotReturn();
void slotRotateToggled(bool);
void slotScaleToggled(bool);
+ void setDocument( const QString& );
protected:
void raiseIconView();
void closeEvent( QCloseEvent* );
private:
template<class T> void initT( const char* name, T**, int );
void initInfo();
void initDisp();
private:
Opie::Core::OConfig *m_cfg;
Opie::Ui::OWidgetStack *m_stack;
PIconView* m_view;
imageinfo *m_info;
ImageView *m_disp;
bool autoRotate;
bool autoScale;
QToolButton*rotateButton;
private slots:
void slotConfig();
};