|
|
|
@ -49,12 +49,8 @@ bool shutting=false;
|
|
|
|
|
|
|
|
|
|
MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const char * name, WFlags f ) : ResizableDragWidget ( parent,name,f ), stand_alone(tren)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tray=0;
|
|
|
|
|
|
|
|
|
|
nresize=false;
|
|
|
|
|
|
|
|
|
|
display=tqt_xdisplay();
|
|
|
|
|
|
|
|
|
|
//TQString k1= "`1234567890-=";
|
|
|
|
@ -500,7 +496,8 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const
|
|
|
|
|
min->res();
|
|
|
|
|
connect ( min, TQT_SIGNAL ( keyClick ( unsigned int ) ), this, TQT_SLOT ( keyPress ( unsigned int ) ) );
|
|
|
|
|
|
|
|
|
|
if (!stand_alone){
|
|
|
|
|
if (!stand_alone)
|
|
|
|
|
{
|
|
|
|
|
tray = new KbdTray ( this );
|
|
|
|
|
tray->setPixmap ( UserIcon ( "tray" ) );
|
|
|
|
|
|
|
|
|
@ -521,8 +518,8 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const
|
|
|
|
|
m->setItemChecked(mnu_dock, show_dock);
|
|
|
|
|
|
|
|
|
|
mnu_lock = m->insertItem(i18n("Lock on screen"), this, TQT_SLOT(toggleLock()));
|
|
|
|
|
bool is_locked = cfg->readBoolEntry("locked", false);
|
|
|
|
|
m->setItemChecked(mnu_lock, is_locked);
|
|
|
|
|
locked = cfg->readBoolEntry("locked", false);
|
|
|
|
|
m->setItemChecked(mnu_lock, locked);
|
|
|
|
|
|
|
|
|
|
//m->insertItem("Configure", this, TQT_SLOT(config()));
|
|
|
|
|
m->insertSeparator();
|
|
|
|
@ -530,20 +527,21 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const
|
|
|
|
|
|
|
|
|
|
tray->show();
|
|
|
|
|
|
|
|
|
|
dock = new KbdDock ( this );
|
|
|
|
|
if (show_dock){
|
|
|
|
|
TQFont fnt = cfg->readFontEntry("KvkbdFont");
|
|
|
|
|
m->setItemChecked(mnu_autores, fnt_autores);
|
|
|
|
|
setFont(fnt);
|
|
|
|
|
|
|
|
|
|
dock = new KbdDock(this);
|
|
|
|
|
if (show_dock)
|
|
|
|
|
{
|
|
|
|
|
dock->show();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dock->hide();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQFont fnt = cfg->readFontEntry("KvkbdFont");
|
|
|
|
|
m->setItemChecked(mnu_autores, fnt_autores);
|
|
|
|
|
|
|
|
|
|
setFont(fnt);
|
|
|
|
|
tray->contextMenu()->setItemChecked(mnu_lock, locked);
|
|
|
|
|
|
|
|
|
|
popup_menu = new VButton ( this,"popupmenu" );
|
|
|
|
|
popup_menu->resize ( 15,30 );
|
|
|
|
@ -555,16 +553,13 @@ MainWidget::MainWidget ( TDEAboutData *about, bool tren, TQWidget *parent, const
|
|
|
|
|
|
|
|
|
|
other_keys.append(popup_menu);
|
|
|
|
|
connect ( popup_menu,TQT_SIGNAL ( clicked() ),this, TQT_SLOT ( showConfigMenu() ) );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
setCaption("kvkbdalone");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWidget::finishInit()
|
|
|
|
|
{
|
|
|
|
|
TDEConfig *cfg = TDEApplication::kApplication()->config();
|
|
|
|
@ -576,6 +571,7 @@ void MainWidget::finishInit()
|
|
|
|
|
hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MainWidget::close(bool alsoDelete)
|
|
|
|
|
{
|
|
|
|
|
shutting=true;
|
|
|
|
@ -741,13 +737,11 @@ void MainWidget::quitClicked()
|
|
|
|
|
|
|
|
|
|
void MainWidget::toggleLock()
|
|
|
|
|
{
|
|
|
|
|
bool c = isLocked();
|
|
|
|
|
|
|
|
|
|
tray->contextMenu()->setItemChecked(mnu_lock, !c);
|
|
|
|
|
setLocked(!c);
|
|
|
|
|
locked = !locked;
|
|
|
|
|
tray->contextMenu()->setItemChecked(mnu_lock, locked);
|
|
|
|
|
|
|
|
|
|
TDEConfig *cfg = TDEApplication::kApplication()->config();
|
|
|
|
|
cfg->writeEntry("locked", !c);
|
|
|
|
|
cfg->writeEntry("locked", locked);
|
|
|
|
|
cfg->sync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|