diff --git a/include/konsole.h b/include/konsole.h index 8cb11f78..edd26d5b 100644 --- a/include/konsole.h +++ b/include/konsole.h @@ -35,10 +35,6 @@ #define PACKAGE "konsole" #define VERSION "0.9.15" -class QDragEnterEvent; -class QDropEvent; - -class KAccel; class KRootPixmap; class Konsole : public KTMainWindow @@ -53,10 +49,7 @@ public: private slots: void configureRequest(TEWidget*,int,int,int); - -// void scrollbar_menu_activated(int item); void activateSession(); - void doneSession(TESession*,int); void opt_menu_activated(int item); void schema_menu_activated(int item); @@ -79,9 +72,6 @@ protected: void saveGlobalProperties(KConfig* config); void readGlobalProperties(KConfig* config); - // Dnd - //void dragEnterEvent(QDragEnterEvent* event); - private slots: void setSchema(int n); @@ -133,19 +123,14 @@ private: KMenuBar* menubar; KStatusBar* statusbar; - KAccel* accel; QPopupMenu* m_file; QPopupMenu* m_sessions; QPopupMenu* m_options; - // QPopupMenu* m_scrollbar; - // QPopupMenu* m_font; QPopupMenu* m_schema; QPopupMenu* m_keytab; QPopupMenu* m_codec; - // QPopupMenu* m_size; - QPopupMenu* m_drop; -// + KToggleAction *showToolbar; bool b_toolbarvis; KToggleAction *showMenubar; diff --git a/src/konsole.C b/src/konsole.C index ecdd6081..6000c5b3 100644 --- a/src/konsole.C +++ b/src/konsole.C @@ -61,7 +61,6 @@ #include #include -//#include #include #include #include @@ -252,9 +251,9 @@ void Konsole::makeMenu() m_sessions->setCheckable(TRUE); m_sessions->insertItem( i18n("Send Signal"), m_signals ); - KAction *act = new KAction(i18n("Rename session..."), 0, this, + KAction *renameSession = new KAction(i18n("Rename session..."), 0, this, SLOT(slotRenameSession()), this); - act->plug(m_sessions); + renameSession->plug(m_sessions); m_sessions->insertSeparator(); @@ -272,6 +271,10 @@ void Konsole::makeMenu() m_codec->setItemChecked(1,TRUE); m_options = new QPopupMenu(this); + // insert the rename schema here too, because they will not find it + // on shift right click + renameSession->plug(m_options); + m_options->insertSeparator(); // Menubar on/off showMenubar = KStdAction::showMenubar(this, SLOT(slotToggleMenubar())); showMenubar->plug(m_options); @@ -281,7 +284,8 @@ void Konsole::makeMenu() // Frame on/off showFrame = new KToggleAction(i18n("Show &frame"), 0, this, SLOT(slotToggleFrame()), this); - showFrame->plug(m_options);; + showFrame->plug(m_options); + // Scrollbar selectScrollbar = new KSelectAction(i18n("Scrollbar"), 0, this, SLOT(slotSelectScrollbar()), this); @@ -344,14 +348,6 @@ void Konsole::makeMenu() QPopupMenu* m_help = helpMenu(aboutAuthor, false); m_help->insertItem( i18n("&Technical Reference ..."), this, SLOT(tecRef()), 0, -1, 1); - /* - // Popup menu for drag & drop - m_drop = new QPopupMenu; - m_drop->insertItem( i18n("Paste"), 0); - m_drop->insertItem( i18n("cd"), 1); - connect(m_drop, SIGNAL(activated(int)), SLOT(drop_menu_activated(int))); - */ - m_options->installEventFilter( this ); @@ -465,6 +461,8 @@ void Konsole::readProperties(KConfig* config) b_toolbarvis = config->readBoolEntry("toolbar visible",TRUE); b_scroll = config->readBoolEntry("history",TRUE); + setHistory(b_scroll); + int n2_keytab = config->readNumEntry("keytab",0); keytab_menu_activated(n2_keytab); // act. the keytab for this session @@ -796,11 +794,19 @@ void Konsole::addSession(TESession* s) session_no += 1; // create an action for the session QString title = i18n("%1 No %2").arg(s->Title()).arg(session_no); - char buffer[30]; - sprintf(buffer,"%d",session_no); - KRadioAction *ra = new KRadioAction(title, "openterm", 0, this, SLOT(activateSession()), this, buffer); + // char buffer[30]; + // int acc = CTRL+SHIFT+Key_0+session_no; + KRadioAction *ra = new KRadioAction(title, + "openterm", + 0, + this, + SLOT(activateSession()), + this); + // buffer); ra->setExclusiveGroup("sessions"); ra->setChecked(true); + // key accelerator + // accel->connectItem(accel->insertItem(acc), ra, SLOT(activate())); action2session.insert(ra, s); session2action.insert(s,ra); @@ -838,6 +844,8 @@ void Konsole::activateSession() ColorSchema* schema = ColorSchema::find(s->schemaNo()); if (schema->usetransparency) { setSchema(schema); + // ??? + repaint(); } s->setConnect(TRUE); } @@ -1040,6 +1048,7 @@ void Konsole::slotRenameSession() { KLineEditDlg dlg(i18n("Session name"),name, this); if (dlg.exec()) { ra->setText(dlg.text()); + ra->setIcon("openterm"); // I don't know why it is needed here toolBar()->updateRects(); } }