25 #include <tdeglobal.h>
26 #include <tdelocale.h>
27 #include <kiconloader.h>
28 #include <tdemenubar.h>
29 #include <kkeydialog.h>
31 #include <tdeconfig.h>
33 #include <tdemessagebox.h>
34 #include <kstandarddirs.h>
35 #include <kedittoolbar.h>
38 #include <tdestdaccel.h>
39 #include <tdeaction.h>
40 #include <kstdaction.h>
42 #include <tqpushbutton.h>
44 #include "mobilegui.h"
46 #include "mobilemain.h"
47 #include <kstatusbar.h>
48 #include "mobilemain.moc"
51 : TDEMainWindow( 0,
"MobileMain" )
53 mView =
new MobileGui(scheduler, prefs,
this);
54 setCentralWidget(mView);
57 statusBar()->insertItem(i18n(
" Disconnected "),1,0,
true);
58 connect(mView,TQ_SIGNAL(statusMessage(
const TQString &)),
59 TQ_SLOT(showStatusMessage(
const TQString &)));
60 connect(mView,TQ_SIGNAL(transienStatusMessage(
const TQString &)),
61 TQ_SLOT(showTransienStatusMessage(
const TQString &)));
65 setAutoSaveSettings();
72 void MobileMain::setupActions()
74 KStdAction::quit(
this, TQ_SLOT(close()), actionCollection());
76 new TDEAction(i18n(
"Terminal"),0,
this,TQ_SLOT(showTerminal()),
77 actionCollection(),
"show_terminal");
79 createStandardStatusBarAction();
80 setStandardToolBarMenuEnabled(
true);
82 KStdAction::keyBindings(
this, TQ_SLOT(optionsConfigureKeys()), actionCollection());
83 KStdAction::configureToolbars(
this, TQ_SLOT(optionsConfigureToolbars()), actionCollection());
84 KStdAction::preferences(
this, TQ_SLOT(optionsPreferences()), actionCollection());
86 createGUI(
"kandymobileui.rc");
107 TDEMainWindow::dragEnterEvent(event);
113 void MobileMain::dropEvent(TQDropEvent *event)
120 TDEMainWindow::dropEvent(event);
123 void MobileMain::optionsConfigureKeys()
125 KKeyDialog::configure( actionCollection(),
this );
128 void MobileMain::optionsConfigureToolbars()
131 saveMainWindowSettings( TDEGlobal::config(), autoSaveGroup() );
132 KEditToolbar dlg(actionCollection());
133 connect(&dlg, TQ_SIGNAL(newToolbarConfig()),
this, TQ_SLOT(newToolbarConfig()));
137 void MobileMain::newToolbarConfig()
140 createGUI(
"kandymobileui.rc");
141 applyMainWindowSettings( TDEGlobal::config(), autoSaveGroup() );
144 void MobileMain::optionsPreferences()
146 emit showPreferencesWin();
149 void MobileMain::showStatusMessage(
const TQString& text)
152 statusBar()->message(text);
155 void MobileMain::showTransienStatusMessage(
const TQString& text)
158 statusBar()->message(text,2000);
161 void MobileMain::changeCaption(
const TQString& text)
167 bool MobileMain::queryClose()
170 if (m_view->isModified()) {
171 switch (KMessageBox::warningYesNoCancel(
this,
172 i18n(
"Save changes to profile %1?").arg(mFilename))) {
173 case KMessageBox::Yes :
176 case KMessageBox::No :
188 void MobileMain::showTerminal()
190 emit showTerminalWin();
virtual ~MobileMain()
Default Destructor.
void saveProperties(TDEConfig *)
This function is called when it is time for the app to save its properties for session management pur...
void readProperties(TDEConfig *)
This function is called when this app is restored.
MobileMain(CommandScheduler *, KandyPrefs *prefs)
Default Constructor.
virtual void dragEnterEvent(TQDragEnterEvent *event)
Overridden virtuals for TQt drag 'n drop (XDND)