25 #include "ui_mainwindow.h"
30 #include <KApplication>
35 #include <KMessageBox>
36 #include <KPushButton>
37 #include <KShortcutsDialog>
38 #include <KStandardAction>
40 #include <KXMLGUIFactory>
41 #include <KActionCollection>
65 delete m_ui->treeWidget;
66 m_ui->treeWidget=
new TaskView(m_ui->centralwidget);
67 ((
TaskView *) m_ui->treeWidget)->load(icsfile);
68 this->setWindowTitle(QString(icsfile));
69 m_ui->gridLayout->addWidget(m_ui->treeWidget, 1, 0, 1, 1);
70 m_ui->treeWidget->hide();
71 m_ui->treeWidget->show();
72 m_ui->ktreewidgetsearchline->show();
73 m_ui->toolBar->addAction(KIcon(
"document-new"),
"New Task",
this,SLOT(
newtask()));
74 m_ui->toolBar->addAction(KIcon(
"subtask-new-ktimetracker"),
"New Subtask");
75 m_ui->toolBar->addAction(KIcon(
"media-playback-start"),
"Start");
76 m_ui->toolBar->addAction(KIcon(
"media-playback-stop"),
"Stop");
77 m_ui->toolBar->addAction(KIcon(
"edit-delete"),
"Delete");
78 m_ui->toolBar->addAction(KIcon(
"document-properties"),
"Edit");
79 setWindowFlags( windowFlags() | Qt::WindowContextHelpButtonHint );
108 ((
TaskView*) m_ui->treeWidget)->newTask();
113 kDebug(5970) <<
"Entering function";
121 ((
TaskView*) m_ui->treeWidget)->reconfigure();
125 void MainWindow::setupActions()
127 configureAction =
new KAction(
this);
128 configureAction->setText(i18n(
"Configure KTimeTracker..."));
134 statusBar()->showMessage(i18n(qs.toUtf8()));
139 kDebug(5970) <<
"MainWindow::~MainWindows: Quitting ktimetracker.";
148 void MainWindow::makeMenus()
154 actionKeyBindings->setToolTip( i18n(
"Configure key bindings" ) );
155 actionKeyBindings->setWhatsThis( i18n(
"This will let you configure key"
156 "bindings which are specific to ktimetracker" ) );
164 KConfigGroup config = KGlobal::config()->group( QString::fromLatin1(
"Main Window Geometry") );
165 int w = config.readEntry( QString::fromLatin1(
"Width"), 100 );
166 int h = config.readEntry( QString::fromLatin1(
"Height"), 100 );
167 w = qMax( w, sizeHint().width() );
168 h = qMax( h, sizeHint().height() );
176 KConfigGroup config = KGlobal::config()->group( QString::fromLatin1(
"Main Window Geometry") );
177 config.writeEntry( QString::fromLatin1(
"Width"), width());
178 config.writeEntry( QString::fromLatin1(
"Height"), height());
192 #include "mainwindow.moc"
void on_actionConfigure_ktimetracker_triggered()
void on_actionQuit_triggered()
void showSettingsDialog()
void setStatusBar(const QString &)
MainWindow(const QString &icsfile="")
static bool configPDA()
Get configPDA.
QString icsfile(const KCmdLineArgs *args)
Container and interface for the tasks.
Main window to tie the application together.