1 /***************************************************************************
2 * Copyright (C) 2005 by The Quassel Team *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
24 #include "channelwidget.h"
25 #include "serverlist.h"
27 MainWin::MainWin() : QMainWindow() {
29 setWindowTitle("Quassel IRC");
30 setWindowIcon(QIcon(":/default/tux.png"));
31 setWindowIconText("Quassel IRC");
32 workspace = new QWorkspace(this);
33 setCentralWidget(workspace);
34 ChannelWidget *cw = new ChannelWidget(this);
35 workspace->addWindow(cw);
36 //setCentralWidget(cw);
37 serverListDlg = new ServerListDlg(this);
38 serverListDlg->setVisible(serverListDlg->showOnStartup());
42 statusBar()->showMessage(tr("Ready"));
46 void MainWin::setupMenus() {
47 fileMenu = menuBar()->addMenu(tr("&File"));
48 serverListAct = fileMenu->addAction(QIcon(":/default/server.png"), tr("&Server List..."), this, SLOT(showServerList()), tr("F7"));
49 fileMenu->addSeparator();
50 quitAct = fileMenu->addAction(QIcon(":/default/exit.png"), tr("&Quit"), qApp, SLOT(quit()), tr("CTRL+Q"));
52 editMenu = menuBar()->addMenu(tr("&Edit"));
53 editMenu->setEnabled(0);
55 ircMenu = menuBar()->addMenu(tr("&IRC"));
56 ircMenu->setEnabled(0);
58 serverMenu = menuBar()->addMenu(tr("Ser&ver"));
59 serverMenu->setEnabled(0);
61 windowMenu = menuBar()->addMenu(tr("&Window"));
62 windowMenu->setEnabled(0);
64 settingsMenu = menuBar()->addMenu(tr("&Settings"));
65 identitiesAct = settingsMenu->addAction(QIcon(":/default/identity.png"), tr("&Identities..."), serverListDlg, SLOT(editIdentities()));
66 settingsMenu->addSeparator();
67 configAct = settingsMenu->addAction(QIcon(":/default/configure.png"), tr("&Configure Quassel..."));
68 configAct->setEnabled(0);
70 helpMenu = menuBar()->addMenu(tr("&Help"));
71 aboutAct = helpMenu->addAction(tr("&About"));
72 aboutAct->setEnabled(0);
73 aboutQtAct = helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
76 //toolBar = new QToolBar("Test", this);
77 //toolBar->addAction(identitiesAct);
78 //addToolBar(Qt::TopToolBarArea, toolBar);
81 void MainWin::showServerList() {
82 // if(!serverListDlg) {
83 // serverListDlg = new ServerListDlg(this);
85 serverListDlg->show();