summaryrefslogtreecommitdiffstats
path: root/kalarm/kalarmapp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kalarm/kalarmapp.cpp')
-rw-r--r--kalarm/kalarmapp.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/kalarm/kalarmapp.cpp b/kalarm/kalarmapp.cpp
index fd81aed47..d37e0dcda 100644
--- a/kalarm/kalarmapp.cpp
+++ b/kalarm/kalarmapp.cpp
@@ -109,7 +109,7 @@ KAlarmApp::KAlarmApp()
mSpeechEnabled(false)
{
Preferences::initialise();
- Preferences::connect(TQT_SIGNAL(preferencesChanged()), this, TQT_SLOT(slotPreferencesChanged()));
+ Preferences::connect(TQT_SIGNAL(preferencesChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotPreferencesChanged()));
KCal::CalFormat::setApplication(aboutData()->programName(), AlarmCalendar::icalProductId());
KARecurrence::setDefaultFeb29Type(Preferences::defaultFeb29Type());
@@ -329,9 +329,9 @@ int KAlarmApp::newInstance()
if (args->isSet("triggerEvent")) { function = EVENT_TRIGGER; option = "triggerEvent"; ++count; }
if (args->isSet("cancelEvent")) { function = EVENT_CANCEL; option = "cancelEvent"; ++count; }
if (!count)
- USAGE(i18n("%1 requires %2, %3 or %4").arg(TQString::tqfromLatin1("--calendarURL")).arg(TQString::tqfromLatin1("--handleEvent")).arg(TQString::tqfromLatin1("--triggerEvent")).arg(TQString::tqfromLatin1("--cancelEvent")))
+ USAGE(i18n("%1 requires %2, %3 or %4").tqarg(TQString::tqfromLatin1("--calendarURL")).tqarg(TQString::tqfromLatin1("--handleEvent")).tqarg(TQString::tqfromLatin1("--triggerEvent")).tqarg(TQString::tqfromLatin1("--cancelEvent")))
if (count > 1)
- USAGE(i18n("%1, %2, %3 mutually exclusive").arg(TQString::tqfromLatin1("--handleEvent")).arg(TQString::tqfromLatin1("--triggerEvent")).arg(TQString::tqfromLatin1("--cancelEvent")));
+ USAGE(i18n("%1, %2, %3 mutually exclusive").tqarg(TQString::tqfromLatin1("--handleEvent")).tqarg(TQString::tqfromLatin1("--triggerEvent")).tqarg(TQString::tqfromLatin1("--cancelEvent")));
if (!initCheck(true)) // open the calendar, don't register with daemon yet
{
exitCode = 1;
@@ -341,7 +341,7 @@ int KAlarmApp::newInstance()
{
TQString calendarUrl = args->getOption("calendarURL");
if (KURL(calendarUrl).url() != AlarmCalendar::activeCalendar()->urlString())
- USAGE(i18n("%1: wrong calendar file").arg(TQString::tqfromLatin1("--calendarURL")))
+ USAGE(i18n("%1: wrong calendar file").tqarg(TQString::tqfromLatin1("--calendarURL")))
}
TQString eventID = args->getOption(option);
args->clear(); // free up memory
@@ -369,7 +369,7 @@ int KAlarmApp::newInstance()
}
if (!KAlarm::edit(eventID))
{
- USAGE(i18n("%1: Event %2 not found, or not editable").arg(TQString::tqfromLatin1("--edit")).arg(eventID))
+ USAGE(i18n("%1: Event %2 not found, or not editable").tqarg(TQString::tqfromLatin1("--edit")).tqarg(eventID))
exitCode = 1;
break;
}
@@ -401,11 +401,11 @@ int KAlarmApp::newInstance()
{
kdDebug(5950)<<"KAlarmApp::newInstance(): file\n";
if (args->isSet("exec"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--exec")).arg(TQString::tqfromLatin1("--file")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--exec")).tqarg(TQString::tqfromLatin1("--file")))
if (args->isSet("mail"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--mail")).arg(TQString::tqfromLatin1("--file")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--mail")).tqarg(TQString::tqfromLatin1("--file")))
if (args->count())
- USAGE(i18n("message incompatible with %1").arg(TQString::tqfromLatin1("--file")))
+ USAGE(i18n("message incompatible with %1").tqarg(TQString::tqfromLatin1("--file")))
alMessage = args->getOption("file");
action = KAEvent::FILE;
}
@@ -413,7 +413,7 @@ int KAlarmApp::newInstance()
{
kdDebug(5950)<<"KAlarmApp::newInstance(): exec\n";
if (args->isSet("mail"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--mail")).arg(TQString::tqfromLatin1("--exec")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--mail")).tqarg(TQString::tqfromLatin1("--exec")))
alMessage = args->getOption("exec");
int n = args->count();
for (int i = 0; i < n; ++i)
@@ -435,7 +435,7 @@ int KAlarmApp::newInstance()
{
TQString addr = TQString::fromLocal8Bit(*i);
if (!KAMail::checkAddress(addr))
- USAGE(i18n("%1: invalid email address").arg(TQString::tqfromLatin1("--mail")))
+ USAGE(i18n("%1: invalid email address").tqarg(TQString::tqfromLatin1("--mail")))
alAddresses += KCal::Person(TQString(), addr);
}
params = args->getOptionList("attach");
@@ -453,13 +453,13 @@ int KAlarmApp::newInstance()
if (action != KAEvent::EMAIL)
{
if (args->isSet("subject"))
- USAGE(i18n("%1 requires %2").arg(TQString::tqfromLatin1("--subject")).arg(TQString::tqfromLatin1("--mail")))
+ USAGE(i18n("%1 requires %2").tqarg(TQString::tqfromLatin1("--subject")).tqarg(TQString::tqfromLatin1("--mail")))
if (args->isSet("from-id"))
- USAGE(i18n("%1 requires %2").arg(TQString::tqfromLatin1("--from-id")).arg(TQString::tqfromLatin1("--mail")))
+ USAGE(i18n("%1 requires %2").tqarg(TQString::tqfromLatin1("--from-id")).tqarg(TQString::tqfromLatin1("--mail")))
if (args->isSet("attach"))
- USAGE(i18n("%1 requires %2").arg(TQString::tqfromLatin1("--attach")).arg(TQString::tqfromLatin1("--mail")))
+ USAGE(i18n("%1 requires %2").tqarg(TQString::tqfromLatin1("--attach")).tqarg(TQString::tqfromLatin1("--mail")))
if (args->isSet("bcc"))
- USAGE(i18n("%1 requires %2").arg(TQString::tqfromLatin1("--bcc")).arg(TQString::tqfromLatin1("--mail")))
+ USAGE(i18n("%1 requires %2").tqarg(TQString::tqfromLatin1("--bcc")).tqarg(TQString::tqfromLatin1("--mail")))
}
bool alarmNoTime = false;
@@ -478,7 +478,7 @@ int KAlarmApp::newInstance()
colourText.tqreplace(0, 2, "#");
bgColour.setNamedColor(colourText);
if (!bgColour.isValid())
- USAGE(i18n("Invalid %1 parameter").arg(TQString::tqfromLatin1("--color")))
+ USAGE(i18n("Invalid %1 parameter").tqarg(TQString::tqfromLatin1("--color")))
}
if (args->isSet("colorfg"))
{
@@ -489,14 +489,14 @@ int KAlarmApp::newInstance()
colourText.tqreplace(0, 2, "#");
fgColour.setNamedColor(colourText);
if (!fgColour.isValid())
- USAGE(i18n("Invalid %1 parameter").arg(TQString::tqfromLatin1("--colorfg")))
+ USAGE(i18n("Invalid %1 parameter").tqarg(TQString::tqfromLatin1("--colorfg")))
}
if (args->isSet("time"))
{
TQCString dateTime = args->getOption("time");
if (!convWakeTime(dateTime, alarmTime, alarmNoTime))
- USAGE(i18n("Invalid %1 parameter").arg(TQString::tqfromLatin1("--time")))
+ USAGE(i18n("Invalid %1 parameter").tqarg(TQString::tqfromLatin1("--time")))
}
else
alarmTime = TQDateTime::tqcurrentDateTime();
@@ -505,9 +505,9 @@ int KAlarmApp::newInstance()
if (haveRecurrence)
{
if (args->isSet("login"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--login")).arg(TQString::tqfromLatin1("--recurrence")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--login")).tqarg(TQString::tqfromLatin1("--recurrence")))
if (args->isSet("until"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--until")).arg(TQString::tqfromLatin1("--recurrence")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--until")).tqarg(TQString::tqfromLatin1("--recurrence")))
TQCString rule = args->getOption("recurrence");
recurrence.set(TQString::fromLocal8Bit(static_cast<const char*>(rule)));
}
@@ -516,24 +516,24 @@ int KAlarmApp::newInstance()
// Repeat count is specified
int count;
if (args->isSet("login"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--login")).arg(TQString::tqfromLatin1("--interval")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--login")).tqarg(TQString::tqfromLatin1("--interval")))
bool ok;
if (args->isSet("repeat"))
{
count = args->getOption("repeat").toInt(&ok);
if (!ok || !count || count < -1 || (count < 0 && haveRecurrence))
- USAGE(i18n("Invalid %1 parameter").arg(TQString::tqfromLatin1("--repeat")))
+ USAGE(i18n("Invalid %1 parameter").tqarg(TQString::tqfromLatin1("--repeat")))
}
else if (haveRecurrence)
- USAGE(i18n("%1 requires %2").arg(TQString::tqfromLatin1("--interval")).arg(TQString::tqfromLatin1("--repeat")))
+ USAGE(i18n("%1 requires %2").tqarg(TQString::tqfromLatin1("--interval")).tqarg(TQString::tqfromLatin1("--repeat")))
else if (args->isSet("until"))
{
count = 0;
TQCString dateTime = args->getOption("until");
if (!convWakeTime(dateTime, endTime, alarmNoTime))
- USAGE(i18n("Invalid %1 parameter").arg(TQString::tqfromLatin1("--until")))
+ USAGE(i18n("Invalid %1 parameter").tqarg(TQString::tqfromLatin1("--until")))
if (endTime < alarmTime)
- USAGE(i18n("%1 earlier than %2").arg(TQString::tqfromLatin1("--until")).arg(TQString::tqfromLatin1("--time")))
+ USAGE(i18n("%1 earlier than %2").tqarg(TQString::tqfromLatin1("--until")).tqarg(TQString::tqfromLatin1("--time")))
}
else
count = -1;
@@ -543,16 +543,16 @@ int KAlarmApp::newInstance()
KARecurrence::Type recurType;
if (!convInterval(args->getOption("interval"), recurType, interval, !haveRecurrence)
|| interval < 0)
- USAGE(i18n("Invalid %1 parameter").arg(TQString::tqfromLatin1("--interval")))
+ USAGE(i18n("Invalid %1 parameter").tqarg(TQString::tqfromLatin1("--interval")))
if (alarmNoTime && recurType == KARecurrence::MINUTELY)
- USAGE(i18n("Invalid %1 parameter for date-only alarm").arg(TQString::tqfromLatin1("--interval")))
+ USAGE(i18n("Invalid %1 parameter for date-only alarm").tqarg(TQString::tqfromLatin1("--interval")))
if (haveRecurrence)
{
// There is a also a recurrence specified, so set up a sub-repetition
int longestInterval = recurrence.longestInterval();
if (count * interval > longestInterval)
- USAGE(i18n("Invalid %1 and %2 parameters: repetition is longer than %3 interval").arg(TQString::tqfromLatin1("--interval")).arg(TQString::tqfromLatin1("--repeat")).arg(TQString::tqfromLatin1("--recurrence")));
+ USAGE(i18n("Invalid %1 and %2 parameters: repetition is longer than %3 interval").tqarg(TQString::tqfromLatin1("--interval")).tqarg(TQString::tqfromLatin1("--repeat")).tqarg(TQString::tqfromLatin1("--recurrence")));
repeatCount = count;
repeatInterval = interval;
}
@@ -566,9 +566,9 @@ int KAlarmApp::newInstance()
else
{
if (args->isSet("repeat"))
- USAGE(i18n("%1 requires %2").arg(TQString::tqfromLatin1("--repeat")).arg(TQString::tqfromLatin1("--interval")))
+ USAGE(i18n("%1 requires %2").tqarg(TQString::tqfromLatin1("--repeat")).tqarg(TQString::tqfromLatin1("--interval")))
if (args->isSet("until"))
- USAGE(i18n("%1 requires %2").arg(TQString::tqfromLatin1("--until")).arg(TQString::tqfromLatin1("--interval")))
+ USAGE(i18n("%1 requires %2").tqarg(TQString::tqfromLatin1("--until")).tqarg(TQString::tqfromLatin1("--interval")))
}
TQCString audioFile;
@@ -582,11 +582,11 @@ int KAlarmApp::newInstance()
{
// Play a sound with the alarm
if (audioRepeat && args->isSet("play"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--play")).arg(TQString::tqfromLatin1("--play-repeat")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--play")).tqarg(TQString::tqfromLatin1("--play-repeat")))
if (args->isSet("beep"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--beep")).arg(TQString::tqfromLatin1(audioRepeat ? "--play-repeat" : "--play")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--beep")).tqarg(TQString::tqfromLatin1(audioRepeat ? "--play-repeat" : "--play")))
if (args->isSet("speak"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--speak")).arg(TQString::tqfromLatin1(audioRepeat ? "--play-repeat" : "--play")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--speak")).tqarg(TQString::tqfromLatin1(audioRepeat ? "--play-repeat" : "--play")))
audioFile = args->getOption(audioRepeat ? "play-repeat" : "play");
#ifndef WITHOUT_ARTS
if (args->isSet("volume"))
@@ -594,21 +594,21 @@ int KAlarmApp::newInstance()
bool ok;
int volumepc = args->getOption("volume").toInt(&ok);
if (!ok || volumepc < 0 || volumepc > 100)
- USAGE(i18n("Invalid %1 parameter").arg(TQString::tqfromLatin1("--volume")))
+ USAGE(i18n("Invalid %1 parameter").tqarg(TQString::tqfromLatin1("--volume")))
audioVolume = static_cast<float>(volumepc) / 100;
}
#endif
}
#ifndef WITHOUT_ARTS
else if (args->isSet("volume"))
- USAGE(i18n("%1 requires %2 or %3").arg(TQString::tqfromLatin1("--volume")).arg(TQString::tqfromLatin1("--play")).arg(TQString::tqfromLatin1("--play-repeat")))
+ USAGE(i18n("%1 requires %2 or %3").tqarg(TQString::tqfromLatin1("--volume")).tqarg(TQString::tqfromLatin1("--play")).tqarg(TQString::tqfromLatin1("--play-repeat")))
#endif
if (args->isSet("speak"))
{
if (args->isSet("beep"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--beep")).arg(TQString::tqfromLatin1("--speak")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--beep")).tqarg(TQString::tqfromLatin1("--speak")))
if (!mSpeechEnabled)
- USAGE(i18n("%1 requires speech synthesis to be configured using KTTSD").arg(TQString::tqfromLatin1("--speak")))
+ USAGE(i18n("%1 requires speech synthesis to be configured using KTTSD").tqarg(TQString::tqfromLatin1("--speak")))
}
int reminderMinutes = 0;
bool onceOnly = args->isSet("reminder-once");
@@ -616,18 +616,18 @@ int KAlarmApp::newInstance()
{
// Issue a reminder alarm in advance of the main alarm
if (onceOnly && args->isSet("reminder"))
- USAGE(i18n("%1 incompatible with %2").arg(TQString::tqfromLatin1("--reminder")).arg(TQString::tqfromLatin1("--reminder-once")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(TQString::tqfromLatin1("--reminder")).tqarg(TQString::tqfromLatin1("--reminder-once")))
TQString opt = onceOnly ? TQString::tqfromLatin1("--reminder-once") : TQString::tqfromLatin1("--reminder");
if (args->isSet("exec"))
- USAGE(i18n("%1 incompatible with %2").arg(opt).arg(TQString::tqfromLatin1("--exec")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(opt).tqarg(TQString::tqfromLatin1("--exec")))
if (args->isSet("mail"))
- USAGE(i18n("%1 incompatible with %2").arg(opt).arg(TQString::tqfromLatin1("--mail")))
+ USAGE(i18n("%1 incompatible with %2").tqarg(opt).tqarg(TQString::tqfromLatin1("--mail")))
KARecurrence::Type recurType;
TQString optval = args->getOption(onceOnly ? "reminder-once" : "reminder");
if (!convInterval(args->getOption(onceOnly ? "reminder-once" : "reminder"), recurType, reminderMinutes))
- USAGE(i18n("Invalid %1 parameter").arg(opt))
+ USAGE(i18n("Invalid %1 parameter").tqarg(opt))
if (recurType == KARecurrence::MINUTELY && alarmNoTime)
- USAGE(i18n("Invalid %1 parameter for date-only alarm").arg(opt))
+ USAGE(i18n("Invalid %1 parameter for date-only alarm").tqarg(opt))
}
int lateCancel = 0;
@@ -636,10 +636,10 @@ int KAlarmApp::newInstance()
KARecurrence::Type recurType;
bool ok = convInterval(args->getOption("late-cancel"), recurType, lateCancel);
if (!ok || lateCancel <= 0)
- USAGE(i18n("Invalid %1 parameter").arg(TQString::tqfromLatin1("late-cancel")))
+ USAGE(i18n("Invalid %1 parameter").tqarg(TQString::tqfromLatin1("late-cancel")))
}
else if (args->isSet("auto-close"))
- USAGE(i18n("%1 requires %2").arg(TQString::tqfromLatin1("--auto-close")).arg(TQString::tqfromLatin1("--late-cancel")))
+ USAGE(i18n("%1 requires %2").tqarg(TQString::tqfromLatin1("--auto-close")).tqarg(TQString::tqfromLatin1("--late-cancel")))
int flags = KAEvent::DEFAULT_FONT;
if (args->isSet("ack-confirm"))
@@ -728,7 +728,7 @@ int KAlarmApp::newInstance()
#endif
if (!usage.isEmpty())
{
- usage += i18n(": option(s) only valid with a message/%1/%2").arg(TQString::tqfromLatin1("--file")).arg(TQString::tqfromLatin1("--exec"));
+ usage += i18n(": option(s) only valid with a message/%1/%2").tqarg(TQString::tqfromLatin1("--file")).tqarg(TQString::tqfromLatin1("--exec"));
break;
}
@@ -1759,7 +1759,7 @@ ShellProcess* KAlarmApp::doShellCommand(const TQString& command, const KAEvent&
// Set up a logging process to write the command's output to.
connect(proc, TQT_SIGNAL(receivedStdout(KProcess*,char*,int)), TQT_SLOT(slotCommandOutput(KProcess*,char*,int)));
connect(proc, TQT_SIGNAL(receivedStderr(KProcess*,char*,int)), TQT_SLOT(slotCommandOutput(KProcess*,char*,int)));
- logproc = new ShellProcess(TQString::tqfromLatin1("cat >>%1").arg(event.logFile()));
+ logproc = new ShellProcess(TQString::tqfromLatin1("cat >>%1").tqarg(event.logFile()));
connect(logproc, TQT_SIGNAL(shellExited(ShellProcess*)), TQT_SLOT(slotLogProcExited(ShellProcess*)));
logproc->start(KProcess::Stdin);
TQCString heading;