summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/commandeditdialog.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/commandeditdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/commandeditdialog.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/core/apps/embeddedkonsole/commandeditdialog.cpp b/core/apps/embeddedkonsole/commandeditdialog.cpp
index 697bf72..1e08767 100644
--- a/core/apps/embeddedkonsole/commandeditdialog.cpp
+++ b/core/apps/embeddedkonsole/commandeditdialog.cpp
@@ -1,30 +1,34 @@
1//comandeditdialog.cpp 1//comandeditdialog.cpp
2 2
3#include "commandeditdialog.h" 3#include "commandeditdialog.h"
4#include "playlistselection.h" 4#include "playlistselection.h"
5
6#include <opie2/oresource.h>
7
5#include <qpe/config.h> 8#include <qpe/config.h>
6#include <qpe/resource.h> 9
10#include <qapplication.h>
7#include <qtoolbutton.h> 11#include <qtoolbutton.h>
8#include <qlineedit.h> 12#include <qlineedit.h>
9#include <qheader.h> 13#include <qheader.h>
10#include <qlabel.h> 14#include <qlabel.h>
11#include "smallcommandeditdialogbase.h" 15#include "smallcommandeditdialogbase.h"
12 16
13CommandEditDialog::CommandEditDialog(QWidget *parent, const char* name, WFlags fl ) 17CommandEditDialog::CommandEditDialog(QWidget *parent, const char* name, WFlags fl )
14 : CommandEditDialogBase(parent, name, TRUE, fl) 18 : CommandEditDialogBase(parent, name, TRUE, fl)
15 19
16{ 20{
17 m_SuggestedCommandList->addColumn( tr("Command Selection") ); 21 m_SuggestedCommandList->addColumn( tr("Command Selection") );
18 m_SuggestedCommandList->header()->hide(); 22 m_SuggestedCommandList->header()->hide();
19 m_SuggestedCommandList->setSorting(-1,FALSE); 23 m_SuggestedCommandList->setSorting(-1,FALSE);
20 m_SuggestedCommandList->clearSelection(); 24 m_SuggestedCommandList->clearSelection();
21 m_SuggestedCommandList->setSorting(0,TRUE); 25 m_SuggestedCommandList->setSorting(0,TRUE);
22 QListViewItem *item; 26 QListViewItem *item;
23 item = new QListViewItem( m_SuggestedCommandList,"export "); 27 item = new QListViewItem( m_SuggestedCommandList,"export ");
24 item = new QListViewItem( m_SuggestedCommandList,"ifconfig "); 28 item = new QListViewItem( m_SuggestedCommandList,"ifconfig ");
25 item = new QListViewItem( m_SuggestedCommandList,"ipkg "); 29 item = new QListViewItem( m_SuggestedCommandList,"ipkg ");
26 item = new QListViewItem( m_SuggestedCommandList,"gzip "); 30 item = new QListViewItem( m_SuggestedCommandList,"gzip ");
27 item = new QListViewItem( m_SuggestedCommandList,"gunzip "); 31 item = new QListViewItem( m_SuggestedCommandList,"gunzip ");
28 item = new QListViewItem( m_SuggestedCommandList,"chgrp "); 32 item = new QListViewItem( m_SuggestedCommandList,"chgrp ");
29 item = new QListViewItem( m_SuggestedCommandList,"chown "); 33 item = new QListViewItem( m_SuggestedCommandList,"chown ");
30 item = new QListViewItem( m_SuggestedCommandList,"date "); 34 item = new QListViewItem( m_SuggestedCommandList,"date ");
@@ -32,76 +36,81 @@ CommandEditDialog::CommandEditDialog(QWidget *parent, const char* name, WFlags f
32 item = new QListViewItem( m_SuggestedCommandList,"dmesg "); 36 item = new QListViewItem( m_SuggestedCommandList,"dmesg ");
33 item = new QListViewItem( m_SuggestedCommandList,"fuser "); 37 item = new QListViewItem( m_SuggestedCommandList,"fuser ");
34 item = new QListViewItem( m_SuggestedCommandList,"hostname "); 38 item = new QListViewItem( m_SuggestedCommandList,"hostname ");
35 item = new QListViewItem( m_SuggestedCommandList,"kill "); 39 item = new QListViewItem( m_SuggestedCommandList,"kill ");
36 item = new QListViewItem( m_SuggestedCommandList,"killall "); 40 item = new QListViewItem( m_SuggestedCommandList,"killall ");
37 item = new QListViewItem( m_SuggestedCommandList,"ln "); 41 item = new QListViewItem( m_SuggestedCommandList,"ln ");
38 item = new QListViewItem( m_SuggestedCommandList,"ln -s "); 42 item = new QListViewItem( m_SuggestedCommandList,"ln -s ");
39 item = new QListViewItem( m_SuggestedCommandList,"lsmod"); 43 item = new QListViewItem( m_SuggestedCommandList,"lsmod");
40 item = new QListViewItem( m_SuggestedCommandList,"depmod -a"); 44 item = new QListViewItem( m_SuggestedCommandList,"depmod -a");
41 item = new QListViewItem( m_SuggestedCommandList,"modprobe "); 45 item = new QListViewItem( m_SuggestedCommandList,"modprobe ");
42 item = new QListViewItem( m_SuggestedCommandList,"mount "); 46 item = new QListViewItem( m_SuggestedCommandList,"mount ");
43 item = new QListViewItem( m_SuggestedCommandList,"more "); 47 item = new QListViewItem( m_SuggestedCommandList,"more ");
44 item = new QListViewItem( m_SuggestedCommandList,"sort "); 48 item = new QListViewItem( m_SuggestedCommandList,"sort ");
45 item = new QListViewItem( m_SuggestedCommandList,"touch "); 49 item = new QListViewItem( m_SuggestedCommandList,"touch ");
46 item = new QListViewItem( m_SuggestedCommandList,"umount "); 50 item = new QListViewItem( m_SuggestedCommandList,"umount ");
47 item = new QListViewItem( m_SuggestedCommandList,"mknod "); 51 item = new QListViewItem( m_SuggestedCommandList,"mknod ");
48 item = new QListViewItem( m_SuggestedCommandList,"netstat "); 52 item = new QListViewItem( m_SuggestedCommandList,"netstat ");
49 item = new QListViewItem( m_SuggestedCommandList,"route "); 53 item = new QListViewItem( m_SuggestedCommandList,"route ");
50 item = new QListViewItem( m_SuggestedCommandList,"cardctl eject "); 54 item = new QListViewItem( m_SuggestedCommandList,"cardctl eject ");
51 m_SuggestedCommandList->setSelected(m_SuggestedCommandList->firstChild(),TRUE); 55 m_SuggestedCommandList->setSelected(m_SuggestedCommandList->firstChild(),TRUE);
52 m_SuggestedCommandList->sort(); 56 m_SuggestedCommandList->sort();
53 57
54 connect( m_SuggestedCommandList, SIGNAL( clicked(QListViewItem*) ), m_PlayListSelection, SLOT( addToSelection(QListViewItem*) ) ); 58 connect( m_SuggestedCommandList, SIGNAL( clicked(QListViewItem*) ), m_PlayListSelection, SLOT( addToSelection(QListViewItem*) ) );
55 59
56 60 bool bigPixmaps = qApp->desktop()->size().width()>330;
57 61
58 ToolButton1->setTextLabel("new"); 62 ToolButton1->setTextLabel("new");
59 ToolButton1->setPixmap(Resource::loadPixmap("new")); 63 ToolButton1->setUsesBigPixmap( bigPixmaps );
64 ToolButton1->setPixmap( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ) );
60 ToolButton1->setAutoRaise(TRUE); 65 ToolButton1->setAutoRaise(TRUE);
61 ToolButton1->setFocusPolicy(QWidget::NoFocus); 66 ToolButton1->setFocusPolicy(QWidget::NoFocus);
62 connect(ToolButton1,SIGNAL(clicked()),this,SLOT(showAddDialog())); 67 connect(ToolButton1,SIGNAL(clicked()),this,SLOT(showAddDialog()));
63 68
64 ToolButton2->setTextLabel("edit"); 69 ToolButton2->setTextLabel("edit");
65 ToolButton2->setPixmap(Resource::loadPixmap("edit")); 70 ToolButton2->setUsesBigPixmap( bigPixmaps );
71 ToolButton2->setPixmap( Opie::Core::OResource::loadPixmap( "edit", Opie::Core::OResource::SmallIcon ) );
66 ToolButton2->setAutoRaise(TRUE); 72 ToolButton2->setAutoRaise(TRUE);
67 ToolButton2->setFocusPolicy(QWidget::NoFocus); 73 ToolButton2->setFocusPolicy(QWidget::NoFocus);
68 connect(ToolButton2,SIGNAL(clicked()),this,SLOT(showEditDialog())); 74 connect(ToolButton2,SIGNAL(clicked()),this,SLOT(showEditDialog()));
69 75
70 ToolButton3->setTextLabel("delete"); 76 ToolButton3->setTextLabel("delete");
71 ToolButton3->setPixmap(Resource::loadPixmap("editdelete")); 77 ToolButton3->setUsesBigPixmap( bigPixmaps );
78 ToolButton3->setPixmap( Opie::Core::OResource::loadPixmap( "editdelete", Opie::Core::OResource::SmallIcon ) );
72 ToolButton3->setAutoRaise(TRUE); 79 ToolButton3->setAutoRaise(TRUE);
73 ToolButton3->setFocusPolicy(QWidget::NoFocus); 80 ToolButton3->setFocusPolicy(QWidget::NoFocus);
74 connect(ToolButton3,SIGNAL(clicked()),m_PlayListSelection,SLOT(removeSelected())); 81 connect(ToolButton3,SIGNAL(clicked()),m_PlayListSelection,SLOT(removeSelected()));
75 82
76 ToolButton4->setTextLabel("up"); 83 ToolButton4->setTextLabel("up");
77 ToolButton4->setPixmap(Resource::loadPixmap("up")); 84 ToolButton4->setUsesBigPixmap( bigPixmaps );
85 ToolButton4->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) );
78 ToolButton4->setAutoRaise(TRUE); 86 ToolButton4->setAutoRaise(TRUE);
79 ToolButton4->setFocusPolicy(QWidget::NoFocus); 87 ToolButton4->setFocusPolicy(QWidget::NoFocus);
80 connect(ToolButton4,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedUp())); 88 connect(ToolButton4,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedUp()));
81 89
82 ToolButton5->setTextLabel("down"); 90 ToolButton5->setTextLabel("down");
83 ToolButton5->setPixmap(Resource::loadPixmap("down")); 91 ToolButton5->setUsesBigPixmap( bigPixmaps );
92 ToolButton5->setPixmap( Opie::Core::OResource::loadPixmap( "down", Opie::Core::OResource::SmallIcon ) );
84 ToolButton5->setAutoRaise(TRUE); 93 ToolButton5->setAutoRaise(TRUE);
85 ToolButton5->setFocusPolicy(QWidget::NoFocus); 94 ToolButton5->setFocusPolicy(QWidget::NoFocus);
86 95
87connect(ToolButton5,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedDown())); 96connect(ToolButton5,SIGNAL(clicked()),m_PlayListSelection,SLOT(moveSelectedDown()));
88 97
89 98
90 99
91 100
92 QListViewItem *current = m_SuggestedCommandList->selectedItem(); 101 QListViewItem *current = m_SuggestedCommandList->selectedItem();
93 if ( current ) 102 if ( current )
94 item->moveItem( current ); 103 item->moveItem( current );
95 m_SuggestedCommandList->setSelected( item, TRUE ); 104 m_SuggestedCommandList->setSelected( item, TRUE );
96 m_SuggestedCommandList->ensureItemVisible( m_SuggestedCommandList->selectedItem() ); 105 m_SuggestedCommandList->ensureItemVisible( m_SuggestedCommandList->selectedItem() );
97 Config cfg( "Konsole" ); 106 Config cfg( "Konsole" );
98 cfg.setGroup("Commands"); 107 cfg.setGroup("Commands");
99 if (cfg.readEntry("Commands Set","FALSE") == "TRUE") { 108 if (cfg.readEntry("Commands Set","FALSE") == "TRUE") {
100 for (int i = 0; i < 100; i++) { 109 for (int i = 0; i < 100; i++) {
101 QString tmp; 110 QString tmp;
102 tmp = cfg.readEntry( QString::number(i),""); 111 tmp = cfg.readEntry( QString::number(i),"");
103 if (!tmp.isEmpty()) 112 if (!tmp.isEmpty())
104 m_PlayListSelection->addStringToSelection(tmp); 113 m_PlayListSelection->addStringToSelection(tmp);
105 } 114 }
106 } else { 115 } else {
107 116