summaryrefslogtreecommitdiff
path: root/noncore/tools
Side-by-side diff
Diffstat (limited to 'noncore/tools') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/calc2/calc.cpp4
-rw-r--r--noncore/tools/calculator/calculatorimpl.cpp2
-rw-r--r--noncore/tools/clock/clock.cpp8
-rw-r--r--noncore/tools/formatter/formatter.cpp6
-rw-r--r--noncore/tools/remote/buttondialog.cpp4
-rw-r--r--noncore/tools/remote/recorddialog.cpp6
-rw-r--r--noncore/tools/remote/topgroup.cpp2
-rw-r--r--noncore/tools/remote/topgroupconf.cpp4
8 files changed, 18 insertions, 18 deletions
diff --git a/noncore/tools/calc2/calc.cpp b/noncore/tools/calc2/calc.cpp
index f75eb69..3dcdf6e 100644
--- a/noncore/tools/calc2/calc.cpp
+++ b/noncore/tools/calc2/calc.cpp
@@ -1,95 +1,95 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include <qvaluelist.h>
#include <qpe/qpeapplication.h>
#include <qdir.h>
#include <qwidgetstack.h>
#include "calc.h"
#include "plugininterface.h"
calc::calc (QWidget * p, const char *n):QWidget (p, n)
{
setCaption (tr ("Calculator"));
// widgets
LCD = new QLCDNumber (this);
LCD->setMaximumSize (QSize (240, 30));
LCD->setNumDigits(12);
LCD->setSegmentStyle(QLCDNumber::Filled);
pluginWidgetStack = new QWidgetStack (this);
// layout widgets
calculatorLayout = new QVBoxLayout (this);
calculatorLayout->addWidget (LCD);
calculatorLayout->addWidget (pluginWidgetStack);
// no formatting of display for now
- connect (&engine, SIGNAL(display (double)), LCD, SLOT(display (double)));
- connect (&engine, SIGNAL(display (const QString &)), LCD, SLOT(display (const QString &)));
+ connect (&engine, SIGNAL(display(double)), LCD, SLOT(display(double)));
+ connect (&engine, SIGNAL(display(const QString&)), LCD, SLOT(display(const QString&)));
connect (&engine, SIGNAL(setBinMode()), LCD, SLOT(setBinMode()));
connect (&engine, SIGNAL(setOctMode()), LCD, SLOT(setOctMode()));
connect (&engine, SIGNAL(setDecMode()), LCD, SLOT(setDecMode()));
connect (&engine, SIGNAL(setHexMode()), LCD, SLOT(setHexMode()));
#ifndef NO_PLUGINS
// load plugins
QValueList < Plugin >::Iterator mit;
for (mit = pluginList.begin (); mit != pluginList.end (); ++mit) {
(*mit).interface->release ();
(*mit).library->unload ();
delete (*mit).library;
}
pluginList.clear ();
QString path = QPEApplication::qpeDir() + "/plugins/calculator";
QDir dir (path, "lib*.so");
QStringList list = dir.entryList ();
QStringList::Iterator it;
for (it = list.begin (); it != list.end (); ++it) {
CalcInterface *iface = 0;
QLibrary *lib = new QLibrary (path + "/" + *it);
Plugin plugin;
plugin.pluginWidget = 0;
if (lib->queryInterface (IID_Calc, (QUnknownInterface **) & iface) ==
QS_OK) {
plugin.library = lib;
plugin.interface = iface;
plugin.pluginWidget = plugin.interface->getPlugin(&engine,pluginWidgetStack);
if (plugin.pluginWidget)
pluginWidgetStack->addWidget (plugin.pluginWidget, pluginList.count());
pluginList.append (plugin);
} else {
delete lib;
}
}
setMode (1);
#else
// load simple interface
#endif
}
calc::~calc ()
{
#ifndef NO_PLUGINS
diff --git a/noncore/tools/calculator/calculatorimpl.cpp b/noncore/tools/calculator/calculatorimpl.cpp
index 163b4da..dead03d 100644
--- a/noncore/tools/calculator/calculatorimpl.cpp
+++ b/noncore/tools/calculator/calculatorimpl.cpp
@@ -175,97 +175,97 @@ CalculatorImpl::CalculatorImpl( QWidget * parent, const char * name,
bgr_command.insert( PushButtonMR);
bgr_command.insert( PushButtonMC);
bgr_command.insert( PushButtonCE);
connect( &bgr_command, SIGNAL(clicked(int) ), this, SLOT(command_buttons(int)));
bgr_digits.insert(PushButton0);
bgr_digits.insert(PushButton1);
bgr_digits.insert(PushButton2);
bgr_digits.insert(PushButton3);
bgr_digits.insert(PushButton4);
bgr_digits.insert(PushButton5);
bgr_digits.insert(PushButton6);
bgr_digits.insert(PushButton7);
bgr_digits.insert(PushButton8);
bgr_digits.insert(PushButton9);
connect( &bgr_digits, SIGNAL(clicked(int) ), this, SLOT(enterNumber(int)));
bgr_std.insert(PushButtonEquals);
bgr_std.insert(PushButtonDecimal);
bgr_std.insert(PushButtonAdd);
bgr_std.insert(PushButtonMinus);
bgr_std.insert(PushButtonDivide);
bgr_std.insert(PushButtonTimes);
connect( &bgr_std, SIGNAL(clicked(int) ), this, SLOT(std_buttons(int)));
// change the / to a proper division signal
PushButtonDivide->setText(QChar(0xF7));
func_buttons[0] = PushButtonF1;
func_buttons[1] = PushButtonF2;
func_buttons[2] = PushButtonF3;
func_buttons[3] = PushButtonF4;
func_buttons[4] = PushButtonF5;
func_buttons[5] = PushButtonF6;
func_buttons[6] = PushButtonF7;
func_buttons[7] = PushButtonF8;
func_buttons[8] = PushButtonF9;
func_buttons[9] = PushButtonF10;
func_buttons[10] = PushButtonF11;
func_buttons[11] = PushButtonF12;
for ( int x = 0 ; x < func_button_count ; x++ ) {
QPushButton* tmpbutton = func_buttons[x];
faces << tmpbutton->text();
bgr_function.insert(tmpbutton);
}
connect( &bgr_function, SIGNAL(clicked(int) ) , this, SLOT(do_convert(int) ) );
- connect( &bgr_function, SIGNAL(clicked(int) ) , this, SLOT(std_funcs (int) ) );
+ connect( &bgr_function, SIGNAL(clicked(int) ) , this, SLOT(std_funcs(int) ) );
connect(ComboBoxFunction, SIGNAL(activated(int) ), this, SLOT(function_button(int) ) );
captions.append(tr("Standard"));
ComboBoxFunction->insertItem(captions.last());
// now add in the conversion modes
// when the menu gets done, these should be in a submenu
QString tmp = QPEApplication::qpeDir();
tmp += "etc/unit_conversion.dat";
QFile myfile(tmp);
if ( !myfile.open( IO_Translate | IO_ReadOnly ) ) {
qDebug("Data file unit_conversion.dat not found\nNo conversion features will be available\n"+tmp);
// disable the f button if no conv file available
ComboBoxFunction->setEnabled(FALSE);
}
else {
QString line, line2;
QTextStream ts(&myfile);
// first pass, see how many conversion types there are in order to allocate for them
while ( ! ts.eof() ) {
line = ts.readLine();
if ( line.contains ("STARTTYPE" ) )
conversion_mode_count++;
}
entry_list = new double[conversion_mode_count*func_button_count];
preoffset_list = new double[conversion_mode_count*func_button_count];
postoffset_list = new double[conversion_mode_count*func_button_count];
myfile.close();
myfile.open( IO_Translate | IO_ReadOnly );
QTextStream ts2(&myfile);
// second pass, read in values
int x = 0;
while ( ! ts2.eof() ) {
line = ts2.readLine();
if ( line.contains("STARTTYPE") ) {
captions << tr( line.remove(0,10) );
ComboBoxFunction->insertItem(captions.last());
while ( !line.contains("ENDTYPE") ) {
line = ts2.readLine();
if ( line.contains("NAME") ) {
faces << tr( line.remove(0,5) );
line2 = ts2.readLine();
line2.remove(0,6);
entry_list[x] = line2.toDouble();
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index 4d92683..118cf1f 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -76,145 +76,145 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f )
: QVBox( parent, name , f )
{
setSpacing( 4 );
setMargin( 1 );
snoozeBtn = new QPushButton ( this );
snoozeBtn->setText( tr( "Snooze" ) );
aclock = new AnalogClock( this );
aclock->display( QTime::currentTime() );
aclock->setLineWidth( 2 );
QHBox *hb = new QHBox( this );
hb->setMargin( 0 );
QWidget *space = new QWidget( hb );
lcd = new QLCDNumber( hb );
lcd->setSegmentStyle( QLCDNumber::Flat );
lcd->setFrameStyle( QFrame::NoFrame );
lcd->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );
lcd->setFixedHeight( 23 );
ampmLabel = new QLabel( tr( "PM" ), hb );
ampmLabel->setFont( QFont( "Helvetica", 14, QFont::Bold ) );
ampmLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ) );
ampmLabel->setAlignment( AlignLeft | AlignBottom );
space = new QWidget( hb );
date = new QLabel( this );
date->setAlignment( AlignHCenter | AlignVCenter );
date->setFont( QFont( "Helvetica", 14, QFont::Bold ) );
date->setText( TimeString::longDateString( QDate::currentDate() ) );
QWidget *controls = new QWidget( this );
QGridLayout *gl = new QGridLayout( controls, 3, 2, 6, 4 );
QButtonGroup *grp = new QButtonGroup( controls );
grp->setRadioButtonExclusive( true );
grp->hide();
clockRB = new QRadioButton ( tr( "Clock" ), controls );
gl->addWidget( clockRB, 0, 0 );
grp->insert( clockRB );
swatchRB = new QRadioButton ( tr( "Stopwatch" ), controls );
gl->addWidget( swatchRB, 1, 0 );
grp->insert( swatchRB );
- connect( grp, SIGNAL( clicked( int ) ), this, SLOT( modeSelect( int ) ) );
+ connect( grp, SIGNAL( clicked(int) ), this, SLOT( modeSelect(int) ) );
grp->setButton( 0 );
set = new QPushButton ( controls );
set->setMaximumSize( 50, 30 );
gl->addWidget( set , 0, 1 );
set->setText( tr( "Start" ) );
set->setEnabled( FALSE );
grp->insert( set );
reset = new QPushButton ( controls );
gl->addWidget( reset, 1, 1 );
reset->setText( tr( "Reset" ) );
reset->setEnabled( FALSE );
grp->insert( reset );
alarmOffBtn = new QPushButton ( controls );
gl->addWidget( alarmOffBtn, 0, 2 );
alarmBtn = new QPushButton ( controls );
gl->addWidget( alarmBtn, 1, 2 );
alarmBtn->setText( tr( "Set Alarm" ) );
OClickableLabel *click = new OClickableLabel( controls, "label" );
click->setText( tr( "Set date and time." ) );
gl->addMultiCellWidget( click, 3, 3, 0, 2, AlignHCenter );
connect( click, SIGNAL( clicked() ), this, SLOT( slotAdjustTime() ) );
connect( set , SIGNAL( pressed() ), SLOT( slotSet() ) );
connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) );
connect( alarmBtn, SIGNAL( clicked() ), SLOT( slotSetAlarm() ) );
connect( snoozeBtn, SIGNAL( clicked() ), SLOT( slotSnooze() ) );
connect( alarmOffBtn, SIGNAL( clicked() ), SLOT( slotToggleAlarm() ) );
- connect( qApp, SIGNAL( appMessage( const QCString&, const QByteArray& ) ),
- this, SLOT( appMessage( const QCString&, const QByteArray& ) ) );
+ connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ),
+ this, SLOT( appMessage(const QCString&,const QByteArray&) ) );
t = new QTimer( this );
connect( t, SIGNAL( timeout() ), SLOT( updateClock() ) );
t->start( 1000 );
connect( qApp, SIGNAL( timeChanged() ), SLOT( updateClock() ) );
swatch_running = FALSE;
swatch_totalms = 0;
- connect( qApp, SIGNAL( clockChanged( bool ) ), this, SLOT( changeClock( bool ) ) );
+ connect( qApp, SIGNAL( clockChanged(bool) ), this, SLOT( changeClock(bool) ) );
Config config( "qpe" );
config.setGroup( "Time" );
ampm = config.readBoolEntry( "AMPM", TRUE );
QString tmp = config.readEntry( "clockAlarmHour", "" );
bool ok;
hour = tmp.toInt( &ok, 10 );
tmp = config.readEntry( "clockAlarmMinute", "" );
minute = tmp.toInt( &ok, 10 );
if ( config.readEntry( "clockAlarmSet", "FALSE" ) == "TRUE" )
{
alarmOffBtn->setText( tr( "Alarm Is On" ) );
alarmBool = TRUE;
snoozeBtn->show();
}
else
{
alarmOffBtn->setText( tr( "Alarm Is Off" ) );
alarmBool = FALSE;
snoozeBtn->hide();
}
QTimer::singleShot( 0, this, SLOT( updateClock() ) );
Config cfg( "Clock" );
cfg.setGroup( "Mode" );
int mode = cfg.readBoolEntry( "clockMode");
setSwatchMode( mode);
modeSelect( mode);
}
Clock::~Clock()
{
toggleScreenSaver( true );
}
void Clock::updateClock()
{
if ( clockRB->isChecked() )
{
QTime tm = QDateTime::currentDateTime().time();
QString s;
if ( ampm )
{
int hour = tm.hour();
diff --git a/noncore/tools/formatter/formatter.cpp b/noncore/tools/formatter/formatter.cpp
index e869317..77e1790 100644
--- a/noncore/tools/formatter/formatter.cpp
+++ b/noncore/tools/formatter/formatter.cpp
@@ -115,99 +115,99 @@ FormatterApp::FormatterApp( QWidget* parent, const char* name, WFlags fl, bool
tabLayout_2->addMultiCellWidget( mountPointLineEdit, 0, 0, 0, 1);
deviceComboBox = new QComboBox( FALSE, tab_2, "deviceComboBox" );
tabLayout_2->addMultiCellWidget( deviceComboBox, 3, 3, 0, 1);
TextLabel5 = new QLabel( tab_2, "TextLabel5" );
TextLabel5->setText( tr( "CAUTION:\n"
"Changing parameters on this\n"
"page may cause your system\n"
"to stop functioning properly!" ) );//idiot message
tabLayout_2->addMultiCellWidget( TextLabel5, 6, 6, 0, 1);
editPushButton = new QPushButton( tab_2, "editPushButton" );
editPushButton->setText( tr( "Edit fstab" ) );
editPushButton->setMaximumWidth(100);
tabLayout_2->addMultiCellWidget( editPushButton, 7, 7, 0, 0 );
fsckButton = new QPushButton( tab_2, "fsckPushButton" );
fsckButton->setText( tr( "Check Disk" ) );
fsckButton->setMaximumWidth(100);
tabLayout_2->addMultiCellWidget( fsckButton, 7, 7, 1, 1);
TextLabel3 = new QLabel( tab_2, "TextLabel3" );
TextLabel3->setText( tr( "Device" ) );
tabLayout_2->addMultiCellWidget( TextLabel3, 4, 4, 0, 1 );
QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
tabLayout_2->addItem( spacer_3, 5, 0 );
TextLabel1 = new QLabel( tab_2, "TextLabel1" );
TextLabel1->setText( tr( "Mount Point" ) );
tabLayout_2->addMultiCellWidget( TextLabel1, 1, 1, 0, 1 );
QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
tabLayout_2->addItem( spacer_4, 2, 1 );
TabWidget->insertTab( tab_2, tr( "Advanced" ) );
FormatterAppLayout->addWidget( TabWidget, 0, 1 );
connect( formatPushButton ,SIGNAL(released()),this,SLOT( doFormat()) );
connect( editPushButton ,SIGNAL(released()),this,SLOT( editFstab()) );
connect( fsckButton ,SIGNAL(released()),this,SLOT( doFsck()) );
- connect( fileSystemsCombo,SIGNAL(activated(int)),this,SLOT( fsComboSelected(int ) ));
- connect( storageComboBox,SIGNAL(activated(int)),this,SLOT( storageComboSelected(int ) ));
- connect( deviceComboBox,SIGNAL(activated(int)),this,SLOT( deviceComboSelected(int ) ));
+ connect( fileSystemsCombo,SIGNAL(activated(int)),this,SLOT( fsComboSelected(int) ));
+ connect( storageComboBox,SIGNAL(activated(int)),this,SLOT( storageComboSelected(int) ));
+ connect( deviceComboBox,SIGNAL(activated(int)),this,SLOT( deviceComboSelected(int) ));
fillCombos();
}
FormatterApp::~FormatterApp()
{}
void FormatterApp::doFormat()
{
int err=0;
Output *outDlg;
QString umountS, remountS;
QString text = storageComboBox->currentText();
QString currentText = storageComboBox->currentText();
QString cmd;
QString diskDevice = currentText.right( currentText.length() - currentText.find(" -> ",0,TRUE) - 4);
QString diskName = currentText.left(currentText.find(" -> ",0,TRUE));
QString fs = fileSystemsCombo->currentText();
#if defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX) // lets test on something cheap
#else
currentText = diskDevice = "/dev/fd0";
umountS = "umount -v /floppy 2>&1";
remountS = "mount -v /floppy 2>&1";
#endif
if( currentText.find("CF",0,TRUE) != -1)
{
umountS = "umount ";
remountS = "mount ";
// umountS = "/sbin/cardctl eject";
// remountS = "/sbin/cardctl insert";
}
if( currentText.find("SD",0,TRUE) != -1)
{
umountS = "umount ";
remountS = "mount ";
// umountS = "/etc/sdcontrol compeject";
// remountS = "/etc/sdcontrol insert";
}
switch ( QMessageBox::warning(this,tr("Format?")
, tr("Really format\n") +diskName+" "+ currentText +
tr("\nwith %1 filesystem?\nYou will loose all data!!").arg( fs )
,tr("Yes")
,tr("No")
diff --git a/noncore/tools/remote/buttondialog.cpp b/noncore/tools/remote/buttondialog.cpp
index 6ea4801..580f101 100644
--- a/noncore/tools/remote/buttondialog.cpp
+++ b/noncore/tools/remote/buttondialog.cpp
@@ -1,104 +1,104 @@
/*
Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
Copyright (C) 2002 Thomas Stephens
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.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "buttondialog.h"
ButtonDialog::ButtonDialog(QString buttonName, QWidget *parent, const char*name, bool modal, WFlags f):QDialog(parent, name, modal, f)
{
setCaption(tr(buttonName));
QVBoxLayout *layout = new QVBoxLayout(this);
QHBoxLayout *hlayout1 = new QHBoxLayout(this);
QHBoxLayout *hlayout2 = new QHBoxLayout(this);
QHBoxLayout *hlayout3 = new QHBoxLayout(this);
layout->addSpacing(5);
layout->addLayout(hlayout1);
layout->addSpacing(5);
layout->addLayout(hlayout2);
layout->addSpacing(5);
layout->addLayout(hlayout3);
layout->addSpacing(5);
remote = new QComboBox(false, this, "remote");
QLabel *remoteLabel = new QLabel(remote, "Remote: ", this, "remoteLabel");
hlayout1->addSpacing(5);
hlayout1->addWidget(remoteLabel);
hlayout1->addSpacing(5);
hlayout1->addWidget(remote);
hlayout1->addSpacing(5);
remote->insertItem("Remote ");
remote->insertStringList(getRemotes());
- connect(remote, SIGNAL(activated(const QString &)), this, SLOT(remoteSelected(const QString&)) );
+ connect(remote, SIGNAL(activated(const QString&)), this, SLOT(remoteSelected(const QString&)) );
button = new QComboBox(false, this, "button");
QLabel *buttonLabel = new QLabel(remote, "Button: ", this, "buttonLabel");
hlayout2->addSpacing(5);
hlayout2->addWidget(buttonLabel);
hlayout2->addSpacing(5);
hlayout2->addWidget(button);
hlayout2->addSpacing(5);
button->insertItem("Button ");
- connect(button, SIGNAL(activated(const QString &)), this, SLOT(buttonSelected(const QString&)) );
+ connect(button, SIGNAL(activated(const QString&)), this, SLOT(buttonSelected(const QString&)) );
label = new QLineEdit(this, "label");
label->setText(buttonName);
QLabel *labelLabel = new QLabel(label, "Label: ", this, "labelLabel");
hlayout3->addSpacing(5);
hlayout3->addWidget(labelLabel);
hlayout3->addSpacing(5);
hlayout3->addWidget(label);
hlayout3->addSpacing(5);
}
void ButtonDialog::remoteSelected(const QString &string)
{
button->insertStringList(getButtons(string.latin1()) );
list="SEND_ONCE";
list+=string;
}
void ButtonDialog::buttonSelected(const QString &string)
{
list+=string;
}
QStringList ButtonDialog::getList()
{
return list;
}
QString ButtonDialog::getLabel()
{
return label->text();
}
QStringList ButtonDialog::getRemotes()
{
const char write_buffer[] = "LIST\n";
const char *readbuffer;
int i, numlines;
QStringList list;
addr.sun_family=AF_UNIX;
strcpy(addr.sun_path,"/dev/lircd");
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if(fd == -1)
{
QMessageBox *mb = new QMessageBox("Error!",
"couldnt connect to socket",
diff --git a/noncore/tools/remote/recorddialog.cpp b/noncore/tools/remote/recorddialog.cpp
index cfab730..1ce5472 100644
--- a/noncore/tools/remote/recorddialog.cpp
+++ b/noncore/tools/remote/recorddialog.cpp
@@ -4,79 +4,79 @@ Copyright (C) 2002 Thomas Stephens
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.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "recorddialog.h"
RecordDialog::RecordDialog(QWidget *parent, const char *name)
:QDialog(parent, name)
{
QVBoxLayout *layout = new QVBoxLayout(this);
QHBoxLayout *hlayout = new QHBoxLayout(this);
layout->insertSpacing(0,5);
output = new QTextView("Please enter the name of the new remote, and press Return\n", 0, this, "output");
layout->insertWidget(-1, output);
layout->insertSpacing(-1, 5);
layout->insertLayout(-1, hlayout);
layout->insertSpacing(-1, 5);
hlayout->insertSpacing(0, 5);
input = new QLineEdit(this, "input");
hlayout->insertWidget(-1, input, 1);
hlayout->insertSpacing(-1, 5);
QPushButton *ret = new QPushButton("Return", this, "return");
hlayout->insertWidget(-1, ret);
hlayout->insertSpacing(-1, 5);
connect(ret, SIGNAL(clicked()), this, SLOT(retPressed()) );
where = 0;
record = new OProcess;
}
void RecordDialog::retPressed()
{
printf("RecordDialog::retPressed: ret pressed\n");
if(where == 0)
{
- connect(record, SIGNAL(receivedStdout(OProcess *, char *, int)), this, SLOT(incoming(OProcess *, char *, int)) );
- connect(record, SIGNAL(receivedStderr(OProcess *, char *, int)), this, SLOT(incoming(OProcess *, char *, int)) );
- connect(record, SIGNAL(processExited(OProcess *)), this, SLOT(done(OProcess *)) );
+ connect(record, SIGNAL(receivedStdout(OProcess*,char*,int)), this, SLOT(incoming(OProcess*,char*,int)) );
+ connect(record, SIGNAL(receivedStderr(OProcess*,char*,int)), this, SLOT(incoming(OProcess*,char*,int)) );
+ connect(record, SIGNAL(processExited(OProcess*)), this, SLOT(done(OProcess*)) );
printf("RecordDialog::retPressed: starting irrecord\n");
QString file = "/tmp/" + input->text();
*record<<"irrecord"<<file.latin1();
if(!record->start(OProcess::NotifyOnExit, OProcess::AllOutput))
{
QMessageBox *mb = new QMessageBox("Error!",
"Could not start irrecord. You must<br>use an lirc ipkg that includes<br>irrecord",
QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton);
mb->exec();
return;
}
// record->resume();
where = 1;
}
}
void RecordDialog::incoming(OProcess *proc, char *buffer, int len)
{
// output->setText(output->text() + QString(buffer).truncate(len-1));
printf("RecordDialog::incoming: got text from irrecord\n");
}
void RecordDialog::done(OProcess *proc)
{
}
diff --git a/noncore/tools/remote/topgroup.cpp b/noncore/tools/remote/topgroup.cpp
index 93cffbb..427cb8f 100644
--- a/noncore/tools/remote/topgroup.cpp
+++ b/noncore/tools/remote/topgroup.cpp
@@ -1,54 +1,54 @@
/*
Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
Copyright (C) 2002 Thomas Stephens
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.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "topgroup.h"
TopGroup::TopGroup(QWidget *parent, const char *name):QWidget(parent,name)
{
QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0);
QPushButton *power = new QPushButton("Power",this,"power");
layout->addWidget(power);
connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
// power->setGeometry(5, 5,40, 20);
layout->addSpacing(5);
QPushButton *source = new QPushButton("Source",this,"source");
layout->addWidget(source);
connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) );
// source->setGeometry(50,5,40,20);
remotes = new QComboBox(false, this, "remotes");
- connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) );
+ connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
remotes->insertItem("Select Remote");
// remotes->setGeometry(135,5,95,20);
QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel");
// remoteLabel->setGeometry(90,5,40,20);
remoteLabel->setAlignment(AlignRight | AlignVCenter);
layout->addWidget(remoteLabel);
layout->addWidget(remotes);
}
void TopGroup::updateRemotes(Config *cfg)
{
remotes->clear();
remotes->insertItem(QString("SelectRemote"));
cfg->setGroup("Remotes");
remotes->insertStringList(cfg->readListEntry("remoteList", ',') );
}
diff --git a/noncore/tools/remote/topgroupconf.cpp b/noncore/tools/remote/topgroupconf.cpp
index d763a3a..0419a65 100644
--- a/noncore/tools/remote/topgroupconf.cpp
+++ b/noncore/tools/remote/topgroupconf.cpp
@@ -1,70 +1,70 @@
/*
Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
Copyright (C) 2002 Thomas Stephens
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.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "topgroupconf.h"
TopGroupConf::TopGroupConf(QWidget *parent, const char *name):QWidget(parent,name)
{
QHBoxLayout *layout = new QHBoxLayout(this);
QPushButton *power = new QPushButton("Power",this,"power");
layout->addWidget(power);
connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
// power->setGeometry(5, 5,40, 20);
layout->addSpacing(5);
QPushButton *source = new QPushButton("Source",this,"source");
layout->addWidget(source);
connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) );
// source->setGeometry(50,5,40,20);
remotes = new QComboBox(true, this, "remotes");
remotes->insertItem(QString("Remotes"));
layout->addWidget(remotes);
layout->setStretchFactor(remotes, 1);
- connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) );
+ connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
QPushButton *newrem = new QPushButton("New", this, "new");
layout->addWidget(newrem);
connect(newrem, SIGNAL(pressed()), this->parentWidget(), SLOT(newPressed()) );
/* remotes = new QComboBox(false, this, "remotes");
- connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) );
+ connect(remotes, SIGNAL(activated(const QString&)), this->parentWidget(), SLOT(remoteSelected(const QString&)) );
remotes->insertItem("Select Remote");
// remotes->setGeometry(135,5,95,20);
QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel");
// remoteLabel->setGeometry(90,5,40,20);
remoteLabel->setAlignment(AlignRight | AlignVCenter);
layout->addWidget(remoteLabel);
layout->addWidget(remotes);
*/
}
void TopGroupConf::updateRemotes(QStringList list)
{
remotes->insertStringList(list);
}
QString TopGroupConf::getRemotesText()
{
return remotes->currentText();
}