summaryrefslogtreecommitdiff
authorzecke <zecke>2004-11-12 17:15:29 (UTC)
committer zecke <zecke>2004-11-12 17:15:29 (UTC)
commit9507723db1df320547a0cb660b9b923d41438fdf (patch) (side-by-side diff)
treee5d14bb4253250c9463146bdcfb4bab4cf31ce21
parenta4b09be869f18dbd79b641afb065ca088889374c (diff)
downloadopie-9507723db1df320547a0cb660b9b923d41438fdf.zip
opie-9507723db1df320547a0cb660b9b923d41438fdf.tar.gz
opie-9507723db1df320547a0cb660b9b923d41438fdf.tar.bz2
Remove the pun "Aye Caramba" from Bart Simpson in
"Opie Eye Caramba" found as the Caption of the Mainwindow
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 295f93f..7570ee3 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -1,237 +1,237 @@
/*
* GPLv2 zecke@handhelds.org
* No WArranty...
*/
#include "mainwindow.h"
#include "imageview.h"
#include "iconview.h"
#include "filesystem.h"
#include "imageinfoui.h"
#include "viewmodebutton.h"
#include "basesetup.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/storage.h>
#include <qpe/applnk.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qlayout.h>
#include <qdialog.h>
#include <qmap.h>
#include <qtimer.h>
#include <qframe.h>
#include <qmenubar.h>
#include <qaction.h>
//OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" )
OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>)
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" ) );
+ setCaption( QObject::tr("Opie Eye" ) );
m_cfg = new Opie::Core::OConfig("opie-eye");
m_cfg->setGroup("main" );
readConfig();
m_setDocCalled = false;
m_polishDone = false;
m_storage = new StorageInfo();
connect(m_storage, SIGNAL(disksChanged() ),
this, SLOT( dirChanged() ) );
m_stack = new Opie::Ui::OWidgetStack( this );
setCentralWidget( m_stack );
m_view = new PIconView( m_stack, m_cfg );
m_stack->addWidget( m_view, IconView );
m_stack->raiseWidget( IconView );
connect(m_view, SIGNAL(sig_display(const QString&)),
this, SLOT(slotDisplay(const QString&)));
connect(m_view, SIGNAL(sig_showInfo(const QString&)),
this, SLOT(slotShowInfo(const QString&)) );
connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int)));
m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce);
listviewMenu = 0;
/* setup menu and toolbar */
setupActions();
setupToolbar();
setupMenu();
m_aHideToolbar->setOn(m_cfg->readBoolEntry("showtoolbar",true));
m_aAutoRotate->setEnabled(!m_aUnscaled->isOn());
odebug << "mainwindow constructor done" << oendl;
}
PMainWindow::~PMainWindow() {
}
void PMainWindow::slotToggleZoomer()
{
m_aZoomer->setOn(!m_aZoomer->isOn());
}
void PMainWindow::slotZoomerToggled(bool how)
{
if (m_disp) {
m_disp->setShowZoomer(how);
}
if (autoSave) {
m_cfg->writeEntry("zoomeron",how);
}
}
void PMainWindow::slotToggleAutorotate()
{
if (!m_aAutoRotate->isEnabled()) return;
m_aAutoRotate->setOn(!m_aAutoRotate->isOn());
}
void PMainWindow::slotToggleAutoscale()
{
m_aUnscaled->setOn(!m_aUnscaled->isOn());
}
void PMainWindow::slotRotateToggled(bool how)
{
if (autoSave) {
m_cfg->writeEntry("autorotate",how);
}
if (m_disp) {
m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),how);
}
}
void PMainWindow::slotScaleToggled(bool how)
{
if (autoSave) {
m_cfg->writeEntry("unscaled",how);
}
odebug << "Unscaled: " << m_aUnscaled->isOn() << oendl;
odebug << "How: " << how << oendl;
if (how) {
m_aAutoRotate->setOn(false);
}
if (m_disp) {
m_disp->setAutoScaleRotate(!m_aUnscaled->isOn(),m_aAutoRotate->isOn());
}
m_aAutoRotate->setEnabled(!how);
odebug << "Autorotate: " << m_aAutoRotate->isOn() << oendl;
}
void PMainWindow::slotConfig() {
/*
* have a tab with the possible views
* a tab for globals image cache size.. scaled loading
* and one tab for the KeyConfigs
*/
QDialog dlg(this, 0, true);
dlg.setCaption( tr("Opie Eye - Config" ) );
QHBoxLayout *lay = new QHBoxLayout(&dlg);
Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg );
lay->addWidget( wid );
BaseSetup*bSetup = new BaseSetup(m_cfg,wid);
wid->addTab(bSetup,"SettingsIcon","Basics setup");
ViewMap *vM = viewMap();
ViewMap::Iterator _it = vM->begin();
QMap<PDirView*, QWidget*> lst;
for( ; _it != vM->end(); ++_it ) {
PDirView *view = (_it.data())(*m_cfg);
PInterfaceInfo *inf = view->interfaceInfo();
QWidget *_wid = inf->configWidget( *m_cfg );
if (!_wid) continue;
_wid->reparent(wid, QPoint() );
lst.insert( view, _wid );
wid->addTab( _wid, "fileopen", inf->name() );
}
/*
* Add the KeyConfigWidget
*/
Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" );
keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue );
keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() );
QWidget*w = m_stack->visibleWidget();
bool reminfo = false;
if ( !m_info ) {
reminfo = true;
initInfo();
m_info->hide();
}
keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() );
bool remdisp = false;
if ( !m_disp ) {
remdisp = true;
initDisp();
m_disp->hide();
}
keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() );
keyWid->load();
wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") );
wid->setCurrentTab(0);
bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted );
/*
* clean up
*apply changes
*/
QMap<PDirView*, QWidget*>::Iterator it;
for ( it = lst.begin(); it != lst.end(); ++it ) {
if ( act )
it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg);
delete it.key();
}
if ( act ) {
keyWid->save();
m_disp->manager()->save();
m_info->manager()->save();
m_view->manager()->save();
bSetup->save_values();
m_view->resetView();
readConfig();
}
delete keyWid;
m_stack->raiseWidget(w);
if (remdisp) {
m_disp->hide();
}
if (reminfo) {
m_info->hide();
}
}
/*
* create a new image info component
* and detach the current one
* we will make the other delete on exit
*/
template<class T>
void PMainWindow::initT( const char* name, T** ptr, int id) {
if ( *ptr ) {
(*ptr)->disconnect(this, SLOT(slotReturn()));